commit 42226c989789d8da4af1de0c31070c96726d990c Author: Linus Torvalds Date: Sun May 15 18:08:58 2022 -0700 Linux 5.18-rc7 Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0cdd776ec92c0fec768c7079331804d3e52d4b27 Merge: 5becde60ed4e 575f00edea0a Author: Linus Torvalds Date: Sun May 15 08:08:51 2022 -0700 Merge tag 'driver-core-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core fixes from Greg KH: "Here is one fix, and three documentation updates for 5.18-rc7. The fix is for the firmware loader which resolves a long-reported problem where the credentials of the firmware loader could be set to a userspace process without enough permissions to actually load the firmware image. Many Android vendors have been reporting this for quite some time. The documentation updates are for the embargoed-hardware-issues.rst file to add a new entry, change an existing one, and sort the list to make changes easier in the future. All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: Documentation/process: Update ARM contact for embargoed hardware issues Documentation/process: Add embargoed HW contact for Ampere Computing Documentation/process: Make groups alphabetical and use tabs consistently firmware_loader: use kernel credentials when reading firmware commit 5becde60ed4e63858385aa10354cb87d7444b9cf Merge: 6811a466d27b d83ea024091e Author: Linus Torvalds Date: Sun May 15 08:07:07 2022 -0700 Merge tag 'char-misc-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are two small driver fixes for 5.18-rc7 that resolve reported problems: - slimbus driver irq bugfix - interconnect sync state bugfix Both of these have been in linux-next with no reported problems" * tag 'char-misc-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: slimbus: qcom: Fix IRQ check in qcom_slim_probe interconnect: Restore sync state by ignoring ipa-virt in provider count commit 6811a466d27ba79e6c31c0aecc74feab0472df36 Merge: fc49583cdb2c 401fb66a355e Author: Linus Torvalds Date: Sun May 15 08:05:04 2022 -0700 Merge tag 'tty-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver fixes from Greg KH: "Here are some small tty n_gsm and serial driver fixes for 5.18-rc7 that resolve reported problems. They include: - n_gsm fixes for reported issues - 8250_mtk driver fixes for some platforms - fsl_lpuart driver fix for reported problem. - digicolor driver fix for reported problem. All have been in linux-next for a while with no reported problems" * tag 'tty-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: fsl_lpuart: Don't enable interrupts too early tty: n_gsm: fix invalid gsmtty_write_room() result tty: n_gsm: fix mux activation issues in gsm_config() tty: n_gsm: fix buffer over-read in gsm_dlci_data() serial: 8250_mtk: Fix register address for XON/XOFF character serial: 8250_mtk: Make sure to select the right FEATURE_SEL serial: 8250_mtk: Fix UART_EFR register address tty/serial: digicolor: fix possible null-ptr-deref in digicolor_uart_probe() commit fc49583cdb2c8d5dc7dc626b80c8852478cb3383 Merge: bc403203d65a 757b9f6e6a20 Author: Linus Torvalds Date: Sun May 15 08:03:24 2022 -0700 Merge tag 'usb-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are some small fixes for reported issues with some USB drivers. They include: - xhci fixes for xhci-mtk platform driver - typec driver fixes for reported problems. - cdc-wdm read-stuck fix - gadget driver fix for reported race condition - new usb-serial driver ids All of these have been in linux-next with no reported problems" * tag 'usb-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: xhci-mtk: remove bandwidth budget table usb: xhci-mtk: fix fs isoc's transfer error usb: gadget: fix race when gadget driver register via ioctl usb: typec: tcpci_mt6360: Update for BMC PHY setting usb: gadget: uvc: allow for application to cleanly shutdown usb: typec: tcpci: Don't skip cleanup in .remove() on error usb: cdc-wdm: fix reading stuck on device close USB: serial: qcserial: add support for Sierra Wireless EM7590 USB: serial: option: add Fibocom MA510 modem USB: serial: option: add Fibocom L610 modem USB: serial: pl2303: add device id for HP LM930 Display commit bc403203d65a874df2f3156046468052e4109cb0 Merge: 79dc4fc2f235 ee8348496c77 Author: Linus Torvalds Date: Sun May 15 06:46:03 2022 -0700 Merge tag 'powerpc-5.18-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: - Fix KVM PR on 32-bit, which was broken by some MMU code refactoring. Thanks to: Alexander Graf, and Matt Evans. * tag 'powerpc-5.18-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: KVM: PPC: Book3S PR: Enable MSR_DR for switch_mmu_context() commit 79dc4fc2f235159f0f59fca2250855a796f590ff Merge: 990e798d182a 280abe14b6e0 Author: Linus Torvalds Date: Sun May 15 06:42:40 2022 -0700 Merge tag 'x86-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fix from Thomas Gleixner: "A single fix for the handling of unpopulated sub-pmd spaces. The copy & pasta from the corresponding s390 code screwed up the address calculation for marking the sub-pmd ranges via memset by omitting the ALIGN_DOWN() to calculate the proper start address. It's a mystery why this code is not generic and shared because there is nothing architecture specific in there, but that's too intrusive for a backportable fix" * tag 'x86-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Fix marking of unused sub-pmd ranges commit 990e798d182a63afba6cc990f5bcd42d18436b55 Merge: fb756280f977 9c2136be0878 Author: Linus Torvalds Date: Sun May 15 06:40:11 2022 -0700 Merge tag 'sched-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Thomas Gleixner: "The recent expansion of the sched switch tracepoint inserted a new argument in the middle of the arguments. This reordering broke BPF programs which relied on the old argument list. While tracepoints are not considered stable ABI, it's not trivial to make BPF cope with such a change, but it's being worked on. For now restore the original argument order and move the new argument to the end of the argument list" * tag 'sched-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/tracing: Append prev_state to tp args instead commit fb756280f97788525e898181adfc4feb106c79d3 Merge: 2fe1020d73ca 792ea6a074ae Author: Linus Torvalds Date: Sun May 15 06:37:05 2022 -0700 Merge tag 'irq-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Thomas Gleixner: "A single fix for a recent (introduced in 5.16) regression in the core interrupt code. The consolidation of the interrupt handler invocation code added an unconditional warning when generic_handle_domain_irq() is invoked from outside hard interrupt context. That's overbroad as the requirement for invoking these handlers in hard interrupt context is only required for certain interrupt types. The subsequently called code already contains a warning which triggers conditionally for interrupt chips which indicate this requirement in their properties. Remove the overbroad one" * tag 'irq-urgent-2022-05-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq: Remove WARN_ON_ONCE() in generic_handle_domain_irq() commit 2fe1020d73ca0467b5383b0a3e459a1d29902762 Merge: ec7f49619d8e c46721e4604f Author: Linus Torvalds Date: Sat May 14 11:43:47 2022 -0700 Merge tag 'perf-tools-fixes-for-v5.18-2022-05-14' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix two NDEBUG warnings in 'perf bench numa' - Fix ARM coresight `perf test` failure - Sync linux/kvm.h with the kernel sources - Add James and Mike as Arm64 performance events reviewers * tag 'perf-tools-fixes-for-v5.18-2022-05-14' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: MAINTAINERS: Add James and Mike as Arm64 performance events reviewers tools headers UAPI: Sync linux/kvm.h with the kernel sources perf tests: Fix coresight `perf test` failure. perf bench: Fix two numa NDEBUG warnings commit ec7f49619d8ee13e108740c82f942cd401b989e9 Merge: d928e8f3af38 eb7bac3973d2 Author: Linus Torvalds Date: Fri May 13 16:20:25 2022 -0700 Merge tag 'drm-fixes-2022-05-14' of git://anongit.freedesktop.org/drm/drm Pull more drm fixes from Dave Airlie: "Turns out I was right, some fixes hadn't made it to me yet. The vmwgfx ones also popped up later, but all seem like bad enough things to fix. The dma-buf, vc4 and nouveau ones are all pretty small. The fbdev fixes are a bit more complicated: a fix to cleanup fbdev devices properly, uncovered some use-after-free bugs in existing drivers. Then the fix for those bugs wasn't correct. This reverts that fix, and puts the proper fixes in place in the drivers to avoid the use-after-frees. This has had a fair number of eyes on it at this stage, and I'm confident enough that it puts things in the right place, and is less dangerous than reverting our way out of the initial change at this stage. fbdev: - revert NULL deref fix that turned into a use-after-free - prevent use-after-free in fbdev - efifb/simplefb/vesafb: fix cleanup paths to avoid use-after-frees dma-buf: - fix panic in stats setup vc4: - fix hdmi build nouveau: - tegra iommu present fix - fix leak in backlight name vmwgfx: - Black screen due to fences using FIFO checks on SVGA3 - Random black screens on boot due to uninitialized drm_mode_fb_cmd2 - Hangs on SVGA3 due to command buffers being used with gbobjects" * tag 'drm-fixes-2022-05-14' of git://anongit.freedesktop.org/drm/drm: drm/vmwgfx: Disable command buffers on svga3 without gbobjects drm/vmwgfx: Initialize drm_mode_fb_cmd2 drm/vmwgfx: Fix fencing on SVGAv3 drm/vc4: hdmi: Fix build error for implicit function declaration dma-buf: call dma_buf_stats_setup after dmabuf is in valid list fbdev: efifb: Fix a use-after-free due early fb_info cleanup drm/nouveau: Fix a potential theorical leak in nouveau_get_backlight_name() drm/nouveau/tegra: Stop using iommu_present() fbdev: vesafb: Cleanup fb_info in .fb_destroy rather than .remove fbdev: efifb: Cleanup fb_info in .fb_destroy rather than .remove fbdev: simplefb: Cleanup fb_info in .fb_destroy rather than .remove fbdev: Prevent possible use-after-free in fb_release() Revert "fbdev: Make fb_release() return -ENODEV if fbdev was unregistered" commit eb7bac3973d209e5227d1783676362ee5a8a7127 Merge: 30c60ba354ce 6fed53de5607 Author: Dave Airlie Date: Sat May 14 08:34:01 2022 +1000 Merge tag 'drm-misc-fixes-2022-05-13' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Multiple fixes to fbdev to address a regression at unregistration, an iommu detection improvement for nouveau, a memory leak fix for nouveau, pointer dereference fix for dma_buf_file_release(), and a build breakage fix for vc4 Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220513073044.ymayac7x7bzatrt7@houat commit 30c60ba354ce28e2953e0d3c50580aa67fb863cd Merge: 5005e9814698 21d1d192890c Author: Dave Airlie Date: Sat May 14 08:29:41 2022 +1000 Merge tag 'vmwgfx-drm-fixes-5.18-2022-05-13' of https://gitlab.freedesktop.org/zack/vmwgfx into drm-fixes vmwgfx fixes for: - Black screen due to fences using FIFO checks on SVGA3 - Random black screens on boot due to uninitialized drm_mode_fb_cmd2 - Hangs on SVGA3 due to command buffers being used with gbobjects Signed-off-by: Dave Airlie From: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/a1d32799e4c74b8540216376d7576bb783ca07ba.camel@vmware.com commit d928e8f3af38abc8d2d56d9329a8280f7af5f10e Merge: f2dd007445b1 e1fa9ea85ce8 Author: Linus Torvalds Date: Fri May 13 14:32:53 2022 -0700 Merge tag 'gfs2-v5.18-rc4-fix3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 fixes from Andreas Gruenbacher: "We've finally identified commit dc732906c245 ("gfs2: Introduce flag for glock holder auto-demotion") to be the other cause of the filesystem corruption we've been seeing. This feature isn't strictly necessary anymore, so we've decided to stop using it for now. With this and the gfs_iomap_end rounding fix you've already seen ("gfs2: Fix filesystem block deallocation for short writes" in this pull request), we're corruption free again now. - Fix filesystem block deallocation for short writes. - Stop using glock holder auto-demotion for now. - Get rid of buffered writes inefficiencies due to page faults being disabled. - Minor other cleanups" * tag 'gfs2-v5.18-rc4-fix3' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Stop using glock holder auto-demotion for now gfs2: buffered write prefaulting gfs2: Align read and write chunks to the page cache gfs2: Pull return value test out of should_fault_in_pages gfs2: Clean up use of fault_in_iov_iter_{read,write}able gfs2: Variable rename gfs2: Fix filesystem block deallocation for short writes commit e1fa9ea85ce89207d2ac0316da35a4a7736801f9 Author: Andreas Gruenbacher Date: Wed May 11 18:27:12 2022 +0200 gfs2: Stop using glock holder auto-demotion for now We're having unresolved issues with the glock holder auto-demotion mechanism introduced in commit dc732906c245. This mechanism was assumed to be essential for avoiding frequent short reads and writes until commit 296abc0d91d8 ("gfs2: No short reads or writes upon glock contention"). Since then, when the inode glock is lost, it is simply re-acquired and the operation is resumed. This means that apart from the performance penalty, we might as well drop the inode glock before faulting in pages, and re-acquire it afterwards. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 46 ++++++++++++++-------------------------------- 1 file changed, 14 insertions(+), 32 deletions(-) commit fa5dfa645d85910d747f4e0c97f19e5e97d1c270 Author: Andreas Gruenbacher Date: Wed May 4 23:37:30 2022 +0200 gfs2: buffered write prefaulting In gfs2_file_buffered_write, to increase the likelihood that all the user memory we're trying to write will be resident in memory, carry out the write in chunks and fault in each chunk of user memory before trying to write it. Otherwise, some workloads will trigger frequent short "internal" writes, causing filesystem blocks to be allocated and then partially deallocated again when writing into holes, which is wasteful and breaks reservations. Neither the chunked writes nor any of the short "internal" writes are user visible. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) commit f2dd007445b1d4c0581d0292f85fdd5b47387776 Merge: c3f5e692bfcc 775266207105 Author: Linus Torvalds Date: Fri May 13 13:13:48 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Four fixes, all in drivers. These patches mosly fix error legs and exceptional conditions (scsi_dh_alua, qla2xxx). The lpfc fixes are for coding issues with lpfc features" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: lpfc: Correct BDE DMA address assignment for GEN_REQ_WQE scsi: lpfc: Fix split code for FLOGI on FCoE scsi: qla2xxx: Fix missed DMA unmap for aborted commands scsi: scsi_dh_alua: Properly handle the ALUA transitioning state commit 324d116c5a5c8204dc00e63f725a3c5ed09afb53 Author: Andreas Gruenbacher Date: Thu May 5 13:32:23 2022 +0200 gfs2: Align read and write chunks to the page cache Align the chunks that reads and writes are carried out in to the page cache rather than the user buffers. This will be more efficient in general, especially for allocating writes. Optimizing the case that the user buffer is gfs2 backed isn't very useful; we only need to make sure we won't deadlock. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) commit 72382264502d9348ead372f82ecc3044de5c82d2 Author: Andreas Gruenbacher Date: Thu May 5 12:53:26 2022 +0200 gfs2: Pull return value test out of should_fault_in_pages Pull the return value test of the previous read or write operation out of should_fault_in_pages(). In a following patch, we'll fault in pages before the I/O and there will be no return value to check. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) commit 6d22ff471070e21e24667be70764ee5abdfe5608 Author: Andreas Gruenbacher Date: Thu May 5 12:37:49 2022 +0200 gfs2: Clean up use of fault_in_iov_iter_{read,write}able No need to store the return value of the fault_in functions in separate variables. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) commit 42e4c3bdcae7833eeeaed7bf0c000c2de17dd291 Author: Andreas Gruenbacher Date: Wed Apr 27 13:53:42 2022 +0200 gfs2: Variable rename Instead of counting the number of bytes read from the filesystem, functions gfs2_file_direct_read and gfs2_file_read_iter count the number of bytes written into the user buffer. Conversely, functions gfs2_file_direct_write and gfs2_file_buffered_write count the number of bytes read from the user buffer. This is nothing but confusing, so change the read functions to count how many bytes they have read, and the write functions to count how many bytes they have written. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) commit d031a8866e709c9d1ee5537a321b6192b4d2dc5b Author: Andreas Gruenbacher Date: Thu Apr 14 17:52:39 2022 +0200 gfs2: Fix filesystem block deallocation for short writes When a write cannot be carried out in full, gfs2_iomap_end() releases blocks that have been allocated for this write but haven't been used. To compute the end of the allocation, gfs2_iomap_end() incorrectly rounded the end of the attempted write down to the next block boundary to arrive at the end of the allocation. It would have to round up, but the end of the allocation is also available as iomap->offset + iomap->length, so just use that instead. In addition, use round_up() for computing the start of the unused range. Fixes: 64bc06bb32ee ("gfs2: iomap buffered write support") Signed-off-by: Andreas Gruenbacher fs/gfs2/bmap.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit c3f5e692bfccd87ff80a582c298e8ee64b188100 Merge: 6dd5884d1d6f 642d51fb0775 Author: Linus Torvalds Date: Fri May 13 11:12:04 2022 -0700 Merge tag 'ceph-for-5.18-rc7' of https://github.com/ceph/ceph-client Pull ceph fix from Ilya Dryomov: "Two fixes to properly maintain xattrs on async creates and thus preserve SELinux context on newly created files and to avoid improper usage of folio->private field which triggered BUG_ONs. Both marked for stable" * tag 'ceph-for-5.18-rc7' of https://github.com/ceph/ceph-client: ceph: check folio PG_private bit instead of folio->private ceph: fix setting of xattrs on async created inodes commit 6dd5884d1d6f6a0613f6906b14fc1f3feaf8adb9 Merge: 364a453ab912 085d16d5f949 Author: Linus Torvalds Date: Fri May 13 11:04:37 2022 -0700 Merge tag 'nfs-for-5.18-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs Pull NFS client bugfixes from Trond Myklebust: "One more pull request. There was a bug in the fix to ensure that gss- proxy continues to work correctly after we fixed the AF_LOCAL socket leak in the RPC code. This therefore reverts that broken patch, and replaces it with one that works correctly. Stable fixes: - SUNRPC: Ensure that the gssproxy client can start in a connected state Bugfixes: - Revert "SUNRPC: Ensure gss-proxy connects on setup" - nfs: fix broken handling of the softreval mount option" * tag 'nfs-for-5.18-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: nfs: fix broken handling of the softreval mount option SUNRPC: Ensure that the gssproxy client can start in a connected state Revert "SUNRPC: Ensure gss-proxy connects on setup" commit 364a453ab9123f493edfa246798ce9eeda452bdb Merge: 91bdba8536b8 9039b8335276 Author: Linus Torvalds Date: Fri May 13 10:22:37 2022 -0700 Merge tag 'mm-hotfixes-stable-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull misc fixes from Andrew Morton: "Seven MM fixes, three of which address issues added in the most recent merge window, four of which are cc:stable. Three non-MM fixes, none very serious" [ And yes, that's a real pull request from Andrew, not me creating a branch from emailed patches. Woo-hoo! ] * tag 'mm-hotfixes-stable-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: MAINTAINERS: add a mailing list for DAMON development selftests: vm: Makefile: rename TARGETS to VMTARGETS mm/kfence: reset PG_slab and memcg_data before freeing __kfence_pool mailmap: add entry for martyna.szapar-mudlaw@intel.com arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map procfs: prevent unprivileged processes accessing fdinfo dir mm: mremap: fix sign for EFAULT error return value mm/hwpoison: use pr_err() instead of dump_page() in get_any_page() mm/huge_memory: do not overkill when splitting huge_zero_page Revert "mm/memory-failure.c: skip huge_zero_page in memory_failure()" commit 91bdba8536b87b25adbbf79ab9dc661840bccc4a Merge: 359ee4f480c6 51f559d66527 Author: Linus Torvalds Date: Fri May 13 10:17:39 2022 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: - TLB invalidation workaround for Qualcomm Kryo-4xx "gold" CPUs - Fix broken dependency in the vDSO Makefile - Fix pointer authentication overrides in ISAR2 ID register * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Enable repeat tlbi workaround on KRYO4XX gold CPUs arm64: cpufeature: remove duplicate ID_AA64ISAR2_EL1 entry arm64: vdso: fix makefile dependency on vdso.so commit 359ee4f480c604a2e5896a73026184fa29d36c9f Merge: 10b4b67ab582 151d6dcbed83 Author: Linus Torvalds Date: Fri May 13 10:10:07 2022 -0700 Merge tag 'hwmon-for-v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Restrict ltq-cputemp to SOC_XWAY to fix build failure - Add OF device ID table to tmp401 driver to enable auto-load * tag 'hwmon-for-v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (ltq-cputemp) restrict it to SOC_XWAY hwmon: (tmp401) Add OF device ID table commit 10b4b67ab58248636723af181734b9574be05ade Merge: f3f19f939c11 5005e9814698 Author: Linus Torvalds Date: Fri May 13 10:00:37 2022 -0700 Merge tag 'drm-fixes-2022-05-13' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Pretty quiet week on the fixes front, 4 amdgpu and one i915 fix. I think there might be a few misc fbdev ones outstanding, but I'll see if they are necessary and pass them on if so. amdgpu: - Disable ASPM for VI boards on ADL platforms - S0ix DCN3.1 display fix - Resume regression fix - Stable pstate fix i915: - fix for kernel memory corruption when running a lot of OpenCL tests in parallel" * tag 'drm-fixes-2022-05-13' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu/ctx: only reset stable pstate if the user changed it (v2) Revert "drm/amd/pm: keep the BACO feature enabled for suspend" drm/i915: Fix race in __i915_vma_remove_closed drm/amd/display: undo clearing of z10 related function pointers drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems commit 21d1d192890ced87f2f04f8f4dea92406e0b162a Author: Zack Rusin Date: Fri Mar 18 13:43:31 2022 -0400 drm/vmwgfx: Disable command buffers on svga3 without gbobjects With very limited vram on svga3 it's difficult to handle all the surface migrations. Without gbobjects, i.e. the ability to store surfaces in guest mobs, there's no reason to support intermediate svga2 features, especially because we can fall back to fb traces and svga3 will never support those in-between features. On svga3 we wither want to use fb traces or screen targets (i.e. gbobjects), nothing in between. This fixes presentation on a lot of fusion/esxi tech previews where the exposed svga3 caps haven't been finalized yet. Signed-off-by: Zack Rusin Fixes: 2cd80dbd3551 ("drm/vmwgfx: Add basic support for SVGA3") Cc: # v5.14+ Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20220318174332.440068-5-zack@kde.org drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 3059d9b9f6aa433a55b9d0d21b566396d5497c33 Author: Zack Rusin Date: Wed Mar 2 10:24:24 2022 -0500 drm/vmwgfx: Initialize drm_mode_fb_cmd2 Transition to drm_mode_fb_cmd2 from drm_mode_fb_cmd left the structure unitialized. drm_mode_fb_cmd2 adds a few additional members, e.g. flags and modifiers which were never initialized. Garbage in those members can cause random failures during the bringup of the fbcon. Initializing the structure fixes random blank screens after bootup due to flags/modifiers mismatches during the fbcon bring up. Fixes: dabdcdc9822a ("drm/vmwgfx: Switch to mode_cmd2") Signed-off-by: Zack Rusin Cc: Daniel Vetter Cc: # v4.10+ Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-7-zack@kde.org drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1d6595b4cd47acfd824550f48f10b54a6f0e93ee Author: Zack Rusin Date: Wed Mar 2 10:24:22 2022 -0500 drm/vmwgfx: Fix fencing on SVGAv3 Port of the vmwgfx to SVGAv3 lacked support for fencing. SVGAv3 removed FIFO's and replaced them with command buffers and extra registers. The initial version of SVGAv3 lacked support for most advanced features (e.g. 3D) which made fences unnecessary. That is no longer the case, especially as 3D support is being turned on. Switch from FIFO commands and capabilities to command buffers and extra registers to enable fences on SVGAv3. Fixes: 2cd80dbd3551 ("drm/vmwgfx: Add basic support for SVGA3") Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20220302152426.885214-5-zack@kde.org drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 8 ++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | 28 +++++++++++++++++++++------- drivers/gpu/drm/vmwgfx/vmwgfx_irq.c | 26 ++++++++++++++++++-------- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +++++--- 5 files changed, 53 insertions(+), 19 deletions(-) commit d83ea024091e11d384f983f389a7853312c33c5d Merge: fe503887eed6 20ce30fb4750 Author: Greg Kroah-Hartman Date: Fri May 13 16:15:28 2022 +0200 Merge tag 'icc-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-linus Pull interconnect fixes from Georgi: "interconnect fixes for v5.18-rc This contains an additional fix for sc7180 and sdx55 platforms that helps them to enter suspend even on devices that don't have the most recent DT changes. - interconnect: Restore sync state by ignoring ipa-virt in provider count Signed-off-by: Georgi Djakov " * tag 'icc-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: Restore sync state by ignoring ipa-virt in provider count commit 280abe14b6e0a38de9cc86fe6a019523aadd8f70 Author: Adrian-Ken Rueegsegger Date: Mon May 9 11:06:37 2022 +0200 x86/mm: Fix marking of unused sub-pmd ranges The unused part precedes the new range spanned by the start, end parameters of vmemmap_use_new_sub_pmd(). This means it actually goes from ALIGN_DOWN(start, PMD_SIZE) up to start. Use the correct address when applying the mark using memset. Fixes: 8d400913c231 ("x86/vmemmap: handle unpopulated sub-pmd ranges") Signed-off-by: Adrian-Ken Rueegsegger Signed-off-by: Thomas Gleixner Reviewed-by: Oscar Salvador Reviewed-by: David Hildenbrand Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220509090637.24152-2-ken@codelabs.ch arch/x86/mm/init_64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 757b9f6e6a2070043e5f215ff4afe350ecfb2bf7 Merge: 1645eee0d7f6 870b1eee2d84 Author: Greg Kroah-Hartman Date: Fri May 13 08:29:40 2022 +0200 Merge tag 'usb-serial-5.18-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial Johan writes: USB-serial fixes for 5.18-rc7 Here are some new device ids. All have been in linux-next with no reported issues. * tag 'usb-serial-5.18-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: qcserial: add support for Sierra Wireless EM7590 USB: serial: option: add Fibocom MA510 modem USB: serial: option: add Fibocom L610 modem USB: serial: pl2303: add device id for HP LM930 Display commit 5005e9814698f47c5a3698fcc56c9f5e6f1d4644 Merge: c8f0c2d45c12 c65b364c52ba Author: Dave Airlie Date: Fri May 13 10:40:55 2022 +1000 Merge tag 'amd-drm-fixes-5.18-2022-05-11' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.18-2022-05-11: amdgpu: - Disable ASPM for VI boards on ADL platforms - S0ix DCN3.1 display fix - Resume regression fix - Stable pstate fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220511174422.5769-1-alexander.deucher@amd.com commit c8f0c2d45c121a59e9786559f647b76e108efa70 Merge: c5eb0a61238d 3220c3b21151 Author: Dave Airlie Date: Fri May 13 09:24:44 2022 +1000 Merge tag 'drm-intel-fixes-2022-05-12' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes Fix for #5732: (Cc stable) kernel memory corruption when running a lot of OpenCL tests in parallel Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YnykW6L4e7vD3yl3@jlahtine-mobl.ger.corp.intel.com commit f3f19f939c11925dadd3f4776f99f8c278a7017b Merge: 0ac824f379fb 3740651bf7e2 Author: Linus Torvalds Date: Thu May 12 11:51:45 2022 -0700 Merge tag 'net-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from wireless, and bluetooth. No outstanding fires. Current release - regressions: - eth: atlantic: always deep reset on pm op, fix null-deref Current release - new code bugs: - rds: use maybe_get_net() when acquiring refcount on TCP sockets [refinement of a previous fix] - eth: ocelot: mark traps with a bool instead of guessing type based on list membership Previous releases - regressions: - net: fix skipping features in for_each_netdev_feature() - phy: micrel: fix null-derefs on suspend/resume and probe - bcmgenet: check for Wake-on-LAN interrupt probe deferral Previous releases - always broken: - ipv4: drop dst in multicast routing path, prevent leaks - ping: fix address binding wrt vrf - net: fix wrong network header length when BPF protocol translation is used on skbs with a fraglist - bluetooth: fix the creation of hdev->name - rfkill: uapi: fix RFKILL_IOCTL_MAX_SIZE ioctl request definition - wifi: iwlwifi: iwl-dbg: use del_timer_sync() before freeing - wifi: ath11k: reduce the wait time of 11d scan and hw scan while adding an interface - mac80211: fix rx reordering with non explicit / psmp ack policy - mac80211: reset MBSSID parameters upon connection - nl80211: fix races in nl80211_set_tx_bitrate_mask() - tls: fix context leak on tls_device_down - sched: act_pedit: really ensure the skb is writable - batman-adv: don't skb_split skbuffs with frag_list - eth: ocelot: fix various issues with TC actions (null-deref; bad stats; ineffective drops; ineffective filter removal)" * tag 'net-5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (61 commits) tls: Fix context leak on tls_device_down net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe() net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down() mlxsw: Avoid warning during ip6gre device removal net: bcmgenet: Check for Wake-on-LAN interrupt probe deferral net: ethernet: mediatek: ppe: fix wrong size passed to memset() Bluetooth: Fix the creation of hdev->name i40e: i40e_main: fix a missing check on list iterator net/sched: act_pedit: really ensure the skb is writable s390/lcs: fix variable dereferenced before check s390/ctcm: fix potential memory leak s390/ctcm: fix variable dereferenced before check net: atlantic: verify hw_head_ lies within TX buffer ring net: atlantic: add check for MAX_SKB_FRAGS net: atlantic: reduce scope of is_rsc_complete net: atlantic: fix "frag[0] not initialized" net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe() net: phy: micrel: Fix incorrect variable type in micrel decnet: Use container_of() for struct dn_neigh casts ... commit 0ac824f379fba2c2b17b75fd5ada69cd68c66348 Merge: c37dba6ae45c 2685027fca38 Author: Linus Torvalds Date: Thu May 12 10:42:56 2022 -0700 Merge branch 'for-5.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup fix from Tejun Heo: "Waiman's fix for a cgroup2 cpuset bug where it could miss nodes which were hot-added" * 'for-5.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup/cpuset: Remove cpus_allowed/mems_allowed setup in cpuset_init_smp() commit c37dba6ae45c2f0ec9913d7c96790fc00976d3d4 Merge: feb9c5e19e91 c1ad35dd0548 Author: Linus Torvalds Date: Thu May 12 10:21:44 2022 -0700 Merge tag 'fixes_for_v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fs fixes from Jan Kara: "Three fixes that I'd still like to get to 5.18: - add a missing sanity check in the fanotify FAN_RENAME feature (added in 5.17, let's fix it before it gets wider usage in userspace) - udf fix for recently introduced filesystem corruption issue - writeback fix for a race in inode list handling that can lead to delayed writeback and possible dirty throttling stalls" * tag 'fixes_for_v5.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: udf: Avoid using stale lengthOfImpUse writeback: Avoid skipping inode writeback fanotify: do not allow setting dirent events in mask of non-dir commit 3740651bf7e200109dd42d5b2fb22226b26f960a Author: Maxim Mikityanskiy Date: Thu May 12 12:18:30 2022 +0300 tls: Fix context leak on tls_device_down The commit cited below claims to fix a use-after-free condition after tls_device_down. Apparently, the description wasn't fully accurate. The context stayed alive, but ctx->netdev became NULL, and the offload was torn down without a proper fallback, so a bug was present, but a different kind of bug. Due to misunderstanding of the issue, the original patch dropped the refcount_dec_and_test line for the context to avoid the alleged premature deallocation. That line has to be restored, because it matches the refcount_inc_not_zero from the same function, otherwise the contexts that survived tls_device_down are leaked. This patch fixes the described issue by restoring refcount_dec_and_test. After this change, there is no leak anymore, and the fallback to software kTLS still works. Fixes: c55dcdd435aa ("net/tls: Fix use-after-free after the TLS device goes down and up") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Link: https://lore.kernel.org/r/20220512091830.678684-1-maximmi@nvidia.com Signed-off-by: Jakub Kicinski net/tls/tls_device.c | 3 +++ 1 file changed, 3 insertions(+) commit 1fa89ffbc04545b7582518e57f4b63e2a062870f Author: Taehee Yoo Date: Thu May 12 05:47:09 2022 +0000 net: sfc: ef10: fix memory leak in efx_ef10_mtd_probe() In the NIC ->probe() callback, ->mtd_probe() callback is called. If NIC has 2 ports, ->probe() is called twice and ->mtd_probe() too. In the ->mtd_probe(), which is efx_ef10_mtd_probe() it allocates and initializes mtd partiion. But mtd partition for sfc is shared data. So that allocated mtd partition data from last called efx_ef10_mtd_probe() will not be used. Therefore it must be freed. But it doesn't free a not used mtd partition data in efx_ef10_mtd_probe(). kmemleak reports: unreferenced object 0xffff88811ddb0000 (size 63168): comm "systemd-udevd", pid 265, jiffies 4294681048 (age 348.586s) 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: [] kmalloc_order_trace+0x19/0x120 [] __kmalloc+0x20e/0x250 [] efx_ef10_mtd_probe+0x11f/0x270 [sfc] [] efx_pci_probe.cold.17+0x3df/0x53d [sfc] [] local_pci_probe+0xdc/0x170 [] pci_device_probe+0x235/0x680 [] really_probe+0x1c2/0x8f0 [] __driver_probe_device+0x2ab/0x460 [] driver_probe_device+0x4a/0x120 [] __driver_attach+0x16e/0x320 [] bus_for_each_dev+0x110/0x190 [] bus_add_driver+0x39e/0x560 [] driver_register+0x18e/0x310 [] 0xffffffffc02e2055 [] do_one_initcall+0xc3/0x450 [] do_init_module+0x1b4/0x700 Acked-by: Martin Habets Fixes: 8127d661e77f ("sfc: Add support for Solarflare SFC9100 family") Signed-off-by: Taehee Yoo Link: https://lore.kernel.org/r/20220512054709.12513-1-ap420073@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/sfc/ef10.c | 5 +++++ 1 file changed, 5 insertions(+) commit f3c46e41b32b6266cf60b0985c61748f53bf1c61 Author: Guangguan Wang Date: Thu May 12 11:08:20 2022 +0800 net/smc: non blocking recvmsg() return -EAGAIN when no data and signal_pending Non blocking sendmsg will return -EAGAIN when any signal pending and no send space left, while non blocking recvmsg return -EINTR when signal pending and no data received. This may makes confused. As TCP returns -EAGAIN in the conditions described above. Align the behavior of smc with TCP. Fixes: 846e344eb722 ("net/smc: add receive timeout check") Signed-off-by: Guangguan Wang Reviewed-by: Tony Lu Acked-by: Karsten Graul Link: https://lore.kernel.org/r/20220512030820.73848-1-guangguan.wang@linux.alibaba.com Signed-off-by: Jakub Kicinski net/smc/smc_rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit b7be130c5d52e5224ac7d89568737b37b4c4b785 Author: Florian Fainelli Date: Wed May 11 19:17:31 2022 -0700 net: dsa: bcm_sf2: Fix Wake-on-LAN with mac_link_down() After commit 2d1f90f9ba83 ("net: dsa/bcm_sf2: fix incorrect usage of state->link") the interface suspend path would call our mac_link_down() call back which would forcibly set the link down, thus preventing Wake-on-LAN packets from reaching our management port. Fix this by looking at whether the port is enabled for Wake-on-LAN and not clearing the link status in that case to let packets go through. Fixes: 2d1f90f9ba83 ("net: dsa/bcm_sf2: fix incorrect usage of state->link") Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20220512021731.2494261-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski drivers/net/dsa/bcm_sf2.c | 3 +++ 1 file changed, 3 insertions(+) commit 1645eee0d7f623660e6ce0f1aef4591788a0c9da Author: Chunfeng Yun Date: Thu May 12 14:49:31 2022 +0800 usb: xhci-mtk: remove bandwidth budget table The bandwidth budget table is introduced to trace ideal bandwidth used by each INT/ISOC endpoint, but in fact the endpoint may consume more bandwidth and cause data transfer error, so it's better to leave some margin. Obviously it's difficult to find the best margin for all cases, instead take use of the worst-case scenario. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220512064931.31670-2-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-mtk-sch.c | 74 +++++++---------------------------------- drivers/usb/host/xhci-mtk.h | 2 -- 2 files changed, 12 insertions(+), 64 deletions(-) commit c237566b78ad8c72bc0431c5d6171db8d12e6f94 Author: Chunfeng Yun Date: Thu May 12 14:49:30 2022 +0800 usb: xhci-mtk: fix fs isoc's transfer error Due to the scheduler allocates the optimal bandwidth for FS ISOC endpoints, this may be not enough actually and causes data transfer error, so come up with an estimate that is no less than the worst case bandwidth used for any one mframe, but may be an over-estimate. Fixes: 451d3912586a ("usb: xhci-mtk: update fs bus bandwidth by bw_budget_table") Cc: stable@vger.kernel.org Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220512064931.31670-1-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-mtk-sch.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) commit 5f0b5f4d50fa0faa8c76ef9d42a42e8d43f98b44 Author: Schspa Shi Date: Sun May 8 23:02:47 2022 +0800 usb: gadget: fix race when gadget driver register via ioctl The usb_gadget_register_driver can be called multi time by to threads via USB_RAW_IOCTL_RUN ioctl syscall, which will lead to multiple registrations. Call trace: driver_register+0x220/0x3a0 drivers/base/driver.c:171 usb_gadget_register_driver_owner+0xfb/0x1e0 drivers/usb/gadget/udc/core.c:1546 raw_ioctl_run drivers/usb/gadget/legacy/raw_gadget.c:513 [inline] raw_ioctl+0x1883/0x2730 drivers/usb/gadget/legacy/raw_gadget.c:1220 ioctl USB_RAW_IOCTL_RUN This routine allows two processes to register the same driver instance via ioctl syscall. which lead to a race condition. Please refer to the following scenarios. T1 T2 ------------------------------------------------------------------ usb_gadget_register_driver_owner driver_register driver_register driver_find driver_find bus_add_driver bus_add_driver priv alloced drv->p = priv; kobject_init_and_add // refcount = 1; //couldn't find an available UDC or it's busy priv alloced drv->priv = priv; kobject_init_and_add ---> refcount = 1 <------ // register success ===================== another ioctl/process ====================== driver_register driver_find k = kset_find_obj() ---> refcount = 2 <------ driver_unregister // drv->p become T2's priv ---> refcount = 1 <------ kobject_put(k) ---> refcount = 0 <------ return priv->driver; --------UAF here---------- There will be UAF in this scenario. We can fix it by adding a new STATE_DEV_REGISTERING device state to avoid double register. Reported-by: syzbot+dc7c3ca638e773db07f6@syzkaller.appspotmail.com Link: https://lore.kernel.org/all/000000000000e66c2805de55b15a@google.com/ Reviewed-by: Andrey Konovalov Signed-off-by: Schspa Shi Link: https://lore.kernel.org/r/20220508150247.38204-1-schspa@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/legacy/raw_gadget.c | 2 ++ 1 file changed, 2 insertions(+) commit 4031cd95cba70c72e4cadc2d46624bcd31e5a6c0 Author: ChiYuan Huang Date: Tue May 10 13:13:00 2022 +0800 usb: typec: tcpci_mt6360: Update for BMC PHY setting Update MT6360 BMC PHY Tx/Rx setting for the compatibility. Macpaul reported this CtoDP cable attention message cannot be received from MT6360 TCPC. But actually, attention message really sent from UFP_D device. After RD's comment, there may be BMC PHY Tx/Rx setting causes this issue. Below's the detailed TCPM log and DP attention message didn't received from 6360 TCPCI. [ 1206.367775] Identity: 0000:0000.0000 [ 1206.416570] Alternate mode 0: SVID 0xff01, VDO 1: 0x00000405 [ 1206.447378] AMS DFP_TO_UFP_ENTER_MODE start [ 1206.447383] PD TX, header: 0x1d6f [ 1206.449393] PD TX complete, status: 0 [ 1206.454110] PD RX, header: 0x184f [1] [ 1206.456867] Rx VDM cmd 0xff018144 type 1 cmd 4 len 1 [ 1206.456872] AMS DFP_TO_UFP_ENTER_MODE finished [ 1206.456873] cc:=4 [ 1206.473100] AMS STRUCTURED_VDMS start [ 1206.473103] PD TX, header: 0x2f6f [ 1206.475397] PD TX complete, status: 0 [ 1206.480442] PD RX, header: 0x2a4f [1] [ 1206.483145] Rx VDM cmd 0xff018150 type 1 cmd 16 len 2 [ 1206.483150] AMS STRUCTURED_VDMS finished [ 1206.483151] cc:=4 [ 1206.505643] AMS STRUCTURED_VDMS start [ 1206.505646] PD TX, header: 0x216f [ 1206.507933] PD TX complete, status: 0 [ 1206.512664] PD RX, header: 0x1c4f [1] [ 1206.515456] Rx VDM cmd 0xff018151 type 1 cmd 17 len 1 [ 1206.515460] AMS STRUCTURED_VDMS finished [ 1206.515461] cc:=4 Fixes: e1aefcdd394fd ("usb typec: mt6360: Add support for mt6360 Type-C driver") Cc: stable Reported-by: Macpaul Lin Tested-by: Macpaul Lin Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: ChiYuan Huang Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/1652159580-30959-1-git-send-email-u0084500@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/typec/tcpm/tcpci_mt6360.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) commit 51f559d66527e238f9a5f82027bff499784d4eac Author: Shreyas K K Date: Thu May 12 16:31:34 2022 +0530 arm64: Enable repeat tlbi workaround on KRYO4XX gold CPUs Add KRYO4XX gold/big cores to the list of CPUs that need the repeat TLBI workaround. Apply this to the affected KRYO4XX cores (rcpe to rfpe). The variant and revision bits are implementation defined and are different from the their Cortex CPU counterparts on which they are based on, i.e., (r0p0 to r3p0) is equivalent to (rcpe to rfpe). Signed-off-by: Shreyas K K Reviewed-by: Sai Prakash Ranjan Link: https://lore.kernel.org/r/20220512110134.12179-1-quic_shrekk@quicinc.com Signed-off-by: Will Deacon Documentation/arm64/silicon-errata.rst | 3 +++ arch/arm64/kernel/cpu_errata.c | 2 ++ 2 files changed, 5 insertions(+) commit 810c2f0a3f86158c1e02e74947b66d811473434a Author: Amit Cohen Date: Wed May 11 14:57:47 2022 +0300 mlxsw: Avoid warning during ip6gre device removal IPv6 addresses which are used for tunnels are stored in a hash table with reference counting. When a new GRE tunnel is configured, the driver is notified and configures it in hardware. Currently, any change in the tunnel is not applied in the driver. It means that if the remote address is changed, the driver is not aware of this change and the first address will be used. This behavior results in a warning [1] in scenarios such as the following: # ip link add name gre1 type ip6gre local 2000::3 remote 2000::fffe tos inherit ttl inherit # ip link set name gre1 type ip6gre local 2000::3 remote 2000::ffff ttl inherit # ip link delete gre1 The change of the address is not applied in the driver. Currently, the driver uses the remote address which is stored in the 'parms' of the overlay device. When the tunnel is removed, the new IPv6 address is used, the driver tries to release it, but as it is not aware of the change, this address is not configured and it warns about releasing non existing IPv6 address. Fix it by using the IPv6 address which is cached in the IPIP entry, this address is the last one that the driver used, so even in cases such the above, the first address will be released, without any warning. [1]: WARNING: CPU: 1 PID: 2197 at drivers/net/ethernet/mellanox/mlxsw/spectrum.c:2920 mlxsw_sp_ipv6_addr_put+0x146/0x220 [mlxsw_spectrum] ... CPU: 1 PID: 2197 Comm: ip Not tainted 5.17.0-rc8-custom-95062-gc1e5ded51a9a #84 Hardware name: Mellanox Technologies Ltd. MSN4700/VMOD0010, BIOS 5.11 07/12/2021 RIP: 0010:mlxsw_sp_ipv6_addr_put+0x146/0x220 [mlxsw_spectrum] ... Call Trace: mlxsw_sp2_ipip_rem_addr_unset_gre6+0xf1/0x120 [mlxsw_spectrum] mlxsw_sp_netdevice_ipip_ol_event+0xdb/0x640 [mlxsw_spectrum] mlxsw_sp_netdevice_event+0xc4/0x850 [mlxsw_spectrum] raw_notifier_call_chain+0x3c/0x50 call_netdevice_notifiers_info+0x2f/0x80 unregister_netdevice_many+0x311/0x6d0 rtnl_dellink+0x136/0x360 rtnetlink_rcv_msg+0x12f/0x380 netlink_rcv_skb+0x49/0xf0 netlink_unicast+0x233/0x340 netlink_sendmsg+0x202/0x440 ____sys_sendmsg+0x1f3/0x220 ___sys_sendmsg+0x70/0xb0 __sys_sendmsg+0x54/0xa0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: e846efe2737b ("mlxsw: spectrum: Add hash table for IPv6 address mapping") Reported-by: Maksym Yaremchuk Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Link: https://lore.kernel.org/r/20220511115747.238602-1-idosch@nvidia.com Signed-off-by: Paolo Abeni drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) commit 2de7689c7caa55949da5a56be02ec41a86ac1725 Author: Kristina Martsenko Date: Wed May 11 17:20:30 2022 +0100 arm64: cpufeature: remove duplicate ID_AA64ISAR2_EL1 entry The ID register table should have one entry per ID register but currently has two entries for ID_AA64ISAR2_EL1. Only one entry has an override, and get_arm64_ftr_reg() can end up choosing the other, causing the override to be ignored. Fix this by removing the duplicate entry. While here, also make the check in sort_ftr_regs() more strict so that duplicate entries can't be added in the future. Fixes: def8c222f054 ("arm64: Add support of PAuth QARMA3 architected algorithm") Signed-off-by: Kristina Martsenko Reviewed-by: Vladimir Murzin Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20220511162030.1403386-1-kristina.martsenko@arm.com Signed-off-by: Will Deacon arch/arm64/kernel/cpufeature.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 6fed53de560768bde6d701a7c79c253b45b259e3 Author: Hui Tang Date: Tue May 10 21:51:48 2022 +0800 drm/vc4: hdmi: Fix build error for implicit function declaration drivers/gpu/drm/vc4/vc4_hdmi.c: In function ‘vc4_hdmi_connector_detect’: drivers/gpu/drm/vc4/vc4_hdmi.c:228:7: error: implicit declaration of function ‘gpiod_get_value_cansleep’; did you mean ‘gpio_get_value_cansleep’? [-Werror=implicit-function-declaration] if (gpiod_get_value_cansleep(vc4_hdmi->hpd_gpio)) ^~~~~~~~~~~~~~~~~~~~~~~~ gpio_get_value_cansleep CC [M] drivers/gpu/drm/vc4/vc4_validate.o CC [M] drivers/gpu/drm/vc4/vc4_v3d.o CC [M] drivers/gpu/drm/vc4/vc4_validate_shaders.o CC [M] drivers/gpu/drm/vc4/vc4_debugfs.o drivers/gpu/drm/vc4/vc4_hdmi.c: In function ‘vc4_hdmi_bind’: drivers/gpu/drm/vc4/vc4_hdmi.c:2883:23: error: implicit declaration of function ‘devm_gpiod_get_optional’; did you mean ‘devm_clk_get_optional’? [-Werror=implicit-function-declaration] vc4_hdmi->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN); ^~~~~~~~~~~~~~~~~~~~~~~ devm_clk_get_optional drivers/gpu/drm/vc4/vc4_hdmi.c:2883:59: error: ‘GPIOD_IN’ undeclared (first use in this function); did you mean ‘GPIOF_IN’? vc4_hdmi->hpd_gpio = devm_gpiod_get_optional(dev, "hpd", GPIOD_IN); ^~~~~~~~ GPIOF_IN drivers/gpu/drm/vc4/vc4_hdmi.c:2883:59: note: each undeclared identifier is reported only once for each function it appears in cc1: all warnings being treated as errors Fixes: 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod") Signed-off-by: Hui Tang Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220510135148.247719-1-tanghui20@huawei.com drivers/gpu/drm/vc4/vc4_hdmi.c | 1 + 1 file changed, 1 insertion(+) commit 6b77c06655b8a749c1a3d9ebc51e9717003f7e5a Author: Florian Fainelli Date: Tue May 10 20:17:51 2022 -0700 net: bcmgenet: Check for Wake-on-LAN interrupt probe deferral The interrupt controller supplying the Wake-on-LAN interrupt line maybe modular on some platforms (irq-bcm7038-l1.c) and might be probed at a later time than the GENET driver. We need to specifically check for -EPROBE_DEFER and propagate that error to ensure that we eventually fetch the interrupt descriptor. Fixes: 9deb48b53e7f ("bcmgenet: add WOL IRQ check") Fixes: 5b1f0e62941b ("net: bcmgenet: Avoid touching non-existent interrupt") Signed-off-by: Florian Fainelli Reviewed-by: Stefan Wahren Link: https://lore.kernel.org/r/20220511031752.2245566-1-f.fainelli@gmail.com Signed-off-by: Paolo Abeni drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ++++ 1 file changed, 4 insertions(+) commit 00832b1d1a393dfb1b9491d085e5b27e8c25d103 Author: Yang Yingliang Date: Wed May 11 11:08:29 2022 +0800 net: ethernet: mediatek: ppe: fix wrong size passed to memset() 'foe_table' is a pointer, the real size of struct mtk_foe_entry should be pass to memset(). Fixes: ba37b7caf1ed ("net: ethernet: mtk_eth_soc: add support for initializing the PPE") Signed-off-by: Yang Yingliang Acked-by: Felix Fietkau Link: https://lore.kernel.org/r/20220511030829.3308094-1-yangyingliang@huawei.com Signed-off-by: Paolo Abeni drivers/net/ethernet/mediatek/mtk_ppe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a48ab883c4a9289694b82cacd95385b8f2367b20 Merge: 8bf6008c8bbc 103a2f3255a9 Author: Jakub Kicinski Date: Wed May 11 17:40:39 2022 -0700 Merge tag 'for-net-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix the creation of hdev->name when index is greater than 9999 * tag 'for-net-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: Fix the creation of hdev->name ==================== Link: https://lore.kernel.org/r/20220512002901.823647-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 8bf6008c8bbca77547aac118d022071b94b4cccd Merge: 3f95a7472d14 a36e07dfe6ee Author: Jakub Kicinski Date: Wed May 11 17:33:01 2022 -0700 Merge tag 'wireless-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Kalle Valo says: ==================== wireless fixes for v5.18 Second set of fixes for v5.18 and hopefully the last one. We have a new iwlwifi maintainer, a fix to rfkill ioctl interface and important fixes to both stack and two drivers. * tag 'wireless-2022-05-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: rfkill: uapi: fix RFKILL_IOCTL_MAX_SIZE ioctl request definition nl80211: fix locking in nl80211_set_tx_bitrate_mask() mac80211_hwsim: call ieee80211_tx_prepare_skb under RCU protection mac80211_hwsim: fix RCU protected chanctx access mailmap: update Kalle Valo's email mac80211: Reset MBSSID parameters upon connection cfg80211: retrieve S1G operating channel number nl80211: validate S1G channel width mac80211: fix rx reordering with non explicit / psmp ack policy ath11k: reduce the wait time of 11d scan and hw scan while add interface MAINTAINERS: update iwlwifi driver maintainer iwlwifi: iwl-dbg: Use del_timer_sync() before freeing ==================== Link: https://lore.kernel.org/r/20220511154535.A1A12C340EE@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 103a2f3255a95991252f8f13375c3a96a75011cd Author: Itay Iellin Date: Sat May 7 08:32:48 2022 -0400 Bluetooth: Fix the creation of hdev->name Set a size limit of 8 bytes of the written buffer to "hdev->name" including the terminating null byte, as the size of "hdev->name" is 8 bytes. If an id value which is greater than 9999 is allocated, then the "snprintf(hdev->name, sizeof(hdev->name), "hci%d", id)" function call would lead to a truncation of the id value in decimal notation. Set an explicit maximum id parameter in the id allocation function call. The id allocation function defines the maximum allocated id value as the maximum id parameter value minus one. Therefore, HCI_MAX_ID is defined as 10000. Signed-off-by: Itay Iellin Signed-off-by: Luiz Augusto von Dentz include/net/bluetooth/hci_core.h | 3 +++ net/bluetooth/hci_core.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) commit 9c2136be0878c88c53dea26943ce40bb03ad8d8d Author: Delyan Kratunov Date: Wed May 11 18:28:36 2022 +0000 sched/tracing: Append prev_state to tp args instead Commit fa2c3254d7cf (sched/tracing: Don't re-read p->state when emitting sched_switch event, 2022-01-20) added a new prev_state argument to the sched_switch tracepoint, before the prev task_struct pointer. This reordering of arguments broke BPF programs that use the raw tracepoint (e.g. tp_btf programs). The type of the second argument has changed and existing programs that assume a task_struct* argument (e.g. for bpf_task_storage access) will now fail to verify. If we instead append the new argument to the end, all existing programs would continue to work and can conditionally extract the prev_state argument on supported kernel versions. Fixes: fa2c3254d7cf (sched/tracing: Don't re-read p->state when emitting sched_switch event, 2022-01-20) Signed-off-by: Delyan Kratunov Signed-off-by: Peter Zijlstra (Intel) Acked-by: Steven Rostedt (Google) Link: https://lkml.kernel.org/r/c8a6930dfdd58a4a5755fc01732675472979732b.camel@fb.com include/trace/events/sched.h | 6 +++--- kernel/sched/core.c | 2 +- kernel/trace/fgraph.c | 4 ++-- kernel/trace/ftrace.c | 4 ++-- kernel/trace/trace_events.c | 8 ++++---- kernel/trace/trace_osnoise.c | 4 ++-- kernel/trace/trace_sched_switch.c | 4 ++-- kernel/trace/trace_sched_wakeup.c | 4 ++-- samples/trace_events/trace_custom_sched.h | 6 +++--- 9 files changed, 21 insertions(+), 21 deletions(-) commit 3f95a7472d14abef284d8968734fe2ae7ff4845f Author: Xiaomeng Tong Date: Tue May 10 13:48:46 2022 -0700 i40e: i40e_main: fix a missing check on list iterator The bug is here: ret = i40e_add_macvlan_filter(hw, ch->seid, vdev->dev_addr, &aq_err); The list iterator 'ch' will point to a bogus position containing HEAD if the list is empty or no element is found. This case must be checked before any use of the iterator, otherwise it will lead to a invalid memory access. To fix this bug, use a new variable 'iter' as the list iterator, while use the origin variable 'ch' as a dedicated pointer to point to the found element. Cc: stable@vger.kernel.org Fixes: 1d8d80b4e4ff6 ("i40e: Add macvlan support on i40e") Signed-off-by: Xiaomeng Tong Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220510204846.2166999-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/intel/i40e/i40e_main.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) commit 8b796475fd7882663a870456466a4fb315cc1bd6 Author: Paolo Abeni Date: Tue May 10 16:57:34 2022 +0200 net/sched: act_pedit: really ensure the skb is writable Currently pedit tries to ensure that the accessed skb offset is writable via skb_unclone(). The action potentially allows touching any skb bytes, so it may end-up modifying shared data. The above causes some sporadic MPTCP self-test failures, due to this code: tc -n $ns2 filter add dev ns2eth$i egress \ protocol ip prio 1000 \ handle 42 fw \ action pedit munge offset 148 u8 invert \ pipe csum tcp \ index 100 The above modifies a data byte outside the skb head and the skb is a cloned one, carrying a TCP output packet. This change addresses the issue by keeping track of a rough over-estimate highest skb offset accessed by the action and ensuring such offset is really writable. Note that this may cause performance regressions in some scenarios, but hopefully pedit is not in the critical path. Fixes: db2c24175d14 ("act_pedit: access skb->data safely") Acked-by: Mat Martineau Tested-by: Geliang Tang Signed-off-by: Paolo Abeni Acked-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/1fcf78e6679d0a287dd61bb0f04730ce33b3255d.1652194627.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski include/net/tc_act/tc_pedit.h | 1 + net/sched/act_pedit.c | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) commit b7c15a3ce6fea5da3aa836c897a78ac628467d54 Merge: ef3a6b70507a c5eb0a61238d Author: Maarten Lankhorst Date: Wed May 11 20:22:22 2022 +0200 Merge remote-tracking branch 'drm/drm-fixes' into drm-misc-fixes Requested by Zack for vmwgfx fixes. Signed-off-by: Maarten Lankhorst commit c65b364c52ba352177dde6944f5efaa29bd40b52 Author: Alex Deucher Date: Tue May 10 10:32:26 2022 -0400 drm/amdgpu/ctx: only reset stable pstate if the user changed it (v2) Check if the requested stable pstate matches the current one before changing it. This avoids changing the stable pstate on context destroy if the user never changed it in the first place via the IOCTL. v2: compare the current and requested rather than setting a flag (Lijo) Fixes: 8cda7a4f96e435 ("drm/amdgpu/UAPI: add new CTX OP to get/set stable pstates") Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 5 +++++ 1 file changed, 5 insertions(+) commit a56f445f807b0276fc0660c330bf93a9ea78e8ea Author: Alex Deucher Date: Tue May 10 09:37:06 2022 -0400 Revert "drm/amd/pm: keep the BACO feature enabled for suspend" This reverts commit eaa090538e8d21801c6d5f94590c3799e6a528b5. Commit ebc002e3ee78 ("drm/amdgpu: don't use BACO for reset in S3") stops using BACO for reset during suspend, so it's no longer necessary to leave BACO enabled during suspend. This fixes resume from suspend on the navy flounder dGPU in the ASUS ROG Strix G513QY. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2008 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1982 Reviewed-by: Lijo Lazar Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit ee8348496c77e3737d0a6cda307a521f2cff954f Author: Alexander Graf Date: Tue May 10 14:37:17 2022 +0200 KVM: PPC: Book3S PR: Enable MSR_DR for switch_mmu_context() Commit 863771a28e27 ("powerpc/32s: Convert switch_mmu_context() to C") moved the switch_mmu_context() to C. While in principle a good idea, it meant that the function now uses the stack. The stack is not accessible from real mode though. So to keep calling the function, let's turn on MSR_DR while we call it. That way, all pointer references to the stack are handled virtually. In addition, make sure to save/restore r12 on the stack, as it may get clobbered by the C function. Fixes: 863771a28e27 ("powerpc/32s: Convert switch_mmu_context() to C") Cc: stable@vger.kernel.org # v5.14+ Reported-by: Matt Evans Signed-off-by: Alexander Graf Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220510123717.24508-1-graf@amazon.com arch/powerpc/kvm/book3s_32_sr.S | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) commit 3cc5c6a7829a67d943a8e9c42edbcc0db18493e2 Merge: 2423b0d0724d 671bb35c8e74 Author: David S. Miller Date: Wed May 11 12:31:01 2022 +0100 Merge branch 's390-net-fixes' Alexandra Winter says: ==================== s390/net: Cleanup some code checker findings clean up smatch findings in legacy code. I was not able to provoke any real failures on my systems, but other hardware reactions, timing conditions or compiler output, may cause failures. There are still 2 smatch warnings left in s390/net: drivers/s390/net/ctcm_main.c:1326 add_channel() warn: missing error code 'rc' This one is a false positive. drivers/s390/net/netiucv.c:1355 netiucv_check_user() warn: argument 3 to %02x specifier has type 'char' Postponing this one, need to better understand string handling in iucv. There are several sparse warnings left in ctcm, like: drivers/s390/net/ctcm_fsms.c:573:9: warning: context imbalance in 'ctcm_chx_setmode' - different lock contexts for basic block Those are mentioned in the source, no plan to rework. ==================== Signed-off-by: David S. Miller commit 671bb35c8e746439f0ed70815968f9a4f20a8deb Author: Alexandra Winter Date: Tue May 10 09:05:08 2022 +0200 s390/lcs: fix variable dereferenced before check smatch complains about drivers/s390/net/lcs.c:1741 lcs_get_control() warn: variable dereferenced before check 'card->dev' (see line 1739) Fixes: 27eb5ac8f015 ("[PATCH] s390: lcs driver bug fixes and improvements [1/2]") Signed-off-by: Alexandra Winter Signed-off-by: David S. Miller drivers/s390/net/lcs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 0c0b20587b9f25a2ad14db7f80ebe49bdf29920a Author: Alexandra Winter Date: Tue May 10 09:05:07 2022 +0200 s390/ctcm: fix potential memory leak smatch complains about drivers/s390/net/ctcm_mpc.c:1210 ctcmpc_unpack_skb() warn: possible memory leak of 'mpcginfo' mpc_action_discontact() did not free mpcginfo. Consolidate the freeing in ctcmpc_unpack_skb(). Fixes: 293d984f0e36 ("ctcm: infrastructure for replaced ctc driver") Signed-off-by: Alexandra Winter Signed-off-by: David S. Miller drivers/s390/net/ctcm_mpc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) commit 2c50c6867c85afee6f2b3bcbc50fc9d0083d1343 Author: Alexandra Winter Date: Tue May 10 09:05:06 2022 +0200 s390/ctcm: fix variable dereferenced before check Found by cppcheck and smatch. smatch complains about drivers/s390/net/ctcm_sysfs.c:43 ctcm_buffer_write() warn: variable dereferenced before check 'priv' (see line 42) Fixes: 3c09e2647b5e ("ctcm: rename READ/WRITE defines to avoid redefinitions") Reported-by: Colin Ian King Signed-off-by: Alexandra Winter Signed-off-by: David S. Miller drivers/s390/net/ctcm_sysfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 2423b0d0724d47897c8a3a988f62aedd3e87ceba Merge: 0807ce0b0104 2120b7f4d128 Author: David S. Miller Date: Wed May 11 12:25:07 2022 +0100 Merge branch 'atlantic-fixes' Grant Grundler says: ==================== net: atlantic: more fuzzing fixes It essentially describes four problems: 1) validate rxd_wb->next_desc_ptr before populating buff->next 2) "frag[0] not initialized" case in aq_ring_rx_clean() 3) limit iterations handling fragments in aq_ring_rx_clean() 4) validate hw_head_ in hw_atl_b0_hw_ring_tx_head_update() (1) was fixed by Zekun Shen around the same time with "atlantic: Fix buff_ring OOB in aq_ring_rx_clean" (SHA1 5f50153288452e10). I've added one "clean up" contribution: "net: atlantic: reduce scope of is_rsc_complete" I tested the "original" patches using chromeos-v5.4 kernel branch: https://chromium-review.googlesource.com/q/hashtag:pcinet-atlantic-2022q1+(status:open%20OR%20status:merged) I've forward ported those patches to 5.18-rc2 and compiled them but am unable to test them on 5.18-rc2 kernel (logistics problems). Credit largely goes to ChromeOS Fuzzing team members: Aashay Shringarpure, Yi Chou, Shervin Oloumi V2 changes: o drop first patch - was already fixed upstream differently o reduce (4) "validate hw_head_" to simple bounds checking. ==================== Signed-off-by: David S. Miller commit 2120b7f4d128433ad8c5f503a9584deba0684901 Author: Grant Grundler Date: Mon May 9 19:28:26 2022 -0700 net: atlantic: verify hw_head_ lies within TX buffer ring Bounds check hw_head index provided by NIC to verify it lies within the TX buffer ring. Reported-by: Aashay Shringarpure Reported-by: Yi Chou Reported-by: Shervin Oloumi Signed-off-by: Grant Grundler Signed-off-by: David S. Miller drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 6aecbba12b5c90b26dc062af3b9de8c4b3a2f19f Author: Grant Grundler Date: Mon May 9 19:28:25 2022 -0700 net: atlantic: add check for MAX_SKB_FRAGS Enforce that the CPU can not get stuck in an infinite loop. Reported-by: Aashay Shringarpure Reported-by: Yi Chou Reported-by: Shervin Oloumi Signed-off-by: Grant Grundler Signed-off-by: David S. Miller drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 79784d77ebbd3ec516b7a5ce555d979fb7946202 Author: Grant Grundler Date: Mon May 9 19:28:24 2022 -0700 net: atlantic: reduce scope of is_rsc_complete Don't defer handling the err case outside the loop. That's pointless. And since is_rsc_complete is only used inside this loop, declare it inside the loop to reduce it's scope. Signed-off-by: Grant Grundler Signed-off-by: David S. Miller drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit 62e0ae0f4020250f961cf8d0103a4621be74e077 Author: Grant Grundler Date: Mon May 9 19:28:23 2022 -0700 net: atlantic: fix "frag[0] not initialized" In aq_ring_rx_clean(), if buff->is_eop is not set AND buff->len < AQ_CFG_RX_HDR_SIZE, then hdr_len remains equal to buff->len and skb_add_rx_frag(xxx, *0*, ...) is not called. The loop following this code starts calling skb_add_rx_frag() starting with i=1 and thus frag[0] is never initialized. Since i is initialized to zero at the top of the primary loop, we can just reference and post-increment i instead of hardcoding the 0 when calling skb_add_rx_frag() the first time. Reported-by: Aashay Shringarpure Reported-by: Yi Chou Reported-by: Shervin Oloumi Signed-off-by: Grant Grundler Signed-off-by: David S. Miller drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 0807ce0b010418a191e0e4009803b2d74c3245d5 Author: Yang Yingliang Date: Tue May 10 11:13:16 2022 +0800 net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe() Switch to using pcim_enable_device() to avoid missing pci_disable_device(). Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220510031316.1780409-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 7752662071053adcdb6b6e7853834205dd60e1c0 Author: James Smart Date: Fri May 6 13:55:48 2022 -0700 scsi: lpfc: Correct BDE DMA address assignment for GEN_REQ_WQE Garbage FCoE CT frames are transmitted on the wire because of bad DMA ptr addresses filled in the GEN_REQ_WQE. The __lpfc_sli_prep_gen_req_s4() routine is using the wrong buffer for the payload address. Change the DMA buffer assignment from the bmp buffer to the bpl buffer. Link: https://lore.kernel.org/r/20220506205548.61644-1-jsmart2021@gmail.com Fixes: 61910d6a5243 ("scsi: lpfc: SLI path split: Refactor CT paths") Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_sli.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit cc28fac16ab7152168be8bee76708df9d65efd71 Author: James Smart Date: Fri May 6 13:55:28 2022 -0700 scsi: lpfc: Fix split code for FLOGI on FCoE The refactoring code converted context information from SLI-3 to SLI-4. The conversion for the SLI-4 bit field tried to use the old (hacky) SLI3 high/low bit settings. Needless to say, it was incorrect. Explicitly set the context field to type FCFI and set it in the wqe. SLI-4 is now a proper bit field so no need for the shifting/anding. Link: https://lore.kernel.org/r/20220506205528.61590-1-jsmart2021@gmail.com Fixes: 6831ce129f19 ("scsi: lpfc: SLI path split: Refactor base ELS paths and the FLOGI path") Co-developed-by: Dick Kennedy Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_els.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 792ea6a074ae7ea5ab6f1b8b31f76bb0297de66c Author: Lukas Wunner Date: Tue May 10 09:56:05 2022 +0200 genirq: Remove WARN_ON_ONCE() in generic_handle_domain_irq() Since commit 0953fb263714 ("irq: remove handle_domain_{irq,nmi}()"), generic_handle_domain_irq() warns if called outside hardirq context, even though the function calls down to handle_irq_desc(), which warns about the same, but conditionally on handle_enforce_irqctx(). The newly added warning is a false positive if the interrupt originates from any other irqchip than x86 APIC or ARM GIC/GICv3. Those are the only ones for which handle_enforce_irqctx() returns true. Per commit c16816acd086 ("genirq: Add protection against unsafe usage of generic_handle_irq()"): "In general calling generic_handle_irq() with interrupts disabled from non interrupt context is harmless. For some interrupt controllers like the x86 trainwrecks this is outright dangerous as it might corrupt state if an interrupt affinity change is pending." Examples for interrupt chips where the warning is a false positive are USB-attached GPIO controllers such as drivers/gpio/gpio-dln2.c: USB gadgets are incapable of directly signaling an interrupt because they cannot initiate a bus transaction by themselves. All communication on the bus is initiated by the host controller, which polls a gadget's Interrupt Endpoint in regular intervals. If an interrupt is pending, that information is passed up the stack in softirq context, from which a hardirq is synthesized via generic_handle_domain_irq(). Remove the warning to eliminate such false positives. Fixes: 0953fb263714 ("irq: remove handle_domain_{irq,nmi}()") Signed-off-by: Lukas Wunner Signed-off-by: Thomas Gleixner Cc: Marc Zyngier Cc: Mark Rutland Cc: Jakub Kicinski CC: Linus Walleij Cc: Bartosz Golaszewski Cc: Octavian Purdila Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220505113207.487861b2@kernel.org Link: https://lore.kernel.org/r/20220506203242.GA1855@wunner.de Link: https://lore.kernel.org/r/c3caf60bfa78e5fdbdf483096b7174da65d1813a.1652168866.git.lukas@wunner.de kernel/irq/irqdesc.c | 1 - 1 file changed, 1 deletion(-) commit 12a4d677b1c34717443470c1492fe520638ef39a Author: Wan Jiabing Date: Mon May 9 22:45:19 2022 +0800 net: phy: micrel: Fix incorrect variable type in micrel In lanphy_read_page_reg, calling __phy_read() might return a negative error code. Use 'int' to check the error code. Fixes: 7c2dcfa295b1 ("net: phy: micrel: Add support for LAN8804 PHY") Signed-off-by: Wan Jiabing Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220509144519.2343399-1-wanjiabing@vivo.com Signed-off-by: Jakub Kicinski drivers/net/phy/micrel.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit feb9c5e19e913b53cb536a7aa7c9f20107bb51ec Merge: 9be9ed2612b5 7ff960a6fe39 Author: Linus Torvalds Date: Tue May 10 11:15:05 2022 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fix from Michael Tsirkin: "A last minute fixup of the transitional ID numbers. Important to get these right - if users start to depend on the wrong ones they are very hard to fix" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: virtio: fix virtio transitional ids commit 575f00edea0a7117e6a4337800ebf62e2a1d09d6 Author: Catalin Marinas Date: Thu Mar 24 15:16:05 2022 +0000 Documentation/process: Update ARM contact for embargoed hardware issues With Grant taking a prominent role in Linaro, I will take over as the process ambassador for ARM w.r.t. embargoed hardware issues. Signed-off-by: Catalin Marinas Cc: Grant Likely Cc: Jonathan Corbet Signed-off-by: Jonathan Corbet Signed-off-by: Greg Kroah-Hartman Documentation/process/embargoed-hardware-issues.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c46721e4604f260918e660550a16d1e28637d66c Author: Mathieu Poirier Date: Mon May 9 10:35:10 2022 -0600 MAINTAINERS: Add James and Mike as Arm64 performance events reviewers James, Mike and Leo have been doing all the reviews and development work for the Coresight perf tools for a couple of years now. As such remove my name and add James and Mike as official reviewers (Leo is already listed as such). Signed-off-by: Mathieu Poirier Cc: James Clark Cc: Leo Yan Cc: Mike Leach Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Arnaldo Carvalho de Melo MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit c1ad35dd0548ce947d97aaf92f7f2f9a202951cf Author: Jan Kara Date: Tue May 10 12:36:04 2022 +0200 udf: Avoid using stale lengthOfImpUse udf_write_fi() uses lengthOfImpUse of the entry it is writing to. However this field has not yet been initialized so it either contains completely bogus value or value from last directory entry at that place. In either case this is wrong and can lead to filesystem corruption or kernel crashes. Reported-by: butt3rflyh4ck CC: stable@vger.kernel.org Fixes: 979a6e28dd96 ("udf: Get rid of 0-length arrays in struct fileIdentDesc") Signed-off-by: Jan Kara fs/udf/namei.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 7ff960a6fe399fdcbca6159063684671ae57eee9 Author: Shunsuke Mie Date: Tue May 10 19:27:23 2022 +0900 virtio: fix virtio transitional ids This commit fixes the transitional PCI device ID. Fixes: d61914ea6ada ("virtio: update virtio id table, add transitional ids") Signed-off-by: Shunsuke Mie Link: https://lore.kernel.org/r/20220510102723.87666-1-mie@igel.co.jp Signed-off-by: Michael S. Tsirkin include/uapi/linux/virtio_ids.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit 205f3991a273cac6008ef4db3d1c0dc54d14fb56 Author: Joey Gouly Date: Tue May 10 11:27:21 2022 +0100 arm64: vdso: fix makefile dependency on vdso.so There is currently no dependency for vdso*-wrap.S on vdso*.so, which means that you can get a build that uses a stale vdso*-wrap.o. In commit a5b8ca97fbf8, the file that includes the vdso.so was moved and renamed from arch/arm64/kernel/vdso/vdso.S to arch/arm64/kernel/vdso-wrap.S, when this happened the Makefile was not updated to force the dependcy on vdso.so. Fixes: a5b8ca97fbf8 ("arm64: do not descend to vdso directories twice") Signed-off-by: Joey Gouly Cc: Masahiro Yamada Cc: Vincenzo Frascino Cc: Catalin Marinas Cc: Will Deacon Link: https://lore.kernel.org/r/20220510102721.50811-1-joey.gouly@arm.com Signed-off-by: Will Deacon arch/arm64/kernel/Makefile | 4 ++++ arch/arm64/kernel/vdso/Makefile | 3 --- arch/arm64/kernel/vdso32/Makefile | 3 --- 3 files changed, 4 insertions(+), 6 deletions(-) commit dc5306a8c0eace6c113aded2e36ae5e15fdca4d7 Author: Kees Cook Date: Sun May 8 03:22:17 2022 -0700 decnet: Use container_of() for struct dn_neigh casts Clang's structure layout randomization feature gets upset when it sees struct neighbor (which is randomized) cast to struct dn_neigh: net/decnet/dn_route.c:1123:15: error: casting from randomized structure pointer type 'struct neighbour *' to 'struct dn_neigh *' gateway = ((struct dn_neigh *)neigh)->addr; ^ Update all the open-coded casts to use container_of() to do the conversion instead of depending on strict member ordering. Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/202205041247.WKBEHGS5-lkp@intel.com Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Yajun Deng Cc: Zheng Yongjun Cc: Bill Wendling Cc: linux-decnet-user@lists.sourceforge.net Cc: netdev@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220508102217.2647184-1-keescook@chromium.org Signed-off-by: Paolo Abeni net/decnet/dn_dev.c | 4 ++-- net/decnet/dn_neigh.c | 3 ++- net/decnet/dn_route.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) commit 846a3351ddfe4a86eede4bb26a205c3f38ef84d3 Author: Jing Xia Date: Tue May 10 10:35:14 2022 +0800 writeback: Avoid skipping inode writeback We have run into an issue that a task gets stuck in balance_dirty_pages_ratelimited() when perform I/O stress testing. The reason we observed is that an I_DIRTY_PAGES inode with lots of dirty pages is in b_dirty_time list and standard background writeback cannot writeback the inode. After studing the relevant code, the following scenario may lead to the issue: task1 task2 ----- ----- fuse_flush write_inode_now //in b_dirty_time writeback_single_inode __writeback_single_inode fuse_write_end filemap_dirty_folio __xa_set_mark:PAGECACHE_TAG_DIRTY lock inode->i_lock if mapping tagged PAGECACHE_TAG_DIRTY inode->i_state |= I_DIRTY_PAGES unlock inode->i_lock __mark_inode_dirty:I_DIRTY_PAGES lock inode->i_lock -was dirty,inode stays in -b_dirty_time unlock inode->i_lock if(!(inode->i_state & I_DIRTY_All)) -not true,so nothing done This patch moves the dirty inode to b_dirty list when the inode currently is not queued in b_io or b_more_io list at the end of writeback_single_inode. Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig CC: stable@vger.kernel.org Fixes: 0ae45f63d4ef ("vfs: add support for a lazytime mount option") Signed-off-by: Jing Xia Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220510023514.27399-1-jing.xia@unisoc.com fs/fs-writeback.c | 4 ++++ 1 file changed, 4 insertions(+) commit ef3a6b70507a2add2cd2e01f5eb9b54d561bacb9 Author: Charan Teja Reddy Date: Tue May 10 01:19:57 2022 +0530 dma-buf: call dma_buf_stats_setup after dmabuf is in valid list When dma_buf_stats_setup() fails, it closes the dmabuf file which results into the calling of dma_buf_file_release() where it does list_del(&dmabuf->list_node) with out first adding it to the proper list. This is resulting into panic in the below path: __list_del_entry_valid+0x38/0xac dma_buf_file_release+0x74/0x158 __fput+0xf4/0x428 ____fput+0x14/0x24 task_work_run+0x178/0x24c do_notify_resume+0x194/0x264 work_pending+0xc/0x5f0 Fix it by moving the dma_buf_stats_setup() after dmabuf is added to the list. Fixes: bdb8d06dfefd ("dmabuf: Add the capability to expose DMA-BUF stats in sysfs") Signed-off-by: Charan Teja Reddy Tested-by: T.J. Mercier Acked-by: T.J. Mercier Cc: # 5.15.x+ Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/1652125797-2043-1-git-send-email-quic_charante@quicinc.com drivers/dma-buf/dma-buf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 1809c30b6e5a83a1de1435fe01aaa4de4d626a7c Author: Manuel Ullmann Date: Wed May 4 21:30:44 2022 +0200 net: atlantic: always deep reset on pm op, fixing up my null deref regression The impact of this regression is the same for resume that I saw on thaw: the kernel hangs and nothing except SysRq rebooting can be done. Fixes regression in commit cbe6c3a8f8f4 ("net: atlantic: invert deep par in pm functions, preventing null derefs"), where I disabled deep pm resets in suspend and resume, trying to make sense of the atl_resume_common() deep parameter in the first place. It turns out, that atlantic always has to deep reset on pm operations. Even though I expected that and tested resume, I screwed up by kexec-rebooting into an unpatched kernel, thus missing the breakage. This fixup obsoletes the deep parameter of atl_resume_common, but I leave the cleanup for the maintainers to post to mainline. Suspend and hibernation were successfully tested by the reporters. Fixes: cbe6c3a8f8f4 ("net: atlantic: invert deep par in pm functions, preventing null derefs") Link: https://lore.kernel.org/regressions/9-Ehc_xXSwdXcvZqKD5aSqsqeNj5Izco4MYEwnx5cySXVEc9-x_WC4C3kAoCqNTi-H38frroUK17iobNVnkLtW36V6VWGSQEOHXhmVMm5iQ=@protonmail.com/ Reported-by: Jordan Leppert Reported-by: Holger Hoffstaette Tested-by: Jordan Leppert Tested-by: Holger Hoffstaette CC: # 5.10+ Signed-off-by: Manuel Ullmann Link: https://lore.kernel.org/r/87bkw8dfmp.fsf@posteo.de Signed-off-by: Paolo Abeni drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 642d51fb0775a41dd6bb3d99b5a40c24df131c20 Author: Xiubo Li Date: Thu May 5 18:53:09 2022 +0800 ceph: check folio PG_private bit instead of folio->private The pages in the file mapping maybe reclaimed and reused by other subsystems and the page->private maybe used as flags field or something else, if later that pages are used by page caches again the page->private maybe not cleared as expected. Here will check the PG_private bit instead of the folio->private. Cc: stable@vger.kernel.org URL: https://tracker.ceph.com/issues/55421 Signed-off-by: Xiubo Li Reviewed-by: Luis Henriques Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov fs/ceph/addr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 620239d9a32e9fe27c9204ec11e40058671aeeb6 Author: Jeff Layton Date: Mon Apr 25 15:54:27 2022 -0400 ceph: fix setting of xattrs on async created inodes Currently when we create a file, we spin up an xattr buffer to send along with the create request. If we end up doing an async create however, then we currently pass down a zero-length xattr buffer. Fix the code to send down the xattr buffer in req->r_pagelist. If the xattrs span more than a page, however give up and don't try to do an async create. Cc: stable@vger.kernel.org URL: https://bugzilla.redhat.com/show_bug.cgi?id=2063929 Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible") Reported-by: John Fortin Reported-by: Sri Ramanujam Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov fs/ceph/file.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) commit fc54e39199928cb09f5423654f344631ac5956fb Merge: 630fd4822af2 a063f2fba3fa Author: Jakub Kicinski Date: Mon May 9 18:16:46 2022 -0700 Merge tag 'batadv-net-pullrequest-20220508' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== Here is a batman-adv bugfix: - Don't skb_split skbuffs with frag_list, by Sven Eckelmann * tag 'batadv-net-pullrequest-20220508' of git://git.open-mesh.org/linux-merge: batman-adv: Don't skb_split skbuffs with frag_list ==================== Link: https://lore.kernel.org/r/20220508132110.20451-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski commit 630fd4822af2374cd75c682b7665dcb367613765 Author: Vladimir Oltean Date: Sat May 7 16:45:50 2022 +0300 net: dsa: flush switchdev workqueue on bridge join error path There is a race between switchdev_bridge_port_offload() and the dsa_port_switchdev_sync_attrs() call right below it. When switchdev_bridge_port_offload() finishes, FDB entries have been replayed by the bridge, but are scheduled for deferred execution later. However dsa_port_switchdev_sync_attrs -> dsa_port_can_apply_vlan_filtering() may impose restrictions on the vlan_filtering attribute and refuse offloading. When this happens, the delayed FDB entries will dereference dp->bridge, which is a NULL pointer because we have stopped the process of offloading this bridge. Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Workqueue: dsa_ordered dsa_slave_switchdev_event_work pc : dsa_port_bridge_host_fdb_del+0x64/0x100 lr : dsa_slave_switchdev_event_work+0x130/0x1bc Call trace: dsa_port_bridge_host_fdb_del+0x64/0x100 dsa_slave_switchdev_event_work+0x130/0x1bc process_one_work+0x294/0x670 worker_thread+0x80/0x460 ---[ end trace 0000000000000000 ]--- Error: dsa_core: Must first remove VLAN uppers having VIDs also present in bridge. Fix the bug by doing what we do on the normal bridge leave path as well, which is to wait until the deferred FDB entries complete executing, then exit. The placement of dsa_flush_workqueue() after switchdev_bridge_port_unoffload() guarantees that both the FDB additions and deletions on rollback are waited for. Fixes: d7d0d423dbaa ("net: dsa: flush switchdev workqueue when leaving the bridge") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220507134550.1849834-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski net/dsa/port.c | 1 + 1 file changed, 1 insertion(+) commit d75b4c7deed1ea87161e22fda6a4c5a73dbc70ef Merge: 91a7cda1f4b8 a11b6c1a383f Author: Jakub Kicinski Date: Mon May 9 17:54:26 2022 -0700 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-05-06 This series contains updates to ice driver only. Ivan Vecera fixes a race with aux plug/unplug by delaying setting adev until initialization is complete and adding locking. Anatolii ensures VF queues are completely disabled before attempting to reconfigure them. Michal ensures stale Tx timestamps are cleared from hardware. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: fix PTP stale Tx timestamps cleanup ice: clear stale Tx queue settings before configuring ice: Fix race during aux device (un)plugging ==================== Link: https://lore.kernel.org/r/20220506174129.4976-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 91a7cda1f4b8bdf770000a3b60640576dafe0cec Author: Francesco Dolcini Date: Fri May 6 08:08:15 2022 +0200 net: phy: Fix race condition on link status change This fixes the following error caused by a race condition between phydev->adjust_link() and a MDIO transaction in the phy interrupt handler. The issue was reproduced with the ethernet FEC driver and a micrel KSZ9031 phy. [ 146.195696] fec 2188000.ethernet eth0: MDIO read timeout [ 146.201779] ------------[ cut here ]------------ [ 146.206671] WARNING: CPU: 0 PID: 571 at drivers/net/phy/phy.c:942 phy_error+0x24/0x6c [ 146.214744] Modules linked in: bnep imx_vdoa imx_sdma evbug [ 146.220640] CPU: 0 PID: 571 Comm: irq/128-2188000 Not tainted 5.18.0-rc3-00080-gd569e86915b7 #9 [ 146.229563] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 146.236257] unwind_backtrace from show_stack+0x10/0x14 [ 146.241640] show_stack from dump_stack_lvl+0x58/0x70 [ 146.246841] dump_stack_lvl from __warn+0xb4/0x24c [ 146.251772] __warn from warn_slowpath_fmt+0x5c/0xd4 [ 146.256873] warn_slowpath_fmt from phy_error+0x24/0x6c [ 146.262249] phy_error from kszphy_handle_interrupt+0x40/0x48 [ 146.268159] kszphy_handle_interrupt from irq_thread_fn+0x1c/0x78 [ 146.274417] irq_thread_fn from irq_thread+0xf0/0x1dc [ 146.279605] irq_thread from kthread+0xe4/0x104 [ 146.284267] kthread from ret_from_fork+0x14/0x28 [ 146.289164] Exception stack(0xe6fa1fb0 to 0xe6fa1ff8) [ 146.294448] 1fa0: 00000000 00000000 00000000 00000000 [ 146.302842] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 146.311281] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 146.318262] irq event stamp: 12325 [ 146.321780] hardirqs last enabled at (12333): [] __up_console_sem+0x50/0x60 [ 146.330013] hardirqs last disabled at (12342): [] __up_console_sem+0x3c/0x60 [ 146.338259] softirqs last enabled at (12324): [] __do_softirq+0x2c0/0x624 [ 146.346311] softirqs last disabled at (12319): [] __irq_exit_rcu+0x138/0x178 [ 146.354447] ---[ end trace 0000000000000000 ]--- With the FEC driver phydev->adjust_link() calls fec_enet_adjust_link() calls fec_stop()/fec_restart() and both these function reset and temporary disable the FEC disrupting any MII transaction that could be happening at the same time. fec_enet_adjust_link() and phy_read() can be running at the same time when we have one additional interrupt before the phy_state_machine() is able to terminate. Thread 1 (phylib WQ) | Thread 2 (phy interrupt) | | phy_interrupt() <-- PHY IRQ | handle_interrupt() | phy_read() | phy_trigger_machine() | --> schedule phylib WQ | | phy_state_machine() | phy_check_link_status() | phy_link_change() | phydev->adjust_link() | fec_enet_adjust_link() | --> FEC reset | phy_interrupt() <-- PHY IRQ | phy_read() | Fix this by acquiring the phydev lock in phy_interrupt(). Link: https://lore.kernel.org/all/20220422152612.GA510015@francesco-nb.int.toradex.com/ Fixes: c974bdbc3e77 ("net: phy: Use threaded IRQ, to allow IRQ from sleeping devices") cc: Signed-off-by: Francesco Dolcini Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220506060815.327382-1-francesco.dolcini@toradex.com Signed-off-by: Jakub Kicinski drivers/net/phy/phy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 9039b8335276569670caaf23606335946625e764 Author: SeongJae Park Date: Mon May 9 17:34:29 2022 -0700 MAINTAINERS: add a mailing list for DAMON development This commit adds an open mailing list for DAMON in MAINTAINERS file. Link: https://lkml.kernel.org/r/20220503180741.137079-1-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit 41c240099fe09377b6b9f8272e45d2267c843d3e Author: Joel Savitz Date: Mon May 9 17:34:29 2022 -0700 selftests: vm: Makefile: rename TARGETS to VMTARGETS The tools/testing/selftests/vm/Makefile uses the variable TARGETS internally to generate a list of platform-specific binary build targets suffixed with _{32,64}. When building the selftests using its own Makefile directly, such as via the following command run in a kernel tree: One receives an error such as the following: make: Entering directory '/root/linux/tools/testing/selftests' make --no-builtin-rules ARCH=x86 -C ../../.. headers_install make[1]: Entering directory '/root/linux' INSTALL ./usr/include make[1]: Leaving directory '/root/linux' make[1]: Entering directory '/root/linux/tools/testing/selftests/vm' make[1]: *** No rule to make target 'vm.c', needed by '/root/linux/tools/testing/selftests/vm/vm_64'. Stop. make[1]: Leaving directory '/root/linux/tools/testing/selftests/vm' make: *** [Makefile:175: all] Error 2 make: Leaving directory '/root/linux/tools/testing/selftests' The TARGETS variable passed to tools/testing/selftests/Makefile collides with the TARGETS used in tools/testing/selftests/vm/Makefile, so rename the latter to VMTARGETS, eliminating the collision with no functional change. Link: https://lkml.kernel.org/r/20220504213454.1282532-1-jsavitz@redhat.com Fixes: f21fda8f6453 ("selftests: vm: pkeys: fix multilib builds for x86") Signed-off-by: Joel Savitz Acked-by: Nico Pache Cc: Joel Savitz Cc: Shuah Khan Cc: Sandipan Das Cc: Dave Hansen Signed-off-by: Andrew Morton tools/testing/selftests/vm/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 2839b0999c20c9f6bf353849c69370e121e2fa1a Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Mon May 9 17:34:29 2022 -0700 mm/kfence: reset PG_slab and memcg_data before freeing __kfence_pool When kfence fails to initialize kfence pool, it frees the pool. But it does not reset memcg_data and PG_slab flag. Below is a BUG because of this. Let's fix it by resetting memcg_data and PG_slab flag before free. [ 0.089149] BUG: Bad page state in process swapper/0 pfn:3d8e06 [ 0.089149] page:ffffea46cf638180 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3d8e06 [ 0.089150] memcg:ffffffff94a475d1 [ 0.089150] flags: 0x17ffffc0000200(slab|node=0|zone=2|lastcpupid=0x1fffff) [ 0.089151] raw: 0017ffffc0000200 ffffea46cf638188 ffffea46cf638188 0000000000000000 [ 0.089152] raw: 0000000000000000 0000000000000000 00000000ffffffff ffffffff94a475d1 [ 0.089152] page dumped because: page still charged to cgroup [ 0.089153] Modules linked in: [ 0.089153] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G B W 5.18.0-rc1+ #965 [ 0.089154] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 [ 0.089154] Call Trace: [ 0.089155] [ 0.089155] dump_stack_lvl+0x49/0x5f [ 0.089157] dump_stack+0x10/0x12 [ 0.089158] bad_page.cold+0x63/0x94 [ 0.089159] check_free_page_bad+0x66/0x70 [ 0.089160] __free_pages_ok+0x423/0x530 [ 0.089161] __free_pages_core+0x8e/0xa0 [ 0.089162] memblock_free_pages+0x10/0x12 [ 0.089164] memblock_free_late+0x8f/0xb9 [ 0.089165] kfence_init+0x68/0x92 [ 0.089166] start_kernel+0x789/0x992 [ 0.089167] x86_64_start_reservations+0x24/0x26 [ 0.089168] x86_64_start_kernel+0xa9/0xaf [ 0.089170] secondary_startup_64_no_verify+0xd5/0xdb [ 0.089171] Link: https://lkml.kernel.org/r/YnPG3pQrqfcgOlVa@hyeyoo Fixes: 0ce20dd84089 ("mm: add Kernel Electric-Fence infrastructure") Fixes: 8f0b36497303 ("mm: kfence: fix objcgs vector allocation") Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Marco Elver Reviewed-by: Muchun Song Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton mm/kfence/core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 5fcaa7caf5fa7f3ad9eaba1897f226d520f963cc Author: Martyna Szapar-Mudlaw Date: Mon May 9 17:34:29 2022 -0700 mailmap: add entry for martyna.szapar-mudlaw@intel.com Separate linux.intel.com account was created for submitting and reviewing kernel patches, thus need to map previously used primary Intel e-mail address. Link: https://lkml.kernel.org/r/20220505132624.41802-1-martyna.szapar-mudlaw@linux.intel.com Signed-off-by: Martyna Szapar-Mudlaw Signed-off-by: Andrew Morton .mailmap | 1 + 1 file changed, 1 insertion(+) commit 260364d112bc822005224667c0c9b1b17a53eafd Author: Mike Rapoport Date: Mon May 9 17:34:28 2022 -0700 arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map The semantics of pfn_valid() is to check presence of the memory map for a PFN and not whether a PFN is covered by the linear map. The memory map may be present for NOMAP memory regions, but they won't be mapped in the linear mapping. Accessing such regions via __va() when they are memremap()'ed will cause a crash. On v5.4.y the crash happens on qemu-arm with UEFI [1]: <1>[ 0.084476] 8<--- cut here --- <1>[ 0.084595] Unable to handle kernel paging request at virtual address dfb76000 <1>[ 0.084938] pgd = (ptrval) <1>[ 0.085038] [dfb76000] *pgd=5f7fe801, *pte=00000000, *ppte=00000000 ... <4>[ 0.093923] [] (memcpy) from [] (dmi_setup+0x60/0x418) <4>[ 0.094204] [] (dmi_setup) from [] (arm_dmi_init+0x8/0x10) <4>[ 0.094408] [] (arm_dmi_init) from [] (do_one_initcall+0x50/0x228) <4>[ 0.094619] [] (do_one_initcall) from [] (kernel_init_freeable+0x15c/0x1f8) <4>[ 0.094841] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x10c) <4>[ 0.095057] [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) On kernels v5.10.y and newer the same crash won't reproduce on ARM because commit b10d6bca8720 ("arch, drivers: replace for_each_membock() with for_each_mem_range()") changed the way memory regions are registered in the resource tree, but that merely covers up the problem. On ARM64 memory resources registered in yet another way and there the issue of wrong usage of pfn_valid() to ensure availability of the linear map is also covered. Implement arch_memremap_can_ram_remap() on ARM and ARM64 to prevent access to NOMAP regions via the linear mapping in memremap(). Link: https://lore.kernel.org/all/Yl65zxGgFzF1Okac@sirena.org.uk Link: https://lkml.kernel.org/r/20220426060107.7618-1-rppt@kernel.org Signed-off-by: Mike Rapoport Reported-by: "kernelci.org bot" Tested-by: Mark Brown Reviewed-by: Ard Biesheuvel Acked-by: Catalin Marinas Cc: Greg Kroah-Hartman Cc: Mark Brown Cc: Mark-PK Tsai Cc: Russell King Cc: Tony Lindgren Cc: Will Deacon Cc: [5.4+] Signed-off-by: Andrew Morton arch/arm/include/asm/io.h | 3 +++ arch/arm/mm/ioremap.c | 8 ++++++++ arch/arm64/include/asm/io.h | 4 ++++ arch/arm64/mm/ioremap.c | 8 ++++++++ 4 files changed, 23 insertions(+) commit 1927e498aee1757b3df755a194cbfc5cc0f2b663 Author: Kalesh Singh Date: Mon May 9 17:34:28 2022 -0700 procfs: prevent unprivileged processes accessing fdinfo dir The file permissions on the fdinfo dir from were changed from S_IRUSR|S_IXUSR to S_IRUGO|S_IXUGO, and a PTRACE_MODE_READ check was added for opening the fdinfo files [1]. However, the ptrace permission check was not added to the directory, allowing anyone to get the open FD numbers by reading the fdinfo directory. Add the missing ptrace permission check for opening the fdinfo directory. [1] https://lkml.kernel.org/r/20210308170651.919148-1-kaleshsingh@google.com Link: https://lkml.kernel.org/r/20210713162008.1056986-1-kaleshsingh@google.com Fixes: 7bc3fa0172a4 ("procfs: allow reading fdinfo with PTRACE_MODE_READ") Signed-off-by: Kalesh Singh Cc: Kees Cook Cc: Eric W. Biederman Cc: Christian Brauner Cc: Suren Baghdasaryan Cc: Hridya Valsaraju Cc: Jann Horn Signed-off-by: Andrew Morton fs/proc/fd.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) commit 7d1e6496616275f3830e2f2f91fa69a66953e95b Author: Niels Dossche Date: Mon May 9 17:34:28 2022 -0700 mm: mremap: fix sign for EFAULT error return value The mremap syscall is supposed to return a pointer to the new virtual memory area on success, and a negative value of the error code in case of failure. Currently, EFAULT is returned when the VMA is not found, instead of -EFAULT. The users of this syscall will therefore believe the syscall succeeded in case the VMA didn't exist, as it returns a pointer to address 0xe (0xe being the value of EFAULT). Fix the sign of the error value. Link: https://lkml.kernel.org/r/20220427224439.23828-2-dossche.niels@gmail.com Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma") Signed-off-by: Niels Dossche Cc: Mina Almasry Cc: Mike Kravetz Cc: Signed-off-by: Andrew Morton mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 151d6dcbed836270c6c240932da66f147950cbdb Author: Randy Dunlap Date: Mon May 9 16:47:40 2022 -0700 hwmon: (ltq-cputemp) restrict it to SOC_XWAY Building with SENSORS_LTQ_CPUTEMP=y with SOC_FALCON=y causes build errors since FALCON does not support the same features as XWAY. Change this symbol to depend on SOC_XWAY since that provides the necessary interfaces. Repairs these build errors: ../drivers/hwmon/ltq-cputemp.c: In function 'ltq_cputemp_enable': ../drivers/hwmon/ltq-cputemp.c:23:9: error: implicit declaration of function 'ltq_cgu_w32'; did you mean 'ltq_ebu_w32'? [-Werror=implicit-function-declaration] 23 | ltq_cgu_w32(ltq_cgu_r32(CGU_GPHY1_CR) | CGU_TEMP_PD, CGU_GPHY1_CR); ../drivers/hwmon/ltq-cputemp.c:23:21: error: implicit declaration of function 'ltq_cgu_r32'; did you mean 'ltq_ebu_r32'? [-Werror=implicit-function-declaration] 23 | ltq_cgu_w32(ltq_cgu_r32(CGU_GPHY1_CR) | CGU_TEMP_PD, CGU_GPHY1_CR); ../drivers/hwmon/ltq-cputemp.c: In function 'ltq_cputemp_probe': ../drivers/hwmon/ltq-cputemp.c:92:31: error: 'SOC_TYPE_VR9_2' undeclared (first use in this function) 92 | if (ltq_soc_type() != SOC_TYPE_VR9_2) Fixes: 7074d0a92758 ("hwmon: (ltq-cputemp) add cpu temp sensor driver") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Florian Eckert Cc: Guenter Roeck Cc: Jean Delvare Cc: linux-hwmon@vger.kernel.org Link: https://lore.kernel.org/r/20220509234740.26841-1-rdunlap@infradead.org Signed-off-by: Guenter Roeck drivers/hwmon/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ee1444b5e1df4155b591d0d9b1e72853a99ea861 Author: Jesse Brandeburg Date: Fri May 6 18:10:38 2022 -0700 dim: initialize all struct fields The W=2 build pointed out that the code wasn't initializing all the variables in the dim_cq_moder declarations with the struct initializers. The net change here is zero since these structs were already static const globals and were initialized with zeros by the compiler, but removing compiler warnings has value in and of itself. lib/dim/net_dim.c: At top level: lib/dim/net_dim.c:54:9: warning: missing initializer for field ‘comps’ of ‘const struct dim_cq_moder’ [-Wmissing-field-initializers] 54 | NET_DIM_RX_EQE_PROFILES, | ^~~~~~~~~~~~~~~~~~~~~~~ In file included from lib/dim/net_dim.c:6: ./include/linux/dim.h:45:13: note: ‘comps’ declared here 45 | u16 comps; | ^~~~~ and repeats for the tx struct, and once you fix the comps entry then the cq_period_mode field needs the same treatment. Use the commonly accepted style to indicate to the compiler that we know what we're doing, and add a comma at the end of each struct initializer to clean up the issue, and use explicit initializers for the fields we are initializing which makes the compiler happy. While here and fixing these lines, clean up the code slightly with a fix for the super long lines by removing the word "_MODERATION" from a couple defines only used in this file. Fixes: f8be17b81d44 ("lib/dim: Fix -Wunused-const-variable warnings") Signed-off-by: Jesse Brandeburg Link: https://lore.kernel.org/r/20220507011038.14568-1-jesse.brandeburg@intel.com Signed-off-by: Jakub Kicinski lib/dim/net_dim.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) commit 4bd46bb037f8e1883dbe1fc9e79896b7f885db3f Author: Jonathan Lemon Date: Fri May 6 15:37:39 2022 -0700 ptp: ocp: Use DIV64_U64_ROUND_UP for rounding. The initial code used roundup() to round the starting time to a multiple of a period. This generated an error on 32-bit systems, so was replaced with DIV_ROUND_UP_ULL(). However, this truncates to 32-bits on a 64-bit system. Replace with DIV64_U64_ROUND_UP() instead. Fixes: b325af3cfab9 ("ptp: ocp: Add signal generators and update sysfs nodes") Signed-off-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220506223739.1930-2-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski drivers/ptp/ptp_ocp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 51ca86b4c9c7c75f5630fa0dbe5f8f0bd98e3c3e Author: Yang Yingliang Date: Fri May 6 17:42:50 2022 +0800 ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one() Fix the missing pci_disable_device() before return from tulip_init_one() in the error handling case. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220506094250.3630615-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/dec/tulip/tulip_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit e4b1045bf9cfec6f70ac6d3783be06c3a88dcb25 Author: Yang Yingliang Date: Fri May 6 11:40:40 2022 +0800 ionic: fix missing pci_release_regions() on error in ionic_probe() If ionic_map_bars() fails, pci_release_regions() need be called. Fixes: fbfb8031533c ("ionic: Add hardware init and device commands") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220506034040.2614129-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 085d16d5f949b64713d5e960d6c9bbf51bc1d511 Author: Dan Aloni Date: Sun May 8 15:54:50 2022 +0300 nfs: fix broken handling of the softreval mount option Turns out that ever since this mount option was added, passing `softreval` in NFS mount options cancelled all other flags while not affecting the underlying flag `NFS_MOUNT_SOFTREVAL`. Fixes: c74dfe97c104 ("NFS: Add mount option 'softreval'") Signed-off-by: Dan Aloni Signed-off-by: Trond Myklebust fs/nfs/fs_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9be9ed2612b5aedb52a2c240edb1630b6b743cb6 Merge: c5eb0a61238d 44acfc22c7d0 Author: Linus Torvalds Date: Mon May 9 08:48:59 2022 -0700 Merge tag 'platform-drivers-x86-v5.18-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: - thinkpad_acpi AMD suspend/resume + fan detection fixes - two other small fixes - one hardware-id addition * tag 'platform-drivers-x86-v5.18-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/surface: aggregator: Fix initialization order when compiling as builtin module platform/surface: gpe: Add support for Surface Pro 8 platform/x86/intel: Fix 'rmmod pmt_telemetry' panic platform/x86: thinkpad_acpi: Correct dual fan probe platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of laptops platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks commit fe503887eed6ea528e144ec8dacfa1d47aa701ac Author: Miaoqian Lin Date: Fri Apr 29 17:49:17 2022 +0100 slimbus: qcom: Fix IRQ check in qcom_slim_probe platform_get_irq() returns non-zero IRQ number on success, negative error number on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: ad7fcbc308b0 ("slimbus: qcom: Add Qualcomm Slimbus controller driver") Cc: stable@vger.kernel.org Signed-off-by: Miaoqian Lin Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220429164917.5202-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/slimbus/qcom-ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a36e07dfe6ee71e209383ea9288cd8d1617e14f9 Author: Gleb Fotengauer-Malinovskiy Date: Fri May 6 17:24:54 2022 +0000 rfkill: uapi: fix RFKILL_IOCTL_MAX_SIZE ioctl request definition The definition of RFKILL_IOCTL_MAX_SIZE introduced by commit 54f586a91532 ("rfkill: make new event layout opt-in") is unusable since it is based on RFKILL_IOC_EXT_SIZE which has not been defined. Fix that by replacing the undefined constant with the constant which is intended to be used in this definition. Fixes: 54f586a91532 ("rfkill: make new event layout opt-in") Cc: stable@vger.kernel.org # 5.11+ Signed-off-by: Gleb Fotengauer-Malinovskiy Signed-off-by: Dmitry V. Levin Link: https://lore.kernel.org/r/20220506172454.120319-1-glebfm@altlinux.org [add commit message provided later by Dmitry] Signed-off-by: Johannes Berg include/uapi/linux/rfkill.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f971e1887fdb3ab500c9bebf4b98f62d49a20655 Author: Johannes Berg Date: Fri May 6 10:21:38 2022 +0200 nl80211: fix locking in nl80211_set_tx_bitrate_mask() This accesses the wdev's chandef etc., so cannot safely be used without holding the lock. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220506102136.06b7205419e6.I2a87c05fbd8bc5e565e84d190d4cfd2e92695a90@changeid Signed-off-by: Johannes Berg net/wireless/nl80211.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 9e2db50f1ef2238fc2f71c5de1c0418b7a5b0ea2 Author: Johannes Berg Date: Thu May 5 23:04:22 2022 +0200 mac80211_hwsim: call ieee80211_tx_prepare_skb under RCU protection This is needed since it might use (and pass out) pointers to e.g. keys protected by RCU. Can't really happen here as the frames aren't encrypted, but we need to still adhere to the rules. Fixes: cacfddf82baf ("mac80211_hwsim: initialize ieee80211_tx_info at hw_scan_work") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220505230421.5f139f9de173.I77ae111a28f7c0e9fd1ebcee7f39dbec5c606770@changeid Signed-off-by: Johannes Berg drivers/net/wireless/mac80211_hwsim.c | 3 +++ 1 file changed, 3 insertions(+) commit a59d55568d02bbbdf9c0cc15be9580180f855b4f Author: Johannes Berg Date: Thu May 5 23:04:21 2022 +0200 mac80211_hwsim: fix RCU protected chanctx access We need to RCU protect the chanctx_conf access, so do that. Fixes: 585625c955b1 ("mac80211_hwsim: check TX and STA bandwidth") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220505230421.fb8055c081a2.Ic6da3307c77a909bd61a0ea25dc2a4b08fe1b03f@changeid Signed-off-by: Johannes Berg drivers/net/wireless/mac80211_hwsim.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit c7e34c1e263f71b2dd78a12b6b7259a89b3a1f44 Author: Kalle Valo Date: Fri May 6 11:42:12 2022 +0300 mailmap: update Kalle Valo's email I switched to use my kernel.org address, the old kvalo@codeaurora.org address doesn't work anymore. Signed-off-by: Kalle Valo Tested-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220506084212.8952-1-kvalo@kernel.org .mailmap | 1 + 1 file changed, 1 insertion(+) commit ceaf69f8eadcafb323392be88e7a5248c415d423 Author: Amir Goldstein Date: Sat May 7 11:00:28 2022 +0300 fanotify: do not allow setting dirent events in mask of non-dir Dirent events (create/delete/move) are only reported on watched directory inodes, but in fanotify as well as in legacy inotify, it was always allowed to set them on non-dir inode, which does not result in any meaningful outcome. Until kernel v5.17, dirent events in fanotify also differed from events "on child" (e.g. FAN_OPEN) in the information provided in the event. For example, FAN_OPEN could be set in the mask of a non-dir or the mask of its parent and event would report the fid of the child regardless of the marked object. By contrast, FAN_DELETE is not reported if the child is marked and the child fid was not reported in the events. Since kernel v5.17, with fanotify group flag FAN_REPORT_TARGET_FID, the fid of the child is reported with dirent events, like events "on child", which may create confusion for users expecting the same behavior as events "on child" when setting events in the mask on a child. The desired semantics of setting dirent events in the mask of a child are not clear, so for now, deny this action for a group initialized with flag FAN_REPORT_TARGET_FID and for the new event FAN_RENAME. We may relax this restriction in the future if we decide on the semantics and implement them. Fixes: d61fd650e9d2 ("fanotify: introduce group flag FAN_REPORT_TARGET_FID") Fixes: 8cc3b1ccd930 ("fanotify: wire up FAN_RENAME event") Link: https://lore.kernel.org/linux-fsdevel/20220505133057.zm5t6vumc4xdcnsg@quack3.lan/ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220507080028.219826-1-amir73il@gmail.com fs/notify/fanotify/fanotify_user.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit edae34a3ed9293b5077dddf9e51a3d86c95dc76a Author: Lina Wang Date: Thu May 5 13:48:50 2022 +0800 selftests net: add UDP GRO fraglist + bpf self-tests When NET_F_F_GRO_FRAGLIST is enabled and bpf_skb_change_proto is used, check if udp packets and tcp packets are successfully delivered to user space. If wrong udp packets are delivered, udpgso_bench_rx will exit with "Initial byte out of range" Signed-off-by: Maciej enczykowski Signed-off-by: Lina Wang Signed-off-by: David S. Miller tools/testing/selftests/net/Makefile | 3 + tools/testing/selftests/net/bpf/Makefile | 14 ++ tools/testing/selftests/net/bpf/nat6to4.c | 285 ++++++++++++++++++++++++++ tools/testing/selftests/net/udpgro_frglist.sh | 101 +++++++++ 4 files changed, 403 insertions(+) commit cf3ab8d4a797960b4be20565abb3bcd227b18a68 Author: Lina Wang Date: Thu May 5 13:48:49 2022 +0800 net: fix wrong network header length When clatd starts with ebpf offloaing, and NETIF_F_GRO_FRAGLIST is enable, several skbs are gathered in skb_shinfo(skb)->frag_list. The first skb's ipv6 header will be changed to ipv4 after bpf_skb_proto_6_to_4, network_header\transport_header\mac_header have been updated as ipv4 acts, but other skbs in frag_list didnot update anything, just ipv6 packets. udp_queue_rcv_skb will call skb_segment_list to traverse other skbs in frag_list and make sure right udp payload is delivered to user space. Unfortunately, other skbs in frag_list who are still ipv6 packets are updated like the first skb and will have wrong transport header length. e.g.before bpf_skb_proto_6_to_4,the first skb and other skbs in frag_list has the same network_header(24)& transport_header(64), after bpf_skb_proto_6_to_4, ipv6 protocol has been changed to ipv4, the first skb's network_header is 44,transport_header is 64, other skbs in frag_list didnot change.After skb_segment_list, the other skbs in frag_list has different network_header(24) and transport_header(44), so there will be 20 bytes different from original,that is difference between ipv6 header and ipv4 header. Just change transport_header to be the same with original. Actually, there are two solutions to fix it, one is traversing all skbs and changing every skb header in bpf_skb_proto_6_to_4, the other is modifying frag_list skb's header in skb_segment_list. Considering efficiency, adopt the second one--- when the first skb and other skbs in frag_list has different network_header length, restore them to make sure right udp payload is delivered to user space. Signed-off-by: Lina Wang Signed-off-by: David S. Miller net/core/skbuff.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 49e6123c65dac6393b04f39ceabf79c44f66b8be Author: Taehee Yoo Date: Wed May 4 12:32:27 2022 +0000 net: sfc: fix memory leak due to ptp channel It fixes memory leak in ring buffer change logic. When ring buffer size is changed(ethtool -G eth0 rx 4096), sfc driver works like below. 1. stop all channels and remove ring buffers. 2. allocates new buffer array. 3. allocates rx buffers. 4. start channels. While the above steps are working, it skips some steps if the channel doesn't have a ->copy callback function. Due to ptp channel doesn't have ->copy callback, these above steps are skipped for ptp channel. It eventually makes some problems. a. ptp channel's ring buffer size is not changed, it works only 1024(default). b. memory leak. The reason for memory leak is to use the wrong ring buffer values. There are some values, which is related to ring buffer size. a. efx->rxq_entries - This is global value of rx queue size. b. rx_queue->ptr_mask - used for access ring buffer as circular ring. - roundup_pow_of_two(efx->rxq_entries) - 1 c. rx_queue->max_fill - efx->rxq_entries - EFX_RXD_HEAD_ROOM These all values should be based on ring buffer size consistently. But ptp channel's values are not. a. efx->rxq_entries - This is global(for sfc) value, always new ring buffer size. b. rx_queue->ptr_mask - This is always 1023(default). c. rx_queue->max_fill - This is new ring buffer size - EFX_RXD_HEAD_ROOM. Let's assume we set 4096 for rx ring buffer, normal channel ptp channel efx->rxq_entries 4096 4096 rx_queue->ptr_mask 4095 1023 rx_queue->max_fill 4086 4086 sfc driver allocates rx ring buffers based on these values. When it allocates ptp channel's ring buffer, 4086 ring buffers are allocated then, these buffers are attached to the allocated array. But ptp channel's ring buffer array size is still 1024(default) and ptr_mask is still 1023 too. So, 3062 ring buffers will be overwritten to the array. This is the reason for memory leak. Test commands: ethtool -G rx 4096 while : do ip link set up ip link set down done In order to avoid this problem, it adds ->copy callback to ptp channel type. So that rx_queue->ptr_mask value will be updated correctly. Fixes: 7c236c43b838 ("sfc: Add support for IEEE-1588 PTP") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller drivers/net/ethernet/sfc/efx_channels.c | 7 ++++++- drivers/net/ethernet/sfc/ptp.c | 14 +++++++++++++- drivers/net/ethernet/sfc/ptp.h | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) commit 3220c3b2115102bb35f8f07d90d2989a3f5eb452 Author: Karol Herbst Date: Wed Apr 20 11:57:20 2022 +0200 drm/i915: Fix race in __i915_vma_remove_closed i915_vma_reopen checked if the vma is closed before without taking the lock. So multiple threads could attempt removing the vma. Instead the lock needs to be taken before actually checking. v2: move struct declaration Cc: Chris Wilson Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: # v5.3+ Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5732 Signed-off-by: Karol Herbst Fixes: 155ab8836caa ("drm/i915: Move object close under its own lock") Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220420095720.3331609-1-kherbst@redhat.com (cherry picked from commit 1df1c79cbb7ac9bf148930be3418973c76ba8dde) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/i915_vma.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 474e76c4075c10461c4373d932a083e25d6adf3c Author: Arnaldo Carvalho de Melo Date: Sun May 9 09:39:02 2021 -0300 tools headers UAPI: Sync linux/kvm.h with the kernel sources To pick the changes in: d495f942f40aa412 ("KVM: fix bad user ABI for KVM_EXIT_SYSTEM_EVENT") That just rebuilds perf, as these patches don't add any new KVM ioctl to be harvested for the the 'perf trace' ioctl syscall argument beautifiers. This is also by now used by tools/testing/selftests/kvm/, a simple test build succeeded. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paolo Bonzini Link: http://lore.kernel.org/lkml/YnE5BIweGmCkpOTN@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/include/uapi/linux/kvm.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit 45fa7c38696bae632310c2876ba81fdfa25cc9c2 Author: Jeremy Linton Date: Thu Apr 28 10:19:47 2022 -0500 perf tests: Fix coresight `perf test` failure. Currently the `perf test` always fails the coresight test like: 89: Check Arm CoreSight trace data recording and synthesized samples: FAILED! That is because the test_arm_coresight.sh is attempting to SIGINT the parent but is using $$ rather than $PPID and it sigint's itself when run under the perf test framework. Since this is done in a trap clause it ends up returning a non zero return. Since $PPID is a bash ism and not all distros are linking /bin/sh to bash, the alternative parent pid lookups are uglier than just dropping the kill, and its not strictly needed, lets pick the simple solution and drop the sigint. Fixes: 133fe2e617e48ca0 ("perf tests: Improve temp file cleanup in test_arm_coresight.sh") Reviewed-by: James Clark Signed-off-by: Jeremy Linton Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Jeremy Linton Link: https://lore.kernel.org/r/20220428151947.290146-1-jeremy.linton@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/tests/shell/test_arm_coresight.sh | 1 - 1 file changed, 1 deletion(-) commit 183d4f2d23acecb29695f4d07427c8594e3a9691 Author: Ian Rogers Date: Thu Apr 28 13:29:11 2022 -0700 perf bench: Fix two numa NDEBUG warnings BUG_ON is a no-op if NDEBUG is defined, otherwise it is an assert. Compiling with NDEBUG yields: bench/numa.c: In function ‘bind_to_cpu’: bench/numa.c:314:1: error: control reaches end of non-void function [-Werror=return-type] 314 | } | ^ bench/numa.c: In function ‘bind_to_node’: bench/numa.c:367:1: error: control reaches end of non-void function [-Werror=return-type] 367 | } | ^ Add return statements to cover this case. Reviewed-by: Athira Jajeev Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220428202912.1056444-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/bench/numa.c | 2 ++ 1 file changed, 2 insertions(+) commit c5eb0a61238dd6faf37f58c9ce61c9980aaffd7a Author: Linus Torvalds Date: Sun May 8 13:54:17 2022 -0700 Linux 5.18-rc6 Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f002488d80b557c7dc540457b176011449895fcb Merge: e3de3a1cda5f ba0c04104082 Author: Linus Torvalds Date: Sun May 8 12:42:05 2022 -0700 Merge tag 'for-5.18/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: "Some reverts of existing patches, which were necessary because of boot issues due to wrong CPU clock handling and cache issues which led to userspace segfaults with 32bit kernels. Dave has a whole bunch of upcoming cache fixes which I then plan to push in the next merge window. Other than that just small updates and fixes, e.g. defconfig updates, spelling fixes, a clocksource fix, boot topology fixes and a fix for /proc/cpuinfo output to satisfy lscpu" * tag 'for-5.18/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: Revert "parisc: Increase parisc_cache_flush_threshold setting" parisc: Mark cr16 clock unstable on all SMP machines parisc: Fix typos in comments parisc: Change MAX_ADDRESS to become unsigned long long parisc: Merge model and model name into one line in /proc/cpuinfo parisc: Re-enable GENERIC_CPU_DEVICES for !SMP parisc: Update 32- and 64-bit defconfigs parisc: Only list existing CPUs in cpu_possible_mask Revert "parisc: Fix patch code locking and flushing" Revert "parisc: Mark sched_clock unstable only if clocks are not syncronized" Revert "parisc: Mark cr16 CPU clocksource unstable on all SMP machines" commit e3de3a1cda5fdc3ac42cb0d45321fb254500595f Merge: 27b5d61c0c0c 348c71344111 Author: Linus Torvalds Date: Sun May 8 11:38:23 2022 -0700 Merge tag 'powerpc-5.18-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix the DWARF CFI in our VDSO time functions, allowing gdb to backtrace through them correctly. - Fix a buffer overflow in the papr_scm driver, only triggerable by hypervisor input. - A fix in the recently added QoS handling for VAS (used for communicating with coprocessors). Thanks to Alan Modra, Haren Myneni, Kajol Jain, and Segher Boessenkool. * tag 'powerpc-5.18-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/papr_scm: Fix buffer overflow issue with CONFIG_FORTIFY_SOURCE powerpc/vdso: Fix incorrect CFI in gettimeofday.S powerpc/pseries/vas: Use QoS credits from the userspace commit 27b5d61c0c0c4ba347b514ade27f7919b032778e Merge: ea82593bad9a 59f5ede3bc0f Author: Linus Torvalds Date: Sun May 8 11:21:54 2022 -0700 Merge tag 'x86-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fix from Thomas Gleixner: "A fix and an email address update: - Prevent FPU state corruption. The condition in irq_fpu_usable() grants FPU usage when the FPU is not used in the kernel. That's just wrong as it does not take the fpregs_lock()'ed regions into account. If FPU usage happens within such a region from interrupt context, then the FPU state gets corrupted. That's a long standing bug, which got unearthed by the recent changes to the random code. - Josh wants to use his kernel.org email address" * tag 'x86-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu: Prevent FPU state corruption MAINTAINERS: Update Josh Poimboeuf's email address commit ea82593bad9a77f6f14c9701c13ff7368b22f027 Merge: 9692df0581ea 2c33d775ef4c Author: Linus Torvalds Date: Sun May 8 11:18:11 2022 -0700 Merge tag 'timers-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Thomas Gleixner: "A fix and an email address update: - Mark the NMI safe time accessors notrace to prevent tracer recursion when they are selected as trace clocks. - John Stultz has a new email address" * tag 'timers-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: timekeeping: Mark NMI safe time accessors as notrace MAINTAINERS: Update email address for John Stultz commit ba0c04104082ca211e108dd8eec6db2ad7676528 Author: Helge Deller Date: Sun May 8 19:55:13 2022 +0200 Revert "parisc: Increase parisc_cache_flush_threshold setting" This reverts commit a58e9d0984e8dad53f17ec73ae3c1cc7f8d88151. Triggers segfaults with 32-bit kernels on PA8500 machines. Signed-off-by: Helge Deller arch/parisc/kernel/cache.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) commit 9692df0581eae29abcc925ca3c12babc6c194741 Merge: ede4c6d78a32 8707898e22fd Author: Linus Torvalds Date: Sun May 8 11:10:17 2022 -0700 Merge tag 'irq-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Thomas Gleixner: "A fix for the threaded interrupt core. A quick sequence of request/free_irq() can result in a hang because the interrupt thread did not reach the thread function and got stopped in the kthread core already. That leaves a state active counter arround which makes a invocation of synchronized_irq() on that interrupt hang forever. Ensure that the thread reached the thread function in request_irq() to prevent that" * tag 'irq-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq: Synchronize interrupt thread startup commit ede4c6d78a32f9b7dfdb12d5edf8c8c4c84c729a Merge: 1f8c5dff000d 60cc5468daae Author: Linus Torvalds Date: Sun May 8 11:01:20 2022 -0700 Merge tag 'locking-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fixlet from Thomas Gleixner: "Just a email address update for MAINTAINERS and mailmap" * tag 'locking-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: futex: MAINTAINERS, .mailmap: Update André's email address commit 340233dcc0160aafcce46ca893d1679f16acf409 Author: Helge Deller Date: Sun May 8 18:25:00 2022 +0200 parisc: Mark cr16 clock unstable on all SMP machines The cr16 interval timers are not synchronized across CPUs, even with just one dual-core CPU. This becomes visible if the machines have a longer uptime. Signed-off-by: Helge Deller arch/parisc/kernel/time.c | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) commit a65bcad5421507c2f6c52e1e2ca6a6ce02fd1ad6 Author: Julia Lawall Date: Sat Apr 30 21:07:18 2022 +0200 parisc: Fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Helge Deller arch/parisc/kernel/kprobes.c | 2 +- arch/parisc/kernel/traps.c | 2 +- arch/parisc/math-emu/dfadd.c | 2 +- arch/parisc/math-emu/dfsub.c | 2 +- arch/parisc/math-emu/sfadd.c | 2 +- arch/parisc/math-emu/sfsub.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) commit 234ff4c585d704896450a3634a7c29fa4e1907e1 Author: Helge Deller Date: Tue Apr 5 21:28:37 2022 +0200 parisc: Change MAX_ADDRESS to become unsigned long long Dave noticed that for the 32-bit kernel MAX_ADDRESS should be a ULL, otherwise this define would become 0: MAX_ADDRESS (1UL << MAX_ADDRBITS) It has no real effect on the kernel. Signed-off-by: Helge Deller Noticed-by: John David Anglin arch/parisc/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5b89966bc96a06f6ad65f64ae4b0461918fcc9d3 Author: Helge Deller Date: Sun Apr 3 21:57:51 2022 +0200 parisc: Merge model and model name into one line in /proc/cpuinfo The Linux tool "lscpu" shows the double amount of CPUs if we have "model" and "model name" in two different lines in /proc/cpuinfo. This change combines the model and the model name into one line. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org arch/parisc/kernel/processor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 1955c4f879a130c7822f483cf593338ad747aed4 Author: Helge Deller Date: Fri Apr 1 22:24:20 2022 +0200 parisc: Re-enable GENERIC_CPU_DEVICES for !SMP In commit 62773112acc5 ("parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY") GENERIC_CPU_DEVICES was unconditionally turned off, but this triggers a warning in topology_add_dev(). Turning it back on for the !SMP case avoids this warning. Reported-by: Guenter Roeck Tested-by: Guenter Roeck Fixes: 62773112acc5 ("parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY") Signed-off-by: Helge Deller arch/parisc/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 7e93a3dd63db2341d094ab1d9ba29b5d8d5093d1 Author: Helge Deller Date: Fri Apr 1 18:55:27 2022 +0200 parisc: Update 32- and 64-bit defconfigs Enable CONFIG_CGROUPS=y on 32-bit defconfig for systemd-support, and enable CONFIG_NAMESPACES and CONFIG_USER_NS. Signed-off-by: Helge Deller arch/parisc/configs/generic-32bit_defconfig | 4 +++- arch/parisc/configs/generic-64bit_defconfig | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) commit 0921244f6f4f0d05698b953fe632a99b38907226 Author: Helge Deller Date: Fri Apr 1 09:19:11 2022 +0200 parisc: Only list existing CPUs in cpu_possible_mask The inventory knows which CPUs are in the system, so this bitmask should be in cpu_possible_mask instead of the bitmask based on CONFIG_NR_CPUS. Reset the cpu_possible_mask before scanning the system for CPUs, and mark each existing CPU as possible during initialization of that CPU. This avoids those warnings later on too: register_cpu_capacity_sysctl: too early to get CPU4 device! Signed-off-by: Helge Deller Noticed-by: John David Anglin arch/parisc/kernel/processor.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 6c800d7f55fcd78e17deae5ae4374d8e73482c13 Author: Helge Deller Date: Sun May 8 10:18:40 2022 +0200 Revert "parisc: Fix patch code locking and flushing" This reverts commit a9fe7fa7d874a536e0540469f314772c054a0323. Leads to segfaults on 32bit kernel. Signed-off-by: Helge Deller arch/parisc/kernel/patch.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) commit 7962c0896429af2a0e00ec6bc15d992536453b2d Author: Helge Deller Date: Sat May 7 15:32:38 2022 +0200 Revert "parisc: Mark sched_clock unstable only if clocks are not syncronized" This reverts commit d97180ad68bdb7ee10f327205a649bc2f558741d. It triggers RCU stalls at boot with a 32-bit kernel. Signed-off-by: Helge Deller Noticed-by: John David Anglin Cc: stable@vger.kernel.org # v5.15+ arch/parisc/kernel/setup.c | 2 ++ arch/parisc/kernel/time.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) commit 9dc4241bb14afecd16518a0760bceb3d7359b12a Author: Helge Deller Date: Sat May 7 15:31:16 2022 +0200 Revert "parisc: Mark cr16 CPU clocksource unstable on all SMP machines" This reverts commit afdb4a5b1d340e4afffc65daa21cc71890d7d589. It triggers RCU stalls at boot with a 32-bit kernel. Signed-off-by: Helge Deller Noticed-by: John David Anglin Cc: stable@vger.kernel.org # v5.16+ arch/parisc/kernel/time.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) commit 1f8c5dff000d96b66273a0bf57dbf4d505c730cc Merge: 379c72654524 2667ed10d9f0 Author: Linus Torvalds Date: Sun May 8 10:28:22 2022 -0700 Merge tag 'core-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull PASID fix from Thomas Gleixner: "A single bugfix for the PASID management code, which freed the PASID too early. The PASID needs to be tied to the mm lifetime, not to the address space lifetime" * tag 'core-urgent-2022-05-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: mm: Fix PASID use-after-free issue commit 379c72654524d97081f8810a0e4284a16f78a25e Merge: 2e3afb42dd48 ac02e3cd5ab9 Author: Linus Torvalds Date: Sun May 8 10:10:51 2022 -0700 Merge tag 'sound-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "This became slightly larger as I've been off in the last weeks. The majority of changes here is about ASoC, fixes for dmaengine and for addressing issues reported by CI, as well as other device-specific small fixes. Also, fixes for FireWire core stack and the usual HD-audio quirks are included" * tag 'sound-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits) ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback ASoC: ops: Validate input values in snd_soc_put_volsw_range() ASoC: dmaengine: Restore NULL prepare_slave_config() callback ASoC: atmel: mchp-pdmc: set prepare_slave_config ASoC: max98090: Generate notifications on changes for custom control ASoC: max98090: Reject invalid values in custom control put() ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes ALSA: hda/realtek: Add quirk for Yoga Duet 7 13ITL6 speakers firewire: core: extend card->lock in fw_core_handle_bus_reset firewire: remove check of list iterator against head past the loop body firewire: fix potential uaf in outbound_phy_packet_callback() ASoC: rt9120: Correct the reg 0x09 size to one byte ALSA: hda/realtek: Enable mute/micmute LEDs support for HP Laptops ALSA: hda/realtek: Fix mute led issue on thinkpad with cs35l41 s-codec ASoC: meson: axg-card: Fix nonatomic links ASoC: meson: axg-tdm-interface: Fix formatters in trigger" ASoC: soc-ops: fix error handling ASoC: meson: Fix event generation for G12A tohdmi mux ASoC: meson: Fix event generation for AUI CODEC mux ASoC: meson: Fix event generation for AUI ACODEC mux ... commit 2e3afb42dd480d755cd7d97ca04586a5616c1a5e Author: Willy Tarreau Date: Sun May 8 11:37:09 2022 +0200 blk-mq: remove the error_count from struct request The last two users were floppy.c and ataflop.c respectively, it was verified that no other drivers makes use of this, so let's remove it. Suggested-by: Linus Torvalds Cc: Minh Yuan Cc: Denis Efremov , Cc: Geert Uytterhoeven Cc: Christoph Hellwig Signed-off-by: Willy Tarreau Signed-off-by: Linus Torvalds include/linux/blk-mq.h | 1 - 1 file changed, 1 deletion(-) commit f3b10a3c22c6a5f1d623b70eca2b4d1efafccd71 Author: Willy Tarreau Date: Sun May 8 11:37:08 2022 +0200 ataflop: use a statically allocated error counters This is the last driver making use of fd_request->error_count, which is easy to get wrong as was shown in floppy.c. We don't need to keep it there, it can be moved to the atari_floppy_struct instead, so let's do this. Suggested-by: Linus Torvalds Cc: Minh Yuan Cc: Geert Uytterhoeven Signed-off-by: Willy Tarreau Signed-off-by: Linus Torvalds drivers/block/ataflop.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit f71f01394f742fc4558b3f9f4c7ef4c4cf3b07c8 Author: Willy Tarreau Date: Sun May 8 11:37:07 2022 +0200 floppy: use a statically allocated error counter Interrupt handler bad_flp_intr() may cause a UAF on the recently freed request just to increment the error count. There's no point keeping that one in the request anyway, and since the interrupt handler uses a static pointer to the error which cannot be kept in sync with the pending request, better make it use a static error counter that's reset for each new request. This reset now happens when entering redo_fd_request() for a new request via set_next_request(). One initial concern about a single error counter was that errors on one floppy drive could be reported on another one, but this problem is not real given that the driver uses a single drive at a time, as that PC-compatible controllers also have this limitation by using shared signals. As such the error count is always for the "current" drive. Reported-by: Minh Yuan Suggested-by: Linus Torvalds Tested-by: Denis Efremov Signed-off-by: Willy Tarreau Signed-off-by: Linus Torvalds drivers/block/floppy.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) commit ac02e3cd5ab9407dcf926df2a1085c13881ccf7a Merge: eb9d84b0ffe3 c61711c1c957 Author: Takashi Iwai Date: Sun May 8 10:49:25 2022 +0200 Merge tag 'asoc-fix-v5.18-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.18 A larger collection of fixes than I'd like, mainly because mixer-test is making it's way into the CI systems and turning up issues on a wider range of systems. The most substantial thing though is a revert and an alternative fix for a dmaengine issue where the fix caused disruption for some other configurations, the core fix is backed out an a driver specific thing done instead. commit fd13359f54ee854f00134abc6be32da94ec53dbf Author: Trond Myklebust Date: Sat May 7 13:53:59 2022 -0400 SUNRPC: Ensure that the gssproxy client can start in a connected state Ensure that the gssproxy client connects to the server from the gssproxy daemon process context so that the AF_LOCAL socket connection is done using the correct path and namespaces. Fixes: 1d658336b05f ("SUNRPC: Add RPC based upcall mechanism for RPCGSS auth") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust include/linux/sunrpc/clnt.h | 1 + net/sunrpc/auth_gss/gss_rpc_upcall.c | 1 + net/sunrpc/clnt.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) commit 3d1b0d351441c2be7de082b92f43d0bfdc95a8f3 Author: Trond Myklebust Date: Sat May 7 13:48:21 2022 -0400 Revert "SUNRPC: Ensure gss-proxy connects on setup" This reverts commit 892de36fd4a98fab3298d417c051d9099af5448d. The gssproxy server is unresponsive when it calls into the kernel to start the upcall service, so it will not reply to our RPC ping at all. Reported-by: "J.Bruce Fields" Fixes: 892de36fd4a9 ("SUNRPC: Ensure gss-proxy connects on setup") Signed-off-by: Trond Myklebust include/linux/sunrpc/clnt.h | 1 - net/sunrpc/auth_gss/gss_rpc_upcall.c | 2 +- net/sunrpc/clnt.c | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) commit 30c8e80f79329617012f07b09b70114592092ea4 Merge: 8967605e7db3 dba785798526 Author: Linus Torvalds Date: Sat May 7 11:02:02 2022 -0700 Merge tag 'gpio-fixes-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix the bounds check for the 'gpio-reserved-ranges' device property in gpiolib-of - drop the assignment of the pwm base number in gpio-mvebu (this was missed by the patch doing it globally for all pwm drivers) - fix the fwnode assignment (use own fwnode, not the parent's one) for the GPIO irqchip in gpio-visconti - update the irq_stat field before checking the trigger field in gpio-pca953x - update GPIO entry in MAINTAINERS * tag 'gpio-fixes-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: pca953x: fix irq_stat not updated when irq is disabled (irq_mask not set) gpio: visconti: Fix fwnode of GPIO IRQ MAINTAINERS: update the GPIO git tree entry gpio: mvebu: drop pwm base assignment gpiolib: of: fix bounds check for 'gpio-reserved-ranges' commit 8967605e7db37a46df69cecf42be2c68774f245c Merge: b366bd7d9613 f1c8781ac9d8 Author: Linus Torvalds Date: Sat May 7 10:47:51 2022 -0700 Merge tag 'block-5.18-2022-05-06' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "A single revert for a change that isn't needed in 5.18, and a small series for s390/dasd" * tag 'block-5.18-2022-05-06' of git://git.kernel.dk/linux-block: s390/dasd: Use kzalloc instead of kmalloc/memset s390/dasd: Fix read inconsistency for ESE DASD devices s390/dasd: Fix read for ESE with blksize < 4k s390/dasd: prevent double format of tracks for ESE devices s390/dasd: fix data corruption for ESE devices Revert "block: release rq qos structures for queue without disk" commit b366bd7d9613971e666cdbfe7a08c653d329bf15 Merge: 4b97bac0756a a196c78b5443 Author: Linus Torvalds Date: Sat May 7 10:41:41 2022 -0700 Merge tag 'io_uring-5.18-2022-05-06' of git://git.kernel.dk/linux-block Pull io_uring fix from Jens Axboe: "Just a single file assignment fix this week" * tag 'io_uring-5.18-2022-05-06' of git://git.kernel.dk/linux-block: io_uring: assign non-fixed early for async work commit 1b5853dfab7fdde450f00f145327342238135c8a Author: Javier Martinez Canillas Date: Fri May 6 15:22:25 2022 +0200 fbdev: efifb: Fix a use-after-free due early fb_info cleanup Commit d258d00fb9c7 ("fbdev: efifb: Cleanup fb_info in .fb_destroy rather than .remove") attempted to fix a use-after-free error due driver freeing the fb_info in the .remove handler instead of doing it in .fb_destroy. But ironically that change introduced yet another use-after-free since the fb_info was still used after the free. This should fix for good by freeing the fb_info at the end of the handler. Fixes: d258d00fb9c7 ("fbdev: efifb: Cleanup fb_info in .fb_destroy rather than .remove") Reported-by: Ville Syrjälä Reported-by: Andrzej Hajda Signed-off-by: Javier Martinez Canillas Reviewed-by: Andi Shyti Reviewed-by: Andrzej Hajda Reviewed-by: Thomas Zimmermann Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220506132225.588379-1-javierm@redhat.com drivers/video/fbdev/efifb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1c7ab9cd98b78bef1657a5db7204d8d437e24c94 Author: Kees Cook Date: Thu May 5 16:31:01 2022 -0700 net: chelsio: cxgb4: Avoid potential negative array offset Using min_t(int, ...) as a potential array index implies to the compiler that negative offsets should be allowed. This is not the case, though. Replace "int" with "unsigned int". Fixes the following warning exposed under future CONFIG_FORTIFY_SOURCE improvements: 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/delay.h:23, from drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:35: drivers/net/ethernet/chelsio/cxgb4/t4_hw.c: In function 't4_get_raw_vpd_params': include/linux/fortify-string.h:46:33: warning: '__builtin_memcpy' pointer overflow between offset 29 and size [2147483648, 4294967295] [-Warray-bounds] 46 | #define __underlying_memcpy __builtin_memcpy | ^ include/linux/fortify-string.h:388:9: note: in expansion of macro '__underlying_memcpy' 388 | __underlying_##op(p, q, __fortify_size); \ | ^~~~~~~~~~~~~ include/linux/fortify-string.h:433:26: note: in expansion of macro '__fortify_memcpy_chk' 433 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:2796:9: note: in expansion of macro 'memcpy' 2796 | memcpy(p->id, vpd + id, min_t(int, id_len, ID_LEN)); | ^~~~~~ include/linux/fortify-string.h:46:33: warning: '__builtin_memcpy' pointer overflow between offset 0 and size [2147483648, 4294967295] [-Warray-bounds] 46 | #define __underlying_memcpy __builtin_memcpy | ^ include/linux/fortify-string.h:388:9: note: in expansion of macro '__underlying_memcpy' 388 | __underlying_##op(p, q, __fortify_size); \ | ^~~~~~~~~~~~~ include/linux/fortify-string.h:433:26: note: in expansion of macro '__fortify_memcpy_chk' 433 | #define memcpy(p, q, s) __fortify_memcpy_chk(p, q, s, \ | ^~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:2798:9: note: in expansion of macro 'memcpy' 2798 | memcpy(p->sn, vpd + sn, min_t(int, sn_len, SERNUM_LEN)); | ^~~~~~ Additionally remove needless cast from u8[] to char * in last strim() call. Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/202205031926.FVP7epJM-lkp@intel.com Fixes: fc9279298e3a ("cxgb4: Search VPD with pci_vpd_find_ro_info_keyword()") Fixes: 24c521f81c30 ("cxgb4: Use pci_vpd_find_id_string() to find VPD ID string") Cc: Raju Rangoju Cc: Eric Dumazet Cc: Paolo Abeni Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220505233101.1224230-1-keescook@chromium.org Signed-off-by: Jakub Kicinski drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit d5076fe4049cadef1f040eda4aaa001bb5424225 Author: Eric Dumazet Date: Thu May 5 09:19:46 2022 -0700 netlink: do not reset transport header in netlink_recvmsg() netlink_recvmsg() does not need to change transport header. If transport header was needed, it should have been reset by the producer (netlink_dump()), not the consumer(s). The following trace probably happened when multiple threads were using MSG_PEEK. BUG: KCSAN: data-race in netlink_recvmsg / netlink_recvmsg write to 0xffff88811e9f15b2 of 2 bytes by task 32012 on cpu 1: skb_reset_transport_header include/linux/skbuff.h:2760 [inline] netlink_recvmsg+0x1de/0x790 net/netlink/af_netlink.c:1978 sock_recvmsg_nosec net/socket.c:948 [inline] sock_recvmsg net/socket.c:966 [inline] __sys_recvfrom+0x204/0x2c0 net/socket.c:2097 __do_sys_recvfrom net/socket.c:2115 [inline] __se_sys_recvfrom net/socket.c:2111 [inline] __x64_sys_recvfrom+0x74/0x90 net/socket.c:2111 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+0x44/0xae write to 0xffff88811e9f15b2 of 2 bytes by task 32005 on cpu 0: skb_reset_transport_header include/linux/skbuff.h:2760 [inline] netlink_recvmsg+0x1de/0x790 net/netlink/af_netlink.c:1978 ____sys_recvmsg+0x162/0x2f0 ___sys_recvmsg net/socket.c:2674 [inline] __sys_recvmsg+0x209/0x3f0 net/socket.c:2704 __do_sys_recvmsg net/socket.c:2714 [inline] __se_sys_recvmsg net/socket.c:2711 [inline] __x64_sys_recvmsg+0x42/0x50 net/socket.c:2711 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+0x44/0xae value changed: 0xffff -> 0x0000 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 32005 Comm: syz-executor.4 Not tainted 5.18.0-rc1-syzkaller-00328-ge1f700ebd6be-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20220505161946.2867638-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski net/netlink/af_netlink.c | 1 - 1 file changed, 1 deletion(-) commit ab244be47a8f111bc82496a8a20c907236e37f95 Author: Christophe JAILLET Date: Wed Feb 9 07:03:11 2022 +0100 drm/nouveau: Fix a potential theorical leak in nouveau_get_backlight_name() If successful ida_simple_get() calls are not undone when needed, some additional memory may be allocated and wasted. Here, an ID between 0 and MAX_INT is required. If this ID is >=100, it is not taken into account and is wasted. It should be released. Instead of calling ida_simple_remove(), take advantage of the 'max' parameter to require the ID not to be too big. Should it be too big, it is not allocated and don't need to be freed. While at it, use ida_alloc_xxx()/ida_free() instead to ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Fixes: db1a0ae21461 ("drm/nouveau/bl: Assign different names to interfaces") Signed-off-by: Christophe JAILLET Reviewed-by: Lyude Paul [Fixed formatting warning from checkpatch] Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/9ba85bca59df6813dc029e743a836451d5173221.1644386541.git.christophe.jaillet@wanadoo.fr drivers/gpu/drm/nouveau/nouveau_backlight.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 4b97bac0756a81cda5afd45417a99b5bccdcff67 Merge: adcffc1716f8 3e1ad196385c Author: Linus Torvalds Date: Fri May 6 14:32:16 2022 -0700 Merge tag 'for-5.18-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "Regression fixes in zone activation: - move a loop invariant out of the loop to avoid checking space status - properly handle unlimited activation Other fixes: - for subpage, force the free space v2 mount to avoid a warning and make it easy to switch a filesystem on different page size systems - export sysfs status of exclusive operation 'balance paused', so the user space tools can recognize it and allow adding a device with paused balance - fix assertion failure when logging directory key range item" * tag 'for-5.18-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: sysfs: export the balance paused state of exclusive operation btrfs: fix assertion failure when logging directory key range item btrfs: zoned: activate block group properly on unlimited active zone device btrfs: zoned: move non-changing condition check out of the loop btrfs: force v2 space cache usage for subpage mount commit 87fd2b091fb33871a7f812658a0971e8e26f903f Author: Robin Murphy Date: Tue Apr 5 15:21:34 2022 +0100 drm/nouveau/tegra: Stop using iommu_present() Even if some IOMMU has registered itself on the platform "bus", that doesn't necessarily mean it provides translation for the device we care about. Replace iommu_present() with a more appropriate check. Signed-off-by: Robin Murphy Reviewed-by: Lyude Paul [added cc for stable] Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org # v5.0+ Link: https://patchwork.freedesktop.org/patch/msgid/70d40ea441da3663c2824d54102b471e9a621f8a.1649168494.git.robin.murphy@arm.com drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit adcffc1716f875610ba57195ec979a4ef655ddd3 Merge: bce58da1f398 a3d0562d4dc0 Author: Linus Torvalds Date: Fri May 6 13:19:11 2022 -0700 Merge tag 'nfs-for-5.18-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs Pull NFS client fixes from Trond Myklebust: "Highlights include: Stable fixes: - Fix a socket leak when setting up an AF_LOCAL RPC client - Ensure that knfsd connects to the gss-proxy daemon on setup Bugfixes: - Fix a refcount leak when migrating a task off an offlined transport - Don't gratuitously invalidate inode attributes on delegation return - Don't leak sockets in xs_local_connect() - Ensure timely close of disconnected AF_LOCAL sockets" * tag 'nfs-for-5.18-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: Revert "SUNRPC: attempt AF_LOCAL connect on setup" SUNRPC: Ensure gss-proxy connects on setup SUNRPC: Ensure timely close of disconnected AF_LOCAL sockets SUNRPC: Don't leak sockets in xs_local_connect() NFSv4: Don't invalidate inode attributes on delegation return SUNRPC release the transport of a relocated task with an assigned transport commit 9e6c6d17d1d6a3f1515ce399f9a011629ec79aa0 Author: Lokesh Dhoundiyal Date: Thu May 5 14:00:17 2022 +1200 ipv4: drop dst in multicast routing path kmemleak reports the following when routing multicast traffic over an ipsec tunnel. Kmemleak output: unreferenced object 0x8000000044bebb00 (size 256): comm "softirq", pid 0, jiffies 4294985356 (age 126.810s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 80 00 00 00 05 13 74 80 ..............t. 80 00 00 00 04 9b bf f9 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000f83947e0>] __kmalloc+0x1e8/0x300 [<00000000b7ed8dca>] metadata_dst_alloc+0x24/0x58 [<0000000081d32c20>] __ipgre_rcv+0x100/0x2b8 [<00000000824f6cf1>] gre_rcv+0x178/0x540 [<00000000ccd4e162>] gre_rcv+0x7c/0xd8 [<00000000c024b148>] ip_protocol_deliver_rcu+0x124/0x350 [<000000006a483377>] ip_local_deliver_finish+0x54/0x68 [<00000000d9271b3a>] ip_local_deliver+0x128/0x168 [<00000000bd4968ae>] xfrm_trans_reinject+0xb8/0xf8 [<0000000071672a19>] tasklet_action_common.isra.16+0xc4/0x1b0 [<0000000062e9c336>] __do_softirq+0x1fc/0x3e0 [<00000000013d7914>] irq_exit+0xc4/0xe0 [<00000000a4d73e90>] plat_irq_dispatch+0x7c/0x108 [<000000000751eb8e>] handle_int+0x16c/0x178 [<000000001668023b>] _raw_spin_unlock_irqrestore+0x1c/0x28 The metadata dst is leaked when ip_route_input_mc() updates the dst for the skb. Commit f38a9eb1f77b ("dst: Metadata destinations") correctly handled dropping the dst in ip_route_input_slow() but missed the multicast case which is handled by ip_route_input_mc(). Drop the dst in ip_route_input_mc() avoiding the leak. Fixes: f38a9eb1f77b ("dst: Metadata destinations") Signed-off-by: Lokesh Dhoundiyal Signed-off-by: Chris Packham Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220505020017.3111846-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Jakub Kicinski net/ipv4/route.c | 1 + 1 file changed, 1 insertion(+) commit bce58da1f39843d47ccd6d9839fadbf898b72358 Merge: 497fe3bb196d 053d2290c030 Author: Linus Torvalds Date: Fri May 6 11:42:58 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "x86: - Account for family 17h event renumberings in AMD PMU emulation - Remove CPUID leaf 0xA on AMD processors - Fix lockdep issue with locking all vCPUs - Fix loss of A/D bits in SPTEs - Fix syzkaller issue with invalid guest state" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: VMX: Exit to userspace if vCPU has injected exception and invalid state KVM: SEV: Mark nested locking of vcpu->lock kvm: x86/cpuid: Only provide CPUID leaf 0xA if host has architectural PMU KVM: x86/svm: Account for family 17h event renumberings in amd_pmc_perf_hw_id KVM: x86/mmu: Use atomic XCHG to write TDP MMU SPTEs with volatile bits KVM: x86/mmu: Move shadow-present check out of spte_has_volatile_bits() KVM: x86/mmu: Don't treat fully writable SPTEs as volatile (modulo A/D) commit 497fe3bb196de7249723ba1496fb72ca63ce14e2 Merge: 4df22ca85d3d c6fe81191bd7 Author: Linus Torvalds Date: Fri May 6 11:30:59 2022 -0700 Merge tag 'riscv-for-linus-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fix from Palmer Dabbelt: - A fix to relocate the DTB early in boot, in cases where the bootloader doesn't put the DTB in a region that will end up mapped by the kernel. This manifests as a crash early in boot on a handful of configurations. * tag 'riscv-for-linus-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: relocate DTB if it's outside memory region commit a11b6c1a383ff092f432e040c20e032503785d47 Author: Michal Michalik Date: Wed Apr 20 14:23:02 2022 +0200 ice: fix PTP stale Tx timestamps cleanup Read stale PTP Tx timestamps from PHY on cleanup. After running out of Tx timestamps request handlers, hardware (HW) stops reporting finished requests. Function ice_ptp_tx_tstamp_cleanup() used to only clean up stale handlers in driver and was leaving the hardware registers not read. Not reading stale PTP Tx timestamps prevents next interrupts from arriving and makes timestamping unusable. Fixes: ea9b847cda64 ("ice: enable transmit timestamps for E810 devices") Signed-off-by: Michal Michalik Reviewed-by: Jacob Keller Reviewed-by: Paul Menzel Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_ptp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 6096dae926a22e2892ef9169f582589c16d39639 Author: Anatolii Gerasymenko Date: Thu Apr 28 12:01:00 2022 +0000 ice: clear stale Tx queue settings before configuring The iAVF driver uses 3 virtchnl op codes to communicate with the PF regarding the VF Tx queues: * VIRTCHNL_OP_CONFIG_VSI_QUEUES configures the hardware and firmware logic for the Tx queues * VIRTCHNL_OP_ENABLE_QUEUES configures the queue interrupts * VIRTCHNL_OP_DISABLE_QUEUES disables the queue interrupts and Tx rings. There is a bug in the iAVF driver due to the race condition between VF reset request and shutdown being executed in parallel. This leads to a break in logic and VIRTCHNL_OP_DISABLE_QUEUES is not being sent. If this occurs, the PF driver never cleans up the Tx queues. This results in leaving behind stale Tx queue settings in the hardware and firmware. The most obvious outcome is that upon the next VIRTCHNL_OP_CONFIG_VSI_QUEUES, the PF will fail to program the Tx scheduler node due to a lack of space. We need to protect ICE driver against such situation. To fix this, make sure we clear existing stale settings out when handling VIRTCHNL_OP_CONFIG_VSI_QUEUES. This ensures we remove the previous settings. Calling ice_vf_vsi_dis_single_txq should be safe as it will do nothing if the queue is not configured. The function already handles the case when the Tx queue is not currently configured and exits with a 0 return in that case. Fixes: 7ad15440acf8 ("ice: Refactor VIRTCHNL_OP_CONFIG_VSI_QUEUES handling") Signed-off-by: Jacob Keller Signed-off-by: Anatolii Gerasymenko Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_virtchnl.c | 68 ++++++++++++++++++++------- 1 file changed, 50 insertions(+), 18 deletions(-) commit 486b9eee57ddca5c9a2d59fc41153f36002e0a00 Author: Ivan Vecera Date: Sat Apr 23 12:20:21 2022 +0200 ice: Fix race during aux device (un)plugging Function ice_plug_aux_dev() assigns pf->adev field too early prior aux device initialization and on other side ice_unplug_aux_dev() starts aux device deinit and at the end assigns NULL to pf->adev. This is wrong because pf->adev should always be non-NULL only when aux device is fully initialized and ready. This wrong order causes a crash when ice_send_event_to_aux() call occurs because that function depends on non-NULL value of pf->adev and does not assume that aux device is half-initialized or half-destroyed. After order correction the race window is tiny but it is still there, as Leon mentioned and manipulation with pf->adev needs to be protected by mutex. Fix (un-)plugging functions so pf->adev field is set after aux device init and prior aux device destroy and protect pf->adev assignment by new mutex. This mutex is also held during ice_send_event_to_aux() call to ensure that aux device is valid during that call. Note that device lock used ice_send_event_to_aux() needs to be kept to avoid race with aux drv unload. Reproducer: cycle=1 while :;do echo "#### Cycle: $cycle" ip link set ens7f0 mtu 9000 ip link add bond0 type bond mode 1 miimon 100 ip link set bond0 up ifenslave bond0 ens7f0 ip link set bond0 mtu 9000 ethtool -L ens7f0 combined 1 ip link del bond0 ip link set ens7f0 mtu 1500 sleep 1 let cycle++ done In short when the device is added/removed to/from bond the aux device is unplugged/plugged. When MTU of the device is changed an event is sent to aux device asynchronously. This can race with (un)plugging operation and because pf->adev is set too early (plug) or too late (unplug) the function ice_send_event_to_aux() can touch uninitialized or destroyed fields. In the case of crash below pf->adev->dev.mutex. Crash: [ 53.372066] bond0: (slave ens7f0): making interface the new active one [ 53.378622] bond0: (slave ens7f0): Enslaving as an active interface with an u p link [ 53.386294] IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready [ 53.549104] bond0: (slave ens7f1): Enslaving as a backup interface with an up link [ 54.118906] ice 0000:ca:00.0 ens7f0: Number of in use tx queues changed inval idating tc mappings. Priority traffic classification disabled! [ 54.233374] ice 0000:ca:00.1 ens7f1: Number of in use tx queues changed inval idating tc mappings. Priority traffic classification disabled! [ 54.248204] bond0: (slave ens7f0): Releasing backup interface [ 54.253955] bond0: (slave ens7f1): making interface the new active one [ 54.274875] bond0: (slave ens7f1): Releasing backup interface [ 54.289153] bond0 (unregistering): Released all slaves [ 55.383179] MII link monitoring set to 100 ms [ 55.398696] bond0: (slave ens7f0): making interface the new active one [ 55.405241] BUG: kernel NULL pointer dereference, address: 0000000000000080 [ 55.405289] bond0: (slave ens7f0): Enslaving as an active interface with an u p link [ 55.412198] #PF: supervisor write access in kernel mode [ 55.412200] #PF: error_code(0x0002) - not-present page [ 55.412201] PGD 25d2ad067 P4D 0 [ 55.412204] Oops: 0002 [#1] PREEMPT SMP NOPTI [ 55.412207] CPU: 0 PID: 403 Comm: kworker/0:2 Kdump: loaded Tainted: G S 5.17.0-13579-g57f2d6540f03 #1 [ 55.429094] bond0: (slave ens7f1): Enslaving as a backup interface with an up link [ 55.430224] Hardware name: Dell Inc. PowerEdge R750/06V45N, BIOS 1.4.4 10/07/ 2021 [ 55.430226] Workqueue: ice ice_service_task [ice] [ 55.468169] RIP: 0010:mutex_unlock+0x10/0x20 [ 55.472439] Code: 0f b1 13 74 96 eb e0 4c 89 ee eb d8 e8 79 54 ff ff 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 65 48 8b 04 25 40 ef 01 00 31 d2 48 0f b1 17 75 01 c3 e9 e3 fe ff ff 0f 1f 00 0f 1f 44 00 00 48 [ 55.491186] RSP: 0018:ff4454230d7d7e28 EFLAGS: 00010246 [ 55.496413] RAX: ff1a79b208b08000 RBX: ff1a79b2182e8880 RCX: 0000000000000001 [ 55.503545] RDX: 0000000000000000 RSI: ff4454230d7d7db0 RDI: 0000000000000080 [ 55.510678] RBP: ff1a79d1c7e48b68 R08: ff4454230d7d7db0 R09: 0000000000000041 [ 55.517812] R10: 00000000000000a5 R11: 00000000000006e6 R12: ff1a79d1c7e48bc0 [ 55.524945] R13: 0000000000000000 R14: ff1a79d0ffc305c0 R15: 0000000000000000 [ 55.532076] FS: 0000000000000000(0000) GS:ff1a79d0ffc00000(0000) knlGS:0000000000000000 [ 55.540163] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 55.545908] CR2: 0000000000000080 CR3: 00000003487ae003 CR4: 0000000000771ef0 [ 55.553041] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 55.560173] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 55.567305] PKRU: 55555554 [ 55.570018] Call Trace: [ 55.572474] [ 55.574579] ice_service_task+0xaab/0xef0 [ice] [ 55.579130] process_one_work+0x1c5/0x390 [ 55.583141] ? process_one_work+0x390/0x390 [ 55.587326] worker_thread+0x30/0x360 [ 55.590994] ? process_one_work+0x390/0x390 [ 55.595180] kthread+0xe6/0x110 [ 55.598325] ? kthread_complete_and_exit+0x20/0x20 [ 55.603116] ret_from_fork+0x1f/0x30 [ 55.606698] Fixes: f9f5301e7e2d ("ice: Register auxiliary device to provide RDMA") Reviewed-by: Leon Romanovsky Signed-off-by: Ivan Vecera Reviewed-by: Dave Ertman Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice.h | 1 + drivers/net/ethernet/intel/ice/ice_idc.c | 25 +++++++++++++++++-------- drivers/net/ethernet/intel/ice/ice_main.c | 2 ++ 3 files changed, 20 insertions(+), 8 deletions(-) commit 053d2290c0307e3642e75e0185ddadf084dc36c1 Author: Sean Christopherson Date: Mon May 2 22:18:50 2022 +0000 KVM: VMX: Exit to userspace if vCPU has injected exception and invalid state Exit to userspace with an emulation error if KVM encounters an injected exception with invalid guest state, in addition to the existing check of bailing if there's a pending exception (KVM doesn't support emulating exceptions except when emulating real mode via vm86). In theory, KVM should never get to such a situation as KVM is supposed to exit to userspace before injecting an exception with invalid guest state. But in practice, userspace can intervene and manually inject an exception and/or stuff registers to force invalid guest state while a previously injected exception is awaiting reinjection. Fixes: fc4fad79fc3d ("KVM: VMX: Reject KVM_RUN if emulation is required with pending exception") Reported-by: syzbot+cfafed3bb76d3e37581b@syzkaller.appspotmail.com Signed-off-by: Sean Christopherson Message-Id: <20220502221850.131873-1-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0c2c7c069285374fc8feacddc0498f8ab7627117 Author: Peter Gonda Date: Mon May 2 09:58:07 2022 -0700 KVM: SEV: Mark nested locking of vcpu->lock svm_vm_migrate_from() uses sev_lock_vcpus_for_migration() to lock all source and target vcpu->locks. Unfortunately there is an 8 subclass limit, so a new subclass cannot be used for each vCPU. Instead maintain ownership of the first vcpu's mutex.dep_map using a role specific subclass: source vs target. Release the other vcpu's mutex.dep_maps. Fixes: b56639318bb2b ("KVM: SEV: Add support for SEV intra host migration") Reported-by: John Sperbeck Suggested-by: David Rientjes Suggested-by: Sean Christopherson Suggested-by: Paolo Bonzini Cc: Hillf Danton Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Peter Gonda Message-Id: <20220502165807.529624-1-pgonda@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/sev.c | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) commit 4df22ca85d3d73f9822b1a354bb56dd1872180cd Merge: 64267926e01b bfdc0edd11f9 Author: Linus Torvalds Date: Fri May 6 09:50:25 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "A few recent regressions in rxe's multicast code, and some old driver bugs: - Error case unwind bug in rxe for rkeys - Dot not call netdev functions under a spinlock in rxe multicast code - Use the proper BH lock type in rxe multicast code - Fix idrma deadlock and crash - Add a missing flush to drain irdma QPs when in error - Fix high userspace latency in irdma during destroy due to synchronize_rcu() - Rare race in siw MPA processing" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/rxe: Change mcg_lock to a _bh lock RDMA/rxe: Do not call dev_mc_add/del() under a spinlock RDMA/siw: Fix a condition race issue in MPA request processing RDMA/irdma: Fix possible crash due to NULL netdev in notifier RDMA/irdma: Reduce iWARP QP destroy time RDMA/irdma: Flush iWARP QP if modified to ERR from RTR state RDMA/rxe: Recheck the MR in when generating a READ reply RDMA/irdma: Fix deadlock in irdma_cleanup_cm_core() RDMA/rxe: Fix "Replace mr by rkey in responder resources" commit 64267926e01b06f43e26232722fb3dc3f4819823 Merge: 5fa576d7f094 3e5a8e8494a8 Author: Linus Torvalds Date: Fri May 6 09:45:44 2022 -0700 Merge tag 'mmc-v5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull mmc fixes from Ulf Hansson: "MMC core: - Fix initialization for eMMC's HS200/HS400 mode MMC host: - sdhci-msm: Reset GCC_SDCC_BCR register to prevent timeout issues - sunxi-mmc: Fix DMA descriptors allocated above 32 bits" * tag 'mmc-v5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-msm: Reset GCC_SDCC_BCR register for SDHC mmc: sunxi-mmc: Fix DMA descriptors allocated above 32 bits mmc: core: Set HS clock speed before sending HS CMD13 commit 5fa576d7f094683051944b63fdba7e353b688746 Merge: fe27d189e3f4 5727375215b0 Author: Linus Torvalds Date: Fri May 6 09:33:28 2022 -0700 Merge tag 'drm-fixes-2022-05-06' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "A pretty quiet week, one fbdev, msm, kconfig, and two amdgpu fixes, about what I'd expect for rc6. fbdev: - hotunplugging fix amdgpu: - Fix a xen dom0 regression on APUs - Fix a potential array overflow if a receiver were to send an erroneous audio channel count msm: - lockdep fix. it6505: - kconfig fix" * tag 'drm-fixes-2022-05-06' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: Avoid reading audio pattern past AUDIO_CHANNELS_COUNT drm/amdgpu: do not use passthrough mode in Xen dom0 drm/bridge: ite-it6505: add missing Kconfig option select fbdev: Make fb_release() return -ENODEV if fbdev was unregistered drm/msm/dp: remove fail safe mode related code commit dba785798526a3282cc4d0f0ea751883715dbbb4 Author: Puyou Lu Date: Fri May 6 16:06:30 2022 +0800 gpio: pca953x: fix irq_stat not updated when irq is disabled (irq_mask not set) When one port's input state get inverted (eg. from low to hight) after pca953x_irq_setup but before setting irq_mask (by some other driver such as "gpio-keys"), the next inversion of this port (eg. from hight to low) will not be triggered any more (because irq_stat is not updated at the first time). Issue should be fixed after this commit. Fixes: 89ea8bbe9c3e ("gpio: pca953x.c: add interrupt handling capability") Signed-off-by: Puyou Lu Signed-off-by: Bartosz Golaszewski drivers/gpio/gpio-pca953x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9b9bd3f640640f94272a461b2dfe558f91b322c5 Author: Eric Yang Date: Sat Mar 19 16:34:24 2022 -0400 drm/amd/display: undo clearing of z10 related function pointers [Why] Z10 and S0i3 have some shared path. Previous code clean up , incorrectly removed these pointers, which breaks s0i3 restore [How] Do not clear the function pointers based on Z10 disable. Reviewed-by: Nicholas Kazlauskas Acked-by: Pavle Kotarac Signed-off-by: Eric Yang Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 5 ----- 1 file changed, 5 deletions(-) commit aa482ddca85a3485be0e7b83a0789dc4d987670b Author: Richard Gong Date: Fri Apr 8 12:08:38 2022 -0500 drm/amdgpu: vi: disable ASPM on Intel Alder Lake based systems Active State Power Management (ASPM) feature is enabled since kernel 5.14. There are some AMD Volcanic Islands (VI) GFX cards, such as the WX3200 and RX640, that do not work with ASPM-enabled Intel Alder Lake based systems. Using these GFX cards as video/display output, Intel Alder Lake based systems will freeze after suspend/resume. The issue was originally reported on one system (Dell Precision 3660 with BIOS version 0.14.81), but was later confirmed to affect at least 4 pre-production Alder Lake based systems. Add an extra check to disable ASPM on Intel Alder Lake based systems with the problematic AMD Volcanic Islands GFX cards. Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885 Signed-off-by: Richard Gong Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/vi.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) commit 44acfc22c7d055d9c4f8f0974ee28422405b971a Author: Maximilian Luz Date: Fri Apr 29 21:57:38 2022 +0200 platform/surface: aggregator: Fix initialization order when compiling as builtin module When building the Surface Aggregator Module (SAM) core, registry, and other SAM client drivers as builtin modules (=y), proper initialization order is not guaranteed. Due to this, client driver registration (triggered by device registration in the registry) races against bus initialization in the core. If any attempt is made at registering the device driver before the bus has been initialized (i.e. if bus initialization fails this race) driver registration will fail with a message similar to: Driver surface_battery was unable to register with bus_type surface_aggregator because the bus was not initialized Switch from module_init() to subsys_initcall() to resolve this issue. Note that the serdev subsystem uses postcore_initcall() so we are still able to safely register the serdev device driver for the core. Fixes: c167b9c7e3d6 ("platform/surface: Add Surface Aggregator subsystem") Reported-by: Blaž Hrastnik Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20220429195738.535751-1-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/surface/aggregator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ed13d4ac57474d959c40fd05d8860e2b1607becb Author: Maximilian Luz Date: Fri Apr 29 20:00:49 2022 +0200 platform/surface: gpe: Add support for Surface Pro 8 The new Surface Pro 8 uses GPEs for lid events as well. Add an entry for that so that the lid can be used to wake the device. Note that this is a device with a keyboard type-cover, where this acts as the "lid". Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20220429180049.1282447-1-luzmaximilian@gmail.com Signed-off-by: Hans de Goede drivers/platform/surface/surface_gpe.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 2cdfa0c20d58da3757054797c2974c967035926a Author: Prarit Bhargava Date: Fri Apr 29 08:23:22 2022 -0400 platform/x86/intel: Fix 'rmmod pmt_telemetry' panic 'rmmod pmt_telemetry' panics with: BUG: kernel NULL pointer dereference, address: 0000000000000040 #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: 4 PID: 1697 Comm: rmmod Tainted: G S W -------- --- 5.18.0-rc4 #3 Hardware name: Intel Corporation Alder Lake Client Platform/AlderLake-P DDR5 RVP, BIOS ADLPFWI1.R00.3056.B00.2201310233 01/31/2022 RIP: 0010:device_del+0x1b/0x3d0 Code: e8 1a d9 e9 ff e9 58 ff ff ff 48 8b 08 eb dc 0f 1f 44 00 00 41 56 41 55 41 54 55 48 8d af 80 00 00 00 53 48 89 fb 48 83 ec 18 <4c> 8b 67 40 48 89 ef 65 48 8b 04 25 28 00 00 00 48 89 44 24 10 31 RSP: 0018:ffffb520415cfd60 EFLAGS: 00010286 RAX: 0000000000000070 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000080 R08: ffffffffffffffff R09: ffffb520415cfd78 R10: 0000000000000002 R11: ffffb520415cfd78 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f7e198e5740(0000) GS:ffff905c9f700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000040 CR3: 000000010782a005 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: ? __xa_erase+0x53/0xb0 device_unregister+0x13/0x50 intel_pmt_dev_destroy+0x34/0x60 [pmt_class] pmt_telem_remove+0x40/0x50 [pmt_telemetry] auxiliary_bus_remove+0x18/0x30 device_release_driver_internal+0xc1/0x150 driver_detach+0x44/0x90 bus_remove_driver+0x74/0xd0 auxiliary_driver_unregister+0x12/0x20 pmt_telem_exit+0xc/0xe4a [pmt_telemetry] __x64_sys_delete_module+0x13a/0x250 ? syscall_trace_enter.isra.19+0x11e/0x1a0 do_syscall_64+0x58/0x80 ? syscall_exit_to_user_mode+0x12/0x30 ? do_syscall_64+0x67/0x80 ? syscall_exit_to_user_mode+0x12/0x30 ? do_syscall_64+0x67/0x80 ? syscall_exit_to_user_mode+0x12/0x30 ? do_syscall_64+0x67/0x80 ? exc_page_fault+0x64/0x140 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f7e1803a05b Code: 73 01 c3 48 8b 0d 2d 4e 38 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 b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d fd 4d 38 00 f7 d8 64 89 01 48 The probe function, pmt_telem_probe(), adds an entry for devices even if they have not been initialized. This results in the array of initialized devices containing both initialized and uninitialized entries. This causes a panic in the remove function, pmt_telem_remove() which expects the array to only contain initialized entries. Only use an entry when a device is initialized. Cc: "David E. Box" Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org Signed-off-by: David Arcari Signed-off-by: Prarit Bhargava Reviewed-by: David E. Box Link: https://lore.kernel.org/r/20220429122322.2550003-1-prarit@redhat.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/intel/pmt/telemetry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit aa2fef6f40e6ccc22e932b36898f260f0e5a021a Author: Mark Pearson Date: Mon May 2 15:12:00 2022 -0400 platform/x86: thinkpad_acpi: Correct dual fan probe There was an issue with the dual fan probe whereby the probe was failing as it assuming that second_fan support was not available. Corrected the logic so the probe works correctly. Cleaned up so quirks only used if 2nd fan not detected. Tested on X1 Carbon 10 (2 fans), X1 Carbon 9 (2 fans) and T490 (1 fan) Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220502191200.63470-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/thinkpad_acpi.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) commit 455cd867b85b53fd3602345f9b8a8facc551adc9 Author: Mario Limonciello Date: Thu Apr 28 22:05:01 2022 -0500 platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of laptops Lenovo laptops that contain NVME SSDs across a variety of generations have trouble resuming from suspend to idle when the IOMMU translation layer is active for the NVME storage device. This generally manifests as a large resume delay or page faults. These delays and page faults occur as a result of a Lenovo BIOS specific SMI that runs during the D3->D0 transition on NVME devices. This SMI occurs because of a flag that is set during resume by Lenovo firmware: ``` OperationRegion (PM80, SystemMemory, 0xFED80380, 0x10) Field (PM80, AnyAcc, NoLock, Preserve) { SI3R, 1 } Method (_ON, 0, NotSerialized) // _ON_: Power On { TPST (0x60D0) If ((DAS3 == 0x00)) { If (SI3R) { TPST (0x60E0) M020 (NBRI, 0x00, 0x00, 0x04, (NCMD | 0x06)) M020 (NBRI, 0x00, 0x00, 0x10, NBAR) APMC = HDSI /* \HDSI */ SLPS = 0x01 SI3R = 0x00 TPST (0x60E1) } D0NV = 0x01 } } ``` Create a quirk that will run early in the resume process to prevent this SMI from running. As any of these machines are fixed, they can be peeled back from this quirk or narrowed down to individual firmware versions. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1910 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1689 Signed-off-by: Mario Limonciello Tested-by: Mark Pearson Link: https://lore.kernel.org/r/20220429030501.1909-3-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/thinkpad_acpi.c | 126 +++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) commit c25d7f32e3e209462cd82e6e93e66b72dbb2308f Author: Mario Limonciello Date: Thu Apr 28 22:05:00 2022 -0500 platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks DMI matching in thinkpad_acpi happens local to a function meaning quirks can only match that function. Future changes to thinkpad_acpi may need to quirk other code, so change this to use a quirk infrastructure. Signed-off-by: Mario Limonciello Tested-by: Mark Pearson Link: https://lore.kernel.org/r/20220429030501.1909-2-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/thinkpad_acpi.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) commit 29ad05fd6760c55fa7ab0e1f96e5be1b66daa4fc Author: Darren Hart Date: Wed Apr 27 10:29:58 2022 -0700 Documentation/process: Add embargoed HW contact for Ampere Computing Add Darren Hart as Ampere Computing's ambassador for the embargoed hardware issues process. Signed-off-by: Darren Hart Link: https://lore.kernel.org/r/2e36a8e925bc958928b4afa189b2f876c392831b.1650995848.git.darren@os.amperecomputing.com Signed-off-by: Greg Kroah-Hartman Documentation/process/embargoed-hardware-issues.rst | 1 + 1 file changed, 1 insertion(+) commit 8bf6e0e3c7de857b91a75aa57cecd56c10035bb2 Author: Darren Hart Date: Wed Apr 27 10:29:57 2022 -0700 Documentation/process: Make groups alphabetical and use tabs consistently The list appears to be grouped by type (silicon, software, cloud) and mostly alphabetical within each group, with a few exceptions. Before adding to it, cleanup the list to be alphabetical within the groups, and use tabs consistently throughout the list. Signed-off-by: Darren Hart Link: https://lore.kernel.org/r/ec574b5d55584a3adda9bd31b7695193636ff136.1650995848.git.darren@os.amperecomputing.com Signed-off-by: Greg Kroah-Hartman Documentation/process/embargoed-hardware-issues.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 581dd69830341d299b0c097fc366097ab497d679 Author: Thiébaud Weksteen Date: Mon May 2 10:49:52 2022 +1000 firmware_loader: use kernel credentials when reading firmware Device drivers may decide to not load firmware when probed to avoid slowing down the boot process should the firmware filesystem not be available yet. In this case, the firmware loading request may be done when a device file associated with the driver is first accessed. The credentials of the userspace process accessing the device file may be used to validate access to the firmware files requested by the driver. Ensure that the kernel assumes the responsibility of reading the firmware. This was observed on Android for a graphic driver loading their firmware when the device file (e.g. /dev/mali0) was first opened by userspace (i.e. surfaceflinger). The security context of surfaceflinger was used to validate the access to the firmware file (e.g. /vendor/firmware/mali.bin). Previously, Android configurations were not setting up the firmware_class.path command line argument and were relying on the userspace fallback mechanism. In this case, the security context of the userspace daemon (i.e. ueventd) was consistently used to read firmware files. More Android devices are now found to set firmware_class.path which gives the kernel the opportunity to read the firmware directly (via kernel_read_file_from_path_initns). In this scenario, the current process credentials were used, even if unrelated to the loading of the firmware file. Signed-off-by: Thiébaud Weksteen Cc: # 5.10 Reviewed-by: Paul Moore Acked-by: Luis Chamberlain Link: https://lore.kernel.org/r/20220502004952.3970800-1-tweek@google.com Signed-off-by: Greg Kroah-Hartman drivers/base/firmware_loader/main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) commit b3c9a924aab61adbc29df110006aa03afe1a78ba Author: Javier Martinez Canillas Date: Fri May 6 00:06:31 2022 +0200 fbdev: vesafb: Cleanup fb_info in .fb_destroy rather than .remove The driver is calling framebuffer_release() in its .remove callback, but this will cause the struct fb_info to be freed too early. Since it could be that a reference is still hold to it if user-space opened the fbdev. This would lead to a use-after-free error if the framebuffer device was unregistered but later a user-space process tries to close the fbdev fd. To prevent this, move the framebuffer_release() call to fb_ops.fb_destroy instead of doing it in the driver's .remove callback. Strictly speaking, the code flow in the driver is still wrong because all the hardware cleanupd (i.e: iounmap) should be done in .remove while the software cleanup (i.e: releasing the framebuffer) should be done in the .fb_destroy handler. But this at least makes to match the behavior before commit 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal"). Fixes: 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal") Suggested-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220505220631.366371-1-javierm@redhat.com drivers/video/fbdev/vesafb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit d258d00fb9c7c0cdf9d10c1ded84f10339d2d349 Author: Javier Martinez Canillas Date: Fri May 6 00:05:40 2022 +0200 fbdev: efifb: Cleanup fb_info in .fb_destroy rather than .remove The driver is calling framebuffer_release() in its .remove callback, but this will cause the struct fb_info to be freed too early. Since it could be that a reference is still hold to it if user-space opened the fbdev. This would lead to a use-after-free error if the framebuffer device was unregistered but later a user-space process tries to close the fbdev fd. To prevent this, move the framebuffer_release() call to fb_ops.fb_destroy instead of doing it in the driver's .remove callback. Strictly speaking, the code flow in the driver is still wrong because all the hardware cleanupd (i.e: iounmap) should be done in .remove while the software cleanup (i.e: releasing the framebuffer) should be done in the .fb_destroy handler. But this at least makes to match the behavior before commit 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal"). Fixes: 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal") Suggested-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220505220540.366218-1-javierm@redhat.com drivers/video/fbdev/efifb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 666b90b3ce9e4aac1e1deba266c3a230fb3913b0 Author: Javier Martinez Canillas Date: Fri May 6 00:04:56 2022 +0200 fbdev: simplefb: Cleanup fb_info in .fb_destroy rather than .remove The driver is calling framebuffer_release() in its .remove callback, but this will cause the struct fb_info to be freed too early. Since it could be that a reference is still hold to it if user-space opened the fbdev. This would lead to a use-after-free error if the framebuffer device was unregistered but later a user-space process tries to close the fbdev fd. To prevent this, move the framebuffer_release() call to fb_ops.fb_destroy instead of doing it in the driver's .remove callback. Strictly speaking, the code flow in the driver is still wrong because all the hardware cleanupd (i.e: iounmap) should be done in .remove while the software cleanup (i.e: releasing the framebuffer) should be done in the .fb_destroy handler. But this at least makes to match the behavior before commit 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal"). Fixes: 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal") Suggested-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220505220456.366090-1-javierm@redhat.com drivers/video/fbdev/simplefb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 89bfd4017e58faaf70411555e7f508495114e90b Author: Daniel Vetter Date: Fri May 6 00:04:13 2022 +0200 fbdev: Prevent possible use-after-free in fb_release() Most fbdev drivers have issues with the fb_info lifetime, because call to framebuffer_release() from their driver's .remove callback, rather than doing from fbops.fb_destroy callback. Doing that will destroy the fb_info too early, while references to it may still exist, leading to a use-after-free error. To prevent this, check the fb_info reference counter when attempting to kfree the data structure in framebuffer_release(). That will leak it but at least will prevent the mentioned error. Signed-off-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220505220413.365977-1-javierm@redhat.com drivers/video/fbdev/core/fbsysfs.c | 4 ++++ 1 file changed, 4 insertions(+) commit 135332f34ba2662bc1e32b5c612e06a8cc41a053 Author: Javier Martinez Canillas Date: Wed May 4 13:59:17 2022 +0200 Revert "fbdev: Make fb_release() return -ENODEV if fbdev was unregistered" This reverts commit aafa025c76dcc7d1a8c8f0bdefcbe4eb480b2f6a. That commit attempted to fix a NULL pointer dereference, caused by the struct fb_info associated with a framebuffer device to not longer be valid when the file descriptor was closed. The issue was exposed by commit 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal"), which added a new path that goes through the struct device removal instead of directly unregistering the fb. Most fbdev drivers have issues with the fb_info lifetime, because call to framebuffer_release() from their driver's .remove callback, rather than doing from fbops.fb_destroy callback. This meant that due to this switch, the fb_info was now destroyed too early, while references still existed, while before it was simply leaked. The patch we're reverting here reinstated that leak, hence "fixed" the regression. But the proper solution is to fix the drivers to not release the fb_info too soon. Suggested-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220504115917.758787-1-javierm@redhat.com drivers/video/fbdev/core/fbmem.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 348c71344111d7a48892e3e52264ff11956fc196 Author: Kajol Jain Date: Thu May 5 21:04:51 2022 +0530 powerpc/papr_scm: Fix buffer overflow issue with CONFIG_FORTIFY_SOURCE With CONFIG_FORTIFY_SOURCE enabled, string functions will also perform dynamic checks for string size which can panic the kernel, like incase of overflow detection. In papr_scm, papr_scm_pmu_check_events function uses stat->stat_id with string operations, to populate the nvdimm_events_map array. Since stat_id variable is not NULL terminated, the kernel panics with CONFIG_FORTIFY_SOURCE enabled at boot time. Below are the logs of kernel panic: detected buffer overflow in __fortify_strlen ------------[ cut here ]------------ kernel BUG at lib/string_helpers.c:980! Oops: Exception in kernel mode, sig: 5 [#1] NIP [c00000000077dad0] fortify_panic+0x28/0x38 LR [c00000000077dacc] fortify_panic+0x24/0x38 Call Trace: [c0000022d77836e0] [c00000000077dacc] fortify_panic+0x24/0x38 (unreliable) [c00800000deb2660] papr_scm_pmu_check_events.constprop.0+0x118/0x220 [papr_scm] [c00800000deb2cb0] papr_scm_probe+0x288/0x62c [papr_scm] [c0000000009b46a8] platform_probe+0x98/0x150 Fix this issue by using kmemdup_nul() to copy the content of stat->stat_id directly to the nvdimm_events_map array. mpe: stat->stat_id comes from the hypervisor, not userspace, so there is no security exposure. Fixes: 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") Signed-off-by: Kajol Jain Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220505153451.35503-1-kjain@linux.ibm.com arch/powerpc/platforms/pseries/papr_scm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit c88d3908516d301972420160f5f15f936ba3ec3a Merge: 4e707344e185 93a8417088ea Author: Jakub Kicinski Date: Thu May 5 19:15:20 2022 -0700 Merge branch 'ocelot-vcap-fixes' Vladimir Oltean says: ==================== Ocelot VCAP fixes Changes in v2: fix the NPDs and UAFs caused by filter->trap_list in a more robust way that actually does not introduce bugs of its own (1/5) This series fixes issues found while running tools/testing/selftests/net/forwarding/tc_actions.sh on the ocelot switch: - NULL pointer dereference when failing to offload a filter - NULL pointer dereference after deleting a trap - filters still having effect after being deleted - dropped packets still being seen by software - statistics counters showing double the amount of hits - statistics counters showing inexistent hits - invalid configurations not rejected ==================== Link: https://lore.kernel.org/r/20220504235503.4161890-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 93a8417088ea570b5721d2b526337a2d3aed9fa3 Author: Vladimir Oltean Date: Thu May 5 02:55:03 2022 +0300 net: mscc: ocelot: avoid corrupting hardware counters when moving VCAP filters Given the following order of operations: (1) we add filter A using tc-flower (2) we send a packet that matches it (3) we read the filter's statistics to find a hit count of 1 (4) we add a second filter B with a higher preference than A, and A moves one position to the right to make room in the TCAM for it (5) we send another packet, and this matches the second filter B (6) we read the filter statistics again. When this happens, the hit count of filter A is 2 and of filter B is 1, despite a single packet having matched each filter. Furthermore, in an alternate history, reading the filter stats a second time between steps (3) and (4) makes the hit count of filter A remain at 1 after step (6), as expected. The reason why this happens has to do with the filter->stats.pkts field, which is written to hardware through the call path below: vcap_entry_set / | \ / | \ / | \ / | \ es0_entry_set is1_entry_set is2_entry_set \ | / \ | / \ | / vcap_data_set(data.counter, ...) The primary role of filter->stats.pkts is to transport the filter hit counters from the last readout all the way from vcap_entry_get() -> ocelot_vcap_filter_stats_update() -> ocelot_cls_flower_stats(). The reason why vcap_entry_set() writes it to hardware is so that the counters (saturating and having a limited bit width) are cleared after each user space readout. The writing of filter->stats.pkts to hardware during the TCAM entry movement procedure is an unintentional consequence of the code design, because the hit count isn't up to date at this point. So at step (4), when filter A is moved by ocelot_vcap_filter_add() to make room for filter B, the hardware hit count is 0 (no packet matched on it in the meantime), but filter->stats.pkts is 1, because the last readout saw the earlier packet. The movement procedure programs the old hit count back to hardware, so this creates the impression to user space that more packets have been matched than they really were. The bug can be seen when running the gact_drop_and_ok_test() from the tc_actions.sh selftest. Fix the issue by reading back the hit count to tmp->stats.pkts before migrating the VCAP filter. Sure, this is a best-effort technique, since the packets that hit the rule between vcap_entry_get() and vcap_entry_set() won't be counted, but at least it allows the counters to be reliably used for selftests where the traffic is under control. The vcap_entry_get() name is a bit unintuitive, but it only reads back the counter portion of the TCAM entry, not the entire entry. The index from which we retrieve the counter is also a bit unintuitive (i - 1 during add, i + 1 during del), but this is the way in which TCAM entry movement works. The "entry index" isn't a stored integer for a TCAM filter, instead it is dynamically computed by ocelot_vcap_block_get_filter_index() based on the entry's position in the &block->rules list. That position (as well as block->count) is automatically updated by ocelot_vcap_filter_add_to_block() on add, and by ocelot_vcap_block_remove_filter() on del. So "i" is the new filter index, and "i - 1" or "i + 1" respectively are the old addresses of that TCAM entry (we only support installing/deleting one filter at a time). Fixes: b596229448dd ("net: mscc: ocelot: Add support for tcam") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/ethernet/mscc/ocelot_vcap.c | 4 ++++ 1 file changed, 4 insertions(+) commit 477d2b91623e682e9a8126ea92acb8f684969cc7 Author: Vladimir Oltean Date: Thu May 5 02:55:02 2022 +0300 net: mscc: ocelot: restrict tc-trap actions to VCAP IS2 lookup 0 Once the CPU port was added to the destination port mask of a packet, it can never be cleared, so even packets marked as dropped by the MASK_MODE of a VCAP IS2 filter will still reach it. This is why we need the OCELOT_POLICER_DISCARD to "kill dropped packets dead" and make software stop seeing them. We disallow policer rules from being put on any other chain than the one for the first lookup, but we don't do this for "drop" rules, although we should. This change is merely ascertaining that the rules dont't (completely) work and letting the user know. The blamed commit is the one that introduced the multi-chain architecture in ocelot. Prior to that, we should have always offloaded the filters to VCAP IS2 lookup 0, where they did work. Fixes: 1397a2eb52e2 ("net: mscc: ocelot: create TCAM skeleton from tc filter chains") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/ethernet/mscc/ocelot_flower.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 6741e11880003e35802d78cc58035057934f4dab Author: Vladimir Oltean Date: Thu May 5 02:55:01 2022 +0300 net: mscc: ocelot: fix VCAP IS2 filters matching on both lookups The VCAP IS2 TCAM is looked up twice per packet, and each filter can be configured to only match during the first, second lookup, or both, or none. The blamed commit wrote the code for making VCAP IS2 filters match only on the given lookup. But right below that code, there was another line that explicitly made the lookup a "don't care", and this is overwriting the lookup we've selected. So the code had no effect. Some of the more noticeable effects of having filters match on both lookups: - in "tc -s filter show dev swp0 ingress", we see each packet matching a VCAP IS2 filter counted twice. This throws off scripts such as tools/testing/selftests/net/forwarding/tc_actions.sh and makes them fail. - a "tc-drop" action offloaded to VCAP IS2 needs a policer as well, because once the CPU port becomes a member of the destination port mask of a packet, nothing removes it, not even a PERMIT/DENY mask mode with a port mask of 0. But VCAP IS2 rules with the POLICE_ENA bit in the action vector can only appear in the first lookup. What happens when a filter matches both lookups is that the action vector is combined, and this makes the POLICE_ENA bit ineffective, since the last lookup in which it has appeared is the second one. In other words, "tc-drop" actions do not drop packets for the CPU port, dropped packets are still seen by software unless there was an FDB entry that directed those packets to some other place different from the CPU. The last bit used to work, because in the initial commit b596229448dd ("net: mscc: ocelot: Add support for tcam"), we were writing the FIRST field of the VCAP IS2 half key with a 1, not with a "don't care". The change to "don't care" was made inadvertently by me in commit c1c3993edb7c ("net: mscc: ocelot: generalize existing code for VCAP"), which I just realized, and which needs a separate fix from this one, for "stable" kernels that lack the commit blamed below. Fixes: 226e9cd82a96 ("net: mscc: ocelot: only install TCAM entries into a specific lookup and PAG") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/ethernet/mscc/ocelot_vcap.c | 1 - 1 file changed, 1 deletion(-) commit 16bbebd35629c93a8c68c6d8d28557e100bcee73 Author: Vladimir Oltean Date: Thu May 5 02:55:00 2022 +0300 net: mscc: ocelot: fix last VCAP IS1/IS2 filter persisting in hardware when deleted ocelot_vcap_filter_del() works by moving the next filters over the current one, and then deleting the last filter by calling vcap_entry_set() with a del_filter which was specially created by memsetting its memory to zeroes. vcap_entry_set() then programs this to the TCAM and action RAM via the cache registers. The problem is that vcap_entry_set() is a dispatch function which looks at del_filter->block_id. But since del_filter is zeroized memory, the block_id is 0, or otherwise said, VCAP_ES0. So practically, what we do is delete the entry at the same TCAM index from VCAP ES0 instead of IS1 or IS2. The code was not always like this. vcap_entry_set() used to simply be is2_entry_set(), and then, the logic used to work. Restore the functionality by populating the block_id of the del_filter based on the VCAP block of the filter that we're deleting. This makes vcap_entry_set() know what to do. Fixes: 1397a2eb52e2 ("net: mscc: ocelot: create TCAM skeleton from tc filter chains") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/ethernet/mscc/ocelot_vcap.c | 4 ++++ 1 file changed, 4 insertions(+) commit e1846cff2fe614d93a2f89461b5935678fd34bd9 Author: Vladimir Oltean Date: Thu May 5 02:54:59 2022 +0300 net: mscc: ocelot: mark traps with a bool instead of keeping them in a list Since the blamed commit, VCAP filters can appear on more than one list. If their action is "trap", they are chained on ocelot->traps via filter->trap_list. This is in addition to their normal placement on the VCAP block->rules list head. Therefore, when we free a VCAP filter, we must remove it from all lists it is a member of, including ocelot->traps. There are at least 2 bugs which are direct consequences of this design decision. First is the incorrect usage of list_empty(), meant to denote whether "filter" is chained into ocelot->traps via filter->trap_list. This does not do the correct thing, because list_empty() checks whether "head->next == head", but in our case, head->next == head->prev == NULL. So we dereference NULL pointers and die when we call list_del(). Second is the fact that not all places that should remove the filter from ocelot->traps do so. One example is ocelot_vcap_block_remove_filter(), which is where we have the main kfree(filter). By keeping freed filters in ocelot->traps we end up in a use-after-free in felix_update_trapping_destinations(). Attempting to fix all the buggy patterns is a whack-a-mole game which makes the driver unmaintainable. Actually this is what the previous patch version attempted to do: https://patchwork.kernel.org/project/netdevbpf/patch/20220503115728.834457-3-vladimir.oltean@nxp.com/ but it introduced another set of bugs, because there are other places in which create VCAP filters, not just ocelot_vcap_filter_create(): - ocelot_trap_add() - felix_tag_8021q_vlan_add_rx() - felix_tag_8021q_vlan_add_tx() Relying on the convention that all those code paths must call INIT_LIST_HEAD(&filter->trap_list) is not going to scale. So let's do what should have been done in the first place and keep a bool in struct ocelot_vcap_filter which denotes whether we are looking at a trapping rule or not. Iterating now happens over the main VCAP IS2 block->rules. The advantage is that we no longer risk having stale references to a freed filter, since it is only present in that list. Fixes: e42bd4ed09aa ("net: mscc: ocelot: keep traps in a list") Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/dsa/ocelot/felix.c | 7 ++++++- drivers/net/ethernet/mscc/ocelot.c | 11 +++-------- drivers/net/ethernet/mscc/ocelot_flower.c | 4 +--- include/soc/mscc/ocelot_vcap.h | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) commit f1c8781ac9d87650ccf45a354c0bbfa3f9230371 Author: Haowen Bai Date: Thu May 5 16:17:33 2022 +0200 s390/dasd: Use kzalloc instead of kmalloc/memset Use kzalloc rather than duplicating its implementation, which makes code simple and easy to understand. Signed-off-by: Haowen Bai Reviewed-by: Sven Schnelle Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20220505141733.1989450-6-sth@linux.ibm.com Signed-off-by: Jens Axboe drivers/s390/block/dasd_eckd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit b9c10f68e23c13f56685559a0d6fdaca9f838324 Author: Jan Höppner Date: Thu May 5 16:17:32 2022 +0200 s390/dasd: Fix read inconsistency for ESE DASD devices Read requests that return with NRF error are partially completed in dasd_eckd_ese_read(). The function keeps track of the amount of processed bytes and the driver will eventually return this information back to the block layer for further processing via __dasd_cleanup_cqr() when the request is in the final stage of processing (from the driver's perspective). For this, blk_update_request() is used which requires the number of bytes to complete the request. As per documentation the nr_bytes parameter is described as follows: "number of bytes to complete for @req". This was mistakenly interpreted as "number of bytes _left_ for @req" leading to new requests with incorrect data length. The consequence are inconsistent and completely wrong read requests as data from random memory areas are read back. Fix this by correctly specifying the amount of bytes that should be used to complete the request. Fixes: 5e6bdd37c552 ("s390/dasd: fix data corruption for thin provisioned devices") Cc: stable@vger.kernel.org # 5.3+ Signed-off-by: Jan Höppner Reviewed-by: Stefan Haberland Link: https://lore.kernel.org/r/20220505141733.1989450-5-sth@linux.ibm.com Signed-off-by: Jens Axboe drivers/s390/block/dasd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit cd68c48ea15c85f1577a442dc4c285e112ff1b37 Author: Jan Höppner Date: Thu May 5 16:17:31 2022 +0200 s390/dasd: Fix read for ESE with blksize < 4k When reading unformatted tracks on ESE devices, the corresponding memory areas are simply set to zero for each segment. This is done incorrectly for blocksizes < 4096. There are two problems. First, the increment of dst is done using the counter of the loop (off), which is increased by blksize every iteration. This leads to a much bigger increment for dst as actually intended. Second, the increment of dst is done before the memory area is set to 0, skipping a significant amount of bytes of memory. This leads to illegal overwriting of memory and ultimately to a kernel panic. This is not a problem with 4k blocksize because blk_queue_max_segment_size is set to PAGE_SIZE, always resulting in a single iteration for the inner segment loop (bv.bv_len == blksize). The incorrectly used 'off' value to increment dst is 0 and the correct memory area is used. In order to fix this for blksize < 4k, increment dst correctly using the blksize and only do it at the end of the loop. Fixes: 5e2b17e712cf ("s390/dasd: Add dynamic formatting support for ESE volumes") Cc: stable@vger.kernel.org # v5.3+ Signed-off-by: Jan Höppner Reviewed-by: Stefan Haberland Link: https://lore.kernel.org/r/20220505141733.1989450-4-sth@linux.ibm.com Signed-off-by: Jens Axboe drivers/s390/block/dasd_eckd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit 71f3871657370dbbaf942a1c758f64e49a36c70f Author: Stefan Haberland Date: Thu May 5 16:17:30 2022 +0200 s390/dasd: prevent double format of tracks for ESE devices For ESE devices we get an error for write operations on an unformatted track. Afterwards the track will be formatted and the IO operation restarted. When using alias devices a track might be accessed by multiple requests simultaneously and there is a race window that a track gets formatted twice resulting in data loss. Prevent this by remembering the amount of formatted tracks when starting a request and comparing this number before actually formatting a track on the fly. If the number has changed there is a chance that the current track was finally formatted in between. As a result do not format the track and restart the current IO to check. The number of formatted tracks does not match the overall number of formatted tracks on the device and it might wrap around but this is no problem. It is only needed to recognize that a track has been formatted at all in between. Fixes: 5e2b17e712cf ("s390/dasd: Add dynamic formatting support for ESE volumes") Cc: stable@vger.kernel.org # 5.3+ Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220505141733.1989450-3-sth@linux.ibm.com Signed-off-by: Jens Axboe drivers/s390/block/dasd.c | 7 +++++++ drivers/s390/block/dasd_eckd.c | 19 +++++++++++++++++-- drivers/s390/block/dasd_int.h | 2 ++ 3 files changed, 26 insertions(+), 2 deletions(-) commit 5b53a405e4658580e1faf7c217db3f55a21ba849 Author: Stefan Haberland Date: Thu May 5 16:17:29 2022 +0200 s390/dasd: fix data corruption for ESE devices For ESE devices we get an error when accessing an unformatted track. The handling of this error will return zero data for read requests and format the track on demand before writing to it. To do this the code needs to distinguish between read and write requests. This is done with data from the blocklayer request. A pointer to the blocklayer request is stored in the CQR. If there is an error on the device an ERP request is built to do error recovery. While the ERP request is mostly a copy of the original CQR the pointer to the blocklayer request is not copied to not accidentally pass it back to the blocklayer without cleanup. This leads to the error that during ESE handling after an ERP request was built it is not possible to determine the IO direction. This leads to the formatting of a track for read requests which might in turn lead to data corruption. Fixes: 5e2b17e712cf ("s390/dasd: Add dynamic formatting support for ESE volumes") Cc: stable@vger.kernel.org # 5.3+ Signed-off-by: Stefan Haberland Reviewed-by: Jan Hoeppner Link: https://lore.kernel.org/r/20220505141733.1989450-2-sth@linux.ibm.com Signed-off-by: Jens Axboe drivers/s390/block/dasd.c | 8 +++++++- drivers/s390/block/dasd_eckd.c | 2 +- drivers/s390/block/dasd_int.h | 12 ++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) commit 4e707344e18525b4edf5c2bc2e3eb60692e8c92e Author: Jonathan Toppins Date: Wed May 4 14:59:08 2022 -0400 MAINTAINERS: add missing files for bonding definition The bonding entry did not include additional include files that have been added nor did it reference the documentation. Add these references for completeness. Signed-off-by: Jonathan Toppins Link: https://lore.kernel.org/r/903ed2906b93628b38a2015664a20d2802042863.1651690748.git.jtoppins@redhat.com Signed-off-by: Jakub Kicinski MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 85db6352fc8a158a893151baa1716463d34a20d0 Author: Tariq Toukan Date: Wed May 4 11:09:14 2022 +0300 net: Fix features skip in for_each_netdev_feature() The find_next_netdev_feature() macro gets the "remaining length", not bit index. Passing "bit - 1" for the following iteration is wrong as it skips the adjacent bit. Pass "bit" instead. Fixes: 3b89ea9c5902 ("net: Fix for_each_netdev_feature on Big endian") Signed-off-by: Tariq Toukan Reviewed-by: Gal Pressman Link: https://lore.kernel.org/r/20220504080914.1918-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski include/linux/netdev_features.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5727375215b0915f28806c337a7ba9835efd340b Merge: ca5e2f4d6b67 3f65b1e2f424 Author: Dave Airlie Date: Fri May 6 11:17:59 2022 +1000 Merge tag 'drm-msm-fixes-2022-04-30' of https://gitlab.freedesktop.org/drm/msm into drm-fixes single lockdep fix. Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGtkzqzxDLp82OaKXVrWd7nWZtkxKsuOK1wOGCDz7qF-dA@mail.gmail.com commit 690447a22c70402c2ef142d8328c909ee7cea853 Merge: 15f03ffe4bb9 e71b7f1f44d3 Author: Jakub Kicinski Date: Thu May 5 18:12:47 2022 -0700 Merge branch 'vrf-fix-address-binding-with-icmp-socket' Nicolas Dichtel says: ==================== vrf: fix address binding with icmp socket The first patch fixes the issue. The second patch adds related tests in selftests. ==================== Link: https://lore.kernel.org/r/20220504090739.21821-1-nicolas.dichtel@6wind.com Signed-off-by: Jakub Kicinski commit e71b7f1f44d3d88c677769c85ef0171caf9fc89f Author: Nicolas Dichtel Date: Wed May 4 11:07:39 2022 +0200 selftests: add ping test with ping_group_range tuned The 'ping' utility is able to manage two kind of sockets (raw or icmp), depending on the sysctl ping_group_range. By default, ping_group_range is set to '1 0', which forces ping to use an ip raw socket. Let's replay the ping tests by allowing 'ping' to use the ip icmp socket. After the previous patch, ipv4 tests results are the same with both kinds of socket. For ipv6, there are a lot a new failures (the previous patch fixes only two cases). Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski tools/testing/selftests/net/fcnal-test.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit e1a7ac6f3ba6e157adcd0ca94d92a401f1943f56 Author: Nicolas Dichtel Date: Wed May 4 11:07:38 2022 +0200 ping: fix address binding wrt vrf When ping_group_range is updated, 'ping' uses the DGRAM ICMP socket, instead of an IP raw socket. In this case, 'ping' is unable to bind its socket to a local address owned by a vrflite. Before the patch: $ sysctl -w net.ipv4.ping_group_range='0 2147483647' $ ip link add blue type vrf table 10 $ ip link add foo type dummy $ ip link set foo master blue $ ip link set foo up $ ip addr add 192.168.1.1/24 dev foo $ ip addr add 2001::1/64 dev foo $ ip vrf exec blue ping -c1 -I 192.168.1.1 192.168.1.2 ping: bind: Cannot assign requested address $ ip vrf exec blue ping6 -c1 -I 2001::1 2001::2 ping6: bind icmp socket: Cannot assign requested address CC: stable@vger.kernel.org Fixes: 1b69c6d0ae90 ("net: Introduce L3 Master device abstraction") Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski net/ipv4/ping.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit ca5e2f4d6b677efa3f43a6790777e46dcf806e4d Merge: ebbc04bdb196 841e512ffb64 Author: Dave Airlie Date: Fri May 6 10:56:20 2022 +1000 Merge tag 'drm-misc-fixes-2022-05-05' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v5.18-rc6: - Small fix for hot-unplugging fb devices. - Kconfig fix for it6505. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/69e51773-8c6f-4ff7-9a06-5c2922a43999@linux.intel.com commit 15f03ffe4bb951e982457f44b6cf6b06ef4cbb93 Author: Fabio Estevam Date: Wed May 4 11:31:04 2022 -0300 net: phy: micrel: Pass .probe for KS8737 Since commit f1131b9c23fb ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices") the kszphy_suspend/ resume hooks are used. These functions require the probe function to be called so that priv can be allocated. Otherwise, a NULL pointer dereference happens inside kszphy_config_reset(). Cc: stable@vger.kernel.org Fixes: f1131b9c23fb ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices") Reported-by: Andrew Lunn Signed-off-by: Fabio Estevam Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220504143104.1286960-2-festevam@gmail.com Signed-off-by: Jakub Kicinski drivers/net/phy/micrel.c | 1 + 1 file changed, 1 insertion(+) commit e333eed63a091a09bd0db191b7710c594c6e995b Author: Fabio Estevam Date: Wed May 4 11:31:03 2022 -0300 net: phy: micrel: Do not use kszphy_suspend/resume for KSZ8061 Since commit f1131b9c23fb ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices") the following NULL pointer dereference is observed on a board with KSZ8061: # udhcpc -i eth0 udhcpc: started, v1.35.0 8<--- cut here --- Unable to handle kernel NULL pointer dereference at virtual address 00000008 pgd = f73cef4e [00000008] *pgd=00000000 Internal error: Oops: 5 [#1] SMP ARM Modules linked in: CPU: 0 PID: 196 Comm: ifconfig Not tainted 5.15.37-dirty #94 Hardware name: Freescale i.MX6 SoloX (Device Tree) PC is at kszphy_config_reset+0x10/0x114 LR is at kszphy_resume+0x24/0x64 ... The KSZ8061 phy_driver structure does not have the .probe/..driver_data fields, which means that priv is not allocated. This causes the NULL pointer dereference inside kszphy_config_reset(). Fix the problem by using the generic suspend/resume functions as before. Another alternative would be to provide the .probe and .driver_data information into the structure, but to be on the safe side, let's just restore Ethernet functionality by using the generic suspend/resume. Cc: stable@vger.kernel.org Fixes: f1131b9c23fb ("net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices") Signed-off-by: Fabio Estevam Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220504143104.1286960-1-festevam@gmail.com Signed-off-by: Jakub Kicinski drivers/net/phy/micrel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ebbc04bdb1966e29d736ec4d28dd6f5cc203291f Merge: 672c0c517342 3dfe85fa87b2 Author: Dave Airlie Date: Fri May 6 09:59:47 2022 +1000 Merge tag 'amd-drm-fixes-5.18-2022-05-04' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.18-2022-05-04: amdgpu: - Fix a xen dom0 regression on APUs - Fix a potential array overflow if a receiver were to send an erroneous audio channel count Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220504190439.5723-1-alexander.deucher@amd.com commit fe27d189e3f42e31d3c8223d5daed7285e334c5e Merge: f47c960e9395 b9ff43dd2743 Author: Linus Torvalds Date: Thu May 5 16:52:15 2022 -0700 Merge tag 'folio-5.18f' of git://git.infradead.org/users/willy/pagecache Pull folio fixes from Matthew Wilcox: "Two folio fixes for 5.18. Darrick and Brian have done amazing work debugging the race I created in the folio BIO iterator. The readahead problem was deterministic, so easy to fix. - Fix a race when we were calling folio_next() in the BIO folio iter without holding a reference, meaning the folio could be split or freed, and we'd jump to the next page instead of the intended next folio. - Fix readahead creating single-page folios instead of the intended large folios when doing reads that are not a power of two in size" * tag 'folio-5.18f' of git://git.infradead.org/users/willy/pagecache: mm/readahead: Fix readahead with large folios block: Do not call folio_next() on an unreferenced folio commit 6997fbd7a3dafa754f81d541498ace35b43246d8 Author: Tetsuo Handa Date: Thu May 5 10:53:53 2022 +0900 net: rds: use maybe_get_net() when acquiring refcount on TCP sockets Eric Dumazet is reporting addition on 0 problem at rds_tcp_tune(), for delayed works queued in rds_wq might be invoked after a net namespace's refcount already reached 0. Since rds_tcp_exit_net() from cleanup_net() calls flush_workqueue(rds_wq), it is guaranteed that we can instead use maybe_get_net() from delayed work functions until rds_tcp_exit_net() returns. Note that I'm not convinced that all works which might access a net namespace are already queued in rds_wq by the moment rds_tcp_exit_net() calls flush_workqueue(rds_wq). If some race is there, rds_tcp_exit_net() will fail to wait for work functions, and kmem_cache_free() could be called from net_free() before maybe_get_net() is called from rds_tcp_tune(). Reported-by: Eric Dumazet Fixes: 3a58f13a881ed351 ("net: rds: acquire refcount on TCP sockets") Signed-off-by: Tetsuo Handa Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/41d09faf-bc78-1a87-dfd1-c6d1b5984b61@I-love.SAKURA.ne.jp Signed-off-by: Jakub Kicinski net/rds/tcp.c | 12 +++++++++--- net/rds/tcp.h | 2 +- net/rds/tcp_connect.c | 5 ++++- net/rds/tcp_listen.c | 5 ++++- 4 files changed, 18 insertions(+), 6 deletions(-) commit f47c960e9395743a8aa3bd939d4d3a0f582f565e Merge: 0f5d752b1395 5dc463042651 Author: Linus Torvalds Date: Thu May 5 15:50:27 2022 -0700 Merge tag 'devicetree-fixes-for-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Drop unused 'max-link-speed' in Apple PCIe - More redundant 'maxItems/minItems' schema fixes - Support values for pinctrl 'drive-push-pull' and 'drive-open-drain' - Fix redundant 'unevaluatedProperties' in MT6360 LEDs binding - Add missing 'power-domains' property to Cadence UFSHC * tag 'devicetree-fixes-for-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: pci: apple,pcie: Drop max-link-speed from example dt-bindings: Drop redundant 'maxItems/minItems' in if/then schemas dt-bindings: pinctrl: Allow values for drive-push-pull and drive-open-drain dt-bindings: leds-mt6360: Drop redundant 'unevaluatedProperties' dt-bindings: ufs: cdns,ufshc: Add power-domains commit 401fb66a355eb0f22096cf26864324f8e63c7d78 Author: Indan Zupancic Date: Thu May 5 13:47:50 2022 +0200 fsl_lpuart: Don't enable interrupts too early If an irq is pending when devm_request_irq() is called, the irq handler will cause a NULL pointer access because initialisation is not done yet. Fixes: 9d7ee0e28da59 ("tty: serial: lpuart: avoid report NULL interrupt") Cc: stable Signed-off-by: Indan Zupancic Link: https://lore.kernel.org/r/20220505114750.45423-1-Indan.Zupancic@mep-info.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/fsl_lpuart.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit 9361ebfbb79fd1bc8594a487c01ad52cdaa391ea Author: Daniel Starke Date: Wed May 4 10:17:33 2022 +0200 tty: n_gsm: fix invalid gsmtty_write_room() result gsmtty_write() does not prevent the user to use the full fifo size of 4096 bytes as allocated in gsm_dlci_alloc(). However, gsmtty_write_room() tries to limit the return value by 'TX_SIZE' and returns a negative value if the fifo has more than 'TX_SIZE' bytes stored. This is obviously wrong as 'TX_SIZE' is defined as 512. Define 'TX_SIZE' to the fifo size and use it accordingly for allocation to keep the current behavior. Return the correct remaining size of the fifo in gsmtty_write_room() via kfifo_avail(). Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220504081733.3494-3-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit edd5f60c340086891fab094ad61270d6c80f9ca4 Author: Daniel Starke Date: Wed May 4 10:17:32 2022 +0200 tty: n_gsm: fix mux activation issues in gsm_config() The current implementation activates the mux if it was restarted and opens the control channel if the mux was previously closed and we are now acting as initiator instead of responder, which is the default setting. This has two issues. 1) No mux is activated if we keep all default values and only switch to initiator. The control channel is not allocated but will be opened next which results in a NULL pointer dereference. 2) Switching the configuration after it was once configured while keeping the initiator value the same will not reopen the control channel if it was closed due to parameter incompatibilities. The mux remains dead. Fix 1) by always activating the mux if it is dead after configuration. Fix 2) by always opening the control channel after mux activation. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220504081733.3494-2-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit fd442e5ba30aaa75ea47b32149e7a3110dc20a46 Author: Daniel Starke Date: Wed May 4 10:17:31 2022 +0200 tty: n_gsm: fix buffer over-read in gsm_dlci_data() 'len' is decreased after each octet that has its EA bit set to 0, which means that the value is encoded with additional octets. However, the final octet does not decreases 'len' which results in 'len' being one byte too long. A buffer over-read may occur in tty_insert_flip_string() as it tries to read one byte more than the passed content size of 'data'. Decrease 'len' also for the final octet which has the EA bit set to 1 to write the correct number of bytes from the internal receive buffer to the virtual tty. Fixes: 2e124b4a390c ("TTY: switch tty_flip_buffer_push") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220504081733.3494-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 1 + 1 file changed, 1 insertion(+) commit e1bfdbc7daca171c74a577b3dd0b36d76bb0ffcc Author: AngeloGioacchino Del Regno Date: Wed Apr 27 15:23:28 2022 +0200 serial: 8250_mtk: Fix register address for XON/XOFF character The XON1/XOFF1 character registers are at offset 0xa0 and 0xa8 respectively, so we cannot use the definition in serial_port.h. Fixes: bdbd0a7f8f03 ("serial: 8250-mtk: modify baudrate setting") Signed-off-by: AngeloGioacchino Del Regno Cc: stable Link: https://lore.kernel.org/r/20220427132328.228297-4-angelogioacchino.delregno@collabora.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/8250/8250_mtk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 6f81fdded0d024c7d4084d434764f30bca1cd6b1 Author: AngeloGioacchino Del Regno Date: Wed Apr 27 15:23:27 2022 +0200 serial: 8250_mtk: Make sure to select the right FEATURE_SEL Set the FEATURE_SEL at probe time to make sure that BIT(0) is enabled: this guarantees that when the port is configured as AP UART, the right register layout is interpreted by the UART IP. Signed-off-by: AngeloGioacchino Del Regno Cc: stable Link: https://lore.kernel.org/r/20220427132328.228297-3-angelogioacchino.delregno@collabora.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/8250/8250_mtk.c | 7 +++++++ 1 file changed, 7 insertions(+) commit bb0b197aadd928f52ce6f01f0ee977f0a08cf1be Author: AngeloGioacchino Del Regno Date: Wed Apr 27 15:23:26 2022 +0200 serial: 8250_mtk: Fix UART_EFR register address On MediaTek SoCs, the UART IP is 16550A compatible, but there are some specific quirks: we are declaring a register shift of 2, but this is only valid for the majority of the registers, as there are some that are out of the standard layout. Specifically, this driver is using definitions from serial_reg.h, where we have a UART_EFR register defined as 2: this results in a 0x8 offset, but there we have the FCR register instead. The right offset for the EFR register on MediaTek UART is at 0x98, so, following the decimal definition convention in serial_reg.h and accounting for the register left shift of two, add and use the correct register address for this IP, defined as decimal 38, so that the final calculation results in (0x26 << 2) = 0x98. Fixes: bdbd0a7f8f03 ("serial: 8250-mtk: modify baudrate setting") Signed-off-by: AngeloGioacchino Del Regno Cc: stable Link: https://lore.kernel.org/r/20220427132328.228297-2-angelogioacchino.delregno@collabora.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/8250/8250_mtk.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) commit 447ee1516f19f534a228dda237eddb202f23e163 Author: Yang Yingliang Date: Thu May 5 20:46:21 2022 +0800 tty/serial: digicolor: fix possible null-ptr-deref in digicolor_uart_probe() It will cause null-ptr-deref when using 'res', if platform_get_resource() returns NULL, so move using 'res' after devm_ioremap_resource() that will check it to avoid null-ptr-deref. And use devm_platform_get_and_ioremap_resource() to simplify code. Fixes: 5930cb3511df ("serial: driver for Conexant Digicolor USART") Signed-off-by: Yang Yingliang Reviewed-by: Baruch Siach Cc: stable Link: https://lore.kernel.org/r/20220505124621.1592697-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/digicolor-usart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit b81ac4395bbeaf36e078dea1a48c02dd97b76235 Author: Dan Vacura Date: Tue May 3 15:10:38 2022 -0500 usb: gadget: uvc: allow for application to cleanly shutdown Several types of kernel panics can occur due to timing during the uvc gadget removal. This appears to be a problem with gadget resources being managed by both the client application's v4l2 open/close and the UDC gadget bind/unbind. Since the concept of USB_GADGET_DELAYED_STATUS doesn't exist for unbind, add a wait to allow for the application to close out. Some examples of the panics that can occur are: <1>[ 1147.652313] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000028 <4>[ 1147.652510] Call trace: <4>[ 1147.652514] usb_gadget_disconnect+0x74/0x1f0 <4>[ 1147.652516] usb_gadget_deactivate+0x38/0x168 <4>[ 1147.652520] usb_function_deactivate+0x54/0x90 <4>[ 1147.652524] uvc_function_disconnect+0x14/0x38 <4>[ 1147.652527] uvc_v4l2_release+0x34/0xa0 <4>[ 1147.652537] __fput+0xdc/0x2c0 <4>[ 1147.652540] ____fput+0x10/0x1c <4>[ 1147.652545] task_work_run+0xe4/0x12c <4>[ 1147.652549] do_notify_resume+0x108/0x168 <1>[ 282.950561][ T1472] Unable to handle kernel NULL pointer dereference at virtual address 00000000000005b8 <6>[ 282.953111][ T1472] Call trace: <6>[ 282.953121][ T1472] usb_function_deactivate+0x54/0xd4 <6>[ 282.953134][ T1472] uvc_v4l2_release+0xac/0x1e4 <6>[ 282.953145][ T1472] v4l2_release+0x134/0x1f0 <6>[ 282.953167][ T1472] __fput+0xf4/0x428 <6>[ 282.953178][ T1472] ____fput+0x14/0x24 <6>[ 282.953193][ T1472] task_work_run+0xac/0x130 <3>[ 213.410077][ T29] configfs-gadget gadget: uvc: Failed to queue request (-108). <1>[ 213.410116][ T29] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000003 <6>[ 213.413460][ T29] Call trace: <6>[ 213.413474][ T29] uvcg_video_pump+0x1f0/0x384 <6>[ 213.413489][ T29] process_one_work+0x2a4/0x544 <6>[ 213.413502][ T29] worker_thread+0x350/0x784 <6>[ 213.413515][ T29] kthread+0x2ac/0x320 <6>[ 213.413528][ T29] ret_from_fork+0x10/0x30 Signed-off-by: Dan Vacura Cc: stable Link: https://lore.kernel.org/r/20220503201039.71720-1-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/function/f_uvc.c | 25 +++++++++++++++++++++++++ drivers/usb/gadget/function/uvc.h | 2 ++ drivers/usb/gadget/function/uvc_v4l2.c | 3 ++- 3 files changed, 29 insertions(+), 1 deletion(-) commit bbc126ae381cf0a27822c1f822d0aeed74cc40d9 Author: Uwe Kleine-König Date: Mon May 2 10:04:56 2022 +0200 usb: typec: tcpci: Don't skip cleanup in .remove() on error Returning an error value in 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. In this case the remove callback even returns early without stopping the tcpm worker thread and various timers. A work scheduled on the work queue, or a firing timer after tcpci_remove() returned probably results in a use-after-free situation because the regmap and driver data were freed. So better make sure that tcpci_unregister_port() is called even if disabling the irq failed. Also emit a more specific error message instead of the i2c core's "remove failed (EIO), will be ignored" and return 0 to suppress the core's warning. This patch is (also) a preparation for making i2c remove callbacks return void. Fixes: 3ba76256fc4e ("usb: typec: tcpci: mask event interrupts when remove driver") Signed-off-by: Uwe Kleine-König Cc: stable Acked-by: Heikki Krogerus Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220502080456.21568-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman drivers/usb/typec/tcpm/tcpci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 01e01f5c89773c600a9f0b32c888de0146066c3a Author: Sergey Ryazanov Date: Sun May 1 20:58:28 2022 +0300 usb: cdc-wdm: fix reading stuck on device close cdc-wdm tracks whether a response reading request is in-progress and blocks the next request from being sent until the previous request is completed. As soon as last user closes the cdc-wdm device file, the driver cancels any ongoing requests, resets the pending response counter, but leaves the response reading in-progress flag (WDM_RESPONDING) untouched. So if the user closes the device file during the response receive request is being performed, no more data will be obtained from the modem. The request will be cancelled, effectively preventing the WDM_RESPONDING flag from being reseted. Keeping the flag set will prevent a new response receive request from being sent, permanently blocking the read path. The read path will staying blocked until the module will be reloaded or till the modem will be re-attached. This stuck has been observed with a Huawei E3372 modem attached to an OpenWrt router and using the comgt utility to set up a network connection. Fix this issue by clearing the WDM_RESPONDING flag on the device file close. Without this fix, the device reading stuck can be easily reproduced in a few connection establishing attempts. With this fix, a load test for modem connection re-establishing worked for several hours without any issues. Fixes: 922a5eadd5a3 ("usb: cdc-wdm: Fix race between autosuspend and reading from the device") Signed-off-by: Sergey Ryazanov Cc: stable Acked-by: Oliver Neukum Link: https://lore.kernel.org/r/20220501175828.8185-1-ryazanov.s.a@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/class/cdc-wdm.c | 1 + 1 file changed, 1 insertion(+) commit 3e1ad196385c65c1454aceab1226d9a4baca27d5 Author: David Sterba Date: Tue May 3 17:35:25 2022 +0200 btrfs: sysfs: export the balance paused state of exclusive operation The new state allowing device addition with paused balance is not exported to user space so it can't recognize it and actually start the operation. Fixes: efc0e69c2fea ("btrfs: introduce exclusive operation BALANCE_PAUSED state") CC: stable@vger.kernel.org # 5.17 Signed-off-by: David Sterba fs/btrfs/sysfs.c | 3 +++ 1 file changed, 3 insertions(+) commit 750ee454908e90a8792b1e2b157c2948da86e926 Author: Filipe Manana Date: Tue May 3 11:57:02 2022 +0100 btrfs: fix assertion failure when logging directory key range item When inserting a key range item (BTRFS_DIR_LOG_INDEX_KEY) while logging a directory, we don't expect the insertion to fail with -EEXIST, because we are holding the directory's log_mutex and we have dropped all existing BTRFS_DIR_LOG_INDEX_KEY keys from the log tree before we started to log the directory. However it's possible that during the logging we attempt to insert the same BTRFS_DIR_LOG_INDEX_KEY key twice, but for this to happen we need to race with insertions of items from other inodes in the subvolume's tree while we are logging a directory. Here's how this can happen: 1) We are logging a directory with inode number 1000 that has its items spread across 3 leaves in the subvolume's tree: leaf A - has index keys from the range 2 to 20 for example. The last item in the leaf corresponds to a dir item for index number 20. All these dir items were created in a past transaction. leaf B - has index keys from the range 22 to 100 for example. It has no keys from other inodes, all its keys are dir index keys for our directory inode number 1000. Its first key is for the dir item with a sequence number of 22. All these dir items were also created in a past transaction. leaf C - has index keys for our directory for the range 101 to 120 for example. This leaf also has items from other inodes, and its first item corresponds to the dir item for index number 101 for our directory with inode number 1000; 2) When we finish processing the items from leaf A at log_dir_items(), we log a BTRFS_DIR_LOG_INDEX_KEY key with an offset of 21 and a last offset of 21, meaning the log is authoritative for the index range from 21 to 21 (a single sequence number). At this point leaf B was not yet modified in the current transaction; 3) When we return from log_dir_items() we have released our read lock on leaf B, and have set *last_offset_ret to 21 (index number of the first item on leaf B minus 1); 4) Some other task inserts an item for other inode (inode number 1001 for example) into leaf C. That resulted in pushing some items from leaf C into leaf B, in order to make room for the new item, so now leaf B has dir index keys for the sequence number range from 22 to 102 and leaf C has the dir items for the sequence number range 103 to 120; 5) At log_directory_changes() we call log_dir_items() again, passing it a 'min_offset' / 'min_key' value of 22 (*last_offset_ret from step 3 plus 1, so 21 + 1). Then btrfs_search_forward() leaves us at slot 0 of leaf B, since leaf B was modified in the current transaction. We have also initialized 'last_old_dentry_offset' to 20 after calling btrfs_previous_item() at log_dir_items(), as it left us at the last item of leaf A, which refers to the dir item with sequence number 20; 6) We then call process_dir_items_leaf() to process the dir items of leaf B, and when we process the first item, corresponding to slot 0, sequence number 22, we notice the dir item was created in a past transaction and its sequence number is greater than the value of *last_old_dentry_offset + 1 (20 + 1), so we decide to log again a BTRFS_DIR_LOG_INDEX_KEY key with an offset of 21 and an end range of 21 (key.offset - 1 == 22 - 1 == 21), which results in an -EEXIST error from insert_dir_log_key(), as we have already inserted that key at step 2, triggering the assertion at process_dir_items_leaf(). The trace produced in dmesg is like the following: assertion failed: ret != -EEXIST, in fs/btrfs/tree-log.c:3857 [198255.980839][ T7460] ------------[ cut here ]------------ [198255.981666][ T7460] kernel BUG at fs/btrfs/ctree.h:3617! [198255.983141][ T7460] invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI [198255.984080][ T7460] CPU: 0 PID: 7460 Comm: repro-ghost-dir Not tainted 5.18.0-5314c78ac373-misc-next+ [198255.986027][ T7460] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 [198255.988600][ T7460] RIP: 0010:assertfail.constprop.0+0x1c/0x1e [198255.989465][ T7460] Code: 8b 4c 89 (...) [198255.992599][ T7460] RSP: 0018:ffffc90007387188 EFLAGS: 00010282 [198255.993414][ T7460] RAX: 000000000000003d RBX: 0000000000000065 RCX: 0000000000000000 [198255.996056][ T7460] RDX: 0000000000000001 RSI: ffffffff8b62b180 RDI: fffff52000e70e24 [198255.997668][ T7460] RBP: ffffc90007387188 R08: 000000000000003d R09: ffff8881f0e16507 [198255.999199][ T7460] R10: ffffed103e1c2ca0 R11: 0000000000000001 R12: 00000000ffffffef [198256.000683][ T7460] R13: ffff88813befc630 R14: ffff888116c16e70 R15: ffffc90007387358 [198256.007082][ T7460] FS: 00007fc7f7c24640(0000) GS:ffff8881f0c00000(0000) knlGS:0000000000000000 [198256.009939][ T7460] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [198256.014133][ T7460] CR2: 0000560bb16d0b78 CR3: 0000000140b34005 CR4: 0000000000170ef0 [198256.015239][ T7460] Call Trace: [198256.015674][ T7460] [198256.016313][ T7460] log_dir_items.cold+0x16/0x2c [198256.018858][ T7460] ? replay_one_extent+0xbf0/0xbf0 [198256.025932][ T7460] ? release_extent_buffer+0x1d2/0x270 [198256.029658][ T7460] ? rcu_read_lock_sched_held+0x16/0x80 [198256.031114][ T7460] ? lock_acquired+0xbe/0x660 [198256.032633][ T7460] ? rcu_read_lock_sched_held+0x16/0x80 [198256.034386][ T7460] ? lock_release+0xcf/0x8a0 [198256.036152][ T7460] log_directory_changes+0xf9/0x170 [198256.036993][ T7460] ? log_dir_items+0xba0/0xba0 [198256.037661][ T7460] ? do_raw_write_unlock+0x7d/0xe0 [198256.038680][ T7460] btrfs_log_inode+0x233b/0x26d0 [198256.041294][ T7460] ? log_directory_changes+0x170/0x170 [198256.042864][ T7460] ? btrfs_attach_transaction_barrier+0x60/0x60 [198256.045130][ T7460] ? rcu_read_lock_sched_held+0x16/0x80 [198256.046568][ T7460] ? lock_release+0xcf/0x8a0 [198256.047504][ T7460] ? lock_downgrade+0x420/0x420 [198256.048712][ T7460] ? ilookup5_nowait+0x81/0xa0 [198256.049747][ T7460] ? lock_downgrade+0x420/0x420 [198256.050652][ T7460] ? do_raw_spin_unlock+0xa9/0x100 [198256.051618][ T7460] ? __might_resched+0x128/0x1c0 [198256.052511][ T7460] ? __might_sleep+0x66/0xc0 [198256.053442][ T7460] ? __kasan_check_read+0x11/0x20 [198256.054251][ T7460] ? iget5_locked+0xbd/0x150 [198256.054986][ T7460] ? run_delayed_iput_locked+0x110/0x110 [198256.055929][ T7460] ? btrfs_iget+0xc7/0x150 [198256.056630][ T7460] ? btrfs_orphan_cleanup+0x4a0/0x4a0 [198256.057502][ T7460] ? free_extent_buffer+0x13/0x20 [198256.058322][ T7460] btrfs_log_inode+0x2654/0x26d0 [198256.059137][ T7460] ? log_directory_changes+0x170/0x170 [198256.060020][ T7460] ? rcu_read_lock_sched_held+0x16/0x80 [198256.060930][ T7460] ? rcu_read_lock_sched_held+0x16/0x80 [198256.061905][ T7460] ? lock_contended+0x770/0x770 [198256.062682][ T7460] ? btrfs_log_inode_parent+0xd04/0x1750 [198256.063582][ T7460] ? lock_downgrade+0x420/0x420 [198256.064432][ T7460] ? preempt_count_sub+0x18/0xc0 [198256.065550][ T7460] ? __mutex_lock+0x580/0xdc0 [198256.066654][ T7460] ? stack_trace_save+0x94/0xc0 [198256.068008][ T7460] ? __kasan_check_write+0x14/0x20 [198256.072149][ T7460] ? __mutex_unlock_slowpath+0x12a/0x430 [198256.073145][ T7460] ? mutex_lock_io_nested+0xcd0/0xcd0 [198256.074341][ T7460] ? wait_for_completion_io_timeout+0x20/0x20 [198256.075345][ T7460] ? lock_downgrade+0x420/0x420 [198256.076142][ T7460] ? lock_contended+0x770/0x770 [198256.076939][ T7460] ? do_raw_spin_lock+0x1c0/0x1c0 [198256.078401][ T7460] ? btrfs_sync_file+0x5e6/0xa40 [198256.080598][ T7460] btrfs_log_inode_parent+0x523/0x1750 [198256.081991][ T7460] ? wait_current_trans+0xc8/0x240 [198256.083320][ T7460] ? lock_downgrade+0x420/0x420 [198256.085450][ T7460] ? btrfs_end_log_trans+0x70/0x70 [198256.086362][ T7460] ? rcu_read_lock_sched_held+0x16/0x80 [198256.087544][ T7460] ? lock_release+0xcf/0x8a0 [198256.088305][ T7460] ? lock_downgrade+0x420/0x420 [198256.090375][ T7460] ? dget_parent+0x8e/0x300 [198256.093538][ T7460] ? do_raw_spin_lock+0x1c0/0x1c0 [198256.094918][ T7460] ? lock_downgrade+0x420/0x420 [198256.097815][ T7460] ? do_raw_spin_unlock+0xa9/0x100 [198256.101822][ T7460] ? dget_parent+0xb7/0x300 [198256.103345][ T7460] btrfs_log_dentry_safe+0x48/0x60 [198256.105052][ T7460] btrfs_sync_file+0x629/0xa40 [198256.106829][ T7460] ? start_ordered_ops.constprop.0+0x120/0x120 [198256.109655][ T7460] ? __fget_files+0x161/0x230 [198256.110760][ T7460] vfs_fsync_range+0x6d/0x110 [198256.111923][ T7460] ? start_ordered_ops.constprop.0+0x120/0x120 [198256.113556][ T7460] __x64_sys_fsync+0x45/0x70 [198256.114323][ T7460] do_syscall_64+0x5c/0xc0 [198256.115084][ T7460] ? syscall_exit_to_user_mode+0x3b/0x50 [198256.116030][ T7460] ? do_syscall_64+0x69/0xc0 [198256.116768][ T7460] ? do_syscall_64+0x69/0xc0 [198256.117555][ T7460] ? do_syscall_64+0x69/0xc0 [198256.118324][ T7460] ? sysvec_call_function_single+0x57/0xc0 [198256.119308][ T7460] ? asm_sysvec_call_function_single+0xa/0x20 [198256.120363][ T7460] entry_SYSCALL_64_after_hwframe+0x44/0xae [198256.121334][ T7460] RIP: 0033:0x7fc7fe97b6ab [198256.122067][ T7460] Code: 0f 05 48 (...) [198256.125198][ T7460] RSP: 002b:00007fc7f7c23950 EFLAGS: 00000293 ORIG_RAX: 000000000000004a [198256.126568][ T7460] RAX: ffffffffffffffda RBX: 00007fc7f7c239f0 RCX: 00007fc7fe97b6ab [198256.127942][ T7460] RDX: 0000000000000002 RSI: 000056167536bcf0 RDI: 0000000000000004 [198256.129302][ T7460] RBP: 0000000000000004 R08: 0000000000000000 R09: 000000007ffffeb8 [198256.130670][ T7460] R10: 00000000000001ff R11: 0000000000000293 R12: 0000000000000001 [198256.132046][ T7460] R13: 0000561674ca8140 R14: 00007fc7f7c239d0 R15: 000056167536dab8 [198256.133403][ T7460] Fix this by treating -EEXIST as expected at insert_dir_log_key() and have it update the item with an end offset corresponding to the maximum between the previously logged end offset and the new requested end offset. The end offsets may be different due to dir index key deletions that happened as part of unlink operations while we are logging a directory (triggered when fsyncing some other inode parented by the directory) or during renames which always attempt to log a single dir index deletion. Reported-by: Zygo Blaxell Link: https://lore.kernel.org/linux-btrfs/YmyefE9mc2xl5ZMz@hungrycats.org/ Fixes: 732d591a5d6c12 ("btrfs: stop copying old dir items when logging a directory") Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) commit ceb4f60830a7cd38ff47b7dd54e9e06ddbaf413c Author: Naohiro Aota Date: Tue May 3 14:10:05 2022 -0700 btrfs: zoned: activate block group properly on unlimited active zone device btrfs_zone_activate() checks if it activated all the underlying zones in the loop. However, that check never hit on an unlimited activate zone device (max_active_zones == 0). Fortunately, it still works without ENOSPC because btrfs_zone_activate() returns true in the end, even if block_group->zone_is_active == 0. But, it is confusing to have non zone_is_active block group still usable for allocation. Also, we are wasting CPU time to iterate the loop every time btrfs_zone_activate() is called for the blog groups. Since error case in the loop is handled by out_unlock, we can just set zone_is_active and do the list stuff after the loop. Fixes: f9a912a3c45f ("btrfs: zoned: make zone activation multi stripe capable") Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba fs/btrfs/zoned.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) commit 549577127afeb759c29cdeeff1bdccd86e6c0dbf Author: Naohiro Aota Date: Tue May 3 14:10:04 2022 -0700 btrfs: zoned: move non-changing condition check out of the loop btrfs_zone_activate() checks if block_group->alloc_offset == block_group->zone_capacity every time it iterates the loop. But, it is not depending on the index. Move out the check and do it only once. Fixes: f9a912a3c45f ("btrfs: zoned: make zone activation multi stripe capable") Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba fs/btrfs/zoned.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 9f73f1aef98b2fa7252c0a89be64840271ce8ea0 Author: Qu Wenruo Date: Fri Apr 1 15:29:37 2022 +0800 btrfs: force v2 space cache usage for subpage mount [BUG] For a 4K sector sized btrfs with v1 cache enabled and only mounted on systems with 4K page size, if it's mounted on subpage (64K page size) systems, it can cause the following warning on v1 space cache: BTRFS error (device dm-1): csum mismatch on free space cache BTRFS warning (device dm-1): failed to load free space cache for block group 84082688, rebuilding it now Although not a big deal, as kernel can rebuild it without problem, such warning will bother end users, especially if they want to switch the same btrfs seamlessly between different page sized systems. [CAUSE] V1 free space cache is still using fixed PAGE_SIZE for various bitmap, like BITS_PER_BITMAP. Such hard-coded PAGE_SIZE usage will cause various mismatch, from v1 cache size to checksum. Thus kernel will always reject v1 cache with a different PAGE_SIZE with csum mismatch. [FIX] Although we should fix v1 cache, it's already going to be marked deprecated soon. And we have v2 cache based on metadata (which is already fully subpage compatible), and it has almost everything superior than v1 cache. So just force subpage mount to use v2 cache on mount. Reported-by: Matt Corallo CC: stable@vger.kernel.org # 5.15+ Link: https://lore.kernel.org/linux-btrfs/61aa27d1-30fc-c1a9-f0f4-9df544395ec3@bluematt.me/ Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Signed-off-by: David Sterba fs/btrfs/disk-io.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit 2685027fca387b602ae565bff17895188b803988 Author: Waiman Long Date: Wed Apr 27 10:54:28 2022 -0400 cgroup/cpuset: Remove cpus_allowed/mems_allowed setup in cpuset_init_smp() There are 3 places where the cpu and node masks of the top cpuset can be initialized in the order they are executed: 1) start_kernel -> cpuset_init() 2) start_kernel -> cgroup_init() -> cpuset_bind() 3) kernel_init_freeable() -> do_basic_setup() -> cpuset_init_smp() The first cpuset_init() call just sets all the bits in the masks. The second cpuset_bind() call sets cpus_allowed and mems_allowed to the default v2 values. The third cpuset_init_smp() call sets them back to v1 values. For systems with cgroup v2 setup, cpuset_bind() is called once. As a result, cpu and memory node hot add may fail to update the cpu and node masks of the top cpuset to include the newly added cpu or node in a cgroup v2 environment. For systems with cgroup v1 setup, cpuset_bind() is called again by rebind_subsystem() when the v1 cpuset filesystem is mounted as shown in the dmesg log below with an instrumented kernel. [ 2.609781] cpuset_bind() called - v2 = 1 [ 3.079473] cpuset_init_smp() called [ 7.103710] cpuset_bind() called - v2 = 0 smp_init() is called after the first two init functions. So we don't have a complete list of active cpus and memory nodes until later in cpuset_init_smp() which is the right time to set up effective_cpus and effective_mems. To fix this cgroup v2 mask setup problem, the potentially incorrect cpus_allowed & mems_allowed setting in cpuset_init_smp() are removed. For cgroup v2 systems, the initial cpuset_bind() call will set the masks correctly. For cgroup v1 systems, the second call to cpuset_bind() will do the right setup. cc: stable@vger.kernel.org Signed-off-by: Waiman Long Tested-by: Feng Tang Reviewed-by: Michal Koutný Signed-off-by: Tejun Heo kernel/cgroup/cpuset.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 0f5d752b1395e777ef81e28886945e5e939b7c8a Merge: 905a6537e764 a06afe838308 Author: Linus Torvalds Date: Thu May 5 10:38:11 2022 -0700 Merge tag 's390-5.18-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Heiko Carstens: - Disable -Warray-bounds warning for gcc12, since the only known way to workaround false positive warnings on lowcore accesses would result in worse code on fast paths. - Avoid lockdep_assert_held() warning in kvm vm memop code. - Reduce overhead within gmap_rmap code to get rid of long latencies when e.g. shutting down 2nd level guests. * tag 's390-5.18-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: KVM: s390: vsie/gmap: reduce gmap_rmap overhead KVM: s390: Fix lockdep issue in vm memop s390: disable -Warray-bounds commit 905a6537e7640993fdbd18da6f56d86035069e88 Merge: 68533eb1fb19 f0a6c68f6998 Author: Linus Torvalds Date: Thu May 5 10:27:30 2022 -0700 Merge tag 'mips-fixes_5.18_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fix from Thomas Bogendoerfer: "Extend R4000/R4400 CPU erratum workaround to all revisions" * tag 'mips-fixes_5.18_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Fix CP0 counter erratum detection for R4k CPUs commit 68533eb1fb197a413fd8612ebb88e111ade3beac Merge: a7391ad35724 4071bf121d59 Author: Linus Torvalds Date: Thu May 5 09:45:12 2022 -0700 Merge tag 'net-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from can, rxrpc and wireguard. Previous releases - regressions: - igmp: respect RCU rules in ip_mc_source() and ip_mc_msfilter() - mld: respect RCU rules in ip6_mc_source() and ip6_mc_msfilter() - rds: acquire netns refcount on TCP sockets - rxrpc: enable IPv6 checksums on transport socket - nic: hinic: fix bug of wq out of bound access - nic: thunder: don't use pci_irq_vector() in atomic context - nic: bnxt_en: fix possible bnxt_open() failure caused by wrong RFS flag - nic: mlx5e: - lag, fix use-after-free in fib event handler - fix deadlock in sync reset flow Previous releases - always broken: - tcp: fix insufficient TCP source port randomness - can: grcan: grcan_close(): fix deadlock - nfc: reorder destructive operations in to avoid bugs Misc: - wireguard: improve selftests reliability" * tag 'net-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (63 commits) NFC: netlink: fix sleep in atomic bug when firmware download timeout selftests: ocelot: tc_flower_chains: specify conform-exceed action for policer tcp: drop the hash_32() part from the index calculation tcp: increase source port perturb table to 2^16 tcp: dynamically allocate the perturb table used by source ports tcp: add small random increments to the source port tcp: resalt the secret every 10 seconds tcp: use different parts of the port_offset for index and offset secure_seq: use the 64 bits of the siphash for port offset calculation wireguard: selftests: set panic_on_warn=1 from cmdline wireguard: selftests: bump package deps wireguard: selftests: restore support for ccache wireguard: selftests: use newer toolchains to fill out architectures wireguard: selftests: limit parallelism to $(nproc) tests at once wireguard: selftests: make routing loop test non-fatal net/mlx5: Fix matching on inner TTC net/mlx5: Avoid double clear or set of sync reset requested net/mlx5: Fix deadlock in sync reset flow net/mlx5e: Fix trust state reset in reload net/mlx5e: Avoid checking offload capability in post_parse action ... commit 870b1eee2d844727b06e238c121d260bc5645580 Author: Ethan Yang Date: Mon Apr 25 13:58:40 2022 +0800 USB: serial: qcserial: add support for Sierra Wireless EM7590 Add support for Sierra Wireless EM7590 0xc080/0xc081 compositions. Signed-off-by: Ethan Yang Link: https://lore.kernel.org/r/20220425055840.5693-1-etyang@sierrawireless.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold drivers/usb/serial/qcserial.c | 2 ++ 1 file changed, 2 insertions(+) commit 171865dab096da1ab980a32eeea5d1b88cd7bc50 Author: Nobuhiro Iwamatsu Date: Thu Apr 21 18:42:28 2022 +0900 gpio: visconti: Fix fwnode of GPIO IRQ The fwnode of GPIO IRQ must be set to its own fwnode, not the fwnode of the parent IRQ. Therefore, this sets own fwnode instead of the parent IRQ fwnode to GPIO IRQ's. Fixes: 2ad74f40dacc ("gpio: visconti: Add Toshiba Visconti GPIO support") Signed-off-by: Nobuhiro Iwamatsu Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski drivers/gpio/gpio-visconti.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 07989eb981d862f7f2be68d233d753f2e7ccc119 Author: Sven Schwermer Date: Mon Apr 25 16:34:50 2022 +0200 USB: serial: option: add Fibocom MA510 modem The MA510 modem has 3 USB configurations that are configurable via the AT command AT+GTUSBMODE={30,31,32} which make the modem enumerate with the following interfaces, respectively: 30: Diag + QDSS + Modem + RMNET 31: Diag + Modem + AT + ECM 32: Modem + AT + ECM The first configuration (30) reuses u-blox R410M's VID/PID with identical interface configuration. A detailed description of the USB configuration for each mode follows: +GTUSBMODE: 30 -------------- T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#= 19 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=05c6 ProdID=90b2 Rev= 0.00 S: Manufacturer=Fibocom MA510 Modem S: Product=Fibocom MA510 Modem S: SerialNumber=55e2695b C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +GTUSBMODE: 31 -------------- T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#= 99 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0106 Rev= 0.00 S: Manufacturer=Fibocom MA510 Modem S: Product=Fibocom MA510 Modem S: SerialNumber=55e2695b C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 3 IfCount= 2 Cls=02(comm.) Sub=00 Prot=00 I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms I: If#= 4 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 4 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +GTUSBMODE: 32 -------------- T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=100 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=010a Rev= 0.00 S: Manufacturer=Fibocom MA510 Modem S: Product=Fibocom MA510 Modem S: SerialNumber=55e2695b C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 2 IfCount= 2 Cls=02(comm.) Sub=00 Prot=00 I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=85(I) Atr=03(Int.) MxPS= 64 Ivl=2ms I: If#= 3 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 3 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Sven Schwermer Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) commit 714adff9a6271b5f1664b04c944b598141ebfe73 Author: Sven Schwermer Date: Mon Apr 25 16:34:49 2022 +0200 USB: serial: option: add Fibocom L610 modem The L610 modem has 3 USB configurations that are configurable via the AT command AT+GTUSBMODE={31,32,33} which make the modem enumerate with the following interfaces, respectively: 31: Modem + NV + MOS + Diag + LOG + AT + AT 32: ECM + Modem + NV + MOS + Diag + LOG + AT + AT 33: RNDIS + Modem + NV + MOS + Diag + LOG + AT + AT A detailed description of the USB configuration for each mode follows: +GTUSBMODE: 31 -------------- T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=124 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1782 ProdID=4d10 Rev= 0.00 S: Manufacturer=FIBOCOM S: Product=L610 C:* #Ifs= 7 Cfg#= 1 Atr=e0 MxPwr=400mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +GTUSBMODE: 32 -------------- T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=122 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1782 ProdID=4d11 Rev= 0.00 S: Manufacturer=FIBOCOM S: Product=L610 C:* #Ifs= 9 Cfg#= 1 Atr=e0 MxPwr=400mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +GTUSBMODE: 33 -------------- T: Bus=03 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=126 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1782 ProdID=4d11 Rev= 0.00 S: Manufacturer=FIBOCOM S: Product=L610 C:* #Ifs= 9 Cfg#= 1 Atr=e0 MxPwr=400mA A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03 I:* If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=rndis_host E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=4096ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 7 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 8 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option E: Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Sven Schwermer Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+) commit 26a08f8bad3e1f98d3153f939fb8cd330da4cb26 Author: Scott Chen Date: Mon Apr 25 17:00:20 2022 +0800 USB: serial: pl2303: add device id for HP LM930 Display Add the device id for the HPLM930Display which is a PL2303GC based device. Signed-off-by: Scott Chen Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 1 + 2 files changed, 2 insertions(+) commit 8707898e22fd665bc1d7b18b809be4b56ce25bdd Author: Thomas Pfaff Date: Mon May 2 13:28:29 2022 +0200 genirq: Synchronize interrupt thread startup A kernel hang can be observed when running setserial in a loop on a kernel with force threaded interrupts. The sequence of events is: setserial open("/dev/ttyXXX") request_irq() do_stuff() -> serial interrupt -> wake(irq_thread) desc->threads_active++; close() free_irq() kthread_stop(irq_thread) synchronize_irq() <- hangs because desc->threads_active != 0 The thread is created in request_irq() and woken up, but does not get on a CPU to reach the actual thread function, which would handle the pending wake-up. kthread_stop() sets the should stop condition which makes the thread immediately exit, which in turn leaves the stale threads_active count around. This problem was introduced with commit 519cc8652b3a, which addressed a interrupt sharing issue in the PCIe code. Before that commit free_irq() invoked synchronize_irq(), which waits for the hard interrupt handler and also for associated threads to complete. To address the PCIe issue synchronize_irq() was replaced with __synchronize_hardirq(), which only waits for the hard interrupt handler to complete, but not for threaded handlers. This was done under the assumption, that the interrupt thread already reached the thread function and waits for a wake-up, which is guaranteed to be handled before acting on the stop condition. The problematic case, that the thread would not reach the thread function, was obviously overlooked. Make sure that the interrupt thread is really started and reaches thread_fn() before returning from __setup_irq(). This utilizes the existing wait queue in the interrupt descriptor. The wait queue is unused for non-shared interrupts. For shared interrupts the usage might cause a spurious wake-up of a waiter in synchronize_irq() or the completion of a threaded handler might cause a spurious wake-up of the waiter for the ready flag. Both are harmless and have no functional impact. [ tglx: Amended changelog ] Fixes: 519cc8652b3a ("genirq: Synchronize only with single thread on free_irq()") Signed-off-by: Thomas Pfaff Signed-off-by: Thomas Gleixner Reviewed-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/552fe7b4-9224-b183-bb87-a8f36d335690@pcs.com kernel/irq/internals.h | 2 ++ kernel/irq/irqdesc.c | 2 ++ kernel/irq/manage.c | 39 +++++++++++++++++++++++++++++---------- 3 files changed, 33 insertions(+), 10 deletions(-) commit 2d3535ed2c73fee356160aed40714b27be07442a Author: Bartosz Golaszewski Date: Mon May 2 11:34:16 2022 +0200 MAINTAINERS: update the GPIO git tree entry My git tree has become the de facto main GPIO tree. Update the MAINTAINERS file to reflect that. Signed-off-by: Bartosz Golaszewski Reported-by: Baruch Siach Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4071bf121d59944d5cd2238de0642f3d7995a997 Author: Duoming Zhou Date: Wed May 4 13:58:47 2022 +0800 NFC: netlink: fix sleep in atomic bug when firmware download timeout There are sleep in atomic bug that could cause kernel panic during firmware download process. The root cause is that nlmsg_new with GFP_KERNEL parameter is called in fw_dnld_timeout which is a timer handler. The call trace is shown below: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:265 Call Trace: kmem_cache_alloc_node __alloc_skb nfc_genl_fw_download_done call_timer_fn __run_timers.part.0 run_timer_softirq __do_softirq ... The nlmsg_new with GFP_KERNEL parameter may sleep during memory allocation process, and the timer handler is run as the result of a "software interrupt" that should not call any other function that could sleep. This patch changes allocation mode of netlink message from GFP_KERNEL to GFP_ATOMIC in order to prevent sleep in atomic bug. The GFP_ATOMIC flag makes memory allocation operation could be used in atomic context. Fixes: 9674da8759df ("NFC: Add firmware upload netlink command") Fixes: 9ea7187c53f6 ("NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD") Signed-off-by: Duoming Zhou Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220504055847.38026-1-duoming@zju.edu.cn Signed-off-by: Paolo Abeni net/nfc/netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit b9ff43dd27434dbd850b908e2e0e1f6e794efd9b Author: Matthew Wilcox (Oracle) Date: Wed Apr 27 17:01:28 2022 -0400 mm/readahead: Fix readahead with large folios Reading 100KB chunks from a big file (eg dd bs=100K) leads to poor readahead behaviour. Studying the traces in detail, I noticed two problems. The first is that we were setting the readahead flag on the folio which contains the last byte read from the block. This is wrong because we will trigger readahead at the end of the read without waiting to see if a subsequent read is going to use the pages we just read. Instead, we need to set the readahead flag on the first folio _after_ the one which contains the last byte that we're reading. The second is that we were looking for the index of the folio with the readahead flag set to exactly match the start + size - async_size. If we've rounded this, either down (as previously) or up (as now), we'll think we hit a folio marked as readahead by a different read, and try to read the wrong pages. So round the expected index to the order of the folio we hit. Reported-by: Guo Xuenan Signed-off-by: Matthew Wilcox (Oracle) mm/readahead.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit 170f37d6aa6ad4582eefd7459015de79e244536e Author: Matthew Wilcox (Oracle) Date: Tue May 3 00:09:31 2022 -0400 block: Do not call folio_next() on an unreferenced folio It is unsafe to call folio_next() on a folio unless you hold a reference on it that prevents it from being split or freed. After returning from the iterator, iomap calls folio_end_writeback() which may drop the last reference to the page, or allow the page to be split. If that happens, the iterator will not advance far enough through the bio_vec, leading to assertion failures like the BUG() in folio_end_writeback() that checks we're not trying to end writeback on a page not currently under writeback. Other assertion failures were also seen, but they're all explained by this one bug. Fix the bug by remembering where the next folio starts before returning from the iterator. There are other ways of fixing this bug, but this seems the simplest. Reported-by: Darrick J. Wong Tested-by: Darrick J. Wong Reported-by: Brian Foster Tested-by: Brian Foster Signed-off-by: Matthew Wilcox (Oracle) include/linux/bio.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 5a7c5f70c743c6cf32b44b05bd6b19d4ad82f49d Author: Vladimir Oltean Date: Tue May 3 15:14:28 2022 +0300 selftests: ocelot: tc_flower_chains: specify conform-exceed action for policer As discussed here with Ido Schimmel: https://patchwork.kernel.org/project/netdevbpf/patch/20220224102908.5255-2-jianbol@nvidia.com/ the default conform-exceed action is "reclassify", for a reason we don't really understand. The point is that hardware can't offload that police action, so not specifying "conform-exceed" was always wrong, even though the command used to work in hardware (but not in software) until the kernel started adding validation for it. Fix the command used by the selftest by making the policer drop on exceed, and pass the packet to the next action (goto) on conform. Fixes: 8cd6b020b644 ("selftests: ocelot: add some example VCAP IS1, IS2 and ES0 tc offloads") Signed-off-by: Vladimir Oltean Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20220503121428.842906-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski tools/testing/selftests/drivers/net/ocelot/tc_flower_chains.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ef562489818723ea0a66c57bfdfbf151ad568c42 Merge: 205557ba9904 e8161345ddbb Author: Jakub Kicinski Date: Wed May 4 19:22:34 2022 -0700 Merge branch 'insufficient-tcp-source-port-randomness' Willy Tarreau says: ==================== insufficient TCP source port randomness In a not-yet published paper, Moshe Kol, Amit Klein, and Yossi Gilad report being able to accurately identify a client by forcing it to emit only 40 times more connections than the number of entries in the table_perturb[] table, which is indexed by hashing the connection tuple. The current 2^8 setting allows them to perform that attack with only 10k connections, which is not hard to achieve in a few seconds. Eric, Amit and I have been working on this for a few weeks now imagining, testing and eliminating a number of approaches that Amit and his team were still able to break or that were found to be too risky or too expensive, and ended up with the simple improvements in this series that resists to the attack, doesn't degrade the performance, and preserves a reliable port selection algorithm to avoid connection failures, including the odd/even port selection preference that allows bind() to always find a port quickly even under strong connect() stress. The approach relies on several factors: - resalting the hash secret that's used to choose the table_perturb[] entry every 10 seconds to eliminate slow attacks and force the attacker to forget everything that was learned after this delay. This already eliminates most of the problem because if a client stays silent for more than 10 seconds there's no link between the previous and the next patterns, and 10s isn't yet frequent enough to cause too frequent repetition of a same port that may induce a connection failure ; - adding small random increments to the source port. Previously, a random 0 or 1 was added every 16 ports. Now a random 0 to 7 is added after each port. This means that with the default 32768-60999 range, a worst case rollover happens after 1764 connections, and an average of 3137. This doesn't stop statistical attacks but requires significantly more iterations of the same attack to confirm a guess. - increasing the table_perturb[] size from 2^8 to 2^16, which Amit says will require 2.6 million connections to be attacked with the changes above, making it pointless to get a fingerprint that will only last 10 seconds. Due to the size, the table was made dynamic. - a few minor improvements on the bits used from the hash, to eliminate some unfortunate correlations that may possibly have been exploited to design future attack models. These changes were tested under the most extreme conditions, up to 1.1 million connections per second to one and a few targets, showing no performance regression, and only 2 connection failures within 13 billion, which is less than 2^-32 and perfectly within usual values. The series is split into small reviewable changes and was already reviewed by Amit and Eric. ==================== Link: https://lore.kernel.org/r/20220502084614.24123-1-w@1wt.eu Signed-off-by: Jakub Kicinski commit e8161345ddbb66e449abde10d2fdce93f867eba9 Author: Willy Tarreau Date: Mon May 2 10:46:14 2022 +0200 tcp: drop the hash_32() part from the index calculation In commit 190cc82489f4 ("tcp: change source port randomizarion at connect() time"), the table_perturb[] array was introduced and an index was taken from the port_offset via hash_32(). But it turns out that hash_32() performs a multiplication while the input here comes from the output of SipHash in secure_seq, that is well distributed enough to avoid the need for yet another hash. Suggested-by: Amit Klein Reviewed-by: Eric Dumazet Signed-off-by: Willy Tarreau Signed-off-by: Jakub Kicinski net/ipv4/inet_hashtables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4c2c8f03a5ab7cb04ec64724d7d176d00bcc91e5 Author: Willy Tarreau Date: Mon May 2 10:46:13 2022 +0200 tcp: increase source port perturb table to 2^16 Moshe Kol, Amit Klein, and Yossi Gilad reported being able to accurately identify a client by forcing it to emit only 40 times more connections than there are entries in the table_perturb[] table. The previous two improvements consisting in resalting the secret every 10s and adding randomness to each port selection only slightly improved the situation, and the current value of 2^8 was too small as it's not very difficult to make a client emit 10k connections in less than 10 seconds. Thus we're increasing the perturb table from 2^8 to 2^16 so that the same precision now requires 2.6M connections, which is more difficult in this time frame and harder to hide as a background activity. The impact is that the table now uses 256 kB instead of 1 kB, which could mostly affect devices making frequent outgoing connections. However such components usually target a small set of destinations (load balancers, database clients, perf assessment tools), and in practice only a few entries will be visited, like before. A live test at 1 million connections per second showed no performance difference from the previous value. Reported-by: Moshe Kol Reported-by: Yossi Gilad Reported-by: Amit Klein Reviewed-by: Eric Dumazet Signed-off-by: Willy Tarreau Signed-off-by: Jakub Kicinski net/ipv4/inet_hashtables.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit e9261476184be1abd486c9434164b2acbe0ed6c2 Author: Willy Tarreau Date: Mon May 2 10:46:12 2022 +0200 tcp: dynamically allocate the perturb table used by source ports We'll need to further increase the size of this table and it's likely that at some point its size will not be suitable anymore for a static table. Let's allocate it on boot from inet_hashinfo2_init(), which is called from tcp_init(). Cc: Moshe Kol Cc: Yossi Gilad Cc: Amit Klein Reviewed-by: Eric Dumazet Signed-off-by: Willy Tarreau Signed-off-by: Jakub Kicinski net/ipv4/inet_hashtables.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit ca7af0402550f9a0b3316d5f1c30904e42ed257d Author: Willy Tarreau Date: Mon May 2 10:46:11 2022 +0200 tcp: add small random increments to the source port Here we're randomly adding between 0 and 7 random increments to the selected source port in order to add some noise in the source port selection that will make the next port less predictable. With the default port range of 32768-60999 this means a worst case reuse scenario of 14116/8=1764 connections between two consecutive uses of the same port, with an average of 14116/4.5=3137. This code was stressed at more than 800000 connections per second to a fixed target with all connections closed by the client using RSTs (worst condition) and only 2 connections failed among 13 billion, despite the hash being reseeded every 10 seconds, indicating a perfectly safe situation. Cc: Moshe Kol Cc: Yossi Gilad Cc: Amit Klein Reviewed-by: Eric Dumazet Signed-off-by: Willy Tarreau Signed-off-by: Jakub Kicinski net/ipv4/inet_hashtables.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 4dfa9b438ee34caca4e6a4e5e961641807367f6f Author: Eric Dumazet Date: Mon May 2 10:46:10 2022 +0200 tcp: resalt the secret every 10 seconds In order to limit the ability for an observer to recognize the source ports sequence used to contact a set of destinations, we should periodically shuffle the secret. 10 seconds looks effective enough without causing particular issues. Cc: Moshe Kol Cc: Yossi Gilad Cc: Amit Klein Cc: Jason A. Donenfeld Tested-by: Willy Tarreau Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski net/core/secure_seq.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit 9e9b70ae923baf2b5e8a0ea4fd0c8451801ac526 Author: Willy Tarreau Date: Mon May 2 10:46:09 2022 +0200 tcp: use different parts of the port_offset for index and offset Amit Klein suggests that we use different parts of port_offset for the table's index and the port offset so that there is no direct relation between them. Cc: Jason A. Donenfeld Cc: Moshe Kol Cc: Yossi Gilad Cc: Amit Klein Reviewed-by: Eric Dumazet Signed-off-by: Willy Tarreau Signed-off-by: Jakub Kicinski net/ipv4/inet_hashtables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b2d057560b8107c633b39aabe517ff9d93f285e3 Author: Willy Tarreau Date: Mon May 2 10:46:08 2022 +0200 secure_seq: use the 64 bits of the siphash for port offset calculation SipHash replaced MD5 in secure_ipv{4,6}_port_ephemeral() via commit 7cd23e5300c1 ("secure_seq: use SipHash in place of MD5"), but the output remained truncated to 32-bit only. In order to exploit more bits from the hash, let's make the functions return the full 64-bit of siphash_3u32(). We also make sure the port offset calculation in __inet_hash_connect() remains done on 32-bit to avoid the need for div_u64_rem() and an extra cost on 32-bit systems. Cc: Jason A. Donenfeld Cc: Moshe Kol Cc: Yossi Gilad Cc: Amit Klein Reviewed-by: Eric Dumazet Signed-off-by: Willy Tarreau Signed-off-by: Jakub Kicinski include/net/inet_hashtables.h | 2 +- include/net/secure_seq.h | 4 ++-- net/core/secure_seq.c | 4 ++-- net/ipv4/inet_hashtables.c | 10 ++++++---- net/ipv6/inet6_hashtables.c | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) commit 205557ba9904eec0a8e9ca28ec32e567f5027338 Merge: ad0724b90a2d 3fc1b11e5d72 Author: Jakub Kicinski Date: Wed May 4 17:50:00 2022 -0700 Merge branch 'wireguard-patches-for-5-18-rc6' Jason A. Donenfeld says: ==================== wireguard patches for 5.18-rc6 In working on some other problems, I wound up leaning on the WireGuard CI more than usual and uncovered a few small issues with reliability. These are fairly low key changes, since they don't impact kernel code itself. One change does stick out in particular, though, which is the "make routing loop test non-fatal" commit. I'm not thrilled about doing this, but currently [1] remains unsolved, and I'm still working on a real solution to that (hopefully for 5.19 or 5.20 if I can come up with a good idea...), so for now that test just prints a big red warning instead. [1] https://lore.kernel.org/netdev/YmszSXueTxYOC41G@zx2c4.com/ ==================== Link: https://lore.kernel.org/r/20220504202920.72908-1-Jason@zx2c4.com Signed-off-by: Jakub Kicinski commit 3fc1b11e5d7278437bdfff0e01f51e777eefb222 Author: Jason A. Donenfeld Date: Wed May 4 22:29:20 2022 +0200 wireguard: selftests: set panic_on_warn=1 from cmdline Rather than setting this once init is running, set panic_on_warn from the kernel command line, so that it catches splats from WireGuard initialization code and the various crypto selftests. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski tools/testing/selftests/wireguard/qemu/arch/aarch64.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/aarch64_be.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/arm.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/armeb.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/i686.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/m68k.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/mips.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/mips64.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/mips64el.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/mipsel.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/powerpc.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/powerpc64.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/powerpc64le.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/riscv32.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/riscv64.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/s390x.config | 2 +- tools/testing/selftests/wireguard/qemu/arch/x86_64.config | 2 +- tools/testing/selftests/wireguard/qemu/init.c | 6 ------ 18 files changed, 17 insertions(+), 23 deletions(-) commit a6b8ea9144340c0aaa66c817a3bbb6bca47f0321 Author: Jason A. Donenfeld Date: Wed May 4 22:29:19 2022 +0200 wireguard: selftests: bump package deps Use newer, more reliable package dependencies. These should hopefully reduce flakes. However, we keep the old iputils package, as it accumulated bugs after resulting in flakes on slow machines. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski tools/testing/selftests/wireguard/qemu/Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit d261ba6aa411e03c27da266b7df4bef771e8105e Author: Jason A. Donenfeld Date: Wed May 4 22:29:18 2022 +0200 wireguard: selftests: restore support for ccache When moving to non-system toolchains, we inadvertantly killed the ability to use ccache. So instead, build ccache support into the test harness directly. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski tools/testing/selftests/wireguard/qemu/.gitignore | 1 + tools/testing/selftests/wireguard/qemu/Makefile | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) commit d5d9b29bc963cc084c5c0f3a7c28e2632a22e0c4 Author: Jason A. Donenfeld Date: Wed May 4 22:29:17 2022 +0200 wireguard: selftests: use newer toolchains to fill out architectures Rather than relying on the system to have cross toolchains available, simply download musl.cc's ones and use that libc.so, and then we use it to fill in a few missing platforms, such as riscv64, riscv64, powerpc64, and s390x. Since riscv doesn't have a second serial port in its device description, we have to use virtio's vport. This is actually the same situation on ARM, but we were previously hacking QEMU up to work around this, which required a custom QEMU. Instead just do the vport trick on ARM too. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski tools/testing/selftests/wireguard/qemu/Makefile | 169 ++++++++++++++------- .../selftests/wireguard/qemu/arch/aarch64.config | 5 +- .../wireguard/qemu/arch/aarch64_be.config | 5 +- .../selftests/wireguard/qemu/arch/arm.config | 5 +- .../selftests/wireguard/qemu/arch/armeb.config | 5 +- .../selftests/wireguard/qemu/arch/powerpc64.config | 13 ++ .../selftests/wireguard/qemu/arch/riscv32.config | 12 ++ .../selftests/wireguard/qemu/arch/riscv64.config | 12 ++ .../selftests/wireguard/qemu/arch/s390x.config | 6 + 9 files changed, 169 insertions(+), 63 deletions(-) commit 39f02bf1e5ce9d72045de01e3d618ade1067158c Author: Jason A. Donenfeld Date: Wed May 4 22:29:16 2022 +0200 wireguard: selftests: limit parallelism to $(nproc) tests at once The parallel tests were added to catch queueing issues from multiple cores. But what happens in reality when testing tons of processes is that these separate threads wind up fighting with the scheduler, and we wind up with contention in places we don't care about that decrease the chances of hitting a bug. So just do a test with the number of CPU cores, rather than trying to scale up arbitrarily. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski tools/testing/selftests/wireguard/netns.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit ae2de669c14a18b5144cdacf49933ad400ed7e1c Author: Jason A. Donenfeld Date: Wed May 4 22:29:15 2022 +0200 wireguard: selftests: make routing loop test non-fatal I hate to do this, but I still do not have a good solution to actually fix this bug across architectures. So just disable it for now, so that the CI can still deliver actionable results. This commit adds a large red warning, so that at least the failure isn't lost forever, and hopefully this can be revisited down the line. Link: https://lore.kernel.org/netdev/CAHmME9pv1x6C4TNdL6648HydD8r+txpV4hTUXOBVkrapBXH4QQ@mail.gmail.com/ Link: https://lore.kernel.org/netdev/YmszSXueTxYOC41G@zx2c4.com/ Link: https://lore.kernel.org/wireguard/CAHmME9rNnBiNvBstb7MPwK-7AmAN0sOfnhdR=eeLrowWcKxaaQ@mail.gmail.com/ Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski tools/testing/selftests/wireguard/netns.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit 59f5ede3bc0f00eb856425f636dab0c10feb06d8 Author: Thomas Gleixner Date: Sun May 1 21:31:43 2022 +0200 x86/fpu: Prevent FPU state corruption The FPU usage related to task FPU management is either protected by disabling interrupts (switch_to, return to user) or via fpregs_lock() which is a wrapper around local_bh_disable(). When kernel code wants to use the FPU then it has to check whether it is possible by calling irq_fpu_usable(). But the condition in irq_fpu_usable() is wrong. It allows FPU to be used when: !in_interrupt() || interrupted_user_mode() || interrupted_kernel_fpu_idle() The latter is checking whether some other context already uses FPU in the kernel, but if that's not the case then it allows FPU to be used unconditionally even if the calling context interrupted a fpregs_lock() critical region. If that happens then the FPU state of the interrupted context becomes corrupted. Allow in kernel FPU usage only when no other context has in kernel FPU usage and either the calling context is not hard interrupt context or the hard interrupt did not interrupt a local bottomhalf disabled region. It's hard to find a proper Fixes tag as the condition was broken in one way or the other for a very long time and the eager/lazy FPU changes caused a lot of churn. Picked something remotely connected from the history. This survived undetected for quite some time as FPU usage in interrupt context is rare, but the recent changes to the random code unearthed it at least on a kernel which had FPU debugging enabled. There is probably a higher rate of silent corruption as not all issues can be detected by the FPU debugging code. This will be addressed in a subsequent change. Fixes: 5d2bd7009f30 ("x86, fpu: decouple non-lazy/eager fpu restore from xsave") Reported-by: Filipe Manana Signed-off-by: Thomas Gleixner Tested-by: Filipe Manana Reviewed-by: Borislav Petkov Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220501193102.588689270@linutronix.de arch/x86/kernel/fpu/core.c | 67 ++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 41 deletions(-) commit bfdc0edd11f9501b891a069b5bbd3b16731941e1 Author: Bob Pearson Date: Wed May 4 15:28:17 2022 -0500 RDMA/rxe: Change mcg_lock to a _bh lock rxe_mcast.c currently uses _irqsave spinlocks for rxe->mcg_lock while rxe_recv.c uses _bh spinlocks for the same lock. As there is no case where the mcg_lock can be taken from an IRQ, change these all to bh locks so we don't have confusing mismatched lock types on the same spinlock. Fixes: 6090a0c4c7c6 ("RDMA/rxe: Cleanup rxe_mcast.c") Link: https://lore.kernel.org/r/20220504202817.98247-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_mcast.c | 36 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 21 deletions(-) commit a926a903b7dc39a8a949150258c09290998dd812 Author: Bob Pearson Date: Wed May 4 15:28:17 2022 -0500 RDMA/rxe: Do not call dev_mc_add/del() under a spinlock These routines were not intended to be called under a spinlock and will throw debugging warnings: raw_local_irq_restore() called with IRQs enabled WARNING: CPU: 13 PID: 3107 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x2f/0x50 CPU: 13 PID: 3107 Comm: python3 Tainted: G E 5.18.0-rc1+ #7 Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 RIP: 0010:warn_bogus_irq_restore+0x2f/0x50 Call Trace: _raw_spin_unlock_irqrestore+0x75/0x80 rxe_attach_mcast+0x304/0x480 [rdma_rxe] ib_attach_mcast+0x88/0xa0 [ib_core] ib_uverbs_attach_mcast+0x186/0x1e0 [ib_uverbs] ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xcd/0x140 [ib_uverbs] ib_uverbs_cmd_verbs+0xdb0/0xea0 [ib_uverbs] ib_uverbs_ioctl+0xd2/0x160 [ib_uverbs] do_syscall_64+0x5c/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Move them out of the spinlock, it is OK if there is some races setting up the MC reception at the ethernet layer with rbtree lookups. Fixes: 6090a0c4c7c6 ("RDMA/rxe: Cleanup rxe_mcast.c") Link: https://lore.kernel.org/r/20220504202817.98247-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_mcast.c | 51 ++++++++++++++++------------------- 1 file changed, 23 insertions(+), 28 deletions(-) commit ef91271c65c12d36e4c2b61c61d4849fb6d11aa0 Author: Cheng Xu Date: Sun Apr 24 16:01:03 2022 +0800 RDMA/siw: Fix a condition race issue in MPA request processing The calling of siw_cm_upcall and detaching new_cep with its listen_cep should be atomistic semantics. Otherwise siw_reject may be called in a temporary state, e,g, siw_cm_upcall is called but the new_cep->listen_cep has not being cleared. This fixes a WARN: WARNING: CPU: 7 PID: 201 at drivers/infiniband/sw/siw/siw_cm.c:255 siw_cep_put+0x125/0x130 [siw] CPU: 2 PID: 201 Comm: kworker/u16:22 Kdump: loaded Tainted: G E 5.17.0-rc7 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Workqueue: iw_cm_wq cm_work_handler [iw_cm] RIP: 0010:siw_cep_put+0x125/0x130 [siw] Call Trace: siw_reject+0xac/0x180 [siw] iw_cm_reject+0x68/0xc0 [iw_cm] cm_work_handler+0x59d/0xe20 [iw_cm] process_one_work+0x1e2/0x3b0 worker_thread+0x50/0x3a0 ? rescuer_thread+0x390/0x390 kthread+0xe5/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 Fixes: 6c52fdc244b5 ("rdma/siw: connection management") Link: https://lore.kernel.org/r/d528d83466c44687f3872eadcb8c184528b2e2d4.1650526554.git.chengyou@linux.alibaba.com Reported-by: Luis Chamberlain Reviewed-by: Bernard Metzler Signed-off-by: Cheng Xu Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/siw/siw_cm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 5dc4630426511f641b7ac44fc550b8e21eafb237 Author: Hector Martin Date: Mon May 2 18:13:08 2022 +0900 dt-bindings: pci: apple,pcie: Drop max-link-speed from example We no longer use these since 111659c2a570 (and they never worked anyway); drop them from the example to avoid confusion. Fixes: 111659c2a570 ("arm64: dts: apple: t8103: Remove PCIe max-link-speed properties") Signed-off-by: Hector Martin Reviewed-by: Alyssa Rosenzweig Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220502091308.28233-1-marcan@marcan.st Documentation/devicetree/bindings/pci/apple,pcie.yaml | 3 --- 1 file changed, 3 deletions(-) commit caf83e494de965dbb5f8add655c526b9af6a96cb Author: Rob Herring Date: Tue May 3 11:27:38 2022 -0500 dt-bindings: Drop redundant 'maxItems/minItems' in if/then schemas Another round of removing redundant minItems/maxItems when 'items' list is specified. This time it is in if/then schemas as the meta-schema was failing to check this case. If a property has an 'items' list, then a 'minItems' or 'maxItems' with the same size as the list is redundant and can be dropped. Note that is DT schema specific behavior and not standard json-schema behavior. The tooling will fixup the final schema adding any unspecified minItems/maxItems. Signed-off-by: Rob Herring Acked-By: Vinod Koul Acked-by: Marc Kleine-Budde Acked-by: Mark Brown Acked-by: Ulf Hansson # For MMC Acked-by: Jonathan Cameron #for IIO Link: https://lore.kernel.org/r/20220503162738.3827041-1-robh@kernel.org .../devicetree/bindings/clock/imx8m-clock.yaml | 4 ---- .../bindings/display/bridge/renesas,lvds.yaml | 4 ---- .../devicetree/bindings/display/renesas,du.yaml | 23 ---------------------- .../devicetree/bindings/iio/adc/st,stm32-adc.yaml | 2 -- .../bindings/mmc/nvidia,tegra20-sdhci.yaml | 7 +------ .../devicetree/bindings/mtd/gpmi-nand.yaml | 2 -- .../devicetree/bindings/net/can/bosch,c_can.yaml | 3 --- .../devicetree/bindings/phy/brcm,sata-phy.yaml | 10 ++++------ .../bindings/rtc/allwinner,sun6i-a31-rtc.yaml | 10 ---------- .../devicetree/bindings/serial/samsung_uart.yaml | 4 ---- .../bindings/sound/allwinner,sun4i-a10-i2s.yaml | 1 - .../bindings/sound/ti,j721e-cpb-audio.yaml | 2 -- .../bindings/thermal/rcar-gen3-thermal.yaml | 1 - 13 files changed, 5 insertions(+), 68 deletions(-) commit b2b701b31e1c5827957c88e5c1f0c3dde1f55b2f Author: Rob Herring Date: Fri Apr 29 14:46:11 2022 -0500 dt-bindings: pinctrl: Allow values for drive-push-pull and drive-open-drain A few platforms, at91 and tegra, use drive-push-pull and drive-open-drain with a 0 or 1 value. There's not really a need for values as '1' should be equivalent to no value (it wasn't treated that way) and drive-push-pull disabled is equivalent to drive-open-drain. So dropping the value can't be done without breaking existing OSs. As we don't want new cases, mark the case with values as deprecated. Cc: Arnd Bergmann Cc: Thierry Reding Cc: Jonathan Hunter Cc: Nicolas Ferre Cc: Claudiu Beznea Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220429194610.2741437-1-robh@kernel.org Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit 770fb0942c338545f93a584342b64848cff31efe Author: Josh Poimboeuf Date: Wed May 4 11:07:45 2022 -0700 MAINTAINERS: Update Josh Poimboeuf's email address Change to my kernel.org email address. Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/1abc3de4b00dc6f915ac975a2ec29ed545d96dc4.1651687652.git.jpoimboe@redhat.com MAINTAINERS | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit a7391ad3572431a354c927cf8896e86e50d7d0bf Merge: 3118d7ab3f01 392bf51946c2 Author: Linus Torvalds Date: Wed May 4 11:04:52 2022 -0700 Merge tag 'iomm-fixes-v5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: "IOMMU core: - Fix for a regression which could cause NULL-ptr dereferences Arm SMMU: - Fix off-by-one in SMMUv3 SVA TLB invalidation - Disable large mappings to workaround nvidia erratum Intel VT-d: - Handle PCI stop marker messages in IOMMU driver to meet the requirement of I/O page fault handling framework. - Calculate a feasible mask for non-aligned page-selective IOTLB invalidation. Apple DART IOMMU: - Fix potential NULL-ptr dereference - Set module owner" * tag 'iomm-fixes-v5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu: Make sysfs robust for non-API groups iommu/dart: Add missing module owner to ops structure iommu/dart: check return value after calling platform_get_resource() iommu/vt-d: Drop stop marker messages iommu/vt-d: Calculate mask for non-aligned flushes iommu: arm-smmu: disable large page mappings for Nvidia arm-smmu iommu/arm-smmu-v3: Fix size calculation in arm_smmu_mm_invalidate_range() commit 3118d7ab3f01e309d38b4e719370bdd5361aec6d Merge: 107c948d1d3e 9cc3aac42566 Author: Linus Torvalds Date: Wed May 4 11:01:31 2022 -0700 Merge tag 'for-linus-5.17-2' of https://github.com/cminyard/linux-ipmi Pull IPMI fixes from Corey Minyard: "Fix some issues that were reported. This has been in for-next for a bit (longer than the times would indicate, I had to rebase to add some text to the headers) and these are fixes that need to go in" * tag 'for-linus-5.17-2' of https://github.com/cminyard/linux-ipmi: ipmi:ipmi_ipmb: Fix null-ptr-deref in ipmi_unregister_smi() ipmi: When handling send message responses, don't process the message commit 3dfe85fa87b2a26bdbd292b66653bba065cf9941 Author: Harry Wentland Date: Tue Apr 19 13:03:12 2022 -0400 drm/amd/display: Avoid reading audio pattern past AUDIO_CHANNELS_COUNT A faulty receiver might report an erroneous channel count. We should guard against reading beyond AUDIO_CHANNELS_COUNT as that would overflow the dpcd_pattern_period array. Signed-off-by: Harry Wentland Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 19965d8259fdabc6806da92adda49684f5bcbec5 Author: Marek Marczykowski-Górecki Date: Wed Apr 27 01:57:15 2022 +0200 drm/amdgpu: do not use passthrough mode in Xen dom0 While technically Xen dom0 is a virtual machine too, it does have access to most of the hardware so it doesn't need to be considered a "passthrough". Commit b818a5d37454 ("drm/amdgpu/gmc: use PCI BARs for APUs in passthrough") changed how FB is accessed based on passthrough mode. This breaks amdgpu in Xen dom0 with message like this: [drm:dc_dmub_srv_wait_idle [amdgpu]] *ERROR* Error waiting for DMUB idle: status=3 While the reason for this failure is unclear, the passthrough mode is not really necessary in Xen dom0 anyway. So, to unbreak booting affected kernels, disable passthrough mode in this case. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1985 Fixes: b818a5d37454 ("drm/amdgpu/gmc: use PCI BARs for APUs in passthrough") Signed-off-by: Marek Marczykowski-Górecki Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 392bf51946c2463436a1ba237c1ec5865b234825 Author: Robin Murphy Date: Wed May 4 13:39:58 2022 +0100 iommu: Make sysfs robust for non-API groups Groups created by VFIO backends outside the core IOMMU API should never be passed directly into the API itself, however they still expose their standard sysfs attributes, so we can still stumble across them that way. Take care to consider those cases before jumping into our normal assumptions of a fully-initialised core API group. Fixes: 3f6634d997db ("iommu: Use right way to retrieve iommu_ops") Reported-by: Jan Stancek Tested-by: Jan Stancek Reviewed-by: Jason Gunthorpe Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/86ada41986988511a8424e84746dfe9ba7f87573.1651667683.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel drivers/iommu/iommu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 6d65028eb67dbb7627651adfc460d64196d38bd8 Author: Michael Ellerman Date: Mon May 2 22:50:10 2022 +1000 powerpc/vdso: Fix incorrect CFI in gettimeofday.S As reported by Alan, the CFI (Call Frame Information) in the VDSO time routines is incorrect since commit ce7d8056e38b ("powerpc/vdso: Prepare for switching VDSO to generic C implementation."). DWARF has a concept called the CFA (Canonical Frame Address), which on powerpc is calculated as an offset from the stack pointer (r1). That means when the stack pointer is changed there must be a corresponding CFI directive to update the calculation of the CFA. The current code is missing those directives for the changes to r1, which prevents gdb from being able to generate a backtrace from inside VDSO functions, eg: Breakpoint 1, 0x00007ffff7f804dc in __kernel_clock_gettime () (gdb) bt #0 0x00007ffff7f804dc in __kernel_clock_gettime () #1 0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6 #2 0x00007fffffffd960 in ?? () #3 0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6 Backtrace stopped: frame did not save the PC Alan helpfully describes some rules for correctly maintaining the CFI information: 1) Every adjustment to the current frame address reg (ie. r1) must be described, and exactly at the instruction where r1 changes. Why? Because stack unwinding might want to access previous frames. 2) If a function changes LR or any non-volatile register, the save location for those regs must be given. The CFI can be at any instruction after the saves up to the point that the reg is changed. (Exception: LR save should be described before a bl. not after) 3) If asychronous unwind info is needed then restores of LR and non-volatile regs must also be described. The CFI can be at any instruction after the reg is restored up to the point where the save location is (potentially) trashed. Fix the inability to backtrace by adding CFI directives describing the changes to r1, ie. satisfying rule 1. Also change the information for LR to point to the copy saved on the stack, not the value in r0 that will be overwritten by the function call. Finally, add CFI directives describing the save/restore of r2. With the fix gdb can correctly back trace and navigate up and down the stack: Breakpoint 1, 0x00007ffff7f804dc in __kernel_clock_gettime () (gdb) bt #0 0x00007ffff7f804dc in __kernel_clock_gettime () #1 0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6 #2 0x0000000100015b60 in gettime () #3 0x000000010000c8bc in print_long_format () #4 0x000000010000d180 in print_current_files () #5 0x00000001000054ac in main () (gdb) up #1 0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6 (gdb) #2 0x0000000100015b60 in gettime () (gdb) #3 0x000000010000c8bc in print_long_format () (gdb) #4 0x000000010000d180 in print_current_files () (gdb) #5 0x00000001000054ac in main () (gdb) Initial frame selected; you cannot go up. (gdb) down #4 0x000000010000d180 in print_current_files () (gdb) #3 0x000000010000c8bc in print_long_format () (gdb) #2 0x0000000100015b60 in gettime () (gdb) #1 0x00007ffff7d8872c in clock_gettime@@GLIBC_2.17 () from /lib64/libc.so.6 (gdb) #0 0x00007ffff7f804dc in __kernel_clock_gettime () (gdb) Fixes: ce7d8056e38b ("powerpc/vdso: Prepare for switching VDSO to generic C implementation.") Cc: stable@vger.kernel.org # v5.11+ Reported-by: Alan Modra Signed-off-by: Michael Ellerman Reviewed-by: Segher Boessenkool Link: https://lore.kernel.org/r/20220502125010.1319370-1-mpe@ellerman.id.au arch/powerpc/kernel/vdso/gettimeofday.S | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 57831bfb5e78777dc399e351ed68ef77c3aee385 Author: Haren Myneni Date: Sat Mar 19 02:28:09 2022 -0700 powerpc/pseries/vas: Use QoS credits from the userspace The user can change the QoS credits dynamically with the management console interface which notifies OS with sysfs. After returning from the OS interface successfully, the management console updates the hypervisor. Since the VAS capabilities in the hypervisor is not updated when the OS gets the update, the kernel is using the old total credits value from the hypervisor. Fix this issue by using the new QoS credits from the userspace instead of depending on VAS capabilities from the hypervisor. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/76d156f8af1e03cc09369d68e0bfad0c40031bcc.camel@linux.ibm.com arch/powerpc/platforms/pseries/vas-sysfs.c | 19 ++++++++++++++----- arch/powerpc/platforms/pseries/vas.c | 23 ++++++++++++----------- arch/powerpc/platforms/pseries/vas.h | 2 +- 3 files changed, 27 insertions(+), 17 deletions(-) commit 3e5a8e8494a8122fe4eb3f167662f406cab753b9 Author: Shaik Sajida Bhanu Date: Sun Apr 24 21:32:33 2022 +0530 mmc: sdhci-msm: Reset GCC_SDCC_BCR register for SDHC Reset GCC_SDCC_BCR register before every fresh initilazation. This will reset whole SDHC-msm controller, clears the previous power control states and avoids, software reset timeout issues as below. [ 5.458061][ T262] mmc1: Reset 0x1 never completed. [ 5.462454][ T262] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 5.469065][ T262] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00007202 [ 5.475688][ T262] mmc1: sdhci: Blk size: 0x00000000 | Blk cnt: 0x00000000 [ 5.482315][ T262] mmc1: sdhci: Argument: 0x00000000 | Trn mode: 0x00000000 [ 5.488927][ T262] mmc1: sdhci: Present: 0x01f800f0 | Host ctl: 0x00000000 [ 5.495539][ T262] mmc1: sdhci: Power: 0x00000000 | Blk gap: 0x00000000 [ 5.502162][ T262] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000003 [ 5.508768][ T262] mmc1: sdhci: Timeout: 0x00000000 | Int stat: 0x00000000 [ 5.515381][ T262] mmc1: sdhci: Int enab: 0x00000000 | Sig enab: 0x00000000 [ 5.521996][ T262] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 5.528607][ T262] mmc1: sdhci: Caps: 0x362dc8b2 | Caps_1: 0x0000808f [ 5.535227][ T262] mmc1: sdhci: Cmd: 0x00000000 | Max curr: 0x00000000 [ 5.541841][ T262] mmc1: sdhci: Resp[0]: 0x00000000 | Resp[1]: 0x00000000 [ 5.548454][ T262] mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 [ 5.555079][ T262] mmc1: sdhci: Host ctl2: 0x00000000 [ 5.559651][ T262] mmc1: sdhci_msm: ----------- VENDOR REGISTER DUMP----------- [ 5.566621][ T262] mmc1: sdhci_msm: DLL sts: 0x00000000 | DLL cfg: 0x6000642c | DLL cfg2: 0x0020a000 [ 5.575465][ T262] mmc1: sdhci_msm: DLL cfg3: 0x00000000 | DLL usr ctl: 0x00010800 | DDR cfg: 0x80040873 [ 5.584658][ T262] mmc1: sdhci_msm: Vndr func: 0x00018a9c | Vndr func2 : 0xf88218a8 Vndr func3: 0x02626040 Fixes: 0eb0d9f4de34 ("mmc: sdhci-msm: Initial support for Qualcomm chipsets") Signed-off-by: Shaik Sajida Bhanu Acked-by: Adrian Hunter Reviewed-by: Philipp Zabel Tested-by: Konrad Dybcio Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1650816153-23797-1-git-send-email-quic_c_sbhanu@quicinc.com Signed-off-by: Ulf Hansson drivers/mmc/host/sdhci-msm.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) commit ad0724b90a2d637c4279fba0a56d4c0b8efc7401 Merge: 0a806ecc4023 a042d7f5bb68 Author: David S. Miller Date: Wed May 4 10:51:05 2022 +0100 Merge tag 'mlx5-fixes-2022-05-03' of git://git.kernel.org/pub/scm/linux/kernel/g it/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-05-03 This series provides bug fixes to mlx5 driver. Please pull and let me know if there is any problem. ==================== Signed-off-by: David S. Miller commit e9f3fb523dbf476dc86beea23f5b5ca8f9687c93 Author: Samuel Holland Date: Sun Apr 24 18:17:50 2022 -0500 mmc: sunxi-mmc: Fix DMA descriptors allocated above 32 bits Newer variants of the MMC controller support a 34-bit physical address space by using word addresses instead of byte addresses. However, the code truncates the DMA descriptor address to 32 bits before applying the shift. This breaks DMA for descriptors allocated above the 32-bit limit. Fixes: 3536b82e5853 ("mmc: sunxi: add support for A100 mmc controller") Signed-off-by: Samuel Holland Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220424231751.32053-1-samuel@sholland.org Signed-off-by: Ulf Hansson drivers/mmc/host/sunxi-mmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 86af062f40a73bf63321694e6bf637144f0383fe Author: Manikanta Pubbisetty Date: Thu Apr 28 10:57:44 2022 +0530 mac80211: Reset MBSSID parameters upon connection Currently MBSSID parameters in struct ieee80211_bss_conf are not reset upon connection. This could be problematic with some drivers in a scenario where the device first connects to a non-transmit BSS and then connects to a transmit BSS of a Multi BSS AP. The MBSSID parameters which are set after connecting to a non-transmit BSS will not be reset and the same parameters will be passed on to the driver during the subsequent connection to a transmit BSS of a Multi BSS AP. For example, firmware running on the ath11k device uses the Multi BSS data for tracking the beacon of a non-transmit BSS and reports the driver when there is a beacon miss. If we do not reset the MBSSID parameters during the subsequent connection to a transmit BSS, then the driver would have wrong MBSSID data and FW would be looking for an incorrect BSSID in the MBSSID beacon of a Multi BSS AP and reports beacon loss leading to an unstable connection. Reset the MBSSID parameters upon every connection to solve this problem. Fixes: 78ac51f81532 ("mac80211: support multi-bssid") Signed-off-by: Manikanta Pubbisetty Link: https://lore.kernel.org/r/20220428052744.27040-1-quic_mpubbise@quicinc.com Signed-off-by: Johannes Berg net/mac80211/mlme.c | 6 ++++++ 1 file changed, 6 insertions(+) commit e847ffe2d146cfd52980ca688d84358e024a6e70 Author: Kieran Frewen Date: Wed Apr 20 04:13:20 2022 +0000 cfg80211: retrieve S1G operating channel number When retrieving the S1G channel number from IEs, we should retrieve the operating channel instead of the primary channel. The S1G operation element specifies the main channel of operation as the oper channel, unlike for HT and HE which specify their main channel of operation as the primary channel. Signed-off-by: Kieran Frewen Signed-off-by: Bassem Dawood Link: https://lore.kernel.org/r/20220420041321.3788789-1-kieran.frewen@morsemicro.com Signed-off-by: Johannes Berg net/wireless/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5d087aa759eb82b8208411913f6c2158bd85abc0 Author: Kieran Frewen Date: Wed Apr 20 04:13:21 2022 +0000 nl80211: validate S1G channel width Validate the S1G channel width input by user to ensure it matches that of the requested channel Signed-off-by: Kieran Frewen Signed-off-by: Bassem Dawood Link: https://lore.kernel.org/r/20220420041321.3788789-2-kieran.frewen@morsemicro.com Signed-off-by: Johannes Berg net/wireless/nl80211.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 5e469ed9764d4722c59562da13120bd2dc6834c5 Author: Felix Fietkau Date: Wed Apr 20 12:50:38 2022 +0200 mac80211: fix rx reordering with non explicit / psmp ack policy When the QoS ack policy was set to non explicit / psmp ack, frames are treated as not being part of a BA session, which causes extra latency on reordering. Fix this by only bypassing reordering for packets with no-ack policy Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20220420105038.36443-1-nbd@nbd.name Signed-off-by: Johannes Berg net/mac80211/rx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 2ac2fab52917ae82cbca97cf6e5d2993530257ed Author: Hector Martin Date: Mon May 2 18:22:38 2022 +0900 iommu/dart: Add missing module owner to ops structure This is required to make loading this as a module work. Signed-off-by: Hector Martin Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver") Reviewed-by: Sven Peter Link: https://lore.kernel.org/r/20220502092238.30486-1-marcan@marcan.st Signed-off-by: Joerg Roedel drivers/iommu/apple-dart.c | 1 + 1 file changed, 1 insertion(+) commit 841e512ffb64898db6322c0619f6bbc41266d86f Author: Fabien Parent Date: Tue Apr 26 16:15:36 2022 +0200 drm/bridge: ite-it6505: add missing Kconfig option select The IT6505 is using functions provided by the DRM_DP_HELPER driver. In order to avoid having the bridge enabled but the helper disabled, let's add a select in order to be sure that the DP helper functions are always available. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Signed-off-by: Fabien Parent Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20220426141536.274727-1-fparent@baylibre.com drivers/gpu/drm/bridge/Kconfig | 1 + 1 file changed, 1 insertion(+) commit a042d7f5bb68c47f6e0e546ca367d14e1e4b25ba Author: Mark Bloch Date: Sun Apr 10 11:58:05 2022 +0000 net/mlx5: Fix matching on inner TTC The cited commits didn't use proper matching on inner TTC as a result distribution of encapsulated packets wasn't symmetric between the physical ports. Fixes: 4c71ce50d2fe ("net/mlx5: Support partial TTC rules") Fixes: 8e25a2bc6687 ("net/mlx5: Lag, add support to create TTC tables for LAG port selection") Signed-off-by: Mark Bloch Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/lag/port_sel.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lib/fs_ttc.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) commit fc3d3db07b35885f238e1fa06b9f04a8fa7a62d0 Author: Moshe Shemesh Date: Mon Apr 11 20:38:44 2022 +0300 net/mlx5: Avoid double clear or set of sync reset requested Double clear of reset requested state can lead to NULL pointer as it will try to delete the timer twice. This can happen for example on a race between abort from FW and pci error or reset. Avoid such case using test_and_clear_bit() to verify only one time reset requested state clear flow. Similarly use test_and_set_bit() to verify only one time reset requested state set flow. Fixes: 7dd6df329d4c ("net/mlx5: Handle sync reset abort event") Signed-off-by: Moshe Shemesh Reviewed-by: Maher Sanalla Reviewed-by: Shay Drory Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 28 +++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) commit cb7786a76ea39f394f0a059787fe24fa8e340fb6 Author: Moshe Shemesh Date: Mon Apr 11 21:31:06 2022 +0300 net/mlx5: Fix deadlock in sync reset flow The sync reset flow can lead to the following deadlock when poll_sync_reset() is called by timer softirq and waiting on del_timer_sync() for the same timer. Fix that by moving the part of the flow that waits for the timer to reset_reload_work. It fixes the following kernel Trace: RIP: 0010:del_timer_sync+0x32/0x40 ... Call Trace: mlx5_sync_reset_clear_reset_requested+0x26/0x50 [mlx5_core] poll_sync_reset.cold+0x36/0x52 [mlx5_core] call_timer_fn+0x32/0x130 __run_timers.part.0+0x180/0x280 ? tick_sched_handle+0x33/0x60 ? tick_sched_timer+0x3d/0x80 ? ktime_get+0x3e/0xa0 run_timer_softirq+0x2a/0x50 __do_softirq+0xe1/0x2d6 ? hrtimer_interrupt+0x136/0x220 irq_exit+0xae/0xb0 smp_apic_timer_interrupt+0x7b/0x140 apic_timer_interrupt+0xf/0x20 Fixes: 3c5193a87b0f ("net/mlx5: Use del_timer_sync in fw reset flow of halting poll") Signed-off-by: Moshe Shemesh Reviewed-by: Maher Sanalla Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) commit b781bff882d16175277ca129c382886cb4c74a2c Author: Moshe Tal Date: Wed Feb 9 19:23:56 2022 +0200 net/mlx5e: Fix trust state reset in reload Setting dscp2prio during the driver reload can cause dcb ieee app list to be not empty after the reload finish and as a result to a conflict between the priority trust state reported by the app and the state in the device register. Reset the dcb ieee app list on initialization in case this is conflicting with the register status. Fixes: 2a5e7a1344f4 ("net/mlx5e: Add dcbnl dscp to priority support") Signed-off-by: Moshe Tal Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 0e322efd64d2ad11a773f7a314512086ebbe000c Author: Ariel Levkovich Date: Mon Mar 28 18:29:13 2022 +0300 net/mlx5e: Avoid checking offload capability in post_parse action During TC action parsing, the can_offload callback is called before calling the action's main parsing callback. Later on, the can_offload callback is called again before handling the action's post_parse callback if exists. Since the main parsing callback might have changed and set parsing params for the rule, following can_offload checks might fail because some parsing params were already set. Specifically, the ct action main parsing sets the ct param in the parsing status structure and when the second can_offload for ct action is called, before handling the ct post parsing, it will return an error since it checks this ct param to indicate multiple ct actions which are not supported. Therefore, the can_offload call is removed from the post parsing handling to prevent such cases. This is allowed since the first can_offload call will ensure that the action can be offloaded and the fact the code reached the post parsing handling already means that the action can be offloaded. Fixes: 8300f225268b ("net/mlx5e: Create new flow attr for multi table actions") Signed-off-by: Ariel Levkovich Reviewed-by: Paul Blakey Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit b069e14fff46c8da9fcc79957f8acaa3e2dfdb6b Author: Paul Blakey Date: Tue Mar 29 17:42:46 2022 +0300 net/mlx5e: CT: Fix queued up restore put() executing after relevant ft release __mlx5_tc_ct_entry_put() queues release of tuple related to some ct FT, if that is the last reference to that tuple, the actual deletion of the tuple can happen after the FT is already destroyed and freed. Flush the used workqueue before destroying the ct FT. Fixes: a2173131526d ("net/mlx5e: CT: manage the lifetime of the ct entry object") Reviewed-by: Oz Shlomo Signed-off-by: Paul Blakey Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 4 ++++ 1 file changed, 4 insertions(+) commit e3fdc71bcb6ffe1d4870a89252ba296a9558e294 Author: Ariel Levkovich Date: Mon Apr 25 17:12:12 2022 +0300 net/mlx5e: TC, fix decap fallback to uplink when int port not supported When resolving the decap route device for a tunnel decap rule, the result may be an OVS internal port device. Prior to adding the support for internal port offload, such case would result in using the uplink as the default decap route device which allowed devices that can't support internal port offload to offload this decap rule. This behavior got broken by adding the internal port offload which will fail in case the device can't support internal port offload. To restore the old behavior, use the uplink device as the decap route as before when internal port offload is not supported. Fixes: b16eb3c81fe2 ("net/mlx5: Support internal port as decap route device") Signed-off-by: Ariel Levkovich Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 087032ee7021a22e4c7557c0ed16bfd792c3f6fe Author: Ariel Levkovich Date: Wed Feb 23 21:29:17 2022 +0200 net/mlx5e: TC, Fix ct_clear overwriting ct action metadata ct_clear action is translated to clearing reg_c metadata which holds ct state and zone information using mod header actions. These actions are allocated during the actions parsing, as part of the flow attributes main mod header action list. If ct action exists in the rule, the flow's main mod header is used only in the post action table rule, after the ct tables which set the ct info in the reg_c as part of the ct actions. Therefore, if the original rule has a ct_clear action followed by a ct action, the ct action reg_c setting will be done first and will be followed by the ct_clear resetting reg_c and overwriting the ct info. Fix this by moving the ct_clear mod header actions allocation from the ct action parsing stage to the ct action post parsing stage where it is already known if ct_clear is followed by a ct action. In such case, we skip the mod header actions allocation for the ct clear since the ct action will write to reg_c anyway after clearing it. Fixes: 806401c20a0f ("net/mlx5e: CT, Fix multiple allocations and memleak of mod acts") Signed-off-by: Ariel Levkovich Reviewed-by: Paul Blakey Reviewed-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed .../net/ethernet/mellanox/mlx5/core/en/tc/act/ct.c | 34 ++++++++++++++++++++-- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 20 ++++--------- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h | 11 +++++++ 3 files changed, 49 insertions(+), 16 deletions(-) commit 4a2a664ed87962c4ddb806a84b5c9634820bcf55 Author: Vlad Buslov Date: Mon Apr 18 17:40:37 2022 +0300 net/mlx5e: Lag, Don't skip fib events on current dst Referenced change added check to skip updating fib when new fib instance has same or lower priority. However, new fib instance can be an update on same dst address as existing one even though the structure is another instance that has different address. Ignoring events on such instances causes multipath LAG state to not be correctly updated. Track 'dst' and 'dst_len' fields of fib event fib_entry_notifier_info structure and don't skip events that have the same value of that fields. Fixes: ad11c4f1d8fd ("net/mlx5e: Lag, Only handle events from highest priority multipath entry") Signed-off-by: Vlad Buslov Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c | 20 ++++++++++++-------- drivers/net/ethernet/mellanox/mlx5/core/lag/mp.h | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) commit a6589155ec9847918e00e7279b8aa6d4c272bea7 Author: Vlad Buslov Date: Mon Apr 18 17:32:54 2022 +0300 net/mlx5e: Lag, Fix fib_info pointer assignment Referenced change incorrectly sets single path fib_info even when LAG is not active. Fix it by moving call to mlx5_lag_fib_set() into conditional that verifies LAG state. Fixes: ad11c4f1d8fd ("net/mlx5e: Lag, Only handle events from highest priority multipath entry") Signed-off-by: Vlad Buslov Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 27b0420fd959e38e3500e60b637d39dfab065645 Author: Vlad Buslov Date: Mon Apr 18 17:32:19 2022 +0300 net/mlx5e: Lag, Fix use-after-free in fib event handler Recent commit that modified fib route event handler to handle events according to their priority introduced use-after-free[0] in mp->mfi pointer usage. The pointer now is not just cached in order to be compared to following fib_info instances, but is also dereferenced to obtain fib_priority. However, since mlx5 lag code doesn't hold the reference to fin_info during whole mp->mfi lifetime, it could be used after fib_info instance has already been freed be kernel infrastructure code. Don't ever dereference mp->mfi pointer. Refactor it to be 'const void*' type and cache fib_info priority in dedicated integer. Group fib_info-related data into dedicated 'fib' structure that will be further extended by following patches in the series. [0]: [ 203.588029] ================================================================== [ 203.590161] BUG: KASAN: use-after-free in mlx5_lag_fib_update+0xabd/0xd60 [mlx5_core] [ 203.592386] Read of size 4 at addr ffff888144df2050 by task kworker/u20:4/138 [ 203.594766] CPU: 3 PID: 138 Comm: kworker/u20:4 Tainted: G B 5.17.0-rc7+ #6 [ 203.596751] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 203.598813] Workqueue: mlx5_lag_mp mlx5_lag_fib_update [mlx5_core] [ 203.600053] Call Trace: [ 203.600608] [ 203.601110] dump_stack_lvl+0x48/0x5e [ 203.601860] print_address_description.constprop.0+0x1f/0x160 [ 203.602950] ? mlx5_lag_fib_update+0xabd/0xd60 [mlx5_core] [ 203.604073] ? mlx5_lag_fib_update+0xabd/0xd60 [mlx5_core] [ 203.605177] kasan_report.cold+0x83/0xdf [ 203.605969] ? mlx5_lag_fib_update+0xabd/0xd60 [mlx5_core] [ 203.607102] mlx5_lag_fib_update+0xabd/0xd60 [mlx5_core] [ 203.608199] ? mlx5_lag_init_fib_work+0x1c0/0x1c0 [mlx5_core] [ 203.609382] ? read_word_at_a_time+0xe/0x20 [ 203.610463] ? strscpy+0xa0/0x2a0 [ 203.611463] process_one_work+0x722/0x1270 [ 203.612344] worker_thread+0x540/0x11e0 [ 203.613136] ? rescuer_thread+0xd50/0xd50 [ 203.613949] kthread+0x26e/0x300 [ 203.614627] ? kthread_complete_and_exit+0x20/0x20 [ 203.615542] ret_from_fork+0x1f/0x30 [ 203.616273] [ 203.617174] Allocated by task 3746: [ 203.617874] kasan_save_stack+0x1e/0x40 [ 203.618644] __kasan_kmalloc+0x81/0xa0 [ 203.619394] fib_create_info+0xb41/0x3c50 [ 203.620213] fib_table_insert+0x190/0x1ff0 [ 203.621020] fib_magic.isra.0+0x246/0x2e0 [ 203.621803] fib_add_ifaddr+0x19f/0x670 [ 203.622563] fib_inetaddr_event+0x13f/0x270 [ 203.623377] blocking_notifier_call_chain+0xd4/0x130 [ 203.624355] __inet_insert_ifa+0x641/0xb20 [ 203.625185] inet_rtm_newaddr+0xc3d/0x16a0 [ 203.626009] rtnetlink_rcv_msg+0x309/0x880 [ 203.626826] netlink_rcv_skb+0x11d/0x340 [ 203.627626] netlink_unicast+0x4cc/0x790 [ 203.628430] netlink_sendmsg+0x762/0xc00 [ 203.629230] sock_sendmsg+0xb2/0xe0 [ 203.629955] ____sys_sendmsg+0x58a/0x770 [ 203.630756] ___sys_sendmsg+0xd8/0x160 [ 203.631523] __sys_sendmsg+0xb7/0x140 [ 203.632294] do_syscall_64+0x35/0x80 [ 203.633045] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 203.634427] Freed by task 0: [ 203.635063] kasan_save_stack+0x1e/0x40 [ 203.635844] kasan_set_track+0x21/0x30 [ 203.636618] kasan_set_free_info+0x20/0x30 [ 203.637450] __kasan_slab_free+0xfc/0x140 [ 203.638271] kfree+0x94/0x3b0 [ 203.638903] rcu_core+0x5e4/0x1990 [ 203.639640] __do_softirq+0x1ba/0x5d3 [ 203.640828] Last potentially related work creation: [ 203.641785] kasan_save_stack+0x1e/0x40 [ 203.642571] __kasan_record_aux_stack+0x9f/0xb0 [ 203.643478] call_rcu+0x88/0x9c0 [ 203.644178] fib_release_info+0x539/0x750 [ 203.644997] fib_table_delete+0x659/0xb80 [ 203.645809] fib_magic.isra.0+0x1a3/0x2e0 [ 203.646617] fib_del_ifaddr+0x93f/0x1300 [ 203.647415] fib_inetaddr_event+0x9f/0x270 [ 203.648251] blocking_notifier_call_chain+0xd4/0x130 [ 203.649225] __inet_del_ifa+0x474/0xc10 [ 203.650016] devinet_ioctl+0x781/0x17f0 [ 203.650788] inet_ioctl+0x1ad/0x290 [ 203.651533] sock_do_ioctl+0xce/0x1c0 [ 203.652315] sock_ioctl+0x27b/0x4f0 [ 203.653058] __x64_sys_ioctl+0x124/0x190 [ 203.653850] do_syscall_64+0x35/0x80 [ 203.654608] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 203.666952] The buggy address belongs to the object at ffff888144df2000 which belongs to the cache kmalloc-256 of size 256 [ 203.669250] The buggy address is located 80 bytes inside of 256-byte region [ffff888144df2000, ffff888144df2100) [ 203.671332] The buggy address belongs to the page: [ 203.672273] page:00000000bf6c9314 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x144df0 [ 203.674009] head:00000000bf6c9314 order:2 compound_mapcount:0 compound_pincount:0 [ 203.675422] flags: 0x2ffff800010200(slab|head|node=0|zone=2|lastcpupid=0x1ffff) [ 203.676819] raw: 002ffff800010200 0000000000000000 dead000000000122 ffff888100042b40 [ 203.678384] raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000 [ 203.679928] page dumped because: kasan: bad access detected [ 203.681455] Memory state around the buggy address: [ 203.682421] ffff888144df1f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 203.683863] ffff888144df1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 203.685310] >ffff888144df2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 203.686701] ^ [ 203.687820] ffff888144df2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [ 203.689226] ffff888144df2100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 203.690620] ================================================================== Fixes: ad11c4f1d8fd ("net/mlx5e: Lag, Only handle events from highest priority multipath entry") Signed-off-by: Vlad Buslov Reviewed-by: Maor Dickman Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c | 26 +++++++++++++++--------- drivers/net/ethernet/mellanox/mlx5/core/lag/mp.h | 5 ++++- 2 files changed, 20 insertions(+), 11 deletions(-) commit c4d963a588a6e7c4ef31160e80697ae8e5a47746 Author: Mark Zhang Date: Wed Apr 6 10:30:21 2022 +0300 net/mlx5e: Fix the calling of update_buffer_lossy() API The arguments of update_buffer_lossy() is in a wrong order. Fix it. Fixes: 88b3d5c90e96 ("net/mlx5e: Fix port buffers cell size value") Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/port_buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ada09af92e621ab500dd80a16d1d0299a18a1180 Author: Vlad Buslov Date: Mon Mar 28 15:54:52 2022 +0300 net/mlx5e: Don't match double-vlan packets if cvlan is not set Currently, match VLAN rule also matches packets that have multiple VLAN headers. This behavior is similar to buggy flower classifier behavior that has recently been fixed. Fix the issue by matching on outer_second_cvlan_tag with value 0 which will cause the HW to verify the packet doesn't contain second vlan header. Fixes: 699e96ddf47f ("net/mlx5e: Support offloading tc double vlan headers match") Signed-off-by: Vlad Buslov Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit 7ba2d9d8de96696c1451fee1b01da11f45bdc2b9 Author: Aya Levin Date: Thu Mar 3 19:02:03 2022 +0200 net/mlx5: Fix slab-out-of-bounds while reading resource dump menu Resource dump menu may span over more than a single page, support it. Otherwise, menu read may result in a memory access violation: reading outside of the allocated page. Note that page format of the first menu page contains menu headers while the proceeding menu pages contain only records. The KASAN logs are as follows: BUG: KASAN: slab-out-of-bounds in strcmp+0x9b/0xb0 Read of size 1 at addr ffff88812b2e1fd0 by task systemd-udevd/496 CPU: 5 PID: 496 Comm: systemd-udevd Tainted: G B 5.16.0_for_upstream_debug_2022_01_10_23_12 #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_address_description.constprop.0+0x1f/0x140 ? strcmp+0x9b/0xb0 ? strcmp+0x9b/0xb0 kasan_report.cold+0x83/0xdf ? strcmp+0x9b/0xb0 strcmp+0x9b/0xb0 mlx5_rsc_dump_init+0x4ab/0x780 [mlx5_core] ? mlx5_rsc_dump_destroy+0x80/0x80 [mlx5_core] ? lockdep_hardirqs_on_prepare+0x286/0x400 ? raw_spin_unlock_irqrestore+0x47/0x50 ? aomic_notifier_chain_register+0x32/0x40 mlx5_load+0x104/0x2e0 [mlx5_core] mlx5_init_one+0x41b/0x610 [mlx5_core] .... The buggy address belongs to the object at ffff88812b2e0000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 4048 bytes to the right of 4096-byte region [ffff88812b2e0000, ffff88812b2e1000) The buggy address belongs to the page: page:000000009d69807a refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88812b2e6000 pfn:0x12b2e0 head:000000009d69807a order:3 compound_mapcount:0 compound_pincount:0 flags: 0x8000000000010200(slab|head|zone=2) raw: 8000000000010200 0000000000000000 dead000000000001 ffff888100043040 raw: ffff88812b2e6000 0000000080040000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88812b2e1e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88812b2e1f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88812b2e1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88812b2e2000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88812b2e2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Fixes: 12206b17235a ("net/mlx5: Add support for resource dump") Signed-off-by: Aya Levin Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed .../ethernet/mellanox/mlx5/core/diag/rsc_dump.c | 31 +++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) commit cb0d54cbf94866b48a73e10a73a55655f808cc7c Author: Ariel Levkovich Date: Tue Mar 15 18:20:48 2022 +0200 net/mlx5e: Fix wrong source vport matching on tunnel rule When OVS internal port is the vtep device, the first decap rule is matching on the internal port's vport metadata value and then changes the metadata to be the uplink's value. Therefore, following rules on the tunnel, in chain > 0, should avoid matching on internal port metadata and use the uplink vport metadata instead. Select the uplink's metadata value for the source vport match in case the rule is in chain greater than zero, even if the tunnel route device is internal port. Fixes: 166f431ec6be ("net/mlx5e: Add indirect tc offload of ovs internal port") Signed-off-by: Ariel Levkovich Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0a806ecc4023fcf393fcc1093f4a532813ca4124 Merge: 5ef9b803a4af 195af57914d1 Author: Jakub Kicinski Date: Tue May 3 17:41:35 2022 -0700 Merge branch 'bnxt_en-bug-fixes' Michael Chan says: ==================== bnxt_en: Bug fixes This patch series includes 3 fixes: - Fix an occasional VF open failure. - Fix a PTP spinlock usage before initialization - Fix unnecesary RX packet drops under high TX traffic load. ==================== Link: https://lore.kernel.org/r/1651540392-2260-1-git-send-email-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit 195af57914d15229186658ed26dab24b9ada4122 Author: Michael Chan Date: Mon May 2 21:13:12 2022 -0400 bnxt_en: Fix unnecessary dropping of RX packets In bnxt_poll_p5(), we first check cpr->has_more_work. If it is true, we are in NAPI polling mode and we will call __bnxt_poll_cqs() to continue polling. It is possible to exhanust the budget again when __bnxt_poll_cqs() returns. We then enter the main while loop to check for new entries in the NQ. If we had previously exhausted the NAPI budget, we may call __bnxt_poll_work() to process an RX entry with zero budget. This will cause packets to be dropped unnecessarily, thinking that we are in the netpoll path. Fix it by breaking out of the while loop if we need to process an RX NQ entry with no budget left. We will then exit NAPI and stay in polling mode. Fixes: 389a877a3b20 ("bnxt_en: Process the NQ under NAPI continuous polling.") Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++++ 1 file changed, 4 insertions(+) commit 2b156fb57d8f0d28f2207edc646751f4717cf20d Author: Michael Chan Date: Mon May 2 21:13:11 2022 -0400 bnxt_en: Initiallize bp->ptp_lock first before using it bnxt_ptp_init() calls bnxt_ptp_init_rtc() which will acquire the ptp_lock spinlock. The spinlock is not initialized until later. Move the bnxt_ptp_init_rtc() call after the spinlock is initialized. Fixes: 24ac1ecd5240 ("bnxt_en: Add driver support to use Real Time Counter for PTP") Reviewed-by: Pavan Chebbi Reviewed-by: Saravanan Vajravel Reviewed-by: Andy Gospodarek Reviewed-by: Somnath Kotur Reviewed-by: Damodharam Ammepalli Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) commit 13ba794397e45e52893cfc21d7a69cb5f341b407 Author: Somnath Kotur Date: Mon May 2 21:13:10 2022 -0400 bnxt_en: Fix possible bnxt_open() failure caused by wrong RFS flag bnxt_open() can fail in this code path, especially on a VF when it fails to reserve default rings: bnxt_open() __bnxt_open_nic() bnxt_clear_int_mode() bnxt_init_dflt_ring_mode() RX rings would be set to 0 when we hit this error path. It is possible for a subsequent bnxt_open() call to potentially succeed with a code path like this: bnxt_open() bnxt_hwrm_if_change() bnxt_fw_init_one() bnxt_fw_init_one_p3() bnxt_set_dflt_rfs() bnxt_rfs_capable() bnxt_hwrm_reserve_rings() On older chips, RFS is capable if we can reserve the number of vnics that is equal to RX rings + 1. But since RX rings is still set to 0 in this code path, we may mistakenly think that RFS is supported for 0 RX rings. Later, when the default RX rings are reserved and we try to enable RFS, it would fail and cause bnxt_open() to fail unnecessarily. We fix this in 2 places. bnxt_rfs_capable() will always return false if RX rings is not yet set. bnxt_init_dflt_ring_mode() will call bnxt_set_dflt_rfs() which will always clear the RFS flags if RFS is not supported. Fixes: 20d7d1c5c9b1 ("bnxt_en: reliably allocate IRQ table on reset to avoid crash") Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 5ef9b803a4af0f5e42012176889b40bb2a978b18 Author: Sergey Shtylyov Date: Mon May 2 23:14:09 2022 +0300 smsc911x: allow using IRQ0 The AlphaProject AP-SH4A-3A/AP-SH4AD-0A SH boards use IRQ0 for their SMSC LAN911x Ethernet chip, so the networking on them must have been broken by commit 965b2aa78fbc ("net/smsc911x: fix irq resource allocation failure") which filtered out 0 as well as the negative error codes -- it was kinda correct at the time, as platform_get_irq() could return 0 on of_irq_get() failure and on the actual 0 in an IRQ resource. This issue was fixed by me (back in 2016!), so we should be able to fix this driver to allow IRQ0 usage again... When merging this to the stable kernels, make sure you also merge commit e330b9a6bb35 ("platform: don't return 0 from platform_get_irq[_byname]() on error") -- that's my fix to platform_get_irq() for the DT platforms... Fixes: 965b2aa78fbc ("net/smsc911x: fix irq resource allocation failure") Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/656036e4-6387-38df-b8a7-6ba683b16e63@omp.ru Signed-off-by: Jakub Kicinski drivers/net/ethernet/smsc/smsc911x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2069624dac19d62c558bb6468fe03678553ab01d Author: Matthew Hagan Date: Mon May 2 23:33:15 2022 +0100 net: sfp: Add tx-fault workaround for Huawei MA5671A SFP ONT As noted elsewhere, various GPON SFP modules exhibit non-standard TX-fault behaviour. In the tested case, the Huawei MA5671A, when used in combination with a Marvell mv88e6085 switch, was found to persistently assert TX-fault, resulting in the module being disabled. This patch adds a quirk to ignore the SFP_F_TX_FAULT state, allowing the module to function. Change from v1: removal of erroneous return statment (Andrew Lunn) Signed-off-by: Matthew Hagan Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220502223315.1973376-1-mnhagan88@gmail.com Signed-off-by: Jakub Kicinski drivers/net/phy/sfp.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 107c948d1d3e61d10aee9d0f7c3d81bbee9842af Merge: ef8e4d3c2ab1 2bfed7d2ffa5 Author: Linus Torvalds Date: Tue May 3 15:47:19 2022 -0700 Merge tag 'seccomp-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull seccomp selftest fix from Kees Cook: - Avoid using stdin for read syscall testing (Jann Horn) * tag 'seccomp-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: selftests/seccomp: Don't call read() on TTY from background pgrp commit 20ce30fb4750f2ffc130cdcb26232b1dd87cd0a5 Author: Stephen Boyd Date: Tue Apr 26 18:32:26 2022 -0700 interconnect: Restore sync state by ignoring ipa-virt in provider count Ignore compatible strings for the IPA virt drivers that were removed in commits 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0 interconnects") and 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0 interconnects") so that the sync state logic can kick in again. Otherwise all the interconnects in the system will stay pegged at max speeds because 'providers_count' is always going to be one larger than the number of drivers that will ever probe on sc7180 or sdx55. This fixes suspend on sc7180 and sdx55 devices when you don't have a devicetree patch to remove the ipa-virt compatible node. Cc: Bjorn Andersson Cc: Doug Anderson Cc: Alex Elder Cc: Taniya Das Cc: Mike Tipton Fixes: 2fb251c26560 ("interconnect: qcom: sdx55: Drop IP0 interconnects") Fixes: 2f3724930eb4 ("interconnect: qcom: sc7180: Drop IP0 interconnects") Signed-off-by: Stephen Boyd Reviewed-by: Alex Elder Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20220427013226.341209-1-swboyd@chromium.org Signed-off-by: Georgi Djakov drivers/interconnect/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit ef8e4d3c2ab1f47f63b6c7e578266b7e5cc9cd1b Merge: 9050ba3a61a4 08da09f02804 Author: Linus Torvalds Date: Tue May 3 09:51:52 2022 -0700 Merge tag 'hwmon-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Work around a hardware problem in the delta-ahe50dc-fan driver - Explicitly disable PEC in PMBus core if not enabled - Fix negative temperature values in f71882fg driver - Fix warning on removal of adt7470 driver - Fix CROSSHAIR VI HERO name in asus_wmi_sensors driver - Fix build warning seen in xdpe12284 driver if CONFIG_SENSORS_XDPE122_REGULATOR is disabled - Fix type of 'ti,n-factor' in ti,tmp421 driver bindings * tag 'hwmon-for-v5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (pmbus) delta-ahe50dc-fan: work around hardware quirk hwmon: (pmbus) disable PEC if not enabled hwmon: (f71882fg) Fix negative temperature dt-bindings: hwmon: ti,tmp421: Fix type for 'ti,n-factor' hwmon: (adt7470) Fix warning on module removal hwmon: (asus_wmi_sensors) Fix CROSSHAIR VI HERO name hwmon: (xdpe12284) Fix build warning seen if CONFIG_SENSORS_XDPE122_REGULATOR is disabled commit aafa025c76dcc7d1a8c8f0bdefcbe4eb480b2f6a Author: Javier Martinez Canillas Date: Mon May 2 15:50:14 2022 +0200 fbdev: Make fb_release() return -ENODEV if fbdev was unregistered A reference to the framebuffer device struct fb_info is stored in the file private data, but this reference could no longer be valid and must not be accessed directly. Instead, the file_fb_info() accessor function must be used since it does sanity checking to make sure that the fb_info is valid. This can happen for example if the registered framebuffer device is for a driver that just uses a framebuffer provided by the system firmware. In that case, the fbdev core would unregister the framebuffer device when a real video driver is probed and ask to remove conflicting framebuffers. The bug has been present for a long time but commit 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal") unmasked it since the fbdev core started unregistering the framebuffers' devices associated. Fixes: 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal") Reported-by: Maxime Ripard Reported-by: Junxiao Chang Signed-off-by: Javier Martinez Canillas Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220502135014.377945-1-javierm@redhat.com drivers/video/fbdev/core/fbmem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 3481551f035725fdc46885425eac3ef9b58ae7b7 Author: Camel Guo Date: Tue May 3 13:43:33 2022 +0200 hwmon: (tmp401) Add OF device ID table This driver doesn't have of_match_table. This makes the kernel module tmp401.ko lack alias patterns (e.g: of:N*T*Cti,tmp411) to match DT node of the supported devices hence this kernel module will not be automatically loaded. After adding of_match_table to this driver, the folllowing alias will be added into tmp401.ko. $ modinfo drivers/hwmon/tmp401.ko filename: drivers/hwmon/tmp401.ko ...... author: Hans de Goede alias: of:N*T*Cti,tmp435C* alias: of:N*T*Cti,tmp435 alias: of:N*T*Cti,tmp432C* alias: of:N*T*Cti,tmp432 alias: of:N*T*Cti,tmp431C* alias: of:N*T*Cti,tmp431 alias: of:N*T*Cti,tmp411C* alias: of:N*T*Cti,tmp411 alias: of:N*T*Cti,tmp401C* alias: of:N*T*Cti,tmp401 ...... Fixes: af503716ac14 ("i2c: core: report OF style module alias for devices registered via OF") Signed-off-by: Camel Guo Link: https://lore.kernel.org/r/20220503114333.456476-1-camel.guo@axis.com Signed-off-by: Guenter Roeck drivers/hwmon/tmp401.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit a06afe8383080c630a7a528b8382fc6bb4925b61 Author: Christian Borntraeger Date: Fri Apr 29 17:15:26 2022 +0200 KVM: s390: vsie/gmap: reduce gmap_rmap overhead there are cases that trigger a 2nd shadow event for the same vmaddr/raddr combination. (prefix changes, reboots, some known races) This will increase memory usages and it will result in long latencies when cleaning up, e.g. on shutdown. To avoid cases with a list that has hundreds of identical raddrs we check existing entries at insert time. As this measurably reduces the list length this will be faster than traversing the list at shutdown time. In the long run several places will be optimized to create less entries and a shrinker might be necessary. Fixes: 4be130a08420 ("s390/mm: add shadow gmap support") Signed-off-by: Christian Borntraeger Acked-by: David Hildenbrand Link: https://lore.kernel.org/r/20220429151526.1560-1-borntraeger@linux.ibm.com Signed-off-by: Heiko Carstens arch/s390/mm/gmap.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 04144108a1ab9792e7a60b3a9e30c614cd3e0e9f Merge: 4f510c8bb1dd 5a1bde46f98b Author: Paolo Bonzini Date: Tue May 3 07:57:40 2022 -0400 Merge branch 'kvm-amd-pmu-fixes' into HEAD commit 5a1bde46f98b893cda6122b00e94c0c40a6ead3c Author: Sandipan Das Date: Wed Apr 27 17:01:49 2022 +0530 kvm: x86/cpuid: Only provide CPUID leaf 0xA if host has architectural PMU On some x86 processors, CPUID leaf 0xA provides information on Architectural Performance Monitoring features. It advertises a PMU version which Qemu uses to determine the availability of additional MSRs to manage the PMCs. Upon receiving a KVM_GET_SUPPORTED_CPUID ioctl request for the same, the kernel constructs return values based on the x86_pmu_capability irrespective of the vendor. This leaf and the additional MSRs are not supported on AMD and Hygon processors. If AMD PerfMonV2 is detected, the PMU version is set to 2 and guest startup breaks because of an attempt to access a non-existent MSR. Return zeros to avoid this. Fixes: a6c06ed1a60a ("KVM: Expose the architectural performance monitoring CPUID leaf") Reported-by: Vasant Hegde Signed-off-by: Sandipan Das Message-Id: <3fef83d9c2b2f7516e8ff50d60851f29a4bcb716.1651058600.git.sandipan.das@amd.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/cpuid.c | 5 +++++ 1 file changed, 5 insertions(+) commit 5eb849322d7f7ae9d5c587c7bc3b4f7c6872cd2f Author: Kyle Huey Date: Mon May 2 22:01:36 2022 -0700 KVM: x86/svm: Account for family 17h event renumberings in amd_pmc_perf_hw_id Zen renumbered some of the performance counters that correspond to the well known events in perf_hw_id. This code in KVM was never updated for that, so guest that attempt to use counters on Zen that correspond to the pre-Zen perf_hw_id values will silently receive the wrong values. This has been observed in the wild with rr[0] when running in Zen 3 guests. rr uses the retired conditional branch counter 00d1 which is incorrectly recognized by KVM as PERF_COUNT_HW_STALLED_CYCLES_BACKEND. [0] https://rr-project.org/ Signed-off-by: Kyle Huey Message-Id: <20220503050136.86298-1-khuey@kylehuey.com> Cc: stable@vger.kernel.org [Check guest family, not host. - Paolo] Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/pmu.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) commit 4f510c8bb1dd0edc5f8f82cbe990c6174ceb5a06 Merge: f751d8eac176 ba3a6120a4e7 Author: Paolo Bonzini Date: Tue May 3 07:23:08 2022 -0400 Merge branch 'kvm-tdp-mmu-atomicity-fix' into HEAD We are dropping A/D bits (and W bits) in the TDP MMU. Even if mmu_lock is held for write, as volatile SPTEs can be written by other tasks/vCPUs outside of mmu_lock. Attempting to prove that bug exposed another notable goof, which has been lurking for a decade, give or take: KVM treats _all_ MMU-writable SPTEs as volatile, even though KVM never clears WRITABLE outside of MMU lock. As a result, the legacy MMU (and the TDP MMU if not fixed) uses XCHG to update writable SPTEs. The fix does not seem to have an easily-measurable affect on performance; page faults are so slow that wasting even a few hundred cycles is dwarfed by the base cost. commit 3a58f13a881ed351198ffab4cf9953cf19d2ab3a Author: Tetsuo Handa Date: Mon May 2 10:40:18 2022 +0900 net: rds: acquire refcount on TCP sockets syzbot is reporting use-after-free read in tcp_retransmit_timer() [1], for TCP socket used by RDS is accessing sock_net() without acquiring a refcount on net namespace. Since TCP's retransmission can happen after a process which created net namespace terminated, we need to explicitly acquire a refcount. Link: https://syzkaller.appspot.com/bug?extid=694120e1002c117747ed [1] Reported-by: syzbot Fixes: 26abe14379f8e2fa ("net: Modify sk_alloc to not reference count the netns of kernel sockets.") Fixes: 8a68173691f03661 ("net: sk_clone_lock() should only do get_net() if the parent is not a kernel socket") Signed-off-by: Tetsuo Handa Tested-by: syzbot Link: https://lore.kernel.org/r/a5fb1fc4-2284-3359-f6a0-e4e390239d7b@I-love.SAKURA.ne.jp Signed-off-by: Paolo Abeni net/rds/tcp.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit ba3a6120a4e7efc13d19fe43eb6c5caf1da05b72 Author: Sean Christopherson Date: Sat Apr 23 03:47:43 2022 +0000 KVM: x86/mmu: Use atomic XCHG to write TDP MMU SPTEs with volatile bits Use an atomic XCHG to write TDP MMU SPTEs that have volatile bits, even if mmu_lock is held for write, as volatile SPTEs can be written by other tasks/vCPUs outside of mmu_lock. If a vCPU uses the to-be-modified SPTE to write a page, the CPU can cache the translation as WRITABLE in the TLB despite it being seen by KVM as !WRITABLE, and/or KVM can clobber the Accessed/Dirty bits and not properly tag the backing page. Exempt non-leaf SPTEs from atomic updates as KVM itself doesn't modify non-leaf SPTEs without holding mmu_lock, they do not have Dirty bits, and KVM doesn't consume the Accessed bit of non-leaf SPTEs. Dropping the Dirty and/or Writable bits is most problematic for dirty logging, as doing so can result in a missed TLB flush and eventually a missed dirty page. In the unlikely event that the only dirty page(s) is a clobbered SPTE, clear_dirty_gfn_range() will see the SPTE as not dirty (based on the Dirty or Writable bit depending on the method) and so not update the SPTE and ultimately not flush. If the SPTE is cached in the TLB as writable before it is clobbered, the guest can continue writing the associated page without ever taking a write-protect fault. For most (all?) file back memory, dropping the Dirty bit is a non-issue. The primary MMU write-protects its PTEs on writeback, i.e. KVM's dirty bit is effectively ignored because the primary MMU will mark that page dirty when the write-protection is lifted, e.g. when KVM faults the page back in for write. The Accessed bit is a complete non-issue. Aside from being unused for non-leaf SPTEs, KVM doesn't do a TLB flush when aging SPTEs, i.e. the Accessed bit may be dropped anyways. Lastly, the Writable bit is also problematic as an extension of the Dirty bit, as KVM (correctly) treats the Dirty bit as volatile iff the SPTE is !DIRTY && WRITABLE. If KVM fixes an MMU-writable, but !WRITABLE, SPTE out of mmu_lock, then it can allow the CPU to set the Dirty bit despite the SPTE being !WRITABLE when it is checked by KVM. But that all depends on the Dirty bit being problematic in the first place. Fixes: 2f2fad0897cb ("kvm: x86/mmu: Add functions to handle changed TDP SPTEs") Cc: stable@vger.kernel.org Cc: Ben Gardon Cc: David Matlack Cc: Venkatesh Srinivas Signed-off-by: Sean Christopherson Message-Id: <20220423034752.1161007-4-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_iter.h | 34 +++++++++++++++++-- arch/x86/kvm/mmu/tdp_mmu.c | 82 +++++++++++++++++++++++++++++---------------- 2 files changed, 85 insertions(+), 31 deletions(-) commit 54eb3ef56f36827aad90915df33387d4c2b5df5a Author: Sean Christopherson Date: Sat Apr 23 03:47:42 2022 +0000 KVM: x86/mmu: Move shadow-present check out of spte_has_volatile_bits() Move the is_shadow_present_pte() check out of spte_has_volatile_bits() and into its callers. Well, caller, since only one of its two callers doesn't already do the shadow-present check. Opportunistically move the helper to spte.c/h so that it can be used by the TDP MMU, which is also the primary motivation for the shadow-present change. Unlike the legacy MMU, the TDP MMU uses a single path for clear leaf and non-leaf SPTEs, and to avoid unnecessary atomic updates, the TDP MMU will need to check is_last_spte() prior to calling spte_has_volatile_bits(), and calling is_last_spte() without first calling is_shadow_present_spte() is at best odd, and at worst a violation of KVM's loosely defines SPTE rules. Note, mmu_spte_clear_track_bits() could likely skip the write entirely for SPTEs that are not shadow-present. Leave that cleanup for a future patch to avoid introducing a functional change, and because the shadow-present check can likely be moved further up the stack, e.g. drop_large_spte() appears to be the only path that doesn't already explicitly check for a shadow-present SPTE. No functional change intended. Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20220423034752.1161007-3-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 29 ++--------------------------- arch/x86/kvm/mmu/spte.c | 28 ++++++++++++++++++++++++++++ arch/x86/kvm/mmu/spte.h | 2 ++ 3 files changed, 32 insertions(+), 27 deletions(-) commit 706c9c55e5a32800605eb6a864ef6e1ca0c6c179 Author: Sean Christopherson Date: Sat Apr 23 03:47:41 2022 +0000 KVM: x86/mmu: Don't treat fully writable SPTEs as volatile (modulo A/D) Don't treat SPTEs that are truly writable, i.e. writable in hardware, as being volatile (unless they're volatile for other reasons, e.g. A/D bits). KVM _sets_ the WRITABLE bit out of mmu_lock, but never _clears_ the bit out of mmu_lock, so if the WRITABLE bit is set, it cannot magically get cleared just because the SPTE is MMU-writable. Rename the wrapper of MMU-writable to be more literal, the previous name of spte_can_locklessly_be_made_writable() is wrong and misleading. Fixes: c7ba5b48cc8d ("KVM: MMU: fast path of handling guest page fault") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20220423034752.1161007-2-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 17 +++++++++-------- arch/x86/kvm/mmu/spte.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) commit f5c2174a3775491e890ce285df52f5715fbef875 Author: Marc Kleine-Budde Date: Mon May 2 11:46:38 2022 +0200 selftests/net: so_txtime: usage(): fix documentation of default clock The program uses CLOCK_TAI as default clock since it was added to the Linux repo. In commit: | 040806343bb4 ("selftests/net: so_txtime multi-host support") a help text stating the wrong default clock was added. This patch fixes the help text. Fixes: 040806343bb4 ("selftests/net: so_txtime multi-host support") Cc: Carlos Llamas Cc: Willem de Bruijn Signed-off-by: Marc Kleine-Budde Acked-by: Willem de Bruijn Reviewed-by: Carlos Llamas Link: https://lore.kernel.org/r/20220502094638.1921702-3-mkl@pengutronix.de Signed-off-by: Paolo Abeni tools/testing/selftests/net/so_txtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 97926d5a847ca1758ad8702ce591e3b05a701e0d Author: Marc Kleine-Budde Date: Mon May 2 11:46:37 2022 +0200 selftests/net: so_txtime: fix parsing of start time stamp on 32 bit systems This patch fixes the parsing of the cmd line supplied start time on 32 bit systems. A "long" on 32 bit systems is only 32 bit wide and cannot hold a timestamp in nano second resolution. Fixes: 040806343bb4 ("selftests/net: so_txtime multi-host support") Cc: Carlos Llamas Cc: Willem de Bruijn Signed-off-by: Marc Kleine-Budde Acked-by: Willem de Bruijn Reviewed-by: Carlos Llamas Link: https://lore.kernel.org/r/20220502094638.1921702-2-mkl@pengutronix.de Signed-off-by: Paolo Abeni tools/testing/selftests/net/so_txtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3122257c02afd9f199a8fc84ae981e1fc4958532 Author: Ido Schimmel Date: Mon May 2 11:45:07 2022 +0300 selftests: mirror_gre_bridge_1q: Avoid changing PVID while interface is operational In emulated environments, the bridge ports enslaved to br1 get a carrier before changing br1's PVID. This means that by the time the PVID is changed, br1 is already operational and configured with an IPv6 link-local address. When the test is run with netdevs registered by mlxsw, changing the PVID is vetoed, as changing the VID associated with an existing L3 interface is forbidden. This restriction is similar to the 8021q driver's restriction of changing the VID of an existing interface. Fix this by taking br1 down and bringing it back up when it is fully configured. With this fix, the test reliably passes on top of both the SW and HW data paths (emulated or not). Fixes: 239e754af854 ("selftests: forwarding: Test mirror-to-gretap w/ UL 802.1q") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Link: https://lore.kernel.org/r/20220502084507.364774-1-idosch@nvidia.com Signed-off-by: Paolo Abeni tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh | 3 +++ 1 file changed, 3 insertions(+) commit 45c77fb41821efa9ebb697430e03b37f2cb56602 Merge: 79396934e289 7a6bc33ab549 Author: Paolo Abeni Date: Tue May 3 11:07:37 2022 +0200 Merge branch 'emaclite-improve-error-handling-and-minor-cleanup' Radhey Shyam Pandey says: ==================== emaclite: improve error handling and minor cleanup This patchset does error handling for of_address_to_resource() and also removes "Don't advertise 1000BASE-T" and auto negotiation. Changes for v3: - Resolve git apply conflicts for 2/2 patch. Changes for v2: - Added Andrew's reviewed by tag in 1/2 patch. - Move ret to down to align with reverse xmas tree style in 2/2 patch. - Also add fixes tag in 2/2 patch. - Specify tree name in subject prefix. ==================== Link: https://lore.kernel.org/r/1651476470-23904-1-git-send-email-radhey.shyam.pandey@xilinx.com Signed-off-by: Paolo Abeni commit 7a6bc33ab54923d325d9a1747ec9652c4361ebd1 Author: Shravya Kumbham Date: Mon May 2 12:57:50 2022 +0530 net: emaclite: Add error handling for of_address_to_resource() check the return value of of_address_to_resource() and also add missing of_node_put() for np and npp nodes. Fixes: e0a3bc65448c ("net: emaclite: Support multiple phys connected to one MDIO bus") Addresses-Coverity: Event check_return value. Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Signed-off-by: Paolo Abeni drivers/net/ethernet/xilinx/xilinx_emaclite.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit b800528b97d0adc3a5ba42d78a8b0d3f07a31f44 Author: Shravya Kumbham Date: Mon May 2 12:57:49 2022 +0530 net: emaclite: Don't advertise 1000BASE-T and do auto negotiation In xemaclite_open() function we are setting the max speed of emaclite to 100Mb using phy_set_max_speed() function so, there is no need to write the advertising registers to stop giga-bit speed and the phy_start() function starts the auto-negotiation so, there is no need to handle it separately using advertising registers. Remove the phy_read and phy_write of advertising registers in xemaclite_open() function. Signed-off-by: Shravya Kumbham Signed-off-by: Radhey Shyam Pandey Reviewed-by: Andrew Lunn Signed-off-by: Paolo Abeni drivers/net/ethernet/xilinx/xilinx_emaclite.c | 15 --------------- 1 file changed, 15 deletions(-) commit 26f9ce53817a8fd84b69a73473a7de852a24c897 Author: Gleb Chesnokov Date: Fri Apr 15 12:42:29 2022 +0000 scsi: qla2xxx: Fix missed DMA unmap for aborted commands Aborting commands that have already been sent to the firmware can cause BUG in qlt_free_cmd(): BUG_ON(cmd->sg_mapped) For instance: - Command passes rdx_to_xfer state, maps sgl, sends to the firmware - Reset occurs, qla2xxx performs ISP error recovery, aborts the command - Target stack calls qlt_abort_cmd() and then qlt_free_cmd() - BUG_ON(cmd->sg_mapped) in qlt_free_cmd() occurs because sgl was not unmapped Thus, unmap sgl in qlt_abort_cmd() for commands with the aborted flag set. Link: https://lore.kernel.org/r/AS8PR10MB4952D545F84B6B1DFD39EC1E9DEE9@AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM Reviewed-by: Himanshu Madhani Signed-off-by: Gleb Chesnokov Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_target.c | 3 +++ 1 file changed, 3 insertions(+) commit 6056a92ceb2a7705d61df7ec5370548e96aee258 Author: Brian Bunker Date: Mon May 2 08:09:17 2022 -0700 scsi: scsi_dh_alua: Properly handle the ALUA transitioning state The handling of the ALUA transitioning state is currently broken. When a target goes into this state, it is expected that the target is allowed to stay in this state for the implicit transition timeout without a path failure. The handler has this logic, but it gets skipped currently. When the target transitions, there is in-flight I/O from the initiator. The first of these responses from the target will be a unit attention letting the initiator know that the ALUA state has changed. The remaining in-flight I/Os, before the initiator finds out that the portal state has changed, will return not ready, ALUA state is transitioning. The portal state will change to SCSI_ACCESS_STATE_TRANSITIONING. This will lead to all new I/O immediately failing the path unexpectedly. The path failure happens in less than a second instead of the expected successes until the transition timer is exceeded. Allow I/Os to continue while the path is in the ALUA transitioning state. The handler already takes care of a target that stays in the transitioning state for too long by changing the state to ALUA state standby once the transition timeout is exceeded at which point the path will fail. Link: https://lore.kernel.org/r/CAHZQxy+4sTPz9+pY3=7VJH+CLUJsDct81KtnR2be8ycN5mhqTg@mail.gmail.com Reviewed-by: Hannes Reinecke Acked-by: Krishna Kant Acked-by: Seamus Connor Signed-off-by: Brian Bunker Signed-off-by: Martin K. Petersen drivers/scsi/device_handler/scsi_dh_alua.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit b5d1274409d0eec6d826f65d6dafebf9d77a1b99 Author: Janis Schoetterl-Glausch Date: Fri Mar 11 18:00:40 2022 +0100 KVM: s390: Fix lockdep issue in vm memop Issuing a memop on a protected vm does not make sense, neither is the memory readable/writable, nor does it make sense to check storage keys. This is why the ioctl will return -EINVAL when it detects the vm to be protected. However, in order to ensure that the vm cannot become protected during the memop, the kvm->lock would need to be taken for the duration of the ioctl. This is also required because kvm_s390_pv_is_protected asserts that the lock must be held. Instead, don't try to prevent this. If user space enables secure execution concurrently with a memop it must accecpt the possibility of the memop failing. Still check if the vm is currently protected, but without locking and consider it a heuristic. Fixes: ef11c9463ae0 ("KVM: s390: Add vm IOCTL for key checked guest absolute memory access") Signed-off-by: Janis Schoetterl-Glausch Reviewed-by: Janosch Frank Reviewed-by: Claudio Imbrenda Link: https://lore.kernel.org/r/20220322153204.2637400-1-scgl@linux.ibm.com Signed-off-by: Christian Borntraeger Signed-off-by: Heiko Carstens arch/s390/kvm/kvm-s390.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) commit 9050ba3a61a4b5bd84c2cde092a100404f814f31 Merge: 672c0c517342 4b73c55fdebd Author: Linus Torvalds Date: Mon May 2 10:09:02 2022 -0700 Merge tag 'for-5.18-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A few more fixes mostly around how some file attributes could be set. - fix handling of compression property: - don't allow setting it on anything else than regular file or directory - do not allow setting it on nodatacow files via properties - improved error handling when setting xattr - make sure symlinks are always properly logged" * tag 'for-5.18-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: skip compression property for anything other than files and dirs btrfs: do not BUG_ON() on failure to update inode when setting xattr btrfs: always log symlinks in full mode btrfs: do not allow compression on nodatacow files btrfs: export a helper for compression hard check commit 285d5731a0cb2dd3a12ddf34d67be4e4965e64da Author: Ming Lei Date: Tue Apr 26 10:49:36 2022 +0800 Revert "block: release rq qos structures for queue without disk" This reverts commit daaca3522a8e67c46e39ef09c1d542e866f85f3b. Commit daaca3522a8e ("block: release rq qos structures for queue without disk") is only needed for v5.15~v5.17, and isn't needed for v5.18, so revert it. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220426024936.3321341-1-ming.lei@redhat.com Signed-off-by: Jens Axboe block/blk-core.c | 4 ---- 1 file changed, 4 deletions(-) commit 1c9043ae0667a43bd87beeebbdd4bed674713629 Author: Mustafa Ismail Date: Mon Apr 25 13:17:03 2022 -0500 RDMA/irdma: Fix possible crash due to NULL netdev in notifier For some net events in irdma_net_event notifier, the netdev can be NULL which will cause a crash in rdma_vlan_dev_real_dev. Fix this by moving all processing to the NETEVENT_NEIGH_UPDATE case where the netdev is guaranteed to not be NULL. Fixes: 6702bc147448 ("RDMA/irdma: Fix netdev notifications for vlan's") Link: https://lore.kernel.org/r/20220425181703.1634-4-shiraz.saleem@intel.com Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/irdma/utils.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) commit 2df6d895907b2f5dfbc558cbff7801bba82cb3cc Author: Shiraz Saleem Date: Mon Apr 25 13:17:02 2022 -0500 RDMA/irdma: Reduce iWARP QP destroy time QP destroy is synchronous and waits for its refcnt to be decremented in irdma_cm_node_free_cb (for iWARP) which fires after the RCU grace period elapses. Applications running a large number of connections are exposed to high wait times on destroy QP for events like SIGABORT. The long pole for this wait time is the firing of the call_rcu callback during a CM node destroy which can be slow. It holds the QP reference count and blocks the destroy QP from completing. call_rcu only needs to make sure that list walkers have a reference to the cm_node object before freeing it and thus need to wait for grace period elapse. The rest of the connection teardown in irdma_cm_node_free_cb is moved out of the grace period wait in irdma_destroy_connection. Also, replace call_rcu with a simple kfree_rcu as it just needs to do a kfree on the cm_node Fixes: 146b9756f14c ("RDMA/irdma: Add connection manager") Link: https://lore.kernel.org/r/20220425181703.1634-3-shiraz.saleem@intel.com Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/irdma/cm.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit 7b8943b821bafab492f43aafbd006b57c6b65845 Author: Tatyana Nikolova Date: Mon Apr 25 13:17:01 2022 -0500 RDMA/irdma: Flush iWARP QP if modified to ERR from RTR state When connection establishment fails in iWARP mode, an app can drain the QPs and hang because flush isn't issued when the QP is modified from RTR state to error. Issue a flush in this case using function irdma_cm_disconn(). Update irdma_cm_disconn() to do flush when cm_id is NULL, which is the case when the QP is in RTR state and there is an error in the connection establishment. Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs") Link: https://lore.kernel.org/r/20220425181703.1634-2-shiraz.saleem@intel.com Signed-off-by: Tatyana Nikolova Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/irdma/cm.c | 16 +++++----------- drivers/infiniband/hw/irdma/verbs.c | 4 ++-- 2 files changed, 7 insertions(+), 13 deletions(-) commit a196c78b5443fc61af2c0490213b9d125482cbd1 Author: Jens Axboe Date: Sun May 1 21:19:50 2022 -0600 io_uring: assign non-fixed early for async work We defer file assignment to ensure that fixed files work with links between a direct accept/open and the links that follow it. But this has the side effect that normal file assignment is then not complete by the time that request submission has been done. For deferred execution, if the file is a regular file, assign it when we do the async prep anyway. Signed-off-by: Jens Axboe fs/io_uring.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit e5f6e5d554ac274f9c8ba60078103d0425b93c19 Author: Baruch Siach Date: Mon Apr 11 09:23:40 2022 +0300 gpio: mvebu: drop pwm base assignment pwmchip_add() unconditionally assigns the base ID dynamically. Commit f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically") dropped all base assignment from drivers under drivers/pwm/. It missed this driver. Fix that. Fixes: f9a8ee8c8bcd1 ("pwm: Always allocate PWM chip base ID dynamically") Signed-off-by: Baruch Siach Reviewed-by: Uwe Kleine-König Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski drivers/gpio/gpio-mvebu.c | 7 ------- 1 file changed, 7 deletions(-) commit e75f88efac05bf4e107e4171d8db6d8c3937252d Author: Andrei Lalaev Date: Fri Apr 15 10:07:11 2022 +0300 gpiolib: of: fix bounds check for 'gpio-reserved-ranges' Gpiolib interprets the elements of "gpio-reserved-ranges" as "start,size" because it clears "size" bits starting from the "start" bit in the according bitmap. So it has to use "greater" instead of "greater or equal" when performs bounds check to make sure that GPIOs are in the available range. Previous implementation skipped ranges that include the last GPIO in the range. I wrote the mail to the maintainers (https://lore.kernel.org/linux-gpio/20220412115554.159435-1-andrei.lalaev@emlid.com/T/#u) of the questioned DTSes (because I couldn't understand how the maintainers interpreted this property), but I haven't received a response. Since the questioned DTSes use "gpio-reserved-ranges = <0 4>" (i.e., the beginning of the range), this patch doesn't affect these DTSes at all. TBH this patch doesn't break any existing DTSes because none of them reserve gpios at the end of range. Fixes: 726cb3ba4969 ("gpiolib: Support 'gpio-reserved-ranges' property") Signed-off-by: Andrei Lalaev Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski drivers/gpio/gpiolib-of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 672c0c5173427e6b3e2a9bbb7be51ceeec78093a Author: Linus Torvalds Date: Sun May 1 13:57:58 2022 -0700 Linux 5.18-rc5 Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b6b2648911bbc13c59def22fd7b4b7c511a4eb92 Merge: b2da7df52e16 f751d8eac176 Author: Linus Torvalds Date: Sun May 1 11:49:32 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "ARM: - Take care of faults occuring between the PARange and IPA range by injecting an exception - Fix S2 faults taken from a host EL0 in protected mode - Work around Oops caused by a PMU access from a 32bit guest when PMU has been created. This is a temporary bodge until we fix it for good. x86: - Fix potential races when walking host page table - Fix shadow page table leak when KVM runs nested - Work around bug in userspace when KVM synthesizes leaf 0x80000021 on older (pre-EPYC) or Intel processors Generic (but affects only RISC-V): - Fix bad user ABI for KVM_EXIT_SYSTEM_EVENT" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: work around QEMU issue with synthetic CPUID leaves Revert "x86/mm: Introduce lookup_address_in_mm()" KVM: x86/mmu: fix potential races when walking host page table KVM: fix bad user ABI for KVM_EXIT_SYSTEM_EVENT KVM: x86/mmu: Do not create SPTEs for GFNs that exceed host.MAXPHYADDR KVM: arm64: Inject exception on out-of-IPA-range translation fault KVM/arm64: Don't emulate a PMU for 32-bit guests if feature not set KVM: arm64: Handle host stage-2 faults from 32-bit EL0 commit b2da7df52e16110c8d8dda0602db81c15711e7ff Merge: b70ed23c238a 7e0815b3e099 Author: Linus Torvalds Date: Sun May 1 10:03:36 2022 -0700 Merge tag 'x86_urgent_for_v5.18_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - A fix to disable PCI/MSI[-X] masking for XEN_HVM guests as that is solely controlled by the hypervisor - A build fix to make the function prototype (__warn()) as visible as the definition itself - A bunch of objtool annotation fixes which have accumulated over time - An ORC unwinder fix to handle bad input gracefully - Well, we thought the microcode gets loaded in time in order to restore the microcode-emulated MSRs but we thought wrong. So there's a fix for that to have the ordering done properly - Add new Intel model numbers - A spelling fix * tag 'x86_urgent_for_v5.18_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests bug: Have __warn() prototype defined unconditionally x86/Kconfig: fix the spelling of 'becoming' in X86_KERNEL_IBT config objtool: Use offstr() to print address of missing ENDBR objtool: Print data address for "!ENDBR" data warnings x86/xen: Add ANNOTATE_NOENDBR to startup_xen() x86/uaccess: Add ENDBR to __put_user_nocheck*() x86/retpoline: Add ANNOTATE_NOENDBR for retpolines x86/static_call: Add ANNOTATE_NOENDBR to static call trampoline objtool: Enable unreachable warnings for CLANG LTO x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE x86,objtool: Mark cpu_startup_entry() __noreturn x86,xen,objtool: Add UNWIND hint lib/strn*,objtool: Enforce user_access_begin() rules MAINTAINERS: Add x86 unwinding entry x86/unwind/orc: Recheck address range after stack info was updated x86/cpu: Load microcode during restore_processor_state() x86/cpu: Add new Alderlake and Raptorlake CPU model numbers commit 79396934e289dbc501316c1d1f975bb4c88ae460 Author: Russell King (Oracle) Date: Fri Apr 29 09:43:03 2022 -0700 net: dsa: b53: convert to phylink_pcs Convert B53 to use phylink_pcs for the serdes rather than hooking it into the MAC-layer callbacks. Fixes: 81c1681cbb9f ("net: dsa: b53: mark as non-legacy") Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller drivers/net/dsa/b53/b53_common.c | 36 ++++--------------- drivers/net/dsa/b53/b53_priv.h | 24 +++++++------ drivers/net/dsa/b53/b53_serdes.c | 74 +++++++++++++++++++++++++++------------- drivers/net/dsa/b53/b53_serdes.h | 9 ++--- drivers/net/dsa/b53/b53_srab.c | 4 +-- 5 files changed, 75 insertions(+), 72 deletions(-) commit b70ed23c238af025153cb0f5b3c1d0ae5bc30f73 Merge: d4af0c17235f 4abff6d48dbc Author: Linus Torvalds Date: Sun May 1 09:34:54 2022 -0700 Merge tag 'objtool_urgent_for_v5.18_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fixes from Borislav Petkov: "A bunch of objtool fixes to improve unwinding, sibling call detection, fallthrough detection and relocation handling of weak symbols when the toolchain strips section symbols" * tag 'objtool_urgent_for_v5.18_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Fix code relocs vs weak symbols objtool: Fix type of reloc::addend objtool: Fix function fallthrough detection for vmlinux objtool: Fix sibling call detection in alternatives objtool: Don't set 'jump_dest' for sibling calls x86/uaccess: Don't jump between functions commit d4af0c17235fbf992f5023bbfb84303e082e45a6 Merge: 57ae8a492116 c7d2f89fea26 Author: Linus Torvalds Date: Sun May 1 09:30:47 2022 -0700 Merge tag 'irq_urgent_for_v5.18_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Borislav Petkov: - Fix locking when accessing device MSI descriptors * tag 'irq_urgent_for_v5.18_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: bus: fsl-mc-msi: Fix MSI descriptor mutex lock for msi_first_desc() commit 6b292a04c694573a302686323fe15b1c7e673e5b Author: Thomas Gleixner Date: Fri Apr 29 15:54:24 2022 +0200 pci_irq_vector() can't be used in atomic context any longer. This conflicts with the usage of this function in nic_mbx_intr_handler(). Cache the Linux interrupt numbers in struct nicpf and use that cache in the interrupt handler to select the mailbox. Fixes: 495c66aca3da ("genirq/msi: Convert to new functions") Reported-by: Ondrej Mosnacek Signed-off-by: Thomas Gleixner Cc: Sunil Goutham Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org Cc: stable@vger.kernel.org Link: https://bugzilla.redhat.com/show_bug.cgi?id=2041772 Signed-off-by: David S. Miller drivers/net/ethernet/cavium/thunder/nic_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit b6693611f71e1b9107a2d178c1f7d92c7d850891 Merge: 47f753c1108e d270453a0d9e Author: David S. Miller Date: Sun May 1 13:26:05 2022 +0100 Merge branch 'nfc-fixes' Duoming Zhou says: ==================== Replace improper checks and fix bugs in nfc subsystem The first patch is used to replace improper checks in netlink related functions of nfc core, the second patch is used to fix bugs in nfcmrvl driver. ==================== Signed-off-by: David S. Miller commit d270453a0d9ec10bb8a802a142fb1b3601a83098 Author: Duoming Zhou Date: Fri Apr 29 20:45:51 2022 +0800 nfc: nfcmrvl: main: reorder destructive operations in nfcmrvl_nci_unregister_dev to avoid bugs There are destructive operations such as nfcmrvl_fw_dnld_abort and gpio_free in nfcmrvl_nci_unregister_dev. The resources such as firmware, gpio and so on could be destructed while the upper layer functions such as nfcmrvl_fw_dnld_start and nfcmrvl_nci_recv_frame is executing, which leads to double-free, use-after-free and null-ptr-deref bugs. There are three situations that could lead to double-free bugs. The first situation is shown below: (Thread 1) | (Thread 2) nfcmrvl_fw_dnld_start | ... | nfcmrvl_nci_unregister_dev release_firmware() | nfcmrvl_fw_dnld_abort kfree(fw) //(1) | fw_dnld_over | release_firmware ... | kfree(fw) //(2) | ... The second situation is shown below: (Thread 1) | (Thread 2) nfcmrvl_fw_dnld_start | ... | mod_timer | (wait a time) | fw_dnld_timeout | nfcmrvl_nci_unregister_dev fw_dnld_over | nfcmrvl_fw_dnld_abort release_firmware | fw_dnld_over kfree(fw) //(1) | release_firmware ... | kfree(fw) //(2) The third situation is shown below: (Thread 1) | (Thread 2) nfcmrvl_nci_recv_frame | if(..->fw_download_in_progress)| nfcmrvl_fw_dnld_recv_frame | queue_work | | fw_dnld_rx_work | nfcmrvl_nci_unregister_dev fw_dnld_over | nfcmrvl_fw_dnld_abort release_firmware | fw_dnld_over kfree(fw) //(1) | release_firmware | kfree(fw) //(2) The firmware struct is deallocated in position (1) and deallocated in position (2) again. The crash trace triggered by POC is like below: BUG: KASAN: double-free or invalid-free in fw_dnld_over Call Trace: kfree fw_dnld_over nfcmrvl_nci_unregister_dev nci_uart_tty_close tty_ldisc_kill tty_ldisc_hangup __tty_hangup.part.0 tty_release ... What's more, there are also use-after-free and null-ptr-deref bugs in nfcmrvl_fw_dnld_start. If we deallocate firmware struct, gpio or set null to the members of priv->fw_dnld in nfcmrvl_nci_unregister_dev, then, we dereference firmware, gpio or the members of priv->fw_dnld in nfcmrvl_fw_dnld_start, the UAF or NPD bugs will happen. This patch reorders destructive operations after nci_unregister_device in order to synchronize between cleanup routine and firmware download routine. The nci_unregister_device is well synchronized. If the device is detaching, the firmware download routine will goto error. If firmware download routine is executing, nci_unregister_device will wait until firmware download routine is finished. Fixes: 3194c6870158 ("NFC: nfcmrvl: add firmware download support") Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller drivers/nfc/nfcmrvl/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit da5c0f119203ad9728920456a0f52a6d850c01cd Author: Duoming Zhou Date: Fri Apr 29 20:45:50 2022 +0800 nfc: replace improper check device_is_registered() in netlink related functions The device_is_registered() in nfc core is used to check whether nfc device is registered in netlink related functions such as nfc_fw_download(), nfc_dev_up() and so on. Although device_is_registered() is protected by device_lock, there is still a race condition between device_del() and device_is_registered(). The root cause is that kobject_del() in device_del() is not protected by device_lock. (cleanup task) | (netlink task) | nfc_unregister_device | nfc_fw_download device_del | device_lock ... | if (!device_is_registered)//(1) kobject_del//(2) | ... ... | device_unlock The device_is_registered() returns the value of state_in_sysfs and the state_in_sysfs is set to zero in kobject_del(). If we pass check in position (1), then set zero in position (2). As a result, the check in position (1) is useless. This patch uses bool variable instead of device_is_registered() to judge whether the nfc device is registered, which is well synchronized. Fixes: 3e256b8f8dfa ("NFC: add nfc subsystem core") Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller net/nfc/core.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) commit 47f753c1108e287edb3e27fad8a7511a9d55578e Author: Tan Tee Min Date: Fri Apr 29 19:58:07 2022 +0800 net: stmmac: disable Split Header (SPH) for Intel platforms Based on DesignWare Ethernet QoS datasheet, we are seeing the limitation of Split Header (SPH) feature is not supported for Ipv4 fragmented packet. This SPH limitation will cause ping failure when the packets size exceed the MTU size. For example, the issue happens once the basic ping packet size is larger than the configured MTU size and the data is lost inside the fragmented packet, replaced by zeros/corrupted values, and leads to ping fail. So, disable the Split Header for Intel platforms. v2: Add fixes tag in commit message. Fixes: 67afd6d1cfdf("net: stmmac: Add Split Header support and enable it in XGMAC cores") Cc: # 5.10.x Suggested-by: Ong, Boon Leong Signed-off-by: Mohammad Athari Bin Ismail Signed-off-by: Wong Vee Khee Signed-off-by: Tan Tee Min Signed-off-by: David S. Miller drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- include/linux/stmmac.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) commit 2667ed10d9f01e250ba806276740782c89d77fda Author: Fenghua Yu Date: Thu Apr 28 11:00:41 2022 -0700 mm: Fix PASID use-after-free issue The PASID is being freed too early. It needs to stay around until after device drivers that might be using it have had a chance to clear it out of the hardware. The relevant refcounts are: mmget() /mmput() refcount the mm's address space mmgrab()/mmdrop() refcount the mm itself The PASID is currently tied to the life of the mm's address space and freed in __mmput(). This makes logical sense because the PASID can't be used once the address space is gone. But, this misses an important point: even after the address space is gone, the PASID will still be programmed into a device. Device drivers might, for instance, still need to flush operations that are outstanding and need to use that PASID. They do this at file->release() time. Device drivers call the IOMMU driver to hold a reference on the mm itself and drop it at file->release() time. But, the IOMMU driver holds a reference on the mm itself, not the address space. The address space (and the PASID) is long gone by the time the driver tries to clean up. This is effectively a use-after-free bug on the PASID. To fix this, move the PASID free operation from __mmput() to __mmdrop(). This ensures that the IOMMU driver's existing mmgrab() keeps the PASID allocated until it drops its mm reference. Fixes: 701fac40384f ("iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit") Reported-by: Zhangfei Gao Suggested-by: Jean-Philippe Brucker Suggested-by: Jacob Pan Signed-off-by: Fenghua Yu Signed-off-by: Thomas Gleixner Tested-by: Zhangfei Gao Reviewed-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20220428180041.806809-1-fenghua.yu@intel.com kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 57ae8a492116910bad2b3497ffe555b3a4b4180f Merge: e2e5ebecca69 ad8d869343ae Author: Linus Torvalds Date: Sat Apr 30 10:24:21 2022 -0700 Merge tag 'driver-core-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core fixes from Greg KH: "Here are some small driver core and kernfs fixes for some reported problems. They include: - kernfs regression that is causing oopses in 5.17 and newer releases - topology sysfs fixes for a few small reported problems. All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: kernfs: fix NULL dereferencing in kernfs_remove topology: Fix up build warning in topology_is_visible() arch_topology: Do not set llc_sibling if llc_id is invalid topology: make core_mask include at least cluster_siblings topology/sysfs: Hide PPIN on systems that do not support it. commit e2e5ebecca69a5a692cbd0728cb7f4abd25f48ac Merge: a6b5c5dc06a4 fda05730f62b Author: Linus Torvalds Date: Sat Apr 30 10:15:57 2022 -0700 Merge tag 'char-misc-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are a small number of char/misc/other driver fixes for 5.18-rc5 Nothing major in here, this is mostly IIO driver fixes along with some other small things: - at25 driver fix for systems without a dma-able stack - phy driver fixes for reported issues - binder driver fixes for reported issues All of these have been in linux-next without any reported problems" * tag 'char-misc-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (31 commits) eeprom: at25: Use DMA safe buffers binder: Gracefully handle BINDER_TYPE_FDA objects with num_fds=0 binder: Address corner cases in deferred copy and fixup phy: amlogic: fix error path in phy_g12a_usb3_pcie_probe() iio: imu: inv_icm42600: Fix I2C init possible nack iio: dac: ltc2688: fix voltage scale read interconnect: qcom: sdx55: Drop IP0 interconnects interconnect: qcom: sc7180: Drop IP0 interconnects phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe phy: ti: omap-usb2: Fix error handling in omap_usb2_enable_clocks bus: mhi: host: pci_generic: Flush recovery worker during freeze bus: mhi: host: pci_generic: Add missing poweroff() PM callback phy: ti: tusb1210: Fix an error handling path in tusb1210_probe() phy: samsung: exynos5250-sata: fix missing device put in probe error paths phy: samsung: Fix missing of_node_put() in exynos_sata_phy_probe phy: ti: Fix missing of_node_put in ti_pipe3_get_sysctrl() phy: ti: tusb1210: Make tusb1210_chg_det_states static iio:dac:ad3552r: Fix an IS_ERR() vs NULL check iio: sx9324: Fix default precharge internal resistance register ... commit a6b5c5dc06a4b25fc7690a7a25a7c095d3f16fa9 Merge: da1b4042bde2 19317433057d Author: Linus Torvalds Date: Sat Apr 30 10:09:14 2022 -0700 Merge tag 'tty-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial fixes from Greg KH: "Here are some small serial driver fixes, and a larger number of GSM line discipline fixes for 5.18-rc5. These include: - lots of tiny n_gsm fixes for issues to resolve a number of reported problems. Seems that people are starting to actually use this code again. - 8250 driver fixes for some devices - imx serial driver fix - amba-pl011 driver fix All of these have been in linux-next for a while with no reported issues" * tag 'tty-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (27 commits) tty: n_gsm: fix sometimes uninitialized warning in gsm_dlci_modem_output() serial: 8250: Correct the clock for EndRun PTP/1588 PCIe device serial: 8250: Also set sticky MCR bits in console restoration tty: n_gsm: fix software flow control handling tty: n_gsm: fix invalid use of MSC in advanced option tty: n_gsm: fix broken virtual tty handling Revert "serial: sc16is7xx: Clear RS485 bits in the shutdown" tty: n_gsm: fix missing update of modem controls after DLCI open serial: 8250: Fix runtime PM for start_tx() for empty buffer serial: imx: fix overrun interrupts in DMA mode serial: amba-pl011: do not time out prematurely when draining tx fifo tty: n_gsm: fix incorrect UA handling tty: n_gsm: fix reset fifo race condition tty: n_gsm: fix missing tty wakeup in convergence layer type 2 tty: n_gsm: fix wrong signal octets encoding in MSC tty: n_gsm: fix wrong command frame length field encoding tty: n_gsm: fix wrong command retry handling tty: n_gsm: fix missing explicit ldisc flush tty: n_gsm: fix wrong DLCI release order tty: n_gsm: fix insufficient txframe size ... commit da1b4042bde22f208b2d172751c8c8aadcf74acc Merge: e9512f3668b7 03e607cbb293 Author: Linus Torvalds Date: Sat Apr 30 09:58:46 2022 -0700 Merge tag 'usb-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are a number of small USB driver fixes for 5.18-rc5 for some reported issues and new quirks. They include: - dwc3 driver fixes - xhci driver fixes - typec driver fixes - new usb-serial driver ids - added new USB devices to existing quirk tables - other tiny fixes All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (31 commits) usb: phy: generic: Get the vbus supply usb: dwc3: gadget: Return proper request status usb: dwc3: pci: add support for the Intel Meteor Lake-P usb: dwc3: core: Only handle soft-reset in DCTL usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind() usb: misc: eud: Fix an error handling path in eud_probe() usb: core: Don't hold the device lock while sleeping in do_proc_control() usb: dwc3: Try usb-role-switch first in dwc3_drd_init usb: dwc3: core: Fix tx/rx threshold settings usb: mtu3: fix USB 3.0 dual-role-switch from device to host xhci: Enable runtime PM on second Alderlake controller usb: dwc3: fix backwards compat with rockchip devices dt-bindings: usb: samsung,exynos-usb2: add missing required reg usb: misc: fix improper handling of refcount in uss720_probe() USB: Fix ehci infinite suspend-resume loop issue in zhaoxin usb: typec: tcpm: Fix undefined behavior due to shift overflowing the constant usb: typec: rt1719: Fix build error without CONFIG_POWER_SUPPLY usb: typec: ucsi: Fix role swapping usb: typec: ucsi: Fix reuse of completion structure usb: xhci: tegra:Fix PM usage reference leak of tegra_xusb_unpowergate_partitions ... commit e9512f3668b7090be7a149fc38026729d96e944a Merge: 8013d1d3d2e3 8be70a842f70 Author: Linus Torvalds Date: Sat Apr 30 09:47:59 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fix from James Bottomley: "One fix for an endless error loop with the target driver affecting tapes" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: target: pscsi: Set SCF_TREAT_READ_AS_NORMAL flag only if there is valid data commit a9384a4c1d250cb40cebf50e41459426d160b08e Author: Eric Dumazet Date: Fri Apr 29 09:20:36 2022 -0700 mld: respect RCU rules in ip6_mc_source() and ip6_mc_msfilter() Whenever RCU protected list replaces an object, the pointer to the new object needs to be updated _before_ the call to kfree_rcu() or call_rcu() Also ip6_mc_msfilter() needs to update the pointer before releasing the mc_lock mutex. Note that linux-5.13 was supporting kfree_rcu(NULL, rcu), so this fix does not need the conditional test I was forced to use in the equivalent patch for IPv4. Fixes: 882ba1f73c06 ("mld: convert ipv6_mc_socklist->sflist to RCU") Signed-off-by: Eric Dumazet Cc: Taehee Yoo Signed-off-by: David S. Miller net/ipv6/mcast.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit dba5bdd57bea587ea4f0b79b03c71135f84a7e8b Author: Eric Dumazet Date: Fri Apr 29 08:42:57 2022 -0700 net: igmp: respect RCU rules in ip_mc_source() and ip_mc_msfilter() syzbot reported an UAF in ip_mc_sf_allow() [1] Whenever RCU protected list replaces an object, the pointer to the new object needs to be updated _before_ the call to kfree_rcu() or call_rcu() Because kfree_rcu(ptr, rcu) got support for NULL ptr only recently in commit 12edff045bc6 ("rcu: Make kfree_rcu() ignore NULL pointers"), I chose to use the conditional to make sure stable backports won't miss this detail. if (psl) kfree_rcu(psl, rcu); net/ipv6/mcast.c has similar issues, addressed in a separate patch. [1] BUG: KASAN: use-after-free in ip_mc_sf_allow+0x6bb/0x6d0 net/ipv4/igmp.c:2655 Read of size 4 at addr ffff88807d37b904 by task syz-executor.5/908 CPU: 0 PID: 908 Comm: syz-executor.5 Not tainted 5.18.0-rc4-syzkaller-00064-g8f4dd16603ce #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x467 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 ip_mc_sf_allow+0x6bb/0x6d0 net/ipv4/igmp.c:2655 raw_v4_input net/ipv4/raw.c:190 [inline] raw_local_deliver+0x4d1/0xbe0 net/ipv4/raw.c:218 ip_protocol_deliver_rcu+0xcf/0xb30 net/ipv4/ip_input.c:193 ip_local_deliver_finish+0x2ee/0x4c0 net/ipv4/ip_input.c:233 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip_local_deliver+0x1b3/0x200 net/ipv4/ip_input.c:254 dst_input include/net/dst.h:461 [inline] ip_rcv_finish+0x1cb/0x2f0 net/ipv4/ip_input.c:437 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip_rcv+0xaa/0xd0 net/ipv4/ip_input.c:556 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5405 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5519 netif_receive_skb_internal net/core/dev.c:5605 [inline] netif_receive_skb+0x13e/0x8e0 net/core/dev.c:5664 tun_rx_batched.isra.0+0x460/0x720 drivers/net/tun.c:1534 tun_get_user+0x28b7/0x3e30 drivers/net/tun.c:1985 tun_chr_write_iter+0xdb/0x200 drivers/net/tun.c:2015 call_write_iter include/linux/fs.h:2050 [inline] new_sync_write+0x38a/0x560 fs/read_write.c:504 vfs_write+0x7c0/0xac0 fs/read_write.c:591 ksys_write+0x127/0x250 fs/read_write.c:644 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+0x44/0xae RIP: 0033:0x7f3f12c3bbff Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 99 fd ff ff 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 cc fd ff ff 48 RSP: 002b:00007f3f13ea9130 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f3f12d9bf60 RCX: 00007f3f12c3bbff RDX: 0000000000000036 RSI: 0000000020002ac0 RDI: 00000000000000c8 RBP: 00007f3f12ce308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000036 R11: 0000000000000293 R12: 0000000000000000 R13: 00007fffb68dd79f R14: 00007f3f13ea9300 R15: 0000000000022000 Allocated by task 908: 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:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524 kasan_kmalloc include/linux/kasan.h:234 [inline] __do_kmalloc mm/slab.c:3710 [inline] __kmalloc+0x209/0x4d0 mm/slab.c:3719 kmalloc include/linux/slab.h:586 [inline] sock_kmalloc net/core/sock.c:2501 [inline] sock_kmalloc+0xb5/0x100 net/core/sock.c:2492 ip_mc_source+0xba2/0x1100 net/ipv4/igmp.c:2392 do_ip_setsockopt net/ipv4/ip_sockglue.c:1296 [inline] ip_setsockopt+0x2312/0x3ab0 net/ipv4/ip_sockglue.c:1432 raw_setsockopt+0x274/0x2c0 net/ipv4/raw.c:861 __sys_setsockopt+0x2db/0x6a0 net/socket.c:2180 __do_sys_setsockopt net/socket.c:2191 [inline] __se_sys_setsockopt net/socket.c:2188 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2188 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+0x44/0xae Freed by task 753: 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:366 [inline] ____kasan_slab_free+0x13d/0x180 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3439 [inline] kmem_cache_free_bulk+0x69/0x460 mm/slab.c:3774 kfree_bulk include/linux/slab.h:437 [inline] kfree_rcu_work+0x51c/0xa10 kernel/rcu/tree.c:3318 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:298 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3595 ip_mc_msfilter+0x712/0xb60 net/ipv4/igmp.c:2510 do_ip_setsockopt net/ipv4/ip_sockglue.c:1257 [inline] ip_setsockopt+0x32e1/0x3ab0 net/ipv4/ip_sockglue.c:1432 raw_setsockopt+0x274/0x2c0 net/ipv4/raw.c:861 __sys_setsockopt+0x2db/0x6a0 net/socket.c:2180 __do_sys_setsockopt net/socket.c:2191 [inline] __se_sys_setsockopt net/socket.c:2188 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2188 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+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 call_rcu+0x99/0x790 kernel/rcu/tree.c:3074 mpls_dev_notify+0x552/0x8a0 net/mpls/af_mpls.c:1656 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1938 call_netdevice_notifiers_extack net/core/dev.c:1976 [inline] call_netdevice_notifiers net/core/dev.c:1990 [inline] unregister_netdevice_many+0x92e/0x1890 net/core/dev.c:10751 default_device_exit_batch+0x449/0x590 net/core/dev.c:11245 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 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:298 The buggy address belongs to the object at ffff88807d37b900 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 4 bytes inside of 64-byte region [ffff88807d37b900, ffff88807d37b940) The buggy address belongs to the physical page: page:ffffea0001f4dec0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807d37b180 pfn:0x7d37b flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff888010c41340 ffffea0001c795c8 ffff888010c40200 raw: ffff88807d37b180 ffff88807d37b000 000000010000001f 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 0x342040(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 2963, tgid 2963 (udevd), ts 139732238007, free_ts 139730893262 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408 __alloc_pages_node include/linux/gfp.h:587 [inline] kmem_getpages mm/slab.c:1378 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2584 cache_alloc_refill+0x27f/0x380 mm/slab.c:2957 ____cache_alloc mm/slab.c:3040 [inline] ____cache_alloc mm/slab.c:3023 [inline] __do_cache_alloc mm/slab.c:3267 [inline] slab_alloc mm/slab.c:3309 [inline] __do_kmalloc mm/slab.c:3708 [inline] __kmalloc+0x3b3/0x4d0 mm/slab.c:3719 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:714 [inline] tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45 tomoyo_encode2 security/tomoyo/realpath.c:31 [inline] tomoyo_encode+0x28/0x50 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x186/0x620 security/tomoyo/realpath.c:288 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x140 security/security.c:1350 vfs_getattr fs/stat.c:157 [inline] vfs_statx+0x16a/0x390 fs/stat.c:232 vfs_fstatat+0x8c/0xb0 fs/stat.c:255 __do_sys_newfstatat+0x91/0x110 fs/stat.c:425 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+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1356 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423 __vunmap+0x85d/0xd30 mm/vmalloc.c:2667 __vfree+0x3c/0xd0 mm/vmalloc.c:2715 vfree+0x5a/0x90 mm/vmalloc.c:2746 __do_replace+0x16b/0x890 net/ipv6/netfilter/ip6_tables.c:1117 do_replace net/ipv6/netfilter/ip6_tables.c:1157 [inline] do_ip6t_set_ctl+0x90d/0xb90 net/ipv6/netfilter/ip6_tables.c:1639 nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x122/0x180 net/ipv6/ipv6_sockglue.c:1026 tcp_setsockopt+0x136/0x2520 net/ipv4/tcp.c:3696 __sys_setsockopt+0x2db/0x6a0 net/socket.c:2180 __do_sys_setsockopt net/socket.c:2191 [inline] __se_sys_setsockopt net/socket.c:2188 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2188 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+0x44/0xae Memory state around the buggy address: ffff88807d37b800: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff88807d37b880: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc >ffff88807d37b900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88807d37b980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88807d37ba00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc Fixes: c85bb41e9318 ("igmp: fix ip_mc_sf_allow race [v5]") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Flavio Leitner Signed-off-by: David S. Miller net/ipv4/igmp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 39cb9faa5d46d0d0694f4b594ef905f517600c8e Author: David Howells Date: Fri Apr 29 21:05:16 2022 +0100 rxrpc: Enable IPv6 checksums on transport socket AF_RXRPC doesn't currently enable IPv6 UDP Tx checksums on the transport socket it opens and the checksums in the packets it generates end up 0. It probably should also enable IPv6 UDP Rx checksums and IPv4 UDP checksums. The latter only seem to be applied if the socket family is AF_INET and don't seem to apply if it's AF_INET6. IPv4 packets from an IPv6 socket seem to have checksums anyway. What seems to have happened is that the inet_inv_convert_csum() call didn't get converted to the appropriate udp_port_cfg parameters - and udp_sock_create() disables checksums unless explicitly told not too. Fix this by enabling the three udp_port_cfg checksum options. Fixes: 1a9b86c9fd95 ("rxrpc: use udp tunnel APIs instead of open code in rxrpc_open_socket") Reported-by: Marc Dionne Signed-off-by: David Howells Reviewed-by: Xin Long Reviewed-by: Marc Dionne cc: Vadim Fedorenko cc: David S. Miller cc: linux-afs@lists.infradead.org Signed-off-by: David S. Miller net/rxrpc/local_object.c | 3 +++ 1 file changed, 3 insertions(+) commit 95098d5ac2551769807031444e55a0da5d4f0952 Author: Yang Yingliang Date: Fri Apr 29 09:53:37 2022 +0800 net: cpsw: add missing of_node_put() in cpsw_probe_dt() 'tmp_node' need be put before returning from cpsw_probe_dt(), so add missing of_node_put() in error path. Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller drivers/net/ethernet/ti/cpsw_new.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 1a15267b7be77e0792cf0c7b36ca65c8eb2df0d8 Author: Yang Yingliang Date: Thu Apr 28 17:57:16 2022 +0800 net: stmmac: dwmac-sun8i: add missing of_node_put() in sun8i_dwmac_register_mdio_mux() The node pointer returned by of_get_child_by_name() with refcount incremented, so add of_node_put() after using it. Fixes: 634db83b8265 ("net: stmmac: dwmac-sun8i: Handle integrated/external MDIOs") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220428095716.540452-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 1 + 1 file changed, 1 insertion(+) commit a9e9b091a1c14ecd8bd9d3214a62142a1786fe30 Author: Yang Yingliang Date: Thu Apr 28 17:53:17 2022 +0800 net: dsa: mt7530: add missing of_node_put() in mt7530_setup() Add of_node_put() if of_get_phy_mode() fails in mt7530_setup() Fixes: 0c65b2b90d13 ("net: of_get_phy_mode: Change API to solve int/unit warnings") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220428095317.538829-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski drivers/net/dsa/mt7530.c | 1 + 1 file changed, 1 insertion(+) commit fee34dd199384a483f84806a5cbcf8d657a481cc Author: Arun Ramadoss Date: Thu Apr 28 12:37:09 2022 +0530 net: dsa: ksz9477: port mirror sniffing limited to one port This patch limits the sniffing to only one port during the mirror add. And during the mirror_del it checks for all the ports using the sniff, if and only if no other ports are referring, sniffing is disabled. The code is updated based on the review comments of LAN937x port mirror patch. Link: https://patchwork.kernel.org/project/netdevbpf/patch/20210422094257.1641396-8-prasanna.vengateshan@microchip.com/ Fixes: b987e98e50ab ("dsa: add DSA switch driver for Microchip KSZ9477") Signed-off-by: Prasanna Vengateshan Signed-off-by: Arun Ramadoss Link: https://lore.kernel.org/r/20220428070709.7094-1-arun.ramadoss@microchip.com Signed-off-by: Jakub Kicinski drivers/net/dsa/microchip/ksz9477.c | 38 +++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) commit 52b2abef450a78e25d485ac61e32f4ce86a87701 Author: Qiao Ma Date: Thu Apr 28 20:30:16 2022 +0800 hinic: fix bug of wq out of bound access If wq has only one page, we need to check wqe rolling over page by compare end_idx and curr_idx, and then copy wqe to shadow wqe to avoid out of bound access. This work has been done in hinic_get_wqe, but missed for hinic_read_wqe. This patch fixes it, and removes unnecessary MASKED_WQE_IDX(). Fixes: 7dd29ee12865 ("hinic: add sriov feature support") Signed-off-by: Qiao Ma Reviewed-by: Xunlei Pang Link: https://lore.kernel.org/r/282817b0e1ae2e28fdf3ed8271a04e77f57bf42e.1651148587.git.mqaio@linux.alibaba.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/huawei/hinic/hinic_hw_wq.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit e87f66b38e66dffdec9daa9f8f0eb044e9a62e3b Author: Niels Dossche Date: Thu Apr 28 23:19:32 2022 +0200 net: mdio: Fix ENOMEM return value in BCM6368 mux bus controller Error values inside the probe function must be < 0. The ENOMEM return value has the wrong sign: it is positive instead of negative. Add a minus sign. Fixes: e239756717b5 ("net: mdio: Add BCM6368 MDIO mux bus controller") Signed-off-by: Niels Dossche Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220428211931.8130-1-dossche.niels@gmail.com Signed-off-by: Jakub Kicinski drivers/net/mdio/mdio-mux-bcm6368.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ff5265d45345d01fefc98fcb9ae891b59633c919 Author: Yang Yingliang Date: Thu Apr 28 14:25:43 2022 +0800 net: ethernet: mediatek: add missing of_node_put() in mtk_sgmii_init() The node pointer returned by of_parse_phandle() with refcount incremented, so add of_node_put() after using it in mtk_sgmii_init(). Fixes: 9ffee4a8276c ("net: ethernet: mediatek: Extend SGMII related functions") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220428062543.64883-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/mediatek/mtk_sgmii.c | 1 + 1 file changed, 1 insertion(+) commit 1e4e6904bb773a4ac5f082f76eb1a12c7a051970 Merge: 4f159a7c4d1b f62c5acc800e Author: Jakub Kicinski Date: Fri Apr 29 17:51:37 2022 -0700 Merge branch 'selftests-net-add-missing-tests-to-makefile' Hangbin Liu says: ==================== selftests: net: add missing tests to Makefile When generating the selftests to another folder, the fixed tests are missing as they are not in Makefile. The missing tests are generated by command: $ for f in $(ls *.sh); do grep -q $f Makefile || echo $f; done ==================== Link: https://lore.kernel.org/r/20220428044511.227416-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski commit f62c5acc800eebfe25bf6738b2cc8aa5d6aa7598 Author: Hangbin Liu Date: Thu Apr 28 12:45:11 2022 +0800 selftests/net/forwarding: add missing tests to Makefile When generating the selftests to another folder, the fixed tests are missing as they are not in Makefile, e.g. make -C tools/testing/selftests/ install \ TARGETS="net/forwarding" INSTALL_PATH=/tmp/kselftests Signed-off-by: Hangbin Liu Signed-off-by: Jakub Kicinski tools/testing/selftests/net/forwarding/Makefile | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) commit 38dcd9570d6fced1dcfee226d5b29722b070ce90 Author: Hangbin Liu Date: Thu Apr 28 12:45:10 2022 +0800 selftests/net: add missing tests to Makefile When generating the selftests to another folder, the fixed tests are missing as they are not in Makefile, e.g. make -C tools/testing/selftests/ install \ TARGETS="net" INSTALL_PATH=/tmp/kselftests Signed-off-by: Hangbin Liu Signed-off-by: Jakub Kicinski tools/testing/selftests/net/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a3d0562d4dc039bca39445e1cddde7951662e17d Author: Trond Myklebust Date: Fri Apr 29 12:27:30 2022 -0400 Revert "SUNRPC: attempt AF_LOCAL connect on setup" This reverts commit 7073ea8799a8cf73db60270986f14e4aae20fa80. We must not try to connect the socket while the transport is under construction, because the mechanisms to safely tear it down are not in place. As the code stands, we end up leaking the sockets on a connection error. Reported-by: wanghai (M) Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust net/sunrpc/xprtsock.c | 3 --- 1 file changed, 3 deletions(-) commit 8013d1d3d2e33236dee13a133fba49ad55045e79 Merge: c0e6265e6c2d adee8aa22a92 Author: Linus Torvalds Date: Fri Apr 29 15:51:05 2022 -0700 Merge tag 'soc-fixes-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: - A fix for a regression caused by the previous set of bugfixes changing tegra and at91 pinctrl properties. More work is needed to figure out what this should actually be, but a revert makes it work for the moment. - Defconfig regression fixes for tegra after renamed symbols - Build-time warning and static checker fixes for imx, op-tee, sunxi, meson, at91, and omap - More at91 DT fixes for audio, regulator and spi nodes - A regression fix for Renesas Hyperflash memory probe - A stability fix for amlogic boards, modifying the allowed cpufreq states - Multiple fixes for system suspend on omap2+ - DT fixes for various i.MX bugs - A probe error fix for imx6ull-colibri MMC - A MAINTAINERS file entry for samsung bug reports * tag 'soc-fixes-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (42 commits) Revert "arm: dts: at91: Fix boolean properties with values" bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create() Revert "arm64: dts: tegra: Fix boolean properties with values" arm64: dts: imx8mn-ddr4-evk: Describe the 32.768 kHz PMIC clock ARM: dts: imx6ull-colibri: fix vqmmc regulator MAINTAINERS: add Bug entry for Samsung and memory controller drivers memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual Mode ARM: dts: logicpd-som-lv: Fix wrong pinmuxing on OMAP35 ARM: dts: am3517-evm: Fix misc pinmuxing ARM: dts: am33xx-l4: Add missing touchscreen clock properties ARM: dts: Fix mmc order for omap3-gta04 ARM: dts: at91: fix pinctrl phandles ARM: dts: at91: sama5d4_xplained: fix pinctrl phandle name ARM: dts: at91: Describe regulators on at91sam9g20ek ARM: dts: at91: Map MCLK for wm8731 on at91sam9g20ek ARM: dts: at91: Fix boolean properties with values ARM: dts: at91: use generic node name for dataflash ARM: dts: at91: align SPI NOR node name with dtschema ARM: dts: at91: sama7g5ek: Align the impedance of the QSPI0's HSIO and PCB lines ARM: dts: at91: sama7g5ek: enable pull-up on flexcom3 console lines ... commit c0e6265e6c2dd3f1bc37d929194c97079f7ffd3f Merge: bd3d3adea90e a91b05f6b928 Author: Linus Torvalds Date: Fri Apr 29 15:38:23 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: "A semi-large pile of clk driver fixes this time around. Nothing is touching the core so these fixes are fairly well contained to specific devices that use these clk drivers. - Some Allwinner SoC fixes to gracefully handle errors and mark an RTC clk as critical so that the RTC keeps ticking. - Fix AXI bus clks and RTC clk design for Microchip PolarFire SoC driver introduced this cycle. This has some devicetree bits acked by riscv maintainers. We're fixing it now so that the prior bindings aren't released in a major kernel version. - Remove a reset on Microchip PolarFire SoCs that broke when enabling CONFIG_PM. - Set a min/max for the Qualcomm graphics clk. This got broken by the clk rate range patches introduced this cycle" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: sunxi: sun9i-mmc: check return value after calling platform_get_resource() clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical riscv: dts: microchip: reparent mpfs clocks clk: microchip: mpfs: add RTCREF clock control clk: microchip: mpfs: re-parent the configurable clocks dt-bindings: rtc: add refclk to mpfs-rtc dt-bindings: clk: mpfs: add defines for two new clocks dt-bindings: clk: mpfs document msspll dri registers riscv: dts: microchip: fix usage of fic clocks on mpfs clk: microchip: mpfs: mark CLK_ATHENA as critical clk: microchip: mpfs: fix parents for FIC clocks clk: qcom: clk-rcg2: fix gfx3d frequency calculation clk: microchip: mpfs: don't reset disabled peripherals clk: sunxi-ng: fix not NULL terminated coccicheck error commit bd3d3adea90e2d4b82efc29eb6f10ee4d9f55e6d Merge: 63b7b3ea9442 09df6a75fffa Author: Linus Torvalds Date: Fri Apr 29 15:28:42 2022 -0700 Merge tag 'block-5.18-2022-04-29' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - Revert of a patch that caused timestamp issues (Tejun) - iocost warning fix (Tejun) - bfq warning fix (Jan) * tag 'block-5.18-2022-04-29' of git://git.kernel.dk/linux-block: bfq: Fix warning in bfqq_request_over_limit() Revert "block: inherit request start time from bio for BLK_CGROUP" iocost: don't reset the inuse weight of under-weighted debtors commit 63b7b3ea9442f1342299ddc58f7366e7ecd7e29f Merge: bdda8303f764 303cc749c865 Author: Linus Torvalds Date: Fri Apr 29 14:51:57 2022 -0700 Merge tag 'io_uring-5.18-2022-04-29' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Pretty boring: - three patches just adding reserved field checks (me, Eugene) - Fixing a potential regression with IOPOLL caused by a block change (Joseph)" Boring is good. * tag 'io_uring-5.18-2022-04-29' of git://git.kernel.dk/linux-block: io_uring: check that data field is 0 in ringfd unregister io_uring: fix uninitialized field in rw io_kiocb io_uring: check reserved fields for recv/recvmsg io_uring: check reserved fields for send/sendmsg commit bdda8303f764d844e7b2fb69e5fd21c650c60943 Merge: bd383b8e32f6 5a7e470e460f Author: Linus Torvalds Date: Fri Apr 29 14:47:17 2022 -0700 Merge tag 'random-5.18-rc5-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator fixes from Jason Donenfeld: - Eric noticed that the memmove() in crng_fast_key_erasure() was bogus, so this has been changed to a memcpy() and the confusing situation clarified with a detailed comment. - [Half]SipHash documentation updates from Bagas and Eric, after Eric pointed out that the use of HalfSipHash in random.c made a bit of the text potentially misleading. * tag 'random-5.18-rc5-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: Documentation: siphash: disambiguate HalfSipHash algorithm from hsiphash functions Documentation: siphash: enclose HalfSipHash usage example in the literal block Documentation: siphash: convert danger note to warning for HalfSipHash random: document crng_fast_key_erasure() destination possibility commit bd383b8e32f6aab08c9485b1fe86e2e932b1df69 Merge: 3e71713c9e75 7acae6183cf3 Author: Linus Torvalds Date: Fri Apr 29 14:37:35 2022 -0700 Merge tag 'ceph-for-5.18-rc5' of https://github.com/ceph/ceph-client Pull ceph client fixes from Ilya Dryomov: "A fix for a NULL dereference that turns out to be easily triggerable by fsync (marked for stable) and a false positive WARN and snap_rwsem locking fixups" * tag 'ceph-for-5.18-rc5' of https://github.com/ceph/ceph-client: ceph: fix possible NULL pointer dereference for req->r_session ceph: remove incorrect session state check ceph: get snap_rwsem read lock in handle_cap_export for ceph_add_cap libceph: disambiguate cluster/pool full log message commit adee8aa22a9298148b3f86a83a7940e7a3329ad9 Author: Arnd Bergmann Date: Fri Apr 29 23:09:49 2022 +0200 Revert "arm: dts: at91: Fix boolean properties with values" This reverts commit 0dc23d1a8e17, which caused another regression as the pinctrl code actually expects an integer value of 0 or 1 rather than a simple boolean property. Signed-off-by: Arnd Bergmann arch/arm/boot/dts/at91-kizbox3-hs.dts | 2 +- arch/arm/boot/dts/at91-kizbox3_common.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 4f159a7c4d1be4d160270ea2800d44d9ebe157e1 Merge: 249aca0d3d63 2873d4d52f7c Author: Jakub Kicinski Date: Fri Apr 29 12:33:54 2022 -0700 Merge tag 'linux-can-fixes-for-5.18-20220429' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-04-29 The first patch is by Oliver Hartkopp and removes the ability to re-binding bounds sockets from the ISOTP. It turned out to be not needed and brings unnecessary complexity. The last 4 patches all target the grcan driver. Duoming Zhou's patch fixes a potential dead lock in the grcan_close() function. Daniel Hellstrom's patch fixes the dma_alloc_coherent() to use the correct device. Andreas Larsson's 1st patch fixes a broken system id check, the 2nd patch fixes the NAPI poll budget usage. * tag 'linux-can-fixes-for-5.18-20220429' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: grcan: only use the NAPI poll budget for RX can: grcan: grcan_probe(): fix broken system id check for errata workaround needs can: grcan: use ofdev->dev when allocating DMA memory can: grcan: grcan_close(): fix deadlock can: isotp: remove re-binding of bound socket ==================== Link: https://lore.kernel.org/r/20220429125612.1792561-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit f751d8eac17692905cdd6935f72d523d8adf3b65 Author: Paolo Bonzini Date: Fri Apr 29 14:43:04 2022 -0400 KVM: x86: work around QEMU issue with synthetic CPUID leaves Synthesizing AMD leaves up to 0x80000021 caused problems with QEMU, which assumes the *host* CPUID[0x80000000].EAX is higher or equal to what KVM_GET_SUPPORTED_CPUID reports. This causes QEMU to issue bogus host CPUIDs when preparing the input to KVM_SET_CPUID2. It can even get into an infinite loop, which is only terminated by an abort(): cpuid_data is full, no space for cpuid(eax:0x8000001d,ecx:0x3e) To work around this, only synthesize those leaves if 0x8000001d exists on the host. The synthetic 0x80000021 leaf is mostly useful on Zen2, which satisfies the condition. Fixes: f144c49e8c39 ("KVM: x86: synthesize CPUID leaf 0x80000021h if useful") Reported-by: Maxim Levitsky Signed-off-by: Paolo Bonzini arch/x86/kvm/cpuid.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) commit 3e71713c9e75c34fc03f55ea86b381856ca952ee Merge: 2d0de93ca251 a5d20d42a2f2 Author: Linus Torvalds Date: Fri Apr 29 11:34:07 2022 -0700 Merge tag 'perf-tools-fixes-for-v5.18-2022-04-29' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix Intel PT (Processor Trace) timeless decoding with perf.data directory. - ARM SPE (Statistical Profiling Extensions) address fixes, for synthesized events and for SPE events with physical addresses. Add a simple 'perf test' entry to make sure this doesn't regress. - Remove arch specific processing of kallsyms data to fixup symbol end address, fixing excessive memory consumption in the annotation code. * tag 'perf-tools-fixes-for-v5.18-2022-04-29' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf symbol: Remove arch__symbols__fixup_end() perf symbol: Update symbols__fixup_end() perf symbol: Pass is_kallsyms to symbols__fixup_end() perf test: Add perf_event_attr test for Arm SPE perf arm-spe: Fix SPE events with phys addresses perf arm-spe: Fix addresses of synthesized SPE events perf intel-pt: Fix timeless decoding with perf.data directory commit 2bfed7d2ffa5d86c462d3e2067f2832eaf8c04c7 Author: Jann Horn Date: Sat Mar 19 02:00:11 2022 +0100 selftests/seccomp: Don't call read() on TTY from background pgrp Since commit 92d25637a3a4 ("kselftest: signal all child processes"), tests are executed in background process groups. This means that trying to read from stdin now throws SIGTTIN when stdin is a TTY, which breaks some seccomp selftests that try to use read(0, NULL, 0) as a dummy syscall. The simplest way to fix that is probably to just use -1 instead of 0 as the dummy read()'s FD. Fixes: 92d25637a3a4 ("kselftest: signal all child processes") Signed-off-by: Jann Horn Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220319010011.1374622-1-jannh@google.com tools/testing/selftests/seccomp/seccomp_bpf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 2d0de93ca2515958e717138e5ee07ec3b6bf0226 Merge: 66c2112b74c2 ac0280a9ca10 Author: Linus Torvalds Date: Fri Apr 29 10:44:58 2022 -0700 Merge tag 'riscv-for-linus-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A fix to properly ensure a single CPU is running during patch_text(). - A defconfig update to include RPMSG_CTRL when RPMSG_CHAR was set, necessary after a recent refactoring. * tag 'riscv-for-linus-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: configs: Configs that had RPMSG_CHAR now get RPMSG_CTRL riscv: patch_text: Fixup last cpu should be master commit 66c2112b74c2b94ee5191bfb8acb717b79377e98 Merge: 38d741cb70b3 c35fe2a68f29 Author: Linus Torvalds Date: Fri Apr 29 10:36:47 2022 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fix from Will Deacon: "Rename and reallocate the PT_ARM_MEMTAG_MTE ELF segment type. This is a fix to the MTE ELF ABI for a bug that was added during the most recent merge window as part of the coredump support. The issue is that the value assigned to the new PT_ARM_MEMTAG_MTE segment type has already been allocated to PT_AARCH64_UNWIND by the ELF ABI, so we've bumped the value and changed the name of the identifier to be better aligned with the existing one" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: elf: Fix the arm64 MTE ELF segment name and value commit 643d95aac59a060c2730975988aedc387f0f9f44 Author: Sean Christopherson Date: Fri Apr 29 07:57:53 2022 -0700 Revert "x86/mm: Introduce lookup_address_in_mm()" Drop lookup_address_in_mm() now that KVM is providing it's own variant of lookup_address_in_pgd() that is safe for use with user addresses, e.g. guards against page tables being torn down. A variant that provides a non-init mm is inherently dangerous and flawed, as the only reason to use an mm other than init_mm is to walk a userspace mapping, and lookup_address_in_pgd() does not play nice with userspace mappings, e.g. doesn't disable IRQs to block TLB shootdowns and doesn't use READ_ONCE() to ensure an upper level entry isn't converted to a huge page between checking the PAGE_SIZE bit and grabbing the address of the next level down. This reverts commit 13c72c060f1ba6f4eddd7b1c4f52a8aded43d6d9. Signed-off-by: Sean Christopherson Message-Id: Signed-off-by: Paolo Bonzini arch/x86/include/asm/pgtable_types.h | 4 ---- arch/x86/mm/pat/set_memory.c | 11 ----------- 2 files changed, 15 deletions(-) commit 73331c5d84cf87974dc3616ef706847ff187d590 Merge: 484c22df5aa0 44187235cbcc Author: Paolo Bonzini Date: Fri Apr 29 06:38:56 2022 -0400 Merge branch 'kvm-fixes-for-5.18-rc5' into HEAD Fixes for (relatively) old bugs, to be merged in both the -rc and next development trees: * Fix potential races when walking host page table * Fix bad user ABI for KVM_EXIT_SYSTEM_EVENT * Fix shadow page table leak when KVM runs nested commit 44187235cbcc7c1129ea7c004bc12f8757d29415 Author: Mingwei Zhang Date: Fri Apr 29 03:17:57 2022 +0000 KVM: x86/mmu: fix potential races when walking host page table KVM uses lookup_address_in_mm() to detect the hugepage size that the host uses to map a pfn. The function suffers from several issues: - no usage of READ_ONCE(*). This allows multiple dereference of the same page table entry. The TOCTOU problem because of that may cause KVM to incorrectly treat a newly generated leaf entry as a nonleaf one, and dereference the content by using its pfn value. - the information returned does not match what KVM needs; for non-present entries it returns the level at which the walk was terminated, as long as the entry is not 'none'. KVM needs level information of only 'present' entries, otherwise it may regard a non-present PXE entry as a present large page mapping. - the function is not safe for mappings that can be torn down, because it does not disable IRQs and because it returns a PTE pointer which is never safe to dereference after the function returns. So implement the logic for walking host page tables directly in KVM, and stop using lookup_address_in_mm(). Cc: Sean Christopherson Cc: Paolo Bonzini Signed-off-by: Mingwei Zhang Message-Id: <20220429031757.2042406-1-mizhang@google.com> [Inline in host_pfn_mapping_level, ensure no semantic change for its callers. - Paolo] Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) commit d495f942f40aa412f8d4d65951152648cfa09903 Author: Paolo Bonzini Date: Fri Apr 22 12:30:13 2022 +0200 KVM: fix bad user ABI for KVM_EXIT_SYSTEM_EVENT When KVM_EXIT_SYSTEM_EVENT was introduced, it included a flags member that at the time was unused. Unfortunately this extensibility mechanism has several issues: - x86 is not writing the member, so it would not be possible to use it on x86 except for new events - the member is not aligned to 64 bits, so the definition of the uAPI struct is incorrect for 32- on 64-bit userspace. This is a problem for RISC-V, which supports CONFIG_KVM_COMPAT, but fortunately usage of flags was only introduced in 5.18. Since padding has to be introduced, place a new field in there that tells if the flags field is valid. To allow further extensibility, in fact, change flags to an array of 16 values, and store how many of the values are valid. The availability of the new ndata field is tied to a system capability; all architectures are changed to fill in the field. To avoid breaking compilation of userspace that was using the flags field, provide a userspace-only union to overlap flags with data[0]. The new field is placed at the same offset for both 32- and 64-bit userspace. Cc: Will Deacon Cc: Marc Zyngier Cc: Peter Gonda Cc: Sean Christopherson Signed-off-by: Paolo Bonzini Reported-by: kernel test robot Message-Id: <20220422103013.34832-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/api.rst | 24 +++++++++++++++++------- arch/arm64/kvm/psci.c | 3 ++- arch/riscv/kvm/vcpu_sbi.c | 5 +++-- arch/x86/kvm/x86.c | 2 ++ include/uapi/linux/kvm.h | 10 +++++++++- virt/kvm/kvm_main.c | 1 + 6 files changed, 34 insertions(+), 11 deletions(-) commit 86931ff7207bc045fa5439ef97b31859613dc303 Author: Sean Christopherson Date: Thu Apr 28 23:34:16 2022 +0000 KVM: x86/mmu: Do not create SPTEs for GFNs that exceed host.MAXPHYADDR Disallow memslots and MMIO SPTEs whose gpa range would exceed the host's MAXPHYADDR, i.e. don't create SPTEs for gfns that exceed host.MAXPHYADDR. The TDP MMU bounds its zapping based on host.MAXPHYADDR, and so if the guest, possibly with help from userspace, manages to coerce KVM into creating a SPTE for an "impossible" gfn, KVM will leak the associated shadow pages (page tables): WARNING: CPU: 10 PID: 1122 at arch/x86/kvm/mmu/tdp_mmu.c:57 kvm_mmu_uninit_tdp_mmu+0x4b/0x60 [kvm] Modules linked in: kvm_intel kvm irqbypass CPU: 10 PID: 1122 Comm: set_memory_regi Tainted: G W 5.18.0-rc1+ #293 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:kvm_mmu_uninit_tdp_mmu+0x4b/0x60 [kvm] Call Trace: kvm_arch_destroy_vm+0x130/0x1b0 [kvm] kvm_destroy_vm+0x162/0x2d0 [kvm] kvm_vm_release+0x1d/0x30 [kvm] __fput+0x82/0x240 task_work_run+0x5b/0x90 exit_to_user_mode_prepare+0xd2/0xe0 syscall_exit_to_user_mode+0x1d/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xae On bare metal, encountering an impossible gpa in the page fault path is well and truly impossible, barring CPU bugs, as the CPU will signal #PF during the gva=>gpa translation (or a similar failure when stuffing a physical address into e.g. the VMCS/VMCB). But if KVM is running as a VM itself, the MAXPHYADDR enumerated to KVM may not be the actual MAXPHYADDR of the underlying hardware, in which case the hardware will not fault on the illegal-from-KVM's-perspective gpa. Alternatively, KVM could continue allowing the dodgy behavior and simply zap the max possible range. But, for hosts with MAXPHYADDR < 52, that's a (minor) waste of cycles, and more importantly, KVM can't reasonably support impossible memslots when running on bare metal (or with an accurate MAXPHYADDR as a VM). Note, limiting the overhead by checking if KVM is running as a guest is not a safe option as the host isn't required to announce itself to the guest in any way, e.g. doesn't need to set the HYPERVISOR CPUID bit. A second alternative to disallowing the memslot behavior would be to disallow creating a VM with guest.MAXPHYADDR > host.MAXPHYADDR. That restriction is undesirable as there are legitimate use cases for doing so, e.g. using the highest host.MAXPHYADDR out of a pool of heterogeneous systems so that VMs can be migrated between hosts with different MAXPHYADDRs without running afoul of the allow_smaller_maxphyaddr mess. Note that any guest.MAXPHYADDR is valid with shadow paging, and it is even useful in order to test KVM with MAXPHYADDR=52 (i.e. without any reserved physical address bits). The now common kvm_mmu_max_gfn() is inclusive instead of exclusive. The memslot and TDP MMU code want an exclusive value, but the name implies the returned value is inclusive, and the MMIO path needs an inclusive check. Fixes: faaf05b00aec ("kvm: x86/mmu: Support zapping SPTEs in the TDP MMU") Fixes: 524a1e4e381f ("KVM: x86/mmu: Don't leak non-leaf SPTEs when zapping all SPTEs") Cc: stable@vger.kernel.org Cc: Maxim Levitsky Cc: Ben Gardon Cc: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20220428233416.2446833-1-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu.h | 24 ++++++++++++++++++++++++ arch/x86/kvm/mmu/mmu.c | 10 ++++++++-- arch/x86/kvm/mmu/spte.h | 6 ------ arch/x86/kvm/mmu/tdp_mmu.c | 15 ++++++++------- arch/x86/kvm/x86.c | 6 +++++- 5 files changed, 45 insertions(+), 16 deletions(-) commit 484c22df5aa0548604e67f7cdc73e1bd736cbecc Merge: e852be8b148e 85ea6b1ec915 Author: Paolo Bonzini Date: Fri Apr 29 12:32:14 2022 -0400 Merge tag 'kvmarm-fixes-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 5.18, take #2 - Take care of faults occuring between the PARange and IPA range by injecting an exception - Fix S2 faults taken from a host EL0 in protected mode - Work around Oops caused by a PMU access from a 32bit guest when PMU has been created. This is a temporary bodge until we fix it for good. commit 892de36fd4a98fab3298d417c051d9099af5448d Author: Trond Myklebust Date: Fri Apr 29 12:22:10 2022 -0400 SUNRPC: Ensure gss-proxy connects on setup For reasons best known to the author, gss-proxy does not implement a NULL procedure, and returns RPC_PROC_UNAVAIL. However we still want to ensure that we connect to the service at setup time. So add a quirk-flag specially for this case. Fixes: 1d658336b05f ("SUNRPC: Add RPC based upcall mechanism for RPCGSS auth") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust include/linux/sunrpc/clnt.h | 1 + net/sunrpc/auth_gss/gss_rpc_upcall.c | 2 +- net/sunrpc/clnt.c | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) commit 9cc3aac42566a0021e0ab7c4e9b31667ad75b1e3 Author: Corey Minyard Date: Thu Apr 21 06:49:43 2022 -0500 ipmi:ipmi_ipmb: Fix null-ptr-deref in ipmi_unregister_smi() KASAN report null-ptr-deref as follows: KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:ipmi_unregister_smi+0x7d/0xd50 drivers/char/ipmi/ipmi_msghandler.c:3680 Call Trace: ipmi_ipmb_remove+0x138/0x1a0 drivers/char/ipmi/ipmi_ipmb.c:443 ipmi_ipmb_probe+0x409/0xda1 drivers/char/ipmi/ipmi_ipmb.c:548 i2c_device_probe+0x959/0xac0 drivers/i2c/i2c-core-base.c:563 really_probe+0x3f3/0xa70 drivers/base/dd.c:541 In ipmi_ipmb_probe(), 'iidev->intf' is not set before ipmi_register_smi() success. And in the error handling case, ipmi_ipmb_remove() is called to release resources, ipmi_unregister_smi() is called without check 'iidev->intf', this will cause KASAN null-ptr-deref issue. General kernel style is to allow NULL to be passed into unregister calls, so fix it that way. This allows a NULL check to be removed in other code. Fixes: 57c9e3c9a374 ("ipmi:ipmi_ipmb: Unregister the SMI on remove") Reported-by: Hulk Robot Cc: stable@vger.kernel.org # v5.17+ Cc: Wei Yongjun Signed-off-by: Corey Minyard drivers/char/ipmi/ipmi_msghandler.c | 5 ++++- drivers/char/ipmi/ipmi_si_intf.c | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) commit 3d092ef09303e615707dc5755cf0e29b4df7555f Author: Corey Minyard Date: Tue Apr 19 12:08:09 2022 -0500 ipmi: When handling send message responses, don't process the message A chunk was dropped when the code handling send messages was rewritten. Those messages shouldn't be processed normally, they are just an indication that the message was successfully sent and the timers should be started for the real response that should be coming later. Add back in the missing chunk to just discard the message and go on. Fixes: 059747c245f0 ("ipmi: Add support for IPMB direct messages") Reported-by: Joe Wiese Cc: stable@vger.kernel.org # v5.16+ Signed-off-by: Corey Minyard Tested-by: Joe Wiese drivers/char/ipmi/ipmi_msghandler.c | 2 ++ 1 file changed, 2 insertions(+) commit c6fe81191bd74f7e6ae9ce96a4837df9485f3ab8 Author: Nick Kossifidis Date: Tue Mar 22 15:28:39 2022 +0200 RISC-V: relocate DTB if it's outside memory region In case the DTB provided by the bootloader/BootROM is before the kernel image or outside /memory, we won't be able to access it through the linear mapping, and get a segfault on setup_arch(). Currently OpenSBI relocates DTB but that's not always the case (e.g. if FW_JUMP_FDT_ADDR is not specified), and it's also not the most portable approach since the default FW_JUMP_FDT_ADDR of the generic platform relocates the DTB at a specific offset that may not be available. To avoid this situation copy DTB so that it's visible through the linear mapping. Signed-off-by: Nick Kossifidis Link: https://lore.kernel.org/r/20220322132839.3653682-1-mick@ics.forth.gr Tested-by: Conor Dooley Fixes: f105aa940e78 ("riscv: add BUILTIN_DTB support for MMU-enabled targets") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt arch/riscv/mm/init.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) commit 310b663753b2cf928ff19f07b9f8af7579d1a0a4 Merge: 73c7bcdcfddc 39ad93d28050 Author: Arnd Bergmann Date: Fri Apr 29 16:41:21 2022 +0200 Merge tag 'tegra-for-5.18-arm-defconfig-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/fixes ARM: tegra: Default configuration fixes for v5.18 This contains two updates to the default configuration needed because of a Kconfig symbol name change. This fixes a failure that was detected in the NVIDIA automated test farm. * tag 'tegra-for-5.18-arm-defconfig-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: config: multi v7: Enable NVIDIA Tegra video decoder driver ARM: tegra_defconfig: Update CONFIG_TEGRA_VDE option Link: https://lore.kernel.org/r/20220429080626.494150-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 303cc749c8659d5f1ccf97973591313ec0bdacd3 Author: Eugene Syromiatnikov Date: Fri Apr 29 16:22:18 2022 +0200 io_uring: check that data field is 0 in ringfd unregister Only allow data field to be 0 in struct io_uring_rsrc_update user arguments to allow for future possible usage. Fixes: e7a6c00dc77a ("io_uring: add support for registering ring file descriptors") Signed-off-by: Eugene Syromiatnikov Link: https://lore.kernel.org/r/20220429142218.GA28696@asgard.redhat.com Signed-off-by: Jens Axboe fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 73c7bcdcfddc8bb20b99e7f13f61f2d07e5b232c Merge: c755ad9810e7 0310b5aa0656 Author: Arnd Bergmann Date: Fri Apr 29 16:23:30 2022 +0200 Merge tag 'imx-fixes-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.18, 2nd round: - Fix one sparse warning on imx-weim driver. - Fix vqmmc regulator to get UHS-I mode work on imx6ull-colibri board. - Add missing 32.768 kHz PMIC clock for imx8mn-ddr4-evk board to fix bd718xx-clk probe error. * tag 'imx-fixes-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: imx8mn-ddr4-evk: Describe the 32.768 kHz PMIC clock ARM: dts: imx6ull-colibri: fix vqmmc regulator bus: imx-weim: make symbol 'weim_of_notifier' static Link: https://lore.kernel.org/r/20220426013427.GB14615@dragon Signed-off-by: Arnd Bergmann commit c755ad9810e7cb59d9363ddba9f3efd36369669b Merge: 2f477ee3ed92 fff8c10368e6 Author: Arnd Bergmann Date: Fri Apr 29 16:23:00 2022 +0200 Merge tag 'sunxi-fixes-for-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes Fix return value in RSB bus driver * tag 'sunxi-fixes-for-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create() Link: https://lore.kernel.org/r/Ymbkd+/dDmRJz66w@kista.localdomain Signed-off-by: Arnd Bergmann commit f0a6c68f69981214cb7858738dd2bc81475111f7 Author: Maciej W. Rozycki Date: Sun Apr 24 12:46:23 2022 +0100 MIPS: Fix CP0 counter erratum detection for R4k CPUs Fix the discrepancy between the two places we check for the CP0 counter erratum in along with the incorrect comparison of the R4400 revision number against 0x30 which matches none and consistently consider all R4000 and R4400 processors affected, as documented in processor errata publications[1][2][3], following the mapping between CP0 PRId register values and processor models: PRId | Processor Model ---------+-------------------- 00000422 | R4000 Revision 2.2 00000430 | R4000 Revision 3.0 00000440 | R4400 Revision 1.0 00000450 | R4400 Revision 2.0 00000460 | R4400 Revision 3.0 No other revision of either processor has ever been spotted. Contrary to what has been stated in commit ce202cbb9e0b ("[MIPS] Assume R4000/R4400 newer than 3.0 don't have the mfc0 count bug") marking the CP0 counter as buggy does not preclude it from being used as either a clock event or a clock source device. It just cannot be used as both at a time, because in that case clock event interrupts will be occasionally lost, and the use as a clock event device takes precedence. Compare against 0x4ff in `can_use_mips_counter' so that a single machine instruction is produced. References: [1] "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", MIPS Technologies Inc., May 10, 1994, Erratum 53, p.13 [2] "MIPS R4400PC/SC Errata, Processor Revision 1.0", MIPS Technologies Inc., February 9, 1994, Erratum 21, p.4 [3] "MIPS R4400PC/SC Errata, Processor Revision 2.0 & 3.0", MIPS Technologies Inc., January 24, 1995, Erratum 14, p.3 Signed-off-by: Maciej W. Rozycki Fixes: ce202cbb9e0b ("[MIPS] Assume R4000/R4400 newer than 3.0 don't have the mfc0 count bug") Cc: stable@vger.kernel.org # v2.6.24+ Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer arch/mips/include/asm/timex.h | 8 ++++---- arch/mips/kernel/time.c | 11 +++-------- 2 files changed, 7 insertions(+), 12 deletions(-) commit 09df6a75fffa68169c5ef9bef990cd7ba94f3eef Author: Jan Kara Date: Thu Apr 7 16:07:38 2022 +0200 bfq: Fix warning in bfqq_request_over_limit() People are occasionally reporting a warning bfqq_request_over_limit() triggering reporting that BFQ's idea of cgroup hierarchy (and its depth) does not match what generic blkcg code thinks. This can actually happen when bfqq gets moved between BFQ groups while bfqq_request_over_limit() is running. Make sure the code is safe against BFQ queue being moved to a different BFQ group. Fixes: 76f1df88bbc2 ("bfq: Limit number of requests consumed by each cgroup") CC: stable@vger.kernel.org Link: https://lore.kernel.org/all/CAJCQCtTw_2C7ZSz7as5Gvq=OmnDiio=HRkQekqWpKot84sQhFA@mail.gmail.com/ Reported-by: Chris Murphy Reported-by: "yukuai (C)" Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220407140738.9723-1-jack@suse.cz Signed-off-by: Jens Axboe block/bfq-iosched.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit efce2d0ba6bf70994394a5a139347ced4d172771 Author: Trond Myklebust Date: Thu Apr 28 11:15:08 2022 -0400 SUNRPC: Ensure timely close of disconnected AF_LOCAL sockets When the rpcbind server closes the socket, we need to ensure that the socket is closed by the kernel as soon as feasible, so add a sk_state_change callback to trigger this close. Signed-off-by: Trond Myklebust net/sunrpc/xprtsock.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) commit 7e0815b3e09986d2fe651199363e135b9358132a Author: Thomas Gleixner Date: Thu Apr 28 15:50:54 2022 +0200 x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests When a XEN_HVM guest uses the XEN PIRQ/Eventchannel mechanism, then PCI/MSI[-X] masking is solely controlled by the hypervisor, but contrary to XEN_PV guests this does not disable PCI/MSI[-X] masking in the PCI/MSI layer. This can lead to a situation where the PCI/MSI layer masks an MSI[-X] interrupt and the hypervisor grants the write despite the fact that it already requested the interrupt. As a consequence interrupt delivery on the affected device is not happening ever. Set pci_msi_ignore_mask to prevent that like it's done for XEN_PV guests already. Fixes: 809f9267bbab ("xen: map MSIs into pirqs") Reported-by: Jeremi Piotrowski Reported-by: Dusty Mabe Reported-by: Salvatore Bonaccorso Signed-off-by: Thomas Gleixner Tested-by: Noah Meyerhans Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/87tuaduxj5.ffs@tglx arch/x86/pci/xen.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 2873d4d52f7c52d60b316ba6c47bd7122b5a9861 Author: Andreas Larsson Date: Fri Apr 29 10:46:56 2022 +0200 can: grcan: only use the NAPI poll budget for RX The previous split budget between TX and RX made it return not using the entire budget but at the same time not having calling called napi_complete. This sometimes led to the poll to not be called, and at the same time having TX and RX interrupts disabled resulting in the driver getting stuck. Fixes: 6cec9b07fe6a ("can: grcan: Add device driver for GRCAN and GRHCAN cores") Link: https://lore.kernel.org/all/20220429084656.29788-4-andreas@gaisler.com Cc: stable@vger.kernel.org Signed-off-by: Andreas Larsson Signed-off-by: Marc Kleine-Budde drivers/net/can/grcan.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) commit 1e93ed26acf03fe6c97c6d573a10178596aadd43 Author: Andreas Larsson Date: Fri Apr 29 10:46:55 2022 +0200 can: grcan: grcan_probe(): fix broken system id check for errata workaround needs The systemid property was checked for in the wrong place of the device tree and compared to the wrong value. Fixes: 6cec9b07fe6a ("can: grcan: Add device driver for GRCAN and GRHCAN cores") Link: https://lore.kernel.org/all/20220429084656.29788-3-andreas@gaisler.com Cc: stable@vger.kernel.org Signed-off-by: Andreas Larsson Signed-off-by: Marc Kleine-Budde drivers/net/can/grcan.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) commit 101da4268626b00d16356a6bf284d66e44c46ff9 Author: Daniel Hellstrom Date: Fri Apr 29 10:46:54 2022 +0200 can: grcan: use ofdev->dev when allocating DMA memory Use the device of the device tree node should be rather than the device of the struct net_device when allocating DMA buffers. The driver got away with it on sparc32 until commit 53b7670e5735 ("sparc: factor the dma coherent mapping into helper") after which the driver oopses. Fixes: 6cec9b07fe6a ("can: grcan: Add device driver for GRCAN and GRHCAN cores") Link: https://lore.kernel.org/all/20220429084656.29788-2-andreas@gaisler.com Cc: stable@vger.kernel.org Signed-off-by: Daniel Hellstrom Signed-off-by: Andreas Larsson Signed-off-by: Marc Kleine-Budde drivers/net/can/grcan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 47f070a63e735bcc8d481de31be1b5a1aa62b31c Author: Duoming Zhou Date: Mon Apr 25 12:24:00 2022 +0800 can: grcan: grcan_close(): fix deadlock There are deadlocks caused by del_timer_sync(&priv->hang_timer) and del_timer_sync(&priv->rr_timer) in grcan_close(), one of the deadlocks are shown below: (Thread 1) | (Thread 2) | grcan_reset_timer() grcan_close() | mod_timer() spin_lock_irqsave() //(1) | (wait a time) ... | grcan_initiate_running_reset() del_timer_sync() | spin_lock_irqsave() //(2) (wait timer to stop) | ... We hold priv->lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need priv->lock in position (2) of thread 2. As a result, grcan_close() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_irqsave(), which could let timer handler to obtain the needed lock. Link: https://lore.kernel.org/all/20220425042400.66517-1-duoming@zju.edu.cn Fixes: 6cec9b07fe6a ("can: grcan: Add device driver for GRCAN and GRHCAN cores") Cc: stable@vger.kernel.org Signed-off-by: Duoming Zhou Reviewed-by: Andreas Larsson Signed-off-by: Marc Kleine-Budde drivers/net/can/grcan.c | 2 ++ 1 file changed, 2 insertions(+) commit 72ed3ee9fa0b461ad086403a8b5336154bd82234 Author: Oliver Hartkopp Date: Fri Apr 22 10:23:37 2022 +0200 can: isotp: remove re-binding of bound socket As a carry over from the CAN_RAW socket (which allows to change the CAN interface while mantaining the filter setup) the re-binding of the CAN_ISOTP socket needs to take care about CAN ID address information and subscriptions. It turned out that this feature is so limited (e.g. the sockopts remain fix) that it finally has never been needed/used. In opposite to the stateless CAN_RAW socket the switching of the CAN ID subscriptions might additionally lead to an interrupted ongoing PDU reception. So better remove this unneeded complexity. Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://lore.kernel.org/all/20220422082337.1676-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde net/can/isotp.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) commit 1825b93b626e99eb9a0f9f50342c7b2fa201b387 Author: Naoya Horiguchi Date: Thu Apr 28 23:14:44 2022 -0700 mm/hwpoison: use pr_err() instead of dump_page() in get_any_page() The following VM_BUG_ON_FOLIO() is triggered when memory error event happens on the (thp/folio) pages which are about to be freed: [ 1160.232771] page:00000000b36a8a0f refcount:1 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x16a000 [ 1160.236916] page:00000000b36a8a0f refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x16a000 [ 1160.240684] flags: 0x57ffffc0800000(hwpoison|node=1|zone=2|lastcpupid=0x1fffff) [ 1160.243458] raw: 0057ffffc0800000 dead000000000100 dead000000000122 0000000000000000 [ 1160.246268] raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 [ 1160.249197] page dumped because: VM_BUG_ON_FOLIO(!folio_test_large(folio)) [ 1160.251815] ------------[ cut here ]------------ [ 1160.253438] kernel BUG at include/linux/mm.h:788! [ 1160.256162] invalid opcode: 0000 [#1] PREEMPT SMP PTI [ 1160.258172] CPU: 2 PID: 115368 Comm: mceinj.sh Tainted: G E 5.18.0-rc1-v5.18-rc1-220404-2353-005-g83111+ #3 [ 1160.262049] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1.fc35 04/01/2014 [ 1160.265103] RIP: 0010:dump_page.cold+0x27e/0x2bd [ 1160.266757] Code: fe ff ff 48 c7 c6 81 f1 5a 98 e9 4c fe ff ff 48 c7 c6 a1 95 59 98 e9 40 fe ff ff 48 c7 c6 50 bf 5a 98 48 89 ef e8 9d 04 6d ff <0f> 0b 41 f7 c4 ff 0f 00 00 0f 85 9f fd ff ff 49 8b 04 24 a9 00 00 [ 1160.273180] RSP: 0018:ffffaa2c4d59fd18 EFLAGS: 00010292 [ 1160.274969] RAX: 000000000000003e RBX: 0000000000000001 RCX: 0000000000000000 [ 1160.277263] RDX: 0000000000000001 RSI: ffffffff985995a1 RDI: 00000000ffffffff [ 1160.279571] RBP: ffffdc9c45a80000 R08: 0000000000000000 R09: 00000000ffffdfff [ 1160.281794] R10: ffffaa2c4d59fb08 R11: ffffffff98940d08 R12: ffffdc9c45a80000 [ 1160.283920] R13: ffffffff985b6f94 R14: 0000000000000000 R15: ffffdc9c45a80000 [ 1160.286641] FS: 00007eff54ce1740(0000) GS:ffff99c67bd00000(0000) knlGS:0000000000000000 [ 1160.289498] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1160.291106] CR2: 00005628381a5f68 CR3: 0000000104712003 CR4: 0000000000170ee0 [ 1160.293031] Call Trace: [ 1160.293724] [ 1160.294334] get_hwpoison_page+0x47d/0x570 [ 1160.295474] memory_failure+0x106/0xaa0 [ 1160.296474] ? security_capable+0x36/0x50 [ 1160.297524] hard_offline_page_store+0x43/0x80 [ 1160.298684] kernfs_fop_write_iter+0x11c/0x1b0 [ 1160.299829] new_sync_write+0xf9/0x160 [ 1160.300810] vfs_write+0x209/0x290 [ 1160.301835] ksys_write+0x4f/0xc0 [ 1160.302718] do_syscall_64+0x3b/0x90 [ 1160.303664] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 1160.304981] RIP: 0033:0x7eff54b018b7 As shown in the RIP address, this VM_BUG_ON in folio_entire_mapcount() is called from dump_page("hwpoison: unhandlable page") in get_any_page(). The below explains the mechanism of the race: CPU 0 CPU 1 memory_failure get_hwpoison_page get_any_page dump_page compound = PageCompound free_pages_prepare page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP folio_entire_mapcount VM_BUG_ON_FOLIO(!folio_test_large(folio)) So replace dump_page() with safer one, pr_err(). Link: https://lkml.kernel.org/r/20220427053220.719866-1-naoya.horiguchi@linux.dev Fixes: 74e8ee4708a8 ("mm: Turn head_compound_mapcount() into folio_entire_mapcount()") Signed-off-by: Naoya Horiguchi Reviewed-by: John Hubbard Reviewed-by: Miaohe Lin Cc: Matthew Wilcox Cc: Christoph Hellwig Cc: Jason Gunthorpe Cc: William Kucharski Cc: Signed-off-by: Andrew Morton mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 478d134e9506c7e9bfe2830ed03dd85e97966313 Author: Xu Yu Date: Thu Apr 28 23:14:43 2022 -0700 mm/huge_memory: do not overkill when splitting huge_zero_page Kernel panic when injecting memory_failure for the global huge_zero_page, when CONFIG_DEBUG_VM is enabled, as follows. Injecting memory failure for pfn 0x109ff9 at process virtual address 0x20ff9000 page:00000000fb053fc3 refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109e00 head:00000000fb053fc3 order:9 compound_mapcount:0 compound_pincount:0 flags: 0x17fffc000010001(locked|head|node=0|zone=2|lastcpupid=0x1ffff) raw: 017fffc000010001 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000002ffffffff 0000000000000000 page dumped because: VM_BUG_ON_PAGE(is_huge_zero_page(head)) ------------[ cut here ]------------ kernel BUG at mm/huge_memory.c:2499! invalid opcode: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 553 Comm: split_bug Not tainted 5.18.0-rc1+ #11 Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 3288b3c 04/01/2014 RIP: 0010:split_huge_page_to_list+0x66a/0x880 Code: 84 9b fb ff ff 48 8b 7c 24 08 31 f6 e8 9f 5d 2a 00 b8 b8 02 00 00 e9 e8 fb ff ff 48 c7 c6 e8 47 3c 82 4c b RSP: 0018:ffffc90000dcbdf8 EFLAGS: 00010246 RAX: 000000000000003c RBX: 0000000000000001 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff823e4c4f RDI: 00000000ffffffff RBP: ffff88843fffdb40 R08: 0000000000000000 R09: 00000000fffeffff R10: ffffc90000dcbc48 R11: ffffffff82d68448 R12: ffffea0004278000 R13: ffffffff823c6203 R14: 0000000000109ff9 R15: ffffea000427fe40 FS: 00007fc375a26740(0000) GS:ffff88842fd80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc3757c9290 CR3: 0000000102174006 CR4: 00000000003706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: try_to_split_thp_page+0x3a/0x130 memory_failure+0x128/0x800 madvise_inject_error.cold+0x8b/0xa1 __x64_sys_madvise+0x54/0x60 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fc3754f8bf9 Code: 01 00 48 81 c4 80 00 00 00 e9 f1 fe ff ff 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 8 RSP: 002b:00007ffeda93a1d8 EFLAGS: 00000217 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc3754f8bf9 RDX: 0000000000000064 RSI: 0000000000003000 RDI: 0000000020ff9000 RBP: 00007ffeda93a200 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000217 R12: 0000000000400490 R13: 00007ffeda93a2e0 R14: 0000000000000000 R15: 0000000000000000 We think that raising BUG is overkilling for splitting huge_zero_page, the huge_zero_page can't be met from normal paths other than memory failure, but memory failure is a valid caller. So we tend to replace the BUG to WARN + returning -EBUSY, and thus the panic above won't happen again. Link: https://lkml.kernel.org/r/f35f8b97377d5d3ede1bc5ac3114da888c57cbce.1651052574.git.xuyu@linux.alibaba.com Fixes: d173d5417fb6 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()") Fixes: 6a46079cf57a ("HWPOISON: The high level memory error handler in the VM v7") Signed-off-by: Xu Yu Suggested-by: Yang Shi Reported-by: kernel test robot Reviewed-by: Naoya Horiguchi Reviewed-by: Yang Shi Reviewed-by: Miaohe Lin Cc: Signed-off-by: Andrew Morton mm/huge_memory.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit b4e61fc031b11dd807dffc46cebbf0e25966d3d1 Author: Xu Yu Date: Thu Apr 28 23:14:43 2022 -0700 Revert "mm/memory-failure.c: skip huge_zero_page in memory_failure()" Patch series "mm/memory-failure: rework fix on huge_zero_page splitting". This patch (of 2): This reverts commit d173d5417fb67411e623d394aab986d847e47dad. The commit d173d5417fb6 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()") explicitly skips huge_zero_page in memory_failure(), in order to avoid triggering VM_BUG_ON_PAGE on huge_zero_page in split_huge_page_to_list(). This works, but Yang Shi thinks that, Raising BUG is overkilling for splitting huge_zero_page. The huge_zero_page can't be met from normal paths other than memory failure, but memory failure is a valid caller. So I tend to replace the BUG to WARN + returning -EBUSY. If we don't care about the reason code in memory failure, we don't have to touch memory failure. And for the issue that huge_zero_page will be set PG_has_hwpoisoned, Yang Shi comments that, The anonymous page fault doesn't check if the page is poisoned or not since it typically gets a fresh allocated page and assumes the poisoned page (isolated successfully) can't be reallocated again. But huge zero page and base zero page are reused every time. So no matter what fix we pick, the issue is always there. Finally, Yang, David, Anshuman and Naoya all agree to fix the bug, i.e., to split huge_zero_page, in split_huge_page_to_list(). This reverts the commit d173d5417fb6 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()"), and the original bug will be fixed by the next patch. Link: https://lkml.kernel.org/r/872cefb182ba1dd686b0e7db1e6b2ebe5a4fff87.1651039624.git.xuyu@linux.alibaba.com Fixes: d173d5417fb6 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()") Fixes: 6a46079cf57a ("HWPOISON: The high level memory error handler in the VM v7") Signed-off-by: Xu Yu Suggested-by: Yang Shi Reviewed-by: Yang Shi Reviewed-by: Miaohe Lin Cc: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton mm/memory-failure.c | 13 ------------- 1 file changed, 13 deletions(-) commit bb300130e47fcefbe938f06dbacaef0312e28416 Author: Wen Gong Date: Wed Apr 27 14:16:19 2022 +0300 ath11k: reduce the wait time of 11d scan and hw scan while add interface (cherry picked from commit 1f682dc9fb3790aa7ec27d3d122ff32b1eda1365 in wireless-next) Currently ath11k will wait 11d scan complete while add interface in ath11k_mac_op_add_interface(), when system resume without enable wowlan, ath11k_mac_op_add_interface() is called for each resume, thus it increase the resume time of system. And ath11k_mac_op_hw_scan() after ath11k_mac_op_add_interface() also needs some time cost because the previous 11d scan need more than 5 seconds when 6 GHz is enabled, then the scan started event will indicated to ath11k after the 11d scan completed. While 11d scan/hw scan is running in firmware, if ath11k update channel list to firmware by WMI_SCAN_CHAN_LIST_CMDID, then firmware will cancel the current scan which is running, it lead the scan failed. The patch commit 9dcf6808b253 ("ath11k: add 11d scan offload support") used finish_11d_scan/finish_11d_ch_list/pending_11d to synchronize the 11d scan/hw scan/channel list between ath11k/firmware/mac80211 and to avoid the scan fail. Add wait operation before ath11k update channel list, function ath11k_reg_update_chan_list() will wait until the current 11d scan/hw scan completed. And remove the wait operation of start 11d scan and waiting channel list complete in hw scan. After these changes, resume time cost reduce about 5 seconds and also hw scan time cost reduced obviously, and scan failed not seen. The 11d scan is sent to firmware only one time for each interface added in mac.c, and it is moved after the 1st hw scan because 11d scan will cost some time and thus leads the AP scan result update to UI delay. Currently priority of ath11k's hw scan is WMI_SCAN_PRIORITY_LOW, and priority of 11d scan in firmware is WMI_SCAN_PRIORITY_MEDIUM, then the 11d scan which sent after hw scan will cancel the hw scan in firmware, so change the priority to WMI_SCAN_PRIORITY_MEDIUM for the hw scan which is in front of the 11d scan, thus it will not happen scan cancel in firmware. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 Fixes: 9dcf6808b253 ("ath11k: add 11d scan offload support") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215777 Cc: Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328035832.14122-1-quic_wgong@quicinc.com Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220427111619.9758-1-kvalo@kernel.org drivers/net/wireless/ath/ath11k/core.c | 1 + drivers/net/wireless/ath/ath11k/core.h | 13 +++++-- drivers/net/wireless/ath/ath11k/mac.c | 71 ++++++++++++++-------------------- drivers/net/wireless/ath/ath11k/mac.h | 2 +- drivers/net/wireless/ath/ath11k/reg.c | 43 +++++++++++++------- drivers/net/wireless/ath/ath11k/reg.h | 2 +- drivers/net/wireless/ath/ath11k/wmi.c | 16 +++++++- 7 files changed, 84 insertions(+), 64 deletions(-) commit 38d741cb70b30741c0e802cbed7bd9cf4fd15fa4 Merge: 249aca0d3d63 9d9f720733b7 Author: Linus Torvalds Date: Thu Apr 28 18:00:34 2022 -0700 Merge tag 'drm-fixes-2022-04-29' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Another relatively quiet week, amdgpu leads the way, some i915 display fixes, and a single sunxi fix. amdgpu: - Runtime pm fix - DCN memory leak fix in error path - SI DPM deadlock fix - S0ix fix amdkfd: - GWS fix - GWS support for CRIU i915: - Fix #5284: Backlight control regression on XMG Core 15 e21 - Fix black display plane on Acer One AO532h - Two smaller display fixes sunxi: - Single fix removing applying PHYS_OFFSET twice" * tag 'drm-fixes-2022-04-29' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: keep mmhub clock gating being enabled during s2idle suspend drm/amd/pm: fix the deadlock issue observed on SI drm/amd/display: Fix memory leak in dcn21_clock_source_create drm/amdgpu: don't runtime suspend if there are displays attached (v3) drm/amdkfd: CRIU add support for GWS queues drm/amdkfd: Fix GWS queue count drm/sun4i: Remove obsolete references to PHYS_OFFSET drm/i915/fbc: Consult hw.crtc instead of uapi.crtc drm/i915: Fix SEL_FETCH_PLANE_*(PIPE_B+) register addresses drm/i915: Check EDID for HDR static metadata when choosing blc drm/i915: Fix DISP_POS_Y and DISP_HEIGHT defines commit 9d9f720733b7e8d11e4cc53b53f461b117dab839 Merge: 22c73ba44bb0 fb8cc3318e47 Author: Dave Airlie Date: Fri Apr 29 10:27:04 2022 +1000 Merge tag 'amd-drm-fixes-5.18-2022-04-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.18-2022-04-27: amdgpu: - Runtime pm fix - DCN memory leak fix in error path - SI DPM deadlock fix - S0ix fix amdkfd: - GWS fix - GWS support for CRIU Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220428023232.5794-1-alexander.deucher@amd.com commit 22c73ba44bb05a0e1ed7063d12fb31a461a154ec Merge: 43f2c104f0e8 f7e1089f4376 Author: Dave Airlie Date: Fri Apr 29 10:17:46 2022 +1000 Merge tag 'drm-intel-fixes-2022-04-28' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix #5284: Backlight control regression on XMG Core 15 e21 - Fix black display plane on Acer One AO532h - Two smaller display fixes Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/Ymotel5VfZUrJahf@jlahtine-mobl.ger.corp.intel.com commit 43f2c104f0e8a723da72cf2b63f85008ec827fe2 Merge: af2d861d4cd2 dc3ae06c5f21 Author: Dave Airlie Date: Fri Apr 29 10:02:04 2022 +1000 Merge tag 'drm-misc-fixes-2022-04-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v5.18-rc5: - Single fix removing applying PHYS_OFFSET twice in sunxi. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/f692bb62-5620-1868-91b7-dffb8d6f9175@linux.intel.com commit 2c33d775ef4c25c0e1e1cc0fd5496d02f76bfa20 Author: Kurt Kanzenbach Date: Thu Apr 28 08:24:32 2022 +0200 timekeeping: Mark NMI safe time accessors as notrace Mark the CLOCK_MONOTONIC fast time accessors as notrace. These functions are used in tracing to retrieve timestamps, so they should not recurse. Fixes: 4498e7467e9e ("time: Parametrize all tk_fast_mono users") Fixes: f09cb9a1808e ("time: Introduce tk_fast_raw") Reported-by: Steven Rostedt Signed-off-by: Kurt Kanzenbach Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220426175338.3807ca4f@gandalf.local.home/ Link: https://lore.kernel.org/r/20220428062432.61063-1-kurt@linutronix.de kernel/time/timekeeping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 249aca0d3d631660aa3583c6a3559b75b6e971b4 Merge: 3c76fe74368b d9157f6806d1 Author: Linus Torvalds Date: Thu Apr 28 12:34:50 2022 -0700 Merge tag 'net-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bluetooth, bpf and netfilter. Current release - new code bugs: - bridge: switchdev: check br_vlan_group() return value - use this_cpu_inc() to increment net->core_stats, fix preempt-rt Previous releases - regressions: - eth: stmmac: fix write to sgmii_adapter_base Previous releases - always broken: - netfilter: nf_conntrack_tcp: re-init for syn packets only, resolving issues with TCP fastopen - tcp: md5: fix incorrect tcp_header_len for incoming connections - tcp: fix F-RTO may not work correctly when receiving DSACK - tcp: ensure use of most recently sent skb when filling rate samples - tcp: fix potential xmit stalls caused by TCP_NOTSENT_LOWAT - virtio_net: fix wrong buf address calculation when using xdp - xsk: fix forwarding when combining copy mode with busy poll - xsk: fix possible crash when multiple sockets are created - bpf: lwt: fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit lwt hook - sctp: null-check asoc strreset_chunk in sctp_generate_reconf_event - wireguard: device: check for metadata_dst with skb_valid_dst() - netfilter: update ip6_route_me_harder to consider L3 domain - gre: make o_seqno start from 0 in native mode - gre: switch o_seqno to atomic to prevent races in collect_md mode Misc: - add Eric Dumazet to networking maintainers - dt: dsa: realtek: remove realtek,rtl8367s string - netfilter: flowtable: Remove the empty file" * tag 'net-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (65 commits) tcp: fix F-RTO may not work correctly when receiving DSACK Revert "ibmvnic: Add ethtool private flag for driver-defined queue limits" net: enetc: allow tc-etf offload even with NETIF_F_CSUM_MASK ixgbe: ensure IPsec VF<->PF compatibility MAINTAINERS: Update BNXT entry with firmware files netfilter: nft_socket: only do sk lookups when indev is available net: fec: add missing of_node_put() in fec_enet_init_stop_mode() bnx2x: fix napi API usage sequence tls: Skip tls_append_frag on zero copy size Add Eric Dumazet to networking maintainers netfilter: conntrack: fix udp offload timeout sysctl netfilter: nf_conntrack_tcp: re-init for syn packets only net: dsa: lantiq_gswip: Don't set GSWIP_MII_CFG_RMII_CLK net: Use this_cpu_inc() to increment net->core_stats Bluetooth: hci_sync: Cleanup hci_conn if it cannot be aborted Bluetooth: hci_event: Fix creating hci_conn object on error status Bluetooth: hci_event: Fix checking for invalid handle on error status ice: fix use-after-free when deinitializing mailbox snapshot ice: wait 5 s for EMP reset after firmware flash ice: Protect vf_state check by cfg_lock in ice_vc_process_vf_msg() ... commit 32452a3eb8b64e01e2be717f518c0be046975b9d Author: Joseph Ravichandran Date: Thu Apr 28 12:57:52 2022 -0400 io_uring: fix uninitialized field in rw io_kiocb io_rw_init_file does not initialize kiocb->private, so when iocb_bio_iopoll reads kiocb->private it can contain uninitialized data. Fixes: 3e08773c3841 ("block: switch polling to be bio based") Signed-off-by: Joseph Ravichandran Signed-off-by: Jens Axboe fs/io_uring.c | 1 + 1 file changed, 1 insertion(+) commit 3c76fe74368b79d5341decaccce97f45907395f1 Merge: 659ed6e2850c a12475f91b69 Author: Linus Torvalds Date: Thu Apr 28 11:57:00 2022 -0700 Merge tag 'thermal-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control fixes from Rafael Wysocki: "These take back recent chages that started to confuse users and fix up an attr.show callback prototype in a driver. Specifics: - Stop warning about deprecation of the userspace thermal governor and cooling device status interface, because there are cases in which user space has to drive thermal management with the help of them (Daniel Lezcano) - Fix attr.show callback prototype in the int340x thermal driver (Kees Cook)" * tag 'thermal-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal/governor: Remove deprecated information Revert "thermal/core: Deprecate changing cooling device state from userspace" thermal: int340x: Fix attr.show callback prototype commit 659ed6e2850c7df4eba838863325f6d71f437844 Merge: f12d31c00b2e edbd9772cc9d Author: Linus Torvalds Date: Thu Apr 28 11:50:21 2022 -0700 Merge tag 'pm-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These fix up recent intel_idle driver changes and fix some ARM cpufreq driver issues. Specifics: - Fix issues with the Qualcomm's cpufreq driver (Dmitry Baryshkov, Vladimir Zapolskiy). - Fix memory leak with the Sun501 driver (Xiaobing Luo). - Make intel_idle enable C1E promotion on all CPUs when C1E is preferred to C1 (Artem Bityutskiy). - Make C6 optimization on Sapphire Rapids added recently work as expected if both C1E and C1 are "preferred" (Artem Bityutskiy)" * tag 'pm-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: intel_idle: Fix SPR C6 optimization intel_idle: Fix the 'preferred_cstates' module parameter cpufreq: qcom-cpufreq-hw: Clear dcvs interrupts cpufreq: fix memory leak in sun50i_cpufreq_nvmem_probe cpufreq: qcom-cpufreq-hw: Fix throttle frequency value on EPSS platforms cpufreq: qcom-hw: provide online/offline operations cpufreq: qcom-hw: fix the opp entries refcounting cpufreq: qcom-hw: fix the race between LMH worker and cpuhp cpufreq: qcom-hw: drop affinity hint before freeing the IRQ commit f12d31c00b2e1d0774772695fd644b1c15e446ac Merge: 259b897e5a79 20e582e16af2 Author: Linus Torvalds Date: Thu Apr 28 11:37:20 2022 -0700 Merge tag 'acpi-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael WysockiL "These fix up the ACPI processor driver after a change made during the 5.16 cycle that inadvertently broke falling back to shallower C-states when C3 cannot be used. Specifics: - Make the ACPI processor driver avoid falling back to C3 type of C-states when C3 cannot be requested (Ville Syrjälä) - Revert a quirk that is not necessary any more after fixing the underlying issue properly (Ville Syrjälä)" * tag 'acpi-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: Revert "ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40" ACPI: processor: idle: Avoid falling back to C3 type C-states commit 259b897e5a7958e06d1ac30ddd28dc8419e8f328 Merge: fd5a4c7d26fa eb2fd9b43fae Author: Linus Torvalds Date: Thu Apr 28 11:13:00 2022 -0700 Merge tag 'platform-drivers-x86-v5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "Highlights: - asus-wmi bug-fixes - intel-sdsu bug-fixes - build (warning) fixes - couple of hw-id additions" * tag 'platform-drivers-x86-v5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86/intel: pmc/core: change pmc_lpm_modes to static platform/x86/intel/sdsi: Fix bug in multi packet reads platform/x86/intel/sdsi: Poll on ready bit for writes platform/x86/intel/sdsi: Handle leaky bucket platform/x86: intel-uncore-freq: Prevent driver loading in guests platform/x86: gigabyte-wmi: added support for B660 GAMING X DDR4 motherboard platform/x86: dell-laptop: Add quirk entry for Latitude 7520 platform/x86: asus-wmi: Fix driver not binding when fan curve control probe fails platform/x86: asus-wmi: Potential buffer overflow in asus_wmi_evaluate_method_buf() tools/power/x86/intel-speed-select: fix build failure when using -Wl,--as-needed commit fd5a4c7d26fa49d0468459b9c453841ff59dc322 Merge: 4a2316a1eda4 dfd2b37edf7e Author: Linus Torvalds Date: Thu Apr 28 11:07:49 2022 -0700 Merge tag 'regulator-fix-v5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fix from Mark Brown: "A minor fix for the DT binding documentation of the rt5190a driver" * tag 'regulator-fix-v5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: dt-bindings: Revise the rt5190a buck/ldo description commit d9157f6806d1499e173770df1f1b234763de5c79 Author: Pengcheng Yang Date: Tue Apr 26 18:03:39 2022 +0800 tcp: fix F-RTO may not work correctly when receiving DSACK Currently DSACK is regarded as a dupack, which may cause F-RTO to incorrectly enter "loss was real" when receiving DSACK. Packetdrill to demonstrate: // Enable F-RTO and TLP 0 `sysctl -q net.ipv4.tcp_frto=2` 0 `sysctl -q net.ipv4.tcp_early_retrans=3` 0 `sysctl -q net.ipv4.tcp_congestion_control=cubic` // Establish a connection +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0 bind(3, ..., ...) = 0 +0 listen(3, 1) = 0 // RTT 10ms, RTO 210ms +.1 < S 0:0(0) win 32792 +0 > S. 0:0(0) ack 1 <...> +.01 < . 1:1(0) ack 1 win 257 +0 accept(3, ..., ...) = 4 // Send 2 data segments +0 write(4, ..., 2000) = 2000 +0 > P. 1:2001(2000) ack 1 // TLP +.022 > P. 1001:2001(1000) ack 1 // Continue to send 8 data segments +0 write(4, ..., 10000) = 10000 +0 > P. 2001:10001(8000) ack 1 // RTO +.188 > . 1:1001(1000) ack 1 // The original data is acked and new data is sent(F-RTO step 2.b) +0 < . 1:1(0) ack 2001 win 257 +0 > P. 10001:12001(2000) ack 1 // D-SACK caused by TLP is regarded as a dupack, this results in // the incorrect judgment of "loss was real"(F-RTO step 3.a) +.022 < . 1:1(0) ack 2001 win 257 // Never-retransmitted data(3001:4001) are acked and // expect to switch to open state(F-RTO step 3.b) +0 < . 1:1(0) ack 4001 win 257 +0 %{ assert tcpi_ca_state == 0, tcpi_ca_state }% Fixes: e33099f96d99 ("tcp: implement RFC5682 F-RTO") Signed-off-by: Pengcheng Yang Acked-by: Neal Cardwell Tested-by: Neal Cardwell Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/1650967419-2150-1-git-send-email-yangpc@wangsu.com Signed-off-by: Jakub Kicinski net/ipv4/tcp_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit c26d0d988edddcd8c19ba59b5bc93a0cabcb6cc7 Merge: aeaf59b78712 743b83f15d40 Author: Jakub Kicinski Date: Thu Apr 28 09:55:59 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Fix incorrect TCP connection tracking window reset for non-syn packets, from Florian Westphal. 2) Incorrect dependency on CONFIG_NFT_FLOW_OFFLOAD, from Volodymyr Mytnyk. 3) Fix nft_socket from the output path, from Florian Westphal. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nft_socket: only do sk lookups when indev is available netfilter: conntrack: fix udp offload timeout sysctl netfilter: nf_conntrack_tcp: re-init for syn packets only ==================== Link: https://lore.kernel.org/r/20220428142109.38726-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 4a2316a1eda4ef3ced18c7f08f7cb3726bcae44b Merge: 8061e16e203f 296abc0d91d8 Author: Linus Torvalds Date: Thu Apr 28 09:50:29 2022 -0700 Merge tag 'gfs2-v5.18-rc4-fix2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 fix from Andreas Gruenbacher: - No short reads or writes upon glock contention * tag 'gfs2-v5.18-rc4-fix2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: No short reads or writes upon glock contention commit aeaf59b78712c7a1827c76f086acff4f586e072f Author: Dany Madden Date: Wed Apr 27 18:51:46 2022 -0500 Revert "ibmvnic: Add ethtool private flag for driver-defined queue limits" This reverts commit 723ad916134784b317b72f3f6cf0f7ba774e5dae When client requests channel or ring size larger than what the server can support the server will cap the request to the supported max. So, the client would not be able to successfully request resources that exceed the server limit. Fixes: 723ad9161347 ("ibmvnic: Add ethtool private flag for driver-defined queue limits") Signed-off-by: Dany Madden Link: https://lore.kernel.org/r/20220427235146.23189-1-drt@linux.ibm.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/ibm/ibmvnic.c | 129 ++++++++++--------------------------- drivers/net/ethernet/ibm/ibmvnic.h | 6 -- 2 files changed, 35 insertions(+), 100 deletions(-) commit 66a2f5ef68faaf950746747d790a0c95f7ec96d2 Author: Vladimir Oltean Date: Wed Apr 27 23:30:17 2022 +0300 net: enetc: allow tc-etf offload even with NETIF_F_CSUM_MASK The Time-Specified Departure feature is indeed mutually exclusive with TX IP checksumming in ENETC, but TX checksumming in itself is broken and was removed from this driver in commit 82728b91f124 ("enetc: Remove Tx checksumming offload code"). The blamed commit declared NETIF_F_HW_CSUM in dev->features to comply with software TSO's expectations, and still did the checksumming in software by calling skb_checksum_help(). So there isn't any restriction for the Time-Specified Departure feature. However, enetc_setup_tc_txtime() doesn't understand that, and blindly looks for NETIF_F_CSUM_MASK. Instead of checking for things which can literally never happen in the current code base, just remove the check and let the driver offload tc-etf qdiscs. Fixes: acede3c5dad5 ("net: enetc: declare NETIF_F_HW_CSUM and do it in software") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220427203017.1291634-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/freescale/enetc/enetc_qos.c | 4 ---- 1 file changed, 4 deletions(-) commit f049efc7f7cd2f3c419f55040928eaefb13b3636 Author: Leon Romanovsky Date: Wed Apr 27 10:31:52 2022 -0700 ixgbe: ensure IPsec VF<->PF compatibility The VF driver can forward any IPsec flags and such makes the function is not extendable and prone to backward/forward incompatibility. If new software runs on VF, it won't know that PF configured something completely different as it "knows" only XFRM_OFFLOAD_INBOUND flag. Fixes: eda0333ac293 ("ixgbe: add VF IPsec management") Reviewed-by: Raed Salem Signed-off-by: Leon Romanovsky Reviewed-by: Shannon Nelson Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220427173152.443102-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 8061e16e203f36e7a5990535760ecb2e60a365f9 Merge: 8f4dd16603ce 9a5280b312e2 Author: Linus Torvalds Date: Thu Apr 28 09:37:56 2022 -0700 Merge tag 'xfs-5.18-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Dave Chinner: - define buffer bit flags as unsigned to fix gcc-5 + c11 warnings - remove redundant XFS fields from MAINTAINERS - fix inode buffer locking order regression * tag 'xfs-5.18-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: reorder iunlink remove operation in xfs_ifree MAINTAINERS: update IOMAP FILESYSTEM LIBRARY and XFS FILESYSTEM xfs: convert buffer flags to unsigned. commit 126858db81a5094d20885bc59621c3b9497f9048 Author: Florian Fainelli Date: Wed Apr 27 09:36:06 2022 -0700 MAINTAINERS: Update BNXT entry with firmware files There appears to be a maintainer gap for BNXT TEE firmware files which causes some patches to be missed. Update the entry for the BNXT Ethernet controller with its companion firmware files. Signed-off-by: Florian Fainelli Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20220427163606.126154-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) commit aad41a7d7cf6c6fa804c872a2480f8e541da37cf Author: Trond Myklebust Date: Thu Apr 28 11:08:13 2022 -0400 SUNRPC: Don't leak sockets in xs_local_connect() If there is still a closed socket associated with the transport, then we need to trigger an autoclose before we can set up a new connection. Reported-by: wanghai (M) Fixes: f00432063db1 ("SUNRPC: Ensure we flush any closed sockets before xs_xprt_free()") Signed-off-by: Trond Myklebust net/sunrpc/xprtsock.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) commit a12475f91b69cce067e5de905fafa893ae12c3ae Merge: fa1ef24ae251 d0f6cfb2bd16 Author: Rafael J. Wysocki Date: Thu Apr 28 16:51:24 2022 +0200 Merge branch 'thermal-int340x' Merge a fix for the attr.show callback prototype in the int340x thermal driver (Kees Cook). * thermal-int340x: thermal: int340x: Fix attr.show callback prototype commit fda05730f62b9a53e7d415f5c607942afbdc1fd9 Merge: 5b47b751b760 b5d6ba09b10d Author: Greg Kroah-Hartman Date: Thu Apr 28 16:35:55 2022 +0200 Merge tag 'iio-fixes-for-5.18a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio Pull set of IIO fixes for 5.18 from Jonathan Cameron: "1st set of IIO fixes for the 5.18 cycle ad3552r: - Fix a bug with error codes being stored in unsigned local variable. - Fix IS_ERR when value is either NULL or not rather than ERR_PTR ad5446 - Fix shifting of read_raw value. ad5592r - Fix missing return value being set for a fwnode property read. ad7280a - Wrong variable being used to set thresholds. admv8818 - Kconfig dependency fix. ak8975 - Missing regulator disable in error path. bmi160 - Disable regulators in an error path. dac5571 - Fix chip id detection for devices with OF bindings. inv_icm42600 - Handle a case of a missing I2C NACK during initially configuration. ltc2688 - Fix voltage scaling where integer part was written twice and decimal part not at all. scd4x - Handle error before using value. sx9310 - Device property parsing against indio_dev->dev.of_node which hasn't been set yet. sx9324 - Fix hardware gain related maths. - Wrong defaults for precharge internal resistance register." * tag 'iio-fixes-for-5.18a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: imu: inv_icm42600: Fix I2C init possible nack iio: dac: ltc2688: fix voltage scale read iio:dac:ad3552r: Fix an IS_ERR() vs NULL check iio: sx9324: Fix default precharge internal resistance register iio: dac: ad5446: Fix read_raw not returning set value iio: magnetometer: ak8975: Fix the error handling in ak8975_power_on() iio:proximity:sx9324: Fix hardware gain read/write iio:proximity:sx_common: Fix device property parsing on DT systems iio: adc: ad7280a: Fix wrong variable used when setting thresholds. iio:filter:admv8818: select REGMAP_SPI for ADMV8818 iio: dac: ad5592r: Fix the missing return value. iio: dac: dac5571: Fix chip id detection for OF devices iio:imu:bmi160: disable regulator in error path iio: scd4x: check return of scd4x_write_and_fetch iio: dac: ad3552r: fix signedness bug in ad3552r_reset() commit 743b83f15d4069ea57c3e40996bf4a1077e0cdc1 Author: Florian Westphal Date: Thu Apr 28 09:39:21 2022 +0200 netfilter: nft_socket: only do sk lookups when indev is available Check if the incoming interface is available and NFT_BREAK in case neither skb->sk nor input device are set. Because nf_sk_lookup_slow*() assume packet headers are in the 'in' direction, use in postrouting is not going to yield a meaningful result. Same is true for the forward chain, so restrict the use to prerouting, input and output. Use in output work if a socket is already attached to the skb. Fixes: 554ced0a6e29 ("netfilter: nf_tables: add support for native socket matching") Reported-and-tested-by: Topi Miettinen Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_socket.c | 52 +++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 14 deletions(-) commit edbd9772cc9d8af6c136d01d8b9402f6ab767e9b Merge: 0f03610b20cc 7eac3bd38d18 Author: Rafael J. Wysocki Date: Thu Apr 28 16:09:50 2022 +0200 Merge branch 'pm-cpuidle' Merge cpuidle fixes for 5.18-rc5: - Make intel_idle enable C1E promotion on all CPUs when C1E is preferred to C1 (Artem Bityutskiy). - Make C6 optimization on Sapphire Rapids added recently work as expected if both C1E and C1 are "preferred" (Artem Bityutskiy). * pm-cpuidle: intel_idle: Fix SPR C6 optimization intel_idle: Fix the 'preferred_cstates' module parameter commit a5d20d42a2f2dc2b2f9e9361912062732414090d Author: Namhyung Kim Date: Fri Apr 15 17:40:48 2022 -0700 perf symbol: Remove arch__symbols__fixup_end() Now the generic code can handle kallsyms fixup properly so no need to keep the arch-functions anymore. Fixes: 3cf6a32f3f2a4594 ("perf symbols: Fix symbol size calculation condition") Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Heiko Carstens Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Michael Petlan Cc: Peter Zijlstra Cc: Song Liu Cc: Will Deacon Cc: linux-s390@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20220416004048.1514900-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/arch/arm64/util/machine.c | 21 --------------------- tools/perf/arch/powerpc/util/Build | 1 - tools/perf/arch/powerpc/util/machine.c | 25 ------------------------- tools/perf/arch/s390/util/machine.c | 16 ---------------- tools/perf/util/symbol.c | 5 ----- tools/perf/util/symbol.h | 1 - 6 files changed, 69 deletions(-) commit 8799ebce84d672aae1dc3170510f6a3e66f96b11 Author: Namhyung Kim Date: Fri Apr 15 17:40:47 2022 -0700 perf symbol: Update symbols__fixup_end() Now arch-specific functions all do the same thing. When it fixes the symbol address it needs to check the boundary between the kernel image and modules. For the last symbol in the previous region, it cannot know the exact size as it's discarded already. Thus it just uses a small page size (4096) and rounds it up like the last symbol. Fixes: 3cf6a32f3f2a4594 ("perf symbols: Fix symbol size calculation condition") Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Heiko Carstens Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Michael Petlan Cc: Peter Zijlstra Cc: Song Liu Cc: Will Deacon Cc: linux-s390@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20220416004048.1514900-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/symbol.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) commit 838425f2defe5262906b698752d28fd2fca1aac2 Author: Namhyung Kim Date: Fri Apr 15 17:40:46 2022 -0700 perf symbol: Pass is_kallsyms to symbols__fixup_end() The symbol fixup is necessary for symbols in kallsyms since they don't have size info. So we use the next symbol's address to calculate the size. Now it's also used for user binaries because sometimes they miss size for hand-written asm functions. There's a arch-specific function to handle kallsyms differently but currently it cannot distinguish kallsyms from others. Pass this information explicitly to handle it properly. Note that those arch functions will be moved to the generic function so I didn't added it to the arch-functions. Fixes: 3cf6a32f3f2a4594 ("perf symbols: Fix symbol size calculation condition") Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Heiko Carstens Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Mathieu Poirier Cc: Michael Ellerman Cc: Michael Petlan Cc: Peter Zijlstra Cc: Song Liu Cc: Will Deacon Cc: linux-s390@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20220416004048.1514900-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/symbol-elf.c | 2 +- tools/perf/util/symbol.c | 7 ++++--- tools/perf/util/symbol.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) commit 3b9a8c8b9ac2a57df8b7f05c6ffa89652ac1ba8c Author: Timothy Hayes Date: Thu Apr 21 17:52:05 2022 +0100 perf test: Add perf_event_attr test for Arm SPE Adds a perf_event_attr test for Arm SPE in which the presence of physical addresses are checked when SPE unit is run with pa_enable=1. Reviewed-by: Leo Yan Signed-off-by: Timothy Hayes Tested-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Song Liu Cc: Will Deacon Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220421165205.117662-4-timothy.hayes@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/tests/attr/README | 1 + tools/perf/tests/attr/test-record-spe-physical-address | 12 ++++++++++++ 2 files changed, 13 insertions(+) commit 7599b70a3c85357d3a57319ae90d419adea0544b Author: Timothy Hayes Date: Thu Apr 21 17:52:04 2022 +0100 perf arm-spe: Fix SPE events with phys addresses This patch corrects a bug whereby SPE collection is invoked with pa_enable=1 but synthesized events fail to show physical addresses. Reviewed-by: Leo Yan Signed-off-by: Timothy Hayes Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Song Liu Cc: Will Deacon Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: netdev@vger.kernel.org Link: https://lore.kernel.org/r/20220421165205.117662-3-timothy.hayes@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/arch/arm64/util/arm-spe.c | 10 ++++++++++ tools/perf/util/arm-spe.c | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) commit 4e13f6706d5aee1a6b835a44f6cf4971a921dcb8 Author: Timothy Hayes Date: Thu Apr 21 17:52:03 2022 +0100 perf arm-spe: Fix addresses of synthesized SPE events This patch corrects a bug whereby synthesized events from SPE samples are missing virtual addresses. Fixes: 54f7815efef7fad9 ("perf arm-spe: Fill address info for samples") Reviewed-by: Leo Yan Signed-off-by: Timothy Hayes Cc: Alexander Shishkin Cc: bpf@vger.kernel.org Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Leo Yan Cc: linux-arm-kernel@lists.infradead.org Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Namhyung Kim Cc: netdev@vger.kernel.org Cc: Song Liu Cc: Will Deacon Cc: Yonghong Song Link: https://lore.kernel.org/r/20220421165205.117662-2-timothy.hayes@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/arm-spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit de8fd138430ccac4b8f7b812e5c6f8963b5ccf07 Author: Adrian Hunter Date: Thu Apr 28 12:31:09 2022 +0300 perf intel-pt: Fix timeless decoding with perf.data directory Intel PT does not capture data in separate directories, so do not use separate directory processing because it doesn't work for timeless decoding. It also looks like it doesn't support one_mmap handling. Example: Before: # perf record --kcore -a -e intel_pt/tsc=0/k sleep 0.1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.799 MB perf.data ] # perf script --itrace=bep | head # After: # perf script --itrace=bep | head perf 21073 [000] psb: psb offs: 0 ffffffffaa68faf4 native_write_msr+0x4 ([kernel.kallsyms]) perf 21073 [000] cbr: cbr: 45 freq: 4505 MHz (161%) ffffffffaa68faf4 native_write_msr+0x4 ([kernel.kallsyms]) perf 21073 [000] 1 branches:k: 0 [unknown] ([unknown]) => ffffffffaa68faf6 native_write_msr+0x6 ([kernel.kallsyms]) perf 21073 [000] 1 branches:k: ffffffffaa68faf8 native_write_msr+0x8 ([kernel.kallsyms]) => ffffffffaa61aab0 pt_config_start+0x60 ([kernel.kallsyms]) perf 21073 [000] 1 branches:k: ffffffffaa61aabd pt_config_start+0x6d ([kernel.kallsyms]) => ffffffffaa61b8ad pt_event_start+0x27d ([kernel.kallsyms]) perf 21073 [000] 1 branches:k: ffffffffaa61b8bb pt_event_start+0x28b ([kernel.kallsyms]) => ffffffffaa61ba60 pt_event_add+0x40 ([kernel.kallsyms]) perf 21073 [000] 1 branches:k: ffffffffaa61ba76 pt_event_add+0x56 ([kernel.kallsyms]) => ffffffffaa880e86 event_sched_in+0xc6 ([kernel.kallsyms]) perf 21073 [000] 1 branches:k: ffffffffaa880e9b event_sched_in+0xdb ([kernel.kallsyms]) => ffffffffaa880ea5 event_sched_in+0xe5 ([kernel.kallsyms]) perf 21073 [000] 1 branches:k: ffffffffaa880eba event_sched_in+0xfa ([kernel.kallsyms]) => ffffffffaa880f96 event_sched_in+0x1d6 ([kernel.kallsyms]) perf 21073 [000] 1 branches:k: ffffffffaa880fc8 event_sched_in+0x208 ([kernel.kallsyms]) => ffffffffaa880ec0 event_sched_in+0x100 ([kernel.kallsyms]) Fixes: bb6be405c4a2a5 ("perf session: Load data directory files for analysis") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220428093109.274641-1-adrian.hunter@intel.com Cc: Ian Rogers Cc: Arnaldo Carvalho de Melo Cc: Namhyung Kim Cc: Alexey Bayduraev Cc: Jiri Olsa Cc: linux-kernel@vger.kernel.org tools/perf/util/session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 296abc0d91d8b65d42224dd33452ace14491ad08 Author: Andreas Gruenbacher Date: Thu Apr 28 14:51:33 2022 +0200 gfs2: No short reads or writes upon glock contention Commit 00bfe02f4796 ("gfs2: Fix mmap + page fault deadlocks for buffered I/O") changed gfs2_file_read_iter() and gfs2_file_buffered_write() to allow dropping the inode glock while faulting in user buffers. When the lock was dropped, a short result was returned to indicate that the operation was interrupted. As pointed out by Linus (see the link below), this behavior is broken and the operations should always re-acquire the inode glock and resume the operation instead. Link: https://lore.kernel.org/lkml/CAHk-=whaz-g_nOOoo8RRiWNjnv2R+h6_xk2F1J4TuSRxk1MtLw@mail.gmail.com/ Fixes: 00bfe02f4796 ("gfs2: Fix mmap + page fault deadlocks for buffered I/O") Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 4 ---- 1 file changed, 4 deletions(-) commit c35fe2a68f29a0bda15ae994154cacaae5f69791 Author: Catalin Marinas Date: Mon Apr 25 16:18:33 2022 +0100 elf: Fix the arm64 MTE ELF segment name and value Unfortunately, the name/value choice for the MTE ELF segment type (PT_ARM_MEMTAG_MTE) was pretty poor: LOPROC+1 is already in use by PT_AARCH64_UNWIND, as defined in the AArch64 ELF ABI (https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst). Update the ELF segment type value to LOPROC+2 and also change the define to PT_AARCH64_MEMTAG_MTE to match the AArch64 ELF ABI namespace. The AArch64 ELF ABI document is updating accordingly (segment type not previously mentioned in the document). Signed-off-by: Catalin Marinas Fixes: 761b9b366cec ("elf: Introduce the ARM MTE ELF segment type") Cc: Will Deacon Cc: Jonathan Corbet Cc: Eric Biederman Cc: Kees Cook Cc: Luis Machado Cc: Richard Earnshaw Link: https://lore.kernel.org/r/20220425151833.2603830-1-catalin.marinas@arm.com Signed-off-by: Will Deacon Documentation/arm64/memory-tagging-extension.rst | 4 ++-- arch/arm64/kernel/elfcore.c | 2 +- include/uapi/linux/elf.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) commit a15932f4377062364d22096afe25bc579134a1c3 Author: Yang Yingliang Date: Mon Apr 25 17:08:26 2022 +0800 iommu/dart: check return value after calling platform_get_resource() It will cause null-ptr-deref in resource_size(), if platform_get_resource() returns NULL, move calling resource_size() after devm_ioremap_resource() that will check 'res' to avoid null-ptr-deref. And use devm_platform_get_and_ioremap_resource() to simplify code. Fixes: 46d1fb072e76 ("iommu/dart: Add DART iommu driver") Signed-off-by: Yang Yingliang Reviewed-by: Sven Peter Link: https://lore.kernel.org/r/20220425090826.2532165-1-yangyingliang@huawei.com Signed-off-by: Joerg Roedel drivers/iommu/apple-dart.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit e6f48bed2cbee69b45d00d98d94e64112501d1e4 Merge: da8669ff41fa 4a25f2ea0e03 Author: Joerg Roedel Date: Thu Apr 28 11:33:40 2022 +0200 Merge tag 'arm-smmu-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into iommu/fixes Arm SMMU fixes for 5.18 - Fix off-by-one in SMMUv3 SVA TLB invalidation - Disable large mappings to workaround nvidia erratum commit da8669ff41fa31573375c9a4180f5c080677204b Author: Lu Baolu Date: Sat Apr 23 16:23:30 2022 +0800 iommu/vt-d: Drop stop marker messages The page fault handling framework in the IOMMU core explicitly states that it doesn't handle PCI PASID Stop Marker and the IOMMU drivers must discard them before reporting faults. This handles Stop Marker messages in prq_event_thread() before reporting events to the core. The VT-d driver explicitly drains the pending page requests when a CPU page table (represented by a mm struct) is unbound from a PASID according to the procedures defined in the VT-d spec. The Stop Marker messages do not need a response. Hence, it is safe to drop the Stop Marker messages silently if any of them is found in the page request queue. Fixes: d5b9e4bfe0d88 ("iommu/vt-d: Report prq to io-pgfault framework") Signed-off-by: Lu Baolu Reviewed-by: Jacob Pan Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220421113558.3504874-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220423082330.3897867-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/svm.c | 4 ++++ 1 file changed, 4 insertions(+) commit 59bf3557cf2f8a469a554aea1e3d2c8e72a579f7 Author: David Stevens Date: Sun Apr 10 09:35:33 2022 +0800 iommu/vt-d: Calculate mask for non-aligned flushes Calculate the appropriate mask for non-size-aligned page selective invalidation. Since psi uses the mask value to mask out the lower order bits of the target address, properly flushing the iotlb requires using a mask value such that [pfn, pfn+pages) all lie within the flushed size-aligned region. This is not normally an issue because iova.c always allocates iovas that are aligned to their size. However, iovas which come from other sources (e.g. userspace via VFIO) may not be aligned. To properly flush the IOTLB, both the start and end pfns need to be equal after applying the mask. That means that the most efficient mask to use is the index of the lowest bit that is equal where all higher bits are also equal. For example, if pfn=0x17f and pages=3, then end_pfn=0x181, so the smallest mask we can use is 8. Any differences above the highest bit of pages are due to carrying, so by xnor'ing pfn and end_pfn and then masking out the lower order bits based on pages, we get 0xffffff00, where the first set bit is the mask we want to use. Fixes: 6fe1010d6d9c ("vfio/type1: DMA unmap chunking") Cc: stable@vger.kernel.org Signed-off-by: David Stevens Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220401022430.1262215-1-stevensd@google.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20220410013533.3959168-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) commit febb2d2fa5619b0ff08e1e2793a29bebf17319d5 Merge: d2b52ec056d5 9b3628d79b46 Author: Paolo Abeni Date: Thu Apr 28 10:18:51 2022 +0200 Merge tag 'for-net-2022-04-27' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix regression causing some HCI events to be discarded when they shouldn't. * tag 'for-net-2022-04-27' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: hci_sync: Cleanup hci_conn if it cannot be aborted Bluetooth: hci_event: Fix creating hci_conn object on error status Bluetooth: hci_event: Fix checking for invalid handle on error status ==================== Link: https://lore.kernel.org/r/20220427234031.1257281-1-luiz.dentz@gmail.com Signed-off-by: Paolo Abeni commit 8be70a842f70c0fe8e00fd488b1966344fa10ff4 Author: David Jeffery Date: Wed Apr 27 14:32:50 2022 -0400 scsi: target: pscsi: Set SCF_TREAT_READ_AS_NORMAL flag only if there is valid data With tape devices, the SCF_TREAT_READ_AS_NORMAL flag is used by the target subsystem to mark commands which have both data to return as well as sense data. But with pscsi, SCF_TREAT_READ_AS_NORMAL can be set even if there is no data to return. The SCF_TREAT_READ_AS_NORMAL flag causes the target core to call iscsit data-in callbacks even if there is no data, which iscsit does not support. This results in iscsit going into an error state requiring recovery and being unable to complete the command to the initiator. This issue can be resolved by fixing pscsi to only set SCF_TREAT_READ_AS_NORMAL if there is valid data to return alongside the sense data. Link: https://lore.kernel.org/r/20220427183250.291881-1-djeffery@redhat.com Fixes: bd81372065fa ("scsi: target: transport should handle st FM/EOM/ILI reads") Reported-by: Scott Hamilton Tested-by: Laurence Oberman Reviewed-by: Laurence Oberman Signed-off-by: David Jeffery Signed-off-by: Martin K. Petersen drivers/target/target_core_pscsi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit d2b52ec056d5bddb055c8f21d7489a23548d0838 Author: Yang Yingliang Date: Tue Apr 26 20:52:31 2022 +0800 net: fec: add missing of_node_put() in fec_enet_init_stop_mode() Put device node in error path in fec_enet_init_stop_mode(). Fixes: 8a448bf832af ("net: ethernet: fec: move GPR register offset and bit into DT") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220426125231.375688-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/freescale/fec_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit af68656d66eda219b7f55ce8313a1da0312c79e1 Author: Manish Chopra Date: Tue Apr 26 08:39:13 2022 -0700 bnx2x: fix napi API usage sequence While handling PCI errors (AER flow) driver tries to disable NAPI [napi_disable()] after NAPI is deleted [__netif_napi_del()] which causes unexpected system hang/crash. System message log shows the following: ======================================= [ 3222.537510] EEH: Detected PCI bus error on PHB#384-PE#800000 [ 3222.537511] EEH: This PCI device has failed 2 times in the last hour and will be permanently disabled after 5 failures. [ 3222.537512] EEH: Notify device drivers to shutdown [ 3222.537513] EEH: Beginning: 'error_detected(IO frozen)' [ 3222.537514] EEH: PE#800000 (PCI 0384:80:00.0): Invoking bnx2x->error_detected(IO frozen) [ 3222.537516] bnx2x: [bnx2x_io_error_detected:14236(eth14)]IO error detected [ 3222.537650] EEH: PE#800000 (PCI 0384:80:00.0): bnx2x driver reports: 'need reset' [ 3222.537651] EEH: PE#800000 (PCI 0384:80:00.1): Invoking bnx2x->error_detected(IO frozen) [ 3222.537651] bnx2x: [bnx2x_io_error_detected:14236(eth13)]IO error detected [ 3222.537729] EEH: PE#800000 (PCI 0384:80:00.1): bnx2x driver reports: 'need reset' [ 3222.537729] EEH: Finished:'error_detected(IO frozen)' with aggregate recovery state:'need reset' [ 3222.537890] EEH: Collect temporary log [ 3222.583481] EEH: of node=0384:80:00.0 [ 3222.583519] EEH: PCI device/vendor: 168e14e4 [ 3222.583557] EEH: PCI cmd/status register: 00100140 [ 3222.583557] EEH: PCI-E capabilities and status follow: [ 3222.583744] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.583892] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.583893] EEH: PCI-E 20: 00000000 [ 3222.583893] EEH: PCI-E AER capability register set follows: [ 3222.584079] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.584230] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.584378] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.584416] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.584416] EEH: of node=0384:80:00.1 [ 3222.584454] EEH: PCI device/vendor: 168e14e4 [ 3222.584491] EEH: PCI cmd/status register: 00100140 [ 3222.584492] EEH: PCI-E capabilities and status follow: [ 3222.584677] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.584825] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.584826] EEH: PCI-E 20: 00000000 [ 3222.584826] EEH: PCI-E AER capability register set follows: [ 3222.585011] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.585160] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.585309] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.585347] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.586872] RTAS: event: 5, Type: Platform Error (224), Severity: 2 [ 3222.586873] EEH: Reset without hotplug activity [ 3224.762767] EEH: Beginning: 'slot_reset' [ 3224.762770] EEH: PE#800000 (PCI 0384:80:00.0): Invoking bnx2x->slot_reset() [ 3224.762771] bnx2x: [bnx2x_io_slot_reset:14271(eth14)]IO slot reset initializing... [ 3224.762887] bnx2x 0384:80:00.0: enabling device (0140 -> 0142) [ 3224.768157] bnx2x: [bnx2x_io_slot_reset:14287(eth14)]IO slot reset --> driver unload Uninterruptible tasks ===================== crash> ps | grep UN 213 2 11 c000000004c89e00 UN 0.0 0 0 [eehd] 215 2 0 c000000004c80000 UN 0.0 0 0 [kworker/0:2] 2196 1 28 c000000004504f00 UN 0.1 15936 11136 wickedd 4287 1 9 c00000020d076800 UN 0.0 4032 3008 agetty 4289 1 20 c00000020d056680 UN 0.0 7232 3840 agetty 32423 2 26 c00000020038c580 UN 0.0 0 0 [kworker/26:3] 32871 4241 27 c0000002609ddd00 UN 0.1 18624 11648 sshd 32920 10130 16 c00000027284a100 UN 0.1 48512 12608 sendmail 33092 32987 0 c000000205218b00 UN 0.1 48512 12608 sendmail 33154 4567 16 c000000260e51780 UN 0.1 48832 12864 pickup 33209 4241 36 c000000270cb6500 UN 0.1 18624 11712 sshd 33473 33283 0 c000000205211480 UN 0.1 48512 12672 sendmail 33531 4241 37 c00000023c902780 UN 0.1 18624 11648 sshd EEH handler hung while bnx2x sleeping and holding RTNL lock =========================================================== crash> bt 213 PID: 213 TASK: c000000004c89e00 CPU: 11 COMMAND: "eehd" #0 [c000000004d477e0] __schedule at c000000000c70808 #1 [c000000004d478b0] schedule at c000000000c70ee0 #2 [c000000004d478e0] schedule_timeout at c000000000c76dec #3 [c000000004d479c0] msleep at c0000000002120cc #4 [c000000004d479f0] napi_disable at c000000000a06448 ^^^^^^^^^^^^^^^^ #5 [c000000004d47a30] bnx2x_netif_stop at c0080000018dba94 [bnx2x] #6 [c000000004d47a60] bnx2x_io_slot_reset at c0080000018a551c [bnx2x] #7 [c000000004d47b20] eeh_report_reset at c00000000004c9bc #8 [c000000004d47b90] eeh_pe_report at c00000000004d1a8 #9 [c000000004d47c40] eeh_handle_normal_event at c00000000004da64 And the sleeping source code ============================ crash> dis -ls c000000000a06448 FILE: ../net/core/dev.c LINE: 6702 6697 { 6698 might_sleep(); 6699 set_bit(NAPI_STATE_DISABLE, &n->state); 6700 6701 while (test_and_set_bit(NAPI_STATE_SCHED, &n->state)) * 6702 msleep(1); 6703 while (test_and_set_bit(NAPI_STATE_NPSVC, &n->state)) 6704 msleep(1); 6705 6706 hrtimer_cancel(&n->timer); 6707 6708 clear_bit(NAPI_STATE_DISABLE, &n->state); 6709 } EEH calls into bnx2x twice based on the system log above, first through bnx2x_io_error_detected() and then bnx2x_io_slot_reset(), and executes the following call chains: bnx2x_io_error_detected() +-> bnx2x_eeh_nic_unload() +-> bnx2x_del_all_napi() +-> __netif_napi_del() bnx2x_io_slot_reset() +-> bnx2x_netif_stop() +-> bnx2x_napi_disable() +->napi_disable() Fix this by correcting the sequence of NAPI APIs usage, that is delete the NAPI after disabling it. Fixes: 7fa6f34081f1 ("bnx2x: AER revised") Reported-by: David Christensen Tested-by: David Christensen Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Link: https://lore.kernel.org/r/20220426153913.6966-1-manishc@marvell.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit a0df71948e9548de819a6f1da68f5f1742258a52 Author: Maxim Mikityanskiy Date: Tue Apr 26 18:49:49 2022 +0300 tls: Skip tls_append_frag on zero copy size Calling tls_append_frag when max_open_record_len == record->len might add an empty fragment to the TLS record if the call happens to be on the page boundary. Normally tls_append_frag coalesces the zero-sized fragment to the previous one, but not if it's on page boundary. If a resync happens then, the mlx5 driver posts dump WQEs in tx_post_resync_dump, and the empty fragment may become a data segment with byte_count == 0, which will confuse the NIC and lead to a CQE error. This commit fixes the described issue by skipping tls_append_frag on zero size to avoid adding empty fragments. The fix is not in the driver, because an empty fragment is hardly the desired behavior. Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Link: https://lore.kernel.org/r/20220426154949.159055-1-maximmi@nvidia.com Signed-off-by: Jakub Kicinski net/tls/tls_device.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 347cb5deae253c292cebcc5fdf1d07a710904a47 Merge: 7b5148be4a6e ba3beec2ec1d Author: Jakub Kicinski Date: Wed Apr 27 15:18:39 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2022-04-27 We've added 5 non-merge commits during the last 20 day(s) which contain a total of 6 files changed, 34 insertions(+), 12 deletions(-). The main changes are: 1) Fix xsk sockets when rx and tx are separately bound to the same umem, also fix xsk copy mode combined with busy poll, from Maciej Fijalkowski. 2) Fix BPF tunnel/collect_md helpers with bpf_xmit lwt hook usage which triggered a crash due to invalid metadata_dst access, from Eyal Birger. 3) Fix release of page pool in XDP live packet mode, from Toke Høiland-Jørgensen. 4) Fix potential NULL pointer dereference in kretprobes, from Adam Zabrocki. (Masami & Steven preferred this small fix to be routed via bpf tree given it's follow-up fix to Masami's rethook work that went via bpf earlier, too.) * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: xsk: Fix possible crash when multiple sockets are created kprobes: Fix KRETPROBES when CONFIG_KRETPROBE_ON_RETHOOK is set bpf, lwt: Fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit lwt hook bpf: Fix release of page_pool in BPF_PROG_RUN in test runner xsk: Fix l2fwd for copy mode + busy poll combo ==================== Link: https://lore.kernel.org/r/20220427212748.9576-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 85ea6b1ec915c9dd90caf3674b203999d8c7e062 Author: Marc Zyngier Date: Thu Apr 21 15:38:10 2022 +0100 KVM: arm64: Inject exception on out-of-IPA-range translation fault When taking a translation fault for an IPA that is outside of the range defined by the hypervisor (between the HW PARange and the IPA range), we stupidly treat it as an IO and forward the access to userspace. Of course, userspace can't do much with it, and things end badly. Arguably, the guest is braindead, but we should at least catch the case and inject an exception. Check the faulting IPA against: - the sanitised PARange: inject an address size fault - the IPA size: inject an abort Reported-by: Christoffer Dall Signed-off-by: Marc Zyngier arch/arm64/include/asm/kvm_emulate.h | 1 + arch/arm64/kvm/inject_fault.c | 28 ++++++++++++++++++++++++++++ arch/arm64/kvm/mmu.c | 19 +++++++++++++++++++ 3 files changed, 48 insertions(+) commit fb8cc3318e47e1a0ced4025ef614317b541147e7 Author: Prike Liang Date: Tue Apr 19 17:22:34 2022 +0800 drm/amdgpu: keep mmhub clock gating being enabled during s2idle suspend Without MMHUB clock gating being enabled then MMHUB will not disconnect from DF and will result in DF C-state entry can't be accessed during S2idle suspend, and eventually s0ix entry will be blocked. Signed-off-by: Prike Liang Acked-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit a71849cdeaec4579696e5e1c45d9279f7b7484bd Author: Evan Quan Date: Fri Apr 8 19:51:34 2022 +0800 drm/amd/pm: fix the deadlock issue observed on SI The adev->pm.mutx is already held at the beginning of amdgpu_dpm_compute_clocks/amdgpu_dpm_enable_uvd/amdgpu_dpm_enable_vce. But on their calling path, amdgpu_display_bandwidth_update will be called and thus its sub functions amdgpu_dpm_get_sclk/mclk. They will then try to acquire the same adev->pm.mutex and deadlock will occur. By placing amdgpu_display_bandwidth_update outside of adev->pm.mutex protection(considering logically they do not need such protection) and restructuring the call flow accordingly, we can eliminate the deadlock issue. This comes with no real logics change. Fixes: 3712e7a49459 ("drm/amd/pm: unified lock protections in amdgpu_dpm.c") Reported-by: Paul Menzel Reported-by: Arthur Marsh Link: https://lore.kernel.org/all/9e689fea-6c69-f4b0-8dee-32c4cf7d8f9c@molgen.mpg.de/ BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1957 Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 39 ++++++++++++++++++++++++ drivers/gpu/drm/amd/pm/legacy-dpm/legacy_dpm.c | 10 ------ drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 35 --------------------- drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 10 ------ 4 files changed, 39 insertions(+), 55 deletions(-) commit 65e54987508b6f0771f56bdfa3ee1926d52785ae Author: Miaoqian Lin Date: Thu Apr 21 17:03:09 2022 +0800 drm/amd/display: Fix memory leak in dcn21_clock_source_create When dcn20_clk_src_construct() fails, we need to release clk_src. Fixes: 6f4e6361c3ff ("drm/amd/display: Add Renoir resource (v2)") Signed-off-by: Miaoqian Lin Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 1 + 1 file changed, 1 insertion(+) commit f95af4a9236695caed24fe6401256bb974e8f2a7 Author: Alex Deucher Date: Tue Dec 28 17:26:24 2021 -0500 drm/amdgpu: don't runtime suspend if there are displays attached (v3) We normally runtime suspend when there are displays attached if they are in the DPMS off state, however, if something wakes the GPU we send a hotplug event on resume (in case any displays were connected while the GPU was in suspend) which can cause userspace to light up the displays again soon after they were turned off. Prior to commit 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's."), the driver took a runtime pm reference when the fbdev emulation was enabled because we didn't implement proper shadowing support for vram access when the device was off so the device never runtime suspended when there was a console bound. Once that commit landed, we now utilize the core fb helper implementation which properly handles the emulation, so runtime pm now suspends in cases where it did not before. Ultimately, we need to sort out why runtime suspend in not working in this case for some users, but this should restore similar behavior to before. v2: move check into runtime_suspend v3: wake ups -> wakeups in comment, retain pm_runtime behavior in runtime_idle callback Fixes: 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.") Link: https://lore.kernel.org/r/20220403132322.51c90903@darkstar.example.org/ Tested-by: Michele Ballabio Reviewed-by: Evan Quan Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 105 +++++++++++++++++++++----------- 1 file changed, 70 insertions(+), 35 deletions(-) commit f567656f8ab82e43815d8d071d9864941b613a82 Author: David Yat Sin Date: Wed Apr 13 11:37:53 2022 -0400 drm/amdkfd: CRIU add support for GWS queues Add support to checkpoint/restore GWS (Global Wave Sync) queues. Signed-off-by: David Yat Sin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) commit 7c6b6e18c890f30965b0589b0a57645e1dbccfde Author: David Yat Sin Date: Mon Apr 18 11:55:58 2022 -0400 drm/amdkfd: Fix GWS queue count dqm->gws_queue_count and pdd->qpd.mapped_gws_queue need to be updated each time the queue gets evicted. Fixes: b8020b0304c8 ("drm/amdkfd: Enable over-subscription with >1 GWS queue") Signed-off-by: David Yat Sin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 83 ++++++++++------------ 1 file changed, 37 insertions(+), 46 deletions(-) commit 8f6379e207e7d834065a080f407a60d67349d961 Author: Alexandru Elisei Date: Mon Apr 25 15:55:30 2022 +0100 KVM/arm64: Don't emulate a PMU for 32-bit guests if feature not set kvm->arch.arm_pmu is set when userspace attempts to set the first PMU attribute. As certain attributes are mandatory, arm_pmu ends up always being set to a valid arm_pmu, otherwise KVM will refuse to run the VCPU. However, this only happens if the VCPU has the PMU feature. If the VCPU doesn't have the feature bit set, kvm->arch.arm_pmu will be left uninitialized and equal to NULL. KVM doesn't do ID register emulation for 32-bit guests and accesses to the PMU registers aren't gated by the pmu_visibility() function. This is done to prevent injecting unexpected undefined exceptions in guests which have detected the presence of a hardware PMU. But even though the VCPU feature is missing, KVM still attempts to emulate certain aspects of the PMU when PMU registers are accessed. This leads to a NULL pointer dereference like this one, which happens on an odroid-c4 board when running the kvm-unit-tests pmu-cycle-counter test with kvmtool and without the PMU feature being set: [ 454.402699] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000150 [ 454.405865] Mem abort info: [ 454.408596] ESR = 0x96000004 [ 454.411638] EC = 0x25: DABT (current EL), IL = 32 bits [ 454.416901] SET = 0, FnV = 0 [ 454.419909] EA = 0, S1PTW = 0 [ 454.423010] FSC = 0x04: level 0 translation fault [ 454.427841] Data abort info: [ 454.430687] ISV = 0, ISS = 0x00000004 [ 454.434484] CM = 0, WnR = 0 [ 454.437404] user pgtable: 4k pages, 48-bit VAs, pgdp=000000000c924000 [ 454.443800] [0000000000000150] pgd=0000000000000000, p4d=0000000000000000 [ 454.450528] Internal error: Oops: 96000004 [#1] PREEMPT SMP [ 454.456036] Modules linked in: [ 454.459053] CPU: 1 PID: 267 Comm: kvm-vcpu-0 Not tainted 5.18.0-rc4 #113 [ 454.465697] Hardware name: Hardkernel ODROID-C4 (DT) [ 454.470612] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 454.477512] pc : kvm_pmu_event_mask.isra.0+0x14/0x74 [ 454.482427] lr : kvm_pmu_set_counter_event_type+0x2c/0x80 [ 454.487775] sp : ffff80000a9839c0 [ 454.491050] x29: ffff80000a9839c0 x28: ffff000000a83a00 x27: 0000000000000000 [ 454.498127] x26: 0000000000000000 x25: 0000000000000000 x24: ffff00000a510000 [ 454.505198] x23: ffff000000a83a00 x22: ffff000003b01000 x21: 0000000000000000 [ 454.512271] x20: 000000000000001f x19: 00000000000003ff x18: 0000000000000000 [ 454.519343] x17: 000000008003fe98 x16: 0000000000000000 x15: 0000000000000000 [ 454.526416] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 [ 454.533489] x11: 000000008003fdbc x10: 0000000000009d20 x9 : 000000000000001b [ 454.540561] x8 : 0000000000000000 x7 : 0000000000000d00 x6 : 0000000000009d00 [ 454.547633] x5 : 0000000000000037 x4 : 0000000000009d00 x3 : 0d09000000000000 [ 454.554705] x2 : 000000000000001f x1 : 0000000000000000 x0 : 0000000000000000 [ 454.561779] Call trace: [ 454.564191] kvm_pmu_event_mask.isra.0+0x14/0x74 [ 454.568764] kvm_pmu_set_counter_event_type+0x2c/0x80 [ 454.573766] access_pmu_evtyper+0x128/0x170 [ 454.577905] perform_access+0x34/0x80 [ 454.581527] kvm_handle_cp_32+0x13c/0x160 [ 454.585495] kvm_handle_cp15_32+0x1c/0x30 [ 454.589462] handle_exit+0x70/0x180 [ 454.592912] kvm_arch_vcpu_ioctl_run+0x1c4/0x5e0 [ 454.597485] kvm_vcpu_ioctl+0x23c/0x940 [ 454.601280] __arm64_sys_ioctl+0xa8/0xf0 [ 454.605160] invoke_syscall+0x48/0x114 [ 454.608869] el0_svc_common.constprop.0+0xd4/0xfc [ 454.613527] do_el0_svc+0x28/0x90 [ 454.616803] el0_svc+0x34/0xb0 [ 454.619822] el0t_64_sync_handler+0xa4/0x130 [ 454.624049] el0t_64_sync+0x18c/0x190 [ 454.627675] Code: a9be7bfd 910003fd f9000bf3 52807ff3 (b9415001) [ 454.633714] ---[ end trace 0000000000000000 ]--- In this particular case, Linux hasn't detected the presence of a hardware PMU because the PMU node is missing from the DTB, so userspace would have been unable to set the VCPU PMU feature even if it attempted it. What happens is that the 32-bit guest reads ID_DFR0, which advertises the presence of the PMU, and when it tries to program a counter, it triggers the NULL pointer dereference because kvm->arch.arm_pmu is NULL. kvm-arch.arm_pmu was introduced by commit 46b187821472 ("KVM: arm64: Keep a per-VM pointer to the default PMU"). Until that commit, this error would be triggered instead: [ 73.388140] ------------[ cut here ]------------ [ 73.388189] Unknown PMU version 0 [ 73.390420] WARNING: CPU: 1 PID: 264 at arch/arm64/kvm/pmu-emul.c:36 kvm_pmu_event_mask.isra.0+0x6c/0x74 [ 73.399821] Modules linked in: [ 73.402835] CPU: 1 PID: 264 Comm: kvm-vcpu-0 Not tainted 5.17.0 #114 [ 73.409132] Hardware name: Hardkernel ODROID-C4 (DT) [ 73.414048] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 73.420948] pc : kvm_pmu_event_mask.isra.0+0x6c/0x74 [ 73.425863] lr : kvm_pmu_event_mask.isra.0+0x6c/0x74 [ 73.430779] sp : ffff80000a8db9b0 [ 73.434055] x29: ffff80000a8db9b0 x28: ffff000000dbaac0 x27: 0000000000000000 [ 73.441131] x26: ffff000000dbaac0 x25: 00000000c600000d x24: 0000000000180720 [ 73.448203] x23: ffff800009ffbe10 x22: ffff00000b612000 x21: 0000000000000000 [ 73.455276] x20: 000000000000001f x19: 0000000000000000 x18: ffffffffffffffff [ 73.462348] x17: 000000008003fe98 x16: 0000000000000000 x15: 0720072007200720 [ 73.469420] x14: 0720072007200720 x13: ffff800009d32488 x12: 00000000000004e6 [ 73.476493] x11: 00000000000001a2 x10: ffff800009d32488 x9 : ffff800009d32488 [ 73.483565] x8 : 00000000ffffefff x7 : ffff800009d8a488 x6 : ffff800009d8a488 [ 73.490638] x5 : ffff0000f461a9d8 x4 : 0000000000000000 x3 : 0000000000000001 [ 73.497710] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000000dbaac0 [ 73.504784] Call trace: [ 73.507195] kvm_pmu_event_mask.isra.0+0x6c/0x74 [ 73.511768] kvm_pmu_set_counter_event_type+0x2c/0x80 [ 73.516770] access_pmu_evtyper+0x128/0x16c [ 73.520910] perform_access+0x34/0x80 [ 73.524532] kvm_handle_cp_32+0x13c/0x160 [ 73.528500] kvm_handle_cp15_32+0x1c/0x30 [ 73.532467] handle_exit+0x70/0x180 [ 73.535917] kvm_arch_vcpu_ioctl_run+0x20c/0x6e0 [ 73.540489] kvm_vcpu_ioctl+0x2b8/0x9e0 [ 73.544283] __arm64_sys_ioctl+0xa8/0xf0 [ 73.548165] invoke_syscall+0x48/0x114 [ 73.551874] el0_svc_common.constprop.0+0xd4/0xfc [ 73.556531] do_el0_svc+0x28/0x90 [ 73.559808] el0_svc+0x28/0x80 [ 73.562826] el0t_64_sync_handler+0xa4/0x130 [ 73.567054] el0t_64_sync+0x1a0/0x1a4 [ 73.570676] ---[ end trace 0000000000000000 ]--- [ 73.575382] kvm: pmu event creation failed -2 The root cause remains the same: kvm->arch.pmuver was never set to something sensible because the VCPU feature itself was never set. The odroid-c4 is somewhat of a special case, because Linux doesn't probe the PMU. But the above errors can easily be reproduced on any hardware, with or without a PMU driver, as long as userspace doesn't set the PMU feature. Work around the fact that KVM advertises a PMU even when the VCPU feature is not set by gating all PMU emulation on the feature. The guest can still access the registers without KVM injecting an undefined exception. Signed-off-by: Alexandru Elisei Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220425145530.723858-1-alexandru.elisei@arm.com arch/arm64/kvm/pmu-emul.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) commit 2a50fc5fd09798cc154b587acd4f4ee261ea19be Author: Will Deacon Date: Wed Apr 27 18:13:32 2022 +0100 KVM: arm64: Handle host stage-2 faults from 32-bit EL0 When pKVM is enabled, host memory accesses are translated by an identity mapping at stage-2, which is populated lazily in response to synchronous exceptions from 64-bit EL1 and EL0. Extend this handling to cover exceptions originating from 32-bit EL0 as well. Although these are very unlikely to occur in practice, as the kernel typically ensures that user pages are initialised before mapping them in, drivers could still map previously untouched device pages into userspace and expect things to work rather than panic the system. Cc: Quentin Perret Cc: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220427171332.13635-1-will@kernel.org arch/arm64/kvm/hyp/nvhe/host.S | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit 8f4dd16603ce834d1c5c4da67803ea82dd282511 Merge: e4d8a2999773 5603f9bdea68 Author: Linus Torvalds Date: Wed Apr 27 13:44:37 2022 -0700 Merge branch 'akpm' (patches from Andrew) Merge fixes from Andrew Morton: "Two patches. Subsystems affected by this patch series: mm/kasan and mm/debug" * emailed patches from Andrew Morton : docs: vm/page_owner: use literal blocks for param description kasan: prevent cpu_quarantine corruption when CPU offline and cache shrink occur at same time commit 5603f9bdea68406f54132125b6fdddeeb5c0d2e4 Author: Akira Yokosawa Date: Wed Apr 27 12:41:59 2022 -0700 docs: vm/page_owner: use literal blocks for param description Sphinx generates hard-to-read lists of parameters at the bottom of the page. Fix them by putting literal-block markers of "::" in front of them. Link: https://lkml.kernel.org/r/cfd3bcc0-b51d-0c68-c065-ca1c4c202447@gmail.com Signed-off-by: Akira Yokosawa Fixes: 57f2b54a9379 ("Documentation/vm/page_owner.rst: update the documentation") Cc: Shenghong Han Cc: Haowen Bai Cc: Jonathan Corbet Cc: Alex Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/page_owner.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 31fa985b4196f8a66f027672e9bf2b81fea0417c Author: Zqiang Date: Wed Apr 27 12:41:56 2022 -0700 kasan: prevent cpu_quarantine corruption when CPU offline and cache shrink occur at same time kasan_quarantine_remove_cache() is called in kmem_cache_shrink()/ destroy(). The kasan_quarantine_remove_cache() call is protected by cpuslock in kmem_cache_destroy() to ensure serialization with kasan_cpu_offline(). However the kasan_quarantine_remove_cache() call is not protected by cpuslock in kmem_cache_shrink(). When a CPU is going offline and cache shrink occurs at same time, the cpu_quarantine may be corrupted by interrupt (per_cpu_remove_cache operation). So add a cpu_quarantine offline flags check in per_cpu_remove_cache(). [akpm@linux-foundation.org: add comment, per Zqiang] Link: https://lkml.kernel.org/r/20220414025925.2423818-1-qiang1.zhang@intel.com Signed-off-by: Zqiang Reviewed-by: Dmitry Vyukov Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/quarantine.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 4b73c55fdebd8939f0f6000921075f7f6fa41397 Author: Filipe Manana Date: Thu Apr 21 11:01:22 2022 +0100 btrfs: skip compression property for anything other than files and dirs The compression property only has effect on regular files and directories (so that it's propagated to files and subdirectories created inside a directory). For any other inode type (symlink, fifo, device, socket), it's pointless to set the compression property because it does nothing and ends up unnecessarily wasting leaf space due to the pointless xattr (75 or 76 bytes, depending on the compression value). Symlinks in particular are very common (for example, I have almost 10k symlinks under /etc, /usr and /var alone) and therefore it's worth to avoid wasting leaf space with the compression xattr. For example, the compression property can end up on a symlink or character device implicitly, through inheritance from a parent directory $ mkdir /mnt/testdir $ btrfs property set /mnt/testdir compression lzo $ ln -s yadayada /mnt/testdir/lnk $ mknod /mnt/testdir/dev c 0 0 Or explicitly like this: $ ln -s yadayda /mnt/lnk $ setfattr -h -n btrfs.compression -v lzo /mnt/lnk So skip the compression property on inodes that are neither a regular file nor a directory. CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/props.c | 43 +++++++++++++++++++++++++++++++++++++++++++ fs/btrfs/props.h | 1 + fs/btrfs/xattr.c | 3 +++ 3 files changed, 47 insertions(+) commit 193b4e83986d7ee6caa8ceefb5ee9f58240fbee0 Author: Filipe Manana Date: Thu Apr 21 11:03:09 2022 +0100 btrfs: do not BUG_ON() on failure to update inode when setting xattr We are doing a BUG_ON() if we fail to update an inode after setting (or clearing) a xattr, but there's really no reason to not instead simply abort the transaction and return the error to the caller. This should be a rare error because we have previously reserved enough metadata space to update the inode and the delayed inode should have already been setup, so an -ENOSPC or -ENOMEM, which are the possible errors, are very unlikely to happen. So replace the BUG_ON()s with a transaction abort. CC: stable@vger.kernel.org # 4.9+ Reviewed-by: Qu Wenruo Reviewed-by: Anand Jain Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/xattr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit d0e64a981fd841cb0f28fcd6afcac55e6f1e6994 Author: Filipe Manana Date: Thu Apr 21 10:56:39 2022 +0100 btrfs: always log symlinks in full mode On Linux, empty symlinks are invalid, and attempting to create one with the system call symlink(2) results in an -ENOENT error and this is explicitly documented in the man page. If we rename a symlink that was created in the current transaction and its parent directory was logged before, we actually end up logging the symlink without logging its content, which is stored in an inline extent. That means that after a power failure we can end up with an empty symlink, having no content and an i_size of 0 bytes. It can be easily reproduced like this: $ mkfs.btrfs -f /dev/sdc $ mount /dev/sdc /mnt $ mkdir /mnt/testdir $ sync # Create a file inside the directory and fsync the directory. $ touch /mnt/testdir/foo $ xfs_io -c "fsync" /mnt/testdir # Create a symlink inside the directory and then rename the symlink. $ ln -s /mnt/testdir/foo /mnt/testdir/bar $ mv /mnt/testdir/bar /mnt/testdir/baz # Now fsync again the directory, this persist the log tree. $ xfs_io -c "fsync" /mnt/testdir $ mount /dev/sdc /mnt $ stat -c %s /mnt/testdir/baz 0 $ readlink /mnt/testdir/baz $ Fix this by always logging symlinks in full mode (LOG_INODE_ALL), so that their content is also logged. A test case for fstests will follow. CC: stable@vger.kernel.org # 4.9+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit 0e852ab8974cd2b5946766b2d9baf82c78ace03d Author: Chung-Chiang Cheng Date: Fri Apr 15 16:04:06 2022 +0800 btrfs: do not allow compression on nodatacow files Compression and nodatacow are mutually exclusive. A similar issue was fixed by commit f37c563bab429 ("btrfs: add missing check for nocow and compression inode flags"). Besides ioctl, there is another way to enable/disable/reset compression directly via xattr. The following steps will result in a invalid combination. $ touch bar $ chattr +C bar $ lsattr bar ---------------C-- bar $ setfattr -n btrfs.compression -v zstd bar $ lsattr bar --------c------C-- bar To align with the logic in check_fsflags, nocompress will also be unacceptable after this patch, to prevent mix any compression-related options with nodatacow. $ touch bar $ chattr +C bar $ lsattr bar ---------------C-- bar $ setfattr -n btrfs.compression -v zstd bar setfattr: bar: Invalid argument $ setfattr -n btrfs.compression -v no bar setfattr: bar: Invalid argument When both compression and nodatacow are enabled, then btrfs_run_delalloc_range prefers nodatacow and no compression happens. Reported-by: Jayce Lin CC: stable@vger.kernel.org # 5.10.x: e6f9d6964802: btrfs: export a helper for compression hard check CC: stable@vger.kernel.org # 5.10.x Reviewed-by: Filipe Manana Signed-off-by: Chung-Chiang Cheng Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/props.c | 16 +++++++++++----- fs/btrfs/props.h | 3 ++- fs/btrfs/xattr.c | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) commit e6f9d69648029e48b8f97db09368d419b5e2614a Author: Chung-Chiang Cheng Date: Fri Apr 15 16:04:05 2022 +0800 btrfs: export a helper for compression hard check inode_can_compress will be used outside of inode.c to check the availability of setting compression flag by xattr. This patch moves this function as an internal helper and renames it to btrfs_inode_can_compress. Reviewed-by: Nikolay Borisov Signed-off-by: Chung-Chiang Cheng Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/btrfs_inode.h | 11 +++++++++++ fs/btrfs/inode.c | 15 ++------------- 2 files changed, 13 insertions(+), 13 deletions(-) commit 4cddeacad6d4b23493a108d0705e7d2ab89ba5a3 Author: Tejun Heo Date: Wed Apr 27 09:49:12 2022 -1000 Revert "block: inherit request start time from bio for BLK_CGROUP" This reverts commit 0006707723233cb2a9a23ca19fc3d0864835704c. It has a couple problems: * bio_issue_time() is stored in bio->bi_issue truncated to 51 bits. This overflows in slightly over 26 days. Setting rq->io_start_time_ns with it means that io duration calculation would yield >26days after 26 days of uptime. This, for example, confuses kyber making it cause high IO latencies. * rq->io_start_time_ns should record the time that the IO is issued to the device so that on-device latency can be measured. However, bio_issue_time() is set before the bio goes through the rq-qos controllers (wbt, iolatency, iocost), so when the bio gets throttled in any of the mechanisms, the measured latencies make no sense - on-device latencies end up higher than request-alloc-to-completion latencies. We'll need a smarter way to avoid calling ktime_get_ns() repeatedly back-to-back. For now, let's revert the commit. Signed-off-by: Tejun Heo Cc: stable@vger.kernel.org # v5.16+ Link: https://lore.kernel.org/r/YmmeOLfo5lzc+8yI@slm.duckdns.org Signed-off-by: Jens Axboe block/blk-mq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) commit 7eac3bd38d18cd3317756649921b8264ddfee692 Author: Artem Bityutskiy Date: Wed Apr 27 09:08:53 2022 +0300 intel_idle: Fix SPR C6 optimization The Sapphire Rapids (SPR) C6 optimization was added to the end of the 'spr_idle_state_table_update()' function. However, the function has a 'return' which may happen before the optimization has a chance to run. And this may prevent the optimization from happening. This is an unlikely scenario, but possible if user boots with, say, the 'intel_idle.preferred_cstates=6' kernel boot option. This patch fixes the issue by eliminating the problematic 'return' statement. Fixes: 3a9cf77b60dc ("intel_idle: add core C6 optimization for SPR") Suggested-by: Jan Beulich Reported-by: Jan Beulich Signed-off-by: Artem Bityutskiy [ rjw: Minor changelog edits ] Signed-off-by: Rafael J. Wysocki drivers/idle/intel_idle.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 39c184a6a9a7a99950b321d55fe713175cf1d404 Author: Artem Bityutskiy Date: Wed Apr 27 09:08:52 2022 +0300 intel_idle: Fix the 'preferred_cstates' module parameter Problem description. When user boots kernel up with the 'intel_idle.preferred_cstates=4' option, we enable C1E and disable C1 states on Sapphire Rapids Xeon (SPR). In order for C1E to work on SPR, we have to enable the C1E promotion bit on all CPUs. However, we enable it only on one CPU. Fix description. The 'intel_idle' driver already has the infrastructure for disabling C1E promotion on every CPU. This patch uses the same infrastructure for enabling C1E promotion on every CPU. It changes the boolean 'disable_promotion_to_c1e' variable to a tri-state 'c1e_promotion' variable. Tested on a 2-socket SPR system. I verified the following combinations: * C1E promotion enabled and disabled in BIOS. * Booted with and without the 'intel_idle.preferred_cstates=4' kernel argument. In all 4 cases C1E promotion was correctly set on all CPUs. Also tested on an old Broadwell system, just to make sure it does not cause a regression. C1E promotion was correctly disabled on that system, both C1 and C1E were exposed (as expected). Fixes: da0e58c038e6 ("intel_idle: add 'preferred_cstates' module argument") Reported-by: Jan Beulich Signed-off-by: Artem Bityutskiy [ rjw: Minor changelog edits ] Signed-off-by: Rafael J. Wysocki drivers/idle/intel_idle.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) commit e17fd4bf54fb579d03566ab22a02dc03b36f4d06 Author: Rob Herring Date: Tue Apr 26 08:35:08 2022 -0500 dt-bindings: leds-mt6360: Drop redundant 'unevaluatedProperties' The binding has both 'unevaluatedProperties: false' and 'additionalProperties: false' which is redundant. 'additionalProperties' is the stricter of the two, so drop 'unevaluatedProperties'. Fixes: e05cab34e417 ("dt-bindings: leds: Add bindings for MT6360 LED") Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220426133508.1849580-1-robh@kernel.org Documentation/devicetree/bindings/leds/leds-mt6360.yaml | 2 -- 1 file changed, 2 deletions(-) commit f9095ac1ba1ce407cecc1df93c05ad4ac504661c Author: Krzysztof Kozlowski Date: Wed Apr 27 08:58:02 2022 +0200 dt-bindings: ufs: cdns,ufshc: Add power-domains The Cadence UFS controller can be part of power domain (as it is in example DTS of TI J721e UFS Host Controller Glue), so allow such property. Reported-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220427065802.110402-1-krzysztof.kozlowski@linaro.org Documentation/devicetree/bindings/ufs/cdns,ufshc.yaml | 3 +++ 1 file changed, 3 insertions(+) commit 0f03610b20ccf72c7bd8cf297c1666a430f6992e Merge: af2d861d4cd2 e4e6448638a0 Author: Rafael J. Wysocki Date: Wed Apr 27 20:20:03 2022 +0200 Merge tag 'cpufreq-arm-fixes-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull ARM cpufreq fixes for 5.18-rc5 from Viresh Kumar: "- Fix issues with the Qualcomm's cpufreq driver (Dmitry Baryshkov and Vladimir Zapolskiy). - Fix memory leak with the Sun501 driver (Xiaobing Luo)." * tag 'cpufreq-arm-fixes-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: qcom-cpufreq-hw: Clear dcvs interrupts cpufreq: fix memory leak in sun50i_cpufreq_nvmem_probe cpufreq: qcom-cpufreq-hw: Fix throttle frequency value on EPSS platforms cpufreq: qcom-hw: provide online/offline operations cpufreq: qcom-hw: fix the opp entries refcounting cpufreq: qcom-hw: fix the race between LMH worker and cpuhp cpufreq: qcom-hw: drop affinity hint before freeing the IRQ commit e4d8a29997731b3bb14059024b24df9f784288d0 Author: Mikulas Patocka Date: Wed Apr 27 11:26:40 2022 -0400 hex2bin: fix access beyond string end If we pass too short string to "hex2bin" (and the string size without the terminating NUL character is even), "hex2bin" reads one byte after the terminating NUL character. This patch fixes it. Note that hex_to_bin returns -1 on error and hex2bin return -EINVAL on error - so we can't just return the variable "hi" or "lo" on error. This inconsistency may be fixed in the next merge window, but for the purpose of fixing this bug, we just preserve the existing behavior and return -1 and -EINVAL. Signed-off-by: Mikulas Patocka Reviewed-by: Andy Shevchenko Fixes: b78049831ffe ("lib: add error checking to hex2bin") Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds lib/hexdump.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit e5be15767e7e284351853cbaba80cde8620341fb Author: Mikulas Patocka Date: Mon Apr 25 08:07:48 2022 -0400 hex2bin: make the function hex_to_bin constant-time The function hex2bin is used to load cryptographic keys into device mapper targets dm-crypt and dm-integrity. It should take constant time independent on the processed data, so that concurrently running unprivileged code can't infer any information about the keys via microarchitectural convert channels. This patch changes the function hex_to_bin so that it contains no branches and no memory accesses. Note that this shouldn't cause performance degradation because the size of the new function is the same as the size of the old function (on x86-64) - and the new function causes no branch misprediction penalties. I compile-tested this function with gcc on aarch64 alpha arm hppa hppa64 i386 ia64 m68k mips32 mips64 powerpc powerpc64 riscv sh4 s390x sparc32 sparc64 x86_64 and with clang on aarch64 arm hexagon i386 mips32 mips64 powerpc powerpc64 s390x sparc32 sparc64 x86_64 to verify that there are no branches in the generated code. Signed-off-by: Mikulas Patocka Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds include/linux/kernel.h | 2 +- lib/hexdump.c | 32 +++++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) commit c7d2f89fea26c84d5accc55d9976dd7e5305e63a Author: Shin'ichiro Kawasaki Date: Tue Apr 12 16:56:36 2022 +0900 bus: fsl-mc-msi: Fix MSI descriptor mutex lock for msi_first_desc() Commit e8604b1447b4 introduced a call to the helper function msi_first_desc(), which needs MSI descriptor mutex lock before call. However, the required mutex lock was not added. This results in lockdep assertion: WARNING: CPU: 4 PID: 119 at kernel/irq/msi.c:274 msi_first_desc+0xd0/0x10c msi_first_desc+0xd0/0x10c fsl_mc_msi_domain_alloc_irqs+0x7c/0xc0 fsl_mc_populate_irq_pool+0x80/0x3cc Fix this by adding the mutex lock and unlock around the function call. Fixes: e8604b1447b4 ("bus: fsl-mc-msi: Simplify MSI descriptor handling") Signed-off-by: Shin'ichiro Kawasaki Signed-off-by: Thomas Gleixner Reviewed-by: Damien Le Moal Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220412075636.755454-1-shinichiro.kawasaki@wdc.com drivers/bus/fsl-mc/fsl-mc-msi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit ad8d869343ae4a07a2038a4ca923f699308c8323 Author: Minchan Kim Date: Wed Apr 27 10:21:51 2022 -0700 kernfs: fix NULL dereferencing in kernfs_remove kernfs_remove supported NULL kernfs_node param to bail out but revent per-fs lock change introduced regression that dereferencing the param without NULL check so kernel goes crash. This patch checks the NULL kernfs_node in kernfs_remove and if so, just return. Quote from bug report by Jirka ``` The bug is triggered by running NAS Parallel benchmark suite on SuperMicro servers with 2x Xeon(R) Gold 6126 CPU. Here is the error log: [ 247.035564] BUG: kernel NULL pointer dereference, address: 0000000000000008 [ 247.036009] #PF: supervisor read access in kernel mode [ 247.036009] #PF: error_code(0x0000) - not-present page [ 247.036009] PGD 0 P4D 0 [ 247.036009] Oops: 0000 [#1] PREEMPT SMP PTI [ 247.058060] CPU: 1 PID: 6546 Comm: umount Not tainted 5.16.0393c3714081a53795bbff0e985d24146def6f57f+ #16 [ 247.058060] Hardware name: Supermicro Super Server/X11DDW-L, BIOS 2.0b 03/07/2018 [ 247.058060] RIP: 0010:kernfs_remove+0x8/0x50 [ 247.058060] Code: 4c 89 e0 5b 5d 41 5c 41 5d 41 5e c3 49 c7 c4 f4 ff ff ff eb b2 66 66 2e 0f 1f 84 00 00 00 00 00 66 90 0f 1f 44 00 00 41 54 55 <48> 8b 47 08 48 89 fd 48 85 c0 48 0f 44 c7 4c 8b 60 50 49 83 c4 60 [ 247.058060] RSP: 0018:ffffbbfa48a27e48 EFLAGS: 00010246 [ 247.058060] RAX: 0000000000000001 RBX: ffffffff89e31f98 RCX: 0000000080200018 [ 247.058060] RDX: 0000000080200019 RSI: fffff6760786c900 RDI: 0000000000000000 [ 247.058060] RBP: ffffffff89e31f98 R08: ffff926b61b24d00 R09: 0000000080200018 [ 247.122048] R10: ffff926b61b24d00 R11: ffff926a8040c000 R12: ffff927bd09a2000 [ 247.122048] R13: ffffffff89e31fa0 R14: dead000000000122 R15: dead000000000100 [ 247.122048] FS: 00007f01be0a8c40(0000) GS:ffff926fa8e40000(0000) knlGS:0000000000000000 [ 247.122048] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 247.122048] CR2: 0000000000000008 CR3: 00000001145c6003 CR4: 00000000007706e0 [ 247.122048] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 247.122048] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 247.122048] PKRU: 55555554 [ 247.122048] Call Trace: [ 247.122048] [ 247.122048] rdt_kill_sb+0x29d/0x350 [ 247.122048] deactivate_locked_super+0x36/0xa0 [ 247.122048] cleanup_mnt+0x131/0x190 [ 247.122048] task_work_run+0x5c/0x90 [ 247.122048] exit_to_user_mode_prepare+0x229/0x230 [ 247.122048] syscall_exit_to_user_mode+0x18/0x40 [ 247.122048] do_syscall_64+0x48/0x90 [ 247.122048] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 247.122048] RIP: 0033:0x7f01be2d735b ``` Link: https://bugzilla.kernel.org/show_bug.cgi?id=215696 Link: https://lore.kernel.org/lkml/CAE4VaGDZr_4wzRn2___eDYRtmdPaGGJdzu_LCSkJYuY9BEO3cw@mail.gmail.com/ Fixes: 393c3714081a (kernfs: switch global kernfs_rwsem lock to per-fs lock) Cc: stable@vger.kernel.org Reported-by: Jirka Hladky Tested-by: Jirka Hladky Acked-by: Tejun Heo Signed-off-by: Minchan Kim Link: https://lore.kernel.org/r/20220427172152.3505364-1-minchan@kernel.org Signed-off-by: Greg Kroah-Hartman fs/kernfs/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 211ed5480aff457ac1a9e333e68522ef4a0c6ce9 Merge: 03498b7131b8 1da18a296f5b Author: Linus Torvalds Date: Wed Apr 27 10:30:29 2022 -0700 Merge tag 'zonefs-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs Pull zonefs fixes from Damien Le Moal: "Two fixes for rc5: - Fix inode initialization to make sure that the inode flags are all cleared. - Use zone reset operation instead of close to make sure that the zone of an empty sequential file in never in an active state after closing the file" * tag 'zonefs-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/zonefs: zonefs: Fix management of open zones zonefs: Clear inode information flags on inode creation commit 3f65b1e2f424f44585bd701024a3bfd0b1e0ade2 Author: Kuogee Hsieh Date: Tue Apr 26 14:12:14 2022 -0700 drm/msm/dp: remove fail safe mode related code Current DP driver implementation has adding safe mode done at dp_hpd_plug_handle() which is expected to be executed under event thread context. However there is possible circular locking happen (see blow stack trace) after edp driver call dp_hpd_plug_handle() from dp_bridge_enable() which is executed under drm_thread context. After review all possibilities methods and as discussed on https://patchwork.freedesktop.org/patch/483155/, supporting EDID compliance tests in the driver is quite hacky. As seen with other vendor drivers, supporting these will be much easier with IGT. Hence removing all the related fail safe code for it so that no possibility of circular lock will happen. Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov ====================================================== WARNING: possible circular locking dependency detected 5.15.35-lockdep #6 Tainted: G W ------------------------------------------------------ frecon/429 is trying to acquire lock: ffffff808dc3c4e8 (&dev->mode_config.mutex){+.+.}-{3:3}, at: dp_panel_add_fail_safe_mode+0x4c/0xa0 but task is already holding lock: ffffff808dc441e0 (&kms->commit_lock[i]){+.+.}-{3:3}, at: lock_crtcs+0xb4/0x124 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&kms->commit_lock[i]){+.+.}-{3:3}: __mutex_lock_common+0x174/0x1a64 mutex_lock_nested+0x98/0xac lock_crtcs+0xb4/0x124 msm_atomic_commit_tail+0x330/0x748 commit_tail+0x19c/0x278 drm_atomic_helper_commit+0x1dc/0x1f0 drm_atomic_commit+0xc0/0xd8 drm_atomic_helper_set_config+0xb4/0x134 drm_mode_setcrtc+0x688/0x1248 drm_ioctl_kernel+0x1e4/0x338 drm_ioctl+0x3a4/0x684 __arm64_sys_ioctl+0x118/0x154 invoke_syscall+0x78/0x224 el0_svc_common+0x178/0x200 do_el0_svc+0x94/0x13c el0_svc+0x5c/0xec el0t_64_sync_handler+0x78/0x108 el0t_64_sync+0x1a4/0x1a8 -> #2 (crtc_ww_class_mutex){+.+.}-{3:3}: __mutex_lock_common+0x174/0x1a64 ww_mutex_lock+0xb8/0x278 modeset_lock+0x304/0x4ac drm_modeset_lock+0x4c/0x7c drmm_mode_config_init+0x4a8/0xc50 msm_drm_init+0x274/0xac0 msm_drm_bind+0x20/0x2c try_to_bring_up_master+0x3dc/0x470 __component_add+0x18c/0x3c0 component_add+0x1c/0x28 dp_display_probe+0x954/0xa98 platform_probe+0x124/0x15c really_probe+0x1b0/0x5f8 __driver_probe_device+0x174/0x20c driver_probe_device+0x70/0x134 __device_attach_driver+0x130/0x1d0 bus_for_each_drv+0xfc/0x14c __device_attach+0x1bc/0x2bc device_initial_probe+0x1c/0x28 bus_probe_device+0x94/0x178 deferred_probe_work_func+0x1a4/0x1f0 process_one_work+0x5d4/0x9dc worker_thread+0x898/0xccc kthread+0x2d4/0x3d4 ret_from_fork+0x10/0x20 -> #1 (crtc_ww_class_acquire){+.+.}-{0:0}: ww_acquire_init+0x1c4/0x2c8 drm_modeset_acquire_init+0x44/0xc8 drm_helper_probe_single_connector_modes+0xb0/0x12dc drm_mode_getconnector+0x5dc/0xfe8 drm_ioctl_kernel+0x1e4/0x338 drm_ioctl+0x3a4/0x684 __arm64_sys_ioctl+0x118/0x154 invoke_syscall+0x78/0x224 el0_svc_common+0x178/0x200 do_el0_svc+0x94/0x13c el0_svc+0x5c/0xec el0t_64_sync_handler+0x78/0x108 el0t_64_sync+0x1a4/0x1a8 -> #0 (&dev->mode_config.mutex){+.+.}-{3:3}: __lock_acquire+0x2650/0x672c lock_acquire+0x1b4/0x4ac __mutex_lock_common+0x174/0x1a64 mutex_lock_nested+0x98/0xac dp_panel_add_fail_safe_mode+0x4c/0xa0 dp_hpd_plug_handle+0x1f0/0x280 dp_bridge_enable+0x94/0x2b8 drm_atomic_bridge_chain_enable+0x11c/0x168 drm_atomic_helper_commit_modeset_enables+0x500/0x740 msm_atomic_commit_tail+0x3e4/0x748 commit_tail+0x19c/0x278 drm_atomic_helper_commit+0x1dc/0x1f0 drm_atomic_commit+0xc0/0xd8 drm_atomic_helper_set_config+0xb4/0x134 drm_mode_setcrtc+0x688/0x1248 drm_ioctl_kernel+0x1e4/0x338 drm_ioctl+0x3a4/0x684 __arm64_sys_ioctl+0x118/0x154 invoke_syscall+0x78/0x224 el0_svc_common+0x178/0x200 do_el0_svc+0x94/0x13c el0_svc+0x5c/0xec el0t_64_sync_handler+0x78/0x108 el0t_64_sync+0x1a4/0x1a8 Changes in v2: -- re text commit title -- remove all fail safe mode Changes in v3: -- remove dp_panel_add_fail_safe_mode() from dp_panel.h -- add Fixes Changes in v5: -- to=dianders@chromium.org Changes in v6: -- fix Fixes commit ID Fixes: 8b2c181e3dcf ("drm/msm/dp: add fail safe mode outside of event_mutex context") Reported-by: Douglas Anderson Signed-off-by: Kuogee Hsieh Link: https://lore.kernel.org/r/1651007534-31842-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Rob Clark drivers/gpu/drm/msm/dp/dp_display.c | 6 ------ drivers/gpu/drm/msm/dp/dp_panel.c | 11 ----------- drivers/gpu/drm/msm/dp/dp_panel.h | 1 - 3 files changed, 18 deletions(-) commit 03498b7131b874166724ca016178932d0b5781aa Merge: 233087ca0636 ba7542eb2dd5 Author: Linus Torvalds Date: Wed Apr 27 10:14:52 2022 -0700 Merge tag 'mtd/fixes-for-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD fixes from Miquel Raynal: "Core fix: - Fix a possible data corruption of the 'part' field in mtd_info Rawnand fixes: - Fix the check on the return value of wait_for_completion_timeout - Fix wrong ECC parameters for mt7622 - Fix a possible memory corruption that might panic in the Qcom driver" * tag 'mtd/fixes-for-5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: qcom: fix memory corruption that causes panic mtd: fix 'part' field data corruption in mtd_info mtd: rawnand: Fix return value check of wait_for_completion_timeout mtd: rawnand: fix ecc parameters for mt7622 commit 7b5148be4a6e1119523f7546c5c3d112ed6c40c2 Author: Jakub Kicinski Date: Tue Apr 26 10:57:23 2022 -0700 Add Eric Dumazet to networking maintainers Welcome Eric! Acked-by: Paolo Abeni Signed-off-by: David S. Miller Link: https://lore.kernel.org/r/20220426175723.417614-1-kuba@kernel.org Signed-off-by: Jakub Kicinski MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) commit 233087ca063686964a53c829d547c7571e3f67bf Author: Willy Tarreau Date: Tue Apr 26 23:41:05 2022 +0300 floppy: disable FDRAWCMD by default Minh Yuan reported a concurrency use-after-free issue in the floppy code between raw_cmd_ioctl and seek_interrupt. [ It turns out this has been around, and that others have reported the KASAN splats over the years, but Minh Yuan had a reproducer for it and so gets primary credit for reporting it for this fix - Linus ] The problem is, this driver tends to break very easily and nowadays, nobody is expected to use FDRAWCMD anyway since it was used to manipulate non-standard formats. The risk of breaking the driver is higher than the risk presented by this race, and accessing the device requires privileges anyway. Let's just add a config option to completely disable this ioctl and leave it disabled by default. Distros shouldn't use it, and only those running on antique hardware might need to enable it. Link: https://lore.kernel.org/all/000000000000b71cdd05d703f6bf@google.com/ Link: https://lore.kernel.org/lkml/CAKcFiNC=MfYVW-Jt9A3=FPJpTwCD2PL_ULNCpsCVE5s8ZeBQgQ@mail.gmail.com Link: https://lore.kernel.org/all/CAEAjamu1FRhz6StCe_55XY5s389ZP_xmCF69k987En+1z53=eg@mail.gmail.com Reported-by: Minh Yuan Reported-by: syzbot+8e8958586909d62b6840@syzkaller.appspotmail.com Reported-by: cruise k Reported-by: Kyungtae Kim Suggested-by: Linus Torvalds Tested-by: Denis Efremov Signed-off-by: Willy Tarreau Signed-off-by: Linus Torvalds drivers/block/Kconfig | 16 ++++++++++++++++ drivers/block/floppy.c | 43 ++++++++++++++++++++++++++++++++----------- 2 files changed, 48 insertions(+), 11 deletions(-) commit eb2fd9b43fae0c51982ac4229535b6cfd77380db Author: Tom Rix Date: Sat Apr 23 08:30:48 2022 -0400 platform/x86/intel: pmc/core: change pmc_lpm_modes to static Sparse reports this issue core.c: note: in included file: core.h:239:12: warning: symbol 'pmc_lpm_modes' was not declared. Should it be static? Global variables should not be defined in headers. This only works because core.h is only included by core.c. Single file use variables should be static, so change its storage-class specifier to static. Signed-off-by: Tom Rix Reviewed-by: David E. Box Link: https://lore.kernel.org/r/20220423123048.591405-1-trix@redhat.com Signed-off-by: Hans de Goede drivers/platform/x86/intel/pmc/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 00dd3ace931b4d2f6e5e9ccf4bf738fe46b64289 Author: David E. Box Date: Wed Apr 20 08:56:22 2022 -0700 platform/x86/intel/sdsi: Fix bug in multi packet reads Fix bug that added an offset to the mailbox addr during multi-packet reads. Did not affect current ABI since it doesn't support multi-packet transactions. Fixes: 2546c6000430 ("platform/x86: Add Intel Software Defined Silicon driver") Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20220420155622.1763633-4-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/intel/sdsi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit a30393b36ca84be7c70733b7c1e39d311f5919f3 Author: David E. Box Date: Wed Apr 20 08:56:21 2022 -0700 platform/x86/intel/sdsi: Poll on ready bit for writes Due to change in firmware flow, update mailbox writes to poll on ready bit instead of run_busy bit. This change makes the polling method consistent for both writes and reads, which also uses the ready bit. Fixes: 2546c6000430 ("platform/x86: Add Intel Software Defined Silicon driver") Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20220420155622.1763633-3-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/intel/sdsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 679c7a3f1596e8b5493c9473da4d967de540027c Author: David E. Box Date: Wed Apr 20 08:56:20 2022 -0700 platform/x86/intel/sdsi: Handle leaky bucket To prevent an agent from indefinitely holding the mailbox firmware has implemented a leaky bucket algorithm. Repeated access to the mailbox may now incur a delay of up to 2.1 seconds. Add a retry loop that tries for up to 2.5 seconds to acquire the mailbox. Fixes: 2546c6000430 ("platform/x86: Add Intel Software Defined Silicon driver") Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20220420155622.1763633-2-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/intel/sdsi.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) commit 8d75f7b4a3dfd5714a5dc87cfdaa27bd2d14aa48 Author: Srinivas Pandruvada Date: Wed Apr 27 03:03:04 2022 -0700 platform/x86: intel-uncore-freq: Prevent driver loading in guests Loading this driver in guests results in unchecked MSR access error for MSR 0x620. There is no use of reading and modifying package/die scope uncore MSRs in guests. So check for CPU feature X86_FEATURE_HYPERVISOR to prevent loading of this driver in guests. Fixes: dbce412a7733 ("platform/x86/intel-uncore-freq: Split common and enumeration part") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215870 Suggested-by: Borislav Petkov Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220427100304.2562990-1-srinivas.pandruvada@linux.intel.com Signed-off-by: Hans de Goede drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c | 3 +++ 1 file changed, 3 insertions(+) commit e5483b45f6ed62e5434e74af2025a15d415480af Author: Darryn Anton Jordan Date: Thu Apr 14 16:24:43 2022 +0200 platform/x86: gigabyte-wmi: added support for B660 GAMING X DDR4 motherboard This works on my system. Signed-off-by: Darryn Anton Jordan Acked-by: Thomas Weißschuh Link: https://lore.kernel.org/r/Ylguq87YG+9L3foV@hark Signed-off-by: Hans de Goede drivers/platform/x86/gigabyte-wmi.c | 1 + 1 file changed, 1 insertion(+) commit 89a8f23fee5ef7545ef6470ef61b61f336df7b49 Author: Gabriele Mazzotta Date: Tue Apr 26 14:08:27 2022 +0200 platform/x86: dell-laptop: Add quirk entry for Latitude 7520 The Latitude 7520 supports AC timeouts, but it has no KBD_LED_AC_TOKEN and so changes to stop_timeout appear to have no effect if the laptop is plugged in. Signed-off-by: Gabriele Mazzotta Acked-by: Pali Rohár Link: https://lore.kernel.org/r/20220426120827.12363-1-gabriele.mzt@gmail.com Signed-off-by: Hans de Goede drivers/platform/x86/dell/dell-laptop.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 9fe1bb29ea0ab231aa916dad4bcf0c435beb5869 Author: Hans de Goede Date: Wed Apr 27 13:49:56 2022 +0200 platform/x86: asus-wmi: Fix driver not binding when fan curve control probe fails Before this commit fan_curve_check_present() was trying to not cause the probe to fail on devices without fan curve control by testing for known error codes returned by asus_wmi_evaluate_method_buf(). Checking for ENODATA or ENODEV, with the latter being returned by this function when an ACPI integer with a value of ASUS_WMI_UNSUPPORTED_METHOD is returned. But for other ACPI integer returns this function just returns them as is, including the ASUS_WMI_DSTS_UNKNOWN_BIT value of 2. On the Asus U36SD ASUS_WMI_DSTS_UNKNOWN_BIT gets returned, leading to: asus-nb-wmi: probe of asus-nb-wmi failed with error 2 Instead of playing whack a mole with error codes here, simply treat all errors as there not being any fan curves, fixing the driver no longer loading on the Asus U36SD laptop. Fixes: e3d13da7f77d ("platform/x86: asus-wmi: Fix regression when probing for fan curve control") BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2079125 Cc: Luke D. Jones Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220427114956.332919-1-hdegoede@redhat.com drivers/platform/x86/asus-wmi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 4345ece8f0bcc682f1fb3b648922c9be5f7dbe6c Author: Dan Carpenter Date: Wed Apr 13 10:37:44 2022 +0300 platform/x86: asus-wmi: Potential buffer overflow in asus_wmi_evaluate_method_buf() This code tests for if the obj->buffer.length is larger than the buffer but then it just does the memcpy() anyway. Fixes: 0f0ac158d28f ("platform/x86: asus-wmi: Add support for custom fan curves") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220413073744.GB8812@kili Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/asus-wmi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 8c936f9ea11ec4e35e288810a7503b5c841a355f Author: Tejun Heo Date: Tue Apr 26 19:01:01 2022 -1000 iocost: don't reset the inuse weight of under-weighted debtors When an iocg is in debt, its inuse weight is owned by debt handling and should stay at 1. This invariant was broken when determining the amount of surpluses at the beginning of donation calculation - when an iocg's hierarchical weight is too low, the iocg is excluded from donation calculation and its inuse is reset to its active regardless of its indebtedness, triggering warnings like the following: WARNING: CPU: 5 PID: 0 at block/blk-iocost.c:1416 iocg_kick_waitq+0x392/0x3a0 ... RIP: 0010:iocg_kick_waitq+0x392/0x3a0 Code: 00 00 be ff ff ff ff 48 89 4d a8 e8 98 b2 70 00 48 8b 4d a8 85 c0 0f 85 4a fe ff ff 0f 0b e9 43 fe ff ff 0f 0b e9 4d fe ff ff <0f> 0b e9 50 fe ff ff e8 a2 ae 70 00 66 90 0f 1f 44 00 00 55 48 89 RSP: 0018:ffffc90000200d08 EFLAGS: 00010016 ... ioc_timer_fn+0x2e0/0x1470 call_timer_fn+0xa1/0x2c0 ... As this happens only when an iocg's hierarchical weight is negligible, its impact likely is limited to triggering the warnings. Fix it by skipping resetting inuse of under-weighted debtors. Signed-off-by: Tejun Heo Reported-by: Rik van Riel Fixes: c421a3eb2e27 ("blk-iocost: revamp debt handling") Cc: stable@vger.kernel.org # v5.10+ Link: https://lore.kernel.org/r/YmjODd4aif9BzFuO@slm.duckdns.org Signed-off-by: Jens Axboe block/blk-iocost.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 626873c446f7559d5af8b48cefad903ffd85cf4e Author: Volodymyr Mytnyk Date: Wed Apr 27 14:09:00 2022 +0300 netfilter: conntrack: fix udp offload timeout sysctl `nf_flowtable_udp_timeout` sysctl option is available only if CONFIG_NFT_FLOW_OFFLOAD enabled. But infra for this flow offload UDP timeout was added under CONFIG_NF_FLOW_TABLE config option. So, if you have CONFIG_NFT_FLOW_OFFLOAD disabled and CONFIG_NF_FLOW_TABLE enabled, the `nf_flowtable_udp_timeout` is not present in sysfs. Please note, that TCP flow offload timeout sysctl option is present even CONFIG_NFT_FLOW_OFFLOAD is disabled. I suppose it was a typo in commit that adds UDP flow offload timeout and CONFIG_NF_FLOW_TABLE should be used instead. Fixes: 975c57504da1 ("netfilter: conntrack: Introduce udp offload timeout configuration") Signed-off-by: Volodymyr Mytnyk Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_conntrack_standalone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c7aab4f17021b636a0ee75bcf28e06fb7c94ab48 Author: Florian Westphal Date: Mon Apr 25 11:47:11 2022 +0200 netfilter: nf_conntrack_tcp: re-init for syn packets only Jaco Kroon reported tcp problems that Eric Dumazet and Neal Cardwell pinpointed to nf_conntrack tcp_in_window() bug. tcp trace shows following sequence: I > R Flags [S], seq 3451342529, win 62580, options [.. tfo [|tcp]> R > I Flags [S.], seq 2699962254, ack 3451342530, win 65535, options [..] R > I Flags [P.], seq 1:89, ack 1, [..] Note 3rd ACK is from responder to initiator so following branch is taken: } else if (((state->state == TCP_CONNTRACK_SYN_SENT && dir == IP_CT_DIR_ORIGINAL) || (state->state == TCP_CONNTRACK_SYN_RECV && dir == IP_CT_DIR_REPLY)) && after(end, sender->td_end)) { ... because state == TCP_CONNTRACK_SYN_RECV and dir is REPLY. This causes the scaling factor to be reset to 0: window scale option is only present in syn(ack) packets. This in turn makes nf_conntrack mark valid packets as out-of-window. This was always broken, it exists even in original commit where window tracking was added to ip_conntrack (nf_conntrack predecessor) in 2.6.9-rc1 kernel. Restrict to 'tcph->syn', just like the 3rd condtional added in commit 82b72cb94666 ("netfilter: conntrack: re-init state for retransmitted syn-ack"). Upon closer look, those conditionals/branches can be merged: Because earlier checks prevent syn-ack from showing up in original direction, the 'dir' checks in the conditional quoted above are redundant, remove them. Return early for pure syn retransmitted in reply direction (simultaneous open). Fixes: 9fb9cbb1082d ("[NETFILTER]: Add nf_conntrack subsystem.") Reported-by: Jaco Kroon Signed-off-by: Florian Westphal Acked-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_conntrack_proto_tcp.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) commit c61711c1c95791850be48dd65a1d72eb34ba719f Author: Ajit Kumar Pandey Date: Tue Apr 26 13:33:57 2022 -0500 ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback We are accessing "desc->ops" in sof_pci_probe without checking "desc" pointer. This results in NULL pointer exception if pci_id->driver_data i.e desc pointer isn't defined in sof device probe: BUG: kernel NULL pointer dereference, address: 0000000000000060 PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI RIP: 0010:sof_pci_probe+0x1e/0x17f [snd_sof_pci] Code: Unable to access opcode bytes at RIP 0xffffffffc043dff4. RSP: 0018:ffffac4b03b9b8d8 EFLAGS: 00010246 Add NULL pointer check for sof_dev_desc pointer to avoid such exception. Reviewed-by: Ranjani Sridharan Signed-off-by: Ajit Kumar Pandey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220426183357.102155-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-pci-dev.c | 5 +++++ 1 file changed, 5 insertions(+) commit 08da09f028043fed9653331ae75bc310411f72e6 Author: Zev Weiss Date: Tue Apr 26 20:51:09 2022 -0700 hwmon: (pmbus) delta-ahe50dc-fan: work around hardware quirk CLEAR_FAULTS commands can apparently sometimes trigger catastrophic power output glitches on the ahe-50dc, so block them from being sent at all. Signed-off-by: Zev Weiss Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220427035109.3819-1-zev@bewilderbeest.net Fixes: d387d88ed045 ("hwmon: (pmbus) Add Delta AHE-50DC fan control module driver") Signed-off-by: Guenter Roeck drivers/hwmon/pmbus/delta-ahe50dc-fan.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit 8b202ee218395319aec1ef44f72043e1fbaccdd6 Author: Sven Schnelle Date: Mon Apr 25 14:17:42 2022 +0200 s390: disable -Warray-bounds gcc-12 shows a lot of array bound warnings on s390. This is caused by the S390_lowcore macro which uses a hardcoded address of 0. Wrapping that with absolute_pointer() works, but gcc no longer knows that a 12 bit displacement is sufficient to access lowcore. So it emits instructions like 'lghi %r1,0; l %rx,xxx(%r1)' instead of a single load/store instruction. As s390 stores variables often read/written in lowcore, this is considered problematic. Therefore disable -Warray-bounds on s390 for gcc-12 for the time being, until there is a better solution. Signed-off-by: Sven Schnelle Link: https://lore.kernel.org/r/yt9dzgkelelc.fsf@linux.ibm.com Link: https://lore.kernel.org/r/20220422134308.1613610-1-svens@linux.ibm.com Link: https://lore.kernel.org/r/20220425121742.3222133-1-svens@linux.ibm.com Signed-off-by: Heiko Carstens arch/s390/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) commit a1bde8c92d27d178a988bfd13d229c170b8135aa Merge: 71cffebf6358 b668f4cd715a Author: David S. Miller Date: Wed Apr 27 10:58:39 2022 +0100 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-04-26 This series contains updates to ice driver only. Ivan Vecera removes races related to VF message processing by changing mutex_trylock() call to mutex_lock() and moving additional operations to occur under mutex. Petr Oros increases wait time after firmware flash as current time is not sufficient. Jake resolves a use-after-free issue for mailbox snapshot. ==================== Signed-off-by: David S. Miller commit 5a1e99b61b0c81388cde0c808b3e4173907df19f Author: Jens Axboe Date: Tue Apr 26 19:34:57 2022 -0600 io_uring: check reserved fields for recv/recvmsg We should check unused fields for non-zero and -EINVAL if they are set, making it consistent with other opcodes. Fixes: aa1fa28fc73e ("io_uring: add support for recvmsg()") Signed-off-by: Jens Axboe fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) commit 588faa1ea5eecb351100ee5d187b9be99210f70d Author: Jens Axboe Date: Tue Apr 26 19:34:11 2022 -0600 io_uring: check reserved fields for send/sendmsg We should check unused fields for non-zero and -EINVAL if they are set, making it consistent with other opcodes. Fixes: 0fa03c624d8f ("io_uring: add support for sendmsg()") Signed-off-by: Jens Axboe fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) commit 71cffebf6358a7f5031f5b208bbdc1cb4db6e539 Author: Martin Blumenstingl Date: Mon Apr 25 17:20:27 2022 +0200 net: dsa: lantiq_gswip: Don't set GSWIP_MII_CFG_RMII_CLK Commit 4b5923249b8fa4 ("net: dsa: lantiq_gswip: Configure all remaining GSWIP_MII_CFG bits") added all known bits in the GSWIP_MII_CFGp register. It helped bring this register into a well-defined state so the driver has to rely less on the bootloader to do things right. Unfortunately it also sets the GSWIP_MII_CFG_RMII_CLK bit without any possibility to configure it. Upon further testing it turns out that all boards which are supported by the GSWIP driver in OpenWrt which use an RMII PHY have a dedicated oscillator on the board which provides the 50MHz RMII reference clock. Don't set the GSWIP_MII_CFG_RMII_CLK bit (but keep the code which always clears it) to fix support for the Fritz!Box 7362 SL in OpenWrt. This is a board with two Atheros AR8030 RMII PHYs. With the "RMII clock" bit set the MAC also generates the RMII reference clock whose signal then conflicts with the signal from the oscillator on the board. This results in a constant cycle of the PHY detecting link up/down (and as a result of that: the two ports using the AR8030 PHYs are not working). At the time of writing this patch there's no known board where the MAC (GSWIP) has to generate the RMII reference clock. If needed this can be implemented in future by providing a device-tree flag so the GSWIP_MII_CFG_RMII_CLK bit can be toggled per port. Fixes: 4b5923249b8fa4 ("net: dsa: lantiq_gswip: Configure all remaining GSWIP_MII_CFG bits") Tested-by: Jan Hoffmann Signed-off-by: Martin Blumenstingl Acked-by: Hauke Mehrtens Link: https://lore.kernel.org/r/20220425152027.2220750-1-martin.blumenstingl@googlemail.com Signed-off-by: Jakub Kicinski drivers/net/dsa/lantiq_gswip.c | 3 --- 1 file changed, 3 deletions(-) commit 6510ea973d8d9d4a0cb2fb557b36bd1ab3eb49f6 Author: Sebastian Andrzej Siewior Date: Mon Apr 25 18:39:46 2022 +0200 net: Use this_cpu_inc() to increment net->core_stats The macro dev_core_stats_##FIELD##_inc() disables preemption and invokes netdev_core_stats_alloc() to return a per-CPU pointer. netdev_core_stats_alloc() will allocate memory on its first invocation which breaks on PREEMPT_RT because it requires non-atomic context for memory allocation. This can be avoided by enabling preemption in netdev_core_stats_alloc() assuming the caller always disables preemption. It might be better to replace local_inc() with this_cpu_inc() now that dev_core_stats_##FIELD##_inc() gained a preempt-disable section and does not rely on already disabled preemption. This results in less instructions on x86-64: local_inc: | incl %gs:__preempt_count(%rip) # __preempt_count | movq 488(%rdi), %rax # _1->core_stats, _22 | testq %rax, %rax # _22 | je .L585 #, | add %gs:this_cpu_off(%rip), %rax # this_cpu_off, tcp_ptr__ | .L586: | testq %rax, %rax # _27 | je .L587 #, | incq (%rax) # _6->a.counter | .L587: | decl %gs:__preempt_count(%rip) # __preempt_count this_cpu_inc(), this patch: | movq 488(%rdi), %rax # _1->core_stats, _5 | testq %rax, %rax # _5 | je .L591 #, | .L585: | incq %gs:(%rax) # _18->rx_dropped Use unsigned long as type for the counter. Use this_cpu_inc() to increment the counter. Use a plain read of the counter. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/YmbO0pxgtKpCw4SY@linutronix.de Signed-off-by: Jakub Kicinski include/linux/netdevice.h | 21 +++++++++------------ net/core/dev.c | 14 +++++--------- 2 files changed, 14 insertions(+), 21 deletions(-) commit 46cf2c613f4b10eb12f749207b0fd2c1bfae3088 Merge: cf424ef014ac 0c9843a74a85 Author: Linus Torvalds Date: Tue Apr 26 16:34:11 2022 -0700 Merge tag 'pinctrl-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: - Fix some register offsets on Intel Alderlake - Fix the order the UFS and SDC pins on Qualcomm SM6350 - Fix a build error in Mediatek Moore. - Fix a pin function table in the Sunplus SP7021. - Fix some Kconfig and static keywords on the Samsung Tesla FSD SoC. - Fix up the EOI function for edge triggered IRQs and keep the block clock enabled for level IRQs in the STM32 driver. - Fix some bits and order in the Rockchip RK3308 driver. - Handle the errorpath in the Pistachio driver probe() properly. * tag 'pinctrl-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: pistachio: fix use of irq_of_parse_and_map() pinctrl: stm32: Keep pinctrl block clock enabled when LEVEL IRQ requested pinctrl: rockchip: sort the rk3308_mux_recalced_data entries pinctrl: rockchip: fix RK3308 pinmux bits pinctrl: stm32: Do not call stm32_gpio_get() for edge triggered IRQs in EOI pinctrl: Fix an error in pin-function table of SP7021 pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config pinctrl: mediatek: moore: Fix build error pinctrl: qcom: sm6350: fix order of UFS & SDC pins pinctrl: alderlake: Fix register offsets for ADL-N variant pinctrl: samsung: staticize fsd_pin_ctrl commit cf424ef014ac30b0da27125dd1fbdf10b0d3a520 Merge: 4fad37d595b9 6fbe0cc53a1b Author: Linus Torvalds Date: Tue Apr 26 11:32:01 2022 -0700 Merge tag 'for-5.18/fbdev-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev fixes and updates from Helge Deller: "A bunch of outstanding fbdev patches - all trivial and small" * tag 'for-5.18/fbdev-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: video: fbdev: clps711x-fb: Use syscon_regmap_lookup_by_phandle video: fbdev: mmp: replace usage of found with dedicated list iterator variable video: fbdev: sh_mobile_lcdcfb: Remove sh_mobile_lcdc_check_var() declaration video: fbdev: i740fb: Error out if 'pixclock' equals zero video: fbdev: i740fb: use memset_io() to clear screen video: fbdev: s3fb: Error out if 'pixclock' equals zero video: fbdev: arkfb: Error out if 'pixclock' equals zero video: fbdev: tridentfb: Error out if 'pixclock' equals zero video: fbdev: vt8623fb: Error out if 'pixclock' equals zero video: fbdev: kyro: Error out if 'lineclock' equals zero video: fbdev: neofb: Fix the check of 'var->pixclock' video: fbdev: imxfb: Fix missing of_node_put in imxfb_probe video: fbdev: omap: Make it CCF clk API compatible video: fbdev: aty/matrox/...: Prepare cleanup of powerpc's asm/prom.h video: fbdev: pm2fb: Fix a kernel-doc formatting issue linux/fb.h: Spelling s/palette/palette/ video: fbdev: sis: fix potential NULL dereference in sisfb_post_sis300() video: fbdev: pxafb: use if else instead video: fbdev: udlfb: properly check endpoint type video: fbdev: of: display_timing: Remove a redundant zeroing of memory commit 4fad37d595b9d9a2996467d780cb2e7a1b08b2c0 Merge: fd574a2f841c e57f9af73d6b Author: Linus Torvalds Date: Tue Apr 26 11:17:18 2022 -0700 Merge tag 'gfs2-v5.18-rc4-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 fix from Andreas Gruenbacher: - Only re-check for direct I/O writes past the end of the file after re-acquiring the inode glock. * tag 'gfs2-v5.18-rc4-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Don't re-check for write past EOF unnecessarily commit 9b3628d79b46f06157affc56fdb218fdd4988321 Author: Luiz Augusto von Dentz Date: Fri Apr 22 12:58:18 2022 -0700 Bluetooth: hci_sync: Cleanup hci_conn if it cannot be aborted This attempts to cleanup the hci_conn if it cannot be aborted as otherwise it would likely result in having the controller and host stack out of sync with respect to connection handle. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann include/net/bluetooth/hci_core.h | 2 +- net/bluetooth/hci_conn.c | 32 ++++++++++++++++++++++++-------- net/bluetooth/hci_event.c | 13 ++++--------- net/bluetooth/hci_sync.c | 11 ++++++++++- 4 files changed, 39 insertions(+), 19 deletions(-) commit fd574a2f841c8f07b20e5b55391e0af5d39d82ff Merge: d615b5416f8a 5f0addf7b890 Author: Linus Torvalds Date: Tue Apr 26 11:10:42 2022 -0700 Merge tag 'for-5.18-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - direct IO fixes: - restore passing file offset to correctly calculate checksums when repairing on read and bio split happens - use correct bio when sumitting IO on zoned filesystem - zoned mode fixes: - fix selection of device to correctly calculate device capabilities when allocating a new bio - use a dedicated lock for exclusion during relocation - fix leaked plug after failure syncing log - fix assertion during scrub and relocation * tag 'for-5.18-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: zoned: use dedicated lock for data relocation btrfs: fix assertion failure during scrub due to block group reallocation btrfs: fix direct I/O writes for split bios on zoned devices btrfs: fix direct I/O read repair for split bios btrfs: fix and document the zoned device choice in alloc_new_bio btrfs: fix leaked plug after failure syncing log on zoned filesystems commit aef2aa4fa98e18ea5d9345bf777ee698c8598728 Author: Luiz Augusto von Dentz Date: Fri Apr 22 12:58:17 2022 -0700 Bluetooth: hci_event: Fix creating hci_conn object on error status It is useless to create a hci_conn object if on error status as the result would be it being freed in the process and anyway it is likely the result of controller and host stack being out of sync. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann net/bluetooth/hci_event.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit c86cc5a3ec70f5644f1fa21610b943d0441bc1f7 Author: Luiz Augusto von Dentz Date: Fri Apr 22 12:58:16 2022 -0700 Bluetooth: hci_event: Fix checking for invalid handle on error status Commit d5ebaa7c5f6f6 introduces checks for handle range (e.g HCI_CONN_HANDLE_MAX) but controllers like Intel AX200 don't seem to respect the valid range int case of error status: > HCI Event: Connect Complete (0x03) plen 11 Status: Page Timeout (0x04) Handle: 65535 Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment& Sound Products Inc) Link type: ACL (0x01) Encryption: Disabled (0x00) [1644965.827560] Bluetooth: hci0: Ignoring HCI_Connection_Complete for invalid handle Because of it is impossible to cleanup the connections properly since the stack would attempt to cancel the connection which is no longer in progress causing the following trace: < HCI Command: Create Connection Cancel (0x01|0x0008) plen 6 Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment& Sound Products Inc) = bluetoothd: src/profile.c:record_cb() Unable to get Hands-Free Voice gateway SDP record: Connection timed out > HCI Event: Command Complete (0x0e) plen 10 Create Connection Cancel (0x01|0x0008) ncmd 1 Status: Unknown Connection Identifier (0x02) Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment& Sound Products Inc) < HCI Command: Create Connection Cancel (0x01|0x0008) plen 6 Address: 94:DB:56:XX:XX:XX (Sony Home Entertainment& Sound Products Inc) Fixes: d5ebaa7c5f6f6 ("Bluetooth: hci_event: Ignore multiple conn complete events") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann include/net/bluetooth/hci.h | 1 + net/bluetooth/hci_event.c | 65 +++++++++++++++++++++++++-------------------- 2 files changed, 37 insertions(+), 29 deletions(-) commit b668f4cd715a297737c6e5952bc609a25b9af944 Author: Jacob Keller Date: Tue Apr 12 10:34:22 2022 -0700 ice: fix use-after-free when deinitializing mailbox snapshot During ice_sriov_configure, if num_vfs is 0, we are being asked by the kernel to remove all VFs. The driver first de-initializes the snapshot before freeing all the VFs. This results in a use-after-free BUG detected by KASAN. The bug occurs because the snapshot can still be accessed until all VFs are removed. Fix this by freeing all the VFs first before calling ice_mbx_deinit_snapshot. [ +0.032591] ================================================================== [ +0.000021] BUG: KASAN: use-after-free in ice_mbx_vf_state_handler+0x1c3/0x410 [ice] [ +0.000315] Write of size 28 at addr ffff889908eb6f28 by task kworker/55:2/1530996 [ +0.000029] CPU: 55 PID: 1530996 Comm: kworker/55:2 Kdump: loaded Tainted: G S I 5.17.0-dirty #1 [ +0.000022] Hardware name: Dell Inc. PowerEdge R740/0923K0, BIOS 1.6.13 12/17/2018 [ +0.000013] Workqueue: ice ice_service_task [ice] [ +0.000279] Call Trace: [ +0.000012] [ +0.000011] dump_stack_lvl+0x33/0x42 [ +0.000030] print_report.cold.13+0xb2/0x6b3 [ +0.000028] ? ice_mbx_vf_state_handler+0x1c3/0x410 [ice] [ +0.000295] kasan_report+0xa5/0x120 [ +0.000026] ? __switch_to_asm+0x21/0x70 [ +0.000024] ? ice_mbx_vf_state_handler+0x1c3/0x410 [ice] [ +0.000298] kasan_check_range+0x183/0x1e0 [ +0.000019] memset+0x1f/0x40 [ +0.000018] ice_mbx_vf_state_handler+0x1c3/0x410 [ice] [ +0.000304] ? ice_conv_link_speed_to_virtchnl+0x160/0x160 [ice] [ +0.000297] ? ice_vsi_dis_spoofchk+0x40/0x40 [ice] [ +0.000305] ice_is_malicious_vf+0x1aa/0x250 [ice] [ +0.000303] ? ice_restore_all_vfs_msi_state+0x160/0x160 [ice] [ +0.000297] ? __mutex_unlock_slowpath.isra.15+0x410/0x410 [ +0.000022] ? ice_debug_cq+0xb7/0x230 [ice] [ +0.000273] ? __kasan_slab_alloc+0x2f/0x90 [ +0.000022] ? memset+0x1f/0x40 [ +0.000017] ? do_raw_spin_lock+0x119/0x1d0 [ +0.000022] ? rwlock_bug.part.2+0x60/0x60 [ +0.000024] __ice_clean_ctrlq+0x3a6/0xd60 [ice] [ +0.000273] ? newidle_balance+0x5b1/0x700 [ +0.000026] ? ice_print_link_msg+0x2f0/0x2f0 [ice] [ +0.000271] ? update_cfs_group+0x1b/0x140 [ +0.000018] ? load_balance+0x1260/0x1260 [ +0.000022] ? ice_process_vflr_event+0x27/0x130 [ice] [ +0.000301] ice_service_task+0x136e/0x1470 [ice] [ +0.000281] process_one_work+0x3b4/0x6c0 [ +0.000030] worker_thread+0x65/0x660 [ +0.000023] ? __kthread_parkme+0xe4/0x100 [ +0.000021] ? process_one_work+0x6c0/0x6c0 [ +0.000020] kthread+0x179/0x1b0 [ +0.000018] ? kthread_complete_and_exit+0x20/0x20 [ +0.000022] ret_from_fork+0x22/0x30 [ +0.000026] [ +0.000018] Allocated by task 10742: [ +0.000013] kasan_save_stack+0x1c/0x40 [ +0.000018] __kasan_kmalloc+0x84/0xa0 [ +0.000016] kmem_cache_alloc_trace+0x16c/0x2e0 [ +0.000015] intel_iommu_probe_device+0xeb/0x860 [ +0.000015] __iommu_probe_device+0x9a/0x2f0 [ +0.000016] iommu_probe_device+0x43/0x270 [ +0.000015] iommu_bus_notifier+0xa7/0xd0 [ +0.000015] blocking_notifier_call_chain+0x90/0xc0 [ +0.000017] device_add+0x5f3/0xd70 [ +0.000014] pci_device_add+0x404/0xa40 [ +0.000015] pci_iov_add_virtfn+0x3b0/0x550 [ +0.000016] sriov_enable+0x3bb/0x600 [ +0.000013] ice_ena_vfs+0x113/0xa79 [ice] [ +0.000293] ice_sriov_configure.cold.17+0x21/0xe0 [ice] [ +0.000291] sriov_numvfs_store+0x160/0x200 [ +0.000015] kernfs_fop_write_iter+0x1db/0x270 [ +0.000018] new_sync_write+0x21d/0x330 [ +0.000013] vfs_write+0x376/0x410 [ +0.000013] ksys_write+0xba/0x150 [ +0.000012] do_syscall_64+0x3a/0x80 [ +0.000012] entry_SYSCALL_64_after_hwframe+0x44/0xae [ +0.000028] Freed by task 10742: [ +0.000011] kasan_save_stack+0x1c/0x40 [ +0.000015] kasan_set_track+0x21/0x30 [ +0.000016] kasan_set_free_info+0x20/0x30 [ +0.000012] __kasan_slab_free+0x104/0x170 [ +0.000016] kfree+0x9b/0x470 [ +0.000013] devres_destroy+0x1c/0x20 [ +0.000015] devm_kfree+0x33/0x40 [ +0.000012] ice_mbx_deinit_snapshot+0x39/0x70 [ice] [ +0.000295] ice_sriov_configure+0xb0/0x260 [ice] [ +0.000295] sriov_numvfs_store+0x1bc/0x200 [ +0.000015] kernfs_fop_write_iter+0x1db/0x270 [ +0.000016] new_sync_write+0x21d/0x330 [ +0.000012] vfs_write+0x376/0x410 [ +0.000012] ksys_write+0xba/0x150 [ +0.000012] do_syscall_64+0x3a/0x80 [ +0.000012] entry_SYSCALL_64_after_hwframe+0x44/0xae [ +0.000024] Last potentially related work creation: [ +0.000010] kasan_save_stack+0x1c/0x40 [ +0.000016] __kasan_record_aux_stack+0x98/0xa0 [ +0.000013] insert_work+0x34/0x160 [ +0.000015] __queue_work+0x20e/0x650 [ +0.000016] queue_work_on+0x4c/0x60 [ +0.000015] nf_nat_masq_schedule+0x297/0x2e0 [nf_nat] [ +0.000034] masq_device_event+0x5a/0x60 [nf_nat] [ +0.000031] raw_notifier_call_chain+0x5f/0x80 [ +0.000017] dev_close_many+0x1d6/0x2c0 [ +0.000015] unregister_netdevice_many+0x4e3/0xa30 [ +0.000015] unregister_netdevice_queue+0x192/0x1d0 [ +0.000014] iavf_remove+0x8f9/0x930 [iavf] [ +0.000058] pci_device_remove+0x65/0x110 [ +0.000015] device_release_driver_internal+0xf8/0x190 [ +0.000017] pci_stop_bus_device+0xb5/0xf0 [ +0.000014] pci_stop_and_remove_bus_device+0xe/0x20 [ +0.000016] pci_iov_remove_virtfn+0x19c/0x230 [ +0.000015] sriov_disable+0x4f/0x170 [ +0.000014] ice_free_vfs+0x9a/0x490 [ice] [ +0.000306] ice_sriov_configure+0xb8/0x260 [ice] [ +0.000294] sriov_numvfs_store+0x1bc/0x200 [ +0.000015] kernfs_fop_write_iter+0x1db/0x270 [ +0.000016] new_sync_write+0x21d/0x330 [ +0.000012] vfs_write+0x376/0x410 [ +0.000012] ksys_write+0xba/0x150 [ +0.000012] do_syscall_64+0x3a/0x80 [ +0.000012] entry_SYSCALL_64_after_hwframe+0x44/0xae [ +0.000025] The buggy address belongs to the object at ffff889908eb6f00 which belongs to the cache kmalloc-96 of size 96 [ +0.000016] The buggy address is located 40 bytes inside of 96-byte region [ffff889908eb6f00, ffff889908eb6f60) [ +0.000026] The buggy address belongs to the physical page: [ +0.000010] page:00000000b7e99a2e refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1908eb6 [ +0.000016] flags: 0x57ffffc0000200(slab|node=1|zone=2|lastcpupid=0x1fffff) [ +0.000024] raw: 0057ffffc0000200 ffffea0069d9fd80 dead000000000002 ffff88810004c780 [ +0.000015] raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 [ +0.000009] page dumped because: kasan: bad access detected [ +0.000016] Memory state around the buggy address: [ +0.000012] ffff889908eb6e00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc [ +0.000014] ffff889908eb6e80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc [ +0.000014] >ffff889908eb6f00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc [ +0.000011] ^ [ +0.000013] ffff889908eb6f80: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc [ +0.000013] ffff889908eb7000: fa fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb [ +0.000012] ================================================================== Fixes: 0891c89674e8 ("ice: warn about potentially malicious VFs") Reported-by: Slawomir Laba Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b537752e6cbf0e4475c165178ca02241b53ff6ef Author: Petr Oros Date: Wed Apr 13 17:37:45 2022 +0200 ice: wait 5 s for EMP reset after firmware flash We need to wait 5 s for EMP reset after firmware flash. Code was extracted from OOT driver (ice v1.8.3 downloaded from sourceforge). Without this wait, fw_activate let card in inconsistent state and recoverable only by second flash/activate. Flash was tested on these fw's: From -> To 3.00 -> 3.10/3.20 3.10 -> 3.00/3.20 3.20 -> 3.00/3.10 Reproducer: [root@host ~]# devlink dev flash pci/0000:ca:00.0 file E810_XXVDA4_FH_O_SEC_FW_1p6p1p9_NVM_3p10_PLDMoMCTP_0.11_8000AD7B.bin Preparing to flash [fw.mgmt] Erasing [fw.mgmt] Erasing done [fw.mgmt] Flashing 100% [fw.mgmt] Flashing done 100% [fw.undi] Erasing [fw.undi] Erasing done [fw.undi] Flashing 100% [fw.undi] Flashing done 100% [fw.netlist] Erasing [fw.netlist] Erasing done [fw.netlist] Flashing 100% [fw.netlist] Flashing done 100% Activate new firmware by devlink reload [root@host ~]# devlink dev reload pci/0000:ca:00.0 action fw_activate reload_actions_performed: fw_activate [root@host ~]# ip link show ens7f0 71: ens7f0: mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000 link/ether b4:96:91:dc:72:e0 brd ff:ff:ff:ff:ff:ff altname enp202s0f0 dmesg after flash: [ 55.120788] ice: Copyright (c) 2018, Intel Corporation. [ 55.274734] ice 0000:ca:00.0: Get PHY capabilities failed status = -5, continuing anyway [ 55.569797] ice 0000:ca:00.0: The DDP package was successfully loaded: ICE OS Default Package version 1.3.28.0 [ 55.603629] ice 0000:ca:00.0: Get PHY capability failed. [ 55.608951] ice 0000:ca:00.0: ice_init_nvm_phy_type failed: -5 [ 55.647348] ice 0000:ca:00.0: PTP init successful [ 55.675536] ice 0000:ca:00.0: DCB is enabled in the hardware, max number of TCs supported on this port are 8 [ 55.685365] ice 0000:ca:00.0: FW LLDP is disabled, DCBx/LLDP in SW mode. [ 55.692179] ice 0000:ca:00.0: Commit DCB Configuration to the hardware [ 55.701382] ice 0000:ca:00.0: 126.024 Gb/s available PCIe bandwidth, limited by 16.0 GT/s PCIe x8 link at 0000:c9:02.0 (capable of 252.048 Gb/s with 16.0 GT/s PCIe x16 link) Reboot doesn’t help, only second flash/activate with OOT or patched driver put card back in consistent state. After patch: [root@host ~]# devlink dev flash pci/0000:ca:00.0 file E810_XXVDA4_FH_O_SEC_FW_1p6p1p9_NVM_3p10_PLDMoMCTP_0.11_8000AD7B.bin Preparing to flash [fw.mgmt] Erasing [fw.mgmt] Erasing done [fw.mgmt] Flashing 100% [fw.mgmt] Flashing done 100% [fw.undi] Erasing [fw.undi] Erasing done [fw.undi] Flashing 100% [fw.undi] Flashing done 100% [fw.netlist] Erasing [fw.netlist] Erasing done [fw.netlist] Flashing 100% [fw.netlist] Flashing done 100% Activate new firmware by devlink reload [root@host ~]# devlink dev reload pci/0000:ca:00.0 action fw_activate reload_actions_performed: fw_activate [root@host ~]# ip link show ens7f0 19: ens7f0: mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether b4:96:91:dc:72:e0 brd ff:ff:ff:ff:ff:ff altname enp202s0f0 Fixes: 399e27dbbd9e94 ("ice: support immediate firmware activation via devlink reload") Signed-off-by: Petr Oros Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_main.c | 3 +++ 1 file changed, 3 insertions(+) commit 77d64d285be5f8d427893e9c54425b1e4f5d9be7 Author: Ivan Vecera Date: Tue Apr 19 16:22:21 2022 +0200 ice: Protect vf_state check by cfg_lock in ice_vc_process_vf_msg() Previous patch labelled "ice: Fix incorrect locking in ice_vc_process_vf_msg()" fixed an issue with ignored messages sent by VF driver but a small race window still left. Recently caught trace during 'ip link set ... vf 0 vlan ...' operation: [ 7332.995625] ice 0000:3b:00.0: Clearing port VLAN on VF 0 [ 7333.001023] iavf 0000:3b:01.0: Reset indication received from the PF [ 7333.007391] iavf 0000:3b:01.0: Scheduling reset task [ 7333.059575] iavf 0000:3b:01.0: PF returned error -5 (IAVF_ERR_PARAM) to our request 3 [ 7333.059626] ice 0000:3b:00.0: Invalid message from VF 0, opcode 3, len 4, error -1 Setting of VLAN for VF causes a reset of the affected VF using ice_reset_vf() function that runs with cfg_lock taken: 1. ice_notify_vf_reset() informs IAVF driver that reset is needed and IAVF schedules its own reset procedure 2. Bit ICE_VF_STATE_DIS is set in vf->vf_state 3. Misc initialization steps 4. ice_sriov_post_vsi_rebuild() -> ice_vf_set_initialized() and that clears ICE_VF_STATE_DIS in vf->vf_state Step 3 is mentioned race window because IAVF reset procedure runs in parallel and one of its step is sending of VIRTCHNL_OP_GET_VF_RESOURCES message (opcode==3). This message is handled in ice_vc_process_vf_msg() and if it is received during the mentioned race window then it's marked as invalid and error is returned to VF driver. Protect vf_state check in ice_vc_process_vf_msg() by cfg_lock to avoid this race condition. Fixes: e6ba5273d4ed ("ice: Fix race conditions between virtchnl handling and VF ndo ops") Tested-by: Fei Liu Signed-off-by: Ivan Vecera Reviewed-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_virtchnl.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) commit aaf461af729b81dbb19ec33abe6da74702b352d2 Author: Ivan Vecera Date: Fri Apr 1 12:40:52 2022 +0200 ice: Fix incorrect locking in ice_vc_process_vf_msg() Usage of mutex_trylock() in ice_vc_process_vf_msg() is incorrect because message sent from VF is ignored and never processed. Use mutex_lock() instead to fix the issue. It is safe because this mutex is used to prevent races between VF related NDOs and handlers processing request messages from VF and these handlers are running in ice_service_task() context. Additionally move this mutex lock prior ice_vc_is_opcode_allowed() call to avoid potential races during allowlist access. Fixes: e6ba5273d4ed ("ice: Fix race conditions between virtchnl handling and VF ndo ops") Signed-off-by: Ivan Vecera Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_virtchnl.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) commit ac0280a9ca106c5501257e79d165f968712b5899 Author: Arnaud Pouliquen Date: Mon Apr 4 11:05:27 2022 +0200 RISC-V: 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: Anup Patel Link: https://lore.kernel.org/r/20220404090527.582217-1-arnaud.pouliquen@foss.st.com Reviewed-by: Mathieu Poirier Signed-off-by: Palmer Dabbelt arch/riscv/configs/defconfig | 1 + arch/riscv/configs/rv32_defconfig | 1 + 2 files changed, 2 insertions(+) commit ba3beec2ec1d3b4fd8672ca6e781dac4b3267f6e Author: Maciej Fijalkowski Date: Mon Apr 25 17:37:45 2022 +0200 xsk: Fix possible crash when multiple sockets are created Fix a crash that happens if an Rx only socket is created first, then a second socket is created that is Tx only and bound to the same umem as the first socket and also the same netdev and queue_id together with the XDP_SHARED_UMEM flag. In this specific case, the tx_descs array page pool was not created by the first socket as it was an Rx only socket. When the second socket is bound it needs this tx_descs array of this shared page pool as it has a Tx component, but unfortunately it was never allocated, leading to a crash. Note that this array is only used for zero-copy drivers using the batched Tx APIs, currently only ice and i40e. [ 5511.150360] BUG: kernel NULL pointer dereference, address: 0000000000000008 [ 5511.158419] #PF: supervisor write access in kernel mode [ 5511.164472] #PF: error_code(0x0002) - not-present page [ 5511.170416] PGD 0 P4D 0 [ 5511.173347] Oops: 0002 [#1] PREEMPT SMP PTI [ 5511.178186] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G E 5.18.0-rc1+ #97 [ 5511.187245] Hardware name: Intel Corp. GRANTLEY/GRANTLEY, BIOS GRRFCRB1.86B.0276.D07.1605190235 05/19/2016 [ 5511.198418] RIP: 0010:xsk_tx_peek_release_desc_batch+0x198/0x310 [ 5511.205375] Code: c0 83 c6 01 84 c2 74 6d 8d 46 ff 23 07 44 89 e1 48 83 c0 14 48 c1 e1 04 48 c1 e0 04 48 03 47 10 4c 01 c1 48 8b 50 08 48 8b 00 <48> 89 51 08 48 89 01 41 80 bd d7 00 00 00 00 75 82 48 8b 19 49 8b [ 5511.227091] RSP: 0018:ffffc90000003dd0 EFLAGS: 00010246 [ 5511.233135] RAX: 0000000000000000 RBX: ffff88810c8da600 RCX: 0000000000000000 [ 5511.241384] RDX: 000000000000003c RSI: 0000000000000001 RDI: ffff888115f555c0 [ 5511.249634] RBP: ffffc90000003e08 R08: 0000000000000000 R09: ffff889092296b48 [ 5511.257886] R10: 0000ffffffffffff R11: ffff889092296800 R12: 0000000000000000 [ 5511.266138] R13: ffff88810c8db500 R14: 0000000000000040 R15: 0000000000000100 [ 5511.274387] FS: 0000000000000000(0000) GS:ffff88903f800000(0000) knlGS:0000000000000000 [ 5511.283746] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 5511.290389] CR2: 0000000000000008 CR3: 00000001046e2001 CR4: 00000000003706f0 [ 5511.298640] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 5511.306892] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 5511.315142] Call Trace: [ 5511.317972] [ 5511.320301] ice_xmit_zc+0x68/0x2f0 [ice] [ 5511.324977] ? ktime_get+0x38/0xa0 [ 5511.328913] ice_napi_poll+0x7a/0x6a0 [ice] [ 5511.333784] __napi_poll+0x2c/0x160 [ 5511.337821] net_rx_action+0xdd/0x200 [ 5511.342058] __do_softirq+0xe6/0x2dd [ 5511.346198] irq_exit_rcu+0xb5/0x100 [ 5511.350339] common_interrupt+0xa4/0xc0 [ 5511.354777] [ 5511.357201] [ 5511.359625] asm_common_interrupt+0x1e/0x40 [ 5511.364466] RIP: 0010:cpuidle_enter_state+0xd2/0x360 [ 5511.370211] Code: 49 89 c5 0f 1f 44 00 00 31 ff e8 e9 00 7b ff 45 84 ff 74 12 9c 58 f6 c4 02 0f 85 72 02 00 00 31 ff e8 02 0c 80 ff fb 45 85 f6 <0f> 88 11 01 00 00 49 63 c6 4c 2b 2c 24 48 8d 14 40 48 8d 14 90 49 [ 5511.391921] RSP: 0018:ffffffff82a03e60 EFLAGS: 00000202 [ 5511.397962] RAX: ffff88903f800000 RBX: 0000000000000001 RCX: 000000000000001f [ 5511.406214] RDX: 0000000000000000 RSI: ffffffff823400b9 RDI: ffffffff8234c046 [ 5511.424646] RBP: ffff88810a384800 R08: 000005032a28c046 R09: 0000000000000008 [ 5511.443233] R10: 000000000000000b R11: 0000000000000006 R12: ffffffff82bcf700 [ 5511.461922] R13: 000005032a28c046 R14: 0000000000000001 R15: 0000000000000000 [ 5511.480300] cpuidle_enter+0x29/0x40 [ 5511.494329] do_idle+0x1c7/0x250 [ 5511.507610] cpu_startup_entry+0x19/0x20 [ 5511.521394] start_kernel+0x649/0x66e [ 5511.534626] secondary_startup_64_no_verify+0xc3/0xcb [ 5511.549230] Detect such case during bind() and allocate this memory region via newly introduced xp_alloc_tx_descs(). Also, use kvcalloc instead of kcalloc as for other buffer pool allocations, so that it matches the kvfree() from xp_destroy(). Fixes: d1bc532e99be ("i40e: xsk: Move tmp desc array from driver to pool") Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20220425153745.481322-1-maciej.fijalkowski@intel.com include/net/xsk_buff_pool.h | 1 + net/xdp/xsk.c | 13 +++++++++++++ net/xdp/xsk_buff_pool.c | 16 ++++++++++++---- 3 files changed, 26 insertions(+), 4 deletions(-) commit aa22125c57f9e577f0a667e4fa07fc3fa8ca1e60 Author: Mark Brown Date: Sat Apr 23 14:12:39 2022 +0100 ASoC: ops: Validate input values in snd_soc_put_volsw_range() Check that values written via snd_soc_put_volsw_range() are within the range advertised by the control, ensuring that we don't write out of spec values to the hardware. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220423131239.3375261-1-broonie@kernel.org Signed-off-by: Mark Brown sound/soc/soc-ops.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) commit 1d661ed54d8613c97bcff2c7d6181c61e482a1da Author: Adam Zabrocki Date: Fri Apr 22 18:40:27 2022 +0200 kprobes: Fix KRETPROBES when CONFIG_KRETPROBE_ON_RETHOOK is set The recent kernel change in 73f9b911faa7 ("kprobes: Use rethook for kretprobe if possible"), introduced a potential NULL pointer dereference bug in the KRETPROBE mechanism. The official Kprobes documentation defines that "Any or all handlers can be NULL". Unfortunately, there is a missing return handler verification to fulfill these requirements and can result in a NULL pointer dereference bug. This patch adds such verification in kretprobe_rethook_handler() function. Fixes: 73f9b911faa7 ("kprobes: Use rethook for kretprobe if possible") Signed-off-by: Adam Zabrocki Signed-off-by: Daniel Borkmann Acked-by: Masami Hiramatsu Cc: Steven Rostedt Cc: Naveen N. Rao Cc: Anil S. Keshavamurthy Link: https://lore.kernel.org/bpf/20220422164027.GA7862@pi3.com.pl kernel/kprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e57f9af73d6b0ffb5f1aeaf6cec9a751dd8535c9 Author: Andreas Gruenbacher Date: Tue Apr 19 20:51:50 2022 +0200 gfs2: Don't re-check for write past EOF unnecessarily Only re-check for direct I/O writes past the end of the file after re-acquiring the inode glock. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dc3ae06c5f2170d879ff58696f629d8c3868aec3 Author: Samuel Holland Date: Sun Apr 24 11:26:21 2022 -0500 drm/sun4i: Remove obsolete references to PHYS_OFFSET commit b4bdc4fbf8d0 ("soc: sunxi: Deal with the MBUS DMA offsets in a central place") added a platform device notifier that sets the DMA offset for all of the display engine frontend and backend devices. The code applying the offset to DMA buffer physical addresses was then removed from the backend driver in commit 756668ba682e ("drm/sun4i: backend: Remove the MBUS quirks"), but the code subtracting PHYS_OFFSET was left in the frontend driver. As a result, the offset was applied twice in the frontend driver. This likely went unnoticed because it only affects specific configurations (scaling or certain pixel formats) where the frontend is used, on boards with both one of these older SoCs and more than 1 GB of DRAM. In addition, the references to PHYS_OFFSET prevent compiling the driver on architectures where PHYS_OFFSET is not defined. Fixes: b4bdc4fbf8d0 ("soc: sunxi: Deal with the MBUS DMA offsets in a central place") Reviewed-by: Jernej Skrabec Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220424162633.12369-4-samuel@sholland.org drivers/gpu/drm/sun4i/sun4i_frontend.c | 3 --- 1 file changed, 3 deletions(-) commit 03e607cbb2931374db1825f371e9c7f28526d3f4 Author: Sean Anderson Date: Mon Apr 25 13:14:09 2022 -0400 usb: phy: generic: Get the vbus supply While support for working with a vbus was added, the regulator was never actually gotten (despite what was documented). Fix this by actually getting the supply from the device tree. Fixes: 7acc9973e3c4 ("usb: phy: generic: add vbus support") Cc: stable Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20220425171412.1188485-3-sean.anderson@seco.com Signed-off-by: Greg Kroah-Hartman drivers/usb/phy/phy-generic.c | 7 +++++++ 1 file changed, 7 insertions(+) commit c7428dbddcf4ea1919e1c8e15f715b94ca359268 Author: Thinh Nguyen Date: Fri Apr 22 17:36:28 2022 -0700 usb: dwc3: gadget: Return proper request status If the user sets the usb_request's no_interrupt, then there will be no completion event for the request. Currently the driver incorrectly uses the event status of a different request to report the status for a request with no_interrupt. The dwc3 driver needs to check the TRB status associated with the request when reporting its status. Note: this is only applicable to missed_isoc TRB completion status, but the other status are also listed for completeness/documentation. Fixes: 6d8a019614f3 ("usb: dwc3: gadget: check for Missed Isoc from event status") Cc: Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/db2c80108286cfd108adb05bad52138b78d7c3a7.1650673655.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/gadget.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) commit 4bc31edebde51fcf8ad0794763b8679a7ecb5ec0 Author: Brian Norris Date: Fri Apr 22 10:08:53 2022 -0700 mmc: core: Set HS clock speed before sending HS CMD13 Way back in commit 4f25580fb84d ("mmc: core: changes frequency to hs_max_dtr when selecting hs400es"), Rockchip engineers noticed that some eMMC don't respond to SEND_STATUS commands very reliably if they're still running at a low initial frequency. As mentioned in that commit, JESD84-B51 P49 suggests a sequence in which the host: 1. sets HS_TIMING 2. bumps the clock ("<= 52 MHz") 3. sends further commands It doesn't exactly require that we don't use a lower-than-52MHz frequency, but in practice, these eMMC don't like it. The aforementioned commit tried to get that right for HS400ES, although it's unclear whether this ever truly worked as committed into mainline, as other changes/refactoring adjusted the sequence in conflicting ways: 08573eaf1a70 ("mmc: mmc: do not use CMD13 to get status after speed mode switch") 53e60650f74e ("mmc: core: Allow CMD13 polling when switching to HS mode for mmc") In any case, today we do step 3 before step 2. Let's fix that, and also apply the same logic to HS200/400, where this eMMC has problems too. Resolves errors like this seen when booting some RK3399 Gru/Scarlet systems: [ 2.058881] mmc1: CQHCI version 5.10 [ 2.097545] mmc1: SDHCI controller on fe330000.mmc [fe330000.mmc] using ADMA [ 2.209804] mmc1: mmc_select_hs400es failed, error -84 [ 2.215597] mmc1: error -84 whilst initialising MMC card [ 2.417514] mmc1: mmc_select_hs400es failed, error -110 [ 2.423373] mmc1: error -110 whilst initialising MMC card [ 2.605052] mmc1: mmc_select_hs400es failed, error -110 [ 2.617944] mmc1: error -110 whilst initialising MMC card [ 2.835884] mmc1: mmc_select_hs400es failed, error -110 [ 2.841751] mmc1: error -110 whilst initialising MMC card Ealier versions of this patch bumped to 200MHz/HS200 speeds too early, which caused issues on, e.g., qcom-msm8974-fairphone-fp2. (Thanks for the report Luca!) After a second look, it appears that aligns with JESD84 / page 45 / table 28, so we need to keep to lower (HS / 52 MHz) rates first. Fixes: 08573eaf1a70 ("mmc: mmc: do not use CMD13 to get status after speed mode switch") Fixes: 53e60650f74e ("mmc: core: Allow CMD13 polling when switching to HS mode for mmc") Fixes: 4f25580fb84d ("mmc: core: changes frequency to hs_max_dtr when selecting hs400es") Cc: Shawn Lin Link: https://lore.kernel.org/linux-mmc/11962455.O9o76ZdvQC@g550jk/ Reported-by: Luca Weiss Signed-off-by: Brian Norris Tested-by: Luca Weiss Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220422100824.v4.1.I484f4ee35609f78b932bd50feed639c29e64997e@changeid Signed-off-by: Ulf Hansson drivers/mmc/core/mmc.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) commit 973e0f7a847ef13ade840d4c30729ce329a66895 Author: Heikki Krogerus Date: Mon Apr 25 13:35:18 2022 +0300 usb: dwc3: pci: add support for the Intel Meteor Lake-P This patch adds the necessary PCI IDs for Intel Meteor Lake-P devices. Signed-off-by: Heikki Krogerus Cc: stable Link: https://lore.kernel.org/r/20220425103518.44028-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/dwc3-pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit acb16b395c3f3d7502443e0c799c2b42df645642 Author: Nikolay Aleksandrov Date: Mon Apr 25 13:37:03 2022 +0300 virtio_net: fix wrong buf address calculation when using xdp We received a report[1] of kernel crashes when Cilium is used in XDP mode with virtio_net after updating to newer kernels. After investigating the reason it turned out that when using mergeable bufs with an XDP program which adjusts xdp.data or xdp.data_meta page_to_buf() calculates the build_skb address wrong because the offset can become less than the headroom so it gets the address of the previous page (-X bytes depending on how lower offset is): page_to_skb: page addr ffff9eb2923e2000 buf ffff9eb2923e1ffc offset 252 headroom 256 This is a pr_err() I added in the beginning of page_to_skb which clearly shows offset that is less than headroom by adding 4 bytes of metadata via an xdp prog. The calculations done are: receive_mergeable(): headroom = VIRTIO_XDP_HEADROOM; // VIRTIO_XDP_HEADROOM == 256 bytes offset = xdp.data - page_address(xdp_page) - vi->hdr_len - metasize; page_to_skb(): p = page_address(page) + offset; ... buf = p - headroom; Now buf goes -4 bytes from the page's starting address as can be seen above which is set as skb->head and skb->data by build_skb later. Depending on what's done with the skb (when it's freed most often) we get all kinds of corruptions and BUG_ON() triggers in mm[2]. We have to recalculate the new headroom after the xdp program has run, similar to how offset and len are recalculated. Headroom is directly related to data_hard_start, data and data_meta, so we use them to get the new size. The result is correct (similar pr_err() in page_to_skb, one case of xdp_page and one case of virtnet buf): a) Case with 4 bytes of metadata [ 115.949641] page_to_skb: page addr ffff8b4dcfad2000 offset 252 headroom 252 [ 121.084105] page_to_skb: page addr ffff8b4dcf018000 offset 20732 headroom 252 b) Case of pushing data +32 bytes [ 153.181401] page_to_skb: page addr ffff8b4dd0c4d000 offset 288 headroom 288 [ 158.480421] page_to_skb: page addr ffff8b4dd00b0000 offset 24864 headroom 288 c) Case of pushing data -33 bytes [ 835.906830] page_to_skb: page addr ffff8b4dd3270000 offset 223 headroom 223 [ 840.839910] page_to_skb: page addr ffff8b4dcdd68000 offset 12511 headroom 223 Offset and headroom are equal because offset points to the start of reserved bytes for the virtio_net header which are at buf start + headroom, while data points at buf start + vnet hdr size + headroom so when data or data_meta are adjusted by the xdp prog both the headroom size and the offset change equally. We can use data_hard_start to compute the new headroom after the xdp prog (linearized / page start case, the virtnet buf case is similar just with bigger base offset): xdp.data_hard_start = page_address + vnet_hdr xdp.data = page_address + vnet_hdr + headroom new headroom after xdp prog = xdp.data - xdp.data_hard_start - metasize An example reproducer xdp prog[3] is below. [1] https://github.com/cilium/cilium/issues/19453 [2] Two of the many traces: [ 40.437400] BUG: Bad page state in process swapper/0 pfn:14940 [ 40.916726] BUG: Bad page state in process systemd-resolve pfn:053b7 [ 41.300891] kernel BUG at include/linux/mm.h:720! [ 41.301801] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI [ 41.302784] CPU: 1 PID: 1181 Comm: kubelet Kdump: loaded Tainted: G B W 5.18.0-rc1+ #37 [ 41.304458] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1.fc35 04/01/2014 [ 41.306018] RIP: 0010:page_frag_free+0x79/0xe0 [ 41.306836] Code: 00 00 75 ea 48 8b 07 a9 00 00 01 00 74 e0 48 8b 47 48 48 8d 50 ff a8 01 48 0f 45 fa eb d0 48 c7 c6 18 b8 30 a6 e8 d7 f8 fc ff <0f> 0b 48 8d 78 ff eb bc 48 8b 07 a9 00 00 01 00 74 3a 66 90 0f b6 [ 41.310235] RSP: 0018:ffffac05c2a6bc78 EFLAGS: 00010292 [ 41.311201] RAX: 000000000000003e RBX: 0000000000000000 RCX: 0000000000000000 [ 41.312502] RDX: 0000000000000001 RSI: ffffffffa6423004 RDI: 00000000ffffffff [ 41.313794] RBP: ffff993c98823600 R08: 0000000000000000 R09: 00000000ffffdfff [ 41.315089] R10: ffffac05c2a6ba68 R11: ffffffffa698ca28 R12: ffff993c98823600 [ 41.316398] R13: ffff993c86311ebc R14: 0000000000000000 R15: 000000000000005c [ 41.317700] FS: 00007fe13fc56740(0000) GS:ffff993cdd900000(0000) knlGS:0000000000000000 [ 41.319150] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 41.320152] CR2: 000000c00008a000 CR3: 0000000014908000 CR4: 0000000000350ee0 [ 41.321387] Call Trace: [ 41.321819] [ 41.322193] skb_release_data+0x13f/0x1c0 [ 41.322902] __kfree_skb+0x20/0x30 [ 41.343870] tcp_recvmsg_locked+0x671/0x880 [ 41.363764] tcp_recvmsg+0x5e/0x1c0 [ 41.384102] inet_recvmsg+0x42/0x100 [ 41.406783] ? sock_recvmsg+0x1d/0x70 [ 41.428201] sock_read_iter+0x84/0xd0 [ 41.445592] ? 0xffffffffa3000000 [ 41.462442] new_sync_read+0x148/0x160 [ 41.479314] ? 0xffffffffa3000000 [ 41.496937] vfs_read+0x138/0x190 [ 41.517198] ksys_read+0x87/0xc0 [ 41.535336] do_syscall_64+0x3b/0x90 [ 41.551637] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 41.568050] RIP: 0033:0x48765b [ 41.583955] Code: e8 4a 35 fe ff eb 88 cc cc cc cc cc cc cc cc e8 fb 7a fe ff 48 8b 7c 24 10 48 8b 74 24 18 48 8b 54 24 20 48 8b 44 24 08 0f 05 <48> 3d 01 f0 ff ff 76 20 48 c7 44 24 28 ff ff ff ff 48 c7 44 24 30 [ 41.632818] RSP: 002b:000000c000a2f5b8 EFLAGS: 00000212 ORIG_RAX: 0000000000000000 [ 41.664588] RAX: ffffffffffffffda RBX: 000000c000062000 RCX: 000000000048765b [ 41.681205] RDX: 0000000000005e54 RSI: 000000c000e66000 RDI: 0000000000000016 [ 41.697164] RBP: 000000c000a2f608 R08: 0000000000000001 R09: 00000000000001b4 [ 41.713034] R10: 00000000000000b6 R11: 0000000000000212 R12: 00000000000000e9 [ 41.728755] R13: 0000000000000001 R14: 000000c000a92000 R15: ffffffffffffffff [ 41.744254] [ 41.758585] Modules linked in: br_netfilter bridge veth netconsole virtio_net and [ 33.524802] BUG: Bad page state in process systemd-network pfn:11e60 [ 33.528617] page ffffe05dc0147b00 ffffe05dc04e7a00 ffff8ae9851ec000 (1) len 82 offset 252 metasize 4 hroom 0 hdr_len 12 data ffff8ae9851ec10c data_meta ffff8ae9851ec108 data_end ffff8ae9851ec14e [ 33.529764] page:000000003792b5ba refcount:0 mapcount:-512 mapping:0000000000000000 index:0x0 pfn:0x11e60 [ 33.532463] flags: 0xfffffc0000000(node=0|zone=1|lastcpupid=0x1fffff) [ 33.532468] raw: 000fffffc0000000 0000000000000000 dead000000000122 0000000000000000 [ 33.532470] raw: 0000000000000000 0000000000000000 00000000fffffdff 0000000000000000 [ 33.532471] page dumped because: nonzero mapcount [ 33.532472] Modules linked in: br_netfilter bridge veth netconsole virtio_net [ 33.532479] CPU: 0 PID: 791 Comm: systemd-network Kdump: loaded Not tainted 5.18.0-rc1+ #37 [ 33.532482] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1.fc35 04/01/2014 [ 33.532484] Call Trace: [ 33.532496] [ 33.532500] dump_stack_lvl+0x45/0x5a [ 33.532506] bad_page.cold+0x63/0x94 [ 33.532510] free_pcp_prepare+0x290/0x420 [ 33.532515] free_unref_page+0x1b/0x100 [ 33.532518] skb_release_data+0x13f/0x1c0 [ 33.532524] kfree_skb_reason+0x3e/0xc0 [ 33.532527] ip6_mc_input+0x23c/0x2b0 [ 33.532531] ip6_sublist_rcv_finish+0x83/0x90 [ 33.532534] ip6_sublist_rcv+0x22b/0x2b0 [3] XDP program to reproduce(xdp_pass.c): #include #include SEC("xdp_pass") int xdp_pkt_pass(struct xdp_md *ctx) { bpf_xdp_adjust_head(ctx, -(int)32); return XDP_PASS; } char _license[] SEC("license") = "GPL"; compile: clang -O2 -g -Wall -target bpf -c xdp_pass.c -o xdp_pass.o load on virtio_net: ip link set enp1s0 xdpdrv obj xdp_pass.o sec xdp_pass CC: stable@vger.kernel.org CC: Jason Wang CC: Xuan Zhuo CC: Daniel Borkmann CC: "Michael S. Tsirkin" CC: virtualization@lists.linux-foundation.org Fixes: 8fb7da9e9907 ("virtio_net: get build_skb() buf by data ptr") Signed-off-by: Nikolay Aleksandrov Reviewed-by: Xuan Zhuo Acked-by: Daniel Borkmann Acked-by: Michael S. Tsirkin Acked-by: Jason Wang Link: https://lore.kernel.org/r/20220425103703.3067292-1-razor@blackwall.org Signed-off-by: Paolo Abeni drivers/net/virtio_net.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) commit 24cbdb910bb62b5be3865275e5682be1a7708c0f Author: Nathan Rossi Date: Mon Apr 25 07:04:54 2022 +0000 net: dsa: mv88e6xxx: Fix port_hidden_wait to account for port_base_addr The other port_hidden functions rely on the port_read/port_write functions to access the hidden control port. These functions apply the offset for port_base_addr where applicable. Update port_hidden_wait to use the port_wait_bit so that port_base_addr offsets are accounted for when waiting for the busy bit to change. Without the offset the port_hidden_wait function would timeout on devices that have a non-zero port_base_addr (e.g. MV88E6141), however devices that have a zero port_base_addr would operate correctly (e.g. MV88E6390). Fixes: 609070133aff ("net: dsa: mv88e6xxx: update code operating on hidden registers") Signed-off-by: Nathan Rossi Reviewed-by: Marek Behún Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220425070454.348584-1-nathan@nathanrossi.com Signed-off-by: Paolo Abeni drivers/net/dsa/mv88e6xxx/port_hidden.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 0ed9704b660b259b54743cad8a84a11148f60f0a Author: Baruch Siach Date: Mon Apr 25 09:27:38 2022 +0300 net: phy: marvell10g: fix return value on error Return back the error value that we get from phy_read_mmd(). Fixes: c84786fa8f91 ("net: phy: marvell10g: read copper results from CSSR1") Signed-off-by: Baruch Siach Reviewed-by: Marek Behún Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/f47cb031aeae873bb008ba35001607304a171a20.1650868058.git.baruch@tkos.co.il Signed-off-by: Paolo Abeni drivers/net/phy/marvell10g.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1fa568e26f001e951b634d62ef3accdc80a87c7b Author: Shida Zhang Date: Tue Apr 26 11:20:07 2022 +0800 bug: Have __warn() prototype defined unconditionally The __warn() prototype is declared in CONFIG_BUG scope but the function definition in panic.c is unconditional. The IBT enablement started using it unconditionally but a CONFIG_X86_KERNEL_IBT=y, CONFIG_BUG=n .config will trigger a arch/x86/kernel/traps.c: In function ‘__exc_control_protection’: arch/x86/kernel/traps.c:249:17: error: implicit declaration of function \ ‘__warn’; did you mean ‘pr_warn’? [-Werror=implicit-function-declaration] Pull up the declarations so that they're unconditionally visible too. [ bp: Rewrite commit message. ] Fixes: 991625f3dd2c ("x86/ibt: Add IBT feature, MSR and #CP handling") Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Shida Zhang Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220426032007.510245-1-starzhangzsd@gmail.com include/asm-generic/bug.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit acac0541d1d65e81e599ec399d34d184d2424401 Author: Jonathan Lemon Date: Sun Apr 24 09:53:07 2022 -0700 net: bcmgenet: hide status block before TX timestamping The hardware checksum offloading requires use of a transmit status block inserted before the outgoing frame data, this was updated in '9a9ba2a4aaaa ("net: bcmgenet: always enable status blocks")' However, skb_tx_timestamp() assumes that it is passed a raw frame and PTP parsing chokes on this status block. Fix this by calling __skb_pull(), which hides the TSB before calling skb_tx_timestamp(), so an outgoing PTP packet is parsed correctly. As the data in the skb has already been set up for DMA, and the dma_unmap_* calls use a separately stored address, there is no no effective change in the data transmission. Signed-off-by: Jonathan Lemon Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220424165307.591145-1-jonathan.lemon@gmail.com Fixes: d03825fba459 ("net: bcmgenet: add skb_tx_timestamp call") Signed-off-by: Paolo Abeni drivers/net/ethernet/broadcom/genet/bcmgenet.c | 7 +++++++ 1 file changed, 7 insertions(+) commit b561275d633bcd8e0e8055ab86f1a13df75a0269 Author: Lin Ma Date: Fri Apr 22 19:43:40 2022 +0800 mctp: defer the kfree of object mdev->addrs The function mctp_unregister() reclaims the device's relevant resource when a netcard detaches. However, a running routine may be unaware of this and cause the use-after-free of the mdev->addrs object. The race condition can be demonstrated below cleanup thread another thread | unregister_netdev() | mctp_sendmsg() ... | ... mctp_unregister() | rt = mctp_route_lookup() ... | mctl_local_output() kfree(mdev->addrs) | ... | saddr = rt->dev->addrs[0]; | An attacker can adopt the (recent provided) mtcpserial driver with pty to fake the device detaching and use the userfaultfd to increase the race success chance (in mctp_sendmsg). The KASan report for such a POC is shown below: [ 86.051955] ================================================================== [ 86.051955] BUG: KASAN: use-after-free in mctp_local_output+0x4e9/0xb7d [ 86.051955] Read of size 1 at addr ffff888005f298c0 by task poc/295 [ 86.051955] [ 86.051955] Call Trace: [ 86.051955] [ 86.051955] dump_stack_lvl+0x33/0x42 [ 86.051955] print_report.cold.13+0xb2/0x6b3 [ 86.051955] ? preempt_schedule_irq+0x57/0x80 [ 86.051955] ? mctp_local_output+0x4e9/0xb7d [ 86.051955] kasan_report+0xa5/0x120 [ 86.051955] ? mctp_local_output+0x4e9/0xb7d [ 86.051955] mctp_local_output+0x4e9/0xb7d [ 86.051955] ? mctp_dev_set_key+0x79/0x79 [ 86.051955] ? copyin+0x38/0x50 [ 86.051955] ? _copy_from_iter+0x1b6/0xf20 [ 86.051955] ? sysvec_apic_timer_interrupt+0x97/0xb0 [ 86.051955] ? asm_sysvec_apic_timer_interrupt+0x12/0x20 [ 86.051955] ? mctp_local_output+0x1/0xb7d [ 86.051955] mctp_sendmsg+0x64d/0xdb0 [ 86.051955] ? mctp_sk_close+0x20/0x20 [ 86.051955] ? __fget_light+0x2fd/0x4f0 [ 86.051955] ? mctp_sk_close+0x20/0x20 [ 86.051955] sock_sendmsg+0xdd/0x110 [ 86.051955] __sys_sendto+0x1cc/0x2a0 [ 86.051955] ? __ia32_sys_getpeername+0xa0/0xa0 [ 86.051955] ? new_sync_write+0x335/0x550 [ 86.051955] ? alloc_file+0x22f/0x500 [ 86.051955] ? __ip_do_redirect+0x820/0x1820 [ 86.051955] ? vfs_write+0x44d/0x7b0 [ 86.051955] ? vfs_write+0x44d/0x7b0 [ 86.051955] ? fput_many+0x15/0x120 [ 86.051955] ? ksys_write+0x155/0x1b0 [ 86.051955] ? __ia32_sys_read+0xa0/0xa0 [ 86.051955] __x64_sys_sendto+0xd8/0x1b0 [ 86.051955] ? exit_to_user_mode_prepare+0x2f/0x120 [ 86.051955] ? syscall_exit_to_user_mode+0x12/0x20 [ 86.051955] do_syscall_64+0x3a/0x80 [ 86.051955] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 86.051955] RIP: 0033:0x7f82118a56b3 [ 86.051955] RSP: 002b:00007ffdb154b110 EFLAGS: 00000293 ORIG_RAX: 000000000000002c [ 86.051955] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f82118a56b3 [ 86.051955] RDX: 0000000000000010 RSI: 00007f8211cd4000 RDI: 0000000000000007 [ 86.051955] RBP: 00007ffdb154c1d0 R08: 00007ffdb154b164 R09: 000000000000000c [ 86.051955] R10: 0000000000000000 R11: 0000000000000293 R12: 000055d779800db0 [ 86.051955] R13: 00007ffdb154c2b0 R14: 0000000000000000 R15: 0000000000000000 [ 86.051955] [ 86.051955] [ 86.051955] Allocated by task 295: [ 86.051955] kasan_save_stack+0x1c/0x40 [ 86.051955] __kasan_kmalloc+0x84/0xa0 [ 86.051955] mctp_rtm_newaddr+0x242/0x610 [ 86.051955] rtnetlink_rcv_msg+0x2fd/0x8b0 [ 86.051955] netlink_rcv_skb+0x11c/0x340 [ 86.051955] netlink_unicast+0x439/0x630 [ 86.051955] netlink_sendmsg+0x752/0xc00 [ 86.051955] sock_sendmsg+0xdd/0x110 [ 86.051955] __sys_sendto+0x1cc/0x2a0 [ 86.051955] __x64_sys_sendto+0xd8/0x1b0 [ 86.051955] do_syscall_64+0x3a/0x80 [ 86.051955] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 86.051955] [ 86.051955] Freed by task 301: [ 86.051955] kasan_save_stack+0x1c/0x40 [ 86.051955] kasan_set_track+0x21/0x30 [ 86.051955] kasan_set_free_info+0x20/0x30 [ 86.051955] __kasan_slab_free+0x104/0x170 [ 86.051955] kfree+0x8c/0x290 [ 86.051955] mctp_dev_notify+0x161/0x2c0 [ 86.051955] raw_notifier_call_chain+0x8b/0xc0 [ 86.051955] unregister_netdevice_many+0x299/0x1180 [ 86.051955] unregister_netdevice_queue+0x210/0x2f0 [ 86.051955] unregister_netdev+0x13/0x20 [ 86.051955] mctp_serial_close+0x6d/0xa0 [ 86.051955] tty_ldisc_kill+0x31/0xa0 [ 86.051955] tty_ldisc_hangup+0x24f/0x560 [ 86.051955] __tty_hangup.part.28+0x2ce/0x6b0 [ 86.051955] tty_release+0x327/0xc70 [ 86.051955] __fput+0x1df/0x8b0 [ 86.051955] task_work_run+0xca/0x150 [ 86.051955] exit_to_user_mode_prepare+0x114/0x120 [ 86.051955] syscall_exit_to_user_mode+0x12/0x20 [ 86.051955] do_syscall_64+0x46/0x80 [ 86.051955] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 86.051955] [ 86.051955] The buggy address belongs to the object at ffff888005f298c0 [ 86.051955] which belongs to the cache kmalloc-8 of size 8 [ 86.051955] The buggy address is located 0 bytes inside of [ 86.051955] 8-byte region [ffff888005f298c0, ffff888005f298c8) [ 86.051955] [ 86.051955] The buggy address belongs to the physical page: [ 86.051955] flags: 0x100000000000200(slab|node=0|zone=1) [ 86.051955] raw: 0100000000000200 dead000000000100 dead000000000122 ffff888005c42280 [ 86.051955] raw: 0000000000000000 0000000080660066 00000001ffffffff 0000000000000000 [ 86.051955] page dumped because: kasan: bad access detected [ 86.051955] [ 86.051955] Memory state around the buggy address: [ 86.051955] ffff888005f29780: 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 [ 86.051955] ffff888005f29800: fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc [ 86.051955] >ffff888005f29880: fc fc fc fb fc fc fc fc fa fc fc fc fc fa fc fc [ 86.051955] ^ [ 86.051955] ffff888005f29900: fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc [ 86.051955] ffff888005f29980: fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc [ 86.051955] ================================================================== To this end, just like the commit e04480920d1e ("Bluetooth: defer cleanup of resources in hci_unregister_dev()") this patch defers the destructive kfree(mdev->addrs) in mctp_unregister to the mctp_dev_put, where the refcount of mdev is zero and the entire device is reclaimed. This prevents the use-after-free because the sendmsg thread holds the reference of mdev in the mctp_route object. Fixes: 583be982d934 (mctp: Add device handling and netlink interface) Signed-off-by: Lin Ma Acked-by: Jeremy Kerr Link: https://lore.kernel.org/r/20220422114340.32346-1-linma@zju.edu.cn Signed-off-by: Paolo Abeni net/mctp/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f7e1089f43761ca221914aea9a755b23dc7cbc33 Author: Ville Syrjälä Date: Wed Apr 13 18:28:51 2022 +0300 drm/i915/fbc: Consult hw.crtc instead of uapi.crtc plane_state->uapi.crtc is not what we want to be looking at. If bigjoiner is used hw.crtc is what tells us what crtc the plane is supposedly using. Not an actual problem on current hardware as the only FBC capable pipe (A) can't be a bigjoiner slave and thus uapi.crtc==hw.crtc always here. But when we get more FBC instances this will become actually important. Fixes: 2e6c99f88679 ("drm/i915/fbc: Nuke lots of crap from intel_fbc_state_cache") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220413152852.7336-1-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare (cherry picked from commit 3e1faae3398789abe8d4797255bfe28d95d81308) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/display/intel_fbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4ae4dd2e26fdfebf0b8c6af6c325383eadfefdb4 Author: Imre Deak Date: Thu Apr 21 19:22:21 2022 +0300 drm/i915: Fix SEL_FETCH_PLANE_*(PIPE_B+) register addresses Fix typo in the _SEL_FETCH_PLANE_BASE_1_B register base address. Fixes: a5523e2ff074a5 ("drm/i915: Add PSR2 selective fetch registers") References: https://gitlab.freedesktop.org/drm/intel/-/issues/5400 Cc: José Roberto de Souza Cc: # v5.9+ Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220421162221.2261895-1-imre.deak@intel.com (cherry picked from commit af2cbc6ef967f61711a3c40fca5366ea0bc7fecc) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/i915_reg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e4e6448638a01905faeda9bf96aa9df7c8ef463c Author: Vladimir Zapolskiy Date: Thu Apr 7 23:09:19 2022 +0300 cpufreq: qcom-cpufreq-hw: Clear dcvs interrupts It's noted that dcvs interrupts are not self-clearing, thus an interrupt handler runs constantly, which leads to a severe regression in runtime. To fix the problem an explicit write to clear interrupt register is required, note that on OSM platforms the register may not be present. Fixes: 275157b367f4 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support") Signed-off-by: Vladimir Zapolskiy Signed-off-by: Viresh Kumar drivers/cpufreq/qcom-cpufreq-hw.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 19317433057dc1f2ca9a975e4e6b547282c2a5ef Author: Daniel Starke Date: Mon Apr 25 03:47:26 2022 -0700 tty: n_gsm: fix sometimes uninitialized warning in gsm_dlci_modem_output() 'size' may be used uninitialized in gsm_dlci_modem_output() if called with an adaption that is neither 1 nor 2. The function is currently only called by gsm_modem_upd_via_data() and only for adaption 2. Properly handle every invalid case by returning -EINVAL to silence the compiler warning and avoid future regressions. Fixes: c19ffe00fed6 ("tty: n_gsm: fix invalid use of MSC in advanced option") Cc: stable@vger.kernel.org Reported-by: kernel test robot Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220425104726.7986-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit 00c94ebec5925593c0377b941289224469e72ac7 Author: Trond Myklebust Date: Mon Apr 25 18:04:27 2022 -0400 NFSv4: Don't invalidate inode attributes on delegation return There is no need to declare attributes such as the ctime, mtime and block size invalid when we're just returning a delegation, so it is inappropriate to call nfs_post_op_update_inode_force_wcc(). Instead, just call nfs_refresh_inode() after faking up the change attribute. We know that the GETATTR op occurs before the DELEGRETURN, so we are safe when doing this. Fixes: 0bc2c9b4dca9 ("NFSv4: Don't discard the attributes returned by asynchronous DELEGRETURN") Signed-off-by: Trond Myklebust fs/nfs/nfs4proc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit a91b05f6b928e8fab750fc953d7df0aa6dc43547 Merge: 6deb9bf4580d f58ca215cda1 Author: Stephen Boyd Date: Mon Apr 25 16:47:24 2022 -0700 Merge tag 'sunxi-clk-fixes-for-5.18-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-fixes Pull Allwinner clk fixes from Jernej Skrabec: - Add missing sentinel - check return value for platform_get_resource() - mark rtc-32k as critical * tag 'sunxi-clk-fixes-for-5.18-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi: sun9i-mmc: check return value after calling platform_get_resource() clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical clk: sunxi-ng: fix not NULL terminated coccicheck error commit 6fbe0cc53a1b5f7abe2c44399c18e943adbebe2f Author: Alexander Shiyan Date: Wed Apr 20 10:06:39 2022 +0300 video: fbdev: clps711x-fb: Use syscon_regmap_lookup_by_phandle Since version 5.13, the standard syscon bindings have been added to all clps711x DT nodes, so we can now use the more general syscon_regmap_lookup_by_phandle function to get the syscon pointer. Signed-off-by: Alexander Shiyan Signed-off-by: Helge Deller drivers/video/fbdev/clps711x-fb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit c3e8d5a40685aed49d736a24f4d2b9e7607771f0 Merge: ba5a4fdd63ae 0558226cebee Author: Jakub Kicinski Date: Mon Apr 25 11:03:51 2022 -0700 Merge branch 'net-smc-two-fixes-for-smc-fallback' Wen Gu says: ==================== net/smc: Two fixes for smc fallback This patch set includes two fixes for smc fallback: Patch 1/2 introduces some simple helpers to wrap the replacement and restore of clcsock's callback functions. Make sure that only the original callbacks will be saved and not overwritten. Patch 2/2 fixes a syzbot reporting slab-out-of-bound issue where smc_fback_error_report() accesses the already freed smc sock (see https://lore.kernel.org/r/00000000000013ca8105d7ae3ada@google.com/). The patch fixes it by resetting sk_user_data and restoring clcsock callback functions timely in fallback situation. But it should be noted that although patch 2/2 can fix the issue of 'slab-out-of-bounds/use-after-free in smc_fback_error_report', it can't pass the syzbot reproducer test. Because after applying these two patches in upstream, syzbot reproducer triggered another known issue like this: ================================================================== BUG: KASAN: use-after-free in tcp_retransmit_timer+0x2ef3/0x3360 net/ipv4/tcp_timer.c:511 Read of size 8 at addr ffff888020328380 by task udevd/4158 CPU: 1 PID: 4158 Comm: udevd Not tainted 5.18.0-rc3-syzkaller-00074-gb05a5683eba6-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x467 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 tcp_retransmit_timer+0x2ef3/0x3360 net/ipv4/tcp_timer.c:511 tcp_write_timer_handler+0x5e6/0xbc0 net/ipv4/tcp_timer.c:622 tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:642 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x679/0xa80 kernel/time/timer.c:1737 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1750 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 ... (detail report can be found in https://syzkaller.appspot.com/text?tag=CrashReport&x=15406b44f00000) IMHO, the above issue is the same as this known one: https://syzkaller.appspot.com/bug?extid=694120e1002c117747ed, and it doesn't seem to be related with SMC. The discussion about this known issue is ongoing and can be found in https://lore.kernel.org/bpf/000000000000f75af905d3ba0716@google.com/T/. And I added the temporary solution mentioned in the above discussion on top of my two patches, the syzbot reproducer of 'slab-out-of-bounds/ use-after-free in smc_fback_error_report' no longer triggers any issue. ==================== Link: https://lore.kernel.org/r/1650614179-11529-1-git-send-email-guwen@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 0558226cebee256aa3f8ec0cc5a800a10bf120a6 Author: Wen Gu Date: Fri Apr 22 15:56:19 2022 +0800 net/smc: Fix slab-out-of-bounds issue in fallback syzbot reported a slab-out-of-bounds/use-after-free issue, which was caused by accessing an already freed smc sock in fallback-specific callback functions of clcsock. This patch fixes the issue by restoring fallback-specific callback functions to original ones and resetting clcsock sk_user_data to NULL before freeing smc sock. Meanwhile, this patch introduces sk_callback_lock to make the access and assignment to sk_user_data mutually exclusive. Reported-by: syzbot+b425899ed22c6943e00b@syzkaller.appspotmail.com Fixes: 341adeec9ada ("net/smc: Forward wakeup to smc socket waitqueue after fallback") Link: https://lore.kernel.org/r/00000000000013ca8105d7ae3ada@google.com/ Signed-off-by: Wen Gu Acked-by: Karsten Graul Signed-off-by: Jakub Kicinski net/smc/af_smc.c | 80 ++++++++++++++++++++++++++++++++++++++--------------- net/smc/smc_close.c | 2 ++ 2 files changed, 59 insertions(+), 23 deletions(-) commit 97b9af7a70936e331170c79040cc9bf20071b566 Author: Wen Gu Date: Fri Apr 22 15:56:18 2022 +0800 net/smc: Only save the original clcsock callback functions Both listen and fallback process will save the current clcsock callback functions and establish new ones. But if both of them happen, the saved callback functions will be overwritten. So this patch introduces some helpers to ensure that only save the original callback functions of clcsock. Fixes: 341adeec9ada ("net/smc: Forward wakeup to smc socket waitqueue after fallback") Signed-off-by: Wen Gu Acked-by: Karsten Graul Signed-off-by: Jakub Kicinski net/smc/af_smc.c | 55 +++++++++++++++++++++++++++++++++++------------------ net/smc/smc.h | 29 ++++++++++++++++++++++++++++ net/smc/smc_close.c | 3 ++- 3 files changed, 67 insertions(+), 20 deletions(-) commit d615b5416f8a1afeb82d13b238f8152c572d59c0 Merge: 0fc74d820a01 4d8ec9120819 Author: Linus Torvalds Date: Mon Apr 25 10:53:56 2022 -0700 Merge tag 'f2fs-fix-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs fixes from Jaegeuk Kim: "This includes major bug fixes introduced in 5.18-rc1 and 5.17+: - Remove obsolete whint_mode (5.18-rc1) - Fix IO split issue caused by op_flags change in f2fs (5.18-rc1) - Fix a wrong condition check to detect IO failure loop (5.18-rc1) - Fix wrong data truncation during roll-forward (5.17+)" * tag 'f2fs-fix-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: f2fs: should not truncate blocks during roll-forward recovery f2fs: fix wrong condition check when failing metapage read f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders f2fs: remove obsolete whint_mode commit f58ca215cda1975f77b2b762903684a3c101bec9 Author: Yang Yingliang Date: Thu Apr 21 21:43:08 2022 +0800 clk: sunxi: sun9i-mmc: check return value after calling platform_get_resource() It will cause null-ptr-deref if platform_get_resource() returns NULL, we need check the return value. Fixes: 7a6fca879f59 ("clk: sunxi: Add driver for A80 MMC config clocks/resets") Signed-off-by: Yang Yingliang Reviewed-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220421134308.2885094-1-yangyingliang@huawei.com drivers/clk/sunxi/clk-sun9i-mmc.c | 2 ++ 1 file changed, 2 insertions(+) commit fff8c10368e64e7f8960f149375c12ca5f3b30af Author: Christophe JAILLET Date: Thu Apr 21 16:35:49 2022 +0200 bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create() This code is really spurious. It always returns an ERR_PTR, even when err is known to be 0 and calls put_device() after a successful device_register() call. It is likely that the return statement in the normal path is missing. Add 'return rdev;' to fix it. Fixes: d787dcdb9c8f ("bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus") Signed-off-by: Christophe JAILLET Reviewed-by: Samuel Holland Tested-by: Samuel Holland Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/ef2b9576350bba4c8e05e669e9535e9e2a415763.1650551719.git.christophe.jaillet@wanadoo.fr drivers/bus/sunxi-rsb.c | 2 ++ 1 file changed, 2 insertions(+) commit 0fc74d820a012550be006ba82dd8f1e3fe6fa9f7 Author: Linus Torvalds Date: Mon Apr 25 01:28:01 2022 -0700 no-MMU: expose vmalloc_huge() for alloc_large_system_hash() It turns out that for the CONFIG_MMU=n builds, vmalloc_huge() was never defined, since it's defined in mm/vmalloc.c, which doesn't get built for the no-MMU configurations. Just implement the trivial wrapper for the no-MMU case too. In fact, just make it an alias to the existing __vmalloc() function that has the same signature. Link: https://lore.kernel.org/all/CAMuHMdVdx2V1uhv_152Sw3_z2xE0spiaWp1d6Ko8-rYmAxUBAg@mail.gmail.com/ Link: https://lore.kernel.org/all/CA+G9fYscb1y4a17Sf5G_Aibt+WuSf-ks_Qjw9tYFy=A4sjCEug@mail.gmail.com/ Link: https://lore.kernel.org/all/20220425150356.GA4138752@roeck-us.net/ Reported-and-tested-by: Linux Kernel Functional Testing Reported-and-tested-by: Geert Uytterhoeven Reported-by: Sudip Mukherjee Reported-by: Guenter Roeck Signed-off-by: Linus Torvalds mm/nommu.c | 2 ++ 1 file changed, 2 insertions(+) commit 75d2b2b06bd8407d03a3f126bc8b95eb356906c7 Author: Adam Wujek Date: Wed Apr 20 14:51:25 2022 +0000 hwmon: (pmbus) disable PEC if not enabled Explicitly disable PEC when the client does not support it. The problematic scenario is the following. A device with enabled PEC support is up and running and a kernel driver is loaded. Then the driver is unloaded (or device unbound), the HW device is reconfigured externally (e.g. by i2cset) to advertise itself as not supporting PEC. Without a new code, at the second load of the driver (or bind) the "flags" variable is not updated to avoid PEC usage. As a consequence the further communication with the device is done with the PEC enabled, which is wrong and may fail. The implementation first disable the I2C_CLIENT_PEC flag, then the old code enable it if needed. Fixes: 4e5418f787ec ("hwmon: (pmbus_core) Check adapter PEC support") Signed-off-by: Adam Wujek Link: https://lore.kernel.org/r/20220420145059.431061-1-dev_public@wujek.eu Signed-off-by: Guenter Roeck drivers/hwmon/pmbus/pmbus_core.c | 3 +++ 1 file changed, 3 insertions(+) commit 5a7e470e460fb90657343d843732325e53bb875f Author: Eric Biggers Date: Thu Apr 21 17:27:31 2022 -0700 Documentation: siphash: disambiguate HalfSipHash algorithm from hsiphash functions Fix the documentation for the hsiphash functions to avoid conflating the HalfSipHash algorithm with the hsiphash functions, since these functions actually implement either HalfSipHash or SipHash, and random.c now uses HalfSipHash (in a very special way) without the hsiphash functions. Signed-off-by: Eric Biggers Signed-off-by: Jason A. Donenfeld Documentation/security/siphash.rst | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) commit 2fbfeb4fa61684955980b99603c29d2002a67118 Author: Bagas Sanjaya Date: Sun Apr 17 14:50:58 2022 +0700 Documentation: siphash: enclose HalfSipHash usage example in the literal block Render usage example of HalfSipHash function as code block by using literal block syntax. Cc: Jonathan Corbet Cc: Eric Biggers Cc: Herbert Xu Cc: Mauro Carvalho Chehab Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya Signed-off-by: Jonathan Corbet Signed-off-by: Jason A. Donenfeld Documentation/security/siphash.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit ec862155c3ccbde59644336eec58468e7d07519b Author: Bagas Sanjaya Date: Sun Apr 17 14:50:57 2022 +0700 Documentation: siphash: convert danger note to warning for HalfSipHash Render danger paragraph into warning block for emphasization. Cc: Jonathan Corbet Cc: Eric Biggers Cc: Herbert Xu Cc: Mauro Carvalho Chehab Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya Signed-off-by: Jonathan Corbet Signed-off-by: Jason A. Donenfeld Documentation/security/siphash.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 8717627d6ac53251ee012c3c7aca392f29f38a42 Author: Jason A. Donenfeld Date: Mon Apr 18 20:57:31 2022 +0200 random: document crng_fast_key_erasure() destination possibility This reverts 35a33ff3807d ("random: use memmove instead of memcpy for remaining 32 bytes"), which was made on a totally bogus basis. The thing it was worried about overlapping came from the stack, not from one of its arguments, as Eric pointed out. But the fact that this confusion even happened draws attention to the fact that it's a bit non-obvious that the random_data parameter can alias chacha_state, and in fact should do so when the caller can't rely on the stack being cleared in a timely manner. So this commit documents that. Reported-by: Eric Biggers Reviewed-by: Eric Biggers Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 660564fc9a92a893a14f255be434f7ea0b967901 Author: Codrin Ciubotariu Date: Thu Apr 21 15:54:02 2022 +0300 ASoC: dmaengine: Restore NULL prepare_slave_config() callback As pointed out by Sascha Hauer, this patch changes: if (pmc->config && !pcm->config->prepare_slave_config) to: if (pmc->config && !pcm->config->prepare_slave_config) snd_dmaengine_pcm_prepare_slave_config() This breaks the drivers that do not need a call to dmaengine_slave_config(). Drivers that still need to call snd_dmaengine_pcm_prepare_slave_config(), but have a NULL pcm->config->prepare_slave_config should use snd_dmaengine_pcm_prepare_slave_config() as their prepare_slave_config callback. Fixes: 9a1e13440a4f ("ASoC: dmaengine: do not use a NULL prepare_slave_config() callback") Reported-by: Sascha Hauer Signed-off-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220421125403.2180824-1-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown sound/soc/soc-generic-dmaengine-pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 2bde1985e39173d8cb64005dad6f34e9bee4c750 Author: Codrin Ciubotariu Date: Thu Apr 21 15:54:03 2022 +0300 ASoC: atmel: mchp-pdmc: set prepare_slave_config Since a pointer to struct snd_dmaengine_pcm_config is passed, snd_dmaengine_pcm_prepare_slave_config() is no longer called unless it's explicitly set in prepare_slave_config. Fixes: 50291652af52 ("ASoC: atmel: mchp-pdmc: add PDMC driver") Suggested-by: Sascha Hauer Signed-off-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220421125403.2180824-2-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown sound/soc/atmel/mchp-pdmc.c | 1 + 1 file changed, 1 insertion(+) commit 13fcf676d9e102594effc686d98521ff5c90b925 Author: Mark Brown Date: Wed Apr 20 20:34:54 2022 +0100 ASoC: max98090: Generate notifications on changes for custom control The max98090 driver has some custom controls which share a put() function which returns 0 unconditionally, meaning that events are not generated when the value changes. Fix that. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220420193454.2647908-2-broonie@kernel.org Signed-off-by: Mark Brown sound/soc/codecs/max98090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2fbe467bcbfc760a08f08475eea6bbd4c2874319 Author: Mark Brown Date: Wed Apr 20 20:34:53 2022 +0100 ASoC: max98090: Reject invalid values in custom control put() The max98090 driver has a custom put function for some controls which can only be updated in certain circumstances which makes no effort to validate that input is suitable for the control, allowing out of spec values to be written to the hardware and presented to userspace. Fix this by returning an error when invalid values are written. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220420193454.2647908-1-broonie@kernel.org Signed-off-by: Mark Brown sound/soc/codecs/max98090.c | 3 +++ 1 file changed, 3 insertions(+) commit 2f477ee3ed92d7b3786778399cf3e08007721c0f Author: Arnd Bergmann Date: Mon Apr 25 13:47:07 2022 +0200 Revert "arm64: dts: tegra: Fix boolean properties with values" This reverts commit 1a67653de0dd, which caused a boot regression. The behavior of the "drive-push-pull" in the kernel does not match what the binding document describes. Revert Rob's patch to make the DT match the kernel again, rather than the binding. Link: https://lore.kernel.org/lkml/YlVAy95eF%2F9b1nmu@orome/ Reported-by: Thierry Reding Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi | 8 ++++---- arch/arm64/boot/dts/nvidia/tegra186-p3509-0000+p3636-0001.dts | 8 ++++---- arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 6 +++--- arch/arm64/boot/dts/nvidia/tegra194-p3668.dtsi | 6 +++--- arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi | 6 +++--- arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi | 8 ++++---- arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 8 ++++---- arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) commit ba5a4fdd63ae0c575707030db0b634b160baddd7 Author: Eric Dumazet Date: Sun Apr 24 13:35:09 2022 -0700 tcp: make sure treq->af_specific is initialized syzbot complained about a recent change in TCP stack, hitting a NULL pointer [1] tcp request sockets have an af_specific pointer, which was used before the blamed change only for SYNACK generation in non SYNCOOKIE mode. tcp requests sockets momentarily created when third packet coming from client in SYNCOOKIE mode were not using treq->af_specific. Make sure this field is populated, in the same way normal TCP requests sockets do in tcp_conn_request(). [1] TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] CPU: 1 PID: 3695 Comm: syz-executor864 Not tainted 5.18.0-rc3-syzkaller-00224-g5fd1fe4807f9 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:tcp_create_openreq_child+0xe16/0x16b0 net/ipv4/tcp_minisocks.c:534 Code: 48 c1 ea 03 80 3c 02 00 0f 85 e5 07 00 00 4c 8b b3 28 01 00 00 48 b8 00 00 00 00 00 fc ff df 49 8d 7e 08 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 c9 07 00 00 48 8b 3c 24 48 89 de 41 ff 56 08 48 RSP: 0018:ffffc90000de0588 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff888076490330 RCX: 0000000000000100 RDX: 0000000000000001 RSI: ffffffff87d67ff0 RDI: 0000000000000008 RBP: ffff88806ee1c7f8 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff87d67f00 R11: 0000000000000000 R12: ffff88806ee1bfc0 R13: ffff88801b0e0368 R14: 0000000000000000 R15: 0000000000000000 FS: 00007f517fe58700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffcead76960 CR3: 000000006f97b000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: tcp_v6_syn_recv_sock+0x199/0x23b0 net/ipv6/tcp_ipv6.c:1267 tcp_get_cookie_sock+0xc9/0x850 net/ipv4/syncookies.c:207 cookie_v6_check+0x15c3/0x2340 net/ipv6/syncookies.c:258 tcp_v6_cookie_check net/ipv6/tcp_ipv6.c:1131 [inline] tcp_v6_do_rcv+0x1148/0x13b0 net/ipv6/tcp_ipv6.c:1486 tcp_v6_rcv+0x3305/0x3840 net/ipv6/tcp_ipv6.c:1725 ip6_protocol_deliver_rcu+0x2e9/0x1900 net/ipv6/ip6_input.c:422 ip6_input_finish+0x14c/0x2c0 net/ipv6/ip6_input.c:464 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:473 dst_input include/net/dst.h:461 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ipv6_rcv+0x27f/0x3b0 net/ipv6/ip6_input.c:297 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5405 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5519 process_backlog+0x3a0/0x7c0 net/core/dev.c:5847 __napi_poll+0xb3/0x6e0 net/core/dev.c:6413 napi_poll net/core/dev.c:6480 [inline] net_rx_action+0x8ec/0xc60 net/core/dev.c:6567 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 Fixes: 5b0b9e4c2c89 ("tcp: md5: incorrect tcp_header_len for incoming connections") Signed-off-by: Eric Dumazet Cc: Francesco Ruggeri Signed-off-by: David S. Miller include/net/tcp.h | 1 + net/ipv4/syncookies.c | 8 +++++++- net/ipv6/syncookies.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) commit 4bfe744ff1644fbc0a991a2677dc874475dd6776 Author: Eric Dumazet Date: Sun Apr 24 17:34:07 2022 -0700 tcp: fix potential xmit stalls caused by TCP_NOTSENT_LOWAT I had this bug sitting for too long in my pile, it is time to fix it. Thanks to Doug Porter for reminding me of it! We had various attempts in the past, including commit 0cbe6a8f089e ("tcp: remove SOCK_QUEUE_SHRUNK"), but the issue is that TCP stack currently only generates EPOLLOUT from input path, when tp->snd_una has advanced and skb(s) cleaned from rtx queue. If a flow has a big RTT, and/or receives SACKs, it is possible that the notsent part (tp->write_seq - tp->snd_nxt) reaches 0 and no more data can be sent until tp->snd_una finally advances. What is needed is to also check if POLLOUT needs to be generated whenever tp->snd_nxt is advanced, from output path. This bug triggers more often after an idle period, as we do not receive ACK for at least one RTT. tcp_notsent_lowat could be a fraction of what CWND and pacing rate would allow to send during this RTT. In a followup patch, I will remove the bogus call to tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED) from tcp_check_space(). Fact that we have decided to generate an EPOLLOUT does not mean the application has immediately refilled the transmit queue. This optimistic call might have been the reason the bug seemed not too serious. Tested: 200 ms rtt, 1% packet loss, 32 MB tcp_rmem[2] and tcp_wmem[2] $ echo 500000 >/proc/sys/net/ipv4/tcp_notsent_lowat $ cat bench_rr.sh SUM=0 for i in {1..10} do V=`netperf -H remote_host -l30 -t TCP_RR -- -r 10000000,10000 -o LOCAL_BYTES_SENT | egrep -v "MIGRATED|Bytes"` echo $V SUM=$(($SUM + $V)) done echo SUM=$SUM Before patch: $ bench_rr.sh 130000000 80000000 140000000 140000000 140000000 140000000 130000000 40000000 90000000 110000000 SUM=1140000000 After patch: $ bench_rr.sh 430000000 590000000 530000000 450000000 450000000 350000000 450000000 490000000 480000000 460000000 SUM=4680000000 # This is 410 % of the value before patch. Fixes: c9bee3b7fdec ("tcp: TCP_NOTSENT_LOWAT socket option") Signed-off-by: Eric Dumazet Reported-by: Doug Porter Cc: Soheil Hassas Yeganeh Cc: Neal Cardwell Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller include/net/tcp.h | 1 + net/ipv4/tcp_input.c | 12 +++++++++++- net/ipv4/tcp_output.c | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) commit 1fcb8fb3522f5b0f1cf0f5c7560cd6629abba0cb Author: Vladimir Oltean Date: Fri Apr 22 02:01:05 2022 +0300 net: mscc: ocelot: don't add VID 0 to ocelot->vlans when leaving VLAN-aware bridge DSA, through dsa_port_bridge_leave(), first notifies the port of the fact that it left a bridge, then, if that bridge was VLAN-aware, it notifies the port of the change in VLAN awareness state, towards VLAN-unaware mode. So ocelot_port_vlan_filtering() can be called when ocelot_port->bridge is NULL, and this makes ocelot_add_vlan_unaware_pvid() create a struct ocelot_bridge_vlan with a vid of 0 and an "untagged" setting of true on that port. In a way this structure correctly reflects the reality, but by design, VID 0 (OCELOT_STANDALONE_PVID) was not meant to be kept in the bridge VLAN list of the driver, but managed separately. Having OCELOT_STANDALONE_PVID in ocelot->vlans makes us trip up on several sanity checks that did not expect to have this VID there. For example, after we leave a VLAN-aware bridge and we re-join it, we can no longer program egress-tagged VLANs to hardware: # ip link add br0 type bridge vlan_filtering 1 && ip link set br0 up # ip link set swp0 master br0 # ip link set swp0 nomaster # ip link set swp0 master br0 # bridge vlan add dev swp0 vid 100 Error: mscc_ocelot_switch_lib: Port with more than one egress-untagged VLAN cannot have egress-tagged VLANs. But this configuration is in fact supported by the hardware, since we could use OCELOT_PORT_TAG_NATIVE. According to its comment: /* all VLANs except the native VLAN and VID 0 are egress-tagged */ yet when assessing the eligibility for this mode, we do not check for VID 0 in ocelot_port_uses_native_vlan(), instead we just ensure that ocelot_port_num_untagged_vlans() == 1. This is simply because VID 0 doesn't have a bridge VLAN structure. The way I identify the problem is that ocelot_port_vlan_filtering(false) only means to call ocelot_add_vlan_unaware_pvid() when we dynamically turn off VLAN awareness for a bridge we are under, and the PVID changes from the bridge PVID to a reserved PVID based on the bridge number. Since OCELOT_STANDALONE_PVID is statically added to the VLAN table during ocelot_vlan_init() and never removed afterwards, calling ocelot_add_vlan_unaware_pvid() for it is not intended and does not serve any purpose. Fix the issue by avoiding the call to ocelot_add_vlan_unaware_pvid(vid=0) when we're resetting VLAN awareness after leaving the bridge, to become a standalone port. Fixes: 54c319846086 ("net: mscc: ocelot: enforce FDB isolation when VLAN-unaware") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/ethernet/mscc/ocelot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9323ac367005d6aa4d579311917c636c43206b53 Author: Vladimir Oltean Date: Fri Apr 22 02:01:04 2022 +0300 net: mscc: ocelot: ignore VID 0 added by 8021q module Both the felix DSA driver and ocelot switchdev driver declare dev->features & NETIF_F_HW_VLAN_CTAG_FILTER under certain circumstances*, so the 8021q module will add VID 0 to our RX filter when the port goes up, to ensure 802.1p traffic is not dropped. We treat VID 0 as a special value (OCELOT_STANDALONE_PVID) which deliberately does not have a struct ocelot_bridge_vlan associated with it. Instead, this gets programmed to the VLAN table in ocelot_vlan_init(). If we allow external calls to modify VID 0, we reach the following situation: # ip link add br0 type bridge vlan_filtering 1 && ip link set br0 up # ip link set swp0 master br0 # ip link set swp0 up # this adds VID 0 to ocelot->vlans with untagged=false bridge vlan port vlan-id swp0 1 PVID Egress Untagged # the bridge also adds VID 1 br0 1 PVID Egress Untagged # bridge vlan add dev swp0 vid 100 untagged Error: mscc_ocelot_switch_lib: Port with egress-tagged VLANs cannot have more than one egress-untagged (native) VLAN. This configuration should have been accepted, because ocelot_port_manage_port_tag() should select OCELOT_PORT_TAG_NATIVE. Yet it isn't, because we have an entry in ocelot->vlans which says VID 0 should be egress-tagged, something the hardware can't do. Fix this by suppressing additions/deletions on VID 0 and managing this VLAN exclusively using OCELOT_STANDALONE_PVID. *DSA toggles it when the port becomes VLAN-aware by joining a VLAN-aware bridge. Ocelot declares it unconditionally for some reason. Fixes: 54c319846086 ("net: mscc: ocelot: enforce FDB isolation when VLAN-unaware") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/ethernet/mscc/ocelot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 7c762e70c50b462fabe44a597e2a6c3e56c236c0 Author: Vladimir Oltean Date: Fri Apr 22 01:42:22 2022 +0300 net: dsa: flood multicast to CPU when slave has IFF_PROMISC Certain DSA switches can eliminate flooding to the CPU when none of the ports have the IFF_ALLMULTI or IFF_PROMISC flags set. This is done by synthesizing a call to dsa_port_bridge_flags() for the CPU port, a call which normally comes from the bridge driver via switchdev. The bridge port flags and IFF_PROMISC|IFF_ALLMULTI have slightly different semantics, and due to inattention/lack of proper testing, the IFF_PROMISC flag allows unknown unicast to be flooded to the CPU, but not unknown multicast. This must be fixed by setting both BR_FLOOD (unicast) and BR_MCAST_FLOOD in the synthesized dsa_port_bridge_flags() call, since IFF_PROMISC means that packets should not be filtered regardless of their MAC DA. Fixes: 7569459a52c9 ("net: dsa: manage flooding on the CPU ports") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller net/dsa/slave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 31c417c948d7f6909cb63f0ac3298f3c38f8ce20 Author: Peilin Ye Date: Thu Apr 21 15:09:02 2022 -0700 ip_gre, ip6_gre: Fix race condition on o_seqno in collect_md mode As pointed out by Jakub Kicinski, currently using TUNNEL_SEQ in collect_md mode is racy for [IP6]GRE[TAP] devices. Consider the following sequence of events: 1. An [IP6]GRE[TAP] device is created in collect_md mode using "ip link add ... external". "ip" ignores "[o]seq" if "external" is specified, so TUNNEL_SEQ is off, and the device is marked as NETIF_F_LLTX (i.e. it uses lockless TX); 2. Someone sets TUNNEL_SEQ on outgoing skb's, using e.g. bpf_skb_set_tunnel_key() in an eBPF program attached to this device; 3. gre_fb_xmit() or __gre6_xmit() processes these skb's: gre_build_header(skb, tun_hlen, flags, protocol, tunnel_id_to_key32(tun_info->key.tun_id), (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) : 0); ^^^^^^^^^^^^^^^^^ Since we are not using the TX lock (&txq->_xmit_lock), multiple CPUs may try to do this tunnel->o_seqno++ in parallel, which is racy. Fix it by making o_seqno atomic_t. As mentioned by Eric Dumazet in commit b790e01aee74 ("ip_gre: lockless xmit"), making o_seqno atomic_t increases "chance for packets being out of order at receiver" when NETIF_F_LLTX is on. Maybe a better fix would be: 1. Do not ignore "oseq" in external mode. Users MUST specify "oseq" if they want the kernel to allow sequencing of outgoing packets; 2. Reject all outgoing TUNNEL_SEQ packets if the device was not created with "oseq". Unfortunately, that would break userspace. We could now make [IP6]GRE[TAP] devices always NETIF_F_LLTX, but let us do it in separate patches to keep this fix minimal. Suggested-by: Jakub Kicinski Fixes: 77a5196a804e ("gre: add sequence number for collect md mode.") Signed-off-by: Peilin Ye Acked-by: William Tu Signed-off-by: David S. Miller include/net/ip6_tunnel.h | 2 +- include/net/ip_tunnels.h | 2 +- net/ipv4/ip_gre.c | 6 +++--- net/ipv6/ip6_gre.c | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) commit fde98ae91f79cab4e020f40c35ed23cbdc59661c Author: Peilin Ye Date: Thu Apr 21 15:08:38 2022 -0700 ip6_gre: Make o_seqno start from 0 in native mode For IP6GRE and IP6GRETAP devices, currently o_seqno starts from 1 in native mode. According to RFC 2890 2.2., "The first datagram is sent with a sequence number of 0." Fix it. It is worth mentioning that o_seqno already starts from 0 in collect_md mode, see the "if (tunnel->parms.collect_md)" clause in __gre6_xmit(), where tunnel->o_seqno is passed to gre_build_header() before getting incremented. Fixes: c12b395a4664 ("gre: Support GRE over IPv6") Signed-off-by: Peilin Ye Acked-by: William Tu Signed-off-by: David S. Miller net/ipv6/ip6_gre.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit ff827beb706ed719c766acf36449801ded0c17fc Author: Peilin Ye Date: Thu Apr 21 15:07:57 2022 -0700 ip_gre: Make o_seqno start from 0 in native mode For GRE and GRETAP devices, currently o_seqno starts from 1 in native mode. According to RFC 2890 2.2., "The first datagram is sent with a sequence number of 0." Fix it. It is worth mentioning that o_seqno already starts from 0 in collect_md mode, see gre_fb_xmit(), where tunnel->o_seqno is passed to gre_build_header() before getting incremented. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Peilin Ye Acked-by: William Tu Signed-off-by: David S. Miller net/ipv4/ip_gre.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 9810c58c7051ae83e7ac326fca3daa823da6b778 Author: Dan Carpenter Date: Thu Apr 21 18:46:13 2022 +0300 net: lan966x: fix a couple off by one bugs The lan966x->ports[] array has lan966x->num_phys_ports elements. These are assigned in lan966x_probe(). That means the > comparison should be changed to >=. The first off by one check is harmless but the second one could lead to an out of bounds access and a crash. Fixes: 5ccd66e01cbe ("net: lan966x: add support for interrupts from analyzer") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller drivers/net/ethernet/microchip/lan966x/lan966x_mac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4e2e65e2e56c6ceb4ea1719360080c0af083229e Author: liuyacan Date: Thu Apr 21 17:40:27 2022 +0800 net/smc: sync err code when tcp connection was refused In the current implementation, when TCP initiates a connection to an unavailable [ip,port], ECONNREFUSED will be stored in the TCP socket, but SMC will not. However, some apps (like curl) use getsockopt(,,SO_ERROR,,) to get the error information, which makes them miss the error message and behave strangely. Fixes: 50717a37db03 ("net/smc: nonblocking connect rework") Signed-off-by: liuyacan Reviewed-by: Tony Lu Acked-by: Karsten Graul Signed-off-by: David S. Miller net/smc/af_smc.c | 2 ++ 1 file changed, 2 insertions(+) commit e85f8a9f162562af1a850b9e83ec384f2b6b56aa Author: Peng Wu Date: Thu Apr 21 05:53:44 2022 +0000 net: hns: Add missing fwnode_handle_put in hns_mac_init In one of the error paths of the device_for_each_child_node() loop in hns_mac_init, add missing call to fwnode_handle_put. Signed-off-by: Peng Wu Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit c4c89a6ad8e1c937f8aec946cf97f77b7c6344b2 Merge: 5220a5251130 c59d60629684 Author: David S. Miller Date: Mon Apr 25 10:48:50 2022 +0100 Merge branch 'hns3-fixes' Guangbin Huang says: ==================== net: hns3: add some fixes for -net This series adds some fixes for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit c59d606296842409a6e5a4828235b0bd46b12bc4 Author: Jian Shen Date: Sun Apr 24 20:57:25 2022 +0800 net: hns3: add return value for mailbox handling in PF Currently, there are some querying mailboxes sent from VF to PF, and VF will wait the PF's handling result. For mailbox HCLGE_MBX_GET_QID_IN_PF and HCLGE_MBX_GET_RSS_KEY, it may fail when the input parameter is invalid, but the prototype of their handler function is void. In this case, PF always return success to VF, which may cause the VF get incorrect result. Fixes it by adding return value for these function. Fixes: 63b1279d9905 ("net: hns3: check queue id range before using") Fixes: 532cfc0df1e4 ("net: hns3: add a check for index in hclge_get_rss_key()") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller .../net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) commit 7d413735cb18ff73aaba3457b16b08332e8d3cc4 Author: Jian Shen Date: Sun Apr 24 20:57:24 2022 +0800 net: hns3: add validity check for message data length Add validity check for message data length in function hclge_send_mbx_msg(), avoid unexpected overflow. Fixes: dde1a86e93ca ("net: hns3: Add mailbox support to PF driver") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 48009e9972974c52a5f649f761862dd67bce3d13 Author: Jie Wang Date: Sun Apr 24 20:57:23 2022 +0800 net: hns3: modify the return code of hclge_get_ring_chain_from_mbx Currently, function hclge_get_ring_chain_from_mbx will return -ENOMEM if ring_num is bigger than HCLGE_MBX_MAX_RING_CHAIN_PARAM_NUM. It is better to return -EINVAL for the invalid parameter case. So this patch fixes it by return -EINVAL in this abnormal branch. Fixes: 5d02a58dae60 ("net: hns3: fix for buffer overflow smatch warning") Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 123521b6b260d901937d3fb598ab88d260c857a6 Author: Peng Li Date: Sun Apr 24 20:57:22 2022 +0800 net: hns3: fix error log of tx/rx tqps stats The comments in function hclge_comm_tqps_update_stats is not right, so fix it. Fixes: 287db5c40d15 ("net: hns3: create new set of common tqp stats APIs for PF and VF reuse") Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_tqp_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1ec1968e4e439c9e05245f9a44e7a65429b0d7e6 Author: Hao Chen Date: Sun Apr 24 20:57:21 2022 +0800 net: hns3: align the debugfs output to the left For debugfs node rx/tx_queue_info and rx/tx_bd_info, their output info is aligned to the right, it's not aligned with output of other debugfs node, so uniform their output info. Fixes: 907676b13071 ("net: hns3: use tx bounce buffer for small packets") Fixes: e44c495d95e0 ("net: hns3: refactor queue info of debugfs") Fixes: 77e9184869c9 ("net: hns3: refactor dump bd info of debugfs") Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 84 +++++++++++----------- 1 file changed, 42 insertions(+), 42 deletions(-) commit e98365afc1e94ea1609268866a44112b3572c58b Author: Jian Shen Date: Sun Apr 24 20:57:20 2022 +0800 net: hns3: clear inited state and stop client after failed to register netdev If failed to register netdev, it needs to clear INITED state and stop client in case of cause problem when concurrency with uninitialized process of driver. Fixes: a289a7e5c1d4 ("net: hns3: put off calling register_netdev() until client initialize complete") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 5220a5251130c251877df4ac6ec7d473668b98a7 Merge: 165e3e17fe8f 8ddffdb9442a Author: David S. Miller Date: Mon Apr 25 10:45:04 2022 +0100 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Fix incorrect printing of memory size of IPVS connection hash table, from Pengcheng Yang. 2) Fix spurious EEXIST errors in nft_set_rbtree. 3) Remove leftover empty flowtable file, from Rongguang Wei. 4) Fix ip6_route_me_harder() with vrf driver, from Martin Willi. ==================== Signed-off-by: David S. Miller commit 8ddffdb9442a9d60b4a6e679ac48d7d21403a674 Author: Martin Willi Date: Tue Apr 19 15:47:00 2022 +0200 netfilter: Update ip6_route_me_harder to consider L3 domain The commit referenced below fixed packet re-routing if Netfilter mangles a routing key property of a packet and the packet is routed in a VRF L3 domain. The fix, however, addressed IPv4 re-routing, only. This commit applies the same behavior for IPv6. While at it, untangle the nested ternary operator to make the code more readable. Fixes: 6d8b49c3a3a3 ("netfilter: Update ip_route_me_harder to consider L3 domain") Cc: stable@vger.kernel.org Signed-off-by: Martin Willi Reviewed-by: David Ahern Signed-off-by: Pablo Neira Ayuso net/ipv6/netfilter.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 7acae6183cf37c48b8da48bbbdb78820fb3913f3 Author: Xiubo Li Date: Thu Apr 14 09:07:21 2022 +0800 ceph: fix possible NULL pointer dereference for req->r_session The request will be inserted into the ci->i_unsafe_dirops before assigning the req->r_session, so it's possible that we will hit NULL pointer dereference bug here. Cc: stable@vger.kernel.org URL: https://tracker.ceph.com/issues/55327 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Tested-by: Aaron Tomlin Signed-off-by: Ilya Dryomov fs/ceph/caps.c | 4 ++++ 1 file changed, 4 insertions(+) commit 396ea1681892211dd3fbc1a58bfc2c2c971433e3 Author: Xiubo Li Date: Tue Mar 22 11:03:13 2022 +0800 ceph: remove incorrect session state check Once the session is opened the s->s_ttl will be set, and when receiving a new mdsmap and the MDS map is changed, it will be possibly will close some sessions and open new ones. And then some sessions will be in CLOSING state evening without unmounting. URL: https://tracker.ceph.com/issues/54979 Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov fs/ceph/mds_client.c | 6 ------ 1 file changed, 6 deletions(-) commit 7f47f7f3b3c33fd2b4a662cd43cd1af96e1a297e Author: Niels Dossche Date: Tue Mar 15 16:29:47 2022 +0100 ceph: get snap_rwsem read lock in handle_cap_export for ceph_add_cap ceph_add_cap says in its function documentation that the caller should hold the read lock on the session snap_rwsem. Furthermore, not only ceph_add_cap needs that lock, when it calls to ceph_lookup_snap_realm it eventually calls ceph_get_snap_realm which states via lockdep that snap_rwsem needs to be held. handle_cap_export calls ceph_add_cap without that mdsc->snap_rwsem held. Thus, since ceph_get_snap_realm and ceph_add_cap both need the lock, the common place to acquire that lock is inside handle_cap_export. Signed-off-by: Niels Dossche Reviewed-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov fs/ceph/caps.c | 3 +++ 1 file changed, 3 insertions(+) commit dc9b0dc4561dedd44b2bf4b8e5ef1a8a040b2424 Author: Ilya Dryomov Date: Sat Mar 12 11:09:34 2022 +0100 libceph: disambiguate cluster/pool full log message Signed-off-by: Ilya Dryomov net/ceph/osd_client.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit b9b1e0da5800a41a537f3bd1c294e492dad5cc9e Author: Rongguang Wei Date: Wed Apr 20 10:38:04 2022 +0800 netfilter: flowtable: Remove the empty file CONFIG_NF_FLOW_TABLE_IPV4 is already removed and the real user is also removed(nf_flow_table_ipv4.c is empty). Fixes: c42ba4290b2147aa ("netfilter: flowtable: remove ipv4/ipv6 modules") Signed-off-by: Pablo Neira Ayuso net/ipv4/netfilter/nf_flow_table_ipv4.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) commit eb9d84b0ffe39893cb23b0b6712bbe3637fa25fa Author: Takashi Sakamoto Date: Sun Apr 24 19:24:28 2022 +0900 ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes ALSA fireworks driver has a bug in its initial state to return count shorter than expected by 4 bytes to userspace applications when handling response frame for Echo Audio Fireworks transaction. It's due to missing addition of the size for the type of event in ALSA firewire stack. Fixes: 555e8a8f7f14 ("ALSA: fireworks: Add command/response functionality into hwdep interface") Cc: Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220424102428.21109-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai sound/firewire/fireworks/fireworks_hwdep.c | 1 + 1 file changed, 1 insertion(+) commit 3b79954fd00d540677c97a560622b73f3a1f4e28 Author: Zihao Wang Date: Sun Apr 24 16:41:20 2022 +0800 ALSA: hda/realtek: Add quirk for Yoga Duet 7 13ITL6 speakers Lenovo Yoga Duet 7 13ITL6 has Realtek ALC287 and built-in speakers do not work out of the box. The fix developed for Yoga 7i 14ITL5 also enables speaker output for this model. Signed-off-by: Zihao Wang Cc: Link: https://lore.kernel.org/r/20220424084120.74125-1-wzhd@ustc.edu Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) commit b4b7f2a65ced7ee28d9516d6a362ee6fb72fbb66 Merge: 5f5d8890789c a7ecbe92b924 Author: Takashi Iwai Date: Mon Apr 25 08:01:17 2022 +0200 Merge branch 'topic/firewire' into for-linus Pull FireWire fixes Signed-off-by: Takashi Iwai commit a7ecbe92b9243edbe94772f6f2c854e4142a3345 Author: Niels Dossche Date: Sat Apr 9 13:12:43 2022 +0900 firewire: core: extend card->lock in fw_core_handle_bus_reset card->local_node and card->bm_retries are both always accessed under card->lock. fw_core_handle_bus_reset has a check whose condition depends on card->local_node and whose body writes to card->bm_retries. Both of these accesses are not under card->lock. Move the lock acquiring of card->lock to before this check such that these accesses do happen when card->lock is held. fw_destroy_nodes is called inside the check. Since fw_destroy_nodes already acquires card->lock inside its function body, move this out to the callsites of fw_destroy_nodes. Also add a comment to indicate which locking is necessary when calling fw_destroy_nodes. Cc: Signed-off-by: Niels Dossche Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220409041243.603210-4-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai drivers/firewire/core-card.c | 3 +++ drivers/firewire/core-topology.c | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) commit 9423973869bd4632ffe669f950510c49296656e0 Author: Jakob Koschel Date: Sat Apr 9 13:12:42 2022 +0900 firewire: remove check of list iterator against head past the loop body When list_for_each_entry() completes the iteration over the whole list without breaking the loop, the iterator value will be a bogus pointer computed based on the head element. While it is safe to use the pointer to determine if it was computed based on the head element, either with list_entry_is_head() or &pos->member == head, using the iterator variable after the loop should be avoided. In preparation to limit the scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Cc: Signed-off-by: Jakob Koschel Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220409041243.603210-3-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai drivers/firewire/core-transaction.c | 30 ++++++++++++++++-------------- drivers/firewire/sbp2.c | 13 +++++++------ 2 files changed, 23 insertions(+), 20 deletions(-) commit b7c81f80246fac44077166f3e07103affe6db8ff Author: Chengfeng Ye Date: Sat Apr 9 13:12:41 2022 +0900 firewire: fix potential uaf in outbound_phy_packet_callback() &e->event and e point to the same address, and &e->event could be freed in queue_event. So there is a potential uaf issue if we dereference e after calling queue_event(). Fix this by adding a temporary variable to maintain e->client in advance, this can avoid the potential uaf issue. Cc: Signed-off-by: Chengfeng Ye Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220409041243.603210-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai drivers/firewire/core-cdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 1aa24a8f3b5133dae4bc1e57427e345445f3e902 Author: Xiaobing Luo Date: Sat Apr 23 15:12:04 2022 +0000 cpufreq: fix memory leak in sun50i_cpufreq_nvmem_probe -------------------------------------------- unreferenced object 0xffff000010742a00 (size 128): comm "swapper/0", pid 1, jiffies 4294902015 (age 1187.652s) 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: [<00000000b4dfebaa>] __kmalloc+0x338/0x474 [<00000000d6e716db>] sun50i_cpufreq_nvmem_probe+0xc4/0x36c [<000000007d6082a0>] platform_probe+0x98/0x11c [<00000000c990f549>] really_probe+0x234/0x5a0 [<000000002d9fecc6>] __driver_probe_device+0x194/0x224 [<00000000cf0b94fa>] driver_probe_device+0x64/0x13c [<00000000f238e4cf>] __device_attach_driver+0xf8/0x180 [<000000006720e418>] bus_for_each_drv+0xf8/0x160 [<00000000df4f14f6>] __device_attach+0x174/0x29c [<00000000782002fb>] device_initial_probe+0x20/0x30 [<00000000c2681b06>] bus_probe_device+0xfc/0x110 [<00000000964cf3bd>] device_add+0x5f0/0xcd0 [<000000004b9264e3>] platform_device_add+0x198/0x390 [<00000000fa82a9d0>] platform_device_register_full+0x178/0x210 [<000000009a5daf13>] sun50i_cpufreq_init+0xf8/0x168 [<000000000377cc7c>] do_one_initcall+0xe4/0x570 -------------------------------------------- if sun50i_cpufreq_get_efuse failed, then opp_tables leak. Fixes: f328584f7bff ("cpufreq: Add sun50i nvmem based CPU scaling driver") Signed-off-by: Xiaobing Luo Reviewed-by: Samuel Holland Signed-off-by: Viresh Kumar drivers/cpufreq/sun50i-cpufreq-nvmem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit c05d8332f5d23fa3b521911cbe55a2b67fb21248 Author: Jouni Högander Date: Wed Apr 13 11:28:26 2022 +0300 drm/i915: Check EDID for HDR static metadata when choosing blc We have now seen panel (XMG Core 15 e21 laptop) advertizing support for Intel proprietary eDP backlight control via DPCD registers, but actually working only with legacy pwm control. This patch adds panel EDID check for possible HDR static metadata and Intel proprietary eDP backlight control is used only if that exists. Missing HDR static metadata is ignored if user specifically asks for Intel proprietary eDP backlight control via enable_dpcd_backlight parameter. v2 : - Ignore missing HDR static metadata if Intel proprietary eDP backlight control is forced via i915.enable_dpcd_backlight - Printout info message if panel is missing HDR static metadata and support for Intel proprietary eDP backlight control is detected Fixes: 4a8d79901d5b ("drm/i915/dp: Enable Intel's HDR backlight interface (only SDR for now)") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5284 Cc: Lyude Paul Cc: Mika Kahola Cc: Jani Nikula Cc: Filippo Falezza Cc: stable@vger.kernel.org Signed-off-by: Jouni Högander Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220413082826.120634-1-jouni.hogander@intel.com Reviewed-by: Lyude Paul (cherry picked from commit b4b157577cb1de13bee8bebc3576f1de6799a921) Signed-off-by: Joonas Lahtinen .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 34 +++++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) commit ed911c9f9dcb26849fa688225f002ef2f2c50cf4 Author: Hans de Goede Date: Mon Apr 18 17:09:36 2022 +0200 drm/i915: Fix DISP_POS_Y and DISP_HEIGHT defines Commit 428cb15d5b00 ("drm/i915: Clean up pre-skl primary plane registers") introduced DISP_POS_Y and DISP_HEIGHT defines but accidentally set these their masks to REG_GENMASK(31, 0) instead of REG_GENMASK(31, 16). This breaks the primary display pane on at least pineview machines, fix the mask to fix the primary display pane only showing black. Tested on an Acer One AO532h with an Intel N450 SoC. Fixes: 428cb15d5b00 ("drm/i915: Clean up pre-skl primary plane registers") Cc: José Roberto de Souza Cc: Ville Syrjälä Signed-off-by: Hans de Goede Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220418150936.5499-1-hdegoede@redhat.com Reviewed-by: José Roberto de Souza (cherry picked from commit 681f8a5c6e372dbfd2a313ace417e7749543de1d) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/i915_reg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit af2d861d4cd2a4da5137f795ee3509e6f944a25b Author: Linus Torvalds Date: Sun Apr 24 14:51:22 2022 -0700 Linux 5.18-rc4 Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b4f3d5f06e29b7020f19cc788b2c2de750e888a1 Author: Samuel Holland Date: Mon Apr 11 00:00:59 2022 -0500 clk: sunxi-ng: sun6i-rtc: Mark rtc-32k as critical Because some newer hardware variants have multiple possible parents for the RTC's timekeeping clock, this driver models it as a "rtc-32k" clock. However, it does not add any consumer for this clock. This causes the common clock framework to disable it, preventing RTC time access. Since the RTC's timekeeping clock should always be enabled, regardless of which drivers are loaded, let's mark this clock as critical instead of adding a consumer in the RTC driver. Fixes: d91612d7f01a ("clk: sunxi-ng: Add support for the sun6i RTC clocks") Signed-off-by: Samuel Holland Acked-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220411050100.40964-1-samuel@sholland.org drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 1 + 1 file changed, 1 insertion(+) commit 42740a2ff5d3f2cc0c73876dfb37ed0b88d926fd Merge: 5206548f6e67 40f5aa4c5eae Author: Linus Torvalds Date: Sun Apr 24 13:28:06 2022 -0700 Merge tag 'sched_urgent_for_v5.18_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Borislav Petkov: - Fix a corner case when calculating sched runqueue variables That fix also removes a check for a zero divisor in the code, without mentioning it. Vincent clarified that it's ok after I whined about it: https://lore.kernel.org/all/CAKfTPtD2QEyZ6ADd5WrwETMOX0XOwJGnVddt7VHgfURdqgOS-Q@mail.gmail.com/ * tag 'sched_urgent_for_v5.18_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/pelt: Fix attach_entity_load_avg() corner case commit 5206548f6e6741fccbce8d95cff8faeba0738c99 Merge: f48ffef19dfd bb82c574691d Author: Linus Torvalds Date: Sun Apr 24 12:11:20 2022 -0700 Merge tag 'powerpc-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Partly revert a change to our timer_interrupt() that caused lockups with high res timers disabled. - Fix a bug in KVM TCE handling that could corrupt kernel memory. - Two commits fixing Power9/Power10 perf alternative event selection. Thanks to Alexey Kardashevskiy, Athira Rajeev, David Gibson, Frederic Barrat, Madhavan Srinivasan, Miguel Ojeda, and Nicholas Piggin. * tag 'powerpc-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/perf: Fix 32bit compile powerpc/perf: Fix power10 event alternatives powerpc/perf: Fix power9 event alternatives KVM: PPC: Fix TCE handling for VFIO powerpc/time: Always set decrementer in timer_interrupt() commit f48ffef19dfd6a3c2a6872d4c680c90e14103fdf Merge: b877ca4dc816 528c9f1daf20 Author: Linus Torvalds Date: Sun Apr 24 12:01:16 2022 -0700 Merge tag 'perf_urgent_for_v5.18_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Add Sapphire Rapids CPU support - Fix a perf vmalloc-ed buffer mapping error (PERF_USE_VMALLOC in use) * tag 'perf_urgent_for_v5.18_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/cstate: Add SAPPHIRERAPIDS_X CPU support perf/core: Fix perf_mmap fail when CONFIG_PERF_USE_VMALLOC enabled commit b877ca4dc816aeee1ac2e27eae3f2ed42179d707 Merge: 9becb6889130 e2932d1f6f05 Author: Linus Torvalds Date: Sun Apr 24 11:24:48 2022 -0700 Merge tag 'edac_urgent_for_v5.18_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC fix from Borislav Petkov: - Read the reported error count from the proper register on synopsys_edac * tag 'edac_urgent_for_v5.18_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/synopsys: Read the error count from the correct register commit 9becb688913023124464c5463b4389b3b293f0e7 Author: Linus Torvalds Date: Fri Apr 22 11:41:38 2022 -0700 kvmalloc: use vmalloc_huge for vmalloc allocations Since 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, because it caused a number of problems that weren't noticed until x86 enabled it too. One of the issues was fixed by Nick Piggin in commit 3b8000ae185c ("mm/vmalloc: huge vmalloc backing pages should be split rather than compound"), but I'm still worried about page protection issues, and VM_FLUSH_RESET_PERMS in particular. However, like the hash table allocation case (commit f2edd118d02d: "page_alloc: use vmalloc_huge for large system hash"), the use of kvmalloc() should be safe from any such games, since the returned pointer might be a SLUB allocation, and as such no user should reasonably be using it in any odd ways. We also know that the allocations are fairly large, since it falls back to the vmalloc case only when a kmalloc() fails. So using a hugepage mapping seems both safe and relevant. This patch does show a weakness in the opt-in strategy: since the opt-in flag is in the 'vm_flags', not the usual gfp_t allocation flags, very few of the usual interfaces actually expose it. That's not much of an issue in this case that already used one of the fairly specialized low-level vmalloc interfaces for the allocation, but for a lot of other vmalloc() users that might want to opt in, it's going to be very inconvenient. We'll either have to fix any compatibility problems, or expose it in the gfp flags (__GFP_COMP would have made a lot of sense) to allow normal vmalloc() users to use hugepage mappings. That said, the cases that really matter were probably already taken care of by the hash tabel allocation. Link: https://lore.kernel.org/all/20220415164413.2727220-1-song@kernel.org/ Link: https://lore.kernel.org/all/CAHk-=whao=iosX1s5Z4SF-ZGa-ebAukJoAdUJFk5SPwnofV+Vg@mail.gmail.com/ Cc: Nicholas Piggin Cc: Paul Menzel Cc: Song Liu Cc: Rick Edgecombe Cc: Andrew Morton Signed-off-by: Linus Torvalds mm/util.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit f2edd118d02dd11449b126f786f09749ca152ba5 Author: Song Liu Date: Fri Apr 15 09:44:11 2022 -0700 page_alloc: use vmalloc_huge for large system hash Use vmalloc_huge() in alloc_large_system_hash() so that large system hash (>= PMD_SIZE) could benefit from huge pages. Note that vmalloc_huge only allocates huge pages for systems with HAVE_ARCH_HUGE_VMALLOC. Signed-off-by: Song Liu Reviewed-by: Christoph Hellwig Reviewed-by: Rik van Riel Signed-off-by: Linus Torvalds mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5b47b751b760ee1c74a51660fd096aa148a362cd Author: Christophe Leroy Date: Wed Mar 23 11:51:55 2022 +0100 eeprom: at25: Use DMA safe buffers Reading EEPROM fails with following warning: [ 16.357496] ------------[ cut here ]------------ [ 16.357529] fsl_spi b01004c0.spi: rejecting DMA map of vmalloc memory [ 16.357698] WARNING: CPU: 0 PID: 371 at include/linux/dma-mapping.h:326 fsl_spi_cpm_bufs+0x2a0/0x2d8 [ 16.357775] CPU: 0 PID: 371 Comm: od Not tainted 5.16.11-s3k-dev-01743-g19beecbfe9d6-dirty #109 [ 16.357806] NIP: c03fbc9c LR: c03fbc9c CTR: 00000000 [ 16.357825] REGS: e68d9b20 TRAP: 0700 Not tainted (5.16.11-s3k-dev-01743-g19beecbfe9d6-dirty) [ 16.357849] MSR: 00029032 CR: 24002282 XER: 00000000 [ 16.357931] [ 16.357931] GPR00: c03fbc9c e68d9be0 c26d06a0 00000039 00000001 c0d36364 c0e96428 00000027 [ 16.357931] GPR08: 00000001 00000000 00000023 3fffc000 24002282 100d3dd6 100a2ffc 00000000 [ 16.357931] GPR16: 100cd280 100b0000 00000000 aff54f7e 100d0000 100d0000 00000001 100cf328 [ 16.357931] GPR24: 100cf328 00000000 00000003 e68d9e30 c156b410 e67ab4c0 e68d9d38 c24ab278 [ 16.358253] NIP [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8 [ 16.358292] LR [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8 [ 16.358325] Call Trace: [ 16.358336] [e68d9be0] [c03fbc9c] fsl_spi_cpm_bufs+0x2a0/0x2d8 (unreliable) [ 16.358388] [e68d9c00] [c03fcb44] fsl_spi_bufs.isra.0+0x94/0x1a0 [ 16.358436] [e68d9c20] [c03fd970] fsl_spi_do_one_msg+0x254/0x3dc [ 16.358483] [e68d9cb0] [c03f7e50] __spi_pump_messages+0x274/0x8a4 [ 16.358529] [e68d9ce0] [c03f9d30] __spi_sync+0x344/0x378 [ 16.358573] [e68d9d20] [c03fb52c] spi_sync+0x34/0x60 [ 16.358616] [e68d9d30] [c03b4dec] at25_ee_read+0x138/0x1a8 [ 16.358667] [e68d9e50] [c04a8fb8] bin_attr_nvmem_read+0x98/0x110 [ 16.358725] [e68d9e60] [c0204b14] kernfs_fop_read_iter+0xc0/0x1fc [ 16.358774] [e68d9e80] [c0168660] vfs_read+0x284/0x410 [ 16.358821] [e68d9f00] [c016925c] ksys_read+0x6c/0x11c [ 16.358863] [e68d9f30] [c00160e0] ret_from_syscall+0x0/0x28 ... [ 16.359608] ---[ end trace a4ce3e34afef0cb5 ]--- [ 16.359638] fsl_spi b01004c0.spi: unable to map tx dma This is due to the AT25 driver using buffers on stack, which is not possible with CONFIG_VMAP_STACK. As mentionned in kernel Documentation (Documentation/spi/spi-summary.rst): - Follow standard kernel rules, and provide DMA-safe buffers in your messages. That way controller drivers using DMA aren't forced to make extra copies unless the hardware requires it (e.g. working around hardware errata that force the use of bounce buffering). Modify the driver to use a buffer located in the at25 device structure which is allocated via kmalloc during probe. Protect writes in this new buffer with the driver's mutex. Fixes: b587b13a4f67 ("[PATCH] SPI eeprom driver") Cc: stable Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/230a9486fc68ea0182df46255e42a51099403642.1648032613.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman drivers/misc/eeprom/at25.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) commit 0c9843a74a85224a89daa81fa66891dae2f930e1 Author: Lv Ruyi Date: Sun Apr 24 03:14:30 2022 +0000 pinctrl: pistachio: fix use of irq_of_parse_and_map() The irq_of_parse_and_map() function returns 0 on failure, and does not return an negative value. Fixes: cefc03e5995e ("pinctrl: Add Pistachio SoC pin control driver") Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220424031430.3170759-1-lv.ruyi@zte.com.cn Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-pistachio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 0310b5aa0656a94102344f1e9ae2892e342a665d Author: Fabio Estevam Date: Mon Apr 18 14:47:31 2022 -0300 arm64: dts: imx8mn-ddr4-evk: Describe the 32.768 kHz PMIC clock The ROHM BD71847 PMIC has a 32.768 kHz clock. Describe the PMIC clock to fix the following boot errors: bd718xx-clk bd71847-clk.1.auto: No parent clk found bd718xx-clk: probe of bd71847-clk.1.auto failed with error -22 Based on the same fix done for imx8mm-evk as per commit a6a355ede574 ("arm64: dts: imx8mm-evk: Add 32.768 kHz clock to PMIC") Fixes: 3e44dd09736d ("arm64: dts: imx8mn-ddr4-evk: Add rohm,bd71847 PMIC support") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts | 4 ++++ 1 file changed, 4 insertions(+) commit 45974e4276a8d6653394f66666fc57d8ffa6de9a Author: Max Krummenacher Date: Thu Apr 14 10:50:54 2022 +0200 ARM: dts: imx6ull-colibri: fix vqmmc regulator The correct spelling for the property is gpios. Otherwise, the regulator will neither reserve nor control any GPIOs. Thus, any SD/MMC card which can use UHS-I modes will fail. Fixes: c2e4987e0e02 ("ARM: dts: imx6ull: add Toradex Colibri iMX6ULL support") Signed-off-by: Max Krummenacher Signed-off-by: Denys Drozdov Signed-off-by: Marcel Ziswiler Signed-off-by: Shawn Guo arch/arm/boot/dts/imx6ull-colibri.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 22da5264abf497a10a4ed629f07f4ba28a7ed5eb Merge: f39359260e39 02655a70b7cc Author: Linus Torvalds Date: Sat Apr 23 17:16:10 2022 -0700 Merge tag '5.18-rc3-ksmbd-fixes' of git://git.samba.org/ksmbd Pull ksmbd server fixes from Steve French: - cap maximum sector size reported to avoid mount problems - reference count fix - fix filename rename race * tag '5.18-rc3-ksmbd-fixes' of git://git.samba.org/ksmbd: ksmbd: set fixed sector size to FS_SECTOR_SIZE_INFORMATION ksmbd: increment reference count of parent fp ksmbd: remove filename in ksmbd_file commit f39359260e39fc45008c1140a84497ffde193fa7 Merge: 6fc2586d23b5 c6ed4d84a2c4 Author: Linus Torvalds Date: Sat Apr 23 16:24:30 2022 -0700 Merge tag 'arc-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC fixes from Vineet Gupta: - Assorted fixes * tag 'arc-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARC: remove redundant READ_ONCE() in cmpxchg loop ARC: atomic: cleanup atomic-llsc definitions arc: drop definitions of pgd_index() and pgd_offset{, _k}() entirely ARC: dts: align SPI NOR node name with dtschema ARC: Remove a redundant memset() ARC: fix typos in comments ARC: entry: fix syscall_trace_exit argument commit 165e3e17fe8fe6a8aab319bc6e631a2e23b9a857 Author: Xin Long Date: Wed Apr 20 16:52:41 2022 -0400 sctp: check asoc strreset_chunk in sctp_generate_reconf_event A null pointer reference issue can be triggered when the response of a stream reconf request arrives after the timer is triggered, such as: send Incoming SSN Reset Request ---> CPU0: reconf timer is triggered, go to the handler code before hold sk lock <--- reply with Outgoing SSN Reset Request CPU1: process Outgoing SSN Reset Request, and set asoc->strreset_chunk to NULL CPU0: continue the handler code, hold sk lock, and try to hold asoc->strreset_chunk, crash! In Ying Xu's testing, the call trace is: [ ] BUG: kernel NULL pointer dereference, address: 0000000000000010 [ ] RIP: 0010:sctp_chunk_hold+0xe/0x40 [sctp] [ ] Call Trace: [ ] [ ] sctp_sf_send_reconf+0x2c/0x100 [sctp] [ ] sctp_do_sm+0xa4/0x220 [sctp] [ ] sctp_generate_reconf_event+0xbd/0xe0 [sctp] [ ] call_timer_fn+0x26/0x130 This patch is to fix it by returning from the timer handler if asoc strreset_chunk is already set to NULL. Fixes: 7b9438de0cd4 ("sctp: add stream reconf timer") Reported-by: Ying Xu Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller net/sctp/sm_sideeffect.c | 4 ++++ 1 file changed, 4 insertions(+) commit 6fc2586d23b574fcd3f6b14430277e91d27cf585 Merge: b51bd23c614b faad6cebded8 Author: Linus Torvalds Date: Sat Apr 23 13:58:18 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fix from James Bottomley: "One fix for an information leak caused by copying a buffer to userspace without checking for error first in the sr driver" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: sr: Do not leak information in ioctl commit b51bd23c614bc5a8a905d258133246e78d611df1 Merge: 13bc32bad705 533bec143a4c Author: Linus Torvalds Date: Sat Apr 23 13:53:21 2022 -0700 Merge tag 'for-linus-5.18-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "A simple cleanup patch and a refcount fix for Xen on Arm" * tag 'for-linus-5.18-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: arm/xen: Fix some refcount leaks xen: Convert kmap() to kmap_local_page() commit 13bc32bad7059d6c5671e9d037e6e3ed001cc0f4 Merge: 0fe86b27cbad c18a2a280c07 Author: Linus Torvalds Date: Sat Apr 23 09:57:30 2022 -0700 Merge tag 'drm-fixes-2022-04-23' of git://anongit.freedesktop.org/drm/drm Pull more drm fixes from Dave Airlie: "Maarten was away, so Maxine stepped up and sent me the drm-fixes merge, so no point leaving it for another week. The big change is an OF revert around bridge/panels, it may have some driver fallout, but hopefully this revert gets them shook out in the next week easier. Otherwise it's a bunch of locking/refcounts across drivers, a radeon dma_resv logic fix and some raspberry pi panel fixes. panel: - revert of patch that broke panel/bridge issues dma-buf: - remove unused header file. amdgpu: - partial revert of locking change radeon: - fix dma_resv logic inversion panel: - pi touchscreen panel init fixes vc4: - build fix - runtime pm refcount fix vmwgfx: - refcounting fix" * tag 'drm-fixes-2022-04-23' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: partial revert "remove ctx->lock" v2 Revert "drm: of: Lookup if child node has panel or bridge" Revert "drm: of: Properly try all possible cases for bridge/panel detection" drm/vc4: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage drm/vmwgfx: Fix gem refcounting and memory evictions drm/vc4: Fix build error when CONFIG_DRM_VC4=y && CONFIG_RASPBERRYPI_FIRMWARE=m drm/panel/raspberrypi-touchscreen: Initialise the bridge in prepare drm/panel/raspberrypi-touchscreen: Avoid NULL deref if not initialised dma-buf-map: remove renamed header file drm/radeon: fix logic inversion in radeon_sync_resv commit 0fe86b27cbad8003e90aa78ebd19c3d8a3eb89a5 Merge: 8467f9e34955 470776c6b034 Author: Linus Torvalds Date: Sat Apr 23 09:52:07 2022 -0700 Merge tag 'input-for-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - a new set of keycodes to be used by marine navigation systems - minor fixes to omap4-keypad and cypress-sf drivers * tag 'input-for-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: add Marine Navigation Keycodes Input: omap4-keypad - fix pm_runtime_get_sync() error checking Input: cypress-sf - register a callback to disable the regulators commit 8467f9e34955c6923e0ed63b1c2dbbf1df70b908 Merge: 1f5e98e723a0 9dca4168a37c Author: Linus Torvalds Date: Sat Apr 23 09:46:44 2022 -0700 Merge tag 'block-5.18-2022-04-22' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Just two small regression fixes for bcache" * tag 'block-5.18-2022-04-22' of git://git.kernel.dk/linux-block: bcache: fix wrong bdev parameter when calling bio_alloc_clone() in do_bio_hook() bcache: put bch_bio_map() back to correct location in journal_write_unlocked() commit 1f5e98e723a0be814181524a7e6aaf87a805cdc9 Merge: 45ab9400e73f c0713540f6d5 Author: Linus Torvalds Date: Sat Apr 23 09:42:13 2022 -0700 Merge tag 'io_uring-5.18-2022-04-22' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Just two small fixes - one fixing a potential leak for the iovec for larger requests added in this cycle, and one fixing a theoretical leak with CQE_SKIP and IOPOLL" * tag 'io_uring-5.18-2022-04-22' of git://git.kernel.dk/linux-block: io_uring: fix leaks on IOPOLL and CQE_SKIP io_uring: free iovec if file assignment fails commit 45ab9400e73f34103e73c18a73280c9aa1650e98 Merge: 9423edfc5188 5bb017d4b97a Author: Linus Torvalds Date: Sat Apr 23 09:36:23 2022 -0700 Merge tag 'perf-tools-fixes-for-v5.18-2022-04-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix header include for LLVM >= 14 when building with libclang. - Allow access to 'data_src' for auxtrace in 'perf script' with ARM SPE perf.data files, fixing processing data with such attributes. - Fix error message for test case 71 ("Convert perf time to TSC") on s390, where it is not supported. * tag 'perf-tools-fixes-for-v5.18-2022-04-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf test: Fix error message for test case 71 on s390, where it is not supported perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event perf script: Always allow field 'data_src' for auxtrace perf clang: Fix header include for LLVM >= 14 commit 9423edfc5188c436f6df4356d0737bae09d35b82 Author: Randy Dunlap Date: Fri Apr 22 20:25:17 2022 -0700 sparc: cacheflush_32.h needs struct page Add a struct page forward declaration to cacheflush_32.h. Fixes this build warning: CC drivers/crypto/xilinx/zynqmp-sha.o In file included from arch/sparc/include/asm/cacheflush.h:11, from include/linux/cacheflush.h:5, from drivers/crypto/xilinx/zynqmp-sha.c:6: arch/sparc/include/asm/cacheflush_32.h:38:37: warning: 'struct page' declared inside parameter list will not be visible outside of this definition or declaration 38 | void sparc_flush_page_to_ram(struct page *page); Exposed by commit 0e03b8fd2936 ("crypto: xilinx - Turn SHA into a tristate and allow COMPILE_TEST") but not Fixes: that commit because the underlying problem is older. Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Herbert Xu Cc: David S. Miller Cc: Sam Ravnborg Cc: sparclinux@vger.kernel.org Acked-by: Sam Ravnborg Acked-by: Herbert Xu Signed-off-by: Linus Torvalds arch/sparc/include/asm/cacheflush_32.h | 1 + 1 file changed, 1 insertion(+) commit c95ce3a23dcda678f6f7811dd39b6d14eeb6f192 Author: Greg Kroah-Hartman Date: Fri Apr 22 08:26:53 2022 +0200 topology: Fix up build warning in topology_is_visible() Commit aa63a74d4535 ("topology/sysfs: Hide PPIN on systems that do not support it.") caused a build warning on some configurations: drivers/base/topology.c: In function 'topology_is_visible': drivers/base/topology.c:158:24: warning: unused variable 'dev' [-Wunused-variable] 158 | struct device *dev = kobj_to_dev(kobj); Fix this up by getting rid of the variable entirely. Fixes: aa63a74d4535 ("topology/sysfs: Hide PPIN on systems that do not support it.") Cc: Tony Luck Reported-by: Stephen Rothwell Link: https://lore.kernel.org/r/20220422062653.3899972-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman drivers/base/topology.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit da609eda81a8b842417ccf74bdf6bf9b5d403549 Merge: f4fd84ae0765 e23e50e7acc8 Author: Greg Kroah-Hartman Date: Sat Apr 23 10:39:26 2022 +0200 Merge tag 'usb-serial-5.18-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.18-rc4 Here's a fix for a potential overflow issue in the whiteheat driver when using the old ARM ABI. Included are also some new modem device ids. All have been in linux-next with no reported issues. * tag 'usb-serial-5.18-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: whiteheat: fix heap overflow in WHITEHEAT_GET_DTR_RTS USB: serial: cp210x: add PIDs for Kamstrup USB Meter Reader USB: serial: option: add support for Cinterion MV32-WA/MV32-WB USB: serial: option: add Telit 0x1057, 0x1058, 0x1075 compositions commit 4dd4e6f659850f2df20b9612593f5a0f040549e1 Author: Gregory Greenman Date: Tue Apr 12 22:01:41 2022 +0300 MAINTAINERS: update iwlwifi driver maintainer Set myself as a maintainer of iwlwifi driver as Luca is moving to a new role. Signed-off-by: Gregory Greenman Acked-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220412190141.4543-1-gregory.greenman@intel.com MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7635a1ad8d92dcc8247b53f949e37795154b5b6f Author: Guenter Roeck Date: Mon Apr 11 08:42:10 2022 -0700 iwlwifi: iwl-dbg: Use del_timer_sync() before freeing In Chrome OS, a large number of crashes is observed due to corrupted timer lists. Steven Rostedt pointed out that this usually happens when a timer is freed while still active, and that the problem is often triggered by code calling del_timer() instead of del_timer_sync() just before freeing. Steven also identified the iwlwifi driver as one of the possible culprits since it does exactly that. Reported-by: Steven Rostedt Cc: Steven Rostedt Cc: Johannes Berg Cc: Gregory Greenman Fixes: 60e8abd9d3e91 ("iwlwifi: dbg_ini: add periodic trigger new API support") Signed-off-by: Guenter Roeck Acked-by: Gregory Greenman Tested-by: Sedat Dilek # Linux v5.17.3-rc1 and Debian LLVM-14 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220411154210.1870008-1-linux@roeck-us.net drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c18a2a280c073f70569a91ef0d7434d12e66e200 Merge: 70da382e1c5b 94f4c4965e55 Author: Dave Airlie Date: Sat Apr 23 15:00:33 2022 +1000 Merge tag 'drm-misc-fixes-2022-04-22' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Two fixes for the raspberrypi panel initialisation, one fix for a logic inversion in radeon, a build and pm refcounting fix for vc4, two reverts for drm_of_get_bridge that caused a number of regression and a locking regression for amdgpu. Signed-off-by: Dave Airlie From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220422084403.2xrhf3jusdej5yo4@houat commit 6deb9bf4580d53fea191fa0689a4446c8937398d Author: Conor Dooley Date: Wed Apr 13 08:58:36 2022 +0100 riscv: dts: microchip: reparent mpfs clocks The 600M clock in the fabric is not the real reference, replace it with a 125M clock which is the correct value for the icicle kit. Rename the msspllclk node to mssrefclk since this is now the input to, not the output of, the msspll clock. Control of the msspll clock has been moved into the clock configurator, so add the register range for it to the clk configurator. Finally, add a new output of the clock config block which will provide the 1M reference clock for the MTIMER and the rtc. Fixes: 528a5b1f2556 ("riscv: dts: microchip: add new peripherals to icicle kit device tree") Fixes: 0fa6107eca41 ("RISC-V: Initial DTS for Microchip ICICLE board") Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220413075835.3354193-10-conor.dooley@microchip.com Acked-by: Palmer Dabbelt Signed-off-by: Stephen Boyd arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dts | 2 +- arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) commit 1c6a7ea32b8cfb1725ef4def26eb9f5bc6e00303 Author: Conor Dooley Date: Wed Apr 13 08:58:35 2022 +0100 clk: microchip: mpfs: add RTCREF clock control The reference clock used by the PolarFire SoC's onboard rtc was missing from the clock driver. Add this clock at the "config" clock level, with the external reference clock as its parent. Fixes: 635e5e73370e ("clk: microchip: Add driver for Microchip PolarFire SoC") Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220413075835.3354193-9-conor.dooley@microchip.com Acked-by: Palmer Dabbelt Signed-off-by: Stephen Boyd drivers/clk/microchip/clk-mpfs.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) commit 445c2da89747e2583062d988c98726cb2744b357 Author: Conor Dooley Date: Wed Apr 13 08:58:34 2022 +0100 clk: microchip: mpfs: re-parent the configurable clocks Currently the mpfs clock driver uses a reference clock called the "msspll", set in the device tree, as the parent for the cpu/axi/ahb (config) clocks. The frequency of the msspll is determined by the FPGA bitstream & the bootloader configures the clock to match the bitstream. The real reference is provided by a 100 or 125 MHz off chip oscillator. However, the msspll clock is not actually the parent of all clocks on the system - the reference clock for the rtc/mtimer actually has the off chip oscillator as its parent. In order to fix this, add support for reading the configuration of the msspll & reparent the "config" clocks so that they are derived from this clock rather than the reference in the device tree. Fixes: 635e5e73370e ("clk: microchip: Add driver for Microchip PolarFire SoC") Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220413075835.3354193-8-conor.dooley@microchip.com Acked-by: Palmer Dabbelt Signed-off-by: Stephen Boyd drivers/clk/microchip/clk-mpfs.c | 151 ++++++++++++++++++++++++++++++++++----- 1 file changed, 132 insertions(+), 19 deletions(-) commit 8e8fbab4f1e659f9955bc946a2fc71b8c3ba17e0 Author: Conor Dooley Date: Wed Apr 13 08:58:33 2022 +0100 dt-bindings: rtc: add refclk to mpfs-rtc The rtc on PolarFire SoC does not use the AHB clock as its reference frequency, but rather a 1 MHz refclk that it shares with MTIMER. Add this second clock to the binding as a required property. Fixes: 4cbcc0d7b397 ("dt-bindings: rtc: add bindings for microchip mpfs rtc") Reviewed-by: Daire McNamara Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220413075835.3354193-7-conor.dooley@microchip.com Acked-by: Palmer Dabbelt Signed-off-by: Stephen Boyd .../devicetree/bindings/rtc/microchip,mfps-rtc.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit 8be99c7b8bb17f2b82af4a0a6798b795f4d74436 Author: Conor Dooley Date: Wed Apr 13 08:58:32 2022 +0100 dt-bindings: clk: mpfs: add defines for two new clocks The RTC reference and MSSPLL were previously not documented or defined, as they were unused. Add their defines to the PolarFire SoC header. Fixes: 2145bb687e3f ("dt-bindings: clk: microchip: Add Microchip PolarFire host binding") Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220413075835.3354193-6-conor.dooley@microchip.com Acked-by: Krzysztof Kozlowski Acked-by: Palmer Dabbelt Signed-off-by: Stephen Boyd include/dt-bindings/clock/microchip,mpfs-clock.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 3ebb9fdf466a246bb17164b70039dce584a0b959 Author: Conor Dooley Date: Wed Apr 13 08:58:31 2022 +0100 dt-bindings: clk: mpfs document msspll dri registers As there are two sections of registers that are responsible for clock configuration on the PolarFire SoC: add the dynamic reconfiguration interface section to the binding & describe what each of the sections are used for. Fixes: 2145bb687e3f ("dt-bindings: clk: microchip: Add Microchip PolarFire host binding") Reviewed-by: Daire McNamara Acked-by: Krzysztof Kozlowski Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220413075835.3354193-5-conor.dooley@microchip.com Acked-by: Palmer Dabbelt Signed-off-by: Stephen Boyd Documentation/devicetree/bindings/clock/microchip,mpfs.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit 2b6190c804238cbdca4e4fbe20304151203a3837 Author: Conor Dooley Date: Wed Apr 13 08:58:30 2022 +0100 riscv: dts: microchip: fix usage of fic clocks on mpfs The fic clocks passed to the pcie controller and other peripherals in the device tree are not the clocks they actually run on. The fics are actually clock domain crossers & the clock config blocks output is the mss/cpu side input to the interconnect. The peripherals are actually clocked by fixed frequency clocks embedded in the fpga fabric. Fix the device tree so that these peripherals use the correct clocks. The fabric side FIC0 & FIC1 inputs both use the same 125 MHz, so only one clock is created for them. Fixes: 528a5b1f2556 ("riscv: dts: microchip: add new peripherals to icicle kit device tree") Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220413075835.3354193-4-conor.dooley@microchip.com Acked-by: Palmer Dabbelt Signed-off-by: Stephen Boyd arch/riscv/boot/dts/microchip/microchip-mpfs-fabric.dtsi | 16 ++++++++++++++-- arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) commit a2438f82366eaeb4dc122c021884ea8deea5b215 Author: Conor Dooley Date: Wed Apr 13 08:58:29 2022 +0100 clk: microchip: mpfs: mark CLK_ATHENA as critical CLK_ATHENA is another fabric interconnect and should be marked as critical as with FIC0-3, since disabling it will cause part of the fabric to go into reset. Fixes: 635e5e73370e ("clk: microchip: Add driver for Microchip PolarFire SoC") Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220413075835.3354193-3-conor.dooley@microchip.com Acked-by: Palmer Dabbelt Signed-off-by: Stephen Boyd drivers/clk/microchip/clk-mpfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 8f9fb2abe22ece8cac47a8cef3e716441d4ba169 Author: Conor Dooley Date: Wed Apr 13 08:58:28 2022 +0100 clk: microchip: mpfs: fix parents for FIC clocks The fabric interconnects are on the AXI bus not AHB. Update their parent clocks to fix this. Fixes: 635e5e73370e ("clk: microchip: Add driver for Microchip PolarFire SoC") Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220413075835.3354193-2-conor.dooley@microchip.com Acked-by: Palmer Dabbelt Signed-off-by: Stephen Boyd drivers/clk/microchip/clk-mpfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit c00c5e1d157bec0ef0b0b59aa5482eb8dc7e8e49 Merge: 2e5991fa39e4 23e3d7f7061f Author: Linus Torvalds Date: Fri Apr 22 18:18:27 2022 -0700 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 some syzbot-detected bugs, as well as other bugs found by I/O injection testing. Change ext4's fallocate to consistently drop set[ug]id bits when an fallocate operation might possibly change the user-visible contents of a file. Also, improve handling of potentially invalid values in the the s_overhead_cluster superblock field to avoid ext4 returning a negative number of free blocks" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: jbd2: fix a potential race while discarding reserved buffers after an abort ext4: update the cached overhead value in the superblock ext4: force overhead calculation if the s_overhead_cluster makes no sense ext4: fix overhead calculation to account for the reserved gdt blocks ext4, doc: fix incorrect h_reserved size ext4: limit length to bitmap_maxbytes - blocksize in punch_hole ext4: fix use-after-free in ext4_search_dir ext4: fix bug_on in start_this_handle during umount filesystem ext4: fix symlink file size not match to file content ext4: fix fallocate to use file_modified to update permissions consistently commit 2e5991fa39e4eec45eb37a680bfdff18129cefd9 Merge: bb4ce2c65881 aafa9f958342 Author: Linus Torvalds Date: Fri Apr 22 18:09:49 2022 -0700 Merge tag 'ata-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA fix from Damien Le Moal: "A single fix to avoid a NULL pointer dereference in the pata_marvell driver with adapters not supporting DMA, from Zheyu" * tag 'ata-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_marvell: Check the 'bmdma_addr' beforing reading commit bb4ce2c65881a2b9bdcd384f54a260a12a89dd91 Merge: 06fb4ecfeac7 e852be8b148e Author: Linus Torvalds Date: Fri Apr 22 17:58:36 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "The main and larger change here is a workaround for AMD's lack of cache coherency for encrypted-memory guests. I have another patch pending, but it's waiting for review from the architecture maintainers. RISC-V: - Remove 's' & 'u' as valid ISA extension - Do not allow disabling the base extensions 'i'/'m'/'a'/'c' x86: - Fix NMI watchdog in guests on AMD - Fix for SEV cache incoherency issues - Don't re-acquire SRCU lock in complete_emulated_io() - Avoid NULL pointer deref if VM creation fails - Fix race conditions between APICv disabling and vCPU creation - Bugfixes for disabling of APICv - Preserve BSP MSR_KVM_POLL_CONTROL across suspend/resume selftests: - Do not use bitfields larger than 32-bits, they differ between GCC and clang" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: kvm: selftests: introduce and use more page size-related constants kvm: selftests: do not use bitfields larger than 32-bits for PTEs KVM: SEV: add cache flush to solve SEV cache incoherency issues KVM: SVM: Flush when freeing encrypted pages even on SME_COHERENT CPUs KVM: SVM: Simplify and harden helper to flush SEV guest page(s) KVM: selftests: Silence compiler warning in the kvm_page_table_test KVM: x86/pmu: Update AMD PMC sample period to fix guest NMI-watchdog x86/kvm: Preserve BSP MSR_KVM_POLL_CONTROL across suspend/resume KVM: SPDX style and spelling fixes KVM: x86: Skip KVM_GUESTDBG_BLOCKIRQ APICv update if APICv is disabled KVM: x86: Pend KVM_REQ_APICV_UPDATE during vCPU creation to fix a race KVM: nVMX: Defer APICv updates while L2 is active until L1 is active KVM: x86: Tag APICv DISABLE inhibit, not ABSENT, if APICv is disabled KVM: Initialize debugfs_dentry when a VM is created to avoid NULL deref KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused KVM: RISC-V: Use kvm_vcpu.srcu_idx, drop RISC-V's unnecessary copy KVM: x86: Don't re-acquire SRCU lock in complete_emulated_io() RISC-V: KVM: Restrict the extensions that can be disabled RISC-V: KVM: Remove 's' & 'u' as valid ISA extension commit 5fd1fe4807f91ea0cca043114d929faa11bd4190 Author: Dinh Nguyen Date: Wed Apr 20 10:23:45 2022 -0500 net: ethernet: stmmac: fix write to sgmii_adapter_base I made a mistake with the commit a6aaa0032424 ("net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link"). I should have tested against both scenario of having a SGMII interface and one without. Without the SGMII PCS TSE adpater, the sgmii_adapter_base address is NULL, thus a write to this address will fail. Cc: stable@vger.kernel.org Fixes: a6aaa0032424 ("net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link") Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20220420152345.27415-1-dinguyen@kernel.org Signed-off-by: Jakub Kicinski drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit f675ed06390b3a4221384fb19a28407fe3e54160 Merge: b253a0680cea 45ac774c33d8 Author: Jakub Kicinski Date: Fri Apr 22 15:59:08 2022 -0700 Merge branch 'wireguard-patches-for-5-18-rc4' Jason A. Donenfeld says: ==================== wireguard patches for 5.18-rc4 Here are two small wireguard fixes for 5.18-rc4: 1) We enable ACPI in the QEMU test harness, so that multiple CPUs are actually used on x86 for testing for races. 2) Sending skbs with metadata dsts attached resulted in a null pointer dereference, triggerable from executing eBPF programs. The fix is a oneliner, changing a skb_dst() null check into a skb_valid_dst() boolean check. ==================== Link: https://lore.kernel.org/r/20220421134805.279118-1-Jason@zx2c4.com Signed-off-by: Jakub Kicinski commit 45ac774c33d834fe9d4de06ab5f1022fe8cd2071 Author: Nikolay Aleksandrov Date: Thu Apr 21 15:48:05 2022 +0200 wireguard: device: check for metadata_dst with skb_valid_dst() When we try to transmit an skb with md_dst attached through wireguard we hit a null pointer dereference in wg_xmit() due to the use of dst_mtu() which calls into dst_blackhole_mtu() which in turn tries to dereference dst->dev. Since wireguard doesn't use md_dsts we should use skb_valid_dst(), which checks for DST_METADATA flag, and if it's set, then falls back to wireguard's device mtu. That gives us the best chance of transmitting the packet; otherwise if the blackhole netdev is used we'd get ETH_MIN_MTU. [ 263.693506] BUG: kernel NULL pointer dereference, address: 00000000000000e0 [ 263.693908] #PF: supervisor read access in kernel mode [ 263.694174] #PF: error_code(0x0000) - not-present page [ 263.694424] PGD 0 P4D 0 [ 263.694653] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 263.694876] CPU: 5 PID: 951 Comm: mausezahn Kdump: loaded Not tainted 5.18.0-rc1+ #522 [ 263.695190] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1.fc35 04/01/2014 [ 263.695529] RIP: 0010:dst_blackhole_mtu+0x17/0x20 [ 263.695770] Code: 00 00 00 0f 1f 44 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 8b 47 10 48 83 e0 fc 8b 40 04 85 c0 75 09 48 8b 07 <8b> 80 e0 00 00 00 c3 66 90 0f 1f 44 00 00 48 89 d7 be 01 00 00 00 [ 263.696339] RSP: 0018:ffffa4a4422fbb28 EFLAGS: 00010246 [ 263.696600] RAX: 0000000000000000 RBX: ffff8ac9c3553000 RCX: 0000000000000000 [ 263.696891] RDX: 0000000000000401 RSI: 00000000fffffe01 RDI: ffffc4a43fb48900 [ 263.697178] RBP: ffffa4a4422fbb90 R08: ffffffff9622635e R09: 0000000000000002 [ 263.697469] R10: ffffffff9b69a6c0 R11: ffffa4a4422fbd0c R12: ffff8ac9d18b1a00 [ 263.697766] R13: ffff8ac9d0ce1840 R14: ffff8ac9d18b1a00 R15: ffff8ac9c3553000 [ 263.698054] FS: 00007f3704c337c0(0000) GS:ffff8acaebf40000(0000) knlGS:0000000000000000 [ 263.698470] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 263.698826] CR2: 00000000000000e0 CR3: 0000000117a5c000 CR4: 00000000000006e0 [ 263.699214] Call Trace: [ 263.699505] [ 263.699759] wg_xmit+0x411/0x450 [ 263.700059] ? bpf_skb_set_tunnel_key+0x46/0x2d0 [ 263.700382] ? dev_queue_xmit_nit+0x31/0x2b0 [ 263.700719] dev_hard_start_xmit+0xd9/0x220 [ 263.701047] __dev_queue_xmit+0x8b9/0xd30 [ 263.701344] __bpf_redirect+0x1a4/0x380 [ 263.701664] __dev_queue_xmit+0x83b/0xd30 [ 263.701961] ? packet_parse_headers+0xb4/0xf0 [ 263.702275] packet_sendmsg+0x9a8/0x16a0 [ 263.702596] ? _raw_spin_unlock_irqrestore+0x23/0x40 [ 263.702933] sock_sendmsg+0x5e/0x60 [ 263.703239] __sys_sendto+0xf0/0x160 [ 263.703549] __x64_sys_sendto+0x20/0x30 [ 263.703853] do_syscall_64+0x3b/0x90 [ 263.704162] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 263.704494] RIP: 0033:0x7f3704d50506 [ 263.704789] Code: 48 c7 c0 ff ff ff ff eb b7 66 2e 0f 1f 84 00 00 00 00 00 90 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 11 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 72 c3 90 55 48 83 ec 30 44 89 4c 24 2c 4c 89 [ 263.705652] RSP: 002b:00007ffe954b0b88 EFLAGS: 00000246 ORIG_RAX: 000000000000002c [ 263.706141] RAX: ffffffffffffffda RBX: 0000558bb259b490 RCX: 00007f3704d50506 [ 263.706544] RDX: 000000000000004a RSI: 0000558bb259b7b2 RDI: 0000000000000003 [ 263.706952] RBP: 0000000000000000 R08: 00007ffe954b0b90 R09: 0000000000000014 [ 263.707339] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe954b0b90 [ 263.707735] R13: 000000000000004a R14: 0000558bb259b7b2 R15: 0000000000000001 [ 263.708132] [ 263.708398] Modules linked in: bridge netconsole bonding [last unloaded: bridge] [ 263.708942] CR2: 00000000000000e0 Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Link: https://github.com/cilium/cilium/issues/19428 Reported-by: Martynas Pumputis Signed-off-by: Nikolay Aleksandrov Acked-by: Daniel Borkmann Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski drivers/net/wireguard/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 00f3d2ed9dac8fc8674a021765a0772f74c6127b Author: Jason A. Donenfeld Date: Thu Apr 21 15:48:04 2022 +0200 wireguard: selftests: enable ACPI for SMP It turns out that by having CONFIG_ACPI=n, we've been failing to boot additional CPUs, and so these systems were functionally UP. The code bloat is unfortunate for build times, but I don't see an alternative. So this commit sets CONFIG_ACPI=y for x86_64 and i686 configs. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski tools/testing/selftests/wireguard/qemu/arch/i686.config | 1 + tools/testing/selftests/wireguard/qemu/arch/x86_64.config | 1 + 2 files changed, 2 insertions(+) commit b253a0680ceadc5d7b4acca7aa2d870326cad8ad Author: Pengcheng Yang Date: Wed Apr 20 10:34:41 2022 +0800 tcp: ensure to use the most recently sent skb when filling the rate sample If an ACK (s)acks multiple skbs, we favor the information from the most recently sent skb by choosing the skb with the highest prior_delivered count. But in the interval between receiving ACKs, we send multiple skbs with the same prior_delivered, because the tp->delivered only changes when we receive an ACK. We used RACK's solution, copying tcp_rack_sent_after() as tcp_skb_sent_after() helper to determine "which packet was sent last?". Later, we will use tcp_skb_sent_after() instead in RACK. Fixes: b9f64820fb22 ("tcp: track data delivery rate for a TCP connection") Signed-off-by: Pengcheng Yang Cc: Paolo Abeni Acked-by: Neal Cardwell Tested-by: Neal Cardwell Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/1650422081-22153-1-git-send-email-yangpc@wangsu.com Signed-off-by: Jakub Kicinski include/net/tcp.h | 6 ++++++ net/ipv4/tcp_rate.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) commit b107a6392b4bdd0e10e155e6b66d75af9e44d85a Author: Luiz Angelo Daros de Luca Date: Mon Apr 18 20:35:58 2022 -0300 net: dsa: realtek: remove realtek,rtl8367s string There is no need to add new compatible strings for each new supported chip version. The compatible string is used only to select the subdriver (rtl8365mb.c or rtl8366rb.c). Once in the subdriver, it will detect the chip model by itself, ignoring which compatible string was used. Link: https://lore.kernel.org/netdev/20220414014055.m4wbmr7tdz6hsa3m@bang-olufsen.dk/ Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Alvin Šipraga Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Acked-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20220418233558.13541-2-luizluca@gmail.com Signed-off-by: Jakub Kicinski drivers/net/dsa/realtek/realtek-mdio.c | 1 - drivers/net/dsa/realtek/realtek-smi.c | 4 ---- 2 files changed, 5 deletions(-) commit b391719191c1b1f5d89330b00c98f21775e5fd8c Author: Luiz Angelo Daros de Luca Date: Mon Apr 18 20:35:57 2022 -0300 dt-bindings: net: dsa: realtek: cleanup compatible strings Compatible strings are used to help the driver find the chip ID/version register for each chip family. After that, the driver can setup the switch accordingly. Keep only the first supported model for each family as a compatible string and reference other chip models in the description. The removed compatible strings have never been used in a released kernel. Link: https://lore.kernel.org/netdev/20220414014055.m4wbmr7tdz6hsa3m@bang-olufsen.dk/ Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Andrew Lunn Acked-by: Arınç ÜNAL Reviewed-by: Alvin Šipraga Link: https://lore.kernel.org/r/20220418233558.13541-1-luizluca@gmail.com Signed-off-by: Jakub Kicinski .../devicetree/bindings/net/dsa/realtek.yaml | 35 +++++++++------------- 1 file changed, 14 insertions(+), 21 deletions(-) commit 7f40ea2145d926510b27b785562d2c92df1b0d91 Author: Clément Léger Date: Thu Apr 21 12:12:47 2022 +0200 net: bridge: switchdev: check br_vlan_group() return value br_vlan_group() can return NULL and thus return value must be checked to avoid dereferencing a NULL pointer. Fixes: 6284c723d9b9 ("net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations") Signed-off-by: Clément Léger Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20220421101247.121896-1-clement.leger@bootlin.com Signed-off-by: Jakub Kicinski net/bridge/br_switchdev.c | 2 ++ 1 file changed, 2 insertions(+) commit 05d8af449d93e04547b4c6b328e39c890bc803f4 Author: Marek Vasut Date: Thu Apr 21 16:08:27 2022 +0200 pinctrl: stm32: Keep pinctrl block clock enabled when LEVEL IRQ requested The current EOI handler for LEVEL triggered interrupts calls clk_enable(), register IO, clk_disable(). The clock manipulation requires locking which happens with IRQs disabled in clk_enable_lock(). Instead of turning the clock on and off all the time, enable the clock in case LEVEL interrupt is requested and keep the clock enabled until all LEVEL interrupts are freed. The LEVEL interrupts are an exception on this platform and seldom used, so this does not affect the common case. This simplifies the LEVEL interrupt handling considerably and also fixes the following splat found when using preempt-rt: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at kernel/locking/rtmutex.c:2040 __rt_mutex_trylock+0x37/0x62 Modules linked in: CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.10.109-rt65-stable-standard-00068-g6a5afc4b1217 #85 Hardware name: STM32 (Device Tree Support) [] (unwind_backtrace) from [] (show_stack+0xb/0xc) [] (show_stack) from [] (dump_stack+0x6f/0x84) [] (dump_stack) from [] (__warn+0x7f/0xa4) [] (__warn) from [] (warn_slowpath_fmt+0x3b/0x74) [] (warn_slowpath_fmt) from [] (__rt_mutex_trylock+0x37/0x62) [] (__rt_mutex_trylock) from [] (rt_spin_trylock+0x7/0x16) [] (rt_spin_trylock) from [] (clk_enable_lock+0xb/0x80) [] (clk_enable_lock) from [] (clk_core_enable_lock+0x9/0x18) [] (clk_core_enable_lock) from [] (stm32_gpio_get+0x11/0x24) [] (stm32_gpio_get) from [] (stm32_gpio_irq_trigger+0x1f/0x48) [] (stm32_gpio_irq_trigger) from [] (handle_fasteoi_irq+0x71/0xa8) [] (handle_fasteoi_irq) from [] (generic_handle_irq+0x19/0x22) [] (generic_handle_irq) from [] (__handle_domain_irq+0x55/0x64) [] (__handle_domain_irq) from [] (gic_handle_irq+0x53/0x64) [] (gic_handle_irq) from [] (__irq_svc+0x65/0xc0) Exception stack(0xc0e01f18 to 0xc0e01f60) 1f00: 0000300c 00000000 1f20: 0000300c c010ff01 00000000 00000000 c0e00000 c0e07714 00000001 c0e01f78 1f40: c0e07758 00000000 ef7cd0ff c0e01f68 c010554b c0105542 40000033 ffffffff [] (__irq_svc) from [] (arch_cpu_idle+0xc/0x1e) [] (arch_cpu_idle) from [] (default_idle_call+0x21/0x3c) [] (default_idle_call) from [] (do_idle+0xe3/0x1e4) [] (do_idle) from [] (cpu_startup_entry+0x13/0x14) [] (cpu_startup_entry) from [] (start_kernel+0x397/0x3d4) [] (start_kernel) from [<00000000>] (0x0) ---[ end trace 0000000000000002 ]--- Power consumption measured on STM32MP157C DHCOM SoM is not increased or is below noise threshold. Fixes: 47beed513a85b ("pinctrl: stm32: Add level interrupt support to gpio irq chip") Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Fabien Dessenne Cc: Linus Walleij Cc: Marc Zyngier Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org To: linux-gpio@vger.kernel.org Reviewed-by: Fabien Dessenne Link: https://lore.kernel.org/r/20220421140827.214088-1-marex@denx.de Signed-off-by: Linus Walleij drivers/pinctrl/stm32/pinctrl-stm32.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) commit 5b0b9e4c2c895227c8852488b3f09839233bba54 Author: Francesco Ruggeri Date: Wed Apr 20 17:50:26 2022 -0700 tcp: md5: incorrect tcp_header_len for incoming connections In tcp_create_openreq_child we adjust tcp_header_len for md5 using the remote address in newsk. But that address is still 0 in newsk at this point, and it is only set later by the callers (tcp_v[46]_syn_recv_sock). Use the address from the request socket instead. Fixes: cfb6eeb4c860 ("[TCP]: MD5 Signature Option (RFC2385) support.") Signed-off-by: Francesco Ruggeri Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220421005026.686A45EC01F2@us226.sjc.aristanetworks.com Signed-off-by: Jakub Kicinski net/ipv4/tcp_minisocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5bb017d4b97a0f135f43ef77091b7edcce4dcee6 Author: Thomas Richter Date: Wed Apr 20 08:29:21 2022 +0200 perf test: Fix error message for test case 71 on s390, where it is not supported Test case 71 'Convert perf time to TSC' is not supported on s390. Subtest 71.1 is skipped with the correct message, but subtest 71.2 is not skipped and fails. The root cause is function evlist__open() called from test__perf_time_to_tsc(). evlist__open() returns -ENOENT because the event cycles:u is not supported by the selected PMU, for example platform s390 on z/VM or an x86_64 virtual machine. The PMU driver returns -ENOENT in this case. This error is leads to the failure. Fix this by returning TEST_SKIP on -ENOENT. Output before: 71: Convert perf time to TSC: 71.1: TSC support: Skip (This architecture does not support) 71.2: Perf time to TSC: FAILED! Output after: 71: Convert perf time to TSC: 71.1: TSC support: Skip (This architecture does not support) 71.2: Perf time to TSC: Skip (perf_read_tsc_conversion is not supported) This also happens on an x86_64 virtual machine: # uname -m x86_64 $ ./perf test -F 71 71: Convert perf time to TSC : 71.1: TSC support : Ok 71.2: Perf time to TSC : FAILED! $ Committer testing: Continues to work on x86_64: $ perf test 71 71: Convert perf time to TSC : 71.1: TSC support : Ok 71.2: Perf time to TSC : Ok $ Fixes: 290fa68bdc458863 ("perf test tsc: Fix error message when not supported") Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Chengdong Li Cc: chengdongli@tencent.com Cc: Heiko Carstens Cc: Sven Schnelle Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20220420062921.1211825-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/tests/perf-time-to-tsc.c | 4 ++++ 1 file changed, 4 insertions(+) commit ccb17caecfbd542f49a2a79ae088136ba8bfb794 Author: Leo Yan Date: Thu Apr 14 20:32:01 2022 +0800 perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event Since commit bb30acae4c4dacfa ("perf report: Bail out --mem-mode if mem info is not available") "perf mem report" and "perf report --mem-mode" don't report result if the PERF_SAMPLE_DATA_SRC bit is missed in sample type. The commit ffab487052054162 ("perf: arm-spe: Fix perf report --mem-mode") partially fixes the issue. It adds PERF_SAMPLE_DATA_SRC bit for Arm SPE event, this allows the perf data file generated by kernel v5.18-rc1 or later version can be reported properly. On the other hand, perf tool still fails to be backward compatibility for a data file recorded by an older version's perf which contains Arm SPE trace data. This patch is a workaround in reporting phase, when detects ARM SPE PMU event and without PERF_SAMPLE_DATA_SRC bit, it will force to set the bit in the sample type and give a warning info. Fixes: bb30acae4c4dacfa ("perf report: Bail out --mem-mode if mem info is not available") Reviewed-by: James Clark Signed-off-by: Leo Yan Tested-by: German Gomez 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/20220414123201.842754-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-report.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit c6d8df01064333dcf140eda996abdb60a60e24b3 Author: Leo Yan Date: Sun Apr 17 19:48:37 2022 +0800 perf script: Always allow field 'data_src' for auxtrace If use command 'perf script -F,+data_src' to dump memory samples with Arm SPE trace data, it reports error: # perf script -F,+data_src Samples for 'dummy:u' event do not have DATA_SRC attribute set. Cannot print 'data_src' field. This is because the 'dummy:u' event is absent DATA_SRC bit in its sample type, so if a file contains AUX area tracing data then always allow field 'data_src' to be selected as an option for perf script. Fixes: e55ed3423c1bb29f ("perf arm-spe: Synthesize memory event") Signed-off-by: Leo Yan Cc: Adrian Hunter Cc: Alexander Shishkin Cc: German Gomez Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220417114837.839896-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d22588d73b18fd12fd971e2dab7fa5ddf978e496 Author: Guilherme Amadio Date: Sat Apr 16 09:45:55 2022 +0200 perf clang: Fix header include for LLVM >= 14 The header TargetRegistry.h has moved in LLVM/clang 14. Committer notes: The problem as noticed when building in ubuntu:22.04: 90 98.61 ubuntu:22.04 : FAIL gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1) util/c++/clang.cpp:23:10: fatal error: llvm/Support/TargetRegistry.h: No such file or directory 23 | #include "llvm/Support/TargetRegistry.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. Fixed after applying this patch. Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Guilherme Amadio Tested-by: Arnaldo Carvalho de Melo Link: https://twitter.com/GuilhermeAmadio/status/1514970524232921088 Link: http://lore.kernel.org/lkml/Ylp0M/VYgHOxtcnF@gentoo.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/c++/clang.cpp | 4 ++++ 1 file changed, 4 insertions(+) commit 7c4cffc5d473e87ae2eaa50aed8cb27d17bcd1ec Author: Luca Ceresoli Date: Wed Apr 20 16:24:32 2022 +0200 pinctrl: rockchip: sort the rk3308_mux_recalced_data entries All the entries are sorted according to num/pin except for two entries. Sort them too. Signed-off-by: Luca Ceresoli Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220420142432.248565-2-luca.ceresoli@bootlin.com Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-rockchip.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) commit 1f3e25a068832f8892a5ff71467622d012f5bc9f Author: Luca Ceresoli Date: Wed Apr 20 16:24:31 2022 +0200 pinctrl: rockchip: fix RK3308 pinmux bits Some of the pinmuxing bits described in rk3308_mux_recalced_data are wrong, pointing to non-existing registers. Fix the entire table. Also add a comment in front of each entry with the same string that appears in the datasheet to make the table easier to compare with the docs. This fix has been tested on real hardware for the gpio3b3_sel entry. Fixes: 7825aeb7b208 ("pinctrl: rockchip: add rk3308 SoC support") Signed-off-by: Luca Ceresoli Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/20220420142432.248565-1-luca.ceresoli@bootlin.com Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-rockchip.c | 45 +++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 15 deletions(-) commit b3af85969e959872f21f0e6aaf5fbb9d37c5cb90 Merge: e74200ebf7c4 ac875df4d854 Author: Linus Walleij Date: Fri Apr 22 23:00:08 2022 +0200 Merge tag 'samsung-pinctrl-fixes-5.18' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into fixes Samsung pinctrl drivers fixes for v5.18 1. Fix sparse warning introduced in v5.18-rc1. 2. Fix possible unmet Kconfig dependency with COMPILE_TEST, present since v4.3 or earlier. commit 06fb4ecfeac7e00d6704fa5ed19299f2fefb3cc9 Author: Mario Limonciello Date: Fri Apr 22 08:14:52 2022 -0500 gpio: Request interrupts after IRQ is initialized Commit 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq members before initialization") attempted to fix a race condition that lead to a NULL pointer, but in the process caused a regression for _AEI/_EVT declared GPIOs. This manifests in messages showing deferred probing while trying to allocate IRQs like so: amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x0000 to IRQ, err -517 amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x002C to IRQ, err -517 amd_gpio AMDI0030:00: Failed to translate GPIO pin 0x003D to IRQ, err -517 [ .. more of the same .. ] The code for walking _AEI doesn't handle deferred probing and so this leads to non-functional GPIO interrupts. Fix this issue by moving the call to `acpi_gpiochip_request_interrupts` to occur after gc->irc.initialized is set. Fixes: 5467801f1fcb ("gpio: Restrict usage of GPIO chip irq members before initialization") Link: https://lore.kernel.org/linux-gpio/BL1PR12MB51577A77F000A008AA694675E2EF9@BL1PR12MB5157.namprd12.prod.outlook.com/ Link: https://bugzilla.suse.com/show_bug.cgi?id=1198697 Link: https://bugzilla.kernel.org/show_bug.cgi?id=215850 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1979 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1976 Reported-by: Mario Limonciello Signed-off-by: Mario Limonciello Reviewed-by: Shreeya Patel Tested-By: Samuel Čavoj Tested-By: lukeluk498@gmail.com Link: Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij Reviewed-and-tested-by: Takashi Iwai Cc: Shreeya Patel Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds drivers/gpio/gpiolib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4e339e5e2dbf91e6499ef65389035b2795518c3d Merge: 7200095feadf bf9bac40b763 Author: Linus Torvalds Date: Fri Apr 22 13:53:14 2022 -0700 Merge tag 'riscv-for-linus-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes Palmer Dabbelt: - A pair of build fixes for the recent cpuidle driver - A fix for systems without sv57 that manifests as a crash early in boot * tag 'riscv-for-linus-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: cpuidle: fix Kconfig select for RISCV_SBI_CPUIDLE RISC-V: mm: Fix set_satp_mode() for platform not having Sv57 cpuidle: riscv: support non-SMP config commit 7200095feadfb9792b744a5a6e20249ce77bc6d7 Merge: 22f19f674048 23bc8f69f0ec Author: Linus Torvalds Date: Fri Apr 22 13:49:26 2022 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "There's no real pattern to the fixes, but the main one fixes our pmd_leaf() definition to resolve a NULL dereference on the migration path. - Fix PMU event validation in the absence of any event counters - Fix allmodconfig build using clang in conjunction with binutils - Fix definitions of pXd_leaf() to handle PROT_NONE entries - More typo fixes" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: fix p?d_leaf() arm64: fix typos in comments arm64: Improve HAVE_DYNAMIC_FTRACE_WITH_REGS selection for clang arm_pmu: Validate single/group leader events commit 533bec143a4c32f7b2014a159d0f5376226e5b4d Author: Miaoqian Lin Date: Wed Apr 20 01:49:13 2022 +0000 arm/xen: Fix some refcount leaks The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Fixes: 9b08aaa3199a ("ARM: XEN: Move xen_early_init() before efi_init()") Fixes: b2371587fe0c ("arm/xen: Read extended regions from DT and init Xen resource") Signed-off-by: Miaoqian Lin Reviewed-by: Stefano Stabellini Signed-off-by: Stefano Stabellini arch/arm/xen/enlighten.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 22f19f67404833c2282b7a8c2f4703d9aff8f748 Merge: 88c5060d56d8 63b1898fffcd Author: Linus Torvalds Date: Fri Apr 22 13:31:39 2022 -0700 Merge tag 'xarray-5.18a' of git://git.infradead.org/users/willy/xarray Pull xarray fixes from Matthew Wilcox: "Syzbot found a nasty race between large page splitting and page lookup. Details in the commit log, but fortunately it has a reliable reproducer. I thought it better to send this one to you straight away. Also fix the test suite build for kmem_cache_alloc_lru()" * tag 'xarray-5.18a' of git://git.infradead.org/users/willy/xarray: XArray: Disallow sibling entries of nodes tools: Add kmem_cache_alloc_lru() commit 88c5060d56d8f756653bbee89fa45a752e241c9c Merge: 279b83c6731c f5d0f921ea36 Author: Linus Torvalds Date: Fri Apr 22 13:26:11 2022 -0700 Merge tag '5.18-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Four fixes, two of them for stable: - fcollapse fix - reconnect lock fix - DFS oops fix - minor cleanup patch" * tag '5.18-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: destage any unwritten data to the server before calling copychunk_write cifs: use correct lock type in cifs_reconnect() cifs: fix NULL ptr dereference in refresh_mounts() cifs: Use kzalloc instead of kmalloc/memset commit 279b83c6731c73a2197a1724d67312ba415e0607 Merge: 2d230968ad0d 0014edaedfd8 Author: Linus Torvalds Date: Fri Apr 22 13:17:19 2022 -0700 Merge tag 'fs.fixes.v5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull mount_setattr fix from Christian Brauner: "The recent cleanup in e257039f0fc7 ("mount_setattr(): clean the control flow and calling conventions") switched the mount attribute codepaths from do-while to for loops as they are more idiomatic when walking mounts. However, we did originally choose do-while constructs because if we request a mount or mount tree to be made read-only we need to hold writers in the following way: The mount attribute code will grab lock_mount_hash() and then call mnt_hold_writers() which will _unconditionally_ set MNT_WRITE_HOLD on the mount. Any callers that need write access have to call mnt_want_write(). They will immediately see that MNT_WRITE_HOLD is set on the mount and the caller will then either spin (on non-preempt-rt) or wait on lock_mount_hash() (on preempt-rt). The fact that MNT_WRITE_HOLD is set unconditionally means that once mnt_hold_writers() returns we need to _always_ pair it with mnt_unhold_writers() in both the failure and success paths. The do-while constructs did take care of this. But Al's change to a for loop in the failure path stops on the first mount we failed to change mount attributes _without_ going into the loop to call mnt_unhold_writers(). This in turn means that once we failed to make a mount read-only via mount_setattr() - i.e. there are already writers on that mount - we will block any writers indefinitely. Fix this by ensuring that the for loop always unsets MNT_WRITE_HOLD including the first mount we failed to change to read-only. Also sprinkle a few comments into the cleanup code to remind people about what is happening including myself. After all, I didn't catch it during review. This is only relevant on mainline and was reported by syzbot. Details about the syzbot reports are all in the commit message" * tag 'fs.fixes.v5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: fs: unset MNT_WRITE_HOLD on failure commit 2d230968ad0d15250af54c6ac70c5ae95db63c78 Merge: 281b9d9a4b02 86222af07abf Author: Linus Torvalds Date: Fri Apr 22 13:11:38 2022 -0700 Merge tag 'sound-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "At this time, the majority of changes are for pending ASoC fixes while a few usual HD-audio and USB-audio quirks are found. Almost all patches are small device-specific fixes, and nothing worrisome stands out, so far" * tag 'sound-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (37 commits) ALSA: hda/realtek: Add quirk for Clevo NP70PNP ALSA: hda: intel-dsp-config: Add RaptorLake PCI IDs ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook 845/865 G9 ALSA: usb-audio: Clear MIDI port active flag after draining ALSA: usb-audio: add mapping for MSI MAG X570S Torpedo MAX. ALSA: hda/i915: Fix one too many pci_dev_put() ALSA: hda/hdmi: add HDMI codec VID for Raptorlake-P ALSA: hda/hdmi: fix warning about PCM count when used with SOF sound/oss/dmasound: fix 'dmasound_setup' defined but not used firmware: cs_dsp: Fix overrun of unterminated control name string ASoC: codecs: Fix an error handling path in (rx|tx|va)_macro_probe() ASoC: Intel: sof_es8336: Add a quirk for Huawei Matebook D15 ASoC: Intel: sof_es8336: add a quirk for headset at mic1 port ASoC: Intel: sof_es8336: support a separate gpio to control headphone ASoC: Intel: sof_es8336: simplify speaker gpio naming ASoC: wm8731: Disable the regulator when probing fails ASoC: Intel: soc-acpi: correct device endpoints for max98373 ASoC: codecs: wcd934x: do not switch off SIDO Buck when codec is in use ASoC: SOF: topology: Fix memory leak in sof_control_load() ASoC: SOF: topology: cleanup dailinks on widget unload ... commit 63b1898fffcd8bd81905b95104ecc52b45a97e21 Author: Matthew Wilcox (Oracle) Date: Fri Apr 22 13:23:12 2022 -0400 XArray: Disallow sibling entries of nodes There is a race between xas_split() and xas_load() which can result in the wrong page being returned, and thus data corruption. Fortunately, it's hard to hit (syzbot took three months to find it) and often guarded with VM_BUG_ON(). The anatomy of this race is: thread A thread B order-9 page is stored at index 0x200 lookup of page at index 0x274 page split starts load of sibling entry at offset 9 stores nodes at offsets 8-15 load of entry at offset 8 The entry at offset 8 turns out to be a node, and so we descend into it, and load the page at index 0x234 instead of 0x274. This is hard to fix on the split side; we could replace the entire node that contains the order-9 page instead of replacing the eight entries. Fixing it on the lookup side is easier; just disallow sibling entries that point to nodes. This cannot ever be a useful thing as the descent would not know the correct offset to use within the new node. The test suite continues to pass, but I have not added a new test for this bug. Reported-by: syzbot+cf4cf13056f85dec2c40@syzkaller.appspotmail.com Tested-by: syzbot+cf4cf13056f85dec2c40@syzkaller.appspotmail.com Fixes: 6b24ca4a1a8d ("mm: Use multi-index entries in the page cache") Signed-off-by: Matthew Wilcox (Oracle) lib/xarray.c | 2 ++ 1 file changed, 2 insertions(+) commit b9663a6ff8289a095d56d9a3a3f9c185a7b7b0d7 Author: Matthew Wilcox (Oracle) Date: Fri Apr 22 13:20:21 2022 -0400 tools: Add kmem_cache_alloc_lru() Turn kmem_cache_alloc() into a wrapper around kmem_cache_alloc_lru(). Fixes: 9bbdc0f32409 ("xarray: use kmem_cache_alloc_lru to allocate xa_node") Signed-off-by: Matthew Wilcox (Oracle) Reported-by: Liam R. Howlett Reported-by: Li Wang tools/include/linux/slab.h | 8 +++++++- tools/testing/radix-tree/linux.c | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) commit 281b9d9a4b02229b602a14f7540206b0fbe4134f Merge: 3b8000ae185c 319561669a59 Author: Linus Torvalds Date: Fri Apr 22 10:10:43 2022 -0700 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "13 patches. Subsystems affected by this patch series: mm (memory-failure, memcg, userfaultfd, hugetlbfs, mremap, oom-kill, kasan, hmm), and kcov" * emailed patches from Andrew Morton : mm/mmu_notifier.c: fix race in mmu_interval_notifier_remove() kcov: don't generate a warning on vm_insert_page()'s failure MAINTAINERS: add Vincenzo Frascino to KASAN reviewers oom_kill.c: futex: delay the OOM reaper to allow time for proper futex cleanup selftest/vm: add skip support to mremap_test selftest/vm: support xfail in mremap_test selftest/vm: verify remap destination address in mremap_test selftest/vm: verify mmap addr in mremap_test mm, hugetlb: allow for "high" userspace addresses userfaultfd: mark uffd_wp regardless of VM_WRITE flag memcg: sync flush only if periodic flush is delayed mm/memory-failure.c: skip huge_zero_page in memory_failure() mm/hwpoison: fix race between hugetlb free/demotion and memory_failure_hugetlb() commit 3b8000ae185cb068adbda5f966a3835053c85fd4 Author: Nicholas Piggin Date: Fri Apr 22 16:01:05 2022 +1000 mm/vmalloc: huge vmalloc backing pages should be split rather than compound Huge vmalloc higher-order backing pages were allocated with __GFP_COMP in order to allow the sub-pages to be refcounted by callers such as "remap_vmalloc_page [sic]" (remap_vmalloc_range). However a similar problem exists for other struct page fields callers use, for example fb_deferred_io_fault() takes a vmalloc'ed page and not only refcounts it but uses ->lru, ->mapping, ->index. This is not compatible with compound sub-pages, and can cause bad page state issues like BUG: Bad page state in process swapper/0 pfn:00743 page:(____ptrval____) refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x743 flags: 0x7ffff000000000(node=0|zone=0|lastcpupid=0x7ffff) raw: 007ffff000000000 c00c00000001d0c8 c00c00000001d0c8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: corrupted mapping in tail page Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.18.0-rc3-00082-gfc6fff4a7ce1-dirty #2810 Call Trace: dump_stack_lvl+0x74/0xa8 (unreliable) bad_page+0x12c/0x170 free_tail_pages_check+0xe8/0x190 free_pcp_prepare+0x31c/0x4e0 free_unref_page+0x40/0x1b0 __vunmap+0x1d8/0x420 ... The correct approach is to use split high-order pages for the huge vmalloc backing. These allow callers to treat them in exactly the same way as individually-allocated order-0 pages. Link: https://lore.kernel.org/all/14444103-d51b-0fb3-ee63-c3f182f0b546@molgen.mpg.de/ Signed-off-by: Nicholas Piggin Cc: Paul Menzel Cc: Song Liu Cc: Rick Edgecombe Signed-off-by: Linus Torvalds mm/vmalloc.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) commit b02d196c44ead1a5949729be9ff08fe781c3e48a Author: Eyal Birger Date: Wed Apr 20 19:52:19 2022 +0300 bpf, lwt: Fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit lwt hook xmit_check_hhlen() observes the dst for getting the device hard header length to make sure a modified packet can fit. When a helper which changes the dst - such as bpf_skb_set_tunnel_key() - is called as part of the xmit program the accessed dst is no longer valid. This leads to the following splat: BUG: kernel NULL pointer dereference, address: 00000000000000de #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 798 Comm: ping Not tainted 5.18.0-rc2+ #103 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 RIP: 0010:bpf_xmit+0xfb/0x17f Code: c6 c0 4d cd 8e 48 c7 c7 7d 33 f0 8e e8 42 09 fb ff 48 8b 45 58 48 8b 95 c8 00 00 00 48 2b 95 c0 00 00 00 48 83 e0 fe 48 8b 00 <0f> b7 80 de 00 00 00 39 c2 73 22 29 d0 b9 20 0a 00 00 31 d2 48 89 RSP: 0018:ffffb148c0bc7b98 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000240008 RCX: 0000000000000000 RDX: 0000000000000010 RSI: 00000000ffffffea RDI: 00000000ffffffff RBP: ffff922a828a4e00 R08: ffffffff8f1350e8 R09: 00000000ffffdfff R10: ffffffff8f055100 R11: ffffffff8f105100 R12: 0000000000000000 R13: ffff922a828a4e00 R14: 0000000000000040 R15: 0000000000000000 FS: 00007f414e8f0080(0000) GS:ffff922afdc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000de CR3: 0000000002d80006 CR4: 0000000000370ef0 Call Trace: lwtunnel_xmit.cold+0x71/0xc8 ip_finish_output2+0x279/0x520 ? __ip_finish_output.part.0+0x21/0x130 Fix by fetching the device hard header length before running the BPF code. Fixes: 3a0af8fd61f9 ("bpf: BPF for lightweight tunnel infrastructure") Signed-off-by: Eyal Birger Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220420165219.1755407-1-eyal.birger@gmail.com net/core/lwt_bpf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit 8ec1442953c66a1d8462cccd8c20b7ba561f5915 Author: Guo Ren Date: Wed Apr 6 22:16:49 2022 +0800 riscv: patch_text: Fixup last cpu should be master These patch_text implementations are using stop_machine_cpuslocked infrastructure with atomic cpu_count. The original idea: When the master CPU patch_text, the others should wait for it. But current implementation is using the first CPU as master, which couldn't guarantee the remaining CPUs are waiting. This patch changes the last CPU as the master to solve the potential risk. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Acked-by: Palmer Dabbelt Reviewed-by: Masami Hiramatsu Fixes: 043cb41a85de ("riscv: introduce interfaces to patch kernel code") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt arch/riscv/kernel/patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ef38de9217a04c9077629a24652689d8fdb4c6c6 Author: Alessandro Astone Date: Fri Apr 15 14:00:14 2022 +0200 binder: Gracefully handle BINDER_TYPE_FDA objects with num_fds=0 Some android userspace is sending BINDER_TYPE_FDA objects with num_fds=0. Like the previous patch, this is reproducible when playing a video. Before commit 09184ae9b575 BINDER_TYPE_FDA objects with num_fds=0 were 'correctly handled', as in no fixup was performed. After commit 09184ae9b575 we aggregate fixup and skip regions in binder_ptr_fixup structs and distinguish between the two by using the skip_size field: if it's 0, then it's a fixup, otherwise skip. When processing BINDER_TYPE_FDA objects with num_fds=0 we add a skip region of skip_size=0, and this causes issues because now binder_do_deferred_txn_copies will think this was a fixup region. To address that, return early from binder_translate_fd_array to avoid adding an empty skip region. Fixes: 09184ae9b575 ("binder: defer copies of pre-patched txn data") Acked-by: Todd Kjos Cc: stable Signed-off-by: Alessandro Astone Link: https://lore.kernel.org/r/20220415120015.52684-1-ales.astone@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/android/binder.c | 3 +++ 1 file changed, 3 insertions(+) commit 2d1746e3fda0c3612143d7c06f8e1d1830c13e23 Author: Alessandro Astone Date: Fri Apr 15 14:00:15 2022 +0200 binder: Address corner cases in deferred copy and fixup When handling BINDER_TYPE_FDA object we are pushing a parent fixup with a certain skip_size but no scatter-gather copy object, since the copy is handled standalone. If BINDER_TYPE_FDA is the last children the scatter-gather copy loop will never stop to skip it, thus we are left with an item in the parent fixup list. This will trigger the BUG_ON(). This is reproducible in android when playing a video. We receive a transaction that looks like this: obj[0] BINDER_TYPE_PTR, parent obj[1] BINDER_TYPE_PTR, child obj[2] BINDER_TYPE_PTR, child obj[3] BINDER_TYPE_FDA, child Fixes: 09184ae9b575 ("binder: defer copies of pre-patched txn data") Acked-by: Todd Kjos Cc: stable Signed-off-by: Alessandro Astone Link: https://lore.kernel.org/r/20220415120015.52684-2-ales.astone@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/android/binder.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit e13433b4416fa31a24e621cbbbb39227a3d651dd Author: Olga Kornievskaia Date: Thu Apr 21 10:32:34 2022 -0400 SUNRPC release the transport of a relocated task with an assigned transport A relocated task must release its previous transport. Fixes: 82ee41b85cef1 ("SUNRPC don't resend a task on an offlined transport") Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust net/sunrpc/clnt.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit fa1ef24ae251f7916e70b6fac94c7db3bb837426 Author: Daniel Lezcano Date: Fri Apr 22 16:10:29 2022 +0200 thermal/governor: Remove deprecated information The userspace governor is still in use on production systems and the deprecating warning is scary. Even if we want to get rid of the userspace governor, it is too soon yet as the alternatives are not yet adopted. Change the deprecated warning by an information message suggesting to switch to the netlink thermal events. Fixes: 0275c9fb0eff ("thermal/core: Make the userspace governor deprecated") Signed-off-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki drivers/thermal/Kconfig | 6 ++++-- drivers/thermal/gov_user_space.c | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) commit 5a42ac43d0c900ade2a5c0337b2ea52d994bdec8 Author: Daniel Lezcano Date: Fri Apr 22 16:10:28 2022 +0200 Revert "thermal/core: Deprecate changing cooling device state from userspace" This reverts commit a67a46af4ad6342378e332b7420c1d1a2818c53f. It has been reported the warning is annoying as the cooling device state is still needed on some production system. Meanwhile we provide a way to consolidate the thermal framework to prevent multiple actors acting on the cooling devices with conflicting decisions, let's revert this warning. Signed-off-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki drivers/thermal/thermal_sysfs.c | 3 --- 1 file changed, 3 deletions(-) commit 637674fa40059cddcc3ad2212728965072f62ea3 Author: Maciej W. Rozycki Date: Mon Apr 18 16:27:16 2022 +0100 serial: 8250: Correct the clock for EndRun PTP/1588 PCIe device The EndRun PTP/1588 dual serial port device is based on the Oxford Semiconductor OXPCIe952 UART device with the PCI vendor:device ID set for EndRun Technologies and is therefore driven by a fixed 62.5MHz clock input derived from the 100MHz PCI Express clock. The clock rate is divided by the oversampling rate of 16 as it is supplied to the baud rate generator, yielding the baud base of 3906250. Replace the incorrect baud base of 4000000 with the right value of 3906250 then, complementing commit 6cbe45d8ac93 ("serial: 8250: Correct the clock for OxSemi PCIe devices"). Signed-off-by: Maciej W. Rozycki Cc: stable Fixes: 1bc8cde46a159 ("8250_pci: Added driver for Endrun Technologies PTP PCIe card.") Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204181515270.9383@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/8250/8250_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 6e6eebdf5e2455f089ccd000754a0deaeb79af82 Author: Maciej W. Rozycki Date: Mon Apr 18 16:27:10 2022 +0100 serial: 8250: Also set sticky MCR bits in console restoration Sticky MCR bits are lost in console restoration if console suspending has been disabled. This currently affects the AFE bit, which works in combination with RTS which we set, so we want to make sure the UART retains control of its FIFO where previously requested. Also specific drivers may need other bits in the future. Signed-off-by: Maciej W. Rozycki Fixes: 4516d50aabed ("serial: 8250: Use canary to restart console after suspend") Cc: stable@vger.kernel.org # v4.0+ Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/alpine.DEB.2.21.2204181518490.9383@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/8250/8250_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f4f7d63287217ba25e5c80f5faae5e4f7118790e Author: Daniel Starke Date: Fri Apr 22 00:10:25 2022 -0700 tty: n_gsm: fix software flow control handling n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.4.8.1 states that XON/XOFF characters shall be used instead of Fcon/Fcoff command in advanced option mode to handle flow control. Chapter 5.4.8.2 describes how XON/XOFF characters shall be handled. Basic option mode only used Fcon/Fcoff commands and no XON/XOFF characters. These are treated as data bytes here. The current implementation uses the gsm_mux field 'constipated' to handle flow control from the remote peer and the gsm_dlci field 'constipated' to handle flow control from each DLCI. The later is unrelated to this patch. The gsm_mux field is correctly set for Fcon/Fcoff commands in gsm_control_message(). However, the same is not true for XON/XOFF characters in gsm1_receive(). Disable software flow control handling in the tty to allow explicit handling by n_gsm. Add the missing handling in advanced option mode for gsm_mux in gsm1_receive() to comply with the standard. This patch depends on the following commit: Commit 8838b2af23ca ("tty: n_gsm: fix SW flow control encoding/handling") Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220422071025.5490-3-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit c19ffe00fed6bb423d81406d2a7e5793074c7d83 Author: Daniel Starke Date: Fri Apr 22 00:10:24 2022 -0700 tty: n_gsm: fix invalid use of MSC in advanced option n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.4.6.3.7 states that the Modem Status Command (MSC) shall only be used if the basic option was chosen. The current implementation uses MSC frames even if advanced option was chosen to inform the peer about modem line state updates. A standard conform peer may choose to discard these frames in advanced option mode. Furthermore, gsmtty_modem_update() is not part of the 'tty_operations' functions despite its name. Rename gsmtty_modem_update() to gsm_modem_update() to clarify this. Split its function into gsm_modem_upd_via_data() and gsm_modem_upd_via_msc() depending on the encoding and adaption. Introduce gsm_dlci_modem_output() as adaption of gsm_dlci_data_output() to encode and queue empty frames in advanced option mode. Use it in gsm_modem_upd_via_data(). gsm_modem_upd_via_msc() is based on the initial gsmtty_modem_update() function which used only MSC frames to update modem states. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220422071025.5490-2-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 117 insertions(+), 8 deletions(-) commit a8c5b8255f8a9acd58a4b15ff1c14cd6effd114b Author: Daniel Starke Date: Fri Apr 22 00:10:23 2022 -0700 tty: n_gsm: fix broken virtual tty handling Dynamic virtual tty registration was introduced to allow the user to handle these cases with uevent rules. The following commits relate to this: Commit 5b87686e3203 ("tty: n_gsm: Modify gsmtty driver register method when config requester") Commit 0b91b5332368 ("tty: n_gsm: Save dlci address open status when config requester") Commit 46292622ad73 ("tty: n_gsm: clean up indenting in gsm_queue()") However, the following behavior can be seen with this implementation: - n_gsm ldisc is activated via ioctl - all configuration parameters are set to their default value (initiator=0) - the mux gets activated and attached and gsmtty0 is being registered in in gsm_dlci_open() after DLCI 0 was established (DLCI 0 is the control channel) - the user configures n_gsm via ioctl GSMIOC_SETCONF as initiator - this re-attaches the n_gsm mux - no new gsmtty devices are registered in gsmld_attach_gsm() because the mux is already active - the initiator side registered only the control channel as gsmtty0 (which should never happen) and no user channel tty The commits above make it impossible to operate the initiator side as no user channel tty is or will be available. On the other hand, this behavior will make it also impossible to allow DLCI parameter negotiation on responder side in the future. The responder side first needs to provide a device for the application before the application can set its parameters of the associated DLCI via ioctl. Note that the user application is still able to detect a link establishment without relaying to uevent by waiting for DTR open on responder side. This is the same behavior as on a physical serial interface. And on initiator side a tty hangup can be detected if a link establishment request failed. Revert the commits above completely to always register all user channels and no control channel after mux attachment. No other changes are made. Fixes: 5b87686e3203 ("tty: n_gsm: Modify gsmtty driver register method when config requester") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220422071025.5490-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 87 +++++++++-------------------------------------------- 1 file changed, 15 insertions(+), 72 deletions(-) commit 41c606879f89623dd5269eaffea640b915e9e17c Author: Hui Wang Date: Mon Apr 18 17:43:39 2022 +0800 Revert "serial: sc16is7xx: Clear RS485 bits in the shutdown" This reverts commit 927728a34f11b5a27f4610bdb7068317d6fdc72a. Once the uart_port->rs485->flag is set to SER_RS485_ENABLED, the port should always work in RS485 mode. If users want the port to leave RS485 mode, they need to call ioctl() to clear SER_RS485_ENABLED. So here we shouldn't clear the RS485 bits in the shutdown(). Fixes: 927728a34f11 ("serial: sc16is7xx: Clear RS485 bits in the shutdown") Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20220418094339.678144-1-hui.wang@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/sc16is7xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 89b3896056c775bf957c8d287c65290707cdad4a Merge: 2e043a2ead2a 2fb251c26560 Author: Greg Kroah-Hartman Date: Fri Apr 22 15:49:59 2022 +0200 Merge tag 'icc-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next Georgi writes: interconnect fixes for v5.18 This contains a fix for a reported issue on sc7180 platforms, where one of the resources has been incorrectly modelled as both clock and interconnect, which is causing a crash when both frameworks try to manage it. Fix the same issue also on another platform that appears to be affected by the same. - interconnect: qcom: sc7180: Drop IP0 interconnects - interconnect: qcom: sdx55: Drop IP0 interconnects Signed-off-by: Georgi Djakov * tag 'icc-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: qcom: sdx55: Drop IP0 interconnects interconnect: qcom: sc7180: Drop IP0 interconnects commit 2e043a2ead2a24d35d5136fc5f7afe4a2b32f381 Merge: e90d20c9df11 2c8045d48dee Author: Greg Kroah-Hartman Date: Fri Apr 22 15:49:23 2022 +0200 Merge tag 'phy-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-misc-linus Vinod writes: phy: fixes for 5.18 Fixes for bunch of drivers: - TI fixes for runtime disable, missing of_node_put and error handling - Samsung fixes for device_put and of_node_put - Amlogic error path handling * tag 'phy-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: amlogic: fix error path in phy_g12a_usb3_pcie_probe() phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe phy: ti: omap-usb2: Fix error handling in omap_usb2_enable_clocks phy: ti: tusb1210: Fix an error handling path in tusb1210_probe() phy: samsung: exynos5250-sata: fix missing device put in probe error paths phy: samsung: Fix missing of_node_put() in exynos_sata_phy_probe phy: ti: Fix missing of_node_put in ti_pipe3_get_sysctrl() phy: ti: tusb1210: Make tusb1210_chg_det_states static commit babc3dc9524f0bcb5a0ec61f3c3639b11508fad6 Author: Pablo Neira Ayuso Date: Mon Apr 18 12:21:05 2022 +0200 netfilter: nft_set_rbtree: overlap detection with element re-addition after deletion This patch fixes spurious EEXIST errors. Extend d2df92e98a34 ("netfilter: nft_set_rbtree: handle element re-addition after deletion") to deal with elements with same end flags in the same transation. Reset the overlap flag as described by 7c84d41416d8 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion"). Fixes: 7c84d41416d8 ("netfilter: nft_set_rbtree: Detect partial overlaps on insertion") Fixes: d2df92e98a34 ("netfilter: nft_set_rbtree: handle element re-addition after deletion") Signed-off-by: Pablo Neira Ayuso Reviewed-by: Stefano Brivio Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_set_rbtree.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit e90d20c9df11cf33e33e6e3e1445454e044216b1 Merge: ce522ba9ef7e c38f83bae403 Author: Greg Kroah-Hartman Date: Fri Apr 22 15:45:22 2022 +0200 Merge tag 'mhi-fixes-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-linus Manivannan writes: MHI fixes for v5.18 Couple of patches fixing the hibernation issue seen on MHI endpoint devices like SDX65 modems: - During hibernation, the host puts the device into D3cold after thaw() stage. But at that time, the device would be in M0 state. So the device emits a warning (not visible to the host but to device firmware only) stating invalid transition. This is fixed by adding a poweroff() callback that puts the device into M3 before D3cold. - There is a possibility that the recovery worker might be running while trying to powerdown the device. So flush the recovery worker before that. * tag 'mhi-fixes-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi: bus: mhi: host: pci_generic: Flush recovery worker during freeze bus: mhi: host: pci_generic: Add missing poweroff() PM callback commit f4fd84ae0765a80494b28c43b756a95100351a94 Author: Thinh Nguyen Date: Thu Apr 21 19:33:56 2022 -0700 usb: dwc3: core: Only handle soft-reset in DCTL Make sure not to set run_stop bit or link state change request while initiating soft-reset. Register read-modify-write operation may unintentionally start the controller before the initialization completes with its previous DCTL value, which can cause initialization failure. Fixes: f59dcab17629 ("usb: dwc3: core: improve reset sequence") Cc: Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/6aecbd78328f102003d40ccf18ceeebd411d3703.1650594792.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit fc06b2867f4cea543505acfb194c2be4ebf0c7d3 Author: Miaoqian Lin Date: Wed Apr 20 19:04:08 2022 +0800 net: dsa: Add missing of_node_put() in dsa_port_link_register_of The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. of_node_put() will check for NULL value. Fixes: a20f997010c4 ("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed") Signed-off-by: Miaoqian Lin Signed-off-by: David S. Miller net/dsa/port.c | 2 ++ 1 file changed, 2 insertions(+) commit dfd2b37edf7ef469574ef7f36e3a1905ac9ead62 Author: ChiYuan Huang Date: Fri Apr 22 14:50:55 2022 +0800 regulator: dt-bindings: Revise the rt5190a buck/ldo description Revise the rt5190a bucks and ldo property description. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1650610255-6180-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown .../devicetree/bindings/regulator/richtek,rt5190a-regulator.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 87c18514bb8477563a61f50b4285da156296edc4 Author: ChiYuan Huang Date: Fri Apr 22 14:26:50 2022 +0800 ASoC: rt9120: Correct the reg 0x09 size to one byte Correct the reg 0x09 size to one byte. Signed-off-by: ChiYuan Huang Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/1650608810-3829-1-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/rt9120.c | 1 - 1 file changed, 1 deletion(-) commit 23bc8f69f0eceecbb87c3801d2e48827d2dca92b Author: Muchun Song Date: Fri Apr 22 14:00:33 2022 +0800 arm64: mm: fix p?d_leaf() The pmd_leaf() is used to test a leaf mapped PMD, however, it misses the PROT_NONE mapped PMD on arm64. Fix it. A real world issue [1] caused by this was reported by Qian Cai. Also fix pud_leaf(). Link: https://patchwork.kernel.org/comment/24798260/ [1] Fixes: 8aa82df3c123 ("arm64: mm: add p?d_leaf() definitions") Reported-by: Qian Cai Signed-off-by: Muchun Song Link: https://lore.kernel.org/r/20220422060033.48711-1-songmuchun@bytedance.com Signed-off-by: Will Deacon arch/arm64/include/asm/pgtable.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4a25f2ea0e030b2fc852c4059a50181bfc5b2f57 Author: Ashish Mhetre Date: Thu Apr 21 13:45:04 2022 +0530 iommu: arm-smmu: disable large page mappings for Nvidia arm-smmu Tegra194 and Tegra234 SoCs have the erratum that causes walk cache entries to not be invalidated correctly. The problem is that the walk cache index generated for IOVA is not same across translation and invalidation requests. This is leading to page faults when PMD entry is released during unmap and populated with new PTE table during subsequent map request. Disabling large page mappings avoids the release of PMD entry and avoid translations seeing stale PMD entry in walk cache. Fix this by limiting the page mappings to PAGE_SIZE for Tegra194 and Tegra234 devices. This is recommended fix from Tegra hardware design team. Acked-by: Robin Murphy Reviewed-by: Krishna Reddy Co-developed-by: Pritesh Raithatha Signed-off-by: Pritesh Raithatha Signed-off-by: Ashish Mhetre Link: https://lore.kernel.org/r/20220421081504.24678-1-amhetre@nvidia.com Signed-off-by: Will Deacon drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) commit 4abff6d48dbcea8200c7ea35ba70c242d128ebf3 Author: Peter Zijlstra Date: Sun Apr 17 17:03:36 2022 +0200 objtool: Fix code relocs vs weak symbols Occasionally objtool driven code patching (think .static_call_sites .retpoline_sites etc..) goes sideways and it tries to patch an instruction that doesn't match. Much head-scatching and cursing later the problem is as outlined below and affects every section that objtool generates for us, very much including the ORC data. The below uses .static_call_sites because it's convenient for demonstration purposes, but as mentioned the ORC sections, .retpoline_sites and __mount_loc are all similarly affected. Consider: foo-weak.c: extern void __SCT__foo(void); __attribute__((weak)) void foo(void) { return __SCT__foo(); } foo.c: extern void __SCT__foo(void); extern void my_foo(void); void foo(void) { my_foo(); return __SCT__foo(); } These generate the obvious code (gcc -O2 -fcf-protection=none -fno-asynchronous-unwind-tables -c foo*.c): foo-weak.o: 0000000000000000 : 0: e9 00 00 00 00 jmpq 5 1: R_X86_64_PLT32 __SCT__foo-0x4 foo.o: 0000000000000000 : 0: 48 83 ec 08 sub $0x8,%rsp 4: e8 00 00 00 00 callq 9 5: R_X86_64_PLT32 my_foo-0x4 9: 48 83 c4 08 add $0x8,%rsp d: e9 00 00 00 00 jmpq 12 e: R_X86_64_PLT32 __SCT__foo-0x4 Now, when we link these two files together, you get something like (ld -r -o foos.o foo-weak.o foo.o): foos.o: 0000000000000000 : 0: e9 00 00 00 00 jmpq 5 1: R_X86_64_PLT32 __SCT__foo-0x4 5: 66 2e 0f 1f 84 00 00 00 00 00 nopw %cs:0x0(%rax,%rax,1) f: 90 nop 0000000000000010 : 10: 48 83 ec 08 sub $0x8,%rsp 14: e8 00 00 00 00 callq 19 15: R_X86_64_PLT32 my_foo-0x4 19: 48 83 c4 08 add $0x8,%rsp 1d: e9 00 00 00 00 jmpq 22 1e: R_X86_64_PLT32 __SCT__foo-0x4 Noting that ld preserves the weak function text, but strips the symbol off of it (hence objdump doing that funny negative offset thing). This does lead to 'interesting' unused code issues with objtool when ran on linked objects, but that seems to be working (fingers crossed). So far so good.. Now lets consider the objtool static_call output section (readelf output, old binutils): foo-weak.o: Relocation section '.rela.static_call_sites' at offset 0x2c8 contains 1 entry: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000200000002 R_X86_64_PC32 0000000000000000 .text + 0 0000000000000004 0000000d00000002 R_X86_64_PC32 0000000000000000 __SCT__foo + 1 foo.o: Relocation section '.rela.static_call_sites' at offset 0x310 contains 2 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000200000002 R_X86_64_PC32 0000000000000000 .text + d 0000000000000004 0000000d00000002 R_X86_64_PC32 0000000000000000 __SCT__foo + 1 foos.o: Relocation section '.rela.static_call_sites' at offset 0x430 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000100000002 R_X86_64_PC32 0000000000000000 .text + 0 0000000000000004 0000000d00000002 R_X86_64_PC32 0000000000000000 __SCT__foo + 1 0000000000000008 0000000100000002 R_X86_64_PC32 0000000000000000 .text + 1d 000000000000000c 0000000d00000002 R_X86_64_PC32 0000000000000000 __SCT__foo + 1 So we have two patch sites, one in the dead code of the weak foo and one in the real foo. All is well. *HOWEVER*, when the toolchain strips unused section symbols it generates things like this (using new enough binutils): foo-weak.o: Relocation section '.rela.static_call_sites' at offset 0x2c8 contains 1 entry: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000200000002 R_X86_64_PC32 0000000000000000 foo + 0 0000000000000004 0000000d00000002 R_X86_64_PC32 0000000000000000 __SCT__foo + 1 foo.o: Relocation section '.rela.static_call_sites' at offset 0x310 contains 2 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000200000002 R_X86_64_PC32 0000000000000000 foo + d 0000000000000004 0000000d00000002 R_X86_64_PC32 0000000000000000 __SCT__foo + 1 foos.o: Relocation section '.rela.static_call_sites' at offset 0x430 contains 4 entries: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000000000 0000000100000002 R_X86_64_PC32 0000000000000000 foo + 0 0000000000000004 0000000d00000002 R_X86_64_PC32 0000000000000000 __SCT__foo + 1 0000000000000008 0000000100000002 R_X86_64_PC32 0000000000000000 foo + d 000000000000000c 0000000d00000002 R_X86_64_PC32 0000000000000000 __SCT__foo + 1 And now we can see how that foos.o .static_call_sites goes side-ways, we now have _two_ patch sites in foo. One for the weak symbol at foo+0 (which is no longer a static_call site!) and one at foo+d which is in fact the right location. This seems to happen when objtool cannot find a section symbol, in which case it falls back to any other symbol to key off of, however in this case that goes terribly wrong! As such, teach objtool to create a section symbol when there isn't one. Fixes: 44f6a7c0755d ("objtool: Fix seg fault with Clang non-section symbols") Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20220419203807.655552918@infradead.org tools/objtool/elf.c | 187 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 165 insertions(+), 22 deletions(-) commit c087c6e7b551b7f208c0b852304f044954cf2bb3 Author: Peter Zijlstra Date: Sun Apr 17 17:03:40 2022 +0200 objtool: Fix type of reloc::addend Elf{32,64}_Rela::r_addend is of type: Elf{32,64}_Sword, that means that our reloc::addend needs to be long or face tuncation issues when we do elf_rebuild_reloc_section(): - 107: 48 b8 00 00 00 00 00 00 00 00 movabs $0x0,%rax 109: R_X86_64_64 level4_kernel_pgt+0x80000067 + 107: 48 b8 00 00 00 00 00 00 00 00 movabs $0x0,%rax 109: R_X86_64_64 level4_kernel_pgt-0x7fffff99 Fixes: 627fce14809b ("objtool: Add ORC unwind table generation") Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20220419203807.596871927@infradead.org tools/objtool/check.c | 8 ++++---- tools/objtool/elf.c | 2 +- tools/objtool/include/objtool/elf.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) commit d48fea8401cfa942c67cc3a522bf379143dbb576 Author: Lv Ruyi Date: Mon Apr 18 10:58:34 2022 +0000 net: cosa: fix error check return value of register_chrdev() If major equal 0, register_chrdev() returns error code when it fails. This function dynamically allocate a major and return its number on success, so we should use "< 0" to check it instead of "!". Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Acked-By: Jan "Yenya" Kasprzak Signed-off-by: David S. Miller drivers/net/wan/cosa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5f5d8890789c90470d9571a283f0b789acd594af Author: Andy Chi Date: Fri Apr 22 17:08:43 2022 +0800 ALSA: hda/realtek: Enable mute/micmute LEDs support for HP Laptops On HP Laptops, requires the same ALC285_FIXUP_HP_GPIO_LED quirk to make its audio LEDs work. So apply the quirk, and make it the last one since it's an LED quirk. Signed-off-by: Andy Chi Fixes: 07bcab93946c ("ALSA: hda/realtek: Add support for HP Laptops") Link: https://lore.kernel.org/r/20220422090845.230071-1-andy.chi@canonical.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit a6ac60b36dade525c13c5bb0838589619533efb7 Author: Hui Wang Date: Fri Apr 22 15:39:37 2022 +0800 ALSA: hda/realtek: Fix mute led issue on thinkpad with cs35l41 s-codec The quirk ALC287_FIXUP_CS35L41_I2C_2 needs to chain the quirk ALC269_FIXUP_THINKPAD_ACPI, otherwise the mute led will not work if a thinkpad machine applies that quirk. And it will be safe if non-thinkpad machines apply that quirk since hda_fixup_thinkpad_acpi() will check and return in this case. Fixes: ae7abe36e352e ("ALSA: hda/realtek: Add CS35L41 support for Thinkpad laptops") Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20220422073937.10073-1-hui.wang@canonical.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 2 ++ 1 file changed, 2 insertions(+) commit 214cab6f8020a9ad4a5e9862a4e68088d5a79f08 Author: John Stultz Date: Mon Apr 18 21:20:16 2022 +0000 MAINTAINERS: Update email address for John Stultz I've switched jobs, so update my email address in MAINTAINERS Signed-off-by: John Stultz Signed-off-by: Thomas Gleixner Acked-by: Sumit Semwal Link: https://lore.kernel.org/r/20220418212016.2669086-1-jstultz@google.com MAINTAINERS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 60cc5468daaefc18ffc081dc484bdaa1bd270561 Author: André Almeida Date: Thu Apr 21 14:32:54 2022 -0300 futex: MAINTAINERS, .mailmap: Update André's email address Update futex entry to use my new professional email address. Signed-off-by: André Almeida Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220421173254.29855-1-andrealmeid@igalia.com .mailmap | 1 + MAINTAINERS | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) commit d569e86915b7f2f9795588591c8d5ea0b66481cb Merge: b05a5683eba6 70da382e1c5b Author: Linus Torvalds Date: Thu Apr 21 20:10:43 2022 -0700 Merge tag 'drm-fixes-2022-04-22' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Extra quiet after Easter, only have minor i915 and msm pulls. However I haven't seen a PR from our misc tree in a little while, I've cc'ed all the suspects. Once that unblocks I expect a bit larger bunch of patches to arrive. Otherwise as I said, one msm revert and two i915 fixes. msm: - revert iommu change that broke some platforms. i915: - Unset enable_psr2_sel_fetch if PSR2 detection fails - Fix to detect when VRR is turned off from panel settings" * tag 'drm-fixes-2022-04-22' of git://anongit.freedesktop.org/drm/drm: drm/i915/display/psr: Unset enable_psr2_sel_fetch if other checks in intel_psr2_config_valid() fails drm/msm: Revert "drm/msm: Stop using iommu_present()" drm/i915/display/vrr: Reset VRR capable property on a long hpd commit 319561669a59d8e9206ab311ae5433ef92fd79d1 Author: Alistair Popple Date: Thu Apr 21 16:36:10 2022 -0700 mm/mmu_notifier.c: fix race in mmu_interval_notifier_remove() In some cases it is possible for mmu_interval_notifier_remove() to race with mn_tree_inv_end() allowing it to return while the notifier data structure is still in use. Consider the following sequence: CPU0 - mn_tree_inv_end() CPU1 - mmu_interval_notifier_remove() ----------------------------------- ------------------------------------ spin_lock(subscriptions->lock); seq = subscriptions->invalidate_seq; spin_lock(subscriptions->lock); spin_unlock(subscriptions->lock); subscriptions->invalidate_seq++; wait_event(invalidate_seq != seq); return; interval_tree_remove(interval_sub); kfree(interval_sub); spin_unlock(subscriptions->lock); wake_up_all(); As the wait_event() condition is true it will return immediately. This can lead to use-after-free type errors if the caller frees the data structure containing the interval notifier subscription while it is still on a deferred list. Fix this by taking the appropriate lock when reading invalidate_seq to ensure proper synchronisation. I observed this whilst running stress testing during some development. You do have to be pretty unlucky, but it leads to the usual problems of use-after-free (memory corruption, kernel crash, difficult to diagnose WARN_ON, etc). Link: https://lkml.kernel.org/r/20220420043734.476348-1-apopple@nvidia.com Fixes: 99cb252f5e68 ("mm/mmu_notifier: add an interval tree notifier") Signed-off-by: Alistair Popple Signed-off-by: Jason Gunthorpe Cc: Christian König Cc: John Hubbard Cc: Ralph Campbell Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mmu_notifier.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit ecc04463d1a36f88baa750d45dfb02c364e1fdb1 Author: Aleksandr Nogikh Date: Thu Apr 21 16:36:07 2022 -0700 kcov: don't generate a warning on vm_insert_page()'s failure vm_insert_page()'s failure is not an unexpected condition, so don't do WARN_ONCE() in such a case. Instead, print a kernel message and just return an error code. This flaw has been reported under an OOM condition by sysbot [1]. The message is mainly for the benefit of the test log, in this case the fuzzer's log so that humans inspecting the log can figure out what was going on. KCOV is a testing tool, so I think being a little more chatty when KCOV unexpectedly is about to fail will save someone debugging time. We don't want the WARN, because it's not a kernel bug that syzbot should report, and failure can happen if the fuzzer tries hard enough (as above). Link: https://lkml.kernel.org/r/Ylkr2xrVbhQYwNLf@elver.google.com [1] Link: https://lkml.kernel.org/r/20220401182512.249282-1-nogikh@google.com Fixes: b3d7fe86fbd0 ("kcov: properly handle subsequent mmap calls"), Signed-off-by: Aleksandr Nogikh Acked-by: Marco Elver Cc: Dmitry Vyukov Cc: Andrey Konovalov Cc: Alexander Potapenko Cc: Taras Madan Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/kcov.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 415fccf85920925d23e5358dfb6a64bcf8a6fdd4 Author: Vincenzo Frascino Date: Thu Apr 21 16:36:04 2022 -0700 MAINTAINERS: add Vincenzo Frascino to KASAN reviewers Add my email address to KASAN reviewers list to make sure that I am Cc'ed in all the KASAN changes that may affect arm64 MTE. Link: https://lkml.kernel.org/r/20220419170640.21404-1-vincenzo.frascino@arm.com Signed-off-by: Vincenzo Frascino Cc: Andrey Ryabinin Cc: Andrey Konovalov Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit e4a38402c36e42df28eb1a5394be87e6571fb48a Author: Nico Pache Date: Thu Apr 21 16:36:01 2022 -0700 oom_kill.c: futex: delay the OOM reaper to allow time for proper futex cleanup The pthread struct is allocated on PRIVATE|ANONYMOUS memory [1] which can be targeted by the oom reaper. This mapping is used to store the futex robust list head; the kernel does not keep a copy of the robust list and instead references a userspace address to maintain the robustness during a process death. A race can occur between exit_mm and the oom reaper that allows the oom reaper to free the memory of the futex robust list before the exit path has handled the futex death: CPU1 CPU2 -------------------------------------------------------------------- page_fault do_exit "signal" wake_oom_reaper oom_reaper oom_reap_task_mm (invalidates mm) exit_mm exit_mm_release futex_exit_release futex_cleanup exit_robust_list get_user (EFAULT- can't access memory) If the get_user EFAULT's, the kernel will be unable to recover the waiters on the robust_list, leaving userspace mutexes hung indefinitely. Delay the OOM reaper, allowing more time for the exit path to perform the futex cleanup. Reproducer: https://gitlab.com/jsavitz/oom_futex_reproducer Based on a patch by Michal Hocko. Link: https://elixir.bootlin.com/glibc/glibc-2.35/source/nptl/allocatestack.c#L370 [1] Link: https://lkml.kernel.org/r/20220414144042.677008-1-npache@redhat.com Fixes: 212925802454 ("mm: oom: let oom_reap_task and exit_mmap run concurrently") Signed-off-by: Joel Savitz Signed-off-by: Nico Pache Co-developed-by: Joel Savitz Suggested-by: Thomas Gleixner Acked-by: Thomas Gleixner Acked-by: Michal Hocko Cc: Rafael Aquini Cc: Waiman Long Cc: Herton R. Krzesinski Cc: Juri Lelli Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Steven Rostedt Cc: Ben Segall Cc: Mel Gorman Cc: Daniel Bristot de Oliveira Cc: David Rientjes Cc: Andrea Arcangeli Cc: Davidlohr Bueso Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Joel Savitz Cc: Darren Hart Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/sched.h | 1 + mm/oom_kill.c | 54 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 14 deletions(-) commit 80df2fb95df26c849c6cc137344013cc048a083f Author: Sidhartha Kumar Date: Thu Apr 21 16:35:58 2022 -0700 selftest/vm: add skip support to mremap_test Allow the mremap test to be skipped due to errors such as failing to parse the mmap_min_addr sysctl. Link: https://lkml.kernel.org/r/20220420215721.4868-4-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/run_vmtests.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit e5508fc52c76fe42d8bb091fbd7796eeb64b52c4 Author: Sidhartha Kumar Date: Thu Apr 21 16:35:55 2022 -0700 selftest/vm: support xfail in mremap_test Use ksft_test_result_xfail for the tests which are expected to fail. Link: https://lkml.kernel.org/r/20220420215721.4868-3-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/mremap_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 18d609daa546c919fd36b62a7b510c18de4b4af8 Author: Sidhartha Kumar Date: Thu Apr 21 16:35:52 2022 -0700 selftest/vm: verify remap destination address in mremap_test Because mremap does not have a MAP_FIXED_NOREPLACE flag, it can destroy existing mappings. This causes a segfault when regions such as text are remapped and the permissions are changed. Verify the requested mremap destination address does not overlap any existing mappings by using mmap's MAP_FIXED_NOREPLACE flag. Keep incrementing the destination address until a valid mapping is found or fail the current test once the max address is reached. Link: https://lkml.kernel.org/r/20220420215721.4868-2-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/mremap_test.c | 42 +++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) commit 9c85a9bae267f6b5e5e374d0d023bbbe9db096d3 Author: Sidhartha Kumar Date: Thu Apr 21 16:35:49 2022 -0700 selftest/vm: verify mmap addr in mremap_test Avoid calling mmap with requested addresses that are less than the system's mmap_min_addr. When run as root, mmap returns EACCES when trying to map addresses < mmap_min_addr. This is not one of the error codes for the condition to retry the mmap in the test. Rather than arbitrarily retrying on EACCES, don't attempt an mmap until addr > vm.mmap_min_addr. Add a munmap call after an alignment check as the mappings are retained after the retry and can reach the vm.max_map_count sysctl. Link: https://lkml.kernel.org/r/20220420215721.4868-1-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Reviewed-by: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/mremap_test.c | 41 +++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) commit 5f24d5a579d1eace79d505b148808a850b417d4c Author: Christophe Leroy Date: Thu Apr 21 16:35:46 2022 -0700 mm, hugetlb: allow for "high" userspace addresses This is a fix for commit f6795053dac8 ("mm: mmap: Allow for "high" userspace addresses") for hugetlb. This patch adds support for "high" userspace addresses that are optionally supported on the system and have to be requested via a hint mechanism ("high" addr parameter to mmap). Architectures such as powerpc and x86 achieve this by making changes to their architectural versions of hugetlb_get_unmapped_area() function. However, arm64 uses the generic version of that function. So take into account arch_get_mmap_base() and arch_get_mmap_end() in hugetlb_get_unmapped_area(). To allow that, move those two macros out of mm/mmap.c into include/linux/sched/mm.h If these macros are not defined in architectural code then they default to (TASK_SIZE) and (base) so should not introduce any behavioural changes to architectures that do not define them. For the time being, only ARM64 is affected by this change. Catalin (ARM64) said "We should have fixed hugetlb_get_unmapped_area() as well when we added support for 52-bit VA. The reason for commit f6795053dac8 was to prevent normal mmap() from returning addresses above 48-bit by default as some user-space had hard assumptions about this. It's a slight ABI change if you do this for hugetlb_get_unmapped_area() but I doubt anyone would notice. It's more likely that the current behaviour would cause issues, so I'd rather have them consistent. Basically when arm64 gained support for 52-bit addresses we did not want user-space calling mmap() to suddenly get such high addresses, otherwise we could have inadvertently broken some programs (similar behaviour to x86 here). Hence we added commit f6795053dac8. But we missed hugetlbfs which could still get such high mmap() addresses. So in theory that's a potential regression that should have bee addressed at the same time as commit f6795053dac8 (and before arm64 enabled 52-bit addresses)" Link: https://lkml.kernel.org/r/ab847b6edb197bffdfe189e70fb4ac76bfe79e0d.1650033747.git.christophe.leroy@csgroup.eu Fixes: f6795053dac8 ("mm: mmap: Allow for "high" userspace addresses") Signed-off-by: Christophe Leroy Reviewed-by: Catalin Marinas Cc: Steve Capper Cc: Will Deacon Cc: [5.0.x] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/hugetlbfs/inode.c | 9 +++++---- include/linux/sched/mm.h | 8 ++++++++ mm/mmap.c | 8 -------- 3 files changed, 13 insertions(+), 12 deletions(-) commit 0e88904cb700a9654c9f0d9ca4967e761e7c9ee8 Author: Nadav Amit Date: Thu Apr 21 16:35:43 2022 -0700 userfaultfd: mark uffd_wp regardless of VM_WRITE flag When a PTE is set by UFFD operations such as UFFDIO_COPY, the PTE is currently only marked as write-protected if the VMA has VM_WRITE flag set. This seems incorrect or at least would be unexpected by the users. Consider the following sequence of operations that are being performed on a certain page: mprotect(PROT_READ) UFFDIO_COPY(UFFDIO_COPY_MODE_WP) mprotect(PROT_READ|PROT_WRITE) At this point the user would expect to still get UFFD notification when the page is accessed for write, but the user would not get one, since the PTE was not marked as UFFD_WP during UFFDIO_COPY. Fix it by always marking PTEs as UFFD_WP regardless on the write-permission in the VMA flags. Link: https://lkml.kernel.org/r/20220217211602.2769-1-namit@vmware.com Fixes: 292924b26024 ("userfaultfd: wp: apply _PAGE_UFFD_WP bit") Signed-off-by: Nadav Amit Acked-by: Peter Xu Cc: Axel Rasmussen Cc: Mike Rapoport Cc: Andrea Arcangeli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/userfaultfd.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit 9b3016154c913b2e7ec5ae5c9a42eb9e732d86aa Author: Shakeel Butt Date: Thu Apr 21 16:35:40 2022 -0700 memcg: sync flush only if periodic flush is delayed Daniel Dao has reported [1] a regression on workloads that may trigger a lot of refaults (anon and file). The underlying issue is that flushing rstat is expensive. Although rstat flush are batched with (nr_cpus * MEMCG_BATCH) stat updates, it seems like there are workloads which genuinely do stat updates larger than batch value within short amount of time. Since the rstat flush can happen in the performance critical codepaths like page faults, such workload can suffer greatly. This patch fixes this regression by making the rstat flushing conditional in the performance critical codepaths. More specifically, the kernel relies on the async periodic rstat flusher to flush the stats and only if the periodic flusher is delayed by more than twice the amount of its normal time window then the kernel allows rstat flushing from the performance critical codepaths. Now the question: what are the side-effects of this change? The worst that can happen is the refault codepath will see 4sec old lruvec stats and may cause false (or missed) activations of the refaulted page which may under-or-overestimate the workingset size. Though that is not very concerning as the kernel can already miss or do false activations. There are two more codepaths whose flushing behavior is not changed by this patch and we may need to come to them in future. One is the writeback stats used by dirty throttling and second is the deactivation heuristic in the reclaim. For now keeping an eye on them and if there is report of regression due to these codepaths, we will reevaluate then. Link: https://lore.kernel.org/all/CA+wXwBSyO87ZX5PVwdHm-=dBjZYECGmfnydUicUyrQqndgX2MQ@mail.gmail.com [1] Link: https://lkml.kernel.org/r/20220304184040.1304781-1-shakeelb@google.com Fixes: 1f828223b799 ("memcg: flush lruvec stats in the refault") Signed-off-by: Shakeel Butt Reported-by: Daniel Dao Tested-by: Ivan Babrou Cc: Michal Hocko Cc: Roman Gushchin Cc: Johannes Weiner Cc: Michal Koutný Cc: Frank Hofmann Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/memcontrol.h | 5 +++++ mm/memcontrol.c | 12 +++++++++++- mm/workingset.c | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) commit d173d5417fb67411e623d394aab986d847e47dad Author: Xu Yu Date: Thu Apr 21 16:35:37 2022 -0700 mm/memory-failure.c: skip huge_zero_page in memory_failure() Kernel panic when injecting memory_failure for the global huge_zero_page, when CONFIG_DEBUG_VM is enabled, as follows. Injecting memory failure for pfn 0x109ff9 at process virtual address 0x20ff9000 page:00000000fb053fc3 refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109e00 head:00000000fb053fc3 order:9 compound_mapcount:0 compound_pincount:0 flags: 0x17fffc000010001(locked|head|node=0|zone=2|lastcpupid=0x1ffff) raw: 017fffc000010001 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000002ffffffff 0000000000000000 page dumped because: VM_BUG_ON_PAGE(is_huge_zero_page(head)) ------------[ cut here ]------------ kernel BUG at mm/huge_memory.c:2499! invalid opcode: 0000 [#1] PREEMPT SMP PTI CPU: 6 PID: 553 Comm: split_bug Not tainted 5.18.0-rc1+ #11 Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 3288b3c 04/01/2014 RIP: 0010:split_huge_page_to_list+0x66a/0x880 Code: 84 9b fb ff ff 48 8b 7c 24 08 31 f6 e8 9f 5d 2a 00 b8 b8 02 00 00 e9 e8 fb ff ff 48 c7 c6 e8 47 3c 82 4c b RSP: 0018:ffffc90000dcbdf8 EFLAGS: 00010246 RAX: 000000000000003c RBX: 0000000000000001 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff823e4c4f RDI: 00000000ffffffff RBP: ffff88843fffdb40 R08: 0000000000000000 R09: 00000000fffeffff R10: ffffc90000dcbc48 R11: ffffffff82d68448 R12: ffffea0004278000 R13: ffffffff823c6203 R14: 0000000000109ff9 R15: ffffea000427fe40 FS: 00007fc375a26740(0000) GS:ffff88842fd80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc3757c9290 CR3: 0000000102174006 CR4: 00000000003706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: try_to_split_thp_page+0x3a/0x130 memory_failure+0x128/0x800 madvise_inject_error.cold+0x8b/0xa1 __x64_sys_madvise+0x54/0x60 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fc3754f8bf9 Code: 01 00 48 81 c4 80 00 00 00 e9 f1 fe ff ff 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 8 RSP: 002b:00007ffeda93a1d8 EFLAGS: 00000217 ORIG_RAX: 000000000000001c RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fc3754f8bf9 RDX: 0000000000000064 RSI: 0000000000003000 RDI: 0000000020ff9000 RBP: 00007ffeda93a200 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000217 R12: 0000000000400490 R13: 00007ffeda93a2e0 R14: 0000000000000000 R15: 0000000000000000 This makes huge_zero_page bail out explicitly before split in memory_failure(), thus the panic above won't happen again. Link: https://lkml.kernel.org/r/497d3835612610e370c74e697ea3c721d1d55b9c.1649775850.git.xuyu@linux.alibaba.com Fixes: 6a46079cf57a ("HWPOISON: The high level memory error handler in the VM v7") Signed-off-by: Xu Yu Reported-by: Abaci Suggested-by: Naoya Horiguchi Acked-by: Naoya Horiguchi Reviewed-by: Miaohe Lin Cc: Anshuman Khandual Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 405ce051236cc65b30bbfe490b28ce60ae6aed85 Author: Naoya Horiguchi Date: Thu Apr 21 16:35:33 2022 -0700 mm/hwpoison: fix race between hugetlb free/demotion and memory_failure_hugetlb() There is a race condition between memory_failure_hugetlb() and hugetlb free/demotion, which causes setting PageHWPoison flag on the wrong page. The one simple result is that wrong processes can be killed, but another (more serious) one is that the actual error is left unhandled, so no one prevents later access to it, and that might lead to more serious results like consuming corrupted data. Think about the below race window: CPU 1 CPU 2 memory_failure_hugetlb struct page *head = compound_head(p); hugetlb page might be freed to buddy, or even changed to another compound page. get_hwpoison_page -- page is not what we want now... The current code first does prechecks roughly and then reconfirms after taking refcount, but it's found that it makes code overly complicated, so move the prechecks in a single hugetlb_lock range. A newly introduced function, try_memory_failure_hugetlb(), always takes hugetlb_lock (even for non-hugetlb pages). That can be improved, but memory_failure() is rare in principle, so should not be a big problem. Link: https://lkml.kernel.org/r/20220408135323.1559401-2-naoya.horiguchi@linux.dev Fixes: 761ad8d7c7b5 ("mm: hwpoison: introduce memory_failure_hugetlb()") Signed-off-by: Naoya Horiguchi Reported-by: Mike Kravetz Reviewed-by: Miaohe Lin Reviewed-by: Mike Kravetz Cc: Yang Shi Cc: Dan Carpenter Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/hugetlb.h | 6 ++ include/linux/mm.h | 8 +++ mm/hugetlb.c | 10 ++++ mm/memory-failure.c | 145 ++++++++++++++++++++++++++++++++++-------------- 4 files changed, 127 insertions(+), 42 deletions(-) commit d968fda3de91ec2f250ba27149cb1b5e9516415f Author: Dmitry Baryshkov Date: Wed Apr 20 02:54:47 2022 +0300 clk: qcom: clk-rcg2: fix gfx3d frequency calculation Since the commit 948fb0969eae ("clk: Always clamp the rounded rate"), the clk_core_determine_round_nolock() would clamp the requested rate between min and max rates from the rate request. Normally these fields would be filled by clk_core_get_boundaries() called from clk_round_rate(). However clk_gfx3d_determine_rate() uses a manually crafted rate request, which did not have these fields filled. Thus the requested frequency would be clamped to 0, resulting in weird frequencies being requested from the hardware. Fix this by filling min_rate and max_rate to the values valid for the respective PLLs (0 and ULONG_MAX). Fixes: 948fb0969eae ("clk: Always clamp the rounded rate") Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220419235447.1586192-1-dmitry.baryshkov@linaro.org Reviewed-by: Bjorn Andersson Reported-by: Rob Clark Signed-off-by: Stephen Boyd drivers/clk/qcom/clk-rcg2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 37843d0f6e7a23af19a6cbe68b9503d318fe1a29 Author: Conor Dooley Date: Mon Apr 11 08:23:41 2022 +0100 clk: microchip: mpfs: don't reset disabled peripherals The current clock driver for PolarFire SoC puts the hardware behind "periph" clocks into reset if their clock is disabled. CONFIG_PM was recently added to the riscv defconfig and exposed issues caused by this behaviour, where the Cadence GEM was being put into reset between its bringup & the PHY bringup: https://lore.kernel.org/linux-riscv/9f4b057d-1985-5fd3-65c0-f944161c7792@microchip.com/ Fix this (for now) by removing the reset from mpfs_periph_clk_disable. Fixes: 635e5e73370e ("clk: microchip: Add driver for Microchip PolarFire SoC") Reviewed-by: Daire McNamara Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220411072340.740981-1-conor.dooley@microchip.com Signed-off-by: Stephen Boyd drivers/clk/microchip/clk-mpfs.c | 4 ---- 1 file changed, 4 deletions(-) commit 4d8ec91208196e0e19195f1e7d6be9de5873f242 Author: Jaegeuk Kim Date: Thu Apr 21 16:47:02 2022 -0700 f2fs: should not truncate blocks during roll-forward recovery If the file preallocated blocks and fsync'ed, we should not truncate them during roll-forward recovery which will recover i_size correctly back. Fixes: d4dd19ec1ea0 ("f2fs: do not expose unwritten blocks to user by DIO") Cc: # 5.17+ Signed-off-by: Jaegeuk Kim fs/f2fs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit aafa9f958342db36c17ac2a7f1b841032c96feb4 Author: Zheyu Ma Date: Thu Apr 21 09:39:20 2022 +0800 ata: pata_marvell: Check the 'bmdma_addr' beforing reading Before detecting the cable type on the dma bar, the driver should check whether the 'bmdma_addr' is zero, which means the adapter does not support DMA, otherwise we will get the following error: [ 5.146634] Bad IO access at port 0x1 (return inb(port)) [ 5.147206] WARNING: CPU: 2 PID: 303 at lib/iomap.c:44 ioread8+0x4a/0x60 [ 5.150856] RIP: 0010:ioread8+0x4a/0x60 [ 5.160238] Call Trace: [ 5.160470] [ 5.160674] marvell_cable_detect+0x6e/0xc0 [pata_marvell] [ 5.161728] ata_eh_recover+0x3520/0x6cc0 [ 5.168075] ata_do_eh+0x49/0x3c0 Signed-off-by: Zheyu Ma Signed-off-by: Damien Le Moal drivers/ata/pata_marvell.c | 2 ++ 1 file changed, 2 insertions(+) commit 70da382e1c5b9b2049c10abfd4489a40c1b60df0 Merge: e827d149fd09 0371870b9690 Author: Dave Airlie Date: Fri Apr 22 09:24:31 2022 +1000 Merge tag 'drm-msm-fixes-2022-04-20' of https://gitlab.freedesktop.org/drm/msm into drm-fixes Revert to fix iommu regression. Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGtvPo4xD2peAztDMPP2n4utb7d9WQboMFwsba9E8U2rCw@mail.gmail.com commit b05a5683eba6e2d40eadd5eeef53c4864149a4fe Merge: 59f0c2447e25 7495a5bbf89f Author: Linus Torvalds Date: Thu Apr 21 16:24:31 2022 -0700 Merge tag 'dmaengine-fix-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine fixes from Vinod Koul: "A bunch of driver fixes: - idxd device RO checks and device cleanup - dw-edma unaligned access and alignment - qcom: missing minItems in binding - mediatek pm usage fix - imx init script" * tag 'dmaengine-fix-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dt-bindings: dmaengine: qcom: gpi: Add minItems for interrupts dmaengine: idxd: skip clearing device context when device is read-only dmaengine: idxd: add RO check for wq max_transfer_size write dmaengine: idxd: add RO check for wq max_batch_size write dmaengine: idxd: fix retry value to be constant for duration of function call dmaengine: idxd: match type for retries var in idxd_enqcmds() dmaengine: dw-edma: Fix inconsistent indenting dmaengine: dw-edma: Fix unaligned 64bit access dmaengine: mediatek:Fix PM usage reference leak of mtk_uart_apdma_alloc_chan_resources dmaengine: imx-sdma: Fix error checking in sdma_event_remap dma: at_xdmac: fix a missing check on list iterator dmaengine: imx-sdma: fix init of uart scripts dmaengine: idxd: fix device cleanup on disable commit bf9bac40b7635e2ce43ba0051a64c3fd44312405 Author: Randy Dunlap Date: Sat Apr 9 15:53:17 2022 -0700 RISC-V: cpuidle: fix Kconfig select for RISCV_SBI_CPUIDLE There can be lots of build errors when building cpuidle-riscv-sbi.o. They are all caused by a kconfig problem with this warning: WARNING: unmet direct dependencies detected for RISCV_SBI_CPUIDLE Depends on [n]: CPU_IDLE [=y] && RISCV [=y] && RISCV_SBI [=n] Selected by [y]: - SOC_VIRT [=y] && CPU_IDLE [=y] so make the 'select' of RISCV_SBI_CPUIDLE also depend on RISCV_SBI. Fixes: c5179ef1ca0c ("RISC-V: Enable RISC-V SBI CPU Idle driver for QEMU virt machine") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Reviewed-by: Anup Patel Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt arch/riscv/Kconfig.socs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d5fdade9331f57335af97dbef61cf15b4930abc1 Author: Anup Patel Date: Tue Apr 12 09:03:35 2022 +0530 RISC-V: mm: Fix set_satp_mode() for platform not having Sv57 When Sv57 is not available the satp.MODE test in set_satp_mode() will fail and lead to pgdir re-programming for Sv48. The pgdir re-programming will fail as well due to pre-existing pgdir entry used for Sv57 and as a result kernel fails to boot on RISC-V platform not having Sv57. To fix above issue, we should clear the pgdir memory in set_satp_mode() before re-programming. Fixes: 011f09d12052 ("riscv: mm: Set sv57 on defaultly") Reported-by: Mayuresh Chitale Signed-off-by: Anup Patel Reviewed-by: Atish Patra Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt arch/riscv/mm/init.c | 1 + 1 file changed, 1 insertion(+) commit e827d149fd095e51928d048a5224144780b34a94 Merge: b2d229d4ddb1 bb02330408a7 Author: Dave Airlie Date: Fri Apr 22 06:34:36 2022 +1000 Merge tag 'drm-intel-fixes-2022-04-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Unset enable_psr2_sel_fetch if PSR2 detection fails - Fix to detect when VRR is turned off from panel settings Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YmAKuHwon7hGyIoC@jlahtine-mobl.ger.corp.intel.com commit e852be8b148e117e25be1c98cf72ee489b05919e Author: Paolo Bonzini Date: Wed Apr 20 06:27:27 2022 -0400 kvm: selftests: introduce and use more page size-related constants Clean up code that was hardcoding masks for various fields, now that the masks are included in processor.h. For more cleanup, define PAGE_SIZE and PAGE_MASK just like in Linux. PAGE_SIZE in particular was defined by several tests. Suggested-by: Sean Christopherson Reviewed-by: Peter Xu Signed-off-by: Paolo Bonzini tools/testing/selftests/kvm/include/x86_64/processor.h | 2 ++ tools/testing/selftests/kvm/lib/x86_64/processor.c | 12 ++++++------ tools/testing/selftests/kvm/x86_64/amx_test.c | 1 - tools/testing/selftests/kvm/x86_64/emulator_error_test.c | 1 - tools/testing/selftests/kvm/x86_64/smm_test.c | 2 -- tools/testing/selftests/kvm/x86_64/vmx_tsc_adjust_test.c | 1 - tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c | 1 - tools/testing/selftests/kvm/x86_64/xen_vmcall_test.c | 1 - 8 files changed, 8 insertions(+), 13 deletions(-) commit f18b4aebe107d092e384b1ae680b1e1de7a0196d Author: Paolo Bonzini Date: Wed Apr 20 06:27:27 2022 -0400 kvm: selftests: do not use bitfields larger than 32-bits for PTEs Red Hat's QE team reported test failure on access_tracking_perf_test: Testing guest mode: PA-bits:ANY, VA-bits:48, 4K pages guest physical test memory offset: 0x3fffbffff000 Populating memory : 0.684014577s Writing to populated memory : 0.006230175s Reading from populated memory : 0.004557805s ==== Test Assertion Failure ==== lib/kvm_util.c:1411: false pid=125806 tid=125809 errno=4 - Interrupted system call 1 0x0000000000402f7c: addr_gpa2hva at kvm_util.c:1411 2 (inlined by) addr_gpa2hva at kvm_util.c:1405 3 0x0000000000401f52: lookup_pfn at access_tracking_perf_test.c:98 4 (inlined by) mark_vcpu_memory_idle at access_tracking_perf_test.c:152 5 (inlined by) vcpu_thread_main at access_tracking_perf_test.c:232 6 0x00007fefe9ff81ce: ?? ??:0 7 0x00007fefe9c64d82: ?? ??:0 No vm physical memory at 0xffbffff000 I can easily reproduce it with a Intel(R) Xeon(R) CPU E5-2630 with 46 bits PA. It turns out that the address translation for clearing idle page tracking returned a wrong result; addr_gva2gpa()'s last step, which is based on "pte[index[0]].pfn", did the calculation with 40 bits length and the high 12 bits got truncated. In above case the GPA address to be returned should be 0x3fffbffff000 for GVA 0xc0000000, but it got truncated into 0xffbffff000 and the subsequent gpa2hva lookup failed. The width of operations on bit fields greater than 32-bit is implementation defined, and differs between GCC (which uses the bitfield precision) and clang (which uses 64-bit arithmetic), so this is a potential minefield. Remove the bit fields and using manual masking instead. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2075036 Reported-by: Nana Liu Reviewed-by: Peter Xu Tested-by: Peter Xu Signed-off-by: Paolo Bonzini .../selftests/kvm/include/x86_64/processor.h | 15 ++ tools/testing/selftests/kvm/lib/x86_64/processor.c | 192 +++++++++------------ 2 files changed, 92 insertions(+), 115 deletions(-) commit 683412ccf61294d727ead4a73d97397396e69a6b Author: Mingwei Zhang Date: Thu Apr 21 03:14:07 2022 +0000 KVM: SEV: add cache flush to solve SEV cache incoherency issues Flush the CPU caches when memory is reclaimed from an SEV guest (where reclaim also includes it being unmapped from KVM's memslots). Due to lack of coherency for SEV encrypted memory, failure to flush results in silent data corruption if userspace is malicious/broken and doesn't ensure SEV guest memory is properly pinned and unpinned. Cache coherency is not enforced across the VM boundary in SEV (AMD APM vol.2 Section 15.34.7). Confidential cachelines, generated by confidential VM guests have to be explicitly flushed on the host side. If a memory page containing dirty confidential cachelines was released by VM and reallocated to another user, the cachelines may corrupt the new user at a later time. KVM takes a shortcut by assuming all confidential memory remain pinned until the end of VM lifetime. Therefore, KVM does not flush cache at mmu_notifier invalidation events. Because of this incorrect assumption and the lack of cache flushing, malicous userspace can crash the host kernel: creating a malicious VM and continuously allocates/releases unpinned confidential memory pages when the VM is running. Add cache flush operations to mmu_notifier operations to ensure that any physical memory leaving the guest VM get flushed. In particular, hook mmu_notifier_invalidate_range_start and mmu_notifier_release events and flush cache accordingly. The hook after releasing the mmu lock to avoid contention with other vCPUs. Cc: stable@vger.kernel.org Suggested-by: Sean Christpherson Reported-by: Mingwei Zhang Signed-off-by: Mingwei Zhang Message-Id: <20220421031407.2516575-4-mizhang@google.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm-x86-ops.h | 1 + arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm/sev.c | 8 ++++++++ arch/x86/kvm/svm/svm.c | 1 + arch/x86/kvm/svm/svm.h | 2 ++ arch/x86/kvm/x86.c | 5 +++++ include/linux/kvm_host.h | 2 ++ virt/kvm/kvm_main.c | 27 ++++++++++++++++++++++++--- 8 files changed, 44 insertions(+), 3 deletions(-) commit 59f0c2447e2553b0918b4a9fd38763a5c0587d02 Merge: b253435746d9 bc6de2878429 Author: Linus Torvalds Date: Thu Apr 21 12:29:08 2022 -0700 Merge tag 'net-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from xfrm and can. Current release - regressions: - rxrpc: restore removed timer deletion Current release - new code bugs: - gre: fix device lookup for l3mdev use-case - xfrm: fix egress device lookup for l3mdev use-case Previous releases - regressions: - sched: cls_u32: fix netns refcount changes in u32_change() - smc: fix sock leak when release after smc_shutdown() - xfrm: limit skb_page_frag_refill use to a single page - eth: atlantic: invert deep par in pm functions, preventing null derefs - eth: stmmac: use readl_poll_timeout_atomic() in atomic state Previous releases - always broken: - gre: fix skb_under_panic on xmit - openvswitch: fix OOB access in reserve_sfa_size() - dsa: hellcreek: calculate checksums in tagger - eth: ice: fix crash in switchdev mode - eth: igc: - fix infinite loop in release_swfw_sync - fix scheduling while atomic" * tag 'net-5.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (37 commits) drivers: net: hippi: Fix deadlock in rr_close() selftests: mlxsw: vxlan_flooding_ipv6: Prevent flooding of unwanted packets selftests: mlxsw: vxlan_flooding: Prevent flooding of unwanted packets nfc: MAINTAINERS: add Bug entry net: stmmac: Use readl_poll_timeout_atomic() in atomic state doc/ip-sysctl: add bc_forwarding netlink: reset network and mac headers in netlink_dump() net: mscc: ocelot: fix broken IP multicast flooding net: dsa: hellcreek: Calculate checksums in tagger net: atlantic: invert deep par in pm functions, preventing null derefs can: isotp: stop timeout monitoring when no first frame was sent bonding: do not discard lowest hash bit for non layer3+4 hashing net: lan966x: Make sure to release ptp interrupt ipv6: make ip6_rt_gc_expire an atomic_t net: Handle l3mdev in ip_tunnel_init_flow l3mdev: l3mdev_master_upper_ifindex_by_index_rcu should be using netdev_master_upper_dev_get_rcu net/sched: cls_u32: fix possible leak in u32_init_knode() net/sched: cls_u32: fix netns refcount changes in u32_change() powerpc: Update MAINTAINERS for ibmvnic and VAS net: restore alpha order to Ethernet devices in config ... commit 86222af07abf1f5f07a5873cc399c29ab8a9b8b8 Author: Tim Crawford Date: Thu Apr 21 11:04:12 2022 -0600 ALSA: hda/realtek: Add quirk for Clevo NP70PNP Fixes headset detection on Clevo NP70PNP. Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220421170412.3697-1-tcrawford@system76.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) commit b07908ab26ceab51165c13714277c19252e62594 Author: Gongjun Song Date: Thu Apr 21 11:35:46 2022 -0500 ALSA: hda: intel-dsp-config: Add RaptorLake PCI IDs Add RaptorLake-P PCI IDs Reviewed-by: Kai Vehmanen Signed-off-by: Gongjun Song Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220421163546.319604-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai sound/hda/intel-dsp-config.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 23e3d7f7061f8682c751c46512718f47580ad8f0 Author: Ye Bin Date: Thu Mar 17 22:21:37 2022 +0800 jbd2: fix a potential race while discarding reserved buffers after an abort we got issue as follows: [ 72.796117] EXT4-fs error (device sda): ext4_journal_check_start:83: comm fallocate: Detected aborted journal [ 72.826847] EXT4-fs (sda): Remounting filesystem read-only fallocate: fallocate failed: Read-only file system [ 74.791830] jbd2_journal_commit_transaction: jh=0xffff9cfefe725d90 bh=0x0000000000000000 end delay [ 74.793597] ------------[ cut here ]------------ [ 74.794203] kernel BUG at fs/jbd2/transaction.c:2063! [ 74.794886] invalid opcode: 0000 [#1] PREEMPT SMP PTI [ 74.795533] CPU: 4 PID: 2260 Comm: jbd2/sda-8 Not tainted 5.17.0-rc8-next-20220315-dirty #150 [ 74.798327] RIP: 0010:__jbd2_journal_unfile_buffer+0x3e/0x60 [ 74.801971] RSP: 0018:ffffa828c24a3cb8 EFLAGS: 00010202 [ 74.802694] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 [ 74.803601] RDX: 0000000000000001 RSI: ffff9cfefe725d90 RDI: ffff9cfefe725d90 [ 74.804554] RBP: ffff9cfefe725d90 R08: 0000000000000000 R09: ffffa828c24a3b20 [ 74.805471] R10: 0000000000000001 R11: 0000000000000001 R12: ffff9cfefe725d90 [ 74.806385] R13: ffff9cfefe725d98 R14: 0000000000000000 R15: ffff9cfe833a4d00 [ 74.807301] FS: 0000000000000000(0000) GS:ffff9d01afb00000(0000) knlGS:0000000000000000 [ 74.808338] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 74.809084] CR2: 00007f2b81bf4000 CR3: 0000000100056000 CR4: 00000000000006e0 [ 74.810047] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 74.810981] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 74.811897] Call Trace: [ 74.812241] [ 74.812566] __jbd2_journal_refile_buffer+0x12f/0x180 [ 74.813246] jbd2_journal_refile_buffer+0x4c/0xa0 [ 74.813869] jbd2_journal_commit_transaction.cold+0xa1/0x148 [ 74.817550] kjournald2+0xf8/0x3e0 [ 74.819056] kthread+0x153/0x1c0 [ 74.819963] ret_from_fork+0x22/0x30 Above issue may happen as follows: write truncate kjournald2 generic_perform_write ext4_write_begin ext4_walk_page_buffers do_journal_get_write_access ->add BJ_Reserved list ext4_journalled_write_end ext4_walk_page_buffers write_end_fn ext4_handle_dirty_metadata ***************JBD2 ABORT************** jbd2_journal_dirty_metadata -> return -EROFS, jh in reserved_list jbd2_journal_commit_transaction while (commit_transaction->t_reserved_list) jh = commit_transaction->t_reserved_list; truncate_pagecache_range do_invalidatepage ext4_journalled_invalidatepage jbd2_journal_invalidatepage journal_unmap_buffer __dispose_buffer __jbd2_journal_unfile_buffer jbd2_journal_put_journal_head ->put last ref_count __journal_remove_journal_head bh->b_private = NULL; jh->b_bh = NULL; jbd2_journal_refile_buffer(journal, jh); bh = jh2bh(jh); ->bh is NULL, later will trigger null-ptr-deref journal_free_journal_head(jh); After commit 96f1e0974575, we no longer hold the j_state_lock while iterating over the list of reserved handles in jbd2_journal_commit_transaction(). This potentially allows the journal_head to be freed by journal_unmap_buffer while the commit codepath is also trying to free the BJ_Reserved buffers. Keeping j_state_lock held while trying extends hold time of the lock minimally, and solves this issue. Fixes: 96f1e0974575("jbd2: avoid long hold times of j_state_lock while committing a transaction") Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220317142137.1821590-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o fs/jbd2/commit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit d0f6cfb2bd165b0aa307750e07e03420859bd554 Author: Kees Cook Date: Thu Apr 21 09:55:04 2022 -0700 thermal: int340x: Fix attr.show callback prototype Control Flow Integrity (CFI) instrumentation of the kernel noticed that the caller, dev_attr_show(), and the callback, odvp_show(), did not have matching function prototypes, which would cause a CFI exception to be raised. Correct the prototype by using struct device_attribute instead of struct kobj_attribute. Reported-and-tested-by: Joao Moreira Link: https://lore.kernel.org/lkml/067ce8bd4c3968054509831fa2347f4f@overdrivepizza.com/ Fixes: 006f006f1e5c ("thermal/int340x_thermal: Export OEM vendor variables") Cc: 5.8+ # 5.8+ Signed-off-by: Kees Cook Signed-off-by: Rafael J. Wysocki drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 20e582e16af24b074e583f9551fad557882a3c9d Author: Ville Syrjälä Date: Wed Apr 20 16:44:17 2022 +0300 Revert "ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40" This reverts commit bfe55a1f7fd6bfede16078bf04c6250fbca11588. This was presumably misdiagnosed as an inability to use C3 at all when I suspect the real problem is just misconfiguration of C3 vs. ARB_DIS. Signed-off-by: Ville Syrjälä Cc: 5.16+ # 5.16+ Tested-by: Woody Suwalski Signed-off-by: Rafael J. Wysocki drivers/acpi/processor_idle.c | 5 ----- 1 file changed, 5 deletions(-) commit fc45e55ebc58dbf622cb89ddbf797589c7a5510b Author: Ville Syrjälä Date: Thu Apr 21 16:36:34 2022 +0300 ACPI: processor: idle: Avoid falling back to C3 type C-states The "safe state" index is used by acpi_idle_enter_bm() to avoid entering a C-state that may require bus mastering to be disabled on entry in the cases when this is not going to happen. For this reason, it should not be set to point to C3 type of C-states, because they may require bus mastering to be disabled on entry in principle. This was broken by commit d6b88ce2eb9d ("ACPI: processor idle: Allow playing dead in C3 state") which inadvertently allowed the "safe state" index to point to C3 type of C-states. This results in a machine that won't boot past the point when it first enters C3. Restore the correct behaviour (either demote to C1/C2, or use C3 but also set ARB_DIS=1). I hit this on a Fujitsu Siemens Lifebook S6010 (P3) machine. Fixes: d6b88ce2eb9d ("ACPI: processor idle: Allow playing dead in C3 state") Cc: 5.16+ # 5.16+ Signed-off-by: Ville Syrjälä Tested-by: Woody Suwalski [ rjw: Subject and changelog adjustments ] Signed-off-by: Rafael J. Wysocki drivers/acpi/processor_idle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 0c9b152c72e53016e96593bdbb8cffe2176694b9 Author: Neil Armstrong Date: Thu Apr 21 17:57:25 2022 +0200 ASoC: meson: axg-card: Fix nonatomic links This commit e138233e56e9829e65b6293887063a1a3ccb2d68 causes the following system crash when using audio on G12A/G12B & SM1 systems: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:282 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 0, name: swapper/0 preempt_count: 10001, expected: 0 RCU nest depth: 0, expected: 0 Preemption disabled at: schedule_preempt_disabled+0x20/0x2c mutex_lock+0x24/0x60 _snd_pcm_stream_lock_irqsave+0x20/0x3c snd_pcm_period_elapsed+0x24/0xa4 axg_fifo_pcm_irq_block+0x64/0xdc __handle_irq_event_percpu+0x104/0x264 handle_irq_event+0x48/0xb4 ... start_kernel+0x3f0/0x484 __primary_switched+0xc0/0xc8 Revert this commit until the crash is fixed. Fixes: e138233e56e9829e65b6 ("ASoC: meson: axg-card: make links nonatomic") Reported-by: Dmitry Shmidt Signed-off-by: Neil Armstrong Acked-by: Jerome Brunet Link: https://lore.kernel.org/r/20220421155725.2589089-2-narmstrong@baylibre.com Signed-off-by: Mark Brown sound/soc/meson/axg-card.c | 1 - 1 file changed, 1 deletion(-) commit c26830b6c5c534d273ce007eb33d5a2d2ad4e969 Author: Neil Armstrong Date: Thu Apr 21 17:57:24 2022 +0200 ASoC: meson: axg-tdm-interface: Fix formatters in trigger" This reverts commit bf5e4887eeddb48480568466536aa08ec7f179a5 because the following and required commit e138233e56e9829e65b6293887063a1a3ccb2d68 causes the following system crash when using audio: BUG: sleeping function called from invalid context at kernel/locking/mutex.c:282 Fixes: bf5e4887eeddb4848056846 ("ASoC: meson: axg-tdm-interface: manage formatters in trigger") Reported-by: Dmitry Shmidt Signed-off-by: Neil Armstrong Acked-by: Jerome Brunet Link: https://lore.kernel.org/r/20220421155725.2589089-1-narmstrong@baylibre.com Signed-off-by: Mark Brown sound/soc/meson/axg-tdm-interface.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) commit eb5773201b1c5d603424bd21f161c8c2d1075b42 Author: Pierre-Louis Bossart Date: Thu Apr 21 11:23:28 2022 -0500 ASoC: soc-ops: fix error handling cppcheck throws the following warning: sound/soc/soc-ops.c:461:8: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] ret = err; ^ This seems to be a missing change in the return value. Fixes: 7f3d90a351968 ("ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_sx()") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220421162328.302017-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/soc-ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bf95c4d4630c7a2c16e7b424fdea5177d9ce0864 Author: Vijayavardhan Vennapusa Date: Wed Apr 13 16:10:38 2022 -0500 usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind() If any function like UVC is deactivating gadget as part of composition switch which results in not calling pullup enablement, it is not getting enabled after switch to new composition due to this deactivation flag not cleared. This results in USB enumeration not happening after switch to new USB composition. Hence clear deactivation flag inside gadget structure in configfs_composite_unbind() before switch to new USB composition. Signed-off-by: Vijayavardhan Vennapusa Signed-off-by: Dan Vacura Cc: stable Link: https://lore.kernel.org/r/20220413211038.72797-1-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/configfs.c | 2 ++ 1 file changed, 2 insertions(+) commit 929b22e669b15fc9a2ab110ea27f0c489ed92beb Author: Christophe JAILLET Date: Sun Apr 3 11:59:15 2022 +0200 usb: misc: eud: Fix an error handling path in eud_probe() It is odd to call devm_add_action_or_reset() before calling the function that should be undone. Either, the "_or_reset" part should be omitted, or the action should be recorded after the resources have been allocated. Switch the order of devm_add_action_or_reset() and usb_role_switch_get(). Fixes: 9a1bf58ccd44 ("usb: misc: eud: Add driver support for Embedded USB Debugger(EUD)") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/362908699275ecec078381b42d87c817c6965fc6.1648979948.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman drivers/usb/misc/qcom_eud.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 0543e4e8852ef5ff1809ae62f1ea963e2ab23b66 Author: Tasos Sahanidis Date: Fri Apr 1 00:47:00 2022 +0300 usb: core: Don't hold the device lock while sleeping in do_proc_control() Since commit ae8709b296d8 ("USB: core: Make do_proc_control() and do_proc_bulk() killable") if a device has the USB_QUIRK_DELAY_CTRL_MSG quirk set, it will temporarily block all other URBs (e.g. interrupts) while sleeping due to a control. This results in noticeable delays when, for example, a userspace usbfs application is sending URB interrupts at a high rate to a keyboard and simultaneously updates the lock indicators using controls. Interrupts with direction set to IN are also affected by this, meaning that delivery of HID reports (containing scancodes) to the usbfs application is delayed as well. This patch fixes the regression by calling msleep() while the device mutex is unlocked, as was the case originally with usb_control_msg(). Fixes: ae8709b296d8 ("USB: core: Make do_proc_control() and do_proc_bulk() killable") Cc: stable Acked-by: Alan Stern Signed-off-by: Tasos Sahanidis Link: https://lore.kernel.org/r/3e299e2a-13b9-ddff-7fee-6845e868bc06@tasossah.com Signed-off-by: Greg Kroah-Hartman drivers/usb/core/devio.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) commit d45829b351ee6ec5f54dd55e6aca1f44fe239fe6 Author: Mingwei Zhang Date: Thu Apr 21 03:14:06 2022 +0000 KVM: SVM: Flush when freeing encrypted pages even on SME_COHERENT CPUs Use clflush_cache_range() to flush the confidential memory when SME_COHERENT is supported in AMD CPU. Cache flush is still needed since SME_COHERENT only support cache invalidation at CPU side. All confidential cache lines are still incoherent with DMA devices. Cc: stable@vger.kerel.org Fixes: add5e2f04541 ("KVM: SVM: Add support for the SEV-ES VMSA") Reviewed-by: Sean Christopherson Signed-off-by: Mingwei Zhang Message-Id: <20220421031407.2516575-3-mizhang@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/sev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 4bbef7e8eb8c2c7dabf57d97decfd2b4f48aaf02 Author: Sean Christopherson Date: Thu Apr 21 03:14:05 2022 +0000 KVM: SVM: Simplify and harden helper to flush SEV guest page(s) Rework sev_flush_guest_memory() to explicitly handle only a single page, and harden it to fall back to WBINVD if VM_PAGE_FLUSH fails. Per-page flushing is currently used only to flush the VMSA, and in its current form, the helper is completely broken with respect to flushing actual guest memory, i.e. won't work correctly for an arbitrary memory range. VM_PAGE_FLUSH takes a host virtual address, and is subject to normal page walks, i.e. will fault if the address is not present in the host page tables or does not have the correct permissions. Current AMD CPUs also do not honor SMAP overrides (undocumented in kernel versions of the APM), so passing in a userspace address is completely out of the question. In other words, KVM would need to manually walk the host page tables to get the pfn, ensure the pfn is stable, and then use the direct map to invoke VM_PAGE_FLUSH. And the latter might not even work, e.g. if userspace is particularly evil/clever and backs the guest with Secret Memory (which unmaps memory from the direct map). Signed-off-by: Sean Christopherson Fixes: add5e2f04541 ("KVM: SVM: Add support for the SEV-ES VMSA") Reported-by: Mingwei Zhang Cc: stable@vger.kernel.org Signed-off-by: Mingwei Zhang Message-Id: <20220421031407.2516575-2-mizhang@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/sev.c | 54 +++++++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 34 deletions(-) commit 266a19a0bc4fbfab4d981a47640ca98972a01865 Author: Thomas Huth Date: Thu Apr 14 12:30:31 2022 +0200 KVM: selftests: Silence compiler warning in the kvm_page_table_test When compiling kvm_page_table_test.c, I get this compiler warning with gcc 11.2: kvm_page_table_test.c: In function 'pre_init_before_test': ../../../../tools/include/linux/kernel.h:44:24: warning: comparison of distinct pointer types lacks a cast 44 | (void) (&_max1 == &_max2); \ | ^~ kvm_page_table_test.c:281:21: note: in expansion of macro 'max' 281 | alignment = max(0x100000, alignment); | ^~~ Fix it by adjusting the type of the absolute value. Signed-off-by: Thomas Huth Reviewed-by: Claudio Imbrenda Message-Id: <20220414103031.565037-1-thuth@redhat.com> Signed-off-by: Paolo Bonzini tools/testing/selftests/kvm/kvm_page_table_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 75189d1de1b377e580ebd2d2c55914631eac9c64 Author: Like Xu Date: Sat Apr 9 09:52:26 2022 +0800 KVM: x86/pmu: Update AMD PMC sample period to fix guest NMI-watchdog NMI-watchdog is one of the favorite features of kernel developers, but it does not work in AMD guest even with vPMU enabled and worse, the system misrepresents this capability via /proc. This is a PMC emulation error. KVM does not pass the latest valid value to perf_event in time when guest NMI-watchdog is running, thus the perf_event corresponding to the watchdog counter will enter the old state at some point after the first guest NMI injection, forcing the hardware register PMC0 to be constantly written to 0x800000000001. Meanwhile, the running counter should accurately reflect its new value based on the latest coordinated pmc->counter (from vPMC's point of view) rather than the value written directly by the guest. Fixes: 168d918f2643 ("KVM: x86: Adjust counter sample period after a wrmsr") Reported-by: Dongli Cao Signed-off-by: Like Xu Reviewed-by: Yanan Wang Tested-by: Yanan Wang Reviewed-by: Jim Mattson Message-Id: <20220409015226.38619-1-likexu@tencent.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini arch/x86/kvm/pmu.h | 9 +++++++++ arch/x86/kvm/svm/pmu.c | 1 + arch/x86/kvm/vmx/pmu_intel.c | 8 ++------ 3 files changed, 12 insertions(+), 6 deletions(-) commit 0361bdfddca20c8855ea3bdbbbc9c999912b10ff Author: Wanpeng Li Date: Mon Apr 18 00:42:32 2022 -0700 x86/kvm: Preserve BSP MSR_KVM_POLL_CONTROL across suspend/resume MSR_KVM_POLL_CONTROL is cleared on reset, thus reverting guests to host-side polling after suspend/resume. Non-bootstrap CPUs are restored correctly by the haltpoll driver because they are hot-unplugged during suspend and hot-plugged during resume; however, the BSP is not hotpluggable and remains in host-sde polling mode after the guest resume. The makes the guest pay for the cost of vmexits every time the guest enters idle. Fix it by recording BSP's haltpoll state and resuming it during guest resume. Cc: Marcelo Tosatti Signed-off-by: Wanpeng Li Message-Id: <1650267752-46796-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini arch/x86/kernel/kvm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit a413a625b43e5f085d4e1a8c4053494d593fb3c1 Author: Tom Rix Date: Sun Apr 10 11:38:40 2022 -0400 KVM: SPDX style and spelling fixes SPDX comments use use /* */ style comments in headers anad // style comments in .c files. Also fix two spelling mistakes. Signed-off-by: Tom Rix Message-Id: <20220410153840.55506-1-trix@redhat.com> Signed-off-by: Paolo Bonzini virt/kvm/dirty_ring.c | 2 +- virt/kvm/kvm_main.c | 4 ++-- virt/kvm/kvm_mm.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) commit 0047fb33f811e00db5c87d028e5fcf0a26632b40 Author: Sean Christopherson Date: Wed Apr 20 01:37:32 2022 +0000 KVM: x86: Skip KVM_GUESTDBG_BLOCKIRQ APICv update if APICv is disabled Skip the APICv inhibit update for KVM_GUESTDBG_BLOCKIRQ if APICv is disabled at the module level to avoid having to acquire the mutex and potentially process all vCPUs. The DISABLE inhibit will (barring bugs) never be lifted, so piling on more inhibits is unnecessary. Fixes: cae72dcc3b21 ("KVM: x86: inhibit APICv when KVM_GUESTDBG_BLOCKIRQ active") Cc: Maxim Levitsky Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20220420013732.3308816-5-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/x86.c | 3 +++ 1 file changed, 3 insertions(+) commit 423ecfea77dda83823c71b0fad1c2ddb2af1e5fc Author: Sean Christopherson Date: Wed Apr 20 01:37:31 2022 +0000 KVM: x86: Pend KVM_REQ_APICV_UPDATE during vCPU creation to fix a race Make a KVM_REQ_APICV_UPDATE request when creating a vCPU with an in-kernel local APIC and APICv enabled at the module level. Consuming kvm_apicv_activated() and stuffing vcpu->arch.apicv_active directly can race with __kvm_set_or_clear_apicv_inhibit(), as vCPU creation happens before the vCPU is fully onlined, i.e. it won't get the request made to "all" vCPUs. If APICv is globally inhibited between setting apicv_active and onlining the vCPU, the vCPU will end up running with APICv enabled and trigger KVM's sanity check. Mark APICv as active during vCPU creation if APICv is enabled at the module level, both to be optimistic about it's final state, e.g. to avoid additional VMWRITEs on VMX, and because there are likely bugs lurking since KVM checks apicv_active in multiple vCPU creation paths. While keeping the current behavior of consuming kvm_apicv_activated() is arguably safer from a regression perspective, force apicv_active so that vCPU creation runs with deterministic state and so that if there are bugs, they are found sooner than later, i.e. not when some crazy race condition is hit. WARNING: CPU: 0 PID: 484 at arch/x86/kvm/x86.c:9877 vcpu_enter_guest+0x2ae3/0x3ee0 arch/x86/kvm/x86.c:9877 Modules linked in: CPU: 0 PID: 484 Comm: syz-executor361 Not tainted 5.16.13 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1~cloud0 04/01/2014 RIP: 0010:vcpu_enter_guest+0x2ae3/0x3ee0 arch/x86/kvm/x86.c:9877 Call Trace: vcpu_run arch/x86/kvm/x86.c:10039 [inline] kvm_arch_vcpu_ioctl_run+0x337/0x15e0 arch/x86/kvm/x86.c:10234 kvm_vcpu_ioctl+0x4d2/0xc80 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3727 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x16d/0x1d0 fs/ioctl.c:860 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+0x44/0xae The bug was hit by a syzkaller spamming VM creation with 2 vCPUs and a call to KVM_SET_GUEST_DEBUG. r0 = openat$kvm(0xffffffffffffff9c, &(0x7f0000000000), 0x0, 0x0) r1 = ioctl$KVM_CREATE_VM(r0, 0xae01, 0x0) ioctl$KVM_CAP_SPLIT_IRQCHIP(r1, 0x4068aea3, &(0x7f0000000000)) (async) r2 = ioctl$KVM_CREATE_VCPU(r1, 0xae41, 0x0) (async) r3 = ioctl$KVM_CREATE_VCPU(r1, 0xae41, 0x400000000000002) ioctl$KVM_SET_GUEST_DEBUG(r3, 0x4048ae9b, &(0x7f00000000c0)={0x5dda9c14aa95f5c5}) ioctl$KVM_RUN(r2, 0xae80, 0x0) Reported-by: Gaoning Pan Reported-by: Yongkang Jia Fixes: 8df14af42f00 ("kvm: x86: Add support for dynamic APICv activation") Cc: stable@vger.kernel.org Cc: Maxim Levitsky Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20220420013732.3308816-4-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/x86.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) commit 7c69661e225cc484fbf44a0b99b56714a5241ae3 Author: Sean Christopherson Date: Wed Apr 20 01:37:30 2022 +0000 KVM: nVMX: Defer APICv updates while L2 is active until L1 is active Defer APICv updates that occur while L2 is active until nested VM-Exit, i.e. until L1 regains control. vmx_refresh_apicv_exec_ctrl() assumes L1 is active and (a) stomps all over vmcs02 and (b) neglects to ever updated vmcs01. E.g. if vmcs12 doesn't enable the TPR shadow for L2 (and thus no APICv controls), L1 performs nested VM-Enter APICv inhibited, and APICv becomes unhibited while L2 is active, KVM will set various APICv controls in vmcs02 and trigger a failed VM-Entry. The kicker is that, unless running with nested_early_check=1, KVM blames L1 and chaos ensues. In all cases, ignoring vmcs02 and always deferring the inhibition change to vmcs01 is correct (or at least acceptable). The ABSENT and DISABLE inhibitions cannot truly change while L2 is active (see below). IRQ_BLOCKING can change, but it is firmly a best effort debug feature. Furthermore, only L2's APIC is accelerated/virtualized to the full extent possible, e.g. even if L1 passes through its APIC to L2, normal MMIO/MSR interception will apply to the virtual APIC managed by KVM. The exception is the SELF_IPI register when x2APIC is enabled, but that's an acceptable hole. Lastly, Hyper-V's Auto EOI can technically be toggled if L1 exposes the MSRs to L2, but for that to work in any sane capacity, L1 would need to pass through IRQs to L2 as well, and IRQs must be intercepted to enable virtual interrupt delivery. I.e. exposing Auto EOI to L2 and enabling VID for L2 are, for all intents and purposes, mutually exclusive. Lack of dynamic toggling is also why this scenario is all but impossible to encounter in KVM's current form. But a future patch will pend an APICv update request _during_ vCPU creation to plug a race where a vCPU that's being created doesn't get included in the "all vCPUs request" because it's not yet visible to other vCPUs. If userspaces restores L2 after VM creation (hello, KVM selftests), the first KVM_RUN will occur while L2 is active and thus service the APICv update request made during VM creation. Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20220420013732.3308816-3-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/vmx/nested.c | 5 +++++ arch/x86/kvm/vmx/vmx.c | 5 +++++ arch/x86/kvm/vmx/vmx.h | 1 + 3 files changed, 11 insertions(+) commit 80f0497c221112fc25845a8b68f1c5b4a23b3567 Author: Sean Christopherson Date: Wed Apr 20 01:37:29 2022 +0000 KVM: x86: Tag APICv DISABLE inhibit, not ABSENT, if APICv is disabled Set the DISABLE inhibit, not the ABSENT inhibit, if APICv is disabled via module param. A recent refactoring to add a wrapper for setting/clearing inhibits unintentionally changed the flag, probably due to a copy+paste goof. Fixes: 4f4c4a3ee53c ("KVM: x86: Trace all APICv inhibit changes and capture overall status") Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20220420013732.3308816-2-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5c697c367a66307a5d943c3449421aff2aa3ca4a Author: Sean Christopherson Date: Fri Apr 15 00:46:22 2022 +0000 KVM: Initialize debugfs_dentry when a VM is created to avoid NULL deref Initialize debugfs_entry to its semi-magical -ENOENT value when the VM is created. KVM's teardown when VM creation fails is kludgy and calls kvm_uevent_notify_change() and kvm_destroy_vm_debugfs() even if KVM never attempted kvm_create_vm_debugfs(). Because debugfs_entry is zero initialized, the IS_ERR() checks pass and KVM derefs a NULL pointer. BUG: kernel NULL pointer dereference, address: 0000000000000018 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 1068b1067 P4D 1068b1067 PUD 1068b0067 PMD 0 Oops: 0000 [#1] SMP CPU: 0 PID: 871 Comm: repro Not tainted 5.18.0-rc1+ #825 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:__dentry_path+0x7b/0x130 Call Trace: dentry_path_raw+0x42/0x70 kvm_uevent_notify_change.part.0+0x10c/0x200 [kvm] kvm_put_kvm+0x63/0x2b0 [kvm] kvm_dev_ioctl+0x43a/0x920 [kvm] __x64_sys_ioctl+0x83/0xb0 do_syscall_64+0x31/0x50 entry_SYSCALL_64_after_hwframe+0x44/0xae Modules linked in: kvm_intel kvm irqbypass Fixes: a44a4cc1c969 ("KVM: Don't create VM debugfs files outside of the VM directory") Cc: stable@vger.kernel.org Cc: Marc Zyngier Cc: Oliver Upton Reported-by: syzbot+df6fbbd2ee39f21289ef@syzkaller.appspotmail.com Signed-off-by: Sean Christopherson Reviewed-by: Oliver Upton Message-Id: <20220415004622.2207751-1-seanjc@google.com> Signed-off-by: Paolo Bonzini virt/kvm/kvm_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 2031f2876896d82aca7e82f84accd9181b9587fb Author: Sean Christopherson Date: Fri Apr 15 00:43:43 2022 +0000 KVM: Add helpers to wrap vcpu->srcu_idx and yell if it's abused Add wrappers to acquire/release KVM's SRCU lock when stashing the index in vcpu->src_idx, along with rudimentary detection of illegal usage, e.g. re-acquiring SRCU and thus overwriting vcpu->src_idx. Because the SRCU index is (currently) either 0 or 1, illegal nesting bugs can go unnoticed for quite some time and only cause problems when the nested lock happens to get a different index. Wrap the WARNs in PROVE_RCU=y, and make them ONCE, otherwise KVM will likely yell so loudly that it will bring the kernel to its knees. Signed-off-by: Sean Christopherson Tested-by: Fabiano Rosas Message-Id: <20220415004343.2203171-4-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/powerpc/kvm/book3s_64_mmu_radix.c | 9 +++++---- arch/powerpc/kvm/book3s_hv_nested.c | 16 ++++++++-------- arch/powerpc/kvm/book3s_rtas.c | 4 ++-- arch/powerpc/kvm/powerpc.c | 4 ++-- arch/riscv/kvm/vcpu.c | 16 ++++++++-------- arch/riscv/kvm/vcpu_exit.c | 4 ++-- arch/s390/kvm/interrupt.c | 4 ++-- arch/s390/kvm/kvm-s390.c | 8 ++++---- arch/s390/kvm/vsie.c | 4 ++-- arch/x86/kvm/x86.c | 28 +++++++++++++--------------- include/linux/kvm_host.h | 24 +++++++++++++++++++++++- 11 files changed, 71 insertions(+), 50 deletions(-) commit fdd6f6ac2e489b9b256cd05a880d13bfdbac7c2e Author: Sean Christopherson Date: Fri Apr 15 00:43:42 2022 +0000 KVM: RISC-V: Use kvm_vcpu.srcu_idx, drop RISC-V's unnecessary copy Use the generic kvm_vcpu's srcu_idx instead of using an indentical field in RISC-V's version of kvm_vcpu_arch. Generic KVM very intentionally does not touch vcpu->srcu_idx, i.e. there's zero chance of running afoul of common code. Signed-off-by: Sean Christopherson Message-Id: <20220415004343.2203171-3-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/riscv/include/asm/kvm_host.h | 3 --- arch/riscv/kvm/vcpu.c | 16 ++++++++-------- arch/riscv/kvm/vcpu_exit.c | 4 ++-- 3 files changed, 10 insertions(+), 13 deletions(-) commit 2d08935682ac5f6bfb70f7e6844ec27d4a245fa4 Author: Sean Christopherson Date: Fri Apr 15 00:43:41 2022 +0000 KVM: x86: Don't re-acquire SRCU lock in complete_emulated_io() Don't re-acquire SRCU in complete_emulated_io() now that KVM acquires the lock in kvm_arch_vcpu_ioctl_run(). More importantly, don't overwrite vcpu->srcu_idx. If the index acquired by complete_emulated_io() differs from the one acquired by kvm_arch_vcpu_ioctl_run(), KVM will effectively leak a lock and hang if/when synchronize_srcu() is invoked for the relevant grace period. Fixes: 8d25b7beca7e ("KVM: x86: pull kvm->srcu read-side to kvm_arch_vcpu_ioctl_run") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20220415004343.2203171-2-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/x86.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) commit ab7aa2866d295438dc60522f85c5421c6b4f1507 Author: Sven Peter Date: Mon Apr 11 17:53:00 2022 +0200 usb: dwc3: Try usb-role-switch first in dwc3_drd_init If the PHY controller node has a "port" dwc3 tries to find an extcon device even when "usb-role-switch" is present. This happens because dwc3_get_extcon() sees that "port" node and then calls extcon_find_edev_by_node() which will always return EPROBE_DEFER in that case. On the other hand, even if an extcon was present and dwc3_get_extcon() was successful it would still be ignored in favor of "usb-role-switch". Let's just first check if "usb-role-switch" is configured in the device tree and directly use it instead and only try to look for an extcon device otherwise. Fixes: 8a0a13799744 ("usb: dwc3: Registering a role switch in the DRD code.") Cc: stable Signed-off-by: Sven Peter Link: https://lore.kernel.org/r/20220411155300.9766-1-sven@svenpeter.dev Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/drd.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit f28ad9069363dec7deb88032b70612755eed9ee6 Author: Thinh Nguyen Date: Mon Apr 11 18:33:47 2022 -0700 usb: dwc3: core: Fix tx/rx threshold settings The current driver logic checks against 0 to determine whether the periodic tx/rx threshold settings are set, but we may get bogus values from uninitialized variables if no device property is set. Properly default these variables to 0. Fixes: 938a5ad1d305 ("usb: dwc3: Check for ESS TX/RX threshold config") Cc: Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/cccfce990b11b730b0dae42f9d217dc6fb988c90.1649727139.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 456244aeecd54249096362a173dfe06b82a5cafa Author: Macpaul Lin Date: Tue Apr 19 16:12:45 2022 +0800 usb: mtu3: fix USB 3.0 dual-role-switch from device to host Issue description: When an OTG port has been switched to device role and then switch back to host role again, the USB 3.0 Host (XHCI) will not be able to detect "plug in event of a connected USB 2.0/1.0 ((Highspeed and Fullspeed) devices until system reboot. Root cause and Solution: There is a condition checking flag "ssusb->otg_switch.is_u3_drd" in toggle_opstate(). At the end of role switch procedure, toggle_opstate() will be called to set DC_SESSION and SOFT_CONN bit. If "is_u3_drd" was set and switched the role to USB host 3.0, bit DC_SESSION and SOFT_CONN will be skipped hence caused the port cannot detect connected USB 2.0 (Highspeed and Fullspeed) devices. Simply remove the condition check to solve this issue. Fixes: d0ed062a8b75 ("usb: mtu3: dual-role mode support") Cc: stable@vger.kernel.org Tested-by: Fabien Parent Reviewed-by: Chunfeng Yun Signed-off-by: Macpaul Lin Signed-off-by: Tainping Fang Link: https://lore.kernel.org/r/20220419081245.21015-1-macpaul.lin@mediatek.com Signed-off-by: Greg Kroah-Hartman drivers/usb/mtu3/mtu3_dr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit d8bfe5091d6cc4b8b8395e4666979ae72a6069ca Author: Evan Green Date: Fri Apr 8 11:42:50 2022 -0700 xhci: Enable runtime PM on second Alderlake controller Alderlake has two XHCI controllers with PCI IDs 0x461e and 0x51ed. We had previously added the quirk to default enable runtime PM for 0x461e, now add it for 0x51ed as well. Signed-off-by: Evan Green Cc: stable Link: https://lore.kernel.org/r/20220408114225.1.Ibcff6b86ed4eacfe4c4bc89c90e18416f3900a3e@changeid Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 4e64cd7763ca52dce5dff2c88f67a200f3aa37d3 Author: Peter Geis Date: Sat Apr 9 11:21:15 2022 -0400 usb: dwc3: fix backwards compat with rockchip devices Commit 33fb697ec7e5 ("usb: dwc3: Get clocks individually") moved from the clk_bulk api to individual clocks, following the snps,dwc3.yaml dt-binding for clock names. Unfortunately the rk3328 (and upcoming rk356x support) use the rockchip,dwc3.yaml which has different clock names, which are common on devices using the glue layer. The rk3328 does not use a glue layer, but attaches directly to the dwc3 core driver. The offending patch series failed to account for this, thus dwc3 was broken on rk3328. To retain backwards compatibility with rk3328 device trees we must also check for the alternate clock names. Fixes: 33fb697ec7e5 ("usb: dwc3: Get clocks individually") Reported-by: Frank Wunderlich Tested-By: Frank Wunderlich Reviewed-by: Heiko Stuebner Acked-by: Sean Anderson Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220409152116.3834354-1-pgwipeout@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/core.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) commit 0cade7885fd5bc47039986b632f3e5585f6b7c22 Author: Krzysztof Kozlowski Date: Thu Apr 7 21:23:38 2022 +0200 dt-bindings: usb: samsung,exynos-usb2: add missing required reg "reg" property is required on Samsung S5PV210/Exynos EHCI/OHCI controllers. Fixes: 4bf2283cb208 ("dt-bindings: usb: samsung,exynos-usb2: convert to dtschema") Reviewed-by: Alim Akhtar Acked-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220407192338.14849-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman Documentation/devicetree/bindings/usb/samsung,exynos-usb2.yaml | 1 + 1 file changed, 1 insertion(+) commit 0a96fa640dc928da9eaa46a22c46521b037b78ad Author: Hangyu Hua Date: Thu Apr 7 10:40:01 2022 +0800 usb: misc: fix improper handling of refcount in uss720_probe() usb_put_dev shouldn't be called when uss720_probe succeeds because of priv->usbdev. At the same time, priv->usbdev shouldn't be set to NULL before destroy_priv in uss720_disconnect because usb_put_dev is in destroy_priv. Fix this by moving priv->usbdev = NULL after usb_put_dev. Fixes: dcb4b8ad6a44 ("misc/uss720: fix memory leak in uss720_probe") Cc: stable Reviewed-by: Dongliang Mu Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20220407024001.11761-1-hbh25y@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/misc/uss720.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit f085bd4bfe0907ce2fad2c787fc65871ec5ca6d6 Author: Weitao Wango Date: Thu Mar 24 20:17:35 2022 +0800 USB: Fix ehci infinite suspend-resume loop issue in zhaoxin In zhaoxin platform, some ehci projects will latch a wakeup signal internal when plug in a device on port during system S0. This wakeup signal will turn on when ehci runtime suspend, which will trigger a system control interrupt that will resume ehci back to D0. As no device connect, ehci will be set to runtime suspend and turn on the internal latched wakeup signal again. It will cause a suspend-resume loop and generate system control interrupt continuously. Fixed this issue by clear wakeup signal latched in ehci internal when ehci resume callback is called. Acked-by: Alan Stern Signed-off-by: Weitao Wang Link: https://lore.kernel.org/r/20220324121735.3803-1-WeitaoWang-oc@zhaoxin.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/ehci-hcd.c | 23 +++++++++++++++++++++++ drivers/usb/host/ehci-pci.c | 4 ++++ drivers/usb/host/ehci.h | 1 + 3 files changed, 28 insertions(+) commit 8d084b2eae7fc5fcfc9f143cd7321a88e1cd76aa Author: Borislav Petkov Date: Tue Apr 5 17:15:13 2022 +0200 usb: typec: tcpm: Fix undefined behavior due to shift overflowing the constant Fix: drivers/usb/typec/tcpm/tcpm.c: In function ‘run_state_machine’: drivers/usb/typec/tcpm/tcpm.c:4724:3: error: case label does not reduce to an integer constant case BDO_MODE_TESTDATA: ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Signed-off-by: Borislav Petkov Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Link: https://lore.kernel.org/r/20220405151517.29753-8-bp@alien8.de Signed-off-by: Greg Kroah-Hartman include/linux/usb/pd_bdo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9e3d68f872e4f5ce40dcc5baba7e37ab7961ed74 Author: Ren Zhijie Date: Mon Apr 18 16:24:25 2022 +0800 usb: typec: rt1719: Fix build error without CONFIG_POWER_SUPPLY Building without CONFIG_POWER_SUPPLY will fail: drivers/usb/typec/rt1719.o: In function `rt1719_psy_set_property': rt1719.c:(.text+0x10a): undefined reference to `power_supply_get_drvdata' drivers/usb/typec/rt1719.o: In function `rt1719_psy_get_property': rt1719.c:(.text+0x2c8): undefined reference to `power_supply_get_drvdata' drivers/usb/typec/rt1719.o: In function `devm_rt1719_psy_register': rt1719.c:(.text+0x3e9): undefined reference to `devm_power_supply_register' drivers/usb/typec/rt1719.o: In function `rt1719_irq_handler': rt1719.c:(.text+0xf9f): undefined reference to `power_supply_changed' drivers/usb/typec/rt1719.o: In function `rt1719_update_pwr_opmode.part.9': rt1719.c:(.text+0x657): undefined reference to `power_supply_changed' drivers/usb/typec/rt1719.o: In function `rt1719_attach': rt1719.c:(.text+0x83e): undefined reference to `power_supply_changed' Add POWER_SUPPLY dependency to Kconfig. Fixes: 25d29b980912 ("usb: typec: rt1719: Add support for Richtek RT1719") Reported-by: Hulk Robot Reviewed-by: ChiYuan Huang Reviewed-by: Heikki Krogerus Signed-off-by: Ren Zhijie Link: https://lore.kernel.org/r/20220418082425.41566-1-renzhijie2@huawei.com Signed-off-by: Greg Kroah-Hartman drivers/usb/typec/Kconfig | 1 + 1 file changed, 1 insertion(+) commit eb5d7ff3cf0d55093c619b5ad107cd5c05ce8134 Author: Heikki Krogerus Date: Tue Apr 5 16:48:24 2022 +0300 usb: typec: ucsi: Fix role swapping All attempts to swap the roles timed out because the completion was done without releasing the port lock. Fixing that by releasing the lock before starting to wait for the completion. Link: https://lore.kernel.org/linux-usb/037de7ac-e210-bdf5-ec7a-8c0c88a0be20@gmail.com/ Fixes: ad74b8649bea ("usb: typec: ucsi: Preliminary support for alternate modes") Cc: stable@vger.kernel.org Reported-and-tested-by: Jia-Ju Bai Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220405134824.68067-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/typec/ucsi/ucsi.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) commit e25adcca917d7e4cdc1dc6444d0692ffda7594bf Author: Heikki Krogerus Date: Tue Apr 5 16:48:23 2022 +0300 usb: typec: ucsi: Fix reuse of completion structure The role swapping completion variable is reused, so it needs to be reinitialised every time. Otherwise it will be marked as done after the first time it's used and completing immediately. Link: https://lore.kernel.org/linux-usb/20220325203959.GA19752@jackp-linux.qualcomm.com/ Fixes: 6df475f804e6 ("usb: typec: ucsi: Start using struct typec_operations") Cc: stable@vger.kernel.org Reported-and-suggested-by: Jack Pham Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220405134824.68067-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/typec/ucsi/ucsi.c | 4 ++++ 1 file changed, 4 insertions(+) commit 8771039482d965bdc8cefd972bcabac2b76944a8 Author: zhangqilong Date: Sat Mar 19 10:38:22 2022 +0800 usb: xhci: tegra:Fix PM usage reference leak of tegra_xusb_unpowergate_partitions pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Fixes: 41a7426d25fa ("usb: xhci: tegra: Unlink power domain devices") Cc: stable Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220319023822.145641-1-zhangqilong3@huawei.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-tegra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 012c722569f171d58169606908ebbb8713f1609e Merge: b2d229d4ddb1 38d9a4ac65f2 Author: Paolo Bonzini Date: Thu Apr 21 11:58:57 2022 -0400 Merge tag 'kvm-riscv-fixes-5.18-2' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv fixes for 5.18, take #2 - Remove 's' & 'u' as valid ISA extension - Do not allow disabling the base extensions 'i'/'m'/'a'/'c' commit 0014edaedfd804dbf35b009808789325ca615716 Author: Christian Brauner Date: Wed Apr 20 15:19:25 2022 +0200 fs: unset MNT_WRITE_HOLD on failure After mnt_hold_writers() has been called we will always have set MNT_WRITE_HOLD and consequently we always need to pair mnt_hold_writers() with mnt_unhold_writers(). After the recent cleanup in [1] where Al switched from a do-while to a for loop the cleanup currently fails to unset MNT_WRITE_HOLD for the first mount that was changed. Fix this and make sure that the first mount will be cleaned up and add some comments to make it more obvious. Link: https://lore.kernel.org/lkml/0000000000007cc21d05dd0432b8@google.com Link: https://lore.kernel.org/lkml/00000000000080e10e05dd043247@google.com Link: https://lore.kernel.org/r/20220420131925.2464685-1-brauner@kernel.org Fixes: e257039f0fc7 ("mount_setattr(): clean the control flow and calling conventions") [1] Cc: Hillf Danton Cc: Christoph Hellwig Cc: Al Viro Reported-by: syzbot+10a16d1c43580983f6a2@syzkaller.appspotmail.com Reported-by: syzbot+306090cfa3294f0bbfb3@syzkaller.appspotmail.com Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner (Microsoft) fs/namespace.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit 846e24dcae5d5d513408b66f7853a93ab2280735 Merge: 90f21460e49a 46ff3df87215 Author: Arnd Bergmann Date: Thu Apr 21 17:01:06 2022 +0200 Merge tag 'omap-for-v5.18/fixes-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Fixes for omaps Few regression fixes for omap variants. These mostly fix issues related to warnings added for system suspend, and some devicetree issues: - Make ti-sysc driver quirks for gpt12 timer omap3 specific to fix timer clock disabling for am335x system suspend - Fix new system suspend warning for dra7 vpe caused by trying to use register bits not wired for vpe - Fix mmc boot order for omap3-gta04 that has no mmc2 or 3 wired - Add missing touchscreen properties for am3 - Fix pin muxing for logicpd-som-lv and am3517-evm to not depend on earlier bootloader versions - Fix refcount leak for omap_gic_of_init * tag 'omap-for-v5.18/fixes-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: logicpd-som-lv: Fix wrong pinmuxing on OMAP35 ARM: dts: am3517-evm: Fix misc pinmuxing ARM: dts: am33xx-l4: Add missing touchscreen clock properties ARM: dts: Fix mmc order for omap3-gta04 ARM: dts: dra7: Fix suspend warning for vpe powerdomain bus: ti-sysc: Make omap3 gpt12 quirk handling SoC specific ARM: OMAP2+: Fix refcount leak in omap_gic_of_init iommu/omap: Fix regression in probe for NULL pointer dereference Link: https://lore.kernel.org/r/pull-1650543308-836725@atomide.com Signed-off-by: Arnd Bergmann commit 90f21460e49ad60caabece95cc0ca14d9d6d099d Author: Krzysztof Kozlowski Date: Wed Apr 20 12:47:08 2022 +0200 MAINTAINERS: add Bug entry for Samsung and memory controller drivers Add a Bug sections, indicating preferred mailing method for bug reports, to Samsung SoC related entries and memory controller drivers. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220420104708.106738-1-krzysztof.kozlowski@linaro.org' Signed-off-by: Arnd Bergmann MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) commit 7e842d70fe599bc13594b650b2144c4b6e6d6bf1 Author: Geert Uytterhoeven Date: Wed Apr 20 09:05:26 2022 +0200 memory: renesas-rpc-if: Fix HF/OSPI data transfer in Manual Mode HyperFlash devices fail to probe: rpc-if-hyperflash rpc-if-hyperflash: probing of hyperbus device failed In HyperFlash or Octal-SPI Flash mode, the Transfer Data Enable bits (SPIDE) in the Manual Mode Enable Setting Register (SMENR) are derived from half of the transfer size, cfr. the rpcif_bits_set() helper function. However, rpcif_reg_{read,write}() does not take the bus size into account, and does not double all Manual Mode Data Register access sizes when communicating with a HyperFlash or Octal-SPI Flash device. Fix this, and avoid the back-and-forth conversion between transfer size and Transfer Data Enable bits, by explicitly storing the transfer size in struct rpcif, and using that value to determine access size in rpcif_reg_{read,write}(). Enforce that the "high" Manual Mode Read/Write Data Registers (SM[RW]DR1) are only used for 8-byte data accesses. While at it, forbid writing to the Manual Mode Read Data Registers, as they are read-only. Fixes: fff53a551db50f5e ("memory: renesas-rpc-if: Correct QSPI data transfer in Manual mode") Signed-off-by: Geert Uytterhoeven Signed-off-by: Krzysztof Kozlowski Tested-by: Lad Prabhakar Tested-by: Wolfram Sang Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/cde9bfacf704c81865f57b15d1b48a4793da4286.1649681476.git.geert+renesas@glider.be Link: https://lore.kernel.org/r/20220420070526.9367-1-krzysztof.kozlowski@linaro.org' Signed-off-by: Arnd Bergmann drivers/memory/renesas-rpc-if.c | 60 +++++++++++++++++++++++++++++++---------- include/memory/renesas-rpc-if.h | 1 + 2 files changed, 47 insertions(+), 14 deletions(-) commit e74200ebf7c4f6a7a7d1be9f63833ddba251effa Author: Marek Vasut Date: Fri Apr 15 23:54:10 2022 +0200 pinctrl: stm32: Do not call stm32_gpio_get() for edge triggered IRQs in EOI The stm32_gpio_get() should only be called for LEVEL triggered interrupts, skip calling it for EDGE triggered interrupts altogether to avoid wasting CPU cycles in EOI handler. On this platform, EDGE triggered interrupts are the majority and LEVEL triggered interrupts are the exception no less, and the CPU cycles are not abundant. Fixes: 47beed513a85b ("pinctrl: stm32: Add level interrupt support to gpio irq chip") Signed-off-by: Marek Vasut Cc: Alexandre Torgue Cc: Fabien Dessenne Cc: Linus Walleij Cc: Marc Zyngier Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org To: linux-gpio@vger.kernel.org Link: https://lore.kernel.org/r/20220415215410.498349-1-marex@denx.de Signed-off-by: Linus Walleij drivers/pinctrl/stm32/pinctrl-stm32.c | 4 ++++ 1 file changed, 4 insertions(+) commit 08b7cf134eafca3b38e818d934b00dfe6b5b0fb4 Author: Wells Lu Date: Fri Apr 15 17:41:28 2022 +0800 pinctrl: Fix an error in pin-function table of SP7021 The first valid item of pin-function table should start from the third item. The first two items, due to historical and compatible reasons, should be dummy items. The two dummy items were removed accidentally in initial submission. This fix adds them back. Signed-off-by: Wells Lu Link: https://lore.kernel.org/r/1650015688-19774-1-git-send-email-wellslutw@gmail.com Signed-off-by: Linus Walleij drivers/pinctrl/sunplus/sppctl_sp7021.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 5f0addf7b89085f8e0a2593faa419d6111612b9b Author: Naohiro Aota Date: Mon Apr 18 16:15:03 2022 +0900 btrfs: zoned: use dedicated lock for data relocation Currently, we use btrfs_inode_{lock,unlock}() to grant an exclusive writeback of the relocation data inode in btrfs_zoned_data_reloc_{lock,unlock}(). However, that can cause a deadlock in the following path. Thread A takes btrfs_inode_lock() and waits for metadata reservation by e.g, waiting for writeback: prealloc_file_extent_cluster() - btrfs_inode_lock(&inode->vfs_inode, 0); - btrfs_prealloc_file_range() ... - btrfs_replace_file_extents() - btrfs_start_transaction ... - btrfs_reserve_metadata_bytes() Thread B (e.g, doing a writeback work) needs to wait for the inode lock to continue writeback process: do_writepages - btrfs_writepages - extent_writpages - btrfs_zoned_data_reloc_lock(BTRFS_I(inode)); - btrfs_inode_lock() The deadlock is caused by relying on the vfs_inode's lock. By using it, we introduced unnecessary exclusion of writeback and btrfs_prealloc_file_range(). Also, the lock at this point is useless as we don't have any dirty pages in the inode yet. Introduce fs_info->zoned_data_reloc_io_lock and use it for the exclusive writeback. Fixes: 35156d852762 ("btrfs: zoned: only allow one process to add pages to a relocation inode") CC: stable@vger.kernel.org # 5.16.x: 869f4cdc73f9: btrfs: zoned: encapsulate inode locking for zoned relocation CC: stable@vger.kernel.org # 5.16.x CC: stable@vger.kernel.org # 5.17 Cc: Johannes Thumshirn Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba fs/btrfs/ctree.h | 1 + fs/btrfs/disk-io.c | 1 + fs/btrfs/zoned.h | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) commit a692e13d87cb6d0193387aac55cfcc947077c20b Author: Filipe Manana Date: Tue Apr 19 14:23:57 2022 +0100 btrfs: fix assertion failure during scrub due to block group reallocation During a scrub, or device replace, we can race with block group removal and allocation and trigger the following assertion failure: [7526.385524] assertion failed: cache->start == chunk_offset, in fs/btrfs/scrub.c:3817 [7526.387351] ------------[ cut here ]------------ [7526.387373] kernel BUG at fs/btrfs/ctree.h:3599! [7526.388001] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI [7526.388970] CPU: 2 PID: 1158150 Comm: btrfs Not tainted 5.17.0-rc8-btrfs-next-114 #4 [7526.390279] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [7526.392430] RIP: 0010:assertfail.constprop.0+0x18/0x1a [btrfs] [7526.393520] Code: f3 48 c7 c7 20 (...) [7526.396926] RSP: 0018:ffffb9154176bc40 EFLAGS: 00010246 [7526.397690] RAX: 0000000000000048 RBX: ffffa0db8a910000 RCX: 0000000000000000 [7526.398732] RDX: 0000000000000000 RSI: ffffffff9d7239a2 RDI: 00000000ffffffff [7526.399766] RBP: ffffa0db8a911e10 R08: ffffffffa71a3ca0 R09: 0000000000000001 [7526.400793] R10: 0000000000000001 R11: 0000000000000000 R12: ffffa0db4b170800 [7526.401839] R13: 00000003494b0000 R14: ffffa0db7c55b488 R15: ffffa0db8b19a000 [7526.402874] FS: 00007f6c99c40640(0000) GS:ffffa0de6d200000(0000) knlGS:0000000000000000 [7526.404038] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [7526.405040] CR2: 00007f31b0882160 CR3: 000000014b38c004 CR4: 0000000000370ee0 [7526.406112] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [7526.407148] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [7526.408169] Call Trace: [7526.408529] [7526.408839] scrub_enumerate_chunks.cold+0x11/0x79 [btrfs] [7526.409690] ? do_wait_intr_irq+0xb0/0xb0 [7526.410276] btrfs_scrub_dev+0x226/0x620 [btrfs] [7526.410995] ? preempt_count_add+0x49/0xa0 [7526.411592] btrfs_ioctl+0x1ab5/0x36d0 [btrfs] [7526.412278] ? __fget_files+0xc9/0x1b0 [7526.412825] ? kvm_sched_clock_read+0x14/0x40 [7526.413459] ? lock_release+0x155/0x4a0 [7526.414022] ? __x64_sys_ioctl+0x83/0xb0 [7526.414601] __x64_sys_ioctl+0x83/0xb0 [7526.415150] do_syscall_64+0x3b/0xc0 [7526.415675] entry_SYSCALL_64_after_hwframe+0x44/0xae [7526.416408] RIP: 0033:0x7f6c99d34397 [7526.416931] Code: 3c 1c e8 1c ff (...) [7526.419641] RSP: 002b:00007f6c99c3fca8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [7526.420735] RAX: ffffffffffffffda RBX: 00005624e1e007b0 RCX: 00007f6c99d34397 [7526.421779] RDX: 00005624e1e007b0 RSI: 00000000c400941b RDI: 0000000000000003 [7526.422820] RBP: 0000000000000000 R08: 00007f6c99c40640 R09: 0000000000000000 [7526.423906] R10: 00007f6c99c40640 R11: 0000000000000246 R12: 00007fff746755de [7526.424924] R13: 00007fff746755df R14: 0000000000000000 R15: 00007f6c99c40640 [7526.425950] That assertion is relatively new, introduced with commit d04fbe19aefd2 ("btrfs: scrub: cleanup the argument list of scrub_chunk()"). The block group we get at scrub_enumerate_chunks() can actually have a start address that is smaller then the chunk offset we extracted from a device extent item we got from the commit root of the device tree. This is very rare, but it can happen due to a race with block group removal and allocation. For example, the following steps show how this can happen: 1) We are at transaction T, and we have the following blocks groups, sorted by their logical start address: [ bg A, start address A, length 1G (data) ] [ bg B, start address B, length 1G (data) ] (...) [ bg W, start address W, length 1G (data) ] --> logical address space hole of 256M, there used to be a 256M metadata block group here [ bg Y, start address Y, length 256M (metadata) ] --> Y matches W's end offset + 256M Block group Y is the block group with the highest logical address in the whole filesystem; 2) Block group Y is deleted and its extent mapping is removed by the call to remove_extent_mapping() made from btrfs_remove_block_group(). So after this point, the last element of the mapping red black tree, its rightmost node, is the mapping for block group W; 3) While still at transaction T, a new data block group is allocated, with a length of 1G. When creating the block group we do a call to find_next_chunk(), which returns the logical start address for the new block group. This calls returns X, which corresponds to the end offset of the last block group, the rightmost node in the mapping red black tree (fs_info->mapping_tree), plus one. So we get a new block group that starts at logical address X and with a length of 1G. It spans over the whole logical range of the old block group Y, that was previously removed in the same transaction. However the device extent allocated to block group X is not the same device extent that was used by block group Y, and it also does not overlap that extent, which must be always the case because we allocate extents by searching through the commit root of the device tree (otherwise it could corrupt a filesystem after a power failure or an unclean shutdown in general), so the extent allocator is behaving as expected; 4) We have a task running scrub, currently at scrub_enumerate_chunks(). There it searches for device extent items in the device tree, using its commit root. It finds a device extent item that was used by block group Y, and it extracts the value Y from that item into the local variable 'chunk_offset', using btrfs_dev_extent_chunk_offset(); It then calls btrfs_lookup_block_group() to find block group for the logical address Y - since there's currently no block group that starts at that logical address, it returns block group X, because its range contains Y. This results in triggering the assertion: ASSERT(cache->start == chunk_offset); right before calling scrub_chunk(), as cache->start is X and chunk_offset is Y. This is more likely to happen of filesystems not larger than 50G, because for these filesystems we use a 256M size for metadata block groups and a 1G size for data block groups, while for filesystems larger than 50G, we use a 1G size for both data and metadata block groups (except for zoned filesystems). It could also happen on any filesystem size due to the fact that system block groups are always smaller (32M) than both data and metadata block groups, but these are not frequently deleted, so much less likely to trigger the race. So make scrub skip any block group with a start offset that is less than the value we expect, as that means it's a new block group that was created in the current transaction. It's pointless to continue and try to scrub its extents, because scrub searches for extents using the commit root, so it won't find any. For a device replace, skip it as well for the same reasons, and we don't need to worry about the possibility of extents of the new block group not being to the new device, because we have the write duplication setup done through btrfs_map_block(). Fixes: d04fbe19aefd ("btrfs: scrub: cleanup the argument list of scrub_chunk()") CC: stable@vger.kernel.org # 5.17 Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/dev-replace.c | 7 ++++++- fs/btrfs/scrub.c | 26 +++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) commit 12131008fc13ff7f7690d170b7a8f72d24fd7d1e Author: Mark Brown Date: Thu Apr 21 13:38:03 2022 +0100 ASoC: meson: Fix event generation for G12A tohdmi mux The G12A tohdmi has a custom put() operation which returns 0 when the value of the mux changes, meaning that events are not generated for userspace. Change to return 1 in this case, the function returns early in the case where there is no change. Signed-off-by: Mark Brown Reviewed-by: Jerome Brunet Link: https://lore.kernel.org/r/20220421123803.292063-4-broonie@kernel.org Signed-off-by: Mark Brown Cc: stable@vger.kernel.org sound/soc/meson/g12a-tohdmitx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fce49921a22262736cdc3cc74fa67915b75e9363 Author: Mark Brown Date: Thu Apr 21 13:38:02 2022 +0100 ASoC: meson: Fix event generation for AUI CODEC mux The AIU CODEC has a custom put() operation which returns 0 when the value of the mux changes, meaning that events are not generated for userspace. Change to return 1 in this case, the function returns early in the case where there is no change. Signed-off-by: Mark Brown Reviewed-by: Jerome Brunet Link: https://lore.kernel.org/r/20220421123803.292063-3-broonie@kernel.org Signed-off-by: Mark Brown Cc: stable@vger.kernel.org sound/soc/meson/aiu-codec-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2e3a0d1bfa95b54333f7add3e50e288769373873 Author: Mark Brown Date: Thu Apr 21 13:38:01 2022 +0100 ASoC: meson: Fix event generation for AUI ACODEC mux The AIU ACODEC has a custom put() operation which returns 0 when the value of the mux changes, meaning that events are not generated for userspace. Change to return 1 in this case, the function returns early in the case where there is no change. Signed-off-by: Mark Brown Reviewed-by: Jerome Brunet Link: https://lore.kernel.org/r/20220421123803.292063-2-broonie@kernel.org Signed-off-by: Mark Brown Cc: stable@vger.kernel.org sound/soc/meson/aiu-acodec-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bb82c574691daf8f7fa9a160264d15c5804cb769 Author: Alexey Kardashevskiy Date: Thu Apr 21 12:57:56 2022 +1000 powerpc/perf: Fix 32bit compile The "read_bhrb" global symbol is only called under CONFIG_PPC64 of arch/powerpc/perf/core-book3s.c but it is compiled for both 32 and 64 bit anyway (and LLVM fails to link this on 32bit). This fixes it by moving bhrb.o to obj64 targets. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220421025756.571995-1-aik@ozlabs.ru arch/powerpc/perf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c6cc9a852f123301d5271f1484df8e961b2b64f1 Author: Athira Rajeev Date: Tue Apr 19 17:18:28 2022 +0530 powerpc/perf: Fix power10 event alternatives When scheduling a group of events, there are constraint checks done to make sure all events can go in a group. Example, one of the criteria is that events in a group cannot use the same PMC. But platform specific PMU supports alternative event for some of the event codes. During perf_event_open(), if any event group doesn't match constraint check criteria, further lookup is done to find alternative event. By current design, the array of alternatives events in PMU code is expected to be sorted by column 0. This is because in find_alternative() the return criteria is based on event code comparison. ie. "event < ev_alt[i][0])". This optimisation is there since find_alternative() can be called multiple times. In power10 PMU code, the alternative event array is not sorted properly and hence there is breakage in finding alternative event. To work with existing logic, fix the alternative event array to be sorted by column 0 for power10-pmu.c Results: In case where an alternative event is not chosen when we could, events will be multiplexed. ie, time sliced where it could actually run concurrently. Example, in power10 PM_INST_CMPL_ALT(0x00002) has alternative event, PM_INST_CMPL(0x500fa). Without the fix, if a group of events with PMC1 to PMC4 is used along with PM_INST_CMPL_ALT, it will be time sliced since all programmable PMC's are consumed already. But with the fix, when it picks alternative event on PMC5, all events will run concurrently. Before: # perf stat -e r00002,r100fc,r200fa,r300fc,r400fc Performance counter stats for 'system wide': 328668935 r00002 (79.94%) 56501024 r100fc (79.95%) 49564238 r200fa (79.95%) 376 r300fc (80.19%) 660 r400fc (79.97%) 4.039150522 seconds time elapsed With the fix, since alternative event is chosen to run on PMC6, events will be run concurrently. After: # perf stat -e r00002,r100fc,r200fa,r300fc,r400fc Performance counter stats for 'system wide': 23596607 r00002 4907738 r100fc 2283608 r200fa 135 r300fc 248 r400fc 1.664671390 seconds time elapsed Fixes: a64e697cef23 ("powerpc/perf: power10 Performance Monitoring support") Signed-off-by: Athira Rajeev Reviewed-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220419114828.89843-2-atrajeev@linux.vnet.ibm.com arch/powerpc/perf/power10-pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0dcad700bb2776e3886fe0a645a4bf13b1e747cd Author: Athira Rajeev Date: Tue Apr 19 17:18:27 2022 +0530 powerpc/perf: Fix power9 event alternatives When scheduling a group of events, there are constraint checks done to make sure all events can go in a group. Example, one of the criteria is that events in a group cannot use the same PMC. But platform specific PMU supports alternative event for some of the event codes. During perf_event_open(), if any event group doesn't match constraint check criteria, further lookup is done to find alternative event. By current design, the array of alternatives events in PMU code is expected to be sorted by column 0. This is because in find_alternative() the return criteria is based on event code comparison. ie. "event < ev_alt[i][0])". This optimisation is there since find_alternative() can be called multiple times. In power9 PMU code, the alternative event array is not sorted properly and hence there is breakage in finding alternative events. To work with existing logic, fix the alternative event array to be sorted by column 0 for power9-pmu.c Results: With alternative events, multiplexing can be avoided. That is, for example, in power9 PM_LD_MISS_L1 (0x3e054) has alternative event, PM_LD_MISS_L1_ALT (0x400f0). This is an identical event which can be programmed in a different PMC. Before: # perf stat -e r3e054,r300fc Performance counter stats for 'system wide': 1057860 r3e054 (50.21%) 379 r300fc (49.79%) 0.944329741 seconds time elapsed Since both the events are using PMC3 in this case, they are multiplexed here. After: # perf stat -e r3e054,r300fc Performance counter stats for 'system wide': 1006948 r3e054 182 r300fc Fixes: 91e0bd1e6251 ("powerpc/perf: Add PM_LD_MISS_L1 and PM_BR_2PATH to power9 event list") Signed-off-by: Athira Rajeev Reviewed-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220419114828.89843-1-atrajeev@linux.vnet.ibm.com arch/powerpc/perf/power9-pmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 94f4c4965e5513ba624488f4b601d6b385635aec Author: Christian König Date: Fri Apr 8 16:22:55 2022 +0200 drm/amdgpu: partial revert "remove ctx->lock" v2 This reverts commit 461fa7b0ac565ef25c1da0ced31005dd437883a7. We are missing some inter dependencies here so re-introduce the lock until we have figured out what's missing. Just drop/retake it while adding dependencies. v2: still drop the lock while adding dependencies Signed-off-by: Christian König Tested-by: Mikhail Gavrilov (v1) Fixes: 461fa7b0ac56 ("drm/amdgpu: remove ctx->lock") Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220419110633.166236-1-christian.koenig@amd.com drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 21 +++++++++++++++------ drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) commit bc6de2878429e85c1f1afaa566f7b5abb2243eef Author: Duoming Zhou Date: Sun Apr 17 20:55:19 2022 +0800 drivers: net: hippi: Fix deadlock in rr_close() There is a deadlock in rr_close(), which is shown below: (Thread 1) | (Thread 2) | rr_open() rr_close() | add_timer() spin_lock_irqsave() //(1) | (wait a time) ... | rr_timer() del_timer_sync() | spin_lock_irqsave() //(2) (wait timer to stop) | ... We hold rrpriv->lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need rrpriv->lock in position (2) of thread 2. As a result, rr_close() will block forever. This patch extracts del_timer_sync() from the protection of spin_lock_irqsave(), which could let timer handler to obtain the needed lock. Signed-off-by: Duoming Zhou Link: https://lore.kernel.org/r/20220417125519.82618-1-duoming@zju.edu.cn Signed-off-by: Paolo Abeni drivers/net/hippi/rrunner.c | 2 ++ 1 file changed, 2 insertions(+) commit e23e50e7acc8d8f16498e9c129db33e6a00e80eb Author: Kees Cook Date: Wed Apr 20 17:12:34 2022 -0700 USB: serial: whiteheat: fix heap overflow in WHITEHEAT_GET_DTR_RTS The sizeof(struct whitehat_dr_info) can be 4 bytes under CONFIG_AEABI=n due to "-mabi=apcs-gnu", even though it has a single u8: whiteheat_private { __u8 mcr; /* 0 1 */ /* size: 4, cachelines: 1, members: 1 */ /* padding: 3 */ /* last cacheline: 4 bytes */ }; The result is technically harmless, as both the source and the destinations are currently the same allocation size (4 bytes) and don't use their padding, but if anything were to ever be added after the "mcr" member in "struct whiteheat_private", it would be overwritten. The structs both have a single u8 "mcr" member, but are 4 bytes in padded size. The memcpy() destination was explicitly targeting the u8 member (size 1) with the length of the whole structure (size 4), triggering the memcpy buffer overflow warning: 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/spinlock.h:62, from include/linux/mmzone.h:8, from include/linux/gfp.h:6, from include/linux/slab.h:15, from drivers/usb/serial/whiteheat.c:17: In function 'fortify_memcpy_chk', inlined from 'firm_send_command' at drivers/usb/serial/whiteheat.c:587:4: include/linux/fortify-string.h:328:25: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning] 328 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Instead, just assign the one byte directly. Reported-by: kernel test robot Link: https://lore.kernel.org/lkml/202204142318.vDqjjSFn-lkp@intel.com Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220421001234.2421107-1-keescook@chromium.org Signed-off-by: Johan Hovold drivers/usb/serial/whiteheat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit b3fbe53610b5ed8f0370ec4c7e6c8a1f261ddf70 Author: Andy Chi Date: Thu Apr 21 14:36:04 2022 +0800 ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on EliteBook 845/865 G9 On HP EliteBook 845 G9 and EliteBook 865 G9, the audio LEDs can be enabled by ALC285_FIXUP_HP_MUTE_LED. So use it accordingly. Signed-off-by: Andy Chi Fixes: 07bcab93946c ("ALSA: hda/realtek: Add support for HP Laptops") Link: https://lore.kernel.org/r/20220421063606.39772-1-andy.chi@canonical.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit ba7542eb2dd5dfc75c457198b88986642e602065 Author: Md Sadre Alam Date: Mon Apr 18 13:18:27 2022 +0530 mtd: rawnand: qcom: fix memory corruption that causes panic This patch fixes a memory corruption that occurred in the nand_scan() path for Hynix nand device. On boot, for Hynix nand device will panic at a weird place: | Unable to handle kernel NULL pointer dereference at virtual address 00000070 | [00000070] *pgd=00000000 | Internal error: Oops: 5 [#1] PREEMPT SMP ARM | Modules linked in: | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.17.0-01473-g13ae1769cfb0 #38 | Hardware name: Generic DT based system | PC is at nandc_set_reg+0x8/0x1c | LR is at qcom_nandc_command+0x20c/0x5d0 | pc : [] lr : [] psr: 00000113 | sp : c14adc50 ip : c14ee208 fp : c0cc970c | r10: 000000a3 r9 : 00000000 r8 : 00000040 | r7 : c16f6a00 r6 : 00000090 r5 : 00000004 r4 :c14ee040 | r3 : 00000000 r2 : 0000000b r1 : 00000000 r0 :c14ee040 | Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none | Control: 10c5387d Table: 8020406a DAC: 00000051 | Register r0 information: slab kmalloc-2k start c14ee000 pointer offset 64 size 2048 | Process swapper/0 (pid: 1, stack limit = 0x(ptrval)) | nandc_set_reg from qcom_nandc_command+0x20c/0x5d0 | qcom_nandc_command from nand_readid_op+0x198/0x1e8 | nand_readid_op from hynix_nand_has_valid_jedecid+0x30/0x78 | hynix_nand_has_valid_jedecid from hynix_nand_init+0xb8/0x454 | hynix_nand_init from nand_scan_with_ids+0xa30/0x14a8 | nand_scan_with_ids from qcom_nandc_probe+0x648/0x7b0 | qcom_nandc_probe from platform_probe+0x58/0xac The problem is that the nand_scan()'s qcom_nand_attach_chip callback is updating the nandc->max_cwperpage from 1 to 4 or 8 based on page size. This causes the sg_init_table of clear_bam_transaction() in the driver's qcom_nandc_command() to memset much more than what was initially allocated by alloc_bam_transaction(). This patch will update nandc->max_cwperpage 1 to 4 or 8 based on page size in qcom_nand_attach_chip call back after freeing the previously allocated memory for bam txn as per nandc->max_cwperpage = 1 and then again allocating bam txn as per nandc->max_cwperpage = 4 or 8 based on page size in qcom_nand_attach_chip call back itself. Cc: stable@vger.kernel.org Fixes: 6a3cec64f18c ("mtd: rawnand: qcom: convert driver to nand_scan()") Reported-by: Konrad Dybcio Reviewed-by: Manivannan Sadhasivam Co-developed-by: Sricharan R Signed-off-by: Sricharan R Signed-off-by: Md Sadre Alam Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1650268107-5363-1-git-send-email-quic_mdalam@quicinc.com drivers/mtd/nand/raw/qcom_nandc.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) commit 37c5f9e80e015d0df17d0c377c18523002986851 Author: Oleksandr Ocheretnyi Date: Sun Apr 17 11:46:47 2022 -0700 mtd: fix 'part' field data corruption in mtd_info Commit 46b5889cc2c5 ("mtd: implement proper partition handling") started using "mtd_get_master_ofs()" in mtd callbacks to determine memory offsets by means of 'part' field from mtd_info, what previously was smashed accessing 'master' field in the mtd_set_dev_defaults() method. That provides wrong offset what causes hardware access errors. Just make 'part', 'master' as separate fields, rather than using union type to avoid 'part' data corruption when mtd_set_dev_defaults() is called. Fixes: 46b5889cc2c5 ("mtd: implement proper partition handling") Signed-off-by: Oleksandr Ocheretnyi Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220417184649.449289-1-oocheret@cisco.com include/linux/mtd/mtd.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 084c16ab423a8890121b902b405823bfec5b4365 Author: Miaoqian Lin Date: Tue Apr 12 08:34:31 2022 +0000 mtd: rawnand: Fix return value check of wait_for_completion_timeout wait_for_completion_timeout() returns unsigned long not int. It returns 0 if timed out, and positive if completed. The check for <= 0 is ambiguous and should be == 0 here indicating timeout which is the only error case. Fixes: 83738d87e3a0 ("mtd: sh_flctl: Add DMA capabilty") Signed-off-by: Miaoqian Lin Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220412083435.29254-1-linmq006@gmail.com drivers/mtd/nand/raw/sh_flctl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) commit b089c0a9b14c354a0c3a421e09af3208cb7c232c Author: Bjorn Andersson Date: Wed Apr 20 16:12:30 2022 -0700 Revert "drm: of: Lookup if child node has panel or bridge" Commit '80253168dbfd ("drm: of: Lookup if child node has panel or bridge")' attempted to simplify the case of expressing a simple panel under a DSI controller, by assuming that the first non-graph child node was a panel or bridge. Unfortunately for non-trivial cases the first child node might not be a panel or bridge. Examples of this can be a aux-bus in the case of DisplayPort, or an opp-table represented before the panel node. In these cases the reverted commit prevents the caller from ever finding a reference to the panel. This reverts commit '80253168dbfd ("drm: of: Lookup if child node has panel or bridge")', in favor of using an explicit graph reference to the panel in the trivial case as well. Signed-off-by: Bjorn Andersson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220420231230.58499-2-bjorn.andersson@linaro.org drivers/gpu/drm/drm_of.c | 17 ----------------- 1 file changed, 17 deletions(-) commit 169466d4e59ca204683998b7f45673ebf0eb2de6 Author: Bjorn Andersson Date: Wed Apr 20 16:12:29 2022 -0700 Revert "drm: of: Properly try all possible cases for bridge/panel detection" Commit '80253168dbfd ("drm: of: Lookup if child node has panel or bridge")' introduced the ability to describe a panel under a display controller without having to use a graph to connect the controller to its single child panel (or bridge). The implementation of this would find the first non-graph node and attempt to acquire the related panel or bridge. This prevents cases where any other child node, such as a aux bus for a DisplayPort controller, or an opp-table to find the referenced panel. Commit '67bae5f28c89 ("drm: of: Properly try all possible cases for bridge/panel detection")' attempted to solve this problem by not bypassing the graph reference lookup before attempting to find the panel or bridge. While this does solve the case where a proper graph reference is present, it does not allow the caller to distinguish between a yet-to-be-probed panel or bridge and the absence of a reference to a panel. One such case is a DisplayPort controller that on some boards have an explicitly described reference to a panel, but on others have a discoverable DisplayPort display attached (which doesn't need to be expressed in DeviceTree). This reverts commit '67bae5f28c89 ("drm: of: Properly try all possible cases for bridge/panel detection")', as a step towards reverting commit '80253168dbfd ("drm: of: Lookup if child node has panel or bridge")'. Signed-off-by: Bjorn Andersson Acked-by: Paul Kocialkowski Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220420231230.58499-1-bjorn.andersson@linaro.org drivers/gpu/drm/drm_of.c | 99 ++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 50 deletions(-) commit 3d0b93d92a2790337aa9d18cb332d02356a24126 Author: Miaoqian Lin Date: Wed Apr 20 21:50:07 2022 +0800 drm/vc4: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() usage If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1. Also, we need to call pm_runtime_put_noidle() when pm_runtime_get_sync() fails, so use pm_runtime_resume_and_get() instead. this function will handle this. Fixes: 4078f5757144 ("drm/vc4: Add DSI driver") Signed-off-by: Miaoqian Lin Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220420135008.2757-1-linmq006@gmail.com drivers/gpu/drm/vc4/vc4_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 26a62b750a4e6364b0393562f66759b1494c3a01 Author: Alexey Kardashevskiy Date: Wed Apr 20 15:08:40 2022 +1000 KVM: PPC: Fix TCE handling for VFIO The LoPAPR spec defines a guest visible IOMMU with a variable page size. Currently QEMU advertises 4K, 64K, 2M, 16MB pages, a Linux VM picks the biggest (16MB). In the case of a passed though PCI device, there is a hardware IOMMU which does not support all pages sizes from the above - P8 cannot do 2MB and P9 cannot do 16MB. So for each emulated 16M IOMMU page we may create several smaller mappings ("TCEs") in the hardware IOMMU. The code wrongly uses the emulated TCE index instead of hardware TCE index in error handling. The problem is easier to see on POWER8 with multi-level TCE tables (when only the first level is preallocated) as hash mode uses real mode TCE hypercalls handlers. The kernel starts using indirect tables when VMs get bigger than 128GB (depends on the max page order). The very first real mode hcall is going to fail with H_TOO_HARD as in the real mode we cannot allocate memory for TCEs (we can in the virtual mode) but on the way out the code attempts to clear hardware TCEs using emulated TCE indexes which corrupts random kernel memory because it_offset==1<<59 is subtracted from those indexes and the resulting index is out of the TCE table bounds. This fixes kvmppc_clear_tce() to use the correct TCE indexes. While at it, this fixes TCE cache invalidation which uses emulated TCE indexes instead of the hardware ones. This went unnoticed as 64bit DMA is used these days and VMs map all RAM in one go and only then do DMA and this is when the TCE cache gets populated. Potentially this could slow down mapping, however normally 16MB emulated pages are backed by 64K hardware pages so it is one write to the "TCE Kill" per 256 updates which is not that bad considering the size of the cache (1024 TCEs or so). Fixes: ca1fc489cfa0 ("KVM: PPC: Book3S: Allow backing bigger guest IOMMU pages with smaller physical pages") Signed-off-by: Alexey Kardashevskiy Tested-by: David Gibson Reviewed-by: Frederic Barrat Reviewed-by: David Gibson Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220420050840.328223-1-aik@ozlabs.ru arch/powerpc/kvm/book3s_64_vio.c | 45 +++++++++++++++++++------------------ arch/powerpc/kvm/book3s_64_vio_hv.c | 44 ++++++++++++++++++------------------ 2 files changed, 45 insertions(+), 44 deletions(-) commit ac875df4d854ab13d9c4af682a1837a1214fecec Author: Krzysztof Kozlowski Date: Wed Apr 20 16:14:07 2022 +0200 pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB. ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8 Exynos selects only the latter leading to possible wrong configuration on ARMv8 build: WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y]) Selected by [y]: - ARCH_EXYNOS [=y] Always select the GPIOLIB from the Samsung pinctrl drivers to fix the issue. This requires removing of OF_GPIO dependency (to avoid recursive dependency), so add dependency on OF for COMPILE_TEST cases. Reported-by: Necip Fazil Yildiran Fixes: eed6b3eb20b9 ("arm64: Split out platform options to separate Kconfig") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Arnd Bergmann Link: https://lore.kernel.org/r/20220420141407.470955-1-krzysztof.kozlowski@linaro.org arch/arm/mach-exynos/Kconfig | 1 - drivers/pinctrl/samsung/Kconfig | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) commit d2b9be1f4af5cabed1ee5bb341f887f64b1c1669 Author: Michael Ellerman Date: Thu Apr 21 00:16:57 2022 +1000 powerpc/time: Always set decrementer in timer_interrupt() This is a partial revert of commit 0faf20a1ad16 ("powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use"). Prior to that commit, we always set the decrementer in timer_interrupt(), to clear the timer interrupt. Otherwise we could end up continuously taking timer interrupts. When high res timers are enabled there is no problem seen with leaving the decrementer untouched in timer_interrupt(), because it will be programmed via hrtimer_interrupt() -> tick_program_event() -> clockevents_program_event() -> decrementer_set_next_event(). However with CONFIG_HIGH_RES_TIMERS=n or booting with highres=off, we see a stall/lockup, because tick_nohz_handler() does not cause a reprogram of the decrementer, leading to endless timer interrupts. Example trace: [ 1.898617][ T7] Freeing initrd memory: 2624K^M [ 22.680919][ C1] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:^M [ 22.682281][ C1] rcu: 0-....: (25 ticks this GP) idle=073/0/0x1 softirq=10/16 fqs=1050 ^M [ 22.682851][ C1] (detected by 1, t=2102 jiffies, g=-1179, q=476)^M [ 22.683649][ C1] Sending NMI from CPU 1 to CPUs 0:^M [ 22.685252][ C0] NMI backtrace for cpu 0^M [ 22.685649][ C0] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.16.0-rc2-00185-g0faf20a1ad16 #145^M [ 22.686393][ C0] NIP: c000000000016d64 LR: c000000000f6cca4 CTR: c00000000019c6e0^M [ 22.686774][ C0] REGS: c000000002833590 TRAP: 0500 Not tainted (5.16.0-rc2-00185-g0faf20a1ad16)^M [ 22.687222][ C0] MSR: 8000000000009033 CR: 24000222 XER: 00000000^M [ 22.688297][ C0] CFAR: c00000000000c854 IRQMASK: 0 ^M ... [ 22.692637][ C0] NIP [c000000000016d64] arch_local_irq_restore+0x174/0x250^M [ 22.694443][ C0] LR [c000000000f6cca4] __do_softirq+0xe4/0x3dc^M [ 22.695762][ C0] Call Trace:^M [ 22.696050][ C0] [c000000002833830] [c000000000f6cc80] __do_softirq+0xc0/0x3dc (unreliable)^M [ 22.697377][ C0] [c000000002833920] [c000000000151508] __irq_exit_rcu+0xd8/0x130^M [ 22.698739][ C0] [c000000002833950] [c000000000151730] irq_exit+0x20/0x40^M [ 22.699938][ C0] [c000000002833970] [c000000000027f40] timer_interrupt+0x270/0x460^M [ 22.701119][ C0] [c0000000028339d0] [c0000000000099a8] decrementer_common_virt+0x208/0x210^M Possibly this should be fixed in the lowres timing code, but that would be a generic change and could take some time and may not backport easily, so for now make the programming of the decrementer unconditional again in timer_interrupt() to avoid the stall/lockup. Fixes: 0faf20a1ad16 ("powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use") Reported-by: Miguel Ojeda Signed-off-by: Michael Ellerman Reviewed-by: Nicholas Piggin Link: https://lore.kernel.org/r/20220420141657.771442-1-mpe@ellerman.id.au arch/powerpc/kernel/time.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) commit f5d0f921ea362636e4a2efb7c38d1ead373a8700 Author: Ronnie Sahlberg Date: Thu Apr 21 11:15:36 2022 +1000 cifs: destage any unwritten data to the server before calling copychunk_write because the copychunk_write might cover a region of the file that has not yet been sent to the server and thus fail. A simple way to reproduce this is: truncate -s 0 /mnt/testfile; strace -f -o x -ttT xfs_io -i -f -c 'pwrite 0k 128k' -c 'fcollapse 16k 24k' /mnt/testfile the issue is that the 'pwrite 0k 128k' becomes rearranged on the wire with the 'fcollapse 16k 24k' due to write-back caching. fcollapse is implemented in cifs.ko as a SMB2 IOCTL(COPYCHUNK_WRITE) call and it will fail serverside since the file is still 0b in size serverside until the writes have been destaged. To avoid this we must ensure that we destage any unwritten data to the server before calling COPYCHUNK_WRITE. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1997373 Reported-by: Xiaoli Feng Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French fs/cifs/smb2ops.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit cd70a3e8988a999c42d307d2616a5e7b6a33c7c8 Author: Paulo Alcantara Date: Wed Apr 20 21:05:46 2022 -0300 cifs: use correct lock type in cifs_reconnect() TCP_Server_Info::origin_fullpath and TCP_Server_Info::leaf_fullpath are protected by refpath_lock mutex and not cifs_tcp_ses_lock spinlock. Signed-off-by: Paulo Alcantara (SUSE) Cc: stable@vger.kernel.org Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French fs/cifs/connect.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 41f10081a92a0ed280008218a8ec18ad8ba0fceb Author: Paulo Alcantara Date: Wed Apr 20 21:05:45 2022 -0300 cifs: fix NULL ptr dereference in refresh_mounts() Either mount(2) or automount might not have server->origin_fullpath set yet while refresh_cache_worker() is attempting to refresh DFS referrals. Add missing NULL check and locking around it. This fixes bellow crash: [ 1070.276835] general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN NOPTI [ 1070.277676] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] [ 1070.278219] CPU: 1 PID: 8506 Comm: kworker/u8:1 Not tainted 5.18.0-rc3 #10 [ 1070.278701] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014 [ 1070.279495] Workqueue: cifs-dfscache refresh_cache_worker [cifs] [ 1070.280044] RIP: 0010:strcasecmp+0x34/0x150 [ 1070.280359] Code: 00 00 00 fc ff df 41 54 55 48 89 fd 53 48 83 ec 10 eb 03 4c 89 fe 48 89 ef 48 83 c5 01 48 89 f8 48 89 fa 48 c1 e8 03 83 e2 07 <42> 0f b6 04 28 38 d0 7f 08 84 c0 0f 85 bc 00 00 00 0f b6 45 ff 44 [ 1070.281729] RSP: 0018:ffffc90008367958 EFLAGS: 00010246 [ 1070.282114] RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 [ 1070.282691] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 1070.283273] RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff873eda27 [ 1070.283857] R10: ffffc900083679a0 R11: 0000000000000001 R12: ffff88812624c000 [ 1070.284436] R13: dffffc0000000000 R14: ffff88810e6e9a88 R15: ffff888119bb9000 [ 1070.284990] FS: 0000000000000000(0000) GS:ffff888151200000(0000) knlGS:0000000000000000 [ 1070.285625] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1070.286100] CR2: 0000561a4d922418 CR3: 000000010aecc000 CR4: 0000000000350ee0 [ 1070.286683] Call Trace: [ 1070.286890] [ 1070.287070] refresh_cache_worker+0x895/0xd20 [cifs] [ 1070.287475] ? __refresh_tcon.isra.0+0xfb0/0xfb0 [cifs] [ 1070.287905] ? __lock_acquire+0xcd1/0x6960 [ 1070.288247] ? is_dynamic_key+0x1a0/0x1a0 [ 1070.288591] ? lockdep_hardirqs_on_prepare+0x410/0x410 [ 1070.289012] ? lock_downgrade+0x6f0/0x6f0 [ 1070.289318] process_one_work+0x7bd/0x12d0 [ 1070.289637] ? worker_thread+0x160/0xec0 [ 1070.289970] ? pwq_dec_nr_in_flight+0x230/0x230 [ 1070.290318] ? _raw_spin_lock_irq+0x5e/0x90 [ 1070.290619] worker_thread+0x5ac/0xec0 [ 1070.290891] ? process_one_work+0x12d0/0x12d0 [ 1070.291199] kthread+0x2a5/0x350 [ 1070.291430] ? kthread_complete_and_exit+0x20/0x20 [ 1070.291770] ret_from_fork+0x22/0x30 [ 1070.292050] [ 1070.292223] Modules linked in: bpfilter cifs cifs_arc4 cifs_md4 [ 1070.292765] ---[ end trace 0000000000000000 ]--- [ 1070.293108] RIP: 0010:strcasecmp+0x34/0x150 [ 1070.293471] Code: 00 00 00 fc ff df 41 54 55 48 89 fd 53 48 83 ec 10 eb 03 4c 89 fe 48 89 ef 48 83 c5 01 48 89 f8 48 89 fa 48 c1 e8 03 83 e2 07 <42> 0f b6 04 28 38 d0 7f 08 84 c0 0f 85 bc 00 00 00 0f b6 45 ff 44 [ 1070.297718] RSP: 0018:ffffc90008367958 EFLAGS: 00010246 [ 1070.298622] RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000 [ 1070.299428] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 1070.300296] RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff873eda27 [ 1070.301204] R10: ffffc900083679a0 R11: 0000000000000001 R12: ffff88812624c000 [ 1070.301932] R13: dffffc0000000000 R14: ffff88810e6e9a88 R15: ffff888119bb9000 [ 1070.302645] FS: 0000000000000000(0000) GS:ffff888151200000(0000) knlGS:0000000000000000 [ 1070.303462] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1070.304131] CR2: 0000561a4d922418 CR3: 000000010aecc000 CR4: 0000000000350ee0 [ 1070.305004] Kernel panic - not syncing: Fatal exception [ 1070.305711] Kernel Offset: disabled [ 1070.305971] ---[ end Kernel panic - not syncing: Fatal exception ]--- Signed-off-by: Paulo Alcantara (SUSE) Cc: stable@vger.kernel.org Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French fs/cifs/connect.c | 2 ++ fs/cifs/dfs_cache.c | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) commit 298799a28264ce400d9ff95c51b7adcb123d866e Author: Zack Rusin Date: Wed Apr 20 00:03:28 2022 -0400 drm/vmwgfx: Fix gem refcounting and memory evictions v2: Add the last part of the ref count fix which was spotted by Philipp Sieweck where the ref count of cpu writers is off due to ERESTARTSYS or EBUSY during bo waits. The initial GEM port broke refcounting on shareable (prime) surfaces and memory evictions. The prime surfaces broke because the parent surfaces weren't increasing the ref count on GEM surfaces, which meant that the memory backing textures could have been deleted while the texture was still accessible. The evictions broke due to a typo, the code was supposed to exit if the passed buffers were not vmw_buffer_object not if they were. They're tied because the evictions depend on having memory to actually evict. This fixes crashes with XA state tracker which is used for xrender acceleration on xf86-video-vmware, apps/tests which use a lot of memory (a good test being the piglit's streaming-texture-leak) and desktops. Signed-off-by: Zack Rusin Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM") Reported-by: Philipp Sieweck Cc: # v5.17+ Reviewed-by: Maaz Mombasawala Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20220420040328.1007409-1-zack@kde.org drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 43 +++++++++++++++------------------ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 8 ++---- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 7 +++++- 3 files changed, 28 insertions(+), 30 deletions(-) commit 1da18a296f5ba4f99429e62a7cf4fdbefa598902 Author: Damien Le Moal Date: Tue Apr 12 17:41:37 2022 +0900 zonefs: Fix management of open zones The mount option "explicit_open" manages the device open zone resources to ensure that if an application opens a sequential file for writing, the file zone can always be written by explicitly opening the zone and accounting for that state with the s_open_zones counter. However, if some zones are already open when mounting, the device open zone resource usage status will be larger than the initial s_open_zones value of 0. Ensure that this inconsistency does not happen by closing any sequential zone that is open when mounting. Furthermore, with ZNS drives, closing an explicitly open zone that has not been written will change the zone state to "closed", that is, the zone will remain in an active state. Since this can then cause failures of explicit open operations on other zones if the drive active zone resources are exceeded, we need to make sure that the zone is not active anymore by resetting it instead of closing it. To address this, zonefs_zone_mgmt() is modified to change a REQ_OP_ZONE_CLOSE request into a REQ_OP_ZONE_RESET for sequential zones that have not been written. Fixes: b5c00e975779 ("zonefs: open/close zone on file open/close") Cc: Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Hans Holmberg fs/zonefs/super.c | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) commit 694852ead287a3433126e7ebda397b242dc99624 Author: Damien Le Moal Date: Tue Apr 12 20:52:35 2022 +0900 zonefs: Clear inode information flags on inode creation Ensure that the i_flags field of struct zonefs_inode_info is cleared to 0 when initializing a zone file inode, avoiding seeing the flag ZONEFS_ZONE_OPEN being incorrectly set. Fixes: b5c00e975779 ("zonefs: open/close zone on file open/close") Cc: Signed-off-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hans Holmberg fs/zonefs/super.c | 1 + 1 file changed, 1 insertion(+) commit 87950929e2ff2236207bdbe14bff8230558b541b Author: YueHaibing Date: Sat Apr 9 18:59:58 2022 +0800 pinctrl: mediatek: moore: Fix build error If EINT_MTK is m and PINCTRL_MTK_V2 is y, build fails: drivers/pinctrl/mediatek/pinctrl-moore.o: In function `mtk_gpio_set_config': pinctrl-moore.c:(.text+0xa6c): undefined reference to `mtk_eint_set_debounce' drivers/pinctrl/mediatek/pinctrl-moore.o: In function `mtk_gpio_to_irq': pinctrl-moore.c:(.text+0xacc): undefined reference to `mtk_eint_find_irq' Select EINT_MTK for PINCTRL_MTK_V2 to fix this. Fixes: 8174a8512e3e ("pinctrl: mediatek: make MediaTek pinctrl v2 driver ready for buidling loadable module") Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220409105958.37412-1-yuehaibing@huawei.com Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 9a5280b312e2e7898b6397b2ca3cfd03f67d7be1 Author: Dave Chinner Date: Thu Apr 21 08:45:16 2022 +1000 xfs: reorder iunlink remove operation in xfs_ifree The O_TMPFILE creation implementation creates a specific order of operations for inode allocation/freeing and unlinked list modification. Currently both are serialised by the AGI, so the order doesn't strictly matter as long as the are both in the same transaction. However, if we want to move the unlinked list insertions largely out from under the AGI lock, then we have to be concerned about the order in which we do unlinked list modification operations. O_TMPFILE creation tells us this order is inode allocation/free, then unlinked list modification. Change xfs_ifree() to use this same ordering on unlinked list removal. This way we always guarantee that when we enter the iunlinked list removal code from this path, we already have the AGI locked and we don't have to worry about lock nesting AGI reads inside unlink list locks because it's already locked and attached to the transaction. We can do this safely as the inode freeing and unlinked list removal are done in the same transaction and hence are atomic operations with respect to log recovery. Reported-by: Frank Hofmann Fixes: 298f7bec503f ("xfs: pin inode backing buffer to the inode log item") Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Dave Chinner fs/xfs/xfs_inode.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) commit d65a92de4383e54b920ba11f333032b0ea5e4174 Author: Tiezhu Yang Date: Thu Apr 21 08:45:14 2022 +1000 MAINTAINERS: update IOMAP FILESYSTEM LIBRARY and XFS FILESYSTEM In IOMAP FILESYSTEM LIBRARY and XFS FILESYSTEM, the M(ail): entry is redundant with the L(ist): entry, remove the redundant M(ail): entry. Signed-off-by: Tiezhu Yang Reviewed-by: Darrick J. Wong Reviewed-by: Chaitanya Kulkarni Signed-off-by: Dave Chinner MAINTAINERS | 3 --- 1 file changed, 3 deletions(-) commit b9b3fe152e4966cf8562630de67aa49e2f9c9222 Author: Dave Chinner Date: Thu Apr 21 08:44:59 2022 +1000 xfs: convert buffer flags to unsigned. 5.18 w/ std=gnu11 compiled with gcc-5 wants flags stored in unsigned fields to be unsigned. This manifests as a compiler error such as: /kisskb/src/fs/xfs/./xfs_trace.h:432:2: note: in expansion of macro 'TP_printk' TP_printk("dev %d:%d daddr 0x%llx bbcount 0x%x hold %d pincount %d " ^ /kisskb/src/fs/xfs/./xfs_trace.h:440:5: note: in expansion of macro '__print_flags' __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), ^ /kisskb/src/fs/xfs/xfs_buf.h:67:4: note: in expansion of macro 'XBF_UNMAPPED' { XBF_UNMAPPED, "UNMAPPED" } ^ /kisskb/src/fs/xfs/./xfs_trace.h:440:40: note: in expansion of macro 'XFS_BUF_FLAGS' __print_flags(__entry->flags, "|", XFS_BUF_FLAGS), ^ /kisskb/src/fs/xfs/./xfs_trace.h: In function 'trace_raw_output_xfs_buf_flags_class': /kisskb/src/fs/xfs/xfs_buf.h:46:23: error: initializer element is not constant #define XBF_UNMAPPED (1 << 31)/* do not map the buffer */ as __print_flags assigns XFS_BUF_FLAGS to a structure that uses an unsigned long for the flag. Since this results in the value of XBF_UNMAPPED causing a signed integer overflow, the result is technically undefined behavior, which gcc-5 does not accept as an integer constant. This is based on a patch from Arnd Bergman . Reported-by: Geert Uytterhoeven Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Signed-off-by: Dave Chinner fs/xfs/xfs_buf.c | 6 +++--- fs/xfs/xfs_buf.h | 42 +++++++++++++++++++++--------------------- fs/xfs/xfs_trans.h | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) commit f31076a6b2391896088fa81755a892213f07788e Author: Alaa Mohamed Date: Wed Apr 20 01:43:28 2022 +0200 xen: Convert kmap() to kmap_local_page() kmap() is being deprecated and these usages are all local to the thread so there is no reason kmap_local_page() can't be used. Replace kmap() calls with kmap_local_page(). Signed-off-by: Alaa Mohamed Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220419234328.10346-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Boris Ostrovsky drivers/xen/gntalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 08ef48404965cfef99343d6bbbcf75b88c74aa0e Author: Mark Brown Date: Wed Apr 20 14:34:37 2022 +0100 ASoC: da7219: Fix change notifications for tone generator frequency The tone generator frequency control just returns 0 on successful write, not a boolean value indicating if there was a change or not. Compare what was written with the value that was there previously so that notifications are generated appropriately when the value changes. Signed-off-by: Mark Brown Reviewed-by: Adam Thomson Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220420133437.569229-1-broonie@kernel.org Signed-off-by: Mark Brown sound/soc/codecs/da7219.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit b253435746d9a4a701b5f09211b9c14d3370d0da Merge: 10c5f102e2be 839769c35477 Author: Linus Torvalds Date: Wed Apr 20 12:43:27 2022 -0700 Merge tag 'xtensa-20220416' of https://github.com/jcmvbkbc/linux-xtensa Pull xtensa fixes from Max Filippov: - fix patching CPU selection in patch_text - fix potential deadlock in ISS platform serial driver - fix potential register clobbering in coprocessor exception handler * tag 'xtensa-20220416' of https://github.com/jcmvbkbc/linux-xtensa: xtensa: fix a7 clobbering in coprocessor context load/store arch: xtensa: platforms: Fix deadlock in rs_close() xtensa: patch_text: Fixup last cpu should be master commit 10c5f102e2be6d816938b168104e8dacdd5bace7 Merge: 906f90409735 8b1ac84dcf2c Author: Linus Torvalds Date: Wed Apr 20 12:35:20 2022 -0700 Merge tag 'erofs-for-5.18-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fixes from Gao Xiang: "One patch to fix a use-after-free race related to the on-stack z_erofs_decompressqueue, which happens very rarely but needs to be fixed properly soon. The other patch fixes some sysfs Sphinx warnings" * tag 'erofs-for-5.18-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: Documentation/ABI: sysfs-fs-erofs: Fix Sphinx errors erofs: fix use-after-free of on-stack io[] commit 906f904097359d059623ca8d3511d9f341080f2c Author: Linus Torvalds Date: Wed Apr 20 12:07:53 2022 -0700 Revert "fs/pipe: use kvcalloc to allocate a pipe_buffer array" This reverts commit 5a519c8fe4d620912385f94372fc8472fa98c662. It turns out that making the pipe almost arbitrarily large has some rather unexpected downsides. The kernel test robot reports a kernel warning that is due to pipe->max_usage now growing to the point where the iter_file_splice_write() buffer allocation can no longer be satisfied as a slab allocation, and the int nbufs = pipe->max_usage; struct bio_vec *array = kcalloc(nbufs, sizeof(struct bio_vec), GFP_KERNEL); code sequence there will now always fail as a result. That code could be modified to use kvcalloc() too, but I feel very uncomfortable making those kinds of changes for a very niche use case that really should have other options than make these kinds of fundamental changes to pipe behavior. Maybe the CRIU process dumping should be multi-threaded, and use multiple pipes and multiple cores, rather than try to use one larger pipe to minimize splice() calls. Reported-by: kernel test robot Link: https://lore.kernel.org/all/20220420073717.GD16310@xsang-OptiPlex-9020/ Cc: Andrei Vagin Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Alexander Viro Cc: Andrew Morton Signed-off-by: Linus Torvalds fs/pipe.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit a6823e4e360fe975bd3da4ab156df7c74c8b07f3 Author: Mikulas Patocka Date: Tue Apr 19 09:56:23 2022 -0400 x86: __memcpy_flushcache: fix wrong alignment if size > 2^32 The first "if" condition in __memcpy_flushcache is supposed to align the "dest" variable to 8 bytes and copy data up to this alignment. However, this condition may misbehave if "size" is greater than 4GiB. The statement min_t(unsigned, size, ALIGN(dest, 8) - dest); casts both arguments to unsigned int and selects the smaller one. However, the cast truncates high bits in "size" and it results in misbehavior. For example: suppose that size == 0x100000001, dest == 0x200000002 min_t(unsigned, size, ALIGN(dest, 8) - dest) == min_t(0x1, 0xe) == 0x1; ... dest += 0x1; so we copy just one byte "and" dest remains unaligned. This patch fixes the bug by replacing unsigned with size_t. Signed-off-by: Mikulas Patocka Signed-off-by: Linus Torvalds arch/x86/lib/usercopy_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 27275f181c7add59c211c7e40c442d8004b1e664 Author: Jaegeuk Kim Date: Tue Mar 29 11:28:07 2022 -0700 f2fs: fix wrong condition check when failing metapage read This patch fixes wrong initialization. Fixes: 50c63009f6ab ("f2fs: avoid an infinite loop in f2fs_sync_dirty_inodes") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/checkpoint.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 0adc2ab0e8a88a0e8b98dae5fc1443ae8c7062ba Author: Jaegeuk Kim Date: Tue Apr 12 15:01:58 2022 -0700 f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders Let's attach io_flags to bio only, so that we can merge IOs given original io_flags only. Fixes: 64bf0eef0171 ("f2fs: pass the bio operation to bio_alloc_bioset") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/data.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) commit 930e2607638de8325686319b2789323cc85ea671 Author: Jaegeuk Kim Date: Tue Apr 12 14:45:50 2022 -0700 f2fs: remove obsolete whint_mode This patch removes obsolete whint_mode. Fixes: 41d36a9f3e53 ("fs: remove kiocb.ki_hint") Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Documentation/filesystems/f2fs.rst | 70 ---------------------------- fs/f2fs/f2fs.h | 9 ---- fs/f2fs/segment.c | 95 -------------------------------------- fs/f2fs/super.c | 32 +------------ 4 files changed, 1 insertion(+), 205 deletions(-) commit 1dc9f1a66e1718479e1c4f95514e1750602a3cb9 Author: Wang Qing Date: Sun Apr 10 19:36:19 2022 -0700 arch_topology: Do not set llc_sibling if llc_id is invalid When ACPI is not enabled, cpuid_topo->llc_id = cpu_topo->llc_id = -1, which will set llc_sibling 0xff(...), this is misleading. Don't set llc_sibling(default 0) if we don't know the cache topology. Reviewed-by: Sudeep Holla Signed-off-by: Wang Qing Fixes: 37c3ec2d810f ("arm64: topology: divorce MC scheduling domain from core_siblings") Cc: stable Link: https://lore.kernel.org/r/1649644580-54626-1-git-send-email-wangqing@vivo.com Signed-off-by: Greg Kroah-Hartman drivers/base/arch_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit db1e59483dfd8d4e956575302520bb8f7e20c79b Author: Darren Hart Date: Mon Apr 11 13:53:34 2022 -0700 topology: make core_mask include at least cluster_siblings Ampere Altra defines CPU clusters in the ACPI PPTT. They share a Snoop Control Unit, but have no shared CPU-side last level cache. cpu_coregroup_mask() will return a cpumask with weight 1, while cpu_clustergroup_mask() will return a cpumask with weight 2. As a result, build_sched_domain() will BUG() once per CPU with: BUG: arch topology borken the CLS domain not a subset of the MC domain The MC level cpumask is then extended to that of the CLS child, and is later removed entirely as redundant. This sched domain topology is an improvement over previous topologies, or those built without SCHED_CLUSTER, particularly for certain latency sensitive workloads. With the current scheduler model and heuristics, this is a desirable default topology for Ampere Altra and Altra Max system. Rather than create a custom sched domains topology structure and introduce new logic in arch/arm64 to detect these systems, update the core_mask so coregroup is never a subset of clustergroup, extending it to cluster_siblings if necessary. Only do this if CONFIG_SCHED_CLUSTER is enabled to avoid also changing the topology (MC) when CONFIG_SCHED_CLUSTER is disabled. This has the added benefit over a custom topology of working for both symmetric and asymmetric topologies. It does not address systems where the CLUSTER topology is above a populated MC topology, but these are not considered today and can be addressed separately if and when they appear. The final sched domain topology for a 2 socket Ampere Altra system is unchanged with or without CONFIG_SCHED_CLUSTER, and the BUG is avoided: For CPU0: CONFIG_SCHED_CLUSTER=y CLS [0-1] DIE [0-79] NUMA [0-159] CONFIG_SCHED_CLUSTER is not set DIE [0-79] NUMA [0-159] Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Catalin Marinas Cc: Will Deacon Cc: Peter Zijlstra Cc: Vincent Guittot Cc: D. Scott Phillips Cc: Ilkka Koskinen Cc: # 5.16.x Suggested-by: Barry Song Reviewed-by: Barry Song Reviewed-by: Dietmar Eggemann Acked-by: Sudeep Holla Signed-off-by: Darren Hart Link: https://lore.kernel.org/r/c8fe9fce7c86ed56b4c455b8c902982dc2303868.1649696956.git.darren@os.amperecomputing.com Signed-off-by: Greg Kroah-Hartman drivers/base/arch_topology.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit aa63a74d4535a1d97b60e46655a1361c42565b89 Author: Tony Luck Date: Wed Apr 6 15:01:50 2022 -0700 topology/sysfs: Hide PPIN on systems that do not support it. Systems that do not support a Protected Processor Identification Number currently report: # cat /sys/devices/system/cpu/cpu0/topology/ppin 0x0 which is confusing/wrong. Add a ".is_visible" function to suppress inclusion of the ppin file. Fixes: ab28e944197f ("topology/sysfs: Add PPIN in sysfs under cpu topology") Signed-off-by: Tony Luck Link: https://lore.kernel.org/r/20220406220150.63855-1-tony.luck@intel.com Signed-off-by: Greg Kroah-Hartman drivers/base/topology.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 48473802506d2d6151f59e0e764932b33b53cb3b Author: Daniel Starke Date: Wed Apr 20 03:13:44 2022 -0700 tty: n_gsm: fix missing update of modem controls after DLCI open Currently the peer is not informed about the initial state of the modem control lines after a new DLCI has been opened. Fix this by sending the initial modem control line states after DLCI open. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220420101346.3315-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 4 ++++ 1 file changed, 4 insertions(+) commit 570a4bf7440e9fb2a4164244a6bf60a46362b627 Author: Bob Pearson Date: Mon Apr 18 12:41:04 2022 -0500 RDMA/rxe: Recheck the MR in when generating a READ reply The rping benchmark fails on long runs. The root cause of this failure has been traced to a failure to compute a nonzero value of mr in rare situations. Fix this failure by correctly handling the computation of mr in read_reply() in rxe_resp.c in the replay flow. Fixes: 8a1a0be894da ("RDMA/rxe: Replace mr by rkey in responder resources") Link: https://lore.kernel.org/r/20220418174103.3040-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_resp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 5e6242151d7f17b056a82ca7b860c4ec8eaa7589 Author: Ido Schimmel Date: Tue Apr 19 16:51:55 2022 +0300 selftests: mlxsw: vxlan_flooding_ipv6: Prevent flooding of unwanted packets The test verifies that packets are correctly flooded by the bridge and the VXLAN device by matching on the encapsulated packets at the other end. However, if packets other than those generated by the test also ingress the bridge (e.g., MLD packets), they will be flooded as well and interfere with the expected count. Make the test more robust by making sure that only the packets generated by the test can ingress the bridge. Drop all the rest using tc filters on the egress of 'br0' and 'h1'. In the software data path, the problem can be solved by matching on the inner destination MAC or dropping unwanted packets at the egress of the VXLAN device, but this is not currently supported by mlxsw. Fixes: d01724dd2a66 ("selftests: mlxsw: spectrum-2: Add a test for VxLAN flooding with IPv6") Signed-off-by: Ido Schimmel Reviewed-by: Amit Cohen Signed-off-by: David S. Miller .../drivers/net/mlxsw/spectrum-2/vxlan_flooding_ipv6.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) commit 044011fdf162c5dd61c02841930c8f438a9adadb Author: Ido Schimmel Date: Tue Apr 19 16:51:54 2022 +0300 selftests: mlxsw: vxlan_flooding: Prevent flooding of unwanted packets The test verifies that packets are correctly flooded by the bridge and the VXLAN device by matching on the encapsulated packets at the other end. However, if packets other than those generated by the test also ingress the bridge (e.g., MLD packets), they will be flooded as well and interfere with the expected count. Make the test more robust by making sure that only the packets generated by the test can ingress the bridge. Drop all the rest using tc filters on the egress of 'br0' and 'h1'. In the software data path, the problem can be solved by matching on the inner destination MAC or dropping unwanted packets at the egress of the VXLAN device, but this is not currently supported by mlxsw. Fixes: 94d302deae25 ("selftests: mlxsw: Add a test for VxLAN flooding") Signed-off-by: Ido Schimmel Reviewed-by: Amit Cohen Signed-off-by: David S. Miller .../selftests/drivers/net/mlxsw/vxlan_flooding.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) commit 3756aa16fadaef2873cfbd2659dfa1978a7e1859 Author: Olivier Moysan Date: Tue Apr 12 13:16:58 2022 +0200 ASoC: simple-card-utils: fix sysclk shutdown In asoc_simple_shutdown() the snd_soc_dai_set_sysclk() function is called twice with input direction SND_SOC_CLOCK_IN. Restore one call with output direction SND_SOC_CLOCK_OUT. Fixes: 5ca2ab459817 ("ASoC: simple-card-utils: Add new system-clock-fixed flag") Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20220412111658.11015-1-olivier.moysan@foss.st.com Signed-off-by: Mark Brown sound/soc/generic/simple-card-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0665886ad1392e6b5bae85d7a6ccbed48dca1522 Author: Takashi Iwai Date: Wed Apr 20 15:02:47 2022 +0200 ALSA: usb-audio: Clear MIDI port active flag after draining When a rawmidi output stream is closed, it calls the drain at first, then does trigger-off only when the drain returns -ERESTARTSYS as a fallback. It implies that each driver should turn off the stream properly after the drain. Meanwhile, USB-audio MIDI interface didn't change the port->active flag after the drain. This may leave the output work picking up the port that is closed right now, which eventually leads to a use-after-free for the already released rawmidi object. This patch fixes the bug by properly clearing the port->active flag after the output drain. Reported-by: syzbot+70e777a39907d6d5fd0a@syzkaller.appspotmail.com Cc: Link: https://lore.kernel.org/r/00000000000011555605dceaff03@google.com Link: https://lore.kernel.org/r/20220420130247.22062-1-tiwai@suse.de Signed-off-by: Takashi Iwai sound/usb/midi.c | 1 + 1 file changed, 1 insertion(+) commit 7495a5bbf89f68c8880757c112fd0994f5dba309 Author: Vinod Koul Date: Thu Apr 14 12:12:35 2022 +0530 dt-bindings: dmaengine: qcom: gpi: Add minItems for interrupts Add the minItems for interrupts property as well. In the absence of this, we get warning if interrupts are less than 13 arch/arm64/boot/dts/qcom/qrb5165-rb5.dtb: dma-controller@800000: interrupts: [[0, 588, 4], [0, 589, 4], [0, 590, 4], [0, 591, 4], [0, 592, 4], [0, 593, 4], [0, 594, 4], [0, 595, 4], [0, 596, 4], [0, 597, 4]] is too short Signed-off-by: Vinod Koul Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220414064235.1182195-1-vkoul@kernel.org Signed-off-by: Vinod Koul Documentation/devicetree/bindings/dma/qcom,gpi.yaml | 1 + 1 file changed, 1 insertion(+) commit c5d0fc54bede8765b7a91bdac342c7c7de8bc8bd Author: Krzysztof Kozlowski Date: Wed Apr 20 12:46:01 2022 +0200 nfc: MAINTAINERS: add Bug entry Add a Bug section, indicating preferred mailing method for bug reports, to NFC Subsystem entry. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit 1cd8e751d96c43ece3f6842ac2244a37d9332c3a Author: Dave Jiang Date: Mon Apr 11 15:06:34 2022 -0700 dmaengine: idxd: skip clearing device context when device is read-only If the device shows up as read-only configuration, skip the clearing of the state as the context must be preserved for device re-enable after being disabled. Fixes: 0dcfe41e9a4c ("dmanegine: idxd: cleanup all device related bits after disabling device") Reported-by: Tony Zhu Tested-by: Tony Zhu Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164971479479.2200566.13980022473526292759.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul drivers/dma/idxd/device.c | 3 +++ 1 file changed, 3 insertions(+) commit 505a2d1032ae656b0a8c736be110255503941cde Author: Dave Jiang Date: Mon Apr 11 15:08:01 2022 -0700 dmaengine: idxd: add RO check for wq max_transfer_size write Block wq_max_transfer_size_store() when the device is configured as read-only and not configurable. Fixes: d7aad5550eca ("dmaengine: idxd: add support for configurable max wq xfer size") Reported-by: Bernice Zhang Tested-by: Bernice Zhang Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164971488154.2200913.10706665404118545941.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul drivers/dma/idxd/sysfs.c | 3 +++ 1 file changed, 3 insertions(+) commit 66903461ffed0b66fc3e0200082d4e09365aacdc Author: Dave Jiang Date: Mon Apr 11 15:08:55 2022 -0700 dmaengine: idxd: add RO check for wq max_batch_size write Block wq_max_batch_size_store() when the device is configured as read-only and not configurable. Fixes: e7184b159dd3 ("dmaengine: idxd: add support for configurable max wq batch size") Reported-by: Bernice Zhang Tested-by: Bernice Zhang Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164971493551.2201159.1942042593642155209.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul drivers/dma/idxd/sysfs.c | 3 +++ 1 file changed, 3 insertions(+) commit bc3452cdfc468a65965d0ac397c940acb787ea4d Author: Dave Jiang Date: Mon Apr 18 14:33:21 2022 -0700 dmaengine: idxd: fix retry value to be constant for duration of function call When retries is compared to wq->enqcmds_retries each loop of idxd_enqcmds(), wq->enqcmds_retries can potentially changed by user. Assign the value of retries to wq->enqcmds_retries during initialization so it is the original value set when entering the function. Fixes: 7930d8553575 ("dmaengine: idxd: add knob for enqcmds retries") Suggested-by: Dave Hansen Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165031760154.3658664.1983547716619266558.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul drivers/dma/idxd/submit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5d9d16e5aa0cf023e600bf716239fd9caa2d4148 Author: Dave Jiang Date: Mon Apr 18 14:31:10 2022 -0700 dmaengine: idxd: match type for retries var in idxd_enqcmds() wq->enqcmds_retries is defined as unsigned int. However, retries on the stack is defined as int. Change retries to unsigned int to compare the same type. Fixes: 7930d8553575 ("dmaengine: idxd: add knob for enqcmds retries") Suggested-by: Thiago Macieira Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/165031747059.3658198.6035308204505664375.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul drivers/dma/idxd/submit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit d4860224e6a9bcaef24121827e97831001290328 Author: Jiapeng Chong Date: Wed Apr 13 10:34:42 2022 +0800 dmaengine: dw-edma: Fix inconsistent indenting Eliminate the follow smatch warning: drivers/dma/dw-edma/dw-edma-v0-core.c:419 dw_edma_v0_core_start() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220413023442.18856-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Vinod Koul drivers/dma/dw-edma/dw-edma-v0-core.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) commit 234901de2bc6847eaa0aeb4aba62c31ffb8d3ad6 Author: Kevin Hao Date: Tue Apr 19 16:42:26 2022 +0800 net: stmmac: Use readl_poll_timeout_atomic() in atomic state The init_systime() may be invoked in atomic state. We have observed the following call trace when running "phc_ctl /dev/ptp0 set" on a Intel Agilex board. BUG: sleeping function called from invalid context at drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c:74 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 381, name: phc_ctl preempt_count: 1, expected: 0 RCU nest depth: 0, expected: 0 Preemption disabled at: [] stmmac_set_time+0x34/0x8c CPU: 2 PID: 381 Comm: phc_ctl Not tainted 5.18.0-rc2-next-20220414-yocto-standard+ #567 Hardware name: SoCFPGA Agilex SoCDK (DT) Call trace: dump_backtrace.part.0+0xc4/0xd0 show_stack+0x24/0x40 dump_stack_lvl+0x7c/0xa0 dump_stack+0x18/0x34 __might_resched+0x154/0x1c0 __might_sleep+0x58/0x90 init_systime+0x78/0x120 stmmac_set_time+0x64/0x8c ptp_clock_settime+0x60/0x9c pc_clock_settime+0x6c/0xc0 __arm64_sys_clock_settime+0x88/0xf0 invoke_syscall+0x5c/0x130 el0_svc_common.constprop.0+0x4c/0x100 do_el0_svc+0x7c/0xa0 el0_svc+0x58/0xcc el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x18c/0x190 So we should use readl_poll_timeout_atomic() here instead of readl_poll_timeout(). Also adjust the delay time to 10us to fix a "__bad_udelay" build error reported by "kernel test robot ". I have tested this on Intel Agilex and NXP S32G boards, there is no delay needed at all. So the 10us delay should be long enough for most cases. Fixes: ff8ed737860e ("net: stmmac: use readl_poll_timeout() function in init_systime()") Signed-off-by: Kevin Hao Signed-off-by: David S. Miller drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 95d4782c34a60800ccf91d9f0703137d4367a2fc Author: Nicolin Chen Date: Tue Apr 19 14:01:58 2022 -0700 iommu/arm-smmu-v3: Fix size calculation in arm_smmu_mm_invalidate_range() The arm_smmu_mm_invalidate_range function is designed to be called by mm core for Shared Virtual Addressing purpose between IOMMU and CPU MMU. However, the ways of two subsystems defining their "end" addresses are slightly different. IOMMU defines its "end" address using the last address of an address range, while mm core defines that using the following address of an address range: include/linux/mm_types.h: unsigned long vm_end; /* The first byte after our end address ... This mismatch resulted in an incorrect calculation for size so it failed to be page-size aligned. Further, it caused a dead loop at "while (iova < end)" check in __arm_smmu_tlb_inv_range function. This patch fixes the issue by doing the calculation correctly. Fixes: 2f7e8c553e98 ("iommu/arm-smmu-v3: Hook up ATC invalidation to mm ops") Cc: stable@vger.kernel.org Signed-off-by: Nicolin Chen Reviewed-by: Jason Gunthorpe Reviewed-by: Robin Murphy Reviewed-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20220419210158.21320-1-nicolinc@nvidia.com Signed-off-by: Will Deacon drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit c6a4254c18c6a2195cdf01f58a362392fbe81e85 Author: Nicolas Dichtel Date: Wed Apr 13 16:00:00 2022 +0200 doc/ip-sysctl: add bc_forwarding Let's describe this sysctl. Fixes: 5cbf777cfdf6 ("route: add support for directed broadcast forwarding") Signed-off-by: Nicolas Dichtel Signed-off-by: David S. Miller Documentation/networking/ip-sysctl.rst | 7 +++++++ 1 file changed, 7 insertions(+) commit 2c8045d48dee703ad8eab2be7d6547765a89c069 Author: Heiner Kallweit Date: Fri Apr 15 16:03:10 2022 +0200 phy: amlogic: fix error path in phy_g12a_usb3_pcie_probe() If clk_prepare_enable() fails we call clk_disable_unprepare() in the error path what results in a warning that the clock is disabled and unprepared already. And if we fail later in phy_g12a_usb3_pcie_probe() then we bail out w/o calling clk_disable_unprepare(). This patch fixes both errors. Fixes: 36077e16c050 ("phy: amlogic: Add Amlogic G12A USB3 + PCIE Combo PHY Driver") Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/8e416f95-1084-ee28-860e-7884f7fa2e32@gmail.com Signed-off-by: Vinod Koul drivers/phy/amlogic/phy-meson-g12a-usb3-pcie.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) commit 38d9a4ac65f204f264b33b966f0af4366f5518a8 Author: Atish Patra Date: Tue Apr 19 18:32:58 2022 -0700 RISC-V: KVM: Restrict the extensions that can be disabled Currently, the config isa register allows us to disable all allowed single letter ISA extensions. It shouldn't be the case as vmm shouldn't be able to disable base extensions (imac). These extensions should always be enabled as long as they are enabled in the host ISA. Signed-off-by: Atish Patra Signed-off-by: Anup Patel Fixes: 92ad82002c39 ("RISC-V: KVM: Implement KVM_GET_ONE_REG/KVM_SET_ONE_REG ioctls") arch/riscv/kvm/vcpu.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) commit 4dee8eebcfc1a99d7550855ec40720503df4842b Author: Zheng Bin Date: Mon Apr 11 10:43:25 2022 +0800 drm/vc4: Fix build error when CONFIG_DRM_VC4=y && CONFIG_RASPBERRYPI_FIRMWARE=m If CONFIG_DRM_VC4=y, CONFIG_RASPBERRYPI_FIRMWARE=m, CONFIG_COMPILE_TEST=n, bulding fails: drivers/gpu/drm/vc4/vc4_drv.o: In function `vc4_drm_bind': vc4_drv.c:(.text+0x320): undefined reference to `rpi_firmware_get' vc4_drv.c:(.text+0x320): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `rpi_firmware_get' vc4_drv.c:(.text+0x34c): undefined reference to `rpi_firmware_property' vc4_drv.c:(.text+0x34c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `rpi_firmware_property' vc4_drv.c:(.text+0x354): undefined reference to `rpi_firmware_put' vc4_drv.c:(.text+0x354): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `rpi_firmware_put' Make DRM_VC4 depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE) to fix this. Fixes: c406ad5e4a85 ("drm/vc4: Notify the firmware when DRM is in charge") Reported-by: Hulk Robot Signed-off-by: Zheng Bin Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220411024325.3968413-1-zhengbin13@huawei.com drivers/gpu/drm/vc4/Kconfig | 3 +++ 1 file changed, 3 insertions(+) commit 5f18c0782b99e26121efa93d20b76c19e17aa1dd Author: Dave Stevenson Date: Fri Apr 15 18:25:13 2022 +0200 drm/panel/raspberrypi-touchscreen: Initialise the bridge in prepare The panel has a prepare call which is before video starts, and an enable call which is after. The Toshiba bridge should be configured before video, so move the relevant power and initialisation calls to prepare. Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.") Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220415162513.42190-3-stefan.wahren@i2se.com drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit f92055ae0acb035891e988ce345d6b81a0316423 Author: Dave Stevenson Date: Fri Apr 15 18:25:12 2022 +0200 drm/panel/raspberrypi-touchscreen: Avoid NULL deref if not initialised If a call to rpi_touchscreen_i2c_write from rpi_touchscreen_probe fails before mipi_dsi_device_register_full is called, then in trying to log the error message if uses ts->dsi->dev when it is still NULL. Use ts->i2c->dev instead, which is initialised earlier in probe. Fixes: 2f733d6194bd ("drm/panel: Add support for the Raspberry Pi 7" Touchscreen.") Signed-off-by: Dave Stevenson Signed-off-by: Stefan Wahren Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220415162513.42190-2-stefan.wahren@i2se.com drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3ab75a793e4939519d288ef1994db73b8e2d1d86 Author: Atish Patra Date: Tue Apr 19 18:32:57 2022 -0700 RISC-V: KVM: Remove 's' & 'u' as valid ISA extension There are no ISA extension defined as 's' & 'u' in RISC-V specifications. The misa register defines 's' & 'u' bit as Supervisor/User privilege mode enabled. But it should not appear in the ISA extension in the device tree. Remove those from the allowed ISA extension for kvm. Fixes: a33c72faf2d7 ("RISC-V: KVM: Implement VCPU create, init and destroy functions") Signed-off-by: Atish Patra Signed-off-by: Anup Patel arch/riscv/kvm/vcpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 35a923a0b329c343e9e81d79518e2937eba06fcd Author: Bruno Thomsen Date: Thu Apr 14 10:12:02 2022 +0200 USB: serial: cp210x: add PIDs for Kamstrup USB Meter Reader Wireless reading of water and heat meters using 868 MHz wM-Bus mode C1. The two different product IDs allow detection of dongle antenna solution: - Internal antenna - External antenna using SMA connector https://www.kamstrup.com/en-en/water-solutions/water-meter-reading/usb-meter-reader Signed-off-by: Bruno Thomsen Link: https://lore.kernel.org/r/20220414081202.5591-1-bruno.thomsen@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold drivers/usb/serial/cp210x.c | 2 ++ 1 file changed, 2 insertions(+) commit b4a64ed6e7b857317070fcb9d87ff5d4a73be3e8 Author: Slark Xiao Date: Thu Apr 14 15:44:34 2022 +0800 USB: serial: option: add support for Cinterion MV32-WA/MV32-WB Add support for Cinterion device MV32-WA/MV32-WB. MV32-WA PID is 0x00F1, and MV32-WB PID is 0x00F2. Test evidence as below: T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=1e2d ProdID=00f1 Rev=05.04 S: Manufacturer=Cinterion S: Product=Cinterion PID 0x00F1 USB Mobile Broadband S: SerialNumber=78ada8c4 C: #Ifs= 6 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#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option I: If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0 D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=1e2d ProdID=00f2 Rev=05.04 S: Manufacturer=Cinterion S: Product=Cinterion PID 0x00F2 USB Mobile Broadband S: SerialNumber=cdd06a78 C: #Ifs= 6 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#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option I: If#=0x3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option Interface 0&1: MBIM, 2:Modem, 3: GNSS, 4: NMEA, 5: Diag GNSS port don't use serial driver. Signed-off-by: Slark Xiao Link: https://lore.kernel.org/r/20220414074434.5699-1-slark_xiao@163.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+) commit bb02330408a7bde33b5f46aa14fd5d7bfe6093b7 Author: José Roberto de Souza Date: Thu Apr 14 08:11:17 2022 -0700 drm/i915/display/psr: Unset enable_psr2_sel_fetch if other checks in intel_psr2_config_valid() fails If any of the PSR2 checks after intel_psr2_sel_fetch_config_valid() fails, enable_psr2_sel_fetch will be kept enabled causing problems in the functions that only checks for it and not for has_psr2. So here moving the check that do not depend on enable_psr2_sel_fetch and for the remaning ones jumping to a section that unset enable_psr2_sel_fetch in case of failure to support PSR2. Fixes: 6e43e276b8c9 ("drm/i915: Initial implementation of PSR2 selective fetch") Cc: Jouni Högander Reviewed-by: Jouni Högander Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220414151118.21980-1-jose.souza@intel.com (cherry picked from commit 554ae8dce1268789e72767a67f0635cb743b3cea) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/display/intel_psr.c | 38 ++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 17 deletions(-) commit f81f7861ee2aaa6f652f18e8f622547bdd379724 Author: Randy Dunlap Date: Sat Apr 2 20:13:55 2022 -0700 cpuidle: riscv: support non-SMP config Add for cpuid_to_hartid_map etc. This is needed for both SMP and non-SMP builds, but not having it causes a build error for non-SMP: drivers/cpuidle/cpuidle-riscv-sbi.c: In function 'sbi_cpuidle_init_cpu': drivers/cpuidle/cpuidle-riscv-sbi.c:350:26: error: implicit declaration of function 'cpuid_to_hartid_map' [-Werror=implicit-function-declaration] Fixes: 6abf32f1d9c5 ("cpuidle: Add RISC-V SBI CPU idle driver") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt drivers/cpuidle/cpuidle-riscv-sbi.c | 1 + 1 file changed, 1 insertion(+) commit 08feafe8d1958febf3a9733a3d1564d8fc23340e Author: Josh Poimboeuf Date: Mon Apr 11 16:10:32 2022 -0700 objtool: Fix function fallthrough detection for vmlinux Objtool's function fallthrough detection only works on C objects. The distinction between C and assembly objects no longer makes sense with objtool running on vmlinux.o. Now that copy_user_64.S has been fixed up, and an objtool sibling call detection bug has been fixed, the asm code is in "compliance" and this hack is no longer needed. Remove it. Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/b434cff98eca3a60dcc64c620d7d5d405a0f441c.1649718562.git.jpoimboe@redhat.com tools/objtool/check.c | 2 +- tools/objtool/include/objtool/objtool.h | 2 +- tools/objtool/objtool.c | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) commit 34c861e806478ac2ea4032721defbf1d6967df08 Author: Josh Poimboeuf Date: Mon Apr 11 16:10:31 2022 -0700 objtool: Fix sibling call detection in alternatives In add_jump_destinations(), sibling call detection requires 'insn->func' to be valid. But alternative instructions get their 'func' set in handle_group_alt(), which runs *after* add_jump_destinations(). So sibling calls in alternatives code don't get properly detected. Fix that by changing the initialization order: call add_special_section_alts() *before* add_jump_destinations(). This also means the special case for a missing 'jump_dest' in add_jump_destinations() can be removed, as it has already been dealt with. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/c02e0a0a2a4286b5f848d17c77fdcb7e0caf709c.1649718562.git.jpoimboe@redhat.com tools/objtool/check.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) commit 26ff604102c98df79c3fe2614d1b9bb068d4c28c Author: Josh Poimboeuf Date: Mon Apr 11 16:10:30 2022 -0700 objtool: Don't set 'jump_dest' for sibling calls For most sibling calls, 'jump_dest' is NULL because objtool treats the jump like a call and sets 'call_dest'. But there are a few edge cases where that's not true. Make it consistent to avoid unexpected behavior. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/8737d6b9d1691831aed73375f444f0f42da3e2c9.1649718562.git.jpoimboe@redhat.com tools/objtool/check.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) commit 02041b32256628aef0d18ec15d3658fe41bc1afe Author: Josh Poimboeuf Date: Mon Apr 11 16:10:29 2022 -0700 x86/uaccess: Don't jump between functions For unwinding sanity, a function shouldn't jump to the middle of another function. Move the short string user copy code out to a separate non-function code snippet. Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/9519e4853148b765e047967708f2b61e56c93186.1649718562.git.jpoimboe@redhat.com arch/x86/lib/copy_user_64.S | 87 +++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 35 deletions(-) commit 4cdfc11b2836e659c0b7b31152a8b0d976167b59 Author: Nur Hussein Date: Mon Apr 18 03:24:54 2022 +0800 x86/Kconfig: fix the spelling of 'becoming' in X86_KERNEL_IBT config There is only one m in becoming. Signed-off-by: Nur Hussein Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220417192454.10247-1-hussein@unixcat.org arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1d08b92fa2c41c43e4efe9787413e9ac9a434f83 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:30 2022 -0700 objtool: Use offstr() to print address of missing ENDBR Fixes: 89bc853eae4a ("objtool: Find unused ENDBR instructions") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/95d12e800c736a3f7d08d61dabb760b2d5251a8e.1650300597.git.jpoimboe@redhat.com tools/objtool/check.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 4baae989e638e9bf4b7d29bc5e36b581fddcca52 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:29 2022 -0700 objtool: Print data address for "!ENDBR" data warnings When a "!ENDBR" warning is reported for a data section, objtool just prints the text address of the relocation target twice, without giving any clues about the location of the original data reference: vmlinux.o: warning: objtool: dcbnl_netdevice_event()+0x0: .text+0xb64680: data relocation to !ENDBR: dcbnl_netdevice_event+0x0 Instead, print the address of the data reference, in addition to the address of the relocation target. vmlinux.o: warning: objtool: dcbnl_nb+0x0: .data..read_mostly+0xe260: data relocation to !ENDBR: dcbnl_netdevice_event+0x0 Fixes: 89bc853eae4a ("objtool: Find unused ENDBR instructions") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/762e88d51300e8eaf0f933a5b0feae20ac033bea.1650300597.git.jpoimboe@redhat.com tools/objtool/check.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 1ab80a0da4c4a4dd496fc14faabbc8bde61a605c Author: Josh Poimboeuf Date: Mon Apr 18 09:50:25 2022 -0700 x86/xen: Add ANNOTATE_NOENDBR to startup_xen() The startup_xen() kernel entry point is referenced by the ".note.Xen" section, and is the real entry point of the VM. Control transfer is through IRET, which *could* set NEED_ENDBR, however Xen currently does no such thing. Add ANNOTATE_NOENDBR to silence future objtool warnings. Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andrew Cooper Link: https://lkml.kernel.org/r/a87bd48b06d11ec4b98122a429e71e489b4e48c3.1650300597.git.jpoimboe@redhat.com arch/x86/xen/xen-head.S | 1 + 1 file changed, 1 insertion(+) commit 7a00829f8ac3f76b3a3aa5c28ce4ddfd2f977bbe Author: Josh Poimboeuf Date: Mon Apr 18 09:50:24 2022 -0700 x86/uaccess: Add ENDBR to __put_user_nocheck*() The __put_user_nocheck*() inner labels are exported, so in keeping with the "allow exported functions to be indirectly called" policy, add ENDBR. Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/207f02177a23031091d1a608de6049a9e5e8ff80.1650300597.git.jpoimboe@redhat.com arch/x86/lib/putuser.S | 4 ++++ 1 file changed, 4 insertions(+) commit 1c0513dec41e4d40eb21402dff397ad84ca13a44 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:23 2022 -0700 x86/retpoline: Add ANNOTATE_NOENDBR for retpolines The retpolines are exported, so they're referenced by ksymtab sections. But they're never indirect-branched to, so add ANNOTATE_NOENDBR. Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/b6ec963dfd9301b6b1d74ef7758fcb0b540d6c6c.1650300597.git.jpoimboe@redhat.com arch/x86/lib/retpoline.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 613871cd665ab26290c5ff531dd06c3789d31319 Author: Josh Poimboeuf Date: Mon Apr 18 09:50:22 2022 -0700 x86/static_call: Add ANNOTATE_NOENDBR to static call trampoline The static call trampoline is never indirect-branched to, but is referenced by the static call key. Add ANNOTATE_NOENDBR. Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/1b5b54aad7d81241dabe5e0c9b40dea64b540b00.1650300597.git.jpoimboe@redhat.com arch/x86/include/asm/static_call.h | 1 + 1 file changed, 1 insertion(+) commit 4a5de9b76fcb3f477f73d5a63f6e27709e8af81f Author: Josh Poimboeuf Date: Mon Apr 18 09:50:20 2022 -0700 objtool: Enable unreachable warnings for CLANG LTO With IBT support in, objtool is now fully capable of following vmlinux code flow in LTO mode. Start reporting unreachable warnings for Clang LTO as well. Fixes: ed53a0d97192 ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/7b12df54bceeb0761fe9fc8269ea0c00501214a9.1650300597.git.jpoimboe@redhat.com scripts/Makefile.build | 2 +- scripts/link-vmlinux.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit d66e9d50ea5cd76b2c4875c758efad665283d7ad Author: Peter Zijlstra Date: Fri Apr 8 11:45:56 2022 +0200 x86,objtool: Explicitly mark idtentry_body()s tail REACHABLE Objtool can figure out that some \cfunc()s are noreturn and then complains about certain instances having unreachable tails: vmlinux.o: warning: objtool: asm_exc_xen_unknown_trap()+0x16: unreachable instruction Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220408094718.441854969@infradead.org arch/x86/entry/entry_64.S | 3 +++ 1 file changed, 3 insertions(+) commit d4e5268a08b211b536fed29beb24271ecd85187e Author: Peter Zijlstra Date: Fri Apr 8 11:45:55 2022 +0200 x86,objtool: Mark cpu_startup_entry() __noreturn GCC-8 isn't clever enough to figure out that cpu_start_entry() is a noreturn while objtool is. This results in code after the call in start_secondary(). Give GCC a hand so that they all agree on things. vmlinux.o: warning: objtool: start_secondary()+0x10e: unreachable Reported-by: Rick Edgecombe Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220408094718.383658532@infradead.org include/linux/cpu.h | 2 +- tools/objtool/check.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) commit 2730d3c14a85617c177337f2e2af2108bf82c4ca Author: Peter Zijlstra Date: Fri Apr 8 11:45:54 2022 +0200 x86,xen,objtool: Add UNWIND hint SYM_CODE_START*() doesn't get auto-validated and needs an UNWIND hint to get checked, add one. vmlinux.o: warning: objtool: pvh_start_xen()+0x0: unreachable Reported-by: Thomas Gleixner Reported-by: Rick Edgecombe Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220408094718.321246297@infradead.org arch/x86/platform/pvh/head.S | 1 + 1 file changed, 1 insertion(+) commit 226d44acf6dfe71c9df5804b82364e93cf908b53 Author: Peter Zijlstra Date: Fri Apr 8 11:45:53 2022 +0200 lib/strn*,objtool: Enforce user_access_begin() rules Apparently GCC can fail to inline a 'static inline' single caller function: lib/strnlen_user.o: warning: objtool: strnlen_user()+0x33: call to do_strnlen_user() with UACCESS enabled lib/strncpy_from_user.o: warning: objtool: strncpy_from_user()+0x33: call to do_strncpy_from_user() with UACCESS enabled Reported-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220408094718.262932488@infradead.org lib/strncpy_from_user.c | 2 +- lib/strnlen_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 610abf3dea1092445b4b185e14ed130d1ec6aa74 Author: Josh Poimboeuf Date: Tue Apr 19 09:54:41 2022 -0700 MAINTAINERS: Add x86 unwinding entry Create a new section for x86 unwinder maintenance. Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/db2b764b735a9481df9f7717a3a1f75ba496fcc1.1650387176.git.jpoimboe@redhat.com Signed-off-by: Peter Zijlstra MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) commit 6c8ef58a50b5fab6e364b558143490a2014e2a4f Author: Dmitry Monakhov Date: Tue Apr 19 10:34:16 2022 +0300 x86/unwind/orc: Recheck address range after stack info was updated A crash was observed in the ORC unwinder: BUG: stack guard page was hit at 000000000dd984a2 (stack is 00000000d1caafca..00000000613712f0) kernel stack overflow (page fault): 0000 [#1] SMP NOPTI CPU: 93 PID: 23787 Comm: context_switch1 Not tainted 5.4.145 #1 RIP: 0010:unwind_next_frame Call Trace: perf_callchain_kernel get_perf_callchain perf_callchain perf_prepare_sample perf_event_output_forward __perf_event_overflow perf_ibs_handle_irq perf_ibs_nmi_handler nmi_handle default_do_nmi do_nmi end_repeat_nmi This was really two bugs: 1) The perf IBS code passed inconsistent regs to the unwinder. 2) The unwinder didn't handle the bad input gracefully. Fix the latter bug. The ORC unwinder needs to be immune against bad inputs. The problem is that stack_access_ok() doesn't recheck the validity of the full range of registers after switching to the next valid stack with get_stack_info(). Fix that. [ jpoimboe: rewrote commit log ] Signed-off-by: Dmitry Monakhov Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/1650353656-956624-1-git-send-email-dmtrmonakhov@yandex-team.ru Signed-off-by: Peter Zijlstra arch/x86/kernel/unwind_orc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 528c9f1daf20da14d3e7348dc4b1d7c55743ee64 Author: Zhang Rui Date: Fri Apr 15 18:45:20 2022 +0800 perf/x86/cstate: Add SAPPHIRERAPIDS_X CPU support From the perspective of Intel cstate residency counters, SAPPHIRERAPIDS_X is the same as ICELAKE_X. Share the code with it. And update the comments for SAPPHIRERAPIDS_X. Signed-off-by: Zhang Rui Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kan Liang Link: https://lkml.kernel.org/r/20220415104520.2737004-1-rui.zhang@intel.com arch/x86/events/intel/cstate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 60490e7966659b26d74bf1fa4aa8693d9a94ca88 Author: Zhipeng Xie Date: Wed Feb 9 09:54:17 2022 -0500 perf/core: Fix perf_mmap fail when CONFIG_PERF_USE_VMALLOC enabled This problem can be reproduced with CONFIG_PERF_USE_VMALLOC enabled on both x86_64 and aarch64 arch when using sysdig -B(using ebpf)[1]. sysdig -B works fine after rebuilding the kernel with CONFIG_PERF_USE_VMALLOC disabled. I tracked it down to the if condition event->rb->nr_pages != nr_pages in perf_mmap is true when CONFIG_PERF_USE_VMALLOC is enabled where event->rb->nr_pages = 1 and nr_pages = 2048 resulting perf_mmap to return -EINVAL. This is because when CONFIG_PERF_USE_VMALLOC is enabled, rb->nr_pages is always equal to 1. Arch with CONFIG_PERF_USE_VMALLOC enabled by default: arc/arm/csky/mips/sh/sparc/xtensa Arch with CONFIG_PERF_USE_VMALLOC disabled by default: x86_64/aarch64/... Fix this problem by using data_page_nr() [1] https://github.com/draios/sysdig Fixes: 906010b2134e ("perf_event: Provide vmalloc() based mmap() backing") Signed-off-by: Zhipeng Xie Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220209145417.6495-1-xiezhipeng1@huawei.com kernel/events/core.c | 2 +- kernel/events/internal.h | 5 +++++ kernel/events/ring_buffer.c | 5 ----- 3 files changed, 6 insertions(+), 6 deletions(-) commit 40f5aa4c5eaebfeaca4566217cb9c468e28ed682 Author: kuyo chang Date: Thu Apr 14 17:02:20 2022 +0800 sched/pelt: Fix attach_entity_load_avg() corner case The warning in cfs_rq_is_decayed() triggered: SCHED_WARN_ON(cfs_rq->avg.load_avg || cfs_rq->avg.util_avg || cfs_rq->avg.runnable_avg) There exists a corner case in attach_entity_load_avg() which will cause load_sum to be zero while load_avg will not be. Consider se_weight is 88761 as per the sched_prio_to_weight[] table. Further assume the get_pelt_divider() is 47742, this gives: se->avg.load_avg is 1. However, calculating load_sum: se->avg.load_sum = div_u64(se->avg.load_avg * se->avg.load_sum, se_weight(se)); se->avg.load_sum = 1*47742/88761 = 0. Then enqueue_load_avg() adds this to the cfs_rq totals: cfs_rq->avg.load_avg += se->avg.load_avg; cfs_rq->avg.load_sum += se_weight(se) * se->avg.load_sum; Resulting in load_avg being 1 with load_sum is 0, which will trigger the WARN. Fixes: f207934fb79d ("sched/fair: Align PELT windows between cfs_rq and its se") Signed-off-by: kuyo chang [peterz: massage changelog] Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Tested-by: Dietmar Eggemann Link: https://lkml.kernel.org/r/20220414090229.342-1-kuyo.chang@mediatek.com kernel/sched/fair.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 559089e0a93d44280ec3ab478830af319c56dbe3 Author: Song Liu Date: Fri Apr 15 09:44:10 2022 -0700 vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP Huge page backed vmalloc memory could benefit performance in many cases. However, some users of vmalloc may not be ready to handle huge pages for various reasons: hardware constraints, potential pages split, etc. VM_NO_HUGE_VMAP was introduced to allow vmalloc users to opt-out huge pages. However, it is not easy to track down all the users that require the opt-out, as the allocation are passed different stacks and may cause issues in different layers. To address this issue, replace VM_NO_HUGE_VMAP with an opt-in flag, VM_ALLOW_HUGE_VMAP, so that users that benefit from huge pages could ask specificially. Also, remove vmalloc_no_huge() and add opt-in helper vmalloc_huge(). Fixes: fac54e2bfb5b ("x86/Kconfig: Select HAVE_ARCH_HUGE_VMALLOC with HAVE_ARCH_HUGE_VMAP") Link: https://lore.kernel.org/netdev/14444103-d51b-0fb3-ee63-c3f182f0b546@molgen.mpg.de/" Reviewed-by: Christoph Hellwig Signed-off-by: Song Liu Reviewed-by: Rik van Riel Signed-off-by: Linus Torvalds arch/Kconfig | 6 ++---- arch/powerpc/kernel/module.c | 2 +- arch/s390/kvm/pv.c | 7 +------ include/linux/vmalloc.h | 4 ++-- mm/vmalloc.c | 17 ++++++++++------- 5 files changed, 16 insertions(+), 20 deletions(-) commit f9e14dbbd454581061c736bf70bf5cbb15ac927c Author: Borislav Petkov Date: Tue Apr 19 09:52:41 2022 -0700 x86/cpu: Load microcode during restore_processor_state() When resuming from system sleep state, restore_processor_state() restores the boot CPU MSRs. These MSRs could be emulated by microcode. If microcode is not loaded yet, writing to emulated MSRs leads to unchecked MSR access error: ... PM: Calling lapic_suspend+0x0/0x210 unchecked MSR access error: WRMSR to 0x10f (tried to write 0x0...0) at rIP: ... (native_write_msr) Call Trace: ? restore_processor_state x86_acpi_suspend_lowlevel acpi_suspend_enter suspend_devices_and_enter pm_suspend.cold state_store kobj_attr_store sysfs_kf_write kernfs_fop_write_iter new_sync_write vfs_write ksys_write __x64_sys_write do_syscall_64 entry_SYSCALL_64_after_hwframe RIP: 0033:0x7fda13c260a7 To ensure microcode emulated MSRs are available for restoration, load the microcode on the boot CPU before restoring these MSRs. [ Pawan: write commit message and productize it. ] Fixes: e2a1256b17b1 ("x86/speculation: Restore speculation related MSRs during S3 resume") Reported-by: Kyle D. Pelton Signed-off-by: Borislav Petkov Signed-off-by: Pawan Gupta Tested-by: Kyle D. Pelton Cc: stable@vger.kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=215841 Link: https://lore.kernel.org/r/4350dfbf785cd482d3fafa72b2b49c83102df3ce.1650386317.git.pawan.kumar.gupta@linux.intel.com arch/x86/include/asm/microcode.h | 2 ++ arch/x86/kernel/cpu/microcode/core.c | 6 +++--- arch/x86/power/cpu.c | 10 +++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) commit 0371870b96907bf560ecf7dc3fadc238fadf7845 Author: Dmitry Baryshkov Date: Tue Apr 19 16:04:22 2022 +0300 drm/msm: Revert "drm/msm: Stop using iommu_present()" This reverts commit e2a88eabb02410267519b838fb9b79f5206769be. The commit in question makes msm_use_mmu() check whether the DRM 'component master' device is translated by the IOMMU. At this moment it is the 'mdss' device. However on platforms using the MDP5 driver (e.g. MSM8916/APQ8016, MSM8996/APQ8096) it's the mdp5 device, which has the iommus property (and thus is "translated by the IOMMU"). This results in these devices being broken with the following lines in the dmesg. [drm] Initialized msm 1.9.0 20130625 for 1a00000.mdss on minor 0 msm 1a00000.mdss: [drm:adreno_request_fw] loaded qcom/a300_pm4.fw from new location msm 1a00000.mdss: [drm:adreno_request_fw] loaded qcom/a300_pfp.fw from new location msm 1a00000.mdss: [drm:get_pages] *ERROR* could not get pages: -28 msm 1a00000.mdss: could not allocate stolen bo msm 1a00000.mdss: [drm:get_pages] *ERROR* could not get pages: -28 msm 1a00000.mdss: [drm:msm_alloc_stolen_fb] *ERROR* failed to allocate buffer object msm 1a00000.mdss: [drm:msm_fbdev_create] *ERROR* failed to allocate fb Getting the mdp5 device pointer from this function is not that easy at this moment. Thus this patch is reverted till the MDSS rework [1] lands. It will make the mdp5/dpu1 device component master and the check will be legit. [1] https://patchwork.freedesktop.org/series/98525/ Fixes: e2a88eabb024 ("drm/msm: Stop using iommu_present()") Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220419130422.1033699-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark drivers/gpu/drm/msm/msm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b7f73403a3e922c20bb278ba3cfcc3c61930d82a Merge: 705191b03d50 8c235cc25087 Author: Linus Torvalds Date: Tue Apr 19 10:30:43 2022 -0700 Merge tag 'spi-fix-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A few more fixes for SPI, plus one new PCI ID for another Intel chipset. All device specific stuff" * tag 'spi-fix-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller spi: cadence-quadspi: fix incorrect supports_op() return value spi: intel: Add support for Raptor Lake-S SPI serial flash spi: spi-mtk-nor: initialize spi controller after resume commit 9dca4168a37c9cfe182f077f0d2289292e9e3656 Author: Coly Li Date: Wed Apr 20 00:04:25 2022 +0800 bcache: fix wrong bdev parameter when calling bio_alloc_clone() in do_bio_hook() Commit abfc426d1b2f ("block: pass a block_device to bio_clone_fast") calls the modified bio_alloc_clone() in bcache code as: bio_init_clone(bio->bi_bdev, bio, orig_bio, GFP_NOIO); But the first parameter is wrong, where bio->bi_bdev should be orig_bio->bi_bdev. The wrong bi_bdev panics the kernel when submitting cache bio. This patch fixes the wrong bdev parameter usage and avoid the panic. Fixes: abfc426d1b2f ("block: pass a block_device to bio_clone_fast") Signed-off-by: Coly Li Cc: Christoph Hellwig Cc: Mike Snitzer Link: https://lore.kernel.org/r/20220419160425.4148-3-colyli@suse.de Signed-off-by: Jens Axboe drivers/md/bcache/request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ff2695e52c9936febf65aa36a1769881da71bec5 Author: Coly Li Date: Wed Apr 20 00:04:24 2022 +0800 bcache: put bch_bio_map() back to correct location in journal_write_unlocked() Commit a7c50c940477 ("block: pass a block_device and opf to bio_reset") moves bch_bio_map() inside journal_write_unlocked() next to the location where the modified bio_reset() was called. This change is wrong because calling bch_bio_map() immediately after bio_reset(), a BUG_ON(!bio->bi_iter.bi_size) inside bch_bio_map() will be triggered and panic the kernel. This patch puts bch_bio_map() back to its original correct location in journal_write_unlocked() and avoid the BUG_ON(). Fixes: a7c50c940477 ("block: pass a block_device and opf to bio_reset") Signed-off-by: Coly Li Cc: Christoph Hellwig Cc: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220419160425.4148-2-colyli@suse.de Signed-off-by: Jens Axboe drivers/md/bcache/journal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 705191b03d507744c7e097f78d583621c14988ac Author: Christian Brauner Date: Tue Apr 19 15:14:23 2022 +0200 fs: fix acl translation Last cycle we extended the idmapped mounts infrastructure to support idmapped mounts of idmapped filesystems (No such filesystem yet exist.). Since then, the meaning of an idmapped mount is a mount whose idmapping is different from the filesystems idmapping. While doing that work we missed to adapt the acl translation helpers. They still assume that checking for the identity mapping is enough. But they need to use the no_idmapping() helper instead. Note, POSIX ACLs are always translated right at the userspace-kernel boundary using the caller's current idmapping and the initial idmapping. The order depends on whether we're coming from or going to userspace. The filesystem's idmapping doesn't matter at the border. Consequently, if a non-idmapped mount is passed we need to make sure to always pass the initial idmapping as the mount's idmapping and not the filesystem idmapping. Since it's irrelevant here it would yield invalid ids and prevent setting acls for filesystems that are mountable in a userns and support posix acls (tmpfs and fuse). I verified the regression reported in [1] and verified that this patch fixes it. A regression test will be added to xfstests in parallel. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215849 [1] Fixes: bd303368b776 ("fs: support mapped mounts of mapped filesystems") Cc: Seth Forshee Cc: Christoph Hellwig Cc: # 5.17 Cc: Signed-off-by: Christian Brauner (Microsoft) Signed-off-by: Linus Torvalds fs/posix_acl.c | 10 ++++++++++ fs/xattr.c | 6 ++++-- include/linux/posix_acl_xattr.h | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) commit 679ab61bf5f5f519377d812afb4fb93634782c74 Author: Duoming Zhou Date: Mon Apr 18 23:33:22 2022 +0800 RDMA/irdma: Fix deadlock in irdma_cleanup_cm_core() There is a deadlock in irdma_cleanup_cm_core(), which is shown below: (Thread 1) | (Thread 2) | irdma_schedule_cm_timer() irdma_cleanup_cm_core() | add_timer() spin_lock_irqsave() //(1) | (wait a time) ... | irdma_cm_timer_tick() del_timer_sync() | spin_lock_irqsave() //(2) (wait timer to stop) | ... We hold cm_core->ht_lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need cm_core->ht_lock in position (2) of thread 2. As a result, irdma_cleanup_cm_core() will block forever. This patch removes the check of timer_pending() in irdma_cleanup_cm_core(), because the del_timer_sync() function will just return directly if there isn't a pending timer. As a result, the lock is redundant, because there is no resource it could protect. Link: https://lore.kernel.org/r/20220418153322.42524-1-duoming@zju.edu.cn Signed-off-by: Duoming Zhou Reviewed-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/irdma/cm.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) commit 0aea30a07ec6b50de0fc5f5b2ec34a68ead86b61 Merge: 4ddef9c4d70a 5b933c7262c5 Author: Takashi Iwai Date: Tue Apr 19 17:26:01 2022 +0200 Merge tag 'asoc-fix-v5.18-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.18 A collection of fixes that came in since the merge window, plus one new device ID for an x86 laptop. Nothing that really stands out with particularly big impact outside of the affected device. commit 71d471e3faf90c9674cadc7605ac719e82cb7fac Author: Dan Vacura Date: Thu Mar 31 13:40:23 2022 -0500 usb: gadget: uvc: Fix crash when encoding data for usb request During the uvcg_video_pump() process, if an error occurs and uvcg_queue_cancel() is called, the buffer queue will be cleared out, but the current marker (queue->buf_used) of the active buffer (no longer active) is not reset. On the next iteration of uvcg_video_pump() the stale buf_used count will be used and the logic of min((unsigned int)len, buf->bytesused - queue->buf_used) may incorrectly calculate a nbytes size, causing an invalid memory access. [80802.185460][ T315] configfs-gadget gadget: uvc: VS request completed with status -18. [80802.185519][ T315] configfs-gadget gadget: uvc: VS request completed with status -18. ... uvcg_queue_cancel() is called and the queue is cleared out, but the marker queue->buf_used is not reset. ... [80802.262328][ T8682] Unable to handle kernel paging request at virtual address ffffffc03af9f000 ... ... [80802.263138][ T8682] Call trace: [80802.263146][ T8682] __memcpy+0x12c/0x180 [80802.263155][ T8682] uvcg_video_pump+0xcc/0x1e0 [80802.263165][ T8682] process_one_work+0x2cc/0x568 [80802.263173][ T8682] worker_thread+0x28c/0x518 [80802.263181][ T8682] kthread+0x160/0x170 [80802.263188][ T8682] ret_from_fork+0x10/0x18 [80802.263198][ T8682] Code: a8c12829 a88130cb a8c130 Fixes: d692522577c0 ("usb: gadget/uvc: Port UVC webcam gadget to use videobuf2 framework") Cc: Signed-off-by: Dan Vacura Link: https://lore.kernel.org/r/20220331184024.23918-1-w36195@motorola.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/function/uvc_queue.c | 2 ++ 1 file changed, 2 insertions(+) commit 0fdf977d4576ee0decd612e22f6a837a239573cc Author: Christoph Hellwig Date: Thu Mar 24 17:06:28 2022 +0100 btrfs: fix direct I/O writes for split bios on zoned devices When a bio is split in btrfs_submit_direct, dip->file_offset contains the file offset for the first bio. But this means the start value used in btrfs_end_dio_bio to record the write location for zone devices is incorrect for subsequent bios. CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Johannes Thumshirn Reviewed-by: Naohiro Aota Reviewed-by: Qu Wenruo Reviewed-by: Sweet Tea Dorminy Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba fs/btrfs/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 00d825258bcc09c0e1b99aa7f9ad7d2c2fad41fa Author: Christoph Hellwig Date: Thu Mar 24 17:06:27 2022 +0100 btrfs: fix direct I/O read repair for split bios When a bio is split in btrfs_submit_direct, dip->file_offset contains the file offset for the first bio. But this means the start value used in btrfs_check_read_dio_bio is incorrect for subsequent bios. Add a file_offset field to struct btrfs_bio to pass along the correct offset. Given that check_data_csum only uses start of an error message this means problems with this miscalculation will only show up when I/O fails or checksums mismatch. The logic was removed in f4f39fc5dc30 ("btrfs: remove btrfs_bio::logical member") but we need it due to the bio splitting. CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Johannes Thumshirn Reviewed-by: Naohiro Aota Reviewed-by: Qu Wenruo Reviewed-by: Sweet Tea Dorminy Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba fs/btrfs/extent_io.c | 1 + fs/btrfs/inode.c | 13 +++++-------- fs/btrfs/volumes.h | 3 +++ 3 files changed, 9 insertions(+), 8 deletions(-) commit 50f1cff3d8865909727fad6f960ce5a050799d00 Author: Christoph Hellwig Date: Thu Mar 24 17:52:10 2022 +0100 btrfs: fix and document the zoned device choice in alloc_new_bio Zone Append bios only need a valid block device in struct bio, but not the device in the btrfs_bio. Use the information from btrfs_zoned_get_device to set up bi_bdev and fix zoned writes on multi-device file system with non-homogeneous capabilities and remove the pointless btrfs_bio.device assignment. Add big fat comments explaining what is going on here. Reviewed-by: Johannes Thumshirn Reviewed-by: Naohiro Aota Signed-off-by: Christoph Hellwig Signed-off-by: David Sterba fs/btrfs/extent_io.c | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) commit 50ff57888d0b13440e7f4cde05dc339ee8d0f1f8 Author: Filipe Manana Date: Wed Apr 6 17:07:54 2022 +0100 btrfs: fix leaked plug after failure syncing log on zoned filesystems On a zoned filesystem, if we fail to allocate the root node for the log root tree while syncing the log, we end up returning without finishing the IO plug we started before, resulting in leaking resources as we have started writeback for extent buffers of a log tree before. That allocation failure, which typically is either -ENOMEM or -ENOSPC, is not fatal and the fsync can safely fallback to a full transaction commit. So release the IO plug if we fail to allocate the extent buffer for the root of the log root tree when syncing the log on a zoned filesystem. Fixes: 3ddebf27fcd3a9 ("btrfs: zoned: reorder log node allocation on zoned filesystem") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/tree-log.c | 1 + 1 file changed, 1 insertion(+) commit 99c07327ae11e24886d552dddbe4537bfca2765d Author: Eric Dumazet Date: Fri Apr 15 11:14:42 2022 -0700 netlink: reset network and mac headers in netlink_dump() netlink_dump() is allocating an skb, reserves space in it but forgets to reset network header. This allows a BPF program, invoked later from sk_filter() to access uninitialized kernel memory from the reserved space. Theorically mac header reset could be omitted, because it is set to a special initial value. bpf_internal_load_pointer_neg_helper calls skb_mac_header() without checking skb_mac_header_was_set(). Relying on skb->len not being too big seems fragile. We also could add a sanity check in bpf_internal_load_pointer_neg_helper() to avoid surprises in the future. syzbot report was: BUG: KMSAN: uninit-value in ___bpf_prog_run+0xa22b/0xb420 kernel/bpf/core.c:1637 ___bpf_prog_run+0xa22b/0xb420 kernel/bpf/core.c:1637 __bpf_prog_run32+0x121/0x180 kernel/bpf/core.c:1796 bpf_dispatcher_nop_func include/linux/bpf.h:784 [inline] __bpf_prog_run include/linux/filter.h:626 [inline] bpf_prog_run include/linux/filter.h:633 [inline] __bpf_prog_run_save_cb+0x168/0x580 include/linux/filter.h:756 bpf_prog_run_save_cb include/linux/filter.h:770 [inline] sk_filter_trim_cap+0x3bc/0x8c0 net/core/filter.c:150 sk_filter include/linux/filter.h:905 [inline] netlink_dump+0xe0c/0x16c0 net/netlink/af_netlink.c:2276 netlink_recvmsg+0x1129/0x1c80 net/netlink/af_netlink.c:2002 sock_recvmsg_nosec net/socket.c:948 [inline] sock_recvmsg net/socket.c:966 [inline] sock_read_iter+0x5a9/0x630 net/socket.c:1039 do_iter_readv_writev+0xa7f/0xc70 do_iter_read+0x52c/0x14c0 fs/read_write.c:786 vfs_readv fs/read_write.c:906 [inline] do_readv+0x432/0x800 fs/read_write.c:943 __do_sys_readv fs/read_write.c:1034 [inline] __se_sys_readv fs/read_write.c:1031 [inline] __x64_sys_readv+0xe5/0x120 fs/read_write.c:1031 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x44/0xae Uninit was stored to memory at: ___bpf_prog_run+0x96c/0xb420 kernel/bpf/core.c:1558 __bpf_prog_run32+0x121/0x180 kernel/bpf/core.c:1796 bpf_dispatcher_nop_func include/linux/bpf.h:784 [inline] __bpf_prog_run include/linux/filter.h:626 [inline] bpf_prog_run include/linux/filter.h:633 [inline] __bpf_prog_run_save_cb+0x168/0x580 include/linux/filter.h:756 bpf_prog_run_save_cb include/linux/filter.h:770 [inline] sk_filter_trim_cap+0x3bc/0x8c0 net/core/filter.c:150 sk_filter include/linux/filter.h:905 [inline] netlink_dump+0xe0c/0x16c0 net/netlink/af_netlink.c:2276 netlink_recvmsg+0x1129/0x1c80 net/netlink/af_netlink.c:2002 sock_recvmsg_nosec net/socket.c:948 [inline] sock_recvmsg net/socket.c:966 [inline] sock_read_iter+0x5a9/0x630 net/socket.c:1039 do_iter_readv_writev+0xa7f/0xc70 do_iter_read+0x52c/0x14c0 fs/read_write.c:786 vfs_readv fs/read_write.c:906 [inline] do_readv+0x432/0x800 fs/read_write.c:943 __do_sys_readv fs/read_write.c:1034 [inline] __se_sys_readv fs/read_write.c:1031 [inline] __x64_sys_readv+0xe5/0x120 fs/read_write.c:1031 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x44/0xae Uninit was created at: slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3244 [inline] __kmalloc_node_track_caller+0xde3/0x14f0 mm/slub.c:4972 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0x545/0xf90 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1158 [inline] netlink_dump+0x30f/0x16c0 net/netlink/af_netlink.c:2242 netlink_recvmsg+0x1129/0x1c80 net/netlink/af_netlink.c:2002 sock_recvmsg_nosec net/socket.c:948 [inline] sock_recvmsg net/socket.c:966 [inline] sock_read_iter+0x5a9/0x630 net/socket.c:1039 do_iter_readv_writev+0xa7f/0xc70 do_iter_read+0x52c/0x14c0 fs/read_write.c:786 vfs_readv fs/read_write.c:906 [inline] do_readv+0x432/0x800 fs/read_write.c:943 __do_sys_readv fs/read_write.c:1034 [inline] __se_sys_readv fs/read_write.c:1031 [inline] __x64_sys_readv+0xe5/0x120 fs/read_write.c:1031 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x44/0xae CPU: 0 PID: 3470 Comm: syz-executor751 Not tainted 5.17.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: db65a3aaf29e ("netlink: Trim skb to alloc size to avoid MSG_TRUNC") Fixes: 9063e21fb026 ("netlink: autosize skb lengthes") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20220415181442.551228-1-eric.dumazet@gmail.com Signed-off-by: Paolo Abeni net/netlink/af_netlink.c | 7 +++++++ 1 file changed, 7 insertions(+) commit b4f5c6b2e52b27462c0599e64e96e53b58438de1 Author: Mark Brown Date: Sat Apr 16 13:54:08 2022 +0100 ASoC: wm8958: Fix change notifications for DSP controls The WM8958 DSP controls all return 0 on successful write, not a boolean value indicating if the write changed the value of the control. Fix this by returning 1 after a change, there is already a check at the start of each put() that skips the function in the case that there is no change. Signed-off-by: Mark Brown Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220416125408.197440-1-broonie@kernel.org Cc: stable@vger.kernel.org sound/soc/codecs/wm8958-dsp2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 3ccce9340326df40ba4462d4d2a1692b6387a68e Author: Tony Luck Date: Mon Apr 11 16:37:03 2022 -0700 x86/cpu: Add new Alderlake and Raptorlake CPU model numbers Intel is subdividing the mobile segment with additional models with the same codename. Using the Intel "N" and "P" suffices for these will be less confusing than trying to map to some different naming convention. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/YlS7n7Xtso9BXZA2@agluck-desk3.sc.intel.com arch/x86/include/asm/intel-family.h | 3 +++ 1 file changed, 3 insertions(+) commit eba1a872cb73314280d5448d934935b23e30b7ca Author: Pengcheng Yang Date: Tue Apr 12 19:05:45 2022 +0800 ipvs: correctly print the memory size of ip_vs_conn_tab The memory size of ip_vs_conn_tab changed after we use hlist instead of list. Fixes: 731109e78415 ("ipvs: use hlist instead of list") Signed-off-by: Pengcheng Yang Acked-by: Julian Anastasov Acked-by: Simon Horman Signed-off-by: Pablo Neira Ayuso net/netfilter/ipvs/ip_vs_conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4cf35a2b627a020fe1a6b6fc7a6a12394644e474 Author: Vladimir Oltean Date: Fri Apr 15 18:19:50 2022 +0300 net: mscc: ocelot: fix broken IP multicast flooding When the user runs: bridge link set dev $br_port mcast_flood on this command should affect not only L2 multicast, but also IPv4 and IPv6 multicast. In the Ocelot switch, unknown multicast gets flooded according to different PGIDs according to its type, and PGID_MC only handles L2 multicast. Therefore, by leaving PGID_MCIPV4 and PGID_MCIPV6 at their default value of 0, unknown IP multicast traffic is never flooded. Fixes: 421741ea5672 ("net: mscc: ocelot: offload bridge port flags to device") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220415151950.219660-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni drivers/net/ethernet/mscc/ocelot.c | 2 ++ 1 file changed, 2 insertions(+) commit 0763120b090418a5257402754e22a34227ae5f12 Author: Kurt Kanzenbach Date: Fri Apr 15 12:33:20 2022 +0200 net: dsa: hellcreek: Calculate checksums in tagger In case the checksum calculation is offloaded to the DSA master network interface, it will include the switch trailing tag. As soon as the switch strips that tag on egress, the calculated checksum is wrong. Therefore, add the checksum calculation to the tagger (if required) before adding the switch tag. This way, the hellcreek code works with all DSA master interfaces regardless of their declared feature set. Fixes: 01ef09caad66 ("net: dsa: Add tag handling for Hirschmann Hellcreek switches") Signed-off-by: Kurt Kanzenbach Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220415103320.90657-1-kurt@linutronix.de Signed-off-by: Paolo Abeni net/dsa/tag_hellcreek.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 9df1e3ff60241ce3fb26db75933970dd1b871213 Author: Manasi Navare Date: Thu Mar 3 15:32:22 2022 -0800 drm/i915/display/vrr: Reset VRR capable property on a long hpd With some VRR panels, user can turn VRR ON/OFF on the fly from the panel settings. When VRR is turned OFF ,sends a long HPD to the driver clearing the Ignore MSA bit in the DPCD. Currently the driver parses that onevery HPD but fails to reset the corresponding VRR Capable Connector property. Hence the userspace still sees this as VRR Capable panel which is incorrect. Fix this by explicitly resetting the connector property. v2: Reset vrr capable if status == connector_disconnected v3: Use i915 and use bool vrr_capable (Jani Nikula) v4: Move vrr_capable to after update modes call (Jani N) Remove the redundant comment (Jan N) v5: Fixes the regression on older platforms by resetting the VRR only if HAS_VRR v6: Remove the checks from driver, add in drm core before setting VRR prop (Ville) v7: Move VRR set/reset to set/unset_edid (Ville) Cc: Jani Nikula Cc: Ville Syrjälä Fixes: 9bc34b4d0f3c ("drm/i915/display/vrr: Reset VRR capable property on a long hpd") Signed-off-by: Manasi Navare Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220303233222.4698-1-manasi.d.navare@intel.com (cherry picked from commit d999ad1079f574be06a8f1701cd24a5dc0ada48c) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/display/intel_dp.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) commit 4ddef9c4d70aae0c9029bdec7c3f7f1c1c51ff8c Author: Maurizio Avogadro Date: Mon Apr 18 15:16:12 2022 +0200 ALSA: usb-audio: add mapping for MSI MAG X570S Torpedo MAX. The USB audio device 0db0:a073 based on the Realtek ALC4080 chipset exposes all playback volume controls as "PCM". This makes distinguishing the individual functions hard. The mapping already adopted for device 0db0:419c based on the same chipset fixes the issue, apply it for this device too. Signed-off-by: Maurizio Avogadro Cc: Link: https://lore.kernel.org/r/Yl1ykPaGgsFf3SnW@ryzen Signed-off-by: Takashi Iwai sound/usb/mixer_maps.c | 4 ++++ 1 file changed, 4 insertions(+) commit 00fd7cfad0548b6b7234c93370076f9b9c2e39f8 Author: Lucas De Marchi Date: Fri Apr 15 23:44:18 2022 -0700 ALSA: hda/i915: Fix one too many pci_dev_put() pci_get_class() will already unref the pci device passed as argument. So if it's unconditionally unref'ed, even if the loop is not stopped, there will be one too many unref for each device not matched. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5701 Fixes: c9db8a30d9f0 ("ALSA: hda/i915 - skip acomp init if no matching display") Signed-off-by: Lucas De Marchi Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220416064418.2364582-1-lucas.demarchi@intel.com Signed-off-by: Takashi Iwai sound/hda/hdac_i915.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit faad6cebded8e0fd902b672f220449b93db479eb Author: Tom Rix Date: Mon Apr 11 13:47:56 2022 -0400 scsi: sr: Do not leak information in ioctl sr_ioctl.c uses this pattern: result = sr_do_ioctl(cd, &cgc); to-user = buffer[]; kfree(buffer); return result; Use of a buffer without checking leaks information. Check result and jump over the use of buffer if there is an error. result = sr_do_ioctl(cd, &cgc); if (result) goto err; to-user = buffer[]; err: kfree(buffer); return result; Additionally, initialize the buffer to zero. This problem can be seen in the 2.4.0 kernel. Link: https://lore.kernel.org/r/20220411174756.2418435-1-trix@redhat.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reviewed-by: Christoph Hellwig Signed-off-by: Tom Rix Signed-off-by: Martin K. Petersen drivers/scsi/sr_ioctl.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit c6ed4d84a2c49de7d6f490144cca7b4a4831fb6e Author: Bang Li Date: Sat Mar 19 10:03:16 2022 +0800 ARC: remove redundant READ_ONCE() in cmpxchg loop This patch reverts commit 7082a29c22ac ("ARC: use ACCESS_ONCE in cmpxchg loop"). It is not necessary to use READ_ONCE() because cmpxchg contains barrier. We can get it from commit d57f727264f1 ("ARC: add compiler barrier to LLSC based cmpxchg"). Signed-off-by: Bang Li Signed-off-by: Vineet Gupta arch/arc/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ac411e41ec065daa867b5668b6e71ea1aff7b36a Author: Sergey Matyukevich Date: Tue Feb 22 17:05:24 2022 +0300 ARC: atomic: cleanup atomic-llsc definitions Remove redundant c_op macro argument. Only asm_op is needed to define atomic operations using llock/scond. Signed-off-by: Sergey Matyukevich Signed-off-by: Vineet Gupta arch/arc/include/asm/atomic-llsc.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) commit d139d0f0bfdabe5762214a96f3d5c4b88f524b41 Author: Rolf Eike Beer Date: Mon Mar 28 10:15:58 2022 +0200 arc: drop definitions of pgd_index() and pgd_offset{, _k}() entirely They were in and have been removed from there in 974b9b2c68f ("mm: consolidate pte_index() and pte_offset_*() definitions") in favor of the generic version. But that missed that the same definitons also existed in , where they were (inadvertently?) introduced in fe6cb7b043b6 ("ARC: mm: disintegrate pgtable.h into levels and flags"). Fixes: 974b9b2c68f3 ("mm: consolidate pte_index() and pte_offset_*() definitions") Fixes: fe6cb7b043b6 ("ARC: mm: disintegrate pgtable.h into levels and flags") Signed-off-by: Rolf Eike Beer Signed-off-by: Vineet Gupta arch/arc/include/asm/pgtable-levels.h | 3 --- 1 file changed, 3 deletions(-) commit 3f943be0e76c72955ca4d1376b9577755be85f5c Author: Krzysztof Kozlowski Date: Thu Apr 7 16:33:22 2022 +0200 ARC: dts: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Signed-off-by: Vineet Gupta arch/arc/boot/dts/hsdk.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7f56b6d789dfbb4e72fa6912cd037fd916d4ee1c Author: Christophe JAILLET Date: Tue Mar 22 20:49:05 2022 +0100 ARC: Remove a redundant memset() disasm_instr() already call memset(0) on its 2nd argument, so there is no need to clear it explicitly before calling this function. Remove the redundant memset(). Signed-off-by: Christophe JAILLET Signed-off-by: Vineet Gupta arch/arc/kernel/disasm.c | 1 - 1 file changed, 1 deletion(-) commit ecaa054fc4c65ad337ec57aef2c6b041e0ef8f91 Author: Julia Lawall Date: Fri Mar 18 11:37:15 2022 +0100 ARC: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Vineet Gupta arch/arc/kernel/disasm.c | 2 +- arch/arc/kernel/signal.c | 2 +- arch/arc/kernel/smp.c | 2 +- arch/arc/kernel/unaligned.c | 2 +- arch/arc/mm/cache.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) commit b1c6ecfdd06907554518ec384ce8e99889d15193 Author: Sergey Matyukevich Date: Thu Apr 14 11:17:22 2022 +0300 ARC: entry: fix syscall_trace_exit argument Function syscall_trace_exit expects pointer to pt_regs. However r0 is also used to keep syscall return value. Restore pointer to pt_regs before calling syscall_trace_exit. Cc: Signed-off-by: Sergey Matyukevich Signed-off-by: Vineet Gupta arch/arc/kernel/entry.S | 1 + 1 file changed, 1 insertion(+) commit 9339faac6d206544601b939321059f60ba96a18d Author: Haowen Bai Date: Mon Apr 18 18:26:26 2022 +0800 cifs: Use kzalloc instead of kmalloc/memset Use kzalloc rather than duplicating its implementation, which makes code simple and easy to understand. Signed-off-by: Haowen Bai Signed-off-by: Steve French fs/cifs/transport.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 4aaaaf0f279836f06d3b9d0ffeec7a1e1a04ceef Author: Ji-Ze Hong (Peter Hong) Date: Mon Apr 18 17:07:06 2022 +0800 hwmon: (f71882fg) Fix negative temperature All temperature of Fintek superio hwmonitor that using 1-byte reg will use 2's complement. In show_temp() temp = data->temp[nr] * 1000; When data->temp[nr] read as 255, it indicate -1C, but this code will report 255C to userspace. It'll be ok when change to: temp = ((s8)data->temp[nr]) * 1000; Signed-off-by: Ji-Ze Hong (Peter Hong) Link: https://lore.kernel.org/r/20220418090706.6339-1-hpeter+linux_kernel@gmail.com Signed-off-by: Guenter Roeck drivers/hwmon/f71882fg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit cbe6c3a8f8f4315b96e46e1a1c70393c06d95a4c Author: Manuel Ullmann Date: Mon Apr 18 00:20:01 2022 +0200 net: atlantic: invert deep par in pm functions, preventing null derefs This will reset deeply on freeze and thaw instead of suspend and resume and prevent null pointer dereferences of the uninitialized ring 0 buffer while thawing. The impact is an indefinitely hanging kernel. You can't switch consoles after this and the only possible user interaction is SysRq. BUG: kernel NULL pointer dereference RIP: 0010:aq_ring_rx_fill+0xcf/0x210 [atlantic] aq_vec_init+0x85/0xe0 [atlantic] aq_nic_init+0xf7/0x1d0 [atlantic] atl_resume_common+0x4f/0x100 [atlantic] pci_pm_thaw+0x42/0xa0 resolves in aq_ring.o to ``` 0000000000000ae0 : { /* ... */ baf: 48 8b 43 08 mov 0x8(%rbx),%rax buff->flags = 0U; /* buff is NULL */ ``` The bug has been present since the introduction of the new pm code in 8aaa112a57c1 ("net: atlantic: refactoring pm logic") and was hidden until 8ce84271697a ("net: atlantic: changes for multi-TC support"), which refactored the aq_vec_{free,alloc} functions into aq_vec_{,ring}_{free,alloc}, but is technically not wrong. The original functions just always reinitialized the buffers on S3/S4. If the interface is down before freezing, the bug does not occur. It does not matter, whether the initrd contains and loads the module before thawing. So the fix is to invert the boolean parameter deep in all pm function calls, which was clearly intended to be set like that. First report was on Github [1], which you have to guess from the resume logs in the posted dmesg snippet. Recently I posted one on Bugzilla [2], since I did not have an AQC device so far. #regzbot introduced: 8ce84271697a #regzbot from: koo5 #regzbot monitor: https://github.com/Aquantia/AQtion/issues/32 Fixes: 8aaa112a57c1 ("net: atlantic: refactoring pm logic") Link: https://github.com/Aquantia/AQtion/issues/32 [1] Link: https://bugzilla.kernel.org/show_bug.cgi?id=215798 [2] Cc: stable@vger.kernel.org Reported-by: koo5 Signed-off-by: Manuel Ullmann Signed-off-by: David S. Miller drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit d94ef51d5b96da431cdc75f6c630435df92e92d2 Merge: 49aefd131739 d73497081710 Author: David S. Miller Date: Mon Apr 18 10:22:22 2022 +0100 Merge tag 'linux-can-fixes-for-5.18-20220417' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-04-17 this is a pull request of 1 patch for net/master. The patch is by Oliver Hartkopp and fixes a timeout monitoring problem in the ISO TP protocol found by the syzbot. ==================== Signed-off-by: David S. Miller commit ef0beba1a5fb0c693ddf7d31246bd96c925ffd00 Author: Luca Weiss Date: Fri Mar 18 19:30:02 2022 +0100 pinctrl: qcom: sm6350: fix order of UFS & SDC pins In other places the SDC and UFS pins have been swapped but this was missed in the PINCTRL_PIN definitions. Fix that. Fixes: 7d74b55afd27 ("pinctrl: qcom: Add SM6350 pinctrl driver") Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20220318183004.858707-5-luca.weiss@fairphone.com Signed-off-by: Linus Walleij drivers/pinctrl/qcom/pinctrl-sm6350.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit fda4d7e7767cc7ed3a6e0b9904ac733b58f3a61e Merge: 312310928417 0be0b70df661 Author: Linus Walleij Date: Mon Apr 18 00:59:45 2022 +0200 Merge tag 'intel-pinctrl-v5.18-2' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into fixes intel-pinctrl for v5.18-2 * Fix the register offsets for Alder Lake-N The following is an automated git shortlog grouped by driver: alderlake: - Fix register offsets for ADL-N variant commit a063f2fba3fa633a599253b62561051ac185fa99 Author: Sven Eckelmann Date: Sat Apr 16 13:51:10 2022 +0200 batman-adv: Don't skb_split skbuffs with frag_list The receiving interface might have used GRO to receive more fragments than MAX_SKB_FRAGS fragments. In this case, these will not be stored in skb_shinfo(skb)->frags but merged into the frag list. batman-adv relies on the function skb_split to split packets up into multiple smaller packets which are not larger than the MTU on the outgoing interface. But this function cannot handle frag_list entries and is only operating on skb_shinfo(skb)->frags. If it is still trying to split such an skb and xmit'ing it on an interface without support for NETIF_F_FRAGLIST, then validate_xmit_skb() will try to linearize it. But this fails due to inconsistent information. And __pskb_pull_tail will trigger a BUG_ON after skb_copy_bits() returns an error. In case of entries in frag_list, just linearize the skb before operating on it with skb_split(). Reported-by: Felix Kaechele Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol") Signed-off-by: Sven Eckelmann Tested-by: Felix Kaechele Signed-off-by: Simon Wunderlich net/batman-adv/fragmentation.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit b2d229d4ddb17db541098b83524d901257e93845 Author: Linus Torvalds Date: Sun Apr 17 13:57:31 2022 -0700 Linux 5.18-rc3 Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 470776c6b03491a3e82c644737a6da5466b8b3eb Author: Shelby Heffron Date: Sun Apr 17 13:05:08 2022 -0700 Input: add Marine Navigation Keycodes Add keycodes that are used by marine navigation devices. Signed-off-by: Shelby Heffron Link: https://lore.kernel.org/r/20220414015356.1619310-1-Shelby.Heffron@garmin.com Signed-off-by: Dmitry Torokhov include/uapi/linux/input-event-codes.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) commit 81022a170462d38ea10612cb67e8e2c529d58abe Author: Miaoqian Lin Date: Sun Apr 17 13:03:31 2022 -0700 Input: omap4-keypad - fix pm_runtime_get_sync() error checking If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Fixes: f77621cc640a ("Input: omap-keypad - dynamically handle register offsets") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220412070131.19848-1-linmq006@gmail.com Signed-off-by: Dmitry Torokhov drivers/input/keyboard/omap4-keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a1901b464e7e3e28956ae7423db2847dbbfb5be8 Merge: 3a69a44278a7 262fc47ac174 Author: Linus Torvalds Date: Sun Apr 17 10:29:10 2022 -0700 Merge tag 'for-linus-5.18-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixlet from Juergen Gross: "A single cleanup patch for the Xen balloon driver" * tag 'for-linus-5.18-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/balloon: don't use PV mode extra memory for zone device allocations commit 3a69a44278a72e15f12e24f5db4d277a497649aa Merge: fbb9c58e56f2 400331f8ffa3 Author: Linus Torvalds Date: Sun Apr 17 09:55:59 2022 -0700 Merge tag 'x86-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Thomas Gleixner: "Two x86 fixes related to TSX: - Use either MSR_TSX_FORCE_ABORT or MSR_IA32_TSX_CTRL to disable TSX to cover all CPUs which allow to disable it. - Disable TSX development mode at boot so that a microcode update which provides TSX development mode does not suddenly make the system vulnerable to TSX Asynchronous Abort" * tag 'x86-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/tsx: Disable TSX development mode at boot x86/tsx: Use MSR_TSX_CTRL to clear CPUID bits commit fbb9c58e56f2ee56e77b19fdfac131d57d3341c1 Merge: 0e59732ed61a 9c95bc25ad3b Author: Linus Torvalds Date: Sun Apr 17 09:53:01 2022 -0700 Merge tag 'timers-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fixes from Thomas Gleixner: "A small set of fixes for the timers core: - Fix the warning condition in __run_timers() which does not take into account that a CPU base (especially the deferrable base) never has a timer armed on it and therefore the next_expiry value can become stale. - Replace a WARN_ON() in the NOHZ code with a WARN_ON_ONCE() to prevent endless spam in dmesg. - Remove the double star from a comment which is not meant to be in kernel-doc format" * tag 'timers-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: tick/sched: Fix non-kernel-doc comment tick/nohz: Use WARN_ON_ONCE() to prevent console saturation timers: Fix warning condition in __run_timers() commit 0e59732ed61a24458b6875c162660dc0758b678f Merge: 7e1777f5ec17 b7ba6d8dc356 Author: Linus Torvalds Date: Sun Apr 17 09:46:15 2022 -0700 Merge tag 'smp-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull SMP fixes from Thomas Gleixner: "Two fixes for the SMP core: - Make the warning condition in flush_smp_call_function_queue() correct, which checked a just emptied list head for being empty instead of validating that there was no pending entry on the offlined CPU at all. - The @cpu member of struct cpuhp_cpu_state is initialized when the CPU hotplug thread for the upcoming CPU is created. That's too late because the creation of the thread can fail and then the following rollback operates on CPU0. Get rid of the CPU member and hand the CPU number to the involved functions directly" * tag 'smp-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state smp: Fix offline cpu check in flush_smp_call_function_queue() commit 7e1777f5ec178542adf0506e5ba2308f5be862a7 Merge: 9a921a6ff7a6 08d835dff916 Author: Linus Torvalds Date: Sun Apr 17 09:42:03 2022 -0700 Merge tag 'irq-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Thomas Gleixner: "A single fix for the interrupt affinity spreading logic to take into account that there can be an imbalance between present and possible CPUs, which causes already assigned bits to be overwritten" * tag 'irq-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq/affinity: Consider that CPUs on nodes can be unbalanced commit 9a921a6ff7a616863b981220d0a2e0d1de2d050b Merge: bd0c7d755bf3 581045ed5cfa Author: Linus Torvalds Date: Sun Apr 17 09:36:27 2022 -0700 Merge tag 'for-v5.18-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply fixes from Sebastian Reichel: - Fix a regression with battery data failing to load from DT * tag 'for-v5.18-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: Reset err after not finding static battery power: supply: samsung-sdi-battery: Add missing charge restart voltages commit bd0c7d755bf3bad8ef075a899c10f192858c01d4 Merge: a2c29ccd9477 e35c93695c74 Author: Linus Torvalds Date: Sun Apr 17 09:31:27 2022 -0700 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Regular set of fixes for drivers and the dev-interface" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: ismt: Fix undefined behavior due to shift overflowing the constant i2c: dev: Force case user pointers in compat_i2cdev_ioctl() i2c: dev: check return value when calling dev_set_name() i2c: qcom-geni: Use dev_err_probe() for GPI DMA error i2c: imx: Implement errata ERR007805 or e7805 bus frequency limit i2c: pasemi: Wait for write xfers to finish commit d73497081710c876c3c61444445512989e102152 Author: Oliver Hartkopp Date: Tue Apr 5 19:51:12 2022 +0200 can: isotp: stop timeout monitoring when no first frame was sent The first attempt to fix a the 'impossible' WARN_ON_ONCE(1) in isotp_tx_timer_handler() focussed on the identical CAN IDs created by the syzbot reproducer and lead to upstream fix/commit 3ea566422cbd ("can: isotp: sanitize CAN ID checks in isotp_bind()"). But this did not catch the root cause of the wrong tx.state in the tx_timer handler. In the isotp 'first frame' case a timeout monitoring needs to be started before the 'first frame' is send. But when this sending failed the timeout monitoring for this specific frame has to be disabled too. Otherwise the tx_timer is fired with the 'warn me' tx.state of ISOTP_IDLE. Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://lore.kernel.org/all/20220405175112.2682-1-socketcan@hartkopp.net Reported-by: syzbot+2339c27f5c66c652843e@syzkaller.appspotmail.com Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde net/can/isotp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit c0713540f6d55c53dca65baaead55a5a8b20552d Author: Pavel Begunkov Date: Sun Apr 17 10:10:34 2022 +0100 io_uring: fix leaks on IOPOLL and CQE_SKIP If all completed requests in io_do_iopoll() were marked with REQ_F_CQE_SKIP, we'll not only skip CQE posting but also io_free_batch_list() leaking memory and resources. Move @nr_events increment before REQ_F_CQE_SKIP check. We'll potentially return the value greater than the real one, but iopolling will deal with it and the userspace will re-iopoll if needed. In anyway, I don't think there are many use cases for REQ_F_CQE_SKIP + IOPOLL. Fixes: 83a13a4181b0e ("io_uring: tweak iopoll CQE_SKIP event counting") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5072fc8693fbfd595f89e5d4305bfcfd5d2f0a64.1650186611.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 49aefd131739df552f83c566d0665744c30b1d70 Author: suresh kumar Date: Sat Apr 16 16:44:10 2022 +0530 bonding: do not discard lowest hash bit for non layer3+4 hashing Commit b5f862180d70 was introduced to discard lowest hash bit for layer3+4 hashing but it also removes last bit from non layer3+4 hashing Below script shows layer2+3 hashing will result in same slave to be used with above commit. $ cat hash.py #/usr/bin/python3.6 h_dests=[0xa0, 0xa1] h_source=0xe3 hproto=0x8 saddr=0x1e7aa8c0 daddr=0x17aa8c0 for h_dest in h_dests: hash = (h_dest ^ h_source ^ hproto ^ saddr ^ daddr) hash ^= hash >> 16 hash ^= hash >> 8 print(hash) print("with last bit removed") for h_dest in h_dests: hash = (h_dest ^ h_source ^ hproto ^ saddr ^ daddr) hash ^= hash >> 16 hash ^= hash >> 8 hash = hash >> 1 print(hash) Output: $ python3.6 hash.py 522133332 522133333 <-------------- will result in both slaves being used with last bit removed 261066666 261066666 <-------------- only single slave used Signed-off-by: suresh kumar Signed-off-by: David S. Miller drivers/net/bonding/bond_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) commit 323b190ba2debbcc03c01d2edaf1ec6b43e6ae43 Author: Jens Axboe Date: Sat Apr 16 21:14:00 2022 -0600 io_uring: free iovec if file assignment fails We just return failure in this case, but we need to release the iovec first. If we're doing IO with more than FAST_IOV segments, then the iovec is allocated and must be freed. Reported-by: syzbot+96b43810dfe9c3bb95ed@syzkaller.appspotmail.com Fixes: 584b0180f0f4 ("io_uring: move read/write file prep state into actual opcode handler") Signed-off-by: Jens Axboe fs/io_uring.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit a2c29ccd9477861b16ddc02c411a6c9665250558 Merge: de6e93366828 652980b1541c Author: Linus Torvalds Date: Sat Apr 16 17:07:50 2022 -0700 Merge tag 'devicetree-fixes-for-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Fix scalar property schemas with array constraints - Fix 'enum' lists with duplicate entries - Fix incomplete if/then/else schemas - Add Renesas RZ/V2L SoC support to Mali Bifrost binding - Maintainers update for Marvell irqchip * tag 'devicetree-fixes-for-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: display: panel-timing: Define a single type for properties dt-bindings: Fix array constraints on scalar properties dt-bindings: gpu: mali-bifrost: Document RZ/V2L SoC dt-bindings: net: snps: remove duplicate name dt-bindings: Fix 'enum' lists with duplicate entries dt-bindings: irqchip: mrvl,intc: refresh maintainers dt-bindings: Fix incomplete if/then/else schemas dt-bindings: power: renesas,apmu: Fix cpus property limits dt-bindings: extcon: maxim,max77843: fix ports type commit de6e93366828925b58e4a102b6590a8f4798b7e2 Merge: 70a0cec8186b 0ebb4fbe3134 Author: Linus Torvalds Date: Sat Apr 16 17:01:43 2022 -0700 Merge tag 'gpio-fixes-for-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: "A single fix for gpio-sim and two patches for GPIO ACPI pulled from Andy: - fix the set/get_multiple() callbacks in gpio-sim - use correct format characters in gpiolib-acpi - use an unsigned type for pins in gpiolib-acpi" * tag 'gpio-fixes-for-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: sim: fix setting and getting multiple lines gpiolib: acpi: Convert type for pin to be unsigned gpiolib: acpi: use correct format characters commit 70a0cec8186bff968384f5ad4fe5cb551f04bfd7 Merge: 92edbe32e382 24a4351e1c04 Author: Linus Torvalds Date: Sat Apr 16 16:51:39 2022 -0700 Merge tag 'soc-fixes-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "There are a number of SoC bugfixes that came in since the merge window, and more of them are already pending. This batch includes: - A boot time regression fix for davinci that triggered on multi_v5_defconfig when booting any platform - Defconfig updates to address removed features, changed symbol names or dependencies, for gemini, ux500, and pxa - Email address changes for Krzysztof Kozlowski - Build warning fixes for ep93xx and iop32x - Devicetree warning fixes across many platforms - Minor bugfixes for the reset controller, memory controller and SCMI firmware subsystems plus the versatile-express board" * tag 'soc-fixes-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (34 commits) ARM: config: Update Gemini defconfig arm64: dts: qcom/sdm845-shift-axolotl: Fix boolean properties with values ARM: dts: align SPI NOR node name with dtschema ARM: dts: Fix more boolean properties with values arm/arm64: dts: qcom: Fix boolean properties with values arm64: dts: imx: Fix imx8*-var-som touchscreen property sizes arm: dts: imx: Fix boolean properties with values arm64: dts: tegra: Fix boolean properties with values arm: dts: at91: Fix boolean properties with values arm: configs: imote2: Drop defconfig as board support dropped. ep93xx: clock: Don't use plain integer as NULL pointer ep93xx: clock: Fix UAF in ep93xx_clk_register_gate() ARM: vexpress/spc: Fix all the kernel-doc build warnings ARM: vexpress/spc: Fix kernel-doc build warning for ve_spc_cpu_in_wfi ARM: config: u8500: Re-enable AB8500 battery charging ARM: config: u8500: Add some common hardware memory: fsl_ifc: populate child nodes of buses and mfd devices ARM: config: Refresh U8500 defconfig firmware: arm_scmi: Fix sparse warnings in OPTEE transport driver firmware: arm_scmi: Replace zero-length array with flexible-array member ... commit 92edbe32e3822f7b66e471c7e0bd5ee5d63bf4b8 Merge: 90ea17a9e27b 35a33ff3807d Author: Linus Torvalds Date: Sat Apr 16 16:42:53 2022 -0700 Merge tag 'random-5.18-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator fixes from Jason Donenfeld: - Per your suggestion, random reads now won't fail if there's a page fault after some non-zero amount of data has been read, which makes the behavior consistent with all other reads in the kernel. - Rather than an inconsistent mix of random_get_entropy() returning an unsigned long or a cycles_t, now it just returns an unsigned long. - A memcpy() was replaced with an memmove(), because the addresses are sometimes overlapping. In practice the destination is always before the source, so not really an issue, but better to be correct than not. * tag 'random-5.18-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: use memmove instead of memcpy for remaining 32 bytes random: make random_get_entropy() return an unsigned long random: allow partial reads if later user copies fail commit 90ea17a9e27b5778ec517efb1ce0b81d36905654 Merge: b00868396dbd 70a3baeec4e8 Author: Linus Torvalds Date: Sat Apr 16 13:38:26 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "13 fixes, all in drivers. The most extensive changes are in the iscsi series (affecting drivers qedi, cxgbi and bnx2i), the next most is scsi_debug, but that's just a simple revert and then minor updates to pm80xx" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: iscsi: MAINTAINERS: Add Mike Christie as co-maintainer scsi: qedi: Fix failed disconnect handling scsi: iscsi: Fix NOP handling during conn recovery scsi: iscsi: Merge suspend fields scsi: iscsi: Fix unbound endpoint error handling scsi: iscsi: Fix conn cleanup and stop race during iscsid restart scsi: iscsi: Fix endpoint reuse regression scsi: iscsi: Release endpoint ID when its freed scsi: iscsi: Fix offload conn cleanup when iscsid restarts scsi: iscsi: Move iscsi_ep_disconnect() scsi: pm80xx: Enable upper inbound, outbound queues scsi: pm80xx: Mask and unmask upper interrupt vectors 32-63 Revert "scsi: scsi_debug: Address races following module load" commit 0ebb4fbe31343a42370a2897ea9424fe78f3a88f Merge: 3836c73e6a25 0c2cae09a765 Author: Bartosz Golaszewski Date: Sat Apr 16 21:57:00 2022 +0200 Merge tag 'intel-gpio-v5.18-2' of gitolite.kernel.org:pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-current intel-gpio for v5.18-2 * Couple of fixes related to handling unsigned value of the pin from ACPI gpiolib: - acpi: Convert type for pin to be unsigned - acpi: use correct format characters commit b00868396dbd23bb6875f4096b6e59e1b17d67de Merge: 59250f8a7f3a 9e02977bfad0 Author: Linus Torvalds Date: Sat Apr 16 11:20:21 2022 -0700 Merge tag 'dma-mapping-5.18-2' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fix from Christoph Hellwig: - avoid a double memory copy for swiotlb (Chao Gao) * tag 'dma-mapping-5.18-2' of git://git.infradead.org/users/hch/dma-mapping: dma-direct: avoid redundant memory sync for swiotlb commit b5d6ba09b10d2ccb865ed9bc45941db0a41c6756 Author: Fawzi Khaber Date: Mon Apr 11 13:15:33 2022 +0200 iio: imu: inv_icm42600: Fix I2C init possible nack This register write to REG_INTF_CONFIG6 enables a spike filter that is impacting the line and can prevent the I2C ACK to be seen by the controller. So we don't test the return value. Fixes: 7297ef1e261672b8 ("iio: imu: inv_icm42600: add I2C driver") Signed-off-by: Fawzi Khaber Signed-off-by: Jean-Baptiste Maneyrol Link: https://lore.kernel.org/r/20220411111533.5826-1-jmaneyrol@invensense.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit e7e51eb037d1848d4403efbf9696ea50c40cad36 Author: Nuno Sá Date: Tue Apr 12 14:49:16 2022 +0200 iio: dac: ltc2688: fix voltage scale read Properly set *val2 (and not overwrite *val) to correctly return IIO_VAL_FRACTIONAL_LOG2. Fixes: 832cb9eeb9312 ("iio: dac: add support for ltc2688") Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220412124916.61-1-nuno.sa@analog.com Signed-off-by: Jonathan Cameron drivers/iio/dac/ltc2688.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 35a33ff3807d3adb9daaf937f5bca002ffa9f84e Author: Jason A. Donenfeld Date: Thu Apr 14 01:50:38 2022 +0200 random: use memmove instead of memcpy for remaining 32 bytes In order to immediately overwrite the old key on the stack, before servicing a userspace request for bytes, we use the remaining 32 bytes of block 0 as the key. This means moving indices 8,9,a,b,c,d,e,f -> 4,5,6,7,8,9,a,b. Since 4 < 8, for the kernel implementations of memcpy(), this doesn't actually appear to be a problem in practice. But relying on that characteristic seems a bit brittle. So let's change that to a proper memmove(), which is the by-the-books way of handling overlapping memory copies. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 839769c35477d4acc2369e45000ca7b0b6af39a7 Author: Max Filippov Date: Wed Apr 13 22:44:36 2022 -0700 xtensa: fix a7 clobbering in coprocessor context load/store Fast coprocessor exception handler saves a3..a6, but coprocessor context load/store code uses a4..a7 as temporaries, potentially clobbering a7. 'Potentially' because coprocessor state load/store macros may not use all four temporary registers (and neither FPU nor HiFi macros do). Use a3..a6 as intended. Cc: stable@vger.kernel.org Fixes: c658eac628aa ("[XTENSA] Add support for configurable registers and coprocessors") Signed-off-by: Max Filippov arch/xtensa/kernel/coprocessor.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 59250f8a7f3a60a2661b84cbafc1e0eb5d05ec9b Merge: ce673f630c09 23c2d497de21 Author: Linus Torvalds Date: Fri Apr 15 15:57:18 2022 -0700 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "14 patches. Subsystems affected by this patch series: MAINTAINERS, binfmt, and mm (tmpfs, secretmem, kasan, kfence, pagealloc, zram, compaction, hugetlb, vmalloc, and kmemleak)" * emailed patches from Andrew Morton : mm: kmemleak: take a full lowmem check in kmemleak_*_phys() mm/vmalloc: fix spinning drain_vmap_work after reading from /proc/vmcore revert "fs/binfmt_elf: use PT_LOAD p_align values for static PIE" revert "fs/binfmt_elf: fix PT_LOAD p_align values for loaders" hugetlb: do not demote poisoned hugetlb pages mm: compaction: fix compiler warning when CONFIG_COMPACTION=n mm: fix unexpected zeroed page mapping with zram swap mm, page_alloc: fix build_zonerefs_node() mm, kfence: support kmem_dump_obj() for KFENCE objects kasan: fix hw tags enablement when KUNIT tests are disabled irq_work: use kasan_record_aux_stack_noalloc() record callstack mm/secretmem: fix panic when growing a memfd_secret tmpfs: fix regressions from wider use of ZERO_PAGE MAINTAINERS: Broadcom internal lists aren't maintainers commit ce673f630c097ec87391335308184bc907184fbf Merge: fb649bda6f56 92b914e29af3 Author: Linus Torvalds Date: Fri Apr 15 15:20:59 2022 -0700 Merge tag 'for-5.18/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 memory corruption in DM integrity target when tag_size is less than digest size. - Fix DM multipath's historical-service-time path selector to not use sched_clock() and ktime_get_ns(); only use ktime_get_ns(). - Fix dm_io->orig_bio NULL pointer dereference in dm_zone_map_bio() due to 5.18 changes that overlooked DM zone's use of ->orig_bio - Fix for regression that broke the use of dm_accept_partial_bio() for "abnormal" IO (e.g. WRITE ZEROES) that does not need duplicate bios - Fix DM's issuing of empty flush bio so that it's size is 0. * tag 'for-5.18/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: fix bio length of empty flush dm: allow dm_accept_partial_bio() for dm_io without duplicate bios dm zone: fix NULL pointer dereference in dm_zone_map_bio dm mpath: only use ktime_get_ns() in historical selector dm integrity: fix memory corruption when tag_size is less than digest size commit 23c2d497de21f25898fbea70aeb292ab8acc8c94 Author: Patrick Wang Date: Thu Apr 14 19:14:04 2022 -0700 mm: kmemleak: take a full lowmem check in kmemleak_*_phys() The kmemleak_*_phys() apis do not check the address for lowmem's min boundary, while the caller may pass an address below lowmem, which will trigger an oops: # echo scan > /sys/kernel/debug/kmemleak Unable to handle kernel paging request at virtual address ff5fffffffe00000 Oops [#1] Modules linked in: CPU: 2 PID: 134 Comm: bash Not tainted 5.18.0-rc1-next-20220407 #33 Hardware name: riscv-virtio,qemu (DT) epc : scan_block+0x74/0x15c ra : scan_block+0x72/0x15c epc : ffffffff801e5806 ra : ffffffff801e5804 sp : ff200000104abc30 gp : ffffffff815cd4e8 tp : ff60000004cfa340 t0 : 0000000000000200 t1 : 00aaaaaac23954cc t2 : 00000000000003ff s0 : ff200000104abc90 s1 : ffffffff81b0ff28 a0 : 0000000000000000 a1 : ff5fffffffe01000 a2 : ffffffff81b0ff28 a3 : 0000000000000002 a4 : 0000000000000001 a5 : 0000000000000000 a6 : ff200000104abd7c a7 : 0000000000000005 s2 : ff5fffffffe00ff9 s3 : ffffffff815cd998 s4 : ffffffff815d0e90 s5 : ffffffff81b0ff28 s6 : 0000000000000020 s7 : ffffffff815d0eb0 s8 : ffffffffffffffff s9 : ff5fffffffe00000 s10: ff5fffffffe01000 s11: 0000000000000022 t3 : 00ffffffaa17db4c t4 : 000000000000000f t5 : 0000000000000001 t6 : 0000000000000000 status: 0000000000000100 badaddr: ff5fffffffe00000 cause: 000000000000000d scan_gray_list+0x12e/0x1a6 kmemleak_scan+0x2aa/0x57e kmemleak_write+0x32a/0x40c full_proxy_write+0x56/0x82 vfs_write+0xa6/0x2a6 ksys_write+0x6c/0xe2 sys_write+0x22/0x2a ret_from_syscall+0x0/0x2 The callers may not quite know the actual address they pass(e.g. from devicetree). So the kmemleak_*_phys() apis should guarantee the address they finally use is in lowmem range, so check the address for lowmem's min boundary. Link: https://lkml.kernel.org/r/20220413122925.33856-1-patrick.wang.shcn@gmail.com Signed-off-by: Patrick Wang Acked-by: Catalin Marinas Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kmemleak.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit c12cd77cb028255663810e6c4528f0325facff66 Author: Omar Sandoval Date: Thu Apr 14 19:14:01 2022 -0700 mm/vmalloc: fix spinning drain_vmap_work after reading from /proc/vmcore Commit 3ee48b6af49c ("mm, x86: Saving vmcore with non-lazy freeing of vmas") introduced set_iounmap_nonlazy(), which sets vmap_lazy_nr to lazy_max_pages() + 1, ensuring that any future vunmaps() immediately purge the vmap areas instead of doing it lazily. Commit 690467c81b1a ("mm/vmalloc: Move draining areas out of caller context") moved the purging from the vunmap() caller to a worker thread. Unfortunately, set_iounmap_nonlazy() can cause the worker thread to spin (possibly forever). For example, consider the following scenario: 1. Thread reads from /proc/vmcore. This eventually calls __copy_oldmem_page() -> set_iounmap_nonlazy(), which sets vmap_lazy_nr to lazy_max_pages() + 1. 2. Then it calls free_vmap_area_noflush() (via iounmap()), which adds 2 pages (one page plus the guard page) to the purge list and vmap_lazy_nr. vmap_lazy_nr is now lazy_max_pages() + 3, so the drain_vmap_work is scheduled. 3. Thread returns from the kernel and is scheduled out. 4. Worker thread is scheduled in and calls drain_vmap_area_work(). It frees the 2 pages on the purge list. vmap_lazy_nr is now lazy_max_pages() + 1. 5. This is still over the threshold, so it tries to purge areas again, but doesn't find anything. 6. Repeat 5. If the system is running with only one CPU (which is typicial for kdump) and preemption is disabled, then this will never make forward progress: there aren't any more pages to purge, so it hangs. If there is more than one CPU or preemption is enabled, then the worker thread will spin forever in the background. (Note that if there were already pages to be purged at the time that set_iounmap_nonlazy() was called, this bug is avoided.) This can be reproduced with anything that reads from /proc/vmcore multiple times. E.g., vmcore-dmesg /proc/vmcore. It turns out that improvements to vmap() over the years have obsoleted the need for this "optimization". I benchmarked `dd if=/proc/vmcore of=/dev/null` with 4k and 1M read sizes on a system with a 32GB vmcore. The test was run on 5.17, 5.18-rc1 with a fix that avoided the hang, and 5.18-rc1 with set_iounmap_nonlazy() removed entirely: |5.17 |5.18+fix|5.18+removal 4k|40.86s| 40.09s| 26.73s 1M|24.47s| 23.98s| 21.84s The removal was the fastest (by a wide margin with 4k reads). This patch removes set_iounmap_nonlazy(). Link: https://lkml.kernel.org/r/52f819991051f9b865e9ce25605509bfdbacadcd.1649277321.git.osandov@fb.com Fixes: 690467c81b1a ("mm/vmalloc: Move draining areas out of caller context") Signed-off-by: Omar Sandoval Acked-by: Chris Down Reviewed-by: Uladzislau Rezki (Sony) Reviewed-by: Christoph Hellwig Acked-by: Baoquan He Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/x86/include/asm/io.h | 2 -- arch/x86/kernel/crash_dump_64.c | 1 - mm/vmalloc.c | 11 ----------- 3 files changed, 14 deletions(-) commit aeb7923733d100b86c6bc68e7ae32913b0cec9d8 Author: Andrew Morton Date: Thu Apr 14 19:13:58 2022 -0700 revert "fs/binfmt_elf: use PT_LOAD p_align values for static PIE" Despite Mike's attempted fix (925346c129da117122), regressions reports continue: https://lore.kernel.org/lkml/cb5b81bd-9882-e5dc-cd22-54bdbaaefbbc@leemhuis.info/ https://bugzilla.kernel.org/show_bug.cgi?id=215720 https://lkml.kernel.org/r/b685f3d0-da34-531d-1aa9-479accd3e21b@leemhuis.info So revert this patch. Fixes: 9630f0d60fec ("fs/binfmt_elf: use PT_LOAD p_align values for static PIE") Cc: Alexey Dobriyan Cc: Al Viro Cc: Chris Kennelly Cc: David Rientjes Cc: Fangrui Song Cc: H.J. Lu Cc: Hugh Dickins Cc: Ian Rogers Cc: Kirill A. Shutemov Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nick Desaulniers Cc: Sandeep Patil Cc: Shuah Khan Cc: Song Liu Cc: Suren Baghdasaryan Cc: Thorsten Leemhuis Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/binfmt_elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 354e923df042a11d1ab8ca06b3ebfab3a018a4ec Author: Andrew Morton Date: Thu Apr 14 19:13:55 2022 -0700 revert "fs/binfmt_elf: fix PT_LOAD p_align values for loaders" Commit 925346c129da11 ("fs/binfmt_elf: fix PT_LOAD p_align values for loaders") was an attempt to fix regressions due to 9630f0d60fec5f ("fs/binfmt_elf: use PT_LOAD p_align values for static PIE"). But regressionss continue to be reported: https://lore.kernel.org/lkml/cb5b81bd-9882-e5dc-cd22-54bdbaaefbbc@leemhuis.info/ https://bugzilla.kernel.org/show_bug.cgi?id=215720 https://lkml.kernel.org/r/b685f3d0-da34-531d-1aa9-479accd3e21b@leemhuis.info This patch reverts the fix, so the original can also be reverted. Fixes: 925346c129da11 ("fs/binfmt_elf: fix PT_LOAD p_align values for loaders") Cc: H.J. Lu Cc: Chris Kennelly Cc: Al Viro Cc: Alexey Dobriyan Cc: Song Liu Cc: David Rientjes Cc: Ian Rogers Cc: Hugh Dickins Cc: Suren Baghdasaryan Cc: Sandeep Patil Cc: Fangrui Song Cc: Nick Desaulniers Cc: Kirill A. Shutemov Cc: Mike Kravetz Cc: Shuah Khan Cc: Thorsten Leemhuis Cc: Mike Rapoport Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/binfmt_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5a317412ef884763fdf7aa17f9f3636959d11d8f Author: Mike Kravetz Date: Thu Apr 14 19:13:52 2022 -0700 hugetlb: do not demote poisoned hugetlb pages It is possible for poisoned hugetlb pages to reside on the free lists. The huge page allocation routines which dequeue entries from the free lists make a point of avoiding poisoned pages. There is no such check and avoidance in the demote code path. If a hugetlb page on the is on a free list, poison will only be set in the head page rather then the page with the actual error. If such a page is demoted, then the poison flag may follow the wrong page. A page without error could have poison set, and a page with poison could not have the flag set. Check for poison before attempting to demote a hugetlb page. Also, return -EBUSY to the caller if only poisoned pages are on the free list. Link: https://lkml.kernel.org/r/20220307215707.50916-1-mike.kravetz@oracle.com Fixes: 8531fc6f52f5 ("hugetlb: add hugetlb demote page support") Signed-off-by: Mike Kravetz Reviewed-by: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/hugetlb.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) commit 31ca72fa7540bb654b55c56adaf99305847376e0 Author: Charan Teja Kalla Date: Thu Apr 14 19:13:49 2022 -0700 mm: compaction: fix compiler warning when CONFIG_COMPACTION=n The below warning is reported when CONFIG_COMPACTION=n: mm/compaction.c:56:27: warning: 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' defined but not used [-Wunused-const-variable=] 56 | static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix it by moving 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' under CONFIG_COMPACTION defconfig. Also since this is just a 'static const int' type, use #define for it. Link: https://lkml.kernel.org/r/1647608518-20924-1-git-send-email-quic_charante@quicinc.com Signed-off-by: Charan Teja Kalla Reported-by: kernel test robot Acked-by: Vlastimil Babka Cc: Nitin Gupta Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/compaction.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit e914d8f00391520ecc4495dd0ca0124538ab7119 Author: Minchan Kim Date: Thu Apr 14 19:13:46 2022 -0700 mm: fix unexpected zeroed page mapping with zram swap Two processes under CLONE_VM cloning, user process can be corrupted by seeing zeroed page unexpectedly. CPU A CPU B do_swap_page do_swap_page SWP_SYNCHRONOUS_IO path SWP_SYNCHRONOUS_IO path swap_readpage valid data swap_slot_free_notify delete zram entry swap_readpage zeroed(invalid) data pte_lock map the *zero data* to userspace pte_unlock pte_lock if (!pte_same) goto out_nomap; pte_unlock return and next refault will read zeroed data The swap_slot_free_notify is bogus for CLONE_VM case since it doesn't increase the refcount of swap slot at copy_mm so it couldn't catch up whether it's safe or not to discard data from backing device. In the case, only the lock it could rely on to synchronize swap slot freeing is page table lock. Thus, this patch gets rid of the swap_slot_free_notify function. With this patch, CPU A will see correct data. CPU A CPU B do_swap_page do_swap_page SWP_SYNCHRONOUS_IO path SWP_SYNCHRONOUS_IO path swap_readpage original data pte_lock map the original data swap_free swap_range_free bd_disk->fops->swap_slot_free_notify swap_readpage read zeroed data pte_unlock pte_lock if (!pte_same) goto out_nomap; pte_unlock return on next refault will see mapped data by CPU B The concern of the patch would increase memory consumption since it could keep wasted memory with compressed form in zram as well as uncompressed form in address space. However, most of cases of zram uses no readahead and do_swap_page is followed by swap_free so it will free the compressed form from in zram quickly. Link: https://lkml.kernel.org/r/YjTVVxIAsnKAXjTd@google.com Fixes: 0bcac06f27d7 ("mm, swap: skip swapcache for swapin of synchronous device") Reported-by: Ivan Babrou Tested-by: Ivan Babrou Signed-off-by: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky Cc: Jens Axboe Cc: David Hildenbrand Cc: [4.14+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_io.c | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) commit e553f62f10d93551eb883eca227ac54d1a4fad84 Author: Juergen Gross Date: Thu Apr 14 19:13:43 2022 -0700 mm, page_alloc: fix build_zonerefs_node() Since commit 6aa303defb74 ("mm, vmscan: only allocate and reclaim from zones with pages managed by the buddy allocator") only zones with free memory are included in a built zonelist. This is problematic when e.g. all memory of a zone has been ballooned out when zonelists are being rebuilt. The decision whether to rebuild the zonelists when onlining new memory is done based on populated_zone() returning 0 for the zone the memory will be added to. The new zone is added to the zonelists only, if it has free memory pages (managed_zone() returns a non-zero value) after the memory has been onlined. This implies, that onlining memory will always free the added pages to the allocator immediately, but this is not true in all cases: when e.g. running as a Xen guest the onlined new memory will be added only to the ballooned memory list, it will be freed only when the guest is being ballooned up afterwards. Another problem with using managed_zone() for the decision whether a zone is being added to the zonelists is, that a zone with all memory used will in fact be removed from all zonelists in case the zonelists happen to be rebuilt. Use populated_zone() when building a zonelist as it has been done before that commit. There was a report that QubesOS (based on Xen) is hitting this problem. Xen has switched to use the zone device functionality in kernel 5.9 and QubesOS wants to use memory hotplugging for guests in order to be able to start a guest with minimal memory and expand it as needed. This was the report leading to the patch. Link: https://lkml.kernel.org/r/20220407120637.9035-1-jgross@suse.com Fixes: 6aa303defb74 ("mm, vmscan: only allocate and reclaim from zones with pages managed by the buddy allocator") Signed-off-by: Juergen Gross Reported-by: Marek Marczykowski-Górecki Acked-by: Michal Hocko Acked-by: David Hildenbrand Cc: Marek Marczykowski-Górecki Reviewed-by: Wei Yang Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2dfe63e61cc31ee59ce951672b0850b5229cd5b0 Author: Marco Elver Date: Thu Apr 14 19:13:40 2022 -0700 mm, kfence: support kmem_dump_obj() for KFENCE objects Calling kmem_obj_info() via kmem_dump_obj() on KFENCE objects has been producing garbage data due to the object not actually being maintained by SLAB or SLUB. Fix this by implementing __kfence_obj_info() that copies relevant information to struct kmem_obj_info when the object was allocated by KFENCE; this is called by a common kmem_obj_info(), which also calls the slab/slub/slob specific variant now called __kmem_obj_info(). For completeness, kmem_dump_obj() now displays if the object was allocated by KFENCE. Link: https://lore.kernel.org/all/20220323090520.GG16885@xsang-OptiPlex-9020/ Link: https://lkml.kernel.org/r/20220406131558.3558585-1-elver@google.com Fixes: b89fb5ef0ce6 ("mm, kfence: insert KFENCE hooks for SLUB") Fixes: d3fb45f370d9 ("mm, kfence: insert KFENCE hooks for SLAB") Signed-off-by: Marco Elver Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reported-by: kernel test robot Acked-by: Vlastimil Babka [slab] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kfence.h | 24 ++++++++++++++++++++++++ mm/kfence/core.c | 21 --------------------- mm/kfence/kfence.h | 21 +++++++++++++++++++++ mm/kfence/report.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ mm/slab.c | 2 +- mm/slab.h | 2 +- mm/slab_common.c | 9 +++++++++ mm/slob.c | 2 +- mm/slub.c | 2 +- 9 files changed, 105 insertions(+), 25 deletions(-) commit b1add418d457bc30cdd6a89c2bba092cd8941fcf Author: Vincenzo Frascino Date: Thu Apr 14 19:13:37 2022 -0700 kasan: fix hw tags enablement when KUNIT tests are disabled Kasan enables hw tags via kasan_enable_tagging() which based on the mode passed via kernel command line selects the correct hw backend. kasan_enable_tagging() is meant to be invoked indirectly via the cpu features framework of the architectures that support these backends. Currently the invocation of this function is guarded by CONFIG_KASAN_KUNIT_TEST which allows the enablement of the correct backend only when KUNIT tests are enabled in the kernel. This inconsistency was introduced in commit: ed6d74446cbf ("kasan: test: support async (again) and asymm modes for HW_TAGS") ... and prevents to enable MTE on arm64 when KUNIT tests for kasan hw_tags are disabled. Fix the issue making sure that the CONFIG_KASAN_KUNIT_TEST guard does not prevent the correct invocation of kasan_enable_tagging(). Link: https://lkml.kernel.org/r/20220408124323.10028-1-vincenzo.frascino@arm.com Fixes: ed6d74446cbf ("kasan: test: support async (again) and asymm modes for HW_TAGS") Signed-off-by: Vincenzo Frascino Reviewed-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/hw_tags.c | 5 +++-- mm/kasan/kasan.h | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) commit 25934fcfb93c4687ad32fd3d062bcf03457129d4 Author: Zqiang Date: Thu Apr 14 19:13:34 2022 -0700 irq_work: use kasan_record_aux_stack_noalloc() record callstack On PREEMPT_RT kernel and KASAN is enabled. the kasan_record_aux_stack() may call alloc_pages(), and the rt-spinlock will be acquired, if currently in atomic context, will trigger warning: BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:46 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 239, name: bootlogd Preemption disabled at: [] rt_mutex_slowunlock+0xa1/0x4e0 CPU: 3 PID: 239 Comm: bootlogd Tainted: G W 5.17.1-rt17-yocto-preempt-rt+ #105 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 Call Trace: __might_resched.cold+0x13b/0x173 rt_spin_lock+0x5b/0xf0 get_page_from_freelist+0x20c/0x1610 __alloc_pages+0x25e/0x5e0 __stack_depot_save+0x3c0/0x4a0 kasan_save_stack+0x3a/0x50 __kasan_record_aux_stack+0xb6/0xc0 kasan_record_aux_stack+0xe/0x10 irq_work_queue_on+0x6a/0x1c0 pull_rt_task+0x631/0x6b0 do_balance_callbacks+0x56/0x80 __balance_callbacks+0x63/0x90 rt_mutex_setprio+0x349/0x880 rt_mutex_slowunlock+0x22a/0x4e0 rt_spin_unlock+0x49/0x80 uart_write+0x186/0x2b0 do_output_char+0x2e9/0x3a0 n_tty_write+0x306/0x800 file_tty_write.isra.0+0x2af/0x450 tty_write+0x22/0x30 new_sync_write+0x27c/0x3a0 vfs_write+0x3f7/0x5d0 ksys_write+0xd9/0x180 __x64_sys_write+0x43/0x50 do_syscall_64+0x44/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Fix it by using kasan_record_aux_stack_noalloc() to avoid the call to alloc_pages(). Link: https://lkml.kernel.org/r/20220402142555.2699582-1-qiang1.zhang@intel.com Signed-off-by: Zqiang Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/irq_work.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f9b141f93659e09a52e28791ccbaf69c273b8e92 Author: Axel Rasmussen Date: Thu Apr 14 19:13:31 2022 -0700 mm/secretmem: fix panic when growing a memfd_secret When one tries to grow an existing memfd_secret with ftruncate, one gets a panic [1]. For example, doing the following reliably induces the panic: fd = memfd_secret(); ftruncate(fd, 10); ptr = mmap(NULL, 10, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); strcpy(ptr, "123456789"); munmap(ptr, 10); ftruncate(fd, 20); The basic reason for this is, when we grow with ftruncate, we call down into simple_setattr, and then truncate_inode_pages_range, and eventually we try to zero part of the memory. The normal truncation code does this via the direct map (i.e., it calls page_address() and hands that to memset()). For memfd_secret though, we specifically don't map our pages via the direct map (i.e. we call set_direct_map_invalid_noflush() on every fault). So the address returned by page_address() isn't useful, and when we try to memset() with it we panic. This patch avoids the panic by implementing a custom setattr for memfd_secret, which detects resizes specifically (setting the size for the first time works just fine, since there are no existing pages to try to zero), and rejects them with EINVAL. One could argue growing should be supported, but I think that will require a significantly more lengthy change. So, I propose a minimal fix for the benefit of stable kernels, and then perhaps to extend memfd_secret to support growing in a separate patch. [1]: BUG: unable to handle page fault for address: ffffa0a889277028 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD afa01067 P4D afa01067 PUD 83f909067 PMD 83f8bf067 PTE 800ffffef6d88060 Oops: 0002 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI CPU: 0 PID: 281 Comm: repro Not tainted 5.17.0-dbg-DEV #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 RIP: 0010:memset_erms+0x9/0x10 Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 aa 4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01 RSP: 0018:ffffb932c09afbf0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffffda63c4249dc0 RCX: 0000000000000fd8 RDX: 0000000000000fd8 RSI: 0000000000000000 RDI: ffffa0a889277028 RBP: ffffb932c09afc00 R08: 0000000000001000 R09: ffffa0a889277028 R10: 0000000000020023 R11: 0000000000000000 R12: ffffda63c4249dc0 R13: ffffa0a890d70d98 R14: 0000000000000028 R15: 0000000000000fd8 FS: 00007f7294899580(0000) GS:ffffa0af9bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffa0a889277028 CR3: 0000000107ef6006 CR4: 0000000000370ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? zero_user_segments+0x82/0x190 truncate_inode_partial_folio+0xd4/0x2a0 truncate_inode_pages_range+0x380/0x830 truncate_setsize+0x63/0x80 simple_setattr+0x37/0x60 notify_change+0x3d8/0x4d0 do_sys_ftruncate+0x162/0x1d0 __x64_sys_ftruncate+0x1c/0x20 do_syscall_64+0x44/0xa0 entry_SYSCALL_64_after_hwframe+0x44/0xae Modules linked in: xhci_pci xhci_hcd virtio_net net_failover failover virtio_blk virtio_balloon uhci_hcd ohci_pci ohci_hcd evdev ehci_pci ehci_hcd 9pnet_virtio 9p netfs 9pnet CR2: ffffa0a889277028 [lkp@intel.com: secretmem_iops can be static] Signed-off-by: kernel test robot [axelrasmussen@google.com: return EINVAL] Link: https://lkml.kernel.org/r/20220324210909.1843814-1-axelrasmussen@google.com Link: https://lkml.kernel.org/r/20220412193023.279320-1-axelrasmussen@google.com Signed-off-by: Axel Rasmussen Cc: Mike Rapoport Cc: Matthew Wilcox Cc: Cc: kernel test robot Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/secretmem.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) commit 1bdec44b1eee32e311b44b5b06144bb7d9b33938 Author: Hugh Dickins Date: Thu Apr 14 19:13:27 2022 -0700 tmpfs: fix regressions from wider use of ZERO_PAGE Chuck Lever reported fsx-based xfstests generic 075 091 112 127 failing when 5.18-rc1 NFS server exports tmpfs: bisected to recent tmpfs change. Whilst nfsd_splice_action() does contain some questionable handling of repeated pages, and Chuck was able to work around there, history from Mark Hemment makes clear that there might be similar dangers elsewhere: it was not a good idea for me to pass ZERO_PAGE down to unknown actors. Revert shmem_file_read_iter() to using ZERO_PAGE for holes only when iter_is_iovec(); in other cases, use the more natural iov_iter_zero() instead of copy_page_to_iter(). We would use iov_iter_zero() throughout, but the x86 clear_user() is not nearly so well optimized as copy to user (dd of 1T sparse tmpfs file takes 57 seconds rather than 44 seconds). And now pagecache_init() does not need to SetPageUptodate(ZERO_PAGE(0)): which had caused boot failure on arm noMMU STM32F7 and STM32H7 boards Link: https://lkml.kernel.org/r/9a978571-8648-e830-5735-1f4748ce2e30@google.com Fixes: 56a8c8eb1eaf ("tmpfs: do not allocate pages on read") Signed-off-by: Hugh Dickins Reported-by: Patrice CHOTARD Reported-by: Chuck Lever III Tested-by: Chuck Lever III Cc: Mark Hemment Cc: Patrice CHOTARD Cc: Mikulas Patocka Cc: Lukas Czerner Cc: Christoph Hellwig Cc: "Darrick J. Wong" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/filemap.c | 6 ------ mm/shmem.c | 31 ++++++++++++++++++++----------- 2 files changed, 20 insertions(+), 17 deletions(-) commit 7fbd166a8f2d697c3e2b4c8432d33253f00266b3 Author: Joe Perches Date: Thu Apr 14 19:13:24 2022 -0700 MAINTAINERS: Broadcom internal lists aren't maintainers Convert the broadcom internal list M: and L: entries to R: as exploder email addresses are neither maintainers nor mailing lists. Reorder the entries as necessary. Link: https://lkml.kernel.org/r/04eb301f5b3adbefdd78e76657eff0acb3e3d87f.camel@perches.com Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds MAINTAINERS | 64 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) commit e35c93695c742b88f5fe32063674551440c63d08 Author: Borislav Petkov Date: Tue Apr 5 17:15:11 2022 +0200 i2c: ismt: Fix undefined behavior due to shift overflowing the constant Fix: drivers/i2c/busses/i2c-ismt.c: In function ‘ismt_hw_init’: drivers/i2c/busses/i2c-ismt.c:770:2: error: case label does not reduce to an integer constant case ISMT_SPGT_SPD_400K: ^~~~ drivers/i2c/busses/i2c-ismt.c:773:2: error: case label does not reduce to an integer constant case ISMT_SPGT_SPD_1M: ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Signed-off-by: Borislav Petkov Reviewed-by: Seth Heasley Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-ismt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit aef80e2fbe3ec6264e935cebfb8fa3367cb1e7b0 Author: Andy Shevchenko Date: Mon Apr 11 21:07:52 2022 +0300 i2c: dev: Force case user pointers in compat_i2cdev_ioctl() Sparse has warned us about wrong address space for user pointers: i2c-dev.c:561:50: warning: incorrect type in initializer (different address spaces) i2c-dev.c:561:50: expected unsigned char [usertype] *buf i2c-dev.c:561:50: got void [noderef] __user * Force cast the pointer to (__u8 *) that is used by I²C core code. Note, this is an additional fix to the previously addressed similar issue in the I2C_RDWR case in the same function. Fixes: 3265a7e6b41b ("i2c: dev: Add __user annotation") Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang drivers/i2c/i2c-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d08ed852560eb71445547f3df7b05bf5c5c69cc4 Author: Horatiu Vultur Date: Wed Apr 13 21:57:16 2022 +0200 net: lan966x: Make sure to release ptp interrupt When the lan966x driver is removed make sure to remove also the ptp_irq IRQ. Fixes: e85a96e48e3309 ("net: lan966x: Add support for ptp interrupts") Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220413195716.3796467-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 3 +++ 1 file changed, 3 insertions(+) commit 9cb7c013420f98fa6fd12fc6a5dc055170c108db Author: Eric Dumazet Date: Wed Apr 13 11:13:33 2022 -0700 ipv6: make ip6_rt_gc_expire an atomic_t Reads and Writes to ip6_rt_gc_expire always have been racy, as syzbot reported lately [1] There is a possible risk of under-flow, leading to unexpected high value passed to fib6_run_gc(), although I have not observed this in the field. Hosts hitting ip6_dst_gc() very hard are under pretty bad state anyway. [1] BUG: KCSAN: data-race in ip6_dst_gc / ip6_dst_gc read-write to 0xffff888102110744 of 4 bytes by task 13165 on cpu 1: ip6_dst_gc+0x1f3/0x220 net/ipv6/route.c:3311 dst_alloc+0x9b/0x160 net/core/dst.c:86 ip6_dst_alloc net/ipv6/route.c:344 [inline] icmp6_dst_alloc+0xb2/0x360 net/ipv6/route.c:3261 mld_sendpack+0x2b9/0x580 net/ipv6/mcast.c:1807 mld_send_cr net/ipv6/mcast.c:2119 [inline] mld_ifc_work+0x576/0x800 net/ipv6/mcast.c:2651 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 read-write to 0xffff888102110744 of 4 bytes by task 11607 on cpu 0: ip6_dst_gc+0x1f3/0x220 net/ipv6/route.c:3311 dst_alloc+0x9b/0x160 net/core/dst.c:86 ip6_dst_alloc net/ipv6/route.c:344 [inline] icmp6_dst_alloc+0xb2/0x360 net/ipv6/route.c:3261 mld_sendpack+0x2b9/0x580 net/ipv6/mcast.c:1807 mld_send_cr net/ipv6/mcast.c:2119 [inline] mld_ifc_work+0x576/0x800 net/ipv6/mcast.c:2651 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 value changed: 0x00000bb3 -> 0x00000ba9 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 11607 Comm: kworker/0:21 Not tainted 5.18.0-rc1-syzkaller-00037-g42e7a03d3bad-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: mld mld_ifc_work Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Reported-by: syzbot Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220413181333.649424-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski include/net/netns/ipv6.h | 4 ++-- net/ipv6/route.c | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) commit 268b41b34d9afd0e49bb266d5cca54c50abbe4c2 Merge: 0b9dcf377553 db53cd3d88dc Author: Jakub Kicinski Date: Fri Apr 15 14:27:30 2022 -0700 Merge branch 'l3mdev-fix-ip-tunnel-case-after-recent-l3mdev-change' David Ahern says: ==================== l3mdev: Fix ip tunnel case after recent l3mdev change Second patch provides a fix for ip tunnels after the recent l3mdev change that avoids touching the oif in the flow struct. First patch preemptively provides a fix to an existing function that the second patch uses. ==================== Link: https://lore.kernel.org/r/20220413174320.28989-1-dsahern@kernel.org Signed-off-by: Jakub Kicinski commit db53cd3d88dc328dea2e968c9c8d3b4294a8a674 Author: David Ahern Date: Wed Apr 13 11:43:20 2022 -0600 net: Handle l3mdev in ip_tunnel_init_flow Ido reported that the commit referenced in the Fixes tag broke a gre use case with dummy devices. Add a check to ip_tunnel_init_flow to see if the oif is an l3mdev port and if so set the oif to 0 to avoid the oif comparison in fib_lookup_good_nhc. Fixes: 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices") Reported-by: Ido Schimmel Signed-off-by: David Ahern Signed-off-by: Jakub Kicinski drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c | 2 +- include/net/ip_tunnels.h | 11 +++++++++-- net/ipv4/ip_gre.c | 4 ++-- net/ipv4/ip_tunnel.c | 9 +++++---- 4 files changed, 17 insertions(+), 9 deletions(-) commit 83daab06252ee5d0e1f4373ff28b79304945fc19 Author: David Ahern Date: Wed Apr 13 11:43:19 2022 -0600 l3mdev: l3mdev_master_upper_ifindex_by_index_rcu should be using netdev_master_upper_dev_get_rcu Next patch uses l3mdev_master_upper_ifindex_by_index_rcu which throws a splat with debug kernels: [13783.087570] ------------[ cut here ]------------ [13783.093974] RTNL: assertion failed at net/core/dev.c (6702) [13783.100761] WARNING: CPU: 3 PID: 51132 at net/core/dev.c:6702 netdev_master_upper_dev_get+0x16a/0x1a0 [13783.184226] CPU: 3 PID: 51132 Comm: kworker/3:3 Not tainted 5.17.0-custom-100090-g6f963aafb1cc #682 [13783.194788] Hardware name: Mellanox Technologies Ltd. MSN2010/SA002610, BIOS 5.6.5 08/24/2017 [13783.204755] Workqueue: mld mld_ifc_work [ipv6] [13783.210338] RIP: 0010:netdev_master_upper_dev_get+0x16a/0x1a0 [13783.217209] Code: 0f 85 e3 fe ff ff e8 65 ac ec fe ba 2e 1a 00 00 48 c7 c6 60 6f 38 83 48 c7 c7 c0 70 38 83 c6 05 5e b5 d7 01 01 e8 c6 29 52 00 <0f> 0b e9 b8 fe ff ff e8 5a 6c 35 ff e9 1c ff ff ff 48 89 ef e8 7d [13783.238659] RSP: 0018:ffffc9000b37f5a8 EFLAGS: 00010286 [13783.244995] RAX: 0000000000000000 RBX: ffff88812ee5c000 RCX: 0000000000000000 [13783.253379] RDX: ffff88811ce09d40 RSI: ffffffff812d0fcd RDI: fffff5200166fea7 [13783.261769] RBP: 0000000000000000 R08: 0000000000000001 R09: ffff8882375f4287 [13783.270138] R10: ffffed1046ebe850 R11: 0000000000000001 R12: dffffc0000000000 [13783.278510] R13: 0000000000000275 R14: ffffc9000b37f688 R15: ffff8881273b4af8 [13783.286870] FS: 0000000000000000(0000) GS:ffff888237400000(0000) knlGS:0000000000000000 [13783.296352] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [13783.303177] CR2: 00007ff25fc9b2e8 CR3: 0000000174d23000 CR4: 00000000001006e0 [13783.311546] Call Trace: [13783.314660] [13783.317553] l3mdev_master_upper_ifindex_by_index_rcu+0x43/0xe0 ... Change l3mdev_master_upper_ifindex_by_index_rcu to use netdev_master_upper_dev_get_rcu. Fixes: 6a6d6681ac1a ("l3mdev: add function to retreive upper master") Signed-off-by: Ido Schimmel Signed-off-by: David Ahern Cc: Alexis Bauvin Signed-off-by: Jakub Kicinski net/l3mdev/l3mdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0b9dcf37755381e9d0b70969b5178d91e32defc8 Merge: f3226eed5431 ec5b0f605b10 Author: Jakub Kicinski Date: Fri Apr 15 14:26:20 2022 -0700 Merge branch 'net-sched-two-fixes-for-cls_u32' Eric Dumazet says: ==================== net/sched: two fixes for cls_u32 One syzbot report brought my attention to cls_u32. This series addresses the syzbot report, and an additional issue discovered in code review. ==================== Link: https://lore.kernel.org/r/20220413173542.533060-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit ec5b0f605b105457f257f2870acad4a5d463984b Author: Eric Dumazet Date: Wed Apr 13 10:35:42 2022 -0700 net/sched: cls_u32: fix possible leak in u32_init_knode() While investigating a related syzbot report, I found that whenever call to tcf_exts_init() from u32_init_knode() is failing, we end up with an elevated refcount on ht->refcnt To avoid that, only increase the refcount after all possible errors have been evaluated. Fixes: b9a24bb76bf6 ("net_sched: properly handle failure case of tcf_exts_init()") Signed-off-by: Eric Dumazet Cc: Cong Wang Cc: Jiri Pirko Acked-by: Jamal Hadi Salim Signed-off-by: Jakub Kicinski net/sched/cls_u32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 3db09e762dc79584a69c10d74a6b98f89a9979f8 Author: Eric Dumazet Date: Wed Apr 13 10:35:41 2022 -0700 net/sched: cls_u32: fix netns refcount changes in u32_change() We are now able to detect extra put_net() at the moment they happen, instead of much later in correct code paths. u32_init_knode() / tcf_exts_init() populates the ->exts.net pointer, but as mentioned in tcf_exts_init(), the refcount on netns has not been elevated yet. The refcount is taken only once tcf_exts_get_net() is called. So the two u32_destroy_key() calls from u32_change() are attempting to release an invalid reference on the netns. syzbot report: refcount_t: decrement hit 0; leaking memory. WARNING: CPU: 0 PID: 21708 at lib/refcount.c:31 refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31 Modules linked in: CPU: 0 PID: 21708 Comm: syz-executor.5 Not tainted 5.18.0-rc2-next-20220412-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31 Code: 1d 14 b6 b2 09 31 ff 89 de e8 6d e9 89 fd 84 db 75 e0 e8 84 e5 89 fd 48 c7 c7 40 aa 26 8a c6 05 f4 b5 b2 09 01 e8 e5 81 2e 05 <0f> 0b eb c4 e8 68 e5 89 fd 0f b6 1d e3 b5 b2 09 31 ff 89 de e8 38 RSP: 0018:ffffc900051af1b0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000040000 RSI: ffffffff8160a0c8 RDI: fffff52000a35e28 RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff81604a9e R11: 0000000000000000 R12: 1ffff92000a35e3b R13: 00000000ffffffef R14: ffff8880211a0194 R15: ffff8880577d0a00 FS: 00007f25d183e700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f19c859c028 CR3: 0000000051009000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_dec include/linux/refcount.h:344 [inline] refcount_dec include/linux/refcount.h:359 [inline] ref_tracker_free+0x535/0x6b0 lib/ref_tracker.c:118 netns_tracker_free include/net/net_namespace.h:327 [inline] put_net_track include/net/net_namespace.h:341 [inline] tcf_exts_put_net include/net/pkt_cls.h:255 [inline] u32_destroy_key.isra.0+0xa7/0x2b0 net/sched/cls_u32.c:394 u32_change+0xe01/0x3140 net/sched/cls_u32.c:909 tc_new_tfilter+0x98d/0x2200 net/sched/cls_api.c:2148 rtnetlink_rcv_msg+0x80d/0xb80 net/core/rtnetlink.c:6016 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2495 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e2/0x800 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 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+0x44/0xae RIP: 0033:0x7f25d0689049 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:00007f25d183e168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f25d079c030 RCX: 00007f25d0689049 RDX: 0000000000000000 RSI: 0000000020000340 RDI: 0000000000000005 RBP: 00007f25d06e308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd0b752e3f R14: 00007f25d183e300 R15: 0000000000022000 Fixes: 35c55fc156d8 ("cls_u32: use tcf_exts_get_net() before call_rcu()") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Cong Wang Cc: Jiri Pirko Acked-by: Jamal Hadi Salim Signed-off-by: Jakub Kicinski net/sched/cls_u32.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) commit f3226eed54318e7bdc186f8f7ed27bcd3cb8b681 Merge: 60496069d0ae 04ebaa1cfdda Author: Jakub Kicinski Date: Fri Apr 15 14:25:42 2022 -0700 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-04-13 This series contains updates to igc and e1000e drivers. Sasha removes waiting for hardware semaphore as it could cause an infinite loop and changes usleep_range() calls done under atomic context to udelay() for igc. For e1000e, he changes some variables from u16 to u32 to prevent possible overflow of values. Vinicius disables PTM when going to suspend as it is causing hang issues on some platforms for igc. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: e1000e: Fix possible overflow in LTR decoding igc: Fix suspending when PTM is active igc: Fix BUG: scheduling while atomic igc: Fix infinite loop in release_swfw_sync ==================== Link: https://lore.kernel.org/r/20220413170814.2066855-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 993eb48fa199b5f476df8204e652eff63dd19361 Author: Andy Shevchenko Date: Mon Apr 11 21:07:51 2022 +0300 i2c: dev: check return value when calling dev_set_name() If dev_set_name() fails, the dev_name() is null, check the return value of dev_set_name() to avoid the null-ptr-deref. Fixes: 1413ef638aba ("i2c: dev: Fix the race between the release of i2c_dev and cdev") Signed-off-by: Andy Shevchenko Signed-off-by: Wolfram Sang drivers/i2c/i2c-dev.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) commit c60bd968c74749a85c71dfed5fabd3e36d487d54 Author: Bjorn Andersson Date: Tue Apr 12 14:26:01 2022 -0700 i2c: qcom-geni: Use dev_err_probe() for GPI DMA error The GPI DMA engine driver can be compiled as a module, in which case the likely probe deferral "error" shows up in the kernel log. Switch to using dev_err_probe() to silence this warning and to ensure that "devices_deferred" in debugfs carries this information. Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-qcom-geni.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 39c025721d706eb4fa8a5a7a376c93a3162b71bc Author: Marek Vasut Date: Fri Apr 8 19:15:24 2022 +0200 i2c: imx: Implement errata ERR007805 or e7805 bus frequency limit The i.MX8MP Mask Set Errata for Mask 1P33A, Rev. 2.0 has description of errata ERR007805 as below. This errata is found on all MX8M{M,N,P,Q}, MX7{S,D}, MX6{UL{,L,Z},S{,LL,X},S,D,DL,Q,DP,QP} . MX7ULP, MX8Q, MX8X are not affected. MX53 and older status is unknown, as the errata first appears in MX6 errata sheets from 2016 and the latest errata sheet for MX53 is from 2015. Older SoC errata sheets predate the MX53 errata sheet. MX8ULP and MX9 status is unknown as the errata sheet is not available yet. " ERR007805 I2C: When the I2C clock speed is configured for 400 kHz, the SCL low period violates the I2C spec of 1.3 uS min Description: When the I2C module is programmed to operate at the maximum clock speed of 400 kHz (as defined by the I2C spec), the SCL clock low period violates the I2C spec of 1.3 uS min. The user must reduce the clock speed to obtain the SCL low time to meet the 1.3us I2C minimum required. This behavior means the SoC is not compliant to the I2C spec at 400kHz. Workaround: To meet the clock low period requirement in fast speed mode, SCL must be configured to 384KHz or less. " Implement the workaround by matching on the affected SoC specific compatible strings and by limiting the maximum bus frequency in case the SoC is affected. Signed-off-by: Marek Vasut To: linux-i2c@vger.kernel.org Acked-by: Oleksij Rempel Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-imx.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) commit bd8963e602c77adc76dbbbfc3417c3cf14fed76b Author: Martin Povišer Date: Tue Mar 29 20:38:17 2022 +0200 i2c: pasemi: Wait for write xfers to finish Wait for completion of write transfers before returning from the driver. At first sight it may seem advantageous to leave write transfers queued for the controller to carry out on its own time, but there's a couple of issues with it: * Driver doesn't check for FIFO space. * The queued writes can complete while the driver is in its I2C read transfer path which means it will get confused by the raising of XEN (the 'transaction ended' signal). This can cause a spurious ENODATA error due to premature reading of the MRXFIFO register. Adding the wait fixes some unreliability issues with the driver. There's some efficiency cost to it (especially with pasemi_smb_waitready doing its polling), but that will be alleviated once the driver receives interrupt support. Fixes: beb58aa39e6e ("i2c: PA Semi SMBus driver") Signed-off-by: Martin Povišer Reviewed-by: Sven Peter Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-pasemi-core.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 92b914e29af3e99589f2d2876616c0b534892ed4 Author: Shin'ichiro Kawasaki Date: Fri Apr 15 17:45:13 2022 +0900 dm: fix bio length of empty flush The commit 92986f6b4c8a ("dm: use bio_clone_fast in alloc_io/alloc_tio") removed bio_clone_fast() call from alloc_tio() when ci->io->tio is available. In this case, ci->bio is not copied to ci->io->tio.clone. This is fine since init_clone_info() sets same values to ci->bio and ci->io->tio.clone. However, when incoming bios have REQ_PREFLUSH flag, __send_empty_flush() prepares a zero length bio on stack and set it to ci->bio. At this time, ci->io->tio.clone still keeps non-zero length. When alloc_tio() chooses this ci->io->tio.clone as the bio to map, it is passed to targets as non-empty flush bio. It causes bio length check failure in dm-zoned and unexpected operation such as dm_accept_partial_bio() call. To avoid the non-empty flush bio, set zero length to ci->io->tio.clone in __send_empty_flush(). Fixes: 92986f6b4c8a ("dm: use bio_clone_fast in alloc_io/alloc_tio") Signed-off-by: Shin'ichiro Kawasaki Signed-off-by: Mike Snitzer drivers/md/dm.c | 1 + 1 file changed, 1 insertion(+) commit fb649bda6f5642f173ee3429a965c769554f23d8 Merge: 0647b9cc7fea 89a2ee91edd9 Author: Linus Torvalds Date: Fri Apr 15 11:38:55 2022 -0700 Merge tag 'block-5.18-2022-04-15' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - Moving of lower_48_bits() to the block layer and a fix for the unaligned_be48 added with that originally (Alexander, Keith) - Fix a bad WARN_ON() for trim size checking (Ming) - A polled IO timeout fix for null_blk (Ming) - Silence IO error printing for dead disks (Christoph) - Compat mode range fix (Khazhismel) - NVMe pull request via Christoph: - Tone down the error logging added this merge window a bit (Chaitanya Kulkarni) - Quirk devices with non-unique unique identifiers (Christoph) * tag 'block-5.18-2022-04-15' of git://git.kernel.dk/linux-block: block: don't print I/O error warning for dead disks block/compat_ioctl: fix range check in BLKGETSIZE nvme-pci: disable namespace identifiers for Qemu controllers nvme-pci: disable namespace identifiers for the MAXIO MAP1002/1202 nvme: add a quirk to disable namespace identifiers nvme: don't print verbose errors for internal passthrough requests block: null_blk: end timed out poll request block: fix offset/size check in bio_trim() asm-generic: fix __get_unaligned_be48() on 32 bit platforms block: move lower_48_bits() to block commit 0647b9cc7feac30eb6c397ccb746aaa91e21e0de Merge: bb34e0dba38e 701521403cfb Author: Linus Torvalds Date: Fri Apr 15 11:33:20 2022 -0700 Merge tag 'io_uring-5.18-2022-04-14' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: - Ensure we check and -EINVAL any use of reserved or struct padding. Although we generally always do that, it's missed in two spots for resource updates, one for the ring fd registration from this merge window, and one for the extended arg. Make sure we have all of them handled. (Dylan) - A few fixes for the deferred file assignment (me, Pavel) - Add a feature flag for the deferred file assignment so apps can tell we handle it correctly (me) - Fix a small perf regression with the current file position fix in this merge window (me) * tag 'io_uring-5.18-2022-04-14' of git://git.kernel.dk/linux-block: io_uring: abort file assignment prior to assigning creds io_uring: fix poll error reporting io_uring: fix poll file assign deadlock io_uring: use right issue_flags for splice/tee io_uring: verify pad field is 0 in io_get_ext_arg io_uring: verify resv is 0 in ringfd register/unregister io_uring: verify that resv2 is 0 in io_uring_rsrc_update2 io_uring: move io_uring_rsrc_update2 validation io_uring: fix assign file locking issue io_uring: stop using io_wq_work as an fd placeholder io_uring: move apoll->events cache io_uring: io_kiocb_update_pos() should not touch file for non -1 offset io_uring: flag the fact that linked file assignment is sane commit bb34e0dba38eaed1160c8c863659318ed2929a93 Merge: e2dec4884454 ce64763c6385 Author: Linus Torvalds Date: Fri Apr 15 11:24:32 2022 -0700 Merge tag 'linux-kselftest-fixes-5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: "A mqueue perf test memory leak bug fix. mq_perf_tests failed to call CPU_FREE to free memory allocated by CPU_SET" * tag 'linux-kselftest-fixes-5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu set commit e2dec4884454650a87d31206e7cfbc566665ebe6 Merge: 028192fea1de f58faed7fb3f Author: Linus Torvalds Date: Fri Apr 15 11:15:02 2022 -0700 Merge tag 'perf-tools-fixes-for-v5.18-2022-04-14' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - 'perf record --per-thread' mode doesn't have the CPU mask setup, so it can use it to figure out the number of mmaps, fix it. - Fix segfault accessing sample_id xyarray out of bounds, noticed while using Intel PT where we have a dummy event to capture text poke perf metadata events and we mixup the set of CPUs specified by the user with the all CPUs map needed for text poke. - Fix 'perf bench numa' to check if CPU used to bind task is online. - Fix 'perf bench numa' usage of affinity for machines with more than 1000 CPUs. - Fix misleading add event PMU debug message, noticed while using the 'intel_pt' PMU. - Fix error check return value of hashmap__new() in 'perf stat', it must use IS_ERR(). * tag 'perf-tools-fixes-for-v5.18-2022-04-14' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf bench: Fix numa bench to fix usage of affinity for machines with #CPUs > 1K perf bench: Fix numa testcase to check if CPU used to bind task is online perf record: Fix per-thread option perf tools: Fix segfault accessing sample_id xyarray perf stat: Fix error check return value of hashmap__new(), must use IS_ERR() perf tools: Fix misleading add event PMU debug message commit 8b1ac84dcf2cf0fc86f29e92e5c63c4862de6e55 Author: Hans de Goede Date: Thu Mar 24 17:59:18 2022 +0100 Documentation/ABI: sysfs-fs-erofs: Fix Sphinx errors Fix the following warnings from "make htmldocs": Documentation/ABI/testing/sysfs-fs-erofs:10: ERROR: Unexpected indentation. WARNING: Block quote ends without a blank line; unexpected unindent. Signed-off-by: Hans de Goede Acked-by: Gao Xiang Link: https://lore.kernel.org/r/20220324165918.22005-4-hdegoede@redhat.com Signed-off-by: Gao Xiang Documentation/ABI/testing/sysfs-fs-erofs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 60b30050116c0351b90154044345c1b53ae1f323 Author: Hongyu Jin Date: Fri Apr 1 19:55:27 2022 +0800 erofs: fix use-after-free of on-stack io[] The root cause is the race as follows: Thread #1 Thread #2(irq ctx) z_erofs_runqueue() struct z_erofs_decompressqueue io_A[]; submit bio A z_erofs_decompress_kickoff(,,1) z_erofs_decompressqueue_endio(bio A) z_erofs_decompress_kickoff(,,-1) spin_lock_irqsave() atomic_add_return() io_wait_event() -> pending_bios is already 0 [end of function] wake_up_locked(io_A[]) // crash Referenced backtrace in kernel 5.4: [ 10.129422] Unable to handle kernel paging request at virtual address eb0454a4 [ 10.364157] CPU: 0 PID: 709 Comm: getprop Tainted: G WC O 5.4.147-ab09225 #1 [ 11.556325] [] (__wake_up_common) from [] (__wake_up_locked+0x40/0x48) [ 11.565487] [] (__wake_up_locked) from [] (z_erofs_vle_unzip_kickoff+0x6c/0xc0) [ 11.575438] [] (z_erofs_vle_unzip_kickoff) from [] (z_erofs_vle_read_endio+0x16c/0x17c) [ 11.586082] [] (z_erofs_vle_read_endio) from [] (clone_endio+0xb4/0x1d0) [ 11.595428] [] (clone_endio) from [] (blk_update_request+0x150/0x4dc) [ 11.604516] [] (blk_update_request) from [] (mmc_blk_cqe_complete_rq+0x144/0x15c) [ 11.614640] [] (mmc_blk_cqe_complete_rq) from [] (blk_done_softirq+0xb0/0xcc) [ 11.624419] [] (blk_done_softirq) from [] (__do_softirq+0x184/0x56c) [ 11.633419] [] (__do_softirq) from [] (irq_exit+0xd4/0x138) [ 11.641640] [] (irq_exit) from [] (__handle_domain_irq+0x94/0xd0) [ 11.650381] [] (__handle_domain_irq) from [] (gic_handle_irq+0x50/0xd4) [ 11.659641] [] (gic_handle_irq) from [] (__irq_svc+0x70/0xb0) Signed-off-by: Hongyu Jin Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220401115527.4935-1-hongyu.jin.cn@gmail.com Signed-off-by: Gao Xiang fs/erofs/zdata.c | 12 ++++-------- fs/erofs/zdata.h | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) commit 89a2ee91edd9c555c59e4d38dc54b99141632cc2 Merge: 3d973a76e54c 66dd346b84d7 Author: Jens Axboe Date: Fri Apr 15 06:33:49 2022 -0600 Merge tag 'nvme-5.18-2022-04-15' of git://git.infradead.org/nvme into block-5.18 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.18 - tone down the error logging added this merge window a bit (Chaitanya Kulkarni) - quirk devices with non-unique unique identifiers (me)" * tag 'nvme-5.18-2022-04-15' of git://git.infradead.org/nvme: nvme-pci: disable namespace identifiers for Qemu controllers nvme-pci: disable namespace identifiers for the MAXIO MAP1002/1202 nvme: add a quirk to disable namespace identifiers nvme: don't print verbose errors for internal passthrough requests commit 3d973a76e54c30772e72128ab0552ca75e588893 Author: Christoph Hellwig Date: Wed Mar 23 17:38:15 2022 +0100 block: don't print I/O error warning for dead disks When a disk has been marked dead, don't print warnings for I/O errors as they are very much expected. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220323163815.1526998-1-hch@lst.de Signed-off-by: Jens Axboe block/blk-mq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit ccf16413e520164eb718cf8b22a30438da80ff23 Author: Khazhismel Kumykov Date: Thu Apr 14 15:40:56 2022 -0700 block/compat_ioctl: fix range check in BLKGETSIZE kernel ulong and compat_ulong_t may not be same width. Use type directly to eliminate mismatches. This would result in truncation rather than EFBIG for 32bit mode for large disks. Reviewed-by: Bart Van Assche Signed-off-by: Khazhismel Kumykov Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220414224056.2875681-1-khazhy@google.com Signed-off-by: Jens Axboe block/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 60496069d0ae2d056bc12714d953c142afdef696 Author: Sukadev Bhattiprolu Date: Wed Apr 13 12:45:15 2022 -0700 powerpc: Update MAINTAINERS for ibmvnic and VAS Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller MAINTAINERS | 2 -- 1 file changed, 2 deletions(-) commit da367ac74aecb59b62a9538009d4aee8ce4bdfb3 Author: Stephen Hemminger Date: Thu Apr 14 09:03:12 2022 -0700 net: restore alpha order to Ethernet devices in config The displayed list of Ethernet devices in make menuconfig has gotten out of order. This is mostly due to changes in vendor names etc, but also because of new Microsoft entry in wrong place. This restores so that the display is in order even if the names of the sub directories are not. Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)") Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller drivers/net/ethernet/Kconfig | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) commit cefa91b2332d7009bc0be5d951d6cbbf349f90f8 Author: Paolo Valerio Date: Fri Apr 15 10:08:41 2022 +0200 openvswitch: fix OOB access in reserve_sfa_size() Given a sufficiently large number of actions, while copying and reserving memory for a new action of a new flow, if next_offset is greater than MAX_ACTIONS_BUFSIZE, the function reserve_sfa_size() does not return -EMSGSIZE as expected, but it allocates MAX_ACTIONS_BUFSIZE bytes increasing actions_len by req_size. This can then lead to an OOB write access, especially when further actions need to be copied. Fix it by rearranging the flow action size check. KASAN splat below: ================================================================== BUG: KASAN: slab-out-of-bounds in reserve_sfa_size+0x1ba/0x380 [openvswitch] Write of size 65360 at addr ffff888147e4001c by task handler15/836 CPU: 1 PID: 836 Comm: handler15 Not tainted 5.18.0-rc1+ #27 ... Call Trace: dump_stack_lvl+0x45/0x5a print_report.cold+0x5e/0x5db ? __lock_text_start+0x8/0x8 ? reserve_sfa_size+0x1ba/0x380 [openvswitch] kasan_report+0xb5/0x130 ? reserve_sfa_size+0x1ba/0x380 [openvswitch] kasan_check_range+0xf5/0x1d0 memcpy+0x39/0x60 reserve_sfa_size+0x1ba/0x380 [openvswitch] __add_action+0x24/0x120 [openvswitch] ovs_nla_add_action+0xe/0x20 [openvswitch] ovs_ct_copy_action+0x29d/0x1130 [openvswitch] ? __kernel_text_address+0xe/0x30 ? unwind_get_return_address+0x56/0xa0 ? create_prof_cpu_mask+0x20/0x20 ? ovs_ct_verify+0xf0/0xf0 [openvswitch] ? prep_compound_page+0x198/0x2a0 ? __kasan_check_byte+0x10/0x40 ? kasan_unpoison+0x40/0x70 ? ksize+0x44/0x60 ? reserve_sfa_size+0x75/0x380 [openvswitch] __ovs_nla_copy_actions+0xc26/0x2070 [openvswitch] ? __zone_watermark_ok+0x420/0x420 ? validate_set.constprop.0+0xc90/0xc90 [openvswitch] ? __alloc_pages+0x1a9/0x3e0 ? __alloc_pages_slowpath.constprop.0+0x1da0/0x1da0 ? unwind_next_frame+0x991/0x1e40 ? __mod_node_page_state+0x99/0x120 ? __mod_lruvec_page_state+0x2e3/0x470 ? __kasan_kmalloc_large+0x90/0xe0 ovs_nla_copy_actions+0x1b4/0x2c0 [openvswitch] ovs_flow_cmd_new+0x3cd/0xb10 [openvswitch] ... Cc: stable@vger.kernel.org Fixes: f28cd2af22a0 ("openvswitch: fix flow actions reallocation") Signed-off-by: Paolo Valerio Acked-by: Eelco Chaudron Signed-off-by: David S. Miller net/openvswitch/flow_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ab198e1d0dd8dc4bc7575fb50758e2cbd51e14e1 Author: Peilin Ye Date: Thu Apr 14 13:35:40 2022 -0700 ip6_gre: Fix skb_under_panic in __gre6_xmit() Feng reported an skb_under_panic BUG triggered by running test_ip6gretap() in tools/testing/selftests/bpf/test_tunnel.sh: [ 82.492551] skbuff: skb_under_panic: text:ffffffffb268bb8e len:403 put:12 head:ffff9997c5480000 data:ffff9997c547fff8 tail:0x18b end:0x2c0 dev:ip6gretap11 <...> [ 82.607380] Call Trace: [ 82.609389] [ 82.611136] skb_push.cold.109+0x10/0x10 [ 82.614289] __gre6_xmit+0x41e/0x590 [ 82.617169] ip6gre_tunnel_xmit+0x344/0x3f0 [ 82.620526] dev_hard_start_xmit+0xf1/0x330 [ 82.623882] sch_direct_xmit+0xe4/0x250 [ 82.626961] __dev_queue_xmit+0x720/0xfe0 <...> [ 82.633431] packet_sendmsg+0x96a/0x1cb0 [ 82.636568] sock_sendmsg+0x30/0x40 <...> The following sequence of events caused the BUG: 1. During ip6gretap device initialization, tunnel->tun_hlen (e.g. 4) is calculated based on old flags (see ip6gre_calc_hlen()); 2. packet_snd() reserves header room for skb A, assuming tunnel->tun_hlen is 4; 3. Later (in clsact Qdisc), the eBPF program sets a new tunnel key for skb A using bpf_skb_set_tunnel_key() (see _ip6gretap_set_tunnel()); 4. __gre6_xmit() detects the new tunnel key, and recalculates "tun_hlen" (e.g. 12) based on new flags (e.g. TUNNEL_KEY and TUNNEL_SEQ); 5. gre_build_header() calls skb_push() with insufficient reserved header room, triggering the BUG. As sugguested by Cong, fix it by moving the call to skb_cow_head() after the recalculation of tun_hlen. Reproducer: OBJ=$LINUX/tools/testing/selftests/bpf/test_tunnel_kern.o ip netns add at_ns0 ip link add veth0 type veth peer name veth1 ip link set veth0 netns at_ns0 ip netns exec at_ns0 ip addr add 172.16.1.100/24 dev veth0 ip netns exec at_ns0 ip link set dev veth0 up ip link set dev veth1 up mtu 1500 ip addr add dev veth1 172.16.1.200/24 ip netns exec at_ns0 ip addr add ::11/96 dev veth0 ip netns exec at_ns0 ip link set dev veth0 up ip addr add dev veth1 ::22/96 ip link set dev veth1 up ip netns exec at_ns0 \ ip link add dev ip6gretap00 type ip6gretap seq flowlabel 0xbcdef key 2 \ local ::11 remote ::22 ip netns exec at_ns0 ip addr add dev ip6gretap00 10.1.1.100/24 ip netns exec at_ns0 ip addr add dev ip6gretap00 fc80::100/96 ip netns exec at_ns0 ip link set dev ip6gretap00 up ip link add dev ip6gretap11 type ip6gretap external ip addr add dev ip6gretap11 10.1.1.200/24 ip addr add dev ip6gretap11 fc80::200/24 ip link set dev ip6gretap11 up tc qdisc add dev ip6gretap11 clsact tc filter add dev ip6gretap11 egress bpf da obj $OBJ sec ip6gretap_set_tunnel tc filter add dev ip6gretap11 ingress bpf da obj $OBJ sec ip6gretap_get_tunnel ping6 -c 3 -w 10 -q ::11 Fixes: 6712abc168eb ("ip6_gre: add ip6 gre and gretap collect_md mode") Reported-by: Feng Zhou Co-developed-by: Cong Wang Signed-off-by: Cong Wang Signed-off-by: Peilin Ye Signed-off-by: David S. Miller net/ipv6/ip6_gre.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit f40c064e933d7787ca7411b699504d7a2664c1f5 Author: Peilin Ye Date: Thu Apr 14 13:34:26 2022 -0700 ip6_gre: Avoid updating tunnel->tun_hlen in __gre6_xmit() Do not update tunnel->tun_hlen in data plane code. Use a local variable instead, just like "tunnel_hlen" in net/ipv4/ip_gre.c:gre_fb_xmit(). Co-developed-by: Cong Wang Signed-off-by: Cong Wang Signed-off-by: Peilin Ye Signed-off-by: David S. Miller net/ipv6/ip6_gre.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 226c60243593443bb5d315b3fc2116b72be858fe Merge: 2cc7fb9d2412 7c8881b77908 Author: David S. Miller Date: Fri Apr 15 11:38:23 2022 +0100 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-04-14 This series contains updates to ice driver only. Maciej adjusts implementation in __ice_alloc_rx_bufs_zc() for when ice_fill_rx_descs() does not return the entire buffer request and fixes a return value for !CONFIG_NET_SWITCHDEV configuration which was preventing VF creation. Wojciech prevents eswitch transmit when VFs are being removed which was causing NULL pointer dereference. Jianglei Nie fixes a memory leak on error path of getting OROM data. ==================== Signed-off-by: David S. Miller commit 2cc7fb9d24129be0612df8d32a1358ac91ead8d1 Merge: 29e8e659f984 5bd8baab087d Author: David S. Miller Date: Fri Apr 15 11:20:10 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-04-14 1) Fix the output interface for VRF cases in xfrm_dst_lookup. From David Ahern. 2) Fix write out of bounds by doing COW on esp output when the packet size is larger than a page. From Sabrina Dubroca. ==================== Signed-off-by: David S. Miller commit 29e8e659f984be00d75ec5fef4e37c88def72712 Author: Hangbin Liu Date: Thu Apr 14 16:49:25 2022 +0800 net/packet: fix packet_sock xmit return value checking packet_sock xmit could be dev_queue_xmit, which also returns negative errors. So only checking positive errors is not enough, or userspace sendmsg may return success while packet is not send out. Move the net_xmit_errno() assignment in the braces as checkpatch.pl said do not use assignment in if condition. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Flavio Leitner Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller net/packet/af_packet.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) commit 1a74e99323746353bba11562a2f2d0aa8102f402 Author: Tony Lu Date: Thu Apr 14 15:51:03 2022 +0800 net/smc: Fix sock leak when release after smc_shutdown() Since commit e5d5aadcf3cd ("net/smc: fix sk_refcnt underflow on linkdown and fallback"), for a fallback connection, __smc_release() does not call sock_put() if its state is already SMC_CLOSED. When calling smc_shutdown() after falling back, its state is set to SMC_CLOSED but does not call sock_put(), so this patch calls it. Reported-and-tested-by: syzbot+6e29a053eb165bd50de5@syzkaller.appspotmail.com Fixes: e5d5aadcf3cd ("net/smc: fix sk_refcnt underflow on linkdown and fallback") Signed-off-by: Tony Lu Acked-by: Karsten Graul Signed-off-by: David S. Miller net/smc/af_smc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit ee3b0826b4764f6c13ad6db67495c5a1c38e9025 Author: David Howells Date: Wed Apr 13 11:16:25 2022 +0100 rxrpc: Restore removed timer deletion A recent patch[1] from Eric Dumazet flipped the order in which the keepalive timer and the keepalive worker were cancelled in order to fix a syzbot reported issue[2]. Unfortunately, this enables the mirror image bug whereby the timer races with rxrpc_exit_net(), restarting the worker after it has been cancelled: CPU 1 CPU 2 =============== ===================== if (rxnet->live) rxnet->live = false; cancel_work_sync(&rxnet->peer_keepalive_work); rxrpc_queue_work(&rxnet->peer_keepalive_work); del_timer_sync(&rxnet->peer_keepalive_timer); Fix this by restoring the removed del_timer_sync() so that we try to remove the timer twice. If the timer runs again, it should see ->live == false and not restart the worker. Fixes: 1946014ca3b1 ("rxrpc: fix a race in rxrpc_exit_net()") Signed-off-by: David Howells cc: Eric Dumazet cc: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/20220404183439.3537837-1-eric.dumazet@gmail.com/ [1] Link: https://syzkaller.appspot.com/bug?extid=724378c4bb58f703b09a [2] Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller net/rxrpc/net_ns.c | 2 ++ 1 file changed, 2 insertions(+) commit 6f06aa6b2fd741d2171ff99de3537141610fd933 Author: Arun Ramadoss Date: Wed Apr 13 12:44:09 2022 +0530 net: phy: LAN937x: added PHY_POLL_CABLE_TEST flag Added the phy_poll_cable_test flag for the lan937x phy driver. Tested using command - ethtool --cable-test Fixes: 680baca546f2 ("net: phy: added the LAN937x phy support") Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller drivers/net/phy/microchip_t1.c | 1 + 1 file changed, 1 insertion(+) commit cc994bb97587787b8f0c094a9bc6945d82075b1d Author: Tony Lindgren Date: Mon Apr 11 14:16:57 2022 +0300 serial: 8250: Fix runtime PM for start_tx() for empty buffer Commit 932d596378b0 ("serial: 8250: Return early in .start_tx() if there are no chars to send") caused a regression where the drivers implementing runtime PM stopped idling. This is because serial8250_rpm_put_tx() is now unbalanced on early return, it normally gets called at __stop_tx(). Fixes: 932d596378b0 ("serial: 8250: Return early in .start_tx() if there are no chars to send") Cc: Steffen Trumtrar Cc: Uwe Kleine-König Reviewed-by: Johan Hovold Reviewed-by: Uwe Kleine-König Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220411111657.16744-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/8250/8250_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3ee82c6e41f3d2212647ce0bc5a05a0f69097824 Author: Johan Hovold Date: Mon Apr 11 10:19:57 2022 +0200 serial: imx: fix overrun interrupts in DMA mode Commit 76821e222c18 ("serial: imx: ensure that RX irqs are off if RX is off") accidentally enabled overrun interrupts unconditionally when deferring DMA enable until after the receiver has been enabled during startup. Fix this by using the DMA-initialised instead of DMA-enabled flag to determine whether overrun interrupts should be enabled. Note that overrun interrupts are already accounted for in imx_uart_clear_rx_errors() when using DMA since commit 41d98b5da92f ("serial: imx-serial - update RX error counters when DMA is used"). Fixes: 76821e222c18 ("serial: imx: ensure that RX irqs are off if RX is off") Cc: stable@vger.kernel.org # 4.17 Cc: Uwe Kleine-König Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220411081957.7846-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0e4deb56b0c625efdb70c94f150429e2f2a16fa1 Author: Lino Sanfilippo Date: Sat Apr 9 01:35:02 2022 +0200 serial: amba-pl011: do not time out prematurely when draining tx fifo The current timeout for draining the tx fifo in RS485 mode is calculated by multiplying the time it takes to transmit one character (with the given baud rate) with the maximal number of characters in the tx queue. This timeout is too short for two reasons: First when calculating the time to transmit one character integer division is used which may round down the result in case of a remainder of the division. Fix this by rounding up the division result. Second the hardware may need additional time (e.g for first putting the characters from the fifo into the shift register) before the characters are actually put onto the wire. To be on the safe side double the current maximum number of iterations that are used to wait for the queue draining. Fixes: 8d479237727c ("serial: amba-pl011: add RS485 support") Cc: stable@vger.kernel.org Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20220408233503.7251-1-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/amba-pl011.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 6624fb41f5126c7205e866e58d4aaae0453f0914 Author: Kai Vehmanen Date: Thu Apr 14 19:01:29 2022 +0300 ALSA: hda/hdmi: add HDMI codec VID for Raptorlake-P Add HDMI codec VID for Intel Raptorlake-P platform. Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220414160129.3641411-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_hdmi.c | 1 + 1 file changed, 1 insertion(+) commit c74193787b2f683751a67603fb5f15c7584f355f Author: Kai Vehmanen Date: Thu Apr 14 18:05:16 2022 +0300 ALSA: hda/hdmi: fix warning about PCM count when used with SOF With commit 13046370c4d1 ("ALSA: hda/hdmi: let new platforms assign the pcm slot dynamically"), old behaviour to consider the HDA pin number, when choosing PCM to assign, was dropped. Build on this change and limit the number of PCMs created to number of converters (= maximum number of concurrent display/receivers) when "mst_no_extra_pcms" and "dyn_pcm_no_legacy" quirks are both set. Fix the check in hdmi_find_pcm_slot() to ensure only spec->pcm_used entries are considered in the search. Elsewhere in the driver spec->pcm_used is already checked properly. Doing this avoids following warning at SOF driver probe for multiple machine drivers: [ 112.425297] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 4 [ 112.425298] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 5 [ 112.425299] sof_sdw sof_sdw: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 6 Fixes: 13046370c4d1 ("ALSA: hda/hdmi: let new platforms assign the pcm slot dynamically") BugLink: https://github.com/thesofproject/linux/issues/2573 Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220414150516.3638283-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_hdmi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 357ad4d898286b94aaae0cb7e3f573459e5b98b9 Author: Miles Chen Date: Thu Apr 14 17:19:38 2022 +0800 sound/oss/dmasound: fix 'dmasound_setup' defined but not used We observed: 'dmasound_setup' defined but not used error with COMPILER=gcc ARCH=m68k DEFCONFIG=allmodconfig build. Fix it by adding __maybe_unused to dmasound_setup. Error(s): sound/oss/dmasound/dmasound_core.c:1431:12: error: 'dmasound_setup' defined but not used [-Werror=unused-function] Fixes: 9dd7c46346ca ("sound/oss/dmasound: fix build when drivers are mixed =y/=m") Signed-off-by: Miles Chen Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220414091940.2216-1-miles.chen@mediatek.com Signed-off-by: Takashi Iwai sound/oss/dmasound/dmasound_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ff9166c623704337bd6fe66fce2838d9768a6634 Author: Daniel Starke Date: Thu Apr 14 02:42:25 2022 -0700 tty: n_gsm: fix incorrect UA handling n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.4.4.2 states that any received unnumbered acknowledgment (UA) with its poll/final (PF) bit set to 0 shall be discarded. Currently, all UA frame are handled in the same way regardless of the PF bit. This does not comply with the standard. Remove the UA case in gsm_queue() to process only UA frames with PF bit set to 1 to abide the standard. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-20-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 1 - 1 file changed, 1 deletion(-) commit 73029a4d7161f8b6c0934553145ef574d2d0c645 Author: Daniel Starke Date: Thu Apr 14 02:42:22 2022 -0700 tty: n_gsm: fix reset fifo race condition gsmtty_write() and gsm_dlci_data_output() properly guard the fifo access. However, gsm_dlci_close() and gsmtty_flush_buffer() modifies the fifo but do not guard this. Add a guard here to prevent race conditions on parallel writes to the fifo. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-17-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 1adf6fee58ca25fb6720b8d34c919dcf5425cc9c Author: Daniel Starke Date: Thu Apr 14 02:42:19 2022 -0700 tty: n_gsm: fix missing tty wakeup in convergence layer type 2 gsm_control_modem() informs the virtual tty that more data can be written after receiving a control signal octet via modem status command (MSC). However, gsm_dlci_data() fails to do the same after receiving a control signal octet from the convergence layer type 2 header. Add tty_wakeup() in gsm_dlci_data() for convergence layer type 2 to fix this. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-14-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 1 + 1 file changed, 1 insertion(+) commit 317f86af7f5d19f286ed2d181cbaef4a188c7f19 Author: Daniel Starke Date: Thu Apr 14 02:42:18 2022 -0700 tty: n_gsm: fix wrong signal octets encoding in MSC n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. The value of the modem status command (MSC) frame contains an address field, control signal and optional break signal octet. The address field is encoded as described in chapter 5.2.1.2 with only one octet (may be extended to more in future versions of the standard). Whereas the control signal and break signal octet are always one byte each. This is strange at first glance as it makes the EA bit redundant. However, the same two octets are also encoded as header in convergence layer type 2 as described in chapter 5.5.2. No header length field is given and the only way to test if there is an optional break signal octet is via the EA flag which extends the control signal octet with a break signal octet. Now it becomes obvious how the EA bit for those two octets shall be encoded in the MSC frame. The current implementation treats the signal octet different for MSC frame and convergence layer type 2 header even though the standard describes it for both in the same way. Use the EA bit to encode the signal octets not only in the convergence layer type 2 header but also in the MSC frame in the same way with either 1 or 2 bytes in case of an optional break signal. Adjust the receiving path accordingly in gsm_control_modem(). Fixes: 3ac06b905655 ("tty: n_gsm: Fix for modems with brk in modem status control") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-13-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) commit 398867f59f956985f4c324f173eff7b946e14bd8 Author: Daniel Starke Date: Thu Apr 14 02:42:17 2022 -0700 tty: n_gsm: fix wrong command frame length field encoding n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.4.6.1 states that each command frame shall be made up from type, length and value. Looking for example in chapter 5.4.6.3.5 at the description for the encoding of a flow control on command it becomes obvious, that the type and length field is always present whereas the value may be zero bytes long. The current implementation omits the length field if the value is not present. This is wrong. Correct this by always sending the length in gsm_control_transmit(). So far only the modem status command (MSC) has included a value and encoded its length directly. Therefore, also change gsmtty_modem_update(). Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-12-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) commit d0bcdffcad5a22f202e3bf37190c0dd8c080ea92 Author: Daniel Starke Date: Thu Apr 14 02:42:16 2022 -0700 tty: n_gsm: fix wrong command retry handling n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.7.3 states that the valid range for the maximum number of retransmissions (N2) is from 0 to 255 (both including). gsm_config() fails to limit this range correctly. Furthermore, gsm_control_retransmit() handles this number incorrectly by performing N2 - 1 retransmission attempts. Setting N2 to zero results in more than 255 retransmission attempts. Fix the range check in gsm_config() and the value handling in gsm_control_send() and gsm_control_retransmit() to comply with 3GPP 27.010. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-11-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 17eac652028501df7ea296b1d9b9c134db262b7d Author: Daniel Starke Date: Thu Apr 14 02:42:15 2022 -0700 tty: n_gsm: fix missing explicit ldisc flush In gsm_cleanup_mux() the muxer is closed down and all queues are removed. However, removing the queues is done without explicit control of the underlying buffers. Flush those before freeing up our queues to ensure that all outgoing queues are cleared consistently. Otherwise, a new mux connection establishment attempt may time out while the underlying tty is still busy sending out the remaining data from the previous connection. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-10-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 1 + 1 file changed, 1 insertion(+) commit deefc58bafb4841df7f0a0d85d89a1c819db9743 Author: Daniel Starke Date: Thu Apr 14 02:42:14 2022 -0700 tty: n_gsm: fix wrong DLCI release order The current DLCI release order starts with the control channel followed by the user channels. Reverse this order to keep the control channel open until all user channels have been released. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-9-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 535bf600de75a859698892ee873521a48d289ec1 Author: Daniel Starke Date: Thu Apr 14 02:42:13 2022 -0700 tty: n_gsm: fix insufficient txframe size n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.7.2 states that the maximum frame size (N1) refers to the length of the information field (i.e. user payload). However, 'txframe' stores the whole frame including frame header, checksum and start/end flags. We also need to consider the byte stuffing overhead. Define constant for the protocol overhead and adjust the 'txframe' size calculation accordingly to reserve enough space for a complete mux frame including byte stuffing for advanced option mode. Note that no byte stuffing is applied to the start and end flag. Also use MAX_MTU instead of MAX_MRU as this buffer is used for data transmission. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-8-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit a24b4b2f660b7ddf3f484b37600bba382cb28a9d Author: Daniel Starke Date: Thu Apr 14 02:42:12 2022 -0700 tty: n_gsm: fix malformed counter for out of frame data The gsm_mux field 'malformed' represents the number of malformed frames received. However, gsm1_receive() also increases this counter for any out of frame byte. Fix this by ignoring out of frame data for the malformed counter. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-7-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 7a0e4b1733b635026a87c023f6d703faf0095e39 Author: Daniel Starke Date: Thu Apr 14 02:42:11 2022 -0700 tty: n_gsm: fix frame reception handling The frame checksum (FCS) is currently handled in gsm_queue() after reception of a frame. However, this breaks layering. A workaround with 'received_fcs' was implemented so far. Furthermore, frames are handled as such even if no end flag was received. Move FCS calculation from gsm_queue() to gsm0_receive() and gsm1_receive(). Also delay gsm_queue() call there until a full frame was received to fix both points. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-6-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 53 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) commit 06d5afd4d640eea67f5623e76cd5fc03359b7f3c Author: Daniel Starke Date: Thu Apr 14 02:42:10 2022 -0700 tty: n_gsm: fix wrong signal octet encoding in convergence layer type 2 n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.5.2 describes that the signal octet in convergence layer type 2 can be either one or two bytes. The length is encoded in the EA bit. This is set 1 for the last byte in the sequence. gsmtty_modem_update() handles this correctly but gsm_dlci_data_output() fails to set EA to 1. There is no case in which we encode two signal octets as there is no case in which we send out a break signal. Therefore, always set the EA bit to 1 for the signal octet to fix this. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-5-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 284260f278b706364fb4c88a7b56ba5298d5973c Author: Daniel Starke Date: Thu Apr 14 02:42:09 2022 -0700 tty: n_gsm: fix mux cleanup after unregister tty device Internally, we manage the alive state of the mux channels and mux itself with the field member 'dead'. This makes it possible to notify the user if the accessed underlying link is already gone. On the other hand, however, removing the virtual ttys before terminating the channels may result in peer messages being received without any internal target. Move the mux cleanup procedure from gsmld_detach_gsm() to gsmld_close() to fix this by keeping the virtual ttys open until the mux has been cleaned up. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-4-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 1ec92e9742774bf42614fceea3bf6b50c9409225 Author: Daniel Starke Date: Thu Apr 14 02:42:08 2022 -0700 tty: n_gsm: fix decoupled mux resource The active mux instances are managed in the gsm_mux array and via mux_get() and mux_put() functions separately. This gives a very loose coupling between the actual instance and the gsm_mux array which manages it. It also results in unnecessary lockings which makes it prone to failures. And it creates a race condition if more than the maximum number of mux instances are requested while the user changes the parameters of an active instance. The user may loose ownership of the current mux instance in this case. Fix this by moving the gsm_mux array handling to the mux allocation and deallocation functions. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-3-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 63 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 25 deletions(-) commit aa371e96f05dcb36a88298f5cb70aa7234d5e8b8 Author: Daniel Starke Date: Thu Apr 14 02:42:07 2022 -0700 tty: n_gsm: fix restart handling via CLD command n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.8.2 states that both sides will revert to the non-multiplexed mode via a close-down message (CLD). The usual program flow is as following: - start multiplex mode by sending AT+CMUX to the mobile - establish the control channel (DLCI 0) - establish user channels (DLCI >0) - terminate user channels - send close-down message (CLD) - revert to AT protocol (i.e. leave multiplexed mode) The AT protocol is out of scope of the n_gsm driver. However, gsm_disconnect() sends CLD if gsm_config() detects that the requested parameters require the mux protocol to restart. The next immediate action is to start the mux protocol by opening DLCI 0 again. Any responder side which handles CLD commands correctly forces us to fail at this point because AT+CMUX needs to be sent to the mobile to start the mux again. Therefore, remove the CLD command in this phase and keep both sides in multiplexed mode. Remove the gsm_disconnect() function as it become unnecessary and merge the remaining parts into gsm_cleanup_mux() to handle the termination order and locking correctly. Fixes: 71e077915396 ("tty: n_gsm: do not send/receive in ldisc close path") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-2-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 68 ++++++++++++++++------------------------------------- 1 file changed, 20 insertions(+), 48 deletions(-) commit 11451693e4081d32ef65147c6ca08cd0094ae252 Author: Daniel Starke Date: Thu Apr 14 02:42:06 2022 -0700 tty: n_gsm: fix missing mux reset on config change at responder Currently, only the initiator resets the mux protocol if the user requests new parameters that are incompatible to those of the current connection. The responder also needs to reset the multiplexer if the new parameter set requires this. Otherwise, we end up with an inconsistent parameter set between initiator and responder. Revert the old behavior to inform the peer upon an incompatible parameter set change from the user on the responder side by re-establishing the mux protocol in such case. Fixes: 509067bbd264 ("tty: n_gsm: Delete gsm_disconnect when config requester") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220414094225.4527-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 66dd346b84d79fde20832ed691a54f4881eac20d Author: Christoph Hellwig Date: Tue Apr 12 07:07:56 2022 +0200 nvme-pci: disable namespace identifiers for Qemu controllers Qemu unconditionally reports a UUID, which depending on the qemu version is either all-null (which is incorrect but harmless) or contains a single bit set for all controllers. In addition it can also optionally report a eui64 which needs to be manually set. Disable namespace identifiers for Qemu controlles entirely even if in some cases they could be set correctly through manual intervention. Reported-by: Luis Chamberlain Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg drivers/nvme/host/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit a98a945b80f8684121d477ae68ebc01da953da1f Author: Christoph Hellwig Date: Mon Apr 11 08:05:27 2022 +0200 nvme-pci: disable namespace identifiers for the MAXIO MAP1002/1202 The MAXIO MAP1002/1202 controllers reports completely bogus Namespace identifiers that even change after suspend cycles. Disable using the Identifiers entirely. Reported-by: 金韬 Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Tested-by: 金韬 drivers/nvme/host/pci.c | 4 ++++ 1 file changed, 4 insertions(+) commit 00ff400e6deee00f7b15e200205b2708b63b8cf6 Author: Christoph Hellwig Date: Mon Apr 11 08:05:27 2022 +0200 nvme: add a quirk to disable namespace identifiers Add a quirk to disable using and exporting namespace identifiers for controllers where they are broken beyond repair. The most directly visible problem with non-unique namespace identifiers is that they break the /dev/disk/by-id/ links, with the link for a supposedly unique identifier now pointing to one of multiple possible namespaces that share the same ID, and a somewhat random selection of which one actually shows up. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni drivers/nvme/host/core.c | 24 ++++++++++++++++++------ drivers/nvme/host/nvme.h | 5 +++++ 2 files changed, 23 insertions(+), 6 deletions(-) commit b42b6f4485e3f0970e11f73df6202eeaf9f53a3e Author: Chaitanya Kulkarni Date: Sun Apr 10 20:12:49 2022 -0700 nvme: don't print verbose errors for internal passthrough requests Use the RQF_QUIET flag to skip the newly added verbose error reporting, and set the flag in __nvme_submit_sync_cmd, which is used for most internal passthrough requests where we do expect errors (e.g. due to probing for optional functionality). This is similar to what the SCSI verbose error logging does. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Alan Adamson Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Tested-by: Alan Adamson Tested-by: Yi Zhang Signed-off-by: Christoph Hellwig drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit eb7054212eac8b451d727bf079eae3db8c88f9d3 Author: Theodore Ts'o Date: Thu Apr 14 22:39:00 2022 -0400 ext4: update the cached overhead value in the superblock If we (re-)calculate the file system overhead amount and it's different from the on-disk s_overhead_clusters value, update the on-disk version since this can take potentially quite a while on bigalloc file systems. Signed-off-by: Theodore Ts'o Cc: stable@kernel.org fs/ext4/ext4.h | 1 + fs/ext4/ioctl.c | 16 ++++++++++++++++ fs/ext4/super.c | 2 ++ 3 files changed, 19 insertions(+) commit 701521403cfb228536b3947035c8a6eca40d8e58 Author: Jens Axboe Date: Thu Apr 14 20:23:40 2022 -0600 io_uring: abort file assignment prior to assigning creds We need to either restore creds properly if we fail on the file assignment, or just do the file assignment first instead. Let's do the latter as it's simpler, should make no difference here for file assignment. Link: https://lore.kernel.org/lkml/000000000000a7edb305dca75a50@google.com/ Reported-by: syzbot+60c52ca98513a8760a91@syzkaller.appspotmail.com Fixes: 6bf9c47a3989 ("io_uring: defer file assignment") Signed-off-by: Jens Axboe fs/io_uring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 85d825dbf4899a69407338bae462a59aa9a37326 Author: Theodore Ts'o Date: Thu Apr 14 21:57:49 2022 -0400 ext4: force overhead calculation if the s_overhead_cluster makes no sense If the file system does not use bigalloc, calculating the overhead is cheap, so force the recalculation of the overhead so we don't have to trust the precalculated overhead in the superblock. Signed-off-by: Theodore Ts'o Cc: stable@kernel.org fs/ext4/super.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit 02655a70b7cc0f534531ee65fa72692f4d31a944 Author: Namjae Jeon Date: Wed Apr 13 10:01:36 2022 +0900 ksmbd: set fixed sector size to FS_SECTOR_SIZE_INFORMATION Currently ksmbd is using ->f_bsize from vfs_statfs() as sector size. If fat/exfat is a local share, ->f_bsize is a cluster size that is too large to be used as a sector size. Sector sizes larger than 4K cause problem occurs when mounting an iso file through windows client. The error message can be obtained using Mount-DiskImage command, the error is: "Mount-DiskImage : The sector size of the physical disk on which the virtual disk resides is not supported." This patch reports fixed 4KB sector size if ->s_blocksize is bigger than 4KB. Signed-off-by: Namjae Jeon Signed-off-by: Steve French fs/ksmbd/smb2pdu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 8510a043d334ecdf83d4604782f288db6bf21d60 Author: Namjae Jeon Date: Tue Apr 5 12:04:43 2022 +0900 ksmbd: increment reference count of parent fp Add missing increment reference count of parent fp in ksmbd_lookup_fd_inode(). Signed-off-by: Namjae Jeon Reviewed-by: Hyunchul Lee Signed-off-by: Steve French fs/ksmbd/smb2pdu.c | 2 ++ fs/ksmbd/vfs_cache.c | 1 + 2 files changed, 3 insertions(+) commit 50f500b7f6335404b18bbffa93e3a905a08d061a Author: Namjae Jeon Date: Thu Feb 24 11:03:41 2022 +0900 ksmbd: remove filename in ksmbd_file If the filename is change by underlying rename the server, fp->filename and real filename can be different. This patch remove the uses of fp->filename in ksmbd and replace it with d_path(). Signed-off-by: Namjae Jeon Reviewed-by: Hyunchul Lee Signed-off-by: Steve French fs/ksmbd/misc.c | 40 +++++++++++++++++++++++++++++++--------- fs/ksmbd/misc.h | 3 ++- fs/ksmbd/oplock.c | 30 ------------------------------ fs/ksmbd/oplock.h | 2 -- fs/ksmbd/smb2pdu.c | 21 +++++++-------------- fs/ksmbd/vfs.c | 6 ++---- fs/ksmbd/vfs_cache.c | 1 - fs/ksmbd/vfs_cache.h | 1 - 8 files changed, 42 insertions(+), 62 deletions(-) commit 10b01ee92df52c8d7200afead4d5e5f55a5c58b1 Author: Theodore Ts'o Date: Thu Apr 14 21:31:27 2022 -0400 ext4: fix overhead calculation to account for the reserved gdt blocks The kernel calculation was underestimating the overhead by not taking into account the reserved gdt blocks. With this change, the overhead calculated by the kernel matches the overhead calculation in mke2fs. Signed-off-by: Theodore Ts'o Cc: stable@kernel.org fs/ext4/super.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 7dd06a2548b2bf516ef2e79873a9cdd00b354b99 Author: Mike Snitzer Date: Thu Apr 14 11:52:54 2022 -0400 dm: allow dm_accept_partial_bio() for dm_io without duplicate bios The intent behind commit e6fc9f62ce6e ("dm: flag clones created by __send_duplicate_bios") was to formally disallow the use of dm_accept_partial_bio() where it simply isn't possible -- due to constraint that multiple bios cannot meaningfully update a shared tio->len_ptr. But that commit went too far and disallowed the case where "abormal" IO (e.g. WRITE_ZEROES) is only using a single bio. Fix this by not marking a dm_io with a single dm_target_io (and bio), that happens to be created by __send_duplicate_bios, as DM_TIO_IS_DUPLICATE_BIO. Also remove 'unsigned *len' parameter from alloc_multiple_bios(). This commit fixes a dm_accept_partial_bio() BUG_ON() with dm-zoned when a WRITE_ZEROES bio is issued. Fixes: 655f3aad7aa4 ("dm: switch dm_target_io booleans over to proper flags") Reported-by: Shinichiro Kawasaki Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer drivers/md/dm.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) commit 028192fea1de083f4f12bfb1eb7c4d7beb5c8ecd Merge: 38a5e3fb17e5 8e401ff5380a Author: Linus Torvalds Date: Thu Apr 14 16:22:16 2022 -0700 Merge tag 'drm-fixes-2022-04-15' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Eggs season holidays are among us, and I think I'd expect some smaller pulls for two weeks then. This seems eerily quiet. One i915 fix, amdgpu has a bunch and msm. I didn't see a misc pull this week, so I expect that will catch up next week. i915: - Correct legacy mmap disabling to use GRAPHICS_VER_FULL msm: - system suspend fix - kzalloc return checks - misc display fix - iommu_present removal amdgpu: - Fix for alpha properly in pre-multiplied mode - Fix VCN 3.1.2 firmware name - Suspend/resume fix - Add a gfxoff quirk for Mac vega20 board - DCN 3.1.6 spread spectrum fix" * tag 'drm-fixes-2022-04-15' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: remove dtbclk_ss compensation for dcn316 drm/amdgpu: Enable gfxoff quirk on MacBook Pro drm/amdgpu: Ensure HDA function is suspended before ASIC reset drm/amdgpu: fix VCN 3.1.2 firmware name drm/amd/display: don't ignore alpha property on pre-multiplied mode drm/msm/gpu: Avoid -Wunused-function with !CONFIG_PM_SLEEP drm/msm/dp: add fail safe mode outside of event_mutex context drm/msm/dsi: Use connector directly in msm_dsi_manager_connector_init() drm/msm: Stop using iommu_present() drm/msm/mdp5: check the return of kzalloc() drm/msm: Fix range size vs end confusion drm/i915: Sunset igpu legacy mmap support based on GRAPHICS_VER_FULL drm/msm/dpu: Use indexed array initializer to prevent mismatches drm/msm/disp: check the return value of kzalloc() dt-bindings: display/msm: another fix for the dpu-qcm2290 example drm/msm: Add missing put_task_struct() in debugfs path drm/msm/gpu: Remove mutex from wait_event condition drm/msm/gpu: Park scheduler threads for system suspend drm/msm/gpu: Rename runtime suspend/resume functions commit 38a5e3fb17e542dd86078eeb43029bf8f146a884 Merge: 62345e482899 1ef3342a934e Author: Linus Torvalds Date: Thu Apr 14 16:06:56 2022 -0700 Merge tag 'vfio-v5.18-rc3' of https://github.com/awilliam/linux-vfio Pull vfio fix from Alex Williamson: - Fix VF token checking for vfio-pci variant drivers (Jason Gunthorpe) * tag 'vfio-v5.18-rc3' of https://github.com/awilliam/linux-vfio: vfio/pci: Fix vf_token mechanism when device-specific VF drivers are used commit 62345e482899185a247b126f32a96e4665018f45 Merge: b3d4650d82c7 8b6c58458ee3 Author: Linus Torvalds Date: Thu Apr 14 16:00:36 2022 -0700 Merge tag '5.18-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: - two fixes related to unmount - symlink overflow fix - minor netfs fix - improved tracing for crediting (flow control) * tag '5.18-rc2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: verify that tcon is valid before dereference in cifs_kill_sb cifs: potential buffer overflow in handling symlinks cifs: Split the smb3_add_credits tracepoint cifs: release cached dentries only if mount is complete cifs: Check the IOCB_DIRECT flag, not O_DIRECT commit b3d4650d82c71b9c9a8184de9e8bb656012b289e Author: NeilBrown Date: Thu Apr 14 13:57:35 2022 +1000 VFS: filename_create(): fix incorrect intent. When asked to create a path ending '/', but which is not to be a directory (LOOKUP_DIRECTORY not set), filename_create() will never try to create the file. If it doesn't exist, -ENOENT is reported. However, it still passes LOOKUP_CREATE|LOOKUP_EXCL to the filesystems ->lookup() function, even though there is no intent to create. This is misleading and can cause incorrect behaviour. If you try ln -s foo /path/dir/ where 'dir' is a directory on an NFS filesystem which is not currently known in the dcache, this will fail with ENOENT. But as the name is not in the dcache, nfs_lookup gets called with LOOKUP_CREATE|LOOKUP_EXCL and so it returns NULL without performing any lookup, with the expectation that a subsequent call to create the target will be made, and the lookup can be combined with the creation. In the case with a trailing '/' and no LOOKUP_DIRECTORY, that call is never made. Instead filename_create() sees that the dentry is not (yet) positive and returns -ENOENT - even though the directory actually exists. So only set LOOKUP_CREATE|LOOKUP_EXCL if there really is an intent to create, and use the absence of these flags to decide if -ENOENT should be returned. Note that filename_parentat() is only interested in LOOKUP_REVAL, so we split that out and store it in 'reval_flag'. __lookup_hash() then gets reval_flag combined with whatever create flags were determined to be needed. Reviewed-by: David Disseldorp Reviewed-by: Jeff Layton Signed-off-by: NeilBrown Cc: Al Viro Signed-off-by: Linus Torvalds fs/namei.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) commit 8e401ff5380a921c309d4c73cacf27b0bdb5f168 Merge: 98a71d12d98d aadaeca46ce5 Author: Dave Airlie Date: Fri Apr 15 07:14:19 2022 +1000 Merge tag 'amd-drm-fixes-5.18-2022-04-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.18-2022-04-13: amdgpu: - Fix for alpha properly in pre-multiplied mode - Fix VCN 3.1.2 firmware name - Suspend/resume fix - Add a gfxoff quirk for Mac vega20 board - DCN 3.1.6 spread spectrum fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220414025821.5811-1-alexander.deucher@amd.com commit 652980b1541c5a02e6410647c7daf840c06d724a Author: Rob Herring Date: Wed Apr 13 09:00:15 2022 -0500 dt-bindings: display: panel-timing: Define a single type for properties It's not good practice to define multiple types for the same property, so factor out the type reference making the properties always an uint32-array with a length of 1 or 3 items. Signed-off-by: Rob Herring Reviewed-by: Sam Ravnborg Link: https://lore.kernel.org/r/20220413140016.3131013-1-robh@kernel.org .../bindings/display/panel/panel-timing.yaml | 42 ++++++++++------------ 1 file changed, 18 insertions(+), 24 deletions(-) commit 67e473a303e76d31bcd221ba76859bd898d152cb Merge: c834eff53c18 0c640d9544d0 Author: Arnd Bergmann Date: Thu Apr 14 23:03:06 2022 +0200 Merge tag 'at91-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes #1 for 5.18: Only DT fixes. They cover syntax issues as well as features: - fix dtschema check warnings for DMA channel entries, boolean properties and flash names - sam9g20ek audio clock and regulator description - sama5d[34]_xplained SPI pinctrl - align DT with hardware subtleties on sama7g5ek * tag 'at91-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: fix pinctrl phandles ARM: dts: at91: sama5d4_xplained: fix pinctrl phandle name ARM: dts: at91: Describe regulators on at91sam9g20ek ARM: dts: at91: Map MCLK for wm8731 on at91sam9g20ek ARM: dts: at91: Fix boolean properties with values ARM: dts: at91: use generic node name for dataflash ARM: dts: at91: align SPI NOR node name with dtschema ARM: dts: at91: sama7g5ek: Align the impedance of the QSPI0's HSIO and PCB lines ARM: dts: at91: sama7g5ek: enable pull-up on flexcom3 console lines ARM: dts: at91: sama7g5: Swap `rx` and `tx` for `i2c` nodes Link: https://lore.kernel.org/r/20220414143318.26363-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit c834eff53c18bddb2dec08169a651d9a72fc6ed2 Merge: 1808b184a311 b5e22886839a Author: Arnd Bergmann Date: Thu Apr 14 23:02:34 2022 +0200 Merge tag 'optee-fix-for-v5.18' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes OP-TEE fix missing mutex_destroy in probe error handling path * tag 'optee-fix-for-v5.18' of git://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: add missing mutext_destroy in optee_ffa_probe Link: https://lore.kernel.org/r/20220413052001.GA49798@jade Signed-off-by: Arnd Bergmann commit 1808b184a3119454f6c5b975aa08234087cde6f5 Merge: 803fa58dfa47 962dd65e575d Author: Arnd Bergmann Date: Thu Apr 14 23:01:22 2022 +0200 Merge branch 'v5.18/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/fixes * 'v5.18/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: arm64: dts: meson-sm1-bananapi-m5: fix wrong GPIO pin labeling for CON1 arm64: dts: remove cpu compatible "arm,armv8" for s4 arm64: dts: meson: remove CPU opps below 1GHz for SM1 boards arm64: dts: meson: remove CPU opps below 1GHz for G12B boards Link: https://lore.kernel.org/r/1132bd6e-cd29-6e58-1fae-38e074545b25@baylibre.com Signed-off-by: Arnd Bergmann commit 803fa58dfa47dd5401a7c3ce3bbb6575e812fa22 Merge: 24a4351e1c04 f571e9c9aafe Author: Arnd Bergmann Date: Thu Apr 14 22:59:53 2022 +0200 Merge tag 'imx-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.18: - Increase DOMAIN_MAX_CLKS in imx8m-blk-ctrl driver to fix an ISI hang on i.MX8MN. - Fix spi-tx-bus-width on imx8mq-tqma8mq board. - Fix an SGTL5000 detection issue by moving MCLK pinctrl into SGTL5000 codec node. - Fix spi2 pin configuration on imx8mm-venice board. - Fix SCU clock controller's compatible property for i.MX8QM. - Fix SAI device compatible for i.MX8MN. - A couple of fixes from Rob to address issues in boolean properties and touchscreen property sizes. - Fix OTG controller over-current configuration for imx8mm-venice-gw boards. - Fix NULL but dereferenced coccicheck error in imx-weim driver. * tag 'imx-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: imx: Fix imx8*-var-som touchscreen property sizes ARM: dts: imx: Fix boolean properties with values ARM: dts: imx8mm-venice-gw{71xx,72xx,73xx}: fix OTG controller OC mode arm64: dts: imx8mn: Fix SAI nodes arm64: dts: imx8mq-tqma8mq: change the spi-nor tx ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue soc: imx: imx8m-blk-ctrl: Fix IMX8MN_DISPBLK_PD_ISI hang arm64: dts: imx8qm: Correct SCU clock controller's compatible property arm64: dts: imx8mm-venice: fix spi2 pin configuration bus: imx-weim: fix NULL but dereferenced coccicheck error Link: https://lore.kernel.org/r/20220411024301.GH129381@dragon Signed-off-by: Arnd Bergmann commit 24a4351e1c04de8e580bf06cae7f3a79094fe7f0 Author: Linus Walleij Date: Sun Apr 10 22:28:37 2022 +0200 ARM: config: Update Gemini defconfig The Gemini defconfig needs to be updated due to DSA driver Kconfig changes in the v5.18 merge window: CONFIG_NET_DSA_REALTEK_SMI is now behind CONFIG_NET_DSA_REALTEK and the desired DSA switch need to be selected explicitly with CONFIG_NET_DSA_REALTEK_RTL8366RB. Take this opportunity to update some other minor config options: - CONFIG_MARVELL_PHY moved around because of Kconfig changes. - CONFIG_SENSORS_DRIVETEMP should be selected since is regulates the system critical alert temperature on some devices, which is nice if it is handled even if initramfs or root fails to mount. Fixes: 319a70a5fea9 ("net: dsa: realtek-smi: move to subdirectory") Fixes: 765c39a4fafe ("net: dsa: realtek: convert subdrivers into modules") Signed-off-by: Linus Walleij Cc: Hans Ulli Kroll Cc: Luiz Angelo Daros de Luca Signed-off-by: Arnd Bergmann arch/arm/configs/gemini_defconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 4f3d7e5a0b6d95e9763d7285435e2b7809feedff Author: Rob Herring Date: Thu Apr 7 17:52:54 2022 -0500 arm64: dts: qcom/sdm845-shift-axolotl: Fix boolean properties with values Boolean properties in DT are present or not present and don't take a value. A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't matter. It may have been intended that 0 values are false, but there is no change in behavior with this patch. Signed-off-by: Rob Herring Cc: Andy Gross Cc: Bjorn Andersson Cc: Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org Link: https://lore.kernel.org/r/20220407225254.2178644-1-robh@kernel.org' Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 56147a156e7e2f50bef695efe6cc4fe8e91c40dc Author: Krzysztof Kozlowski Date: Thu Apr 7 16:30:27 2022 +0200 ARM: dts: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220407143027.294678-1-krzysztof.kozlowski@linaro.org' Signed-off-by: Arnd Bergmann arch/arm/boot/dts/da850-evm.dts | 2 +- arch/arm/boot/dts/dm8168-evm.dts | 2 +- arch/arm/boot/dts/spear1310-evb.dts | 2 +- arch/arm/boot/dts/spear1340-evb.dts | 2 +- arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi | 2 +- arch/arm/boot/dts/stm32mp157c-ev1.dts | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) commit 558bd89edc06051c978dc8b0a9771941b406a9fd Author: Rob Herring Date: Thu Apr 7 17:51:07 2022 -0500 ARM: dts: Fix more boolean properties with values Boolean properties in DT are present or not present and don't take a value. A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't matter. It may have been intended that 0 values are false, but there is no change in behavior with this patch. Signed-off-by: Rob Herring Reviewed-by: Claudiu Beznea Reviewed-by: Bjorn Andersson Cc: Krzysztof Kozlowski Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Claudiu Beznea Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: "Benoît Cousson" Cc: Tony Lindgren Cc: Andy Gross Cc: Bjorn Andersson Cc: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org Link: https://lore.kernel.org/r/20220407225107.2175958-1-robh@kernel.org' Signed-off-by: Arnd Bergmann arch/arm/boot/dts/at91-sam9_l9260.dts | 2 +- arch/arm/boot/dts/imx28-ts4600.dts | 2 +- arch/arm/boot/dts/logicpd-torpedo-baseboard.dtsi | 4 ++-- arch/arm/boot/dts/qcom-ipq8064.dtsi | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) commit cfd08b94bed0a90d64fd3f7fb70d836d56fe1462 Merge: 475acef9ed48 62f642451499 Author: Arnd Bergmann Date: Thu Apr 14 22:48:30 2022 +0200 Merge tag 'ux500-defconfig-soc-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/fixes Defconfig updates for kernel v5.18: - Refresh defconfig with new and moved options - Add some new hardware drivers - Activate battery charging * tag 'ux500-defconfig-soc-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: config: u8500: Re-enable AB8500 battery charging ARM: config: u8500: Add some common hardware ARM: config: Refresh U8500 defconfig Link: https://lore.kernel.org/r/CACRpkdY+_Go4XNzOh+Rvc24QBnUud2k-S7VQuaH5d-j71_dJog@mail.gmail.com Signed-off-by: Arnd Bergmann commit 115acbb56978941bb7537a97dfc303da286106c1 Merge: d20339fa93e9 c68c63429319 Author: Linus Torvalds Date: Thu Apr 14 12:17:25 2022 -0700 Merge tag 's390-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Heiko Carstens: - Convert current_stack_pointer to a register alias like it is assumed if ARCH_HAS_CURRENT_STACK_POINTER is selected. The existing implementation as a function breaks CONFIG_HARDENED_USERCOPY sanity-checks - Get rid of -Warray-bounds warning within kexec code - Add minimal IBM z16 support by reporting a proper elf platform, and adding compile options - Update defconfigs * tag 's390-5.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: enable CONFIG_HARDENED_USERCOPY in debug_defconfig s390: current_stack_pointer shouldn't be a function s390: update defconfigs s390/kexec: silence -Warray-bounds warning s390: allow to compile with z16 optimizations s390: add z16 elf platform commit d20339fa93e9810fcf87518bdd62e44f62bb64ee Merge: b9b4c79e5830 2df3fc4a84e9 Author: Linus Torvalds Date: Thu Apr 14 11:58:19 2022 -0700 Merge tag 'net-5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from wireless and netfilter. Current release - regressions: - smc: fix af_ops of child socket pointing to released memory - wifi: ath9k: fix usage of driver-private space in tx_info Previous releases - regressions: - ipv6: fix panic when forwarding a pkt with no in6 dev - sctp: use the correct skb for security_sctp_assoc_request - smc: fix NULL pointer dereference in smc_pnet_find_ib() - sched: fix initialization order when updating chain 0 head - phy: don't defer probe forever if PHY IRQ provider is missing - dsa: revert "net: dsa: setup master before ports" - dsa: felix: fix tagging protocol changes with multiple CPU ports - eth: ice: - fix use-after-free when freeing @rx_cpu_rmap - revert "iavf: fix deadlock occurrence during resetting VF interface" - eth: lan966x: stop processing the MAC entry is port is wrong Previous releases - always broken: - sched: - flower: fix parsing of ethertype following VLAN header - taprio: check if socket flags are valid - nfc: add flush_workqueue to prevent uaf - veth: ensure eth header is in skb's linear part - eth: stmmac: fix altr_tse_pcs function when using a fixed-link - eth: macb: restart tx only if queue pointer is lagging - eth: macvlan: fix leaking skb in source mode with nodst option" * tag 'net-5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (52 commits) net: bcmgenet: Revert "Use stronger register read/writes to assure ordering" rtnetlink: Fix handling of disabled L3 stats in RTM_GETSTATS replies net: dsa: felix: fix tagging protocol changes with multiple CPU ports tun: annotate access to queue->trans_start nfc: nci: add flush_workqueue to prevent uaf net: dsa: realtek: don't parse compatible string for RTL8366S net: dsa: realtek: fix Kconfig to assure consistent driver linkage net: ftgmac100: access hardware register after clock ready Revert "net: dsa: setup master before ports" macvlan: Fix leaking skb in source mode with nodst option netfilter: nf_tables: nft_parse_register can return a negative value net: lan966x: Stop processing the MAC entry is port is wrong. net: lan966x: Fix when a port's upper is changed. net: lan966x: Fix IGMP snooping when frames have vlan tag net: lan966x: Update lan966x_ptp_get_nominal_value sctp: Initialize daddr on peeled off socket net/smc: Fix af_ops of child socket pointing to released memory net/smc: Fix NULL pointer dereference in smc_pnet_find_ib() net/smc: use memcpy instead of snprintf to avoid out of bounds read net: macb: Restart tx only if queue pointer is lagging ... commit b9b4c79e58305ac64352286ee5030d193fc8aa22 Merge: 722985e2f6ec 24d0c9f0e7de Author: Linus Torvalds Date: Thu Apr 14 11:08:12 2022 -0700 Merge tag 'sound-5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "This became an unexpectedly large pull request due to various regression fixes in the previous kernels. The majority of fixes are a series of patches to address the regression at probe errors in devres'ed drivers, while there are yet more fixes for the x86 SG allocations and for USB-audio buffer management. In addition, a few HD-audio quirks and other small fixes are found" * tag 'sound-5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (52 commits) ALSA: usb-audio: Limit max buffer and period sizes per time ALSA: memalloc: Add fallback SG-buffer allocations for x86 ALSA: nm256: Don't call card private_free at probe error path ALSA: mtpav: Don't call card private_free at probe error path ALSA: rme9652: Fix the missing snd_card_free() call at probe error ALSA: hdspm: Fix the missing snd_card_free() call at probe error ALSA: hdsp: Fix the missing snd_card_free() call at probe error ALSA: oxygen: Fix the missing snd_card_free() call at probe error ALSA: lx6464es: Fix the missing snd_card_free() call at probe error ALSA: cmipci: Fix the missing snd_card_free() call at probe error ALSA: aw2: Fix the missing snd_card_free() call at probe error ALSA: als300: Fix the missing snd_card_free() call at probe error ALSA: lola: Fix the missing snd_card_free() call at probe error ALSA: bt87x: Fix the missing snd_card_free() call at probe error ALSA: sis7019: Fix the missing error handling ALSA: intel_hdmi: Fix the missing snd_card_free() call at probe error ALSA: via82xx: Fix the missing snd_card_free() call at probe error ALSA: sonicvibes: Fix the missing snd_card_free() call at probe error ALSA: rme96: Fix the missing snd_card_free() call at probe error ALSA: rme32: Fix the missing snd_card_free() call at probe error ... commit 5a674d9dc9a097308e8f5848b8439e8a3eeac846 Author: Rob Herring Date: Wed Apr 13 09:01:21 2022 -0500 dt-bindings: Fix array constraints on scalar properties Scalar properties shouldn't have array constraints (minItems, maxItems, items). These constraints can simply be dropped with any constraints under 'items' moved up a level. Cc: Agathe Porte Cc: Guenter Roeck Cc: Jean Delvare Cc: Krzysztof Kozlowski Cc: Olivier Moysan Cc: Arnaud Pouliquen Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Philipp Zabel Cc: Mauro Carvalho Chehab Cc: Bjorn Andersson Cc: Mathieu Poirier Cc: Mark Brown Cc: Fabrice Gasnier Cc: Yunfei Dong Cc: Geert Uytterhoeven Cc: linux-hwmon@vger.kernel.org Cc: alsa-devel@alsa-project.org Cc: linux-iio@vger.kernel.org Cc: linux-media@vger.kernel.org Cc: linux-remoteproc@vger.kernel.org Cc: linux-spi@vger.kernel.org Signed-off-by: Rob Herring Acked-by: Jonathan Cameron Reviewed-by: Philipp Zabel Acked-by: Mark Brown Reviewed-by: Geert Uytterhoeven Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20220413140121.3132837-1-robh@kernel.org Documentation/devicetree/bindings/hwmon/ti,tmp464.yaml | 5 ++--- Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.yaml | 4 +--- Documentation/devicetree/bindings/media/coda.yaml | 1 - Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml | 2 -- Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml | 2 -- .../devicetree/bindings/media/mediatek,vcodec-subdev-decoder.yaml | 1 - .../devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml | 4 +--- Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml | 2 -- 8 files changed, 4 insertions(+), 17 deletions(-) commit 722985e2f6ec9127064771ba526578ea8275834d Merge: ec9c57a7328b acee08aaf6d1 Author: Linus Torvalds Date: Thu Apr 14 10:58:27 2022 -0700 Merge tag 'for-5.18-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A few more code and warning fixes. There's one feature ioctl removal patch slated for 5.18 that did not make it to the main pull request. It's just a one-liner and the ioctl has a v2 that's in use for a long time, no point to postpone it to 5.19. Late update: - remove balance v1 ioctl, superseded by v2 in 2012 Fixes: - add back cgroup attribution for compressed writes - add super block write start/end annotations to asynchronous balance - fix root reference count on an error handling path - in zoned mode, activate zone at the chunk allocation time to avoid ENOSPC due to timing issues - fix delayed allocation accounting for direct IO Warning fixes: - simplify assertion condition in zoned check - remove an unused variable" * tag 'for-5.18-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: fix btrfs_submit_compressed_write cgroup attribution btrfs: fix root ref counts in error handling in btrfs_get_root_ref btrfs: zoned: activate block group only for extent allocation btrfs: return allocated block group from do_chunk_alloc() btrfs: mark resumed async balance as writing btrfs: remove support of balance v1 ioctl btrfs: release correct delalloc amount in direct IO write path btrfs: remove unused variable in btrfs_{start,write}_dirty_block_groups() btrfs: zoned: remove redundant condition in btrfs_run_delalloc_range commit ec9c57a7328b178918aa3124f989060bc5624a3f Merge: a19944809fe9 61132ceeda72 Author: Linus Torvalds Date: Thu Apr 14 10:51:20 2022 -0700 Merge tag 'fscache-fixes-20220413' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull fscache fixes from David Howells: "Here's a collection of fscache and cachefiles fixes and misc small cleanups. The two main fixes are: - Add a missing unmark of the inode in-use mark in an error path. - Fix a KASAN slab-out-of-bounds error when setting the xattr on a cachefiles volume due to the wrong length being given to memcpy(). In addition, there's the removal of an unused parameter, removal of an unused Kconfig option, conditionalising a bit of procfs-related stuff and some doc fixes" * tag 'fscache-fixes-20220413' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: fscache: remove FSCACHE_OLD_API Kconfig option fscache: Use wrapper fscache_set_cache_state() directly when relinquishing fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS fscache: Remove the cookie parameter from fscache_clear_page_bits() docs: filesystems: caching/backend-api.rst: fix an object withdrawn API docs: filesystems: caching/backend-api.rst: correct two relinquish APIs use cachefiles: Fix KASAN slab-out-of-bounds in cachefiles_set_volume_xattr cachefiles: unmark inode in use in error path commit 3e3876d322aef82416ecc496a4d4a587e0fdf7a3 Author: Ming Lei Date: Wed Apr 13 16:48:36 2022 +0800 block: null_blk: end timed out poll request When poll request is timed out, it is removed from the poll list, but not completed, so the request is leaked, and never get chance to complete. Fix the issue by ending it in timeout handler. Fixes: 0a593fbbc245 ("null_blk: poll queue support") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220413084836.1571995-1-ming.lei@redhat.com Signed-off-by: Jens Axboe drivers/block/null_blk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8535c0185d14ea41f0efd6a357961b05daf6687e Author: Ming Lei Date: Thu Apr 14 16:44:43 2022 +0800 block: fix offset/size check in bio_trim() Unit of bio->bi_iter.bi_size is bytes, but unit of offset/size is sector. Fix the above issue in checking offset/size in bio_trim(). Fixes: e83502ca5f1e ("block: fix argument type of bio_trim()") Cc: Chaitanya Kulkarni Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220414084443.1736850-1-ming.lei@redhat.com Signed-off-by: Jens Axboe block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ec547af8a9ea6441864bad34172676b5652ceb96 Author: Oliver Neukum Date: Thu Apr 14 14:31:52 2022 +0200 USB: quirks: add STRING quirk for VCOM device This has been reported to stall if queried Cc: stable Signed-off-by: Oliver Neukum Link: https://lore.kernel.org/r/20220414123152.1700-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+) commit 2a7ccf6bb6f147f64c025ad68f4255d8e1e0ce6d Author: Oliver Neukum Date: Thu Apr 14 13:02:09 2022 +0200 USB: quirks: add a Realtek card reader This device is reported to stall when enummerated. Cc: stable Signed-off-by: Oliver Neukum Link: https://lore.kernel.org/r/20220414110209.30924-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+) commit 7c8881b77908a51814a050da408c89f1a25b7fb7 Author: Jianglei Nie Date: Sat Apr 2 10:17:15 2022 +0800 ice: Fix memory leak in ice_get_orom_civd_data() A memory chunk was allocated for orom_data in ice_get_orom_civd_data() by vzmalloc(). But when ice_read_flash_module() fails, the allocated memory is not freed, which will lead to a memory leak. We can fix it by freeing the orom_data when ce_read_flash_module() fails. Fixes: af18d8866c80 ("ice: reduce time to read Option ROM CIVD data") Signed-off-by: Jianglei Nie Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_nvm.c | 1 + 1 file changed, 1 insertion(+) commit d201665147ae788b7cca9fab58a1826f64152034 Author: Wojciech Drewek Date: Fri Apr 8 09:56:10 2022 +0200 ice: fix crash in switchdev mode Below steps end up with crash: - modprobe ice - devlink dev eswitch set $PF1_PCI mode switchdev - echo 64 > /sys/class/net/$PF1/device/sriov_numvfs - rmmod ice Calling ice_eswitch_port_start_xmit while the process of removing VFs is in progress ends up with NULL pointer dereference. That's because PR netdev is not released but some resources are already freed. Fix it by checking if ICE_VF_DIS bit is set. Call trace: [ 1379.595146] BUG: kernel NULL pointer dereference, address: 0000000000000040 [ 1379.595284] #PF: supervisor read access in kernel mode [ 1379.595410] #PF: error_code(0x0000) - not-present page [ 1379.595535] PGD 0 P4D 0 [ 1379.595657] Oops: 0000 [#1] PREEMPT SMP PTI [ 1379.595783] CPU: 4 PID: 974 Comm: NetworkManager Kdump: loaded Tainted: G OE 5.17.0-rc8_mrq_dev-queue+ #12 [ 1379.595926] Hardware name: Intel Corporation S1200SP/S1200SP, BIOS S1200SP.86B.03.01.0042.013020190050 01/30/2019 [ 1379.596063] RIP: 0010:ice_eswitch_port_start_xmit+0x46/0xd0 [ice] [ 1379.596292] Code: c7 c8 09 00 00 e8 9a c9 fc ff 84 c0 0f 85 82 00 00 00 4c 89 e7 e8 ca 70 fe ff 48 8b 7d 58 48 89 c3 48 85 ff 75 5e 48 8b 53 20 <8b> 42 40 85 c0 74 78 8d 48 01 f0 0f b1 4a 40 75 f2 0f b6 95 84 00 [ 1379.596456] RSP: 0018:ffffaba0c0d7bad0 EFLAGS: 00010246 [ 1379.596584] RAX: ffff969c14c71680 RBX: ffff969c14c71680 RCX: 000100107a0f0000 [ 1379.596715] RDX: 0000000000000000 RSI: ffff969b9d631000 RDI: 0000000000000000 [ 1379.596846] RBP: ffff969c07b46500 R08: ffff969becfca8ac R09: 0000000000000001 [ 1379.596977] R10: 0000000000000004 R11: ffffaba0c0d7bbec R12: ffff969b9d631000 [ 1379.597106] R13: ffffffffc08357a0 R14: ffff969c07b46500 R15: ffff969b9d631000 [ 1379.597237] FS: 00007f72c0e25c80(0000) GS:ffff969f13500000(0000) knlGS:0000000000000000 [ 1379.597414] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1379.597562] CR2: 0000000000000040 CR3: 000000012b316006 CR4: 00000000003706e0 [ 1379.597713] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1379.597863] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1379.598015] Call Trace: [ 1379.598153] [ 1379.598294] dev_hard_start_xmit+0xd9/0x220 [ 1379.598444] sch_direct_xmit+0x8a/0x340 [ 1379.598592] __dev_queue_xmit+0xa3c/0xd30 [ 1379.598739] ? packet_parse_headers+0xb4/0xf0 [ 1379.598890] packet_sendmsg+0xa15/0x1620 [ 1379.599038] ? __check_object_size+0x46/0x140 [ 1379.599186] sock_sendmsg+0x5e/0x60 [ 1379.599330] ____sys_sendmsg+0x22c/0x270 [ 1379.599474] ? import_iovec+0x17/0x20 [ 1379.599622] ? sendmsg_copy_msghdr+0x59/0x90 [ 1379.599771] ___sys_sendmsg+0x81/0xc0 [ 1379.599917] ? __pollwait+0xd0/0xd0 [ 1379.600061] ? preempt_count_add+0x68/0xa0 [ 1379.600210] ? _raw_write_lock_irq+0x1a/0x40 [ 1379.600369] ? ep_done_scan+0xc9/0x110 [ 1379.600494] ? _raw_spin_unlock_irqrestore+0x25/0x40 [ 1379.600622] ? preempt_count_add+0x68/0xa0 [ 1379.600747] ? _raw_spin_lock_irq+0x1a/0x40 [ 1379.600899] ? __fget_light+0x8f/0x110 [ 1379.601024] __sys_sendmsg+0x49/0x80 [ 1379.601148] ? release_ds_buffers+0x50/0xe0 [ 1379.601274] do_syscall_64+0x3b/0x90 [ 1379.601399] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 1379.601525] RIP: 0033:0x7f72c1e2e35d Fixes: f5396b8a663f ("ice: switchdev slow path") Signed-off-by: Wojciech Drewek Reported-by: Marcin Szycik Reviewed-by: Michal Swiatkowski Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_eswitch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit aacca7a83b9753c562395ef328352dfd8c003c59 Author: Maciej Fijalkowski Date: Fri Apr 1 14:54:38 2022 +0200 ice: allow creating VFs for !CONFIG_NET_SWITCHDEV Currently for !CONFIG_NET_SWITCHDEV kernel builds it is not possible to create VFs properly as call to ice_eswitch_configure() returns -EOPNOTSUPP for us. This is because CONFIG_ICE_SWITCHDEV depends on CONFIG_NET_SWITCHDEV. Change the ice_eswitch_configure() implementation for !CONFIG_ICE_SWITCHDEV to return 0 instead -EOPNOTSUPP and let ice_ena_vfs() finish its work properly. CC: Grzegorz Nitka Fixes: 1a1c40df2e80 ("ice: set and release switchdev environment") Signed-off-by: Maciej Fijalkowski Signed-off-by: Michal Swiatkowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_eswitch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d1fc4c6feac18f893e55aeefa267a281e132c7b7 Author: Maciej Fijalkowski Date: Thu Mar 17 18:57:27 2022 +0100 ice: xsk: check if Rx ring was filled up to the end __ice_alloc_rx_bufs_zc() checks if a number of the descriptors to be allocated would cause the ring wrap. In that case, driver will issue two calls to xsk_buff_alloc_batch() - one that will fill the ring up to the end and the second one that will start with filling descriptors from the beginning of the ring. ice_fill_rx_descs() is a wrapper for taking care of what xsk_buff_alloc_batch() gave back to the driver. It works in a best effort approach, so for example when driver asks for 64 buffers, ice_fill_rx_descs() could assign only 32. Such case needs to be checked when ring is being filled up to the end, because in that situation ntu might not reached the end of the ring. Fix the ring wrap by checking if nb_buffs_extra has the expected value. If not, bump ntu and go directly to tail update. Fixes: 3876ff525de7 ("ice: xsk: Handle SW XDP ring wrap and bump tail more often") Signed-off-by: Magnus Karlsson Signed-off-by: Maciej Fijalkowski Tested-by: Shwetha Nagaraju Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_xsk.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit e2932d1f6f055b2af2114c7e64a26dc1b5593d0c Author: Shubhrajyoti Datta Date: Thu Apr 14 15:58:13 2022 +0530 EDAC/synopsys: Read the error count from the correct register Currently, the error count is read wrongly from the status register. Read the count from the proper error count register (ERRCNT). [ bp: Massage. ] Fixes: b500b4a029d5 ("EDAC, synopsys: Add ECC support for ZynqMP DDR controller") Signed-off-by: Shubhrajyoti Datta Signed-off-by: Borislav Petkov Acked-by: Michal Simek Cc: Link: https://lore.kernel.org/r/20220414102813.4468-1-shubhrajyoti.datta@xilinx.com drivers/edac/synopsys_edac.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) commit f58faed7fb3f784efdbf3b401368dcf51a6e28fa Author: Athira Rajeev Date: Tue Apr 12 22:10:59 2022 +0530 perf bench: Fix numa bench to fix usage of affinity for machines with #CPUs > 1K The 'perf bench numa' testcase fails on systems with more than 1K CPUs. Testcase: perf bench numa mem -p 1 -t 3 -P 512 -s 100 -zZ0qcm --thp 1 Snippet of code: <<>> perf: bench/numa.c:302: bind_to_node: Assertion `!(ret)' failed. Aborted (core dumped) <<>> bind_to_node() uses "sched_getaffinity" to save the original cpumask and this call is returning EINVAL ((invalid argument). This happens because the default mask size in glibc is 1024. To overcome this 1024 CPUs mask size limitation of cpu_set_t, change the mask size using the CPU_*_S macros ie, use CPU_ALLOC to allocate cpumask, CPU_ALLOC_SIZE for size. Apart from fixing this for "orig_mask", apply same logic to "mask" as well which is used to setaffinity so that mask size is large enough to represent number of possible CPU's in the system. sched_getaffinity is used in one more place in perf numa bench. It is in "bind_to_cpu" function. Apply the same logic there also. Though currently no failure is reported from there, it is ideal to change getaffinity to work with such system configurations having CPU's more than default mask size supported by glibc. Also fix "sched_setaffinity" to use mask size which is large enough to represent number of possible CPU's in the system. Fixed all places where "bind_cpumask" which is part of "struct thread_data" is used such that bind_cpumask works in all configuration. Reported-by: Disha Goel Signed-off-by: Athira Jajeev Cc: Ian Rogers Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nageswara R Sastry Cc: Srikar Dronamraju Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20220412164059.42654-3-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/bench/numa.c | 128 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 95 insertions(+), 33 deletions(-) commit 8cb7a188ac33b71ec24a9081d1521f46dcab53c4 Author: Athira Rajeev Date: Tue Apr 12 22:10:58 2022 +0530 perf bench: Fix numa testcase to check if CPU used to bind task is online Perf numa bench test fails with error: Testcase: ./perf bench numa mem -p 2 -t 1 -P 1024 -C 0,8 -M 1,0 -s 20 -zZq --thp 1 --no-data_rand_walk Failure snippet: <<>> Running 'numa/mem' benchmark: # Running main, "perf bench numa numa-mem -p 2 -t 1 -P 1024 -C 0,8 -M 1,0 -s 20 -zZq --thp 1 --no-data_rand_walk" perf: bench/numa.c:333: bind_to_cpumask: Assertion `!(ret)' failed. <<>> The Testcases uses CPU's 0 and 8. In function "parse_setup_cpu_list", There is check to see if cpu number is greater than max cpu's possible in the system ie via "if (bind_cpu_0 >= g->p.nr_cpus || bind_cpu_1 >= g->p.nr_cpus) {". But it could happen that system has say 48 CPU's, but only number of online CPU's is 0-7. Other CPU's are offlined. Since "g->p.nr_cpus" is 48, so function will go ahead and set bit for CPU 8 also in cpumask ( td->bind_cpumask). bind_to_cpumask function is called to set affinity using sched_setaffinity and the cpumask. Since the CPU8 is not present, set affinity will fail here with EINVAL. Fix this issue by adding a check to make sure that, CPU's provided in the input argument values are online before proceeding further and skip the test. For this, include new helper function "is_cpu_online" in "tools/perf/util/header.c". Since "BIT(x)" definition will get included from header.h, remove that from bench/numa.c Reported-by: Disha Goel Signed-off-by: Athira Jajeev Tested-by: Disha Goel Cc: Ian Rogers Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nageswara R Sastry Cc: Srikar Dronamraju Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20220412164059.42654-2-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/bench/numa.c | 8 ++++++-- tools/perf/util/header.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/header.h | 1 + 3 files changed, 58 insertions(+), 2 deletions(-) commit 23380e4d53305765789fd1a2cf6bddb07239cd3b Author: Alexey Bayduraev Date: Wed Apr 13 18:46:40 2022 -0700 perf record: Fix per-thread option Per-thread mode doesn't have specific CPUs for events, add checks for this case. Minor fix to a pr_debug by Ian Rogers to avoid an out of bound array access. Fixes: 7954f71689f90cb2 ("perf record: Introduce thread affinity and mmap masks") Reported-by: Ian Rogers Signed-off-by: Alexey Bayduraev Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220414014642.3308206-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-record.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) commit 0ff74a23e08f909ce859039e860f53727dfed0dd Author: Ken Kurematsu Date: Thu Apr 14 02:37:18 2022 +0000 arm64: fix typos in comments Fix a typo "cortex" Signed-off-by: Ken Kurematsu Link: https://lore.kernel.org/r/OSBPR01MB3288B15006E15C64D4D617F7DBEF9@OSBPR01MB3288.jpnprd01.prod.outlook.com Signed-off-by: Will Deacon arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 45bd8951806eb5e857772c593de021b09057950d Author: Nathan Chancellor Date: Wed Apr 13 11:14:21 2022 -0700 arm64: Improve HAVE_DYNAMIC_FTRACE_WITH_REGS selection for clang Will and Anders reported that using just 'CC=clang' with CONFIG_FTRACE=y and CONFIG_STACK_TRACER=y would result in an error while linking: aarch64-linux-gnu-ld: .init.data has both ordered [`__patchable_function_entries' in init/main.o] and unordered [`.meminit.data' in mm/sparse.o] sections aarch64-linux-gnu-ld: final link failed: bad value This error was exposed by commit f12b034afeb3 ("scripts/Makefile.clang: default to LLVM_IAS=1") in combination with binutils older than 2.36. When '-fpatchable-function-entry' was implemented in LLVM, two code paths were added for adding the section attributes, one for the integrated assembler and another for GNU as, due to binutils deficiencies at the time. If the integrated assembler was used, attributes that GNU ld < 2.36 could not handle were added, presumably with the assumption that use of the integrated assembler meant the whole LLVM stack was being used, namely ld.lld. Prior to the kernel change previously mentioned, that assumption was valid, as there were three commonly used combinations of tools for compiling, assembling, and linking respectively: $ make CC=clang (clang, GNU as, GNU ld) $ make LLVM=1 (clang, GNU as, ld.lld) $ make LLVM=1 LLVM_IAS=1 (clang, integrated assembler, ld.lld) After the default switch of the integrated assembler, the second and third commands become equivalent and the first command means "clang, integrated assembler, and GNU ld", which was not a combination that was considered when the aforementioned LLVM change was implemented. It is not possible to go back and fix LLVM, as this change was implemented in the 10.x series, which is no longer supported. To workaround this on the kernel side, split out the selection of HAVE_DYNAMIC_FTRACE_WITH_REGS to two separate configurations, one for GCC and one for clang. The GCC config inherits the '-fpatchable-function-entry' check. The Clang config does not it, as '-fpatchable-function-entry' is always available for LLVM 11.0.0 and newer, which is the supported range of versions for the kernel. The Clang config makes sure that the user is using GNU as or the integrated assembler with ld.lld or GNU ld 2.36 or newer, which will avoid the error above. Link: https://github.com/ClangBuiltLinux/linux/issues/1507 Link: https://github.com/ClangBuiltLinux/linux/issues/788 Link: https://lore.kernel.org/YlCA5PoIjF6nhwYj@dev-arch.thelio-3990X/ Link: https://sourceware.org/bugzilla/show_bug.cgi?id=26256 Link: https://github.com/llvm/llvm-project/commit/7fa5290d5bd5632d7a36a4ea9f46e81e04fb819e Link: https://github.com/llvm/llvm-project/commit/853a2649160c1c80b9bbd38a20b53ca8fab704e8 Reported-by: Anders Roxell Reported-by: Will Deacon Tested-by: Will Deacon Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220413181420.3522187-1-nathan@kernel.org Signed-off-by: Will Deacon arch/arm64/Kconfig | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit 46ff3df87215ff42c0cd2c4bdb7d74540384a69c Author: Adam Ford Date: Thu Mar 3 11:18:17 2022 -0600 ARM: dts: logicpd-som-lv: Fix wrong pinmuxing on OMAP35 The pinout of the OMAP35 and DM37 variants of the SOM-LV are the same, but the macros which define the pinmuxing are different between OMAP3530 and DM3730. The pinmuxing was correct for for the DM3730, but wrong for the OMAP3530. Since the boot loader was correctly pin-muxing the pins, this was not obvious. As the bootloader not guaranteed to pinmux all the pins any more, this causes an issue, so the pinmux needs to be moved from a common file to their respective board files. Fixes: f8a2e3ff7103 ("ARM: dts: Add minimal support for LogicPD OMAP35xx SOM-LV devkit") Signed-off-by: Adam Ford Message-Id: <20220303171818.11060-1-aford173@gmail.com> Signed-off-by: Tony Lindgren arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts | 15 +++++++++++++++ arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts | 15 +++++++++++++++ arch/arm/boot/dts/logicpd-som-lv.dtsi | 15 --------------- 3 files changed, 30 insertions(+), 15 deletions(-) commit 942da3af32b2288e674736eb159d1fc676261691 Author: Adam Ford Date: Sat Feb 26 15:48:19 2022 -0600 ARM: dts: am3517-evm: Fix misc pinmuxing The bootloader for the AM3517 has previously done much of the pin muxing, but as the bootloader is moving more and more to a model based on the device tree, it may no longer automatically mux the pins, so it is necessary to add the pinmuxing to the Linux device trees so the respective peripherals can remain functional. Fixes: 6ed1d7997561 ("ARM: dts: am3517-evm: Add support for UI board and Audio") Signed-off-by: Adam Ford Message-Id: <20220226214820.747847-1-aford173@gmail.com> Signed-off-by: Tony Lindgren arch/arm/boot/dts/am3517-evm.dts | 45 ++++++++++++++++++++++++++++++++++----- arch/arm/boot/dts/am3517-som.dtsi | 9 ++++++++ 2 files changed, 49 insertions(+), 5 deletions(-) commit c21a7434d6cc216a910dd35632617850f1751f4c Author: Miquel Raynal Date: Mon Mar 14 17:34:45 2022 +0100 ARM: dts: am33xx-l4: Add missing touchscreen clock properties When adding support for TI magadc (Magnetic Stripe Reader and ADC), the MFD driver common to the touchscreen and the ADC got updated to ease the insertion of a new DT node for the ADC, with its own compatible, clocks, etc. Commit 235a96e92c16 ("mfd: ti_am335x_tscadc: Don't search the tree for our clock") removed one compatible specific information which was the clock name, because the clock was looked up from scratch in the DT while this hardware block was only fed by a single clock, already defined and properly filled in the DT. Problem is, this change was only validated with an am437x-based board, where the clocks are effectively correctly defined and referenced. But on am33xx, the ADC clock is also correctly defined but is not referenced with a clock phandle as it ought to be. The touchscreen bindings clearly state that the clocks/clock-names properties are mandatory, but they have been forgotten in one DTSI. This was probably not noticed in the first place because of the clock actually existing and the clk_get() call going through all the tree anyway. Add the missing clock phandles in the am33xx touchscreen description. Reported-by: H. Nikolaus Schaller Fixes: 235a96e92c16 ("mfd: ti_am335x_tscadc: Don't search the tree for our clock") Signed-off-by: Miquel Raynal Tested-by: H. Nikolaus Schaller Message-Id: <20220314163445.79807-1-miquel.raynal@bootlin.com> Signed-off-by: Tony Lindgren arch/arm/boot/dts/am33xx-l4.dtsi | 2 ++ 1 file changed, 2 insertions(+) commit 09269dd050094593fc747f2a5853d189fefcb6b5 Author: H. Nikolaus Schaller Date: Tue Mar 8 14:00:20 2022 +0100 ARM: dts: Fix mmc order for omap3-gta04 Commit a1ebdb374199 ("ARM: dts: Fix swapped mmc order for omap3") introduces general mmc aliases. Let's tailor them to the need of the GTA04 board which does not make use of mmc2 and mmc3 interfaces. Fixes: a1ebdb374199 ("ARM: dts: Fix swapped mmc order for omap3") Signed-off-by: H. Nikolaus Schaller Message-Id: Signed-off-by: Tony Lindgren arch/arm/boot/dts/omap3-gta04.dtsi | 2 ++ 1 file changed, 2 insertions(+) commit 3836c73e6a2585561af928c6641d74528a8bdfa4 Author: Bartosz Golaszewski Date: Wed Apr 13 16:01:32 2022 +0200 gpio: sim: fix setting and getting multiple lines We need to take mask into account in the set/get_multiple() callbacks. Use bitmap_replace() instead of bitmap_copy(). Fixes: cb8c474e79be ("gpio: sim: new testing module") Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko drivers/gpio/gpio-sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 2df3fc4a84e917a422935cc5bae18f43f9955d31 Author: Jeremy Linton Date: Tue Apr 12 16:04:20 2022 -0500 net: bcmgenet: Revert "Use stronger register read/writes to assure ordering" It turns out after digging deeper into this bug, that it was being triggered by GCC12 failing to call the bcmgenet_enable_dma() routine. Given that a gcc12 fix has been merged [1] and the genet driver now works properly when built with gcc12, this commit should be reverted. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105160 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=aabb9a261ef060cf24fd626713f1d7d9df81aa57 Fixes: 8d3ea3d402db ("net: bcmgenet: Use stronger register read/writes to assure ordering") Signed-off-by: Jeremy Linton Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220412210420.1129430-1-jeremy.linton@arm.com Signed-off-by: Paolo Abeni drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 23cfe941b52e2fa645bdfd770087128a74c7dbee Author: Petr Machata Date: Tue Apr 12 22:25:06 2022 +0200 rtnetlink: Fix handling of disabled L3 stats in RTM_GETSTATS replies When L3 stats are disabled, rtnl_offload_xstats_get_size_stats() returns size of 0, which is supposed to be an indication that the corresponding attribute should not be emitted. However, instead, the current code reserves a 0-byte attribute. The reason this does not show up as a citation on a kasan kernel is that netdev_offload_xstats_get(), which is supposed to fill in the data, never ends up getting called, because rtnl_offload_xstats_get_stats() notices that the stats are not actually used and skips the call. Thus a zero-length IFLA_OFFLOAD_XSTATS_L3_STATS attribute ends up in a response, confusing the userspace. Fix by skipping the L3-stats related block in rtnl_offload_xstats_fill(). Fixes: 0e7788fd7622 ("net: rtnetlink: Add UAPI for obtaining L3 offload xstats") Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/591b58e7623edc3eb66dd1fcfa8c8f133d090974.1649794741.git.petrm@nvidia.com Signed-off-by: Paolo Abeni net/core/rtnetlink.c | 3 +++ 1 file changed, 3 insertions(+) commit 00fa91bc9cc2a9d340f963af5e457610ad4b2f9c Author: Vladimir Oltean Date: Tue Apr 12 20:22:09 2022 +0300 net: dsa: felix: fix tagging protocol changes with multiple CPU ports When the device tree has 2 CPU ports defined, a single one is active (has any dp->cpu_dp pointers point to it). Yet the second one is still a CPU port, and DSA still calls ->change_tag_protocol on it. On the NXP LS1028A, the CPU ports are ports 4 and 5. Port 4 is the active CPU port and port 5 is inactive. After the following commands: # Initial setting cat /sys/class/net/eno2/dsa/tagging ocelot echo ocelot-8021q > /sys/class/net/eno2/dsa/tagging echo ocelot > /sys/class/net/eno2/dsa/tagging traffic is now broken, because the driver has moved the NPI port from port 4 to port 5, unbeknown to DSA. The problem can be avoided by detecting that the second CPU port is unused, and not doing anything for it. Further rework will be needed when proper support for multiple CPU ports is added. Treat this as a bug and prepare current kernels to work in single-CPU mode with multiple-CPU DT blobs. Fixes: adb3dccf090b ("net: dsa: felix: convert to the new .change_tag_protocol DSA API") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220412172209.2531865-1-vladimir.oltean@nxp.com Signed-off-by: Paolo Abeni drivers/net/dsa/ocelot/felix.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) commit 2fb251c265608636fc961b7d38e1a03937e57371 Author: Stephen Boyd Date: Tue Apr 12 15:00:33 2022 -0700 interconnect: qcom: sdx55: Drop IP0 interconnects Similar to the sc7180 commit, let's drop the IP0 interconnects here because the IP0 resource is also used in the clk-rpmh driver on sdx55. It's bad to have the clk framework and interconnect framework control the same RPMh resource without any coordination. The rpmh driver in the kernel doesn't aggregate resources between clients either, so leaving control to clk-rpmh avoids any issues with unused interconnects turning off IP0 behind the back of the clk framework. Cc: Alex Elder Cc: Manivannan Sadhasivam Cc: Bjorn Andersson Cc: Taniya Das Cc: Mike Tipton Fixes: b2150cab9a97 ("clk: qcom: rpmh: add support for SDX55 rpmh IPA clock") Signed-off-by: Stephen Boyd Reviewed-by: Alex Elder Acked-by: Manivannan Sadhasivam Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220412220033.1273607-3-swboyd@chromium.org Signed-off-by: Georgi Djakov drivers/interconnect/qcom/sdx55.c | 21 --------------------- 1 file changed, 21 deletions(-) commit 2f3724930eb4bba74f7d10bc3bef5bb22dd323df Author: Stephen Boyd Date: Tue Apr 12 15:00:32 2022 -0700 interconnect: qcom: sc7180: Drop IP0 interconnects The IPA BCM resource ("IP0") on sc7180 was moved to the clk-rpmh driver in commit bcd63d222b60 ("clk: qcom: rpmh: Add IPA clock for SC7180") and modeled as a clk, but this interconnect driver still had it modeled as an interconnect. This was mostly OK because nobody used the interconnect definition, until the interconnect framework started dropping bandwidth requests on interconnects that aren't used via the sync_state callback in commit 7d3b0b0d8184 ("interconnect: qcom: Use icc_sync_state"). Once that patch was applied the IP0 resource was going to be controlled from two places, the clk framework and the interconnect framework. Even then, things were probably going to be OK, because commit b95b668eaaa2 ("interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate") was needed to actually drop bandwidth requests on unused interconnects, of which the IPA was one of the interconnect that wasn't getting dropped to zero. Combining the three commits together leads to bad behavior where the interconnect framework is disabling the IP0 resource because it has no users while the clk framework thinks the IP0 resource is on because the only user, the IPA driver, has turned it on via clk_prepare_enable(). Depending on when sync_state is called, we can get into a situation like below: IPA driver probes IPA driver gets notified modem started runtime PM get() IPA clk enabled -> IP0 resource is ON sync_state runs interconnect zeroes out the IP0 resource -> IP0 resource is off IPA driver tries to access a register and blows up The crash is an unclocked access that manifest as an SError. SError Interrupt on CPU0, code 0xbe000011 -- SError CPU: 0 PID: 3595 Comm: mmdata_mgr Not tainted 5.17.1+ #166 Hardware name: Google Lazor (rev1 - 2) with LTE (DT) pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : mutex_lock+0x4c/0x80 lr : mutex_lock+0x30/0x80 sp : ffffffc00da9b9c0 x29: ffffffc00da9b9c0 x28: 0000000000000000 x27: 0000000000000000 x26: ffffffc00da9bc90 x25: ffffff80c2024010 x24: ffffff80c2024000 x23: ffffff8083100000 x22: ffffff80831000d0 x21: ffffff80831000a8 x20: ffffff80831000a8 x19: ffffff8083100070 x18: 00000000ffff0a00 x17: 000000002f7254f1 x16: 0000000000000100 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 x11: 000000000001f0b8 x10: ffffffc00931f0b8 x9 : 0000000000000000 x8 : 0000000000000000 x7 : fefefefefeff2f60 x6 : 0000808080808080 x5 : 0000000000000000 x4 : 8080808080800000 x3 : ffffff80d2d4ee28 x2 : ffffff808c1d6e40 x1 : 0000000000000000 x0 : ffffff8083100070 Kernel panic - not syncing: Asynchronous SError Interrupt CPU: 0 PID: 3595 Comm: mmdata_mgr Not tainted 5.17.1+ #166 Hardware name: Google Lazor (rev1 - 2) with LTE (DT) Call trace: dump_backtrace+0xf4/0x114 show_stack+0x24/0x30 dump_stack_lvl+0x64/0x7c dump_stack+0x18/0x38 panic+0x150/0x38c nmi_panic+0x88/0xa0 arm64_serror_panic+0x74/0x80 do_serror+0x0/0x80 do_serror+0x58/0x80 el1h_64_error_handler+0x34/0x4c el1h_64_error+0x78/0x7c mutex_lock+0x4c/0x80 __gsi_channel_start+0x50/0x17c gsi_channel_start+0x54/0x90 ipa_endpoint_enable_one+0x34/0xc0 ipa_open+0x4c/0x120 Remove all IP0 resource management from the interconnect driver so that clk-rpmh is the sole owner. This fixes the issue by preventing the interconnect driver from overwriting the IP0 resource data that the clk-rpmh driver wrote. Cc: Alex Elder Cc: Bjorn Andersson Cc: Taniya Das Cc: Mike Tipton Fixes: b95b668eaaa2 ("interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate") Fixes: bcd63d222b60 ("clk: qcom: rpmh: Add IPA clock for SC7180") Fixes: 7d3b0b0d8184 ("interconnect: qcom: Use icc_sync_state") Signed-off-by: Stephen Boyd Tested-by: Alex Elder Reviewed-by: Alex Elder Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220412220033.1273607-2-swboyd@chromium.org Signed-off-by: Georgi Djakov drivers/interconnect/qcom/sc7180.c | 21 --------------------- 1 file changed, 21 deletions(-) commit 968a1a5d6541cd24e37dadc1926eab9c10aeb09b Author: Antoine Tenart Date: Tue Apr 12 15:58:52 2022 +0200 tun: annotate access to queue->trans_start Commit 5337824f4dc4 ("net: annotate accesses to queue->trans_start") introduced a new helper, txq_trans_cond_update, to update queue->trans_start using WRITE_ONCE. One snippet in drivers/net/tun.c was missed, as it was introduced roughly at the same time. Fixes: 5337824f4dc4 ("net: annotate accesses to queue->trans_start") Cc: Eric Dumazet Signed-off-by: Antoine Tenart Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220412135852.466386-1-atenart@kernel.org Signed-off-by: Paolo Abeni drivers/net/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ce88613e5bd579478653a028291098143f2a5bdf Author: Miaoqian Lin Date: Tue Mar 1 02:58:49 2022 +0000 phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe The pm_runtime_enable() will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Add missing pm_runtime_disable() for serdes_am654_probe(). Fixes: 71e2f5c5c224 ("phy: ti: Add a new SERDES driver for TI's AM654x SoC") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220301025853.1911-1-linmq006@gmail.com Signed-off-by: Vinod Koul drivers/phy/ti/phy-am654-serdes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d644e0d79829b1b9a14beedbdb0dc1256fc3677d Author: Miaoqian Lin Date: Tue Mar 1 02:46:11 2022 +0000 phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). And use pm_runtime_dont_use_autosuspend() to undo pm_runtime_use_autosuspend() In the PM Runtime docs: Drivers in ->remove() callback should undo the runtime PM changes done in ->probe(). Usually this means calling pm_runtime_disable(), pm_runtime_dont_use_autosuspend() etc. We should do this in error handling. Fixes: f7f50b2a7b05 ("phy: mapphone-mdm6600: Add runtime PM support for n_gsm on USB suspend") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220301024615.31899-1-linmq006@gmail.com Signed-off-by: Vinod Koul drivers/phy/motorola/phy-mapphone-mdm6600.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 8b6c58458ee3206dde345fce327a4cb83e69caf9 Author: Ronnie Sahlberg Date: Wed Apr 13 10:02:17 2022 +1000 cifs: verify that tcon is valid before dereference in cifs_kill_sb On umount, cifs_sb->tlink_tree might contain entries that do not represent a valid tcon. Check the tcon for error before we dereference it. Signed-off-by: Ronnie Sahlberg Cc: stable@vger.kernel.org Reviewed-by: Shyam Prasad N Reported-by: Xiaoli Feng Signed-off-by: Steve French fs/cifs/cifsfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 98a71d12d98dddfb55acfe28e988ee18ff2312d6 Merge: 16e0400772c6 390d645877ff Author: Dave Airlie Date: Thu Apr 14 15:06:21 2022 +1000 Merge tag 'drm-msm-fixes-2022-04-13' of https://gitlab.freedesktop.org/drm/msm into drm-fixes Some msm fixes for v5.18. kzalloc return checks, display fix, misc locking and scheduler bug, iommu present removal. Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvuTwx09MKwK68KWXqi4o7LxDGMUz1=Z7xOS+i=OV84Ug@mail.gmail.com commit 16e0400772c6ce07e749419794b2c78b6426f668 Merge: ce522ba9ef7e 1acb34e7dd77 Author: Dave Airlie Date: Thu Apr 14 14:38:53 2022 +1000 Merge tag 'drm-intel-fixes-2022-04-13' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Correct legacy mmap disabling to use GRAPHICS_VER_FULL Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YlZma8iA20iakK62@jlahtine-mobl.ger.corp.intel.com commit 9e02977bfad006af328add9434c8bffa40e053bb Author: Chao Gao Date: Wed Apr 13 08:32:22 2022 +0200 dma-direct: avoid redundant memory sync for swiotlb When we looked into FIO performance with swiotlb enabled in VM, we found swiotlb_bounce() is always called one more time than expected for each DMA read request. It turns out that the bounce buffer is copied to original DMA buffer twice after the completion of a DMA request (one is done by in dma_direct_sync_single_for_cpu(), the other by swiotlb_tbl_unmap_single()). But the content in bounce buffer actually doesn't change between the two rounds of copy. So, one round of copy is redundant. Pass DMA_ATTR_SKIP_CPU_SYNC flag to swiotlb_tbl_unmap_single() to skip the memory copy in it. This fix increases FIO 64KB sequential read throughput in a guest with swiotlb=force by 5.6%. Fixes: 55897af63091 ("dma-direct: merge swiotlb_dma_ops into the dma_direct code") Reported-by: Wang Zhaoyang1 Reported-by: Gao Liang Signed-off-by: Chao Gao Reviewed-by: Kevin Tian Signed-off-by: Christoph Hellwig kernel/dma/direct.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit aadaeca46ce54af9f8f494792a1ba47a6fbda7ba Author: Charlene Liu Date: Wed Mar 30 15:25:00 2022 -0400 drm/amd/display: remove dtbclk_ss compensation for dcn316 [why] dcn316's dtbclk is from non_ss clock source. no compensation required here. Reviewed-by: Chris Park Acked-by: Pavle Kotarac Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c | 2 +- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) commit 4593c1b6d159f1e5c35c07a7f125e79e5a864302 Author: Tomasz Moń Date: Wed Apr 6 21:49:21 2022 +0200 drm/amdgpu: Enable gfxoff quirk on MacBook Pro Enabling gfxoff quirk results in perfectly usable graphical user interface on MacBook Pro (15-inch, 2019) with Radeon Pro Vega 20 4 GB. Without the quirk, X server is completely unusable as every few seconds there is gpu reset due to ring gfx timeout. Signed-off-by: Tomasz Moń Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 1 file changed, 2 insertions(+) commit 887f75cfd0da44c19dda93b2ff9e70ca8792cdc1 Author: Kai-Heng Feng Date: Thu Apr 7 20:12:28 2022 +0800 drm/amdgpu: Ensure HDA function is suspended before ASIC reset DP/HDMI audio on AMD PRO VII stops working after S3: [ 149.450391] amdgpu 0000:63:00.0: amdgpu: MODE1 reset [ 149.450395] amdgpu 0000:63:00.0: amdgpu: GPU mode1 reset [ 149.450494] amdgpu 0000:63:00.0: amdgpu: GPU psp mode1 reset [ 149.983693] snd_hda_intel 0000:63:00.1: refused to change power state from D0 to D3hot [ 150.003439] amdgpu 0000:63:00.0: refused to change power state from D0 to D3hot ... [ 155.432975] snd_hda_intel 0000:63:00.1: CORB reset timeout#2, CORBRP = 65535 The offending commit is daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)"). Commit 34452ac3038a7 ("drm/amdgpu: don't use BACO for reset in S3 ") doesn't help, so the issue is something different. Assuming that to make HDA resume to D0 fully realized, it needs to be successfully put to D3 first. And this guesswork proves working, by moving amdgpu_asic_reset() to noirq callback, so it's called after HDA function is in D3. Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)") Signed-off-by: Kai-Heng Feng Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit e3cf2e05441a2c5107fbffadb5b7943113ee11dd Author: Alex Deucher Date: Wed Apr 6 14:39:03 2022 -0400 drm/amdgpu: fix VCN 3.1.2 firmware name Drop the trailing vcn. Fixes: afc2f276057ea1 ("drm/amdgpu/vcn: add vcn support for vcn 3.1.2") Reviewed-by: James Zhu Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e4f1541caf60fcbe5a59e9d25805c0b5865e546a Author: Melissa Wen Date: Tue Mar 29 19:18:35 2022 -0100 drm/amd/display: don't ignore alpha property on pre-multiplied mode "Pre-multiplied" is the default pixel blend mode for KMS/DRM, as documented in supported_modes of drm_plane_create_blend_mode_property(): https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/drm_blend.c In this mode, both 'pixel alpha' and 'plane alpha' participate in the calculation, as described by the pixel blend mode formula in KMS/DRM documentation: out.rgb = plane_alpha * fg.rgb + (1 - (plane_alpha * fg.alpha)) * bg.rgb Considering the blend config mechanisms we have in the driver so far, the alpha mode that better fits this blend mode is the _PER_PIXEL_ALPHA_COMBINED_GLOBAL_GAIN, where the value for global_gain is the plane alpha (global_alpha). With this change, alpha property stops to be ignored. It also addresses Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1734 v2: * keep the 8-bit value for global_alpha_value (Nicholas) * correct the logical ordering for combined global gain (Nicholas) * apply to dcn10 too (Nicholas) Signed-off-by: Melissa Wen Tested-by: Rodrigo Siqueira Reviewed-by: Harry Wentland Tested-by: Simon Ser Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 14 +++++++++----- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) commit a668cc07f990d2ed19424d5c1a529521a9d1cee1 Author: Adrian Hunter Date: Wed Apr 13 14:42:32 2022 +0300 perf tools: Fix segfault accessing sample_id xyarray perf_evsel::sample_id is an xyarray which can cause a segfault when accessed beyond its size. e.g. # perf record -e intel_pt// -C 1 sleep 1 Segmentation fault (core dumped) # That is happening because a dummy event is opened to capture text poke events accross all CPUs, however the mmap logic is allocating according to the number of user_requested_cpus. In general, perf sometimes uses the evsel cpus to open events, and sometimes the evlist user_requested_cpus. However, it is not necessary to determine which case is which because the opened event file descriptors are also in an xyarray, the size of whch can be used to correctly allocate the size of the sample_id xyarray, because there is one ID per file descriptor. Note, in the affected code path, perf_evsel fd array is subsequently used to get the file descriptor for the mmap, so it makes sense for the xyarrays to be the same size there. Fixes: d1a177595b3a824c ("libperf: Adopt perf_evlist__mmap()/munmap() from tools/perf") Fixes: 246eba8e9041c477 ("perf tools: Add support for PERF_RECORD_TEXT_POKE") Signed-off-by: Adrian Hunter Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Jiri Olsa Cc: stable@vger.kernel.org # 5.5+ Link: https://lore.kernel.org/r/20220413114232.26914-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo tools/lib/perf/evlist.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit d73f5d14e0cdd1f39764379250f26163913d7155 Author: Lv Ruyi Date: Wed Apr 13 09:33:02 2022 +0000 perf stat: Fix error check return value of hashmap__new(), must use IS_ERR() hashmap__new() returns ERR_PTR(-ENOMEM) when it fails, so we should use IS_ERR() to check it in error handling path. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220413093302.2538128-1-lv.ruyi@zte.com.cn Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/stat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit b7ba6d8dc3569e49800ef0136799f26f43e237e8 Author: Steven Price Date: Mon Apr 11 16:22:32 2022 +0100 cpu/hotplug: Remove the 'cpu' member of cpuhp_cpu_state Currently the setting of the 'cpu' member of struct cpuhp_cpu_state in cpuhp_create() is too late as it is used earlier in _cpu_up(). If kzalloc_node() in __smpboot_create_thread() fails then the rollback will be done with st->cpu==0 causing CPU0 to be erroneously set to be dying, causing the scheduler to get mightily confused and throw its toys out of the pram. However the cpu number is actually available directly, so simply remove the 'cpu' member and avoid the problem in the first place. Fixes: 2ea46c6fc945 ("cpumask/hotplug: Fix cpu_dying() state tracking") Signed-off-by: Steven Price Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220411152233.474129-2-steven.price@arm.com kernel/cpu.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) commit 1ef3342a934e235aca72b4bcc0d6854d80a65077 Author: Jason Gunthorpe Date: Wed Apr 13 10:10:36 2022 -0300 vfio/pci: Fix vf_token mechanism when device-specific VF drivers are used get_pf_vdev() tries to check if a PF is a VFIO PF by looking at the driver: if (pci_dev_driver(physfn) != pci_dev_driver(vdev->pdev)) { However now that we have multiple VF and PF drivers this is no longer reliable. This means that security tests realted to vf_token can be skipped by mixing and matching different VFIO PCI drivers. Instead of trying to use the driver core to find the PF devices maintain a linked list of all PF vfio_pci_core_device's that we have called pci_enable_sriov() on. When registering a VF just search the list to see if the PF is present and record the match permanently in the struct. PCI core locking prevents a PF from passing pci_disable_sriov() while VF drivers are attached so the VFIO owned PF becomes a static property of the VF. In common cases where vfio does not own the PF the global list remains empty and the VF's pointer is statically NULL. This also fixes a lockdep splat from recursive locking of the vfio_group::device_lock between vfio_device_get_from_name() and vfio_device_get_from_dev(). If the VF and PF share the same group this would deadlock. Fixes: ff53edf6d6ab ("vfio/pci: Split the pci_driver code out of vfio_pci_core.c") Signed-off-by: Jason Gunthorpe Link: https://lore.kernel.org/r/0-v3-876570980634+f2e8-vfio_vf_token_jgg@nvidia.com Signed-off-by: Alex Williamson drivers/vfio/pci/vfio_pci_core.c | 124 +++++++++++++++++++++++---------------- include/linux/vfio_pci_core.h | 2 + 2 files changed, 76 insertions(+), 50 deletions(-) commit 73d7b06e902dd294e1f61554f7c403d0f705cf92 Author: Mike Snitzer Date: Wed Apr 13 11:06:19 2022 -0400 dm zone: fix NULL pointer dereference in dm_zone_map_bio Commit 0fbb4d93b38b ("dm: add dm_submit_bio_remap interface") changed the alloc_io() function to delay the initialization of struct dm_io's orig_bio member, leaving it NULL until after the dm_io and associated user submitted bio is processed by __split_and_process_bio(). This change causes a NULL pointer dereference in dm_zone_map_bio() when the original user bio is inspected to detect the need for zone append command emulation. Fix this NULL pointer by updating dm_zone_map_bio() to not access ->orig_bio when the same info can be accessed from the clone of the ->orig_bio _before_ any ->map processing. Save off the bio_op() and bio_sectors() for the clone and then use the saved orig_bio_details as needed. Fixes: 0fbb4d93b38b ("dm: add dm_submit_bio_remap interface") Reported-by: Damien Le Moal Tested-by: Damien Le Moal Signed-off-by: Mike Snitzer drivers/md/dm-zone.c | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) commit ce40426fdc3c92acdba6b5ca74bc7277ffaa6a3d Author: Khazhismel Kumykov Date: Mon Apr 11 15:03:35 2022 -0700 dm mpath: only use ktime_get_ns() in historical selector Mixing sched_clock() and ktime_get_ns() usage will give bad results. Switch hst_select_path() from using sched_clock() to ktime_get_ns(). Also rename path_service_time()'s 'sched_now' variable to 'now'. Fixes: 2613eab11996 ("dm mpath: add Historical Service Time Path Selector") Signed-off-by: Khazhismel Kumykov Signed-off-by: Mike Snitzer drivers/md/dm-ps-historical-service-time.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit 64c4a37ac04eeb43c42d272f6e6c8c12bfcf4304 Author: Harshit Mogalapalli Date: Wed Apr 13 04:42:51 2022 -0700 cifs: potential buffer overflow in handling symlinks Smatch printed a warning: arch/x86/crypto/poly1305_glue.c:198 poly1305_update_arch() error: __memcpy() 'dctx->buf' too small (16 vs u32max) It's caused because Smatch marks 'link_len' as untrusted since it comes from sscanf(). Add a check to ensure that 'link_len' is not larger than the size of the 'link_str' buffer. Fixes: c69c1b6eaea1 ("cifs: implement CIFSParseMFSymlink()") Signed-off-by: Harshit Mogalapalli Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French fs/cifs/link.c | 3 +++ 1 file changed, 3 insertions(+) commit 0c640d9544d0109da3889d71ae77301e556db977 Author: Claudiu Beznea Date: Thu Mar 31 17:13:23 2022 +0300 ARM: dts: at91: fix pinctrl phandles Commit bf781869e5cf ("ARM: dts: at91: add pinctrl-{names, 0} for all gpios") introduces pinctrl phandles for pins used by individual controllers to avoid failures due to commit 2ab73c6d8323 ("gpio: Support GPIO controllers without pin-ranges"). For SPI controllers available on SAMA5D4 and SAMA5D3 some of the pins are defined in SoC specific dtsi on behalf of pinctrl-0. Adding extra pinctrl phandles on board specific dts also on behalf of pinctrl-0 overwrite the pinctrl-0 phandle specified in SoC specific dtsi. Thus add the board specific pinctrl to pinctrl-1. Fixes: bf781869e5cf ("ARM: dts: at91: add pinctrl-{names, 0} for all gpios") Depends-on: 5c8b49852910 ("ARM: dts: at91: sama5d4_xplained: fix pinctrl phandle name") Reported-by: Ajay Kathat Co-developed-by: Ajay Kathat Signed-off-by: Ajay Kathat Tested-by: Ajay Kathat Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220331141323.194355-2-claudiu.beznea@microchip.com arch/arm/boot/dts/at91-sama5d3_xplained.dts | 8 ++++---- arch/arm/boot/dts/at91-sama5d4_xplained.dts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) commit 5c8b49852910caffeebb1ce541fdd264ffc691b8 Author: Claudiu Beznea Date: Thu Mar 31 17:13:22 2022 +0300 ARM: dts: at91: sama5d4_xplained: fix pinctrl phandle name Pinctrl phandle is for spi1 so rename it to reflect this. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220331141323.194355-1-claudiu.beznea@microchip.com arch/arm/boot/dts/at91-sama5d4_xplained.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9e949a3886356fe9112c6f6f34a6e23d1d35407f Author: Nadav Amit Date: Sat Mar 19 00:20:15 2022 -0700 smp: Fix offline cpu check in flush_smp_call_function_queue() The check in flush_smp_call_function_queue() for callbacks that are sent to offline CPUs currently checks whether the queue is empty. However, flush_smp_call_function_queue() has just deleted all the callbacks from the queue and moved all the entries into a local list. This checks would only be positive if some callbacks were added in the short time after llist_del_all() was called. This does not seem to be the intention of this check. Change the check to look at the local list to which the entries were moved instead of the queue from which all the callbacks were just removed. Fixes: 8d056c48e4862 ("CPU hotplug, smp: flush any pending IPI callbacks before CPU offline") Signed-off-by: Nadav Amit Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220319072015.1495036-1-namit@vmware.com kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit afca68de401fceb1d52e1b6daec78e8b09f7f0a2 Author: Mark Brown Date: Mon Apr 4 11:28:06 2022 +0100 ARM: dts: at91: Describe regulators on at91sam9g20ek The at91sam9g20ek has no software controllable regulators, only some fixed discrete regulators, but they are there and currently the wm8731 driver does try to use them. Show the supplies in the DT and map them for the wm8731 so things start up cleanly. Signed-off-by: Mark Brown Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220404102806.581374-3-broonie@kernel.org arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) commit 0e486fe341fabd8e583f3d601a874cd394979c45 Author: Mark Brown Date: Mon Apr 4 11:28:05 2022 +0100 ARM: dts: at91: Map MCLK for wm8731 on at91sam9g20ek The MCLK of the WM8731 on the AT91SAM9G20-EK board is connected to the PCK0 output of the SoC and is expected to be set to 12MHz. Previously this was mapped using pre-common clock API calls in the audio machine driver but the conversion to the common clock framework broke that so describe things in the DT instead. Fixes: ff78a189b0ae55f ("ARM: at91: remove old at91-specific clock driver") Signed-off-by: Mark Brown Reviewed-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220404102806.581374-2-broonie@kernel.org arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 6 ++++++ 1 file changed, 6 insertions(+) commit 3891222d88ad5b9983b132135609e00e05884b25 Author: Rob Herring Date: Wed Apr 6 14:09:47 2022 -0500 ARM: dts: at91: Fix boolean properties with values Boolean properties in DT are present or not present and don't take a value. A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't matter. It may have been intended that 0 values are false, but there is no change in behavior with this patch. Signed-off-by: Rob Herring Reviewed-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/Yk3leykDEKGBN8rk@robh.at.kernel.org arch/arm/boot/dts/at91-kizbox3-hs.dts | 2 +- arch/arm/boot/dts/at91-kizbox3_common.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 4a6471e65050fef99559354bac97b551310f985c Author: Krzysztof Kozlowski Date: Tue Apr 12 12:50:13 2022 +0200 ARM: dts: at91: use generic node name for dataflash The node names should be generic, so use "flash" for dataflash nodes and for cfi-flash. Suggested-by: Tudor Ambarus Signed-off-by: Krzysztof Kozlowski Reviewed-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220412105013.249793-1-krzysztof.kozlowski@linaro.org Documentation/devicetree/bindings/mfd/atmel-flexcom.txt | 2 +- arch/arm/boot/dts/at91rm9200ek.dts | 4 ++-- arch/arm/boot/dts/at91sam9260ek.dts | 2 +- arch/arm/boot/dts/at91sam9261ek.dts | 2 +- arch/arm/boot/dts/at91sam9263ek.dts | 2 +- arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 2 +- arch/arm/boot/dts/at91sam9m10g45ek.dts | 2 +- arch/arm/boot/dts/at91sam9rlek.dts | 2 +- arch/arm/boot/dts/usb_a9263.dts | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) commit e5628110bb6669330c3f0cadcc7f486de0007355 Author: Krzysztof Kozlowski Date: Thu Apr 7 16:32:22 2022 +0200 ARM: dts: at91: align SPI NOR node name with dtschema The node names should be generic and SPI NOR dtschema expects "flash". Signed-off-by: Krzysztof Kozlowski Reviewed-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220407143223.295344-1-krzysztof.kozlowski@linaro.org arch/arm/boot/dts/at91-dvk_su60_somc.dtsi | 2 +- arch/arm/boot/dts/at91-q5xr5.dts | 2 +- arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi | 2 +- arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts | 2 +- arch/arm/boot/dts/at91-sama5d2_xplained.dts | 2 +- arch/arm/boot/dts/at91-sama5d4_ma5d4.dtsi | 2 +- arch/arm/boot/dts/at91-sama5d4ek.dts | 2 +- arch/arm/boot/dts/at91-vinco.dts | 2 +- arch/arm/boot/dts/at91sam9n12ek.dts | 2 +- arch/arm/boot/dts/at91sam9x5ek.dtsi | 2 +- arch/arm/boot/dts/sama5d3xmb.dtsi | 2 +- arch/arm/boot/dts/sama5d3xmb_cmp.dtsi | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) commit 68a9345536daf199147d2ef07ec2ef0df43672ac Author: Tudor Ambarus Date: Wed Apr 6 16:05:05 2022 +0300 ARM: dts: at91: sama7g5ek: Align the impedance of the QSPI0's HSIO and PCB lines The impedance of the QSPI PCB lines on the sama7g5ek is 50 Ohms. Align the output impedance of the QSPI0 HSIOs by setting a medium drive strength which corresponds to an impedance of 56 Ohms when VDD is in the 3.0V - 3.6V range. The high drive strength setting corresponds to an output impedance of 42 Ohms on the QSPI0 HSIOs. Suggested-by: Mihai Sain Signed-off-by: Tudor Ambarus Reviewed-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220406130505.422042-1-tudor.ambarus@microchip.com arch/arm/boot/dts/at91-sama7g5ek.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3f7ce6d7091765ed6c67c5d78aa364b9d17e3aab Author: Eugen Hristev Date: Mon Mar 7 13:38:27 2022 +0200 ARM: dts: at91: sama7g5ek: enable pull-up on flexcom3 console lines Flexcom3 is used as board console serial. There are no pull-ups on these lines on the board. This means that if a cable is not connected (that has pull-ups included), stray characters could appear on the console as the floating pins voltage levels are interpreted as incoming characters. To avoid this problem, enable the internal pull-ups on these lines. Fixes: 7540629e2fc7 ("ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek") Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Eugen Hristev Reviewed-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220307113827.2419331-1-eugen.hristev@microchip.com arch/arm/boot/dts/at91-sama7g5ek.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 08c1af8f1c13bbf210f1760132f4df24d0ed46d6 Author: Mikulas Patocka Date: Sun Apr 3 14:38:22 2022 -0400 dm integrity: fix memory corruption when tag_size is less than digest size It is possible to set up dm-integrity in such a way that the "tag_size" parameter is less than the actual digest size. In this situation, a part of the digest beyond tag_size is ignored. In this case, dm-integrity would write beyond the end of the ic->recalc_tags array and corrupt memory. The corruption happened in integrity_recalc->integrity_sector_checksum->crypto_shash_final. Fix this corruption by increasing the tags array so that it has enough padding at the end to accomodate the loop in integrity_recalc() being able to write a full digest size for the last member of the tags array. Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer drivers/md/dm-integrity.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit df96e96a8c6f61db17a640cbac00494d13ed0779 Author: Sergiu Moga Date: Thu Mar 10 13:45:51 2022 +0200 ARM: dts: at91: sama7g5: Swap `rx` and `tx` for `i2c` nodes Swap `rx` and `tx` for the `dma-names` property of the `i2c` nodes in order to maintain consistency across Microchip/Atmel SoC files. Signed-off-by: Sergiu Moga Reviewed-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220310114553.184763-2-sergiu.moga@microchip.com arch/arm/boot/dts/sama7g5.dtsi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit 7179c3ce3dbff646c55f7cd664a895f462f049e5 Author: Pavel Begunkov Date: Wed Apr 13 16:10:35 2022 +0100 io_uring: fix poll error reporting We should not return an error code in req->result in io_poll_check_events(), because it may get mangled and returned as success. Just return the error code directly, the callers will fail the request or proceed accordingly. Fixes: 6bf9c47a3989 ("io_uring: defer file assignment") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5f03514ee33324dc811fb93df84aee0f695fb044.1649862516.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit cce64ef01308b677a687d90927fc2b2e0e1cba67 Author: Pavel Begunkov Date: Wed Apr 13 16:10:34 2022 +0100 io_uring: fix poll file assign deadlock We pass "unlocked" into io_assign_file() in io_poll_check_events(), which can lead to double locking. Fixes: 6bf9c47a3989 ("io_uring: defer file assignment") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2476d4ae46554324b599ee4055447b105f20a75a.1649862516.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e941976659f1f6834077a1596bf53e6bdb10e90b Author: Pavel Begunkov Date: Wed Apr 13 16:10:33 2022 +0100 io_uring: use right issue_flags for splice/tee Pass right issue_flags into into io_file_get_fixed() instead of IO_URING_F_UNLOCKED. It's probably not a problem at the moment but let's do it safer. Fixes: 6bf9c47a3989 ("io_uring: defer file assignment") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/7d242daa9df5d776907686977cd29fbceb4a2d8d.1649862516.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 04ebaa1cfddae5f240cc7404f009133bb0389a47 Author: Sasha Neftin Date: Tue Apr 5 18:56:01 2022 +0300 e1000e: Fix possible overflow in LTR decoding When we decode the latency and the max_latency, u16 value may not fit the required size and could lead to the wrong LTR representation. Scaling is represented as: scale 0 - 1 (2^(5*0)) = 2^0 scale 1 - 32 (2^(5 *1))= 2^5 scale 2 - 1024 (2^(5 *2)) =2^10 scale 3 - 32768 (2^(5 *3)) =2^15 scale 4 - 1048576 (2^(5 *4)) = 2^20 scale 5 - 33554432 (2^(5 *4)) = 2^25 scale 4 and scale 5 required 20 and 25 bits respectively. scale 6 reserved. Replace the u16 type with the u32 type and allow corrected LTR representation. Cc: stable@vger.kernel.org Fixes: 44a13a5d99c7 ("e1000e: Fix the max snoop/no-snoop latency for 10M") Reported-by: James Hutchinson Link: https://bugzilla.kernel.org/show_bug.cgi?id=215689 Suggested-by: Dima Ruinskiy Signed-off-by: Sasha Neftin Tested-by: Naama Meir Tested-by: James Hutchinson Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/e1000e/ich8lan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 822f52e7efdc88fccffb9fbf6250a4b7666a0b0f Author: Vinicius Costa Gomes Date: Tue Apr 12 18:58:15 2022 -0700 igc: Fix suspending when PTM is active Some mainboard/CPU combinations, in particular, Alder Lake-S with a W680 mainboard, have shown problems (system hangs usually, no kernel logs) with suspend/resume when PCIe PTM is enabled and active. In some cases, it could be reproduced when removing the igc module. The best we can do is to stop PTM dialogs from the downstream/device side before the interface is brought down. PCIe PTM will be re-enabled when the interface is being brought up. Fixes: a90ec8483732 ("igc: Add support for PTP getcrosststamp()") Signed-off-by: Vinicius Costa Gomes Tested-by: Naama Meir Acked-by: Paul Menzel Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/igc/igc_ptp.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) commit 8c235cc25087495c4288d94f547e9d3061004991 Author: Tudor Ambarus Date: Wed Apr 6 16:36:03 2022 +0300 spi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller Use the spi_mem_default_supports_op() core helper in order to take into account the buswidth specified by the user in device tree. Cc: Fixes: 0e6aae08e9ae ("spi: Add QuadSPI driver for Atmel SAMA5D2") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20220406133604.455356-1-tudor.ambarus@microchip.com Signed-off-by: Mark Brown drivers/spi/atmel-quadspi.c | 3 +++ 1 file changed, 3 insertions(+) commit c80a29f0fe9b6f5457e0788e27d1110577eba99b Author: Sasha Neftin Date: Wed Mar 9 08:19:19 2022 +0200 igc: Fix BUG: scheduling while atomic Replace usleep_range() method with udelay() method to allow atomic contexts in low-level MDIO access functions. The following issue can be seen by doing the following: $ modprobe -r bonding $ modprobe -v bonding max_bonds=1 mode=1 miimon=100 use_carrier=0 $ ip link set bond0 up $ ifenslave bond0 eth0 eth1 [ 982.357308] BUG: scheduling while atomic: kworker/u64:0/9/0x00000002 [ 982.364431] INFO: lockdep is turned off. [ 982.368824] Modules linked in: bonding sctp ip6_udp_tunnel udp_tunnel mlx4_ib ib_uverbs ib_core mlx4_en mlx4_core nfp tls sunrpc intel_rapl_msr iTCO_wdt iTCO_vendor_support mxm_wmi dcdbas intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel rapl intel_cstate intel_uncore pcspkr lpc_ich mei_me ipmi_ssif mei ipmi_si ipmi_devintf ipmi_msghandler wmi acpi_power_meter xfs libcrc32c sr_mod cdrom sd_mod t10_pi sg mgag200 drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm ahci libahci crc32c_intel libata i2c_algo_bit tg3 megaraid_sas igc dm_mirror dm_region_hash dm_log dm_mod [last unloaded: bonding] [ 982.437941] CPU: 25 PID: 9 Comm: kworker/u64:0 Kdump: loaded Tainted: G W --------- - - 4.18.0-348.el8.x86_64+debug #1 [ 982.451333] Hardware name: Dell Inc. PowerEdge R730/0H21J3, BIOS 2.7.0 12/005/2017 [ 982.459791] Workqueue: bond0 bond_mii_monitor [bonding] [ 982.465622] Call Trace: [ 982.468355] dump_stack+0x8e/0xd0 [ 982.472056] __schedule_bug.cold.60+0x3a/0x60 [ 982.476919] __schedule+0x147b/0x1bc0 [ 982.481007] ? firmware_map_remove+0x16b/0x16b [ 982.485967] ? hrtimer_fixup_init+0x40/0x40 [ 982.490625] schedule+0xd9/0x250 [ 982.494227] schedule_hrtimeout_range_clock+0x10d/0x2c0 [ 982.500058] ? hrtimer_nanosleep_restart+0x130/0x130 [ 982.505598] ? hrtimer_init_sleeper_on_stack+0x90/0x90 [ 982.511332] ? usleep_range+0x88/0x130 [ 982.515514] ? recalibrate_cpu_khz+0x10/0x10 [ 982.520279] ? ktime_get+0xab/0x1c0 [ 982.524175] ? usleep_range+0x88/0x130 [ 982.528355] usleep_range+0xdd/0x130 [ 982.532344] ? console_conditional_schedule+0x30/0x30 [ 982.537987] ? igc_put_hw_semaphore+0x17/0x60 [igc] [ 982.543432] igc_read_phy_reg_gpy+0x111/0x2b0 [igc] [ 982.548887] igc_phy_has_link+0xfa/0x260 [igc] [ 982.553847] ? igc_get_phy_id+0x210/0x210 [igc] [ 982.558894] ? lock_acquire+0x34d/0x890 [ 982.563187] ? lock_downgrade+0x710/0x710 [ 982.567659] ? rcu_read_unlock+0x50/0x50 [ 982.572039] igc_check_for_copper_link+0x106/0x210 [igc] [ 982.577970] ? igc_config_fc_after_link_up+0x840/0x840 [igc] [ 982.584286] ? rcu_read_unlock+0x50/0x50 [ 982.588661] ? lock_release+0x591/0xb80 [ 982.592939] ? lock_release+0x591/0xb80 [ 982.597220] igc_has_link+0x113/0x330 [igc] [ 982.601887] ? lock_downgrade+0x710/0x710 [ 982.606362] igc_ethtool_get_link+0x6d/0x90 [igc] [ 982.611614] bond_check_dev_link+0x131/0x2c0 [bonding] [ 982.617350] ? bond_time_in_interval+0xd0/0xd0 [bonding] [ 982.623277] ? rcu_read_lock_held+0x62/0xc0 [ 982.627944] ? rcu_read_lock_sched_held+0xe0/0xe0 [ 982.633198] bond_mii_monitor+0x314/0x2500 [bonding] [ 982.638738] ? lock_contended+0x880/0x880 [ 982.643214] ? bond_miimon_link_change+0xa0/0xa0 [bonding] [ 982.649336] ? lock_acquire+0x34d/0x890 [ 982.653615] ? lock_downgrade+0x710/0x710 [ 982.658089] ? debug_object_deactivate+0x221/0x340 [ 982.663436] ? rcu_read_unlock+0x50/0x50 [ 982.667811] ? debug_print_object+0x2b0/0x2b0 [ 982.672672] ? __switch_to_asm+0x41/0x70 [ 982.677049] ? __switch_to_asm+0x35/0x70 [ 982.681426] ? _raw_spin_unlock_irq+0x24/0x40 [ 982.686288] ? trace_hardirqs_on+0x20/0x195 [ 982.690956] ? _raw_spin_unlock_irq+0x24/0x40 [ 982.695818] process_one_work+0x8f0/0x1770 [ 982.700390] ? pwq_dec_nr_in_flight+0x320/0x320 [ 982.705443] ? debug_show_held_locks+0x50/0x50 [ 982.710403] worker_thread+0x87/0xb40 [ 982.714489] ? process_one_work+0x1770/0x1770 [ 982.719349] kthread+0x344/0x410 [ 982.722950] ? kthread_insert_work_sanity_check+0xd0/0xd0 [ 982.728975] ret_from_fork+0x3a/0x50 Fixes: 5586838fe9ce ("igc: Add code for PHY support") Reported-by: Corinna Vinschen Suggested-by: Dima Ruinskiy Signed-off-by: Sasha Neftin Tested-by: Corinna Vinschen Tested-by: Naama Meir Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/igc/igc_phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 907862e9aef75bf89e2b265efcc58870be06081e Author: Sasha Neftin Date: Tue Mar 1 15:32:10 2022 +0200 igc: Fix infinite loop in release_swfw_sync An infinite loop may occur if we fail to acquire the HW semaphore, which is needed for resource release. This will typically happen if the hardware is surprise-removed. At this stage there is nothing to do, except log an error and quit. Fixes: c0071c7aa5fe ("igc: Add HW initialization code") Suggested-by: Dima Ruinskiy Signed-off-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/igc/igc_i225.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 4d0d5c352303a318925ceb84a86818761aa6586b Author: Rob Herring Date: Wed Apr 13 08:47:29 2022 -0500 dt-bindings: hwmon: ti,tmp421: Fix type for 'ti,n-factor' 'ti,n-factor' is read as a 32-bit signed value, so the type and constraints are wrong. The same property is also defined for ti,tmp464 and is correct. The constraints should also not be under 'items' as this property is not an array. Cc: Jean Delvare Cc: Guenter Roeck Cc: Krzysztof Kozlowski Cc: linux-hwmon@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220413134729.3112190-1-robh@kernel.org Signed-off-by: Guenter Roeck Documentation/devicetree/bindings/hwmon/ti,tmp421.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit ef27324e2cb7bb24542d6cb2571740eefe6b00dc Author: Lin Ma Date: Wed Apr 13 00:04:30 2022 +0800 nfc: nci: add flush_workqueue to prevent uaf Our detector found a concurrent use-after-free bug when detaching an NCI device. The main reason for this bug is the unexpected scheduling between the used delayed mechanism (timer and workqueue). The race can be demonstrated below: Thread-1 Thread-2 | nci_dev_up() | nci_open_device() | __nci_request(nci_reset_req) | nci_send_cmd | queue_work(cmd_work) nci_unregister_device() | nci_close_device() | ... del_timer_sync(cmd_timer)[1] | ... | Worker nci_free_device() | nci_cmd_work() kfree(ndev)[3] | mod_timer(cmd_timer)[2] In short, the cleanup routine thought that the cmd_timer has already been detached by [1] but the mod_timer can re-attach the timer [2], even it is already released [3], resulting in UAF. This UAF is easy to trigger, crash trace by POC is like below [ 66.703713] ================================================================== [ 66.703974] BUG: KASAN: use-after-free in enqueue_timer+0x448/0x490 [ 66.703974] Write of size 8 at addr ffff888009fb7058 by task kworker/u4:1/33 [ 66.703974] [ 66.703974] CPU: 1 PID: 33 Comm: kworker/u4:1 Not tainted 5.18.0-rc2 #5 [ 66.703974] Workqueue: nfc2_nci_cmd_wq nci_cmd_work [ 66.703974] Call Trace: [ 66.703974] [ 66.703974] dump_stack_lvl+0x57/0x7d [ 66.703974] print_report.cold+0x5e/0x5db [ 66.703974] ? enqueue_timer+0x448/0x490 [ 66.703974] kasan_report+0xbe/0x1c0 [ 66.703974] ? enqueue_timer+0x448/0x490 [ 66.703974] enqueue_timer+0x448/0x490 [ 66.703974] __mod_timer+0x5e6/0xb80 [ 66.703974] ? mark_held_locks+0x9e/0xe0 [ 66.703974] ? try_to_del_timer_sync+0xf0/0xf0 [ 66.703974] ? lockdep_hardirqs_on_prepare+0x17b/0x410 [ 66.703974] ? queue_work_on+0x61/0x80 [ 66.703974] ? lockdep_hardirqs_on+0xbf/0x130 [ 66.703974] process_one_work+0x8bb/0x1510 [ 66.703974] ? lockdep_hardirqs_on_prepare+0x410/0x410 [ 66.703974] ? pwq_dec_nr_in_flight+0x230/0x230 [ 66.703974] ? rwlock_bug.part.0+0x90/0x90 [ 66.703974] ? _raw_spin_lock_irq+0x41/0x50 [ 66.703974] worker_thread+0x575/0x1190 [ 66.703974] ? process_one_work+0x1510/0x1510 [ 66.703974] kthread+0x2a0/0x340 [ 66.703974] ? kthread_complete_and_exit+0x20/0x20 [ 66.703974] ret_from_fork+0x22/0x30 [ 66.703974] [ 66.703974] [ 66.703974] Allocated by task 267: [ 66.703974] kasan_save_stack+0x1e/0x40 [ 66.703974] __kasan_kmalloc+0x81/0xa0 [ 66.703974] nci_allocate_device+0xd3/0x390 [ 66.703974] nfcmrvl_nci_register_dev+0x183/0x2c0 [ 66.703974] nfcmrvl_nci_uart_open+0xf2/0x1dd [ 66.703974] nci_uart_tty_ioctl+0x2c3/0x4a0 [ 66.703974] tty_ioctl+0x764/0x1310 [ 66.703974] __x64_sys_ioctl+0x122/0x190 [ 66.703974] do_syscall_64+0x3b/0x90 [ 66.703974] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 66.703974] [ 66.703974] Freed by task 406: [ 66.703974] kasan_save_stack+0x1e/0x40 [ 66.703974] kasan_set_track+0x21/0x30 [ 66.703974] kasan_set_free_info+0x20/0x30 [ 66.703974] __kasan_slab_free+0x108/0x170 [ 66.703974] kfree+0xb0/0x330 [ 66.703974] nfcmrvl_nci_unregister_dev+0x90/0xd0 [ 66.703974] nci_uart_tty_close+0xdf/0x180 [ 66.703974] tty_ldisc_kill+0x73/0x110 [ 66.703974] tty_ldisc_hangup+0x281/0x5b0 [ 66.703974] __tty_hangup.part.0+0x431/0x890 [ 66.703974] tty_release+0x3a8/0xc80 [ 66.703974] __fput+0x1f0/0x8c0 [ 66.703974] task_work_run+0xc9/0x170 [ 66.703974] exit_to_user_mode_prepare+0x194/0x1a0 [ 66.703974] syscall_exit_to_user_mode+0x19/0x50 [ 66.703974] do_syscall_64+0x48/0x90 [ 66.703974] entry_SYSCALL_64_after_hwframe+0x44/0xae To fix the UAF, this patch adds flush_workqueue() to ensure the nci_cmd_work is finished before the following del_timer_sync. This combination will promise the timer is actually detached. Fixes: 6a2968aaf50c ("NFC: basic NCI protocol implementation") Signed-off-by: Lin Ma Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller net/nfc/nci/core.c | 4 ++++ 1 file changed, 4 insertions(+) commit f1d388f216aeb41a5df518815ae559d14a6d438e Author: Matthias Schiffer Date: Wed Apr 6 15:28:32 2022 +0200 spi: cadence-quadspi: fix incorrect supports_op() return value Since the conversion to spi-mem, the driver advertised support for various operations that cqspi_set_protocol() was never expected to handle correctly - in particuar all non-DTR operations with command or address buswidth > 1. For DTR, all operations except for 8-8-8 would fail, as cqspi_set_protocol() returns -EINVAL. In non-DTR mode, this resulted in data corruption for SPI-NOR flashes that support such operations. As a minimal fix that can be backported to stable kernels, simply disallow the unsupported operations again to avoid this issue. Fixes: a314f6367787 ("mtd: spi-nor: Convert cadence-quadspi to use spi-mem framework") Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/20220406132832.199777-1-matthias.schiffer@ew.tq-group.com Signed-off-by: Mark Brown drivers/spi/spi-cadence-quadspi.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) commit 8e925de60ddaeccb455f0bdad17ce9d8cc2db2e1 Author: Alvin Šipraga Date: Tue Apr 12 17:57:49 2022 +0200 net: dsa: realtek: don't parse compatible string for RTL8366S This switch is not even supported, but if someone were to actually put this compatible string "realtek,rtl8366s" in their device tree, they would be greeted with a kernel panic because the probe function would dereference NULL. So let's just remove it. Link: https://lore.kernel.org/all/CACRpkdYdKZs0WExXc3=0yPNOwP+oOV60HRz7SRoGjZvYHaT=1g@mail.gmail.com/ Signed-off-by: Alvin Šipraga Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller drivers/net/dsa/realtek/realtek-smi.c | 5 ----- 1 file changed, 5 deletions(-) commit 2511e0c87786f333c4665508f421ac99e378c719 Author: Alvin Šipraga Date: Tue Apr 12 17:55:27 2022 +0200 net: dsa: realtek: fix Kconfig to assure consistent driver linkage The kernel test robot reported a build failure: or1k-linux-ld: drivers/net/dsa/realtek/realtek-smi.o:(.rodata+0x16c): undefined reference to `rtl8366rb_variant' ... with the following build configuration: CONFIG_NET_DSA_REALTEK=y CONFIG_NET_DSA_REALTEK_SMI=y CONFIG_NET_DSA_REALTEK_RTL8365MB=y CONFIG_NET_DSA_REALTEK_RTL8366RB=m The problem here is that the realtek-smi interface driver gets built-in, while the rtl8366rb switch subdriver gets built as a module, hence the symbol rtl8366rb_variant is not reachable when defining the OF device table in the interface driver. The Kconfig dependencies don't help in this scenario because they just say that the subdriver(s) depend on at least one interface driver. In fact, the subdrivers don't depend on the interface drivers at all, and can even be built even in their absence. Somewhat strangely, the interface drivers can also be built in the absence of any subdriver, BUT, if a subdriver IS enabled, then it must be reachable according to the linkage of the interface driver: effectively what the IS_REACHABLE() macro achieves. If it is not reachable, the above kind of linker error will be observed. Rather than papering over the above build error by simply using IS_REACHABLE(), we can do a little better and admit that it is actually the interface drivers that have a dependency on the subdrivers. So this patch does exactly that. Specifically, we ensure that: 1. The interface drivers' Kconfig symbols must have a value no greater than the value of any subdriver Kconfig symbols. 2. The subdrivers should by default enable both interface drivers, since most users probably want at least one of them; those interface drivers can be explicitly disabled however. What this doesn't do is prevent a user from building only a subdriver, without any interface driver. To that end, add an additional line of help in the menu to guide users in the right direction. Link: https://lore.kernel.org/all/202204110757.XIafvVnj-lkp@intel.com/ Reported-by: kernel test robot Fixes: aac94001067d ("net: dsa: realtek: add new mdio interface for drivers") Signed-off-by: Alvin Šipraga Signed-off-by: David S. Miller drivers/net/dsa/realtek/Kconfig | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) commit f8e6b7babfeb40987e946bc1427609a9976017fa Author: Karol Herbst Date: Mon Apr 11 15:44:04 2022 +0200 dma-buf-map: remove renamed header file commit 7938f4218168 ("dma-buf-map: Rename to iosys-map") already renamed this file, but it got brought back by a merge. Delete it for real this time. Fixes: 30424ebae8df ("Merge tag 'drm-intel-gt-next-2022-02-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-next") Cc: Rodrigo Vivi Cc: Lucas De Marchi Cc: dri-devel@lists.freedesktop.org Signed-off-by: Karol Herbst Reviewed-by: Michel Dänzer Reviewed-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220411134404.524776-1-kherbst@redhat.com include/linux/dma-buf-map.h | 266 -------------------------------------------- 1 file changed, 266 deletions(-) commit 299d8b74519d04042f8803d0604e08a1a7e31e5e Author: Mika Westerberg Date: Mon Apr 11 14:21:16 2022 +0300 spi: intel: Add support for Raptor Lake-S SPI serial flash Intel Raptor Lake-S has the same SPI serial flash controller as Alder Lake-P. Add Raptor Lake-S PCI ID to the driver list of supported devices. Signed-off-by: Mika Westerberg Link: https://lore.kernel.org/r/20220411112116.53281-1-mika.westerberg@linux.intel.com Signed-off-by: Mark Brown drivers/spi/spi-intel-pci.c | 1 + 1 file changed, 1 insertion(+) commit dad32cfeed7c5a375335b04398bf064a9c61cc20 Merge: 3d2504524531 fb4bccd863cc Author: David S. Miller Date: Wed Apr 13 13:13:34 2022 +0100 Merge tag 'wireless-2022-04-13' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Kalle Valo says: ==================== wireless fixes for v5.18 First set of fixes for v5.18. Maintainers file updates, two compilation warning fixes, one revert for ath11k and smaller fixes to drivers and stack. All the usual stuff. ==================== Signed-off-by: David S. Miller commit b0c3e796f24b588b862b61ce235d3c9417dc8983 Author: Jason A. Donenfeld Date: Fri Apr 8 18:14:57 2022 +0200 random: make random_get_entropy() return an unsigned long Some implementations were returning type `unsigned long`, while others that fell back to get_cycles() were implicitly returning a `cycles_t` or an untyped constant int literal. That makes for weird and confusing code, and basically all code in the kernel already handled it like it was an `unsigned long`. I recently tried to handle it as the largest type it could be, a `cycles_t`, but doing so doesn't really help with much. Instead let's just make random_get_entropy() return an unsigned long all the time. This also matches the commonly used `arch_get_random_long()` function, so now RDRAND and RDTSC return the same sized integer, which means one can fallback to the other more gracefully. Cc: Dominik Brodowski Cc: Theodore Ts'o Acked-by: Thomas Gleixner Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 20 +++++++------------- include/linux/timex.h | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) commit 5209aed5137880fa229746cb521f715e55596460 Author: Jason A. Donenfeld Date: Thu Apr 7 21:23:08 2022 +0200 random: allow partial reads if later user copies fail Rather than failing entirely if a copy_to_user() fails at some point, instead we should return a partial read for the amount that succeeded prior, unless none succeeded at all, in which case we return -EFAULT as before. This makes it consistent with other reader interfaces. For example, the following snippet for /dev/zero outputs "4" followed by "1": int fd; void *x = mmap(NULL, 4096, PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); assert(x != MAP_FAILED); fd = open("/dev/zero", O_RDONLY); assert(fd >= 0); printf("%zd\n", read(fd, x, 4)); printf("%zd\n", read(fd, x + 4095, 4)); close(fd); This brings that same standard behavior to the various RNG reader interfaces. While we're at it, we can streamline the loop logic a little bit. Suggested-by: Linus Torvalds Cc: Jann Horn Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) commit b2dd71f9f728da695a86b8308feb4f39defe9019 Author: Herton R. Krzesinski Date: Mon Apr 4 18:05:25 2022 -0300 tools/power/x86/intel-speed-select: fix build failure when using -Wl,--as-needed Build of intel-speed-select will fail if you run: $ LDFLAGS="-Wl,--as-needed" /usr/bin/make V=1 ... gcc -O2 -Wall -g -D_GNU_SOURCE -Iinclude -I/usr/include/libnl3 -Wl,--as-needed -lnl-genl-3 -lnl-3 intel-speed-select-in.o -o intel-speed-select /usr/bin/ld: intel-speed-select-in.o: in function `handle_event': (...)/linux/tools/power/x86/intel-speed-select/hfi-events.c:189: undefined reference to `nlmsg_hdr' ... In this case the problem is that order when linking matters when using the flag -Wl,--as-needed, symbols not used at that point are discarded. So since intel-speed-select-in.o comes after, at that point the libraries/symbols are already discarded and then missing/undefined references are reported. To fix this, make sure we specify LDFLAGS after the object file. Acked-by: Srinivas Pandruvada Signed-off-by: Herton R. Krzesinski Link: https://lore.kernel.org/r/20220404210525.725611-1-herton@redhat.com Signed-off-by: Hans de Goede tools/power/x86/intel-speed-select/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3d2504524531990b32a0629cc984db44f399d161 Author: Dylan Hung Date: Tue Apr 12 19:48:59 2022 +0800 net: ftgmac100: access hardware register after clock ready AST2600 MAC register 0x58 is writable only when the MAC clock is enabled. Usually, the MAC clock is enabled by the bootloader so register 0x58 is set normally when the bootloader is involved. To make ast2600 ftgmac100 work without the bootloader, postpone the register write until the clock is ready. Fixes: 137d23cea1c0 ("net: ftgmac100: Fix Aspeed ast2600 TX hang issue") Signed-off-by: Dylan Hung Signed-off-by: David S. Miller drivers/net/ethernet/faraday/ftgmac100.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 762c2998c9625f642f0d23da7d3f7e4f90665fdf Author: Vladimir Oltean Date: Tue Apr 12 12:44:26 2022 +0300 Revert "net: dsa: setup master before ports" This reverts commit 11fd667dac315ea3f2469961f6d2869271a46cae. dsa_slave_change_mtu() updates the MTU of the DSA master and of the associated CPU port, but only if it detects a change to the master MTU. The blamed commit in the Fixes: tag below addressed a regression where dsa_slave_change_mtu() would return early and not do anything due to ds->ops->port_change_mtu() not being implemented. However, that commit also had the effect that the master MTU got set up to the correct value by dsa_master_setup(), but the associated CPU port's MTU did not get updated. This causes breakage for drivers that rely on the ->port_change_mtu() DSA call to account for the tagging overhead on the CPU port, and don't set up the initial MTU during the setup phase. Things actually worked before because they were in a fragile equilibrium where dsa_slave_change_mtu() was called before dsa_master_setup() was. So dsa_slave_change_mtu() could actually detect a change and update the CPU port MTU too. Restore the code to the way things used to work by reverting the reorder of dsa_tree_setup_master() and dsa_tree_setup_ports(). That change did not have a concrete motivation going for it anyway, it just looked better. Fixes: 066dfc429040 ("Revert "net: dsa: stop updating master MTU from master.c"") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/dsa2.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) commit e16b859872b87650bb55b12cca5a5fcdc49c1442 Author: Martin Willi Date: Tue Apr 12 11:34:57 2022 +0200 macvlan: Fix leaking skb in source mode with nodst option The MACVLAN receive handler clones skbs to all matching source MACVLAN interfaces, before it passes the packet along to match on destination based MACVLANs. When using the MACVLAN nodst mode, passing the packet to destination based MACVLANs is omitted and the handler returns with RX_HANDLER_CONSUMED. However, the passed skb is not freed, leaking for any packet processed with the nodst option. Properly free the skb when consuming packets to fix that leak. Fixes: 427f0c8c194b ("macvlan: Add nodst option to macvlan type source") Signed-off-by: Martin Willi Signed-off-by: David S. Miller drivers/net/macvlan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit e5c23779f93d45e39a52758ca593bd7e62e9b4be Author: Rob Herring Date: Fri Apr 8 15:33:30 2022 -0500 arm_pmu: Validate single/group leader events In the case where there is only a cycle counter available (i.e. PMCR_EL0.N is 0) and an event other than CPU cycles is opened, the open should fail as the event can never possibly be scheduled. However, the event validation when an event is opened is skipped when the group leader is opened. Fix this by always validating the group leader events. Reported-by: Al Grant Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Rob Herring Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220408203330.4014015-1-robh@kernel.org Cc: Signed-off-by: Will Deacon drivers/perf/arm_pmu.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit eb5adc70754d26a260f8b42d39db42da0d0af500 Author: Duoming Zhou Date: Thu Apr 7 23:44:30 2022 +0800 arch: xtensa: platforms: Fix deadlock in rs_close() There is a deadlock in rs_close(), which is shown below: (Thread 1) | (Thread 2) | rs_open() rs_close() | mod_timer() spin_lock_bh() //(1) | (wait a time) ... | rs_poll() del_timer_sync() | spin_lock() //(2) (wait timer to stop) | ... We hold timer_lock in position (1) of thread 1 and use del_timer_sync() to wait timer to stop, but timer handler also need timer_lock in position (2) of thread 2. As a result, rs_close() will block forever. This patch deletes the redundant timer_lock in order to prevent the deadlock. Because there is no race condition between rs_close, rs_open and rs_poll. Signed-off-by: Duoming Zhou Message-Id: <20220407154430.22387-1-duoming@zju.edu.cn> Signed-off-by: Max Filippov arch/xtensa/platforms/iss/console.c | 8 -------- 1 file changed, 8 deletions(-) commit ee69d4be8fd064cd08270b4808d2dfece3614ee0 Author: Guo Ren Date: Thu Apr 7 15:33:22 2022 +0800 xtensa: patch_text: Fixup last cpu should be master These patch_text implementations are using stop_machine_cpuslocked infrastructure with atomic cpu_count. The original idea: When the master CPU patch_text, the others should wait for it. But current implementation is using the first CPU as master, which couldn't guarantee the remaining CPUs are waiting. This patch changes the last CPU as the master to solve the potential risk. Fixes: 64711f9a47d4 ("xtensa: implement jump_label support") Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Max Filippov Reviewed-by: Masami Hiramatsu Cc: Message-Id: <20220407073323.743224-4-guoren@kernel.org> Signed-off-by: Max Filippov arch/xtensa/kernel/jump_label.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 581045ed5cfa42ed7f5364d6ccbcb6fcc077ffcf Author: Yassine Oudjana Date: Tue Mar 29 03:34:03 2022 +0000 power: supply: Reset err after not finding static battery Otherwise power_supply_get_battery_info always returns -ENODEV on devices that do not have a static battery, even when a simple battery is found. Fixes: c8aee3f41cb8 ("power: supply: Static data for Samsung batteries") Signed-off-by: Yassine Oudjana Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel drivers/power/supply/power_supply_core.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 5c7d28c6f6d4e739bafb92f913ec8ff982239c0e Author: Linus Walleij Date: Sun Mar 6 00:24:20 2022 +0100 power: supply: samsung-sdi-battery: Add missing charge restart voltages Two of the batteries were missing charging restart voltages, meaning they can drain if the algorithm relies on restarting charging at this voltage. Fix it up. Fixes: c8aee3f41cb8 ("power: supply: Static data for Samsung batteries") Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel drivers/power/supply/samsung-sdi-battery.c | 2 ++ 1 file changed, 2 insertions(+) commit f034fc50d3c7d9385c20d505ab4cf56b8fd18ac7 Author: Adrian Hunter Date: Mon Apr 11 09:17:58 2022 +0300 perf tools: Fix misleading add event PMU debug message Fix incorrect debug message: Attempting to add event pmu 'intel_pt' with '' that may result in non-fatal errors which always appears with perf record -vv and intel_pt e.g. perf record -vv -e intel_pt//u uname The message is incorrect because there will never be non-fatal errors. Suppress the message if the PMU is 'selectable' i.e. meant to be selected directly as an event. Fixes: 4ac22b484d4c79e8 ("perf parse-events: Make add PMU verbose output clearer") Signed-off-by: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20220411061758.2458417-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/parse-events.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 3588060befff75ff39fab7122b94c6fb3148fcda Author: Miaoqian Lin Date: Fri Mar 18 10:57:46 2022 +0000 phy: ti: omap-usb2: Fix error handling in omap_usb2_enable_clocks The corresponding API for clk_prepare_enable is clk_disable_unprepare. Make sure that the clock is unprepared on exit by changing clk_disable to clk_disable_unprepare. Fixes: ed31ee7cf1fe ("phy: ti: usb2: Fix logic on -EPROBE_DEFER") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220318105748.19532-1-linmq006@gmail.com Signed-off-by: Vinod Koul drivers/phy/ti/phy-omap-usb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 022074918042465668db9b0f768e2260b1e39c59 Author: Christian König Date: Mon Apr 11 15:49:09 2022 +0200 drm/radeon: fix logic inversion in radeon_sync_resv Shared is the opposite of write/exclusive. Signed-off-by: Christian König Fixes: 0597ca7b43e4 ("drm/radeon: use new iterator in radeon_sync_resv") Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1970 Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220412093626.608767-1-christian.koenig@amd.com drivers/gpu/drm/radeon/radeon_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5bd8baab087dff657e05387aee802e70304cc813 Author: Sabrina Dubroca Date: Wed Apr 13 10:10:50 2022 +0200 esp: limit skb_page_frag_refill use to a single page Commit ebe48d368e97 ("esp: Fix possible buffer overflow in ESP transformation") tried to fix skb_page_frag_refill usage in ESP by capping allocsize to 32k, but that doesn't completely solve the issue, as skb_page_frag_refill may return a single page. If that happens, we will write out of bounds, despite the check introduced in the previous patch. This patch forces COW in cases where we would end up calling skb_page_frag_refill with a size larger than a page (first in esp_output_head with tailen, then in esp_output_tail with skb->data_len). Fixes: cac2661c53f3 ("esp4: Avoid skb_cow_data whenever possible") Fixes: 03e2a30f6a27 ("esp6: Avoid skb_cow_data whenever possible") Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert include/net/esp.h | 2 -- net/ipv4/esp4.c | 5 ++--- net/ipv6/esp6.c | 5 ++--- 3 files changed, 4 insertions(+), 8 deletions(-) commit c38f83bae4037023827c85e045841d0421f85034 Author: Manivannan Sadhasivam Date: Fri Apr 8 20:30:39 2022 +0530 bus: mhi: host: pci_generic: Flush recovery worker during freeze It is possible that the recovery work might be running while the freeze gets executed (during hibernation etc.,). Currently, we don't powerdown the stack if it is not up but if the recovery work completes after freeze, then the device will be up afterwards. This will not be a sane situation. So let's flush the recovery worker before trying to powerdown the device. Cc: stable@vger.kernel.org Fixes: 5f0c2ee1fe8d ("bus: mhi: pci-generic: Fix hibernation") Reported-by: Bhaumik Vasav Bhatt Reviewed-by: Bhaumik Vasav Bhatt Link: https://lore.kernel.org/r/20220408150039.17297-1-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam drivers/bus/mhi/host/pci_generic.c | 1 + 1 file changed, 1 insertion(+) commit e64d5fa5044f225ac87d96a7e4be11389999c4c6 Author: Manivannan Sadhasivam Date: Tue Apr 5 18:29:07 2022 +0530 bus: mhi: host: pci_generic: Add missing poweroff() PM callback During hibernation process, once thaw() stage completes, the MHI endpoint devices will be in M0 state post recovery. After that, the devices will be powered down so that the system can enter the target sleep state. During this stage, the PCI core will put the devices in D3hot. But this transition is allowed by the MHI spec. The devices can only enter D3hot when it is in M3 state. So for fixing this issue, let's add the poweroff() callback that will get executed before putting the system in target sleep state during hibernation. This callback will power down the device properly so that it could be restored during restore() or thaw() stage. Cc: stable@vger.kernel.org Fixes: 5f0c2ee1fe8d ("bus: mhi: pci-generic: Fix hibernation") Reported-by: Hemant Kumar Suggested-by: Hemant Kumar Link: https://lore.kernel.org/r/20220405125907.5644-1-manivannan.sadhasivam@linaro.org Signed-off-by: Manivannan Sadhasivam drivers/bus/mhi/host/pci_generic.c | 1 + 1 file changed, 1 insertion(+) commit 24d0c9f0e7de95fe3e3e0067cbea1cd5d413244b Author: Takashi Iwai Date: Tue Apr 12 15:07:40 2022 +0200 ALSA: usb-audio: Limit max buffer and period sizes per time In the previous fix, we increased the max buffer bytes from 1MB to 4MB so that we can use bigger buffers for the modern HiFi devices with higher rates, more channels and wider formats. OTOH, extending this has a concern that too big buffer is allowed for the lower rates, less channels and narrower formats; when an application tries to allocate as big buffer as possible, it'll lead to unexpectedly too huge size. Also, we had a problem about the inconsistent max buffer and period bytes for the implicit feedback mode when both streams have different channels. This was fixed by the (relatively complex) patch to reduce the max buffer and period bytes accordingly. This is an alternative fix for those, a patch to kill two birds with one stone (*): instead of increasing the max buffer bytes blindly and applying the reduction per channels, we simply use the hw constraints for the buffer and period "time". Meanwhile the max buffer and period bytes are set unlimited instead. Since the inconsistency of buffer (and period) bytes comes from the difference of the channels in the tied streams, as long as we care only about the buffer (and period) time, it doesn't matter; the buffer time is same for different channels, although we still allow higher buffer size. Similarly, this will allow more buffer bytes for HiFi devices while it also keeps the reasonable size for the legacy devices, too. As of this patch, the max period and buffer time are set to 1 and 2 seconds, which should be large enough for all possible use cases. (*) No animals were harmed in the making of this patch. Fixes: 98c27add5d96 ("ALSA: usb-audio: Cap upper limits of buffer/period bytes for implicit fb") Fixes: fee2ec8cceb3 ("ALSA: usb-audio: Increase max buffer size") Link: https://lore.kernel.org/r/20220412130740.18933-1-tiwai@suse.de Signed-off-by: Takashi Iwai sound/usb/pcm.c | 101 ++++++++------------------------------------------------ 1 file changed, 14 insertions(+), 87 deletions(-) commit 925ca893b4a65177394581737b95d03fea2660f2 Author: Takashi Iwai Date: Wed Apr 13 07:48:08 2022 +0200 ALSA: memalloc: Add fallback SG-buffer allocations for x86 The recent change for memory allocator replaced the SG-buffer handling helper for x86 with the standard non-contiguous page handler. This works for most cases, but there is a corner case I obviously overlooked, namely, the fallback of non-contiguous handler without IOMMU. When the system runs without IOMMU, the core handler tries to use the continuous pages with a single SGL entry. It works nicely for most cases, but when the system memory gets fragmented, the large allocation may fail frequently. Ideally the non-contig handler could deal with the proper SG pages, it's cumbersome to extend for now. As a workaround, here we add new types for (minimalistic) SG allocations, instead, so that the allocator falls back to those types automatically when the allocation with the standard API failed. BTW, one better (but pretty minor) improvement from the previous SG-buffer code is that this provides the proper mmap support without the PCM's page fault handling. Fixes: 2c95b92ecd92 ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)") BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2272 BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1198248 Cc: Link: https://lore.kernel.org/r/20220413054808.7547-1-tiwai@suse.de Signed-off-by: Takashi Iwai include/sound/memalloc.h | 5 +++ sound/core/memalloc.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 115 insertions(+), 1 deletion(-) commit 7102ffe4c166ca0f5e35137e9f9de83768c2d27d Author: wangjianjian (C) Date: Fri Apr 1 20:07:35 2022 +0800 ext4, doc: fix incorrect h_reserved size According to document and code, ext4_xattr_header's size is 32 bytes, so h_reserved size should be 3. Signed-off-by: Wang Jianjian Link: https://lore.kernel.org/r/92fcc3a6-7d77-8c09-4126-377fcb4c46a5@huawei.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Documentation/filesystems/ext4/attributes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2da376228a2427501feb9d15815a45dbdbdd753e Author: Tadeusz Struk Date: Thu Mar 31 13:05:15 2022 -0700 ext4: limit length to bitmap_maxbytes - blocksize in punch_hole Syzbot found an issue [1] in ext4_fallocate(). The C reproducer [2] calls fallocate(), passing size 0xffeffeff000ul, and offset 0x1000000ul, which, when added together exceed the bitmap_maxbytes for the inode. This triggers a BUG in ext4_ind_remove_space(). According to the comments in this function the 'end' parameter needs to be one block after the last block to be removed. In the case when the BUG is triggered it points to the last block. Modify the ext4_punch_hole() function and add constraint that caps the length to satisfy the one before laster block requirement. LINK: [1] https://syzkaller.appspot.com/bug?id=b80bd9cf348aac724a4f4dff251800106d721331 LINK: [2] https://syzkaller.appspot.com/text?tag=ReproC&x=14ba0238700000 Fixes: a4bb6b64e39a ("ext4: enable "punch hole" functionality") Reported-by: syzbot+7a806094edd5d07ba029@syzkaller.appspotmail.com Signed-off-by: Tadeusz Struk Link: https://lore.kernel.org/r/20220331200515.153214-1-tadeusz.struk@linaro.org Signed-off-by: Theodore Ts'o Cc: stable@kernel.org fs/ext4/inode.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) commit c186f0887fe7061a35cebef024550ec33ef8fbd8 Author: Ye Bin Date: Thu Mar 24 14:48:16 2022 +0800 ext4: fix use-after-free in ext4_search_dir We got issue as follows: EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue ================================================================== BUG: KASAN: use-after-free in ext4_search_dir fs/ext4/namei.c:1394 [inline] BUG: KASAN: use-after-free in search_dirblock fs/ext4/namei.c:1199 [inline] BUG: KASAN: use-after-free in __ext4_find_entry+0xdca/0x1210 fs/ext4/namei.c:1553 Read of size 1 at addr ffff8881317c3005 by task syz-executor117/2331 CPU: 1 PID: 2331 Comm: syz-executor117 Not tainted 5.10.0+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:83 [inline] dump_stack+0x144/0x187 lib/dump_stack.c:124 print_address_description+0x7d/0x630 mm/kasan/report.c:387 __kasan_report+0x132/0x190 mm/kasan/report.c:547 kasan_report+0x47/0x60 mm/kasan/report.c:564 ext4_search_dir fs/ext4/namei.c:1394 [inline] search_dirblock fs/ext4/namei.c:1199 [inline] __ext4_find_entry+0xdca/0x1210 fs/ext4/namei.c:1553 ext4_lookup_entry fs/ext4/namei.c:1622 [inline] ext4_lookup+0xb8/0x3a0 fs/ext4/namei.c:1690 __lookup_hash+0xc5/0x190 fs/namei.c:1451 do_rmdir+0x19e/0x310 fs/namei.c:3760 do_syscall_64+0x33/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x445e59 Code: 4d c7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 1b c7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fff2277fac8 EFLAGS: 00000246 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 0000000000400280 RCX: 0000000000445e59 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000200000c0 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000002 R10: 00007fff2277f990 R11: 0000000000000246 R12: 0000000000000000 R13: 431bde82d7b634db R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:0000000048cd3304 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x1317c3 flags: 0x200000000000000() raw: 0200000000000000 ffffea0004526588 ffffea0004528088 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881317c2f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881317c2f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881317c3000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881317c3080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881317c3100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ext4_search_dir: ... de = (struct ext4_dir_entry_2 *)search_buf; dlimit = search_buf + buf_size; while ((char *) de < dlimit) { ... if ((char *) de + de->name_len <= dlimit && ext4_match(dir, fname, de)) { ... } ... de_len = ext4_rec_len_from_disk(de->rec_len, dir->i_sb->s_blocksize); if (de_len <= 0) return -1; offset += de_len; de = (struct ext4_dir_entry_2 *) ((char *) de + de_len); } Assume: de=0xffff8881317c2fff dlimit=0x0xffff8881317c3000 If read 'de->name_len' which address is 0xffff8881317c3005, obviously is out of range, then will trigger use-after-free. To solve this issue, 'dlimit' must reserve 8 bytes, as we will read 'de->name_len' to judge if '(char *) de + de->name_len' out of range. Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220324064816.1209985-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org fs/ext4/ext4.h | 4 ++++ fs/ext4/namei.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) commit b98535d091795a79336f520b0708457aacf55c67 Author: Ye Bin Date: Tue Mar 22 09:24:19 2022 +0800 ext4: fix bug_on in start_this_handle during umount filesystem We got issue as follows: ------------[ cut here ]------------ kernel BUG at fs/jbd2/transaction.c:389! invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI CPU: 9 PID: 131 Comm: kworker/9:1 Not tainted 5.17.0-862.14.0.6.x86_64-00001-g23f87daf7d74-dirty #197 Workqueue: events flush_stashed_error_work RIP: 0010:start_this_handle+0x41c/0x1160 RSP: 0018:ffff888106b47c20 EFLAGS: 00010202 RAX: ffffed10251b8400 RBX: ffff888128dc204c RCX: ffffffffb52972ac RDX: 0000000000000200 RSI: 0000000000000004 RDI: ffff888128dc2050 RBP: 0000000000000039 R08: 0000000000000001 R09: ffffed10251b840a R10: ffff888128dc204f R11: ffffed10251b8409 R12: ffff888116d78000 R13: 0000000000000000 R14: dffffc0000000000 R15: ffff888128dc2000 FS: 0000000000000000(0000) GS:ffff88839d680000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000001620068 CR3: 0000000376c0e000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: jbd2__journal_start+0x38a/0x790 jbd2_journal_start+0x19/0x20 flush_stashed_error_work+0x110/0x2b3 process_one_work+0x688/0x1080 worker_thread+0x8b/0xc50 kthread+0x26f/0x310 ret_from_fork+0x22/0x30 Modules linked in: ---[ end trace 0000000000000000 ]--- Above issue may happen as follows: umount read procfs error_work ext4_put_super flush_work(&sbi->s_error_work); ext4_mb_seq_groups_show ext4_mb_load_buddy_gfp ext4_mb_init_group ext4_mb_init_cache ext4_read_block_bitmap_nowait ext4_validate_block_bitmap ext4_error ext4_handle_error schedule_work(&EXT4_SB(sb)->s_error_work); ext4_unregister_sysfs(sb); jbd2_journal_destroy(sbi->s_journal); journal_kill_thread journal->j_flags |= JBD2_UNMOUNT; flush_stashed_error_work jbd2_journal_start start_this_handle BUG_ON(journal->j_flags & JBD2_UNMOUNT); To solve this issue, we call 'ext4_unregister_sysfs() before flushing s_error_work in ext4_put_super(). Signed-off-by: Ye Bin Reviewed-by: Jan Kara Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220322012419.725457-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o fs/ext4/super.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) commit a2b0b205d125f27cddfb4f7280e39affdaf46686 Author: Ye Bin Date: Mon Mar 21 22:44:38 2022 +0800 ext4: fix symlink file size not match to file content We got issue as follows: [home]# fsck.ext4 -fn ram0yb e2fsck 1.45.6 (20-Mar-2020) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Symlink /p3/d14/d1a/l3d (inode #3494) is invalid. Clear? no Entry 'l3d' in /p3/d14/d1a (3383) has an incorrect filetype (was 7, should be 0). Fix? no As the symlink file size does not match the file content. If the writeback of the symlink data block failed, ext4_finish_bio() handles the end of IO. However this function fails to mark the buffer with BH_write_io_error and so when unmount does journal checkpoint it cannot detect the writeback error and will cleanup the journal. Thus we've lost the correct data in the journal area. To solve this issue, mark the buffer as BH_write_io_error in ext4_finish_bio(). Cc: stable@kernel.org Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220321144438.201685-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o fs/ext4/page-io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit ad5cd4f4ee4d5fcdb1bfb7a0c073072961e70783 Author: Darrick J. Wong Date: Tue Mar 8 10:50:43 2022 -0800 ext4: fix fallocate to use file_modified to update permissions consistently Since the initial introduction of (posix) fallocate back at the turn of the century, it has been possible to use this syscall to change the user-visible contents of files. This can happen by extending the file size during a preallocation, or through any of the newer modes (punch, zero, collapse, insert range). Because the call can be used to change file contents, we should treat it like we do any other modification to a file -- update the mtime, and drop set[ug]id privileges/capabilities. The VFS function file_modified() does all this for us if pass it a locked inode, so let's make fallocate drop permissions correctly. Signed-off-by: Darrick J. Wong Link: https://lore.kernel.org/r/20220308185043.GA117678@magnolia Signed-off-by: Theodore Ts'o Cc: stable@kernel.org fs/ext4/ext4.h | 2 +- fs/ext4/extents.c | 32 +++++++++++++++++++++++++------- fs/ext4/inode.c | 7 ++++++- 3 files changed, 32 insertions(+), 9 deletions(-) commit a19944809fe9942e6a96292490717904d0690c21 Merge: c1488c97517a c40160f2998c Author: Linus Torvalds Date: Tue Apr 12 14:29:40 2022 -1000 Merge tag 'hardening-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening fixes from Kees Cook: - latent_entropy: Use /dev/urandom instead of small GCC seed (Jason Donenfeld) - uapi/stddef.h: add missed include guards (Tadeusz Struk) * tag 'hardening-v5.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-plugins: latent_entropy: use /dev/urandom uapi/linux/stddef.h: Add include guards commit c1488c97517adab67087aa7ed43658af49dbd0ab Merge: 453096eb048c 4d5004451ab2 Author: Linus Torvalds Date: Tue Apr 12 14:23:19 2022 -1000 Merge tag 'nfsd-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: - Fix a write performance regression - Fix crashes during request deferral on RDMA transports * tag 'nfsd-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: SUNRPC: Fix the svc_deferred_event trace class SUNRPC: Fix NFSD's request deferral on RDMA transports nfsd: Clean up nfsd_file_put() nfsd: Fix a write performance regression SUNRPC: Return true/false (not 1/0) from bool functions commit 453096eb048ce613d5775ea21cdf7826d4340e80 Merge: 7083b89ef3e9 42dcbe7d8bac Author: Linus Torvalds Date: Tue Apr 12 14:16:33 2022 -1000 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "x86: - Miscellaneous bugfixes - A small cleanup for the new workqueue code - Documentation syntax fix RISC-V: - Remove hgatp zeroing in kvm_arch_vcpu_put() - Fix alignment of the guest_hang() in KVM selftest - Fix PTE A and D bits in KVM selftest - Missing #include in vcpu_fp.c ARM: - Some PSCI fixes after introducing PSCIv1.1 and SYSTEM_RESET2 - Fix the MMU write-lock not being taken on THP split - Fix mixed-width VM handling - Fix potential UAF when debugfs registration fails - Various selftest updates for all of the above" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (24 commits) KVM: x86: hyper-v: Avoid writing to TSC page without an active vCPU KVM: SVM: Do not activate AVIC for SEV-enabled guest Documentation: KVM: Add SPDX-License-Identifier tag selftests: kvm: add tsc_scaling_sync to .gitignore RISC-V: KVM: include missing hwcap.h into vcpu_fp KVM: selftests: riscv: Fix alignment of the guest_hang() function KVM: selftests: riscv: Set PTE A and D bits in VS-stage page table RISC-V: KVM: Don't clear hgatp CSR in kvm_arch_vcpu_put() selftests: KVM: Free the GIC FD when cleaning up in arch_timer selftests: KVM: Don't leak GIC FD across dirty log test iterations KVM: Don't create VM debugfs files outside of the VM directory KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3) KVM: avoid NULL pointer dereference in kvm_dirty_ring_push KVM: arm64: selftests: Introduce vcpu_width_config KVM: arm64: mixed-width check should be skipped for uninitialized vCPUs KVM: arm64: vgic: Remove unnecessary type castings KVM: arm64: Don't split hugepages outside of MMU write lock KVM: arm64: Drop unneeded minor version check from PSCI v1.x handler KVM: arm64: Actually prevent SMC64 SYSTEM_RESET2 from AArch32 KVM: arm64: Generally disallow SMC64 for AArch32 guests ... commit 7083b89ef3e9a6ec362585026f81cb165c51b78a Merge: 932aba1e1690 3ae87d2f25c0 Author: Linus Torvalds Date: Tue Apr 12 14:08:43 2022 -1000 Merge tag 'media/v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: - a regression fix for si2157 - a Kconfig dependency fix for imx-mipi-csis - fix the rockchip/rga driver probing logic * tag 'media/v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: si2157: unknown chip version Si2147-A30 ROM 0x50 media: platform: imx-mipi-csis: Add dependency on VIDEO_DEV media: rockchip/rga: do proper error checking in probe commit 932aba1e169090357a77af18850a10c256b50819 Author: Mikulas Patocka Date: Tue Apr 12 05:41:00 2022 -0400 stat: fix inconsistency between struct stat and struct compat_stat struct stat (defined in arch/x86/include/uapi/asm/stat.h) has 32-bit st_dev and st_rdev; struct compat_stat (defined in arch/x86/include/asm/compat.h) has 16-bit st_dev and st_rdev followed by a 16-bit padding. This patch fixes struct compat_stat to match struct stat. [ Historical note: the old x86 'struct stat' did have that 16-bit field that the compat layer had kept around, but it was changes back in 2003 by "struct stat - support larger dev_t": https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=e95b2065677fe32512a597a79db94b77b90c968d and back in those days, the x86_64 port was still new, and separate from the i386 code, and had already picked up the old version with a 16-bit st_dev field ] Note that we can't change compat_dev_t because it is used by compat_loop_info. Also, if the st_dev and st_rdev values are 32-bit, we don't have to use old_valid_dev to test if the value fits into them. This fixes -EOVERFLOW on filesystems that are on NVMe because NVMe uses the major number 259. Signed-off-by: Mikulas Patocka Cc: Andreas Schwab Cc: Matthew Wilcox Cc: Christoph Hellwig Signed-off-by: Linus Torvalds arch/x86/include/asm/compat.h | 6 ++---- fs/stat.c | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) commit b97687527be85a55e12804c98745c5619eadcc32 Author: Alexander Lobakin Date: Tue Apr 12 21:59:16 2022 +0000 asm-generic: fix __get_unaligned_be48() on 32 bit platforms While testing the new macros for working with 48 bit containers, I faced a weird problem: 32 + 16: 0x2ef6e8da 0x79e60000 48: 0xffffe8da + 0x79e60000 All the bits starting from the 32nd were getting 1d in 9/10 cases. The debug showed: p[0]: 0x00002e0000000000 p[1]: 0x00002ef600000000 p[2]: 0xffffffffe8000000 p[3]: 0xffffffffe8da0000 p[4]: 0xffffffffe8da7900 p[5]: 0xffffffffe8da79e6 that the value becomes a garbage after the third OR, i.e. on `p[2] << 24`. When the 31st bit is 1 and there's no explicit cast to an unsigned, it's being considered as a signed int and getting sign-extended on OR, so `e8000000` becomes `ffffffffe8000000` and messes up the result. Cast the @p[2] to u64 as well to avoid this. Now: 32 + 16: 0x7ef6a490 0xddc10000 48: 0x7ef6a490 + 0xddc10000 p[0]: 0x00007e0000000000 p[1]: 0x00007ef600000000 p[2]: 0x00007ef6a4000000 p[3]: 0x00007ef6a4900000 p[4]: 0x00007ef6a490dd00 p[5]: 0x00007ef6a490ddc1 Fixes: c2ea5fcf53d5 ("asm-generic: introduce be48 unaligned accessors") Signed-off-by: Alexander Lobakin Link: https://lore.kernel.org/r/20220412215220.75677-1-alobakin@pm.me Signed-off-by: Jens Axboe include/asm-generic/unaligned.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 610323d8f6f8b479a04eec33fd67e4152beb7b65 Author: Jakob Koschel Date: Fri Apr 1 00:35:03 2022 +0200 video: fbdev: mmp: replace usage of found with dedicated list iterator variable To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable instead of a found boolean [1]. This removes the need to use a found variable and simply checking if the variable was set, can determine if the break/goto was hit. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Signed-off-by: Helge Deller drivers/video/fbdev/mmp/core.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit ce64763c63854b4079f2e036638aa881a1fb3fbc Author: Athira Rajeev Date: Fri Apr 8 12:54:31 2022 +0530 testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu set The selftest "mqueue/mq_perf_tests.c" use CPU_ALLOC to allocate CPU set. This cpu set is used further in pthread_attr_setaffinity_np and by pthread_create in the code. But in current code, allocated cpu set is not freed. Fix this issue by adding CPU_FREE in the "shutdown" function which is called in most of the error/exit path for the cleanup. There are few error paths which exit without using shutdown. Add a common goto error path with CPU_FREE for these cases. Fixes: 7820b0715b6f ("tools/selftests: add mq_perf_tests") Signed-off-by: Athira Rajeev Signed-off-by: Shuah Khan tools/testing/selftests/mqueue/mq_perf_tests.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) commit c40160f2998c897231f8454bf797558d30a20375 Author: Jason A. Donenfeld Date: Wed Apr 6 00:28:15 2022 +0200 gcc-plugins: latent_entropy: use /dev/urandom While the latent entropy plugin mostly doesn't derive entropy from get_random_const() for measuring the call graph, when __latent_entropy is applied to a constant, then it's initialized statically to output from get_random_const(). In that case, this data is derived from a 64-bit seed, which means a buffer of 512 bits doesn't really have that amount of compile-time entropy. This patch fixes that shortcoming by just buffering chunks of /dev/urandom output and doling it out as requested. At the same time, it's important that we don't break the use of -frandom-seed, for people who want the runtime benefits of the latent entropy plugin, while still having compile-time determinism. In that case, we detect whether gcc's set_random_seed() has been called by making a call to get_random_seed(noinit=true) in the plugin init function, which is called after set_random_seed() is called but before anything that calls get_random_seed(noinit=false), and seeing if it's zero or not. If it's not zero, we're in deterministic mode, and so we just generate numbers with a basic xorshift prng. Note that we don't detect if -frandom-seed is being used using the documented local_tick variable, because it's assigned via: local_tick = (unsigned) tv.tv_sec * 1000 + tv.tv_usec / 1000; which may well overflow and become -1 on its own, and so isn't reliable: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105171 [kees: The 256 byte rnd_buf size was chosen based on average (250), median (64), and std deviation (575) bytes of used entropy for a defconfig x86_64 build] Fixes: 38addce8b600 ("gcc-plugins: Add latent_entropy plugin") Cc: stable@vger.kernel.org Cc: PaX Team Signed-off-by: Jason A. Donenfeld Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220405222815.21155-1-Jason@zx2c4.com scripts/gcc-plugins/latent_entropy_plugin.c | 44 ++++++++++++++++++----------- 1 file changed, 27 insertions(+), 17 deletions(-) commit 5b933c7262c5b0ea11ea3c3b3ea81add04895954 Author: Richard Fitzgerald Date: Tue Apr 12 17:39:27 2022 +0100 firmware: cs_dsp: Fix overrun of unterminated control name string For wmfw format v2 and later the coefficient name strings have a length field and are NOT null-terminated. Use kasprintf() to convert the unterminated string into a null-terminated string in an allocated buffer. The previous code handled this duplication incorrectly using kmemdup() and getting the length from a strlen() of the (unterminated) source string. This resulted in creating a string that continued up to the next byte in the firmware file that just happened to be 0x00. Signed-off-by: Richard Fitzgerald Fixes: f6bc909e7673 ("firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs") Link: https://lore.kernel.org/r/20220412163927.1303470-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown drivers/firmware/cirrus/cs_dsp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 625e8cb8e0e7b9eb6566c5a6e4fa95fb9dad9d4e Merge: ad8064a7f1a6 6c6f9f31ecd4 Author: Jakub Kicinski Date: Tue Apr 12 09:48:53 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Fix cgroupv2 from the input path, from Florian Westphal. 2) Fix incorrect return value of nft_parse_register(), from Antoine Tenart. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: nft_parse_register can return a negative value netfilter: nft_socket: make cgroup match work in input too ==================== Link: https://lore.kernel.org/r/20220412094246.448055-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit d2347b9695dafe5c388a5f9aeb70e27a7a4d29cf Author: Dylan Yudaken Date: Tue Apr 12 09:30:42 2022 -0700 io_uring: verify pad field is 0 in io_get_ext_arg Ensure that only 0 is passed for pad here. Fixes: c73ebb685fb6 ("io_uring: add timeout support for io_uring_enter()") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220412163042.2788062-5-dylany@fb.com Signed-off-by: Jens Axboe fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) commit 6fb53cf8ff2c4713247df523404d24f466b98f52 Author: Dylan Yudaken Date: Tue Apr 12 09:30:41 2022 -0700 io_uring: verify resv is 0 in ringfd register/unregister Only allow resv field to be 0 in struct io_uring_rsrc_update user arguments. Fixes: e7a6c00dc77a ("io_uring: add support for registering ring file descriptors") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220412163042.2788062-4-dylany@fb.com Signed-off-by: Jens Axboe fs/io_uring.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit d8a3ba9c143bf89c032deced8a686ffa53b46098 Author: Dylan Yudaken Date: Tue Apr 12 09:30:40 2022 -0700 io_uring: verify that resv2 is 0 in io_uring_rsrc_update2 Verify that the user does not pass in anything but 0 for this field. Fixes: 992da01aa932 ("io_uring: change registration/upd/rsrc tagging ABI") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220412163042.2788062-3-dylany@fb.com Signed-off-by: Jens Axboe fs/io_uring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 565c5e616e8061b40a2e1d786c418a7ac3503a8d Author: Dylan Yudaken Date: Tue Apr 12 09:30:39 2022 -0700 io_uring: move io_uring_rsrc_update2 validation Move validation to be more consistently straight after copy_from_user. This is already done in io_register_rsrc_update and so this removes that redundant check. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220412163042.2788062-2-dylany@fb.com Signed-off-by: Jens Axboe fs/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 317c2045618cc1f8d38beb8c93a7bdb6ad8638c6 Author: Allen-KH Cheng Date: Tue Apr 12 19:57:43 2022 +0800 spi: spi-mtk-nor: initialize spi controller after resume After system resumes, the registers of nor controller are initialized with default values. The nor controller will not function properly. To handle both issues above, we add mtk_nor_init() in mtk_nor_resume after pm_runtime_force_resume(). Fixes: 3bfd9103c7af ("spi: spi-mtk-nor: Add power management support") Signed-off-by: Allen-KH Cheng Reviewed-by: Rex-BC Chen Link: https://lore.kernel.org/r/20220412115743.22641-1-allen-kh.cheng@mediatek.com Signed-off-by: Mark Brown drivers/spi/spi-mtk-nor.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit f20ae5074dfb38f23b0c07c62bdf8e7254a0acf8 Author: Takashi Iwai Date: Tue Apr 12 12:26:36 2022 +0200 ALSA: nm256: Don't call card private_free at probe error path The card destructor of nm256 driver does merely stopping the running streams, and it's superfluous for the probe error handling. Moreover, calling this via the previous devres change would lead to another problem due to the reverse call order. This patch moves the setup of the private_free callback after the card registration, so that it can be used only after fully set up. Fixes: c19935f04784 ("ALSA: nm256: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-40-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/nm256/nm256.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4fb27190879b82e48ce89a56e9d6c04437dbc065 Author: Takashi Iwai Date: Tue Apr 12 12:26:35 2022 +0200 ALSA: mtpav: Don't call card private_free at probe error path The card destructor of nm256 driver does merely stopping the running timer, and it's superfluous for the probe error handling. Moreover, calling this via the previous devres change would lead to another problem due to the reverse call order. This patch moves the setup of the private_free callback after the card registration, so that it can be used only after fully set up. Fixes: aa92050f10f0 ("ALSA: mtpav: Allocate resources with device-managed APIs") Link: https://lore.kernel.org/r/20220412102636.16000-39-tiwai@suse.de Signed-off-by: Takashi Iwai sound/drivers/mtpav.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit b2aa4f80693b7841e5ac4eadbd2d8cec56b10a51 Author: Takashi Iwai Date: Tue Apr 12 12:26:34 2022 +0200 ALSA: rme9652: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() manually on the error from the probe callback. Fixes: b1002b2d41c5 ("ALSA: rme9652: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-38-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/rme9652/rme9652.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit eab521aebcdeb1c801009503e3a7f8989e3c6b36 Author: Takashi Iwai Date: Tue Apr 12 12:26:33 2022 +0200 ALSA: hdspm: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() manually on the error from the probe callback. Fixes: 0195ca5fd1f4 ("ALSA: hdspm: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-37-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/rme9652/hdspm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit e2263f0bf7443a200a5c1c418baefd92f1674600 Author: Takashi Iwai Date: Tue Apr 12 12:26:32 2022 +0200 ALSA: hdsp: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() manually on the error from the probe callback. Fixes: d136b8e54f92 ("ALSA: hdsp: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-36-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/rme9652/hdsp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 6ebc16e206aa82ddb0450c907865c55bcb7c0f43 Author: Takashi Iwai Date: Tue Apr 12 12:26:31 2022 +0200 ALSA: oxygen: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 596ae97ab0ce ("ALSA: oxygen: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-35-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/oxygen/oxygen_lib.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 60797a21dd8360a99ba797f8ca587087c07bb54c Author: Takashi Iwai Date: Tue Apr 12 12:26:30 2022 +0200 ALSA: lx6464es: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() manually on the error from the probe callback. Fixes: 6f16c19b115e ("ALSA: lx6464es: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-34-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/lx6464es/lx6464es.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit a59396b1c11823c69c31621198c04def17f3a869 Author: Takashi Iwai Date: Tue Apr 12 12:26:29 2022 +0200 ALSA: cmipci: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() manually on the error from the probe callback. Fixes: 87e082ad84a7 ("ALSA: cmipci: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-33-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/cmipci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit bf4067e8a19eae67c45659a956c361d59251ba57 Author: Takashi Iwai Date: Tue Apr 12 12:26:28 2022 +0200 ALSA: aw2: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() manually on the error from the probe callback. Fixes: 33631012cd06 ("ALSA: aw2: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-32-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/aw2/aw2-alsa.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit ab8bce9da6102c575c473c053672547589bc4c59 Author: Takashi Iwai Date: Tue Apr 12 12:26:27 2022 +0200 ALSA: als300: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() manually on the error from the probe callback. Fixes: 21a9314cf93b ("ALSA: als300: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-31-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/als300.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit d04e84b9817c652002f0ee9b42059d41493e9118 Author: Takashi Iwai Date: Tue Apr 12 12:26:26 2022 +0200 ALSA: lola: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 098fe3d6e775 ("ALSA: lola: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-30-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/lola/lola.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit f0438155273f057fec9818bc9d1b782ba35cf6a1 Author: Takashi Iwai Date: Tue Apr 12 12:26:25 2022 +0200 ALSA: bt87x: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 9e80ed64a006 ("ALSA: bt87x: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-29-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/bt87x.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 2236a3243ff8291e97c70097dd11a0fdb8904380 Author: Takashi Iwai Date: Tue Apr 12 12:26:24 2022 +0200 ALSA: sis7019: Fix the missing error handling The previous cleanup with devres forgot to replace the snd_card_free() call with the devm version. Moreover, it still needs the manual call of snd_card_free() at the probe error path, otherwise the reverse order of the releases may happen. This patch addresses those issues. Fixes: 499ddc16394c ("ALSA: sis7019: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-28-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/sis7019.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 5e154dfb4f9995096aa6d342df75040ae802c17e Author: Takashi Iwai Date: Tue Apr 12 12:26:23 2022 +0200 ALSA: intel_hdmi: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 854577ac2aea ("ALSA: x86: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-27-tiwai@suse.de Signed-off-by: Takashi Iwai sound/x86/intel_hdmi_audio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 27a0963f9cea5be3c68281f07fe82cdf712ef333 Author: Takashi Iwai Date: Tue Apr 12 12:26:22 2022 +0200 ALSA: via82xx: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: afaf99751d0c ("ALSA: via82xx: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-26-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/via82xx.c | 10 ++++++++-- sound/pci/via82xx_modem.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) commit b087a381d7386ec95803222d0d9b1ac499550713 Author: Takashi Iwai Date: Tue Apr 12 12:26:21 2022 +0200 ALSA: sonicvibes: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 2ca6cbde6ad7 ("ALSA: sonicvibes: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-25-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/sonicvibes.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 93b884f8d82f08c7af542703a724cc23cd2d5bfc Author: Takashi Iwai Date: Tue Apr 12 12:26:20 2022 +0200 ALSA: rme96: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: df06df7cc997 ("ALSA: rme96: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-24-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/rme96.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 55d2d046b23b9bcb907f6b3e38e52113d55085eb Author: Takashi Iwai Date: Tue Apr 12 12:26:19 2022 +0200 ALSA: rme32: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 102e6156ded2 ("ALSA: rme32: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-23-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/rme32.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 348f08de55b149e41a05111d1a713c4484e5a426 Author: Takashi Iwai Date: Tue Apr 12 12:26:18 2022 +0200 ALSA: riptide: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 546c201a891e ("ALSA: riptide: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-22-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/riptide/riptide.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit ae86bf5c2a8d81418eadf1c31dd9253b609e3093 Author: Takashi Iwai Date: Tue Apr 12 12:26:17 2022 +0200 ALSA: maestro3: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 5c0939253c3c ("ALSA: maestro3: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-21-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/maestro3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit c01b723a56ce18ae66ff18c5803942badc15fbcd Author: Takashi Iwai Date: Tue Apr 12 12:26:16 2022 +0200 ALSA: korg1212: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: b5cde369b618 ("ALSA: korg1212: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-20-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/korg1212/korg1212.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 71b21f5f8970a87f034138454ebeff0608d24875 Author: Takashi Iwai Date: Tue Apr 12 12:26:15 2022 +0200 ALSA: intel8x0: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 7835e0901e24 ("ALSA: intel8x0: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-19-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/intel8x0.c | 10 ++++++++-- sound/pci/intel8x0m.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) commit 4a850a0079ce601c0c4016f4edb7d618e811ed7d Author: Takashi Iwai Date: Tue Apr 12 12:26:14 2022 +0200 ALSA: ice1724: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 314f6dbb1f33 ("ALSA: ice1724: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-18-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/ice1712/ice1724.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 7f611274a3d1657a67b3fa8cd0cec1dee00e02b4 Author: Takashi Iwai Date: Tue Apr 12 12:26:13 2022 +0200 ALSA: fm801: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 47c413395376 ("ALSA: fm801: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-17-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/fm801.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit de9a01bc95a9e5e36d0659521bb04579053d8566 Author: Takashi Iwai Date: Tue Apr 12 12:26:12 2022 +0200 ALSA: es1968: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: a7b4cbfdc701 ("ALSA: es1968: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-16-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/es1968.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit bc22628591e5913e67edb3c2a89b97849e30a8f8 Author: Takashi Iwai Date: Tue Apr 12 12:26:11 2022 +0200 ALSA: es1938: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 08e9d3ab4cc1 ("ALSA: es1938: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-15-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/es1938.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit c2dc46932d117a1505f589ad1db3095aa6789058 Author: Takashi Iwai Date: Tue Apr 12 12:26:10 2022 +0200 ALSA: ens137x: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 10ed6eaf9d72 ("ALSA: ens137x: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-14-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/ens1370.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit f37019b6bfe2e13cc536af0e6a42ed62005392ae Author: Takashi Iwai Date: Tue Apr 12 12:26:09 2022 +0200 ALSA: emu10k1x: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 2b377c6b6012 ("ALSA: emu10k1x: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-13-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/emu10k1/emu10k1x.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 2a56314798e0227cf51e3d1d184a419dc07bc173 Author: Takashi Iwai Date: Tue Apr 12 12:26:08 2022 +0200 ALSA: cs5535audio: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). Fixes: 5eba4c646dfe ("ALSA: cs5535audio: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-12-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/cs5535audio/cs5535audio.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 9bf5ed9a4e623583f15202d99f4521bc39050f61 Author: Takashi Iwai Date: Tue Apr 12 12:26:07 2022 +0200 ALSA: cs4281: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 99041fea70d0 ("ALSA: cs4281: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-11-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/cs4281.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit c79442cc5a38e46597bc647128c8f1de62d80020 Author: Takashi Iwai Date: Tue Apr 12 12:26:06 2022 +0200 ALSA: ca0106: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 1656fa6ea258 ("ALSA: ca0106: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-10-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/ca0106/ca0106_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 49fe36e1c02cb06f66689c888e4e767c31cd259d Author: Takashi Iwai Date: Tue Apr 12 12:26:05 2022 +0200 ALSA: azt3328: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 8c5823ef31e1 ("ALSA: azt3328: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-9-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/azt3328.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit b093de145bc8769c6e9207947afad9efe102f4f6 Author: Takashi Iwai Date: Tue Apr 12 12:26:04 2022 +0200 ALSA: au88x0: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: e44b5b440609 ("ALSA: au88x0: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-8-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/au88x0/au88x0.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 48e8adde8d1c586c799dab123fc1ebc8b8db620f Author: Takashi Iwai Date: Tue Apr 12 12:26:03 2022 +0200 ALSA: atiixp: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 86bde74dbf09 ("ALSA: atiixp: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-7-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/atiixp.c | 10 ++++++++-- sound/pci/atiixp_modem.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) commit d616a0246da88d811f9f4c3aa83003c05efd3af0 Author: Takashi Iwai Date: Tue Apr 12 12:26:02 2022 +0200 ALSA: als4000: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 0e175f665960 ("ALSA: als4000: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-6-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/als4000.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 19401a9441236cfbbbeb1bef4ef4c8668db45dfc Author: Takashi Iwai Date: Tue Apr 12 12:26:01 2022 +0200 ALSA: ali5451: Fix the missing snd_card_free() call at probe error The recent cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 1f0819979248 ("ALSA: ali5451: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-5-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/ali5451/ali5451.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit a8e84a5da18e6d786540aa4ceb6f969d5f1a441d Author: Takashi Iwai Date: Tue Apr 12 12:26:00 2022 +0200 ALSA: ad1889: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 567f58754109 ("ALSA: ad1889: Allocate resources with device-managed APIs") Link: https://lore.kernel.org/r/20220412102636.16000-4-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/ad1889.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit d72458071150b802940204950d0d462ea3c913b1 Author: Takashi Iwai Date: Tue Apr 12 12:25:59 2022 +0200 ALSA: sc6000: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 111601ff76e9 ("ALSA: sc6000: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-3-tiwai@suse.de Signed-off-by: Takashi Iwai sound/isa/sc6000.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 10b1881a97be240126891cb384bd3bc1869f52d8 Author: Takashi Iwai Date: Tue Apr 12 12:25:58 2022 +0200 ALSA: galaxy: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 35a245ec0619 ("ALSA: galaxy: Allocate resources with device-managed APIs") Cc: Link: https://lore.kernel.org/r/20220412102636.16000-2-tiwai@suse.de Signed-off-by: Takashi Iwai sound/isa/galaxy/galaxy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 0f8da75b51ac863b9435368bd50691718cc454b0 Author: Pavel Begunkov Date: Tue Apr 12 15:24:43 2022 +0100 io_uring: fix assign file locking issue io-wq work cancellation path can't take uring_lock as how it's done on file assignment, we have to handle IO_WQ_WORK_CANCEL first, this fixes encountered hangs. Fixes: 6bf9c47a3989 ("io_uring: defer file assignment") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0d9b9f37841645518503f6a207e509d14a286aba.1649773463.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 290c4a902b79246ec55e477fc313f27f98393dee Author: Bob Pearson Date: Sun Apr 10 22:06:48 2022 -0500 RDMA/rxe: Fix "Replace mr by rkey in responder resources" The referenced commit generates a reference counting error if the rkey has the same index but the wrong key. In this case the reference taken by rxe_pool_get_index() is not dropped. Drop the reference if the keys don't match in rxe_recheck_mr(). Check that the mw and mr are still valid. Fixes: 8a1a0be894da ("RDMA/rxe: Replace mr by rkey in responder resources") Link: https://lore.kernel.org/r/20220411030647.20011-1-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_resp.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) commit 8fc5133d6d4da65cad6b73152fc714ad3d7f91c1 Author: Herve Codina Date: Fri Feb 25 13:02:52 2022 +0100 dmaengine: dw-edma: Fix unaligned 64bit access On some arch (ie aarch64 iMX8MM) unaligned PCIe accesses are not allowed and lead to a kernel Oops. [ 1911.668835] Unable to handle kernel paging request at virtual address ffff80001bc00a8c [ 1911.668841] Mem abort info: [ 1911.668844] ESR = 0x96000061 [ 1911.668847] EC = 0x25: DABT (current EL), IL = 32 bits [ 1911.668850] SET = 0, FnV = 0 [ 1911.668852] EA = 0, S1PTW = 0 [ 1911.668853] Data abort info: [ 1911.668855] ISV = 0, ISS = 0x00000061 [ 1911.668857] CM = 0, WnR = 1 [ 1911.668861] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000040ff4000 [ 1911.668864] [ffff80001bc00a8c] pgd=00000000bffff003, pud=00000000bfffe003, pmd=0068000018400705 [ 1911.668872] Internal error: Oops: 96000061 [#1] PREEMPT SMP ... The llp register present in the channel group registers is not aligned on 64bit. Fix unaligned 64bit access using two 32bit accesses Fixes: 04e0a39fc10f ("dmaengine: dw-edma: Add writeq() and readq() for 64 bits architectures") Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20220225120252.309404-1-herve.codina@bootlin.com Signed-off-by: Vinod Koul drivers/dma/dw-edma/dw-edma-v0-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 545b2baac89b859180e51215468c05d85ea8465a Author: zhangqilong Date: Sat Mar 19 10:21:42 2022 +0800 dmaengine: mediatek:Fix PM usage reference leak of mtk_uart_apdma_alloc_chan_resources pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it: 1) Replacing it with pm_runtime_resume_and_get to keep usage counter balanced. 2) Add putting operation before returning error. Fixes:9135408c3ace4 ("dmaengine: mediatek: Add MediaTek UART APDMA support") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220319022142.142709-1-zhangqilong3@huawei.com Signed-off-by: Vinod Koul drivers/dma/mediatek/mtk-uart-apdma.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit c68c63429319a923a3f23db64810ba608f5d20f7 Author: Sven Schnelle Date: Fri Apr 8 16:21:43 2022 +0200 s390: enable CONFIG_HARDENED_USERCOPY in debug_defconfig Signed-off-by: Sven Schnelle Signed-off-by: Heiko Carstens arch/s390/configs/debug_defconfig | 1 + 1 file changed, 1 insertion(+) commit 30de14b1884ba609fc1acfba5b40309e3a6ccefe Author: Sven Schnelle Date: Fri Apr 8 14:51:26 2022 +0200 s390: current_stack_pointer shouldn't be a function s390 defines current_stack_pointer as function while all other architectures use 'register unsigned long asm(""). This make codes like the following from check_stack_object() fail: if (IS_ENABLED(CONFIG_STACK_GROWSUP)) { if ((void *)current_stack_pointer < obj + len) return BAD_STACK; } else { if (obj < (void *)current_stack_pointer) return BAD_STACK; } because this would compare the address of current_stack_pointer() and not the stackpointer value. Reported-by: Karsten Graul Fixes: 2792d84e6da5 ("usercopy: Check valid lifetime via stack depth") Cc: Kees Cook Cc: Vasily Gorbik Cc: Alexander Gordeev Signed-off-by: Sven Schnelle Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens arch/s390/include/asm/entry-common.h | 2 +- arch/s390/include/asm/processor.h | 8 +------- arch/s390/include/asm/stacktrace.h | 2 +- arch/s390/lib/test_unwind.c | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) commit 8d2453d9a307c2eafd21242dd73f35f05fb7ce74 Author: Tony Lindgren Date: Tue Apr 12 12:26:51 2022 +0300 ARM: dts: dra7: Fix suspend warning for vpe powerdomain We currently are getting the following warning after a system suspend: Powerdomain (vpe_pwrdm) didn't enter target state 0 Looks like this is because the STANDBYMODE bit for SMART_IDLE should not be used. The TRM "Table 12-348. VPE_SYSCONFIG" says that the value for SMART_IDLE is "0x2: Same behavior as bit-field value of 0x1". But if the SMART_IDLE value is used, PM_VPE_PWRSTST LASTPOWERSTATEENTERED bits always show value of 3. Let's fix the issue by dropping SMART_IDLE for vpe. And let's also add the missing the powerdomain for vpe. Fixes: 1a2095160594 ("ARM: dts: dra7: Add ti-sysc node for VPE") Cc: Benoit Parrot Reported-by: Kevin Hilman Reviewed-by: Kevin Hilman Tested-by: Kevin Hilman Signed-off-by: Tony Lindgren arch/arm/boot/dts/dra7-l4.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a12315d6d27093392b6c634e1d35a59f1d1f7a59 Author: Tony Lindgren Date: Tue Apr 12 12:26:51 2022 +0300 bus: ti-sysc: Make omap3 gpt12 quirk handling SoC specific On beagleboard revisions A to B4 we need to use gpt12 as the system timer. However, the quirk handling added for gpt12 caused a regression for system suspend for am335x as the PM coprocessor needs the timers idled for suspend. Let's make the gpt12 quirk specific to omap34xx, other SoCs don't need it. Beagleboard revisions C and later no longer need to use the gpt12 related quirk. Then at some point, if we decide to drop support for the old beagleboard revisions A to B4, we can also drop the gpt12 related quirks completely. Fixes: 3ff340e24c9d ("bus: ti-sysc: Fix gpt12 system timer issue with reserved status") Reported-by: Kevin Hilman Suggested-by: Kevin Hilman Signed-off-by: Tony Lindgren drivers/bus/ti-sysc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) commit 0f83e6b4161617014017a694888dd8743f46f071 Author: Miaoqian Lin Date: Wed Mar 9 10:43:01 2022 +0000 ARM: OMAP2+: Fix refcount leak in omap_gic_of_init The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Fixes: fd1c07861491 ("ARM: OMAP4: Fix the init code to have OMAP4460 errata available in DT build") Signed-off-by: Miaoqian Lin Message-Id: <20220309104302.18398-1-linmq006@gmail.com> Signed-off-by: Tony Lindgren arch/arm/mach-omap2/omap4-common.c | 2 ++ 1 file changed, 2 insertions(+) commit 313c7e57035125cb7533b53ddd0bc7aa562b433c Author: Takashi Iwai Date: Tue Apr 12 11:31:41 2022 +0200 ALSA: echoaudio: Fix the missing snd_card_free() call at probe error The previous cleanup with devres may lead to the incorrect release orders at the probe error handling due to the devres's nature. Until we register the card, snd_card_free() has to be called at first for releasing the stuff properly when the driver tries to manage and release the stuff via card->private_free(). This patch fixes it by calling snd_card_free() on the error from the probe callback using a new helper function. Fixes: 9c211bf392bb ("ALSA: echoaudio: Allocate resources with device-managed APIs") Reported-and-tested-by: Zheyu Ma Cc: Link: https://lore.kernel.org/r/CAMhUBjm2AdyEZ_-EgexdNDN7SvY4f89=4=FwAL+c0Mg0O+X50A@mail.gmail.com Link: https://lore.kernel.org/r/20220412093141.8008-3-tiwai@suse.de Signed-off-by: Takashi Iwai sound/pci/echoaudio/echoaudio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit fee2b871d8d6389c9b4bdf9346a99ccc1c98c9b8 Author: Takashi Iwai Date: Tue Apr 12 11:31:40 2022 +0200 ALSA: core: Add snd_card_free_on_error() helper This is a small helper function to handle the error path more easily when an error happens during the probe for the device with the device-managed card. Since devres releases in the reverser order of the creations, usually snd_card_free() gets called at the last in the probe error path unless it already reached snd_card_register() calls. Due to this nature, when a driver expects the resource releases in card->private_free, this might be called too lately. As a workaround, one should call the probe like: static int __some_probe(...) { // do real probe.... } static int some_probe(...) { return snd_card_free_on_error(dev, __some_probe(dev, ...)); } so that the snd_card_free() is called explicitly at the beginning of the error path from the probe. This function will be used in the upcoming fixes to address the regressions by devres usages. Fixes: e8ad415b7a55 ("ALSA: core: Add managed card creation") Cc: Link: https://lore.kernel.org/r/20220412093141.8008-2-tiwai@suse.de Signed-off-by: Takashi Iwai include/sound/core.h | 1 + sound/core/init.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) commit 6c6f9f31ecd47dce1d0dafca4bec8805f9bc97cd Author: Antoine Tenart Date: Tue Apr 12 10:14:59 2022 +0200 netfilter: nf_tables: nft_parse_register can return a negative value Since commit 6e1acfa387b9 ("netfilter: nf_tables: validate registers coming from userspace.") nft_parse_register can return a negative value, but the function prototype is still returning an unsigned int. Fixes: 6e1acfa387b9 ("netfilter: nf_tables: validate registers coming from userspace.") Signed-off-by: Antoine Tenart Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c40b65304c361432b841bdbd5b1c8dfa918d6baa Author: Geert Uytterhoeven Date: Mon Apr 11 14:58:01 2022 +0200 video: fbdev: sh_mobile_lcdcfb: Remove sh_mobile_lcdc_check_var() declaration As of commit 0fe66f327c464943 ("fbdev/sh_mobile: remove sh_mobile_lcdc_display_notify"), there is no longer a need for a foward declaration of sh_mobile_lcdc_check_var(). Signed-off-by: Geert Uytterhoeven Signed-off-by: Helge Deller drivers/video/fbdev/sh_mobile_lcdcfb.c | 3 --- 1 file changed, 3 deletions(-) commit 7281a59ce3a584ed7379bbdcd06a2008c47c3e5c Merge: ce522ba9ef7e 753ee989f7cf Author: Linus Torvalds Date: Mon Apr 11 19:51:23 2022 -1000 Merge tag 'platform-drivers-x86-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform drivers fixes from Hans de Goede: - Documentation and compilation warning fixes - Kconfig dep fixes - Misc small code cleanups * tag 'platform-drivers-x86-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: amd-pmc: Fix compilation without CONFIG_SUSPEND platform/x86: acerhdf: Cleanup str_starts_with() Documentation/ABI: sysfs-class-firmware-attributes: Misc. cleanups Documentation/ABI: sysfs-class-firmware-attributes: Fix Sphinx errors Documentation/ABI: sysfs-driver-intel_sdsi: Fix sphinx warnings platform/x86: barco-p50-gpio: Fix duplicate included linux/io.h platform/x86: samsung-laptop: Fix an unsigned comparison which can never be negative platform/x86: think-lmi: certificate support clean ups commit ad8064a7f1a67c3e47b37ffcb66abb12c931daa4 Merge: 8467dda0c265 269219321eb7 Author: Jakub Kicinski Date: Mon Apr 11 20:47:18 2022 -0700 Merge branch 'net-lan966x-lan966x-fixes' Horatiu Vultur says: ==================== net: lan966x: lan966x fixes This contains different fixes for lan966x in different areas like PTP, MAC, Switchdev and IGMP processing. ==================== Link: https://lore.kernel.org/r/20220409184143.1204786-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski commit 269219321eb7d7645a3122cf40a420c5dc655eb9 Author: Horatiu Vultur Date: Sat Apr 9 20:41:43 2022 +0200 net: lan966x: Stop processing the MAC entry is port is wrong. Currently when getting a new MAC is learn, the HW generates an interrupt. So then the SW will check the new entry and checks if it arrived on a correct port. If it didn't just generate a warning. But this could still crash the system. Therefore stop processing that entry when an issue is seen. Fixes: 5ccd66e01cbef8 ("net: lan966x: add support for interrupts from analyzer") Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski drivers/net/ethernet/microchip/lan966x/lan966x_mac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit d7a947d289dc205fc717c004dcebe33b15305afd Author: Horatiu Vultur Date: Sat Apr 9 20:41:42 2022 +0200 net: lan966x: Fix when a port's upper is changed. On lan966x it is not allowed to have foreign interfaces under a bridge which already contains lan966x ports. So when a port leaves the bridge it would call switchdev_bridge_port_unoffload which eventually will notify the other ports that bridge left the vlan group but that is not true because the bridge is still part of the vlan group. Therefore when a port leaves the bridge, stop generating replays because already the HW cleared after itself and the other ports don't need to do anything else. Fixes: cf2f60897e921e ("net: lan966x: Add support to offload the forwarding.") Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski drivers/net/ethernet/microchip/lan966x/lan966x_switchdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 6476f90aefaf119c47ceccde52327464e813fe26 Author: Horatiu Vultur Date: Sat Apr 9 20:41:41 2022 +0200 net: lan966x: Fix IGMP snooping when frames have vlan tag In case an IGMP frame has a vlan tag, then the function lan966x_hw_offload couldn't figure out that is a IGMP frame. Therefore the SW thinks that the frame was already forward by the HW which is not true. Extend lan966x_hw_offload to pop the vlan tag if are any and then check for IGMP frames. Fixes: 47aeea0d57e80c ("net: lan966x: Implement the callback SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED ") Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 ++++++ 1 file changed, 6 insertions(+) commit eb9c0d671e9432901b8a453e7915416f22f7f919 Author: Horatiu Vultur Date: Sat Apr 9 20:41:40 2022 +0200 net: lan966x: Update lan966x_ptp_get_nominal_value The clk_per_cfg register represents the value added to the system clock for each clock cycle. The issue is that the default value is wrong, meaning that in case the DUT was a grandmaster then everone in the network was too slow. In case there was a grandmaster, then there is no issue because the DUT will configure clk_per_cfg register based on the master frequency. Fixes: d096459494a887 ("net: lan966x: Add support for ptp clocks") Signed-off-by: Horatiu Vultur Signed-off-by: Jakub Kicinski drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 8467dda0c26583547731e7f3ea73fc3856bae3bf Author: Petr Malat Date: Sat Apr 9 08:36:11 2022 +0200 sctp: Initialize daddr on peeled off socket Function sctp_do_peeloff() wrongly initializes daddr of the original socket instead of the peeled off socket, which makes getpeername() return zeroes instead of the primary address. Initialize the new socket instead. Fixes: d570ee490fb1 ("[SCTP]: Correctly set daddr for IPv6 sockets during peeloff") Signed-off-by: Petr Malat Acked-by: Marcelo Ricardo Leitner Link: https://lore.kernel.org/r/20220409063611.673193-1-oss@malat.biz Signed-off-by: Jakub Kicinski net/sctp/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 70a3baeec4e89736be932a60d682d7ae27556f5c Author: Mike Christie Date: Thu Apr 7 19:13:14 2022 -0500 scsi: iscsi: MAINTAINERS: Add Mike Christie as co-maintainer I've been doing a lot of iscsi patches because Oracle is paying me to work on iSCSI again. It was supposed to be temp assignment, but my co-worker that was working on iscsi moved to a new group so it looks like I'm back on this code again. After talking to Chris and Lee this patch adds me back as co-maintainer, so I can help them and people remember to cc me on issues. Link: https://lore.kernel.org/r/20220408001314.5014-11-michael.christie@oracle.com Tested-by: Manish Rangankar Acked-by: Lee Duncan Acked-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit 857b06527f707f5df634b854898a191b5c1d0272 Author: Mike Christie Date: Thu Apr 7 19:13:13 2022 -0500 scsi: qedi: Fix failed disconnect handling We set the qedi_ep state to EP_STATE_OFLDCONN_START when the ep is created. Then in qedi_set_path we kick off the offload work. If userspace times out the connection and calls ep_disconnect, qedi will only flush the offload work if the qedi_ep state has transitioned away from EP_STATE_OFLDCONN_START. If we can't connect we will not have transitioned state and will leave the offload work running, and we will free the qedi_ep from under it. This patch just has us init the work when we create the ep, then always flush it. Link: https://lore.kernel.org/r/20220408001314.5014-10-michael.christie@oracle.com Tested-by: Manish Rangankar Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Acked-by: Manish Rangankar Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/qedi/qedi_iscsi.c | 69 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 35 deletions(-) commit 44ac97109e42f87b1a34954704b81b6c8eca80c4 Author: Mike Christie Date: Thu Apr 7 19:13:12 2022 -0500 scsi: iscsi: Fix NOP handling during conn recovery If a offload driver doesn't use the xmit workqueue, then when we are doing ep_disconnect libiscsi can still inject PDUs to the driver. This adds a check for if the connection is bound before trying to inject PDUs. Link: https://lore.kernel.org/r/20220408001314.5014-9-michael.christie@oracle.com Tested-by: Manish Rangankar Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/libiscsi.c | 7 ++++++- include/scsi/libiscsi.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) commit 5bd856256f8c03e329f8ff36d8c8efcb111fe6df Author: Mike Christie Date: Thu Apr 7 19:13:11 2022 -0500 scsi: iscsi: Merge suspend fields Move the tx and rx suspend fields into one flags field. Link: https://lore.kernel.org/r/20220408001314.5014-8-michael.christie@oracle.com Tested-by: Manish Rangankar Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/bnx2i/bnx2i_hwi.c | 2 +- drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 +- drivers/scsi/cxgbi/libcxgbi.c | 6 +++--- drivers/scsi/libiscsi.c | 20 ++++++++++---------- drivers/scsi/libiscsi_tcp.c | 2 +- include/scsi/libiscsi.h | 9 +++++---- 6 files changed, 21 insertions(+), 20 deletions(-) commit 03690d81974535f228e892a14f0d2d44404fe555 Author: Mike Christie Date: Thu Apr 7 19:13:10 2022 -0500 scsi: iscsi: Fix unbound endpoint error handling If a driver raises a connection error before the connection is bound, we can leave a cleanup_work queued that can later run and disconnect/stop a connection that is logged in. The problem is that drivers can call iscsi_conn_error_event for endpoints that are connected but not yet bound when something like the network port they are using is brought down. iscsi_cleanup_conn_work_fn will check for this and exit early, but if the cleanup_work is stuck behind other works, it might not get run until after userspace has done ep_disconnect. Because the endpoint is not yet bound there was no way for ep_disconnect to flush the work. The bug of leaving stop_conns queued was added in: Commit 23d6fefbb3f6 ("scsi: iscsi: Fix in-kernel conn failure handling") and: Commit 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") was supposed to fix it, but left this case. This patch moves the conn state check to before we even queue the work so we can avoid queueing. Link: https://lore.kernel.org/r/20220408001314.5014-7-michael.christie@oracle.com Fixes: 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") Tested-by: Manish Rangankar Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 65 ++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 29 deletions(-) commit 7c6e99c18167ed89729bf167ccb4a7e3ab3115ba Author: Mike Christie Date: Thu Apr 7 19:13:09 2022 -0500 scsi: iscsi: Fix conn cleanup and stop race during iscsid restart If iscsid is doing a stop_conn at the same time the kernel is starting error recovery we can hit a race that allows the cleanup work to run on a valid connection. In the race, iscsi_if_stop_conn sees the cleanup bit set, but it calls flush_work on the clean_work before iscsi_conn_error_event has queued it. The flush then returns before the queueing and so the cleanup_work can run later and disconnect/stop a conn while it's in a connected state. The patch: Commit 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") added the late stop_conn call bug originally, and the patch: Commit 23d6fefbb3f6 ("scsi: iscsi: Fix in-kernel conn failure handling") attempted to fix it but only fixed the normal EH case and left the above race for the iscsid restart case. For the normal EH case we don't hit the race because we only signal userspace to start recovery after we have done the queueing, so the flush will always catch the queued work or see it completed. For iscsid restart cases like boot, we can hit the race because iscsid will call down to the kernel before the kernel has signaled any error, so both code paths can be running at the same time. This adds a lock around the setting of the cleanup bit and queueing so they happen together. Link: https://lore.kernel.org/r/20220408001314.5014-6-michael.christie@oracle.com Fixes: 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") Tested-by: Manish Rangankar Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 17 +++++++++++++++++ include/scsi/scsi_transport_iscsi.h | 2 ++ 2 files changed, 19 insertions(+) commit 0aadafb5c34403a7cced1a8d61877048dc059f70 Author: Mike Christie Date: Thu Apr 7 19:13:08 2022 -0500 scsi: iscsi: Fix endpoint reuse regression This patch fixes a bug where when using iSCSI offload we can free an endpoint while userspace still thinks it's active. That then causes the endpoint ID to be reused for a new connection's endpoint while userspace still thinks the ID is for the original connection. Userspace will then end up disconnecting a running connection's endpoint or trying to bind to another connection's endpoint. This bug is a regression added in: Commit 23d6fefbb3f6 ("scsi: iscsi: Fix in-kernel conn failure handling") where we added a in kernel ep_disconnect call to fix a bug in: Commit 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") where we would call stop_conn without having done ep_disconnect. This early ep_disconnect call will then free the endpoint and it's ID while userspace still thinks the ID is valid. Fix the early release of the ID by having the in kernel recovery code keep a reference to the endpoint until userspace has called into the kernel to finish cleaning up the endpoint/connection. It requires the previous commit "scsi: iscsi: Release endpoint ID when its freed" which moved the freeing of the ID until when the endpoint is released. Link: https://lore.kernel.org/r/20220408001314.5014-5-michael.christie@oracle.com Fixes: 23d6fefbb3f6 ("scsi: iscsi: Fix in-kernel conn failure handling") Tested-by: Manish Rangankar Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 3c6ae371b8a1ffba1fc415989fd581ebf841ed0a Author: Mike Christie Date: Thu Apr 7 19:13:07 2022 -0500 scsi: iscsi: Release endpoint ID when its freed We can't release the endpoint ID until all references to the endpoint have been dropped or it could be allocated while in use. This has us use an idr instead of looping over all conns to find a free ID and then free the ID when all references have been dropped instead of when the device is only deleted. Link: https://lore.kernel.org/r/20220408001314.5014-4-michael.christie@oracle.com Tested-by: Manish Rangankar Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Reviewed-by: Wu Bo Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 71 ++++++++++++++++++------------------- include/scsi/scsi_transport_iscsi.h | 2 +- 2 files changed, 36 insertions(+), 37 deletions(-) commit cbd2283aaf47fef4ded4b29124b1ef3beb515f3a Author: Mike Christie Date: Thu Apr 7 19:13:06 2022 -0500 scsi: iscsi: Fix offload conn cleanup when iscsid restarts When userspace restarts during boot or upgrades it won't know about the offload driver's endpoint and connection mappings. iscsid will start by cleaning up the old session by doing a stop_conn call. Later, if we are able to create a new connection, we clean up the old endpoint during the binding stage. The problem is that if we do stop_conn before doing the ep_disconnect call offload, drivers can still be executing I/O. We then might free tasks from the under the card/driver. This moves the ep_disconnect call to before we do the stop_conn call for this case. It will then work and look like a normal recovery/cleanup procedure from the driver's point of view. Link: https://lore.kernel.org/r/20220408001314.5014-3-michael.christie@oracle.com Tested-by: Manish Rangankar Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 48 +++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 20 deletions(-) commit c34f95e98d8fb750eefd4f3fe58b4f8b5e89253b Author: Mike Christie Date: Thu Apr 7 19:13:05 2022 -0500 scsi: iscsi: Move iscsi_ep_disconnect() This patch moves iscsi_ep_disconnect() so it can be called earlier in the next patch. Link: https://lore.kernel.org/r/20220408001314.5014-2-michael.christie@oracle.com Tested-by: Manish Rangankar Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) commit bcd8a45223470e00b5f254018174d64a75db4bbe Author: Ajish Koshy Date: Mon Apr 11 12:16:03 2022 +0530 scsi: pm80xx: Enable upper inbound, outbound queues Executing driver on servers with more than 32 CPUs were faced with command timeouts. This is because we were not geting completions for commands submitted on IQ32 - IQ63. Set E64Q bit to enable upper inbound and outbound queues 32 to 63 in the MPI main configuration table. Added 500ms delay after successful MPI initialization as mentioned in controller datasheet. Link: https://lore.kernel.org/r/20220411064603.668448-3-Ajish.Koshy@microchip.com Fixes: 05c6c029a44d ("scsi: pm80xx: Increase number of supported queues") Reviewed-by: Damien Le Moal Acked-by: Jack Wang Signed-off-by: Ajish Koshy Signed-off-by: Viswas G Signed-off-by: Martin K. Petersen drivers/scsi/pm8001/pm80xx_hwi.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit 294080eacf92a0781e6d43663448a55001ec8c64 Author: Ajish Koshy Date: Mon Apr 11 12:16:02 2022 +0530 scsi: pm80xx: Mask and unmask upper interrupt vectors 32-63 When upper inbound and outbound queues 32-63 are enabled, we see upper vectors 32-63 in interrupt service routine. We need corresponding registers to handle masking and unmasking of these upper interrupts. To achieve this, we use registers MSGU_ODMR_U(0x34) to mask and MSGU_ODMR_CLR_U(0x3C) to unmask the interrupts. In these registers bit 0-31 represents interrupt vectors 32-63. Link: https://lore.kernel.org/r/20220411064603.668448-2-Ajish.Koshy@microchip.com Fixes: 05c6c029a44d ("scsi: pm80xx: Increase number of supported queues") Reviewed-by: John Garry Acked-by: Jack Wang Signed-off-by: Ajish Koshy Signed-off-by: Viswas G Signed-off-by: Martin K. Petersen drivers/scsi/pm8001/pm80xx_hwi.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) commit f19fe8f354a6e7c2b9588f83af4876e34f0ce83e Author: Bart Van Assche Date: Fri Apr 8 21:37:03 2022 -0700 Revert "scsi: scsi_debug: Address races following module load" Revert the patch mentioned in the subject since it blocks I/O after module unload has started while this is a legitimate use case. For e.g. blktests test case srp/001 that patch causes a command timeout to be triggered for the following call stack: __schedule+0x4c3/0xd20 schedule+0x82/0x110 schedule_timeout+0x122/0x200 io_schedule_timeout+0x7b/0xc0 __wait_for_common+0x2bc/0x380 wait_for_completion_io_timeout+0x1d/0x20 blk_execute_rq+0x1db/0x200 __scsi_execute+0x1fb/0x310 sd_sync_cache+0x155/0x2c0 [sd_mod] sd_shutdown+0xbb/0x190 [sd_mod] sd_remove+0x5b/0x80 [sd_mod] device_remove+0x9a/0xb0 device_release_driver_internal+0x2c5/0x360 device_release_driver+0x12/0x20 bus_remove_device+0x1aa/0x270 device_del+0x2d4/0x640 __scsi_remove_device+0x168/0x1a0 scsi_forget_host+0xa8/0xb0 scsi_remove_host+0x9b/0x150 sdebug_driver_remove+0x3d/0x140 [scsi_debug] device_remove+0x6f/0xb0 device_release_driver_internal+0x2c5/0x360 device_release_driver+0x12/0x20 bus_remove_device+0x1aa/0x270 device_del+0x2d4/0x640 device_unregister+0x18/0x70 sdebug_do_remove_host+0x138/0x180 [scsi_debug] scsi_debug_exit+0x45/0xd5 [scsi_debug] __do_sys_delete_module.constprop.0+0x210/0x320 __x64_sys_delete_module+0x1f/0x30 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Link: https://lore.kernel.org/r/20220409043704.28573-1-bvanassche@acm.org Fixes: 2aad3cd85370 ("scsi: scsi_debug: Address races following module load") Cc: Douglas Gilbert Cc: Yi Zhang Cc: Bob Pearson Reported-by: Yi Zhang Tested-by: Yi Zhang Acked-by: Douglas Gilbert Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen drivers/scsi/scsi_debug.c | 197 ++++++++++++---------------------------------- 1 file changed, 51 insertions(+), 146 deletions(-) commit 390d645877ffd6dcb55f162d618045b2779217b3 Author: Nathan Chancellor Date: Mon Apr 11 11:12:50 2022 -0700 drm/msm/gpu: Avoid -Wunused-function with !CONFIG_PM_SLEEP When building with CONFIG_PM=y and CONFIG_PM_SLEEP=n (such as ARCH=riscv allmodconfig), the following warnings/errors occur: drivers/gpu/drm/msm/adreno/adreno_device.c:679:12: error: 'adreno_system_resume' defined but not used [-Werror=unused-function] 679 | static int adreno_system_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/msm/adreno/adreno_device.c:655:12: error: 'adreno_system_suspend' defined but not used [-Werror=unused-function] 655 | static int adreno_system_suspend(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors These functions are only used in SET_SYSTEM_SLEEP_PM_OPS(), which evaluates to empty when CONFIG_PM_SLEEP is not set, making these functions unused. To resolve this, use the SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS() macros, which were introduced in commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones"). They are designed to avoid these compiler warnings while still guarding their use on CONFIG_PM{,_SLEEP}=y. Fixes: 7e4167c9e021 ("drm/msm/gpu: Park scheduler threads for system suspend") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220411181249.2758344-1-nathan@kernel.org Signed-off-by: Rob Clark drivers/gpu/drm/msm/adreno/adreno_device.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 65745da171e685b47725bfee138580ad8bf09d8f Merge: d6d9fc1d37f9 7d59706dbef8 Author: Jakub Kicinski Date: Mon Apr 11 18:34:43 2022 -0700 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-04-08 Alexander fixes a use after free issue with aRFS for ice driver. Mateusz reverts a commit that introduced issues related to device resets for iavf driver. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: Revert "iavf: Fix deadlock occurrence during resetting VF interface" ice: arfs: fix use-after-free when freeing @rx_cpu_rmap ==================== Link: https://lore.kernel.org/r/20220408163411.2415552-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit d6d9fc1d37f9bb911ba7013d7628a03bb4cb2561 Merge: 5ad7f18cd82c 49b7d376abe5 Author: Jakub Kicinski Date: Mon Apr 11 18:28:07 2022 -0700 Merge branch 'net-smc-fixes-2022-04-08' Karsten Graul says: ==================== net/smc: fixes 2022-04-08 Patch 1 fixes two usages of snprintf() with non null-terminated string which results into an out-of-bounds read. Pach 2 fixes a syzbot finding where a pointer check was missed before the call to dev_name(). Patch 3 fixes a crash when already released memory is used as a function pointer. ==================== Link: https://lore.kernel.org/r/20220408151035.1044701-1-kgraul@linux.ibm.com Signed-off-by: Jakub Kicinski commit 49b7d376abe54a49e8bd5e64824032b7c97c62d4 Author: Karsten Graul Date: Fri Apr 8 17:10:35 2022 +0200 net/smc: Fix af_ops of child socket pointing to released memory Child sockets may inherit the af_ops from the parent listen socket. When the listen socket is released then the af_ops of the child socket points to released memory. Solve that by restoring the original af_ops for child sockets which inherited the parent af_ops. And clear any inherited user_data of the parent socket. Fixes: 8270d9c21041 ("net/smc: Limit backlog connections") Reviewed-by: Wenjia Zhang Signed-off-by: Karsten Graul Reviewed-by: D. Wythe Signed-off-by: Jakub Kicinski net/smc/af_smc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) commit d22f4f977236f97e01255a80bca2ea93a8094fc8 Author: Karsten Graul Date: Fri Apr 8 17:10:34 2022 +0200 net/smc: Fix NULL pointer dereference in smc_pnet_find_ib() dev_name() was called with dev.parent as argument but without to NULL-check it before. Solve this by checking the pointer before the call to dev_name(). Fixes: af5f60c7e3d5 ("net/smc: allow PCI IDs as ib device names in the pnet table") Reported-by: syzbot+03e3e228510223dabd34@syzkaller.appspotmail.com Signed-off-by: Karsten Graul Signed-off-by: Jakub Kicinski net/smc/smc_pnet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit b1871fd48efc567650dbdc974e5a2342a03fe0d2 Author: Karsten Graul Date: Fri Apr 8 17:10:33 2022 +0200 net/smc: use memcpy instead of snprintf to avoid out of bounds read Using snprintf() to convert not null-terminated strings to null terminated strings may cause out of bounds read in the source string. Therefore use memcpy() and terminate the target string with a null afterwards. Fixes: fa0866625543 ("net/smc: add support for user defined EIDs") Fixes: 3c572145c24e ("net/smc: add generic netlink support for system EID") Signed-off-by: Karsten Graul Signed-off-by: Jakub Kicinski net/smc/smc_clc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 868e6139c5212e7d9de8332806aacfeafb349320 Author: Keith Busch Date: Sun Mar 27 11:33:16 2022 -0600 block: move lower_48_bits() to block The function is not generally applicable enough to be included in the core kernel header. Move it to block since it's the only subsystem using it. Suggested-by: Linus Torvalds Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20220327173316.315-1-kbusch@kernel.org Signed-off-by: Jens Axboe include/linux/kernel.h | 9 --------- include/linux/t10-pi.h | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) commit 5ad7f18cd82cee8e773d40cc7a1465a526f2615c Author: Tomas Melin Date: Thu Apr 7 19:16:59 2022 +0300 net: macb: Restart tx only if queue pointer is lagging commit 4298388574da ("net: macb: restart tx after tx used bit read") added support for restarting transmission. Restarting tx does not work in case controller asserts TXUBR interrupt and TQBP is already at the end of the tx queue. In that situation, restarting tx will immediately cause assertion of another TXUBR interrupt. The driver will end up in an infinite interrupt loop which it cannot break out of. For cases where TQBP is at the end of the tx queue, instead only clear TX_USED interrupt. As more data gets pushed to the queue, transmission will resume. This issue was observed on a Xilinx Zynq-7000 based board. During stress test of the network interface, driver would get stuck on interrupt loop within seconds or minutes causing CPU to stall. Signed-off-by: Tomas Melin Tested-by: Claudiu Beznea Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220407161659.14532-1-tomas.melin@vaisala.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/cadence/macb_main.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 82733d168cbd3fe9dab603f05894316b99008924 Author: Jens Axboe Date: Sun Apr 10 19:05:09 2022 -0600 io_uring: stop using io_wq_work as an fd placeholder There are two reasons why this isn't the best idea: - It's an odd area to grab a bit of storage space, hence it's an odd area to grab storage from. - It puts the 3rd io_kiocb cacheline into the hot path, where normal hot path just needs the first two. Use 'cflags' for joint fd/cflags storage. We only need fd until we successfully issue, and we only need cflags once a request is done and is completed. Fixes: 6bf9c47a3989 ("io_uring: defer file assignment") Signed-off-by: Jens Axboe fs/io-wq.h | 1 - fs/io_uring.c | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) commit 2804ecd8d3e3730b4f999cc1ff4b2441e1f4d513 Author: Jens Axboe Date: Mon Apr 11 17:03:26 2022 -0600 io_uring: move apoll->events cache In preparation for fixing a regression with pulling in an extra cacheline for IO that doesn't usually touch the last cacheline of the io_kiocb, move the cached location of apoll->events to space shared with some other completion data. Like cflags, this isn't used until after the request has been completed, so we can piggy back on top of comp_list. Fixes: 81459350d581 ("io_uring: cache req->apoll->events in req->cflags") Signed-off-by: Jens Axboe fs/io_uring.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) commit 6f83ab22adcb77a5824d2c274dace0d99e21319f Author: Jens Axboe Date: Mon Apr 11 09:48:30 2022 -0600 io_uring: io_kiocb_update_pos() should not touch file for non -1 offset -1 tells use to use the current position, but we check if the file is a stream regardless of that. Fix up io_kiocb_update_pos() to only dip into file if we need to. This is both more efficient and also drops 12 bytes of text on aarch64 and 64 bytes on x86-64. Fixes: b4aec4001595 ("io_uring: do not recalculate ppos unnecessarily") Signed-off-by: Jens Axboe fs/io_uring.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) commit a9f17d0c0778dd971dc9770fa0a2085a41d8c5e4 Author: Christophe JAILLET Date: Sun Apr 3 15:06:08 2022 +0200 phy: ti: tusb1210: Fix an error handling path in tusb1210_probe() tusb1210_probe_charger_detect() must be undone by a corresponding tusb1210_remove_charger_detect() in the error handling path, as already done in the remove function. Fixes: 48969a5623ed ("phy: ti: tusb1210: Add charger detection") Signed-off-by: Christophe JAILLET Reviewed-by: Hans de Goede Link: https://lore.kernel.org/r/07c4926c42243cedb3b6067a241bb486fdda01b5.1648991162.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul drivers/phy/ti/phy-tusb1210.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 42dcbe7d8bac997eef4c379e61d9121a15ed4e36 Author: Vitaly Kuznetsov Date: Thu Apr 7 22:10:13 2022 +0200 KVM: x86: hyper-v: Avoid writing to TSC page without an active vCPU The following WARN is triggered from kvm_vm_ioctl_set_clock(): WARNING: CPU: 10 PID: 579353 at arch/x86/kvm/../../../virt/kvm/kvm_main.c:3161 mark_page_dirty_in_slot+0x6c/0x80 [kvm] ... CPU: 10 PID: 579353 Comm: qemu-system-x86 Tainted: G W O 5.16.0.stable #20 Hardware name: LENOVO 20UF001CUS/20UF001CUS, BIOS R1CET65W(1.34 ) 06/17/2021 RIP: 0010:mark_page_dirty_in_slot+0x6c/0x80 [kvm] ... Call Trace: ? kvm_write_guest+0x114/0x120 [kvm] kvm_hv_invalidate_tsc_page+0x9e/0xf0 [kvm] kvm_arch_vm_ioctl+0xa26/0xc50 [kvm] ? schedule+0x4e/0xc0 ? __cond_resched+0x1a/0x50 ? futex_wait+0x166/0x250 ? __send_signal+0x1f1/0x3d0 kvm_vm_ioctl+0x747/0xda0 [kvm] ... The WARN was introduced by commit 03c0304a86bc ("KVM: Warn if mark_page_dirty() is called without an active vCPU") but the change seems to be correct (unlike Hyper-V TSC page update mechanism). In fact, there's no real need to actually write to guest memory to invalidate TSC page, this can be done by the first vCPU which goes through kvm_guest_time_update(). Reported-by: Maxim Levitsky Reported-by: Naresh Kamboju Suggested-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Message-Id: <20220407201013.963226-1-vkuznets@redhat.com> arch/x86/include/asm/kvm_host.h | 4 +--- arch/x86/kvm/hyperv.c | 40 ++++++++-------------------------------- arch/x86/kvm/hyperv.h | 2 +- arch/x86/kvm/x86.c | 7 +++---- 4 files changed, 13 insertions(+), 40 deletions(-) commit c538dc792ff7e456d777f585fdf96aa4e781ed66 Author: Suravee Suthikulpanit Date: Fri Apr 8 08:37:10 2022 -0500 KVM: SVM: Do not activate AVIC for SEV-enabled guest Since current AVIC implementation cannot support encrypted memory, inhibit AVIC for SEV-enabled guest. Signed-off-by: Suravee Suthikulpanit Message-Id: <20220408133710.54275-1-suravee.suthikulpanit@amd.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm/avic.c | 3 ++- arch/x86/kvm/svm/sev.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) commit af105c9cc9ec8fdc087827a98d4b9dc10d61c358 Author: Like Xu Date: Wed Apr 6 14:37:15 2022 +0800 Documentation: KVM: Add SPDX-License-Identifier tag +new file mode 100644 +WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 +#27: FILE: Documentation/virt/kvm/x86/errata.rst:1: Opportunistically update all other non-added KVM documents and remove a new extra blank line at EOF for x86/errata.rst. Signed-off-by: Like Xu Message-Id: <20220406063715.55625-5-likexu@tencent.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/vcpu-requests.rst | 2 ++ Documentation/virt/kvm/x86/amd-memory-encryption.rst | 2 ++ Documentation/virt/kvm/x86/errata.rst | 2 +- Documentation/virt/kvm/x86/running-nested-guests.rst | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) commit 0c8b6641c8410930e2a2f4a437ac3f987fbf9404 Author: Like Xu Date: Wed Apr 6 14:37:13 2022 +0800 selftests: kvm: add tsc_scaling_sync to .gitignore The tsc_scaling_sync's binary should be present in the .gitignore file for the git to ignore it. Signed-off-by: Like Xu Message-Id: <20220406063715.55625-3-likexu@tencent.com> Signed-off-by: Paolo Bonzini tools/testing/selftests/kvm/.gitignore | 1 + 1 file changed, 1 insertion(+) commit b2c2c21a7d78a7994fe145d829ddc460bfb51912 Merge: a44e2c207c30 4054eee92902 Author: Paolo Bonzini Date: Mon Apr 11 13:28:23 2022 -0400 Merge tag 'kvm-riscv-fixes-5.18-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv fixes for 5.18, take #1 - Remove hgatp zeroing in kvm_arch_vcpu_put() - Fix alignment of the guest_hang() in KVM selftest - Fix PTE A and D bits in KVM selftest - Missing #include in vcpu_fp.c commit 5c8402c4db45dd55c2c93c8d730f5dfa7c78a702 Author: Krzysztof Kozlowski Date: Thu Apr 7 11:18:57 2022 +0200 phy: samsung: exynos5250-sata: fix missing device put in probe error paths The actions of of_find_i2c_device_by_node() in probe function should be reversed in error paths by putting the reference to obtained device. Fixes: bcff4cba41bc ("PHY: Exynos: Add Exynos5250 SATA PHY driver") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220407091857.230386-2-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul drivers/phy/samsung/phy-exynos5250-sata.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) commit 388ec8f079f2f20d5cd183c3bc6f33cbc3ffd3ef Author: Miaoqian Lin Date: Thu Apr 7 11:18:56 2022 +0200 phy: samsung: Fix missing of_node_put() in exynos_sata_phy_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: bcff4cba41bc ("PHY: Exynos: Add Exynos5250 SATA PHY driver") Signed-off-by: Miaoqian Lin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220407091857.230386-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul drivers/phy/samsung/phy-exynos5250-sata.c | 1 + 1 file changed, 1 insertion(+) commit 751ee15da5e5d33e15726c1a79de0f5db8155bdd Author: Lv Ruyi Date: Fri Apr 8 09:56:17 2022 +0000 phy: ti: Fix missing of_node_put in ti_pipe3_get_sysctrl() of_parse_phandle() returns node pointer with refcount incremented, use of_node_put() on it to decrease refcount when done. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Link: https://lore.kernel.org/r/20220408095617.2495234-1-lv.ruyi@zte.com.cn Signed-off-by: Vinod Koul drivers/phy/ti/phy-ti-pipe3.c | 1 + 1 file changed, 1 insertion(+) commit 8b2c181e3dcf7562445af6702ee94aaedcbe13c8 Author: Kuogee Hsieh Date: Fri Apr 8 14:04:54 2022 -0700 drm/msm/dp: add fail safe mode outside of event_mutex context There is possible circular locking dependency detected on event_mutex (see below logs). This is due to set fail safe mode is done at dp_panel_read_sink_caps() within event_mutex scope. To break this possible circular locking, this patch move setting fail safe mode out of event_mutex scope. [ 23.958078] ====================================================== [ 23.964430] WARNING: possible circular locking dependency detected [ 23.970777] 5.17.0-rc2-lockdep-00088-g05241de1f69e #148 Not tainted [ 23.977219] ------------------------------------------------------ [ 23.983570] DrmThread/1574 is trying to acquire lock: [ 23.988763] ffffff808423aab0 (&dp->event_mutex){+.+.}-{3:3}, at: msm_dp_displ ay_enable+0x58/0x164 [ 23.997895] [ 23.997895] but task is already holding lock: [ 24.003895] ffffff808420b280 (&kms->commit_lock[i]/1){+.+.}-{3:3}, at: lock_c rtcs+0x80/0x8c [ 24.012495] [ 24.012495] which lock already depends on the new lock. [ 24.012495] [ 24.020886] [ 24.020886] the existing dependency chain (in reverse order) is: [ 24.028570] [ 24.028570] -> #5 (&kms->commit_lock[i]/1){+.+.}-{3:3}: [ 24.035472] __mutex_lock+0xc8/0x384 [ 24.039695] mutex_lock_nested+0x54/0x74 [ 24.044272] lock_crtcs+0x80/0x8c [ 24.048222] msm_atomic_commit_tail+0x1e8/0x3d0 [ 24.053413] commit_tail+0x7c/0xfc [ 24.057452] drm_atomic_helper_commit+0x158/0x15c [ 24.062826] drm_atomic_commit+0x60/0x74 [ 24.067403] drm_mode_atomic_ioctl+0x6b0/0x908 [ 24.072508] drm_ioctl_kernel+0xe8/0x168 [ 24.077086] drm_ioctl+0x320/0x370 [ 24.081123] drm_compat_ioctl+0x40/0xdc [ 24.085602] __arm64_compat_sys_ioctl+0xe0/0x150 [ 24.090895] invoke_syscall+0x80/0x114 [ 24.095294] el0_svc_common.constprop.3+0xc4/0xf8 [ 24.100668] do_el0_svc_compat+0x2c/0x54 [ 24.105242] el0_svc_compat+0x4c/0xe4 [ 24.109548] el0t_32_sync_handler+0xc4/0xf4 [ 24.114381] el0t_32_sync+0x178 [ 24.118688] [ 24.118688] -> #4 (&kms->commit_lock[i]){+.+.}-{3:3}: [ 24.125408] __mutex_lock+0xc8/0x384 [ 24.129628] mutex_lock_nested+0x54/0x74 [ 24.134204] lock_crtcs+0x80/0x8c [ 24.138155] msm_atomic_commit_tail+0x1e8/0x3d0 [ 24.143345] commit_tail+0x7c/0xfc [ 24.147382] drm_atomic_helper_commit+0x158/0x15c [ 24.152755] drm_atomic_commit+0x60/0x74 [ 24.157323] drm_atomic_helper_set_config+0x68/0x90 [ 24.162869] drm_mode_setcrtc+0x394/0x648 [ 24.167535] drm_ioctl_kernel+0xe8/0x168 [ 24.172102] drm_ioctl+0x320/0x370 [ 24.176135] drm_compat_ioctl+0x40/0xdc [ 24.180621] __arm64_compat_sys_ioctl+0xe0/0x150 [ 24.185904] invoke_syscall+0x80/0x114 [ 24.190302] el0_svc_common.constprop.3+0xc4/0xf8 [ 24.195673] do_el0_svc_compat+0x2c/0x54 [ 24.200241] el0_svc_compat+0x4c/0xe4 [ 24.204544] el0t_32_sync_handler+0xc4/0xf4 [ 24.209378] el0t_32_sync+0x174/0x178 [ 24.213680] -> #3 (crtc_ww_class_mutex){+.+.}-{3:3}: [ 24.220308] __ww_mutex_lock.constprop.20+0xe8/0x878 [ 24.225951] ww_mutex_lock+0x60/0xd0 [ 24.230166] modeset_lock+0x190/0x19c [ 24.234467] drm_modeset_lock+0x34/0x54 [ 24.238953] drmm_mode_config_init+0x550/0x764 [ 24.244065] msm_drm_bind+0x170/0x59c [ 24.248374] try_to_bring_up_master+0x244/0x294 [ 24.253572] __component_add+0xf4/0x14c [ 24.258057] component_add+0x2c/0x38 [ 24.262273] dsi_dev_attach+0x2c/0x38 [ 24.266575] dsi_host_attach+0xc4/0x120 [ 24.271060] mipi_dsi_attach+0x34/0x48 [ 24.275456] devm_mipi_dsi_attach+0x28/0x68 [ 24.280298] ti_sn_bridge_probe+0x2b4/0x2dc [ 24.285137] auxiliary_bus_probe+0x78/0x90 [ 24.289893] really_probe+0x1e4/0x3d8 [ 24.294194] __driver_probe_device+0x14c/0x164 [ 24.299298] driver_probe_device+0x54/0xf8 [ 24.304043] __device_attach_driver+0xb4/0x118 [ 24.309145] bus_for_each_drv+0xb0/0xd4 [ 24.313628] __device_attach+0xcc/0x158 [ 24.318112] device_initial_probe+0x24/0x30 [ 24.322954] bus_probe_device+0x38/0x9c [ 24.327439] deferred_probe_work_func+0xd4/0xf0 [ 24.332628] process_one_work+0x2f0/0x498 [ 24.337289] process_scheduled_works+0x44/0x48 [ 24.342391] worker_thread+0x1e4/0x26c [ 24.346788] kthread+0xe4/0xf4 [ 24.350470] ret_from_fork+0x10/0x20 [ 24.354683] [ 24.354683] [ 24.354683] -> #2 (crtc_ww_class_acquire){+.+.}-{0:0}: [ 24.361489] drm_modeset_acquire_init+0xe4/0x138 [ 24.366777] drm_helper_probe_detect_ctx+0x44/0x114 [ 24.372327] check_connector_changed+0xbc/0x198 [ 24.377517] drm_helper_hpd_irq_event+0xcc/0x11c [ 24.382804] dsi_hpd_worker+0x24/0x30 [ 24.387104] process_one_work+0x2f0/0x498 [ 24.391762] worker_thread+0x1d0/0x26c [ 24.396158] kthread+0xe4/0xf4 [ 24.399840] ret_from_fork+0x10/0x20 [ 24.404053] [ 24.404053] -> #1 (&dev->mode_config.mutex){+.+.}-{3:3}: [ 24.411032] __mutex_lock+0xc8/0x384 [ 24.415247] mutex_lock_nested+0x54/0x74 [ 24.419819] dp_panel_read_sink_caps+0x23c/0x26c [ 24.425108] dp_display_process_hpd_high+0x34/0xd4 [ 24.430570] dp_display_usbpd_configure_cb+0x30/0x3c [ 24.436205] hpd_event_thread+0x2ac/0x550 [ 24.440864] kthread+0xe4/0xf4 [ 24.444544] ret_from_fork+0x10/0x20 [ 24.448757] [ 24.448757] -> #0 (&dp->event_mutex){+.+.}-{3:3}: [ 24.455116] __lock_acquire+0xe2c/0x10d8 [ 24.459690] lock_acquire+0x1ac/0x2d0 [ 24.463988] __mutex_lock+0xc8/0x384 [ 24.468201] mutex_lock_nested+0x54/0x74 [ 24.472773] msm_dp_display_enable+0x58/0x164 [ 24.477789] dp_bridge_enable+0x24/0x30 [ 24.482273] drm_atomic_bridge_chain_enable+0x78/0x9c [ 24.488006] drm_atomic_helper_commit_modeset_enables+0x1bc/0x244 [ 24.494801] msm_atomic_commit_tail+0x248/0x3d0 [ 24.499992] commit_tail+0x7c/0xfc [ 24.504031] drm_atomic_helper_commit+0x158/0x15c [ 24.509404] drm_atomic_commit+0x60/0x74 [ 24.513976] drm_mode_atomic_ioctl+0x6b0/0x908 [ 24.519079] drm_ioctl_kernel+0xe8/0x168 [ 24.523650] drm_ioctl+0x320/0x370 [ 24.527689] drm_compat_ioctl+0x40/0xdc [ 24.532175] __arm64_compat_sys_ioctl+0xe0/0x150 [ 24.537463] invoke_syscall+0x80/0x114 [ 24.541861] el0_svc_common.constprop.3+0xc4/0xf8 [ 24.547235] do_el0_svc_compat+0x2c/0x54 [ 24.551806] el0_svc_compat+0x4c/0xe4 [ 24.556106] el0t_32_sync_handler+0xc4/0xf4 [ 24.560948] el0t_32_sync+0x174/0x178 Changes in v2: -- add circular lockiing trace Fixes: d4aca422539c ("drm/msm/dp: always add fail-safe mode into connector mode list") Signed-off-by: Kuogee Hsieh Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/481396/ Link: https://lore.kernel.org/r/1649451894-554-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark drivers/gpu/drm/msm/dp/dp_display.c | 6 ++++++ drivers/gpu/drm/msm/dp/dp_panel.c | 20 ++++++++++---------- drivers/gpu/drm/msm/dp/dp_panel.h | 1 + 3 files changed, 17 insertions(+), 10 deletions(-) commit 47b7de6b88b962ef339a2427a023d2a23d161654 Author: Stephen Boyd Date: Thu Mar 17 17:07:31 2022 -0700 drm/msm/dsi: Use connector directly in msm_dsi_manager_connector_init() The member 'msm_dsi->connector' isn't assigned until msm_dsi_manager_connector_init() returns (see msm_dsi_modeset_init() and how it assigns the return value). Therefore this pointer is going to be NULL here. Let's use 'connector' which is what was intended. Cc: Dmitry Baryshkov Cc: Sean Paul Fixes: 6d5e78406991 ("drm/msm/dsi: Move dsi panel init into modeset init path") Signed-off-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/478693/ Link: https://lore.kernel.org/r/20220318000731.2823718-1-swboyd@chromium.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark drivers/gpu/drm/msm/dsi/dsi_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e2a88eabb02410267519b838fb9b79f5206769be Author: Robin Murphy Date: Tue Apr 5 15:17:48 2022 +0100 drm/msm: Stop using iommu_present() Even if some IOMMU has registered itself on the platform "bus", that doesn't necessarily mean it provides translation for the device we care about. Replace iommu_present() with a more appropriate check. Signed-off-by: Robin Murphy Reviewed-by: Rob Clark Patchwork: https://patchwork.freedesktop.org/patch/480707/ Link: https://lore.kernel.org/r/5ab4f4574d7f3e042261da702d493ee40d003356.1649168268.git.robin.murphy@arm.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark drivers/gpu/drm/msm/msm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 047ae665577776b7feb11bd4f81f46627cff95e7 Author: Xiaoke Wang Date: Thu Apr 7 10:31:51 2022 +0800 drm/msm/mdp5: check the return 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. Besides, since mdp5_plane_reset() is void type, so we should better set `plane-state` to NULL after releasing it. Signed-off-by: Xiaoke Wang Reviewed-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/481055/ Link: https://lore.kernel.org/r/tencent_8E2A1C78140EE1784AB2FF4B2088CC0AB908@qq.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 3 +++ 1 file changed, 3 insertions(+) commit 537fef808be5ea56f6fc06932162550819a3b3c3 Author: Rob Clark Date: Thu Apr 7 13:28:33 2022 -0700 drm/msm: Fix range size vs end confusion The fourth param is size, rather than range_end. Note that we could increase the address space size if we had a way to prevent buffers from spanning a 4G split, mostly just to avoid fw bugs with 64b math. Fixes: 84c31ee16f90 ("drm/msm/a6xx: Add support for per-instance pagetables") Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220407202836.1211268-1-robdclark@gmail.com Signed-off-by: Rob Clark drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 962dd65e575dde950ef0844568edc37cfb39f302 Author: Guillaume Giraudon Date: Mon Apr 11 10:44:28 2022 -0400 arm64: dts: meson-sm1-bananapi-m5: fix wrong GPIO pin labeling for CON1 The labels for lines 61 through 84 on the periphs-banks were offset by 2. 2 lines are missing in the BOOT GPIO lines (contains 14, should be 16) Added 2 empty entries in BOOT to realigned the rest of GPIO labels to match the Banana Pi M5 schematics. (Thanks to Neil Armstrong for the heads up on the position of the missing pins) Fixes: 976e920183e4 ("arm64: dts: meson-sm1: add Banana PI BPI-M5 board dts") Signed-off-by: Guillaume Giraudon Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220411144427.874-1-ggiraudon@prism19.com arch/arm64/boot/dts/amlogic/meson-sm1-bananapi-m5.dts | 1 + 1 file changed, 1 insertion(+) commit 425d239379db03d514cb1c476bfe7c320bb89dfc Author: Toke Høiland-Jørgensen Date: Sat Apr 9 23:30:53 2022 +0200 bpf: Fix release of page_pool in BPF_PROG_RUN in test runner The live packet mode in BPF_PROG_RUN allocates a page_pool instance for each test run instance and uses it for the packet data. On setup it creates the page_pool, and calls xdp_reg_mem_model() to allow pages to be returned properly from the XDP data path. However, xdp_reg_mem_model() also raises the reference count of the page_pool itself, so the single page_pool_destroy() count on teardown was not enough to actually release the pool. To fix this, add an additional xdp_unreg_mem_model() call on teardown. Fixes: b530e9e1063e ("bpf: Add "live packet" mode for XDP in BPF_PROG_RUN") Reported-by: Freysteinn Alfredsson Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20220409213053.3117305-1-toke@redhat.com net/bpf/test_run.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit b541f9e59a0e56fff840cf983394e59de7bc2d96 Author: Hans de Goede Date: Mon Apr 11 15:54:40 2022 +0200 phy: ti: tusb1210: Make tusb1210_chg_det_states static Make tusb1210_chg_det_states static, fixing the following sparse warning: drivers/phy/ti/phy-tusb1210.c:158:12: sparse: sparse: symbol 'tusb1210_chg_det_states' was not declared. Should it be static? Fixes: 48969a5623ed ("phy: ti: tusb1210: Add charger detection") Reported-by: kernel test robot Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220411135440.558394-1-hdegoede@redhat.com Signed-off-by: Vinod Koul drivers/phy/ti/phy-tusb1210.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7104b9cb35a33ad803a1adbbfa50569b008faf15 Author: Miaoqian Lin Date: Tue Mar 8 06:49:51 2022 +0000 dmaengine: imx-sdma: Fix error checking in sdma_event_remap of_parse_phandle() returns NULL on errors, rather than error pointers. Using NULL check on grp_np to fix this. Fixes: d078cd1b4185 ("dmaengine: imx-sdma: Add imx6sx platform support") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220308064952.15743-1-linmq006@gmail.com Signed-off-by: Vinod Koul drivers/dma/imx-sdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 206680c4e46b62fd8909385e0874a36952595b85 Author: Xiaomeng Tong Date: Sun Mar 27 14:11:54 2022 +0800 dma: at_xdmac: fix a missing check on list iterator The bug is here: __func__, desc, &desc->tx_dma_desc.phys, ret, cookie, residue); The list iterator 'desc' will point to a bogus position containing HEAD if the list is empty or no element is found. To avoid dev_dbg() prints a invalid address, use a new variable 'iter' as the list iterator, while use the origin variable 'desc' as a dedicated pointer to point to the found element. Cc: stable@vger.kernel.org Fixes: 82e2424635f4c ("dmaengine: xdmac: fix print warning on dma_addr_t variable") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220327061154.4867-1-xiam0nd.tong@gmail.com Signed-off-by: Vinod Koul drivers/dma/at_xdmac.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit e3fa461d8b0e185b7da8a101fe94dfe6dd500ac0 Author: Nicolas Dichtel Date: Fri Apr 8 16:03:42 2022 +0200 ipv6: fix panic when forwarding a pkt with no in6 dev kongweibin reported a kernel panic in ip6_forward() when input interface has no in6 dev associated. The following tc commands were used to reproduce this panic: tc qdisc del dev vxlan100 root tc qdisc add dev vxlan100 root netem corrupt 5% CC: stable@vger.kernel.org Fixes: ccd27f05ae7b ("ipv6: fix 'disable_policy' for fwd packets") Reported-by: kongweibin Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern Signed-off-by: David S. Miller net/ipv6/ip6_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1a7eb80d170c28be2928433702256fe2a0bd1e0f Author: Lv Ruyi Date: Fri Apr 8 09:49:41 2022 +0000 dpaa_eth: Fix missing of_node_put in dpaa_get_ts_info() Both of of_get_parent() and of_parse_phandle() return node pointer with refcount incremented, use of_node_put() on it to decrease refcount when done. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: David S. Miller drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit a3ae97f4c87d9570e7e9a3e3324c443757f6e29a Author: Kevin Groeneveld Date: Sun Apr 10 18:31:18 2022 -0400 dmaengine: imx-sdma: fix init of uart scripts Commit b98ce2f4e32b ("dmaengine: imx-sdma: add uart rom script") broke uart rx on imx5 when using sdma firmware from older Freescale 2.6.35 kernel. In this case reading addr->uartXX_2_mcu_addr was going out of bounds of the firmware memory and corrupting the uart script addresses. Simply adding a bounds check before accessing addr->uartXX_2_mcu_addr does not work as the uartXX_2_mcu_addr members are now beyond the size of the older firmware and the uart addresses would never be populated in that case. There are other ways to fix this but overall the logic seems clearer to me to revert the uartXX_2_mcu_ram_addr structure entries back to uartXX_2_mcu_addr, change the newer entries to uartXX_2_mcu_rom_addr and update the logic accordingly. I have tested this patch on: 1. An i.MX53 system with sdma firmware from Freescale 2.6.35 kernel. Without this patch uart rx is broken in this scenario, with the patch uart rx is restored. 2. An i.MX6D system with no external sdma firmware. uart is okay with or without this patch. 3. An i.MX8MM system using current sdma-imx7d.bin firmware from linux-firmware. uart is okay with or without this patch and I confirmed the rom version of the uart script is being used which was the intention and reason for commit b98ce2f4e32b ("dmaengine: imx-sdma: add uart rom script") in the first place. Fixes: b98ce2f4e32b ("dmaengine: imx-sdma: add uart rom script") Cc: stable@vger.kernel.org Signed-off-by: Kevin Groeneveld Reviewed-by: Lucas Stach Reviewed-by: Fabio Estevam Acked-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20220410223118.15086-1-kgroeneveld@lenbrook.com Signed-off-by: Vinod Koul drivers/dma/imx-sdma.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) commit 05ae2fba821c4d122ab4ba3e52144e21586c4010 Author: Florian Westphal Date: Sat Apr 9 13:20:19 2022 +0200 netfilter: nft_socket: make cgroup match work in input too cgroupv2 helper function ignores the already-looked up sk and uses skb->sk instead. Just pass sk from the calling function instead; this will make cgroup matching work for udp and tcp in input even when edemux did not set skb->sk already. Fixes: e0bb96db96f8 ("netfilter: nft_socket: add support for cgroupsv2") Signed-off-by: Florian Westphal Tested-by: Topi Miettinen Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_socket.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit fb4bccd863ccccd36ad000601856609e259a1859 Author: Ben Greear Date: Wed Apr 6 10:56:59 2022 -0700 mac80211: fix ht_capa printout in debugfs Don't use sizeof(pointer) when calculating scnprintf offset. Fixes: 01f84f0ed3b4 ("mac80211: reduce stack usage in debugfs") Signed-off-by: Ben Greear Link: https://lore.kernel.org/r/20220406175659.20611-1-greearb@candelatech.com [correct the Fixes tag] Signed-off-by: Johannes Berg net/mac80211/debugfs_sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a5199b5626cd6913cf8776a835bc63d40e0686ad Author: Rameshkumar Sundaram Date: Mon Apr 11 14:37:51 2022 +0530 cfg80211: hold bss_lock while updating nontrans_list Synchronize additions to nontrans_list of transmitting BSS with bss_lock to avoid races. Also when cfg80211_add_nontrans_list() fails __cfg80211_unlink_bss() needs bss_lock to be held (has lockdep assert on bss_lock). So protect the whole block with bss_lock to avoid races and warnings. Found during code review. Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning") Signed-off-by: Rameshkumar Sundaram Link: https://lore.kernel.org/r/1649668071-9370-1-git-send-email-quic_ramess@quicinc.com Signed-off-by: Johannes Berg net/wireless/scan.c | 2 ++ 1 file changed, 2 insertions(+) commit 6624bb34b4eb19f715db9908cca00122748765d7 Author: Johannes Berg Date: Mon Apr 11 11:42:03 2022 +0200 nl80211: correctly check NL80211_ATTR_REG_ALPHA2 size We need this to be at least two bytes, so we can access alpha2[0] and alpha2[1]. It may be three in case some userspace used NUL-termination since it was NLA_STRING (and we also push it out with NUL-termination). Cc: stable@vger.kernel.org Reported-by: Lee Jones Link: https://lore.kernel.org/r/20220411114201.fd4a31f06541.Ie7ff4be2cf348d8cc28ed0d626fc54becf7ea799@changeid Signed-off-by: Johannes Berg net/wireless/nl80211.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e8a64bbaaad1f6548cec5508297bc6d45e8ab69e Author: Benedikt Spranger Date: Fri Apr 8 11:47:45 2022 +0200 net/sched: taprio: Check if socket flags are valid A user may set the SO_TXTIME socket option to ensure a packet is send at a given time. The taprio scheduler has to confirm, that it is allowed to send a packet at that given time, by a check against the packet time schedule. The scheduler drop the packet, if the gates are closed at the given send time. The check, if SO_TXTIME is set, may fail since sk_flags are part of an union and the union is used otherwise. This happen, if a socket is not a full socket, like a request socket for example. Add a check to verify, if the union is used for sk_flags. Fixes: 4cfd5779bd6e ("taprio: Add support for txtime-assist mode") Signed-off-by: Benedikt Spranger Reviewed-by: Kurt Kanzenbach Acked-by: Vinicius Costa Gomes Signed-off-by: David S. Miller net/sched/sch_taprio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a6aaa00324240967272b451bfa772547bd576ee6 Author: Dinh Nguyen Date: Thu Apr 7 08:25:21 2022 -0500 net: ethernet: stmmac: fix altr_tse_pcs function when using a fixed-link When using a fixed-link, the altr_tse_pcs driver crashes due to null-pointer dereference as no phy_device is provided to tse_pcs_fix_mac_speed function. Fix this by adding a check for phy_dev before calling the tse_pcs_fix_mac_speed() function. Also clean up the tse_pcs_fix_mac_speed function a bit. There is no need to check for splitter_base and sgmii_adapter_base because the driver will fail if these 2 variables are not derived from the device tree. Fixes: fb3bbdb85989 ("net: ethernet: Add TSE PCS support to dwmac-socfpga") Signed-off-by: Dinh Nguyen Signed-off-by: David S. Miller drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c | 8 -------- drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h | 4 ++++ drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 13 +++++-------- 3 files changed, 9 insertions(+), 16 deletions(-) commit b2cd2cde7d690b760bcdd675380ff37c3e1aa38d Author: Arun Ramadoss Date: Thu Apr 7 10:16:10 2022 +0530 net: phy: LAN87xx: remove genphy_softreset in config_aneg When the T1 phy master/slave state is changed, at the end of config_aneg function genphy_softreset is called. After the reset all the registers configured during the config_init are restored to default value. To avoid this, removed the genphy_softreset call. v1->v2 ------ Added the author in cc Fixes: 8a1b415d70b7 ("net: phy: added ethtool master-slave configuration support") Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller drivers/net/phy/microchip_t1.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) commit 8be9cdc6911877843c4f13e44e836382818eb355 Author: Wei Yongjun Date: Sat Feb 26 09:43:33 2022 +0000 bus: imx-weim: make symbol 'weim_of_notifier' static The sparse tool complains as follows: drivers/bus/imx-weim.c:373:23: warning: symbol 'weim_of_notifier' was not declared. Should it be static? This symbol is not used outside of imx-weim.c, so marks it static. Fixes: e6cb5408289f ("bus: imx-weim: add DT overlay support for WEIM bus") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: Shawn Guo drivers/bus/imx-weim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f32c5a0423400e01f4d7c607949fa3a1f006e8fa Author: Daniele Palmas Date: Wed Apr 6 16:14:08 2022 +0200 USB: serial: option: add Telit 0x1057, 0x1058, 0x1075 compositions Add support for the following Telit FN980 and FN990 compositions: 0x1057: tty, adb, rmnet, tty, tty, tty, tty, tty 0x1058: tty, adb, tty, tty, tty, tty, tty 0x1075: adb, tty Signed-off-by: Daniele Palmas Link: https://lore.kernel.org/r/20220406141408.580669-1-dnlplm@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold drivers/usb/serial/option.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 400331f8ffa3bec5c561417e5eec6848464e9160 Author: Pawan Gupta Date: Thu Mar 10 14:02:09 2022 -0800 x86/tsx: Disable TSX development mode at boot A microcode update on some Intel processors causes all TSX transactions to always abort by default[*]. Microcode also added functionality to re-enable TSX for development purposes. With this microcode loaded, if tsx=on was passed on the cmdline, and TSX development mode was already enabled before the kernel boot, it may make the system vulnerable to TSX Asynchronous Abort (TAA). To be on safer side, unconditionally disable TSX development mode during boot. If a viable use case appears, this can be revisited later. [*]: Intel TSX Disable Update for Selected Processors, doc ID: 643557 [ bp: Drop unstable web link, massage heavily. ] Suggested-by: Andrew Cooper Suggested-by: Borislav Petkov Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov Tested-by: Neelima Krishnan Cc: Link: https://lore.kernel.org/r/347bd844da3a333a9793c6687d4e4eb3b2419a3e.1646943780.git.pawan.kumar.gupta@linux.intel.com arch/x86/include/asm/msr-index.h | 4 +-- arch/x86/kernel/cpu/common.c | 2 ++ arch/x86/kernel/cpu/cpu.h | 5 ++-- arch/x86/kernel/cpu/intel.c | 8 ------ arch/x86/kernel/cpu/tsx.c | 50 ++++++++++++++++++++++++++++++++-- tools/arch/x86/include/asm/msr-index.h | 4 +-- 6 files changed, 55 insertions(+), 18 deletions(-) commit 08d835dff916bfe8f45acc7b92c7af6c4081c8a7 Author: Rei Yamamoto Date: Thu Mar 31 09:33:09 2022 +0900 genirq/affinity: Consider that CPUs on nodes can be unbalanced If CPUs on a node are offline at boot time, the number of nodes is different when building affinity masks for present cpus and when building affinity masks for possible cpus. This causes the following problem: In the case that the number of vectors is less than the number of nodes there are cases where bits of masks for present cpus are overwritten when building masks for possible cpus. Fix this by excluding CPUs, which are not part of the current build mask (present/possible). [ tglx: Massaged changelog and added comment ] Fixes: b82592199032 ("genirq/affinity: Spread IRQs to all available NUMA nodes") Signed-off-by: Rei Yamamoto Signed-off-by: Thomas Gleixner Reviewed-by: Ming Lei Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220331003309.10891-1-yamamoto.rei@jp.fujitsu.com kernel/irq/affinity.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 258f3b8c3210b03386e4ad92b4bd8652b5c1beb3 Author: Pawan Gupta Date: Thu Mar 10 14:00:59 2022 -0800 x86/tsx: Use MSR_TSX_CTRL to clear CPUID bits tsx_clear_cpuid() uses MSR_TSX_FORCE_ABORT to clear CPUID.RTM and CPUID.HLE. Not all CPUs support MSR_TSX_FORCE_ABORT, alternatively use MSR_IA32_TSX_CTRL when supported. [ bp: Document how and why TSX gets disabled. ] Fixes: 293649307ef9 ("x86/tsx: Clear CPUID bits when TSX always force aborts") Reported-by: kernel test robot Signed-off-by: Pawan Gupta Signed-off-by: Borislav Petkov Tested-by: Neelima Krishnan Cc: Link: https://lore.kernel.org/r/5b323e77e251a9c8bcdda498c5cc0095be1e1d3c.1646943780.git.pawan.kumar.gupta@linux.intel.com arch/x86/kernel/cpu/intel.c | 1 + arch/x86/kernel/cpu/tsx.c | 54 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 48 insertions(+), 7 deletions(-) commit 264fb03497ec1c7841bba872571bcd11beed57a7 Author: Tao Jin Date: Sat Apr 9 18:44:24 2022 -0400 ALSA: hda/realtek: add quirk for Lenovo Thinkpad X12 speakers For this specific device on Lenovo Thinkpad X12 tablet, the verbs were dumped by qemu running a guest OS that init this codec properly. After studying the dump, it turns out that the same quirk used by the other Lenovo devices can be reused. The patch was tested working against the mainline kernel. Cc: Signed-off-by: Tao Jin Link: https://lore.kernel.org/r/CO6PR03MB6241CD73310B37858FE64C85E1E89@CO6PR03MB6241.namprd03.prod.outlook.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) commit 2f7a26abb8241a0208c68d22815aa247c5ddacab Author: Fabio M. De Francesco Date: Sat Apr 9 03:26:55 2022 +0200 ALSA: pcm: Test for "silence" field in struct "pcm_format_data" Syzbot reports "KASAN: null-ptr-deref Write in snd_pcm_format_set_silence".[1] It is due to missing validation of the "silence" field of struct "pcm_format_data" in "pcm_formats" array. Add a test for valid "pat" and, if it is not so, return -EINVAL. [1] https://lore.kernel.org/lkml/000000000000d188ef05dc2c7279@google.com/ Reported-and-tested-by: syzbot+205eb15961852c2c5974@syzkaller.appspotmail.com Signed-off-by: Fabio M. De Francesco Cc: Link: https://lore.kernel.org/r/20220409012655.9399-1-fmdefrancesco@gmail.com Signed-off-by: Takashi Iwai sound/core/pcm_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 15cf0b82271b1823fb02ab8c377badba614d95d5 Author: Zheyu Ma Date: Mon Apr 4 16:47:17 2022 +0800 video: fbdev: i740fb: Error out if 'pixclock' equals zero The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of 'pixclock', it may cause divide error. Fix this by checking whether 'pixclock' is zero in the function i740fb_check_var(). The following log reveals it: divide error: 0000 [#1] PREEMPT SMP KASAN PTI RIP: 0010:i740fb_decode_var drivers/video/fbdev/i740fb.c:444 [inline] RIP: 0010:i740fb_set_par+0x272f/0x3bb0 drivers/video/fbdev/i740fb.c:739 Call Trace: fb_set_var+0x604/0xeb0 drivers/video/fbdev/core/fbmem.c:1036 do_fb_ioctl+0x234/0x670 drivers/video/fbdev/core/fbmem.c:1112 fb_ioctl+0xdd/0x130 drivers/video/fbdev/core/fbmem.c:1191 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] Signed-off-by: Zheyu Ma Signed-off-by: Helge Deller drivers/video/fbdev/i740fb.c | 3 +++ 1 file changed, 3 insertions(+) commit 12acdbd7ca7d8b3ac0f55d8069f52c223d8d23fd Author: Ondrej Zary Date: Sun Apr 10 22:28:33 2022 +0200 video: fbdev: i740fb: use memset_io() to clear screen sparse complains that using memset() on __iomem pointer is wrong: incorrect type in argument 1 (different address spaces) Use memset_io() to clear screen instead. Tested on real i740 cards. Signed-off-by: Ondrej Zary Signed-off-by: Helge Deller drivers/video/fbdev/i740fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7015bb57c304bad7289e872c2c5c587adee3a756 Author: Zheyu Ma Date: Mon Apr 4 16:47:23 2022 +0800 video: fbdev: s3fb: Error out if 'pixclock' equals zero The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of 'pixclock', it may cause divide error. Fix this by checking whether 'pixclock' is zero in s3fb_check_var(). The following log reveals it: divide error: 0000 [#1] PREEMPT SMP KASAN PTI RIP: 0010:s3fb_check_var+0x3f3/0x530 Call Trace: fb_set_var+0x367/0xeb0 do_fb_ioctl+0x234/0x670 fb_ioctl+0xdd/0x130 do_syscall_64+0x3b/0x90 Signed-off-by: Zheyu Ma Signed-off-by: Helge Deller drivers/video/fbdev/s3fb.c | 3 +++ 1 file changed, 3 insertions(+) commit e1e965156438a3662dbb151d892ada834214c833 Author: Zheyu Ma Date: Mon Apr 4 16:47:22 2022 +0800 video: fbdev: arkfb: Error out if 'pixclock' equals zero The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of 'pixclock', it may cause divide error. Fix this by checking whether 'pixclock' is zero. The following log reveals it: divide error: 0000 [#1] PREEMPT SMP KASAN PTI RIP: 0010:arkfb_set_par+0x10fc/0x24f0 Call Trace: fb_set_var+0x604/0xeb0 do_fb_ioctl+0x234/0x670 fb_ioctl+0xdd/0x130 do_syscall_64+0x3b/0x90 Signed-off-by: Zheyu Ma Signed-off-by: Helge Deller drivers/video/fbdev/arkfb.c | 3 +++ 1 file changed, 3 insertions(+) commit 16844e5870424c2728486dc0c0300ebf7fa09ad6 Author: Zheyu Ma Date: Mon Apr 4 16:47:21 2022 +0800 video: fbdev: tridentfb: Error out if 'pixclock' equals zero The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of 'pixclock', it may cause divide error. Fix this by checking whether 'pixclock' is zero. The following log reveals it: divide error: 0000 [#1] PREEMPT SMP KASAN PTI RIP: 0010:tridentfb_check_var+0x853/0xe60 Call Trace: fb_set_var+0x367/0xeb0 do_fb_ioctl+0x234/0x670 fb_ioctl+0xdd/0x130 do_syscall_64+0x3b/0x90 Signed-off-by: Zheyu Ma Signed-off-by: Helge Deller drivers/video/fbdev/tridentfb.c | 3 +++ 1 file changed, 3 insertions(+) commit f2bfd792c1ed4b1e0578db3fcdb0879dc87fe027 Author: Zheyu Ma Date: Mon Apr 4 16:47:20 2022 +0800 video: fbdev: vt8623fb: Error out if 'pixclock' equals zero The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of 'pixclock', it may cause divide error. Fix this by checking whether 'pixclock' is zero in the function vt8623fb_check_var(). The following log reveals it: divide error: 0000 [#1] PREEMPT SMP KASAN PTI RIP: 0010:vt8623fb_set_par+0xecd/0x2210 Call Trace: fb_set_var+0x604/0xeb0 do_fb_ioctl+0x234/0x670 fb_ioctl+0xdd/0x130 do_syscall_64+0x3b/0x90 Signed-off-by: Zheyu Ma Signed-off-by: Helge Deller drivers/video/fbdev/vt8623fb.c | 3 +++ 1 file changed, 3 insertions(+) commit 213e2df4733275165038d77289812d4473b0b010 Author: Zheyu Ma Date: Mon Apr 4 16:47:19 2022 +0800 video: fbdev: kyro: Error out if 'lineclock' equals zero The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of 'lineclock', it may cause divide error. Fix this by checking whether 'lineclock' is zero. The following log reveals it: divide error: 0000 [#1] PREEMPT SMP KASAN PTI RIP: 0010:kyrofb_set_par+0x30d/0xd80 Call Trace: fb_set_var+0x604/0xeb0 do_fb_ioctl+0x234/0x670 fb_ioctl+0xdd/0x130 do_syscall_64+0x3b/0x90 Signed-off-by: Zheyu Ma Signed-off-by: Helge Deller drivers/video/fbdev/kyro/fbdev.c | 2 ++ 1 file changed, 2 insertions(+) commit 85ec038b53faec11baefb2c42b6c0ce8bec94d3e Author: Zheyu Ma Date: Mon Apr 4 16:47:18 2022 +0800 video: fbdev: neofb: Fix the check of 'var->pixclock' The previous check against 'var->pixclock' doesn't return -EINVAL when it equals zero, but the driver uses it again, causing the divide error. Fix this by returning when 'var->pixclock' is zero. The following log reveals it: divide error: 0000 [#1] PREEMPT SMP KASAN PTI RIP: 0010:neofb_set_par+0x190f/0x49a0 Call Trace: fb_set_var+0x604/0xeb0 do_fb_ioctl+0x234/0x670 fb_ioctl+0xdd/0x130 do_syscall_64+0x3b/0x90 Signed-off-by: Zheyu Ma Signed-off-by: Helge Deller drivers/video/fbdev/neofb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1acb34e7dd7720a1fff00cbd4d000ec3219dc9d6 Author: Matt Roper Date: Thu Apr 7 09:18:39 2022 -0700 drm/i915: Sunset igpu legacy mmap support based on GRAPHICS_VER_FULL The intent of the version check in the mmap ioctl was to maintain support for existing platforms (i.e., ADL/RPL and earlier), but drop support on all future igpu platforms. As we've seen on the dgpu side, the hardware teams are using a more fine-grained numbering system for IP version numbers these days, so it's possible the version number associated with our next igpu could be some form of "12.xx" rather than 13 or higher. Comparing against the full ver.release number will ensure the intent of the check is maintained no matter what numbering the hardware teams settle on. Fixes: d3f3baa3562a ("drm/i915: Reinstate the mmap ioctl for some platforms") Cc: Thomas Hellström Cc: Lucas De Marchi Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220407161839.1073443-1-matthew.d.roper@intel.com (cherry picked from commit 8e7e5c077cd57ee9a36d58c65f07257dc49a88d5) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/gem/i915_gem_mman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f571e9c9aafed2fbd60fd99aa4b9823221338b98 Author: Rob Herring Date: Fri Mar 4 14:25:27 2022 -0600 arm64: dts: imx: Fix imx8*-var-som touchscreen property sizes The common touchscreen properties are all 32-bit, not 16-bit. These properties must not be too important as they are all ignored in case of an error reading them. Signed-off-by: Rob Herring Signed-off-by: Shawn Guo arch/arm64/boot/dts/freescale/imx8mm-var-som.dtsi | 8 ++++---- arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) commit 7af1caf8781b9e4e53bf6b2a1de0deb3c122501a Author: Rob Herring Date: Fri Mar 4 14:25:18 2022 -0600 ARM: dts: imx: Fix boolean properties with values Boolean properties in DT are present or not present and don't take a value. A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't matter. It may have been intended that 0 values are false, but there is no change in behavior with this patch. Signed-off-by: Rob Herring Signed-off-by: Shawn Guo arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi | 32 +++++++++++----------- .../boot/dts/imx6ul-phytec-segin-peb-av-02.dtsi | 4 +-- 2 files changed, 18 insertions(+), 18 deletions(-) commit 4c79865f3e8a2db93ec1e844509edfebe5a6ae56 Author: Tim Harvey Date: Tue Apr 5 12:35:09 2022 -0700 ARM: dts: imx8mm-venice-gw{71xx,72xx,73xx}: fix OTG controller OC mode The GW71xx, GW72xx and GW73xx boards have USB1 routed to a USB OTG connectors and USB2 routed to a USB hub. The OTG connector has a over-currently protection with an active-low pin and the USB1 to HUB connection has no over-current protection (as the HUB itself implements this for its downstream ports). Add proper dt nodes to specify the over-current pin polarity for USB1 and disable over-current protection for USB2. Fixes: 6f30b27c5ef5 ("arm64: dts: imx8mm: Add Gateworks i.MX 8M Mini Development Kits") Cc: stable@vger.kernel.org Signed-off-by: Tim Harvey Signed-off-by: Shawn Guo arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi | 2 ++ arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi | 2 ++ arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi | 2 ++ 3 files changed, 6 insertions(+) commit 574518b7ccbaef74cb89eb1a1a0da88afa1e0113 Author: Marek Vasut Date: Mon Apr 4 01:42:05 2022 +0200 arm64: dts: imx8mn: Fix SAI nodes The most specific compatible string element should be "fsl,imx8mn-sai" on i.MX8M Nano, fix it from current "fsl,imx8mm-sai" (two Ms, likely due to copy-paste error from i.MX8M Mini). Fixes: 9e9860069725f ("arm64: dts: imx8mn: Add SAI nodes") Signed-off-by: Marek Vasut Cc: Adam Ford Cc: Fabio Estevam Cc: Peng Fan Cc: Shawn Guo Cc: NXP Linux Team To: linux-arm-kernel@lists.infradead.org Reviewed-by: Adam Ford Signed-off-by: Shawn Guo arch/arm64/boot/dts/freescale/imx8mn.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit c4212f3eb89fd5654f0a6ed2ee1d13fcb86cb664 Author: Jens Axboe Date: Sun Apr 10 15:13:24 2022 -0600 io_uring: flag the fact that linked file assignment is sane Give applications a way to tell if the kernel supports sane linked files, as in files being assigned at the right time to be able to reliably do while using IOSQE_IO_LINK to order them. Not really a bug fix, but flag it as such so that it gets pulled in with backports of the deferred file assignment. Fixes: 6bf9c47a3989 ("io_uring: defer file assignment") Signed-off-by: Jens Axboe fs/io_uring.c | 3 ++- include/uapi/linux/io_uring.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) commit c7b45c79fb279e539346919a5c196e417925719e Author: Alexander Stein Date: Thu Mar 31 15:02:06 2022 +0200 arm64: dts: imx8mq-tqma8mq: change the spi-nor tx This fixes the qspi read command by importing the changes from commit 04aa946d57b2 ("arm64: dts: imx8: change the spi-nor tx"). Fixes: b186b8b6e770 ("arm64: dts: freescale: add initial device tree for TQMa8Mx with i.MX8M") Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo arch/arm64/boot/dts/freescale/imx8mq-tqma8mq.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e Author: Linus Torvalds Date: Sun Apr 10 14:21:36 2022 -1000 Linux 5.18-rc2 Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8b57b3046107b50ebecb65537a172ef3d6cec673 Merge: 95aa17c36dc8 dbf3f0932214 Author: Linus Torvalds Date: Sun Apr 10 10:08:50 2022 -1000 Merge tag 'tty-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull serial driver fix from Greg KH: "This is a single serial driver fix for a build issue that showed up due to changes that came in through the tty tree in 5.18-rc1 that were missed previously. It resolves a build error with the mpc52xx_uart driver. It has been in linux-next this week with no reported problems" * tag 'tty-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: tty: serial: mpc52xx_uart: make rx/tx hooks return unsigned, part II. commit 95aa17c36dc89bf008753217ed27f8a8eb5faf79 Merge: 33563138ac2f 20314bacd2f9 Author: Linus Torvalds Date: Sun Apr 10 10:04:30 2022 -1000 Merge tag 'staging-5.18-rc2' 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 5.18-rc2 that resolves an endian issue for the r8188eu driver. It has been in linux-next all this week with no reported problems" * tag 'staging-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: r8188eu: Fix PPPoE tag insertion on little endian systems commit 33563138ac2fa38fd4fb9fc79a2c29be4ea65642 Merge: f58d3410c558 cdb4f26a63c3 Author: Linus Torvalds Date: Sun Apr 10 09:55:09 2022 -1000 Merge tag 'driver-core-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here are two small driver core changes for 5.18-rc2. They are the final bits in the removal of the default_attrs field in struct kobj_type. I had to wait until after 5.18-rc1 for all of the changes to do this came in through different development trees, and then one new user snuck in. So this series has two changes: - removal of the default_attrs field in the powerpc/pseries/vas code. The change has been acked by the PPC maintainers to come through this tree - removal of default_attrs from struct kobj_type now that all in-kernel users are removed. This cleans up the kobject code a little bit and removes some duplicated functionality that confused people (now there is only one way to do default groups) Both of these have been in linux-next for all of this week with no reported problems" * tag 'driver-core-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: kobject: kobj_type: remove default_attrs powerpc/pseries/vas: use default_groups in kobj_type commit f58d3410c5586bc22ceae2e65a17754378fc4a7c Merge: 4ea3c6425269 94865e2dcb46 Author: Linus Torvalds Date: Sun Apr 10 09:52:46 2022 -1000 Merge tag 'char-misc-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fix from Greg KH: "A single driver fix. It resolves the build warning issue on 32bit systems in the habannalabs driver that came in during the 5.18-rc1 merge cycle. It has been in linux-next for all this week with no reported problems" * tag 'char-misc-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: habanalabs: Fix test build failures commit 4ea3c6425269d33da53c79d539ce9554117cf4d4 Merge: 1519610b5337 1ff5c8e8c835 Author: Linus Torvalds Date: Sun Apr 10 07:36:18 2022 -1000 Merge tag 'powerpc-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix KVM "lost kick" race, where an attempt to pull a vcpu out of the guest could be lost (or delayed until the next guest exit). - Disable SCV (system call vectored) when PR KVM guests could be run. - Fix KVM PR guests using SCV, by disallowing AIL != 0 for KVM PR guests. - Add a new KVM CAP to indicate if AIL == 3 is supported. - Fix a regression when hotplugging a CPU to a memoryless/cpuless node. - Make virt_addr_valid() stricter for 64-bit Book3E & 32-bit, which fixes crashes seen due to hardened usercopy. - Revert a change to max_mapnr which broke HIGHMEM. Thanks to Christophe Leroy, Fabiano Rosas, Kefeng Wang, Nicholas Piggin, and Srikar Dronamraju. * tag 'powerpc-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: Revert "powerpc: Set max_mapnr correctly" powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit KVM: PPC: Move kvmhv_on_pseries() into kvm_ppc.h powerpc/numa: Handle partially initialized numa nodes powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S KVM: PPC: Use KVM_CAP_PPC_AIL_MODE_3 KVM: PPC: Book3S PR: Disallow AIL != 0 KVM: PPC: Book3S PR: Disable SCV when AIL could be disabled KVM: PPC: Book3S HV P9: Fix "lost kick" race commit 1519610b533754c600effd8e25cd4aa44951a6a5 Merge: 9c6913b7499c 63ef1a8a07ef Author: Linus Torvalds Date: Sun Apr 10 07:25:49 2022 -1000 Merge tag 'irq-urgent-2022-04-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fixes from Thomas Gleixner: "A set of interrupt chip driver fixes: - A fix for a long standing bug in the ARM GICv3 redistributor polling which uses the wrong bit number to test. - Prevent translation of bogus ACPI table entries which map device interrupts into the IPI space on ARM GICs. - Don't write into the pending register of ARM GICV4 before the scan in hardware has completed. - A set of build and correctness fixes for the Qualcomm MPM driver" * tag 'irq-urgent-2022-04-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/gic, gic-v3: Prevent GSI to SGI translations irqchip/gic-v3: Fix GICR_CTLR.RWP polling irqchip/gic-v4: Wait for GICR_VPENDBASER.Dirty to clear before descheduling irqchip/irq-qcom-mpm: fix return value check in qcom_mpm_init() irq/qcom-mpm: Fix build error without MAILBOX commit 9c6913b7499cca943776cb0b02ea282113625580 Merge: b51f86e9900a 59b18a1e65b7 Author: Linus Torvalds Date: Sun Apr 10 07:12:27 2022 -1000 Merge tag 'x86_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Fix the MSI message data struct definition - Use local labels in the exception table macros to avoid symbol conflicts with clang LTO builds - A couple of fixes to objtool checking of the relatively newly added SLS and IBT code - Rename a local var in the WARN* macro machinery to prevent shadowing * tag 'x86_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/msi: Fix msi message data shadow struct x86/extable: Prefer local labels in .set directives x86,bpf: Avoid IBT objtool warning objtool: Fix SLS validation for kcov tail-call replacement objtool: Fix IBT tail-call detection x86/bug: Prevent shadowing in __WARN_FLAGS x86/mm/tlb: Revert retpoline avoidance approach commit b51f86e9900ab1ff05fb5674c17fd3cb858c4500 Merge: 50c94de67cfc e19cd0b6fa59 Author: Linus Torvalds Date: Sun Apr 10 07:08:22 2022 -1000 Merge tag 'perf_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - A couple of fixes to cgroup-related handling of perf events - A couple of fixes to event encoding on Sapphire Rapids - Pass event caps of inherited events so that perf doesn't fail wrongly at fork() - Add support for a new Raptor Lake CPU * tag 'perf_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Always set cpuctx cgrp when enable cgroup event perf/core: Fix perf_cgroup_switch() perf/core: Use perf_cgroup_info->active to check if cgroup is active perf/core: Don't pass task around when ctx sched in perf/x86/intel: Update the FRONTEND MSR mask on Sapphire Rapids perf/x86/intel: Don't extend the pseudo-encoding to GP counters perf/core: Inherit event_caps perf/x86/uncore: Add Raptor Lake uncore support perf/x86/msr: Add Raptor Lake CPU support perf/x86/cstate: Add Raptor Lake support perf/x86: Add Intel Raptor Lake support commit de3b9fe9609a05d3c354c6718ca657962d11d9fe Author: Dan Carpenter Date: Mon Apr 4 14:42:44 2022 +0300 iio:dac:ad3552r: Fix an IS_ERR() vs NULL check The fwnode_get_named_child_node() function does not return error pointers. It returns NULL. Update the check accordingly. Fixes: 8f2b54824b28 ("drivers:iio:dac: Add AD3552R driver support") Signed-off-by: Dan Carpenter Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220404114244.GA19201@kili Signed-off-by: Jonathan Cameron drivers/iio/dac/ad3552r.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 50c94de67cfcf858d32a868dcc4e40d8581137c1 Merge: 7136849ea952 273ba85b5e8b Author: Linus Torvalds Date: Sun Apr 10 06:56:46 2022 -1000 Merge tag 'locking_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fixes from Borislav Petkov: - Allow the compiler to optimize away unused percpu accesses and change the local_lock_* macros back to inline functions - A couple of fixes to static call insn patching * tag 'locking_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Revert "mm/page_alloc: mark pagesets as __maybe_unused" Revert "locking/local_lock: Make the empty local_lock_*() function a macro." x86/percpu: Remove volatile from arch_raw_cpu_ptr(). static_call: Remove __DEFINE_STATIC_CALL macro static_call: Properly initialise DEFINE_STATIC_CALL_RET0() static_call: Don't make __static_call_return0 static x86,static_call: Fix __static_call_return0 for i386 commit d79478a79cfa393cde46bccb05d52fc7d875d2e2 Author: Gwendal Grignou Date: Wed Apr 6 09:50:04 2022 -0700 iio: sx9324: Fix default precharge internal resistance register Fix the default value for the register that set the resistance: it has to be 0x10 per datasheet. Fixes: 4c18a890dff8d ("iio:proximity:sx9324: Add SX9324 support") Cc: stable@vger.kernel.org Signed-off-by: Gwendal Grignou Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20220406165011.10202-2-gwendal@chromium.org Signed-off-by: Jonathan Cameron drivers/iio/proximity/sx9324.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 7136849ea95280685dc6a00a893501e61983b6b9 Merge: 1862a69c9174 0a70045ed851 Author: Linus Torvalds Date: Sun Apr 10 06:47:49 2022 -1000 Merge tag 'sched_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Borislav Petkov: - Use the correct static key checking primitive on the IRQ exit path - Two fixes for the new forceidle balancer * tag 'sched_urgent_for_v5.18_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: entry: Fix compile error in dynamic_irqentry_exit_cond_resched() sched: Teach the forced-newidle balancer about CPU affinity limitation. sched/core: Fix forceidle balancing commit 89a01cd688d3c0ac983ef0b0e5f40018ab768317 Author: Michael Hennerich Date: Wed Apr 6 12:56:20 2022 +0200 iio: dac: ad5446: Fix read_raw not returning set value read_raw should return the un-scaled value. Fixes: 5e06bdfb46e8b ("staging:iio:dac:ad5446: Return cached value for 'raw' attribute") Signed-off-by: Michael Hennerich Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220406105620.1171340-1-michael.hennerich@analog.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/dac/ad5446.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a25d5887821e242e5ea8388d8461ff20bedb0729 Author: Heiko Carstens Date: Thu Apr 7 13:40:27 2022 +0200 s390: update defconfigs Signed-off-by: Heiko Carstens arch/s390/configs/debug_defconfig | 7 +++++-- arch/s390/configs/defconfig | 6 ++++-- arch/s390/configs/zfcpdump_defconfig | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) commit 3a26787dacf04257a68b16315c984eb2c340bc5e Author: Zheyu Ma Date: Sat Apr 9 11:48:49 2022 +0800 iio: magnetometer: ak8975: Fix the error handling in ak8975_power_on() When the driver fails to enable the regulator 'vid', we will get the following splat: [ 79.955610] WARNING: CPU: 5 PID: 441 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0 [ 79.959641] RIP: 0010:_regulator_put+0x3ec/0x4e0 [ 79.967570] Call Trace: [ 79.967773] [ 79.967951] regulator_put+0x1f/0x30 [ 79.968254] devres_release_group+0x319/0x3d0 [ 79.968608] i2c_device_probe+0x766/0x940 Fix this by disabling the 'vdd' regulator when failing to enable 'vid' regulator. Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220409034849.3717231-2-zheyuma97@gmail.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/magnetometer/ak8975.c | 1 + 1 file changed, 1 insertion(+) commit 5a6b06f5927c940fa44026695779c30b7536474c Author: Toke Høiland-Jørgensen Date: Mon Apr 4 22:48:00 2022 +0200 ath9k: Fix usage of driver-private space in tx_info The ieee80211_tx_info_clear_status() helper also clears the rate counts and the driver-private part of struct ieee80211_tx_info, so using it breaks quite a few other things. So back out of using it, and instead define a ath-internal helper that only clears the area between the status_driver_data and the rates info. Combined with moving the ath_frame_info struct to status_driver_data, this avoids clearing anything we shouldn't be, and so we can keep the existing code for handling the rate information. While fixing this I also noticed that the setting of tx_info->status.rates[tx_rateindex].count on hardware underrun errors was always immediately overridden by the normal setting of the same fields, so rearrange the code so that the underrun detection actually takes effect. The new helper could be generalised to a 'memset_between()' helper, but leave it as a driver-internal helper for now since this needs to go to stable. Cc: stable@vger.kernel.org Reported-by: Peter Seiderer Fixes: 037250f0a45c ("ath9k: Properly clear TX status area before reporting to mac80211") Signed-off-by: Toke Høiland-Jørgensen Reviewed-by: Peter Seiderer Tested-by: Peter Seiderer Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220404204800.2681133-1-toke@toke.dk drivers/net/wireless/ath/ath9k/main.c | 2 +- drivers/net/wireless/ath/ath9k/xmit.c | 30 ++++++++++++++++++++---------- 2 files changed, 21 insertions(+), 11 deletions(-) commit 6fb3a5868b2117611f41e421e10e6a8c2a13039a Author: Borislav Petkov Date: Tue Apr 5 18:55:37 2022 +0200 brcmfmac: sdio: Fix undefined behavior due to shift overflowing the constant Fix: drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_drivestrengthinit’: drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3798:2: error: case label does not reduce to an integer constant case SDIOD_DRVSTR_KEY(BRCM_CC_43143_CHIP_ID, 17): ^~~~ drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3809:2: error: case label does not reduce to an integer constant case SDIOD_DRVSTR_KEY(BRCM_CC_43362_CHIP_ID, 13): ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Signed-off-by: Borislav Petkov Cc: Arend van Spriel Cc: Franky Lin Cc: Hante Meuleman Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: brcm80211-dev-list.pdl@broadcom.com Cc: netdev@vger.kernel.org Acked-by: Arend van Spriel Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/Ykx0iRlvtBnKqtbG@zn.tnic drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dbc2b1764734857d68425468ffa8486e97ab89df Author: Borislav Petkov Date: Tue Apr 5 17:15:14 2022 +0200 mt76: Fix undefined behavior due to shift overflowing the constant Fix: drivers/net/wireless/mediatek/mt76/mt76x2/pci.c: In function ‘mt76x2e_probe’: ././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_946’ \ declared with attribute error: FIELD_PREP: mask is not constant _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Signed-off-by: Borislav Petkov Cc: Felix Fietkau Cc: Lorenzo Bianconi Cc: Ryder Lee Cc: Shayne Chen Cc: Sean Wang Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220405151517.29753-9-bp@alien8.de drivers/net/wireless/mediatek/mt76/mt76x2/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9c95bc25ad3b1a2240cd1f896569292a57d3ce85 Author: Jiapeng Chong Date: Mon Feb 14 16:47:39 2022 +0800 tick/sched: Fix non-kernel-doc comment Fixes the following W=1 kernel build warning: kernel/time/tick-sched.c:1563: warning: This comment starts with '/**', but isn't a kernel-doc comment. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220214084739.63228-1-jiapeng.chong@linux.alibaba.com kernel/time/tick-sched.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 40e97e42961f8c6cc7bd5fe67cc18417e02d78f1 Author: Paul Gortmaker Date: Mon Dec 6 09:59:50 2021 -0500 tick/nohz: Use WARN_ON_ONCE() to prevent console saturation While running some testing on code that happened to allow the variable tick_nohz_full_running to get set but with no "possible" NOHZ cores to back up that setting, this warning triggered: if (unlikely(tick_do_timer_cpu == TICK_DO_TIMER_NONE)) WARN_ON(tick_nohz_full_running); The console was overwhemled with an endless stream of one WARN per tick per core and there was no way to even see what was going on w/o using a serial console to capture it and then trace it back to this. Change it to WARN_ON_ONCE(). Fixes: 08ae95f4fd3b ("nohz_full: Allow the boot CPU to be nohz_full") Signed-off-by: Paul Gortmaker Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211206145950.10927-3-paul.gortmaker@windriver.com kernel/time/tick-sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fa51e1dc4b91375bc18349663a52395ad585bd3c Author: Fabio Estevam Date: Sat Mar 26 12:14:55 2022 -0300 ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue On a custom carrier board with a i.MX6Q Apalis SoM, the sgtl5000 codec on the SoM is often not detected and the following error message is seen when the sgtl5000 driver tries to read the ID register: sgtl5000 1-000a: Error reading chip id -6 The reason for the error is that the MCLK clock is not provided early enough. Fix the problem by describing the MCLK pinctrl inside the codec node instead of placing it inside the audmux pinctrl group. With this change applied the sgtl5000 is always detected on every boot. Fixes: 693e3ffaae5a ("ARM: dts: imx6: Add support for Toradex Apalis iMX6Q/D SoM") Signed-off-by: Fabio Estevam Reviewed-by: Tim Harvey Acked-by: Max Krummenacher Signed-off-by: Shawn Guo arch/arm/boot/dts/imx6qdl-apalis.dtsi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 1862a69c917417142190bc18c8ce16680598664b Merge: 94a4c2bb7a1f 940a445a9040 Author: Linus Torvalds Date: Sat Apr 9 18:45:10 2022 -1000 Merge tag 'perf-tools-fixes-for-v5.18-2022-04-09' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix the clang command line option probing and remove some options to filter out, fixing the build with the latest clang versions - Fix 'perf bench' futex and epoll benchmarks to deal with machines with more than 1K CPUs - Fix 'perf test tsc' error message when not supported - Remap perf ring buffer if there is no space for event, fixing perf usage in 32-bit ChromeOS - Drop objdump stderr to avoid getting stuck waiting for stdout output in 'perf annotate' - Fix up garbled output by now showing unwind error messages when augmenting frame in best effort mode - Fix perf's libperf_print callback, use the va_args eprintf() variant - Sync vhost and arm64 cputype headers with the kernel sources - Fix 'perf report --mem-mode' with ARM SPE - Add missing external commands ('iiostat', etc) to 'perf --list-cmds' * tag 'perf-tools-fixes-for-v5.18-2022-04-09' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf annotate: Drop objdump stderr to avoid getting stuck waiting for stdout output perf tools: Add external commands to list-cmds perf docs: Add perf-iostat link to manpages perf session: Remap buf if there is no space for event perf bench: Fix epoll bench to correct usage of affinity for machines with #CPUs > 1K perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K perf tools: Fix perf's libperf_print callback perf: arm-spe: Fix perf report --mem-mode perf unwind: Don't show unwind error messages when augmenting frame pointer stack tools headers arm64: Sync arm64's cputype.h with the kernel sources perf test tsc: Fix error message when not supported perf build: Don't use -ffat-lto-objects in the python feature test when building with clang-13 perf python: Fix probing for some clang command line options tools build: Filter out options and warnings not supported by clang tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts tools include UAPI: Sync linux/vhost.h with the kernel sources commit 94a4c2bb7a1fb95bd7105ac5685377f57c13daf3 Merge: fa3b895da8e0 d28820419ca3 Author: Linus Torvalds Date: Sat Apr 9 18:31:59 2022 -1000 Merge tag 'cxl+nvdimm-for-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull cxl and nvdimm fixes from Dan Williams: - Fix a compile error in the nvdimm unit tests - Fix a shadowed variable warning in the CXL PCI driver * tag 'cxl+nvdimm-for-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: cxl/pci: Drop shadowed variable tools/testing/nvdimm: Fix security_init() symbol collision commit fa3b895da8e06d6e3dcf3e6941a3fd428343e3d7 Merge: e1f700ebd6be 5467801f1fcb Author: Linus Torvalds Date: Sat Apr 9 18:17:43 2022 -1000 Merge tag 'gpio-fixes-for-v5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fix from Bartosz Golaszewski: - fix a race condition with consumers accessing the fields of GPIO IRQ chips before they're fully initialized * tag 'gpio-fixes-for-v5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: Restrict usage of GPIO chip irq members before initialization commit e2aa165cd0163cef83cb295eb572aa9fb1604cf4 Author: Adam Ford Date: Sun Mar 20 15:52:12 2022 -0500 soc: imx: imx8m-blk-ctrl: Fix IMX8MN_DISPBLK_PD_ISI hang The imx8mn clock list for the ISI lists four clocks, but DOMAIN_MAX_CLKS was set to 3. Because of this, attempts to enable the fourth clock failed, threw some splat, and ultimately hung. Fixes: 7f511d514e8c ("soc: imx: imx8m-blk-ctrl: add i.MX8MN DISP blk-ctrl") Signed-off-by: Adam Ford Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo drivers/soc/imx/imx8m-blk-ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 63ef1a8a07ef64f802af1adadae3b05ba824c534 Merge: 312310928417 544808f7e21c Author: Thomas Gleixner Date: Sat Apr 9 22:21:55 2022 +0200 Merge tag 'irqchip-fixes-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent Pull irqchip fixes from Marc Zyngier: - Fix GICv3 polling for RWP in redistributors - Reject ACPI attempts to use SGIs on GIC/GICv3 - Fix unpredictible behaviour when making a VPE non-resident with GICv4 - A couple of fixes for the newly merged qcom-mpm driver Link: https://lore.kernel.org/lkml/20220409094229.267649-1-maz@kernel.org commit c54bc0fc84214b203f7a0ebfd1bd308ce2abe920 Author: Anna-Maria Behnsen Date: Tue Apr 5 21:17:32 2022 +0200 timers: Fix warning condition in __run_timers() When the timer base is empty, base::next_expiry is set to base::clk + NEXT_TIMER_MAX_DELTA and base::next_expiry_recalc is false. When no timer is queued until jiffies reaches base::next_expiry value, the warning for not finding any expired timer and base::next_expiry_recalc is false in __run_timers() triggers. To prevent triggering the warning in this valid scenario base::timers_pending needs to be added to the warning condition. Fixes: 31cd0e119d50 ("timers: Recalculate next timer interrupt only when necessary") Reported-by: Johannes Berg Signed-off-by: Anna-Maria Behnsen Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20220405191732.7438-3-anna-maria@linutronix.de kernel/time/timer.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 940a445a904088eac715dd985c01847311a42459 Author: Ian Rogers Date: Thu Apr 7 16:04:59 2022 -0700 perf annotate: Drop objdump stderr to avoid getting stuck waiting for stdout output If objdump writes to stderr it can block waiting for it to be read. As perf doesn't read stderr then progress stops with perf waiting for stdout output. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Dave Marchevsky Cc: Denis Nikitin Cc: German Gomez Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Lexi Shao Cc: Li Huafei Cc: Mark Rutland Cc: Martin Liška Cc: Masami Hiramatsu Cc: Mathieu Poirier Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Remi Bernon Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Thomas Richter Cc: Will Deacon Cc: William Cohen Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20220407230503.1265036-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/annotate.c | 1 + 1 file changed, 1 insertion(+) commit 3e6b43beb7b56ac6fd376c84f06d90ded73a2788 Author: Michael Petlan Date: Tue Apr 5 00:15:41 2022 +0200 perf tools: Add external commands to list-cmds The `perf --list-cmds` output prints only internal commands, although there is no reason for that from users' perspective. Adding the external commands to commands array with NULL function pointer allows printing all perf commands while not changing the logic of command handler selection. Signed-off-by: Michael Petlan Acked-by: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220404221541.30312-2-mpetlan@redhat.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/perf.c | 4 ++++ 1 file changed, 4 insertions(+) commit 0ff26efe92844aa3910eff8951739d44a5ab6493 Author: Michael Petlan Date: Tue Apr 5 00:15:40 2022 +0200 perf docs: Add perf-iostat link to manpages Signed-off-by: Michael Petlan Acked-by: Ian Rogers Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220404221541.30312-1-mpetlan@redhat.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/Documentation/perf.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bc21e74d4775f883ae1f542c1f1dc7205b15d925 Author: Denis Nikitin Date: Tue Mar 29 20:11:30 2022 -0700 perf session: Remap buf if there is no space for event If a perf event doesn't fit into remaining buffer space return NULL to remap buf and fetch the event again. Keep the logic to error out on inadequate input from fuzzing. This fixes perf failing on ChromeOS (with 32b userspace): $ perf report -v -i perf.data ... prefetch_event: head=0x1fffff8 event->header_size=0x30, mmap_size=0x2000000: fuzzed or compressed perf.data? Error: failed to process sample Fixes: 57fc032ad643ffd0 ("perf session: Avoid infinite loop when seeing invalid header.size") Reviewed-by: James Clark Signed-off-by: Denis Nikitin Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Alexey Budankov Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220330031130.2152327-1-denik@chromium.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/session.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit e1f700ebd6bea293abe3c7e2807b252018efde01 Merge: f1b45d8ccb98 56495f295d8e Author: Linus Torvalds Date: Sat Apr 9 06:05:46 2022 -1000 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: - add support for new devices (ufs, mvsas) - a major set of fixes in lpfc - get rid of a driver specific ioctl in pcmraid - a major rework of aha152x to get rid of the scsi_pointer. - minor fixes and obvious changes including several spelling updates. * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (36 commits) scsi: megaraid_sas: Target with invalid LUN ID is deleted during scan scsi: ufs: ufshpb: Fix a NULL check on list iterator scsi: sd: Clean up gendisk if device_add_disk() failed scsi: message: fusion: Remove redundant variable dmp scsi: mvsas: Add PCI ID of RocketRaid 2640 scsi: sd: sd_read_cpr() requires VPD pages scsi: mpt3sas: Fail reset operation if config request timed out scsi: sym53c500_cs: Stop using struct scsi_pointer scsi: ufs: ufs-pci: Add support for Intel MTL scsi: mpt3sas: Fix mpt3sas_check_same_4gb_region() kdoc comment scsi: scsi_debug: Fix sdebug_blk_mq_poll() in_use_bm bitmap use scsi: bnx2i: Fix spelling mistake "mis-match" -> "mismatch" scsi: bnx2fc: Fix spelling mistake "mis-match" -> "mismatch" scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one() scsi: aic7xxx: Use standard PCI subsystem, subdevice defines scsi: ufs: qcom: Drop custom Android boot parameters scsi: core: sysfs: Remove comments that conflict with the actual logic scsi: hisi_sas: Remove stray fallthrough annotation scsi: virtio-scsi: Eliminate anonymous module_init & module_exit scsi: isci: Fix spelling mistake "doesnt" -> "doesn't" ... commit 3ae87d2f25c0e998da2721ce332e2b80d3d53c39 Author: Piotr Chmura Date: Thu Mar 31 17:55:50 2022 +0200 media: si2157: unknown chip version Si2147-A30 ROM 0x50 Fix firmware file names assignment in si2157 tuner, allow for running devices without firmware files needed. modprobe gives error: unknown chip version Si2147-A30 ROM 0x50 Device initialization is interrupted. Caused by: 1. table si2157_tuners has swapped fields rom_id and required vs struct si2157_tuner_info. 2. both firmware file names can be null for devices with required == false - device uses build-in firmware in this case Tested on this device: m07ca:1871 AVerMedia Technologies, Inc. TD310 DVB-T/T2/C dongle [mchehab: fix mangled patch] Link: https://bugzilla.kernel.org/show_bug.cgi?id=215726 Link: https://lore.kernel.org/lkml/5f660108-8812-383c-83e4-29ee0558d623@leemhuis.info/ Link: https://lore.kernel.org/linux-media/c4bcaff8-fbad-969e-ad47-e2c487ac02a1@gmail.com Fixes: 1c35ba3bf972 ("media: si2157: use a different namespace for firmware") Cc: stable@vger.kernel.org # 5.17.x Signed-off-by: Piotr Chmura Tested-by: Robert Schlabbach Signed-off-by: Mauro Carvalho Chehab drivers/media/tuners/si2157.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) commit 299687e18a06aa648c8d4ebb025b322ac83fe7dd Author: Athira Rajeev Date: Wed Apr 6 23:21:11 2022 +0530 perf bench: Fix epoll bench to correct usage of affinity for machines with #CPUs > 1K The 'perf bench epoll' testcase fails on systems with more than 1K CPUs. Testcase: perf bench epoll all Result snippet: <<>> Run summary [PID 106497]: 1399 threads monitoring on 64 file-descriptors for 8 secs. perf: pthread_create: No such file or directory <<>> In epoll benchmarks (ctl, wait) pthread_create is invoked in do_threads from respective bench_epoll_* function. Though the logs shows direct failure from pthread_create, the actual failure is from "sched_setaffinity" returning EINVAL (invalid argument). This happens because the default mask size in glibc is 1024. To overcome this 1024 CPUs mask size limitation of cpu_set_t, change the mask size using the CPU_*_S macros. Patch addresses this by fixing all the epoll benchmarks to use CPU_ALLOC to allocate cpumask, CPU_ALLOC_SIZE for size, and CPU_SET_S to set the mask. Reported-by: Disha Goel Signed-off-by: Athira Jajeev Tested-by: Disha Goel Acked-by: Ian Rogers Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nageswara R Sastry Cc: Srikar Dronamraju Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20220406175113.87881-3-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/bench/epoll-ctl.c | 25 +++++++++++++++++++------ tools/perf/bench/epoll-wait.c | 25 +++++++++++++++++++------ 2 files changed, 38 insertions(+), 12 deletions(-) commit c9c2a427dd9fe0e73eceacafb42d54f3c4535693 Author: Athira Rajeev Date: Wed Apr 6 23:21:10 2022 +0530 perf bench: Fix futex bench to correct usage of affinity for machines with #CPUs > 1K The 'perf bench futex' testcase fails on systems with more than 1K CPUs. Testcase: perf bench futex all Failure snippet: <<>>Running futex/hash benchmark... perf: pthread_create: No such file or directory <<>> All the futex benchmarks (ie hash, lock-api, requeue, wake, wake-parallel), pthread_create is invoked in respective bench_futex_* function. Though the logs shows direct failure from pthread_create, strace logs showed that actual failure is from "sched_setaffinity" returning EINVAL (invalid argument). This happens because the default mask size in glibc is 1024. To overcome this 1024 CPUs mask size limitation of cpu_set_t, change the mask size using the CPU_*_S macros. Patch addresses this by fixing all the futex benchmarks to use CPU_ALLOC to allocate cpumask, CPU_ALLOC_SIZE for size, and CPU_SET_S to set the mask. Reported-by: Disha Goel Reviewed-by: Srikar Dronamraju Signed-off-by: Athira Jajeev Tested-by: Disha Goel Acked-by: Ian Rogers 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/20220406175113.87881-2-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/bench/futex-hash.c | 26 +++++++++++++++++++------- tools/perf/bench/futex-lock-pi.c | 21 ++++++++++++++++----- tools/perf/bench/futex-requeue.c | 21 ++++++++++++++++----- tools/perf/bench/futex-wake-parallel.c | 21 ++++++++++++++++----- tools/perf/bench/futex-wake.c | 22 ++++++++++++++++------ 5 files changed, 83 insertions(+), 28 deletions(-) commit aeee9dc53ce405d2161f9915f553114e94e5b677 Author: Adrian Hunter Date: Fri Apr 8 16:26:25 2022 +0300 perf tools: Fix perf's libperf_print callback eprintf() does not expect va_list as the type of the 4th parameter. Use veprintf() because it does. Signed-off-by: Adrian Hunter Fixes: 428dab813a56ce94 ("libperf: Merge libperf_set_print() into libperf_init()") Cc: Jiri Olsa Link: https://lore.kernel.org/r/20220408132625.2451452-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ffab487052054162b3b6c9c6005777ec6cfcea05 Author: James Clark Date: Fri Apr 8 15:40:56 2022 +0100 perf: arm-spe: Fix perf report --mem-mode Since commit bb30acae4c4dacfa ("perf report: Bail out --mem-mode if mem info is not available") "perf mem report" and "perf report --mem-mode" don't allow opening the file unless one of the events has PERF_SAMPLE_DATA_SRC set. SPE doesn't have this set even though synthetic memory data is generated after it is decoded. Fix this issue by setting DATA_SRC on SPE events. This has no effect on the data collected because the SPE driver doesn't do anything with that flag and doesn't generate samples. Fixes: bb30acae4c4dacfa ("perf report: Bail out --mem-mode if mem info is not available") Signed-off-by: James Clark Tested-by: Leo Yan Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: German Gomez Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: linux-arm-kernel@lists.infradead.org Cc: Mark Rutland Cc: Mathieu Poirier Cc: Ravi Bangoria Cc: Will Deacon Link: https://lore.kernel.org/r/20220408144056.1955535-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/arch/arm64/util/arm-spe.c | 6 ++++++ 1 file changed, 6 insertions(+) commit fa7095c5c3240bb2ecbc77f8b69be9b1d9e2cf60 Author: James Clark Date: Wed Apr 6 15:56:51 2022 +0100 perf unwind: Don't show unwind error messages when augmenting frame pointer stack Commit Fixes: b9f6fbb3b2c29736 ("perf arm64: Inject missing frames when using 'perf record --call-graph=fp'") intended to add a 'best effort' DWARF unwind that improved the frame pointer stack in most scenarios. It's expected that the unwind will fail sometimes, but this shouldn't be reported as an error. It only works when the return address can be determined from the contents of the link register alone. Fix the error shown when the unwinder requires extra registers by adding a new flag that suppresses error messages. This flag is not set in the normal --call-graph=dwarf unwind mode so that behavior is not changed. Fixes: b9f6fbb3b2c29736 ("perf arm64: Inject missing frames when using 'perf record --call-graph=fp'") Reported-by: John Garry Signed-off-by: James Clark Tested-by: John Garry Cc: Alexander Shishkin Cc: Alexandre Truong Cc: German Gomez Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220406145651.1392529-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/tests/dwarf-unwind.c | 2 +- tools/perf/util/arm64-frame-pointer-unwind-support.c | 2 +- tools/perf/util/machine.c | 2 +- tools/perf/util/unwind-libdw.c | 10 +++++++--- tools/perf/util/unwind-libdw.h | 1 + tools/perf/util/unwind-libunwind-local.c | 10 +++++++--- tools/perf/util/unwind-libunwind.c | 6 ++++-- tools/perf/util/unwind.h | 13 ++++++++++--- 8 files changed, 32 insertions(+), 14 deletions(-) commit 278aaba2c555a54e62aec40e04defaa9fffcc1c9 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: 83bea32ac7ed37bb ("arm64: Add part number for Arm Cortex-A78AE") 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: Ali Saidi Cc: Andrew Kilroy Cc: Chanho Park Cc: German Gomez Cc: James Clark Cc: John Garry Cc: Leo Yan Cc: Will Deacon Link: http://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo tools/arch/arm64/include/asm/cputype.h | 2 ++ 1 file changed, 2 insertions(+) commit 290fa68bdc4588637849adb8534301a1e62beee2 Author: Chengdong Li Date: Fri Apr 8 16:47:48 2022 +0800 perf test tsc: Fix error message when not supported By default `perf test tsc` does not return the error message when the child process detected kernel does not support it. Instead, the child process prints an error message to stderr, unfortunately stderr is redirected to /dev/null when verbose <= 0. This patch does: - return TEST_SKIP to the parent process instead of TEST_OK when perf_read_tsc_conversion() is not supported. - Add a new subtest of testing if TSC is supported on current architecture by moving exist code to a separate function. It avoids two places in test__perf_time_to_tsc() that return TEST_SKIP by doing this. - Extend the test suite definition to contain above two subtests. Current test_suite and test_case structs do not support printing skip reason when the number of subtest less than 1. To print skip reason, it is necessary to extend current test suite definition. Reviewed-by: Adrian Hunter Signed-off-by: Chengdong Li Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: likexu@tencent.com Link: https://lore.kernel.org/r/20220408084748.43707-1-chengdongli@tencent.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/tests/perf-time-to-tsc.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) commit 3a8a0475861a443f02e3a9b57d044fe2a0a99291 Author: Arnaldo Carvalho de Melo Date: Thu Apr 7 11:04:20 2022 -0300 perf build: Don't use -ffat-lto-objects in the python feature test when building with clang-13 Using -ffat-lto-objects in the python feature test when building with clang-13 results in: clang-13: error: optimization flag '-ffat-lto-objects' is not supported [-Werror,-Wignored-optimization-argument] error: command '/usr/sbin/clang' failed with exit code 1 cp: cannot stat '/tmp/build/perf/python_ext_build/lib/perf*.so': No such file or directory make[2]: *** [Makefile.perf:639: /tmp/build/perf/python/perf.so] Error 1 Noticed when building on a docker.io/library/archlinux:base container. Cc: Adrian Hunter Cc: Fangrui Song Cc: Florian Fainelli Cc: Ian Rogers Cc: Jiri Olsa Cc: John Keeping Cc: Leo Yan Cc: Michael Petlan Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Sedat Dilek Signed-off-by: Arnaldo Carvalho de Melo tools/perf/Makefile.config | 3 +++ tools/perf/util/setup.py | 2 ++ 2 files changed, 5 insertions(+) commit dd6e1fe91cdd52774ca642d1da75b58a86356b56 Author: Arnaldo Carvalho de Melo Date: Fri Apr 8 10:08:07 2022 -0300 perf python: Fix probing for some clang command line options The clang compiler complains about some options even without a source file being available, while others require one, so use the simple tools/build/feature/test-hello.c file. Then check for the "is not supported" string in its output, in addition to the "unknown argument" already being looked for. This was noticed when building with clang-13 where -ffat-lto-objects isn't supported and since we were looking just for "unknown argument" and not providing a source code to clang, was mistakenly assumed as being available and not being filtered to set of command line options provided to clang, leading to a build failure. Cc: Adrian Hunter Cc: Fangrui Song Cc: Florian Fainelli Cc: Ian Rogers Cc: Jiri Olsa Cc: John Keeping Cc: Leo Yan Cc: Michael Petlan Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Sedat Dilek Link: http://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 41caff459a5b956b3e23ba9ca759dd0629ad3dda Author: Arnaldo Carvalho de Melo Date: Tue Apr 5 10:33:21 2022 -0300 tools build: Filter out options and warnings not supported by clang These make the feature check fail when using clang, so remove them just like is done in tools/perf/Makefile.config to build perf itself. Adding -Wno-compound-token-split-by-macro to tools/perf/Makefile.config when building with clang is also necessary to avoid these warnings turned into errors (-Werror): CC /tmp/build/perf/util/scripting-engines/trace-event-perl.o In file included from util/scripting-engines/trace-event-perl.c:35: In file included from /usr/lib64/perl5/CORE/perl.h:4085: In file included from /usr/lib64/perl5/CORE/hv.h:659: In file included from /usr/lib64/perl5/CORE/hv_func.h:34: In file included from /usr/lib64/perl5/CORE/sbox32_hash.h:4: /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib64/perl5/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32' #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START { \ ^~~~~~~~~~ /usr/lib64/perl5/CORE/perl.h:737:29: note: expanded from macro 'STMT_START' # define STMT_START (void)( /* gcc supports "({ STATEMENTS; })" */ ^ /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: note: '{' token is here ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib64/perl5/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32' #define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START { \ ^ /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro] ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib64/perl5/CORE/zaphod32_hash.h:87:41: note: expanded from macro 'ZAPHOD32_SCRAMBLE32' v ^= (v>>23); \ ^ /usr/lib64/perl5/CORE/zaphod32_hash.h:150:5: note: ')' token is here ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/lib64/perl5/CORE/zaphod32_hash.h:88:3: note: expanded from macro 'ZAPHOD32_SCRAMBLE32' } STMT_END ^~~~~~~~ /usr/lib64/perl5/CORE/perl.h:738:21: note: expanded from macro 'STMT_END' # define STMT_END ) ^ Please refer to the discussion on the Link: tag below, where Nathan clarifies the situation: acme> And then get to the problems at the end of this message, which seem acme> similar to the problem described here: acme> acme> From Nathan Chancellor <> acme> Subject [PATCH] mwifiex: Remove unnecessary braces from HostCmd_SET_SEQ_NO_BSS_INFO acme> acme> https://lkml.org/lkml/2020/9/1/135 acme> acme> So perhaps in this case its better to disable that acme> -Werror,-Wcompound-token-split-by-macro when building with clang? Yes, I think that is probably the best solution. As far as I can tell, at least in this file and context, the warning appears harmless, as the "create a GNU C statement expression from two different macros" is very much intentional, based on the presence of PERL_USE_GCC_BRACE_GROUPS. The warning is fixed in upstream Perl by just avoiding creating GNU C statement expressions using STMT_START and STMT_END: https://github.com/Perl/perl5/issues/18780 https://github.com/Perl/perl5/pull/18984 If I am reading the source code correctly, an alternative to disabling the warning would be specifying -DPERL_GCC_BRACE_GROUPS_FORBIDDEN but it seems like that might end up impacting more than just this site, according to the issue discussion above. Based-on-a-patch-by: Sedat Dilek Tested-by: Sedat Dilek # Debian/Selfmade LLVM-14 (x86-64) Cc: Adrian Hunter Cc: Fangrui Song Cc: Florian Fainelli Cc: Ian Rogers Cc: Jiri Olsa Cc: John Keeping Cc: Leo Yan Cc: Michael Petlan Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Link: http://lore.kernel.org/lkml/YkxWcYzph5pC1EK8@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/build/feature/Makefile | 7 +++++++ tools/perf/Makefile.config | 3 +++ 2 files changed, 10 insertions(+) commit 541f695cbcb6932c22638b06e0cbe1d56177e2e9 Author: Arnaldo Carvalho de Melo Date: Mon Apr 4 17:28:48 2022 -0300 tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts Just like its done for ldopts and for both in tools/perf/Makefile.config. Using `` to initialize PERL_EMBED_CCOPTS somehow precludes using: $(filter-out SOMETHING_TO_FILTER,$(PERL_EMBED_CCOPTS)) And we need to do it to allow for building with versions of clang where some gcc options selected by distros are not available. Tested-by: Sedat Dilek # Debian/Selfmade LLVM-14 (x86-64) Cc: Adrian Hunter Cc: Fangrui Song Cc: Florian Fainelli Cc: Ian Rogers Cc: Jiri Olsa Cc: John Keeping Cc: Leo Yan Cc: Michael Petlan Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Nick Desaulniers Link: http://lore.kernel.org/lkml/YktYX2OnLtyobRYD@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/build/feature/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b3fa25de31fb7e9afebe9599b8ff32eda13d7c94 Author: Pawel Laszczak Date: Tue Mar 29 10:46:05 2022 +0200 usb: cdns3: Fix issue for clear halt endpoint Path fixes bug which occurs during resetting endpoint in __cdns3_gadget_ep_clear_halt function. During resetting endpoint controller will change HW/DMA owned TRB. It set Abort flag in trb->control and will change trb->length field. If driver want to use the aborted trb it must update the changed field in TRB. Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") cc: Acked-by: Peter Chen Signed-off-by: Pawel Laszczak Link: https://lore.kernel.org/r/20220329084605.4022-1-pawell@cadence.com Signed-off-by: Greg Kroah-Hartman drivers/usb/cdns3/cdns3-gadget.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 33597f0c48be0836854d43c577e35c8f8a765a7d Author: Mathias Nyman Date: Fri Apr 8 16:48:23 2022 +0300 xhci: increase usb U3 -> U0 link resume timeout from 100ms to 500ms The first U3 wake signal by the host may be lost if the USB 3 connection is tunneled over USB4, with a runtime suspended USB4 host, and firmware implemented connection manager. Specs state the host must wait 100ms (tU3WakeupRetryDelay) before resending a U3 wake signal if device doesn't respond, leading to U3 -> U0 link transition times around 270ms in the tunneled case. Fixes: 0200b9f790b0 ("xhci: Wait until link state trainsits to U0 after setting USB_SS_PORT_LS_U0") Cc: stable@vger.kernel.org Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220408134823.2527272-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dc92944a014cd6a6f6c94299aaa36164dd2c238a Author: Henry Lin Date: Fri Apr 8 16:48:22 2022 +0300 xhci: stop polling roothubs after shutdown While rebooting, XHCI controller and its bus device will be shut down in order by .shutdown callback. Stopping roothubs polling in xhci_shutdown() can prevent XHCI driver from accessing port status after its bus device shutdown. Take PCIe XHCI controller as example, if XHCI driver doesn't stop roothubs polling, XHCI driver may access PCIe BAR register for port status after parent PCIe root port driver is shutdown and cause PCIe bus error. [check shared hcd exist before stopping its roothub polling -Mathias] Cc: stable@vger.kernel.org Signed-off-by: Henry Lin Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220408134823.2527272-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit e91ac20889d1a26d077cc511365cd7ff4346a6f3 Author: Weitao Wang Date: Fri Apr 8 16:48:21 2022 +0300 USB: Fix xhci event ring dequeue pointer ERDP update issue In some situations software handles TRB events slower than adding TRBs. If the number of TRB events to be processed in a given interrupt is exactly the same as the event ring size 256, then the local variable "event_ring_deq" that holds the initial dequeue position is equal to software_dequeue after handling all 256 interrupts. It will cause driver to not update ERDP to hardware, Software dequeue pointer is out of sync with ERDP on interrupt exit. On the next interrupt, the event ring may full but driver will not update ERDP as software_dequeue is equal to ERDP. [ 536.377115] xhci_hcd 0000:00:12.0: ERROR unknown event type 37 [ 566.933173] sd 8:0:0:0: [sdb] tag#27 uas_eh_abort_handler 0 uas-tag 7 inflight: CMD OUT [ 566.933181] sd 8:0:0:0: [sdb] tag#27 CDB: Write(10) 2a 00 17 71 e6 78 00 00 08 00 [ 572.041186] xhci_hcd On some situataions,the0000:00:12.0: xHCI host not responding to stop endpoint command. [ 572.057193] xhci_hcd 0000:00:12.0: Host halt failed, -110 [ 572.057196] xhci_hcd 0000:00:12.0: xHCI host controller not responding, assume dead [ 572.057236] sd 8:0:0:0: [sdb] tag#26 uas_eh_abort_handler 0 uas-tag 6 inflight: CMD [ 572.057240] sd 8:0:0:0: [sdb] tag#26 CDB: Write(10) 2a 00 38 eb cc d8 00 00 08 00 [ 572.057244] sd 8:0:0:0: [sdb] tag#25 uas_eh_abort_handler 0 uas-tag 5 inflight: CMD Hardware ERDP is updated mid event handling if there are more than 128 events in an interrupt (half of ring size). Fix this by updating the software local variable at the same time as hardware ERDP. [commit message rewording -Mathias] Fixes: dc0ffbea5729 ("usb: host: xhci: update event ring dequeue pointer on purpose") Reviewed-by: Peter Chen Signed-off-by: Weitao Wang Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220408134823.2527272-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-ring.c | 1 + 1 file changed, 1 insertion(+) commit 940442deea98b3280061095dd811e6136f1b41f6 Author: Arnaldo Carvalho de Melo Date: Tue Apr 14 09:12:55 2020 -0300 tools include UAPI: Sync linux/vhost.h with the kernel sources To get the changes in: b04d910af330b55e ("vdpa: support exposing the count of vqs to userspace") a61280ddddaa45f9 ("vdpa: support exposing the config size to userspace") Silencing this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/vhost.h' differs from latest version at 'include/uapi/linux/vhost.h' diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h $ diff -u tools/include/uapi/linux/vhost.h include/uapi/linux/vhost.h --- tools/include/uapi/linux/vhost.h 2021-07-15 16:17:01.840818309 -0300 +++ include/uapi/linux/vhost.h 2022-04-02 18:55:05.702522387 -0300 @@ -150,4 +150,11 @@ /* Get the valid iova range */ #define VHOST_VDPA_GET_IOVA_RANGE _IOR(VHOST_VIRTIO, 0x78, \ struct vhost_vdpa_iova_range) + +/* Get the config size */ +#define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32) + +/* Get the count of all virtqueues */ +#define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32) + #endif $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > before $ cp include/uapi/linux/vhost.h tools/include/uapi/linux/vhost.h $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh > after $ diff -u before after --- before 2022-04-04 14:52:25.036375145 -0300 +++ after 2022-04-04 14:52:31.906549976 -0300 @@ -38,4 +38,6 @@ [0x73] = "VDPA_GET_CONFIG", [0x76] = "VDPA_GET_VRING_NUM", [0x78] = "VDPA_GET_IOVA_RANGE", + [0x79] = "VDPA_GET_CONFIG_SIZE", + [0x80] = "VDPA_GET_VQS_COUNT", }; $ Cc: Longpeng Cc: Michael S. Tsirkin Link: https://lore.kernel.org/lkml/YksxoFcOARk%2Fldev@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/include/uapi/linux/vhost.h | 7 +++++++ 1 file changed, 7 insertions(+) commit f1b45d8ccb9839b48e5884664470e54520e17f4c Merge: 4d6f9f2475f6 286901941fd1 Author: Linus Torvalds Date: Fri Apr 8 18:58:03 2022 -1000 Merge tag 'block-5.18-2022-04-08' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Nothing major in here, just a few small fixes: - Small series of neglected drbd patches (Christoph, Lv, Xiaomeng) - Remove dead variable in cdrom (Enze)" * tag 'block-5.18-2022-04-08' of git://git.kernel.dk/linux-block: drbd: set QUEUE_FLAG_STABLE_WRITES drbd: fix an invalid memory access caused by incorrect use of list iterator drbd: Fix five use after free bugs in get_initial_state cdrom: remove unused variable commit 4d6f9f2475f6f288b8b144bc263636c0b09cb4ef Merge: f335af10482a e677edbcabee Author: Linus Torvalds Date: Fri Apr 8 18:50:14 2022 -1000 Merge tag 'io_uring-5.18-2022-04-08' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "A bit bigger than usual post merge window, largely due to a revert and a fix of at what point files are assigned for requests. The latter fixing a linked request use case where a dependent link can rely on what file is assigned consistently. Summary: - 32-bit compat fix for IORING_REGISTER_IOWQ_AFF (Eugene) - File assignment fixes (me) - Revert of the NAPI poll addition from this merge window. The author isn't available right now to engage on this, so let's revert it and we can retry for the 5.19 release (me, Jakub) - Fix a timeout removal race (me) - File update and SCM fixes (Pavel)" * tag 'io_uring-5.18-2022-04-08' of git://git.kernel.dk/linux-block: io_uring: fix race between timeout flush and removal io_uring: use nospec annotation for more indexes io_uring: zero tag on rsrc removal io_uring: don't touch scm_fp_list after queueing skb io_uring: nospec index for tags on files update io_uring: implement compat handling for IORING_REGISTER_IOWQ_AFF Revert "io_uring: Add support for napi_busy_poll" io_uring: drop the old style inflight file tracking io_uring: defer file assignment io_uring: propagate issue_flags state down to file assignment io_uring: move read/write file prep state into actual opcode handler io_uring: defer splice/tee file validity check until command issue io_uring: don't check req->file in io_fsync_prep() commit f335af10482a41ad5d28b4a2b0bee3ea35f771ce Merge: d017a3167bcb 2bbac98d0930 Author: Linus Torvalds Date: Fri Apr 8 18:29:02 2022 -1000 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Several bug fixes for old bugs: - Welcome Leon as co-maintainer for RDMA so we are back to having two people - Some corner cases are fixed in mlx5's MR code - Long standing CM bug where a DREQ at the wrong time can result in a long timeout - Missing locking and refcounting in hf1" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/hfi1: Fix use-after-free bug for mm struct IB/rdmavt: add lock to call to rvt_error_qp to prevent a race condition IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD RDMA/mlx5: Add a missing update of cache->last_add RDMA/mlx5: Don't remove cache MRs when a delay is needed MAINTAINERS: Update qib and hfi1 related drivers MAINTAINERS: Add Leon Romanovsky to RDMA maintainers commit d017a3167bcb76caedf2b444645bf4db75f775a5 Merge: 6c7376da2358 87ad236001eb Author: Linus Torvalds Date: Fri Apr 8 18:23:02 2022 -1000 Merge tag 'acpi-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These revert a problematic commit from the 5.17 development cycle and finalize the elimination of acpi_bus_get_device() that mostly took place during the recent merge window. Specifics: - Revert an ACPI processor driver change related to cache invalidation in acpi_idle_play_dead() that clearly was a mistake and introduced user-visible regressions (Akihiko Odaki). - Replace the last instance of acpi_bus_get_device() added during the recent merge window and drop the function to prevent more users of it from being added (Rafael Wysocki)" * tag 'acpi-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: bus: Eliminate acpi_bus_get_device() Revert "ACPI: processor: idle: Only flush cache on entering C3" commit 4054eee9290248bf66c5eacb58879c9aaad37f71 Author: Heiko Stuebner Date: Sat Apr 9 09:16:00 2022 +0530 RISC-V: KVM: include missing hwcap.h into vcpu_fp vcpu_fp uses the riscv_isa_extension mechanism which gets defined in hwcap.h but doesn't include that head file. While it seems to work in most cases, in certain conditions this can lead to build failures like ../arch/riscv/kvm/vcpu_fp.c: In function ‘kvm_riscv_vcpu_fp_reset’: ../arch/riscv/kvm/vcpu_fp.c:22:13: error: implicit declaration of function ‘riscv_isa_extension_available’ [-Werror=implicit-function-declaration] 22 | if (riscv_isa_extension_available(&isa, f) || | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../arch/riscv/kvm/vcpu_fp.c:22:49: error: ‘f’ undeclared (first use in this function) 22 | if (riscv_isa_extension_available(&isa, f) || Fix this by simply including the necessary header. Fixes: 0a86512dc113 ("RISC-V: KVM: Factor-out FP virtualization into separate sources") Signed-off-by: Heiko Stuebner Signed-off-by: Anup Patel arch/riscv/kvm/vcpu_fp.c | 1 + 1 file changed, 1 insertion(+) commit ebdef0de2dbc40e697adaa6b3408130f7a7b8351 Author: Anup Patel Date: Sat Apr 9 09:15:51 2022 +0530 KVM: selftests: riscv: Fix alignment of the guest_hang() function The guest_hang() function is used as the default exception handler for various KVM selftests applications by setting it's address in the vstvec CSR. The vstvec CSR requires exception handler base address to be at least 4-byte aligned so this patch fixes alignment of the guest_hang() function. Fixes: 3e06cdf10520 ("KVM: selftests: Add initial support for RISC-V 64-bit") Signed-off-by: Anup Patel Tested-by: Mayuresh Chitale Signed-off-by: Anup Patel tools/testing/selftests/kvm/lib/riscv/processor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fac3725364397f9a40a101f089b86ea655a58d06 Author: Anup Patel Date: Sat Apr 9 09:15:44 2022 +0530 KVM: selftests: riscv: Set PTE A and D bits in VS-stage page table Supporting hardware updates of PTE A and D bits is optional for any RISC-V implementation so current software strategy is to always set these bits in both G-stage (hypervisor) and VS-stage (guest kernel). If PTE A and D bits are not set by software (hypervisor or guest) then RISC-V implementations not supporting hardware updates of these bits will cause traps even for perfectly valid PTEs. Based on above explanation, the VS-stage page table created by various KVM selftest applications is not correct because PTE A and D bits are not set. This patch fixes VS-stage page table programming of PTE A and D bits for KVM selftests. Fixes: 3e06cdf10520 ("KVM: selftests: Add initial support for RISC-V 64-bit") Signed-off-by: Anup Patel Tested-by: Mayuresh Chitale Signed-off-by: Anup Patel tools/testing/selftests/kvm/include/riscv/processor.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 8c3ce496bd612bd21679e445f75fcabb6be997b2 Author: Anup Patel Date: Sat Apr 9 09:15:33 2022 +0530 RISC-V: KVM: Don't clear hgatp CSR in kvm_arch_vcpu_put() We might have RISC-V systems (such as QEMU) where VMID is not part of the TLB entry tag so these systems will have to flush all TLB entries upon any change in hgatp.VMID. Currently, we zero-out hgatp CSR in kvm_arch_vcpu_put() and we re-program hgatp CSR in kvm_arch_vcpu_load(). For above described systems, this will flush all TLB entries whenever VCPU exits to user-space hence reducing performance. This patch fixes above described performance issue by not clearing hgatp CSR in kvm_arch_vcpu_put(). Fixes: 34bde9d8b9e6 ("RISC-V: KVM: Implement VCPU world-switch") Cc: stable@vger.kernel.org Signed-off-by: Anup Patel Signed-off-by: Anup Patel arch/riscv/kvm/vcpu.c | 2 -- 1 file changed, 2 deletions(-) commit 8d3a6c37d50d5a0504c126c932cc749e6dd9c78f Author: Kai-Heng Feng Date: Fri Apr 8 10:22:04 2022 +0800 net: atlantic: Avoid out-of-bounds indexing UBSAN warnings are observed on atlantic driver: [ 294.432996] UBSAN: array-index-out-of-bounds in /build/linux-Qow4fL/linux-5.15.0/drivers/net/ethernet/aquantia/atlantic/aq_nic.c:484:48 [ 294.433695] index 8 is out of range for type 'aq_vec_s *[8]' The ring is dereferenced right before breaking out the loop, to prevent that from happening, only use the index in the loop to fix the issue. BugLink: https://bugs.launchpad.net/bugs/1958770 Tested-by: Mario Limonciello Signed-off-by: Kai-Heng Feng Reviewed-by: Igor Russkikh Link: https://lore.kernel.org/r/20220408022204.16815-1-kai.heng.feng@canonical.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 8 ++++---- drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) commit e6934e4048c91502efcb21da92b7ae37cd8fa741 Author: Michael Walle Date: Fri Apr 8 12:15:21 2022 +0200 net: dsa: felix: suppress -EPROBE_DEFER errors The DSA master might not have been probed yet in which case the probe of the felix switch fails with -EPROBE_DEFER: [ 4.435305] mscc_felix 0000:00:00.5: Failed to register DSA switch: -517 It is not an error. Use dev_err_probe() to demote this particular error to a debug message. Fixes: 56051948773e ("net: dsa: ocelot: add driver for Felix switch family") Signed-off-by: Michael Walle Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220408101521.281886-1-michael@walle.cc Signed-off-by: Jakub Kicinski drivers/net/dsa/ocelot/felix_vsc9959.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dd2737fab4a6ce9ba4eb84842bedbd87d55241a6 Author: Liu Ying Date: Fri Mar 4 16:04:43 2022 +0800 arm64: dts: imx8qm: Correct SCU clock controller's compatible property The fsl,scu.txt dt-binding documentation explicitly mentions that the compatible string should be either "fsl,imx8qm-clock" or "fsl,imx8qxp-clock", followed by "fsl,scu-clk". Also, i.MX8qm SCU clocks and i.MX8qxp SCU clocks are really not the same, so we have to set the compatible property according to SoC name. Let's correct the i.MX8qm clock controller's compatible property from "fsl,imx8qxp-clk", "fsl,scu-clk" to "fsl,imx8qm-clk", "fsl,scu-clk" . Fixes: f2180be18a63 ("arm64: dts: imx: add imx8qm common dts file") Cc: Rob Herring Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Signed-off-by: Liu Ying Signed-off-by: Shawn Guo arch/arm64/boot/dts/freescale/imx8qm.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fd0a4b39870d49ff15f6966470185409e261f20f Author: Zheyu Ma Date: Fri Apr 8 19:30:49 2022 -0700 Input: cypress-sf - register a callback to disable the regulators When the driver fails to probe, we will get the following splat: [ 19.311970] ------------[ cut here ]------------ [ 19.312566] WARNING: CPU: 3 PID: 375 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0 [ 19.317591] RIP: 0010:_regulator_put+0x3ec/0x4e0 [ 19.328831] Call Trace: [ 19.329112] [ 19.329369] regulator_bulk_free+0x82/0xe0 [ 19.329860] devres_release_group+0x319/0x3d0 [ 19.330357] i2c_device_probe+0x766/0x940 Fix this by adding a callback that will deal with the disabling when the driver fails to probe. Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220409022629.3493557-1-zheyuma97@gmail.com Signed-off-by: Dmitry Torokhov drivers/input/keyboard/cypress-sf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit 1ddff774164f1bcd0fcf988f7a5bb24270fbdf2c Author: David Howells Date: Thu Mar 17 14:28:34 2022 +0000 cifs: Split the smb3_add_credits tracepoint Split the smb3_add_credits tracepoint to make it more obvious when looking at the logs which line corresponds to what credit change. Also add a tracepoint for credit overflow when it's being added back. Note that it might be better to add another field to the tracepoint for the information rather than splitting it. It would also be useful to store the MID potentially, though that isn't available when the credits are first obtained. Signed-off-by: David Howells cc: Shyam Prasad N cc: Rohith Surabattula cc: linux-cifs@vger.kernel.org Acked-by: Paulo Alcantara (SUSE) Reviewed-by: Enzo Matsumiya Signed-off-by: Steve French fs/cifs/connect.c | 2 +- fs/cifs/smb2ops.c | 9 ++++++--- fs/cifs/trace.h | 7 +++++++ fs/cifs/transport.c | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) commit 6c7376da23587738ab0e84b8b90b6cc02db5181e Merge: 9abb16bad5d8 02c7efa43627 Author: Linus Torvalds Date: Fri Apr 8 15:06:11 2022 -1000 Merge tag 'linux-kselftest-kunit-fixes-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit fix from Shuah Khan: "A single documentation fix to incorrect and outdated usage information" * tag 'linux-kselftest-kunit-fixes-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: Documentation: kunit: fix path to .kunitconfig in start.rst commit 9abb16bad5d802e4a1fce3a498d5ee6a334e84a4 Merge: 911b2b95168c 79ee8aa31d51 Author: Linus Torvalds Date: Fri Apr 8 14:48:35 2022 -1000 Merge tag 'linux-kselftest-fixes-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: "Build and run-times fixes to tests: - header dependencies - missing tear-downs to release allocated resources in assert paths - missing error messages when build fails - coccicheck and unused variable warnings" * tag 'linux-kselftest-fixes-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/harness: Pass variant to teardown selftests/harness: Run TEARDOWN for ASSERT failures selftests: fix an unused variable warning in pidfd selftest selftests: fix header dependency for pid_namespace selftests selftests: x86: add 32bit build warnings for SUSE selftests/proc: fix array_size.cocci warning selftests/vDSO: fix array_size.cocci warning commit 911b2b95168c7790ed5ea2703d804086c03088df Merge: 1a3b1bba7c7a 4071a1b9e24e Author: Linus Torvalds Date: Fri Apr 8 14:31:41 2022 -1000 Merge branch 'akpm' (patches from Andrew) Merge fixes from Andrew Morton: "9 patches. Subsystems affected by this patch series: mm (migration, highmem, sparsemem, mremap, mempolicy, and memcg), lz4, mailmap, and MAINTAINERS" * emailed patches from Andrew Morton : MAINTAINERS: add Tom as clang reviewer mm/list_lru.c: revert "mm/list_lru: optimize memcg_reparent_list_lru_node()" mailmap: update Vasily Averin's email address mm/mempolicy: fix mpol_new leak in shared_policy_replace mmmremap.c: avoid pointless invalidate_range_start/end on mremap(old_size=0) mm/sparsemem: fix 'mem_section' will never be NULL gcc 12 warning lz4: fix LZ4_decompress_safe_partial read out of bound highmem: fix checks in __kmap_local_sched_{in,out} mm: migrate: use thp_order instead of HPAGE_PMD_ORDER for new page allocation. commit 4071a1b9e24ee394b7492bff7542707ee9ad986d Author: Tom Rix Date: Fri Apr 8 13:09:16 2022 -0700 MAINTAINERS: add Tom as clang reviewer I have been helping with build breaks and other clang things and would like to help with the reviews. Link: https://lkml.kernel.org/r/20220407175715.3378998-1-trix@redhat.com Signed-off-by: Tom Rix Acked-by: Nathan Chancellor Acked-by: Nick Desaulniers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit b33e1044475afffaaabe51d35837aa10c09ba9ae Author: Andrew Morton Date: Fri Apr 8 13:09:13 2022 -0700 mm/list_lru.c: revert "mm/list_lru: optimize memcg_reparent_list_lru_node()" Commit 405cc51fc104 ("mm/list_lru: optimize memcg_reparent_list_lru_node()") has subtle races which are proving ugly to fix. Revert the original optimization. If quantitative testing indicates that we have a significant problem here then other implementations can be looked at. Fixes: 405cc51fc104 ("mm/list_lru: optimize memcg_reparent_list_lru_node()") Acked-by: Shakeel Butt Reviewed-by: Muchun Song Acked-by: Michal Hocko Cc: Waiman Long Cc: Roman Gushchin Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/list_lru.c | 6 ------ 1 file changed, 6 deletions(-) commit 0347b2b95c3e1474c4b10f53df7ff2e841fda147 Author: Vasily Averin Date: Fri Apr 8 13:09:10 2022 -0700 mailmap: update Vasily Averin's email address I'm moving to a @linux.dev account. Map my old addresses. Link: https://lkml.kernel.org/r/737c7c2b-cdab-63ee-be90-cb33316c9657@linux.dev Signed-off-by: Vasily Averin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds .mailmap | 4 ++++ 1 file changed, 4 insertions(+) commit 4ad099559b00ac01c3726e5c95dc3108ef47d03e Author: Miaohe Lin Date: Fri Apr 8 13:09:07 2022 -0700 mm/mempolicy: fix mpol_new leak in shared_policy_replace If mpol_new is allocated but not used in restart loop, mpol_new will be freed via mpol_put before returning to the caller. But refcnt is not initialized yet, so mpol_put could not do the right things and might leak the unused mpol_new. This would happen if mempolicy was updated on the shared shmem file while the sp->lock has been dropped during the memory allocation. This issue could be triggered easily with the below code snippet if there are many processes doing the below work at the same time: shmid = shmget((key_t)5566, 1024 * PAGE_SIZE, 0666|IPC_CREAT); shm = shmat(shmid, 0, 0); loop many times { mbind(shm, 1024 * PAGE_SIZE, MPOL_LOCAL, mask, maxnode, 0); mbind(shm + 128 * PAGE_SIZE, 128 * PAGE_SIZE, MPOL_DEFAULT, mask, maxnode, 0); } Link: https://lkml.kernel.org/r/20220329111416.27954-1-linmiaohe@huawei.com Fixes: 42288fe366c4 ("mm: mempolicy: Convert shared_policy mutex to spinlock") Signed-off-by: Miaohe Lin Acked-by: Michal Hocko Cc: KOSAKI Motohiro Cc: Mel Gorman Cc: [3.8] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mempolicy.c | 1 + 1 file changed, 1 insertion(+) commit 01e67e04c28170c47700c2c226d732bbfedb1ad0 Author: Paolo Bonzini Date: Fri Apr 8 13:09:04 2022 -0700 mmmremap.c: avoid pointless invalidate_range_start/end on mremap(old_size=0) If an mremap() syscall with old_size=0 ends up in move_page_tables(), it will call invalidate_range_start()/invalidate_range_end() unnecessarily, i.e. with an empty range. This causes a WARN in KVM's mmu_notifier. In the past, empty ranges have been diagnosed to be off-by-one bugs, hence the WARNing. Given the low (so far) number of unique reports, the benefits of detecting more buggy callers seem to outweigh the cost of having to fix cases such as this one, where userspace is doing something silly. In this particular case, an early return from move_page_tables() is enough to fix the issue. Link: https://lkml.kernel.org/r/20220329173155.172439-1-pbonzini@redhat.com Reported-by: syzbot+6bde52d89cfdf9f61425@syzkaller.appspotmail.com Signed-off-by: Paolo Bonzini Cc: Sean Christopherson Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mremap.c | 3 +++ 1 file changed, 3 insertions(+) commit a431dbbc540532b7465eae4fc8b56a85a9fc7d17 Author: Waiman Long Date: Fri Apr 8 13:09:01 2022 -0700 mm/sparsemem: fix 'mem_section' will never be NULL gcc 12 warning The gcc 12 compiler reports a "'mem_section' will never be NULL" warning on the following code: static inline struct mem_section *__nr_to_section(unsigned long nr) { #ifdef CONFIG_SPARSEMEM_EXTREME if (!mem_section) return NULL; #endif if (!mem_section[SECTION_NR_TO_ROOT(nr)]) return NULL; : It happens with CONFIG_SPARSEMEM_EXTREME off. The mem_section definition is #ifdef CONFIG_SPARSEMEM_EXTREME extern struct mem_section **mem_section; #else extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT]; #endif In the !CONFIG_SPARSEMEM_EXTREME case, mem_section is a static 2-dimensional array and so the check "!mem_section[SECTION_NR_TO_ROOT(nr)]" doesn't make sense. Fix this warning by moving the "!mem_section[SECTION_NR_TO_ROOT(nr)]" check up inside the CONFIG_SPARSEMEM_EXTREME block and adding an explicit NR_SECTION_ROOTS check to make sure that there is no out-of-bound array access. Link: https://lkml.kernel.org/r/20220331180246.2746210-1-longman@redhat.com Fixes: 3e347261a80b ("sparsemem extreme implementation") Signed-off-by: Waiman Long Reported-by: Justin Forbes Cc: "Kirill A . Shutemov" Cc: Ingo Molnar Cc: Rafael Aquini Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/mmzone.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit eafc0a02391b7b36617b36c97c4b5d6832cf5e24 Author: Guo Xuenan Date: Fri Apr 8 13:08:58 2022 -0700 lz4: fix LZ4_decompress_safe_partial read out of bound When partialDecoding, it is EOF if we've either filled the output buffer or can't proceed with reading an offset for following match. In some extreme corner cases when compressed data is suitably corrupted, UAF will occur. As reported by KASAN [1], LZ4_decompress_safe_partial may lead to read out of bound problem during decoding. lz4 upstream has fixed it [2] and this issue has been disscussed here [3] before. current decompression routine was ported from lz4 v1.8.3, bumping lib/lz4 to v1.9.+ is certainly a huge work to be done later, so, we'd better fix it first. [1] https://lore.kernel.org/all/000000000000830d1205cf7f0477@google.com/ [2] https://github.com/lz4/lz4/commit/c5d6f8a8be3927c0bec91bcc58667a6cfad244ad# [3] https://lore.kernel.org/all/CC666AE8-4CA4-4951-B6FB-A2EFDE3AC03B@fb.com/ Link: https://lkml.kernel.org/r/20211111105048.2006070-1-guoxuenan@huawei.com Reported-by: syzbot+63d688f1d899c588fb71@syzkaller.appspotmail.com Signed-off-by: Guo Xuenan Reviewed-by: Nick Terrell Acked-by: Gao Xiang Cc: Yann Collet Cc: Chengyang Fan Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/lz4/lz4_decompress.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 66f133ceab7456c789f70a242991ed1b27ba1c3d Author: Max Filippov Date: Fri Apr 8 13:08:55 2022 -0700 highmem: fix checks in __kmap_local_sched_{in,out} When CONFIG_DEBUG_KMAP_LOCAL is enabled __kmap_local_sched_{in,out} check that even slots in the tsk->kmap_ctrl.pteval are unmapped. The slots are initialized with 0 value, but the check is done with pte_none. 0 pte however does not necessarily mean that pte_none will return true. e.g. on xtensa it returns false, resulting in the following runtime warnings: WARNING: CPU: 0 PID: 101 at mm/highmem.c:627 __kmap_local_sched_out+0x51/0x108 CPU: 0 PID: 101 Comm: touch Not tainted 5.17.0-rc7-00010-gd3a1cdde80d2-dirty #13 Call Trace: dump_stack+0xc/0x40 __warn+0x8f/0x174 warn_slowpath_fmt+0x48/0xac __kmap_local_sched_out+0x51/0x108 __schedule+0x71a/0x9c4 preempt_schedule_irq+0xa0/0xe0 common_exception_return+0x5c/0x93 do_wp_page+0x30e/0x330 handle_mm_fault+0xa70/0xc3c do_page_fault+0x1d8/0x3c4 common_exception+0x7f/0x7f WARNING: CPU: 0 PID: 101 at mm/highmem.c:664 __kmap_local_sched_in+0x50/0xe0 CPU: 0 PID: 101 Comm: touch Tainted: G W 5.17.0-rc7-00010-gd3a1cdde80d2-dirty #13 Call Trace: dump_stack+0xc/0x40 __warn+0x8f/0x174 warn_slowpath_fmt+0x48/0xac __kmap_local_sched_in+0x50/0xe0 finish_task_switch$isra$0+0x1ce/0x2f8 __schedule+0x86e/0x9c4 preempt_schedule_irq+0xa0/0xe0 common_exception_return+0x5c/0x93 do_wp_page+0x30e/0x330 handle_mm_fault+0xa70/0xc3c do_page_fault+0x1d8/0x3c4 common_exception+0x7f/0x7f Fix it by replacing !pte_none(pteval) with pte_val(pteval) != 0. Link: https://lkml.kernel.org/r/20220403235159.3498065-1-jcmvbkbc@gmail.com Fixes: 5fbda3ecd14a ("sched: highmem: Store local kmaps in task struct") Signed-off-by: Max Filippov Reviewed-by: Thomas Gleixner Cc: "Peter Zijlstra (Intel)" Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/highmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a04cd1600b831a16625b45226b90a292c8f6e8d9 Author: Zi Yan Date: Fri Apr 8 13:08:52 2022 -0700 mm: migrate: use thp_order instead of HPAGE_PMD_ORDER for new page allocation. Fix a VM_BUG_ON_FOLIO(folio_nr_pages(old) != nr_pages) crash. With folios support, it is possible to have other than HPAGE_PMD_ORDER THPs, in the form of folios, in the system. Use thp_order() to correctly determine the source page order during migration. Link: https://lkml.kernel.org/r/20220404165325.1883267-1-zi.yan@sent.com Link: https://lore.kernel.org/linux-mm/20220404132908.GA785673@u2004/ Fixes: d68eccad3706 ("mm/filemap: Allow large folios to be added to the page cache") Reported-by: Naoya Horiguchi Signed-off-by: Zi Yan Cc: Matthew Wilcox Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mempolicy.c | 2 +- mm/migrate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 61132ceeda723d2c48cbc2610ca3213a7fcb083b Author: Yue Hu Date: Thu Mar 31 19:57:18 2022 +0800 fscache: remove FSCACHE_OLD_API Kconfig option Commit 01491a756578 ("fscache, cachefiles: Disable configuration") added the FSCACHE_OLD_API configuration when rewritten. Now, it's not used any more. Remove it. Signed-off-by: Yue Hu Signed-off-by: David Howells cc: linux-cachefs@redhat.com Link: https://listman.redhat.com/archives/linux-cachefs/2022-March/006647.html # v1 fs/fscache/Kconfig | 3 --- 1 file changed, 3 deletions(-) commit b3c958c20a61fb8514fa16e3edcb421703600ee0 Author: Yue Hu Date: Fri Apr 1 14:37:15 2022 +0800 fscache: Use wrapper fscache_set_cache_state() directly when relinquishing We already have the wrapper function to set cache state. Signed-off-by: Yue Hu Signed-off-by: David Howells Reviewed-by: Jeffle Xu cc: linux-cachefs@redhat.com Link: https://listman.redhat.com/archives/linux-cachefs/2022-April/006648.html # v1 fs/fscache/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 19517e53740ec671c335f05089abe1f0720103c7 Author: Yue Hu Date: Sat Apr 2 12:47:43 2022 +0800 fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS fscache_cookies_seq_ops is only used in proc.c that is compiled under enabled CONFIG_PROC_FS, so move related code under this config. The same case exsits in internal.h. Also, make fscache_lru_cookie_timeout static due to no user outside of cookie.c. Signed-off-by: Yue Hu Signed-off-by: David Howells cc: linux-cachefs@redhat.com Link: https://listman.redhat.com/archives/linux-cachefs/2022-April/006649.html # v1 fs/fscache/cookie.c | 4 +++- fs/fscache/internal.h | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) commit 2c547f299827c12244d613eb2ee3616d88f56088 Author: Yue Hu Date: Wed Apr 6 11:50:17 2022 +0800 fscache: Remove the cookie parameter from fscache_clear_page_bits() The cookie is not used at all, remove it and update the usage in io.c and afs/write.c (which is the only user outside of fscache currently) at the same time. [DH: Amended the documentation also] Signed-off-by: Yue Hu Signed-off-by: David Howells cc: linux-cachefs@redhat.com Link: https://listman.redhat.com/archives/linux-cachefs/2022-April/006659.html Documentation/filesystems/caching/netfs-api.rst | 25 ++++++++++++------------- fs/afs/write.c | 3 +-- fs/fscache/io.c | 5 ++--- include/linux/fscache.h | 4 +--- 4 files changed, 16 insertions(+), 21 deletions(-) commit 5d3d5b9645b53691b2eee7607cf995bcfae46dd0 Author: Yue Hu Date: Thu Apr 7 19:02:39 2022 +0800 docs: filesystems: caching/backend-api.rst: fix an object withdrawn API There's no fscache_are_objects_withdrawn() helper at all to test if cookie withdrawal is completed currently. The cache backend is using fscache_wait_for_objects() to wait all objects to be withdrawn. Signed-off-by: Yue Hu Signed-off-by: David Howells cc: linux-cachefs@redhat.com Link: https://listman.redhat.com/archives/linux-cachefs/2022-April/006705.html # v1 Documentation/filesystems/caching/backend-api.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c54eead2a66914a36b4a9ea5bbeb95a768307cba Author: Yue Hu Date: Thu Apr 7 18:28:32 2022 +0800 docs: filesystems: caching/backend-api.rst: correct two relinquish APIs use 1. cache backend is using fscache_relinquish_cache() rather than fscache_relinquish_cookie() to reset the cache cookie. 2. No fscache_cache_relinquish() helper currently, it should be fscache_relinquish_cache(). Signed-off-by: Yue Hu Signed-off-by: David Howells cc: linux-cachefs@redhat.com Link: https://listman.redhat.com/archives/linux-cachefs/2022-April/006703.html # v1 Link: https://listman.redhat.com/archives/linux-cachefs/2022-April/006704.html # v2 Documentation/filesystems/caching/backend-api.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 7b2f6c306601240635c72caa61f682e74d4591b2 Author: Dave Wysochanski Date: Tue Apr 5 09:46:49 2022 -0400 cachefiles: Fix KASAN slab-out-of-bounds in cachefiles_set_volume_xattr Use the actual length of volume coherency data when setting the xattr to avoid the following KASAN report. BUG: KASAN: slab-out-of-bounds in cachefiles_set_volume_xattr+0xa0/0x350 [cachefiles] Write of size 4 at addr ffff888101e02af4 by task kworker/6:0/1347 CPU: 6 PID: 1347 Comm: kworker/6:0 Kdump: loaded Not tainted 5.18.0-rc1-nfs-fscache-netfs+ #13 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-4.fc34 04/01/2014 Workqueue: events fscache_create_volume_work [fscache] Call Trace: dump_stack_lvl+0x45/0x5a print_report.cold+0x5e/0x5db ? __lock_text_start+0x8/0x8 ? cachefiles_set_volume_xattr+0xa0/0x350 [cachefiles] kasan_report+0xab/0x120 ? cachefiles_set_volume_xattr+0xa0/0x350 [cachefiles] kasan_check_range+0xf5/0x1d0 memcpy+0x39/0x60 cachefiles_set_volume_xattr+0xa0/0x350 [cachefiles] cachefiles_acquire_volume+0x2be/0x500 [cachefiles] ? __cachefiles_free_volume+0x90/0x90 [cachefiles] fscache_create_volume_work+0x68/0x160 [fscache] process_one_work+0x3b7/0x6a0 worker_thread+0x2c4/0x650 ? process_one_work+0x6a0/0x6a0 kthread+0x16c/0x1a0 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 Allocated by task 1347: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x81/0xa0 cachefiles_set_volume_xattr+0x76/0x350 [cachefiles] cachefiles_acquire_volume+0x2be/0x500 [cachefiles] fscache_create_volume_work+0x68/0x160 [fscache] process_one_work+0x3b7/0x6a0 worker_thread+0x2c4/0x650 kthread+0x16c/0x1a0 ret_from_fork+0x22/0x30 The buggy address belongs to the object at ffff888101e02af0 which belongs to the cache kmalloc-8 of size 8 The buggy address is located 4 bytes inside of 8-byte region [ffff888101e02af0, ffff888101e02af8) The buggy address belongs to the physical page: page:00000000a2292d70 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101e02 flags: 0x17ffffc0000200(slab|node=0|zone=2|lastcpupid=0x1fffff) raw: 0017ffffc0000200 0000000000000000 dead000000000001 ffff888100042280 raw: 0000000000000000 0000000080660066 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888101e02980: fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc ffff888101e02a00: 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 >ffff888101e02a80: fc fc fc fc 00 fc fc fc fc 00 fc fc fc fc 04 fc ^ ffff888101e02b00: fc fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc ffff888101e02b80: fc fc 00 fc fc fc fc 00 fc fc fc fc 00 fc fc fc ================================================================== Fixes: 413a4a6b0b55 "cachefiles: Fix volume coherency attribute" Signed-off-by: Dave Wysochanski Signed-off-by: David Howells cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/20220405134649.6579-1-dwysocha@redhat.com/ # v1 Link: https://lore.kernel.org/r/20220405142810.8208-1-dwysocha@redhat.com/ # Incorrect v2 fs/cachefiles/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ea5dc046127e857a7873ae55fd57c866e9e86fb2 Author: Jeffle Xu Date: Wed Mar 30 17:47:59 2022 +0800 cachefiles: unmark inode in use in error path Unmark inode in use if error encountered. If the in-use flag leakage occurs in cachefiles_open_file(), Cachefiles will complain "Inode already in use" when later another cookie with the same index key is looked up. If the in-use flag leakage occurs in cachefiles_create_tmpfile(), though the "Inode already in use" warning won't be triggered, fix the leakage anyway. Reported-by: Gao Xiang Fixes: 1f08c925e7a3 ("cachefiles: Implement backing file wrangling") Signed-off-by: Jeffle Xu Signed-off-by: David Howells cc: linux-cachefs@redhat.com Link: https://listman.redhat.com/archives/linux-cachefs/2022-March/006615.html # v1 Link: https://listman.redhat.com/archives/linux-cachefs/2022-March/006618.html # v2 fs/cachefiles/namei.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) commit e65812fd22eba32f11abe28cb377cbd64cfb1ba0 Author: Marcelo Ricardo Leitner Date: Thu Apr 7 11:29:23 2022 -0300 net/sched: fix initialization order when updating chain 0 head Currently, when inserting a new filter that needs to sit at the head of chain 0, it will first update the heads pointer on all devices using the (shared) block, and only then complete the initialization of the new element so that it has a "next" element. This can lead to a situation that the chain 0 head is propagated to another CPU before the "next" initialization is done. When this race condition is triggered, packets being matched on that CPU will simply miss all other filters, and will flow through the stack as if there were no other filters installed. If the system is using OVS + TC, such packets will get handled by vswitchd via upcall, which results in much higher latency and reordering. For other applications it may result in packet drops. This is reproducible with a tc only setup, but it varies from system to system. It could be reproduced with a shared block amongst 10 veth tunnels, and an ingress filter mirroring packets to another veth. That's because using the last added veth tunnel to the shared block to do the actual traffic, it makes the race window bigger and easier to trigger. The fix is rather simple, to just initialize the next pointer of the new filter instance (tp) before propagating the head change. The fixes tag is pointing to the original code though this issue should only be observed when using it unlocked. Fixes: 2190d1d0944f ("net: sched: introduce helpers to work with filter chains") Signed-off-by: Marcelo Ricardo Leitner Signed-off-by: Vlad Buslov Reviewed-by: Davide Caratti Link: https://lore.kernel.org/r/b97d5f4eaffeeb9d058155bcab63347527261abf.1649341369.git.marcelo.leitner@gmail.com Signed-off-by: Jakub Kicinski net/sched/cls_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e2d88f9ce678cd33763826ae2f0412f181251314 Author: Xin Long Date: Thu Apr 7 09:24:22 2022 -0400 sctp: use the correct skb for security_sctp_assoc_request Yi Chen reported an unexpected sctp connection abort, and it occurred when COOKIE_ECHO is bundled with DATA Fragment by SCTP HW GSO. As the IP header is included in chunk->head_skb instead of chunk->skb, it failed to check IP header version in security_sctp_assoc_request(). According to Ondrej, SELinux only looks at IP header (address and IPsec options) and XFRM state data, and these are all included in head_skb for SCTP HW GSO packets. So fix it by using head_skb when calling security_sctp_assoc_request() in processing COOKIE_ECHO. v1->v2: - As Ondrej noticed, chunk->head_skb should also be used for security_sctp_assoc_established() in sctp_sf_do_5_1E_ca(). Fixes: e215dab1c490 ("security: call security_sctp_assoc_request in sctp_sf_do_5_1D_ce") Reported-by: Yi Chen Signed-off-by: Xin Long Reviewed-by: Ondrej Mosnacek Acked-by: Marcelo Ricardo Leitner Link: https://lore.kernel.org/r/71becb489e51284edf0c11fc15246f4ed4cef5b6.1649337862.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski net/sctp/sm_statefuns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit d452088cdfd5a4ad9d96d847d2273fe958d6339b Author: Vadim Pasternak Date: Thu Apr 7 10:07:03 2022 +0300 mlxsw: i2c: Fix initialization error flow Add mutex_destroy() call in driver initialization error flow. Fixes: 6882b0aee180f ("mlxsw: Introduce support for I2C bus") Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Link: https://lore.kernel.org/r/20220407070703.2421076-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/mellanox/mlxsw/i2c.c | 1 + 1 file changed, 1 insertion(+) commit 74befa447e6839cdd90ed541159ec783726946f9 Author: Vladimir Oltean Date: Thu Apr 7 19:55:38 2022 +0300 net: mdio: don't defer probe forever if PHY IRQ provider is missing When a driver for an interrupt controller is missing, of_irq_get() returns -EPROBE_DEFER ad infinitum, causing fwnode_mdiobus_phy_device_register(), and ultimately, the entire of_mdiobus_register() call, to fail. In turn, any phy_connect() call towards a PHY on this MDIO bus will also fail. This is not what is expected to happen, because the PHY library falls back to poll mode when of_irq_get() returns a hard error code, and the MDIO bus, PHY and attached Ethernet controller work fine, albeit suboptimally, when the PHY library polls for link status. However, -EPROBE_DEFER has special handling given the assumption that at some point probe deferral will stop, and the driver for the supplier will kick in and create the IRQ domain. Reasons for which the interrupt controller may be missing: - It is not yet written. This may happen if a more recent DT blob (with an interrupt-parent for the PHY) is used to boot an old kernel where the driver didn't exist, and that kernel worked with the vintage-correct DT blob using poll mode. - It is compiled out. Behavior is the same as above. - It is compiled as a module. The kernel will wait for a number of seconds specified in the "deferred_probe_timeout" boot parameter for user space to load the required module. The current default is 0, which times out at the end of initcalls. It is possible that this might cause regressions unless users adjust this boot parameter. The proposed solution is to use the driver_deferred_probe_check_state() helper function provided by the driver core, which gives up after some -EPROBE_DEFER attempts, taking "deferred_probe_timeout" into consideration. The return code is changed from -EPROBE_DEFER into -ENODEV or -ETIMEDOUT, depending on whether the kernel is compiled with support for modules or not. Fixes: 66bdede495c7 ("of_mdio: Fix broken PHY IRQ in case of probe deferral") Suggested-by: Robin Murphy Signed-off-by: Vladimir Oltean Acked-by: Greg Kroah-Hartman Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220407165538.4084809-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski drivers/base/dd.c | 1 + drivers/net/mdio/fwnode_mdio.c | 5 +++++ 2 files changed, 6 insertions(+) commit e677edbcabee849bfdd43f1602bccbecf736a646 Author: Jens Axboe Date: Fri Apr 8 11:08:58 2022 -0600 io_uring: fix race between timeout flush and removal io_flush_timeouts() assumes the timeout isn't in progress of triggering or being removed/canceled, so it unconditionally removes it from the timeout list and attempts to cancel it. Leave it on the list and let the normal timeout cancelation take care of it. Cc: stable@vger.kernel.org # 5.5+ Signed-off-by: Jens Axboe fs/io_uring.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit d28820419ca332f856cdf8bef0cafed79c29ed05 Author: Dan Williams Date: Fri Apr 8 12:58:44 2022 -0700 cxl/pci: Drop shadowed variable 0day reports that wait_for_media_ready() declares an @rc variable twice. >> drivers/cxl/pci.c:439:7: warning: Local variable 'rc' shadows outer variable [shadowVariable] int rc; ^ drivers/cxl/pci.c:431:6: note: Shadowed declaration int rc, i; ^ drivers/cxl/pci.c:439:7: note: Shadow variable int rc; ^ Cc: Randy Dunlap Fixes: 523e594d9cc0 ("cxl/pci: Implement wait for media active") Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reported-by: kernel test robot Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/164944636936.455177.14136200464724208233.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams drivers/cxl/pci.c | 1 - 1 file changed, 1 deletion(-) commit e8cf229ebe5eb31eecee86268223530a872872c2 Author: Dan Williams Date: Sun Apr 3 20:19:46 2022 -0700 tools/testing/nvdimm: Fix security_init() symbol collision Starting with the new perf-event support in the nvdimm core, the nfit_test mock module stops compiling. Rename its security_init() to nfit_security_init(). tools/testing/nvdimm/test/nfit.c:1845:13: error: conflicting types for ‘security_init’; have ‘void(struct nfit_test *)’ 1845 | static void security_init(struct nfit_test *t) | ^~~~~~~~~~~~~ In file included from ./include/linux/perf_event.h:61, from ./include/linux/nd.h:11, from ./drivers/nvdimm/nd-core.h:11, from tools/testing/nvdimm/test/nfit.c:19: Fixes: 9a61d0838cd0 ("drivers/nvdimm: Add nvdimm pmu structure") Cc: Kajol Jain Reviewed-by: Kajol Jain Reviewed-by: Vishal Verma Link: https://lore.kernel.org/r/164904238610.1330275.1889212115373993727.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams tools/testing/nvdimm/test/nfit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 2bbac98d0930e8161b1957dc0ec99de39ade1b3c Author: Douglas Miller Date: Fri Apr 8 09:35:23 2022 -0400 RDMA/hfi1: Fix use-after-free bug for mm struct Under certain conditions, such as MPI_Abort, the hfi1 cleanup code may represent the last reference held on the task mm. hfi1_mmu_rb_unregister() then drops the last reference and the mm is freed before the final use in hfi1_release_user_pages(). A new task may allocate the mm structure while it is still being used, resulting in problems. One manifestation is corruption of the mmap_sem counter leading to a hang in down_write(). Another is corruption of an mm struct that is in use by another task. Fixes: 3d2a9d642512 ("IB/hfi1: Ensure correct mm is used at all times") Link: https://lore.kernel.org/r/20220408133523.122165.72975.stgit@awfm-01.cornelisnetworks.com Cc: Signed-off-by: Douglas Miller Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hfi1/mmu_rb.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 12e45e89556d7a532120f976081e9e7582addd2b Author: Dave Jiang Date: Tue Apr 5 14:53:39 2022 -0700 dmaengine: idxd: fix device cleanup on disable There are certain parts of WQ that needs to be cleaned up even after WQ is disabled during the device disable. Those are the unchangeable parts for a WQ when the device is still enabled. Move the cleanup outside of WQ state check. Remove idxd_wq_disable_cleanup() inside idxd_wq_device_reset_cleanup() since only the unchangeable parts need to be cleared. Fixes: 0f225705cf65 ("dmaengine: idxd: fix wq settings post wq disable") Reported-by: Tony Zhu Tested-by: Tony Zhu Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/164919561905.1455025.13542366389944678346.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul drivers/dma/idxd/device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 87ad236001eb95cf1760ccaf7670c94722231097 Merge: dfbba2518aac ac2a3feefad5 Author: Rafael J. Wysocki Date: Fri Apr 8 19:50:44 2022 +0200 Merge branch 'acpi-bus' * acpi-bus: ACPI: bus: Eliminate acpi_bus_get_device() commit 1a3b1bba7c7a5eb8a11513cf88427cb9d77bc60a Merge: c0aa53389b0c ff053dbbaffe Author: Linus Torvalds Date: Fri Apr 8 07:39:17 2022 -1000 Merge tag 'nfs-for-5.18-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs Pull NFS client fixes from Trond Myklebust: "Stable fixes: - SUNRPC: Ensure we flush any closed sockets before xs_xprt_free() Bugfixes: - Fix an Oopsable condition due to SLAB_ACCOUNT setting in the NFSv4.2 xattr code. - Fix for open() using an file open mode of '3' in NFSv4 - Replace readdir's use of xxhash() with hash_64() - Several patches to handle malloc() failure in SUNRPC" * tag 'nfs-for-5.18-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: SUNRPC: Move the call to xprt_send_pagedata() out of xprt_sock_sendmsg() SUNRPC: svc_tcp_sendmsg() should handle errors from xdr_alloc_bvec() SUNRPC: Handle allocation failure in rpc_new_task() NFS: Ensure rpc_run_task() cannot fail in nfs_async_rename() NFSv4/pnfs: Handle RPC allocation errors in nfs4_proc_layoutget SUNRPC: Handle low memory situations in call_status() SUNRPC: Handle ENOMEM in call_transmit_status() NFSv4.2: Fix missing removal of SLAB_ACCOUNT on kmem_cache allocation SUNRPC: Ensure we flush any closed sockets before xs_xprt_free() NFS: Replace readdir's use of xxhash() with hash_64() SUNRPC: handle malloc failure in ->request_prepare NFSv4: fix open failure with O_ACCMODE flag Revert "NFSv4: Handle the special Linux file open access mode" commit c0aa53389b0c869be2e4373594a1d10e8499f5b0 Merge: d66b6985b164 d02b4dd84e1a Author: Linus Torvalds Date: Fri Apr 8 07:09:17 2022 -1000 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "The two main things to note are: (1) The bulk of the diffstat is us reverting a horrible bodge we had in place to ease the merging of maple tree during the merge window (which turned out not to be needed, but anyway) (2) The TLB invalidation fix is done in core code, as suggested by (and Acked-by) Peter. Summary: - Revert temporary bodge in MTE coredumping to ease maple tree integration - Fix stack frame size warning reported with 64k pages - Fix stop_machine() race with instruction text patching - Ensure alternatives patching routines are not instrumented - Enable Spectre-BHB mitigation for Cortex-A78AE - Fix hugetlb TLB invalidation when contiguous hint is used - Minor perf driver fixes - Fix some typos" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: perf/imx_ddr: Fix undefined behavior due to shift overflowing the constant arm64: Add part number for Arm Cortex-A78AE arm64: patch_text: Fixup last cpu should be master tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry arm64: alternatives: mark patch_alternative() as `noinstr` perf: MARVELL_CN10K_DDR_PMU should depend on ARCH_THUNDER perf: qcom_l2_pmu: fix an incorrect NULL check on list iterator arm64: Fix comments in macro __init_el2_gicv3 arm64: fix typos in comments arch/arm64: Fix topology initialization for core scheduling arm64: mte: Fix the stack frame size warning in mte_dump_tag_range() Revert "arm64: Change elfcore for_each_mte_vma() to use VMA iterator" commit d66b6985b164b368657333c4a700bf4108893612 Merge: d00c50b35101 98ea02597b99 Author: Linus Torvalds Date: Fri Apr 8 06:52:50 2022 -1000 Merge tag 'folio-5.18e' of git://git.infradead.org/users/willy/pagecache Pull folio fixes from Matthew Wilcox: "Fewer bug reports than I was expecting from enabling large folios. One that doesn't show up on x86 but does on arm64, one that shows up with hugetlbfs memory failure testing and one that shows up with page migration, which it turns out I wasn't testing because my last NUMA machine died. Need to set up a qemu fake NUMA machine so I don't skip testing that in future. Summary: - Remove the migration code's assumptions about large pages being PMD sized - Don't call pmd_page() on a non-leaf PMD - Fix handling of hugetlbfs pages in page_vma_mapped_walk" * tag 'folio-5.18e' of git://git.infradead.org/users/willy/pagecache: mm/rmap: Fix handling of hugetlbfs pages in page_vma_mapped_walk mm/mempolicy: Use vma_alloc_folio() in new_page() mm: Add vma_alloc_folio() mm/migrate: Use a folio in migrate_misplaced_transhuge_page() mm/migrate: Use a folio in alloc_migration_target() mm/huge_memory: Avoid calling pmd_page() on a non-leaf PMD commit d00c50b35101b862c3db270ffeba53a63a1063d9 Merge: 98849765a58b 2c7d1b281286 Author: Linus Torvalds Date: Fri Apr 8 06:45:38 2022 -1000 Merge tag 'spi-fix-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A small collection of fixes that have arrived since the merge window, the most noticable one is a fix for unmapping messages when the mapping was done with the struct device supplied to do the mapping overridden" * tag 'spi-fix-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op() spi: cadence-quadspi: fix protocol setup for non-1-1-X operations spi: core: add dma_map_dev for __spi_unmap_msg() spi: mxic: Fix an error handling path in mxic_spi_probe() spi: rpc-if: Fix RPM imbalance in probe error path commit 98849765a58b56479dbb105565a24417752eff25 Merge: 0ccab01401c8 908b768f9a8f Author: Linus Torvalds Date: Fri Apr 8 06:42:03 2022 -1000 Merge tag 'regulator-fix-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "A few small driver specific fixes for v5.18, plus an update to the MAINTAINERS file" * tag 'regulator-fix-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: MAINTAINERS: Fix reviewer info for a few ROHM ICs regulator: atc260x: Fix missing active_discharge_on setting regulator: rtq2134: Fix missing active_discharge_on setting regulator: wm8994: Add an off-on delay for WM8994 variant commit 0ccab01401c89cc846913fcba6130f76034624c0 Merge: 02994fd2da76 b71597edfaad Author: Linus Torvalds Date: Fri Apr 8 06:37:11 2022 -1000 Merge tag 'mmc-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: "MMC core: - Improve API to make it clear that mmc_hw_reset() is for cards - Fixup support for writeback-cache for eMMC and SD - Check for errors after writes on SPI MMC host: - renesas_sdhi: A couple of fixes of TAP settings for eMMC HS400 mode - mmci_stm32: Fixup check of all elements in sg list - sdhci-xenon: Revert unnecessary fix for annoying 1.8V regulator warning" * tag 'mmc-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: core: improve API to make clear mmc_hw_reset is for cards mmc: renesas_sdhi: don't overwrite TAP settings when HS400 tuning is complete mmc: renesas_sdhi: special 4tap settings only apply to HS400 mmc: core: Fixup support for writeback-cache for eMMC and SD mmc: block: Check for errors after write on SPI mmc: mmci: stm32: correctly check all elements of sg list Revert "mmc: sdhci-xenon: fix annoying 1.8V regulator warning" commit a44e2c207c30a5780c4ad0cc3579b8715cebf52e Merge: 5593473a1e6c 21db83846683 Author: Paolo Bonzini Date: Fri Apr 8 12:30:04 2022 -0400 Merge tag 'kvmarm-fixes-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 5.18, take #1 - Some PSCI fixes after introducing PSCIv1.1 and SYSTEM_RESET2 - Fix the MMU write-lock not being taken on THP split - Fix mixed-width VM handling - Fix potential UAF when debugfs registration fails - Various selftest updates for all of the above commit 02994fd2da76b99d3f6777f5b3bdb5d2823a0fed Merge: 1831fed55973 71ff461c3f41 Author: Linus Torvalds Date: Fri Apr 8 06:29:25 2022 -1000 Merge tag 'iommu-fix-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fix from Joerg Roedel: - Fix boot regression due to a NULL-ptr dereference on OMAP machines * tag 'iommu-fix-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/omap: Fix regression in probe for NULL pointer dereference commit 7d59706dbef8de83b3662026766507bc494223d7 Author: Mateusz Palczewski Date: Thu Mar 24 14:19:15 2022 +0100 Revert "iavf: Fix deadlock occurrence during resetting VF interface" This change caused a regression with resetting while changing network namespaces. By clearing the IFF_UP flag, the kernel now thinks it has fully closed the device. This reverts commit 0cc318d2e8408bc0ffb4662a0c3e5e57005ac6ff. Fixes: 0cc318d2e840 ("iavf: Fix deadlock occurrence during resetting VF interface") Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/iavf/iavf_main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit d7442f512b71fc63a99c8a801422dde4fbbf9f93 Author: Alexander Lobakin Date: Mon Apr 4 18:15:09 2022 +0200 ice: arfs: fix use-after-free when freeing @rx_cpu_rmap The CI testing bots triggered the following splat: [ 718.203054] BUG: KASAN: use-after-free in free_irq_cpu_rmap+0x53/0x80 [ 718.206349] Read of size 4 at addr ffff8881bd127e00 by task sh/20834 [ 718.212852] CPU: 28 PID: 20834 Comm: sh Kdump: loaded Tainted: G S W IOE 5.17.0-rc8_nextqueue-devqueue-02643-g23f3121aca93 #1 [ 718.219695] Hardware name: Intel Corporation S2600WFT/S2600WFT, BIOS SE5C620.86B.02.01.0012.070720200218 07/07/2020 [ 718.223418] Call Trace: [ 718.227139] [ 718.230783] dump_stack_lvl+0x33/0x42 [ 718.234431] print_address_description.constprop.9+0x21/0x170 [ 718.238177] ? free_irq_cpu_rmap+0x53/0x80 [ 718.241885] ? free_irq_cpu_rmap+0x53/0x80 [ 718.245539] kasan_report.cold.18+0x7f/0x11b [ 718.249197] ? free_irq_cpu_rmap+0x53/0x80 [ 718.252852] free_irq_cpu_rmap+0x53/0x80 [ 718.256471] ice_free_cpu_rx_rmap.part.11+0x37/0x50 [ice] [ 718.260174] ice_remove_arfs+0x5f/0x70 [ice] [ 718.263810] ice_rebuild_arfs+0x3b/0x70 [ice] [ 718.267419] ice_rebuild+0x39c/0xb60 [ice] [ 718.270974] ? asm_sysvec_apic_timer_interrupt+0x12/0x20 [ 718.274472] ? ice_init_phy_user_cfg+0x360/0x360 [ice] [ 718.278033] ? delay_tsc+0x4a/0xb0 [ 718.281513] ? preempt_count_sub+0x14/0xc0 [ 718.284984] ? delay_tsc+0x8f/0xb0 [ 718.288463] ice_do_reset+0x92/0xf0 [ice] [ 718.292014] ice_pci_err_resume+0x91/0xf0 [ice] [ 718.295561] pci_reset_function+0x53/0x80 <...> [ 718.393035] Allocated by task 690: [ 718.433497] Freed by task 20834: [ 718.495688] Last potentially related work creation: [ 718.568966] The buggy address belongs to the object at ffff8881bd127e00 which belongs to the cache kmalloc-96 of size 96 [ 718.574085] The buggy address is located 0 bytes inside of 96-byte region [ffff8881bd127e00, ffff8881bd127e60) [ 718.579265] The buggy address belongs to the page: [ 718.598905] Memory state around the buggy address: [ 718.601809] ffff8881bd127d00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc [ 718.604796] ffff8881bd127d80: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc [ 718.607794] >ffff8881bd127e00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc [ 718.610811] ^ [ 718.613819] ffff8881bd127e80: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc [ 718.617107] ffff8881bd127f00: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc This is due to that free_irq_cpu_rmap() is always being called *after* (devm_)free_irq() and thus it tries to work with IRQ descs already freed. For example, on device reset the driver frees the rmap right before allocating a new one (the splat above). Make rmap creation and freeing function symmetrical with {request,free}_irq() calls i.e. do that on ifup/ifdown instead of device probe/remove/resume. These operations can be performed independently from the actual device aRFS configuration. Also, make sure ice_vsi_free_irq() clears IRQ affinity notifiers only when aRFS is disabled -- otherwise, CPU rmap sets and clears its own and they must not be touched manually. Fixes: 28bf26724fdb0 ("ice: Implement aRFS") Co-developed-by: Ivan Vecera Signed-off-by: Ivan Vecera Signed-off-by: Alexander Lobakin Tested-by: Ivan Vecera Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_arfs.c | 9 ++------- drivers/net/ethernet/intel/ice/ice_lib.c | 5 ++++- drivers/net/ethernet/intel/ice/ice_main.c | 18 ++++++++---------- 3 files changed, 14 insertions(+), 18 deletions(-) commit 7b2666ce445c700b8dcee994da44ddcf050a0842 Author: Armin Wolf Date: Thu Apr 7 12:13:12 2022 +0200 hwmon: (adt7470) Fix warning on module removal When removing the adt7470 module, a warning might be printed: do not call blocking ops when !TASK_RUNNING; state=1 set at [] adt7470_update_thread+0x7b/0x130 [adt7470] This happens because adt7470_update_thread() can leave the kthread in TASK_INTERRUPTIBLE state when the kthread is being stopped before the call of set_current_state(). Since kthread_exit() might sleep in exit_signals(), the warning is printed. Fix that by using schedule_timeout_interruptible() and removing the call of set_current_state(). This causes TASK_INTERRUPTIBLE to be set after kthread_should_stop() which might cause the kthread to exit. Reported-by: Zheyu Ma Fixes: 93cacfd41f82 (hwmon: (adt7470) Allow faster removal) Signed-off-by: Armin Wolf Tested-by: Zheyu Ma Link: https://lore.kernel.org/r/20220407101312.13331-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck drivers/hwmon/adt7470.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ddfd534528146660de75ee84d6db10f10e778f95 Author: Christophe JAILLET Date: Sun Apr 3 08:58:27 2022 +0200 ASoC: codecs: Fix an error handling path in (rx|tx|va)_macro_probe() After a successful lpass_macro_pds_init() call, lpass_macro_pds_exit() must be called. Add the missing call in the error handling path of the probe function and use it. Fixes: 9e3d83c52844 ("ASoC: codecs: Add power domains support in digital macro codecs") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/5b5a015a9b1dc8011c6a4053fa49da1f2531e47c.1648969065.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown sound/soc/codecs/lpass-rx-macro.c | 14 ++++++++++---- sound/soc/codecs/lpass-tx-macro.c | 14 ++++++++++---- sound/soc/codecs/lpass-va-macro.c | 8 ++++++-- 3 files changed, 26 insertions(+), 10 deletions(-) commit d788e51636462e61c6883f7d96b07b06bc291650 Author: Shyam Prasad N Date: Fri Apr 1 06:25:17 2022 +0000 cifs: release cached dentries only if mount is complete During cifs_kill_sb, we first dput all the dentries that we have cached. However this function can also get called for mount failures. So dput the cached dentries only if the filesystem mount is complete. i.e. cifs_sb->root is populated. Fixes: 5e9c89d43fa6 ("cifs: Grab a reference for the dentry of the cached directory during the lifetime of the cache") Signed-off-by: Shyam Prasad N Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French fs/cifs/cifsfs.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) commit 994fd530a512597ffcd713b0f6d5bc916c5698f0 Author: David Howells Date: Thu Apr 7 00:03:14 2022 +0100 cifs: Check the IOCB_DIRECT flag, not O_DIRECT Use the IOCB_DIRECT indicator flag on the I/O context rather than checking to see if the file was opened O_DIRECT. Signed-off-by: David Howells cc: Steve French cc: Shyam Prasad N cc: Rohith Surabattula cc: linux-cifs@vger.kernel.org Signed-off-by: Steve French fs/cifs/cifsfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d02b4dd84e1a90f7f1444d027c0289bf355b0d5a Author: Borislav Petkov Date: Tue Apr 5 17:15:15 2022 +0200 perf/imx_ddr: Fix undefined behavior due to shift overflowing the constant Fix: In file included from :0:0: In function ‘ddr_perf_counter_enable’, inlined from ‘ddr_perf_irq_handler’ at drivers/perf/fsl_imx8_ddr_perf.c:651:2: ././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_729’ \ declared with attribute error: FIELD_PREP: mask is not constant _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) ... See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. Signed-off-by: Borislav Petkov Cc: Frank Li Cc: Will Deacon Cc: Mark Rutland Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org Acked-by: Will Deacon Link: https://lore.kernel.org/r/20220405151517.29753-10-bp@alien8.de Signed-off-by: Will Deacon drivers/perf/fsl_imx8_ddr_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fee2ec8cceb33b8886bc5894fb07e0b2e34148af Author: Takashi Iwai Date: Thu Apr 7 23:27:40 2022 +0200 ALSA: usb-audio: Increase max buffer size The current limit of max buffer size 1MB seems too small for modern devices with lots of channels and high sample rates. Let's make bigger, 4MB. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220407212740.17920-1-tiwai@suse.de Signed-off-by: Takashi Iwai sound/usb/pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 98c27add5d96485db731a92dac31567b0486cae8 Author: Takashi Iwai Date: Thu Apr 7 23:16:57 2022 +0200 ALSA: usb-audio: Cap upper limits of buffer/period bytes for implicit fb In the implicit feedback mode, some parameters are tied between both playback and capture streams. One of the tied parameters is the period size, and this can be a problem if the device has different number of channels to both streams. Assume that an application opens a playback stream that has an implicit feedback from a capture stream, and it allocates up to the max period and buffer size as much as possible. When the capture device supports only more channels than the playback, the minimum period and buffer sizes become larger than the sizes the playback stream took. That is, the minimum size will be over the max size the driver limits, and PCM core sees as if no available configuration is found, returning -EINVAL mercilessly. For avoiding this problem, we have to look through the counter part of audioformat list for each sync ep, and checks the channels. If more channels are found there, we reduce the max period and buffer sizes accordingly. You may wonder that the patch adds only the evaluation of channels between streams, and what about other parameters? Both the format and the rate are tied in the implicit fb mode, hence they are always identical. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215792 Fixes: 5a6c3e11c9c9 ("ALSA: usb-audio: Add hw constraint for implicit fb sync") Cc: Link: https://lore.kernel.org/r/20220407211657.15087-1-tiwai@suse.de Signed-off-by: Takashi Iwai sound/usb/pcm.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 87 insertions(+), 2 deletions(-) commit 0c2cae09a765b1c1d842eb9328982976ec735926 Author: Andy Shevchenko Date: Thu Mar 17 11:33:11 2022 +0200 gpiolib: acpi: Convert type for pin to be unsigned A pin that comes from ACPI tables is of unsigned type. This also applies to the internal APIs which use unsigned int to store the pin. Convert type for pin to be unsigned in the places where it's not yet true. While at it, add a stub for acpi_get_and_request_gpiod() for the sake of consistency in the APIs. Signed-off-by: Andy Shevchenko drivers/gpio/gpiolib-acpi.c | 18 ++++++++++-------- include/linux/gpio/consumer.h | 8 +++++++- 2 files changed, 17 insertions(+), 9 deletions(-) commit 213d266ebfb1621aab79cfe63388facc520a1381 Author: Linus Torvalds Date: Sat Mar 19 16:21:09 2022 -0700 gpiolib: acpi: use correct format characters When compiling with -Wformat, clang emits the following warning: gpiolib-acpi.c:393:4: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] pin); ^~~ So warning that '%hhX' is paired with an 'int' is all just completely mindless and wrong. Sadly, I can see a different bogus warning reason why people would want to use '%02hhX'. Again, the *sane* thing from a human perspective is to use '%02X. But if the compiler doesn't do any range analysis at all, it could decide that "Oh, that print format could need up to 8 bytes of space in the result". Using '%02hhX' would cut that down to two. And since we use char ev_name[5]; and currently use "_%c%02hhX" as the format string, even a compiler that doesn't notice that "pin <= 255" test that guards this all will go "OK, that's at most 4 bytes and the final NUL termination, so it's fine". While a compiler - like gcc - that only sees that the original source of the 'pin' value is a 'unsigned short' array, and then doesn't take the "pin <= 255" into account, will warn like this: gpiolib-acpi.c: In function 'acpi_gpiochip_request_interrupt': gpiolib-acpi.c:206:24: warning: '%02X' directive writing between 2 and 4 bytes into a region of size 3 [-Wformat-overflow=] sprintf(ev_name, "_%c%02X", ^~~~ gpiolib-acpi.c:206:20: note: directive argument in the range [0, 65535] because gcc isn't being very good at that argument range analysis either. In other words, the original use of 'hhx' was bogus to begin with, and due to *another* compiler warning being bad, and we had that bad code being written back in 2016 to work around _that_ compiler warning (commit e40a3ae1f794: "gpio: acpi: work around false-positive -Wstring-overflow warning"). Sadly, two different bad compiler warnings together does not make for one good one. It just makes for even more pain. End result: I think the simplest and cleanest option is simply the proposed change which undoes that '%hhX' change for gcc, and replaces it with just using a slightly bigger stack allocation. It's not like a 5-byte allocation is in any way likely to have saved any actual stack, since all the other variables in that function are 'int' or bigger. False-positive compiler warnings really do make people write worse code, and that's a problem. But on a scale of bad code, I feel that extending the buffer trivially is better than adding a pointless cast that literally makes no sense. At least in this case the end result isn't unreadable or buggy. We've had several cases of bad compiler warnings that caused changes that were actually horrendously wrong. Fixes: e40a3ae1f794 ("gpio: acpi: work around false-positive -Wstring-overflow warning") Signed-off-by: Linus Torvalds Signed-off-by: Andy Shevchenko drivers/gpio/gpiolib-acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 7cea5560bf656b84f9ed01c0cc829d4eecd0640b Author: Hongbin Wang Date: Wed Apr 6 22:46:22 2022 -0400 vxlan: fix error return code in vxlan_fdb_append When kmalloc and dst_cache_init failed, should return ENOMEM rather than ENOBUFS. Signed-off-by: Hongbin Wang Signed-off-by: David S. Miller drivers/net/vxlan/vxlan_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1b808993e19447731e823b1313ee4e8da7fd92a0 Author: Jakub Kicinski Date: Wed Apr 6 14:15:21 2022 -0700 flow_dissector: fix false-positive __read_overflow2_field() warning Bounds checking is unhappy that we try to copy both Ethernet addresses but pass pointer to the first one. Luckily destination address is the first field so pass the pointer to the entire header, whatever. Signed-off-by: Jakub Kicinski Reviewed-by: Kees Cook Signed-off-by: David S. Miller net/core/flow_dissector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 726e2c5929de841fdcef4e2bf995680688ae1b87 Author: Guillaume Nault Date: Wed Apr 6 16:18:54 2022 +0200 veth: Ensure eth header is in skb's linear part After feeding a decapsulated packet to a veth device with act_mirred, skb_headlen() may be 0. But veth_xmit() calls __dev_forward_skb(), which expects at least ETH_HLEN byte of linear data (as __dev_forward_skb2() calls eth_type_trans(), which pulls ETH_HLEN bytes unconditionally). Use pskb_may_pull() to ensure veth_xmit() respects this constraint. kernel BUG at include/linux/skbuff.h:2328! RIP: 0010:eth_type_trans+0xcf/0x140 Call Trace: __dev_forward_skb2+0xe3/0x160 veth_xmit+0x6e/0x250 [veth] dev_hard_start_xmit+0xc7/0x200 __dev_queue_xmit+0x47f/0x520 ? skb_ensure_writable+0x85/0xa0 ? skb_mpls_pop+0x98/0x1c0 tcf_mirred_act+0x442/0x47e [act_mirred] tcf_action_exec+0x86/0x140 fl_classify+0x1d8/0x1e0 [cls_flower] ? dma_pte_clear_level+0x129/0x1a0 ? dma_pte_clear_level+0x129/0x1a0 ? prb_fill_curr_block+0x2f/0xc0 ? skb_copy_bits+0x11a/0x220 __tcf_classify+0x58/0x110 tcf_classify_ingress+0x6b/0x140 __netif_receive_skb_core.constprop.0+0x47d/0xfd0 ? __iommu_dma_unmap_swiotlb+0x44/0x90 __netif_receive_skb_one_core+0x3d/0xa0 netif_receive_skb+0x116/0x170 be_process_rx+0x22f/0x330 [be2net] be_poll+0x13c/0x370 [be2net] __napi_poll+0x2a/0x170 net_rx_action+0x22f/0x2f0 __do_softirq+0xca/0x2a8 __irq_exit_rcu+0xc1/0xe0 common_interrupt+0x83/0xa0 Fixes: e314dbdc1c0d ("[NET]: Virtual ethernet device driver.") Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller drivers/net/veth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2cd1881b9821be68d1eb748c96311258b16af225 Author: Gal Pressman Date: Wed Apr 6 16:54:20 2022 +0300 bonding: Update layer2 and layer2+3 hash formula documentation When using layer2 or layer2+3 hash, only the 5th byte of the MAC addresses is used. Signed-off-by: Gal Pressman Signed-off-by: David S. Miller Documentation/networking/bonding.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 908b768f9a8ffca2ef69f3145e23a6a259f99ac3 Author: Matti Vaittinen Date: Fri Apr 8 11:32:00 2022 +0300 MAINTAINERS: Fix reviewer info for a few ROHM ICs The email backend used by ROHM keeps labeling patches as spam. Additionally, there have been reports of some emails been completely dropped. Finally also the email list (or shared inbox) linux-power@fi.rohmeurope.com inadvertly stopped working and has not been reviwed during the past few weeks. Remove no longer working list 'linux-power' list-entry and switch my email to use the personal gmail account instead of the company account. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/Yk/zAHusOdf4+h06@dc73szyh141qn5ck3nwqy-3.rev.dnainternet.fi Signed-off-by: Mark Brown MAINTAINERS | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) commit aa70527d36d74db80a1c40e792f5320ab56e6eae Merge: 92ccbf17eeac c7cb4717f641 Author: Mark Brown Date: Fri Apr 8 12:08:37 2022 +0100 Make headphone work on Huawei Matebook D15 Merge series from Mauro Carvalho Chehab : Huawei Matebook D15 uses two different GPIOs are used to control the output: - gpio0 controls the speaker output; - gpio1 controls the headphone output. Changing both at the same time cause spurious events that are mis-interpreted as input events, causing troubles on apps. So, a delay is needed before turning on such gpios. Also, the headset microphone is connected to MIC1, instead of MIC2 port. With this patch, plugging a headphone causes a jack event to trigger the speaker supply, powering down the speaker and powering up the headphone output. Removing the headphone also triggers the power supply, powering up the speaker and powering down the headphone. The headset microphone also works. commit 2105f700b53c24aa48b65c15652acc386044d26a Author: Vlad Buslov Date: Wed Apr 6 14:22:41 2022 +0300 net/sched: flower: fix parsing of ethertype following VLAN header A tc flower filter matching TCA_FLOWER_KEY_VLAN_ETH_TYPE is expected to match the L2 ethertype following the first VLAN header, as confirmed by linked discussion with the maintainer. However, such rule also matches packets that have additional second VLAN header, even though filter has both eth_type and vlan_ethtype set to "ipv4". Looking at the code this seems to be mostly an artifact of the way flower uses flow dissector. First, even though looking at the uAPI eth_type and vlan_ethtype appear like a distinct fields, in flower they are all mapped to the same key->basic.n_proto. Second, flow dissector skips following VLAN header as no keys for FLOW_DISSECTOR_KEY_CVLAN are set and eventually assigns the value of n_proto to last parsed header. With these, such filters ignore any headers present between first VLAN header and first "non magic" header (ipv4 in this case) that doesn't result FLOW_DISSECT_RET_PROTO_AGAIN. Fix the issue by extending flow dissector VLAN key structure with new 'vlan_eth_type' field that matches first ethertype following previously parsed VLAN header. Modify flower classifier to set the new flow_dissector_key_vlan->vlan_eth_type with value obtained from TCA_FLOWER_KEY_VLAN_ETH_TYPE/TCA_FLOWER_KEY_CVLAN_ETH_TYPE uAPIs. Link: https://lore.kernel.org/all/Yjhgi48BpTGh6dig@nanopsycho/ Fixes: 9399ae9a6cb2 ("net_sched: flower: Add vlan support") Fixes: d64efd0926ba ("net/sched: flower: Add supprt for matching on QinQ vlan headers") Signed-off-by: Vlad Buslov Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller include/net/flow_dissector.h | 2 ++ net/core/flow_dissector.c | 1 + net/sched/cls_flower.c | 18 +++++++++++++----- 3 files changed, 16 insertions(+), 5 deletions(-) commit 5a80059d88046b0a87e957565363ba3ee57600bb Author: Kunihiko Hayashi Date: Tue Apr 5 16:53:01 2022 +0900 dt-bindings: net: ave: Use unevaluatedProperties This refers common bindings, so this is preferred for unevaluatedProperties instead of additionalProperties. Signed-off-by: Kunihiko Hayashi Acked-by: Rob Herring Signed-off-by: David S. Miller Documentation/devicetree/bindings/net/socionext,uniphier-ave4.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2610bd72efe4b376febd477425769f647152a3a8 Author: Kunihiko Hayashi Date: Tue Apr 5 16:53:00 2022 +0900 dt-bindings: net: ave: Clean up clocks, resets, and their names using compatible string Instead of "oneOf:" choices, use "allOf:" and "if:" to define clocks, resets, and their names that can be taken by the compatible string. The order of clock-names and reset-names doesn't change here. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Signed-off-by: David S. Miller .../bindings/net/socionext,uniphier-ave4.yaml | 55 +++++++++++++++------- 1 file changed, 38 insertions(+), 17 deletions(-) commit 83bea32ac7ed37bbda58733de61fc9369513f9f9 Author: Chanho Park Date: Thu Apr 7 18:11:28 2022 +0900 arm64: Add part number for Arm Cortex-A78AE Add the MIDR part number info for the Arm Cortex-A78AE[1] and add it to spectre-BHB affected list[2]. [1]: https://developer.arm.com/Processors/Cortex-A78AE [2]: https://developer.arm.com/Arm%20Security%20Center/Spectre-BHB Cc: Catalin Marinas Cc: Mark Rutland Cc: Will Deacon Cc: James Morse Signed-off-by: Chanho Park Link: https://lore.kernel.org/r/20220407091128.8700-1-chanho61.park@samsung.com Signed-off-by: Will Deacon arch/arm64/include/asm/cputype.h | 2 ++ arch/arm64/kernel/proton-pack.c | 1 + 2 files changed, 3 insertions(+) commit 31a099dbd91e69fcab55eef4be15ed7a8c984918 Author: Guo Ren Date: Thu Apr 7 15:33:20 2022 +0800 arm64: patch_text: Fixup last cpu should be master These patch_text implementations are using stop_machine_cpuslocked infrastructure with atomic cpu_count. The original idea: When the master CPU patch_text, the others should wait for it. But current implementation is using the first CPU as master, which couldn't guarantee the remaining CPUs are waiting. This patch changes the last CPU as the master to solve the potential risk. Fixes: ae16480785de ("arm64: introduce interfaces to hotpatch kernel and module code") Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Catalin Marinas Reviewed-by: Masami Hiramatsu Cc: Link: https://lore.kernel.org/r/20220407073323.743224-2-guoren@kernel.org Signed-off-by: Will Deacon arch/arm64/kernel/patching.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 71ff461c3f41f6465434b9e980c01782763e7ad8 Author: Tony Lindgren Date: Thu Mar 31 09:23:01 2022 +0300 iommu/omap: Fix regression in probe for NULL pointer dereference Commit 3f6634d997db ("iommu: Use right way to retrieve iommu_ops") started triggering a NULL pointer dereference for some omap variants: __iommu_probe_device from probe_iommu_group+0x2c/0x38 probe_iommu_group from bus_for_each_dev+0x74/0xbc bus_for_each_dev from bus_iommu_probe+0x34/0x2e8 bus_iommu_probe from bus_set_iommu+0x80/0xc8 bus_set_iommu from omap_iommu_init+0x88/0xcc omap_iommu_init from do_one_initcall+0x44/0x24 This is caused by omap iommu probe returning 0 instead of ERR_PTR(-ENODEV) as noted by Jason Gunthorpe . Looks like the regression already happened with an earlier commit 6785eb9105e3 ("iommu/omap: Convert to probe/release_device() call-backs") that changed the function return type and missed converting one place. Cc: Drew Fustini Cc: Lu Baolu Cc: Suman Anna Suggested-by: Jason Gunthorpe Fixes: 6785eb9105e3 ("iommu/omap: Convert to probe/release_device() call-backs") Fixes: 3f6634d997db ("iommu: Use right way to retrieve iommu_ops") Signed-off-by: Tony Lindgren Tested-by: Drew Fustini Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220331062301.24269-1-tony@atomide.com Signed-off-by: Joerg Roedel drivers/iommu/omap-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b71597edfaade119157ded98991bac7160be80c2 Author: Wolfram Sang Date: Fri Apr 8 10:00:42 2022 +0200 mmc: core: improve API to make clear mmc_hw_reset is for cards To make it unambiguous that mmc_hw_reset() is for cards and not for controllers, we make the function argument mmc_card instead of mmc_host. Also, all users are converted. Suggested-by: Ulf Hansson Signed-off-by: Wolfram Sang Acked-by: Kalle Valo Link: https://lore.kernel.org/r/20220408080045.6497-2-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson drivers/mmc/core/block.c | 2 +- drivers/mmc/core/core.c | 5 +++-- drivers/mmc/core/mmc_test.c | 3 +-- drivers/net/wireless/ath/ath10k/sdio.c | 2 +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 +- drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +- drivers/net/wireless/ti/wlcore/sdio.c | 2 +- include/linux/mmc/core.h | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) commit 9af9c58a099b57b818b15eca1e50cef1d222406e Author: Xianwei Zhao Date: Fri Apr 8 15:09:01 2022 +0800 arm64: dts: remove cpu compatible "arm,armv8" for s4 Amlogic s4 device is already applied, but cpu compatible 'arm,armv8' is only valid for software models, so we remove it. Fixes: ac4dfd0d1d35 ("arm64: dts: add support for S4 based Amlogic AQ222") Signed-off-by: Xianwei Zhao Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220408070901.26446-1-xianwei.zhao@amlogic.com arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 1831fed559732b132aef0ea8261ac77e73f7eadf Merge: 5a5dcfd1e878 88711fa9a14f Author: Linus Torvalds Date: Thu Apr 7 19:27:39 2022 -1000 Merge tag 'drm-fixes-2022-04-08' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Main set of fixes for rc2, mostly amdgpu, but some dma-fence fixups as well, along with some other misc ones. dma-fence: - fix warning about fence containers - fix logic error in new fence merge code - handle empty dma_fence_arrays gracefully bridge: - Try all possible cases for bridge/panel detection. bindings: - Don't require input port for MIPI-DSI, and make width/height mandatory. fbdev: - Fix unregistering of framebuffers without device. nouveau: - Fix a crash when booting with nouveau on tegra. amdgpu: - GFX 10.3.7 fixes - noretry updates - VCN fixes - TMDS fix - zstate fix for freesync video - DCN 3.1.5 fix - Display stack size fix - Audio fix - DCN 3.1 pstate fix - TMZ VCN fix - APU passthrough fix - Misc other fixes - VCN 3.0 fixes - Misc display fixes - GC 10.3 golden register fix - Suspend fix - SMU 10 fix amdkfd: - Error handling fix - xgmi p2p fix - HWS VMIDs fix - Event fix panel: - ili9341: Fix optional regulator handling imx: - Catch an EDID allocation failure in imx-ldb - fix a leaked drm display mode on DT parsing error in parallel-display - properly remove the dw_hdmi bridge in case the component_add fails in dw_hdmi-imx - fix the IPU clock frequency debug printout in ipu-di" * tag 'drm-fixes-2022-04-08' of git://anongit.freedesktop.org/drm/drm: (61 commits) dt-bindings: display: panel: mipi-dbi-spi: Make width-mm/height-mm mandatory fbdev: Fix unregistering of framebuffers without device drm/amdgpu/smu10: fix SoC/fclk units in auto mode drm/amd/display: update dcn315 clock table read drm/amdgpu/display: change pipe policy for DCN 2.1 drm/amd/display: Add configuration options for AUX wake work around. drm/amd/display: remove assert for odm transition case drm/amdgpu: don't use BACO for reset in S3 drm/amd/display: Fix by adding FPU protection for dcn30_internal_validate_bw drm/amdkfd: Create file descriptor after client is added to smi_clients list drm/amdgpu: Sync up header and implementation to use the same parameter names drm/amdgpu: fix incorrect GCR_GENERAL_CNTL address amd/display: set backlight only if required drm/amd/display: Fix allocate_mst_payload assert on resume drm/amd/display: Revert FEC check in validation drm/amd/display: Add work around for AUX failure on wake. drm/amd/display: Clear optc false state when disable otg drm/amd/display: Enable power gating before init_pipes drm/amd/display: Remove redundant dsc power gating from init_hw drm/amd/display: Correct Slice reset calculation ... commit 5a5dcfd1e8789053730908c96639151b4151c4d0 Merge: 73b193f26509 7cd1cc415dd8 Author: Linus Torvalds Date: Thu Apr 7 19:16:49 2022 -1000 Merge tag '5.18-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs client fixes from Steve French: - reconnect fixes: one for DFS and one to avoid a reconnect race - small change to deal with upcoming behavior change of list iterators * tag '5.18-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module number cifs: force new session setup and tcon for dfs cifs: remove check of list iterator against head past the loop body cifs: fix potential race with cifsd thread commit 73b193f265096080eac866b9a852627b475384fc Merge: 42e7a03d3bad ec4eb8a86ade Author: Linus Torvalds Date: Thu Apr 7 19:01:47 2022 -1000 Merge tag 'net-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Paolo Abeni: "Including fixes from bpf and netfilter. Current release - new code bugs: - mctp: correct mctp_i2c_header_create result - eth: fungible: fix reference to __udivdi3 on 32b builds - eth: micrel: remove latencies support lan8814 Previous releases - regressions: - bpf: resolve to prog->aux->dst_prog->type only for BPF_PROG_TYPE_EXT - vrf: fix packet sniffing for traffic originating from ip tunnels - rxrpc: fix a race in rxrpc_exit_net() - dsa: revert "net: dsa: stop updating master MTU from master.c" - eth: ice: fix MAC address setting Previous releases - always broken: - tls: fix slab-out-of-bounds bug in decrypt_internal - bpf: support dual-stack sockets in bpf_tcp_check_syncookie - xdp: fix coalescing for page_pool fragment recycling - ovs: fix leak of nested actions - eth: sfc: - add missing xdp queue reinitialization - fix using uninitialized xdp tx_queue - eth: ice: - clear default forwarding VSI during VSI release - fix broken IFF_ALLMULTI handling - synchronize_rcu() when terminating rings - eth: qede: confirm skb is allocated before using - eth: aqc111: fix out-of-bounds accesses in RX fixup - eth: slip: fix NPD bug in sl_tx_timeout()" * tag 'net-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (61 commits) drivers: net: slip: fix NPD bug in sl_tx_timeout() bpf: Adjust bpf_tcp_check_syncookie selftest to test dual-stack sockets bpf: Support dual-stack sockets in bpf_tcp_check_syncookie myri10ge: fix an incorrect free for skb in myri10ge_sw_tso net: usb: aqc111: Fix out-of-bounds accesses in RX fixup qede: confirm skb is allocated before using net: ipv6mr: fix unused variable warning with CONFIG_IPV6_PIMSM_V2=n net: phy: mscc-miim: reject clause 45 register accesses net: axiemac: use a phandle to reference pcs_phy dt-bindings: net: add pcs-handle attribute net: axienet: factor out phy_node in struct axienet_local net: axienet: setup mdio unconditionally net: sfc: fix using uninitialized xdp tx_queue rxrpc: fix a race in rxrpc_exit_net() net: openvswitch: fix leak of nested actions net: ethernet: mv643xx: Fix over zealous checking of_get_mac_address() net: openvswitch: don't send internal clone attribute to the userspace. net: micrel: Fix KS8851 Kconfig ice: clear cmd_type_offset_bsz for TX rings ice: xsk: fix VSI state check in ice_xsk_wakeup() ... commit 88711fa9a14f6f473f4a7645155ca51386e36c21 Merge: 995f74807329 1ecc0c09f19f Author: Dave Airlie Date: Fri Apr 8 09:22:07 2022 +1000 Merge tag 'drm-misc-fixes-2022-04-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v5.18-rc2: - Fix a crash when booting with nouveau on tegra. - Don't require input port for MIPI-DSI, and make width/height mandatory. - Fix unregistering of framebuffers without device. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/58fa2262-3eb6-876d-7157-ab7a135696b7@linux.intel.com commit 995f74807329c97e0aa7449c7a8345fce978a2c4 Merge: dc7d19d27d01 67bae5f28c89 Author: Dave Airlie Date: Fri Apr 8 09:13:33 2022 +1000 Merge tag 'drm-misc-next-fixes-2022-04-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-next-fixes for v5.18-rc2: - fix warning about fence containers - fix logic error in new fence merge code - handle empty dma_fence_arrays gracefully - Try all possible cases for bridge/panel detection. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/3b8e6439-612e-f640-e380-51e834393e94@linux.intel.com commit 8de8b71b787f38983d414d2dba169a3bfefa668a Author: Maciej Fijalkowski Date: Wed Apr 6 17:58:04 2022 +0200 xsk: Fix l2fwd for copy mode + busy poll combo While checking AF_XDP copy mode combined with busy poll, strange results were observed. rxdrop and txonly scenarios worked fine, but l2fwd broke immediately. After a deeper look, it turned out that for l2fwd, Tx side was exiting early due to xsk_no_wakeup() returning true and in the end xsk_generic_xmit() was never called. Note that AF_XDP Tx in copy mode is syscall steered, so the current behavior is broken. Txonly scenario only worked due to the fact that sk_mark_napi_id_once_xdp() was never called - since Rx side is not in the picture for this case and mentioned function is called in xsk_rcv_check(), sk::sk_napi_id was never set, which in turn meant that xsk_no_wakeup() was returning false (see the sk->sk_napi_id >= MIN_NAPI_ID check in there). To fix this, prefer busy poll in xsk_sendmsg() only when zero copy is enabled on a given AF_XDP socket. By doing so, busy poll in copy mode would not exit early on Tx side and eventually xsk_generic_xmit() will be called. Fixes: a0731952d9cd ("xsk: Add busy-poll support for {recv,send}msg()") Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220406155804.434493-1-maciej.fijalkowski@intel.com net/xdp/xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ff053dbbaffec45c85e5bfe43306d26694a6433f Author: Trond Myklebust Date: Wed Apr 6 22:51:58 2022 -0400 SUNRPC: Move the call to xprt_send_pagedata() out of xprt_sock_sendmsg() The client and server have different requirements for their memory allocation, so move the allocation of the send buffer out of the socket send code that is common to both. Reported-by: NeilBrown Fixes: b2648015d452 ("SUNRPC: Make the rpciod and xprtiod slab allocation modes consistent") Signed-off-by: Trond Myklebust net/sunrpc/socklib.c | 6 ------ net/sunrpc/svcsock.c | 9 ++++++--- net/sunrpc/xprtsock.c | 15 +++++++++++++-- 3 files changed, 19 insertions(+), 11 deletions(-) commit b056fa070814897be32d83b079dbc311375588e7 Author: Trond Myklebust Date: Thu Apr 7 14:10:23 2022 -0400 SUNRPC: svc_tcp_sendmsg() should handle errors from xdr_alloc_bvec() The allocation is done with GFP_KERNEL, but it could still fail in a low memory situation. Fixes: 4a85a6a3320b ("SUNRPC: Handle TCP socket sends with kernel_sendpage() again") Signed-off-by: Trond Myklebust net/sunrpc/svcsock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 25cf32ad5dba79385f6e7de9008dcb75556c42d2 Author: Trond Myklebust Date: Wed Apr 6 22:36:19 2022 -0400 SUNRPC: Handle allocation failure in rpc_new_task() If the call to rpc_alloc_task() fails, then ensure that the calldata is released, and that rpc_run_task() and rpc_run_bc_task() bail out early. Reported-by: NeilBrown Fixes: 910ad38697d9 ("NFS: Fix memory allocation in rpc_alloc_task()") Signed-off-by: Trond Myklebust net/sunrpc/clnt.c | 7 +++++++ net/sunrpc/sched.c | 5 +++++ 2 files changed, 12 insertions(+) commit 88dee0cc93adcd83db9d089c1163dc88edafd1c1 Author: Trond Myklebust Date: Wed Apr 6 22:34:35 2022 -0400 NFS: Ensure rpc_run_task() cannot fail in nfs_async_rename() Ensure the call to rpc_run_task() cannot fail by preallocating the rpc_task. Fixes: 910ad38697d9 ("NFS: Fix memory allocation in rpc_alloc_task()") Signed-off-by: Trond Myklebust fs/nfs/unlink.c | 1 + include/linux/nfs_xdr.h | 1 + 2 files changed, 2 insertions(+) commit 68b78dcdf93a845d68e34918d17c125924240584 Author: Trond Myklebust Date: Wed Apr 6 22:33:19 2022 -0400 NFSv4/pnfs: Handle RPC allocation errors in nfs4_proc_layoutget If rpc_run_task() fails due to an allocation error, then bail out early. Fixes: 910ad38697d9 ("NFS: Fix memory allocation in rpc_alloc_task()") Signed-off-by: Trond Myklebust fs/nfs/nfs4proc.c | 2 ++ 1 file changed, 2 insertions(+) commit 9d82819d5b065348ce623f196bf601028e22ed00 Author: Trond Myklebust Date: Thu Apr 7 09:50:19 2022 -0400 SUNRPC: Handle low memory situations in call_status() We need to handle ENFILE, ENOBUFS, and ENOMEM, because xprt_wake_pending_tasks() can be called with any one of these due to socket creation failures. Fixes: b61d59fffd3e ("SUNRPC: xs_tcp_connect_worker{4,6}: merge common code") Signed-off-by: Trond Myklebust net/sunrpc/clnt.c | 5 +++++ 1 file changed, 5 insertions(+) commit d3c15033b240767d0287f1c4a529cbbe2d5ded8a Author: Trond Myklebust Date: Wed Apr 6 23:18:57 2022 -0400 SUNRPC: Handle ENOMEM in call_transmit_status() Both call_transmit() and call_bc_transmit() can now return ENOMEM, so let's make sure that we handle the errors gracefully. Fixes: 0472e4766049 ("SUNRPC: Convert socket page send code to use iov_iter()") Signed-off-by: Trond Myklebust net/sunrpc/clnt.c | 2 ++ 1 file changed, 2 insertions(+) commit dcc7977c7fdd0b59809cf7420ae1d5f5b5bd16ad Author: Muchun Song Date: Fri Apr 1 10:59:05 2022 +0800 NFSv4.2: Fix missing removal of SLAB_ACCOUNT on kmem_cache allocation The commit 5c60e89e71f8 ("NFSv4.2: Fix up an invalid combination of memory allocation flags") has stripped GFP_KERNEL_ACCOUNT down to GFP_KERNEL, however, it forgot to remove SLAB_ACCOUNT from kmem_cache allocation. It means that memory is still limited by kmemcg. This patch also fix a NULL pointer reference issue [1] reported by NeilBrown. Link: https://lore.kernel.org/all/164870069595.25542.17292003658915487357@noble.neil.brown.name/ [1] Fixes: 5c60e89e71f8 ("NFSv4.2: Fix up an invalid combination of memory allocation flags") Fixes: 5abc1e37afa0 ("mm: list_lru: allocate list_lru_one only when needed") Reported-by: NeilBrown Signed-off-by: Muchun Song Signed-off-by: Trond Myklebust fs/nfs/nfs42xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f00432063db1a0db484e85193eccc6845435b80e Author: Trond Myklebust Date: Sun Apr 3 15:58:11 2022 -0400 SUNRPC: Ensure we flush any closed sockets before xs_xprt_free() We must ensure that all sockets are closed before we call xprt_free() and release the reference to the net namespace. The problem is that calling fput() will defer closing the socket until delayed_fput() gets called. Let's fix the situation by allowing rpciod and the transport teardown code (which runs on the system wq) to call __fput_sync(), and directly close the socket. Reported-by: Felix Fu Acked-by: Al Viro Fixes: a73881c96d73 ("SUNRPC: Fix an Oops in udp_poll()") Cc: stable@vger.kernel.org # 5.1.x: 3be232f11a3c: SUNRPC: Prevent immediate close+reconnect Cc: stable@vger.kernel.org # 5.1.x: 89f42494f92f: SUNRPC: Don't call connect() more than once on a TCP socket Cc: stable@vger.kernel.org # 5.1.x Signed-off-by: Trond Myklebust fs/file_table.c | 1 + include/trace/events/sunrpc.h | 1 - net/sunrpc/xprt.c | 7 +------ net/sunrpc/xprtsock.c | 16 +++++++++++++--- 4 files changed, 15 insertions(+), 10 deletions(-) commit 830f1111d90e8770fcfad8bd5628e8ae6fecec06 Author: Trond Myklebust Date: Wed Mar 30 20:00:07 2022 -0400 NFS: Replace readdir's use of xxhash() with hash_64() Both xxhash() and hash_64() appear to give similarly low collision rates with a standard linearly increasing readdir offset. They both give similarly higher collision rates when applied to ext4's offsets. So switch to using the standard hash_64(). Signed-off-by: Trond Myklebust fs/nfs/Kconfig | 4 ---- fs/nfs/dir.c | 9 +++------ 2 files changed, 3 insertions(+), 10 deletions(-) commit 262fc47ac17461c8cdc71c70aff6c3ea45acb0b9 Author: Juergen Gross Date: Thu Apr 7 11:38:57 2022 +0200 xen/balloon: don't use PV mode extra memory for zone device allocations When running as a Xen PV guest use the extra memory (memory which isn't allocated for the guest at boot time) only for ballooning purposes and not for zone device allocations. This will remove some code without any lack of functionality. While at it move some code to get rid of another #ifdef. Remove a comment which is stale since some time now. Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20220407093857.1485-1-jgross@suse.com Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky drivers/xen/balloon.c | 54 ++++++++++++++++++----------------------- drivers/xen/unpopulated-alloc.c | 33 ------------------------- 2 files changed, 23 insertions(+), 64 deletions(-) commit 836ffc47fa245e58cae51ac40c5ef71be8f4d480 Author: Lv Ruyi Date: Thu Apr 7 09:01:22 2022 +0000 video: fbdev: imxfb: Fix missing of_node_put in imxfb_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 Signed-off-by: Helge Deller drivers/video/fbdev/imxfb.c | 2 ++ 1 file changed, 2 insertions(+) commit c7cb4717f641db68e8117635bfcf62a9c27dc8d3 Author: Mauro Carvalho Chehab Date: Thu Apr 7 20:49:59 2022 +0200 ASoC: Intel: sof_es8336: Add a quirk for Huawei Matebook D15 Based on experimental tests, Huawei Matebook D15 actually uses both gpio0 and gpio1: the first one controls the speaker, while the other one controls the headphone. Also, the headset is mapped as MIC1, instead of MIC2. So, add a quirk for it. Signed-off-by: Mauro Carvalho Chehab Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/d678aef9fc9a07aced611aa7cb8c9b800c649e5a.1649357263.git.mchehab@kernel.org Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 7c7bb2a059b226ebadb14ce07460f6357023d56c Author: Mauro Carvalho Chehab Date: Thu Apr 7 20:49:58 2022 +0200 ASoC: Intel: sof_es8336: add a quirk for headset at mic1 port The headset/internal mic can either be routed as mic1/mic2 or vice-versa. By default, the driver assumes that the headset is mapped as mic2, but not all devices map this way. So, add a quirk to support changing it to mic1, using mic2 for the internal analog mic (if any). Signed-off-by: Mauro Carvalho Chehab Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/5d88fc29b79be7ab77dae391c8e5ee929fd36c27.1649357263.git.mchehab@kernel.org Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) commit 6e1ff1459e0086312e61c2d1ff8b74395a082fcb Author: Mauro Carvalho Chehab Date: Thu Apr 7 20:49:57 2022 +0200 ASoC: Intel: sof_es8336: support a separate gpio to control headphone Some devices may use both gpio0 and gpio1 to independently switch the speaker and the headphone. Add support for that. Acked-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/535454c0c598a8454487fe29b164527370e2db81.1649357263.git.mchehab@kernel.org Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 59 ++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 10 deletions(-) commit 890a4087a6c2045911b5002566d1528f710cd723 Author: Pierre-Louis Bossart Date: Thu Apr 7 20:49:56 2022 +0200 ASoC: Intel: sof_es8336: simplify speaker gpio naming In preparation for the support of an additional gpio for headphone control, rename GPIOs to make explicit references to speakers and gpio0 or gpio1. No functionality change. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mauro Carvalho Chehab Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/3008c576ca45d5cc99ad4a18d1d30de45a0aff80.1649357263.git.mchehab@kernel.org Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) commit 92ccbf17eeacf510cf1eed9c252d9332ca24f02d Author: Zheyu Ma Date: Tue Apr 5 20:10:38 2022 +0800 ASoC: wm8731: Disable the regulator when probing fails When the driver fails during probing, the driver should disable the regulator, not just handle it in wm8731_hw_init(). The following log reveals it: [ 17.812483] WARNING: CPU: 1 PID: 364 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0 [ 17.815958] RIP: 0010:_regulator_put+0x3ec/0x4e0 [ 17.824467] Call Trace: [ 17.824774] [ 17.825040] regulator_bulk_free+0x82/0xe0 [ 17.825514] devres_release_group+0x319/0x3d0 [ 17.825882] i2c_device_probe+0x766/0x940 [ 17.829198] i2c_register_driver+0xb5/0x130 Signed-off-by: Zheyu Ma Link: https://lore.kernel.org/r/20220405121038.4094051-1-zheyuma97@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/wm8731.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) commit 97326be14df7bacc6ba5c62c0556298c27ea0432 Author: Chao Song Date: Wed Apr 6 14:23:41 2022 -0500 ASoC: Intel: soc-acpi: correct device endpoints for max98373 The left speaker of max98373 uses spk_r_endpoint, and right speaker uses spk_l_endpoint, this is obviously wrong. This patch corrects the endpoints for max98373 codec. Signed-off-by: Chao Song Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220406192341.271465-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/common/soc-acpi-intel-tgl-match.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit db6dd1bee63d1d88fbddfe07af800af5948ac28e Author: Srinivas Kandagatla Date: Thu Apr 7 10:43:13 2022 +0100 ASoC: codecs: wcd934x: do not switch off SIDO Buck when codec is in use SIDO(Single-Inductor Dual-Ouput) Buck powers up both analog and digital circuits along with internal memory, powering off this is the last thing that codec should do when going to very low power. Current code was powering off this Buck if there are no users of sysclk, which is not correct. Powering off this buck will result in no register access. This code path was never tested until recently after adding pm support in SoundWire controller. Fix this by removing the buck poweroff when the codec is active and also the code that is not used. Without this patch all the read/write transactions will never complete and results in SLIMBus Errors like: qcom,slim-ngd qcom,slim-ngd.1: Tx:MT:0x0, MC:0x60, LA:0xcf failed:-110 wcd934x-codec wcd934x-codec.1.auto: ASoC: error at soc_component_read_no_lock on wcd934x-codec.1.auto for register: [0x00000d05] -110 qcom,slim-ngd-ctrl 171c0000.slim: Error Interrupt received 0x82000000 Reported-by: Amit Pundir Fixes: a61f3b4f476e ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec") Signed-off-by: Srinivas Kandagatla Tested-by: Amit Pundir Link: https://lore.kernel.org/r/20220407094313.2880-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown sound/soc/codecs/wcd934x.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) commit 9b91d0ece22b9ab37fc185511c7f992e51c93d6e Author: Yu Liao Date: Fri Mar 18 10:16:16 2022 +0800 ASoC: SOF: topology: Fix memory leak in sof_control_load() scontrol doesn't get freed when kstrdup returns NULL. Fix by free iscontrol in that case. scontrol = kzalloc(sizeof(*scontrol), GFP_KERNEL); if (!scontrol) return -ENOMEM; scontrol->name = kstrdup(hdr->name, GFP_KERNEL); if (!scontrol->name) return -ENOMEM; Signed-off-by: Yu Liao Link: https://lore.kernel.org/r/20220318021616.2599630-1-liaoyu15@huawei.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 20744617bdbafe2e7fb7bf5401f616e24bde4471 Author: Pierre-Louis Bossart Date: Wed Apr 6 14:16:06 2022 -0500 ASoC: SOF: topology: cleanup dailinks on widget unload We set the cpu_dai capture_ or playback_widget on widget_ready but never clear them, which leads to failures when unloading/reloading a topology in modprobe/rmmod tests BugLink: https://github.com/thesofproject/linux/issues/3535 Fixes: 311ce4fe7637 ("ASoC: SOF: Add support for loading topologies") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220406191606.254576-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) commit 770f3d992a3f7330f801dfeee98429b2885c9fdb Author: Pierre-Louis Bossart Date: Wed Apr 6 14:20:05 2022 -0500 ASoC: rt711/5682: check if bus is active before deferred jack detection This patch takes a defensive programming and paranoid approach in case the parent device (SoundWire) is pm_runtime resumed but the rt711 device is not. In that case, during the attachment and initialization, a jack detection workqueue can be scheduled. Since the pm_runtime suspend routines will not be invoked, the sequence to cancel all deferred work is not executed, and the jack detection could happen after the bus stops operating, leading to a timeout. This patch applies the same solution to rt5682, based on the similarities between codec drivers. The race condition with rt5682 was not detected experimentally though. BugLink: https://github.com/thesofproject/linux/issues/3459 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220406192005.262996-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/codecs/rt5682.c | 9 +++++++++ sound/soc/codecs/rt711.c | 7 +++++++ 2 files changed, 16 insertions(+) commit 4cdd158be9d09223737df83136a1fb65269d809a Author: Pavel Begunkov Date: Thu Apr 7 14:05:05 2022 +0100 io_uring: use nospec annotation for more indexes There are still several places that using pre array_index_nospec() indexes, fix them up. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/b01ef5ee83f72ed35ad525912370b729f5d145f4.1649336342.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit 8f0a24801bb44aa58496945aabb904c729176772 Author: Pavel Begunkov Date: Thu Apr 7 14:05:04 2022 +0100 io_uring: zero tag on rsrc removal Automatically default rsrc tag in io_queue_rsrc_removal(), it's safer than leaving it there and relying on the rest of the code to behave and not use it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/1cf262a50df17478ea25b22494dcc19f3a80301f.1649336342.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit a07211e3001435fe8591b992464cd8d5e3c98c5a Author: Pavel Begunkov Date: Wed Apr 6 12:43:58 2022 +0100 io_uring: don't touch scm_fp_list after queueing skb It's safer to not touch scm_fp_list after we queued an skb to which it was assigned, there might be races lurking if we screw subtle sync guarantees on the io_uring side. Fixes: 6b06314c47e14 ("io_uring: add file set registration") Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe fs/io_uring.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 34bb77184123ae401100a4d156584f12fa630e5c Author: Pavel Begunkov Date: Wed Apr 6 12:43:57 2022 +0100 io_uring: nospec index for tags on files update Don't forget to array_index_nospec() for indexes before updating rsrc tags in __io_sqe_files_update(), just use already safe and precalculated index @i. Fixes: c3bdad0271834 ("io_uring: add generic rsrc update with tags") Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0f5e4b83b37a96e3643951588ed7176b9b187c0a Author: Eugene Syromiatnikov Date: Wed Apr 6 13:55:33 2022 +0200 io_uring: implement compat handling for IORING_REGISTER_IOWQ_AFF Similarly to the way it is done im mbind syscall. Cc: stable@vger.kernel.org # 5.14 Fixes: fe76421d1da1dcdb ("io_uring: allow user configurable IO thread CPU affinity") Signed-off-by: Eugene Syromiatnikov Signed-off-by: Jens Axboe fs/io_uring.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit cb318216732579da80202fe3e622a504e55b3a0f Author: Jens Axboe Date: Tue Apr 5 10:31:43 2022 -0600 Revert "io_uring: Add support for napi_busy_poll" This reverts commit adc8682ec69012b68d5ab7123e246d2ad9a6f94b. There's some discussion on the API not being as good as it can be. Rather than ship something and be stuck with it forever, let's revert the NAPI support for now and work on getting something sorted out for the next kernel release instead. Link: https://lore.kernel.org/io-uring/b7bbc124-8502-0ee9-d4c8-7c41b4487264@kernel.dk/ Signed-off-by: Jens Axboe fs/io_uring.c | 232 +--------------------------------------------------------- 1 file changed, 1 insertion(+), 231 deletions(-) commit d5361233e9ab920e135819f73dd8466355f1fddd Author: Jens Axboe Date: Thu Mar 31 12:38:46 2022 -0600 io_uring: drop the old style inflight file tracking io_uring tracks requests that are referencing an io_uring descriptor to be able to cancel without worrying about loops in the references. Since we now assign the file at execution time, the easier approach is to drop a potentially problematic reference before we punt the request. This eliminates the need to special case these types of files beyond just marking them as such, and simplifies cancelation quite a bit. This also fixes a recent issue where an async punted tee operation would with the io_uring descriptor as the output file would crash when attempting to get a reference to the file from the io-wq worker. We could have worked around that, but this is the much cleaner fix. Fixes: 6bf9c47a3989 ("io_uring: defer file assignment") Reported-by: syzbot+c4b9303500a21750b250@syzkaller.appspotmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 85 +++++++++++++++++++---------------------------------------- 1 file changed, 27 insertions(+), 58 deletions(-) commit 6bf9c47a398911e0ab920e362115153596c80432 Author: Jens Axboe Date: Tue Mar 29 10:10:08 2022 -0600 io_uring: defer file assignment If an application uses direct open or accept, it knows in advance what direct descriptor value it will get as it picks it itself. This allows combined requests such as: sqe = io_uring_get_sqe(ring); io_uring_prep_openat_direct(sqe, ..., file_slot); sqe->flags |= IOSQE_IO_LINK | IOSQE_CQE_SKIP_SUCCESS; sqe = io_uring_get_sqe(ring); io_uring_prep_read(sqe,file_slot, buf, buf_size, 0); sqe->flags |= IOSQE_FIXED_FILE; io_uring_submit(ring); where we prepare both a file open and read, and only get a completion event for the read when both have completed successfully. Currently links are fully prepared before the head is issued, but that fails if the dependent link needs a file assigned that isn't valid until the head has completed. Conversely, if the same chain is performed but the fixed file slot is already valid, then we would be unexpectedly returning data from the old file slot rather than the newly opened one. Make sure we're consistent here. Allow deferral of file setup, which makes this documented case work. Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Jens Axboe fs/io-wq.h | 1 + fs/io_uring.c | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 10 deletions(-) commit 5106dd6e74ab6c94daac1c357094f11e6934b36f Author: Jens Axboe Date: Mon Apr 4 17:18:43 2022 -0600 io_uring: propagate issue_flags state down to file assignment We'll need this in a future patch, when we could be assigning the file after the prep stage. While at it, get rid of the io_file_get() helper, it just makes the code harder to read. Signed-off-by: Jens Axboe fs/io_uring.c | 82 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 35 deletions(-) commit 42e7a03d3badebd4e70aea5362d6914dfc7c220b Merge: 3638bd90df99 eaa03d345358 Author: Linus Torvalds Date: Thu Apr 7 06:35:34 2022 -1000 Merge tag 'hyperv-fixes-signed-20220407' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - Correctly propagate coherence information for VMbus devices (Michael Kelley) - Disable balloon and memory hot-add on ARM64 temporarily (Boqun Feng) - Use barrier to prevent reording when reading ring buffer (Michael Kelley) - Use virt_store_mb in favour of smp_store_mb (Andrea Parri) - Fix VMbus device object initialization (Andrea Parri) - Deactivate sysctl_record_panic_msg on isolated guest (Andrea Parri) - Fix a crash when unloading VMbus module (Guilherme G. Piccoli) * tag 'hyperv-fixes-signed-20220407' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: Drivers: hv: vmbus: Replace smp_store_mb() with virt_store_mb() Drivers: hv: balloon: Disable balloon and hot-add accordingly Drivers: hv: balloon: Support status report for larger page sizes Drivers: hv: vmbus: Prevent load re-ordering when reading ring buffer PCI: hv: Propagate coherence from VMbus device to PCI device Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device Drivers: hv: vmbus: Fix potential crash on module unload Drivers: hv: vmbus: Fix initialization of device object in vmbus_device_register() Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests commit 3638bd90df9930511fa85f9a811d02feee4e0b97 Merge: 640b5037da8e e3c1c4fd9e6d Author: Linus Torvalds Date: Thu Apr 7 06:02:55 2022 -1000 Merge tag 'random-5.18-rc2-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator fixes from Jason Donenfeld: - Another fixup to the fast_init/crng_init split, this time in how much entropy is being credited, from Jan Varho. - As discussed, we now opportunistically call try_to_generate_entropy() in /dev/urandom reads, as a replacement for the reverted commit. I opted to not do the more invasive wait_for_random_bytes() change at least for now, preferring to do something smaller and more obvious for the time being, but maybe that can be revisited as things evolve later. - Userspace can use FUSE or userfaultfd or simply move a process to idle priority in order to make a read from the random device never complete, which breaks forward secrecy, fixed by overwriting sensitive bytes early on in the function. - Jann Horn noticed that /dev/urandom reads were only checking for pending signals if need_resched() was true, a bug going back to the genesis commit, now fixed by always checking for signal_pending() and calling cond_resched(). This explains various noticeable signal delivery delays I've seen in programs over the years that do long reads from /dev/urandom. - In order to be more like other devices (e.g. /dev/zero) and to mitigate the impact of fixing the above bug, which has been around forever (users have never really needed to check the return value of read() for medium-sized reads and so perhaps many didn't), we now move signal checking to the bottom part of the loop, and do so every PAGE_SIZE-bytes. * tag 'random-5.18-rc2-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: check for signals every PAGE_SIZE chunk of /dev/[u]random random: check for signal_pending() outside of need_resched() check random: do not allow user to keep crng key around on stack random: opportunistically initialize on /dev/urandom reads random: do not split fast init input in add_hwgenerator_randomness() commit 640b5037da8edfaa98d102183ccfe3af5898f94b Merge: 3e732ebf7316 55b014159ee7 Author: Linus Torvalds Date: Thu Apr 7 05:56:54 2022 -1000 Merge tag 'ata-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fixes from Damien Le Moal: - Fix a compilation warning due to an uninitialized variable in ata_sff_lost_interrupt(), from me. - Fix invalid internal command tag handling in the sata_dwc_460ex driver, from Christian. - Disable READ LOG DMA EXT with Samsung 840 EVO SSDs as this command causes the drives to hang, from Christian. - Change the config option CONFIG_SATA_LPM_POLICY back to its original name CONFIG_SATA_LPM_MOBILE_POLICY to avoid potential problems with users losing their configuration (as discussed during the merge window), from Mario. * tag 'ata-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: ahci: Rename CONFIG_SATA_LPM_POLICY configuration item back ata: libata-core: Disable READ LOG DMA EXT for Samsung 840 EVOs ata: sata_dwc_460ex: Fix crash due to OOB write ata: libata-sff: Fix compilation warning in ata_sff_lost_interrupt() commit 4d5004451ab2218eab94a30e1841462c9316ba19 Author: Chuck Lever Date: Wed Apr 6 13:51:32 2022 -0400 SUNRPC: Fix the svc_deferred_event trace class Fix a NULL deref crash that occurs when an svc_rqst is deferred while the sunrpc tracing subsystem is enabled. svc_revisit() sets dr->xprt to NULL, so it can't be relied upon in the tracepoint to provide the remote's address. Unfortunately we can't revert the "svc_deferred_class" hunk in commit ece200ddd54b ("sunrpc: Save remote presentation address in svc_xprt for trace events") because there is now a specific check of event format specifiers for unsafe dereferences. The warning that check emits is: event svc_defer_recv has unsafe dereference of argument 1 A "%pISpc" format specifier with a "struct sockaddr *" is indeed flagged by this check. Instead, take the brute-force approach used by the svcrdma_qp_error tracepoint. Convert the dr::addr field into a presentation address in the TP_fast_assign() arm of the trace event, and store that as a string. This fix can be backported to -stable kernels. In the meantime, commit c6ced22997ad ("tracing: Update print fmt check to handle new __get_sockaddr() macro") is now in v5.18, so this wonky fix can be replaced with __sockaddr() and friends properly during the v5.19 merge window. Fixes: ece200ddd54b ("sunrpc: Save remote presentation address in svc_xprt for trace events") Signed-off-by: Chuck Lever include/trace/events/sunrpc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 98ea02597b9967c0817d29fee2f96d21b9e59ca5 Author: zhenwei pi Date: Thu Apr 7 14:40:08 2022 +0800 mm/rmap: Fix handling of hugetlbfs pages in page_vma_mapped_walk page_mapped_in_vma() sets nr_pages to 1, which is usually correct as we only want to know about the precise page and not about other pages in the folio. However, hugetlbfs does want to know about the entire hpage, and using nr_pages to get the size of the hpage is wrong. We could change page_mapped_in_vma() to special-case hugetlbfs pages, but it's better to ignore nr_pages in page_vma_mapped_walk() and get the size from the VMA instead. Fixes: 2aff7a4755bed ("mm: Convert page_vma_mapped_walk to work on PFNs") Signed-off-by: zhenwei pi Reviewed-by: Muchun Song Signed-off-by: Matthew Wilcox (Oracle) [edit commit message, use hstate directly] mm/page_vma_mapped.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit ec4858e07ed62eceb60bac2ded3c0d6e2471c66b Author: Matthew Wilcox (Oracle) Date: Mon Apr 4 15:23:39 2022 -0400 mm/mempolicy: Use vma_alloc_folio() in new_page() Simplify new_page() by unifying the THP and base page cases, and handle orders other than 0 and HPAGE_PMD_ORDER correctly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zi Yan Reviewed-by: William Kucharski mm/mempolicy.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) commit f584b68005ac782097d63a691740cb0dfed072ed Author: Matthew Wilcox (Oracle) Date: Mon Apr 4 15:11:04 2022 -0400 mm: Add vma_alloc_folio() This wrapper around alloc_pages_vma() calls prep_transhuge_page(), removing the obligation from the caller. This is in the same spirit as __folio_alloc(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zi Yan Reviewed-by: William Kucharski include/linux/gfp.h | 8 ++++++-- mm/mempolicy.c | 13 +++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) commit c185e494ae0ceb126d89b8e3413ed0a1132e05d3 Author: Matthew Wilcox (Oracle) Date: Tue Jul 6 10:50:39 2021 -0400 mm/migrate: Use a folio in migrate_misplaced_transhuge_page() Unify alloc_misplaced_dst_page() and alloc_misplaced_dst_page_thp(). Removes an assumption that compound pages are HPAGE_PMD_ORDER. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zi Yan Reviewed-by: William Kucharski mm/migrate.c | 58 ++++++++++++++++------------------------------------------ 1 file changed, 16 insertions(+), 42 deletions(-) commit ffe06786b54039edcecb51a54061ee8d81036a19 Author: Matthew Wilcox (Oracle) Date: Mon Apr 4 14:35:04 2022 -0400 mm/migrate: Use a folio in alloc_migration_target() This removes an assumption that a large folio is HPAGE_PMD_ORDER as well as letting us remove the call to prep_transhuge_page() and a few hidden calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zi Yan Reviewed-by: William Kucharski mm/migrate.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) commit 83a8441f8d8e2e47e9bf2aead3aca625ab95d5ad Author: Matthew Wilcox (Oracle) Date: Wed Apr 6 08:41:39 2022 -0400 mm/huge_memory: Avoid calling pmd_page() on a non-leaf PMD Calling try_to_unmap() with TTU_SPLIT_HUGE_PMD and a folio that's not mapped by a PMD causes oopses on arm64 because we now call page_folio() on an invalid page. pmd_page() returns a valid page for non-leaf PMDs on some architectures, so this bug escaped testing before now. Fix this bug by delaying the call to pmd_page() until after we know the PMD is a leaf. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215804 Fixes: af28a988b313 ("mm/huge_memory: Convert __split_huge_pmd() to take a folio") Reported-by: Zorro Lang Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Zorro Lang mm/huge_memory.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit 59b18a1e65b7a2134814106d0860010e10babe18 Author: Reto Buerki Date: Thu Apr 7 13:06:47 2022 +0200 x86/msi: Fix msi message data shadow struct The x86 MSI message data is 32 bits in total and is either in compatibility or remappable format, see Intel Virtualization Technology for Directed I/O, section 5.1.2. Fixes: 6285aa50736 ("x86/msi: Provide msi message shadow structs") Co-developed-by: Adrian-Ken Rueegsegger Signed-off-by: Adrian-Ken Rueegsegger Signed-off-by: Reto Buerki Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220407110647.67372-1-reet@codelabs.ch arch/x86/include/asm/msi.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) commit 475acef9ed480818aab223addfff1636af0d1915 Merge: bc2fb47db586 03cb66463b55 Author: Arnd Bergmann Date: Thu Apr 7 14:38:59 2022 +0200 Merge tag 'reset-fixes-for-v5.18' of git://git.pengutronix.de/pza/linux into arm/fixes Reset controller fixes for v5.18 Document the deprecated 'hisi,rst-syscon' device tree property for hisilicon,hi3660-reset, add an error check to reset deassertion in reset-rzg2l-usbphy-ctrl, restore transfer error handling in Tegra reset-bpmp, and document the optional 'resets' device tree property for socionext,uniphier-reset. * tag 'reset-fixes-for-v5.18' of git://git.pengutronix.de/pza/linux: dt-bindings: reset: Add parent "resets" property as optional reset: tegra-bpmp: Restore Handle errors in BPMP response reset: renesas: Check return value of reset_control_deassert() dt-bindings: reset: document deprecated HiSilicon property Link: https://lore.kernel.org/r/20220406153337.1265414-1-p.zabel@pengutronix.de Signed-off-by: Arnd Bergmann commit bc2fb47db586dc807be96a6d79045616771b53d4 Author: Rob Herring Date: Wed Apr 6 14:16:07 2022 -0500 arm/arm64: dts: qcom: Fix boolean properties with values Boolean properties in DT are present or not present and don't take a value. A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't matter. It may have been intended that 0 values are false, but there is no change in behavior with this patch. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/Yk3m92Sj26/v1mLG@robh.at.kernel.org' Signed-off-by: Arnd Bergmann arch/arm/boot/dts/qcom-apq8064-pins.dtsi | 12 ++++++------ arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 ++-- arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom.dtsi | 2 +- arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) commit 1bc12d301594eafde0a8529d28d459af81053b3a Author: Rob Herring Date: Wed Apr 6 14:14:41 2022 -0500 arm64: dts: imx: Fix imx8*-var-som touchscreen property sizes The common touchscreen properties are all 32-bit, not 16-bit. These properties must not be too important as they are all ignored in case of an error reading them. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/Yk3moe6Hz8ELM0iS@robh.at.kernel.org' Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/freescale/imx8mm-var-som.dtsi | 8 ++++---- arch/arm64/boot/dts/freescale/imx8mn-var-som.dtsi | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) commit 3b881035e959cf39f046484e340e48a3e46a99db Author: Rob Herring Date: Wed Apr 6 14:13:11 2022 -0500 arm: dts: imx: Fix boolean properties with values Boolean properties in DT are present or not present and don't take a value. A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't matter. It may have been intended that 0 values are false, but there is no change in behavior with this patch. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/Yk3mR5yae3gCkKhp@robh.at.kernel.org' Signed-off-by: Arnd Bergmann arch/arm/boot/dts/imx6qdl-aristainetos2.dtsi | 32 +++++++++++----------- .../boot/dts/imx6ul-phytec-segin-peb-av-02.dtsi | 4 +-- 2 files changed, 18 insertions(+), 18 deletions(-) commit 1a67653de0ddc67d274ce2762265ae18d58cc09a Author: Rob Herring Date: Wed Apr 6 14:17:30 2022 -0500 arm64: dts: tegra: Fix boolean properties with values Boolean properties in DT are present or not present and don't take a value. A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't matter. It may have been intended that 0 values are false, but there is no change in behavior with this patch. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/Yk3nShkFzNJaI3/Z@robh.at.kernel.org' Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi | 8 ++++---- arch/arm64/boot/dts/nvidia/tegra186-p3509-0000+p3636-0001.dts | 8 ++++---- arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 6 +++--- arch/arm64/boot/dts/nvidia/tegra194-p3668.dtsi | 6 +++--- arch/arm64/boot/dts/nvidia/tegra210-p2180.dtsi | 6 +++--- arch/arm64/boot/dts/nvidia/tegra210-p2894.dtsi | 8 ++++---- arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 8 ++++---- arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) commit 0dc23d1a8e17839f1c071302b5f3e04a34692d44 Author: Rob Herring Date: Wed Apr 6 14:09:47 2022 -0500 arm: dts: at91: Fix boolean properties with values Boolean properties in DT are present or not present and don't take a value. A property such as 'foo = <0>;' evaluated to true. IOW, the value doesn't matter. It may have been intended that 0 values are false, but there is no change in behavior with this patch. Signed-off-by: Rob Herring Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/Yk3leykDEKGBN8rk@robh.at.kernel.org' Signed-off-by: Arnd Bergmann arch/arm/boot/dts/at91-kizbox3-hs.dts | 2 +- arch/arm/boot/dts/at91-kizbox3_common.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 1f5fb1dc7497776a7dd12420ae87382e61718bf5 Author: Jonathan Cameron Date: Tue Apr 5 14:52:52 2022 +0100 arm: configs: imote2: Drop defconfig as board support dropped. Missed the defconfig when removing the board files causing failures in builds using this defconfig. Fixes: 28f74201e37c ("ARM: pxa: remove Intel Imote2 and Stargate 2 boards") Reported-by: Sudip Mukherjee Signed-off-by: Jonathan Cameron Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220405135252.10283-1-Jonathan.Cameron@huawei.com' Signed-off-by: Arnd Bergmann arch/arm/configs/imote2_defconfig | 365 -------------------------------------- 1 file changed, 365 deletions(-) commit 44e4a2c75676eda875bf5da20709bfae62af9a99 Merge: 02481c7b849d dd8adc713b16 Author: Arnd Bergmann Date: Thu Apr 7 13:58:17 2022 +0200 Merge tag 'memory-controller-drv-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/fixes Memory controller drivers - fixes for v5.18 Issues in v5.18: 1. Freescale/NXP: fix populating children of Integrated Flash Controller DT nodes. Issues existing before: 1. Renesas: fix platform-device leak in probe's error path. 2. Atmel: fix of_node reference leak in probe's error path. 3. Synopsys: correct the bindings for snps,ddrc-3.80a (interrupts are required). * tag 'memory-controller-drv-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: fsl_ifc: populate child nodes of buses and mfd devices dt-bindings: memory: snps,ddrc-3.80a compatible also need interrupts memory: atmel-ebi: Fix missing of_node_put in atmel_ebi_probe memory: renesas-rpc-if: fix platform-device leak in error path Link: https://lore.kernel.org/r/20220407081448.113208-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit 02481c7b849d893dcceaa60fe113f3f080fcee62 Merge: bc22bb224b3c 1a9f338f9cf9 Author: Arnd Bergmann Date: Thu Apr 7 13:57:59 2022 +0200 Merge tag 'samsung-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/fixes Samsung fixes for v5.18 Update Krzysztof Kozlowski's email address in multiple maintainer entries. The old one @canonical.com bounces already. * tag 'samsung-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: MAINTAINERS: update Krzysztof Kozlowski's email to Linaro dt-bindings: update Krzysztof Kozlowski's email Link: https://lore.kernel.org/r/20220407080545.112290-1-krzysztof.kozlowski@linaro.org Signed-off-by: Arnd Bergmann commit bc22bb224b3c1cbea868c3efa5466014b6a29d59 Merge: f455742ae2ca 42a997f0bde1 Author: Arnd Bergmann Date: Thu Apr 7 13:57:30 2022 +0200 Merge tag 'vexpress-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes ARM Vexpress fixes for 5.18 Couple of fixes to address negative array index access and kernel-doc build warnings. * tag 'vexpress-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: ARM: vexpress/spc: Fix all the kernel-doc build warnings ARM: vexpress/spc: Fix kernel-doc build warning for ve_spc_cpu_in_wfi ARM: vexpress/spc: Avoid negative array index when !SMP Link: https://lore.kernel.org/r/20220407110828.1436206-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit f455742ae2caf270a4b874f7f1dd86e56c5eeb95 Merge: caee01050bd4 bf36619a5463 Author: Arnd Bergmann Date: Thu Apr 7 13:57:15 2022 +0200 Merge tag 'scmi-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm SCMI firmware interface fixes for v5.18 Few fixes to address assorted set of issues: - Erroneous clearing of Tx channel which only platform firmware must do - Invalid point access pass as parameter to sort() in clock support - Sparse build warnings in OPTEE transport driver - Use of deprecated zero-length arrays * tag 'scmi-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Fix sparse warnings in OPTEE transport driver firmware: arm_scmi: Replace zero-length array with flexible-array member firmware: arm_scmi: Fix sorting of retrieved clock rates firmware: arm_scmi: Remove clear channel call on the TX channel Link: https://lore.kernel.org/r/20220407110818.1436181-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit caee01050bd483f1b6f6abc686a3516e48e2ad9e Author: Alexander Sverdlin Date: Thu Jan 20 14:37:39 2022 +0100 ep93xx: clock: Don't use plain integer as NULL pointer Fix sparse warning: arch/arm/mach-ep93xx/clock.c:210:35: sparse: sparse: Using plain integer as NULL pointer Reported-by: kernel test robot Signed-off-by: Alexander Sverdlin Link: https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/TLFJ6D7WGMDJSQ6XK7UZE4XR2PLRZJSV/ Signed-off-by: Arnd Bergmann arch/arm/mach-ep93xx/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3b68b08885217abd9c57ff9b3bb3eb173eee02a9 Author: Alexander Sverdlin Date: Sun Jan 30 16:25:02 2022 +0100 ep93xx: clock: Fix UAF in ep93xx_clk_register_gate() arch/arm/mach-ep93xx/clock.c:154:2: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc] arch/arm/mach-ep93xx/clock.c:151:2: note: Taking true branch if (IS_ERR(clk)) ^ arch/arm/mach-ep93xx/clock.c:152:3: note: Memory is released kfree(psc); ^~~~~~~~~~ arch/arm/mach-ep93xx/clock.c:154:2: note: Use of memory after it is freed return &psc->hw; ^ ~~~~~~~~ Fixes: 9645ccc7bd7a ("ep93xx: clock: convert in-place to COMMON_CLK") Reported-by: kernel test robot Signed-off-by: Alexander Sverdlin Cc: stable@vger.kernel.org Link: https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/B5YCO2NJEXINCYE26Y255LCVMO55BGWW/ Signed-off-by: Arnd Bergmann arch/arm/mach-ep93xx/clock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 03e59b1e2f56245163b14c69e0a830c24b1a3a47 Author: Wolfram Sang Date: Mon Apr 4 13:49:02 2022 +0200 mmc: renesas_sdhi: don't overwrite TAP settings when HS400 tuning is complete When HS400 tuning is complete and HS400 is going to be activated, we have to keep the current number of TAPs and should not overwrite them with a hardcoded value. This was probably a copy&paste mistake when upporting HS400 support from the BSP. Fixes: 26eb2607fa28 ("mmc: renesas_sdhi: add eMMC HS400 mode support") Reported-by: Yoshihiro Shimoda Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220404114902.12175-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson drivers/mmc/host/renesas_sdhi_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 711136bb6620b4e84498aa87d4a2ceb7b70c8176 Author: Heiko Carstens Date: Wed Apr 6 14:06:27 2022 +0200 s390/kexec: silence -Warray-bounds warning Just use absolute_pointer() like e.g. in commit 545c272232ca ("alpha: Silence -Warray-bounds warnings") to get rid of this warning: arch/s390/kernel/machine_kexec.c:59:9: warning: ‘memcpy’ offset [0, 511] is out of the bounds [0, 0] [-Warray-bounds] Signed-off-by: Heiko Carstens arch/s390/kernel/machine_kexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 42a997f0bde1da0cce14a4768bb190b5030513eb Author: Sudeep Holla Date: Mon Apr 4 14:02:07 2022 +0100 ARM: vexpress/spc: Fix all the kernel-doc build warnings There are more kernel-doc build warnings as below than the ones reported by kernel test robot recently for this file. | arch/arm/mach-vexpress/spc.c:125: warning: missing initial short description on line: | * ve_spc_global_wakeup_irq() | arch/arm/mach-vexpress/spc.c:131: warning: contents before sections | arch/arm/mach-vexpress/spc.c:148: warning: missing initial short description on line: | * ve_spc_cpu_wakeup_irq() | arch/arm/mach-vexpress/spc.c:154: warning: contents before sections | arch/arm/mach-vexpress/spc.c:203: warning: missing initial short description on line: | * ve_spc_powerdown() | arch/arm/mach-vexpress/spc.c:209: warning: contents before sections | arch/arm/mach-vexpress/spc.c:231: warning: missing initial short description on line: | * ve_spc_cpu_in_wfi() | 7 warnings Fix all these warnings. Link: https://lore.kernel.org/r/20220404130207.1162445-2-sudeep.holla@arm.com Cc: Liviu Dudau Cc: Lorenzo Pieralisi Signed-off-by: Sudeep Holla arch/arm/mach-vexpress/spc.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) commit 5063b7a80eba25960464d2a366b66544810d9694 Author: Sudeep Holla Date: Mon Apr 4 14:02:06 2022 +0100 ARM: vexpress/spc: Fix kernel-doc build warning for ve_spc_cpu_in_wfi Kbuild bot reported the following kernel-doc build warning: | arch/arm/mach-versatile/spc.c:231: warning: This comment starts with | '/**', but isn't a kernel-doc comment. | Refer Documentation/doc-guide/kernel-doc.rst | * ve_spc_cpu_in_wfi(u32 cpu, u32 cluster) Fix the issue by dropping the parameters specified in the kernel doc. Link: https://lore.kernel.org/linux-doc/202204031026.4ogKxt89-lkp@intel.com Link: https://lore.kernel.org/r/20220404130207.1162445-1-sudeep.holla@arm.com Cc: Liviu Dudau Cc: Lorenzo Pieralisi Reported-by: kernel test robot Signed-off-by: Sudeep Holla arch/arm/mach-vexpress/spc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 334865b2915c33080624e0d06f1c3e917036472c Author: Nick Desaulniers Date: Tue Mar 29 13:21:45 2022 -0700 x86/extable: Prefer local labels in .set directives Bernardo reported an error that Nathan bisected down to (x86_64) defconfig+LTO_CLANG_FULL+X86_PMEM_LEGACY. LTO vmlinux.o ld.lld: error: :1:13: redefinition of 'found' .set found, 0 ^ :29:1: while in macro instantiation extable_type_reg reg=%eax, type=(17 | ((0) << 16)) ^ This appears to be another LTO specific issue similar to what was folded into commit 4b5305decc84 ("x86/extable: Extend extable functionality"), where the `.set found, 0` in DEFINE_EXTABLE_TYPE_REG in arch/x86/include/asm/asm.h conflicts with the symbol for the static function `found` in arch/x86/kernel/pmem.c. Assembler .set directive declare symbols with global visibility, so the assembler may not rename such symbols in the event of a conflict. LTO could rename static functions if there was a conflict in C sources, but it cannot see into symbols defined in inline asm. The symbols are also retained in the symbol table, regardless of LTO. Give the symbols .L prefixes making them locally visible, so that they may be renamed for LTO to avoid conflicts, and to drop them from the symbol table regardless of LTO. Fixes: 4b5305decc84 ("x86/extable: Extend extable functionality") Reported-by: Bernardo Meurer Costa Debugged-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220329202148.2379697-1-ndesaulniers@google.com arch/x86/include/asm/asm.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit be8a096521ca1a252bf078b347f96ce94582612e Author: Peter Zijlstra Date: Mon Mar 28 13:13:41 2022 +0200 x86,bpf: Avoid IBT objtool warning Clang can inline emit_indirect_jump() and then folds constants, which results in: | vmlinux.o: warning: objtool: emit_bpf_dispatcher()+0x6a4: relocation to !ENDBR: .text.__x86.indirect_thunk+0x40 | vmlinux.o: warning: objtool: emit_bpf_dispatcher()+0x67d: relocation to !ENDBR: .text.__x86.indirect_thunk+0x40 | vmlinux.o: warning: objtool: emit_bpf_tail_call_indirect()+0x386: relocation to !ENDBR: .text.__x86.indirect_thunk+0x20 | vmlinux.o: warning: objtool: emit_bpf_tail_call_indirect()+0x35d: relocation to !ENDBR: .text.__x86.indirect_thunk+0x20 Suppress the optimization such that it must emit a code reference to the __x86_indirect_thunk_array[] base. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Alexei Starovoitov Link: https://lkml.kernel.org/r/20220405075531.GB30877@worktop.programming.kicks-ass.net arch/x86/net/bpf_jit_comp.c | 1 + 1 file changed, 1 insertion(+) commit d52eee988597ac2a2c5d17d842946616d7d41070 Author: Pierre-Louis Bossart Date: Wed Apr 6 14:04:18 2022 -0500 ALSA: hda: intel-dsp-config: update AlderLake PCI IDs Add missing AlderLake-PS and RaptorLake-S PCI IDs (already in HDaudio and SOF drivers), add comments and regroup by skew. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220406190418.245044-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai sound/hda/intel-dsp-config.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) commit 9dd7c46346ca4390f84a7ea9933005eb1b175c15 Author: Randy Dunlap Date: Tue Apr 5 16:41:18 2022 -0700 sound/oss/dmasound: fix build when drivers are mixed =y/=m When CONFIG_DMASOUND_ATARI=m and CONFIG_DMASOUND_Q40=y (or vice versa), dmasound_core.o can be built without dmasound_deinit() being defined, causing a build error: ERROR: modpost: "dmasound_deinit" [sound/oss/dmasound/dmasound_atari.ko] undefined! Modify dmasound_core.c and dmasound.h so that dmasound_deinit() is always available. The mixed modes (=y/=m) also mean that several variables and structs have to be declared in all cases. Suggested-by: Arnd Bergmann Suggested-by: Geert Uytterhoeven Signed-off-by: Randy Dunlap Reported-by: kernel test robot Link: lore.kernel.org/r/202204032138.EFT9qGEd-lkp@intel.com Cc: Geert Uytterhoeven Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Link: https://lore.kernel.org/r/20220405234118.24830-1-rdunlap@infradead.org Signed-off-by: Takashi Iwai sound/oss/dmasound/dmasound.h | 6 ------ sound/oss/dmasound/dmasound_core.c | 24 +----------------------- 2 files changed, 1 insertion(+), 29 deletions(-) commit 9eb6f5c388060d8cef3c8b616cc31b765e022359 Author: Tim Crawford Date: Tue Apr 5 12:20:29 2022 -0600 ALSA: hda/realtek: Add quirk for Clevo PD50PNT Fixes speaker output and headset detection on Clevo PD50PNT. Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220405182029.27431-1-tcrawford@system76.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) commit 21db83846683d3987666505a3ec38f367708199a Author: Oliver Upton Date: Wed Apr 6 23:56:15 2022 +0000 selftests: KVM: Free the GIC FD when cleaning up in arch_timer In order to correctly destroy a VM, all references to the VM must be freed. The arch_timer selftest creates a VGIC for the guest, which itself holds a reference to the VM. Close the GIC FD when cleaning up a VM. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220406235615.1447180-4-oupton@google.com tools/testing/selftests/kvm/aarch64/arch_timer.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) commit 386ba265a8197716076a88853244f4437b92b167 Author: Oliver Upton Date: Wed Apr 6 23:56:14 2022 +0000 selftests: KVM: Don't leak GIC FD across dirty log test iterations dirty_log_perf_test instantiates a VGICv3 for the guest (if supported by hardware) to reduce the overhead of guest exits. However, the test does not actually close the GIC fd when cleaning up the VM between test iterations, meaning that the VM is never actually destroyed in the kernel. While this is generally a bad idea, the bug was detected from the kernel spewing about duplicate debugfs entries as subsequent VMs happen to reuse the same FD even though the debugfs directory is still present. Abstract away the notion of setup/cleanup of the GIC FD from the test by creating arch-specific helpers for test setup/cleanup. Close the GIC FD on VM cleanup and do nothing for the other architectures. Fixes: c340f7899af6 ("KVM: selftests: Add vgic initialization for dirty log perf test for ARM") Reviewed-by: Jing Zhang Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220406235615.1447180-3-oupton@google.com tools/testing/selftests/kvm/dirty_log_perf_test.c | 34 +++++++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) commit a44a4cc1c969afec97dbb2aedaf6f38eaa6253bb Author: Oliver Upton Date: Wed Apr 6 23:56:13 2022 +0000 KVM: Don't create VM debugfs files outside of the VM directory Unfortunately, there is no guarantee that KVM was able to instantiate a debugfs directory for a particular VM. To that end, KVM shouldn't even attempt to create new debugfs files in this case. If the specified parent dentry is NULL, debugfs_create_file() will instantiate files at the root of debugfs. For arm64, it is possible to create the vgic-state file outside of a VM directory, the file is not cleaned up when a VM is destroyed. Nonetheless, the corresponding struct kvm is freed when the VM is destroyed. Nip the problem in the bud for all possible errant debugfs file creations by initializing kvm->debugfs_dentry to -ENOENT. In so doing, debugfs_create_file() will fail instead of creating the file in the root directory. Cc: stable@kernel.org Fixes: 929f45e32499 ("kvm: no need to check return value of debugfs_create functions") Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220406235615.1447180-2-oupton@google.com virt/kvm/kvm_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 02de9331c4d0c6bddac9c5fa66d91f70adf8612b Author: Andrew Jones Date: Wed Mar 16 13:51:29 2022 +0100 KVM: selftests: get-reg-list: Add KVM_REG_ARM_FW_REG(3) When testing a kernel with commit a5905d6af492 ("KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated") get-reg-list output vregs: Number blessed registers: 234 vregs: Number registers: 238 vregs: There are 1 new registers. Consider adding them to the blessed reg list with the following lines: KVM_REG_ARM_FW_REG(3), vregs: PASS ... That output inspired two changes: 1) add the new register to the blessed list and 2) explain why "Number registers" is actually four larger than "Number blessed registers" (on the system used for testing), even though only one register is being stated as new. The reason is that some registers are host dependent and they get filtered out when comparing with the blessed list. The system used for the test apparently had three filtered registers. Signed-off-by: Andrew Jones Acked-by: Marc Zyngier Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220316125129.392128-1-drjones@redhat.com tools/testing/selftests/kvm/aarch64/get-reg-list.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit ec4eb8a86ade4d22633e1da2a7d85a846b7d1798 Author: Duoming Zhou Date: Tue Apr 5 21:22:06 2022 +0800 drivers: net: slip: fix NPD bug in sl_tx_timeout() When a slip driver is detaching, the slip_close() will act to cleanup necessary resources and sl->tty is set to NULL in slip_close(). Meanwhile, the packet we transmit is blocked, sl_tx_timeout() will be called. Although slip_close() and sl_tx_timeout() use sl->lock to synchronize, we don`t judge whether sl->tty equals to NULL in sl_tx_timeout() and the null pointer dereference bug will happen. (Thread 1) | (Thread 2) | slip_close() | spin_lock_bh(&sl->lock) | ... ... | sl->tty = NULL //(1) sl_tx_timeout() | spin_unlock_bh(&sl->lock) spin_lock(&sl->lock); | ... | ... tty_chars_in_buffer(sl->tty)| if (tty->ops->..) //(2) | ... | synchronize_rcu() We set NULL to sl->tty in position (1) and dereference sl->tty in position (2). This patch adds check in sl_tx_timeout(). If sl->tty equals to NULL, sl_tx_timeout() will goto out. Signed-off-by: Duoming Zhou Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20220405132206.55291-1-duoming@zju.edu.cn Signed-off-by: Jakub Kicinski drivers/net/slip/slip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8e9d0d7a76c556e8b73289555950917db13d2077 Merge: b423e54ba965 53968dafc4a6 Author: Jakub Kicinski Date: Wed Apr 6 21:58:49 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2022-04-06 We've added 8 non-merge commits during the last 8 day(s) which contain a total of 9 files changed, 139 insertions(+), 36 deletions(-). The main changes are: 1) rethook related fixes, from Jiri and Masami. 2) Fix the case when tracing bpf prog is attached to struct_ops, from Martin. 3) Support dual-stack sockets in bpf_tcp_check_syncookie, from Maxim. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Adjust bpf_tcp_check_syncookie selftest to test dual-stack sockets bpf: Support dual-stack sockets in bpf_tcp_check_syncookie bpf: selftests: Test fentry tracing a struct_ops program bpf: Resolve to prog->aux->dst_prog->type only for BPF_PROG_TYPE_EXT rethook: Fix to use WRITE_ONCE() for rethook:: Handler selftests/bpf: Fix warning comparing pointer to 0 bpf: Fix sparse warnings in kprobe_multi_resolve_syms bpftool: Explicit errno handling in skeletons ==================== Link: https://lore.kernel.org/r/20220407031245.73026-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski commit 56495f295d8e021f77d065b890fc0100e3f9f6d8 Author: Chandrakanth patil Date: Thu Mar 24 02:47:11 2022 -0700 scsi: megaraid_sas: Target with invalid LUN ID is deleted during scan The megaraid_sas driver supports single LUN for RAID devices. That is LUN 0. All other LUNs are unsupported. When a device scan on a logical target with invalid LUN number is invoked through sysfs, that target ends up getting removed. Add LUN ID validation in the slave destroy function to avoid the target deletion. Link: https://lore.kernel.org/r/20220324094711.48833-1-chandrakanth.patil@broadcom.com Signed-off-by: Chandrakanth patil Signed-off-by: Martin K. Petersen drivers/scsi/megaraid/megaraid_sas.h | 3 +++ drivers/scsi/megaraid/megaraid_sas_base.c | 7 +++++++ 2 files changed, 10 insertions(+) commit bfb7789bcbd901caead43861461bc8f334c90d3b Author: Xiaomeng Tong Date: Sun Mar 20 23:07:33 2022 +0800 scsi: ufs: ufshpb: Fix a NULL check on list iterator The list iterator is always non-NULL so the check 'if (!rgn)' is always false and the dev_err() is never called. Move the check outside the loop and determine if 'victim_rgn' is NULL, to fix this bug. Link: https://lore.kernel.org/r/20220320150733.21824-1-xiam0nd.tong@gmail.com Fixes: 4b5f49079c52 ("scsi: ufs: ufshpb: L2P map management for HPB read") Reviewed-by: Daejun Park Signed-off-by: Xiaomeng Tong Signed-off-by: Martin K. Petersen drivers/scsi/ufs/ufshpb.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit 03252259e18e63eb56a0d29c2fefcc30b58b812b Author: Wenchao Hao Date: Thu Mar 31 21:10:19 2022 -0400 scsi: sd: Clean up gendisk if device_add_disk() failed We forgot to call blk_cleanup_disk() when device_add_disk() failed. This would cause a memory leak of gendisk and sched_tags allocated in elevator_init_mq() Reference:https://syzkaller.appspot.com/x/log.txt?x=13b41dcb700000 Reported-and-tested-by: syzbot+f08c77040fa163a75a46@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20220401011018.1026553-1-haowenchao@huawei.com Signed-off-by: Wenchao Hao Signed-off-by: Martin K. Petersen drivers/scsi/sd.c | 1 + 1 file changed, 1 insertion(+) commit 61144d83376a136d8aa7a9e057d916c505bfb75f Author: Colin Ian King Date: Fri Mar 18 00:39:27 2022 +0000 scsi: message: fusion: Remove redundant variable dmp Variable dmp is being assigned a value that is never read, the variable is redundant and can be removed. Cleans up clang scan build warning: drivers/message/fusion/mptbase.c:6667:39: warning: Although the value stored to 'dmp' is used in the enclosing expression, the value is never actually read from 'dmp' [deadcode.DeadStores] Link: https://lore.kernel.org/r/20220318003927.81471-1-colin.i.king@gmail.com Reviewed-by: Nick Desaulniers Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen drivers/message/fusion/mptbase.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5f2bce1e222028dc1c15f130109a17aa654ae6e8 Author: Alexey Galakhov Date: Wed Mar 9 22:25:35 2022 +0100 scsi: mvsas: Add PCI ID of RocketRaid 2640 The HighPoint RocketRaid 2640 is a low-cost SAS controller based on Marvell chip. The chip in question was already supported by the kernel, just the PCI ID of this particular board was missing. Link: https://lore.kernel.org/r/20220309212535.402987-1-agalakhov@gmail.com Signed-off-by: Alexey Galakhov Signed-off-by: Martin K. Petersen drivers/scsi/mvsas/mv_init.c | 1 + 1 file changed, 1 insertion(+) commit 1700714b1ff252b634db21186db4d91e7e006043 Author: Martin K. Petersen Date: Wed Mar 2 00:35:57 2022 -0500 scsi: sd: sd_read_cpr() requires VPD pages As such it should be called inside the scsi_device_supports_vpd() conditional. Link: https://lore.kernel.org/r/20220302053559.32147-13-martin.petersen@oracle.com Fixes: e815d36548f0 ("scsi: sd: add concurrent positioning ranges support") Cc: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f61eb1216c959f93ffabd3b8781fa5b2b22f8907 Author: Sreekanth Reddy Date: Tue Apr 5 17:36:37 2022 +0530 scsi: mpt3sas: Fail reset operation if config request timed out As part of controller reset operation the driver issues a config request command. If this command gets times out, then fail the controller reset operation instead of retrying it. Link: https://lore.kernel.org/r/20220405120637.20528-1-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen drivers/scsi/mpt3sas/mpt3sas_config.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 75f5a0c4744c7880f1ceceb8b22e3751bf1d4166 Author: Finn Thain Date: Wed Apr 6 19:05:39 2022 +1000 scsi: sym53c500_cs: Stop using struct scsi_pointer This driver doesn't use SCp.ptr to save a SCSI command data pointer which means "scsi pointer" is a complete misnomer here. Only a few members of struct scsi_pointer are needed so move those to private command data. Link: https://lore.kernel.org/r/accf71e293ba3aed6d18c8baeb405de8dfe7c935.1649235939.git.fthain@linux-m68k.org Cc: Bart Van Assche Cc: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Finn Thain Signed-off-by: Martin K. Petersen drivers/scsi/pcmcia/sym53c500_cs.c | 52 ++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 27 deletions(-) commit 4049f7acef3eb37c1ea0df45f3ffc29404f4e708 Author: Adrian Hunter Date: Mon Apr 4 08:50:38 2022 +0300 scsi: ufs: ufs-pci: Add support for Intel MTL Add PCI ID and callbacks to support Intel Meteor Lake (MTL). Link: https://lore.kernel.org/r/20220404055038.2208051-1-adrian.hunter@intel.com Cc: stable@vger.kernel.org # v5.15+ Reviewed-by: Avri Altman Reviewed-by: Bart Van Assche Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen drivers/scsi/ufs/ufshcd-pci.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) commit 6eaa77144b90582cef7f1fc346f11df51f9f83d5 Author: Damien Le Moal Date: Mon Apr 4 14:00:41 2022 +0900 scsi: mpt3sas: Fix mpt3sas_check_same_4gb_region() kdoc comment The start_addres argument of mpt3sas_check_same_4gb_region() was misnamed in the function kdoc comment, resulting in the following warning when compiling with W=1. drivers/scsi/mpt3sas/mpt3sas_base.c:5728: warning: Function parameter or member 'start_address' not described in 'mpt3sas_check_same_4gb_region' drivers/scsi/mpt3sas/mpt3sas_base.c:5728: warning: Excess function parameter 'reply_pool_start_address' description in 'mpt3sas_check_same_4gb_region' Fix the argument name in the function kdoc comment to avoid it. While at it, remove a useless blank line between the kdoc and function code. Link: https://lore.kernel.org/r/20220404050041.594774-1-damien.lemoal@opensource.wdc.com Acked-by: Sreekanth Reddy Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen drivers/scsi/mpt3sas/mpt3sas_base.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 6a0d0ae3e8b533d6de627c814c60264b9a85bad6 Author: Damien Le Moal Date: Mon Apr 4 13:55:47 2022 +0900 scsi: scsi_debug: Fix sdebug_blk_mq_poll() in_use_bm bitmap use The in_use_bm bitmap of struct sdebug_queue should be accessed under protection of the qc_lock spinlock. Make sure that this lock is taken before calling find_first_bit() at the beginning of the function sdebug_blk_mq_poll(). Link: https://lore.kernel.org/r/20220404045547.579887-1-damien.lemoal@opensource.wdc.com Fixes: 3fd07aecb750 ("scsi: scsi_debug: Fix qc_lock use in sdebug_blk_mq_poll()") Acked-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen drivers/scsi/scsi_debug.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 5f3ecd74476510382a35e3ac1883ce52eb5903ae Merge: 312310928417 a6b758b0420b Author: Martin K. Petersen Date: Wed Apr 6 21:46:54 2022 -0400 Merge branch '5.18/scsi-queue' into 5.18/scsi-fixes Pull the remaining commits from 5.18/scsi-queue into fixes. Signed-off-by: Martin K. Petersen commit 1ecc0c09f19f8e10a2c52676f8ca47c28c9f73c7 Author: Marek Vasut Date: Mon Apr 4 21:21:05 2022 +0200 dt-bindings: display: panel: mipi-dbi-spi: Make width-mm/height-mm mandatory Make the width-mm/height-mm panel properties mandatory to correctly report the panel dimensions to the OS. Fixes: 2f3468b82db97 ("dt-bindings: display: add bindings for MIPI DBI compatible SPI panels") Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: Daniel Vetter Cc: Dmitry Osipenko Cc: Laurent Pinchart Cc: Noralf Trønnes Cc: Rob Herring Cc: Robert Foss Cc: Sam Ravnborg Cc: Thomas Zimmermann Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Acked-by: Noralf Trønnes Reviewed-by: Laurent Pinchart Acked-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20220404192105.12547-1-marex@denx.de Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml | 2 ++ 1 file changed, 2 insertions(+) commit dc7d19d27d019d223e74f2f47ef47e778781cb52 Merge: c6b035e672e3 2f25d8ce09b7 Author: Dave Airlie Date: Thu Apr 7 10:23:22 2022 +1000 Merge tag 'amd-drm-fixes-5.18-2022-04-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.18-2022-04-06: amdgpu: - VCN 3.0 fixes - DCN 3.1.5 fix - Misc display fixes - GC 10.3 golden register fix - Suspend fix - SMU 10 fix amdkfd: - Event fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220406170441.5779-1-alexander.deucher@amd.com commit c6b035e672e3dc47307fd80ef68718f3e023f5da Merge: 691b592abb9a 070a88fd4a03 Author: Dave Airlie Date: Thu Apr 7 10:23:03 2022 +1000 Merge tag 'imx-drm-fixes-2022-04-06' of git://git.pengutronix.de/pza/linux into drm-fixes drm/imx: error handling and debug output fixes Catch an EDID allocation failure in imx-ldb, fix a leaked drm display mode on DT parsing error in parallel-display, properly remove the dw_hdmi bridge in case the component_add fails in dw_hdmi-imx, and fix the IPU clock frequency debug printout in ipu-di. Signed-off-by: Dave Airlie From: Philipp Zabel Link: https://patchwork.freedesktop.org/patch/msgid/20220406155101.1271845-1-p.zabel@pengutronix.de commit 691b592abb9a5f2b331969393bc06fcc8b564d3c Merge: 72cfb835e56f d14eb80e2779 Author: Dave Airlie Date: Thu Apr 7 10:22:31 2022 +1000 Merge tag 'drm-misc-fixes-2022-03-24' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * drm/panel/ili9341: Fix optional regulator handling Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YjwkvPp6UnePy4Q8@linux-uq9g.fritz.box commit 72cfb835e56f0eec18f934095fc1a52df1815f0c Merge: 312310928417 15f9cd4334c8 Author: Dave Airlie Date: Thu Apr 7 10:21:46 2022 +1000 Merge tag 'amd-drm-next-5.18-2022-03-25' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-next-5.18-2022-03-25: amdgpu: - GFX 10.3.7 fixes - noretry updates - VCN fixes - TMDS fix - zstate fix for freesync video - DCN 3.1.5 fix - Display stack size fix - Audio fix - DCN 3.1 pstate fix - TMZ VCN fix - APU passthrough fix - Misc other fixes amdkfd: - Error handling fix - xgmi p2p fix - HWS VMIDs fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220325183602.5718-1-alexander.deucher@amd.com commit e3c1c4fd9e6d14059ed93ebfe15e1c57793b1a05 Author: Jason A. Donenfeld Date: Wed Apr 6 02:36:16 2022 +0200 random: check for signals every PAGE_SIZE chunk of /dev/[u]random In 1448769c9cdb ("random: check for signal_pending() outside of need_resched() check"), Jann pointed out that we previously were only checking the TIF_NOTIFY_SIGNAL and TIF_SIGPENDING flags if the process had TIF_NEED_RESCHED set, which meant in practice, super long reads to /dev/[u]random would delay signal handling by a long time. I tried this using the below program, and indeed I wasn't able to interrupt a /dev/urandom read until after several megabytes had been read. The bug he fixed has always been there, and so code that reads from /dev/urandom without checking the return value of read() has mostly worked for a long time, for most sizes, not just for <= 256. Maybe it makes sense to keep that code working. The reason it was so small prior, ignoring the fact that it didn't work anyway, was likely because /dev/random used to block, and that could happen for pretty large lengths of time while entropy was gathered. But now, it's just a chacha20 call, which is extremely fast and is just operating on pure data, without having to wait for some external event. In that sense, /dev/[u]random is a lot more like /dev/zero. Taking a page out of /dev/zero's read_zero() function, it always returns at least one chunk, and then checks for signals after each chunk. Chunk sizes there are of length PAGE_SIZE. Let's just copy the same thing for /dev/[u]random, and check for signals and cond_resched() for every PAGE_SIZE amount of data. This makes the behavior more consistent with expectations, and should mitigate the impact of Jann's fix for the age-old signal check bug. ---- test program ---- #include #include #include #include static unsigned char x[~0U]; static void handle(int) { } int main(int argc, char *argv[]) { pid_t pid = getpid(), child; signal(SIGUSR1, handle); if (!(child = fork())) { for (;;) kill(pid, SIGUSR1); } pause(); printf("interrupted after reading %zd bytes\n", getrandom(x, sizeof(x), 0)); kill(child, SIGTERM); return 0; } Cc: Jann Horn Cc: Theodore Ts'o Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) commit 1ff5c8e8c835e8a81c0868e3050c76563dd56a2c Author: Kefeng Wang Date: Thu Apr 7 00:57:58 2022 +1000 Revert "powerpc: Set max_mapnr correctly" This reverts commit 602946ec2f90d5bd965857753880db29d2d9a1e9. If CONFIG_HIGHMEM is enabled, no highmem will be added with max_mapnr set to max_low_pfn, see mem_init(): for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) { ... free_highmem_page(); } Now that virt_addr_valid() has been fixed in the previous commit, we can revert the change to max_mapnr. Fixes: 602946ec2f90 ("powerpc: Set max_mapnr correctly") Signed-off-by: Kefeng Wang Reviewed-by: Christophe Leroy Reported-by: Erhard F. [mpe: Update change log to reflect series reordering] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220406145802.538416-2-mpe@ellerman.id.au arch/powerpc/mm/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ffa0b64e3be58519ae472ea29a1a1ad681e32f48 Author: Kefeng Wang Date: Thu Apr 7 00:57:57 2022 +1000 powerpc: Fix virt_addr_valid() for 64-bit Book3E & 32-bit mpe: On 64-bit Book3E vmalloc space starts at 0x8000000000000000. Because of the way __pa() works we have: __pa(0x8000000000000000) == 0, and therefore virt_to_pfn(0x8000000000000000) == 0, and therefore virt_addr_valid(0x8000000000000000) == true Which is wrong, virt_addr_valid() should be false for vmalloc space. In fact all vmalloc addresses that alias with a valid PFN will return true from virt_addr_valid(). That can cause bugs with hardened usercopy as described below by Kefeng Wang: When running ethtool eth0 on 64-bit Book3E, a BUG occurred: usercopy: Kernel memory exposure attempt detected from SLUB object not in SLUB page?! (offset 0, size 1048)! kernel BUG at mm/usercopy.c:99 ... usercopy_abort+0x64/0xa0 (unreliable) __check_heap_object+0x168/0x190 __check_object_size+0x1a0/0x200 dev_ethtool+0x2494/0x2b20 dev_ioctl+0x5d0/0x770 sock_do_ioctl+0xf0/0x1d0 sock_ioctl+0x3ec/0x5a0 __se_sys_ioctl+0xf0/0x160 system_call_exception+0xfc/0x1f0 system_call_common+0xf8/0x200 The code shows below, data = vzalloc(array_size(gstrings.len, ETH_GSTRING_LEN)); copy_to_user(useraddr, data, gstrings.len * ETH_GSTRING_LEN)) The data is alloced by vmalloc(), virt_addr_valid(ptr) will return true on 64-bit Book3E, which leads to the panic. As commit 4dd7554a6456 ("powerpc/64: Add VIRTUAL_BUG_ON checks for __va and __pa addresses") does, make sure the virt addr above PAGE_OFFSET in the virt_addr_valid() for 64-bit, also add upper limit check to make sure the virt is below high_memory. Meanwhile, for 32-bit PAGE_OFFSET is the virtual address of the start of lowmem, high_memory is the upper low virtual address, the check is suitable for 32-bit, this will fix the issue mentioned in commit 602946ec2f90 ("powerpc: Set max_mapnr correctly") too. On 32-bit there is a similar problem with high memory, that was fixed in commit 602946ec2f90 ("powerpc: Set max_mapnr correctly"), but that commit breaks highmem and needs to be reverted. We can't easily fix __pa(), we have code that relies on its current behaviour. So for now add extra checks to virt_addr_valid(). For 64-bit Book3S the extra checks are not necessary, the combination of virt_to_pfn() and pfn_valid() should yield the correct result, but they are harmless. Signed-off-by: Kefeng Wang Reviewed-by: Christophe Leroy [mpe: Add additional change log detail] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220406145802.538416-1-mpe@ellerman.id.au arch/powerpc/include/asm/page.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 5dc6ce767dc8ba173534fa75c66a9e2a13b969d1 Author: Lad Prabhakar Date: Tue Mar 8 21:15:43 2022 +0000 dt-bindings: gpu: mali-bifrost: Document RZ/V2L SoC The Renesas RZ/V2L SoC (a.k.a R9A07G054) has a Bifrost Mali-G31 GPU, add a compatible string for it. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220308211543.3081-1-prabhakar.mahadev-lad.rj@bp.renesas.com Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit c887bdc4fb254a871e6180e18203152c548419f1 Author: Wan Jiabing Date: Mon Mar 28 15:39:31 2022 +0800 clk: sunxi-ng: fix not NULL terminated coccicheck error Fix the following coccicheck error: ./drivers/clk/sunxi-ng/ccu-sun6i-rtc.c:348:1-2: sun6i_rtc_ccu_match is not NULL terminated at line 348 Fixes: d91612d7f01a ("clk: sunxi-ng: Add support for the sun6i RTC clocks") Signed-off-by: Wan Jiabing Reviewed-by: Jernej Skrabec Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220328073931.36544-1-wanjiabing@vivo.com drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 1 + 1 file changed, 1 insertion(+) commit 0f525289ff0ddeb380813bd81e0f9bdaaa1c9078 Author: Thomas Zimmermann Date: Mon Apr 4 21:44:02 2022 +0200 fbdev: Fix unregistering of framebuffers without device OF framebuffers do not have an underlying device in the Linux device hierarchy. Do a regular unregister call instead of hot unplugging such a non-existing device. Fixes a NULL dereference. An example error message on ppc64le is shown below. BUG: Kernel NULL pointer dereference on read at 0x00000060 Faulting instruction address: 0xc00000000080dfa4 Oops: Kernel access of bad area, sig: 11 [#1] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries [...] CPU: 2 PID: 139 Comm: systemd-udevd Not tainted 5.17.0-ae085d7f9365 #1 NIP: c00000000080dfa4 LR: c00000000080df9c CTR: c000000000797430 REGS: c000000004132fe0 TRAP: 0300 Not tainted (5.17.0-ae085d7f9365) MSR: 8000000002009033 CR: 28228282 XER: 20000000 CFAR: c00000000000c80c DAR: 0000000000000060 DSISR: 40000000 IRQMASK: 0 GPR00: c00000000080df9c c000000004133280 c00000000169d200 0000000000000029 GPR04: 00000000ffffefff c000000004132f90 c000000004132f88 0000000000000000 GPR08: c0000000015658f8 c0000000015cd200 c0000000014f57d0 0000000048228283 GPR12: 0000000000000000 c00000003fffe300 0000000020000000 0000000000000000 GPR16: 0000000000000000 0000000113fc4a40 0000000000000005 0000000113fcfb80 GPR20: 000001000f7283b0 0000000000000000 c000000000e4a588 c000000000e4a5b0 GPR24: 0000000000000001 00000000000a0000 c008000000db0168 c0000000021f6ec0 GPR28: c0000000016d65a8 c000000004b36460 0000000000000000 c0000000016d64b0 NIP [c00000000080dfa4] do_remove_conflicting_framebuffers+0x184/0x1d0 [c000000004133280] [c00000000080df9c] do_remove_conflicting_framebuffers+0x17c/0x1d0 (unreliable) [c000000004133350] [c00000000080e4d0] remove_conflicting_framebuffers+0x60/0x150 [c0000000041333a0] [c00000000080e6f4] remove_conflicting_pci_framebuffers+0x134/0x1b0 [c000000004133450] [c008000000e70438] drm_aperture_remove_conflicting_pci_framebuffers+0x90/0x100 [drm] [c000000004133490] [c008000000da0ce4] bochs_pci_probe+0x6c/0xa64 [bochs] [...] [c000000004133db0] [c00000000002aaa0] system_call_exception+0x170/0x2d0 [c000000004133e10] [c00000000000c3cc] system_call_common+0xec/0x250 The bug [1] was introduced by commit 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal"). Most firmware framebuffers have an underlying platform device, which can be hot-unplugged before loading the native graphics driver. OF framebuffers do not (yet) have that device. Fix the code by unregistering the framebuffer as before without a hot unplug. Tested with 5.17 on qemu ppc64le emulation. Signed-off-by: Thomas Zimmermann Fixes: 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal") Reported-by: Sudip Mukherjee Reviewed-by: Daniel Vetter Reviewed-by: Javier Martinez Canillas Tested-by: Sudip Mukherjee Cc: Zack Rusin Cc: Javier Martinez Canillas Cc: Hans de Goede Cc: stable@vger.kernel.org # v5.11+ Cc: Helge Deller Cc: Daniel Vetter Cc: Sam Ravnborg Cc: Zheyu Ma Cc: Xiyu Yang Cc: Zhen Lei Cc: Matthew Wilcox Cc: Alex Deucher Cc: Tetsuo Handa Cc: Guenter Roeck Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Link: https://lore.kernel.org/all/YkHXO6LGHAN0p1pq@debian/ # [1] Link: https://patchwork.freedesktop.org/patch/msgid/20220404194402.29974-1-tzimmermann@suse.de drivers/video/fbdev/core/fbmem.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 286901941fd18a52b2138fddbbf589ad3639eb00 Author: Christoph Böhmwalder Date: Wed Apr 6 21:04:45 2022 +0200 drbd: set QUEUE_FLAG_STABLE_WRITES We want our pages not to change while they are being written. Signed-off-by: Christoph Böhmwalder Signed-off-by: Jens Axboe drivers/block/drbd/drbd_main.c | 1 + 1 file changed, 1 insertion(+) commit ae4d37b5df749926891583d42a6801b5da11e3c1 Author: Xiaomeng Tong Date: Wed Apr 6 21:04:44 2022 +0200 drbd: fix an invalid memory access caused by incorrect use of list iterator The bug is here: idr_remove(&connection->peer_devices, vnr); If the previous for_each_connection() don't exit early (no goto hit inside the loop), the iterator 'connection' after the loop will be a bogus pointer to an invalid structure object containing the HEAD (&resource->connections). As a result, the use of 'connection' above will lead to a invalid memory access (including a possible invalid free as idr_remove could call free_layer). The original intention should have been to remove all peer_devices, but the following lines have already done the work. So just remove this line and the unneeded label, to fix this bug. Cc: stable@vger.kernel.org Fixes: c06ece6ba6f1b ("drbd: Turn connection->volumes into connection->peer_devices") Signed-off-by: Xiaomeng Tong Reviewed-by: Christoph Böhmwalder Reviewed-by: Lars Ellenberg Signed-off-by: Jens Axboe drivers/block/drbd/drbd_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit aadb22ba2f656581b2f733deb3a467c48cc618f6 Author: Lv Yunlong Date: Wed Apr 6 21:04:43 2022 +0200 drbd: Fix five use after free bugs in get_initial_state In get_initial_state, it calls notify_initial_state_done(skb,..) if cb->args[5]==1. If genlmsg_put() failed in notify_initial_state_done(), the skb will be freed by nlmsg_free(skb). Then get_initial_state will goto out and the freed skb will be used by return value skb->len, which is a uaf bug. What's worse, the same problem goes even further: skb can also be freed in the notify_*_state_change -> notify_*_state calls below. Thus 4 additional uaf bugs happened. My patch lets the problem callee functions: notify_initial_state_done and notify_*_state_change return an error code if errors happen. So that the error codes could be propagated and the uaf bugs can be avoid. v2 reports a compilation warning. This v3 fixed this warning and built successfully in my local environment with no additional warnings. v2: https://lore.kernel.org/patchwork/patch/1435218/ Fixes: a29728463b254 ("drbd: Backport the "events2" command") Signed-off-by: Lv Yunlong Reviewed-by: Christoph Böhmwalder Signed-off-by: Jens Axboe drivers/block/drbd/drbd_int.h | 8 +++---- drivers/block/drbd/drbd_nl.c | 41 +++++++++++++++++++++------------- drivers/block/drbd/drbd_state.c | 18 +++++++-------- drivers/block/drbd/drbd_state_change.h | 8 +++---- 4 files changed, 42 insertions(+), 33 deletions(-) commit 773f91b2cf3f52df0d7508fdbf60f37567cdaee4 Author: Chuck Lever Date: Fri Apr 1 17:08:21 2022 -0400 SUNRPC: Fix NFSD's request deferral on RDMA transports Trond Myklebust reports an NFSD crash in svc_rdma_sendto(). Further investigation shows that the crash occurred while NFSD was handling a deferred request. This patch addresses two inter-related issues that prevent request deferral from working correctly for RPC/RDMA requests: 1. Prevent the crash by ensuring that the original svc_rqst::rq_xprt_ctxt value is available when the request is revisited. Otherwise svc_rdma_sendto() does not have a Receive context available with which to construct its reply. 2. Possibly since before commit 71641d99ce03 ("svcrdma: Properly compute .len and .buflen for received RPC Calls"), svc_rdma_recvfrom() did not include the transport header in the returned xdr_buf. There should have been no need for svc_defer() and friends to save and restore that header, as of that commit. This issue is addressed in a backport-friendly way by simply having svc_rdma_recvfrom() set rq_xprt_hlen to zero unconditionally, just as svc_tcp_recvfrom() does. This enables svc_deferred_recv() to correctly reconstruct an RPC message received via RPC/RDMA. Reported-by: Trond Myklebust Link: https://lore.kernel.org/linux-nfs/82662b7190f26fb304eb0ab1bb04279072439d4e.camel@hammerspace.com/ Signed-off-by: Chuck Lever Cc: include/linux/sunrpc/svc.h | 1 + net/sunrpc/svc_xprt.c | 3 +++ net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) commit ce8b3ad1071b764e963d9b08ac34ffddddf12da6 Author: Dongjin Yang Date: Mon Apr 4 11:28:57 2022 +0900 dt-bindings: net: snps: remove duplicate name snps,dwmac has duplicated name for loongson,ls2k-dwmac and loongson,ls7a-dwmac. Signed-off-by: Dongjin Yang Fixes: 68277749a013 ("dt-bindings: dwmac: Add bindings for new Loongson SoC and bridge chip") Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220404022857epcms1p6e6af1a6a86569f339e50c318abde7d3c@epcms1p6 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 5593473a1e6c743764b08e3b6071cb43b5cfa6c4 Author: Paolo Bonzini Date: Wed Apr 6 13:13:42 2022 -0400 KVM: avoid NULL pointer dereference in kvm_dirty_ring_push kvm_vcpu_release() will call kvm_dirty_ring_free(), freeing ring->dirty_gfns and setting it to NULL. Afterwards, it calls kvm_arch_vcpu_destroy(). However, if closing the file descriptor races with KVM_RUN in such away that vcpu->arch.st.preempted == 0, the following call stack leads to a NULL pointer dereference in kvm_dirty_run_push(): mark_page_dirty_in_slot+0x192/0x270 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3171 kvm_steal_time_set_preempted arch/x86/kvm/x86.c:4600 [inline] kvm_arch_vcpu_put+0x34e/0x5b0 arch/x86/kvm/x86.c:4618 vcpu_put+0x1b/0x70 arch/x86/kvm/../../../virt/kvm/kvm_main.c:211 vmx_free_vcpu+0xcb/0x130 arch/x86/kvm/vmx/vmx.c:6985 kvm_arch_vcpu_destroy+0x76/0x290 arch/x86/kvm/x86.c:11219 kvm_vcpu_destroy arch/x86/kvm/../../../virt/kvm/kvm_main.c:441 [inline] The fix is to release the dirty page ring after kvm_arch_vcpu_destroy has run. Reported-by: Qiuhao Li Reported-by: Gaoning Pan Reported-by: Yongkang Jia Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 53968dafc4a6061c1e01d884f1f9a4b8c4b0d5bc Author: Maxim Mikityanskiy Date: Wed Apr 6 15:41:13 2022 +0300 bpf: Adjust bpf_tcp_check_syncookie selftest to test dual-stack sockets The previous commit fixed support for dual-stack sockets in bpf_tcp_check_syncookie. This commit adjusts the selftest to verify the fixed functionality. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Alexei Starovoitov Acked-by: Arthur Fabre Link: https://lore.kernel.org/bpf/20220406124113.2795730-2-maximmi@nvidia.com .../selftests/bpf/test_tcp_check_syncookie_user.c | 78 ++++++++++++++++------ 1 file changed, 59 insertions(+), 19 deletions(-) commit 2e8702cc0cfa1080f29fd64003c00a3e24ac38de Author: Maxim Mikityanskiy Date: Wed Apr 6 15:41:12 2022 +0300 bpf: Support dual-stack sockets in bpf_tcp_check_syncookie bpf_tcp_gen_syncookie looks at the IP version in the IP header and validates the address family of the socket. It supports IPv4 packets in AF_INET6 dual-stack sockets. On the other hand, bpf_tcp_check_syncookie looks only at the address family of the socket, ignoring the real IP version in headers, and validates only the packet size. This implementation has some drawbacks: 1. Packets are not validated properly, allowing a BPF program to trick bpf_tcp_check_syncookie into handling an IPv6 packet on an IPv4 socket. 2. Dual-stack sockets fail the checks on IPv4 packets. IPv4 clients end up receiving a SYNACK with the cookie, but the following ACK gets dropped. This patch fixes these issues by changing the checks in bpf_tcp_check_syncookie to match the ones in bpf_tcp_gen_syncookie. IP version from the header is taken into account, and it is validated properly with address family. Fixes: 399040847084 ("bpf: add helper to check for a valid SYN cookie") Signed-off-by: Maxim Mikityanskiy Signed-off-by: Alexei Starovoitov Reviewed-by: Tariq Toukan Acked-by: Arthur Fabre Link: https://lore.kernel.org/bpf/20220406124113.2795730-1-maximmi@nvidia.com net/core/filter.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) commit 0fe35b8dcb8b3c4b751a1a44f1e128b690af71e4 Author: Marijn Suijten Date: Sat Feb 26 20:46:32 2022 +0100 drm/msm/dpu: Use indexed array initializer to prevent mismatches While there's a comment pointing from dpu_intr_set to dpu_hw_intr_reg and vice-versa, an array initializer using indices makes it so that the indices between the enum and array cannot possibly get out of sync even if they're accidentially ordered wrongly. It is still useful to keep the comment to be made aware where the register offset mapping resides while looking at dpu_hw_intr_reg. Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220226194633.204501-1-marijn.suijten@somainline.org Signed-off-by: Rob Clark drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) commit f75e582b0c3ee8f0bddc2248cc8b9175f29c5937 Author: Xiaoke Wang Date: Thu Mar 24 17:15:08 2022 +0800 drm/msm/disp: check 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 Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/tencent_B3E19486FF39415098B572B7397C2936C309@qq.com Signed-off-by: Rob Clark drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c | 2 ++ 1 file changed, 2 insertions(+) commit 2f25d8ce09b7ba5d769c132ba3d4eb84a941d2cb Author: Alex Deucher Date: Fri Apr 1 11:08:48 2022 -0400 drm/amdgpu/smu10: fix SoC/fclk units in auto mode SMU takes clock limits in Mhz units. socclk and fclk were using 10 khz units in some cases. Switch to Mhz units. Fixes higher than required SoC clocks. Fixes: 97cf32996c46d9 ("drm/amd/pm: Removed fixed clock in auto mode DPM") Reviewed-by: Paul Menzel Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 28c25238898a242c58bfaff3f46a006585c2dd94 Author: Dmytro Laktyushkin Date: Wed Mar 30 16:05:50 2022 -0400 drm/amd/display: update dcn315 clock table read [Why & How] Make dcn315 base its clock table off dcfclk rather than fclk. This change also adds some sanity checking to make sure an empty pmfw table does not result in invalid dal clocks. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher .../amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 107 +++++++++++++-------- 1 file changed, 67 insertions(+), 40 deletions(-) commit 879791ad8bf3dc5453061cad74776a617b6e3319 Author: Benjamin Marty Date: Wed Mar 23 22:08:26 2022 +0100 drm/amdgpu/display: change pipe policy for DCN 2.1 Fixes crash on MST Hub disconnect. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1849 Fixes: ee2698cf79cc ("drm/amd/display: Changed pipe split policy to allow for multi-display pipe split") Signed-off-by: Benjamin Marty Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6e93d5b0333279d8968a2972065f47a899fb58b9 Author: Jimmy Kizito Date: Tue Mar 22 19:12:47 2022 -0400 drm/amd/display: Add configuration options for AUX wake work around. [Why] Work around to try to wake unresponsive DP sinks may need to be adjusted for certain sinks. [How] Add options to disable work around or adjust time spent trying to wake unresponsive DPRX. Tested-by: Daniel Wheeler Reviewed-by: Martin Leung Acked-by: Tom Chung Signed-off-by: Jimmy Kizito Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 8 +++++++- drivers/gpu/drm/amd/display/dc/dc.h | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) commit 7e8906dc2689cbf562ce520cf4a8ba5b495db0f6 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. Tested-by: Daniel Wheeler Reviewed-by: Alvin Lee Acked-by: Tom Chung Signed-off-by: Eric Bernstein Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 1 - 1 file changed, 1 deletion(-) commit ebc002e3ee78409c42156e62e4e27ad1d09c5a75 Author: Alex Deucher Date: Fri Mar 25 11:53:39 2022 -0400 drm/amdgpu: don't use BACO for reset in S3 Seems to cause a reboots or hangs on some systems. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1924 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1953 Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)") Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit ca1198849ab0e7af5efb392ef6baf1138f6fc086 Author: CHANDAN VURDIGERE NATARAJ Date: Tue Mar 29 13:10:31 2022 +0530 drm/amd/display: Fix by adding FPU protection for dcn30_internal_validate_bw [Why] Below general protection fault observed when WebGL Aquarium is run for longer duration. If drm debug logs are enabled and set to 0x1f then the issue is observed within 10 minutes of run. [ 100.717056] general protection fault, probably for non-canonical address 0x2d33302d32323032: 0000 [#1] PREEMPT SMP NOPTI [ 100.727921] CPU: 3 PID: 1906 Comm: DrmThread Tainted: G W 5.15.30 #12 d726c6a2d6ebe5cf9223931cbca6892f916fe18b [ 100.754419] RIP: 0010:CalculateSwathWidth+0x1f7/0x44f [ 100.767109] Code: 00 00 00 f2 42 0f 11 04 f0 48 8b 85 88 00 00 00 f2 42 0f 10 04 f0 48 8b 85 98 00 00 00 f2 42 0f 11 04 f0 48 8b 45 10 0f 57 c0 42 0f 2a 04 b0 0f 57 c9 f3 43 0f 2a 0c b4 e8 8c e2 f3 ff 48 8b [ 100.781269] RSP: 0018:ffffa9230079eeb0 EFLAGS: 00010246 [ 100.812528] RAX: 2d33302d32323032 RBX: 0000000000000500 RCX: 0000000000000000 [ 100.819656] RDX: 0000000000000001 RSI: ffff99deb712c49c RDI: 0000000000000000 [ 100.826781] RBP: ffffa9230079ef50 R08: ffff99deb712460c R09: ffff99deb712462c [ 100.833907] R10: ffff99deb7124940 R11: ffff99deb7124d70 R12: ffff99deb712ae44 [ 100.841033] R13: 0000000000000001 R14: 0000000000000000 R15: ffffa9230079f0a0 [ 100.848159] FS: 00007af121212640(0000) GS:ffff99deba780000(0000) knlGS:0000000000000000 [ 100.856240] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 100.861980] CR2: 0000209000fe1000 CR3: 000000011b18c000 CR4: 0000000000350ee0 [ 100.869106] Call Trace: [ 100.871555] [ 100.873655] ? asm_sysvec_reschedule_ipi+0x12/0x20 [ 100.878449] CalculateSwathAndDETConfiguration+0x1a3/0x6dd [ 100.883937] dml31_ModeSupportAndSystemConfigurationFull+0x2ce4/0x76da [ 100.890467] ? kallsyms_lookup_buildid+0xc8/0x163 [ 100.895173] ? kallsyms_lookup_buildid+0xc8/0x163 [ 100.899874] ? __sprint_symbol+0x80/0x135 [ 100.903883] ? dm_update_plane_state+0x3f9/0x4d2 [ 100.908500] ? symbol_string+0xb7/0xde [ 100.912250] ? number+0x145/0x29b [ 100.915566] ? vsnprintf+0x341/0x5ff [ 100.919141] ? desc_read_finalized_seq+0x39/0x87 [ 100.923755] ? update_load_avg+0x1b9/0x607 [ 100.927849] ? compute_mst_dsc_configs_for_state+0x7d/0xd5b [ 100.933416] ? fetch_pipe_params+0xa4d/0xd0c [ 100.937686] ? dc_fpu_end+0x3d/0xa8 [ 100.941175] dml_get_voltage_level+0x16b/0x180 [ 100.945619] dcn30_internal_validate_bw+0x10e/0x89b [ 100.950495] ? dcn31_validate_bandwidth+0x68/0x1fc [ 100.955285] ? resource_build_scaling_params+0x98b/0xb8c [ 100.960595] ? dcn31_validate_bandwidth+0x68/0x1fc [ 100.965384] dcn31_validate_bandwidth+0x9a/0x1fc [ 100.970001] dc_validate_global_state+0x238/0x295 [ 100.974703] amdgpu_dm_atomic_check+0x9c1/0xbce [ 100.979235] ? _printk+0x59/0x73 [ 100.982467] drm_atomic_check_only+0x403/0x78b [ 100.986912] drm_mode_atomic_ioctl+0x49b/0x546 [ 100.991358] ? drm_ioctl+0x1c1/0x3b3 [ 100.994936] ? drm_atomic_set_property+0x92a/0x92a [ 100.999725] drm_ioctl_kernel+0xdc/0x149 [ 101.003648] drm_ioctl+0x27f/0x3b3 [ 101.007051] ? drm_atomic_set_property+0x92a/0x92a [ 101.011842] amdgpu_drm_ioctl+0x49/0x7d [ 101.015679] __se_sys_ioctl+0x7c/0xb8 [ 101.015685] do_syscall_64+0x5f/0xb8 [ 101.015690] ? __irq_exit_rcu+0x34/0x96 [How] It calles populate_dml_pipes which uses doubles to initialize. Adding FPU protection avoids context switch and probable loss of vba context as there is potential contention while drm debug logs are enabled. Signed-off-by: CHANDAN VURDIGERE NATARAJ Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 ++ 1 file changed, 2 insertions(+) commit e79a2398e1b2d47060474dca291542368183bc0f Author: Lee Jones Date: Thu Mar 31 13:21:17 2022 +0100 drm/amdkfd: Create file descriptor after client is added to smi_clients list This ensures userspace cannot prematurely clean-up the client before it is fully initialised which has been proven to cause issues in the past. Cc: Felix Kuehling Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) commit ef1a0808a2e20c58d166c5707864fba515832bd7 Author: Ma Jun Date: Wed Mar 23 21:16:19 2022 +0800 drm/amdgpu: Sync up header and implementation to use the same parameter names Sync up header and implementation to use the same parameter names in function amdgpu_ring_init. ring_size -> max_dw, prio -> hw_prio Reviewed-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Ma Jun Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 96f2b7a3571618a1c8aed694c9e668014c70898b Author: Ruili Ji Date: Thu Mar 31 12:19:00 2022 +0800 drm/amdgpu: fix incorrect GCR_GENERAL_CNTL address gfx10.3.3/gfx10.3.6/gfx10.3.7 shall use 0x1580 address for GCR_GENERAL_CNTL Acked-by: Prike Liang Acked-by: Yifan Zhang Reviewed-by: Aaron Liu Signed-off-by: Ruili Ji Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 4052287a75eb3fc0f487fcc5f768a38bede455c8 Author: Shirish S Date: Fri Mar 11 20:30:17 2022 +0530 amd/display: set backlight only if required [Why] comparing pwm bl values (coverted) with user brightness(converted) levels in commit_tail leads to continuous setting of backlight via dmub as they don't to match. This leads overdrive in queuing of commands to DMCU that sometimes lead to depending on load on DMCU fw: "[drm:dc_dmub_srv_wait_idle] *ERROR* Error waiting for DMUB idle: status=3" [How] Store last successfully set backlight value and compare with it instead of pwm reads which is not what we should compare with. Signed-off-by: Shirish S Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) commit f4346fb3edf7720db3f7f5e1cab1f667cd024280 Author: Roman Li Date: Thu Mar 17 19:55:05 2022 -0400 drm/amd/display: Fix allocate_mst_payload assert on resume [Why] On resume we do link detection for all non-MST connectors. MST is handled separately. However the condition for telling if connector is on mst branch is not enough for mst hub case. Link detection for mst branch link leads to mst topology reset. That causes assert in dc_link_allocate_mst_payload() [How] Use link type as indicator for mst link. Reviewed-by: Wayne Lin Acked-by: Alex Hung Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit b2075fce104b88b789c15ef1ed2b91dc94198e26 Author: Martin Leung Date: Fri Mar 18 11:12:36 2022 -0400 drm/amd/display: Revert FEC check in validation why and how: causes failure on install on certain machines Reviewed-by: George Shen Acked-by: Alex Hung Signed-off-by: Martin Leung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ---- 1 file changed, 4 deletions(-) commit 2944dbedc7e167221fdb99531f7b0cdbac9ac696 Author: Jimmy Kizito Date: Wed Mar 9 18:26:47 2022 -0500 drm/amd/display: Add work around for AUX failure on wake. [Why] When waking from low-power states, a DP sink may remain unresponsive to AUX transactions. [How] Try to toggle DPCD SET_POWER register repeatedly (up to a maximum timeout value) until DP sink becomes responsive. Reviewed-by: Mustapha Ghaddar Acked-by: Alex Hung Signed-off-by: Jimmy Kizito Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 59 ++++++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h | 1 + 2 files changed, 60 insertions(+) commit 83e9faac9a387894e945e7f33c2bb7a9c348257c Author: Charlene Liu Date: Tue Mar 15 16:42:33 2022 -0400 drm/amd/display: Clear optc false state when disable otg [why] when disable optc, need to clear the underflow status as well. Reviewed-by: Chris Park Acked-by: Alex Hung Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c | 14 +++++++------- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_optc.c | 5 ++++- 2 files changed, 11 insertions(+), 8 deletions(-) commit 58e16c752e9540b28a873c44c3bee83e022007c1 Author: Roman Li Date: Tue Mar 15 16:31:14 2022 -0400 drm/amd/display: Enable power gating before init_pipes [Why] In init_hw() we call init_pipes() before enabling power gating. init_pipes() tries to power gate dsc but it may fail because required force-ons are not released yet. As a result with dsc config the following errors observed on resume: "REG_WAIT timeout 1us * 1000 tries - dcn20_dsc_pg_control" "REG_WAIT timeout 1us * 1000 tries - dcn20_dpp_pg_control" "REG_WAIT timeout 1us * 1000 tries - dcn20_hubp_pg_control" [How] Move enable_power_gating_plane() before init_pipes() in init_hw() Reviewed-by: Anthony Koo Reviewed-by: Eric Yang Acked-by: Alex Hung Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 5 +++-- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c | 5 +++-- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) commit 95707203407c4cf0b7e520a99d6f46d8aed4b57f Author: Roman Li Date: Tue Mar 15 14:57:34 2022 -0400 drm/amd/display: Remove redundant dsc power gating from init_hw [Why] DSC Power down code has been moved from dcn31_init_hw into init_pipes() Need to remove it from dcn10_init_hw() as well to avoid duplicated action on dcn1.x/2.x [How] Remove DSC power down code from dcn10_init_hw() Fixes: 8fa6f4c5715c ("drm/amd/display: fixed the DSC power off sequence during Driver PnP") Reviewed-by: Anthony Koo Reviewed-by: Eric Yang Acked-by: Alex Hung Signed-off-by: Roman Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 7 ------- 1 file changed, 7 deletions(-) commit 862a876c3a6372f2fa9d0c6510f1976ac94fc857 Author: Chris Park Date: Tue Mar 15 12:21:43 2022 -0400 drm/amd/display: Correct Slice reset calculation [Why] Once DSC slice cannot fit pixel clock, we incorrectly reset min slices to 0 and allow max slice to operate, even when max slice itself cannot fit the pixel clock properly. [How] Change the sequence such that we correctly determine DSC is not possible when both min slices and max slices cannot fit pixel clock per slice. Reviewed-by: Wenjing Liu Acked-by: Alex Hung Signed-off-by: Chris Park Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit dda81d9761d07541c404dd5fa93e773a8eda5ddc Author: tiancyin Date: Sun Mar 27 19:07:13 2022 +0800 drm/amd/vcn: fix an error msg on vcn 3.0 Some video card has more than one vcn instance, passing 0 to vcn_v3_0_pause_dpg_mode is incorrect. Error msg: Register(1) [mmUVD_POWER_STATUS] failed to reach value 0x00000001 != 0x00000002 Reviewed-by: James Zhu Signed-off-by: tiancyin Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 945da79e6dd058be70bc47442dce319844e14daa Author: Boyuan Zhang Date: Thu Mar 24 12:19:06 2022 -0400 drm/amdgpu/vcn3: send smu interface type For VCN FW to detect ASIC type, in order to use different mailbox registers. V2: simplify codes and fix format issue. Signed-off-by: Boyuan Zhang Acked-by Huang Rui Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 7 +++++++ drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 +++++ 2 files changed, 12 insertions(+) commit 39ad93d280506f4953a9d0c545cfffa581889326 Author: Dmitry Osipenko Date: Sun Feb 20 23:46:23 2022 +0300 ARM: config: multi v7: Enable NVIDIA Tegra video decoder driver Enable NVIDIA Tegra V4L2 video decoder driver. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+) commit 3739157768d746e581697c4cbd7ceb3a28040c06 Author: Dmitry Osipenko Date: Sun Feb 20 23:46:22 2022 +0300 ARM: tegra_defconfig: Update CONFIG_TEGRA_VDE option The CONFIG_TEGRA_VDE has been deprecated and replaced with the new V4L options after de-staging of the tegra-vde driver. Update the config entry. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding arch/arm/configs/tegra_defconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 2c7d1b281286c46049cd22b43435cecba560edde Author: Kamal Dasu Date: Mon Mar 28 10:24:42 2022 -0400 spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op() This fixes case where MSPI controller is used to access spi-nor flash and BSPI block is not present. Fixes: 5f195ee7d830 ("spi: bcm-qspi: Implement the spi_mem interface") Signed-off-by: Kamal Dasu Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220328142442.7553-1-kdasu.kdev@gmail.com Signed-off-by: Mark Brown drivers/spi/spi-bcm-qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 97e4827d775faa9a32b5e1a97959c69dd77d17a3 Author: Matthias Schiffer Date: Thu Mar 31 13:08:19 2022 +0200 spi: cadence-quadspi: fix protocol setup for non-1-1-X operations cqspi_set_protocol() only set the data width, but ignored the command and address width (except for 8-8-8 DTR ops), leading to corruption of all transfers using 1-X-X or X-X-X ops. Fix by setting the other two widths as well. While we're at it, simplify the code a bit by replacing the CQSPI_INST_TYPE_* constants with ilog2(). Tested on a TI AM64x with a Macronix MX25U51245G QSPI flash with 1-4-4 read and write operations. Signed-off-by: Matthias Schiffer Link: https://lore.kernel.org/r/20220331110819.133392-1-matthias.schiffer@ew.tq-group.com Signed-off-by: Mark Brown drivers/spi/spi-cadence-quadspi.c | 46 ++++++++++----------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) commit 409543cec01a84610029d6440c480c3fdd7214fb Author: Vinod Koul Date: Wed Apr 6 18:52:38 2022 +0530 spi: core: add dma_map_dev for __spi_unmap_msg() Commit b470e10eb43f ("spi: core: add dma_map_dev for dma device") added dma_map_dev for _spi_map_msg() but missed to add for unmap routine, __spi_unmap_msg(), so add it now. Fixes: b470e10eb43f ("spi: core: add dma_map_dev for dma device") Cc: stable@vger.kernel.org # v5.14+ Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20220406132238.1029249-1-vkoul@kernel.org Signed-off-by: Mark Brown drivers/spi/spi.c | 4 ++++ 1 file changed, 4 insertions(+) commit fcd1e39cca6e3a262f2badfcd5edd76c910ad3bc Author: Ajye Huang Date: Thu Mar 24 16:47:08 2022 +0800 ASoC: Intel: sof_rt5682: Add support for max98360a speaker amp on SSP2 Follow Intel's design to replace max98360a amp SSP2 reather than SSP1 by judging DMI_OEM_STRING in sof_rt5682_quirk_table struct. And reusing max98357's topology since DAI setting could be leveraged. Signed-off-by: Ajye Huang Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220324084708.2009375-1-ajye_huang@compal.corp-partner.google.com Signed-off-by: Mark Brown sound/soc/intel/boards/sof_rt5682.c | 13 +++++++++++++ sound/soc/sof/sof-pci-dev.c | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) commit d00887c106dac47b9af6ed70e8d5c45b69c4bd52 Author: Ahmad Fatoum Date: Tue Apr 5 17:57:31 2022 +0200 ASoC: fsl_sai: fix 1:1 bclk:mclk ratio support Refactoring in commit a50b7926d015 ("ASoC: fsl_sai: implement 1:1 bclk:mclk ratio support") led to the bypass never happening as (ratio = 1) was caught in the existing if (ratio & 1) continue; check. The correct check sequence instead is: - skip all ratios lower than one and higher than 512 - skip all odd ratios except for 1:1 - skip 1:1 ratio if and only if !support_1_1_ratio And for all others, calculate the appropriate divider. Adjust the code to facilitate this. Fixes: a50b7926d015 ("ASoC: fsl_sai: implement 1:1 bclk:mclk ratio support") Signed-off-by: Ahmad Fatoum Acked-by: Shengjiu Wang Reviewed-by: Sascha Hauer Link: https://lore.kernel.org/r/20220405155731.745413-1-a.fatoum@pengutronix.de Signed-off-by: Mark Brown sound/soc/fsl/fsl_sai.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 51a630a7051f7f4f1cfdd64c20c7110f9907c230 Author: Richard Fitzgerald Date: Mon Apr 4 12:32:52 2022 +0100 ASoC: simple-card-utils: Avoid NULL deref in asoc_simple_set_tdm() Don't dereference simple_dai before it has been checked for NULL. Signed-off-by: Richard Fitzgerald Fixes: 1e974e5b82b3 ("ASoC: audio_graph_card2: Add support for variable slot widths") Reported-by: kernel test robot Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/20220404113252.1152659-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown sound/soc/generic/simple-card-utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 4ded53ea0c7d46fa043efc7320e17ca443a1debb Author: Enze Li Date: Fri Apr 1 22:18:42 2022 +0100 cdrom: remove unused variable The clang static analyzer reports the following warning, File: drivers/cdrom/cdrom.c Warning: line 1380, column 7 Although the value stored to 'status' is used in enclosing expression, the value is never actually read from 'status' Remove the unused variable to eliminate the warning. Signed-off-by: Enze Li Link: https://lore.kernel.org/all/20220401032623.293666-1-lienze@kylinos.cn Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20220401211842.2088096-1-phil@philpotter.co.uk Signed-off-by: Jens Axboe drivers/cdrom/cdrom.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit b423e54ba965b4469b48e46fd16941f1e1701697 Author: Xiaomeng Tong Date: Wed Apr 6 11:55:56 2022 +0800 myri10ge: fix an incorrect free for skb in myri10ge_sw_tso All remaining skbs should be released when myri10ge_xmit fails to transmit a packet. Fix it within another skb_list_walk_safe. Signed-off-by: Xiaomeng Tong Signed-off-by: David S. Miller drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit afb8e246527536848b9b4025b40e613edf776a9d Author: Marcin Kozlowski Date: Wed Apr 6 10:05:37 2022 +0200 net: usb: aqc111: Fix out-of-bounds accesses in RX fixup aqc111_rx_fixup() contains several out-of-bounds accesses that can be triggered by a malicious (or defective) USB device, in particular: - The metadata array (desc_offset..desc_offset+2*pkt_count) can be out of bounds, causing OOB reads and (on big-endian systems) OOB endianness flips. - A packet can overlap the metadata array, causing a later OOB endianness flip to corrupt data used by a cloned SKB that has already been handed off into the network stack. - A packet SKB can be constructed whose tail is far beyond its end, causing out-of-bounds heap data to be considered part of the SKB's data. Found doing variant analysis. Tested it with another driver (ax88179_178a), since I don't have a aqc111 device to test it, but the code looks very similar. Signed-off-by: Marcin Kozlowski Signed-off-by: David S. Miller drivers/net/usb/aqc111.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 4e910dbe36508654a896d5735b318c0b88172570 Author: Jamie Bainbridge Date: Wed Apr 6 21:19:19 2022 +1000 qede: confirm skb is allocated before using qede_build_skb() assumes build_skb() always works and goes straight to skb_reserve(). However, build_skb() can fail under memory pressure. This results in a kernel panic because the skb to reserve is NULL. Add a check in case build_skb() failed to allocate and return NULL. The NULL return is handled correctly in callers to qede_build_skb(). Fixes: 8a8633978b842 ("qede: Add build_skb() support.") Signed-off-by: Jamie Bainbridge Signed-off-by: David S. Miller drivers/net/ethernet/qlogic/qede/qede_fp.c | 3 +++ 1 file changed, 3 insertions(+) commit a3ebe92a0f2dfaeac257b685531decf8c9cd8eee Author: Florian Westphal Date: Wed Apr 6 12:04:45 2022 +0200 net: ipv6mr: fix unused variable warning with CONFIG_IPV6_PIMSM_V2=n net/ipv6/ip6mr.c:1656:14: warning: unused variable 'do_wrmifwhole' Move it to the CONFIG_IPV6_PIMSM_V2 scope where its used. Fixes: 4b340a5a726d ("net: ip6mr: add support for passing full packet on wrong mif") Signed-off-by: Florian Westphal Signed-off-by: David S. Miller net/ipv6/ip6mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 74edbe9edeeffbf5a57f02ac8e8665bc5dbe8ffc Merge: 8d90991e5bf7 e19778e6c911 Author: David S. Miller Date: Wed Apr 6 15:03:50 2022 +0100 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-04-05 Maciej Fijalkowski says: We were solving issues around AF_XDP busy poll's not-so-usual scenarios, such as very big busy poll budgets applied to very small HW rings. This set carries the things that were found during that work that apply to net tree. One thing that was fixed for all in-tree ZC drivers was missing on ice side all the time - it's about syncing RCU before destroying XDP resources. Next one fixes the bit that is checked in ice_xsk_wakeup and third one avoids false setting of DD bits on Tx descriptors. ==================== Signed-off-by: David S. Miller commit eaa03d34535872d29004cb5cf77dc9dec1ba9a25 Author: Andrea Parri (Microsoft) Date: Mon Mar 28 17:44:57 2022 +0200 Drivers: hv: vmbus: Replace smp_store_mb() with virt_store_mb() Following the recommendation in Documentation/memory-barriers.txt for virtual machine guests. Fixes: 8b6a877c060ed ("Drivers: hv: vmbus: Replace the per-CPU channel lists with a global array of channels") Signed-off-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20220328154457.100872-1-parri.andrea@gmail.com Signed-off-by: Wei Liu drivers/hv/channel_mgmt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit dc900431337f5f861e3cc47ec5be5a69db40ee34 Author: Johan Hovold Date: Mon Feb 28 11:16:17 2022 +0100 arm64: dts: imx8mm-venice: fix spi2 pin configuration Due to what looks like a copy-paste error, the ECSPI2_MISO pad is not muxed for SPI mode and causes reads from a slave-device connected to the SPI header to always return zero. Configure the ECSPI2_MISO pad for SPI mode on the gw71xx, gw72xx and gw73xx families of boards that got this wrong. Fixes: 6f30b27c5ef5 ("arm64: dts: imx8mm: Add Gateworks i.MX 8M Mini Development Kits") Cc: stable@vger.kernel.org # 5.12 Cc: Tim Harvey Signed-off-by: Johan Hovold Acked-by: Tim Harvey Signed-off-by: Shawn Guo arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8mm-venice-gw72xx.dtsi | 2 +- arch/arm64/boot/dts/freescale/imx8mm-venice-gw73xx.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit 89bac792faf03fae5a9564bebfaacab53a029932 Merge: e927b05f3cc2 fc35880d198d Author: Mark Brown Date: Wed Apr 6 14:23:46 2022 +0100 ASoC: meson: aiu: fix duplicate debugfs directory error Merge series from Heiner Kallweit : On a S905W-based system I get the following error: debugfs: Directory 'c1105400.audio-controller' with parent 'P230-Q200' already present! Turned out that multiple components having the same name triggers this error in soc_init_component_debugfs(). The proposed solution allows other drivers to adopt the same approach with minimal effort. With the patch the error is gone and that's the debugfs entries. /sys/kernel/debug/asoc/P230-Q200/acodec:c1105400.audio-controller /sys/kernel/debug/asoc/P230-Q200/hdmi:c1105400.audio-controller /sys/kernel/debug/asoc/P230-Q200/cpu:c1105400.audio-controller commit be5802795cf8d0b881745fa9ba7790293b382280 Author: Boqun Feng Date: Fri Mar 25 10:32:12 2022 +0800 Drivers: hv: balloon: Disable balloon and hot-add accordingly Currently there are known potential issues for balloon and hot-add on ARM64: * Unballoon requests from Hyper-V should only unballoon ranges that are guest page size aligned, otherwise guests cannot handle because it's impossible to partially free a page. This is a problem when guest page size > 4096 bytes. * Memory hot-add requests from Hyper-V should provide the NUMA node id of the added ranges or ARM64 should have a functional memory_add_physaddr_to_nid(), otherwise the node id is missing for add_memory(). These issues require discussions on design and implementation. In the meanwhile, post_status() is working and essential to guest monitoring. Therefore instead of disabling the entire hv_balloon driver, the ballooning (when page size > 4096 bytes) and hot-add are disabled accordingly for now. Once the issues are fixed, they can be re-enable in these cases. Signed-off-by: Boqun Feng Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220325023212.1570049-3-boqun.feng@gmail.com Signed-off-by: Wei Liu drivers/hv/hv_balloon.c | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) commit b3d6dd09ff00fdcf4f7c0cb54700ffd5dd343502 Author: Boqun Feng Date: Fri Mar 25 10:32:11 2022 +0800 Drivers: hv: balloon: Support status report for larger page sizes DM_STATUS_REPORT expects the numbers of pages in the unit of 4k pages (HV_HYP_PAGE) instead of guest pages, so to make it work when guest page sizes are larger than 4k, convert the numbers of guest pages into the numbers of HV_HYP_PAGEs. Note that the numbers of guest pages are still used for tracing because tracing is internal to the guest kernel. Reported-by: Vitaly Kuznetsov Signed-off-by: Boqun Feng Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220325023212.1570049-2-boqun.feng@gmail.com Signed-off-by: Wei Liu drivers/hv/hv_balloon.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit 1448769c9cdb69ad65287f4f7ab58bc5f2f5d7ba Author: Jann Horn Date: Tue Apr 5 18:39:31 2022 +0200 random: check for signal_pending() outside of need_resched() check signal_pending() checks TIF_NOTIFY_SIGNAL and TIF_SIGPENDING, which signal that the task should bail out of the syscall when possible. This is a separate concept from need_resched(), which checks TIF_NEED_RESCHED, signaling that the task should preempt. In particular, with the current code, the signal_pending() bailout probably won't work reliably. Change this to look like other functions that read lots of data, such as read_zero(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jann Horn Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit aba120cc101788544aa3e2c30c8da88513892350 Author: Jason A. Donenfeld Date: Tue Apr 5 16:40:51 2022 +0200 random: do not allow user to keep crng key around on stack The fast key erasure RNG design relies on the key that's used to be used and then discarded. We do this, making judicious use of memzero_explicit(). However, reads to /dev/urandom and calls to getrandom() involve a copy_to_user(), and userspace can use FUSE or userfaultfd, or make a massive call, dynamically remap memory addresses as it goes, and set the process priority to idle, in order to keep a kernel stack alive indefinitely. By probing /proc/sys/kernel/random/entropy_avail to learn when the crng key is refreshed, a malicious userspace could mount this attack every 5 minutes thereafter, breaking the crng's forward secrecy. In order to fix this, we just overwrite the stack's key with the first 32 bytes of the "free" fast key erasure output. If we're returning <= 32 bytes to the user, then we can still return those bytes directly, so that short reads don't become slower. And for long reads, the difference is hopefully lost in the amortization, so it doesn't change much, with that amortization helping variously for medium reads. We don't need to do this for get_random_bytes() and the various kernel-space callers, and later, if we ever switch to always batching, this won't be necessary either, so there's no need to change the API of these functions. Cc: Theodore Ts'o Reviewed-by: Jann Horn Fixes: c92e040d575a ("random: add backtracking protection to the CRNG") Fixes: 186873c549df ("random: use simpler fast key erasure flow on per-cpu keys") Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) commit 8d90991e5bf7fdb9f264f5f579d18969913054b7 Author: Michael Walle Date: Tue Apr 5 14:02:33 2022 +0200 net: phy: mscc-miim: reject clause 45 register accesses The driver doesn't support clause 45 register access yet, but doesn't check if the access is a c45 one either. This leads to spurious register reads and writes. Add the check. Fixes: 542671fe4d86 ("net: phy: mscc-miim: Add MDIO driver") Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller drivers/net/mdio/mdio-mscc-miim.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 9386d1811f343db5fc11aba10441108a7411e8f1 Merge: fb5833d81e43 19c7a43912c6 Author: David S. Miller Date: Wed Apr 6 13:54:52 2022 +0100 Merge branch 'axienet-broken-link' Andy Chiu says: ==================== Fix broken link on Xilinx's AXI Ethernet in SGMII mode The Ethernet driver use phy-handle to reference the PCS/PMA PHY. This could be a problem if one wants to configure an external PHY via phylink, since it use the same phandle to get the PHY. To fix this, introduce a dedicated pcs-handle to point to the PCS/PMA PHY and deprecate the use of pointing it with phy-handle. A similar use case of pcs-handle can be seen on dpaa2 as well. --- patch v5 --- - Re-apply the v4 patch on the net tree. - Describe the pcs-handle DT binding at ethernet-controller level. --- patch v6 --- - Remove "preferrably" to clearify usage of pcs_handle. --- patch v7 --- - Rebase the patch on latest net/master --- patch v8 --- - Rebase the patch on net-next/master - Add "reviewed-by" tag in PATCH 3/4: dt-bindings: net: add pcs-handle attribute - Remove "fix" tag in last commit message since this is not a critical bug and will not be back ported to stable. ==================== Signed-off-by: David S. Miller commit 19c7a43912c61a3bcc09f220cd8681d35c1bec79 Author: Andy Chiu Date: Tue Apr 5 17:19:29 2022 +0800 net: axiemac: use a phandle to reference pcs_phy In some SGMII use cases where both a fixed link external PHY and the internal PCS/PMA PHY need to be configured, we should explicitly use a phandle "pcs-phy" to get the reference to the PCS/PMA PHY. Otherwise, the driver would use "phy-handle" in the DT as the reference to both the external and the internal PCS/PMA PHY. In other cases where the core is connected to a SFP cage, we could still point phy-handle to the intenal PCS/PMA PHY, and let the driver connect to the SFP module, if exist, via phylink. Signed-off-by: Andy Chiu Reviewed-by: Greentime Hu Reviewed-by: Robert Hancock Reviewed-by: Andrew Lunn Reviewed-by: Radhey Shyam Pandey Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit dc48f04fd6562de6019e9fc7ed9ed539d632babb Author: Andy Chiu Date: Tue Apr 5 17:19:28 2022 +0800 dt-bindings: net: add pcs-handle attribute Document the new pcs-handle attribute to support connecting to an external PHY. For Xilinx's AXI Ethernet, this is used when the core operates in SGMII or 1000Base-X modes and links through the internal PCS/PMA PHY. Signed-off-by: Andy Chiu Reviewed-by: Greentime Hu Reviewed-by: Rob Herring Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Documentation/devicetree/bindings/net/ethernet-controller.yaml | 6 ++++++ Documentation/devicetree/bindings/net/xilinx_axienet.txt | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) commit ab3a5d4c6081dbcfd90d19cc9849af89c6985d0f Author: Andy Chiu Date: Tue Apr 5 17:19:27 2022 +0800 net: axienet: factor out phy_node in struct axienet_local the struct member `phy_node` of struct axienet_local is not used by the driver anymore after initialization. It might be a remnent of old code and could be removed. Signed-off-by: Andy Chiu Reviewed-by: Greentime Hu Reviewed-by: Robert Hancock Reviewed-by: Radhey Shyam Pandey Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 -- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 13 +++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) commit d1c4f93e3f0a023024a6f022a61528c06cf1daa9 Author: Andy Chiu Date: Tue Apr 5 17:19:26 2022 +0800 net: axienet: setup mdio unconditionally The call to axienet_mdio_setup should not depend on whether "phy-node" pressents on the DT. Besides, since `lp->phy_node` is used if PHY is in SGMII or 100Base-X modes, move it into the if statement. And the next patch will remove `lp->phy_node` from driver's private structure and do an of_node_put on it right away after use since it is not used elsewhere. Signed-off-by: Andy Chiu Reviewed-by: Greentime Hu Reviewed-by: Robert Hancock Reviewed-by: Radhey Shyam Pandey Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit fb5833d81e4333294add35d3ac7f7f52a7bf107f Author: Taehee Yoo Date: Tue Apr 5 08:45:44 2022 +0000 net: sfc: fix using uninitialized xdp tx_queue In some cases, xdp tx_queue can get used before initialization. 1. interface up/down 2. ring buffer size change When CPU cores are lower than maximum number of channels of sfc driver, it creates new channels only for XDP. When an interface is up or ring buffer size is changed, all channels are initialized. But xdp channels are always initialized later. So, the below scenario is possible. Packets are received to rx queue of normal channels and it is acted XDP_TX and tx_queue of xdp channels get used. But these tx_queues are not initialized yet. If so, TX DMA or queue error occurs. In order to avoid this problem. 1. initializes xdp tx_queues earlier than other rx_queue in efx_start_channels(). 2. checks whether tx_queue is initialized or not in efx_xdp_tx_buffers(). Splat looks like: sfc 0000:08:00.1 enp8s0f1np1: TX queue 10 spurious TX completion id 250 sfc 0000:08:00.1 enp8s0f1np1: resetting (RECOVER_OR_ALL) sfc 0000:08:00.1 enp8s0f1np1: MC command 0x80 inlen 100 failed rc=-22 (raw=22) arg=789 sfc 0000:08:00.1 enp8s0f1np1: has been disabled Fixes: f28100cb9c96 ("sfc: fix lack of XDP TX queues - error XDP TX failed (-22)") Acked-by: Martin Habets Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller drivers/net/ethernet/sfc/efx_channels.c | 2 +- drivers/net/ethernet/sfc/tx.c | 3 +++ drivers/net/ethernet/sfc/tx_common.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) commit 1946014ca3b19be9e485e780e862c375c6f98bad Author: Eric Dumazet Date: Mon Apr 4 11:34:39 2022 -0700 rxrpc: fix a race in rxrpc_exit_net() Current code can lead to the following race: CPU0 CPU1 rxrpc_exit_net() rxrpc_peer_keepalive_worker() if (rxnet->live) rxnet->live = false; del_timer_sync(&rxnet->peer_keepalive_timer); timer_reduce(&rxnet->peer_keepalive_timer, jiffies + delay); cancel_work_sync(&rxnet->peer_keepalive_work); rxrpc_exit_net() exits while peer_keepalive_timer is still armed, leading to use-after-free. syzbot report was: ODEBUG: free active (active state 0) object type: timer_list hint: rxrpc_peer_keepalive_timeout+0x0/0xb0 WARNING: CPU: 0 PID: 3660 at lib/debugobjects.c:505 debug_print_object+0x16e/0x250 lib/debugobjects.c:505 Modules linked in: CPU: 0 PID: 3660 Comm: kworker/u4:6 Not tainted 5.17.0-syzkaller-13993-g88e6c0207623 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net RIP: 0010:debug_print_object+0x16e/0x250 lib/debugobjects.c:505 Code: ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 af 00 00 00 48 8b 14 dd 00 1c 26 8a 4c 89 ee 48 c7 c7 00 10 26 8a e8 b1 e7 28 05 <0f> 0b 83 05 15 eb c5 09 01 48 83 c4 18 5b 5d 41 5c 41 5d 41 5e c3 RSP: 0018:ffffc9000353fb00 EFLAGS: 00010082 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000000 RDX: ffff888029196140 RSI: ffffffff815efad8 RDI: fffff520006a7f52 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff815ea4ae R11: 0000000000000000 R12: ffffffff89ce23e0 R13: ffffffff8a2614e0 R14: ffffffff816628c0 R15: dffffc0000000000 FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fe1f2908924 CR3: 0000000043720000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __debug_check_no_obj_freed lib/debugobjects.c:992 [inline] debug_check_no_obj_freed+0x301/0x420 lib/debugobjects.c:1023 kfree+0xd6/0x310 mm/slab.c:3809 ops_free_list.part.0+0x119/0x370 net/core/net_namespace.c:176 ops_free_list net/core/net_namespace.c:174 [inline] cleanup_net+0x591/0xb00 net/core/net_namespace.c:598 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:298 Fixes: ace45bec6d77 ("rxrpc: Fix firewall route keepalive") Signed-off-by: Eric Dumazet Cc: David Howells Cc: Marc Dionne Cc: linux-afs@lists.infradead.org Reported-by: syzbot Signed-off-by: David S. Miller net/rxrpc/net_ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9b6d368b082e1922ae55a669769bc98fba9e4833 Author: Wan Jiabing Date: Wed Feb 23 11:51:45 2022 +0800 bus: imx-weim: fix NULL but dereferenced coccicheck error Fix following coccicheck warning: ./drivers/bus/imx-weim.c:355:18-21: ERROR: pdev is NULL but dereferenced. Signed-off-by: Wan Jiabing Acked-by: Ivan Bornyakov Signed-off-by: Shawn Guo drivers/bus/imx-weim.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 62f6424514991ce6104f6a8becfd58e986f993b6 Author: Linus Walleij Date: Wed Apr 6 14:37:20 2022 +0200 ARM: config: u8500: Re-enable AB8500 battery charging This is effectively a revert of the temporary disablement patch. Battery charging now works! We also enable static battery data for the Samsung SDI batteries as used by the U8500 Samsung phones. Cc: Lee Jones Fixes: a1149ae97554 ("ARM: ux500: Disable Power Supply and Battery Management by default") Signed-off-by: Linus Walleij arch/arm/configs/u8500_defconfig | 2 ++ 1 file changed, 2 insertions(+) commit 1f30fb9166d4f15a1aa19449b9da871fe0ed4796 Author: Ilya Maximets Date: Mon Apr 4 17:43:45 2022 +0200 net: openvswitch: fix leak of nested actions While parsing user-provided actions, openvswitch module may dynamically allocate memory and store pointers in the internal copy of the actions. So this memory has to be freed while destroying the actions. Currently there are only two such actions: ct() and set(). However, there are many actions that can hold nested lists of actions and ovs_nla_free_flow_actions() just jumps over them leaking the memory. For example, removal of the flow with the following actions will lead to a leak of the memory allocated by nf_ct_tmpl_alloc(): actions:clone(ct(commit),0) Non-freed set() action may also leak the 'dst' structure for the tunnel info including device references. Under certain conditions with a high rate of flow rotation that may cause significant memory leak problem (2MB per second in reporter's case). The problem is also hard to mitigate, because the user doesn't have direct control over the datapath flows generated by OVS. Fix that by iterating over all the nested actions and freeing everything that needs to be freed recursively. New build time assertion should protect us from this problem if new actions will be added in the future. Unfortunately, openvswitch module doesn't use NLA_F_NESTED, so all attributes has to be explicitly checked. sample() and clone() actions are mixing extra attributes into the user-provided action list. That prevents some code generalization too. Fixes: 34ae932a4036 ("openvswitch: Make tunnel set action attach a metadata dst") Link: https://mail.openvswitch.org/pipermail/ovs-dev/2022-March/392922.html Reported-by: Stéphane Graber Signed-off-by: Ilya Maximets Acked-by: Aaron Conole Signed-off-by: David S. Miller net/openvswitch/flow_netlink.c | 95 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 90 insertions(+), 5 deletions(-) commit 697a1d44af8ba0477ee729e632f4ade37999249a Author: Steve Capper Date: Wed Mar 30 12:25:43 2022 +0100 tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry tlb_remove_huge_tlb_entry only considers PMD_SIZE and PUD_SIZE when updating the mmu_gather structure. Unfortunately on arm64 there are two additional huge page sizes that need to be covered: CONT_PTE_SIZE and CONT_PMD_SIZE. Where an end-user attempts to employ contiguous huge pages, a VM_BUG_ON can be experienced due to the fact that the tlb structure hasn't been correctly updated by the relevant tlb_flush_p.._range() call from tlb_remove_huge_tlb_entry. This patch adds inequality logic to the generic implementation of tlb_remove_huge_tlb_entry s.t. CONT_PTE_SIZE and CONT_PMD_SIZE are effectively covered on arm64. Also, as well as ptes, pmds and puds; p4ds are now considered too. Reported-by: David Hildenbrand Suggested-by: Peter Zijlstra (Intel) Cc: Anshuman Khandual Cc: Catalin Marinas Cc: Will Deacon Link: https://lore.kernel.org/linux-mm/811c5c8e-b3a2-85d2-049c-717f17c3a03a@redhat.com/ Signed-off-by: Steve Capper Acked-by: David Hildenbrand Reviewed-by: Anshuman Khandual Reviewed-by: Catalin Marinas Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220330112543.863-1-steve.capper@arm.com Signed-off-by: Will Deacon include/asm-generic/tlb.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) commit 2f5d27e6cf14efe652748bad89ee529ed5a5d577 Author: Reiji Watanabe Date: Mon Mar 28 20:19:24 2022 -0700 KVM: arm64: selftests: Introduce vcpu_width_config Introduce a test for aarch64 that ensures non-mixed-width vCPUs (all 64bit vCPUs or all 32bit vcPUs) can be configured, and mixed-width vCPUs cannot be configured. Reviewed-by: Andrew Jones Signed-off-by: Reiji Watanabe Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220329031924.619453-3-reijiw@google.com tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + .../selftests/kvm/aarch64/vcpu_width_config.c | 122 +++++++++++++++++++++ 3 files changed, 124 insertions(+) commit 26bf74bd9f6ff0f1545b4f0c92a37c232d076014 Author: Reiji Watanabe Date: Mon Mar 28 20:19:23 2022 -0700 KVM: arm64: mixed-width check should be skipped for uninitialized vCPUs KVM allows userspace to configure either all EL1 32bit or 64bit vCPUs for a guest. At vCPU reset, vcpu_allowed_register_width() checks if the vcpu's register width is consistent with all other vCPUs'. Since the checking is done even against vCPUs that are not initialized (KVM_ARM_VCPU_INIT has not been done) yet, the uninitialized vCPUs are erroneously treated as 64bit vCPU, which causes the function to incorrectly detect a mixed-width VM. Introduce KVM_ARCH_FLAG_EL1_32BIT and KVM_ARCH_FLAG_REG_WIDTH_CONFIGURED bits for kvm->arch.flags. A value of the EL1_32BIT bit indicates that the guest needs to be configured with all 32bit or 64bit vCPUs, and a value of the REG_WIDTH_CONFIGURED bit indicates if a value of the EL1_32BIT bit is valid (already set up). Values in those bits are set at the first KVM_ARM_VCPU_INIT for the guest based on KVM_ARM_VCPU_EL1_32BIT configuration for the vCPU. Check vcpu's register width against those new bits at the vcpu's KVM_ARM_VCPU_INIT (instead of against other vCPUs' register width). Fixes: 66e94d5cafd4 ("KVM: arm64: Prevent mixed-width VM creation") Signed-off-by: Reiji Watanabe Reviewed-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220329031924.619453-2-reijiw@google.com arch/arm64/include/asm/kvm_emulate.h | 27 ++++++++++----- arch/arm64/include/asm/kvm_host.h | 10 ++++++ arch/arm64/kvm/reset.c | 65 +++++++++++++++++++++++++----------- 3 files changed, 74 insertions(+), 28 deletions(-) commit e69a7ff8d5deefc81bd9ce00b3ece83950a88fe6 Author: Heiko Carstens Date: Tue Jul 20 14:28:08 2021 +0200 s390: allow to compile with z16 optimizations Add config and compile options which allow to compile with z16 optimizations if the compiler supports it. Signed-off-by: Heiko Carstens arch/s390/Kconfig | 19 +++++++++++++++++++ arch/s390/Makefile | 2 ++ 2 files changed, 21 insertions(+) commit 6203ac30297847ddc5e122ccdcbe9941fbc258e6 Author: Heiko Carstens Date: Fri Jul 23 19:45:53 2021 +0200 s390: add z16 elf platform Add detection for machine types 0x3931 and 0x3932 and set ELF platform name to z16. Signed-off-by: Heiko Carstens arch/s390/kernel/processor.c | 4 ++++ 1 file changed, 4 insertions(+) commit a2c0b0fbe01419f8f5d1c0b9c581631f34ffce8b Author: Joey Gouly Date: Tue Apr 5 11:47:33 2022 +0100 arm64: alternatives: mark patch_alternative() as `noinstr` The alternatives code must be `noinstr` such that it does not patch itself, as the cache invalidation is only performed after all the alternatives have been applied. Mark patch_alternative() as `noinstr`. Mark branch_insn_requires_update() and get_alt_insn() with `__always_inline` since they are both only called through patch_alternative(). Booting a kernel in QEMU TCG with KCSAN=y and ARM64_USE_LSE_ATOMICS=y caused a boot hang: [ 0.241121] CPU: All CPU(s) started at EL2 The alternatives code was patching the atomics in __tsan_read4() from LL/SC atomics to LSE atomics. The following fragment is using LL/SC atomics in the .text section: | <__tsan_unaligned_read4+304>: ldxr x6, [x2] | <__tsan_unaligned_read4+308>: add x6, x6, x5 | <__tsan_unaligned_read4+312>: stxr w7, x6, [x2] | <__tsan_unaligned_read4+316>: cbnz w7, <__tsan_unaligned_read4+304> This LL/SC atomic sequence was to be replaced with LSE atomics. However since the alternatives code was instrumentable, __tsan_read4() was being called after only the first instruction was replaced, which led to the following code in memory: | <__tsan_unaligned_read4+304>: ldadd x5, x6, [x2] | <__tsan_unaligned_read4+308>: add x6, x6, x5 | <__tsan_unaligned_read4+312>: stxr w7, x6, [x2] | <__tsan_unaligned_read4+316>: cbnz w7, <__tsan_unaligned_read4+304> This caused an infinite loop as the `stxr` instruction never completed successfully, so `w7` was always 0. Signed-off-by: Joey Gouly Cc: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Link: https://lore.kernel.org/r/20220405104733.11476-1-joey.gouly@arm.com Signed-off-by: Will Deacon arch/arm64/kernel/alternative.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 0be0b70df6611205ac392d0e21f7e077f3230ee6 Author: Andy Shevchenko Date: Tue Apr 5 20:02:51 2022 +0300 pinctrl: alderlake: Fix register offsets for ADL-N variant It appears that almost traditionally the N variants have deviations in the register offsets in comparison to S one. This is the case for Intel Alder Lake as well. Fix register offsets for ADL-N variant. Fixes: 114b610b9048 ("pinctrl: alderlake: Add Intel Alder Lake-N pin controller support") Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg drivers/pinctrl/intel/pinctrl-alderlake.c | 60 ++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 20 deletions(-) commit c707663e81ef48d279719e97fd86acef835a2671 Author: Yu Zhe Date: Tue Mar 29 03:20:59 2022 -0700 KVM: arm64: vgic: Remove unnecessary type castings Remove unnecessary casts. Signed-off-by: Yu Zhe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220329102059.268983-1-yuzhe@nfschina.com arch/arm64/kvm/vgic/vgic-debug.c | 10 +++++----- arch/arm64/kvm/vgic/vgic-its.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) commit f587661f21eb9a38af52488bbe54ce61a64dfae8 Author: Oliver Upton Date: Fri Apr 1 19:46:52 2022 +0000 KVM: arm64: Don't split hugepages outside of MMU write lock It is possible to take a stage-2 permission fault on a page larger than PAGE_SIZE. For example, when running a guest backed by 2M HugeTLB, KVM eagerly maps at the largest possible block size. When dirty logging is enabled on a memslot, KVM does *not* eagerly split these 2M stage-2 mappings and instead clears the write bit on the pte. Since dirty logging is always performed at PAGE_SIZE granularity, KVM lazily splits these 2M block mappings down to PAGE_SIZE in the stage-2 fault handler. This operation must be done under the write lock. Since commit f783ef1c0e82 ("KVM: arm64: Add fast path to handle permission relaxation during dirty logging"), the stage-2 fault handler conditionally takes the read lock on permission faults with dirty logging enabled. To that end, it is possible to split a 2M block mapping while only holding the read lock. The problem is demonstrated by running kvm_page_table_test with 2M anonymous HugeTLB, which splats like so: WARNING: CPU: 5 PID: 15276 at arch/arm64/kvm/hyp/pgtable.c:153 stage2_map_walk_leaf+0x124/0x158 [...] Call trace: stage2_map_walk_leaf+0x124/0x158 stage2_map_walker+0x5c/0xf0 __kvm_pgtable_walk+0x100/0x1d4 __kvm_pgtable_walk+0x140/0x1d4 __kvm_pgtable_walk+0x140/0x1d4 kvm_pgtable_walk+0xa0/0xf8 kvm_pgtable_stage2_map+0x15c/0x198 user_mem_abort+0x56c/0x838 kvm_handle_guest_abort+0x1fc/0x2a4 handle_exit+0xa4/0x120 kvm_arch_vcpu_ioctl_run+0x200/0x448 kvm_vcpu_ioctl+0x588/0x664 __arm64_sys_ioctl+0x9c/0xd4 invoke_syscall+0x4c/0x144 el0_svc_common+0xc4/0x190 do_el0_svc+0x30/0x8c el0_svc+0x28/0xcc el0t_64_sync_handler+0x84/0xe4 el0t_64_sync+0x1a4/0x1a8 Fix the issue by only acquiring the read lock if the guest faulted on a PAGE_SIZE granule w/ dirty logging enabled. Add a WARN to catch locking bugs in future changes. Fixes: f783ef1c0e82 ("KVM: arm64: Add fast path to handle permission relaxation during dirty logging") Cc: Jing Zhang Signed-off-by: Oliver Upton Reviewed-by: Reiji Watanabe Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220401194652.950240-1-oupton@google.com arch/arm64/kvm/mmu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 73b725c7a6c82eee10fa2d6752babefff795ca9a Author: Oliver Upton Date: Tue Mar 22 18:35:38 2022 +0000 KVM: arm64: Drop unneeded minor version check from PSCI v1.x handler We already sanitize the guest's PSCI version when it is being written by userspace, rejecting unsupported version numbers. Additionally, the 'minor' parameter to kvm_psci_1_x_call() is a constant known at compile time for all callsites. Though it is benign, the additional check against the PSCI kvm_psci_1_x_call() is unnecessary and likely to be missed the next time KVM raises its maximum PSCI version. Drop the check altogether and rely on sanitization when the PSCI version is set by userspace. No functional change intended. Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220322183538.2757758-4-oupton@google.com arch/arm64/kvm/psci.c | 3 --- 1 file changed, 3 deletions(-) commit 827c2ab3314814e1c7d873372c0fe0cad50ba1c5 Author: Oliver Upton Date: Tue Mar 22 18:35:37 2022 +0000 KVM: arm64: Actually prevent SMC64 SYSTEM_RESET2 from AArch32 The SMCCC does not allow the SMC64 calling convention to be used from AArch32. While KVM checks to see if the calling convention is allowed in PSCI_1_0_FN_PSCI_FEATURES, it does not actually prevent calls to unadvertised PSCI v1.0+ functions. Hoist the check to see if the requested function is allowed into kvm_psci_call(), thereby preventing SMC64 calls from AArch32 for all PSCI versions. Fixes: d43583b890e7 ("KVM: arm64: Expose PSCI SYSTEM_RESET2 call to the guest") Acked-by: Will Deacon Reviewed-by: Reiji Watanabe Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220322183538.2757758-3-oupton@google.com arch/arm64/kvm/psci.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) commit 2da0aebc74dba6a09ac90b88e38860fbc65d6c0a Author: Oliver Upton Date: Tue Mar 22 18:35:36 2022 +0000 KVM: arm64: Generally disallow SMC64 for AArch32 guests The only valid calling SMC calling convention from an AArch32 state is SMC32. Disallow any PSCI function that sets the SMC64 function ID bit when called from AArch32 rather than comparing against known SMC64 PSCI functions. Note that without this change KVM advertises the SMC64 flavor of SYSTEM_RESET2 to AArch32 guests. Fixes: d43583b890e7 ("KVM: arm64: Expose PSCI SYSTEM_RESET2 call to the guest") Acked-by: Will Deacon Reviewed-by: Reiji Watanabe Reviewed-by: Andrew Jones Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220322183538.2757758-2-oupton@google.com arch/arm64/kvm/psci.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) commit 93bcdaca6eccb6761194fa8340672792e17f8f66 Author: Linus Walleij Date: Wed Apr 6 10:28:51 2022 +0200 ARM: config: u8500: Add some common hardware This activates display drivers that give console on the different U8500 mobile phones, the GNSS subsystem and the SIRF GNSS driver so we can manage the GPS chips, the regulator LEDs as used in some phones and one more IIO light sensor driver. Signed-off-by: Linus Walleij arch/arm/configs/u8500_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) commit dd8adc713b1656ce469702eba8fc1adc4db91dc4 Author: Li Yang Date: Mon Mar 7 14:41:18 2022 -0600 memory: fsl_ifc: populate child nodes of buses and mfd devices Commit 3e25f800afb8 ("memory: fsl_ifc: populate child devices without relying on simple-bus") was trying to replace the "simple-bus" compatible with explicit bus populate in the driver. But of_platform_populate() only populates child nodes of ifc without populating child buses and child mfd devices residing under ifc. Change it to of_platform_default_populate() to fix the problem. Fixes: 3e25f800afb8 ("memory: fsl_ifc: populate child devices without relying on simple-bus") Signed-off-by: Li Yang Link: https://lore.kernel.org/r/20220307204118.19093-1-leoyang.li@nxp.com Signed-off-by: Krzysztof Kozlowski drivers/memory/fsl_ifc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 55b014159ee7af63770cd7f2b6fe926f6dd99335 Author: Mario Limonciello Date: Wed Apr 6 10:57:51 2022 +0900 ata: ahci: Rename CONFIG_SATA_LPM_POLICY configuration item back CONFIG_SATA_LPM_MOBILE_POLICY was renamed to CONFIG_SATA_LPM_POLICY in commit 4dd4d3deb502 ("ata: ahci: Rename CONFIG_SATA_LPM_MOBILE_POLICY configuration item"). This can potentially cause problems as users would invisibly lose configuration policy defaults when they built the new kernel. To avoid such problems, switch back to the old name (even if it's wrong). Suggested-by: Christoph Hellwig Suggested-by: Damien Le Moal Signed-off-by: Mario Limonciello Signed-off-by: Damien Le Moal drivers/ata/Kconfig | 6 ++++-- drivers/ata/ahci.c | 2 +- drivers/ata/ahci.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) commit 11f8e7c122ce013fa745029fa8c94c6db69c2e54 Author: Andrew Lunn Date: Tue Apr 5 02:04:04 2022 +0200 net: ethernet: mv643xx: Fix over zealous checking of_get_mac_address() There is often not a MAC address available in an EEPROM accessible by Linux with Marvell devices. Instead the bootload has the MAC address and directly programs it into the hardware. So don't consider an error from of_get_mac_address() has fatal. However, the check was added for the case where there is a MAC address in an the EEPROM, but the EEPROM has not probed yet, and -EPROBE_DEFER is returned. In that case the error should be returned. So make the check specific to this error code. Cc: Mauri Sandberg Reported-by: Thomas Walther Fixes: 42404d8f1c01 ("net: mv643xx_eth: process retval from of_get_mac_address") Signed-off-by: Andrew Lunn Link: https://lore.kernel.org/r/20220405000404.3374734-1-andrew@lunn.ch Signed-off-by: Jakub Kicinski drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3f2a3050b4a3e7f32fc0ea3c9b0183090ae00522 Author: Ilya Maximets Date: Mon Apr 4 12:41:50 2022 +0200 net: openvswitch: don't send internal clone attribute to the userspace. 'OVS_CLONE_ATTR_EXEC' is an internal attribute that is used for performance optimization inside the kernel. It's added by the kernel while parsing user-provided actions and should not be sent during the flow dump as it's not part of the uAPI. The issue doesn't cause any significant problems to the ovs-vswitchd process, because reported actions are not really used in the application lifecycle and only supposed to be shown to a human via ovs-dpctl flow dump. However, the action list is still incorrect and causes the following error if the user wants to look at the datapath flows: # ovs-dpctl add-dp system@ovs-system # ovs-dpctl add-flow "" "clone(ct(commit),0)" # ovs-dpctl dump-flows , packets:0, bytes:0, used:never, actions:clone(bad length 4, expected -1 for: action0(01 00 00 00), ct(commit),0) With the fix: # ovs-dpctl dump-flows , packets:0, bytes:0, used:never, actions:clone(ct(commit),0) Additionally fixed an incorrect attribute name in the comment. Fixes: b233504033db ("openvswitch: kernel datapath clone action") Signed-off-by: Ilya Maximets Acked-by: Aaron Conole Link: https://lore.kernel.org/r/20220404104150.2865736-1-i.maximets@ovn.org Signed-off-by: Jakub Kicinski net/openvswitch/actions.c | 2 +- net/openvswitch/flow_netlink.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) commit 1d7e4fd72bb9be080c23a099b0dff1007109fc2b Author: Horatiu Vultur Date: Tue Apr 5 08:59:36 2022 +0200 net: micrel: Fix KS8851 Kconfig KS8851 selects MICREL_PHY, which depends on PTP_1588_CLOCK_OPTIONAL, so make KS8851 also depend on PTP_1588_CLOCK_OPTIONAL. Fixes kconfig warning and build errors: WARNING: unmet direct dependencies detected for MICREL_PHY Depends on [m]: NETDEVICES [=y] && PHYLIB [=y] && PTP_1588_CLOCK_OPTIONAL [=m] Selected by [y]: - KS8851 [=y] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_MICREL [=y] && SPI [=y] ld.lld: error: undefined symbol: ptp_clock_register referenced by micrel.c net/phy/micrel.o:(lan8814_probe) in archive drivers/built-in.a ld.lld: error: undefined symbol: ptp_clock_index referenced by micrel.c net/phy/micrel.o:(lan8814_ts_info) in archive drivers/built-in.a Reported-by: kernel test robot Fixes: ece19502834d ("net: phy: micrel: 1588 support for LAN8814 phy") Signed-off-by: Horatiu Vultur Tested-by: Randy Dunlap Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220405065936.4105272-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/micrel/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 62c31868f528e8657947694913f1e76db816425b Author: Laurent Pinchart Date: Thu Mar 31 14:31:51 2022 +0200 media: platform: imx-mipi-csis: Add dependency on VIDEO_DEV The imx-mipi-csis driver (VIDEO_IMX_MIPI_CSIS) lost its dependency on VIDEO_DEV in commit 63fe3d27b226 ("media: platform/*/Kconfig: make manufacturer menus more uniform"). This causes build failures with configurations that don't have VIDEO_DEV set. Fix it by restoring the dependency. Link: https://lore.kernel.org/linux-media/20220331123151.1953-1-laurent.pinchart@ideasonboard.com Fixes: 63fe3d27b226 ("media: platform/*/Kconfig: make manufacturer menus more uniform") Reported-by: kernel test robot Signed-off-by: Laurent Pinchart Signed-off-by: Randy Dunlap Reported-by: kernel test robot Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/nxp/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 82e32bc31e794f13cc028e8c709c4a217ff410ff Author: Linus Walleij Date: Wed Apr 6 00:55:40 2022 +0200 ARM: config: Refresh U8500 defconfig This just updates the U8500 defconfig to reflect what has happened in the Kconfig: DRM_PANEL_SONY_ACX424AKP is now handled by DRM_PANEL_NOVATEK_NT35560, all ST sensors have SPI version drivers that we don't use, and some debug options moved around. Signed-off-by: Linus Walleij arch/arm/configs/u8500_defconfig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit acee08aaf6d158d03668dc82b0a0eef41100531b Author: Dennis Zhou Date: Thu Mar 31 14:58:28 2022 -0700 btrfs: fix btrfs_submit_compressed_write cgroup attribution This restores the logic from commit 46bcff2bfc5e ("btrfs: fix compressed write bio blkcg attribution") which added cgroup attribution to btrfs writeback. It also adds back the REQ_CGROUP_PUNT flag for these ios. Fixes: 91507240482e ("btrfs: determine stripe boundary at bio allocation time in btrfs_submit_compressed_write") CC: stable@vger.kernel.org # 5.16+ Signed-off-by: Dennis Zhou Signed-off-by: David Sterba fs/btrfs/compression.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 168a2f776b9762f4021421008512dd7ab7474df1 Author: Jia-Ju Bai Date: Thu Mar 24 06:44:54 2022 -0700 btrfs: fix root ref counts in error handling in btrfs_get_root_ref In btrfs_get_root_ref(), when btrfs_insert_fs_root() fails, btrfs_put_root() can happen for two reasons: - the root already exists in the tree, in that case it returns the reference obtained in btrfs_lookup_fs_root() - another error so the cleanup is done in the fail label Calling btrfs_put_root() unconditionally would lead to double decrement of the root reference possibly freeing it in the second case. Reported-by: TOTE Robot Fixes: bc44d7c4b2b1 ("btrfs: push btrfs_grab_fs_root into btrfs_get_fs_root") CC: stable@vger.kernel.org # 5.10+ Signed-off-by: Jia-Ju Bai Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/disk-io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 760e69c4c2e2f475a812bdd414b62758215ce9cb Author: Naohiro Aota Date: Tue Mar 22 18:11:34 2022 +0900 btrfs: zoned: activate block group only for extent allocation In btrfs_make_block_group(), we activate the allocated block group, expecting that the block group is soon used for allocation. However, the chunk allocation from flush_space() context broke the assumption. There can be a large time gap between the chunk allocation time and the extent allocation time from the chunk. Activating the empty block groups pre-allocated from flush_space() context can exhaust the active zone counter of a device. Once we use all the active zone counts for empty pre-allocated block groups, we cannot activate new block group for the other things: metadata, tree-log, or data relocation block group. That failure results in a fake -ENOSPC. This patch introduces CHUNK_ALLOC_FORCE_FOR_EXTENT to distinguish the chunk allocation from find_free_extent(). Now, the new block group is activated only in that context. Fixes: eb66a010d518 ("btrfs: zoned: activate new block group") CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Johannes Thumshirn Tested-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba fs/btrfs/block-group.c | 24 ++++++++++++++++-------- fs/btrfs/block-group.h | 4 ++++ fs/btrfs/extent-tree.c | 2 +- 3 files changed, 21 insertions(+), 9 deletions(-) commit 820c363bd526ec8e133e4b84e6ad1fda12023b4b Author: Naohiro Aota Date: Tue Mar 22 18:11:33 2022 +0900 btrfs: return allocated block group from do_chunk_alloc() Return the allocated block group from do_chunk_alloc(). This is a preparation patch for the next patch. CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Johannes Thumshirn Tested-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Signed-off-by: David Sterba fs/btrfs/block-group.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) commit a690e5f2db4d1dca742ce734aaff9f3112d63764 Author: Naohiro Aota Date: Tue Mar 29 15:55:58 2022 +0900 btrfs: mark resumed async balance as writing When btrfs balance is interrupted with umount, the background balance resumes on the next mount. There is a potential deadlock with FS freezing here like as described in commit 26559780b953 ("btrfs: zoned: mark relocation as writing"). Mark the process as sb_writing to avoid it. Reviewed-by: Filipe Manana CC: stable@vger.kernel.org # 4.9+ Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/volumes.c | 2 ++ 1 file changed, 2 insertions(+) commit d03ae0d3b687223de24d3dd1a7bca96034aeca25 Author: Nikolay Borisov Date: Wed Mar 30 12:14:05 2022 +0300 btrfs: remove support of balance v1 ioctl It was scheduled for removal in kernel v5.18 commit 6c405b24097c ("btrfs: deprecate BTRFS_IOC_BALANCE ioctl") thus its time has come. Reviewed-by: Sweet Tea Dorminy Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/ioctl.c | 2 -- 1 file changed, 2 deletions(-) commit 6d82ad13c4110e73c7b0392f00534a1502a1b520 Author: Naohiro Aota Date: Mon Mar 28 21:32:05 2022 +0900 btrfs: release correct delalloc amount in direct IO write path Running generic/406 causes the following WARNING in btrfs_destroy_inode() which tells there are outstanding extents left. In btrfs_get_blocks_direct_write(), we reserve a temporary outstanding extents with btrfs_delalloc_reserve_metadata() (or indirectly from btrfs_delalloc_reserve_space(()). We then release the outstanding extents with btrfs_delalloc_release_extents(). However, the "len" can be modified in the COW case, which releases fewer outstanding extents than expected. Fix it by calling btrfs_delalloc_release_extents() for the original length. To reproduce the warning, the filesystem should be 1 GiB. It's triggering a short-write, due to not being able to allocate a large extent and instead allocating a smaller one. WARNING: CPU: 0 PID: 757 at fs/btrfs/inode.c:8848 btrfs_destroy_inode+0x1e6/0x210 [btrfs] Modules linked in: btrfs blake2b_generic xor lzo_compress lzo_decompress raid6_pq zstd zstd_decompress zstd_compress xxhash zram zsmalloc CPU: 0 PID: 757 Comm: umount Not tainted 5.17.0-rc8+ #101 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS d55cb5a 04/01/2014 RIP: 0010:btrfs_destroy_inode+0x1e6/0x210 [btrfs] RSP: 0018:ffffc9000327bda8 EFLAGS: 00010206 RAX: 0000000000000000 RBX: ffff888100548b78 RCX: 0000000000000000 RDX: 0000000000026900 RSI: 0000000000000000 RDI: ffff888100548b78 RBP: ffff888100548940 R08: 0000000000000000 R09: ffff88810b48aba8 R10: 0000000000000001 R11: ffff8881004eb240 R12: ffff88810b48a800 R13: ffff88810b48ec08 R14: ffff88810b48ed00 R15: ffff888100490c68 FS: 00007f8549ea0b80(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f854a09e733 CR3: 000000010a2e9003 CR4: 0000000000370eb0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: destroy_inode+0x33/0x70 dispose_list+0x43/0x60 evict_inodes+0x161/0x1b0 generic_shutdown_super+0x2d/0x110 kill_anon_super+0xf/0x20 btrfs_kill_super+0xd/0x20 [btrfs] deactivate_locked_super+0x27/0x90 cleanup_mnt+0x12c/0x180 task_work_run+0x54/0x80 exit_to_user_mode_prepare+0x152/0x160 syscall_exit_to_user_mode+0x12/0x30 do_syscall_64+0x42/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f854a000fb7 Fixes: f0bfa76a11e9 ("btrfs: fix ENOSPC failure when attempting direct IO write into NOCOW range") CC: stable@vger.kernel.org # 5.17 Reviewed-by: Johannes Thumshirn Tested-by: Johannes Thumshirn Reviewed-by: Filipe Manana Signed-off-by: Naohiro Aota Signed-off-by: David Sterba fs/btrfs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 6d4a6b515c39f1f8763093e0f828959b2fbc2f45 Author: Nathan Chancellor Date: Thu Mar 24 08:36:45 2022 -0700 btrfs: remove unused variable in btrfs_{start,write}_dirty_block_groups() Clang's version of -Wunused-but-set-variable recently gained support for unary operations, which reveals two unused variables: fs/btrfs/block-group.c:2949:6: error: variable 'num_started' set but not used [-Werror,-Wunused-but-set-variable] int num_started = 0; ^ fs/btrfs/block-group.c:3116:6: error: variable 'num_started' set but not used [-Werror,-Wunused-but-set-variable] int num_started = 0; ^ 2 errors generated. These variables appear to be unused from their introduction, so just remove them to silence the warnings. Fixes: c9dc4c657850 ("Btrfs: two stage dirty block group writeout") Fixes: 1bbc621ef284 ("Btrfs: allow block group cache writeout outside critical section in commit") CC: stable@vger.kernel.org # 5.4+ Link: https://github.com/ClangBuiltLinux/linux/issues/1614 Signed-off-by: Nathan Chancellor Signed-off-by: David Sterba fs/btrfs/block-group.c | 4 ---- 1 file changed, 4 deletions(-) commit 9435be734ae9de020072bd4443d46e02d92564d1 Author: Haowen Bai Date: Wed Mar 23 09:45:58 2022 +0800 btrfs: zoned: remove redundant condition in btrfs_run_delalloc_range The logic !A || A && B is equivalent to !A || B. so we can make code clear. Note: though it's preferred to be in the more human readable form, there have been repeated reports and patches as the expression is detected by tools so apply it to reduce the load. Reviewed-by: Johannes Thumshirn Signed-off-by: Haowen Bai Reviewed-by: David Sterba [ add note ] Signed-off-by: David Sterba fs/btrfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 03eb7daec59f9b273d87141a5e8c4bea24fb3358 Merge: 1158f79f82d4 42193ffd79bd Author: Jakub Kicinski Date: Tue Apr 5 13:04:03 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Incorrect comparison in bitmask .reduce, from Jeremy Sowden. 2) Missing GFP_KERNEL_ACCOUNT for dynamically allocated objects, from Vasily Averin. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: memcg accounting for dynamically allocated objects netfilter: bitwise: fix reduce comparisons ==================== Link: https://lore.kernel.org/r/20220405100923.7231-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit fc35880d198d9f2023bf231c120e1a69ad4db841 Author: Heiner Kallweit Date: Wed Mar 9 21:23:06 2022 +0100 ASoC: meson: aiu: fix duplicate debugfs directory error On a S905W-based system I get the following error: debugfs: Directory 'c1105400.audio-controller' with parent 'P230-Q200' already present! Turned out that multiple components having the same name triggers this error in soc_init_component_debugfs(). With the patch the error is gone and that's the debugfs entries. /sys/kernel/debug/asoc/P230-Q200/acodec:c1105400.audio-controller /sys/kernel/debug/asoc/P230-Q200/hdmi:c1105400.audio-controller /sys/kernel/debug/asoc/P230-Q200/cpu:c1105400.audio-controller Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/38053baf-c33b-7fdf-7593-99b22153a9c0@gmail.com Signed-off-by: Mark Brown sound/soc/meson/aiu-acodec-ctrl.c | 3 +++ sound/soc/meson/aiu-codec-ctrl.c | 3 +++ sound/soc/meson/aiu.c | 3 +++ 3 files changed, 9 insertions(+) commit d462f6ed2aeac30c0b440a91fb05d964956935f9 Author: Heiner Kallweit Date: Wed Mar 9 21:21:55 2022 +0100 ASoC: soc-core: add debugfs_prefix member to snd_soc_component_driver Allow the component debugfs_prefix to be set from snd_soc_component_driver. First use case is avoiding a duplicate debugfs entry error in case a device has multiple components which have the same name therefore. Note that we don't set component->debugfs_prefix if it's set already. That's needed because partially component->debugfs_prefix is set before calling snd_soc_component_initialize(). Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/d18bff6a-1df1-5f95-0cf8-10dbaa62d7be@gmail.com Signed-off-by: Mark Brown include/sound/soc-component.h | 4 ++++ sound/soc/soc-core.c | 5 +++++ 2 files changed, 9 insertions(+) commit ac2a3feefad549814f5e7cca30be07a255c8494a Author: Rafael J. Wysocki Date: Tue Apr 5 19:49:26 2022 +0200 ACPI: bus: Eliminate acpi_bus_get_device() Replace the last instance of acpi_bus_get_device(), added recently by commit 87e59b36e5e2 ("spi: Support selection of the index of the ACPI Spi Resource before alloc"), with acpi_fetch_acpi_dev() and finally drop acpi_bus_get_device() that has no more users. Signed-off-by: Rafael J. Wysocki Acked-by: Mark Brown drivers/acpi/scan.c | 13 ------------- drivers/spi/spi.c | 3 ++- include/acpi/acpi_bus.h | 1 - 3 files changed, 2 insertions(+), 15 deletions(-) commit 3e732ebf7316ac83e8562db7e64cc68aec390a18 Merge: e2a1256b17b1 1c80cf031e02 Author: Linus Torvalds Date: Tue Apr 5 10:40:52 2022 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "Fixes and cleanups: - A couple of mlx5 fixes related to cvq - A couple of reverts dropping useless code (code that used it got reverted earlier)" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vdpa: mlx5: synchronize driver status with CVQ vdpa: mlx5: prevent cvq work from hogging CPU Revert "virtio_config: introduce a new .enable_cbs method" Revert "virtio: use virtio_device_ready() in virtio_device_restore()" commit e2a1256b17b16f9b9adf1b6fea56819e7b68e463 Author: Pawan Gupta Date: Mon Apr 4 17:35:45 2022 -0700 x86/speculation: Restore speculation related MSRs during S3 resume After resuming from suspend-to-RAM, the MSRs that control CPU's speculative execution behavior are not being restored on the boot CPU. These MSRs are used to mitigate speculative execution vulnerabilities. Not restoring them correctly may leave the CPU vulnerable. Secondary CPU's MSRs are correctly being restored at S3 resume by identify_secondary_cpu(). During S3 resume, restore these MSRs for boot CPU when restoring its processor state. Fixes: 772439717dbf ("x86/bugs/intel: Set proper CPU features and setup RDS") Reported-by: Neelima Krishnan Signed-off-by: Pawan Gupta Tested-by: Neelima Krishnan Acked-by: Borislav Petkov Reviewed-by: Dave Hansen Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds arch/x86/power/cpu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit 73924ec4d560257004d5b5116b22a3647661e364 Author: Pawan Gupta Date: Mon Apr 4 17:34:19 2022 -0700 x86/pm: Save the MSR validity status at context setup The mechanism to save/restore MSRs during S3 suspend/resume checks for the MSR validity during suspend, and only restores the MSR if its a valid MSR. This is not optimal, as an invalid MSR will unnecessarily throw an exception for every suspend cycle. The more invalid MSRs, higher the impact will be. Check and save the MSR validity at setup. This ensures that only valid MSRs that are guaranteed to not throw an exception will be attempted during suspend. Fixes: 7a9c2dd08ead ("x86/pm: Introduce quirk framework to save/restore extra MSR registers around suspend/resume") Suggested-by: Dave Hansen Signed-off-by: Pawan Gupta Reviewed-by: Dave Hansen Acked-by: Borislav Petkov Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds arch/x86/power/cpu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 1ef8715975de8bd481abbd0839ed4f49d9e5b0ff Author: Borislav Petkov Date: Tue Apr 5 17:15:08 2022 +0200 ALSA: usb-audio: Fix undefined behavior due to shift overflowing the constant Fix: sound/usb/midi.c: In function ‘snd_usbmidi_out_endpoint_create’: sound/usb/midi.c:1389:2: error: case label does not reduce to an integer constant case USB_ID(0xfc08, 0x0101): /* Unknown vendor Cable */ ^~~~ See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory details as to why it triggers with older gccs only. [ A slight correction with parentheses around the argument by tiwai ] Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220405151517.29753-3-bp@alien8.de Signed-off-by: Takashi Iwai sound/usb/usbaudio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c9db8a30d9f091aa571b5fb7c3f434cde107b02c Author: Kai Vehmanen Date: Tue Apr 5 15:36:22 2022 +0300 ALSA: hda/i915 - skip acomp init if no matching display In systems with only a discrete i915 GPU, the acomp init will always timeout for the PCH HDA controller instance. Avoid the timeout by checking the PCI device hierarchy whether any display class PCI device can be found on the system, and at the same level as the HDA PCI device. If found, proceed with the acomp init, which will wait until i915 probe is complete and component binding can proceed. If no matching display device is found, the audio component bind can be safely skipped. The bind timeout will still be hit if the display is present in the system, but i915 driver does not bind to it by configuration choice or probe error. In this case the 60sec timeout will be hit. Signed-off-by: Kai Vehmanen Acked-by: Lucas De Marchi Link: https://lore.kernel.org/r/20220405123622.2874457-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai sound/hda/hdac_i915.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) commit e19778e6c911691856447c3bf9617f00b3e1347f Author: Maciej Fijalkowski Date: Thu Mar 17 19:36:29 2022 +0100 ice: clear cmd_type_offset_bsz for TX rings Currently when XDP rings are created, each descriptor gets its DD bit set, which turns out to be the wrong approach as it can lead to a situation where more descriptors get cleaned than it was supposed to, e.g. when AF_XDP busy poll is run with a large batch size. In this situation, the driver would request for more buffers than it is able to handle. Fix this by not setting the DD bits in ice_xdp_alloc_setup_rings(). They should be initialized to zero instead. Fixes: 9610bd988df9 ("ice: optimize XDP_TX workloads") Signed-off-by: Maciej Fijalkowski Tested-by: Shwetha Nagaraju Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 72b915a2b444e9247c9d424a840e94263db07c27 Author: Maciej Fijalkowski Date: Thu Mar 17 19:36:28 2022 +0100 ice: xsk: fix VSI state check in ice_xsk_wakeup() ICE_DOWN is dedicated for pf->state. Check for ICE_VSI_DOWN being set on vsi->state in ice_xsk_wakeup(). Fixes: 2d4238f55697 ("ice: Add support for AF_XDP") Signed-off-by: Maciej Fijalkowski Tested-by: Shwetha Nagaraju Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f9124c68f05ffdb87a47e3ea6d5fae9dad7cb6eb Author: Maciej Fijalkowski Date: Thu Mar 17 19:36:27 2022 +0100 ice: synchronize_rcu() when terminating rings Unfortunately, the ice driver doesn't respect the RCU critical section that XSK wakeup is surrounded with. To fix this, add synchronize_rcu() calls to paths that destroy resources that might be in use. This was addressed in other AF_XDP ZC enabled drivers, for reference see for example commit b3873a5be757 ("net/i40e: Fix concurrency issues between config flow and XSK") Fixes: efc2214b6047 ("ice: Add support for XDP") Fixes: 2d4238f55697 ("ice: Add support for AF_XDP") Signed-off-by: Maciej Fijalkowski Tested-by: Shwetha Nagaraju Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice.h | 2 +- drivers/net/ethernet/intel/ice/ice_main.c | 4 +++- drivers/net/ethernet/intel/ice/ice_xsk.c | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) commit ce4c854ee8681bc66c1c369518b6594e93b11ee5 Merge: 312310928417 60021bd754c6 Author: Linus Torvalds Date: Tue Apr 5 08:59:37 2022 -0700 Merge tag 'for-5.18-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - prevent deleting subvolume with active swapfile - fix qgroup reserve limit calculation overflow - remove device count in superblock and its item in one transaction so they cant't get out of sync - skip defragmenting an isolated sector, this could cause some extra IO - unify handling of mtime/permissions in hole punch with fallocate - zoned mode fixes: - remove assert checking for only single mode, we have the DUP mode implemented - fix potential lockdep warning while traversing devices when checking for zone activation * tag 'for-5.18-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: prevent subvol with swapfile from being deleted btrfs: do not warn for free space inode in cow_file_range btrfs: avoid defragging extents whose next extents are not targets btrfs: fix fallocate to use file_modified to update permissions consistently btrfs: remove device item and update super block in the same transaction btrfs: fix qgroup reserve overflow the qgroup limit btrfs: zoned: remove left over ASSERT checking for single profile btrfs: zoned: traverse devices under chunk_mutex in btrfs_can_activate_zone commit 544808f7e21cb9ccdb8f3aa7de594c05b1419061 Author: Andre Przywara Date: Mon Apr 4 12:08:42 2022 +0100 irqchip/gic, gic-v3: Prevent GSI to SGI translations At the moment the GIC IRQ domain translation routine happily converts ACPI table GSI numbers below 16 to GIC SGIs (Software Generated Interrupts aka IPIs). On the Devicetree side we explicitly forbid this translation, actually the function will never return HWIRQs below 16 when using a DT based domain translation. We expect SGIs to be handled in the first part of the function, and any further occurrence should be treated as a firmware bug, so add a check and print to report this explicitly and avoid lengthy debug sessions. Fixes: 64b499d8df40 ("irqchip/gic-v3: Configure SGIs as standard interrupts") Signed-off-by: Andre Przywara Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220404110842.2882446-1-andre.przywara@arm.com drivers/irqchip/irq-gic-v3.c | 6 ++++++ drivers/irqchip/irq-gic.c | 6 ++++++ 2 files changed, 12 insertions(+) commit 0df6664531a12cdd8fc873f0cac0dcb40243d3e9 Author: Marc Zyngier Date: Tue Mar 15 16:50:32 2022 +0000 irqchip/gic-v3: Fix GICR_CTLR.RWP polling It turns out that our polling of RWP is totally wrong when checking for it in the redistributors, as we test the *distributor* bit index, whereas it is a different bit number in the RDs... Oopsie boo. This is embarassing. Not only because it is wrong, but also because it took *8 years* to notice the blunder... Just fix the damn thing. Fixes: 021f653791ad ("irqchip: gic-v3: Initial support for GICv3") Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Reviewed-by: Andre Przywara Reviewed-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20220315165034.794482-2-maz@kernel.org drivers/irqchip/irq-gic-v3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit af27e41612ec7e5b4783f589b753a7c31a37aac8 Author: Marc Zyngier Date: Thu Mar 17 09:49:02 2022 +0000 irqchip/gic-v4: Wait for GICR_VPENDBASER.Dirty to clear before descheduling The way KVM drives GICv4.{0,1} is as follows: - vcpu_load() makes the VPE resident, instructing the RD to start scanning for interrupts - just before entering the guest, we check that the RD has finished scanning and that we can start running the vcpu - on preemption, we deschedule the VPE by making it invalid on the RD However, we are preemptible between the first two steps. If it so happens *and* that the RD was still scanning, we nonetheless write to the GICR_VPENDBASER register while Dirty is set, and bad things happen (we're in UNPRED land). This affects both the 4.0 and 4.1 implementations. Make sure Dirty is cleared before performing the deschedule, meaning that its_clear_vpend_valid() becomes a sort of full VPE residency barrier. Reported-by: Jingyi Wang Tested-by: Nianyao Tang Signed-off-by: Marc Zyngier Fixes: 57e3cebd022f ("KVM: arm64: Delay the polling of the GICR_VPENDBASER.Dirty bit") Link: https://lore.kernel.org/r/4aae10ba-b39a-5f84-754b-69c2eb0a2c03@huawei.com drivers/irqchip/irq-gic-v3-its.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) commit 76ff614a79152cee07a2c48080c3dc91c56f0f1d Author: Yang Yingliang Date: Wed Mar 16 10:51:00 2022 +0800 irqchip/irq-qcom-mpm: fix return value check in qcom_mpm_init() If devm_platform_ioremap_resource() fails, it never returns NULL, replace NULL check with IS_ERR(). Fixes: a6199bb514d8 ("irqchip: Add Qualcomm MPM controller driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Acked-by: Shawn Guo Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220316025100.1758413-1-yangyingliang@huawei.com drivers/irqchip/irq-qcom-mpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fa4dcc880390fbedf4118e9f88a6b13363e0a7a1 Author: YueHaibing Date: Thu Mar 17 21:19:56 2022 +0800 irq/qcom-mpm: Fix build error without MAILBOX If MAILBOX is n, building fails: drivers/irqchip/irq-qcom-mpm.o: In function `mpm_pd_power_off': irq-qcom-mpm.c:(.text+0x174): undefined reference to `mbox_send_message' irq-qcom-mpm.c:(.text+0x174): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `mbox_send_message' Make QCOM_MPM depends on MAILBOX to fix this. Fixes: a6199bb514d8 ("irqchip: Add Qualcomm MPM controller driver") Signed-off-by: YueHaibing Acked-by: Shawn Guo Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220317131956.30004-1-yuehaibing@huawei.com drivers/irqchip/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 6150f276073a1480030242a7e006a89e161d6cd6 Author: Kyle Copperfield Date: Sat Nov 20 13:23:02 2021 +0100 media: rockchip/rga: do proper error checking in probe The latest fix for probe error handling contained a typo that causes probing to fail with the following message: rockchip-rga: probe of ff680000.rga failed with error -12 This patch fixes the typo. Fixes: e58430e1d4fd (media: rockchip/rga: fix error handling in probe) Reviewed-by: Dragan Simic Signed-off-by: Kyle Copperfield Reviewed-by: Kieran Bingham Reviewed-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/rockchip/rga/rga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 48bff1053c172e6c7f340e506027d118147c8b7f Author: Jason A. Donenfeld Date: Tue Apr 5 15:57:05 2022 +0200 random: opportunistically initialize on /dev/urandom reads In 6f98a4bfee72 ("random: block in /dev/urandom"), we tried to make a successful try_to_generate_entropy() call *required* if the RNG was not already initialized. Unfortunately, weird architectures and old userspaces combined in TCG test harnesses, making that change still not realistic, so it was reverted in 0313bc278dac ("Revert "random: block in /dev/urandom""). However, rather than making a successful try_to_generate_entropy() call *required*, we can instead make it *best-effort*. If try_to_generate_entropy() fails, it fails, and nothing changes from the current behavior. If it succeeds, then /dev/urandom becomes safe to use for free. This way, we don't risk the regression potential that led to us reverting the required-try_to_generate_entropy() call before. Practically speaking, this means that at least on x86, /dev/urandom becomes safe. Probably other architectures with working cycle counters will also become safe. And architectures with slow or broken cycle counters at least won't be affected at all by this change. So it may not be the glorious "all things are unified!" change we were hoping for initially, but practically speaking, it makes a positive impact. Cc: Theodore Ts'o Cc: Dominik Brodowski Cc: Linus Torvalds Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 7 +++++++ 1 file changed, 7 insertions(+) commit cdb4f26a63c391317e335e6e683a614358e70aeb Author: Greg Kroah-Hartman Date: Thu Jan 6 14:31:51 2022 +0100 kobject: kobj_type: remove default_attrs Now that all in-kernel users of default_attrs for the kobj_type are gone and converted to properly use the default_groups pointer instead, it can be safely removed. There is one standard way to create sysfs files in a kobj_type, and not two like before, causing confusion as to which should be used. Cc: "Rafael J. Wysocki" Link: https://lore.kernel.org/r/20220106133151.607703-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman fs/sysfs/file.c | 13 ------------- include/linux/kobject.h | 1 - lib/kobject.c | 32 -------------------------------- 3 files changed, 46 deletions(-) commit c31bc0461f861ec68e026b5d4d27394bcb722068 Author: Greg Kroah-Hartman Date: Tue Mar 29 16:25:52 2022 +0200 powerpc/pseries/vas: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the pseries vas sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Haren Myneni Cc: Nicholas Piggin Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Link: https://lore.kernel.org/r/20220329142552.558339-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman arch/powerpc/platforms/pseries/vas-sysfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit c1be1ef1b4a7589878d63673b7b322856989064e Author: Bagas Sanjaya Date: Sun Apr 3 13:57:36 2022 +0700 Documentation: kvm: Add missing line break in api.rst Add missing line break separator between literal block and description of KVM_EXIT_RISCV_SBI. This fixes: /Documentation/virt/kvm/api.rst:6118: WARNING: Literal block ends without a blank line; unexpected unindent. Fixes: da40d85805937d (RISC-V: KVM: Document RISC-V specific parts of KVM API, 2021-09-27) Cc: Anup Patel Cc: Paolo Bonzini Cc: Jonathan Corbet Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-riscv@lists.infradead.org Signed-off-by: Bagas Sanjaya Message-Id: <20220403065735.23859-1-bagasdotme@gmail.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/api.rst | 1 + 1 file changed, 1 insertion(+) commit 3203a56a0f0eaaf4ea7fc01467378c4bce3841ff Author: Lv Ruyi Date: Fri Apr 1 08:35:30 2022 +0000 KVM: x86/mmu: remove unnecessary flush_workqueue() All work currently pending will be done first by calling destroy_workqueue, so there is unnecessary to flush it explicitly. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Reviewed-by: Sean Christopherson Message-Id: <20220401083530.2407703-1-lv.ruyi@zte.com.cn> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1d0e84806047f38027d7572adb4702ef7c09b317 Author: Sean Christopherson Date: Thu Mar 31 22:13:59 2022 +0000 KVM: x86/mmu: Resolve nx_huge_pages when kvm.ko is loaded Resolve nx_huge_pages to true/false when kvm.ko is loaded, leaving it as -1 is technically undefined behavior when its value is read out by param_get_bool(), as boolean values are supposed to be '0' or '1'. Alternatively, KVM could define a custom getter for the param, but the auto value doesn't depend on the vendor module in any way, and printing "auto" would be unnecessarily unfriendly to the user. In addition to fixing the undefined behavior, resolving the auto value also fixes the scenario where the auto value resolves to N and no vendor module is loaded. Previously, -1 would result in Y being printed even though KVM would ultimately disable the mitigation. Rename the existing MMU module init/exit helpers to clarify that they're invoked with respect to the vendor module, and add comments to document why KVM has two separate "module init" flows. ========================================================================= UBSAN: invalid-load in kernel/params.c:320:33 load of value 255 is not a valid value for type '_Bool' CPU: 6 PID: 892 Comm: tail Not tainted 5.17.0-rc3+ #799 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Call Trace: dump_stack_lvl+0x34/0x44 ubsan_epilogue+0x5/0x40 __ubsan_handle_load_invalid_value.cold+0x43/0x48 param_get_bool.cold+0xf/0x14 param_attr_show+0x55/0x80 module_attr_show+0x1c/0x30 sysfs_kf_seq_show+0x93/0xc0 seq_read_iter+0x11c/0x450 new_sync_read+0x11b/0x1a0 vfs_read+0xf0/0x190 ksys_read+0x5f/0xe0 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae ========================================================================= Fixes: b8e8c8303ff2 ("kvm: mmu: ITLB_MULTIHIT mitigation") Cc: stable@vger.kernel.org Reported-by: Bruno Goncalves Reported-by: Jan Stancek Signed-off-by: Sean Christopherson Message-Id: <20220331221359.3912754-1-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm_host.h | 5 +++-- arch/x86/kvm/mmu/mmu.c | 20 ++++++++++++++++---- arch/x86/kvm/x86.c | 20 ++++++++++++++++++-- 3 files changed, 37 insertions(+), 8 deletions(-) commit 00c22013467069197dc006c943ca1f0395ca8aaa Author: Peter Gonda Date: Wed Mar 30 09:43:06 2022 -0700 KVM: SEV: Add cond_resched() to loop in sev_clflush_pages() Add resched to avoid warning from sev_clflush_pages() with large number of pages. Signed-off-by: Peter Gonda Cc: Sean Christopherson Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Message-Id: <20220330164306.2376085-1-pgonda@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/sev.c | 1 + 1 file changed, 1 insertion(+) commit 1158f79f82d437093aeed87d57df0548bdd68146 Author: David Ahern Date: Mon Apr 4 09:09:08 2022 -0600 ipv6: Fix stats accounting in ip6_pkt_drop VRF devices are the loopbacks for VRFs, and a loopback can not be assigned to a VRF. Accordingly, the condition in ip6_pkt_drop should be '||' not '&&'. Fixes: 1d3fd8a10bed ("vrf: Use orig netdev to count Ip6InNoRoutes and a fresh route lookup when sending dest unreach") Reported-by: Pudak, Filip Reported-by: Xiao, Jiguang Signed-off-by: David Ahern Link: https://lore.kernel.org/r/20220404150908.2937-1-dsahern@kernel.org Signed-off-by: Paolo Abeni net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 61fb3eee13e8a79245059924e69fe3430f3f3b19 Merge: 2b04bd4f03bb 05ef6813b234 Author: Paolo Abeni Date: Tue Apr 5 12:50:28 2022 +0200 Merge branch 'ice-bug-fixes' Tony Nguyen says: ==================== ice bug fixes Alice Michael says: There were a couple of bugs that have been found and fixed by Anatolii in the ice driver. First he fixed a bug on ring creation by setting the default value for the teid. Anatolli also fixed a bug with deleting queues in ice_vc_dis_qs_msg based on their enablement. --- v2: Remove empty lines between tags The following are changes since commit 458f5d92df4807e2a7c803ed928369129996bf96: sfc: Do not free an empty page_ring and are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE ==================== Link: https://lore.kernel.org/r/20220404183548.3422851-1-anthony.l.nguyen@intel.com Signed-off-by: Paolo Abeni commit 05ef6813b234db3196f083b91db3963f040b65bb Author: Anatolii Gerasymenko Date: Mon Apr 4 11:35:48 2022 -0700 ice: Do not skip not enabled queues in ice_vc_dis_qs_msg Disable check for queue being enabled in ice_vc_dis_qs_msg, because there could be a case when queues were created, but were not enabled. We still need to delete those queues. Normal workflow for VF looks like: Enable path: VIRTCHNL_OP_ADD_ETH_ADDR (opcode 10) VIRTCHNL_OP_CONFIG_VSI_QUEUES (opcode 6) VIRTCHNL_OP_ENABLE_QUEUES (opcode 8) Disable path: VIRTCHNL_OP_DISABLE_QUEUES (opcode 9) VIRTCHNL_OP_DEL_ETH_ADDR (opcode 11) The issue appears only in stress conditions when VF is enabled and disabled very fast. Eventually there will be a case, when queues are created by VIRTCHNL_OP_CONFIG_VSI_QUEUES, but are not enabled by VIRTCHNL_OP_ENABLE_QUEUES. In turn, these queues are not deleted by VIRTCHNL_OP_DISABLE_QUEUES, because there is a check whether queues are enabled in ice_vc_dis_qs_msg. When we bring up the VF again, we will see the "Failed to set LAN Tx queue context" error during VIRTCHNL_OP_CONFIG_VSI_QUEUES step. This happens because old 16 queues were not deleted and VF requests to create 16 more, but ice_sched_get_free_qparent in ice_ena_vsi_txq would fail to find a parent node for first newly requested queue (because all nodes are allocated to 16 old queues). Testing Hints: Just enable and disable VF fast enough, so it would be disabled before reaching VIRTCHNL_OP_ENABLE_QUEUES. while true; do ip link set dev ens785f0v0 up sleep 0.065 # adjust delay value for you machine ip link set dev ens785f0v0 down done Fixes: 77ca27c41705 ("ice: add support for virtchnl_queue_select.[tx|rx]_queues bitmap") Signed-off-by: Anatolii Gerasymenko Tested-by: Konrad Jankowski Signed-off-by: Alice Michael Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni drivers/net/ethernet/intel/ice/ice_virtchnl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ccfee1822042b87e5135d33cad8ea353e64612d2 Author: Anatolii Gerasymenko Date: Mon Apr 4 11:35:47 2022 -0700 ice: Set txq_teid to ICE_INVAL_TEID on ring creation When VF is freshly created, but not brought up, ring->txq_teid value is by default set to 0. But 0 is a valid TEID. On some platforms the Root Node of Tx scheduler has a TEID = 0. This can cause issues as shown below. The proper way is to set ring->txq_teid to ICE_INVAL_TEID (0xFFFFFFFF). Testing Hints: echo 1 > /sys/class/net/ens785f0/device/sriov_numvfs ip link set dev ens785f0v0 up ip link set dev ens785f0v0 down If we have freshly created VF and quickly turn it on and off, so there would be no time to reach VIRTCHNL_OP_CONFIG_VSI_QUEUES stage, then VIRTCHNL_OP_DISABLE_QUEUES stage will fail with error: [ 639.531454] disable queue 89 failed 14 [ 639.532233] Failed to disable LAN Tx queues, error: ICE_ERR_AQ_ERROR [ 639.533107] ice 0000:02:00.0: Failed to stop Tx ring 0 on VSI 5 The reason for the fail is that we are trying to send AQ command to delete queue 89, which has never been created and receive an "invalid argument" error from firmware. As this queue has never been created, it's teid and ring->txq_teid have default value 0. ice_dis_vsi_txq has a check against non-existent queues: node = ice_sched_find_node_by_teid(pi->root, q_teids[i]); if (!node) continue; But on some platforms the Root Node of Tx scheduler has a teid = 0. Hence, ice_sched_find_node_by_teid finds a node with teid = 0 (it is pi->root), and we go further to submit an erroneous request to firmware. Fixes: 37bb83901286 ("ice: Move common functions out of ice_main.c part 7/7") Signed-off-by: Anatolii Gerasymenko Reviewed-by: Maciej Fijalkowski Tested-by: Konrad Jankowski Signed-off-by: Alice Michael Signed-off-by: Tony Nguyen Signed-off-by: Paolo Abeni drivers/net/ethernet/intel/ice/ice_lib.c | 1 + 1 file changed, 1 insertion(+) commit 2b04bd4f03bba021959ca339314f6739710f0954 Author: Miaoqian Lin Date: Mon Apr 4 12:53:36 2022 +0000 dpaa2-ptp: Fix refcount leak in dpaa2_ptp_probe This node pointer is returned by of_find_compatible_node() with refcount incremented. Calling of_node_put() to aovid the refcount leak. Fixes: d346c9e86d86 ("dpaa2-ptp: reuse ptp_qoriq driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220404125336.13427-1-linmq006@gmail.com Signed-off-by: Paolo Abeni drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 42193ffd79bd3acd91bd947e53f3548a3661d0a1 Author: Vasily Averin Date: Sat Apr 2 12:50:37 2022 +0300 netfilter: nf_tables: memcg accounting for dynamically allocated objects nft_*.c files whose NFT_EXPR_STATEFUL flag is set on need to use __GFP_ACCOUNT flag for objects that are dynamically allocated from the packet path. Such objects are allocated inside nft_expr_ops->init() callbacks executed in task context while processing netlink messages. In addition, this patch adds accounting to nft_set_elem_expr_clone() used for the same purposes. Signed-off-by: Vasily Averin Acked-by: Roman Gushchin Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_tables_api.c | 2 +- net/netfilter/nft_connlimit.c | 2 +- net/netfilter/nft_counter.c | 2 +- net/netfilter/nft_last.c | 2 +- net/netfilter/nft_limit.c | 2 +- net/netfilter/nft_quota.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) commit 13043d1a12c54d8b6605bbead5e177e9fb98a287 Merge: cf5c5763eb53 67bae5f28c89 Author: Maxime Ripard Date: Tue Apr 5 11:38:33 2022 +0200 Merge drm-misc/drm-misc-next-fixes into drm-misc-fixes There were a few patches left in drm-misc-next-fixes, let's bring them into drm-misc-fixes. Signed-off-by: Maxime Ripard commit cf5c5763eb531ff5120111ad300126e926fb5a56 Merge: 8047f98c8958 312310928417 Author: Maxime Ripard Date: Tue Apr 5 11:37:03 2022 +0200 Merge drm/drm-fixes into drm-misc-fixes Let's start the 5.18 fixes cycle. Signed-off-by: Maxime Ripard commit e927b05f3cc20de87f6b7d912a5bbe556931caca Author: Miaoqian Lin Date: Sun Apr 3 11:52:39 2022 +0000 ASoC: msm8916-wcd-digital: Check failure for devm_snd_soc_register_component devm_snd_soc_register_component() may fails, we should check the error and do the corresponding error handling. Fixes: 150db8c5afa1 ("ASoC: codecs: Add msm8916-wcd digital codec") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220403115239.30140-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/msm8916-wcd-digital.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 8ba08d3a367a70f707b7c5d53ad92b98b960ee88 Author: Miaoqian Lin Date: Mon Apr 4 09:07:46 2022 +0000 ASoC: rk817: Use devm_clk_get() in rk817_platform_probe We need to call clk_put() to undo clk_get() in the error path. Use devm_clk_get() to obtain a reference to the clock, It has the benefit that clk_put() is no longer required. Fixes: 0d6a04da9b25 ("ASoC: Add Rockchip rk817 audio CODEC support") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220404090753.17940-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/rk817_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0b3d5d2e358ca6772fc3662fca27acb12a682fbf Author: Hui Wang Date: Thu Mar 24 16:18:39 2022 +0800 ASoC: cs35l41: Fix a shift-out-of-bounds warning found by UBSAN We enabled UBSAN in the ubuntu kernel, and the cs35l41 driver triggers a warning calltrace like below: cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: bitoffset= 8, word_offset=23, bit_sum mod 32=0, otp_map[i].size = 24 cs35l41-hda i2c-CSC3551:00-cs35l41-hda.0: bitoffset= 0, word_offset=24, bit_sum mod 32=24, otp_map[i].size = 0 ================================================================================ UBSAN: shift-out-of-bounds in linux-kernel-src/sound/soc/codecs/cs35l41-lib.c:836:8 shift exponent 64 is too large for 64-bit type 'long unsigned int' CPU: 10 PID: 595 Comm: systemd-udevd Not tainted 5.15.0-23-generic #23 Hardware name: LENOVO \x02MFG_IN_GO/\x02MFG_IN_GO, BIOS N3GET19W (1.00 ) 03/11/2022 Call Trace: show_stack+0x52/0x58 dump_stack_lvl+0x4a/0x5f dump_stack+0x10/0x12 ubsan_epilogue+0x9/0x45 __ubsan_handle_shift_out_of_bounds.cold+0x61/0xef ? regmap_unlock_mutex+0xe/0x10 cs35l41_otp_unpack.cold+0x1c6/0x2b2 [snd_soc_cs35l41_lib] cs35l41_hda_probe+0x24f/0x33a [snd_hda_scodec_cs35l41] cs35l41_hda_i2c_probe+0x65/0x90 [snd_hda_scodec_cs35l41_i2c] When both bitoffset and otp_map[i].size are 0, the line 836 will result in GENMASK(-1, 0), this triggers the shift-out-of-bounds calltrace. Here add a checking, if both bitoffset and otp_map[i].size are 0, do not run GENMASK() and directly set otp_val to 0, this will not bring any function change on the driver but could avoid the calltrace. Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20220324081839.62009-2-hui.wang@canonical.com Signed-off-by: Mark Brown sound/soc/codecs/cs35l41-lib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit c598ccfbeb26cb9452f99e7beb92ef779dcb16b1 Author: Hui Wang Date: Thu Mar 24 16:18:38 2022 +0800 ASoC: cs35l41: Add one more variable in the debug log otp_map[].size is a key variable to compute the value of otp_val and to update the bit_offset, it is helpful to debug if could put it in the debug log. Signed-off-by: Hui Wang Reviewed-by: Lucas Tanure Link: https://lore.kernel.org/r/20220324081839.62009-1-hui.wang@canonical.com Signed-off-by: Mark Brown sound/soc/codecs/cs35l41-lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c8618d65007ba68d7891130642d73e89372101e8 Author: Xiaomeng Tong Date: Sun Mar 27 16:10:02 2022 +0800 ASoC: rt5682: fix an incorrect NULL check on list iterator The bug is here: if (!dai) { The list iterator value 'dai' will *always* be set and non-NULL by for_each_component_dais(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found (In fact, it will be a bogus pointer to an invalid struct object containing the HEAD). Otherwise it will bypass the check 'if (!dai) {' (never call dev_err() and never return -ENODEV;) and lead to invalid memory access lately when calling 'rt5682_set_bclk1_ratio(dai, factor);'. To fix the bug, just return rt5682_set_bclk1_ratio(dai, factor); when found the 'dai', otherwise dev_err() and return -ENODEV; Cc: stable@vger.kernel.org Fixes: ebbfabc16d23d ("ASoC: rt5682: Add CCF usage for providing I2S clks") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220327081002.12684-1-xiam0nd.tong@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/rt5682.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) commit f730a46b931d894816af34a0ff8e4ad51565b39f Author: Xiaomeng Tong Date: Tue Mar 29 09:21:34 2022 +0800 ASoC: soc-dapm: fix two incorrect uses of list iterator These two bug are here: list_for_each_entry_safe_continue(w, n, list, power_list); list_for_each_entry_safe_continue(w, n, list, power_list); After the list_for_each_entry_safe_continue() exits, the list iterator will always be a bogus pointer which point to an invalid struct objdect containing HEAD member. The funciton poniter 'w->event' will be a invalid value which can lead to a control-flow hijack if the 'w' can be controlled. The original intention was to continue the outer list_for_each_entry_safe() loop with the same entry if w->event is NULL, but misunderstanding the meaning of list_for_each_entry_safe_continue(). So just add a 'continue;' to fix the bug. Cc: stable@vger.kernel.org Fixes: 163cac061c973 ("ASoC: Factor out DAPM sequence execution") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220329012134.9375-1-xiam0nd.tong@gmail.com Signed-off-by: Mark Brown sound/soc/soc-dapm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 7a53f408902d913cd541b4f8ad7dbcd4961f5b82 Author: Peter Zijlstra Date: Wed Mar 23 23:35:01 2022 +0100 objtool: Fix SLS validation for kcov tail-call replacement Since not all compilers have a function attribute to disable KCOV instrumentation, objtool can rewrite KCOV instrumentation in noinstr functions as per commit: f56dae88a81f ("objtool: Handle __sanitize_cov*() tail calls") However, this has subtle interaction with the SLS validation from commit: 1cc1e4c8aab4 ("objtool: Add straight-line-speculation validation") In that when a tail-call instrucion is replaced with a RET an additional INT3 instruction is also written, but is not represented in the decoded instruction stream. This then leads to false positive missing INT3 objtool warnings in noinstr code. Instead of adding additional struct instruction objects, mark the RET instruction with retpoline_safe to suppress the warning (since we know there really is an INT3). Fixes: 1cc1e4c8aab4 ("objtool: Add straight-line-speculation validation") Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220323230712.GA8939@worktop.programming.kicks-ass.net tools/objtool/check.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit d139bca4b824ffb9731763c31b271a24b595948a Author: Peter Zijlstra Date: Tue Mar 22 12:33:31 2022 +0100 objtool: Fix IBT tail-call detection Objtool reports: arch/x86/crypto/poly1305-x86_64.o: warning: objtool: poly1305_blocks_avx() falls through to next function poly1305_blocks_x86_64() arch/x86/crypto/poly1305-x86_64.o: warning: objtool: poly1305_emit_avx() falls through to next function poly1305_emit_x86_64() arch/x86/crypto/poly1305-x86_64.o: warning: objtool: poly1305_blocks_avx2() falls through to next function poly1305_blocks_x86_64() Which reads like: 0000000000000040 : 40: f3 0f 1e fa endbr64 ... 0000000000000400 : 400: f3 0f 1e fa endbr64 404: 44 8b 47 14 mov 0x14(%rdi),%r8d 408: 48 81 fa 80 00 00 00 cmp $0x80,%rdx 40f: 73 09 jae 41a 411: 45 85 c0 test %r8d,%r8d 414: 0f 84 2a fc ff ff je 44 ... These are simple conditional tail-calls and *should* be recognised as such by objtool, however due to a mistake in commit 08f87a93c8ec ("objtool: Validate IBT assumptions") this is failing. Specifically, the jump_dest is +4, this means the instruction pointed at will not be ENDBR and as such it will fail the second clause of is_first_func_insn() that was supposed to capture this exact case. Instead, have is_first_func_insn() look at the previous instruction. Fixes: 08f87a93c8ec ("objtool: Validate IBT assumptions") Reported-by: Stephen Rothwell Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220322115125.811582125@infradead.org tools/objtool/check.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) commit 9ce02f0fc68326dd1f87a0a3a4c6ae7fdd39e6f6 Author: Vincent Mailhol Date: Thu Mar 24 11:37:42 2022 +0900 x86/bug: Prevent shadowing in __WARN_FLAGS The macro __WARN_FLAGS() uses a local variable named "f". This being a common name, there is a risk of shadowing other variables. For example, GCC would yield: | In file included from ./include/linux/bug.h:5, | from ./include/linux/cpumask.h:14, | from ./arch/x86/include/asm/cpumask.h:5, | from ./arch/x86/include/asm/msr.h:11, | from ./arch/x86/include/asm/processor.h:22, | from ./arch/x86/include/asm/timex.h:5, | from ./include/linux/timex.h:65, | from ./include/linux/time32.h:13, | from ./include/linux/time.h:60, | from ./include/linux/stat.h:19, | from ./include/linux/module.h:13, | from virt/lib/irqbypass.mod.c:1: | ./include/linux/rcupdate.h: In function 'rcu_head_after_call_rcu': | ./arch/x86/include/asm/bug.h:80:21: warning: declaration of 'f' shadows a parameter [-Wshadow] | 80 | __auto_type f = BUGFLAG_WARNING|(flags); \ | | ^ | ./include/asm-generic/bug.h:106:17: note: in expansion of macro '__WARN_FLAGS' | 106 | __WARN_FLAGS(BUGFLAG_ONCE | \ | | ^~~~~~~~~~~~ | ./include/linux/rcupdate.h:1007:9: note: in expansion of macro 'WARN_ON_ONCE' | 1007 | WARN_ON_ONCE(func != (rcu_callback_t)~0L); | | ^~~~~~~~~~~~ | In file included from ./include/linux/rbtree.h:24, | from ./include/linux/mm_types.h:11, | from ./include/linux/buildid.h:5, | from ./include/linux/module.h:14, | from virt/lib/irqbypass.mod.c:1: | ./include/linux/rcupdate.h:1001:62: note: shadowed declaration is here | 1001 | rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t f) | | ~~~~~~~~~~~~~~~^ For reference, sparse also warns about it, c.f. [1]. This patch renames the variable from f to __flags (with two underscore prefixes as suggested in the Linux kernel coding style [2]) in order to prevent collisions. [1] https://lore.kernel.org/all/CAFGhKbyifH1a+nAMCvWM88TK6fpNPdzFtUXPmRGnnQeePV+1sw@mail.gmail.com/ [2] Linux kernel coding style, section 12) Macros, Enums and RTL, paragraph 5) namespace collisions when defining local variables in macros resembling functions https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl Fixes: bfb1a7c91fb7 ("x86/bug: Merge annotate_reachable() into_BUG_FLAGS() asm") Signed-off-by: Vincent Mailhol Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Nick Desaulniers Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20220324023742.106546-1-mailhol.vincent@wanadoo.fr arch/x86/include/asm/bug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e19cd0b6fa5938c51d7b928010d584f0de93913a Author: Chengming Zhou Date: Tue Mar 29 23:45:23 2022 +0800 perf/core: Always set cpuctx cgrp when enable cgroup event When enable a cgroup event, cpuctx->cgrp setting is conditional on the current task cgrp matching the event's cgroup, so have to do it for every new event. It brings complexity but no advantage. To keep it simple, this patch would always set cpuctx->cgrp when enable the first cgroup event, and reset to NULL when disable the last cgroup event. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220329154523.86438-5-zhouchengming@bytedance.com kernel/events/core.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) commit 96492a6c558acb56124844d1409d9ef8624a0322 Author: Chengming Zhou Date: Tue Mar 29 23:45:22 2022 +0800 perf/core: Fix perf_cgroup_switch() There is a race problem that can trigger WARN_ON_ONCE(cpuctx->cgrp) in perf_cgroup_switch(). CPU1 CPU2 perf_cgroup_sched_out(prev, next) cgrp1 = perf_cgroup_from_task(prev) cgrp2 = perf_cgroup_from_task(next) if (cgrp1 != cgrp2) perf_cgroup_switch(prev, PERF_CGROUP_SWOUT) cgroup_migrate_execute() task->cgroups = ? perf_cgroup_attach() task_function_call(task, __perf_cgroup_move) perf_cgroup_sched_in(prev, next) cgrp1 = perf_cgroup_from_task(prev) cgrp2 = perf_cgroup_from_task(next) if (cgrp1 != cgrp2) perf_cgroup_switch(next, PERF_CGROUP_SWIN) __perf_cgroup_move() perf_cgroup_switch(task, PERF_CGROUP_SWOUT | PERF_CGROUP_SWIN) The commit a8d757ef076f ("perf events: Fix slow and broken cgroup context switch code") want to skip perf_cgroup_switch() when the perf_cgroup of "prev" and "next" are the same. But task->cgroups can change in concurrent with context_switch() in cgroup_migrate_execute(). If cgrp1 == cgrp2 in sched_out(), cpuctx won't do sched_out. Then task->cgroups changed cause cgrp1 != cgrp2 in sched_in(), cpuctx will do sched_in. So trigger WARN_ON_ONCE(cpuctx->cgrp). Even though __perf_cgroup_move() will be synchronized as the context switch disables the interrupt, context_switch() still can see the task->cgroups is changing in the middle, since task->cgroups changed before sending IPI. So we have to combine perf_cgroup_sched_in() into perf_cgroup_sched_out(), unified into perf_cgroup_switch(), to fix the incosistency between perf_cgroup_sched_out() and perf_cgroup_sched_in(). But we can't just compare prev->cgroups with next->cgroups to decide whether to skip cpuctx sched_out/in since the prev->cgroups is changing too. For example: CPU1 CPU2 cgroup_migrate_execute() prev->cgroups = ? perf_cgroup_attach() task_function_call(task, __perf_cgroup_move) perf_cgroup_switch(task) cgrp1 = perf_cgroup_from_task(prev) cgrp2 = perf_cgroup_from_task(next) if (cgrp1 != cgrp2) cpuctx sched_out/in ... task_function_call() will return -ESRCH In the above example, prev->cgroups changing cause (cgrp1 == cgrp2) to be true, so skip cpuctx sched_out/in. And later task_function_call() would return -ESRCH since the prev task isn't running on cpu anymore. So we would leave perf_events of the old prev->cgroups still sched on the CPU, which is wrong. The solution is that we should use cpuctx->cgrp to compare with the next task's perf_cgroup. Since cpuctx->cgrp can only be changed on local CPU, and we have irq disabled, we can read cpuctx->cgrp to compare without holding ctx lock. Fixes: a8d757ef076f ("perf events: Fix slow and broken cgroup context switch code") Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220329154523.86438-4-zhouchengming@bytedance.com kernel/events/core.c | 132 ++++++++++----------------------------------------- 1 file changed, 25 insertions(+), 107 deletions(-) commit 6875186aea5ce09a644758d9193265da1cc187c7 Author: Chengming Zhou Date: Tue Mar 29 23:45:21 2022 +0800 perf/core: Use perf_cgroup_info->active to check if cgroup is active Since we use perf_cgroup_set_timestamp() to start cgroup time and set active to 1, then use update_cgrp_time_from_cpuctx() to stop cgroup time and set active to 0. We can use info->active directly to check if cgroup is active. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220329154523.86438-3-zhouchengming@bytedance.com kernel/events/core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit a0827713e298d021d3c79ae7423aea408f3f7c3a Author: Chengming Zhou Date: Tue Mar 29 23:45:20 2022 +0800 perf/core: Don't pass task around when ctx sched in The current code pass task around for ctx_sched_in(), only to get perf_cgroup of the task, then update the timestamp of it and its ancestors and set them to active. But we can use cpuctx->cgrp to get active perf_cgroup and its ancestors since cpuctx->cgrp has been set before ctx_sched_in(). This patch remove the task argument in ctx_sched_in() and cleanup related code. Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220329154523.86438-2-zhouchengming@bytedance.com kernel/events/core.c | 58 +++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) commit e590928de7547454469693da9bc7ffd562e54b7e Author: Kan Liang Date: Mon Mar 28 08:49:03 2022 -0700 perf/x86/intel: Update the FRONTEND MSR mask on Sapphire Rapids On Sapphire Rapids, the FRONTEND_RETIRED.MS_FLOWS event requires the FRONTEND MSR value 0x8. However, the current FRONTEND MSR mask doesn't support it. Update intel_spr_extra_regs[] to support it. 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://lore.kernel.org/r/1648482543-14923-2-git-send-email-kan.liang@linux.intel.com arch/x86/events/intel/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4a263bf331c512849062805ef1b4ac40301a9829 Author: Kan Liang Date: Mon Mar 28 08:49:02 2022 -0700 perf/x86/intel: Don't extend the pseudo-encoding to GP counters The INST_RETIRED.PREC_DIST event (0x0100) doesn't count on SPR. perf stat -e cpu/event=0xc0,umask=0x0/,cpu/event=0x0,umask=0x1/ -C0 Performance counter stats for 'CPU(s) 0': 607,246 cpu/event=0xc0,umask=0x0/ 0 cpu/event=0x0,umask=0x1/ The encoding for INST_RETIRED.PREC_DIST is pseudo-encoding, which doesn't work on the generic counters. However, current perf extends its mask to the generic counters. The pseudo event-code for a fixed counter must be 0x00. Check and avoid extending the mask for the fixed counter event which using the pseudo-encoding, e.g., ref-cycles and PREC_DIST event. With the patch, perf stat -e cpu/event=0xc0,umask=0x0/,cpu/event=0x0,umask=0x1/ -C0 Performance counter stats for 'CPU(s) 0': 583,184 cpu/event=0xc0,umask=0x0/ 583,048 cpu/event=0x0,umask=0x1/ Fixes: 2de71ee153ef ("perf/x86/intel: Fix ICL/SPR INST_RETIRED.PREC_DIST encodings") Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/1648482543-14923-1-git-send-email-kan.liang@linux.intel.com arch/x86/events/intel/core.c | 6 +++++- arch/x86/include/asm/perf_event.h | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) commit e3265a4386428d3d157d9565bb520aabff8b4bf0 Author: Namhyung Kim Date: Mon Mar 28 13:01:12 2022 -0700 perf/core: Inherit event_caps It was reported that some perf event setup can make fork failed on ARM64. It was the case of a group of mixed hw and sw events and it failed in perf_event_init_task() due to armpmu_event_init(). The ARM PMU code checks if all the events in a group belong to the same PMU except for software events. But it didn't set the event_caps of inherited events and no longer identify them as software events. Therefore the test failed in a child process. A simple reproducer is: $ perf stat -e '{cycles,cs,instructions}' perf bench sched messaging # Running 'sched/messaging' benchmark: perf: fork(): Invalid argument The perf stat was fine but the perf bench failed in fork(). Let's inherit the event caps from the parent. Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Cc: Link: https://lkml.kernel.org/r/20220328200112.457740-1-namhyung@kernel.org kernel/events/core.c | 3 +++ 1 file changed, 3 insertions(+) commit ad4878d4d71d9ada913be2ad5b6d7f526a695b6f Author: Kan Liang Date: Tue Mar 15 10:46:00 2022 -0700 perf/x86/uncore: Add Raptor Lake uncore support The uncore PMU of the Raptor Lake is the same as Alder Lake. Add new PCIIDs of IMC for Raptor Lake. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/1647366360-82824-4-git-send-email-kan.liang@linux.intel.com arch/x86/events/intel/uncore.c | 1 + arch/x86/events/intel/uncore_snb.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) commit 82cd83047a9a80e52c0849e56885279166215310 Author: Kan Liang Date: Tue Mar 15 10:45:59 2022 -0700 perf/x86/msr: Add Raptor Lake CPU support Raptor Lake is Intel's successor to Alder lake. PPERF and SMI_COUNT MSRs are also supported. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/1647366360-82824-3-git-send-email-kan.liang@linux.intel.com arch/x86/events/msr.c | 1 + 1 file changed, 1 insertion(+) commit 2da202aa1c38bfe8841611a3d339892eb5579e2b Author: Kan Liang Date: Tue Mar 15 10:45:58 2022 -0700 perf/x86/cstate: Add Raptor Lake support Raptor Lake is Intel's successor to Alder lake. From the perspective of Intel cstate residency counters, there is nothing changed compared with Alder lake. Share adl_cstates with Alder lake. Update the comments for Raptor Lake. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/1647366360-82824-2-git-send-email-kan.liang@linux.intel.com arch/x86/events/intel/cstate.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) commit c61759e581576d3330bd1d9490b4d7552e24da6b Author: Kan Liang Date: Tue Mar 15 10:45:57 2022 -0700 perf/x86: Add Intel Raptor Lake support From PMU's perspective, Raptor Lake is the same as the Alder Lake. The only difference is the event list, which will be supported in the perf tool later. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/1647366360-82824-1-git-send-email-kan.liang@linux.intel.com arch/x86/events/intel/core.c | 1 + 1 file changed, 1 insertion(+) commit 273ba85b5e8b971ed28eb5c17e1638543be9237d Author: Sebastian Andrzej Siewior Date: Mon Mar 28 16:58:10 2022 +0200 Revert "mm/page_alloc: mark pagesets as __maybe_unused" The local_lock() is now using a proper static inline function which is enough for llvm to accept that the variable is used. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220328145810.86783-4-bigeasy@linutronix.de mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2d2f8f083ef29e9b7adfe5cb421368331543473f Author: Sebastian Andrzej Siewior Date: Mon Mar 28 16:58:09 2022 +0200 Revert "locking/local_lock: Make the empty local_lock_*() function a macro." With volatile removed from arch_raw_cpu_ptr() the compiler no longer creates the per-CPU reference. The usage of the macro can be reverted now. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220328145810.86783-3-bigeasy@linutronix.de include/linux/local_lock_internal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 1c1e7e3c23dd25f938302428eeb22c3dda2c3427 Author: Sebastian Andrzej Siewior Date: Mon Mar 28 16:58:08 2022 +0200 x86/percpu: Remove volatile from arch_raw_cpu_ptr(). The volatile attribute in the inline assembly of arch_raw_cpu_ptr() forces the compiler to always generate the code, even if the compiler can decide upfront that its result is not needed. For instance invoking __intel_pmu_disable_all(false) (like intel_pmu_snapshot_arch_branch_stack() does) leads to loading the address of &cpu_hw_events into the register while compiler knows that it has no need for it. This ends up with code like: | movq $cpu_hw_events, %rax #, tcp_ptr__ | add %gs:this_cpu_off(%rip), %rax # this_cpu_off, tcp_ptr__ | xorl %eax, %eax # tmp93 It also creates additional code within local_lock() with !RT && !LOCKDEP which is not desired. By removing the volatile attribute the compiler can place the function freely and avoid it if it is not needed in the end. By using the function twice the compiler properly caches only the variable offset and always loads the CPU-offset. this_cpu_ptr() also remains properly placed within a preempt_disable() sections because - arch_raw_cpu_ptr() assembly has a memory input ("m" (this_cpu_off)) - prempt_{dis,en}able() fundamentally has a 'barrier()' in it Therefore this_cpu_ptr() is already properly serialized and does not rely on the 'volatile' attribute. Remove volatile from arch_raw_cpu_ptr(). [ bigeasy: Added Linus' explanation why this_cpu_ptr() is not moved out of a preempt_disable() section without the 'volatile' attribute. ] Suggested-by: Linus Torvalds Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220328145810.86783-2-bigeasy@linutronix.de arch/x86/include/asm/percpu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit df21c0d7a94db64a4e1a0d070e26fb02e60fefab Author: Christophe Leroy Date: Mon Mar 14 11:27:36 2022 +0100 static_call: Remove __DEFINE_STATIC_CALL macro Only DEFINE_STATIC_CALL use __DEFINE_STATIC_CALL macro now when CONFIG_HAVE_STATIC_CALL is selected. Only keep __DEFINE_STATIC_CALL() for the generic fallback, and also use it to implement DEFINE_STATIC_CALL_NULL() in that case. Signed-off-by: Christophe Leroy Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/329074f92d96e3220ebe15da7bbe2779beee31eb.1647253456.git.christophe.leroy@csgroup.eu include/linux/static_call.h | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) commit 5517d500829c683a358a8de04ecb2e28af629ae5 Author: Christophe Leroy Date: Mon Mar 14 11:27:35 2022 +0100 static_call: Properly initialise DEFINE_STATIC_CALL_RET0() When a static call is updated with __static_call_return0() as target, arch_static_call_transform() set it to use an optimised set of instructions which are meant to lay in the same cacheline. But when initialising a static call with DEFINE_STATIC_CALL_RET0(), we get a branch to the real __static_call_return0() function instead of getting the optimised setup: c00d8120 <__SCT__perf_snapshot_branch_stack>: c00d8120: 4b ff ff f4 b c00d8114 <__static_call_return0> c00d8124: 3d 80 c0 0e lis r12,-16370 c00d8128: 81 8c 81 3c lwz r12,-32452(r12) c00d812c: 7d 89 03 a6 mtctr r12 c00d8130: 4e 80 04 20 bctr c00d8134: 38 60 00 00 li r3,0 c00d8138: 4e 80 00 20 blr c00d813c: 00 00 00 00 .long 0x0 Add ARCH_DEFINE_STATIC_CALL_RET0_TRAMP() defined by each architecture to setup the optimised configuration, and rework DEFINE_STATIC_CALL_RET0() to call it: c00d8120 <__SCT__perf_snapshot_branch_stack>: c00d8120: 48 00 00 14 b c00d8134 <__SCT__perf_snapshot_branch_stack+0x14> c00d8124: 3d 80 c0 0e lis r12,-16370 c00d8128: 81 8c 81 3c lwz r12,-32452(r12) c00d812c: 7d 89 03 a6 mtctr r12 c00d8130: 4e 80 04 20 bctr c00d8134: 38 60 00 00 li r3,0 c00d8138: 4e 80 00 20 blr c00d813c: 00 00 00 00 .long 0x0 Signed-off-by: Christophe Leroy Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/1e0a61a88f52a460f62a58ffc2a5f847d1f7d9d8.1647253456.git.christophe.leroy@csgroup.eu arch/powerpc/include/asm/static_call.h | 1 + arch/x86/include/asm/static_call.h | 2 ++ include/linux/static_call.h | 20 +++++++++++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) commit 8fd4ddda2f49a66bf5dd3d0c01966c4b1971308b Author: Christophe Leroy Date: Mon Mar 14 12:49:36 2022 +0100 static_call: Don't make __static_call_return0 static System.map shows that vmlinux contains several instances of __static_call_return0(): c0004fc0 t __static_call_return0 c0011518 t __static_call_return0 c00d8160 t __static_call_return0 arch_static_call_transform() uses the middle one to check whether we are setting a call to __static_call_return0 or not: c0011520 : c0011520: 3d 20 c0 01 lis r9,-16383 <== r9 = 0xc001 << 16 c0011524: 39 29 15 18 addi r9,r9,5400 <== r9 += 0x1518 c0011528: 7c 05 48 00 cmpw r5,r9 <== r9 has value 0xc0011518 here So if static_call_update() is called with one of the other instances of __static_call_return0(), arch_static_call_transform() won't recognise it. In order to work properly, global single instance of __static_call_return0() is required. Fixes: 3f2a8fc4b15d ("static_call/x86: Add __static_call_return0()") Signed-off-by: Christophe Leroy Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/30821468a0e7d28251954b578e5051dc09300d04.1647258493.git.christophe.leroy@csgroup.eu include/linux/static_call.h | 5 +- kernel/Makefile | 3 +- kernel/static_call.c | 541 ------------------------------------------- kernel/static_call_inline.c | 543 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 546 insertions(+), 546 deletions(-) commit 1cd5f059d956e6f614ba6666ecdbcf95db05d5f5 Author: Peter Zijlstra Date: Fri Mar 18 21:24:38 2022 +0100 x86,static_call: Fix __static_call_return0 for i386 Paolo reported that the instruction sequence that is used to replace: call __static_call_return0 namely: 66 66 48 31 c0 data16 data16 xor %rax,%rax decodes to something else on i386, namely: 66 66 48 data16 dec %ax 31 c0 xor %eax,%eax Which is a nonsensical sequence that happens to have the same outcome. *However* an important distinction is that it consists of 2 instructions which is a problem when the thing needs to be overwriten with a regular call instruction again. As such, replace the instruction with something that decodes the same on both i386 and x86_64. Fixes: 3f2a8fc4b15d ("static_call/x86: Add __static_call_return0()") Reported-by: Paolo Bonzini Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220318204419.GT8939@worktop.programming.kicks-ass.net arch/x86/kernel/static_call.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 0a70045ed8516dfcff4b5728557e1ef3fd017c53 Author: Sven Schnelle Date: Wed Mar 30 10:43:28 2022 +0200 entry: Fix compile error in dynamic_irqentry_exit_cond_resched() kernel/entry/common.c: In function ‘dynamic_irqentry_exit_cond_resched’: kernel/entry/common.c:409:14: error: implicit declaration of function ‘static_key_unlikely’; did you mean ‘static_key_enable’? [-Werror=implicit-function-declaration] 409 | if (!static_key_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) | ^~~~~~~~~~~~~~~~~~~ | static_key_enable static_key_unlikely() should be static_branch_unlikely(). Fixes: 99cf983cc8bca ("sched/preempt: Add PREEMPT_DYNAMIC using static keys") Signed-off-by: Sven Schnelle Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20220330084328.1805665-1-svens@linux.ibm.com kernel/entry/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 386ef214c3c6ab111d05e1790e79475363abaa05 Author: Sebastian Andrzej Siewior Date: Thu Mar 17 15:51:32 2022 +0100 sched: Teach the forced-newidle balancer about CPU affinity limitation. try_steal_cookie() looks at task_struct::cpus_mask to decide if the task could be moved to `this' CPU. It ignores that the task might be in a migration disabled section while not on the CPU. In this case the task must not be moved otherwise per-CPU assumption are broken. Use is_cpu_allowed(), as suggested by Peter Zijlstra, to decide if the a task can be moved. Fixes: d2dfa17bc7de6 ("sched: Trivial forced-newidle balancer") Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/YjNK9El+3fzGmswf@linutronix.de kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5b6547ed97f4f5dfc23f8e3970af6d11d7b7ed7e Author: Peter Zijlstra Date: Wed Mar 16 22:03:41 2022 +0100 sched/core: Fix forceidle balancing Steve reported that ChromeOS encounters the forceidle balancer being ran from rt_mutex_setprio()'s balance_callback() invocation and explodes. Now, the forceidle balancer gets queued every time the idle task gets selected, set_next_task(), which is strictly too often. rt_mutex_setprio() also uses set_next_task() in the 'change' pattern: queued = task_on_rq_queued(p); /* p->on_rq == TASK_ON_RQ_QUEUED */ running = task_current(rq, p); /* rq->curr == p */ if (queued) dequeue_task(...); if (running) put_prev_task(...); /* change task properties */ if (queued) enqueue_task(...); if (running) set_next_task(...); However, rt_mutex_setprio() will explicitly not run this pattern on the idle task (since priority boosting the idle task is quite insane). Most other 'change' pattern users are pidhash based and would also not apply to idle. Also, the change pattern doesn't contain a __balance_callback() invocation and hence we could have an out-of-band balance-callback, which *should* trigger the WARN in rq_pin_lock() (which guards against this exact anti-pattern). So while none of that explains how this happens, it does indicate that having it in set_next_task() might not be the most robust option. Instead, explicitly queue the forceidle balancer from pick_next_task() when it does indeed result in forceidle selection. Having it here, ensures it can only be triggered under the __schedule() rq->lock instance, and hence must be ran from that context. This also happens to clean up the code a little, so win-win. Fixes: d2dfa17bc7de ("sched: Trivial forced-newidle balancer") Reported-by: Steven Rostedt Signed-off-by: Peter Zijlstra (Intel) Tested-by: T.J. Alumbaugh Link: https://lkml.kernel.org/r/20220330160535.GN8939@worktop.programming.kicks-ass.net kernel/sched/core.c | 14 ++++++++++---- kernel/sched/idle.c | 1 - kernel/sched/sched.h | 6 ------ 3 files changed, 10 insertions(+), 11 deletions(-) commit 8047f98c8958d0f0c29882298ec293ff09ffea92 Author: Maxime Ripard Date: Wed Mar 23 16:48:23 2022 +0100 dt-bindings: display: bridge: Drop requirement on input port for DSI devices MIPI-DSI devices, if they are controlled through the bus itself, have to be described as a child node of the controller they are attached to. Thus, there's no requirement on the controller having an OF-Graph output port to model the data stream: it's assumed that it would go from the parent to the child. However, some bridges controlled through the DSI bus still require an input OF-Graph port, thus requiring a controller with an OF-Graph output port. This prevents those bridges from being used with the controllers that do not have one without any particular reason to. Let's drop that requirement. Signed-off-by: Maxime Ripard Reviewed-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20220323154823.839469-1-maxime@cerno.tech Documentation/devicetree/bindings/display/bridge/chipone,icn6211.yaml | 1 - Documentation/devicetree/bindings/display/bridge/toshiba,tc358762.yaml | 1 - 2 files changed, 2 deletions(-) commit e3d37210df5c41c51147a2d5d465de1a4d77be7a Author: Jamie Bainbridge Date: Mon Apr 4 09:47:48 2022 +1000 sctp: count singleton chunks in assoc user stats Singleton chunks (INIT, HEARTBEAT PMTU probes, and SHUTDOWN- COMPLETE) are not counted in SCTP_GET_ASOC_STATS "sas_octrlchunks" counter available to the assoc owner. These are all control chunks so they should be counted as such. Add counting of singleton chunks so they are properly accounted for. Fixes: 196d67593439 ("sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call") Signed-off-by: Jamie Bainbridge Acked-by: Marcelo Ricardo Leitner Link: https://lore.kernel.org/r/c9ba8785789880cf07923b8a5051e174442ea9ee.1649029663.git.jamie.bainbridge@gmail.com Signed-off-by: Paolo Abeni net/sctp/outqueue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit b5e22886839ae466fcf03295150094516c0fd8eb Author: Dongliang Mu Date: Wed Mar 16 21:50:47 2022 +0800 tee: optee: add missing mutext_destroy in optee_ffa_probe The error handling code of optee_ffa_probe misses the mutex_destroy of ffa.mutex when mutext_init succeeds. Fix this by adding mutex_destory of ffa.mutex at the error handling part Fixes: aceeafefff73 ("optee: use driver internal tee_context for some rpc") Signed-off-by: Dongliang Mu Signed-off-by: Jens Wiklander drivers/tee/optee/ffa_abi.c | 1 + 1 file changed, 1 insertion(+) commit 7cd1cc415dd8d0dca7244c9eafb9a0adc8036805 Author: Steve French Date: Fri Apr 1 17:50:59 2022 -0500 cifs: update internal module number To 2.36 Signed-off-by: Steve French fs/cifs/cifsfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fb39d30e227233498c8debe6a9fe3e7cf575c85f Author: Paulo Alcantara Date: Fri Apr 1 13:51:34 2022 -0300 cifs: force new session setup and tcon for dfs Do not reuse existing sessions and tcons in DFS failover as it might connect to different servers and shares. Signed-off-by: Paulo Alcantara (SUSE) Cc: stable@vger.kernel.org Reviewed-by: Enzo Matsumiya Signed-off-by: Steve French fs/cifs/connect.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit 584b0180f0f4d67d7145950fe68c625f06c88b10 Author: Jens Axboe Date: Tue Mar 29 10:48:05 2022 -0600 io_uring: move read/write file prep state into actual opcode handler In preparation for not necessarily having a file assigned at prep time, defer any initialization associated with the file to when the opcode handler is run. Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Jens Axboe fs/io_uring.c | 101 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 53 insertions(+), 48 deletions(-) commit a3e4bc23d5470b2beb7cc42a86b6a3e75b704c15 Author: Jens Axboe Date: Tue Mar 29 10:59:20 2022 -0600 io_uring: defer splice/tee file validity check until command issue In preparation for not using the file at prep time, defer checking if this file refers to a valid io_uring instance until issue time. This also means we can get rid of the cleanup flag for splice and tee. Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Jens Axboe fs/io_uring.c | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) commit 38d4e5cf5b08798f093374e53c2f4609d5382dd5 Author: Karol Herbst Date: Tue Mar 22 13:48:00 2022 +0100 drm/nouveau/pmu: Add missing callbacks for Tegra devices Fixes a crash booting on those platforms with nouveau. Fixes: 4cdd2450bf73 ("drm/nouveau/pmu/gm200-: use alternate falcon reset sequence") Cc: Ben Skeggs Cc: Karol Herbst Cc: dri-devel@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Cc: # v5.17+ Signed-off-by: Karol Herbst Reviewed-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20220322124800.2605463-1-kherbst@redhat.com drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gm20b.c | 1 + drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp102.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/pmu/gp10b.c | 1 + drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) commit bf36619a5463fbe6d3ecde37bb13680b532a253b Author: Sudeep Holla Date: Mon Apr 4 11:24:19 2022 +0100 firmware: arm_scmi: Fix sparse warnings in OPTEE transport driver The sparse checker complains about converting pointers between address spaces. We correctly stored an __iomem pointer in struct scmi_optee_channel, but discarded the __iomem when returning it from get_channel_shm, causing one warning. Then we passed the non-__iomem pointer return from get_channel_shm at two other places, where an __iomem pointer is expected, causing couple of other warnings Add the appropriate __iomem annotations at all places where it is missing. optee.c:414:20: warning: incorrect type in return expression (different address spaces) optee.c:414:20: expected struct scmi_shared_mem * optee.c:414:20: got struct scmi_shared_mem [noderef] __iomem *shmem optee.c:426:26: warning: incorrect type in argument 1 (different address spaces) optee.c:426:26: expected struct scmi_shared_mem [noderef] __iomem *shmem optee.c:426:26: got struct scmi_shared_mem *shmem optee.c:441:30: warning: incorrect type in argument 1 (different address spaces) optee.c:441:30: expected struct scmi_shared_mem [noderef] __iomem *shmem optee.c:441:30: got struct scmi_shared_mem *shmem Link: https://lore.kernel.org/r/20220404102419.1159705-1-sudeep.holla@arm.com Cc: Etienne Carriere Cc: Cristian Marussi Reported-by: kernel test robot Signed-off-by: Sudeep Holla drivers/firmware/arm_scmi/optee.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit f1ad601d1f4a8f5dac69706d641f3a88beccc488 Author: Lv Ruyi Date: Fri Apr 1 07:55:37 2022 +0000 firmware: arm_scmi: Replace zero-length array with flexible-array member There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use “flexible array members”[1] for these cases. The older style of one-element or zero-length arrays should no longer be used[2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://lore.kernel.org/r/20220401075537.2407376-1-lv.ruyi@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Sudeep Holla drivers/firmware/arm_scmi/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 23274739a5b6166f74d8d9cb5243d7bf6b46aab9 Author: Cristian Marussi Date: Fri Mar 18 09:28:13 2022 +0000 firmware: arm_scmi: Fix sorting of retrieved clock rates During SCMI Clock protocol initialization, after having retrieved from the SCMI platform all the available discrete rates for a specific clock, the clock rates array is sorted, unfortunately using a pointer to its end as a base instead of its start, so that sorting does not work. Fix invocation of sort() passing as base a pointer to the start of the retrieved clock rates array. Link: https://lore.kernel.org/r/20220318092813.49283-1-cristian.marussi@arm.com Fixes: dccec73de91d ("firmware: arm_scmi: Keep the discrete clock rates sorted") Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla drivers/firmware/arm_scmi/clock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 79ee8aa31d518c1fd5f3b1b1ac39dd1fb4dc7039 Author: Willem de Bruijn Date: Thu Mar 24 16:19:07 2022 -0700 selftests/harness: Pass variant to teardown FIXTURE_VARIANT data is passed to FIXTURE_SETUP and TEST_F as "variant". In some cases, the variant will change the setup, such that expectations also change on teardown. Also pass variant to FIXTURE_TEARDOWN. The new FIXTURE_TEARDOWN logic is identical to that in FIXTURE_SETUP, right above. Signed-off-by: Willem de Bruijn Reviewed-by: Jakub Kicinski Acked-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20201210231010.420298-1-willemdebruijn.kernel@gmail.com Signed-off-by: Shuah Khan tools/testing/selftests/kselftest_harness.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 63e6b2a42342c3297cce286fb124c99be9e0f3fd Author: Kees Cook Date: Thu Mar 24 16:19:06 2022 -0700 selftests/harness: Run TEARDOWN for ASSERT failures The kselftest test harness has traditionally not run the registered TEARDOWN handler when a test encountered an ASSERT. This creates unexpected situations and tests need to be very careful about using ASSERT, which seems a needless hurdle for test writers. Because of the harness's design for optional failure handlers, the original implementation of ASSERT used an abort() to immediately stop execution, but that meant the context for running teardown was lost. Instead, use setjmp/longjmp so that teardown can be done. Failed SETUP routines continue to not be followed by TEARDOWN, though. Cc: Andy Lutomirski Cc: Will Drewry Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Shuah Khan tools/testing/selftests/kselftest_harness.h | 49 ++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 15 deletions(-) commit 187816d07729ff88e75d84efbc668642106cebf3 Author: Axel Rasmussen Date: Thu Mar 24 15:39:29 2022 -0700 selftests: fix an unused variable warning in pidfd selftest I fixed a few warnings like this in commit e2aa5e650b07 ("selftests: fixup build warnings in pidfd / clone3 tests"), but I missed this one by mistake. Since this variable is unused, remove it. Signed-off-by: Axel Rasmussen Reviewed-by: Christian Brauner Signed-off-by: Shuah Khan tools/testing/selftests/pidfd/pidfd_wait.c | 1 - 1 file changed, 1 deletion(-) commit 52035628fae646269b1379417926fa3d60ef87d0 Author: Axel Rasmussen Date: Thu Mar 24 15:39:28 2022 -0700 selftests: fix header dependency for pid_namespace selftests The way the test target was defined before, when building with clang we get a command line like this: clang -Wall -Werror -g -I../../../../usr/include/ \ regression_enomem.c ../pidfd/pidfd.h -o regression_enomem This yields an error, because clang thinks we want to produce both a *.o file, as well as a precompiled header: clang: error: cannot specify -o when generating multiple output files gcc, for whatever reason, doesn't exhibit the same behavior which I suspect is why the problem wasn't noticed before. This can be fixed simply by using the LOCAL_HDRS infrastructure the selftests lib.mk provides. It does the right think and marks the target as depending on the header (so if the header changes, we rebuild), but it filters the header out of the compiler command line, so we don't get the error described above. Signed-off-by: Axel Rasmussen Reviewed-by: Christian Brauner Signed-off-by: Shuah Khan tools/testing/selftests/pid_namespace/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit aa8ce29931d6a37aa80f10ae7aa30045108f276d Author: Geliang Tang Date: Thu Mar 24 17:55:54 2022 +0800 selftests: x86: add 32bit build warnings for SUSE In order to successfully build all these 32bit tests, these 32bit gcc and glibc packages, named gcc-32bit and glibc-devel-static-32bit on SUSE, need to be installed. This patch added this information in warn_32bit_failure. Signed-off-by: Geliang Tang Signed-off-by: Shuah Khan tools/testing/selftests/x86/Makefile | 4 ++++ 1 file changed, 4 insertions(+) commit 1585b1b55a2b9086823a6b30031eb63f965f8d44 Author: Guo Zhengkui Date: Mon Mar 21 18:25:17 2022 +0800 selftests/proc: fix array_size.cocci warning Fix the following coccicheck warning: tools/testing/selftests/proc/proc-pid-vm.c:371:26-27: WARNING: Use ARRAY_SIZE tools/testing/selftests/proc/proc-pid-vm.c:420:26-27: WARNING: Use ARRAY_SIZE It has been tested with gcc (Debian 8.3.0-6) 8.3.0 on x86_64. Signed-off-by: Guo Zhengkui Signed-off-by: Shuah Khan tools/testing/selftests/proc/proc-pid-vm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 8ff88bec6f6186c406aa71312b2919e56f7b8084 Author: Guo Zhengkui Date: Mon Mar 21 13:27:42 2022 +0800 selftests/vDSO: fix array_size.cocci warning Fix the following coccicheck warning: tools/testing/selftests/vDSO/vdso_test_correctness.c:309:46-47: WARNING: Use ARRAY_SIZE tools/testing/selftests/vDSO/vdso_test_correctness.c:373:46-47: WARNING: Use ARRAY_SIZE It has been tested with gcc (Debian 8.3.0-6) 8.3.0 on x86_64. Signed-off-by: Guo Zhengkui Signed-off-by: Shuah Khan tools/testing/selftests/vDSO/vdso_test_correctness.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) commit c3b0068194269193286209d7a70ad1e93a13247f Author: Rob Herring Date: Fri Apr 1 09:12:47 2022 -0500 dt-bindings: Fix 'enum' lists with duplicate entries There's no reason to list the same value twice in an 'enum'. Fix all the occurrences in the tree. A meta-schema change will catch future ones. Cc: Krzysztof Kozlowski Cc: Thierry Reding Cc: Jonathan Hunter Cc: Mauro Carvalho Chehab Cc: Charles Keepax Cc: Linus Walleij Cc: Sebastian Reichel Cc: Tony Lindgren Cc: Yunfei Dong Cc: - Cc: linux-media@vger.kernel.org Cc: alsa-devel@alsa-project.org Cc: linux-gpio@vger.kernel.org Cc: linux-pm@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Acked-by: Sebastian Reichel Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220401141247.2993925-1-robh@kernel.org .../devicetree/bindings/arm/tegra/nvidia,tegra20-pmc.yaml | 1 - Documentation/devicetree/bindings/bus/ti-sysc.yaml | 1 - .../devicetree/bindings/media/mediatek,vcodec-encoder.yaml | 1 - Documentation/devicetree/bindings/pinctrl/cirrus,madera.yaml | 11 +++++------ Documentation/devicetree/bindings/power/supply/bq2415x.yaml | 1 - 5 files changed, 5 insertions(+), 10 deletions(-) commit 866f404f1b7431ce956bf2f16264ef3ca51cb0dc Author: Krzysztof Kozlowski Date: Thu Mar 17 15:29:52 2022 +0100 dt-bindings: irqchip: mrvl,intc: refresh maintainers Jason's email bounces and his address was dropped from maintainers in commit 509920aee72a ("MAINTAINERS: Move Jason Cooper to CREDITS"), so drop him here too. Switch other maintainers from IRQCHIP subsystem maintainers to Marvell Orion platform maintainers because its a bigger chance they know the hardware. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Andrew Lunn Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220317142952.479413-1-krzysztof.kozlowski@canonical.com .../devicetree/bindings/interrupt-controller/mrvl,intc.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 27e4a85cf79b74650b0c60541fc989af7954ba62 Author: Rob Herring Date: Wed Mar 30 09:57:41 2022 -0500 dt-bindings: Fix incomplete if/then/else schemas A recent review highlighted that the json-schema meta-schema allows any combination of if/then/else schema keywords even though if, then or else by themselves makes little sense. With an added meta-schema to only allow valid combinations, there's a handful of schemas found which need fixing in a variety of ways. Incorrect indentation is the most common issue. Cc: Lars-Peter Clausen Cc: Michael Hennerich Cc: Jonathan Cameron Cc: Krzysztof Kozlowski Cc: Olivier Moysan Cc: Arnaud Pouliquen Cc: Bjorn Andersson Cc: Georgi Djakov Cc: Ulf Hansson Cc: Thierry Reding Cc: Jonathan Hunter Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Kishon Vijay Abraham I Cc: Vinod Koul Cc: Mark Brown Cc: Fabrice Gasnier Cc: Grygorii Strashko Cc: Dmitry Osipenko Cc: linux-iio@vger.kernel.org Cc: alsa-devel@alsa-project.org Cc: linux-mmc@vger.kernel.org Cc: linux-tegra@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-phy@lists.infradead.org Signed-off-by: Rob Herring Acked-by: Jakub Kicinski Reviewed-by: Krzysztof Kozlowski Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220330145741.3044896-1-robh@kernel.org .../devicetree/bindings/iio/adc/adi,ad7476.yaml | 1 + .../bindings/iio/adc/st,stm32-dfsdm-adc.yaml | 8 +-- .../devicetree/bindings/iio/dac/adi,ad5360.yaml | 6 +- .../devicetree/bindings/interconnect/qcom,rpm.yaml | 84 +++++++++++----------- .../bindings/mmc/nvidia,tegra20-sdhci.yaml | 2 + .../devicetree/bindings/net/ti,davinci-mdio.yaml | 1 + .../bindings/phy/nvidia,tegra20-usb-phy.yaml | 20 +++--- .../devicetree/bindings/phy/qcom,usb-hs-phy.yaml | 32 +++++---- .../bindings/regulator/fixed-regulator.yaml | 34 ++++----- .../devicetree/bindings/sound/st,stm32-sai.yaml | 6 +- Documentation/devicetree/bindings/sram/sram.yaml | 16 ++--- 11 files changed, 107 insertions(+), 103 deletions(-) commit dfbba2518aac4204203b0697a894d3b2f80134d3 Author: Akihiko Odaki Date: Sun Apr 3 15:23:22 2022 +0900 Revert "ACPI: processor: idle: Only flush cache on entering C3" Revert commit 87ebbb8c612b ("ACPI: processor: idle: Only flush cache on entering C3") that broke the assumptions of the acpi_idle_play_dead() callers. Namely, the CPU cache must always be flushed in acpi_idle_play_dead(), regardless of the target C-state that is going to be requested, because this is likely to be part of a CPU offline procedure or preparation for entering a system-wide sleep state and the lack of synchronization between the CPU cache and RAM may lead to problems going forward, for example when the CPU is brought back online. In particular, it breaks resume from suspend-to-RAM on Lenovo ThinkPad C13 which fails occasionally until the problematic commit is reverted. Signed-off-by: Akihiko Odaki [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki drivers/acpi/processor_idle.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit e7ccd8a49a050428bd842822970b70c66fd0b988 Author: Geert Uytterhoeven Date: Wed Mar 30 15:04:16 2022 +0200 dt-bindings: power: renesas,apmu: Fix cpus property limits "make dtbs_check": arch/arm/boot/dts/r8a7791-koelsch.dtb: apmu@e6152000: cpus:0: [6, 7] is too long From schema: Documentation/devicetree/bindings/power/renesas,apmu.yaml Correct the minimum and maximum number of CPUs controlled by a single APMU instance. Fixes: 39bd2b6a3783b899 ("dt-bindings: Improve phandle-array schemas") Signed-off-by: Geert Uytterhoeven Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/9ece1a07bbcb95abc9d80e6a6ecc95806a294a11.1648645279.git.geert+renesas@glider.be Documentation/devicetree/bindings/power/renesas,apmu.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 3bbbb3e5b59f4ca0f7493307a03f99930737bb76 Author: Krzysztof Kozlowski Date: Thu Mar 10 08:32:58 2022 +0100 dt-bindings: extcon: maxim,max77843: fix ports type The "ports" property can contain multiple ports as name suggests, so it should be using "ports" type from device graphs. Reported-by: Rob Herring Fixes: 9729cad0278b ("dt-bindings: extcon: maxim,max77843: Add MAX77843 bindings") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220310073258.24060-1-krzysztof.kozlowski@canonical.com Documentation/devicetree/bindings/extcon/maxim,max77843.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 02c7efa43627163e489a8db87882445a0ff381f7 Author: Daniel Latypov Date: Mon Jan 31 13:23:41 2022 -0800 Documentation: kunit: fix path to .kunitconfig in start.rst Commit ddbd60c779b4 ("kunit: use --build_dir=.kunit as default") changed the default --build_dir, which had the side effect of making `.kunitconfig` move to `.kunit/.kunitconfig`. However, the first few lines of kunit/start.rst never got updated, oops. Fix this by telling people to run kunit.py first, which will automatically generate the .kunit directory and .kunitconfig file, and then edit the file manually as desired. Reported-by: Yifan Yuan Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan Documentation/dev-tools/kunit/start.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit 4d809f69695d4e7d1378b3a072fa9aef23123018 Author: Niels Dossche Date: Mon Feb 28 17:53:30 2022 +0100 IB/rdmavt: add lock to call to rvt_error_qp to prevent a race condition The documentation of the function rvt_error_qp says both r_lock and s_lock need to be held when calling that function. It also asserts using lockdep that both of those locks are held. However, the commit I referenced in Fixes accidentally makes the call to rvt_error_qp in rvt_ruc_loopback no longer covered by r_lock. This results in the lockdep assertion failing and also possibly in a race condition. Fixes: d757c60eca9b ("IB/rdmavt: Fix concurrency panics in QP post_send and modify to error") Link: https://lore.kernel.org/r/20220228165330.41546-1-dossche.niels@gmail.com Signed-off-by: Niels Dossche Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rdmavt/qp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit d39268ad24c0fd0665d0c5cf55a7c1a0ebf94766 Author: Dave Hansen Date: Fri Mar 18 06:52:59 2022 -0700 x86/mm/tlb: Revert retpoline avoidance approach 0day reported a regression on a microbenchmark which is intended to stress the TLB flushing path: https://lore.kernel.org/all/20220317090415.GE735@xsang-OptiPlex-9020/ It pointed at a commit from Nadav which intended to remove retpoline overhead in the TLB flushing path by taking the 'cond'-ition in on_each_cpu_cond_mask(), pre-calculating it, and incorporating it into 'cpumask'. That allowed the code to use a bunch of earlier direct calls instead of later indirect calls that need a retpoline. But, in practice, threads can go idle (and into lazy TLB mode where they don't need to flush their TLB) between the early and late calls. It works in this direction and not in the other because TLB-flushing threads tend to hold mmap_lock for write. Contention on that lock causes threads to _go_ idle right in this early/late window. There was not any performance data in the original commit specific to the retpoline overhead. I did a few tests on a system with retpolines: https://lore.kernel.org/all/dd8be93c-ded6-b962-50d4-96b1c3afb2b7@intel.com/ which showed a possible small win. But, that small win pales in comparison with the bigger loss induced on non-retpoline systems. Revert the patch that removed the retpolines. This was not a clean revert, but it was self-contained enough not to be too painful. Fixes: 6035152d8eeb ("x86/mm/tlb: Open-code on_each_cpu_cond_mask() for tlb_is_not_lazy()") Reported-by: kernel test robot Signed-off-by: Dave Hansen Signed-off-by: Borislav Petkov Acked-by: Nadav Amit Cc: Link: https://lkml.kernel.org/r/164874672286.389.7021457716635788197.tip-bot2@tip-bot2 arch/x86/mm/tlb.c | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) commit 527a9867af29ff89f278d037db704e0ed50fb666 Author: Jan Varho Date: Mon Apr 4 19:42:30 2022 +0300 random: do not split fast init input in add_hwgenerator_randomness() add_hwgenerator_randomness() tries to only use the required amount of input for fast init, but credits all the entropy, rather than a fraction of it. Since it's hard to determine how much entropy is left over out of a non-unformly random sample, either give it all to fast init or credit it, but don't attempt to do both. In the process, we can clean up the injection code to no longer need to return a value. Signed-off-by: Jan Varho [Jason: expanded commit message] Fixes: 73c7733f122e ("random: do not throw away excess input to crng_fast_load") Cc: stable@vger.kernel.org # 5.17+, requires af704c856e88 Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) commit 10cb21f4ff3f9cb36d1e1c39bf80426f02f4986a Author: Anilkumar Kolli Date: Thu Mar 31 10:07:57 2022 +0530 Revert "ath11k: mesh: add support for 256 bitmap in blockack frames in 11ax" This reverts commit 743b9065fe6348a5f8f5ce04869ce2d701e5e1bc. The original commit breaks the 256 bitmap in blockack frames in AP mode. After reverting the commit the feature works again in both AP and mesh modes Tested-on: IPQ8074 hw2.0 PCI WLAN.HK.2.6.0.1-00786-QCAHKSWPL_SILICONZ-1 Fixes: 743b9065fe63 ("ath11k: mesh: add support for 256 bitmap in blockack frames in 11ax") Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1648701477-16367-1-git-send-email-quic_akolli@quicinc.com drivers/net/wireless/ath/ath11k/mac.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) commit 00c796eecba4898194ea549679797ee28f89a92f Author: Jakob Koschel Date: Thu Mar 31 23:55:41 2022 +0200 cifs: remove check of list iterator against head past the loop body When list_for_each_entry() completes the iteration over the whole list without breaking the loop, the iterator value will be a bogus pointer computed based on the head element. While it is safe to use the pointer to determine if it was computed based on the head element, either with list_entry_is_head() or &pos->member == head, using the iterator variable after the loop should be avoided. In preparation to limit the scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Jakob Koschel Signed-off-by: Steve French fs/cifs/smb2misc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 687127c81ad32c8900a3fedbc7ed8f686ca95855 Author: Paulo Alcantara Date: Thu Mar 31 15:01:50 2022 -0300 cifs: fix potential race with cifsd thread To avoid racing with demultiplex thread while it is handling data on socket, use cifs_signal_cifsd_for_reconnect() helper for marking current server to reconnect and let the demultiplex thread handle the rest. Fixes: dca65818c80c ("cifs: use a different reconnect helper for non-cifsd threads") Reviewed-by: Enzo Matsumiya Reviewed-by: Shyam Prasad N Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French fs/cifs/connect.c | 2 +- fs/cifs/netmisc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit abb860ac7e3f022a233f34b12d035d49abfc114d Author: Krzysztof Kozlowski Date: Thu Mar 31 21:45:26 2022 +0200 pinctrl: samsung: staticize fsd_pin_ctrl struct fsd_pin_ctrl is not used outside of the file, so it can be made static. This fixes sparse warning: drivers/pinctrl/samsung/pinctrl-exynos-arm64.c:773:31: sparse: symbol 'fsd_pin_ctrl' was not declared. Should it be static? Reported-by: kernel test robot Fixes: 0d1b662c374c ("pinctrl: samsung: add FSD SoC specific data") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220331194526.52444-1-krzysztof.kozlowski@linaro.org drivers/pinctrl/samsung/pinctrl-exynos-arm64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4f9f45d0eb0e7d449bc9294459df79b9c66edfac Author: Sherry Sun Date: Mon Mar 21 15:51:30 2022 +0800 dt-bindings: memory: snps,ddrc-3.80a compatible also need interrupts For the snps,ddrc-3.80a compatible, the interrupts property is also required, also order the compatibles by name (s goes before x). Signed-off-by: Sherry Sun Fixes: a9e6b3819b36 ("dt-bindings: memory: Add entry for version 3.80a") Link: https://lore.kernel.org/r/20220321075131.17811-2-sherry.sun@nxp.com Signed-off-by: Krzysztof Kozlowski .../devicetree/bindings/memory-controllers/synopsys,ddrc-ecc.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 6f296a9665ba5ac68937bf11f96214eb9de81baa Author: Miaoqian Lin Date: Wed Mar 9 11:01:43 2022 +0000 memory: atmel-ebi: Fix missing of_node_put in atmel_ebi_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: 87108dc78eb8 ("memory: atmel-ebi: Enable the SMC clock if specified") Signed-off-by: Miaoqian Lin Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220309110144.22412-1-linmq006@gmail.com Signed-off-by: Krzysztof Kozlowski drivers/memory/atmel-ebi.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) commit b452dbf24d7d9a990d70118462925f6ee287d135 Author: Johan Hovold Date: Thu Mar 3 19:06:32 2022 +0100 memory: renesas-rpc-if: fix platform-device leak in error path Make sure to free the flash platform device in the event that registration fails during probe. Fixes: ca7d8b980b67 ("memory: add Renesas RPC-IF driver") Cc: stable@vger.kernel.org # 5.8 Cc: Sergei Shtylyov Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220303180632.3194-1-johan@kernel.org Signed-off-by: Krzysztof Kozlowski drivers/memory/renesas-rpc-if.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit d10f4b22e912d9771493f71d05337362538eec07 Author: Arnd Bergmann Date: Mon Apr 4 17:30:44 2022 +0200 ARM: iop32x: include iop3xx.h header where needed Building with 'make W=1' shows a warning about a missing prototype: arch/arm/mach-iop32x/cp6.c:10:6: warning: no previous prototype for 'iop_enable_cp6' [-Wmissing-prototypes] Include the header that contains the declaration. Fixes: 6f5d248d05db ("ARM: iop32x: use GENERIC_IRQ_MULTI_HANDLER") Reported-by: kernel test robot Signed-off-by: Arnd Bergmann arch/arm/mach-iop32x/cp6.c | 2 ++ 1 file changed, 2 insertions(+) commit 94865e2dcb46c1c852c881cfa769cec4947d8f28 Author: Guenter Roeck Date: Mon Apr 4 06:48:59 2022 -0700 habanalabs: Fix test build failures allmodconfig builds on 32-bit architectures fail with the following error. drivers/misc/habanalabs/common/memory.c: In function 'alloc_device_memory': drivers/misc/habanalabs/common/memory.c:153:49: error: cast from pointer to integer of different size Fix the typecast. While at it, drop other unnecessary typecasts associated with the same commit. Fixes: e8458e20e0a3c ("habanalabs: make sure device mem alloc is page aligned") Cc: Ohad Sharabi Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20220404134859.3278599-1-linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman drivers/misc/habanalabs/common/memory.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 20314bacd2f9b1b8fc10895417e6db0dc85f8248 Author: Guenter Roeck Date: Mon Apr 4 06:43:38 2022 -0700 staging: r8188eu: Fix PPPoE tag insertion on little endian systems In __nat25_add_pppoe_tag(), the tag length is read from the tag data structure. The value is kept in network format, but read as raw value. With -Warray-bounds, this results in the following gcc error/warning when building the driver on alpha. In function '__nat25_add_pppoe_tag', inlined from 'nat25_db_handle' at drivers/staging/r8188eu/core/rtw_br_ext.c:479:11: arch/alpha/include/asm/string.h:22:16: error: '__builtin_memcpy' forming offset [40, 2051] is out of the bounds [0, 40] of object 'tag_buf' with type 'unsigned char[40]' Add the missing be16_to_cpu() to fix the compile error. It should be noted, however, that this fix means that the code did probably not work on any little endian systems and/or that the driver has other endiannes related issues. A build with C=1 suggests that this is indeed the case. This patch does not attempt to fix any of those other issues. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Cc: Phillip Potter Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20220404134338.3276991-1-linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_br_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 83a1cde5c74bfb44b49cb2a940d044bb2380f4ea Author: Nathan Chancellor Date: Thu Dec 23 15:21:41 2021 -0700 ARM: davinci: da850-evm: Avoid NULL pointer dereference With newer versions of GCC, there is a panic in da850_evm_config_emac() when booting multi_v5_defconfig in QEMU under the palmetto-bmc machine: Unable to handle kernel NULL pointer dereference at virtual address 00000020 pgd = (ptrval) [00000020] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 5.15.0 #1 Hardware name: Generic DT based system PC is at da850_evm_config_emac+0x1c/0x120 LR is at do_one_initcall+0x50/0x1e0 The emac_pdata pointer in soc_info is NULL because davinci_soc_info only gets populated on davinci machines but da850_evm_config_emac() is called on all machines via device_initcall(). Move the rmii_en assignment below the machine check so that it is only dereferenced when running on a supported SoC. Fixes: bae105879f2f ("davinci: DA850/OMAP-L138 EVM: implement autodetect of RMII PHY") Signed-off-by: Nathan Chancellor Reviewed-by: Arnd Bergmann Reviewed-by: Bartosz Golaszewski Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/YcS4xVWs6bQlQSPC@archlinux-ax161/ Signed-off-by: Arnd Bergmann arch/arm/mach-davinci/board-da850-evm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 753ee989f7cf0c0a76a7f56956827a8863a60f97 Author: Mario Limonciello Date: Sat Apr 2 18:11:22 2022 -0500 platform/x86: amd-pmc: Fix compilation without CONFIG_SUSPEND Since commit b1f66033cd4e ("platform/x86: amd-pmc: Move to later in the suspend process") amd-pmc doesn't use traditional suspend resume callback anymore but relies on functions only created declared when CONFIG_SUSPEND is set. Check for CONFIG_SUSPEND and only use those functions in those circumstances. Fixes: commit b1f66033cd4e ("platform/x86: amd-pmc: Move to later in the suspend process") Reported-by: Randy Dunlap Signed-off-by: Mario Limonciello Acked-by: Randy Dunlap Tested-by: Randy Dunlap Link: https://lore.kernel.org/r/20220402231122.3877-1-mario.limonciello@amd.com Signed-off-by: Hans de Goede drivers/platform/x86/amd-pmc.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit 4fd45cc8568e6086272d3036f2c29d61e9b776a1 Author: Denis Pauk Date: Sun Apr 3 22:34:54 2022 +0300 hwmon: (asus_wmi_sensors) Fix CROSSHAIR VI HERO name CROSSHAIR VI HERO motherboard is incorrectly named as ROG CROSSHAIR VI HERO. Signed-off-by: Denis Pauk Link: https://lore.kernel.org/r/20220403193455.1363-1-pauk.denis@gmail.com Signed-off-by: Guenter Roeck drivers/hwmon/asus_wmi_sensors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d6732317a5525a95a7eb2d12b46e3e42d321c6b6 Author: Guenter Roeck Date: Fri Mar 25 15:24:34 2022 -0700 hwmon: (xdpe12284) Fix build warning seen if CONFIG_SENSORS_XDPE122_REGULATOR is disabled 0-day reports: drivers/hwmon/pmbus/xdpe12284.c:127:36: warning: unused variable 'xdpe122_reg_desc' This is seen if CONFIG_SENSORS_XDPE122_REGULATOR is not enabled. Mark xdpe122_reg_desc as __maybe_unused to fix the problem. Fixes: f53bfe4d6984 ("hwmon: (xdpe12284) Add regulator support") Reported-by: kernel test robot Cc: Marcello Sylvester Bauer Signed-off-by: Guenter Roeck drivers/hwmon/pmbus/xdpe12284.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 487532ec20c1a0b9fc85c1265fa81f04a151f007 Author: Wei Li Date: Sat Mar 26 10:02:49 2022 +0800 platform/x86: acerhdf: Cleanup str_starts_with() Since there is already a generic function strstarts() that check if a string starts with a given prefix, cleanup str_starts_with(). Signed-off-by: Wei Li Acked-by: Peter Kästle Link: https://lore.kernel.org/r/20220326020249.3266561-1-liwei391@huawei.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/acerhdf.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) commit 9aa6471419dc904c4f182295dbe00edfe4c92a29 Author: Hans de Goede Date: Thu Mar 24 17:47:36 2022 +0100 Documentation/ABI: sysfs-class-firmware-attributes: Misc. cleanups Cleanup / fix some minor issues. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220324164737.21765-4-hdegoede@redhat.com Documentation/ABI/testing/sysfs-class-firmware-attributes | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 45440a1d79eed68bcb8db236a6967a1d5c37a8ce Author: Hans de Goede Date: Thu Mar 24 17:47:35 2022 +0100 Documentation/ABI: sysfs-class-firmware-attributes: Fix Sphinx errors Fix the following warnings from "make htmldocs": Documentation/ABI/testing/sysfs-class-firmware-attributes:130: ERROR: Unexpected indentation. ERROR: Unexpected indentation. ERROR: Unexpected indentation. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220324164737.21765-3-hdegoede@redhat.com .../ABI/testing/sysfs-class-firmware-attributes | 42 ++++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) commit c5547574797b254ba9c98c7da417bc5de71cd198 Author: Hans de Goede Date: Thu Mar 24 17:47:34 2022 +0100 Documentation/ABI: sysfs-driver-intel_sdsi: Fix sphinx warnings Fix the following warnings from "make htmldocs": Documentation/ABI/testing/sysfs-driver-intel_sdsi:2: WARNING: Unexpected indentation. WARNING: Block quote ends without a blank line; unexpected unindent. WARNING: Definition list ends without a blank line; unexpected unindent. By turning the error-code table into a proper ReST table. While at it also fix the error-code table mixing tab and spaces for indentation (switch to all tabs). Reported-by: Stephen Rothwell Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220324164737.21765-2-hdegoede@redhat.com Documentation/ABI/testing/sysfs-driver-intel_sdsi | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit 3f2a3c79a4536fba6a8eee8a4f49218467216300 Author: Haowen Bai Date: Wed Mar 23 15:50:25 2022 +0800 platform/x86: barco-p50-gpio: Fix duplicate included linux/io.h Clean up the following includecheck warning: drivers/platform/x86/barco-p50-gpio.c: linux/io.h is included more than once. No functional change. Signed-off-by: Haowen Bai Acked-by: Peter Korsgaard Link: https://lore.kernel.org/r/1648021825-6182-1-git-send-email-baihaowen@meizu.com Signed-off-by: Hans de Goede drivers/platform/x86/barco-p50-gpio.c | 1 - 1 file changed, 1 deletion(-) commit 0284d4d1be753f648f28b77bdfbe6a959212af5c Author: Jiapeng Chong Date: Tue Mar 22 14:18:30 2022 +0800 platform/x86: samsung-laptop: Fix an unsigned comparison which can never be negative Eliminate the follow smatch warnings: drivers/platform/x86/samsung-laptop.c:1124 kbd_led_set() warn: unsigned 'value' is never less than zero. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220322061830.105579-1-jiapeng.chong@linux.alibaba.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/samsung-laptop.c | 2 -- 1 file changed, 2 deletions(-) commit 1a9f338f9cf96f8338d5592dee5fce222929e4f7 Author: Krzysztof Kozlowski Date: Wed Mar 30 09:40:16 2022 +0200 MAINTAINERS: update Krzysztof Kozlowski's email to Linaro Use Krzysztof Kozlowski's @linaro.org account in maintainer entries. Signed-off-by: Krzysztof Kozlowski Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20220330074016.12896-3-krzysztof.kozlowski@linaro.org MAINTAINERS | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) commit 8a1e6bb3f78f06432e095758476358d8cb63c03d Author: Krzysztof Kozlowski Date: Wed Mar 30 09:40:15 2022 +0200 dt-bindings: update Krzysztof Kozlowski's email Krzysztof Kozlowski's @canonical.com email stopped working, so switch to generic @kernel.org account for all Devicetree bindings. Signed-off-by: Krzysztof Kozlowski Acked-by: Rob Herring Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20220330074016.12896-2-krzysztof.kozlowski@linaro.org Documentation/devicetree/bindings/clock/samsung,exynos-audss-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,exynos-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,exynos-ext-clock.yaml | 2 +- .../devicetree/bindings/clock/samsung,exynos4412-isp-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,exynos5260-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,exynos5410-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,exynos5433-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,exynos7885-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,exynos850-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,s2mps11.yaml | 2 +- .../devicetree/bindings/clock/samsung,s5pv210-audss-clock.yaml | 2 +- Documentation/devicetree/bindings/clock/samsung,s5pv210-clock.yaml | 2 +- .../devicetree/bindings/devfreq/event/samsung,exynos-nocp.yaml | 2 +- .../devicetree/bindings/devfreq/event/samsung,exynos-ppmu.yaml | 2 +- .../devicetree/bindings/display/samsung/samsung,exynos-hdmi-ddc.yaml | 2 +- .../devicetree/bindings/display/samsung/samsung,exynos-hdmi.yaml | 2 +- .../devicetree/bindings/display/samsung/samsung,exynos-mixer.yaml | 2 +- .../devicetree/bindings/display/samsung/samsung,exynos5433-decon.yaml | 2 +- .../devicetree/bindings/display/samsung/samsung,exynos5433-mic.yaml | 2 +- .../devicetree/bindings/display/samsung/samsung,exynos7-decon.yaml | 2 +- Documentation/devicetree/bindings/display/samsung/samsung,fimd.yaml | 2 +- Documentation/devicetree/bindings/extcon/maxim,max77843.yaml | 2 +- Documentation/devicetree/bindings/hwmon/lltc,ltc4151.yaml | 2 +- Documentation/devicetree/bindings/hwmon/microchip,mcp3021.yaml | 2 +- Documentation/devicetree/bindings/hwmon/sensirion,sht15.yaml | 2 +- Documentation/devicetree/bindings/hwmon/ti,tmp102.yaml | 2 +- Documentation/devicetree/bindings/hwmon/ti,tmp108.yaml | 2 +- Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml | 2 +- Documentation/devicetree/bindings/i2c/samsung,s3c2410-i2c.yaml | 2 +- .../bindings/interrupt-controller/samsung,exynos4210-combiner.yaml | 2 +- Documentation/devicetree/bindings/leds/maxim,max77693.yaml | 2 +- Documentation/devicetree/bindings/memory-controllers/brcm,dpfe-cpu.yaml | 2 +- .../bindings/memory-controllers/ddr/jedec,lpddr2-timings.yaml | 2 +- .../devicetree/bindings/memory-controllers/ddr/jedec,lpddr2.yaml | 2 +- .../bindings/memory-controllers/ddr/jedec,lpddr3-timings.yaml | 2 +- .../devicetree/bindings/memory-controllers/ddr/jedec,lpddr3.yaml | 2 +- .../bindings/memory-controllers/marvell,mvebu-sdram-controller.yaml | 2 +- .../bindings/memory-controllers/qca,ath79-ddr-controller.yaml | 2 +- .../devicetree/bindings/memory-controllers/renesas,h8300-bsc.yaml | 2 +- .../devicetree/bindings/memory-controllers/samsung,exynos5422-dmc.yaml | 2 +- .../devicetree/bindings/memory-controllers/synopsys,ddrc-ecc.yaml | 2 +- .../devicetree/bindings/memory-controllers/ti,da8xx-ddrctl.yaml | 2 +- Documentation/devicetree/bindings/mfd/maxim,max14577.yaml | 2 +- Documentation/devicetree/bindings/mfd/maxim,max77686.yaml | 2 +- Documentation/devicetree/bindings/mfd/maxim,max77693.yaml | 2 +- Documentation/devicetree/bindings/mfd/maxim,max77802.yaml | 2 +- Documentation/devicetree/bindings/mfd/maxim,max77843.yaml | 2 +- Documentation/devicetree/bindings/mfd/samsung,exynos5433-lpass.yaml | 2 +- Documentation/devicetree/bindings/mfd/samsung,s2mpa01.yaml | 2 +- Documentation/devicetree/bindings/mfd/samsung,s2mps11.yaml | 2 +- Documentation/devicetree/bindings/mfd/samsung,s5m8767.yaml | 2 +- Documentation/devicetree/bindings/net/nfc/marvell,nci.yaml | 2 +- Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml | 2 +- Documentation/devicetree/bindings/net/nfc/nxp,pn532.yaml | 2 +- Documentation/devicetree/bindings/net/nfc/nxp,pn544.yaml | 2 +- Documentation/devicetree/bindings/net/nfc/st,st-nci.yaml | 2 +- Documentation/devicetree/bindings/net/nfc/st,st21nfca.yaml | 2 +- Documentation/devicetree/bindings/net/nfc/st,st95hf.yaml | 2 +- Documentation/devicetree/bindings/net/nfc/ti,trf7970a.yaml | 2 +- Documentation/devicetree/bindings/phy/samsung,dp-video-phy.yaml | 2 +- Documentation/devicetree/bindings/phy/samsung,exynos-hdmi-phy.yaml | 2 +- Documentation/devicetree/bindings/phy/samsung,exynos5250-sata-phy.yaml | 2 +- Documentation/devicetree/bindings/phy/samsung,mipi-video-phy.yaml | 2 +- Documentation/devicetree/bindings/phy/samsung,usb2-phy.yaml | 2 +- Documentation/devicetree/bindings/phy/samsung,usb3-drd-phy.yaml | 2 +- .../devicetree/bindings/pinctrl/samsung,pinctrl-gpio-bank.yaml | 2 +- Documentation/devicetree/bindings/pinctrl/samsung,pinctrl-pins-cfg.yaml | 2 +- .../devicetree/bindings/pinctrl/samsung,pinctrl-wakeup-interrupt.yaml | 2 +- Documentation/devicetree/bindings/pinctrl/samsung,pinctrl.yaml | 2 +- Documentation/devicetree/bindings/power/supply/maxim,max14577.yaml | 2 +- Documentation/devicetree/bindings/power/supply/maxim,max77693.yaml | 2 +- Documentation/devicetree/bindings/regulator/maxim,max14577.yaml | 2 +- Documentation/devicetree/bindings/regulator/maxim,max77686.yaml | 2 +- Documentation/devicetree/bindings/regulator/maxim,max77693.yaml | 2 +- Documentation/devicetree/bindings/regulator/maxim,max77802.yaml | 2 +- Documentation/devicetree/bindings/regulator/maxim,max77843.yaml | 2 +- Documentation/devicetree/bindings/regulator/maxim,max8952.yaml | 2 +- Documentation/devicetree/bindings/regulator/maxim,max8973.yaml | 2 +- Documentation/devicetree/bindings/regulator/maxim,max8997.yaml | 2 +- Documentation/devicetree/bindings/regulator/samsung,s2mpa01.yaml | 2 +- Documentation/devicetree/bindings/regulator/samsung,s2mps11.yaml | 2 +- Documentation/devicetree/bindings/regulator/samsung,s2mps13.yaml | 2 +- Documentation/devicetree/bindings/regulator/samsung,s2mps14.yaml | 2 +- Documentation/devicetree/bindings/regulator/samsung,s2mps15.yaml | 2 +- Documentation/devicetree/bindings/regulator/samsung,s2mpu02.yaml | 2 +- Documentation/devicetree/bindings/regulator/samsung,s5m8767.yaml | 2 +- Documentation/devicetree/bindings/rng/samsung,exynos5250-trng.yaml | 2 +- Documentation/devicetree/bindings/rng/timeriomem_rng.yaml | 2 +- Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml | 2 +- Documentation/devicetree/bindings/sound/samsung,arndale.yaml | 2 +- Documentation/devicetree/bindings/sound/samsung,smdk5250.yaml | 2 +- Documentation/devicetree/bindings/sound/samsung,snow.yaml | 2 +- Documentation/devicetree/bindings/sound/samsung,tm2.yaml | 2 +- Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml | 2 +- Documentation/devicetree/bindings/spi/samsung,spi.yaml | 2 +- Documentation/devicetree/bindings/thermal/samsung,exynos-thermal.yaml | 2 +- Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml | 2 +- Documentation/devicetree/bindings/usb/samsung,exynos-usb2.yaml | 2 +- 99 files changed, 99 insertions(+), 99 deletions(-) commit 107dd7beba403a363adfeb3ffe3734fe38a05cce Author: Mark Zhang Date: Mon Apr 4 11:58:05 2022 +0300 IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD On the passive side when the disconnectReq event comes, if the current state is MRA_REP_RCVD, it needs to cancel the MAD before entering the DREQ_RCVD and TIMEWAIT states, otherwise the destroy_id may block until this mad will reach timeout. Fixes: a977049dacde ("[PATCH] IB: Add the kernel CM implementation") Link: https://lore.kernel.org/r/75261c00c1d82128b1d981af9ff46e994186e621.1649062436.git.leonro@nvidia.com Signed-off-by: Mark Zhang Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/core/cm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 1d735eeee63a0beb65180ca0224f239cc0c9f804 Author: Aharon Landau Date: Mon Apr 4 11:58:04 2022 +0300 RDMA/mlx5: Add a missing update of cache->last_add Update cache->last_add when returning an MR to the cache so that the cache work won't remove it. Fixes: b9358bdbc713 ("RDMA/mlx5: Fix locking in MR cache work queue") Link: https://lore.kernel.org/r/c99f076fce4b44829d434936bbcd3b5fc4c95020.1649062436.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Shay Drory Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/mlx5/mr.c | 1 + 1 file changed, 1 insertion(+) commit 84c2362fb65d69c721fec0974556378cbb36a62b Author: Aharon Landau Date: Mon Apr 4 11:58:03 2022 +0300 RDMA/mlx5: Don't remove cache MRs when a delay is needed Don't remove MRs from the cache if need to delay the removal. Fixes: b9358bdbc713 ("RDMA/mlx5: Fix locking in MR cache work queue") Link: https://lore.kernel.org/r/c3087a90ff362c8796c7eaa2715128743ce36722.1649062436.git.leonro@nvidia.com Signed-off-by: Aharon Landau Reviewed-by: Shay Drory Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/mlx5/mr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit abcc160e4c2bc320f0d94e1b77f272a12fe90a0e Author: Dennis Dalessandro Date: Tue Mar 29 14:42:21 2022 -0400 MAINTAINERS: Update qib and hfi1 related drivers Remove Mike's contact from maintainers file. Link: https://lore.kernel.org/r/20220329184221.182061.69846.stgit@awfm-01.cornelisnetworks.com Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe MAINTAINERS | 4 ---- 1 file changed, 4 deletions(-) commit 442b8b250c41050d26353eb158514f3d91df3455 Author: Jason Gunthorpe Date: Thu Mar 24 14:53:19 2022 -0300 MAINTAINERS: Add Leon Romanovsky to RDMA maintainers Welcome Leon to the maintainer list so we continue to have two people on a medium sized subsystem. Link: https://lore.kernel.org/r/0-v1-64175bea3d24+13436-leon_maint_jgg@nvidia.com Signed-off-by: Jason Gunthorpe MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit fb6d679fee95d272c0a94912c4e534146823ee89 Author: Christophe JAILLET Date: Thu Mar 31 22:19:44 2022 +0200 ASoC: soc-pcm: use GFP_KERNEL when the code is sleepable At the kzalloc() call in dpcm_be_connect(), there is no spin lock involved. It's merely protected by card->pcm_mutex, instead. The spinlock is applied at the later call with snd_soc_pcm_stream_lock_irq() only for the list manipulations. (See it's *_irq(), not *_irqsave(); that means the context being sleepable at that point.) So, we can use GFP_KERNEL safely there. This patch revert commit d8a9c6e1f676 ("ASoC: soc-pcm: use GFP_ATOMIC for dpcm structure") which is no longer needed since commit b7898396f4bb ("ASoC: soc-pcm: Fix and cleanup DPCM locking"). Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/e740f1930843060e025e3c0f17ec1393cfdafb26.1648757961.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown sound/soc/soc-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5708cc2f4b50c7bf27234eee77e1d9487533bbd3 Author: Peter Ujfalusi Date: Thu Mar 31 14:48:45 2022 +0300 ASoC: SOF: topology: Fix memory leak of scontrol->name The scontrol->name is allocated with kstrdup, it must be freed before the scontrol is freed to avoid leaking memory. The constant leaking happens via sof_widget_unload() path on every module removal. Fixes: b5cee8feb1d48 ("ASoC: SOF: topology: Make control parsing IPC agnostic") Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220331114845.32747-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 3 +++ 1 file changed, 3 insertions(+) commit acc72863e0f11cd0bedc888b663700229f9ba5ff Author: Xiaomeng Tong Date: Sun Mar 27 16:13:00 2022 +0800 codecs: rt5682s: fix an incorrect NULL check on list iterator The bug is here: if (!dai) { The list iterator value 'dai' will *always* be set and non-NULL by for_each_component_dais(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element is found (In fact, it will be a bogus pointer to an invalid struct object containing the HEAD). Otherwise it will bypass the check 'if (!dai) {' (never call dev_err() and never return -ENODEV;) and lead to invalid memory access lately when calling 'rt5682s_set_bclk1_ratio(dai, factor);'. To fix the bug, just return rt5682s_set_bclk1_ratio(dai, factor); when found the 'dai', otherwise dev_err() and return -ENODEV; Cc: stable@vger.kernel.org Fixes: bdd229ab26be9 ("ASoC: rt5682s: Add driver for ALC5682I-VS codec") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220327081300.12962-1-xiam0nd.tong@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/rt5682s.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) commit 9c363532413cda3e2c6dfa10e5cca7cd221877a0 Author: Peter Ujfalusi Date: Thu Mar 31 14:49:57 2022 +0300 ASoC: topology: Correct error handling in soc_tplg_dapm_widget_create() Academic correction of error handling: In case the allocation of kc or kcontrol_type fails the correct label to jump is hdr_err since the template.sname has been also allocated at this point. Fixes: d29d41e28eea6 ("ASoC: topology: Add support for multiple kcontrol types to a widget") Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220331114957.519-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown sound/soc/soc-topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c775cbf62ed4911e4f0f23880f01815753123690 Author: Mark Brown Date: Fri Mar 25 15:42:39 2022 +0000 ASoC: atmel: Remove system clock tree configuration for at91sam9g20ek The MCLK of the WM8731 on the AT91SAM9G20-EK board is connected to the PCK0 output of the SoC, intended in the reference software to be supplied using PLLB and programmed to 12MHz. As originally written for use with a board file the audio driver was responsible for configuring the entire tree but in the conversion to the common clock framework the registration of the named pck0 and pllb clocks was removed so the driver has failed to instantiate ever since. Since the WM8731 driver has had support for managing a MCLK provided via the common clock framework for some time we can simply drop all the clock management code from the machine driver other than configuration of the sysclk rate, the CODEC driver still respects that configuration from the machine driver. Fixes: ff78a189b0ae55f ("ARM: at91: remove old at91-specific clock driver") Signed-off-by: Mark Brown Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220325154241.1600757-2-broonie@kernel.org sound/soc/atmel/sam9g20_wm8731.c | 61 ---------------------------------------- 1 file changed, 61 deletions(-) commit 36560efeab3232aa18d1190f7202eb42ff29e0f4 Author: Mark Pearson Date: Mon Mar 21 14:06:24 2022 -0400 platform/x86: think-lmi: certificate support clean ups Complete some clean-ups as reqested from the last review as follow-ups - Remove certificate from structure as no need to store it any more - Clean up return code handling - Moved freeing of signature to before admin object released (issue seen in testing when unloading module) - Minor code flow improvements Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220321180624.4761-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/think-lmi.c | 44 ++++++++++++++-------------------------- drivers/platform/x86/think-lmi.h | 1 - 2 files changed, 15 insertions(+), 30 deletions(-) commit 5467801f1fcbdc46bc7298a84dbf3ca1ff2a7320 Author: Shreeya Patel Date: Mon Mar 21 19:02:41 2022 +0530 gpio: Restrict usage of GPIO chip irq members before initialization GPIO chip irq members are exposed before they could be completely initialized and this leads to race conditions. One such issue was observed for the gc->irq.domain variable which was accessed through the I2C interface in gpiochip_to_irq() before it could be initialized by gpiochip_add_irqchip(). This resulted in Kernel NULL pointer dereference. Following are the logs for reference :- kernel: Call Trace: kernel: gpiod_to_irq+0x53/0x70 kernel: acpi_dev_gpio_irq_get_by+0x113/0x1f0 kernel: i2c_acpi_get_irq+0xc0/0xd0 kernel: i2c_device_probe+0x28a/0x2a0 kernel: really_probe+0xf2/0x460 kernel: RIP: 0010:gpiochip_to_irq+0x47/0xc0 To avoid such scenarios, restrict usage of GPIO chip irq members before they are completely initialized. Signed-off-by: Shreeya Patel Cc: stable@vger.kernel.org Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski drivers/gpio/gpiolib.c | 19 +++++++++++++++++++ include/linux/gpio/driver.h | 9 +++++++++ 2 files changed, 28 insertions(+) commit 458f5d92df4807e2a7c803ed928369129996bf96 Author: Martin Habets Date: Mon Apr 4 11:48:51 2022 +0100 sfc: Do not free an empty page_ring When the page_ring is not used page_ptr_mask is 0. Do not dereference page_ring[0] in this case. Fixes: 2768935a4660 ("sfc: reuse pages to avoid DMA mapping/unmapping costs") Reported-by: Taehee Yoo Signed-off-by: Martin Habets Signed-off-by: David S. Miller drivers/net/ethernet/sfc/rx_common.c | 3 +++ 1 file changed, 3 insertions(+) commit 2baed4f9b085724a8a34add832d4763f3d83f877 Author: Tom Rix Date: Sun Apr 3 10:02:02 2022 -0400 stmmac: dwmac-loongson: change loongson_dwmac_driver from global to static Smatch reports this issue dwmac-loongson.c:208:19: warning: symbol 'loongson_dwmac_driver' was not declared. Should it be static? loongson_dwmac_driver is only used in dwmac-loongson.c. File scope variables used only in one file should be static. Change loongson_dwmac_driver's storage-class-specifier from global to static. Signed-off-by: Tom Rix Signed-off-by: David S. Miller drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 46d4820f949a3030b19ee482c68a50b06dd27590 Author: Wolfram Sang Date: Mon Apr 4 12:05:08 2022 +0200 mmc: renesas_sdhi: special 4tap settings only apply to HS400 Previous documentation was vague, so we included SDR104 for slow SDnH clock settings. It turns out now, that it is only needed for HS400. Fixes: bb6d3fa98a41 ("clk: renesas: rcar-gen3: Switch to new SD clock handling") Cc: stable@vger.kernel.org Reported-by: Yoshihiro Shimoda Signed-off-by: Wolfram Sang Reviewed-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20220404100508.3209-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson drivers/mmc/host/renesas_sdhi_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5dc64b6dcbc2350200a05d0b495dfaef6723a87c Merge: 20921c0c8609 27d4073f8d9a Author: David S. Miller Date: Mon Apr 4 12:44:50 2022 +0100 Merge branch 'bnxt_en-fixes' Michael Chan says: ==================== bnxt_en: XDP redirect fixes This series includes 3 fixes related to the XDP redirect code path in the driver. The first one adds locking when the number of TX XDP rings is less than the number of CPUs. The second one adjusts the maximum MTU that can support XDP with enough tail room in the buffer. The 3rd one fixes a race condition between TX ring shutdown and the XDP redirect path. ==================== Signed-off-by: David S. Miller commit 27d4073f8d9af0340362554414f4961643a4f4de Author: Ray Jui Date: Fri Apr 1 20:21:12 2022 -0400 bnxt_en: Prevent XDP redirect from running when stopping TX queue Add checks in the XDP redirect callback to prevent XDP from running when the TX ring is undergoing shutdown. Also remove redundant checks in the XDP redirect callback to validate the txr and the flag that indicates the ring supports XDP. The modulo arithmetic on 'tx_nr_rings_xdp' already guarantees the derived TX ring is an XDP ring. txr is also guaranteed to be valid after checking BNXT_STATE_OPEN and within RCU grace period. Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support") Reviewed-by: Vladimir Olovyannikov Signed-off-by: Ray Jui Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit facc173cf700e55b2ad249ecbd3a7537f7315691 Author: Andy Gospodarek Date: Fri Apr 1 20:21:11 2022 -0400 bnxt_en: reserve space inside receive page for skb_shared_info Insufficient space was being reserved in the page used for packet reception, so the interface MTU could be set too large to still have room for the contents of the packet when doing XDP redirect. This resulted in the following message when redirecting a packet between 3520 and 3822 bytes with an MTU of 3822: [311815.561880] XDP_WARN: xdp_update_frame_from_buff(line:200): Driver BUG: missing reserved tailroom Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support") Reviewed-by: Somnath Kotur Reviewed-by: Pavan Chebbi Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 4f81def272de17dc4bbd89ac38f49b2676c9b3d2 Author: Pavan Chebbi Date: Fri Apr 1 20:21:10 2022 -0400 bnxt_en: Synchronize tx when xdp redirects happen on same ring If there are more CPUs than the number of TX XDP rings, multiple XDP redirects can select the same TX ring based on the CPU on which XDP redirect is called. Add locking when needed and use static key to decide whether to take the lock. Fixes: f18c2b77b2e4 ("bnxt_en: optimized XDP_REDIRECT support") Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt.c | 7 +++++++ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 2 ++ drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 8 ++++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.h | 2 ++ 4 files changed, 19 insertions(+) commit 20921c0c86092b4082c91bd7c88305da74e5520b Author: Manish Chopra Date: Fri Apr 1 11:53:04 2022 -0700 qed: fix ethtool register dump To fix a coverity complain, commit d5ac07dfbd2b ("qed: Initialize debug string array") removed "sw-platform" (one of the common global parameters) from the dump as this was used in the dump with an uninitialized string, however it did not reduce the number of common global parameters which caused the incorrect (unable to parse) register dump this patch fixes it with reducing NUM_COMMON_GLOBAL_PARAMS bye one. Cc: stable@vger.kernel.org Cc: Tim Gardner Cc: "David S. Miller" Fixes: d5ac07dfbd2b ("qed: Initialize debug string array") Signed-off-by: Prabhakar Kushwaha Signed-off-by: Alok Prasad Signed-off-by: Ariel Elior Signed-off-by: Manish Chopra Reviewed-by: Tim Gardner Signed-off-by: David S. Miller drivers/net/ethernet/qlogic/qed/qed_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2370759b8a00179bf7802d59784fa0abcea2424b Merge: 692930cc4350 76e9ccd68943 Author: David S. Miller Date: Mon Apr 4 12:40:42 2022 +0100 Merge branch 'micrel-lan8814-remove-latencies' Horatiu Vultur says: ==================== net: phy: micrel: Remove latencies support lan8814 Remove the latencies support both from the PHY driver and from the DT. The IP already has some default latencies values which can be used to get decent results. It has the following values(defined in ns): rx-1000mbit: 429 tx-1000mbit: 201 rx-100mbit: 2346 tx-100mbit: 705 v0->v1: - fix the split of the patches, there was a compiling error between patch 2 and patch 3. --- But to get better results the following values needs to be set: rx-1000mbit: 459 tx-1000mbit: 171 rx-100mbit: 1706 tx-100mbit: 1345 We are proposing to use ethtool to set these latencies, the RFC can be found here[1] ==================== Signed-off-by: David S. Miller commit 76e9ccd6894377bc3cf7fbdea90b0af2cb4eb12a Author: Horatiu Vultur Date: Fri Apr 1 13:05:22 2022 +0200 net: phy: micrel: Remove DT option lan8814,ignore-ts When the PHY and the MAC are capable of doing timestamping, the PHY has priority. Therefore the DT option lan8814,ignore-ts was added such that the PHY will not expose a PHC so then the timestamping was done in the MAC. This is not the correct approach of doing it, therefore remove this. Fixes: ece19502834d84 ("net: phy: micrel: 1588 support for LAN8814 phy") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller drivers/net/phy/micrel.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit b814403a8cd8b28a2c0497e211f029786394531d Author: Horatiu Vultur Date: Fri Apr 1 13:05:21 2022 +0200 net: phy: micrel: Remove latency from driver Based on the discussions here[1], the PHY driver is the wrong place to set the latencies, therefore remove them. [1] https://lkml.org/lkml/2022/3/4/325 Fixes: ece19502834d84 ("net: phy: micrel: 1588 support for LAN8814 phy") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller drivers/net/phy/micrel.c | 102 +---------------------------------------------- 1 file changed, 1 insertion(+), 101 deletions(-) commit b117c88df0e3b48903c36f97be92bac6a9e03df7 Author: Horatiu Vultur Date: Fri Apr 1 13:05:20 2022 +0200 dt-bindings: net: micrel: Revert latency support and timestamping check Revert latency support from binding. Based on the discussion[1], the DT is the wrong place to have the lantecies for the PHY. [1] https://lkml.org/lkml/2022/3/4/325 Fixes: 2358dd3fd325fc ("dt-bindings: net: micrel: Configure latency values and timestamping check for LAN8814 phy") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller Documentation/devicetree/bindings/net/micrel.txt | 17 ----------------- 1 file changed, 17 deletions(-) commit 748b82c23e25310fec54e1eff2cb63936f391b24 Author: David Ahern Date: Fri Apr 1 12:58:37 2022 -0600 xfrm: Pass flowi_oif or l3mdev as oif to xfrm_dst_lookup The commit referenced in the Fixes tag no longer changes the flow oif to the l3mdev ifindex. A xfrm use case was expecting the flowi_oif to be the VRF if relevant and the change broke that test. Update xfrm_bundle_create to pass oif if set and any potential flowi_l3mdev if oif is not set. Fixes: 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices") Reported-by: kernel test robot Signed-off-by: David Ahern Signed-off-by: Steffen Klassert net/xfrm/xfrm_policy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 08ebf903af57cda6d773f3dd1671b64f73b432b8 Author: Michael Wu Date: Thu Mar 31 15:32:23 2022 +0800 mmc: core: Fixup support for writeback-cache for eMMC and SD During the card initialization process, the mmc core checks whether the eMMC/SD card supports an internal writeback-cache and then enables it inside the card. Unfortunately, this isn't according to what the mmc core reports to the upper block layer. Instead, the writeback-cache support with REQ_FLUSH and REQ_FUA, are being enabled depending on whether the host supports the CMD23 (MMC_CAP_CMD23) and whether an eMMC supports the reliable-write command. This is wrong and it may also sound awkward. In fact, it's a remnant from when both eMMC/SD cards didn't have dedicated commands/support to control the internal writeback-cache. In other words, it was the best we could do at that point in time. To fix the problem, but also without breaking backwards compatibility, let's align the REQ_FLUSH support with whether the writeback-cache became successfully enabled - for both eMMC and SD cards. Cc: stable@kernel.org Fixes: 881d1c25f765 ("mmc: core: Add cache control for eMMC4.5 device") Fixes: 130206a615a9 ("mmc: core: Add support for cache ctrl for SD cards") Depends-on: 97fce126e279 ("mmc: block: Issue a cache flush only when it's enabled") Reviewed-by: Avri Altman Signed-off-by: Michael Wu Link: https://lore.kernel.org/r/20220331073223.106415-1-michael@allwinnertech.com [Ulf: Re-wrote the commit message] Signed-off-by: Ulf Hansson drivers/mmc/core/block.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit 5d435933376962b107bd76970912e7e80247dcc7 Author: Christian Löhle Date: Thu Mar 24 14:18:41 2022 +0000 mmc: block: Check for errors after write on SPI Introduce a SEND_STATUS check for writes through SPI to not mark an unsuccessful write as successful. Since SPI SD/MMC does not have states, after a write, the card will just hold the line LOW until it is ready again. The driver marks the write therefore as completed as soon as it reads something other than all zeroes. The driver does not distinguish from a card no longer signalling busy and it being disconnected (and the line being pulled-up by the host). This lead to writes being marked as successful when disconnecting a busy card. Now the card is ensured to be still connected by an additional CMD13, just like non-SPI is ensured to go back to TRAN state. While at it and since we already poll for the post-write status anyway, we might as well check for SPIs error bits (any of them). The disconnecting card problem is reproducable for me after continuous write activity and randomly disconnecting, around every 20-50 tries on SPI DS for some card. Fixes: 7213d175e3b6f ("MMC/SD card driver learns SPI") Cc: stable@vger.kernel.org Signed-off-by: Christian Loehle Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/76f6f5d2b35543bab3dfe438f268609c@hyperstone.com Signed-off-by: Ulf Hansson drivers/mmc/core/block.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) commit 0d319dd5a27183b75d984e3dc495248e59f99334 Author: Yann Gautier Date: Thu Mar 17 12:19:43 2022 +0100 mmc: mmci: stm32: correctly check all elements of sg list Use sg and not data->sg when checking sg list elements. Else only the first element alignment is checked. The last element should be checked the same way, for_each_sg already set sg to sg_next(sg). Fixes: 46b723dd867d ("mmc: mmci: add stm32 sdmmc variant") Cc: stable@vger.kernel.org Signed-off-by: Yann Gautier Link: https://lore.kernel.org/r/20220317111944.116148-2-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson drivers/mmc/host/mmci_stm32_sdmmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 7e2646ed47542123168d43916b84b954532e5386 Author: Pali Rohár Date: Fri Mar 18 15:14:41 2022 +0100 Revert "mmc: sdhci-xenon: fix annoying 1.8V regulator warning" This reverts commit bb32e1987bc55ce1db400faf47d85891da3c9b9f. Commit 1a3ed0dc3594 ("mmc: sdhci-xenon: fix 1.8v regulator stabilization") contains proper fix for the issue described in commit bb32e1987bc5 ("mmc: sdhci-xenon: fix annoying 1.8V regulator warning"). Fixes: 8d876bf472db ("mmc: sdhci-xenon: wait 5ms after set 1.8V signal enable") Cc: stable@vger.kernel.org # 1a3ed0dc3594 ("mmc: sdhci-xenon: fix 1.8v regulator stabilization") Signed-off-by: Pali Rohár Reviewed-by: Marek Behún Reviewed-by: Marcin Wojtas Link: https://lore.kernel.org/r/20220318141441.32329-1-pali@kernel.org Signed-off-by: Ulf Hansson drivers/mmc/host/sdhci-xenon.c | 10 ---------- 1 file changed, 10 deletions(-) commit 1d8e926a04b948f03b3c98aabf7e0033ac12ffbc Author: Geert Uytterhoeven Date: Tue Mar 29 15:10:10 2022 +0200 perf: MARVELL_CN10K_DDR_PMU should depend on ARCH_THUNDER The Marvell CN10K DRAM Subsystem (DSS) performance monitor is only present on Marvell CN10K SoCs. Hence add a dependency on ARCH_THUNDER, to prevent asking the user about this driver when configuring a kernel without Cavium Thunder (incl. Marvell CN10K) SoC support, Fixes: 68fa55f0e05c ("perf/marvell: cn10k DDR perf event core ownership") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/18bfd6e1bcf67db7ea656d684a8bbb68261eeb54.1648559364.git.geert+renesas@glider.be Signed-off-by: Will Deacon drivers/perf/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2012a9e279013933885983cbe0a5fe828052563b Author: Xiaomeng Tong Date: Sun Mar 27 13:57:33 2022 +0800 perf: qcom_l2_pmu: fix an incorrect NULL check on list iterator The bug is here: return cluster; The list iterator value 'cluster' 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. To fix the bug, return 'cluster' when found, otherwise return NULL. Cc: stable@vger.kernel.org Fixes: 21bdbb7102ed ("perf: add qcom l2 cache perf events driver") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220327055733.4070-1-xiam0nd.tong@gmail.com Signed-off-by: Will Deacon drivers/perf/qcom_l2_pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 03cb66463b5547b289099a95ac4ea591cca88ca9 Author: Kunihiko Hayashi Date: Wed Mar 30 14:11:18 2022 +0900 dt-bindings: reset: Add parent "resets" property as optional LD11 mio reset controller has a reset lines from system controller. Add parent "resets" property to fix the following warning. uniphier-ld11-global.dt.yaml: reset: 'resets' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/reset/socionext,uniphier-reset.yaml Signed-off-by: Kunihiko Hayashi Reviewed-by: Krzysztof Kozlowski Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/1648617078-8312-1-git-send-email-hayashi.kunihiko@socionext.com Documentation/devicetree/bindings/reset/socionext,uniphier-reset.yaml | 3 +++ 1 file changed, 3 insertions(+) commit 4dfa1f3657a0d4fb556d4440322d35bdcf5e4970 Author: Zhiyuan Dai Date: Mon Mar 21 10:56:27 2022 +0800 arm64: Fix comments in macro __init_el2_gicv3 Fix typo in comment. Signed-off-by: Zhiyuan Dai Link: https://lore.kernel.org/r/1647831387-3686-1-git-send-email-daizhiyuan@phytium.com.cn Signed-off-by: Will Deacon arch/arm64/include/asm/el2_setup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dd671f16b1cdb188aa64d740a408f7d00e281444 Author: Julia Lawall Date: Fri Mar 18 11:37:05 2022 +0100 arm64: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220318103729.157574-10-Julia.Lawall@inria.fr [will: Squashed in 20220318103729.157574-28-Julia.Lawall@inria.fr] Signed-off-by: Will Deacon arch/arm64/kernel/hw_breakpoint.c | 2 +- arch/arm64/kernel/module-plts.c | 2 +- arch/arm64/kernel/suspend.c | 2 +- arch/arm64/mm/init.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) commit 5524cbb1bfcdff0cad0aaa9f94e6092002a07259 Author: Phil Auld Date: Thu Mar 31 11:39:26 2022 -0400 arch/arm64: Fix topology initialization for core scheduling Arm64 systems rely on store_cpu_topology() to call update_siblings_masks() to transfer the toplogy to the various cpu masks. This needs to be done before the call to notify_cpu_starting() which tells the scheduler about each cpu found, otherwise the core scheduling data structures are setup in a way that does not match the actual topology. With smt_mask not setup correctly we bail on `cpumask_weight(smt_mask) == 1` for !leaders in: notify_cpu_starting() cpuhp_invoke_callback_range() sched_cpu_starting() sched_core_cpu_starting() which leads to rq->core not being correctly set for !leader-rq's. Without this change stress-ng (which enables core scheduling in its prctl tests in newer versions -- i.e. with PR_SCHED_CORE support) causes a warning and then a crash (trimmed for legibility): [ 1853.805168] ------------[ cut here ]------------ [ 1853.809784] task_rq(b)->core != rq->core [ 1853.809792] WARNING: CPU: 117 PID: 0 at kernel/sched/fair.c:11102 cfs_prio_less+0x1b4/0x1c4 ... [ 1854.015210] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 ... [ 1854.231256] Call trace: [ 1854.233689] pick_next_task+0x3dc/0x81c [ 1854.237512] __schedule+0x10c/0x4cc [ 1854.240988] schedule_idle+0x34/0x54 Fixes: 9edeaea1bc45 ("sched: Core-wide rq->lock") Signed-off-by: Phil Auld Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Link: https://lore.kernel.org/r/20220331153926.25742-1-pauld@redhat.com Signed-off-by: Will Deacon arch/arm64/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d1da1052ffad63aa5181b69f20a6952e31f339c2 Author: Sameer Pujar Date: Wed Jan 12 19:26:46 2022 +0530 reset: tegra-bpmp: Restore Handle errors in BPMP response This reverts following commit 69125b4b9440 ("reset: tegra-bpmp: Revert Handle errors in BPMP response"). The Tegra194 HDA reset failure is fixed by commit d278dc9151a0 ("ALSA: hda/tegra: Fix Tegra194 HDA reset failure"). The temporary revert of original commit c045ceb5a145 ("reset: tegra-bpmp: Handle errors in BPMP response") can be removed now. Signed-off-by: Sameer Pujar Tested-by: Jon Hunter Reviewed-by: Jon Hunter Acked-by: Thierry Reding Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/1641995806-15245-1-git-send-email-spujar@nvidia.com drivers/reset/tegra/reset-bpmp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit da18980a855edf44270f05455e0ec3f2472f64cc Author: Heiner Kallweit Date: Wed Dec 15 11:25:46 2021 +0100 reset: renesas: Check return value of reset_control_deassert() Deasserting the reset is vital, therefore bail out in case of error. Suggested-by: Biju Das Signed-off-by: Heiner Kallweit Reviewed-by: Biju Das Link: https://lore.kernel.org/r/b2131908-0110-006b-862f-080517f3e2d8@gmail.com Signed-off-by: Philipp Zabel drivers/reset/reset-rzg2l-usbphy-ctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 8362f5217bc69c3cd30da73cd2d2ae3af4cc8117 Author: David Heidelberg Date: Wed Dec 8 19:41:49 2021 +0100 dt-bindings: reset: document deprecated HiSilicon property Documenting deprecated property prevents dt-schema validation errors. Signed-off-by: David Heidelberg Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211208184149.99537-1-david@ixit.cz Signed-off-by: Philipp Zabel Documentation/devicetree/bindings/reset/hisilicon,hi3660-reset.yaml | 5 +++++ 1 file changed, 5 insertions(+) commit 16decce22efa0813beafbc9084181e299b69a1a1 Author: Catalin Marinas Date: Fri Apr 1 16:13:56 2022 +0100 arm64: mte: Fix the stack frame size warning in mte_dump_tag_range() With 64K page configurations, the tags array stored on the stack of the mte_dump_tag_range() function is 2048 bytes, triggering a compiler warning when CONFIG_FRAME_WARN is enabled. Switch to a kmalloc() allocation via mte_allocate_tag_storage(). Signed-off-by: Catalin Marinas Fixes: 6dd8b1a0b6cb ("arm64: mte: Dump the MTE tags in the core file") Reported-by: kernel test robot Cc: Will Deacon Link: https://lore.kernel.org/r/20220401151356.1674232-1-catalin.marinas@arm.com Signed-off-by: Will Deacon arch/arm64/kernel/elfcore.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) commit a0ab7e5bc9651d65637f50ee9c09e083919677ed Author: Will Deacon Date: Mon Apr 4 09:44:32 2022 +0100 Revert "arm64: Change elfcore for_each_mte_vma() to use VMA iterator" This reverts commit 3a4f7ef4bed5bdc77a1ac8132f9f0650bbcb3eae. Revert this temporary bodge. It only existed to ease integration with the maple tree work for the 5.18 merge window and that doesn't appear to have landed in any case. Signed-off-by: Will Deacon arch/arm64/kernel/elfcore.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) commit 9fe4e0d3cbfe90152137963cc024ecb63db6e8e6 Author: Chuanhong Guo Date: Sun Apr 3 00:03:13 2022 +0800 mtd: rawnand: fix ecc parameters for mt7622 According to the datasheet, mt7622 only has 5 ECC capabilities instead of 7, and the decoding error register is arranged as follows: +------+---------+---------+---------+---------+ | Bits | 19:15 | 14:10 | 9:5 | 4:0 | +------+---------+---------+---------+---------+ | Name | ERRNUM3 | ERRNUM2 | ERRNUM1 | ERRNUM0 | +------+---------+---------+---------+---------+ This means err_mask should be 0x1f instead of 0x3f and the number of bits shifted in mtk_ecc_get_stats should be 5 instead of 8. This commit introduces err_shift for the difference in this register and fix other existing parameters. Public MT7622 reference manual can be found on [0] and the info this commit is based on is from page 656 and page 660. [0]: https://wiki.banana-pi.org/Banana_Pi_BPI-R64#Documents Fixes: 98dea8d71931 ("mtd: nand: mtk: Support MT7622 NAND flash controller.") Signed-off-by: Chuanhong Guo Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220402160315.919094-1-gch981213@gmail.com drivers/mtd/nand/raw/mtk_ecc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit dbf3f09322141b6f04a33949453b7626f62d9e0b Author: Jiri Slaby Date: Mon Apr 4 07:51:22 2022 +0200 tty: serial: mpc52xx_uart: make rx/tx hooks return unsigned, part II. The below commit changed types of some hooks in struct psc_ops. It also changed the types of the functions which are referenced in the instances of the above struct. However the commit did so only for CONFIG_PPC_MPC52xx, but not for CONFIG_PPC_MPC512x. This results in build errors like: mpc52xx_uart.c:static unsigned int mpc52xx_psc_raw_tx_rdy(struct uart_port *port) mpc52xx_uart.c:static int mpc512x_psc_raw_tx_rdy(struct uart_port *port) ^^^ mpc52xx_uart.c:static int mpc5125_psc_raw_tx_rdy(struct uart_port *port) ^^^ Therefore, fix the latter case now too. Fixes: 18662a1d8f35 (tty: serial: mpc52xx_uart: make rx/tx hooks return unsigned) Cc: Linus Torvalds Reported-by: Guenter Roeck Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220404055122.31194-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/mpc52xx_uart.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit 108e4d4de2b58011eafd14581b6ea7469f1fc467 Author: Stephen Boyd Date: Thu Mar 24 15:29:28 2022 -0700 iio:proximity:sx9324: Fix hardware gain read/write There are four possible gain values according to 'sx9324_gain_vals[]': 1, 2, 4, and 8 The values are off by one when writing and reading the register. The bits should be set according to this equation: ilog2() + 1 so that a gain of 8 is 0x4 in the register field and a gain of 4 is 0x3 in the register field, etc. Note that a gain of 0 is reserved per the datasheet. The default gain (SX9324_REG_PROX_CTRL0_GAIN_1) is also wrong. It should be 0x1 << 3, i.e. 0x8, not 0x80 which is setting the reserved bit 7. Fix this all up to properly handle the hardware gain and return errors for invalid settings. Fixes: 4c18a890dff8 ("iio:proximity:sx9324: Add SX9324 support") Signed-off-by: Stephen Boyd Reviewed-by: Gwendal Grignou Link: https://lore.kernel.org/r/20220324222928.874522-1-swboyd@chromium.org Signed-off-by: Jonathan Cameron drivers/iio/proximity/sx9324.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) commit 74a53a959028e5f28e3c0e9445a876e5c8da147c Author: Stephen Boyd Date: Thu Mar 31 14:04:25 2022 -0700 iio:proximity:sx_common: Fix device property parsing on DT systems After commit 7a3605bef878 ("iio: sx9310: Support ACPI property") we started using the 'indio_dev->dev' to extract device properties for various register settings in sx9310_get_default_reg(). This broke DT based systems because dev_fwnode() used in the device_property*() APIs can't find an 'of_node'. That's because the 'indio_dev->dev.of_node' pointer isn't set until iio_device_register() is called. Set the pointer earlier, next to where the ACPI companion is set, so that the device property APIs work on DT systems. Cc: Gwendal Grignou Fixes: 7a3605bef878 ("iio: sx9310: Support ACPI property") Signed-off-by: Stephen Boyd Reviewed-by: Gwendal Grignou Link: https://lore.kernel.org/r/20220331210425.3908278-1-swboyd@chromium.org Cc: Signed-off-by: Jonathan Cameron drivers/iio/proximity/sx_common.c | 1 + 1 file changed, 1 insertion(+) commit 03779df928a6b34e18b28c17c94627fe014304b3 Author: Jonathan Cameron Date: Sat Feb 26 17:56:04 2022 +0000 iio: adc: ad7280a: Fix wrong variable used when setting thresholds. Name of variable change missed in refactoring patch. Fixes: 112bf4aa4afb ("staging:iio:adc:ad7280a: Switch to standard event control") Reported-by: Colin Ian King Signed-off-by: Jonathan Cameron Cc: Marcelo Schmitt Reviewed-by: Marcelo Schmitt Link: https://lore.kernel.org/r/20220226175604.662422-1-jic23@kernel.org drivers/iio/adc/ad7280a.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit d85cce86a86746354fffb688dd134609c8277adc Author: Wang ShaoBo Date: Sun Mar 20 13:54:57 2022 +0800 iio:filter:admv8818: select REGMAP_SPI for ADMV8818 admv8818 driver needs __devm_regmap_init_spi() which is defined when CONFIG_REGMAP_SPI is set and struct regmap_config when CONFIG_REGMAP is set, so automatically select CONFIG_REGMAP_SPI which also sets CONFIG_REGMAP. Fixes: f34fe888ad05 ("iio:filter:admv8818: add support for ADMV8818") Signed-off-by: Wang ShaoBo Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220320055457.254983-1-bobo.shaobowang@huawei.com Signed-off-by: Jonathan Cameron drivers/iio/filter/Kconfig | 1 + 1 file changed, 1 insertion(+) commit b55b38f7cc12da3b9ef36e7a3b7f8f96737df4d5 Author: Zizhuang Deng Date: Thu Mar 10 20:54:50 2022 +0800 iio: dac: ad5592r: Fix the missing return value. The third call to `fwnode_property_read_u32` did not record the return value, resulting in `channel_offstate` possibly being assigned the wrong value. Fixes: 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs") Signed-off-by: Zizhuang Deng Link: https://lore.kernel.org/r/20220310125450.4164164-1-sunsetdzz@gmail.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/dac/ad5592r-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a2a43fd9d84aec15f8c3dc434d50cd59d8a116b2 Author: Jose Cazarin Date: Fri Mar 25 01:43:40 2022 +0200 iio: dac: dac5571: Fix chip id detection for OF devices When matching an OF device, the match mechanism tries all components of the compatible property. This can result with a device matched with a compatible string that isn't the first in the compatible list. For instance, with a compatible property set to compatible = "ti,dac081c081", "ti,dac5571"; the driver will match the second compatible string, as the first one isn't listed in the of_device_id table. The device will however be named "dac081c081" by the I2C core. This causes an issue when identifying the chip. The probe function receives a i2c_device_id that comes from the module's I2C device ID table. There is no entry in that table for "dac081c081", which results in a NULL pointer passed to the probe function. To fix this, add chip_id information in the data field of the OF device ID table, and retrieve it with device_get_match_data() for OF devices. Signed-off-by: Jose Cazarin Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220324234340.32402-1-laurent.pinchart@ideasonboard.com Signed-off-by: Jonathan Cameron drivers/iio/dac/ti-dac5571.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) commit d926054d5565d3cfa2c7c3f7a48e79bcc10453ed Author: Tong Zhang Date: Sun Mar 27 08:40:05 2022 -0700 iio:imu:bmi160: disable regulator in error path Regulator should be disabled in error path as mentioned in _regulator_put(). Also disable accel if gyro cannot be enabled. [ 16.233604] WARNING: CPU: 0 PID: 2177 at drivers/regulator/core.c:2257 _regulator_put [ 16.240453] Call Trace: [ 16.240572] [ 16.240676] regulator_put+0x26/0x40 [ 16.240853] regulator_bulk_free+0x26/0x50 [ 16.241050] release_nodes+0x3f/0x70 [ 16.241225] devres_release_group+0x147/0x1c0 [ 16.241441] ? bmi160_core_probe+0x175/0x3a0 [bmi160_core] Fixes: 5dea3fb066f0 ("iio: imu: bmi160: added regulator support") Reviewed-by: Andy Shevchenko Signed-off-by: Tong Zhang Link: https://lore.kernel.org/r/20220327154005.806049-1-ztong0001@gmail.com Signed-off-by: Jonathan Cameron drivers/iio/imu/bmi160/bmi160_core.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) commit f50232193e61cf89a73130b5e843fef30763c428 Author: Tom Rix Date: Mon Feb 28 18:52:23 2022 -0800 iio: scd4x: check return of scd4x_write_and_fetch Clang static analysis reports this problem scd4x.c:474:10: warning: The left operand of '==' is a garbage value if (val == 0xff) { ~~~ ^ val is only set from a successful call to scd4x_write_and_fetch() So check it's return. Fixes: 49d22b695cbb ("drivers: iio: chemical: Add support for Sensirion SCD4x CO2 sensor") Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220301025223.223223-1-trix@redhat.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/chemical/scd4x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 460bfa65b0de72f4d8a808bc7cfb1cb591a95b18 Author: Dan Carpenter Date: Wed Mar 16 15:23:54 2022 +0300 iio: dac: ad3552r: fix signedness bug in ad3552r_reset() The "val" variable is used to store either negative error codes from ad3552r_read_reg_wrapper() or positive u16 values on success. It needs to be signed for the error handling to work correctly. Fixes: 8f2b54824b28 ("drivers:iio:dac: Add AD3552R driver support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220316122354.GA16825@kili Signed-off-by: Jonathan Cameron drivers/iio/dac/ad3552r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2316f0fc0ad2aa87a568ceaf3d76be983ee555c3 Author: Axel Lin Date: Sun Apr 3 21:22:35 2022 +0800 regulator: atc260x: Fix missing active_discharge_on setting Without active_discharge_on setting, the SWITCH1 discharge enable control is always disabled. Fix it. Fixes: 3b15ccac161a ("regulator: Add regulator driver for ATC260x PMICs") Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20220403132235.123727-1-axel.lin@ingics.com Signed-off-by: Mark Brown drivers/regulator/atc260x-regulator.c | 1 + 1 file changed, 1 insertion(+) commit fd86d85401c2049f652293877c0f7e6e5afc3bbc Author: Christian Hewitt Date: Thu Feb 10 10:06:38 2022 +0000 arm64: dts: meson: remove CPU opps below 1GHz for SM1 boards Amlogic SM1 devices experience CPU stalls and random board wedges when the system idles and CPU cores clock down to lower opp points. Recent vendor kernels include a change to remove 100-250MHz and other distro sources also remove the 500/667MHz points. Unless all 100-667Mhz opps are removed or the CPU governor forced to performance stalls are still observed, so let's remove them to improve stability and uptime. Fixes: 3d9e76483049 ("arm64: dts: meson-sm1-sei610: enable DVFS") Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220210100638.19130-3-christianshewitt@gmail.com arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 20 -------------------- 1 file changed, 20 deletions(-) commit 6c4d636bc00dc17c63ffb2a73a0da850240e26e3 Author: Christian Hewitt Date: Thu Feb 10 10:06:37 2022 +0000 arm64: dts: meson: remove CPU opps below 1GHz for G12B boards Amlogic G12B devices experience CPU stalls and random board wedges when the system idles and CPU cores clock down to lower opp points. Recent vendor kernels include a change to remove 100-250MHz and other distro sources also remove the 500/667MHz points. Unless all 100-667Mhz opps are removed or the CPU governor forced to performance stalls are still observed, so let's remove them to improve stability and uptime. Fixes: b96d4e92709b ("arm64: dts: meson-g12b: support a311d and s922x cpu operating points") Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220210100638.19130-2-christianshewitt@gmail.com arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi | 40 ----------------------- arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi | 40 ----------------------- 2 files changed, 80 deletions(-) commit 35d516bdcd92fde46202d06b68df1166760208fd Author: Christophe JAILLET Date: Sun Apr 3 12:11:13 2022 +0200 spi: mxic: Fix an error handling path in mxic_spi_probe() If spi_register_master() fails, we must undo a previous mxic_spi_mem_ecc_probe() call, as already done in the remove function. Fixes: 00360ebae483 ("spi: mxic: Add support for pipelined ECC operations") Signed-off-by: Christophe JAILLET Reviewed-by: Miquel Raynal Link: https://lore.kernel.org/r/09c81f751241f6ec0bac7a48d4ec814a742e0d17.1648980664.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown drivers/spi/spi-mxic.c | 1 + 1 file changed, 1 insertion(+) commit 2f8cf5f642e80f8b6b0e660a9c86924a1f41cd80 Author: Geert Uytterhoeven Date: Tue Mar 29 16:00:39 2022 +0200 spi: rpc-if: Fix RPM imbalance in probe error path If rpcif_hw_init() fails, Runtime PM is left enabled. Fixes: b04cc0d912eb80d3 ("memory: renesas-rpc-if: Add support for RZ/G2L") Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/1c78a1f447d019bb66b6e7787f520ae78821e2ae.1648562287.git.geert+renesas@glider.be Signed-off-by: Mark Brown drivers/spi/spi-rpc-if.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 17049bf9de55a42ee96fd34520aff8a484677675 Author: Axel Lin Date: Mon Apr 4 10:25:14 2022 +0800 regulator: rtq2134: Fix missing active_discharge_on setting The active_discharge_on setting was missed, so output discharge resistor is always disabled. Fix it. Fixes: 0555d41497de ("regulator: rtq2134: Add support for Richtek RTQ2134 SubPMIC") Signed-off-by: Axel Lin Link: https://lore.kernel.org/r/20220404022514.449231-1-axel.lin@ingics.com Signed-off-by: Mark Brown drivers/regulator/rtq2134-regulator.c | 1 + 1 file changed, 1 insertion(+) commit 92d96b603738ec4f35cde7198c303ae264dd47cb Author: Jonathan Bakker Date: Sun Mar 27 18:01:54 2022 -0700 regulator: wm8994: Add an off-on delay for WM8994 variant As per Table 130 of the wm8994 datasheet at [1], there is an off-on delay for LDO1 and LDO2. In the wm8958 datasheet [2], I could not find any reference to it. I could not find a wm1811 datasheet to double-check there, but as no one has complained presumably it works without it. This solves the issue on Samsung Aries boards with a wm8994 where register writes fail when the device is powered off and back-on quickly. [1] https://statics.cirrus.com/pubs/proDatasheet/WM8994_Rev4.6.pdf [2] https://statics.cirrus.com/pubs/proDatasheet/WM8958_v3.5.pdf Signed-off-by: Jonathan Bakker Acked-by: Charles Keepax Link: https://lore.kernel.org/r/CY4PR04MB056771CFB80DC447C30D5A31CB1D9@CY4PR04MB0567.namprd04.prod.outlook.com Signed-off-by: Mark Brown drivers/regulator/wm8994-regulator.c | 42 +++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) commit 070a88fd4a03f921b73a2059e97d55faaa447dab Author: Leo Ruan Date: Mon Feb 7 16:14:11 2022 +0100 gpu: ipu-v3: Fix dev_dbg frequency output This commit corrects the printing of the IPU clock error percentage if it is between -0.1% to -0.9%. For example, if the pixel clock requested is 27.2 MHz but only 27.0 MHz can be achieved the deviation is -0.8%. But the fixed point math had a flaw and calculated error of 0.2%. Before: Clocks: IPU 270000000Hz DI 24716667Hz Needed 27200000Hz IPU clock can give 27000000 with divider 10, error 0.2% Want 27200000Hz IPU 270000000Hz DI 24716667Hz using IPU, 27000000Hz After: Clocks: IPU 270000000Hz DI 24716667Hz Needed 27200000Hz IPU clock can give 27000000 with divider 10, error -0.8% Want 27200000Hz IPU 270000000Hz DI 24716667Hz using IPU, 27000000Hz Signed-off-by: Leo Ruan Signed-off-by: Mark Jonas Reviewed-by: Philipp Zabel Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220207151411.5009-1-mark.jonas@de.bosch.com drivers/gpu/ipu-v3/ipu-di.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit e8083acc3f8cc2097917018e947fd4c857f60454 Author: Liu Ying Date: Fri Jan 28 17:19:44 2022 +0800 drm/imx: dw_hdmi-imx: Fix bailout in error cases of probe In dw_hdmi_imx_probe(), if error happens after dw_hdmi_probe() returns successfully, dw_hdmi_remove() should be called where necessary as bailout. Fixes: c805ec7eb210 ("drm/imx: dw_hdmi-imx: move initialization into probe") Cc: Philipp Zabel Cc: David Airlie Cc: Daniel Vetter Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Signed-off-by: Liu Ying Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220128091944.3831256-1-victor.liu@nxp.com drivers/gpu/drm/imx/dw_hdmi-imx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit bce81feb03a20fca7bbdd1c4af16b4e9d5c0e1d3 Author: José Expósito Date: Sat Jan 8 17:52:30 2022 +0100 drm/imx: Fix memory leak in imx_pd_connector_get_modes Avoid leaking the display mode variable if of_get_drm_display_mode fails. Fixes: 76ecd9c9fb24 ("drm/imx: parallel-display: check return code from of_get_drm_display_mode()") Addresses-Coverity-ID: 1443943 ("Resource leak") Signed-off-by: José Expósito Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220108165230.44610-1-jose.exposito89@gmail.com drivers/gpu/drm/imx/parallel-display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 8027a9ad9b3568c5eb49c968ad6c97f279d76730 Author: Jiasheng Jiang Date: Wed Jan 5 15:47:29 2022 +0800 drm/imx: imx-ldb: Check for null pointer after calling kmemdup As the possible failure of the allocation, kmemdup() may return NULL pointer. Therefore, it should be better to check the return value of kmemdup() and return error if fails. Fixes: dc80d7038883 ("drm/imx-ldb: Add support to drm-bridge") Signed-off-by: Jiasheng Jiang Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220105074729.2363657-1-jiasheng@iscas.ac.cn drivers/gpu/drm/imx/imx-ldb.c | 2 ++ 1 file changed, 2 insertions(+) commit b3f1dd52c991d79118f35e6d1bf4d7cb09882e38 Author: Kees Cook Date: Thu Mar 31 12:04:43 2022 -0700 ARM: vexpress/spc: Avoid negative array index when !SMP When building multi_v7_defconfig+CONFIG_SMP=n, -Warray-bounds exposes a couple negative array index accesses: arch/arm/mach-vexpress/spc.c: In function 've_spc_clk_init': arch/arm/mach-vexpress/spc.c:583:21: warning: array subscript -1 is below array bounds of 'bool[2]' {aka '_Bool[2]'} [-Warray-bounds] 583 | if (init_opp_table[cluster]) | ~~~~~~~~~~~~~~^~~~~~~~~ arch/arm/mach-vexpress/spc.c:556:7: note: while referencing 'init_opp_table' 556 | bool init_opp_table[MAX_CLUSTERS] = { false }; | ^~~~~~~~~~~~~~ arch/arm/mach-vexpress/spc.c:592:18: warning: array subscript -1 is below array bounds of 'bool[2]' {aka '_Bool[2]'} [-Warray-bounds] 592 | init_opp_table[cluster] = true; | ~~~~~~~~~~~~~~^~~~~~~~~ arch/arm/mach-vexpress/spc.c:556:7: note: while referencing 'init_opp_table' 556 | bool init_opp_table[MAX_CLUSTERS] = { false }; | ^~~~~~~~~~~~~~ Skip this logic when built !SMP. Link: https://lore.kernel.org/r/20220331190443.851661-1-keescook@chromium.org Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Acked-by: Liviu Dudau Signed-off-by: Kees Cook Signed-off-by: Sudeep Holla arch/arm/mach-vexpress/spc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 98f0d68f94ea21541e0050cc64fa108ade779839 Author: Cristian Marussi Date: Thu Feb 24 15:24:04 2022 +0000 firmware: arm_scmi: Remove clear channel call on the TX channel On SCMI transports whose channels are based on a shared resource the TX channel area has to be acquired by the agent before placing the desired command into the channel and it will be then relinquished by the platform once the related reply has been made available into the channel. On an RX channel the logic is reversed with the platform acquiring the channel area and the agent reliquishing it once done by calling the scmi_clear_channel() helper. As a consequence, even in case of error, the agent must never try to clear a TX channel from its side: restrict the existing clear channel call on the the reply path only to delayed responses since they are indeed coming from the RX channel. Link: https://lore.kernel.org/r/20220224152404.12877-1-cristian.marussi@arm.com Fixes: e9b21c96181c ("firmware: arm_scmi: Make .clear_channel optional") Signed-off-by: Cristian Marussi Signed-off-by: Sudeep Holla drivers/firmware/arm_scmi/driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 7e4920bf59cb085e148796e937a8e8212fd2bae0 Author: Janusz Krzysztofik Date: Sat Apr 2 13:54:44 2022 +0200 video: fbdev: omap: Make it CCF clk API compatible OMAP1 LCDC drivers now omit clk_prepare/unprepare() steps, not supported by OMAP1 custom implementation of clock API. However, non-CCF stubs of those functions exist for use on such platforms until converted to CCF. Update the drivers to be compatible with CCF implementation of clock API. Signed-off-by: Janusz Krzysztofik Signed-off-by: Helge Deller drivers/video/fbdev/omap/hwa742.c | 6 +++--- drivers/video/fbdev/omap/lcdc.c | 6 +++--- drivers/video/fbdev/omap/sossi.c | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) commit 2a8f0934e92242e90be6ef20c5f9f77eef1e333f Author: Christophe Leroy Date: Sat Apr 2 12:22:56 2022 +0200 video: fbdev: aty/matrox/...: Prepare cleanup of powerpc's asm/prom.h powerpc's asm/prom.h brings some headers that it doesn't need itself. In order to clean it up, first add missing headers in users of asm/prom.h Signed-off-by: Christophe Leroy Signed-off-by: Helge Deller drivers/video/fbdev/aty/aty128fb.c | 1 - drivers/video/fbdev/aty/atyfb_base.c | 1 - drivers/video/fbdev/aty/radeon_pm.c | 1 - drivers/video/fbdev/aty/radeonfb.h | 2 +- drivers/video/fbdev/controlfb.c | 3 --- drivers/video/fbdev/matrox/matroxfb_base.h | 1 - drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 2 ++ drivers/video/fbdev/platinumfb.c | 2 +- drivers/video/fbdev/valkyriefb.c | 3 +-- 9 files changed, 5 insertions(+), 11 deletions(-) commit 5c6d8b23cef8feb0039377e355f67aa7441c1115 Author: Haowen Bai Date: Fri Apr 1 16:41:57 2022 +0800 video: fbdev: pm2fb: Fix a kernel-doc formatting issue This function had kernel-doc that not used a hash to separate the function name from the one line description. Signed-off-by: Haowen Bai Signed-off-by: Helge Deller drivers/video/fbdev/pm2fb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) commit f56b919fa4f1b27c589e71f7d90e9785f9196bf1 Author: Geert Uytterhoeven Date: Wed Feb 16 09:39:22 2022 +0100 linux/fb.h: Spelling s/palette/palette/ Fix a misspelling of "palette" in a comment. Signed-off-by: Geert Uytterhoeven Reviewed-by: Pekka Paalanen Signed-off-by: Helge Deller include/uapi/linux/fb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d1d608ce78b3fc330938faaa1f70a91cf20c03a9 Author: Haowen Bai Date: Fri Apr 1 11:41:16 2022 +0800 video: fbdev: sis: fix potential NULL dereference in sisfb_post_sis300() Do no access bios[] if it's NULL. Signed-off-by: Haowen Bai Signed-off-by: Helge Deller drivers/video/fbdev/sis/sis_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b23e868d35d572d459e9be4b994a8c709f1a1606 Author: Wang Qing Date: Tue Mar 29 02:14:32 2022 -0700 video: fbdev: pxafb: use if else instead use if and else instead of consequent if(A) and if (!A) Signed-off-by: Wang Qing Signed-off-by: Helge Deller drivers/video/fbdev/pxafb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit aaf7dbe07385e0b8deb7237eca2a79926bbc7091 Author: Pavel Skripkin Date: Tue Mar 22 23:04:38 2022 +0300 video: fbdev: udlfb: properly check endpoint type syzbot reported warning in usb_submit_urb, which is caused by wrong endpoint type. This driver uses out bulk endpoint for communication, so let's check if this endpoint is present and bail out early if not. Fail log: usb 1-1: BOGUS urb xfer, pipe 3 != type 1 WARNING: CPU: 0 PID: 4822 at drivers/usb/core/urb.c:493 usb_submit_urb+0xd27/0x1540 drivers/usb/core/urb.c:493 Modules linked in: CPU: 0 PID: 4822 Comm: kworker/0:3 Tainted: G W 5.13.0-syzkaller #0 ... Workqueue: usb_hub_wq hub_event RIP: 0010:usb_submit_urb+0xd27/0x1540 drivers/usb/core/urb.c:493 ... Call Trace: dlfb_submit_urb+0x89/0x160 drivers/video/fbdev/udlfb.c:1969 dlfb_set_video_mode+0x21f0/0x2950 drivers/video/fbdev/udlfb.c:315 dlfb_ops_set_par+0x2a3/0x840 drivers/video/fbdev/udlfb.c:1110 dlfb_usb_probe.cold+0x113e/0x1f4a drivers/video/fbdev/udlfb.c:1732 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396 Fixes: 88e58b1a42f8 ("Staging: add udlfb driver") Reported-and-tested-by: syzbot+53ce4a4246d0fe0fee34@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Helge Deller drivers/video/fbdev/udlfb.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) commit af11f31715b50ce77e50fa393bc530df0f33960b Author: Christophe JAILLET Date: Tue Mar 22 21:33:38 2022 +0100 video: fbdev: of: display_timing: Remove a redundant zeroing of memory of_parse_display_timing() already call memset(0) on its 2nd argument, so there is no need to clear it explicitly before calling this function. Use kmalloc() instead of kzalloc() to save a few cycles. Signed-off-by: Christophe JAILLET Signed-off-by: Helge Deller drivers/video/of_display_timing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f84ccad5f5660f86a642a3d7e2bfdc4e7a8a2d49 Author: Vladimir Zapolskiy Date: Fri Apr 1 10:14:24 2022 +0300 cpufreq: qcom-cpufreq-hw: Fix throttle frequency value on EPSS platforms On QCOM platforms with EPSS flavour of cpufreq IP a throttled frequency is obtained from another register REG_DOMAIN_STATE, thus the helper function qcom_lmh_get_throttle_freq() should be modified accordingly, as for now it returns gibberish since .reg_current_vote is unset for EPSS hardware. To exclude a hardcoded magic number 19200 it is replaced by "xo" clock rate in KHz. Fixes: 275157b367f4 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support") Reviewed-by: Bjorn Andersson Signed-off-by: Vladimir Zapolskiy Signed-off-by: Viresh Kumar drivers/cpufreq/qcom-cpufreq-hw.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) commit a1eb080a04477a55c66d70fb3401b059d6dcc3a9 Author: Dmitry Baryshkov Date: Sat Mar 26 18:51:53 2022 +0300 cpufreq: qcom-hw: provide online/offline operations Provide lightweight online and offline operations. This saves us from parsing and tearing down the OPP tables each time the CPU is put online or offline. Tested-by: Vladimir Zapolskiy Reviewed-by: Vladimir Zapolskiy Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Viresh Kumar drivers/cpufreq/qcom-cpufreq-hw.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) commit 6240aaad75e1a623872a830d13393d7aabf1052c Author: Dmitry Baryshkov Date: Sat Mar 26 18:51:52 2022 +0300 cpufreq: qcom-hw: fix the opp entries refcounting The qcom_lmh_dcvs_notify() will get the dev_pm_opp instance for throttling, but will not put it, ending up with leaking a reference count and the following backtrace when putting the CPU offline. Correctly put the reference count of the returned opp instance. [ 84.418025] ------------[ cut here ]------------ [ 84.422770] WARNING: CPU: 7 PID: 43 at drivers/opp/core.c:1396 _opp_table_kref_release+0x188/0x190 [ 84.431966] Modules linked in: [ 84.435106] CPU: 7 PID: 43 Comm: cpuhp/7 Tainted: G S 5.17.0-rc6-00388-g7cf3c0d89c44-dirty #721 [ 84.451631] pstate: 82400005 (Nzcv daif +PAN -UAO +TCO -DIT -SSBS BTYPE=--) [ 84.458781] pc : _opp_table_kref_release+0x188/0x190 [ 84.463878] lr : _opp_table_kref_release+0x78/0x190 [ 84.468885] sp : ffff80000841bc70 [ 84.472294] x29: ffff80000841bc70 x28: ffff6664afe3d000 x27: ffff1db6729e5908 [ 84.479621] x26: 0000000000000000 x25: 0000000000000000 x24: ffff1db6729e58e0 [ 84.486946] x23: ffff8000080a5000 x22: ffff1db40aad80e0 x21: ffff1db4002fec80 [ 84.494277] x20: ffff1db40aad8000 x19: ffffb751c3186300 x18: ffffffffffffffff [ 84.501603] x17: 5300326563697665 x16: 645f676e696c6f6f x15: 00001186c1df5448 [ 84.508928] x14: 00000000000002e9 x13: 0000000000000000 x12: 0000000000000000 [ 84.516256] x11: ffffb751c3186368 x10: ffffb751c39a2a70 x9 : 0000000000000000 [ 84.523585] x8 : ffff1db4008edf00 x7 : ffffb751c328c000 x6 : 0000000000000001 [ 84.530916] x5 : 0000000000040000 x4 : 0000000000000001 x3 : ffff1db4008edf00 [ 84.538247] x2 : 0000000000000000 x1 : ffff1db400aa6100 x0 : ffff1db40aad80d0 [ 84.545579] Call trace: [ 84.548101] _opp_table_kref_release+0x188/0x190 [ 84.552842] dev_pm_opp_remove_all_dynamic+0x8c/0xc0 [ 84.557949] qcom_cpufreq_hw_cpu_exit+0x30/0xdc [ 84.562608] cpufreq_offline.isra.0+0x1b4/0x1d8 [ 84.567270] cpuhp_cpufreq_offline+0x10/0x6c [ 84.571663] cpuhp_invoke_callback+0x16c/0x2b0 [ 84.576231] cpuhp_thread_fun+0x190/0x250 [ 84.580353] smpboot_thread_fn+0x12c/0x230 [ 84.584568] kthread+0xfc/0x100 [ 84.587810] ret_from_fork+0x10/0x20 [ 84.591490] irq event stamp: 3482 [ 84.594901] hardirqs last enabled at (3481): [] call_rcu+0x39c/0x50c [ 84.603119] hardirqs last disabled at (3482): [] el1_dbg+0x24/0x8c [ 84.611074] softirqs last enabled at (310): [] _stext+0x410/0x588 [ 84.619028] softirqs last disabled at (305): [] __irq_exit_rcu+0x158/0x174 [ 84.627691] ---[ end trace 0000000000000000 ]--- Fixes: 275157b367f4 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support") Reported-by: kernel test robot Tested-by: Vladimir Zapolskiy Reviewed-by: Vladimir Zapolskiy Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Viresh Kumar drivers/cpufreq/qcom-cpufreq-hw.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 5e4f009da6be563984ba4db4ef4f32529e9aeb90 Author: Dmitry Baryshkov Date: Sat Mar 26 18:51:51 2022 +0300 cpufreq: qcom-hw: fix the race between LMH worker and cpuhp The driver would disable the worker when cpu is being put offline, but it happens closer to the end of cpufreq_offline(). The function qcom_lmh_dcvs_poll() can be running in parallel with this, when policy->cpus already has been updated. Read policy->related_cpus instead. [ 37.122433] ------------[ cut here ]------------ [ 37.127225] WARNING: CPU: 0 PID: 187 at drivers/base/arch_topology.c:180 topology_update_thermal_pressure+0xec/0x100 [ 37.138098] Modules linked in: [ 37.141279] CPU: 0 PID: 187 Comm: kworker/0:3 Tainted: G S 5.17.0-rc6-00389-g37c83d0b8710-dirty #713 [ 37.158306] Workqueue: events qcom_lmh_dcvs_poll [ 37.163095] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 37.170278] pc : topology_update_thermal_pressure+0xec/0x100 [ 37.176131] lr : topology_update_thermal_pressure+0x20/0x100 [ 37.181977] sp : ffff800009b6bce0 [ 37.185402] x29: ffff800009b6bce0 x28: ffffd87abe92b000 x27: ffff04bd7292e205 [ 37.192792] x26: ffffd87abe930af8 x25: ffffd87abe94e4c8 x24: 0000000000000000 [ 37.200180] x23: ffff04bb01177018 x22: ffff04bb011770c0 x21: ffff04bb01177000 [ 37.207567] x20: ffff04bb0a419000 x19: 00000000000c4e00 x18: 0000000000000000 [ 37.214954] x17: 000000040044ffff x16: 004000b2b5503510 x15: 0000006aaa1326d2 [ 37.222333] x14: 0000000000000232 x13: 0000000000000001 x12: 0000000000000040 [ 37.229718] x11: ffff04bb00400000 x10: 968f57bd39f701c8 x9 : ffff04bb0acc8674 [ 37.237095] x8 : fefefefefefefeff x7 : 0000000000000018 x6 : ffffd87abd90092c [ 37.244478] x5 : 0000000000000016 x4 : 0000000000000000 x3 : 0000000000000100 [ 37.251852] x2 : ffff04bb0a419020 x1 : 0000000000000100 x0 : 0000000000000100 [ 37.259235] Call trace: [ 37.261771] topology_update_thermal_pressure+0xec/0x100 [ 37.267266] qcom_lmh_dcvs_poll+0xbc/0x154 [ 37.271505] process_one_work+0x288/0x69c [ 37.275654] worker_thread+0x74/0x470 [ 37.279450] kthread+0xfc/0x100 [ 37.282712] ret_from_fork+0x10/0x20 [ 37.286417] irq event stamp: 74 [ 37.289664] hardirqs last enabled at (73): [] _raw_spin_unlock_irq+0x44/0x80 [ 37.298632] hardirqs last disabled at (74): [] __schedule+0x710/0xa10 [ 37.306885] softirqs last enabled at (58): [] _stext+0x410/0x588 [ 37.314778] softirqs last disabled at (51): [] __irq_exit_rcu+0x158/0x174 [ 37.323386] ---[ end trace 0000000000000000 ]--- Fixes: 275157b367f4 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support") Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Signed-off-by: Viresh Kumar drivers/cpufreq/qcom-cpufreq-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit be5985b3dbce5ba2af3c8b0f2b7df235c93907e6 Author: Dmitry Baryshkov Date: Sat Mar 26 18:51:50 2022 +0300 cpufreq: qcom-hw: drop affinity hint before freeing the IRQ Drop affinity hint before freeing the throttling IRQ to fix the following trace: [ 185.114773] ------------[ cut here ]------------ [ 185.119517] WARNING: CPU: 7 PID: 43 at kernel/irq/manage.c:1887 free_irq+0x3a4/0x3dc [ 185.127474] Modules linked in: [ 185.130618] CPU: 7 PID: 43 Comm: cpuhp/7 Tainted: G S W 5.17.0-rc6-00386-g67382a5b705d-dirty #690 [ 185.147125] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 185.154269] pc : free_irq+0x3a4/0x3dc [ 185.158031] lr : free_irq+0x33c/0x3dc [ 185.161792] sp : ffff80000841bc90 [ 185.165195] x29: ffff80000841bc90 x28: ffffa6edc5c3d000 x27: ffff6d93729e5908 [ 185.172515] x26: 0000000000000000 x25: ffff6d910109fc00 x24: ffff6d91011490e0 [ 185.179838] x23: ffff6d9101149218 x22: 0000000000000080 x21: 0000000000000000 [ 185.187163] x20: ffff6d9101149000 x19: ffff6d910ab61500 x18: ffffffffffffffff [ 185.194487] x17: 2e35202020202020 x16: 2020202020202020 x15: ffff80008841b9a7 [ 185.201805] x14: 00000000000003c9 x13: 0000000000000001 x12: 0000000000000040 [ 185.209135] x11: ffff6d91005aab58 x10: ffff6d91005aab5a x9 : ffffc6a5ad1c5408 [ 185.216455] x8 : ffff6d91005adb88 x7 : 0000000000000000 x6 : ffffc6a5ab5a91f4 [ 185.223776] x5 : 0000000000000000 x4 : ffff6d91011490a8 x3 : ffffc6a5ad266108 [ 185.231098] x2 : 0000000013033204 x1 : ffff6d9101149000 x0 : ffff6d910a9cc000 [ 185.238421] Call trace: [ 185.240932] free_irq+0x3a4/0x3dc [ 185.244334] qcom_cpufreq_hw_cpu_exit+0x78/0xcc [ 185.248985] cpufreq_offline.isra.0+0x228/0x270 [ 185.253639] cpuhp_cpufreq_offline+0x10/0x20 [ 185.258027] cpuhp_invoke_callback+0x16c/0x2b0 [ 185.262592] cpuhp_thread_fun+0x190/0x250 [ 185.266710] smpboot_thread_fn+0x12c/0x230 [ 185.270914] kthread+0xfc/0x100 [ 185.274145] ret_from_fork+0x10/0x20 [ 185.277820] irq event stamp: 212 [ 185.281136] hardirqs last enabled at (211): [] _raw_spin_unlock_irqrestore+0x8c/0xa0 [ 185.290775] hardirqs last disabled at (212): [] __schedule+0x710/0xa10 [ 185.299081] softirqs last enabled at (0): [] copy_process+0x7d0/0x1a14 [ 185.307475] softirqs last disabled at (0): [<0000000000000000>] 0x0 Fixes: 3ed6dfbd3bb98 ("cpufreq: qcom-hw: Set CPU affinity of dcvsh interrupts") Tested-by: Vladimir Zapolskiy Reviewed-by: Vladimir Zapolskiy Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Signed-off-by: Viresh Kumar drivers/cpufreq/qcom-cpufreq-hw.c | 1 + 1 file changed, 1 insertion(+) commit 5399752299396a3c9df6617f4b3c907d7aa4ded8 Author: Christian Lamparter Date: Sat Mar 19 21:11:03 2022 +0100 ata: libata-core: Disable READ LOG DMA EXT for Samsung 840 EVOs Samsung' 840 EVO with the latest firmware (EXT0DB6Q) locks up with the a message: "READ LOG DMA EXT failed, trying PIO" during boot. Initially this was discovered because it caused a crash with the sata_dwc_460ex controller on a WD MyBook Live DUO. The reporter "Tice Rex" which has the unique opportunity that he has two Samsung 840 EVO SSD! One with the older firmware "EXT0BB0Q" which booted fine and didn't expose "READ LOG DMA EXT". But the newer/latest firmware "EXT0DB6Q" caused the headaches. BugLink: https://github.com/openwrt/openwrt/issues/9505 Signed-off-by: Christian Lamparter Signed-off-by: Damien Le Moal drivers/ata/libata-core.c | 3 +++ 1 file changed, 3 insertions(+) commit 7aa8104a554713b685db729e66511b93d989dd6a Author: Christian Lamparter Date: Sat Mar 19 21:11:02 2022 +0100 ata: sata_dwc_460ex: Fix crash due to OOB write the driver uses libata's "tag" values from in various arrays. Since the mentioned patch bumped the ATA_TAG_INTERNAL to 32, the value of the SATA_DWC_QCMD_MAX needs to account for that. Otherwise ATA_TAG_INTERNAL usage cause similar crashes like this as reported by Tice Rex on the OpenWrt Forum and reproduced (with symbols) here: | BUG: Kernel NULL pointer dereference at 0x00000000 | Faulting instruction address: 0xc03ed4b8 | Oops: Kernel access of bad area, sig: 11 [#1] | BE PAGE_SIZE=4K PowerPC 44x Platform | CPU: 0 PID: 362 Comm: scsi_eh_1 Not tainted 5.4.163 #0 | NIP: c03ed4b8 LR: c03d27e8 CTR: c03ed36c | REGS: cfa59950 TRAP: 0300 Not tainted (5.4.163) | MSR: 00021000 CR: 42000222 XER: 00000000 | DEAR: 00000000 ESR: 00000000 | GPR00: c03d27e8 cfa59a08 cfa55fe0 00000000 0fa46bc0 [...] | [..] | NIP [c03ed4b8] sata_dwc_qc_issue+0x14c/0x254 | LR [c03d27e8] ata_qc_issue+0x1c8/0x2dc | Call Trace: | [cfa59a08] [c003f4e0] __cancel_work_timer+0x124/0x194 (unreliable) | [cfa59a78] [c03d27e8] ata_qc_issue+0x1c8/0x2dc | [cfa59a98] [c03d2b3c] ata_exec_internal_sg+0x240/0x524 | [cfa59b08] [c03d2e98] ata_exec_internal+0x78/0xe0 | [cfa59b58] [c03d30fc] ata_read_log_page.part.38+0x1dc/0x204 | [cfa59bc8] [c03d324c] ata_identify_page_supported+0x68/0x130 | [...] This is because sata_dwc_dma_xfer_complete() NULLs the dma_pending's next neighbour "chan" (a *dma_chan struct) in this '32' case right here (line ~735): > hsdevp->dma_pending[tag] = SATA_DWC_DMA_PENDING_NONE; Then the next time, a dma gets issued; dma_dwc_xfer_setup() passes the NULL'd hsdevp->chan to the dmaengine_slave_config() which then causes the crash. With this patch, SATA_DWC_QCMD_MAX is now set to ATA_MAX_QUEUE + 1. This avoids the OOB. But please note, there was a worthwhile discussion on what ATA_TAG_INTERNAL and ATA_MAX_QUEUE is. And why there should not be a "fake" 33 command-long queue size. Ideally, the dw driver should account for the ATA_TAG_INTERNAL. In Damien Le Moal's words: "... having looked at the driver, it is a bigger change than just faking a 33rd "tag" that is in fact not a command tag at all." Fixes: 28361c403683c ("libata: add extra internal command") Cc: stable@kernel.org # 4.18+ BugLink: https://github.com/openwrt/openwrt/issues/9505 Signed-off-by: Christian Lamparter Signed-off-by: Damien Le Moal drivers/ata/sata_dwc_460ex.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 76ed2f61ae3ee5ca6e3ef155a703ab3eee1eb295 Author: Damien Le Moal Date: Tue Mar 22 16:01:37 2022 +0900 ata: libata-sff: Fix compilation warning in ata_sff_lost_interrupt() When returning false, ata_sff_altstatus() does not return any status value, resulting in a compilation warning in ata_sff_lost_interrupt() ("uninitialized symbol 'status'"). Fix this by initializing the local variable "status" to 0. Fixes: 03c0e84f9c1e ("ata: libata-sff: refactor ata_sff_altstatus()") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal drivers/ata/libata-sff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ec858afda857e361182ceafc3d2ba2b164b8e889 Author: Jens Axboe Date: Wed Mar 30 11:06:02 2022 -0600 io_uring: don't check req->file in io_fsync_prep() This is a leftover from the really old days where we weren't able to track and error early if we need a file and it wasn't assigned. Kill the check. Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Jens Axboe fs/io_uring.c | 3 --- 1 file changed, 3 deletions(-) commit 3123109284176b1532874591f7c81f3837bbdc17 Author: Linus Torvalds Date: Sun Apr 3 14:08:21 2022 -0700 Linux 5.18-rc1 Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 09bb8856d4a7cf3128dedd79cd07d75bbf4a9f04 Merge: 34a53ff911eb 5cfff569cab8 Author: Linus Torvalds Date: Sun Apr 3 12:26:01 2022 -0700 Merge tag 'trace-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull more tracing updates from Steven Rostedt: - Rename the staging files to give them some meaning. Just stage1,stag2,etc, does not show what they are for - Check for NULL from allocation in bootconfig - Hold event mutex for dyn_event call in user events - Mark user events to broken (to work on the API) - Remove eBPF updates from user events - Remove user events from uapi header to keep it from being installed. - Move ftrace_graph_is_dead() into inline as it is called from hot paths and also convert it into a static branch. * tag 'trace-v5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Move user_events.h temporarily out of include/uapi ftrace: Make ftrace_graph_is_dead() a static branch tracing: Set user_events to BROKEN tracing/user_events: Remove eBPF interfaces tracing/user_events: Hold event_mutex during dyn_event_add proc: bootconfig: Add null pointer check tracing: Rename the staging files for trace_events commit 34a53ff911eb30629baad788fbed892f711bdd3e Merge: 8b5656bc4e37 859c2c7b1d06 Author: Linus Torvalds Date: Sun Apr 3 12:21:14 2022 -0700 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fix from Stephen Boyd: "A single revert to fix a boot regression seen when clk_put() started dropping rate range requests. It's best to keep various systems booting so we'll kick this out and try again next time" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: Revert "clk: Drop the rate range on clk_put()" commit 8b5656bc4e3707da642cb4a9126f4849fb518423 Merge: e235f4192f4f d6d6d50f1e80 Author: Linus Torvalds Date: Sun Apr 3 12:15:47 2022 -0700 Merge tag 'x86-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Thomas Gleixner: "A set of x86 fixes and updates: - Make the prctl() for enabling dynamic XSTATE components correct so it adds the newly requested feature to the permission bitmap instead of overwriting it. Add a selftest which validates that. - Unroll string MMIO for encrypted SEV guests as the hypervisor cannot emulate it. - Handle supervisor states correctly in the FPU/XSTATE code so it takes the feature set of the fpstate buffer into account. The feature sets can differ between host and guest buffers. Guest buffers do not contain supervisor states. So far this was not an issue, but with enabling PASID it needs to be handled in the buffer offset calculation and in the permission bitmaps. - Avoid a gazillion of repeated CPUID invocations in by caching the values early in the FPU/XSTATE code. - Enable CONFIG_WERROR in x86 defconfig. - Make the X86 defconfigs more useful by adapting them to Y2022 reality" * tag 'x86-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu/xstate: Consolidate size calculations x86/fpu/xstate: Handle supervisor states in XSTATE permissions x86/fpu/xsave: Handle compacted offsets correctly with supervisor states x86/fpu: Cache xfeature flags from CPUID x86/fpu/xsave: Initialize offset/size cache early x86/fpu: Remove unused supervisor only offsets x86/fpu: Remove redundant XCOMP_BV initialization x86/sev: Unroll string mmio with CC_ATTR_GUEST_UNROLL_STRING_IO x86/config: Make the x86 defconfigs a bit more usable x86/defconfig: Enable WERROR selftests/x86/amx: Update the ARCH_REQ_XCOMP_PERM test x86/fpu/xstate: Fix the ARCH_REQ_XCOMP_PERM implementation commit e235f4192f4f5689ac7aa8a7a320fe157f1bb803 Merge: 63d12cc30574 7dd5ad2d3e82 Author: Linus Torvalds Date: Sun Apr 3 12:08:26 2022 -0700 Merge tag 'core-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RT signal fix from Thomas Gleixner: "Revert the RT related signal changes. They need to be reworked and generalized" * tag 'core-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Revert "signal, x86: Delay calling signals in atomic on RT enabled kernels" commit 63d12cc30574eec9241932cefa17a21df3afd8d0 Merge: 5dee87215b2c 4fe87e818ea4 Author: Linus Torvalds Date: Sun Apr 3 10:31:00 2022 -0700 Merge tag 'dma-mapping-5.18-1' of git://git.infradead.org/users/hch/dma-mapping Pull more dma-mapping updates from Christoph Hellwig: - fix a regression in dma remap handling vs AMD memory encryption (me) - finally kill off the legacy PCI DMA API (Christophe JAILLET) * tag 'dma-mapping-5.18-1' of git://git.infradead.org/users/hch/dma-mapping: dma-mapping: move pgprot_decrypted out of dma_pgprot PCI/doc: cleanup references to the legacy PCI DMA API PCI: Remove the deprecated "pci-dma-compat.h" API commit 5dee87215b2c539e7b82704d56f610a4e558b9cc Merge: be2d3ecedd99 de4fb176622d Author: Linus Torvalds Date: Sun Apr 3 10:17:48 2022 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: - avoid unnecessary rebuilds for library objects - fix return value of __setup handlers - fix invalid input check for "crashkernel=" kernel option - silence KASAN warnings in unwind_frame * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9191/1: arm/stacktrace, kasan: Silence KASAN warnings in unwind_frame() ARM: 9190/1: kdump: add invalid input check for 'crashkernel=0' ARM: 9187/1: JIVE: fix return value of __setup handler ARM: 9189/1: decompressor: fix unneeded rebuilds of library objects commit 7f921a2d6c93051b6002dbb7c1781f1fa5b88cce Author: Michael Ellerman Date: Sun Apr 3 22:12:52 2022 +1000 KVM: PPC: Move kvmhv_on_pseries() into kvm_ppc.h We recently introduced a usage of kvmhv_on_pseries() in powerpc.c, which causes a build error for ppc64_book3e_allmodconfig: arch/powerpc/kvm/powerpc.c:716:8: error: implicit declaration of function ‘kvmhv_on_pseries’ 716 | if (kvmhv_on_pseries()) { | ^~~~~~~~~~~~~~~~ Fix it by moving kvmhv_on_pseries() into kvm_ppc.h so that the stub version is available for book3e builds. Fixes: f771b55731fc ("KVM: PPC: Use KVM_CAP_PPC_AIL_MODE_3") Signed-off-by: Michael Ellerman arch/powerpc/include/asm/kvm_book3s_64.h | 12 ------------ arch/powerpc/include/asm/kvm_ppc.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) commit 692930cc435099580a4b9e32fa781b0688c18439 Author: Nikolay Aleksandrov Date: Fri Apr 1 18:54:27 2022 +0300 selftests: net: fix nexthop warning cleanup double ip typo I made a stupid typo when adding the nexthop route warning selftest and added both $IP and ip after it (double ip) on the cleanup path. The error doesn't show up when running the test, but obviously it doesn't cleanup properly after it. Fixes: 392baa339c6a ("selftests: net: add delete nexthop route warning test") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller tools/testing/selftests/net/fib_nexthops.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5a48b7433a5aee719ab242d2feadaf4c9e065989 Author: Bjorn Helgaas Date: Sat Apr 2 09:46:23 2022 -0500 docs: net: dsa: fix minor grammar and punctuation issues Fix a few typos and minor grammatical issues. Signed-off-by: Bjorn Helgaas Signed-off-by: David S. Miller Documentation/networking/dsa/dsa.rst | 64 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 32 deletions(-) commit 859c2c7b1d0623a6f523f970043db85ce0e5aa60 Author: Stephen Boyd Date: Sat Apr 2 19:28:18 2022 -0700 Revert "clk: Drop the rate range on clk_put()" This reverts commit 7dabfa2bc4803eed83d6f22bd6f045495f40636b. There are multiple reports that this breaks boot on various systems. The common theme is that orphan clks are having rates set on them when that isn't expected. Let's revert it out for now so that -rc1 boots. Reported-by: Marek Szyprowski Reported-by: Tony Lindgren Reported-by: Alexander Stein Reported-by: Naresh Kamboju Link: https://lore.kernel.org/r/366a0232-bb4a-c357-6aa8-636e398e05eb@samsung.com Cc: Maxime Ripard Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220403022818.39572-1-sboyd@kernel.org drivers/clk/clk.c | 42 +++++++------------ drivers/clk/clk_test.c | 108 ------------------------------------------------- 2 files changed, 14 insertions(+), 136 deletions(-) commit be2d3ecedd9911fbfd7e55cc9ceac5f8b79ae4cf Merge: d897b680418d 7e2022af7921 Author: Linus Torvalds Date: Sat Apr 2 12:57:17 2022 -0700 Merge tag 'perf-tools-for-v5.18-2022-04-02' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull more perf tools updates from Arnaldo Carvalho de Melo: - Avoid SEGV if core.cpus isn't set in 'perf stat'. - Stop depending on .git files for building PERF-VERSION-FILE, used in 'perf --version', fixing some perf tools build scenarios. - Convert tracepoint.py example to python3. - Update UAPI header copies from the kernel sources: socket, mman-common, msr-index, KVM, i915 and cpufeatures. - Update copy of libbpf's hashmap.c. - Directly return instead of using local ret variable in evlist__create_syswide_maps(), found by coccinelle. * tag 'perf-tools-for-v5.18-2022-04-02' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf python: Convert tracepoint.py example to python3 perf evlist: Directly return instead of using local ret variable perf cpumap: More cpu map reuse by merge. perf cpumap: Add is_subset function perf evlist: Rename cpus to user_requested_cpus perf tools: Stop depending on .git files for building PERF-VERSION-FILE tools headers cpufeatures: Sync with the kernel sources tools headers UAPI: Sync drm/i915_drm.h with the kernel sources tools headers UAPI: Sync linux/kvm.h with the kernel sources tools kvm headers arm64: Update KVM headers from the kernel sources tools arch x86: Sync the msr-index.h copy with the kernel sources tools headers UAPI: Sync asm-generic/mman-common.h with the kernel perf beauty: Update copy of linux/socket.h with the kernel sources perf tools: Update copy of libbpf's hashmap.c perf stat: Avoid SEGV if core.cpus isn't set commit d897b680418db98f01a0bff038f1b03770a33722 Merge: 0b0fa57a2772 bf5c0c2231bc Author: Linus Torvalds Date: Sat Apr 2 12:33:31 2022 -0700 Merge tag 'kbuild-fixes-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix empty $(PYTHON) expansion. - Fix UML, which got broken by the attempt to suppress Clang warnings. - Fix warning message in modpost. * tag 'kbuild-fixes-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: modpost: restore the warning message for missing symbol versions Revert "um: clang: Strip out -mno-global-merge from USER_CFLAGS" kbuild: Remove '-mno-global-merge' kbuild: fix empty ${PYTHON} in scripts/link-vmlinux.sh kconfig: remove stale comment about removed kconfig_print_symbol() commit 0b0fa57a2772be5bcef199ae5e769295afec0de5 Merge: 38904911e864 41022eff9c2d Author: Linus Torvalds Date: Sat Apr 2 12:14:38 2022 -0700 Merge tag 'mips_5.18_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Thomas Bogendoerfer: - build fix for gpio - fix crc32 build problems - check for failed memory allocations * tag 'mips_5.18_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: crypto: Fix CRC32 code MIPS: rb532: move GPIOD definition into C-files MIPS: lantiq: check the return value of kzalloc() mips: sgi-ip22: add a check for the return of kzalloc() commit 38904911e86495d4690f8d805720b90e65426c71 Merge: 6f34f8c3d617 c15e0ae42c8e Author: Linus Torvalds Date: Sat Apr 2 12:09:02 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: - Only do MSR filtering for MSRs accessed by rdmsr/wrmsr - Documentation improvements - Prevent module exit until all VMs are freed - PMU Virtualization fixes - Fix for kvm_irq_delivery_to_apic_fast() NULL-pointer dereferences - Other miscellaneous bugfixes * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (42 commits) KVM: x86: fix sending PV IPI KVM: x86/mmu: do compare-and-exchange of gPTE via the user address KVM: x86: Remove redundant vm_entry_controls_clearbit() call KVM: x86: cleanup enter_rmode() KVM: x86: SVM: fix tsc scaling when the host doesn't support it kvm: x86: SVM: remove unused defines KVM: x86: SVM: move tsc ratio definitions to svm.h KVM: x86: SVM: fix avic spec based definitions again KVM: MIPS: remove reference to trap&emulate virtualization KVM: x86: document limitations of MSR filtering KVM: x86: Only do MSR filtering when access MSR by rdmsr/wrmsr KVM: x86/emulator: Emulate RDPID only if it is enabled in guest KVM: x86/pmu: Fix and isolate TSX-specific performance event logic KVM: x86: mmu: trace kvm_mmu_set_spte after the new SPTE was set KVM: x86/svm: Clear reserved bits written to PerfEvtSeln MSRs KVM: x86: Trace all APICv inhibit changes and capture overall status KVM: x86: Add wrappers for setting/clearing APICv inhibits KVM: x86: Make APICv inhibit reasons an enum and cleanup naming KVM: X86: Handle implicit supervisor access with SMAP KVM: X86: Rename variable smap to not_smap in permission_fault() ... commit bf5c0c2231bcab677e5cdfb7f73e6c79f6d8c2d4 Author: Masahiro Yamada Date: Sat Apr 2 00:56:10 2022 +0900 modpost: restore the warning message for missing symbol versions This log message was accidentally chopped off. I was wondering why this happened, but checking the ML log, Mark precisely followed my suggestion [1]. I just used "..." because I was too lazy to type the sentence fully. Sorry for the confusion. [1]: https://lore.kernel.org/all/CAK7LNAR6bXXk9-ZzZYpTqzFqdYbQsZHmiWspu27rtsFxvfRuVA@mail.gmail.com/ Fixes: 4a6795933a89 ("kbuild: modpost: Explicitly warn about unprototyped symbols") Signed-off-by: Masahiro Yamada Acked-by: Mark Brown Reviewed-by: Nick Desaulniers scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6f34f8c3d6178527d4c02aa3a53c370cc70cb91e Merge: 9a212aaf9536 7198bfc20176 Author: Linus Torvalds Date: Sat Apr 2 11:03:03 2022 -0700 Merge tag 'for-5.18/drivers-2022-04-02' of git://git.kernel.dk/linux-block Pull block driver fix from Jens Axboe: "Got two reports on nbd spewing warnings on load now, which is a regression from a commit that went into your tree yesterday. Revert the problematic change for now" * tag 'for-5.18/drivers-2022-04-02' of git://git.kernel.dk/linux-block: Revert "nbd: fix possible overflow on 'first_minor' in nbd_dev_add()" commit 9a212aaf95369d56f811b60a1ebdfa7e6b0ca030 Merge: 02d4f8a3e05b 22ef7ee3eeb2 Author: Linus Torvalds Date: Sat Apr 2 10:54:52 2022 -0700 Merge tag 'pci-v5.18-changes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fix from Bjorn Helgaas: - Fix Hyper-V "defined but not used" build issue added during merge window (YueHaibing) * tag 'pci-v5.18-changes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: hv: Remove unused hv_set_msi_entry_from_desc() commit 02d4f8a3e05b4d09fcd20bd7dbe4046757e151e2 Merge: b490207017ba 0e8eb5e8acba Author: Linus Torvalds Date: Sat Apr 2 10:44:18 2022 -0700 Merge tag 'tag-chrome-platform-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Benson Leung: "cros_ec_typec: - Check for EC device - Fix a crash when using the cros_ec_typec driver on older hardware not capable of typec commands - Make try power role optional - Mux configuration reorganization series from Prashant cros_ec_debugfs: - Fix use after free. Thanks Tzung-bi sensorhub: - cros_ec_sensorhub fixup - Split trace include file misc: - Add new mailing list for chrome-platform development: chrome-platform@lists.linux.dev Now with patchwork!" * tag 'tag-chrome-platform-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec_debugfs: detach log reader wq from devm platform: chrome: Split trace include file platform/chrome: cros_ec_typec: Update mux flags during partner removal platform/chrome: cros_ec_typec: Configure muxes at start of port update platform/chrome: cros_ec_typec: Get mux state inside configure_mux platform/chrome: cros_ec_typec: Move mux flag checks platform/chrome: cros_ec_typec: Check for EC device platform/chrome: cros_ec_typec: Make try power role optional MAINTAINERS: platform-chrome: Add new chrome-platform@lists.linux.dev list commit 7198bfc2017644c6b92d2ecef9b8b8e0363bb5fd Author: Jens Axboe Date: Sat Apr 2 11:40:23 2022 -0600 Revert "nbd: fix possible overflow on 'first_minor' in nbd_dev_add()" This reverts commit 6d35d04a9e18990040e87d2bbf72689252669d54. Both Gabriel and Borislav report that this commit casues a regression with nbd: sysfs: cannot create duplicate filename '/dev/block/43:0' Revert it before 5.18-rc1 and we'll investigage this separately in due time. Link: https://lore.kernel.org/all/YkiJTnFOt9bTv6A2@zn.tnic/ Reported-by: Gabriel L. Somlo Reported-by: Borislav Petkov Signed-off-by: Jens Axboe drivers/block/nbd.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) commit b490207017ba237d97b735b2aa66dc241ccd18f5 Author: Eric Dumazet Date: Mon Mar 28 18:07:04 2022 +0100 watch_queue: Free the page array when watch_queue is dismantled Commit 7ea1a0124b6d ("watch_queue: Free the alloc bitmap when the watch_queue is torn down") took care of the bitmap, but not the page array. BUG: memory leak unreferenced object 0xffff88810d9bc140 (size 32): comm "syz-executor335", pid 3603, jiffies 4294946994 (age 12.840s) hex dump (first 32 bytes): 40 a7 40 04 00 ea 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: kmalloc_array include/linux/slab.h:621 [inline] kcalloc include/linux/slab.h:652 [inline] watch_queue_set_size+0x12f/0x2e0 kernel/watch_queue.c:251 pipe_ioctl+0x82/0x140 fs/pipe.c:632 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0xfc/0x140 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] Reported-by: syzbot+25ea042ae28f3888727a@syzkaller.appspotmail.com Fixes: c73be61cede5 ("pipe: Add general notification queue support") Signed-off-by: Eric Dumazet Signed-off-by: David Howells Cc: Jann Horn Link: https://lore.kernel.org/r/20220322004654.618274-1-eric.dumazet@gmail.com/ Signed-off-by: Linus Torvalds kernel/watch_queue.c | 1 + 1 file changed, 1 insertion(+) commit 1cd927ad6f62f27d8908498dcbf61395c5dd5fe2 Author: Steven Rostedt (Google) Date: Fri Apr 1 14:39:03 2022 -0400 tracing: mark user_events as BROKEN After being merged, user_events become more visible to a wider audience that have concerns with the current API. It is too late to fix this for this release, but instead of a full revert, just mark it as BROKEN (which prevents it from being selected in make config). Then we can work finding a better API. If that fails, then it will need to be completely reverted. To not have the code silently bitrot, still allow building it with COMPILE_TEST. And to prevent the uapi header from being installed, then later changed, and then have an old distro user space see the old version, move the header file out of the uapi directory. Surround the include with CONFIG_COMPILE_TEST to the current location, but when the BROKEN tag is taken off, it will use the uapi directory, and fail to compile. This is a good way to remind us to move the header back. Link: https://lore.kernel.org/all/20220330155835.5e1f6669@gandalf.local.home Link: https://lkml.kernel.org/r/20220330201755.29319-1-mathieu.desnoyers@efficios.com Suggested-by: Mathieu Desnoyers Signed-off-by: Steven Rostedt (Google) Signed-off-by: Linus Torvalds include/{uapi => }/linux/user_events.h | 0 kernel/trace/Kconfig | 1 + kernel/trace/trace_events_user.c | 5 +++++ 3 files changed, 6 insertions(+) commit 5cfff569cab8bf544bab62c911c5d6efd5af5e05 Author: Steven Rostedt (Google) Date: Fri Apr 1 14:39:03 2022 -0400 tracing: Move user_events.h temporarily out of include/uapi While user_events API is under development and has been marked for broken to not let the API become fixed, move the header file out of the uapi directory. This is to prevent it from being installed, then later changed, and then have an old distro user space update with a new kernel, where applications see the user_events being available, but the old header is in place, and then they get compiled incorrectly. Also, surround the include with CONFIG_COMPILE_TEST to the current location, but when the BROKEN tag is taken off, it will use the uapi directory, and fail to compile. This is a good way to remind us to move the header back. Link: https://lore.kernel.org/all/20220330155835.5e1f6669@gandalf.local.home Link: https://lkml.kernel.org/r/20220330201755.29319-1-mathieu.desnoyers@efficios.com Link: https://lkml.kernel.org/r/20220401143903.188384f3@gandalf.local.home Suggested-by: Mathieu Desnoyers Signed-off-by: Steven Rostedt (Google) include/{uapi => }/linux/user_events.h | 0 kernel/trace/trace_events_user.c | 5 +++++ 2 files changed, 5 insertions(+) commit 18bfee3216fa6f28d55ebf88d824a539d2bec3c7 Author: Christophe Leroy Date: Wed Mar 30 09:00:19 2022 +0200 ftrace: Make ftrace_graph_is_dead() a static branch ftrace_graph_is_dead() is used on hot paths, it just reads a variable in memory and is not worth suffering function call constraints. For instance, at entry of prepare_ftrace_return(), inlining it avoids saving prepare_ftrace_return() parameters to stack and restoring them after calling ftrace_graph_is_dead(). While at it using a static branch is even more performant and is rather well adapted considering that the returned value will almost never change. Inline ftrace_graph_is_dead() and replace 'kill_ftrace_graph' bool by a static branch. The performance improvement is noticeable. Link: https://lkml.kernel.org/r/e0411a6a0ed3eafff0ad2bc9cd4b0e202b4617df.1648623570.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Signed-off-by: Steven Rostedt (Google) include/linux/ftrace.h | 16 +++++++++++++++- kernel/trace/fgraph.c | 17 +++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) commit fcbf591cedbd44d82d7765b3c7e261858108593f Author: Steven Rostedt (Google) Date: Wed Mar 30 15:58:35 2022 -0400 tracing: Set user_events to BROKEN After being merged, user_events become more visible to a wider audience that have concerns with the current API. It is too late to fix this for this release, but instead of a full revert, just mark it as BROKEN (which prevents it from being selected in make config). Then we can work finding a better API. If that fails, then it will need to be completely reverted. Link: https://lore.kernel.org/all/2059213643.196683.1648499088753.JavaMail.zimbra@efficios.com/ Link: https://lkml.kernel.org/r/20220330155835.5e1f6669@gandalf.local.home Signed-off-by: Steven Rostedt (Google) kernel/trace/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 768c1e7f1de03afd0b55e0e951efc272309eeb52 Author: Beau Belgrave Date: Tue Mar 29 10:30:51 2022 -0700 tracing/user_events: Remove eBPF interfaces Remove eBPF interfaces within user_events to ensure they are fully reviewed. Link: https://lore.kernel.org/all/20220329165718.GA10381@kbox/ Link: https://lkml.kernel.org/r/20220329173051.10087-1-beaub@linux.microsoft.com Suggested-by: Alexei Starovoitov Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) Documentation/trace/user_events.rst | 14 ++----- include/uapi/linux/user_events.h | 53 --------------------------- kernel/trace/trace_events_user.c | 73 +------------------------------------ 3 files changed, 4 insertions(+), 136 deletions(-) commit efe34e99fc41ad2b3fd3bbe79ecd3906620ec961 Author: Beau Belgrave Date: Mon Mar 28 15:32:25 2022 -0700 tracing/user_events: Hold event_mutex during dyn_event_add Make sure the event_mutex is properly held during dyn_event_add call. This is required when adding dynamic events. Link: https://lkml.kernel.org/r/20220328223225.1992-1-beaub@linux.microsoft.com Reported-by: Mathieu Desnoyers Signed-off-by: Beau Belgrave Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events_user.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit bed5b60bf67ccd8957b8c0558fead30c4a3f5d3f Author: Lv Ruyi Date: Tue Mar 29 10:40:04 2022 +0000 proc: bootconfig: Add null pointer check kzalloc is a memory allocation function which can return NULL when some internal memory errors happen. It is safer to add null pointer check. Link: https://lkml.kernel.org/r/20220329104004.2376879-1-lv.ruyi@zte.com.cn Cc: stable@vger.kernel.org Fixes: c1a3c36017d4 ("proc: bootconfig: Add /proc/bootconfig to show boot config list") Acked-by: Masami Hiramatsu Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Steven Rostedt (Google) fs/proc/bootconfig.c | 2 ++ 1 file changed, 2 insertions(+) commit 84055411d861d3a2b485ad629fce7d2179d72c1e Author: Steven Rostedt (Google) Date: Tue Mar 29 16:50:44 2022 -0400 tracing: Rename the staging files for trace_events When looking for implementation of different phases of the creation of the TRACE_EVENT() macro, it is pretty useless when all helper macro redefinitions are in files labeled "stageX_defines.h". Rename them to state which phase the files are for. For instance, when looking for the defines that are used to create the event fields, seeing "stage4_event_fields.h" gives the developer a good idea that the defines are in that file. Signed-off-by: Steven Rostedt (Google) .../stages/{stage1_defines.h => stage1_struct_define.h} | 0 .../stages/{stage2_defines.h => stage2_data_offsets.h} | 0 .../stages/{stage3_defines.h => stage3_trace_output.h} | 0 .../stages/{stage4_defines.h => stage4_event_fields.h} | 0 .../stages/{stage5_defines.h => stage5_get_offsets.h} | 0 .../stages/{stage6_defines.h => stage6_event_callback.h} | 0 .../stages/{stage7_defines.h => stage7_class_define.h} | 0 include/trace/trace_custom_events.h | 14 +++++++------- include/trace/trace_events.h | 14 +++++++------- 9 files changed, 14 insertions(+), 14 deletions(-) commit c15e0ae42c8e5a61e9aca8aac920517cf7b3e94e Author: Li RongQing Date: Wed Mar 9 16:35:44 2022 +0800 KVM: x86: fix sending PV IPI If apic_id is less than min, and (max - apic_id) is greater than KVM_IPI_CLUSTER_SIZE, then the third check condition is satisfied but the new apic_id does not fit the bitmask. In this case __send_ipi_mask should send the IPI. This is mostly theoretical, but it can happen if the apic_ids on three iterations of the loop are for example 1, KVM_IPI_CLUSTER_SIZE, 0. Fixes: aaffcfd1e82 ("KVM: X86: Implement PV IPIs in linux guest") Signed-off-by: Li RongQing Message-Id: <1646814944-51801-1-git-send-email-lirongqing@baidu.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini arch/x86/kernel/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2a8859f373b0a86f0ece8ec8312607eacf12485d Author: Paolo Bonzini Date: Tue Mar 29 12:56:24 2022 -0400 KVM: x86/mmu: do compare-and-exchange of gPTE via the user address FNAME(cmpxchg_gpte) is an inefficient mess. It is at least decent if it can go through get_user_pages_fast(), but if it cannot then it tries to use memremap(); that is not just terribly slow, it is also wrong because it assumes that the VM_PFNMAP VMA is contiguous. The right way to do it would be to do the same thing as hva_to_pfn_remapped() does since commit add6a0cd1c5b ("KVM: MMU: try to fix up page faults before giving up", 2016-07-05), using follow_pte() and fixup_user_fault() to determine the correct address to use for memremap(). To do this, one could for example extract hva_to_pfn() for use outside virt/kvm/kvm_main.c. But really there is no reason to do that either, because there is already a perfectly valid address to do the cmpxchg() on, only it is a userspace address. That means doing user_access_begin()/user_access_end() and writing the code in assembly to handle exceptions correctly. Worse, the guest PTE can be 8-byte even on i686 so there is the extra complication of using cmpxchg8b to account for. But at least it is an efficient mess. (Thanks to Linus for suggesting improvement on the inline assembly). Reported-by: Qiuhao Li Reported-by: Gaoning Pan Reported-by: Yongkang Jia Reported-by: syzbot+6cde2282daa792c49ab8@syzkaller.appspotmail.com Debugged-by: Tadeusz Struk Tested-by: Maxim Levitsky Cc: stable@vger.kernel.org Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs") Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/paging_tmpl.h | 74 +++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 40 deletions(-) commit 4335edbbc1284259b17590f76a21fd4a162b4305 Author: Zhenzhong Duan Date: Fri Mar 11 18:26:43 2022 +0800 KVM: x86: Remove redundant vm_entry_controls_clearbit() call When emulating exit from long mode, EFER_LMA is cleared with vmx_set_efer(). This will already unset the VM_ENTRY_IA32E_MODE control bit as requested by SDM, so there is no need to unset VM_ENTRY_IA32E_MODE again in exit_lmode() explicitly. In case EFER isn't supported by hardware, long mode isn't supported, so exit_lmode() cannot be reached. Note that, thanks to the shadow controls mechanism, this change doesn't eliminate vmread or vmwrite. Signed-off-by: Zhenzhong Duan Message-Id: <20220311102643.807507-3-zhenzhong.duan@intel.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/vmx/vmx.c | 1 - 1 file changed, 1 deletion(-) commit b76edfe91a87a5cca19cdca09bf6d08f08d4d6e9 Author: Zhenzhong Duan Date: Fri Mar 11 18:26:42 2022 +0800 KVM: x86: cleanup enter_rmode() vmx_set_efer() sets uret->data but, in fact if the value of uret->data will be used vmx_setup_uret_msrs() will have rewritten it with the value returned by update_transition_efer(). uret->data is consumed if and only if uret->load_into_hardware is true, and vmx_setup_uret_msrs() takes care of (a) updating uret->data before setting uret->load_into_hardware to true (b) setting uret->load_into_hardware to false if uret->data isn't updated. Opportunistically use "vmx" directly instead of redoing to_vmx(). Signed-off-by: Zhenzhong Duan Message-Id: <20220311102643.807507-2-zhenzhong.duan@intel.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/vmx/vmx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) commit 880993138396f8f0be620c425d08f84490c35251 Author: Maxim Levitsky Date: Tue Mar 22 19:24:48 2022 +0200 KVM: x86: SVM: fix tsc scaling when the host doesn't support it It was decided that when TSC scaling is not supported, the virtual MSR_AMD64_TSC_RATIO should still have the default '1.0' value. However in this case kvm_max_tsc_scaling_ratio is not set, which breaks various assumptions. Fix this by always calculating kvm_max_tsc_scaling_ratio regardless of host support. For consistency, do the same for VMX. Suggested-by: Paolo Bonzini Signed-off-by: Maxim Levitsky Message-Id: <20220322172449.235575-8-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/svm.c | 4 ++-- arch/x86/kvm/vmx/vmx.c | 7 +++---- arch/x86/kvm/x86.c | 4 +--- 3 files changed, 6 insertions(+), 9 deletions(-) commit f37b735e31f418f9a607ad6ed9fda75482a8d385 Author: Maxim Levitsky Date: Tue Mar 22 19:24:47 2022 +0200 kvm: x86: SVM: remove unused defines Remove some unused #defines from svm.c Signed-off-by: Maxim Levitsky Message-Id: <20220322172449.235575-7-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/svm.c | 8 -------- 1 file changed, 8 deletions(-) commit bb2aa78e9a90769993d8cefd9920f81355853a98 Author: Maxim Levitsky Date: Tue Mar 22 19:24:46 2022 +0200 KVM: x86: SVM: move tsc ratio definitions to svm.h Another piece of SVM spec which should be in the header file Signed-off-by: Maxim Levitsky Message-Id: <20220322172449.235575-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/svm.h | 6 ++++++ arch/x86/kvm/svm/svm.c | 15 +++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) commit 0dacc3df898e219fa774f39e5e10d686364e0a27 Author: Maxim Levitsky Date: Tue Mar 22 19:24:45 2022 +0200 KVM: x86: SVM: fix avic spec based definitions again Due to wrong rebase, commit 4a204f7895878 ("KVM: SVM: Allow AVIC support on system w/ physical APIC ID > 255") moved avic spec #defines back to avic.c. Move them back, and while at it extend AVIC_DOORBELL_PHYSICAL_ID_MASK to 12 bits as well (it will be used in nested avic) Signed-off-by: Maxim Levitsky Message-Id: <20220322172449.235575-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/svm.h | 8 +++++--- arch/x86/kvm/svm/svm.h | 11 ----------- 2 files changed, 5 insertions(+), 14 deletions(-) commit fe5f691413c12999e747695b7220635375520f63 Author: Paolo Bonzini Date: Sun Mar 13 15:05:22 2022 +0100 KVM: MIPS: remove reference to trap&emulate virtualization Signed-off-by: Paolo Bonzini Message-Id: <20220313140522.1307751-1-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/api.rst | 6 ------ 1 file changed, 6 deletions(-) commit ce2f72e26c1a352f5f2d1cda19bcafeff6c3b4fc Author: Paolo Bonzini Date: Tue Mar 15 18:17:15 2022 -0400 KVM: x86: document limitations of MSR filtering MSR filtering requires an exit to userspace that is hard to implement and would be very slow in the case of nested VMX vmexit and vmentry MSR accesses. Document the limitation. Signed-off-by: Paolo Bonzini Documentation/virt/kvm/api.rst | 5 +++++ 1 file changed, 5 insertions(+) commit ac8d6cad3c7b39633d5899dc2fa9abec7135e83e Author: Hou Wenlong Date: Mon Mar 7 20:26:33 2022 +0800 KVM: x86: Only do MSR filtering when access MSR by rdmsr/wrmsr If MSR access is rejected by MSR filtering, kvm_set_msr()/kvm_get_msr() would return KVM_MSR_RET_FILTERED, and the return value is only handled well for rdmsr/wrmsr. However, some instruction emulation and state transition also use kvm_set_msr()/kvm_get_msr() to do msr access but may trigger some unexpected results if MSR access is rejected, E.g. RDPID emulation would inject a #UD but RDPID wouldn't cause a exit when RDPID is supported in hardware and ENABLE_RDTSCP is set. And it would also cause failure when load MSR at nested entry/exit. Since msr filtering is based on MSR bitmap, it is better to only do MSR filtering for rdmsr/wrmsr. Signed-off-by: Hou Wenlong Message-Id: <2b2774154f7532c96a6f04d71c82a8bec7d9e80b.1646655860.git.houwenlong.hwl@antgroup.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/emulate.c | 4 ++-- arch/x86/kvm/kvm_emulate.h | 2 ++ arch/x86/kvm/x86.c | 50 +++++++++++++++++++++++++++++++++------------- 3 files changed, 40 insertions(+), 16 deletions(-) commit a836839cbfe60dc434c5476a7429cf2bae36415d Author: Hou Wenlong Date: Wed Mar 2 21:15:14 2022 +0800 KVM: x86/emulator: Emulate RDPID only if it is enabled in guest When RDTSCP is supported but RDPID is not supported in host, RDPID emulation is available. However, __kvm_get_msr() would only fail when RDTSCP/RDPID both are disabled in guest, so the emulator wouldn't inject a #UD when RDPID is disabled but RDTSCP is enabled in guest. Fixes: fb6d4d340e05 ("KVM: x86: emulate RDPID") Signed-off-by: Hou Wenlong Message-Id: <1dfd46ae5b76d3ed87bde3154d51c64ea64c99c1.1646226788.git.houwenlong.hwl@antgroup.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/emulate.c | 4 +++- arch/x86/kvm/kvm_emulate.h | 1 + arch/x86/kvm/x86.c | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) commit e644896f5106aa3f6d7e8c7adf2e4dc0fce53555 Author: Like Xu Date: Wed Mar 9 16:42:57 2022 +0800 KVM: x86/pmu: Fix and isolate TSX-specific performance event logic HSW_IN_TX* bits are used in generic code which are not supported on AMD. Worse, these bits overlap with AMD EventSelect[11:8] and hence using HSW_IN_TX* bits unconditionally in generic code is resulting in unintentional pmu behavior on AMD. For example, if EventSelect[11:8] is 0x2, pmc_reprogram_counter() wrongly assumes that HSW_IN_TX_CHECKPOINTED is set and thus forces sampling period to be 0. Also per the SDM, both bits 32 and 33 "may only be set if the processor supports HLE or RTM" and for "IN_TXCP (bit 33): this bit may only be set for IA32_PERFEVTSEL2." Opportunistically eliminate code redundancy, because if the HSW_IN_TX* bit is set in pmc->eventsel, it is already set in attr.config. Reported-by: Ravi Bangoria Reported-by: Jim Mattson Fixes: 103af0a98788 ("perf, kvm: Support the in_tx/in_tx_cp modifiers in KVM arch perfmon emulation v5") Co-developed-by: Ravi Bangoria Signed-off-by: Ravi Bangoria Signed-off-by: Like Xu Message-Id: <20220309084257.88931-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/pmu.c | 15 +++++---------- arch/x86/kvm/vmx/pmu_intel.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 13 deletions(-) commit 5959ff4ae96eece2f0c3dfde5d27bff70ab1ce56 Author: Maxim Levitsky Date: Wed Mar 2 12:24:57 2022 +0200 KVM: x86: mmu: trace kvm_mmu_set_spte after the new SPTE was set It makes more sense to print new SPTE value than the old value. Signed-off-by: Maxim Levitsky Reviewed-by: Sean Christopherson Message-Id: <20220302102457.588450-1-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9b026073db2f1ad0e4d8b61c83316c8497981037 Author: Jim Mattson Date: Sat Feb 26 15:41:31 2022 -0800 KVM: x86/svm: Clear reserved bits written to PerfEvtSeln MSRs AMD EPYC CPUs never raise a #GP for a WRMSR to a PerfEvtSeln MSR. Some reserved bits are cleared, and some are not. Specifically, on Zen3/Milan, bits 19 and 42 are not cleared. When emulating such a WRMSR, KVM should not synthesize a #GP, regardless of which bits are set. However, undocumented bits should not be passed through to the hardware MSR. So, rather than checking for reserved bits and synthesizing a #GP, just clear the reserved bits. This may seem pedantic, but since KVM currently does not support the "Host/Guest Only" bits (41:40), it is necessary to clear these bits rather than synthesizing #GP, because some popular guests (e.g Linux) will set the "Host Only" bit even on CPUs that don't support EFER.SVME, and they don't expect a #GP. For example, root@Ubuntu1804:~# perf stat -e r26 -a sleep 1 Performance counter stats for 'system wide': 0 r26 1.001070977 seconds time elapsed Feb 23 03:59:58 Ubuntu1804 kernel: [ 405.379957] unchecked MSR access error: WRMSR to 0xc0010200 (tried to write 0x0000020000130026) at rIP: 0xffffffff9b276a28 (native_write_msr+0x8/0x30) Feb 23 03:59:58 Ubuntu1804 kernel: [ 405.379958] Call Trace: Feb 23 03:59:58 Ubuntu1804 kernel: [ 405.379963] amd_pmu_disable_event+0x27/0x90 Fixes: ca724305a2b0 ("KVM: x86/vPMU: Implement AMD vPMU code for KVM") Reported-by: Lotus Fenn Signed-off-by: Jim Mattson Reviewed-by: Like Xu Reviewed-by: David Dunn Message-Id: <20220226234131.2167175-1-jmattson@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/pmu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 4f4c4a3ee53cc20569158a05f99b6c2d1f9c998a Author: Sean Christopherson Date: Fri Mar 11 04:35:17 2022 +0000 KVM: x86: Trace all APICv inhibit changes and capture overall status Trace all APICv inhibit changes instead of just those that result in APICv being (un)inhibited, and log the current state. Debugging why APICv isn't working is frustrating as it's hard to see why APICv is still inhibited, and logging only the first inhibition means unnecessary onion peeling. Opportunistically drop the export of the tracepoint, it is not and should not be used by vendor code due to the need to serialize toggling via apicv_update_lock. Note, using the common flow means kvm_apicv_init() switched from atomic to non-atomic bitwise operations. The VM is unreachable at init, so non-atomic is perfectly ok. Signed-off-by: Sean Christopherson Message-Id: <20220311043517.17027-4-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/trace.h | 18 ++++++++++-------- arch/x86/kvm/x86.c | 29 +++++++++++++++++++---------- 2 files changed, 29 insertions(+), 18 deletions(-) commit 320af55a930f30ba49d7cd663280d46705e11383 Author: Sean Christopherson Date: Fri Mar 11 04:35:16 2022 +0000 KVM: x86: Add wrappers for setting/clearing APICv inhibits Add set/clear wrappers for toggling APICv inhibits to make the call sites more readable, and opportunistically rename the inner helpers to align with the new wrappers and to make them more readable as well. Invert the flag from "activate" to "set"; activate is painfully ambiguous as it's not obvious if the inhibit is being activated, or if APICv is being activated, in which case the inhibit is being deactivated. For the functions that take @set, swap the order of the inhibit reason and @set so that the call sites are visually similar to those that bounce through the wrapper. Signed-off-by: Sean Christopherson Message-Id: <20220311043517.17027-3-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm_host.h | 20 ++++++++++++++++---- arch/x86/kvm/hyperv.c | 10 +++++++--- arch/x86/kvm/i8254.c | 6 ++---- arch/x86/kvm/svm/svm.c | 11 +++++------ arch/x86/kvm/trace.h | 8 ++++---- arch/x86/kvm/x86.c | 30 +++++++++++++++--------------- 6 files changed, 49 insertions(+), 36 deletions(-) commit 7491b7b2e1c57990dcd0f60ed2f3f1c92a145486 Author: Sean Christopherson Date: Fri Mar 11 04:35:15 2022 +0000 KVM: x86: Make APICv inhibit reasons an enum and cleanup naming Use an enum for the APICv inhibit reasons, there is no meaning behind their values and they most definitely are not "unsigned longs". Rename the various params to "reason" for consistency and clarity (inhibit may be confused as a command, i.e. inhibit APICv, instead of the reason that is getting toggled/checked). No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20220311043517.17027-2-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm_host.h | 25 +++++++++++++------------ arch/x86/kvm/svm/avic.c | 4 ++-- arch/x86/kvm/svm/svm.h | 2 +- arch/x86/kvm/trace.h | 12 ++++++------ arch/x86/kvm/vmx/vmx.c | 4 ++-- arch/x86/kvm/x86.c | 19 +++++++++++-------- 6 files changed, 35 insertions(+), 31 deletions(-) commit 4f4aa80e3b882cbbafdf95ebc018c72b10879dbb Author: Lai Jiangshan Date: Fri Mar 11 15:03:44 2022 +0800 KVM: X86: Handle implicit supervisor access with SMAP There are two kinds of implicit supervisor access implicit supervisor access when CPL = 3 implicit supervisor access when CPL < 3 Current permission_fault() handles only the first kind for SMAP. But if the access is implicit when SMAP is on, data may not be read nor write from any user-mode address regardless the current CPL. So the second kind should be also supported. The first kind can be detect via CPL and access mode: if it is supervisor access and CPL = 3, it must be implicit supervisor access. But it is not possible to detect the second kind without extra information, so this patch adds an artificial PFERR_EXPLICIT_ACCESS into @access. This extra information also works for the first kind, so the logic is changed to use this information for both cases. The value of PFERR_EXPLICIT_ACCESS is deliberately chosen to be bit 48 which is in the most significant 16 bits of u64 and less likely to be forced to change due to future hardware uses it. This patch removes the call to ->get_cpl() for access mode is determined by @access. Not only does it reduce a function call, but also remove confusions when the permission is checked for nested TDP. The nested TDP shouldn't have SMAP checking nor even the L2's CPL have any bearing on it. The original code works just because it is always user walk for NPT and SMAP fault is not set for EPT in update_permission_bitmask. Signed-off-by: Lai Jiangshan Message-Id: <20220311070346.45023-5-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/mmu.h | 24 +++++++++++------------- arch/x86/kvm/mmu/mmu.c | 4 ++-- arch/x86/kvm/x86.c | 8 ++++++-- 4 files changed, 21 insertions(+), 17 deletions(-) commit 8873c1434fac436f68ac2221676bb148e8fdffa2 Author: Lai Jiangshan Date: Fri Mar 11 15:03:43 2022 +0800 KVM: X86: Rename variable smap to not_smap in permission_fault() Comments above the variable says the bit is set when SMAP is overridden or the same meaning in update_permission_bitmask(): it is not subjected to SMAP restriction. Renaming it to reflect the negative implication and make the code better readability. Signed-off-by: Lai Jiangshan Message-Id: <20220311070346.45023-4-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 94b4a2f1745fe7aaa551d3d6a9424b6616587c72 Author: Lai Jiangshan Date: Fri Mar 11 15:03:42 2022 +0800 KVM: X86: Fix comments in update_permission_bitmask The commit 09f037aa48f3 ("KVM: MMU: speedup update_permission_bitmask") refactored the code of update_permission_bitmask() and change the comments. It added a condition into a list to match the new code, so the number/order for conditions in the comments should be updated too. Signed-off-by: Lai Jiangshan Message-Id: <20220311070346.45023-3-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5b22bbe717d9b96867783cde380c43f6cc28aafd Author: Lai Jiangshan Date: Fri Mar 11 15:03:41 2022 +0800 KVM: X86: Change the type of access u32 to u64 Change the type of access u32 to u64 for FNAME(walk_addr) and ->gva_to_gpa(). The kinds of accesses are usually combinations of UWX, and VMX/SVM's nested paging adds a new factor of access: is it an access for a guest page table or for a final guest physical address. And SMAP relies a factor for supervisor access: explicit or implicit. So @access in FNAME(walk_addr) and ->gva_to_gpa() is better to include all these information to do the walk. Although @access(u32) has enough bits to encode all the kinds, this patch extends it to u64: o Extra bits will be in the higher 32 bits, so that we can easily obtain the traditional access mode (UWX) by converting it to u32. o Reuse the value for the access kind defined by SVM's nested paging (PFERR_GUEST_FINAL_MASK and PFERR_GUEST_PAGE_MASK) as @error_code in kvm_handle_page_fault(). Signed-off-by: Lai Jiangshan Message-Id: <20220311070346.45023-2-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/mmu.h | 8 +++++--- arch/x86/kvm/mmu/mmu.c | 2 +- arch/x86/kvm/mmu/paging_tmpl.h | 8 ++++---- arch/x86/kvm/x86.c | 24 ++++++++++++------------ 5 files changed, 23 insertions(+), 21 deletions(-) commit cf1d88b36ba7e83bdaa50bccc4c47864e8f08cbe Author: David Woodhouse Date: Thu Mar 3 15:41:12 2022 +0000 KVM: Remove dirty handling from gfn_to_pfn_cache completely It isn't OK to cache the dirty status of a page in internal structures for an indefinite period of time. Any time a vCPU exits the run loop to userspace might be its last; the VMM might do its final check of the dirty log, flush the last remaining dirty pages to the destination and complete a live migration. If we have internal 'dirty' state which doesn't get flushed until the vCPU is finally destroyed on the source after migration is complete, then we have lost data because that will escape the final copy. This problem already exists with the use of kvm_vcpu_unmap() to mark pages dirty in e.g. VMX nesting. Note that the actual Linux MM already considers the page to be dirty since we have a writeable mapping of it. This is just about the KVM dirty logging. For the nesting-style use cases (KVM_GUEST_USES_PFN) we will need to track which gfn_to_pfn_caches have been used and explicitly mark the corresponding pages dirty before returning to userspace. But we would have needed external tracking of that anyway, rather than walking the full list of GPCs to find those belonging to this vCPU which are dirty. So let's rely *solely* on that external tracking, and keep it simple rather than laying a tempting trap for callers to fall into. Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-3-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/api.rst | 4 ++++ arch/x86/kvm/xen.c | 5 ++--- include/linux/kvm_host.h | 14 +++++--------- include/linux/kvm_types.h | 1 - virt/kvm/pfncache.c | 41 ++++++++--------------------------------- 5 files changed, 19 insertions(+), 46 deletions(-) commit d0d96121d03d6d9cf608d948247a9f24f5a02da9 Author: Sean Christopherson Date: Thu Mar 3 15:41:11 2022 +0000 KVM: Use enum to track if cached PFN will be used in guest and/or host Replace the guest_uses_pa and kernel_map booleans in the PFN cache code with a unified enum/bitmask. Using explicit names makes it easier to review and audit call sites. Opportunistically add a WARN to prevent passing garbage; instantating a cache without declaring its usage is either buggy or pointless. Signed-off-by: Sean Christopherson Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini Message-Id: <20220303154127.202856-2-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini arch/x86/kvm/xen.c | 2 +- include/linux/kvm_host.h | 16 ++++++++-------- include/linux/kvm_types.h | 10 ++++++++-- virt/kvm/pfncache.c | 14 +++++++------- 4 files changed, 24 insertions(+), 18 deletions(-) commit 4a9e7b9ea252842bc8b14d495706ac6317fafd5d Author: Peter Gonda Date: Fri Mar 4 08:10:32 2022 -0800 KVM: SVM: Fix kvm_cache_regs.h inclusions for is_guest_mode() Include kvm_cache_regs.h to pick up the definition of is_guest_mode(), which is referenced by nested_svm_virtualize_tpr() in svm.h. Remove include from svm_onhpyerv.c which was done only because of lack of include in svm.h. Fixes: 883b0a91f41ab ("KVM: SVM: Move Nested SVM Implementation to nested.c") Cc: Paolo Bonzini Cc: Sean Christopherson Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Peter Gonda Message-Id: <20220304161032.2270688-1-pgonda@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/svm.h | 2 ++ arch/x86/kvm/svm/svm_onhyperv.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) commit 95b065bf5c431c06c68056a03a5853b660640ecc Author: Jim Mattson Date: Mon Mar 7 17:24:52 2022 -0800 KVM: x86/pmu: Use different raw event masks for AMD and Intel The third nybble of AMD's event select overlaps with Intel's IN_TX and IN_TXCP bits. Therefore, we can't use AMD64_RAW_EVENT_MASK on Intel platforms that support TSX. Declare a raw_event_mask in the kvm_pmu structure, initialize it in the vendor-specific pmu_refresh() functions, and use that mask for PERF_TYPE_RAW configurations in reprogram_gp_counter(). Fixes: 710c47651431 ("KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW") Signed-off-by: Jim Mattson Message-Id: <20220308012452.3468611-1-jmattson@google.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/pmu.c | 3 ++- arch/x86/kvm/svm/pmu.c | 1 + arch/x86/kvm/vmx/pmu_intel.c | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) commit df06dae3f2a8bfb83683abf88d3dcde23fc8093d Author: Sean Christopherson Date: Wed Feb 23 16:53:02 2022 +0000 KVM: Don't actually set a request when evicting vCPUs for GFN cache invd Don't actually set a request bit in vcpu->requests when making a request purely to force a vCPU to exit the guest. Logging a request but not actually consuming it would cause the vCPU to get stuck in an infinite loop during KVM_RUN because KVM would see the pending request and bail from VM-Enter to service the request. Note, it's currently impossible for KVM to set KVM_REQ_GPC_INVALIDATE as nothing in KVM is wired up to set guest_uses_pa=true. But, it'd be all too easy for arch code to introduce use of kvm_gfn_to_pfn_cache_init() without implementing handling of the request, especially since getting test coverage of MMU notifier interaction with specific KVM features usually requires a directed test. Opportunistically rename gfn_to_pfn_cache_invalidate_start()'s wake_vcpus to evict_vcpus. The purpose of the request is to get vCPUs out of guest mode, it's supposed to _avoid_ waking vCPUs that are blocking. Opportunistically rename KVM_REQ_GPC_INVALIDATE to be more specific as to what it wants to accomplish, and to genericize the name so that it can used for similar but unrelated scenarios, should they arise in the future. Add a comment and documentation to explain why the "no action" request exists. Add compile-time assertions to help detect improper usage. Use the inner assertless helper in the one s390 path that makes requests without a hardcoded request. Cc: David Woodhouse Signed-off-by: Sean Christopherson Message-Id: <20220223165302.3205276-1-seanjc@google.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/vcpu-requests.rst | 10 +++++++++ arch/s390/kvm/kvm-s390.c | 2 +- include/linux/kvm_host.h | 38 ++++++++++++++++++++++++++------ virt/kvm/kvm_main.c | 3 ++- virt/kvm/pfncache.c | 18 +++++++++------ 5 files changed, 55 insertions(+), 16 deletions(-) commit 79593c086eb95eb2886f36ee6f78a1d6845e1bdf Author: David Woodhouse Date: Tue Mar 29 13:11:47 2022 -0400 KVM: avoid double put_page with gfn-to-pfn cache If the cache's user host virtual address becomes invalid, there is still a path from kvm_gfn_to_pfn_cache_refresh() where __release_gpc() could release the pfn but the gpc->pfn field has not been overwritten with an error value. If this happens, kvm_gfn_to_pfn_cache_unmap will call put_page again on the same page. Cc: stable@vger.kernel.org Fixes: 982ed0de4753 ("KVM: Reinstate gfn_to_pfn_cache with invalidation support") Signed-off-by: David Woodhouse Signed-off-by: Paolo Bonzini virt/kvm/pfncache.c | 1 + 1 file changed, 1 insertion(+) commit f47e5bbbc92f5d234bbab317523c64a65b6ac4e2 Author: Sean Christopherson Date: Fri Mar 25 23:03:48 2022 +0000 KVM: x86/mmu: Zap only TDP MMU leafs in zap range and mmu_notifier unmap Re-introduce zapping only leaf SPTEs in kvm_zap_gfn_range() and kvm_tdp_mmu_unmap_gfn_range(), this time without losing a pending TLB flush when processing multiple roots (including nested TDP shadow roots). Dropping the TLB flush resulted in random crashes when running Hyper-V Server 2019 in a guest with KSM enabled in the host (or any source of mmu_notifier invalidations, KSM is just the easiest to force). This effectively revert commits 873dd122172f8cce329113cfb0dfe3d2344d80c0 and fcb93eb6d09dd302cbef22bd95a5858af75e4156, and thus restores commit cf3e26427c08ad9015956293ab389004ac6a338e, plus this delta on top: bool kvm_tdp_mmu_zap_leafs(struct kvm *kvm, int as_id, gfn_t start, gfn_t end, struct kvm_mmu_page *root; for_each_tdp_mmu_root_yield_safe(kvm, root, as_id) - flush = tdp_mmu_zap_leafs(kvm, root, start, end, can_yield, false); + flush = tdp_mmu_zap_leafs(kvm, root, start, end, can_yield, flush); return flush; } Cc: Ben Gardon Signed-off-by: Sean Christopherson Tested-by: Vitaly Kuznetsov Message-Id: <20220325230348.2587437-1-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 4 ++-- arch/x86/kvm/mmu/tdp_mmu.c | 55 ++++++++++++++-------------------------------- arch/x86/kvm/mmu/tdp_mmu.h | 8 +------ 3 files changed, 19 insertions(+), 48 deletions(-) commit a80ced6ea514000d34bf1239d47553de0d1ee89e Author: Yi Wang Date: Wed Mar 9 19:30:25 2022 +0800 KVM: SVM: fix panic on out-of-bounds guest IRQ As guest_irq is coming from KVM_IRQFD API call, it may trigger crash in svm_update_pi_irte() due to out-of-bounds: crash> bt PID: 22218 TASK: ffff951a6ad74980 CPU: 73 COMMAND: "vcpu8" #0 [ffffb1ba6707fa40] machine_kexec at ffffffff8565b397 #1 [ffffb1ba6707fa90] __crash_kexec at ffffffff85788a6d #2 [ffffb1ba6707fb58] crash_kexec at ffffffff8578995d #3 [ffffb1ba6707fb70] oops_end at ffffffff85623c0d #4 [ffffb1ba6707fb90] no_context at ffffffff856692c9 #5 [ffffb1ba6707fbf8] exc_page_fault at ffffffff85f95b51 #6 [ffffb1ba6707fc50] asm_exc_page_fault at ffffffff86000ace [exception RIP: svm_update_pi_irte+227] RIP: ffffffffc0761b53 RSP: ffffb1ba6707fd08 RFLAGS: 00010086 RAX: ffffb1ba6707fd78 RBX: ffffb1ba66d91000 RCX: 0000000000000001 RDX: 00003c803f63f1c0 RSI: 000000000000019a RDI: ffffb1ba66db2ab8 RBP: 000000000000019a R8: 0000000000000040 R9: ffff94ca41b82200 R10: ffffffffffffffcf R11: 0000000000000001 R12: 0000000000000001 R13: 0000000000000001 R14: ffffffffffffffcf R15: 000000000000005f ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #7 [ffffb1ba6707fdb8] kvm_irq_routing_update at ffffffffc09f19a1 [kvm] #8 [ffffb1ba6707fde0] kvm_set_irq_routing at ffffffffc09f2133 [kvm] #9 [ffffb1ba6707fe18] kvm_vm_ioctl at ffffffffc09ef544 [kvm] RIP: 00007f143c36488b RSP: 00007f143a4e04b8 RFLAGS: 00000246 RAX: ffffffffffffffda RBX: 00007f05780041d0 RCX: 00007f143c36488b RDX: 00007f05780041d0 RSI: 000000004008ae6a RDI: 0000000000000020 RBP: 00000000000004e8 R8: 0000000000000008 R9: 00007f05780041e0 R10: 00007f0578004560 R11: 0000000000000246 R12: 00000000000004e0 R13: 000000000000001a R14: 00007f1424001c60 R15: 00007f0578003bc0 ORIG_RAX: 0000000000000010 CS: 0033 SS: 002b Vmx have been fix this in commit 3a8b0677fc61 (KVM: VMX: Do not BUG() on out-of-bounds guest IRQ), so we can just copy source from that to fix this. Co-developed-by: Yi Liu Signed-off-by: Yi Liu Signed-off-by: Yi Wang Message-Id: <20220309113025.44469-1-wang.yi59@zte.com.cn> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini arch/x86/kvm/svm/avic.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit a1a39128faabc9883a7f9e3f8777b3fbd560fa5f Author: Paolo Bonzini Date: Fri Mar 25 12:42:52 2022 -0400 KVM: MMU: propagate alloc_workqueue failure If kvm->arch.tdp_mmu_zap_wq cannot be created, the failure has to be propagated up to kvm_mmu_init_vm and kvm_arch_init_vm. kvm_arch_init_vm also has to undo all the initialization, so group all the MMU initialization code at the beginning and handle cleaning up of kvm_page_track_init. Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/mmu/mmu.c | 11 +++++++++-- arch/x86/kvm/mmu/tdp_mmu.c | 17 ++++++++++------- arch/x86/kvm/mmu/tdp_mmu.h | 4 ++-- arch/x86/kvm/x86.c | 15 ++++++++++----- 5 files changed, 32 insertions(+), 17 deletions(-) commit c21cabb0fd0b54b8b54235fc1ecfe1195a23bcb2 Author: Chen-Yu Tsai Date: Fri Apr 1 02:48:32 2022 +0800 net: stmmac: Fix unset max_speed difference between DT and non-DT platforms In commit 9cbadf094d9d ("net: stmmac: support max-speed device tree property"), when DT platforms don't set "max-speed", max_speed is set to -1; for non-DT platforms, it stays the default 0. Prior to commit eeef2f6b9f6e ("net: stmmac: Start adding phylink support"), the check for a valid max_speed setting was to check if it was greater than zero. This commit got it right, but subsequent patches just checked for non-zero, which is incorrect for DT platforms. In commit 92c3807b9ac3 ("net: stmmac: convert to phylink_get_linkmodes()") the conversion switched completely to checking for non-zero value as a valid value, which caused 1000base-T to stop getting advertised by default. Instead of trying to fix all the checks, simply leave max_speed alone if DT property parsing fails. Fixes: 9cbadf094d9d ("net: stmmac: support max-speed device tree property") Fixes: 92c3807b9ac3 ("net: stmmac: convert to phylink_get_linkmodes()") Signed-off-by: Chen-Yu Tsai Acked-by: Russell King (Oracle) Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220331184832.16316-1-wens@kernel.org Signed-off-by: Jakub Kicinski drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 31ac3bcee47b8628d676bf4080c56b238d0222d1 Author: Dimitris Michailidis Date: Fri Apr 1 16:24:11 2022 -0700 net/fungible: Fix reference to __udivdi3 on 32b builds 32b builds with CONFIG_PHYS_ADDR_T_64BIT=y, such as i386 PAE, raise a linker error due to a 64b division: ld: drivers/net/ethernet/fungible/funcore/fun_dev.o: in function `fun_dev_enable': (.text+0xe1a): undefined reference to `__udivdi3' The divisor in the offendinng expression is a power of 2. Change it to use an explicit right shift. Fixes: e1ffcc66818f ("net/fungible: Add service module for Fungible drivers") Reported-by: Randy Dunlap Signed-off-by: Dimitris Michailidis Link: https://lore.kernel.org/r/20220401232411.313881-1-dmichail@fungible.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/fungible/funcore/fun_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 88e6c0207623874922712e162e25d9dafd39661e Merge: a4251ab9896c 61e02cdb6ac6 Author: Linus Torvalds Date: Fri Apr 1 19:57:03 2022 -0700 Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs updates from Al Viro: "Assorted bits and pieces" * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: aio: drop needless assignment in aio_read() clean overflow checks in count_mounts() a bit seq_file: fix NULL pointer arithmetic warning uml/x86: use x86 load_unaligned_zeropad() asm/user.h: killed unused macros constify struct path argument of finish_automount()/do_add_mount() fs: Remove FIXME comment in generic_write_checks() commit a4251ab9896cefd75926b11c45aa477f8464cdec Merge: b32e3819a823 49df34221804 Author: Linus Torvalds Date: Fri Apr 1 19:35:56 2022 -0700 Merge tag 'vfs-5.18-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull vfs fix from Darrick Wong: "The erofs developers felt that FIEMAP should handle ranged requests starting at s_maxbytes by returning EFBIG instead of passing the filesystem implementation a nonsense 0-byte request. Not sure why they keep tagging this 'iomap', but the VFS shouldn't be asking for information about ranges of a file that the filesystem already declared that it does not support. - Fix a potential infinite loop in FIEMAP by fixing an off by one error when comparing the requested range against s_maxbytes" * tag 'vfs-5.18-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: fs: fix an infinite loop in iomap_fiemap commit b32e3819a8230332d7848a6fb067aee52d08557e Merge: 1fdff407028c 919edbadebe1 Author: Linus Torvalds Date: Fri Apr 1 19:30:44 2022 -0700 Merge tag 'xfs-5.18-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: "This fixes multiple problems in the reserve pool sizing functions: an incorrect free space calculation, a pointless infinite loop, and even more braindamage that could result in the pool being overfilled. The pile of patches from Dave fix myriad races and UAF bugs in the log recovery code that much to our mutual surprise nobody's tripped over. Dave also fixed a performance optimization that had turned into a regression. Dave Chinner is taking over as XFS maintainer starting Sunday and lasting until 5.19-rc1 is tagged so that I can focus on starting a massive design review for the (feature complete after five years) online repair feature. From then on, he and I will be moving XFS to a co-maintainership model by trading duties every other release. NOTE: I hope very strongly that the other pieces of the (X)FS ecosystem (fstests and xfsprogs) will make similar changes to spread their maintenance load. Summary: - Fix an incorrect free space calculation in xfs_reserve_blocks that could lead to a request for free blocks that will never succeed. - Fix a hang in xfs_reserve_blocks caused by an infinite loop and the incorrect free space calculation. - Fix yet a third problem in xfs_reserve_blocks where multiple racing threads can overfill the reserve pool. - Fix an accounting error that lead to us reporting reserved space as "available". - Fix a race condition during abnormal fs shutdown that could cause UAF problems when memory reclaim and log shutdown try to clean up inodes. - Fix a bug where log shutdown can race with unmount to tear down the log, thereby causing UAF errors. - Disentangle log and filesystem shutdown to reduce confusion. - Fix some confusion in xfs_trans_commit such that a race between transaction commit and filesystem shutdown can cause unlogged dirty inode metadata to be committed, thereby corrupting the filesystem. - Remove a performance optimization in the log as it was discovered that certain storage hardware handle async log flushes so poorly as to cause serious performance regressions. Recent restructuring of other parts of the logging code mean that no performance benefit is seen on hardware that handle it well" * tag 'xfs-5.18-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: drop async cache flushes from CIL commits. xfs: shutdown during log recovery needs to mark the log shutdown xfs: xfs_trans_commit() path must check for log shutdown xfs: xfs_do_force_shutdown needs to block racing shutdowns xfs: log shutdown triggers should only shut down the log xfs: run callbacks before waking waiters in xlog_state_shutdown_callbacks xfs: shutdown in intent recovery has non-intent items in the AIL xfs: aborting inodes on shutdown may need buffer lock xfs: don't report reserved bnobt space as available xfs: fix overfilling of reserve pool xfs: always succeed at setting the reserve pool size xfs: remove infinite loop when reserving free block pool xfs: don't include bnobt blocks when reserving free block pool xfs: document the XFS_ALLOC_AGFL_RESERVE constant commit 1fdff407028c6064be96343f4bac31a0e679cbd0 Merge: 8467b0ed6ce3 2524257bce43 Author: Linus Torvalds Date: Fri Apr 1 19:19:56 2022 -0700 Merge tag 'riscv-for-linus-5.18-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fix from Palmer Dabbelt: - Fix the RISC-V section of the generic CPU idle bindings to comply with the recently tightened DT schema. * tag 'riscv-for-linus-5.18-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: dt-bindings: Fix phandle-array issues in the idle-states bindings commit 8467b0ed6ce37f7e3f87aa3826627dc9cc55ecb2 Merge: d589ae0d4460 2651ee5ae432 Author: Linus Torvalds Date: Fri Apr 1 16:26:57 2022 -0700 Merge tag 'for-5.18/drivers-2022-04-01' of git://git.kernel.dk/linux-block Pull block driver fixes from Jens Axboe: "Followup block driver updates and fixes for the 5.18-rc1 merge window. In detail: - NVMe pull request - Fix multipath hang when disk goes live over reconnect (Anton Eidelman) - fix RCU hole that allowed for endless looping in multipath round robin (Chris Leech) - remove redundant assignment after left shift (Colin Ian King) - add quirks for Samsung X5 SSDs (Monish Kumar R) - fix the read-only state for zoned namespaces with unsupposed features (Pankaj Raghav) - use a private workqueue instead of the system workqueue in nvmet (Sagi Grimberg) - allow duplicate NSIDs for private namespaces (Sungup Moon) - expose use_threaded_interrupts read-only in sysfs (Xin Hao)" - nbd minor allocation fix (Zhang) - drbd fixes and maintainer addition (Lars, Jakob, Christoph) - n64cart build fix (Jackie) - loop compat ioctl fix (Carlos) - misc fixes (Colin, Dongli)" * tag 'for-5.18/drivers-2022-04-01' of git://git.kernel.dk/linux-block: drbd: remove check of list iterator against head past the loop body drbd: remove usage of list iterator variable after loop nbd: fix possible overflow on 'first_minor' in nbd_dev_add() MAINTAINERS: add drbd co-maintainer drbd: fix potential silent data corruption loop: fix ioctl calls using compat_loop_info nvme-multipath: fix hang when disk goes live over reconnect nvme: fix RCU hole that allowed for endless looping in multipath round robin nvme: allow duplicate NSIDs for private namespaces nvmet: remove redundant assignment after left shift nvmet: use a private workqueue instead of the system workqueue nvme-pci: add quirks for Samsung X5 SSDs nvme-pci: expose use_threaded_interrupts read-only in sysfs nvme: fix the read-only state for zoned namespaces with unsupposed features n64cart: convert bi_disk to bi_bdev->bd_disk fix build xen/blkfront: fix comment for need_copy xen-blkback: remove redundant assignment to variable i commit d589ae0d44607a0af65b83113e4cfba1a8af7eb3 Merge: 3b1509f275ce 8d7829ebc1e4 Author: Linus Torvalds Date: Fri Apr 1 16:20:00 2022 -0700 Merge tag 'for-5.18/block-2022-04-01' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Either fixes or a few additions that got missed in the initial merge window pull. In detail: - List iterator fix to avoid leaking value post loop (Jakob) - One-off fix in minor count (Christophe) - Fix for a regression in how io priority setting works for an exiting task (Jiri) - Fix a regression in this merge window with blkg_free() being called in an inappropriate context (Ming) - Misc fixes (Ming, Tom)" * tag 'for-5.18/block-2022-04-01' of git://git.kernel.dk/linux-block: blk-wbt: remove wbt_track stub block: use dedicated list iterator variable block: Fix the maximum minor value is blk_alloc_ext_minor() block: restore the old set_task_ioprio() behaviour wrt PF_EXITING block: avoid calling blkg_free() in atomic context lib/sbitmap: allocate sb->map via kvzalloc_node commit 3b1509f275ce13865c28ce254c36dc7c915808eb Merge: fe35fdb30511 3f1d52abf098 Author: Linus Torvalds Date: Fri Apr 1 16:10:51 2022 -0700 Merge tag 'for-5.18/io_uring-2022-04-01' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "A little bit all over the map, some regression fixes for this merge window, and some general fixes that are stable bound. In detail: - Fix an SQPOLL memory ordering issue (Almog) - Accept fixes (Dylan) - Poll fixes (me) - Fixes for provided buffers and recycling (me) - Tweak to IORING_OP_MSG_RING command added in this merge window (me) - Memory leak fix (Pavel) - Misc fixes and tweaks (Pavel, me)" * tag 'for-5.18/io_uring-2022-04-01' of git://git.kernel.dk/linux-block: io_uring: defer msg-ring file validity check until command issue io_uring: fail links if msg-ring doesn't succeeed io_uring: fix memory leak of uid in files registration io_uring: fix put_kbuf without proper locking io_uring: fix invalid flags for io_put_kbuf() io_uring: improve req fields comments io_uring: enable EPOLLEXCLUSIVE for accept poll io_uring: improve task work cache utilization io_uring: fix async accept on O_NONBLOCK sockets io_uring: remove IORING_CQE_F_MSG io_uring: add flag for disabling provided buffer recycling io_uring: ensure recv and recvmsg handle MSG_WAITALL correctly io_uring: don't recycle provided buffer if punted to async worker io_uring: fix assuming triggered poll waitqueue is the single poll io_uring: bump poll refs to full 31-bits io_uring: remove poll entry from list when canceling all io_uring: fix memory ordering when SQPOLL thread goes to sleep io_uring: ensure that fsnotify is always called io_uring: recycle provided before arming poll commit fe35fdb30511f845608571f7c09062ebb94d96c2 Merge: 7a3ecddc571c 5291984004ed Author: Linus Torvalds Date: Fri Apr 1 15:57:27 2022 -0700 Merge tag 'for-5.18/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper fixes from Mike Snitzer: - Fix DM integrity shrink crash due to journal entry not being marked unused. - Fix DM bio polling to handle possibility that underlying device(s) return BLK_STS_AGAIN during submission. - Fix dm_io and dm_target_io flags race condition on Alpha. - Add some pr_err debugging to help debug cases when DM ioctl structure is corrupted. * tag 'for-5.18/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: fix bio polling to handle possibile BLK_STS_AGAIN dm: fix dm_io and dm_target_io flags race condition on Alpha dm integrity: set journal entry unused when shrinking device dm ioctl: log an error if the ioctl structure is corrupted commit 2524257bce43610f5ec14feccbacf7a103cae94a Author: Palmer Dabbelt Date: Fri Apr 1 12:57:42 2022 -0700 dt-bindings: Fix phandle-array issues in the idle-states bindings As per 39bd2b6a3783 ("dt-bindings: Improve phandle-array schemas"), the phandle-array bindings have been disambiguated. This fixes the new RISC-V idle-states bindings to comply with the schema. Fixes: 1bd524f7e8d8 ("dt-bindings: Add common bindings for ARM and RISC-V idle states") Reviewed-by: Rob Herring Signed-off-by: Palmer Dabbelt Documentation/devicetree/bindings/cpu/idle-states.yaml | 16 ++++++++-------- Documentation/devicetree/bindings/riscv/cpus.yaml | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) commit 7a3ecddc571cc3294e5d6bb5948ff2b0cfa12735 Merge: 9a005bea4f59 edf5f0548fbb Author: Linus Torvalds Date: Fri Apr 1 14:39:28 2022 -0700 Merge tag '5.18-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd Pull ksmbd updates from Steve French: - three cleanup fixes - shorten module load warning - two documentation fixes * tag '5.18-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd: ksmbd: replace usage of found with dedicated list iterator variable ksmbd: Remove a redundant zeroing of memory MAINTAINERS: ksmbd: switch Sergey to reviewer ksmbd: shorten experimental warning on loading the module ksmbd: use netif_is_bridge_port Documentation: ksmbd: update Feature Status table commit 9a005bea4f59b603c413ac1df19cda37aa3aa486 Merge: ec251f3e1851 d6f5e3584524 Author: Linus Torvalds Date: Fri Apr 1 14:31:57 2022 -0700 Merge tag '5.18-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 Pull more cifs updates from Steve French: - three fixes for big endian issues in how Persistent and Volatile file ids were stored - Various misc. fixes: including some for oops, 2 for ioctls, 1 for writeback - cleanup of how tcon (tree connection) status is tracked - Four changesets to move various duplicated protocol definitions (defined both in cifs.ko and ksmbd) into smbfs_common/smb2pdu.h - important performance improvement to use cached handles in some key compounding code paths (reduces numbers of opens/closes sent in some workloads) - fix to allow alternate DFS target to be used to retry on a failed i/o * tag '5.18-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix NULL ptr dereference in smb2_ioctl_query_info() cifs: prevent bad output lengths in smb2_ioctl_query_info() smb3: fix ksmbd bigendian bug in oplock break, and move its struct to smbfs_common smb3: cleanup and clarify status of tree connections smb3: move defines for query info and query fsinfo to smbfs_common smb3: move defines for ioctl protocol header and SMB2 sizes to smbfs_common [smb3] move more common protocol header definitions to smbfs_common cifs: fix incorrect use of list iterator after the loop ksmbd: store fids as opaque u64 integers cifs: fix bad fids sent over wire cifs: change smb2_query_info_compound to use a cached fid, if available cifs: convert the path to utf16 in smb2_query_info_compound cifs: writeback fix cifs: do not skip link targets when an I/O fails commit ec251f3e1851380f3e177e1559fc497843947e35 Merge: cda4351252e7 a4a3d8c52d95 Author: Linus Torvalds Date: Fri Apr 1 14:20:24 2022 -0700 Merge tag 'exfat-for-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat Pull exfat updates from Namjae Jeon: - Add keep_last_dots mount option to allow access to paths with trailing dots - Avoid repetitive volume dirty bit set/clear to improve storage life time * tag 'exfat-for-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: do not clear VolumeDirty in writeback exfat: allow access to paths with trailing dots commit cda4351252e710507d32178dfbb5a7f0f92488f8 Merge: 5a3fe95d7699 5a60542c61f3 Author: Linus Torvalds Date: Fri Apr 1 13:50:50 2022 -0700 Merge tag 'folio-5.18d' of git://git.infradead.org/users/willy/pagecache Pull more filesystem folio updates from Matthew Wilcox: "A mixture of odd changes that didn't quite make it into the original pull and fixes for things that did. Also the readpages changes had to wait for the NFS tree to be pulled first. - Remove ->readpages infrastructure - Remove AOP_FLAG_CONT_EXPAND - Move read_descriptor_t to networking code - Pass the iocb to generic_perform_write - Minor updates to iomap, btrfs, ext4, f2fs, ntfs" * tag 'folio-5.18d' of git://git.infradead.org/users/willy/pagecache: btrfs: Remove a use of PAGE_SIZE in btrfs_invalidate_folio() ntfs: Correct mark_ntfs_record_dirty() folio conversion f2fs: Get the superblock from the mapping instead of the page f2fs: Correct f2fs_dirty_data_folio() conversion ext4: Correct ext4_journalled_dirty_folio() conversion filemap: Remove AOP_FLAG_CONT_EXPAND fs: Pass an iocb to generic_perform_write() fs, net: Move read_descriptor_t to net.h fs: Remove read_actor_t iomap: Simplify is_partially_uptodate a little readahead: Update comments mm: remove the skip_page argument to read_pages mm: remove the pages argument to read_pages fs: Remove ->readpages address space operation readahead: Remove read_cache_pages() commit 5a3fe95d76999980a106f661bf70379818a77701 Merge: a3dfc532b873 3ed4bb77156d Author: Linus Torvalds Date: Fri Apr 1 13:40:44 2022 -0700 Merge tag 'xarray-5.18' of git://git.infradead.org/users/willy/xarray Pull XArray updates from Matthew Wilcox: - Documentation update - Fix test-suite build after move of bitmap.h - Fix xas_create_range() when a large entry is already present - Fix xas_split() of a shadow entry * tag 'xarray-5.18' of git://git.infradead.org/users/willy/xarray: XArray: Update the LRU list in xas_split() XArray: Fix xas_create_range() when multi-order entry present XArray: Include bitmap.h from xarray.h XArray: Document the locking requirement for the xa_state commit a3dfc532b8731843c12bdc45e804eacc47e51e50 Merge: 9ae24d5aa001 1464d00b27b2 Author: Linus Torvalds Date: Fri Apr 1 13:31:57 2022 -0700 Merge tag 'riscv-for-linus-5.18-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull more RISC-V updates from Palmer Dabbelt: "This has a handful of new features: - Support for CURRENT_STACK_POINTER, which enables some extra stack debugging for HARDENED_USERCOPY. - Support for the new SBI CPU idle extension, via cpuidle and suspend drivers. - Profiling has been enabled in the defconfigs. but is mostly fixes and cleanups" * tag 'riscv-for-linus-5.18-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (21 commits) RISC-V: K210 defconfigs: Drop redundant MEMBARRIER=n RISC-V: defconfig: Drop redundant SBI HVC and earlycon Documentation: riscv: remove non-existent directory from table of contents riscv: cpu.c: don't use kernel-doc markers for comments RISC-V: Enable profiling by default RISC-V: module: fix apply_r_riscv_rcv_branch_rela typo RISC-V: Declare per cpu boot data as static RISC-V: Fix a comment typo in riscv_of_parent_hartid() riscv: Increase stack size under KASAN riscv: Fix fill_callchain return value riscv: dts: canaan: Fix SPI3 bus width riscv: Rename "sp_in_global" to "current_stack_pointer" riscv module: remove (NOLOAD) RISC-V: Enable RISC-V SBI CPU Idle driver for QEMU virt machine dt-bindings: Add common bindings for ARM and RISC-V idle states cpuidle: Add RISC-V SBI CPU idle driver cpuidle: Factor-out power domain related code from PSCI domain driver RISC-V: Add SBI HSM suspend related defines RISC-V: Add arch functions for non-retentive suspend entry/exit RISC-V: Rename relocate() and make it global ... commit 9ae24d5aa001622035270de8f46c0634e6c6d55a Merge: ba2d6201a9bf faf79934e65a Author: Linus Torvalds Date: Fri Apr 1 13:26:31 2022 -0700 Merge tag 's390-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull more s390 updates from Vasily Gorbik: - Add kretprobes framepointer verification and return address recovery in stacktrace. - Support control domain masks on custom zcrypt devices and filter admin requests. - Cleanup timer API usage. - Rework absolute lowcore access helpers. - Other various small improvements and fixes. * tag 's390-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (26 commits) s390/alternatives: avoid using jgnop mnemonic s390/pci: rename get_zdev_by_bus() to zdev_from_bus() s390/pci: improve zpci_dev reference counting s390/smp: use physical address for SIGP_SET_PREFIX command s390: cleanup timer API use s390/zcrypt: fix using the correct variable for sizeof() s390/vfio-ap: fix kernel doc and signature of group notifier functions s390/maccess: rework absolute lowcore accessors s390/smp: cleanup control register update routines s390/smp: cleanup target CPU callback starting s390/test_unwind: verify __kretprobe_trampoline is replaced s390/unwind: avoid duplicated unwinding entries for kretprobes s390/unwind: recover kretprobe modified return address in stacktrace s390/kprobes: enable kretprobes framepointer verification s390/test_unwind: extend kretprobe test s390/ap: adjust whitespace s390/ap: use insn format for new instructions s390/alternatives: use insn format for new instructions s390/alternatives: use instructions instead of byte patterns s390/traps: improve panic message for translation-specification exception ... commit ba2d6201a9bfb1c5d5bfbc58a2db73d051b8337a Merge: b012b3235cb9 eeeb4f1075d7 Author: Linus Torvalds Date: Fri Apr 1 13:21:19 2022 -0700 Merge tag 'soc-fixes-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd BergmannL "The introduction of vmap-stack on 32-bit arm caused a regression on a few omap3/omap4 machines that pass a stack variable into a firmware interface. The early pre-ACPI AMD Seattle machines have been broken for a while, Ard Biesheuvel has a series to bring them back for now. A few machines with multiple DMA channels used on a device have the channels in the wrong order according to the binding, which causes a harmless warning. Reversing the order is easier than fixing the tools to suppress the warning" * tag 'soc-fixes-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: arm64: dts: ls1046a: Update i2c node dma properties arm64: dts: ls1043a: Update i2c dma properties ARM: dts: spear1340: Update serial node properties ARM: dts: spear13xx: Update SPI dma properties ARM: OMAP2+: Fix regression for smc calls for vmap stack dt: amd-seattle: add a description of the CPUs and caches dt: amd-seattle: disable IPMI controller and some GPIO blocks on B0 dt: amd-seattle: add description of the SATA/CCP SMMUs dt: amd-seattle: add a description of the PCIe SMMU dt: amd-seattle: fix PCIe legacy interrupt routing dt: amd-seattle: upgrade AMD Seattle XGBE to new SMMU binding dt: amd-seattle: remove Overdrive revision A0 support dt: amd-seattle: remove Husky platform commit 7e2022af7921978ce37bb8fc1a35239b81cbc1af Author: Tanu M Date: Sun Mar 27 23:08:46 2022 -0700 perf python: Convert tracepoint.py example to python3 Convert the tracepoint.py file to python3 as many of the files in tools/perf are already written in python3. Committer testing: # export PYTHONPATH=/tmp/build/perf/python/ # python3 ~acme/git/perf/tools/perf/python/tracepoint.py | head time 67394457376909 prev_comm=swapper/12 prev_pid=0 prev_prio=120 prev_state=0x0 ==> next_comm=gnome-terminal- next_pid=3313 next_prio=120 time 67394457807669 prev_comm=python3 prev_pid=1485930 prev_prio=120 prev_state=0x1 ==> next_comm=swapper/13 next_pid=0 next_prio=120 time 67394457811859 prev_comm=swapper/13 prev_pid=0 prev_prio=120 prev_state=0x0 ==> next_comm=python3 next_pid=1485930 next_prio=120 time 67394457824929 prev_comm=python3 prev_pid=1485930 prev_prio=120 prev_state=0x1 ==> next_comm=swapper/13 next_pid=0 next_prio=120 time 67394457831899 prev_comm=swapper/13 prev_pid=0 prev_prio=120 prev_state=0x0 ==> next_comm=python3 next_pid=1485930 next_prio=120 time 67394457842299 prev_comm=python3 prev_pid=1485930 prev_prio=120 prev_state=0x1 ==> next_comm=swapper/13 next_pid=0 next_prio=120 time 67394457844179 prev_comm=swapper/13 prev_pid=0 prev_prio=120 prev_state=0x0 ==> next_comm=python3 next_pid=1485930 next_prio=120 time 67394457853879 prev_comm=python3 prev_pid=1485930 prev_prio=120 prev_state=0x1 ==> next_comm=swapper/13 next_pid=0 next_prio=120 time 67394457856339 prev_comm=swapper/13 prev_pid=0 prev_prio=120 prev_state=0x0 ==> next_comm=python3 next_pid=1485930 next_prio=120 time 67394457865659 prev_comm=python3 prev_pid=1485930 prev_prio=120 prev_state=0x1 ==> next_comm=swapper/13 next_pid=0 next_prio=120 Traceback (most recent call last): File "/var/home/acme/git/perf/tools/perf/python/tracepoint.py", line 48, in main() File "/var/home/acme/git/perf/tools/perf/python/tracepoint.py", line 37, in main print("time %u prev_comm=%s prev_pid=%d prev_prio=%d prev_state=0x%x ==> next_comm=%s next_pid=%d next_prio=%d" % ( BrokenPipeError: [Errno 32] Broken pipe # Signed-off-by: Tanu M Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/linux-perf-users/CAPS78prawYzRZnyhWjgOnGw4EwoswNwztvfZFdCOPOydFzVwzQ@mail.gmail.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/python/tracepoint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f717d89a2b20dd9201a3ed798cff6b8f09c77e01 Author: Haowen Bai Date: Mon Mar 28 09:55:32 2022 +0800 perf evlist: Directly return instead of using local ret variable Addresses this coccinelle warning: ./tools/perf/util/evlist.c:1333:5-8: Unneeded variable: "err". Return "- ENOMEM" on line 1358 Signed-off-by: Haowen Bai Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/1648432532-23151-1-git-send-email-baihaowen@meizu.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/evlist.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit da0bfb9fdf1fef8d2329efb215abfd94ba262b49 Author: Ian Rogers Date: Mon Mar 28 16:26:46 2022 -0700 perf cpumap: More cpu map reuse by merge. perf_cpu_map__merge() will reuse one of its arguments if they are equal or the other argument is NULL. The arguments could be reused if it is known one set of values is a subset of the other. For example, a map of 0-1 and a map of just 0 when merged yields the map of 0-1. Currently a new map is created rather than adding a reference count to the original 0-1 map. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: German Gomez Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Kajol Jain Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Will Deacon Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20220328232648.2127340-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/lib/perf/cpumap.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) commit c3ad8d23bc0e8cacd8ea2e6615b53c6a7811cb66 Author: Ian Rogers Date: Mon Mar 28 16:26:45 2022 -0700 perf cpumap: Add is_subset function Returns true if the second argument is a subset of the first. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: German Gomez Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Kajol Jain Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Will Deacon Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20220328232648.2127340-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/lib/perf/cpumap.c | 20 ++++++++++++++++++++ tools/lib/perf/include/internal/cpumap.h | 1 + 2 files changed, 21 insertions(+) commit 0df6ade7119daa40904b0c18871169e753663e14 Author: Ian Rogers Date: Mon Mar 28 16:26:44 2022 -0700 perf evlist: Rename cpus to user_requested_cpus evlist contains cpus and all_cpus. all_cpus is the union of the cpu maps of all evsels. For non-task targets, cpus is set to be cpus requested from the command line, defaulting to all online cpus if no cpus are specified. For an uncore event, all_cpus may be just CPU 0 or every online CPU. This causes all_cpus to have fewer values than the cpus variable which is confusing given the 'all' in the name. To try to make the behavior clearer, rename cpus to user_requested_cpus and add comments on the two struct variables. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: German Gomez Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Kajol Jain Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Will Deacon Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20220328232648.2127340-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/lib/perf/evlist.c | 28 ++++++++++++++-------------- tools/lib/perf/include/internal/evlist.h | 7 ++++++- tools/perf/arch/arm/util/cs-etm.c | 8 ++++---- tools/perf/arch/arm64/util/arm-spe.c | 2 +- tools/perf/arch/x86/util/intel-bts.c | 2 +- tools/perf/arch/x86/util/intel-pt.c | 4 ++-- tools/perf/bench/evlist-open-close.c | 2 +- tools/perf/builtin-ftrace.c | 2 +- tools/perf/builtin-record.c | 6 +++--- tools/perf/builtin-stat.c | 10 +++++----- tools/perf/builtin-top.c | 2 +- tools/perf/util/auxtrace.c | 2 +- tools/perf/util/bpf_ftrace.c | 4 ++-- tools/perf/util/evlist.c | 15 ++++++++------- tools/perf/util/record.c | 6 +++--- tools/perf/util/sideband_evlist.c | 3 ++- tools/perf/util/stat-display.c | 2 +- tools/perf/util/synthetic-events.c | 2 +- tools/perf/util/top.c | 8 +++++--- 19 files changed, 62 insertions(+), 53 deletions(-) commit d4ff92659244a4783e424fa41b6f83645d8920c1 Author: John Garry Date: Wed Mar 30 18:22:54 2022 +0800 perf tools: Stop depending on .git files for building PERF-VERSION-FILE This essentially reverts commit c72e3f04b45fb2e5 ("tools/perf/build: Speed up git-version test on re-make") and commit 4e666cdb06eede20 ("perf tools: Fix dependency for version file creation") In commit c72e3f04b45fb2e5 ("tools/perf/build: Speed up git-version test on re-make"), a makefile dependency on .git/HEAD was added. The background is that running PERF-VERSION-FILE is relatively slow, and commands like "git describe" are particularly slow. In commit 4e666cdb06eede20 ("perf tools: Fix dependency for version file creation"), an additional dependency on .git/ORIG_HEAD was added, as .git/HEAD may not change for "git reset --hard HEAD^" command. However, depending on whether we're on a branch or not, a "git cherry-pick" may not lead to the version being updated. As discussed with the git community in [0], using git internal files for dependencies is not reliable. Commit 4e666cdb06ee also breaks some build scenarios [1]. As mentioned, c72e3f04b45fb2e5 ("tools/perf/build: Speed up git-version test on re-make") was added to speed up the build. However in commit 7572733b84997d23 ("perf tools: Fix version kernel tag") we removed the call to "git describe", so just revert Makefile.perf back to same as pre c72e3f04b45fb2e5 ("tools/perf/build: Speed up git-version test on re-make") and the build should not be so slow, as below: Pre 7572733b8499: $> time util/PERF-VERSION-GEN PERF_VERSION = 5.17.rc8.g4e666cdb06ee real 0m0.110s user 0m0.091s sys 0m0.019s Post 7572733b8499: $> time util/PERF-VERSION-GEN PERF_VERSION = 5.17.rc8.g7572733b8499 real 0m0.039s user 0m0.036s sys 0m0.007s [0] https://lore.kernel.org/git/87wngkpddp.fsf@igel.home/T/#m4a4dd6de52fdbe21179306cd57b3761eb07f45f8 [1] https://lore.kernel.org/linux-perf-users/20220329093120.4173283-1-matthieu.baerts@tessares.net/T/#u Committer testing: After a fresh rebuild using 'make -C tools/perf O=/tmp/build/perf install-bin': $ perf -v perf version 5.17.g162f9db407b6 $ git log --oneline -1 162f9db407b6a6e5 (HEAD -> perf/core) perf tools: Stop depending on .git files for building PERF-VERSION-FILE $ Now using a detached tarball, i.e. outside the kernel source tree: $ ls -la perf*tar ls: cannot access 'perf*tar': No such file or directory $ make perf-tar-src-pkg TAR PERF_VERSION = 5.17.g31d10b3ef133 $ ls -la perf*tar -rw-r--r--. 1 acme acme 22241280 Mar 30 13:26 perf-5.17.0.tar $ mv perf-5.17.0.tar /tmp $ cd /tmp $ tar xf perf-5.17.0.tar $ cd perf-5.17.0/ $ make -C tools/perf |& tail CC util/pmu.o CC util/pmu-flex.o CC util/expr-flex.o CC util/expr.o LD util/scripting-engines/perf-in.o LD util/intel-pt-decoder/perf-in.o LD util/perf-in.o LD perf-in.o LINK perf make: Leaving directory '/tmp/perf-5.17.0/tools/perf' $ tools/perf/perf -v perf version 5.17.g31d10b3ef133 $ pwd /tmp/perf-5.17.0 $ cat PERF-VERSION-FILE #define PERF_VERSION "5.17.g31d10b3ef133" $ Fixes: 4e666cdb06eede20 ("perf tools: Fix dependency for version file creation") Reported-by: Matthieu Baerts Signed-off-by: John Garry Tested-by: Arnaldo Carvalho de Melo Tested-by: Matthieu Baerts Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/1648635774-14581-1-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/Makefile.perf | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) commit 5ced81243593dd84f46ee3e7bb3cb8a69ede0276 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: 991625f3dd2cbc4b ("x86/ibt: Add IBT feature, MSR and #CP handling") 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: Peter Zijlstra Link: https://lore.kernel.org/lkml/YkSCx2kr4ambH+Qe@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/arch/x86/include/asm/cpufeatures.h | 1 + 1 file changed, 1 insertion(+) commit f444b2d15f7a025416ace9ec298f0b93ef68be68 Author: Arnaldo Carvalho de Melo Date: Sat Nov 13 11:08:31 2021 -0300 tools headers UAPI: Sync drm/i915_drm.h with the kernel sources To pick up the changes in: caa574ffc4aaf4f2 ("drm/i915/uapi: document behaviour for DG2 64K support") That don't add any new ioctl, so no changes in tooling. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/drm/i915_drm.h' differs from latest version at 'include/uapi/drm/i915_drm.h' diff -u tools/include/uapi/drm/i915_drm.h include/uapi/drm/i915_drm.h Cc: Lucas De Marchi Cc: Matthew Auld Link: http://lore.kernel.org/lkml/YkSChHqaOApscFQ0@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/include/uapi/drm/i915_drm.h | 45 ++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) commit 7ceda0cfcafee15e377ab532b37625bacda5eb84 Author: Arnaldo Carvalho de Melo Date: Sun May 9 09:39:02 2021 -0300 tools headers UAPI: Sync linux/kvm.h with the kernel sources To pick the changes in: 6d8491910fcd3324 ("KVM: x86: Introduce KVM_CAP_DISABLE_QUIRKS2") ef11c9463ae00630 ("KVM: s390: Add vm IOCTL for key checked guest absolute memory access") e9e9feebcbc14b17 ("KVM: s390: Add optional storage key checking to MEMOP IOCTL") That just rebuilds perf, as these patches don't add any new KVM ioctl to be harvested for the the 'perf trace' ioctl syscall argument beautifiers. This is also by now used by tools/testing/selftests/kvm/, a simple test build succeeded. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Cc: Christian Borntraeger Cc: Janis Schoetterl-Glausch Cc: Oliver Upton Cc: Paolo Bonzini Link: http://lore.kernel.org/lkml/YkSCOWHQdir1lhdJ@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/include/uapi/linux/kvm.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 8db38afd12ef2134a033f9d266a9493b9c2cb7c8 Author: Arnaldo Carvalho de Melo Date: Mon Dec 21 12:53:44 2020 -0300 tools kvm headers arm64: Update KVM headers from the kernel sources To pick the changes from: 34739fd95fab3a5e ("KVM: arm64: Indicate SYSTEM_RESET2 in kvm_run::system_event flags field") 583cda1b0e7d5d49 ("KVM: arm64: Refuse to run VCPU if the PMU doesn't match the physical CPU") That don't causes any changes in tooling (when built on x86), only addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/kvm.h' differs from latest version at 'arch/arm64/include/uapi/asm/kvm.h' diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h Cc: Marc Zyngier Cc: Will Deacon Cc: Alexandru Elisei Link: https://lore.kernel.org/lkml/YkSB4Q7kWmnaqeZU@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/arch/arm64/include/uapi/asm/kvm.h | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 672b259fed48cca4210c4e2329861ed63a036f8b 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: 991625f3dd2cbc4b ("x86/ibt: Add IBT feature, MSR and #CP handling") 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-03-29 16:23:07.678740040 -0300 +++ after 2022-03-29 16:23:16.960978524 -0300 @@ -220,6 +220,13 @@ [0x00000669] = "MC6_DEMOTION_POLICY_CONFIG", [0x00000680] = "LBR_NHM_FROM", [0x00000690] = "CORE_PERF_LIMIT_REASONS", + [0x000006a0] = "IA32_U_CET", + [0x000006a2] = "IA32_S_CET", + [0x000006a4] = "IA32_PL0_SSP", + [0x000006a5] = "IA32_PL1_SSP", + [0x000006a6] = "IA32_PL2_SSP", + [0x000006a7] = "IA32_PL3_SSP", + [0x000006a8] = "IA32_INT_SSP_TAB", [0x000006B0] = "GFX_PERF_LIMIT_REASONS", [0x000006B1] = "RING_PERF_LIMIT_REASONS", [0x000006c0] = "LBR_NHM_TO", $ And this gets rebuilt: CC /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o LD /tmp/build/perf/trace/beauty/tracepoints/perf-in.o LD /tmp/build/perf/trace/beauty/perf-in.o CC /tmp/build/perf/util/amd-sample-raw.o LD /tmp/build/perf/util/perf-in.o LD /tmp/build/perf/perf-in.o LINK /tmp/build/perf/perf Now one can trace systemwide asking to see backtraces to where those MSRs are being read/written with: # 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: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/YkNd7Ky+vi7H2Zl2@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/arch/x86/include/asm/msr-index.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) commit 6d05e1398507fc3509debc397bb9dfa18fc5230e Author: Arnaldo Carvalho de Melo Date: Fri Sep 27 11:30:30 2019 -0300 tools headers UAPI: Sync asm-generic/mman-common.h with the kernel To pick the changes from: 9457056ac426e5ed ("mm: madvise: MADV_DONTNEED_LOCKED") That result in these changes in the tools: $ diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h --- tools/include/uapi/asm-generic/mman-common.h 2022-03-29 16:17:50.461694991 -0300 +++ include/uapi/asm-generic/mman-common.h 2022-03-27 19:12:48.923250468 -0300 @@ -75,6 +75,8 @@ #define MADV_POPULATE_READ 22 /* populate (prefault) page tables readable */ #define MADV_POPULATE_WRITE 23 /* populate (prefault) page tables writable */ +#define MADV_DONTNEED_LOCKED 24 /* like DONTNEED, but drop locked pages too */ + /* compatibility flags */ #define MAP_FILE 0 $ tools/perf/trace/beauty/madvise_behavior.sh > before $ cp include/uapi/asm-generic/mman-common.h tools/include/uapi/asm-generic/mman-common.h $ tools/perf/trace/beauty/madvise_behavior.sh > after $ diff -u before after --- before 2022-03-29 16:18:04.091044244 -0300 +++ after 2022-03-29 16:18:11.692238906 -0300 @@ -20,6 +20,7 @@ [21] = "PAGEOUT", [22] = "POPULATE_READ", [23] = "POPULATE_WRITE", + [24] = "DONTNEED_LOCKED", [100] = "HWPOISON", [101] = "SOFT_OFFLINE", }; $ I.e. now when madvise gets those behaviours as args, 'perf trace' will be able to translate from the number to a human readable string and to use the strings in tracepoint filter expressions. This addresses the following perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/mman-common.h' differs from latest version at 'include/uapi/asm-generic/mman-common.h' diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Johannes Weiner Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/YkNcUfeh795yqGMV@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/include/uapi/asm-generic/mman-common.h | 2 ++ 1 file changed, 2 insertions(+) commit 9a195da42feca3948d7f1ee8a689e2b9d2406fb5 Author: Arnaldo Carvalho de Melo Date: Mon Sep 6 11:57:46 2021 -0300 perf beauty: Update copy of linux/socket.h with the kernel sources To pick the changes in: a6a6fe27bab48f0d ("net/smc: Dynamic control handshake limitation by socket options") This automagically adds support for the SOL_MNC socket level: $ diff -u tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h --- tools/perf/trace/beauty/include/linux/socket.h 2022-03-14 17:55:22.277148656 -0300 +++ include/linux/socket.h 2022-03-27 19:12:48.908250063 -0300 @@ -366,6 +366,7 @@ #define SOL_XDP 283 #define SOL_MPTCP 284 #define SOL_MCTP 285 +#define SOL_SMC 286 /* IPX options */ #define IPX_TYPE 1 $ tools/perf/trace/beauty/socket.sh > before $ cp include/linux/socket.h tools/perf/trace/beauty/include/linux/socket.h $ tools/perf/trace/beauty/socket.sh > after $ diff -u before after --- before 2022-03-29 11:47:56.390258780 -0300 +++ after 2022-03-29 11:48:03.158436189 -0300 @@ -67,6 +67,7 @@ [283] = "XDP", [284] = "MPTCP", [285] = "MCTP", + [286] = "SMC", }; DEFINE_STRARRAY(socket_level, "SOL_"); $ This will allow 'perf trace' to translate 286 into "SMC" as is done with the other socket levels: # perf trace -e setsockopt --max-events 4 344.916 ( 0.003 ms): Socket Thread/3816 setsockopt(fd: 168, level: TCP, optname: 5, optval: 0x7f5797b9c4f8, optlen: 4) = 0 344.920 ( 0.002 ms): Socket Thread/3816 setsockopt(fd: 168, level: TCP, optname: 6, optval: 0x7f5797b9c4f4, optlen: 4) = 0 1246.974 ( 0.010 ms): systemd-resolv/1128 setsockopt(fd: 22, level: IP, optname: 11, optval: 0x7ffc96cd7244, optlen: 4) = 0 1246.986 ( 0.002 ms): systemd-resolv/1128 setsockopt(fd: 22, level: IP, optname: 8, optval: 0x7ffc96cd7264, optlen: 4) = 0 This addresses this perf build warning: Warning: Kernel ABI header at 'tools/perf/trace/beauty/include/linux/socket.h' differs from latest version at 'include/linux/socket.h' diff -u tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h Cc: Adrian Hunter Cc: David S. Miller Cc: D. Wythe Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/YkMdpzzjPu5VZtW3@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/trace/beauty/include/linux/socket.h | 1 + 1 file changed, 1 insertion(+) commit 4d4d00dd321f2c9c1ce35ec2a1d32515371af009 Author: Arnaldo Carvalho de Melo Date: Mon Oct 19 12:26:45 2020 -0300 perf tools: Update copy of libbpf's hashmap.c To pick the changes in: fba60b171a032283 ("libbpf: Use IS_ERR_OR_NULL() in hashmap__free()") That don't entail any changes in tools/perf. This addresses this perf build warning: Warning: Kernel ABI header at 'tools/perf/util/hashmap.h' differs from latest version at 'tools/lib/bpf/hashmap.h' diff -u tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h Not a kernel ABI, its just that this uses the mechanism in place for checking kernel ABI files drift. Cc: Andrii Nakryiko Cc: Ian Rogers Cc: Jiri Olsa Cc: Mauricio Vásquez Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/YkMb2SAIai2VeuUD@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/hashmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 8a96f454f566857290867fb3943ffc37ea7d50d2 Author: Ian Rogers Date: Sun Mar 27 23:24:13 2022 -0700 perf stat: Avoid SEGV if core.cpus isn't set Passing NULL to perf_cpu_map__max doesn't make sense as there is no valid max. Avoid this problem by null checking in perf_stat_init_aggr_mode. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: German Gomez Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Kajol Jain Cc: Leo Yan Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Song Liu Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Will Deacon Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20220328062414.1893550-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-stat.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit b012b3235cb9d05e4ccaff8327bfbed6faf014aa Merge: d0d642a5d365 78049e94a171 Author: Linus Torvalds Date: Fri Apr 1 12:08:34 2022 -0700 Merge branch 'akpm' (patches from Andrew) Merge still more updates from Andrew Morton: "16 patches. Subsystems affected by this patch series: ofs2, nilfs2, mailmap, and mm (madvise, mlock, mfence, memory-failure, kasan, debug, kmemleak, and damon)" * emailed patches from Andrew Morton : mm/damon: prevent activated scheme from sleeping by deactivated schemes mm/kmemleak: reset tag when compare object pointer doc/vm/page_owner.rst: remove content related to -c option tools/vm/page_owner_sort.c: remove -c option mm, kasan: fix __GFP_BITS_SHIFT definition breaking LOCKDEP mm,hwpoison: unmap poisoned page before invalidation mailmap: update Kirill's email mm: kfence: fix objcgs vector allocation mm/munlock: protect the per-CPU pagevec by a local_lock_t mm/munlock: update Documentation/vm/unevictable-lru.rst mm/munlock: add lru_add_drain() to fix memcg_stat_test nilfs2: get rid of nilfs_mapping_init() nilfs2: fix lockdep warnings during disk space reclamation nilfs2: fix lockdep warnings in page operations for btree nodes ocfs2: fix crash when mount with quota enabled Revert "mm: madvise: skip unmapped vma holes passed to process_madvise" commit 78049e94a171837e5a882814ca5bc4f14f265603 Author: Jonghyeon Kim Date: Fri Apr 1 11:28:57 2022 -0700 mm/damon: prevent activated scheme from sleeping by deactivated schemes In the DAMON, the minimum wait time of the schemes decides whether the kernel wakes up 'kdamon_fn()'. But since the minimum wait time is initialized to zero, there are corner cases against the original objective. For example, if we have several schemes for one target, and if the wait time of the first scheme is zero, the minimum wait time will set zero, which means 'kdamond_fn()' should wake up to apply this scheme. However, in the following scheme, wait time can be set to non-zero. Thus, the mininum wait time will be set to non-zero, which can cause sleeping this interval for 'kdamon_fn()' due to one deactivated last scheme. This commit prevents making DAMON monitoring inactive state due to other deactivated schemes. Link: https://lkml.kernel.org/r/20220330105302.32114-1-tome01@ajou.ac.kr Signed-off-by: Jonghyeon Kim Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit bfc8089f00fa526dea983844c880fa8106c33ac4 Author: Kuan-Ying Lee Date: Fri Apr 1 11:28:54 2022 -0700 mm/kmemleak: reset tag when compare object pointer When we use HW-tag based kasan and enable vmalloc support, we hit the following bug. It is due to comparison between tagged object and non-tagged pointer. We need to reset the kasan tag when we need to compare tagged object and non-tagged pointer. kmemleak: [name:kmemleak&]Scan area larger than object 0xffffffe77076f440 CPU: 4 PID: 1 Comm: init Tainted: G S W 5.15.25-android13-0-g5cacf919c2bc #1 Hardware name: MT6983(ENG) (DT) Call trace: add_scan_area+0xc4/0x244 kmemleak_scan_area+0x40/0x9c layout_and_allocate+0x1e8/0x288 load_module+0x2c8/0xf00 __se_sys_finit_module+0x190/0x1d0 __arm64_sys_finit_module+0x20/0x30 invoke_syscall+0x60/0x170 el0_svc_common+0xc8/0x114 do_el0_svc+0x28/0xa0 el0_svc+0x60/0xf8 el0t_64_sync_handler+0x88/0xec el0t_64_sync+0x1b4/0x1b8 kmemleak: [name:kmemleak&]Object 0xf5ffffe77076b000 (size 32768): kmemleak: [name:kmemleak&] comm "init", pid 1, jiffies 4294894197 kmemleak: [name:kmemleak&] min_count = 0 kmemleak: [name:kmemleak&] count = 0 kmemleak: [name:kmemleak&] flags = 0x1 kmemleak: [name:kmemleak&] checksum = 0 kmemleak: [name:kmemleak&] backtrace: module_alloc+0x9c/0x120 move_module+0x34/0x19c layout_and_allocate+0x1c4/0x288 load_module+0x2c8/0xf00 __se_sys_finit_module+0x190/0x1d0 __arm64_sys_finit_module+0x20/0x30 invoke_syscall+0x60/0x170 el0_svc_common+0xc8/0x114 do_el0_svc+0x28/0xa0 el0_svc+0x60/0xf8 el0t_64_sync_handler+0x88/0xec el0t_64_sync+0x1b4/0x1b8 Link: https://lkml.kernel.org/r/20220318034051.30687-1-Kuan-Ying.Lee@mediatek.com Signed-off-by: Kuan-Ying Lee Reviewed-by: Catalin Marinas Cc: Matthias Brugger Cc: Chinwen Chang Cc: Nicholas Tang Cc: Yee Lee Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kmemleak.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit c89b3ad2dea254ad17ae2585b17c2cf9f78e64d9 Author: Yinan Zhang Date: Fri Apr 1 11:28:51 2022 -0700 doc/vm/page_owner.rst: remove content related to -c option -c option has been removed from page_owner_sort.c. Remove the usage of -c option from Documentation. This work is coauthored by Shenghong Han Yixuan Cao Chongxi Zhao Jiajian Ye Yuhong Feng Yongqiang Liu Link: https://lkml.kernel.org/r/20220326085920.1470081-2-zhangyinan2019@email.szu.edu.cn Signed-off-by: Yinan Zhang Cc: Jonathan Corbet Cc: Stephen Rothwell Cc: Sean Anderson Cc: Tang Bin Cc: Zhenliang Wei Cc: Georgi Djakov Cc: Chongxi Zhao Cc: Jiajian Ye Cc: Yixuan Cao Cc: Yuhong Feng Cc: Yongqiang Liu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/page_owner.rst | 1 - 1 file changed, 1 deletion(-) commit d8b7b3fa9f9b2dc67fa1df29c4ce98eb10d62824 Author: Yinan Zhang Date: Fri Apr 1 11:28:48 2022 -0700 tools/vm/page_owner_sort.c: remove -c option The -c option is used to cull by stacktrace. Now, --cull option has been Added in page_owner_sort.c. Culling by stacktrace is one of the function of "--cull". No need to set an extra parameter. So remove -c option. Remove parsing of -c when parse parameter and remove "-c" from usage. This work is coauthored by Shenghong Han Yixuan Cao Chongxi Zhao Jiajian Ye Yuhong Feng Yongqiang Liu Link: https://lkml.kernel.org/r/20220326085920.1470081-1-zhangyinan2019@email.szu.edu.cn Signed-off-by: Yinan Zhang Cc: Chongxi Zhao Cc: Georgi Djakov Cc: Jiajian Ye Cc: Jonathan Corbet Cc: Sean Anderson Cc: Stephen Rothwell Cc: Tang Bin Cc: Yixuan Cao Cc: Yongqiang Liu Cc: Yuhong Feng Cc: Zhenliang Wei Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) commit ada543af3bfe3d953986eca118601b9612382c13 Author: Andrey Konovalov Date: Fri Apr 1 11:28:45 2022 -0700 mm, kasan: fix __GFP_BITS_SHIFT definition breaking LOCKDEP KASAN changes that added new GFP flags mistakenly updated __GFP_BITS_SHIFT as the total number of GFP bits instead of as a shift used to define __GFP_BITS_MASK. This broke LOCKDEP, as __GFP_BITS_MASK now gets the 25th bit enabled instead of the 28th for __GFP_NOLOCKDEP. Update __GFP_BITS_SHIFT to always count KASAN GFP bits. In the future, we could handle all combinations of KASAN and LOCKDEP to occupy as few bits as possible. For now, we have enough GFP bits to be inefficient in this quick fix. Link: https://lkml.kernel.org/r/462ff52742a1fcc95a69778685737f723ee4dfb3.1648400273.git.andreyknvl@google.com Fixes: 9353ffa6e9e9 ("kasan, page_alloc: allow skipping memory init for HW_TAGS") Fixes: 53ae233c30a6 ("kasan, page_alloc: allow skipping unpoisoning for HW_TAGS") Fixes: f49d9c5bb15c ("kasan, mm: only define ___GFP_SKIP_KASAN_POISON with HW_TAGS") Signed-off-by: Andrey Konovalov Reported-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Acked-by: Vlastimil Babka Cc: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrey Ryabinin Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/gfp.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 3149c79f3cb0e2e3bafb7cfadacec090cbd250d3 Author: Rik van Riel Date: Fri Apr 1 11:28:42 2022 -0700 mm,hwpoison: unmap poisoned page before invalidation In some cases it appears the invalidation of a hwpoisoned page fails because the page is still mapped in another process. This can cause a program to be continuously restarted and die when it page faults on the page that was not invalidated. Avoid that problem by unmapping the hwpoisoned page when we find it. Another issue is that sometimes we end up oopsing in finish_fault, if the code tries to do something with the now-NULL vmf->page. I did not hit this error when submitting the previous patch because there are several opportunities for alloc_set_pte to bail out before accessing vmf->page, and that apparently happened on those systems, and most of the time on other systems, too. However, across several million systems that error does occur a handful of times a day. It can be avoided by returning VM_FAULT_NOPAGE which will cause do_read_fault to return before calling finish_fault. Link: https://lkml.kernel.org/r/20220325161428.5068d97e@imladris.surriel.com Fixes: e53ac7374e64 ("mm: invalidate hwpoison page cache page in fault path") Signed-off-by: Rik van Riel Reviewed-by: Miaohe Lin Tested-by: Naoya Horiguchi Reviewed-by: Oscar Salvador Cc: Mel Gorman Cc: Johannes Weiner Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit 4f1f9698d77734a90cae1bb9a50188f44f15e305 Author: Kirill Tkhai Date: Fri Apr 1 11:28:39 2022 -0700 mailmap: update Kirill's email My new email address is kirill.tkhai@openvz.org. Link: https://lkml.kernel.org/r/164846762354.278960.13129571556274098855.stgit@pro Signed-off-by: Kirill Tkhai Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds .mailmap | 1 + 1 file changed, 1 insertion(+) commit 8f0b36497303487d5a32c75789c77859cc2ee895 Author: Muchun Song Date: Fri Apr 1 11:28:36 2022 -0700 mm: kfence: fix objcgs vector allocation If the kfence object is allocated to be used for objects vector, then this slot of the pool eventually being occupied permanently since the vector is never freed. The solutions could be (1) freeing vector when the kfence object is freed or (2) allocating all vectors statically. Since the memory consumption of object vectors is low, it is better to chose (2) to fix the issue and it is also can reduce overhead of vectors allocating in the future. Link: https://lkml.kernel.org/r/20220328132843.16624-1-songmuchun@bytedance.com Fixes: d3fb45f370d9 ("mm, kfence: insert KFENCE hooks for SLAB") Signed-off-by: Muchun Song Reviewed-by: Marco Elver Reviewed-by: Roman Gushchin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Xiongchun Duan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kfence/core.c | 11 ++++++++++- mm/kfence/kfence.h | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) commit adb11e78c5dc5e26774acb05f983da36447f7911 Author: Sebastian Andrzej Siewior Date: Fri Apr 1 11:28:33 2022 -0700 mm/munlock: protect the per-CPU pagevec by a local_lock_t The access to mlock_pvec is protected by disabling preemption via get_cpu_var() or implicit by having preemption disabled by the caller (in mlock_page_drain() case). This breaks on PREEMPT_RT since folio_lruvec_lock_irq() acquires a sleeping lock in this section. Create struct mlock_pvec which consits of the local_lock_t and the pagevec. Acquire the local_lock() before accessing the per-CPU pagevec. Replace mlock_page_drain() with a _local() version which is invoked on the local CPU and acquires the local_lock_t and a _remote() version which uses the pagevec from a remote CPU which offline. Link: https://lkml.kernel.org/r/YjizWi9IY0mpvIfb@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Acked-by: Hugh Dickins Cc: Vlastimil Babka Cc: Matthew Wilcox Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/internal.h | 6 ++++-- mm/migrate.c | 2 +- mm/mlock.c | 46 ++++++++++++++++++++++++++++++++++++---------- mm/page_alloc.c | 1 + mm/rmap.c | 4 ++-- mm/swap.c | 4 +++- 6 files changed, 47 insertions(+), 16 deletions(-) commit 577e9846f8a9e7b09cd356ae0d59a66e19402e8b Author: Hugh Dickins Date: Fri Apr 1 11:28:30 2022 -0700 mm/munlock: update Documentation/vm/unevictable-lru.rst Update Documentation/vm/unevictable-lru.rst to reflect the changes made by the mm/munlock series: keeping an mlock_count instead of page_mlock() (formerly try_to_munlock()) and munlock_vma_pages_all() etc. Also make other little updates or cleanups wherever noticed. But, I apologize, this is already out of date, in that "folio" appears nowhere: 5.18 will be in a transitional state from "page" to "folio", and documenting its current mix of the two does not help to understand "the Unevictable LRU". Should be revisited when naming is more settled. Link: https://lkml.kernel.org/r/3753962-d491-bf60-f59f-51bfe84fd6a0@google.com Signed-off-by: Hugh Dickins Cc: Jonathan Corbet Cc: Randy Dunlap Cc: Matthew Wilcox Cc: Michal Hocko Cc: Vlastimil Babka Cc: "Kirill A. Shutemov" Cc: David Hildenbrand Cc: Alistair Popple Cc: Johannes Weiner Cc: Rik van Riel Cc: Suren Baghdasaryan Cc: Yu Zhao Cc: Greg Thelen Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/unevictable-lru.rst | 471 ++++++++++++++++------------------- 1 file changed, 210 insertions(+), 261 deletions(-) commit ece369c7e1044a333dc002d3c3c228b8853fc5f7 Author: Hugh Dickins Date: Fri Apr 1 11:28:27 2022 -0700 mm/munlock: add lru_add_drain() to fix memcg_stat_test Mike reports that LTP memcg_stat_test usually leads to memcg_stat_test 3 TINFO: Test unevictable with MAP_LOCKED memcg_stat_test 3 TINFO: Running memcg_process --mmap-lock1 -s 135168 memcg_stat_test 3 TINFO: Warming up pid: 3460 memcg_stat_test 3 TINFO: Process is still here after warm up: 3460 memcg_stat_test 3 TFAIL: unevictable is 122880, 135168 expected but may also lead to memcg_stat_test 4 TINFO: Test unevictable with mlock memcg_stat_test 4 TINFO: Running memcg_process --mmap-lock2 -s 135168 memcg_stat_test 4 TINFO: Warming up pid: 4271 memcg_stat_test 4 TINFO: Process is still here after warm up: 4271 memcg_stat_test 4 TFAIL: unevictable is 122880, 135168 expected or both. A wee bit flaky. follow_page_pte() used to have an lru_add_drain() per each page mlocked, and the test came to rely on accurate stats. The pagevec to be drained is different now, but still covered by lru_add_drain(); and, never mind the test, I believe it's in everyone's interest that a bulk faulting interface like populate_vma_page_range() or faultin_vma_page_range() should drain its local pagevecs at the end, to save others sometimes needing the much more expensive lru_add_drain_all(). This does not absolutely guarantee exact stats - the mlocking task can be migrated between CPUs as it proceeds - but it's good enough and the tests pass. Link: https://lkml.kernel.org/r/47f6d39c-a075-50cb-1cfb-26dd957a48af@google.com Fixes: b67bf49ce7aa ("mm/munlock: delete FOLL_MLOCK and FOLL_POPULATE") Signed-off-by: Hugh Dickins Reported-by: Mike Galbraith Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/gup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit cdd81b313d5e09e8a248c2dbd9c6b069f82e5d71 Author: Ryusuke Konishi Date: Fri Apr 1 11:28:24 2022 -0700 nilfs2: get rid of nilfs_mapping_init() After applying the lockdep warning fixes, nilfs_mapping_init() is no longer used, so delete it. Link: https://lkml.kernel.org/r/1647867427-30498-4-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Cc: David Hildenbrand Cc: Hao Sun Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/nilfs2/page.c | 9 --------- fs/nilfs2/page.h | 1 - 2 files changed, 10 deletions(-) commit 6e211930f79aa45d422009a5f2e5467d2369ffe5 Author: Ryusuke Konishi Date: Fri Apr 1 11:28:21 2022 -0700 nilfs2: fix lockdep warnings during disk space reclamation During disk space reclamation, nilfs2 still emits the following lockdep warning due to page/folio operations on shadowed page caches that nilfs2 uses to get a snapshot of DAT file in memory: WARNING: CPU: 0 PID: 2643 at include/linux/backing-dev.h:272 __folio_mark_dirty+0x645/0x670 ... RIP: 0010:__folio_mark_dirty+0x645/0x670 ... Call Trace: filemap_dirty_folio+0x74/0xd0 __set_page_dirty_nobuffers+0x85/0xb0 nilfs_copy_dirty_pages+0x288/0x510 [nilfs2] nilfs_mdt_save_to_shadow_map+0x50/0xe0 [nilfs2] nilfs_clean_segments+0xee/0x5d0 [nilfs2] nilfs_ioctl_clean_segments.isra.19+0xb08/0xf40 [nilfs2] nilfs_ioctl+0xc52/0xfb0 [nilfs2] __x64_sys_ioctl+0x11d/0x170 This fixes the remaining warning by using inode objects to hold those page caches. Link: https://lkml.kernel.org/r/1647867427-30498-3-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Ryusuke Konishi Tested-by: Ryusuke Konishi Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Hao Sun Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/nilfs2/dat.c | 4 +++- fs/nilfs2/inode.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++---- fs/nilfs2/mdt.c | 38 ++++++++++++++++++++++----------- fs/nilfs2/mdt.h | 6 ++---- fs/nilfs2/nilfs.h | 2 ++ 5 files changed, 92 insertions(+), 21 deletions(-) commit e897be17a441fa637cd166fc3de1445131e57692 Author: Ryusuke Konishi Date: Fri Apr 1 11:28:18 2022 -0700 nilfs2: fix lockdep warnings in page operations for btree nodes Patch series "nilfs2 lockdep warning fixes". The first two are to resolve the lockdep warning issue, and the last one is the accompanying cleanup and low priority. Based on your comment, this series solves the issue by separating inode object as needed. Since I was worried about the impact of the object composition changes, I tested the series carefully not to cause regressions especially for delicate functions such like disk space reclamation and snapshots. This patch (of 3): If CONFIG_LOCKDEP is enabled, nilfs2 hits lockdep warnings at inode_to_wb() during page/folio operations for btree nodes: WARNING: CPU: 0 PID: 6575 at include/linux/backing-dev.h:269 inode_to_wb include/linux/backing-dev.h:269 [inline] WARNING: CPU: 0 PID: 6575 at include/linux/backing-dev.h:269 folio_account_dirtied mm/page-writeback.c:2460 [inline] WARNING: CPU: 0 PID: 6575 at include/linux/backing-dev.h:269 __folio_mark_dirty+0xa7c/0xe30 mm/page-writeback.c:2509 Modules linked in: ... RIP: 0010:inode_to_wb include/linux/backing-dev.h:269 [inline] RIP: 0010:folio_account_dirtied mm/page-writeback.c:2460 [inline] RIP: 0010:__folio_mark_dirty+0xa7c/0xe30 mm/page-writeback.c:2509 ... Call Trace: __set_page_dirty include/linux/pagemap.h:834 [inline] mark_buffer_dirty+0x4e6/0x650 fs/buffer.c:1145 nilfs_btree_propagate_p fs/nilfs2/btree.c:1889 [inline] nilfs_btree_propagate+0x4ae/0xea0 fs/nilfs2/btree.c:2085 nilfs_bmap_propagate+0x73/0x170 fs/nilfs2/bmap.c:337 nilfs_collect_dat_data+0x45/0xd0 fs/nilfs2/segment.c:625 nilfs_segctor_apply_buffers+0x14a/0x470 fs/nilfs2/segment.c:1009 nilfs_segctor_scan_file+0x47a/0x700 fs/nilfs2/segment.c:1048 nilfs_segctor_collect_blocks fs/nilfs2/segment.c:1224 [inline] nilfs_segctor_collect fs/nilfs2/segment.c:1494 [inline] nilfs_segctor_do_construct+0x14f3/0x6c60 fs/nilfs2/segment.c:2036 nilfs_segctor_construct+0x7a7/0xb30 fs/nilfs2/segment.c:2372 nilfs_segctor_thread_construct fs/nilfs2/segment.c:2480 [inline] nilfs_segctor_thread+0x3c3/0xf90 fs/nilfs2/segment.c:2563 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 This is because nilfs2 uses two page caches for each inode and inode->i_mapping never points to one of them, the btree node cache. This causes inode_to_wb(inode) to refer to a different page cache than the caller page/folio operations such like __folio_start_writeback(), __folio_end_writeback(), or __folio_mark_dirty() acquired the lock. This patch resolves the issue by allocating and using an additional inode to hold the page cache of btree nodes. The inode is attached one-to-one to the traditional nilfs2 inode if it requires a block mapping with b-tree. This setup change is in memory only and does not affect the disk format. Link: https://lkml.kernel.org/r/1647867427-30498-1-git-send-email-konishi.ryusuke@gmail.com Link: https://lkml.kernel.org/r/1647867427-30498-2-git-send-email-konishi.ryusuke@gmail.com Link: https://lore.kernel.org/r/YXrYvIo8YRnAOJCj@casper.infradead.org Link: https://lore.kernel.org/r/9a20b33d-b38f-b4a2-4742-c1eb5b8e4d6c@redhat.com Signed-off-by: Ryusuke Konishi Reported-by: syzbot+0d5b462a6f07447991b3@syzkaller.appspotmail.com Reported-by: syzbot+34ef28bb2aeb28724aa0@syzkaller.appspotmail.com Reported-by: Hao Sun Reported-by: David Hildenbrand Tested-by: Ryusuke Konishi Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/nilfs2/btnode.c | 23 ++++++++++-- fs/nilfs2/btnode.h | 1 + fs/nilfs2/btree.c | 27 ++++++++++---- fs/nilfs2/gcinode.c | 7 ++-- fs/nilfs2/inode.c | 104 +++++++++++++++++++++++++++++++++++++++++++++------- fs/nilfs2/mdt.c | 7 ++-- fs/nilfs2/nilfs.h | 14 +++---- fs/nilfs2/page.c | 7 ++-- fs/nilfs2/segment.c | 9 +++-- fs/nilfs2/super.c | 5 +-- 10 files changed, 154 insertions(+), 50 deletions(-) commit de19433423c7bedabbd4f9a25f7dbc62c5e78921 Author: Joseph Qi Date: Fri Apr 1 11:28:15 2022 -0700 ocfs2: fix crash when mount with quota enabled There is a reported crash when mounting ocfs2 with quota enabled. RIP: 0010:ocfs2_qinfo_lock_res_init+0x44/0x50 [ocfs2] Call Trace: ocfs2_local_read_info+0xb9/0x6f0 [ocfs2] dquot_load_quota_sb+0x216/0x470 dquot_load_quota_inode+0x85/0x100 ocfs2_enable_quotas+0xa0/0x1c0 [ocfs2] ocfs2_fill_super.cold+0xc8/0x1bf [ocfs2] mount_bdev+0x185/0x1b0 legacy_get_tree+0x27/0x40 vfs_get_tree+0x25/0xb0 path_mount+0x465/0xac0 __x64_sys_mount+0x103/0x140 It is caused by when initializing dqi_gqlock, the corresponding dqi_type and dqi_sb are not properly initialized. This issue is introduced by commit 6c85c2c72819, which wants to avoid accessing uninitialized variables in error cases. So make global quota info properly initialized. Link: https://lkml.kernel.org/r/20220323023644.40084-1-joseph.qi@linux.alibaba.com Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1007141 Fixes: 6c85c2c72819 ("ocfs2: quota_local: fix possible uninitialized-variable access in ocfs2_local_read_info()") Signed-off-by: Joseph Qi Reported-by: Dayvison Tested-by: Valentin Vidic Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/ocfs2/quota_global.c | 23 ++++++++++++----------- fs/ocfs2/quota_local.c | 2 -- 2 files changed, 12 insertions(+), 13 deletions(-) commit e6b0a7b357659c332231621e4315658d062c23ee Author: Charan Teja Kalla Date: Fri Apr 1 11:28:12 2022 -0700 Revert "mm: madvise: skip unmapped vma holes passed to process_madvise" This reverts commit 08095d6310a7 ("mm: madvise: skip unmapped vma holes passed to process_madvise") as process_madvise() fails to return the exact processed bytes in other cases too. As an example: if process_madvise() hits mlocked pages after processing some initial bytes passed in [start, end), it just returns EINVAL although some bytes are processed. Thus making an exception only for ENOMEM is partially fixing the problem of returning the proper advised bytes. Thus revert this patch and return proper bytes advised. Link: https://lkml.kernel.org/r/e73da1304a88b6a8a11907045117cccf4c2b8374.1648046642.git.quic_charante@quicinc.com Fixes: 08095d6310a7ce ("mm: madvise: skip unmapped vma holes passed to process_madvise") Signed-off-by: Charan Teja Kalla Acked-by: Michal Hocko Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: David Rientjes Cc: Nadav Amit Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/madvise.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) commit 5a60542c61f3cce6e5dff2a38c8fb08a852a517b Author: Matthew Wilcox (Oracle) Date: Tue Mar 29 23:25:06 2022 -0400 btrfs: Remove a use of PAGE_SIZE in btrfs_invalidate_folio() While btrfs doesn't use large folios yet, this should have been changed as part of the conversion from invalidatepage to invalidate_folio. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c37731301d66cce9c1a212c60e504f28e4342b39 Author: Matthew Wilcox (Oracle) Date: Tue Mar 29 16:31:41 2022 -0400 ntfs: Correct mark_ntfs_record_dirty() folio conversion We've already done the work of block_dirty_folio() here, leaving only the work that needs to be done by filemap_dirty_folio(). This was a misconversion where I misread __set_page_dirty_nobuffers() as __set_page_dirty_buffers(). Fixes: e621900ad28b ("fs: Convert __set_page_dirty_buffers to block_dirty_folio") Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro fs/ntfs/aops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 29c87793eb3c6f78f215f85be863e5415e263e43 Author: Matthew Wilcox (Oracle) Date: Tue Mar 29 16:27:21 2022 -0400 f2fs: Get the superblock from the mapping instead of the page It's slightly more efficient to go directly from the mapping to the superblock than to go from the page. Now that these routines have the mapping passed to them, there's no reason not to use it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro fs/f2fs/checkpoint.c | 2 +- fs/f2fs/node.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit 0fb5b2ebc0422fccbb41b09ff38ff7f27616294d Author: Matthew Wilcox (Oracle) Date: Tue Mar 29 16:22:54 2022 -0400 f2fs: Correct f2fs_dirty_data_folio() conversion I got the return value wrong. Very little checks the return value from set_page_dirty(), so nobody noticed during testing. Fixes: 4f5e34f71318 ("f2fs: Convert f2fs_set_data_page_dirty to f2fs_dirty_data_folio") Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro fs/f2fs/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0f2523366386f29d56040887555989a1de548625 Author: Matthew Wilcox (Oracle) Date: Tue Mar 29 16:21:53 2022 -0400 ext4: Correct ext4_journalled_dirty_folio() conversion This should use the new folio_buffers() instead of page_has_buffers(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro fs/ext4/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d7414ba14a3a67f81321069219dc7dbc095022c3 Author: Matthew Wilcox (Oracle) Date: Sun Feb 20 22:28:03 2022 -0500 filemap: Remove AOP_FLAG_CONT_EXPAND This flag is no longer used, so remove it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro fs/buffer.c | 3 +-- include/linux/fs.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) commit 800ba29547e16d5fbe67ca764ba660e049e9f1bf Author: Matthew Wilcox (Oracle) Date: Sat Feb 19 23:19:49 2022 -0500 fs: Pass an iocb to generic_perform_write() We can extract both the file pointer and the pos from the iocb. This simplifies each caller as well as allowing generic_perform_write() to see more of the iocb contents in the future. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner Reviewed-by: Al Viro Acked-by: Al Viro fs/ceph/file.c | 2 +- fs/ext4/file.c | 2 +- fs/f2fs/file.c | 2 +- fs/nfs/file.c | 2 +- include/linux/fs.h | 2 +- mm/filemap.c | 10 ++++++---- 6 files changed, 11 insertions(+), 9 deletions(-) commit b2403a61308533c576c9dd783fcb73a9186e0b37 Author: Matthew Wilcox (Oracle) Date: Mon Feb 14 09:15:34 2022 -0500 fs, net: Move read_descriptor_t to net.h fs.h has no more need for this typedef; networking is now the sole user of the read_descriptor_t. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro include/linux/fs.h | 19 ------------------- include/linux/net.h | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) commit a9fcd89d67bb8c4ad613b54ab691fc603c94a03a Author: Matthew Wilcox (Oracle) Date: Mon Feb 14 09:13:43 2022 -0500 fs: Remove read_actor_t This typedef is not used any more. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro include/linux/fs.h | 3 --- 1 file changed, 3 deletions(-) commit 2756c818e5cbcc4c9d13d7399273e86068e95156 Author: Matthew Wilcox (Oracle) Date: Fri Mar 4 14:05:23 2022 -0500 iomap: Simplify is_partially_uptodate a little Remove the unnecessary variable 'len' and fix a comment to refer to the folio instead of the page. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro fs/iomap/buffered-io.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 1e4702806faca1551733f58be17ea11a9d214e91 Author: Matthew Wilcox (Oracle) Date: Thu Mar 31 15:02:34 2022 -0400 readahead: Update comments - Refer to folios where appropriate, not pages (Matthew Wilcox) - Eliminate references to the internal PG_readhead - Use "readahead" consistently - not "read-ahead" or "read ahead" (mostly Neil Brown) - Clarify some sections that, on reflection, weren't very clear (Neil Brown) - Minor punctuation/spelling fixes (Neil Brown) Signed-off-by: Matthew Wilcox (Oracle) mm/readahead.c | 92 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 45 insertions(+), 47 deletions(-) commit b4e089d705eef82364945abae325cd241c80e107 Author: Christoph Hellwig Date: Thu Mar 31 05:35:55 2022 -0700 mm: remove the skip_page argument to read_pages The skip_page argument to read_pages controls if rac->_index is incremented before returning from the function. Just open code that in the callers. Signed-off-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro Signed-off-by: Matthew Wilcox (Oracle) mm/readahead.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) commit dfd8b4fc76d5f7ae5663328b791c4acf222c4d39 Author: Christoph Hellwig Date: Thu Mar 31 05:35:23 2022 -0700 mm: remove the pages argument to read_pages This is always an empty list or NULL with the removal of the ->readahead support, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro Signed-off-by: Matthew Wilcox (Oracle) mm/readahead.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) commit 704528d895dd3e7b173e672116b4eb2b0a0fceb0 Author: Matthew Wilcox (Oracle) Date: Wed Mar 23 21:29:04 2022 -0400 fs: Remove ->readpages address space operation All filesystems have now been converted to use ->readahead, so remove the ->readpages operation and fix all the comments that used to refer to it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro Documentation/filesystems/fsverity.rst | 6 +++--- Documentation/filesystems/locking.rst | 6 ------ Documentation/filesystems/vfs.rst | 11 ----------- fs/btrfs/reflink.c | 4 ++-- fs/cifs/cifssmb.c | 2 +- fs/cifs/inode.c | 2 +- fs/crypto/crypto.c | 2 +- fs/ext4/readpage.c | 2 +- fs/f2fs/data.c | 4 ++-- fs/fuse/fuse_i.h | 2 +- fs/verity/verify.c | 4 ++-- include/linux/fs.h | 6 ------ include/linux/fsverity.h | 2 +- mm/filemap.c | 2 +- mm/readahead.c | 15 ++------------- 15 files changed, 18 insertions(+), 52 deletions(-) commit ebf921a9fac38560e0fc3a4381e163a6969efd5a Author: Matthew Wilcox (Oracle) Date: Sat Jan 22 15:46:22 2022 -0500 readahead: Remove read_cache_pages() With no remaining users, remove this function and the related infrastructure. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Al Viro Acked-by: Al Viro include/linux/pagemap.h | 2 -- mm/readahead.c | 76 ------------------------------------------------- 2 files changed, 78 deletions(-) commit d0d642a5d365b5e2295950fd184d5d1f630896dd Merge: 26803bac2b70 bc55cfd5718c Author: Linus Torvalds Date: Fri Apr 1 10:32:46 2022 -0700 Merge tag 'sound-fix-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Just a few fixes that have been gathered since the previous pull: - An additional fix for potential PCM deadlocks - A series of HD-audio CS8409 codec patches for new models - Other device specific fixes for HD-audio, ASoC mediatek, Intel, fsl, rockchip" * tag 'sound-fix-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock ALSA: hda: Avoid unsol event during RPM suspending ALSA: hda/realtek: Fix audio regression on Mi Notebook Pro 2020 ALSA: hda/cs8409: Add new Dolphin HW variants ALSA: hda/cs8409: Disable HSBIAS_SENSE_EN for Cyborg ALSA: hda/cs8409: Support new Warlock MLK Variants ALSA: hda/cs8409: Fix Full Scale Volume setting for all variants ALSA: hda/cs8409: Re-order quirk table into ascending order ALSA: hda/cs8409: Fix Warlock to use mono mic configuration ALSA: cs4236: fix an incorrect NULL check on list iterator ALSA: hda/realtek: Enable headset mic on Lenovo P360 ASoC: SOF: Intel: Fix build error without SND_SOC_SOF_PCI_DEV ALSA: hda/realtek: Add mute and micmut LED support for Zbook Fury 17 G9 ASoC: rockchip: i2s_tdm: Fixup config for SND_SOC_DAIFMT_DSP_A/B ASoC: fsl-asoc-card: Fix jack_event() always return 0 ASoC: mediatek: mt6358: add missing EXPORT_SYMBOLs commit 26803bac2b70a7314f19d56c588cf7d55e4ddc3e Merge: aa240ee78834 24f71ae5447e Author: Linus Torvalds Date: Fri Apr 1 10:26:09 2022 -0700 Merge tag 'gpio-fixes-for-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - grammar and formatting fixes in comments for gpio-ts4900 - correct links in gpio-ts5500 - fix a warning in doc generation for the core GPIO documentation * tag 'gpio-fixes-for-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: ts5500: Fix Links to Technologic Systems web resources gpio: Properly document parent data union gpio: ts4900: Fix comment formatting and grammar commit 5291984004edfcc7510024e52eaed044573b79c7 Author: Ming Lei Date: Fri Apr 1 09:47:32 2022 -0400 dm: fix bio polling to handle possibile BLK_STS_AGAIN Expanded testing of DM's bio polling support (using more fio threads to dm-linear ontop of null_blk) exposed the possibility for polled bios to hang (repeatedly polling in io_uring) when null_blk responds with BLK_STS_AGAIN (due to lack of resources): 1) io_complete_rw_iopoll() is called from blkdev_bio_end_io_async() to notify kiocb is done, that is the completion interface between block layer and io_uring 2) io_complete_rw_iopoll() is called from io_do_iopoll() 3) dm returns BLK_STS_AGAIN for one bio (on behalf of underlying driver), then io_complete_rw_iopoll is called, but io_do_iopoll() doesn't handle -EAGAIN at all (due to logic in io_rw_should_reissue) 4) reason for dm's BLK_STS_AGAIN is underlying null_blk driver ran out of requests (easier to reproduce by setting low hw_queue_depth). 5) dm should handle BLK_STS_AGAIN for POLLED underlying IO, and may retry in dm layer. This fix adds REQ_POLLED specific BLK_STS_AGAIN handling to dm_io_complete() that clears REQ_POLLED and requeues the bio to DM using queue_io(). Fixes: b99fdcdc3636 ("dm: support bio polling") Signed-off-by: Ming Lei [snitzer: revised header, reused dm_io_complete's REQ_POLLED case] Signed-off-by: Mike Snitzer drivers/md/dm.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) commit aad5b23ebf21573a32b6f07644f028d64492a5d6 Author: Mikulas Patocka Date: Mon Mar 28 12:34:31 2022 -0400 dm: fix dm_io and dm_target_io flags race condition on Alpha Early alpha processors cannot write a single byte or short; they read 8 bytes, modify the value in registers and write back 8 bytes. This could cause race condition in the structure dm_io - if the fields flags and io_count are modified simultaneously. Fix this bug by using 32-bit flags if we are on Alpha and if we are compiling for a processor that doesn't have the byte-word-extension. Signed-off-by: Mikulas Patocka Fixes: bd4a6dd241ae ("dm: reduce size of dm_io and dm_target_io structs") [snitzer: Jens allowed this change since Mikulas owns a relevant Alpha!] Acked-by: Jens Axboe Signed-off-by: Mike Snitzer drivers/md/dm-core.h | 4 ++-- include/linux/blk_types.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) commit aa240ee7883487201d0c6cc537ec1c4cd6cb2a9e Merge: 6a34fdcca452 8b188fba7519 Author: Linus Torvalds Date: Fri Apr 1 10:14:32 2022 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a revert of a patch resetting extra buttons on touchpads claiming to be buttonpads as this caused regression on certain Dell devices - a new driver for Mediatek MT6779 keypad - a new driver for Imagis touchscreen - rework of Google/Chrome OS "Vivaldi" keyboard handling - assorted driver fixes. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (31 commits) Revert "Input: clear BTN_RIGHT/MIDDLE on buttonpads" Input: adi - remove redundant variable z Input: add Imagis touchscreen driver dt-bindings: input/touchscreen: bindings for Imagis Input: synaptics - enable InterTouch on ThinkPad T14/P14s Gen 1 AMD Input: stmfts - fix reference leak in stmfts_input_open Input: add bounds checking to input_set_capability() Input: iqs5xx - use local input_dev pointer HID: google: modify HID device groups of eel HID: google: Add support for vivaldi to hid-hammer HID: google: extract Vivaldi hid feature mapping for use in hid-hammer Input: extract ChromeOS vivaldi physmap show function HID: google: switch to devm when registering keyboard backlight LED Input: mt6779-keypad - fix signedness bug Input: mt6779-keypad - add MediaTek keypad driver dt-bindings: input: Add bindings for Mediatek matrix keypad Input: da9063 - use devm_delayed_work_autocancel() Input: goodix - fix race on driver unbind Input: goodix - use input_copy_abs() helper Input: add input_copy_abs() function ... commit 6a34fdcca452457a530980be2561dab06da3627f Merge: e8b767f5e040 915593a7a663 Author: Linus Torvalds Date: Fri Apr 1 09:37:18 2022 -0700 Merge tag 'rtc-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "The bulk of the patches are about replacing the uie_unsupported struct rtc_device member by a feature bit. Subsystem: - remove uie_unsupported, all users have been converted to clear RTC_FEATURE_UPDATE_INTERRUPT and provide a reason - RTCs with an alarm with a resolution of a minute are now letting the core handle rounding down the alarm time - fix use-after-free on device removal New driver: - OP-TEE RTC PTA Drivers: - sun6i: Add H616 support - cmos: Fix the AltCentury for AMD platforms - spear: set range" * tag 'rtc-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (56 commits) rtc: check if __rtc_read_time was successful rtc: gamecube: Fix refcount leak in gamecube_rtc_read_offset_from_sram rtc: mc146818-lib: Fix the AltCentury for AMD platforms rtc: optee: add RTC driver for OP-TEE RTC PTA rtc: pm8xxx: Return -ENODEV if set_time disallowed rtc: pm8xxx: Attach wake irq to device clk: sunxi-ng: sun6i-rtc: include clk/sunxi-ng.h rtc: remove uie_unsupported rtc: xgene: stop using uie_unsupported rtc: hym8563: switch to RTC_FEATURE_UPDATE_INTERRUPT rtc: hym8563: let the core handle the alarm resolution rtc: hym8563: switch to devm_rtc_allocate_device rtc: efi: switch to RTC_FEATURE_UPDATE_INTERRUPT rtc: efi: switch to devm_rtc_allocate_device rtc: add new RTC_FEATURE_ALARM_WAKEUP_ONLY feature rtc: spear: fix spear_rtc_read_time rtc: spear: drop uie_unsupported rtc: spear: set range rtc: spear: switch to devm_rtc_allocate_device rtc: pcf8563: switch to RTC_FEATURE_UPDATE_INTERRUPT ... commit de4fb176622d54a82ea3ceb7362392aaf5ff0b5a Merge: 9be4c88bb792 9c6d6652e950 Author: Russell King (Oracle) Date: Fri Apr 1 16:12:31 2022 +0100 Merge branches 'fixes' and 'misc' into for-linus commit 1e39036de5fce1b0c61204c546ca04aff6eafc71 Author: Nathan Chancellor Date: Wed Mar 30 16:45:28 2022 -0700 Revert "um: clang: Strip out -mno-global-merge from USER_CFLAGS" This reverts commit 6580c5c18fb3df2b11c5e0452372f815deeff895. This patch is buggy, as noted in the patch linked below. The root cause has been solved by removing '-mno-global-merge' for the entire kernel. Link: https://lore.kernel.org/r/20220322173547.677760-1-nathan@kernel.org/ Signed-off-by: Nathan Chancellor Reviewed-by: David Gow Reviewed-by: Kees Cook Signed-off-by: Masahiro Yamada arch/um/Makefile | 4 ---- 1 file changed, 4 deletions(-) commit cf300b83c793c25c6b485fdaf7a4447d8ea4c655 Author: Nathan Chancellor Date: Wed Mar 30 16:45:27 2022 -0700 kbuild: Remove '-mno-global-merge' This flag is specific to clang, where it is only used by the 32-bit and 64-bit ARM backends. In certain situations, the presence of this flag will cause a warning, as shown by commit 6580c5c18fb3 ("um: clang: Strip out -mno-global-merge from USER_CFLAGS"). Since commit 61163efae020 ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang") that added this flag back in 2014, there have been quite a few changes to the GlobalMerge pass in LLVM. Building several different ARCH=arm and ARCH=arm64 configurations with LLVM 11 (minimum) and 15 (current main version) with this flag removed (i.e., with the default of '-mglobal-merge') reveals no modpost warnings, so it is likely that the issue noted in the comment is no longer relevant due to changes in LLVM or modpost, meaning this flag can be removed. If any new warnings show up that are a result of the removal of this flag, it can be added back under arch/arm{,64}/Makefile to avoid warnings on other architectures. Signed-off-by: Nathan Chancellor Tested-by: David Gow Reviewed-by: Kees Cook Tested-by: Sedat Dilek Reviewed-by: Sedat Dilek Signed-off-by: Masahiro Yamada Makefile | 4 ---- 1 file changed, 4 deletions(-) commit 099c22bdca406733c80f3d34ea2d2554bd15fb16 Author: Masahiro Yamada Date: Tue Mar 29 11:14:36 2022 +0900 kbuild: fix empty ${PYTHON} in scripts/link-vmlinux.sh The two commits d8d2d38275c1 ("kbuild: remove PYTHON variable") a8cccdd95473 ("init: lto: ensure initcall ordering") were applied in the same development cycle, into two different trees. After they were merged together, this ${PYTHON} expands to an empty string. Therefore, ${srctree}/scripts/jobserver-exec is executed directly. (it has the executable bit set) This is working but let's fix the code into the intended form. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers Reviewed-by: Sedat Dilek scripts/link-vmlinux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b6ad541697ea9a673b838533a7f8c45b24b0275e Author: Masahiro Yamada Date: Tue Mar 29 00:07:10 2022 +0900 kconfig: remove stale comment about removed kconfig_print_symbol() This comment is about kconfig_print_symbol(), which was removed by commit 6ce45a91a982 ("kconfig: refactor conf_write_symbol()"). Signed-off-by: Masahiro Yamada scripts/kconfig/confdata.c | 7 ------- 1 file changed, 7 deletions(-) commit cc09e8a9dec4f0e8299e80a7a2a8e6f54164a10b Author: Mikulas Patocka Date: Sat Mar 26 10:24:56 2022 -0400 dm integrity: set journal entry unused when shrinking device Commit f6f72f32c22c ("dm integrity: don't replay journal data past the end of the device") skips journal replay if the target sector points beyond the end of the device. Unfortunatelly, it doesn't set the journal entry unused, which resulted in this BUG being triggered: BUG_ON(!journal_entry_is_unused(je)) Fix this by calling journal_entry_set_unused() for this case. Fixes: f6f72f32c22c ("dm integrity: don't replay journal data past the end of the device") Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: Mikulas Patocka Tested-by: Milan Broz [snitzer: revised header] Signed-off-by: Mike Snitzer drivers/md/dm-integrity.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit dbdcc906d978650417b076a875b0f962fcdf79dd Author: Mikulas Patocka Date: Sun Mar 20 17:12:46 2022 -0400 dm ioctl: log an error if the ioctl structure is corrupted This will help triage bugs when userspace is passing invalid ioctl structure to the kernel. Signed-off-by: Mikulas Patocka [snitzer: log errors using DMERR instead of DMWARN] Signed-off-by: Mike Snitzer drivers/md/dm-ioctl.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit 9be4c88bb7924f68f88cfd47d925c2d046f51a73 Author: linyujun Date: Fri Apr 1 10:52:47 2022 +0100 ARM: 9191/1: arm/stacktrace, kasan: Silence KASAN warnings in unwind_frame() The following KASAN warning is detected by QEMU. ================================================================== BUG: KASAN: stack-out-of-bounds in unwind_frame+0x508/0x870 Read of size 4 at addr c36bba90 by task cat/163 CPU: 1 PID: 163 Comm: cat Not tainted 5.10.0-rc1 #40 Hardware name: ARM-Versatile Express [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x98/0xb0) [] (dump_stack) from [] (print_address_description.constprop.0+0x58/0x4bc) [] (print_address_description.constprop.0) from [] (kasan_report+0x154/0x170) [] (kasan_report) from [] (unwind_frame+0x508/0x870) [] (unwind_frame) from [] (__save_stack_trace+0x110/0x134) [] (__save_stack_trace) from [] (stack_trace_save+0x8c/0xb4) [] (stack_trace_save) from [] (kasan_set_track+0x38/0x60) [] (kasan_set_track) from [] (kasan_set_free_info+0x20/0x2c) [] (kasan_set_free_info) from [] (__kasan_slab_free+0xec/0x120) [] (__kasan_slab_free) from [] (kmem_cache_free+0x7c/0x334) [] (kmem_cache_free) from [] (rcu_core+0x390/0xccc) [] (rcu_core) from [] (__do_softirq+0x180/0x518) [] (__do_softirq) from [] (irq_exit+0x9c/0xe0) [] (irq_exit) from [] (__handle_domain_irq+0xb0/0x110) [] (__handle_domain_irq) from [] (gic_handle_irq+0xa0/0xb8) [] (gic_handle_irq) from [] (__irq_svc+0x6c/0x94) Exception stack(0xc36bb928 to 0xc36bb970) b920: c36bb9c0 00000000 c0126919 c0101228 c36bb9c0 b76d7730 b940: c36b8000 c36bb9a0 c3335b00 c01ce0d8 00000003 c36bba3c c36bb940 c36bb978 b960: c010e298 c011373c 60000013 ffffffff [] (__irq_svc) from [] (unwind_frame+0x0/0x870) [] (unwind_frame) from [<00000000>] (0x0) The buggy address belongs to the page: page:(ptrval) refcount:0 mapcount:0 mapping:00000000 index:0x0 pfn:0x636bb flags: 0x0() raw: 00000000 00000000 ef867764 00000000 00000000 00000000 ffffffff 00000000 page dumped because: kasan: bad access detected addr c36bba90 is located in stack of task cat/163 at offset 48 in frame: stack_trace_save+0x0/0xb4 this frame has 1 object: [32, 48) 'trace' Memory state around the buggy address: c36bb980: f1 f1 f1 f1 00 04 f2 f2 00 00 f3 f3 00 00 00 00 c36bba00: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 >c36bba80: 00 00 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 ^ c36bbb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c36bbb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== There is a same issue on x86 and has been resolved by the commit f7d27c35ddff ("x86/mm, kasan: Silence KASAN warnings in get_wchan()"). The solution could be applied to arm architecture too. Signed-off-by: Lin Yujun Reported-by: He Ying Signed-off-by: Russell King (Oracle) arch/arm/kernel/stacktrace.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 9d17f3372306429661d8d44a5cbc0b1209e2ebe5 Author: Austin Kim Date: Fri Apr 1 09:30:51 2022 +0100 ARM: 9190/1: kdump: add invalid input check for 'crashkernel=0' Add invalid input check expression when 'crashkernel=0' is specified running kdump. Signed-off-by: Austin Kim Signed-off-by: Russell King (Oracle) arch/arm/kernel/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 37391cc843eb7a302eed289b3ad745863d2af470 Merge: c3efcedd272a 392baa339c6a Author: David S. Miller Date: Fri Apr 1 12:09:17 2022 +0100 Merge branch 'nexthop-route-deletye-warning' Nikolay Aleksandrov says: ==================== net: ipv4: fix nexthop route delete warning The first patch fixes a warning that can be triggered by deleting a nexthop route and specifying a device (more info in its commit msg). And the second patch adds a selftest for that case. Chose this way to fix it because we should match when deleting without nh spec and should fail when deleting a nexthop route with old-style nh spec because nexthop objects are managed separately, e.g.: $ ip r show 1.2.3.4/32 1.2.3.4 nhid 12 via 192.168.11.2 dev dummy0 $ ip r del 1.2.3.4/32 $ ip r del 1.2.3.4/32 nhid 12 $ ip r del 1.2.3.4/32 dev dummy0 v2: addded more to patch 01's commit message adjusted the test comment in patch 02 ==================== Signed-off-by: David S. Miller commit 392baa339c6a42a2cb088e5e5df2b59b8f89be24 Author: Nikolay Aleksandrov Date: Fri Apr 1 10:33:43 2022 +0300 selftests: net: add delete nexthop route warning test Add a test which causes a WARNING on kernels which treat a nexthop route like a normal route when comparing for deletion and a device is specified. That is, a route is found but we hit a warning while matching it. The warning is from fib_info_nh() in include/net/nexthop.h because we run it on a fib_info with nexthop object. The call chain is: inet_rtm_delroute -> fib_table_delete -> fib_nh_match (called with a nexthop fib_info and also with fc_oif set thus calling fib_info_nh on the fib_info and triggering the warning). Repro steps: $ ip nexthop add id 12 via 172.16.1.3 dev veth1 $ ip route add 172.16.101.1/32 nhid 12 $ ip route delete 172.16.101.1/32 dev veth1 Signed-off-by: Nikolay Aleksandrov Reviewed-by: David Ahern Signed-off-by: David S. Miller tools/testing/selftests/net/fib_nexthops.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit 6bf92d70e690b7ff12b24f4bfff5e5434d019b82 Author: Nikolay Aleksandrov Date: Fri Apr 1 10:33:42 2022 +0300 net: ipv4: fix route with nexthop object delete warning FRR folks have hit a kernel warning[1] while deleting routes[2] which is caused by trying to delete a route pointing to a nexthop id without specifying nhid but matching on an interface. That is, a route is found but we hit a warning while matching it. The warning is from fib_info_nh() in include/net/nexthop.h because we run it on a fib_info with nexthop object. The call chain is: inet_rtm_delroute -> fib_table_delete -> fib_nh_match (called with a nexthop fib_info and also with fc_oif set thus calling fib_info_nh on the fib_info and triggering the warning). The fix is to not do any matching in that branch if the fi has a nexthop object because those are managed separately. I.e. we should match when deleting without nh spec and should fail when deleting a nexthop route with old-style nh spec because nexthop objects are managed separately, e.g.: $ ip r show 1.2.3.4/32 1.2.3.4 nhid 12 via 192.168.11.2 dev dummy0 $ ip r del 1.2.3.4/32 $ ip r del 1.2.3.4/32 nhid 12 $ ip r del 1.2.3.4/32 dev dummy0 [1] [ 523.462226] ------------[ cut here ]------------ [ 523.462230] WARNING: CPU: 14 PID: 22893 at include/net/nexthop.h:468 fib_nh_match+0x210/0x460 [ 523.462236] Modules linked in: dummy rpcsec_gss_krb5 xt_socket nf_socket_ipv4 nf_socket_ipv6 ip6table_raw iptable_raw bpf_preload xt_statistic ip_set ip_vs_sh ip_vs_wrr ip_vs_rr ip_vs xt_mark nf_tables xt_nat veth nf_conntrack_netlink nfnetlink xt_addrtype br_netfilter overlay dm_crypt nfsv3 nfs fscache netfs vhost_net vhost vhost_iotlb tap tun xt_CHECKSUM xt_MASQUERADE xt_conntrack 8021q garp mrp ipt_REJECT nf_reject_ipv4 ip6table_mangle ip6table_nat iptable_mangle iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter bridge stp llc rfcomm snd_seq_dummy snd_hrtimer rpcrdma rdma_cm iw_cm ib_cm ib_core ip6table_filter xt_comment ip6_tables vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) qrtr bnep binfmt_misc xfs vfat fat squashfs loop nvidia_drm(POE) nvidia_modeset(POE) nvidia_uvm(POE) nvidia(POE) intel_rapl_msr intel_rapl_common snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi btusb btrtl iwlmvm uvcvideo btbcm snd_hda_intel edac_mce_amd [ 523.462274] videobuf2_vmalloc videobuf2_memops btintel snd_intel_dspcfg videobuf2_v4l2 snd_intel_sdw_acpi bluetooth snd_usb_audio snd_hda_codec mac80211 snd_usbmidi_lib joydev snd_hda_core videobuf2_common kvm_amd snd_rawmidi snd_hwdep snd_seq videodev ccp snd_seq_device libarc4 ecdh_generic mc snd_pcm kvm iwlwifi snd_timer drm_kms_helper snd cfg80211 cec soundcore irqbypass rapl wmi_bmof i2c_piix4 rfkill k10temp pcspkr acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc drm zram ip_tables crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel nvme sp5100_tco r8169 nvme_core wmi ipmi_devintf ipmi_msghandler fuse [ 523.462300] CPU: 14 PID: 22893 Comm: ip Tainted: P OE 5.16.18-200.fc35.x86_64 #1 [ 523.462302] Hardware name: Micro-Star International Co., Ltd. MS-7C37/MPG X570 GAMING EDGE WIFI (MS-7C37), BIOS 1.C0 10/29/2020 [ 523.462303] RIP: 0010:fib_nh_match+0x210/0x460 [ 523.462304] Code: 7c 24 20 48 8b b5 90 00 00 00 e8 bb ee f4 ff 48 8b 7c 24 20 41 89 c4 e8 ee eb f4 ff 45 85 e4 0f 85 2e fe ff ff e9 4c ff ff ff <0f> 0b e9 17 ff ff ff 3c 0a 0f 85 61 fe ff ff 48 8b b5 98 00 00 00 [ 523.462306] RSP: 0018:ffffaa53d4d87928 EFLAGS: 00010286 [ 523.462307] RAX: 0000000000000000 RBX: ffffaa53d4d87a90 RCX: ffffaa53d4d87bb0 [ 523.462308] RDX: ffff9e3d2ee6be80 RSI: ffffaa53d4d87a90 RDI: ffffffff920ed380 [ 523.462309] RBP: ffff9e3d2ee6be80 R08: 0000000000000064 R09: 0000000000000000 [ 523.462310] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000031 [ 523.462310] R13: 0000000000000020 R14: 0000000000000000 R15: ffff9e3d331054e0 [ 523.462311] FS: 00007f245517c1c0(0000) GS:ffff9e492ed80000(0000) knlGS:0000000000000000 [ 523.462313] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 523.462313] CR2: 000055e5dfdd8268 CR3: 00000003ef488000 CR4: 0000000000350ee0 [ 523.462315] Call Trace: [ 523.462316] [ 523.462320] fib_table_delete+0x1a9/0x310 [ 523.462323] inet_rtm_delroute+0x93/0x110 [ 523.462325] rtnetlink_rcv_msg+0x133/0x370 [ 523.462327] ? _copy_to_iter+0xb5/0x6f0 [ 523.462330] ? rtnl_calcit.isra.0+0x110/0x110 [ 523.462331] netlink_rcv_skb+0x50/0xf0 [ 523.462334] netlink_unicast+0x211/0x330 [ 523.462336] netlink_sendmsg+0x23f/0x480 [ 523.462338] sock_sendmsg+0x5e/0x60 [ 523.462340] ____sys_sendmsg+0x22c/0x270 [ 523.462341] ? import_iovec+0x17/0x20 [ 523.462343] ? sendmsg_copy_msghdr+0x59/0x90 [ 523.462344] ? __mod_lruvec_page_state+0x85/0x110 [ 523.462348] ___sys_sendmsg+0x81/0xc0 [ 523.462350] ? netlink_seq_start+0x70/0x70 [ 523.462352] ? __dentry_kill+0x13a/0x180 [ 523.462354] ? __fput+0xff/0x250 [ 523.462356] __sys_sendmsg+0x49/0x80 [ 523.462358] do_syscall_64+0x3b/0x90 [ 523.462361] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 523.462364] RIP: 0033:0x7f24552aa337 [ 523.462365] Code: 0e 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b9 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 [ 523.462366] RSP: 002b:00007fff7f05a838 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 523.462368] RAX: ffffffffffffffda RBX: 000000006245bf91 RCX: 00007f24552aa337 [ 523.462368] RDX: 0000000000000000 RSI: 00007fff7f05a8a0 RDI: 0000000000000003 [ 523.462369] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000 [ 523.462370] R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000001 [ 523.462370] R13: 00007fff7f05ce08 R14: 0000000000000000 R15: 000055e5dfdd1040 [ 523.462373] [ 523.462374] ---[ end trace ba537bc16f6bf4ed ]--- [2] https://github.com/FRRouting/frr/issues/6412 Fixes: 4c7e8084fd46 ("ipv4: Plumb support for nexthop object in a fib_info") Signed-off-by: Nikolay Aleksandrov Reviewed-by: David Ahern Signed-off-by: David S. Miller net/ipv4/fib_semantics.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit c3efcedd272aa6dd5929e20cf902a52ddaa1197a Author: Randy Dunlap Date: Thu Mar 31 22:42:44 2022 -0700 net: micrel: fix KS8851_MLL Kconfig KS8851_MLL selects MICREL_PHY, which depends on PTP_1588_CLOCK_OPTIONAL, so make KS8851_MLL also depend on PTP_1588_CLOCK_OPTIONAL since 'select' does not follow any dependency chains. Fixes kconfig warning and build errors: WARNING: unmet direct dependencies detected for MICREL_PHY Depends on [m]: NETDEVICES [=y] && PHYLIB [=y] && PTP_1588_CLOCK_OPTIONAL [=m] Selected by [y]: - KS8851_MLL [=y] && NETDEVICES [=y] && ETHERNET [=y] && NET_VENDOR_MICREL [=y] && HAS_IOMEM [=y] ld: drivers/net/phy/micrel.o: in function `lan8814_ts_info': micrel.c:(.text+0xb35): undefined reference to `ptp_clock_index' ld: drivers/net/phy/micrel.o: in function `lan8814_probe': micrel.c:(.text+0x2586): undefined reference to `ptp_clock_register' Signed-off-by: Randy Dunlap Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Signed-off-by: David S. Miller drivers/net/ethernet/micrel/Kconfig | 1 + 1 file changed, 1 insertion(+) commit f41bdd49afef32e63c61c3011fef53c463710169 Merge: 4298a62ff894 4a9dda1c1da6 Author: David S. Miller Date: Fri Apr 1 12:04:15 2022 +0100 Merge branch 'MCTP-fixes' Matt Johnston says: ==================== MCTP fixes The following are fixes for the mctp core and mctp-i2c driver. ==================== Signed-off-by: David S. Miller commit 4a9dda1c1da65beee994f0977a56a9a21c5db2a7 Author: Matt Johnston Date: Fri Apr 1 10:48:44 2022 +0800 mctp: Use output netdev to allocate skb headroom Previously the skb was allocated with headroom MCTP_HEADER_MAXLEN, but that isn't sufficient if we are using devs that are not MCTP specific. This also adds a check that the smctp_halen provided to sendmsg for extended addressing is the correct size for the netdev. Fixes: 833ef3b91de6 ("mctp: Populate socket implementation") Reported-by: Matthew Rinaldi Signed-off-by: Matt Johnston Signed-off-by: David S. Miller include/net/mctp.h | 2 -- net/mctp/af_mctp.c | 46 +++++++++++++++++++++++++++++++++------------- net/mctp/route.c | 14 +++++++++++--- 3 files changed, 44 insertions(+), 18 deletions(-) commit 8ce40a2fd350769e94877b53d353a3b11d85f43b Author: Matt Johnston Date: Fri Apr 1 10:48:43 2022 +0800 mctp i2c: correct mctp_i2c_header_create result header_ops.create should return the length of the header, instead mctp_i2c_head_create() returned 0. This didn't cause any problem because the MCTP stack accepted 0 as success. Fixes: f5b8abf9fc3d ("mctp i2c: MCTP I2C binding driver") Signed-off-by: Matt Johnston Signed-off-by: David S. Miller drivers/net/mctp/mctp-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 60be976ac45137657b7b505d7e0d44d0e51accb7 Author: Matt Johnston Date: Fri Apr 1 10:48:42 2022 +0800 mctp: Fix check for dev_hard_header() result dev_hard_header() returns the length of the header, so we need to test for negative errors rather than non-zero. Fixes: 889b7da23abf ("mctp: Add initial routing framework") Signed-off-by: Matt Johnston Signed-off-by: David S. Miller net/mctp/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4298a62ff894b5b3b3e6545b2aa6dcbcfdc69be1 Merge: 066dfc429040 1273f89578f2 Author: David S. Miller Date: Fri Apr 1 12:01:38 2022 +0100 Merge branch 'ice-fixups' Tony Nguyen says: ==================== ice-fixups This series handles a handful of cleanups for the ice driver. Ivan fixed a problem on the VSI during a release, fixing a MAC address setting, and a broken IFF_ALLMULTI handling. ==================== Signed-off-by: David S. Miller commit 1273f89578f268ea705ddbad60c4bd2dcff80611 Author: Ivan Vecera Date: Thu Mar 31 09:20:08 2022 -0700 ice: Fix broken IFF_ALLMULTI handling Handling of all-multicast flag and associated multicast promiscuous mode is broken in ice driver. When an user switches allmulticast flag on or off the driver checks whether any VLANs are configured over the interface (except default VLAN 0). If any extra VLANs are registered it enables multicast promiscuous mode for all these VLANs (including default VLAN 0) using ICE_SW_LKUP_PROMISC_VLAN look-up type. In this situation all multicast packets tagged with known VLAN ID or untagged are received and multicast packets tagged with unknown VLAN ID ignored. If no extra VLANs are registered (so only VLAN 0 exists) it enables multicast promiscuous mode for VLAN 0 and uses ICE_SW_LKUP_PROMISC look-up type. In this situation any multicast packets including tagged ones are received. The driver handles IFF_ALLMULTI in ice_vsi_sync_fltr() this way: ice_vsi_sync_fltr() { ... if (changed_flags & IFF_ALLMULTI) { if (netdev->flags & IFF_ALLMULTI) { if (vsi->num_vlans > 1) ice_set_promisc(..., ICE_MCAST_VLAN_PROMISC_BITS); else ice_set_promisc(..., ICE_MCAST_PROMISC_BITS); } else { if (vsi->num_vlans > 1) ice_clear_promisc(..., ICE_MCAST_VLAN_PROMISC_BITS); else ice_clear_promisc(..., ICE_MCAST_PROMISC_BITS); } } ... } The code above depends on value vsi->num_vlan that specifies number of VLANs configured over the interface (including VLAN 0) and this is problem because that value is modified in NDO callbacks ice_vlan_rx_add_vid() and ice_vlan_rx_kill_vid(). Scenario 1: 1. ip link set ens7f0 allmulticast on 2. ip link add vlan10 link ens7f0 type vlan id 10 3. ip link set ens7f0 allmulticast off 4. ip link set ens7f0 allmulticast on [1] In this scenario IFF_ALLMULTI is enabled and the driver calls ice_set_promisc(..., ICE_MCAST_PROMISC_BITS) that installs multicast promisc rule with non-VLAN look-up type. [2] Then VLAN with ID 10 is added and vsi->num_vlan incremented to 2 [3] Command switches IFF_ALLMULTI off and the driver calls ice_clear_promisc(..., ICE_MCAST_VLAN_PROMISC_BITS) but this call is effectively NOP because it looks for multicast promisc rules for VLAN 0 and VLAN 10 with VLAN look-up type but no such rules exist. So the all-multicast remains enabled silently in hardware. [4] Command tries to switch IFF_ALLMULTI on and the driver calls ice_clear_promisc(..., ICE_MCAST_PROMISC_BITS) but this call fails (-EEXIST) because non-VLAN multicast promisc rule already exists. Scenario 2: 1. ip link add vlan10 link ens7f0 type vlan id 10 2. ip link set ens7f0 allmulticast on 3. ip link add vlan20 link ens7f0 type vlan id 20 4. ip link del vlan10 ; ip link del vlan20 5. ip link set ens7f0 allmulticast off [1] VLAN with ID 10 is added and vsi->num_vlan==2 [2] Command switches IFF_ALLMULTI on and driver installs multicast promisc rules with VLAN look-up type for VLAN 0 and 10 [3] VLAN with ID 20 is added and vsi->num_vlan==3 but no multicast promisc rules is added for this new VLAN so the interface does not receive MC packets from VLAN 20 [4] Both VLANs are removed but multicast rule for VLAN 10 remains installed so interface receives multicast packets from VLAN 10 [5] Command switches IFF_ALLMULTI off and because vsi->num_vlan is 1 the driver tries to remove multicast promisc rule for VLAN 0 with non-VLAN look-up that does not exist. All-multicast looks disabled from user point of view but it is partially enabled in HW (interface receives all multicast packets either untagged or tagged with VLAN ID 10) To resolve these issues the patch introduces these changes: 1. Adds handling for IFF_ALLMULTI to ice_vlan_rx_add_vid() and ice_vlan_rx_kill_vid() callbacks. So when VLAN is added/removed and IFF_ALLMULTI is enabled an appropriate multicast promisc rule for that VLAN ID is added/removed. 2. In ice_vlan_rx_add_vid() when first VLAN besides VLAN 0 is added so (vsi->num_vlan == 2) and IFF_ALLMULTI is enabled then look-up type for existing multicast promisc rule for VLAN 0 is updated to ICE_MCAST_VLAN_PROMISC_BITS. 3. In ice_vlan_rx_kill_vid() when last VLAN besides VLAN 0 is removed so (vsi->num_vlan == 1) and IFF_ALLMULTI is enabled then look-up type for existing multicast promisc rule for VLAN 0 is updated to ICE_MCAST_PROMISC_BITS. 4. Both ice_vlan_rx_{add,kill}_vid() have to run under ICE_CFG_BUSY bit protection to avoid races with ice_vsi_sync_fltr() that runs in ice_service_task() context. 5. Bit ICE_VSI_VLAN_FLTR_CHANGED is use-less and can be removed. 6. Error messages added to ice_fltr_*_vsi_promisc() helper functions to avoid them in their callers 7. Small improvements to increase readability Fixes: 5eda8afd6bcc ("ice: Add support for PF/VF promiscuous mode") Signed-off-by: Ivan Vecera Reviewed-by: Jacob Keller Signed-off-by: Alice Michael Signed-off-by: David S. Miller drivers/net/ethernet/intel/ice/ice.h | 1 - drivers/net/ethernet/intel/ice/ice_fltr.c | 44 ++++++++++-- drivers/net/ethernet/intel/ice/ice_main.c | 114 +++++++++++++++++++++--------- 3 files changed, 121 insertions(+), 38 deletions(-) commit 2c0069f3f91f125b1b2ce66cc6bea8eb134723c3 Author: Ivan Vecera Date: Thu Mar 31 09:20:07 2022 -0700 ice: Fix MAC address setting Commit 2ccc1c1ccc671b ("ice: Remove excess error variables") merged the usage of 'status' and 'err' variables into single one in function ice_set_mac_address(). Unfortunately this causes a regression when call of ice_fltr_add_mac() returns -EEXIST because this return value does not indicate an error in this case but value of 'err' remains to be -EEXIST till the end of the function and is returned to caller. Prior mentioned commit this does not happen because return value of ice_fltr_add_mac() was stored to 'status' variable first and if it was -EEXIST then 'err' remains to be zero. Fix the problem by reset 'err' to zero when ice_fltr_add_mac() returns -EEXIST. Fixes: 2ccc1c1ccc671b ("ice: Remove excess error variables") Signed-off-by: Ivan Vecera Reviewed-by: Jacob Keller Acked-by: Alexander Lobakin Signed-off-by: Alice Michael Signed-off-by: David S. Miller drivers/net/ethernet/intel/ice/ice_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit bd8c624c0cd59de0032752ba3001c107bba97f7b Author: Ivan Vecera Date: Thu Mar 31 09:20:06 2022 -0700 ice: Clear default forwarding VSI during VSI release VSI is set as default forwarding one when promisc mode is set for PF interface, when PF is switched to switchdev mode or when VF driver asks to enable allmulticast or promisc mode for the VF interface (when vf-true-promisc-support priv flag is off). The third case is buggy because in that case VSI associated with VF remains as default one after VF removal. Reproducer: 1. Create VF echo 1 > sys/class/net/ens7f0/device/sriov_numvfs 2. Enable allmulticast or promisc mode on VF ip link set ens7f0v0 allmulticast on ip link set ens7f0v0 promisc on 3. Delete VF echo 0 > sys/class/net/ens7f0/device/sriov_numvfs 4. Try to enable promisc mode on PF ip link set ens7f0 promisc on Although it looks that promisc mode on PF is enabled the opposite is true because ice_vsi_sync_fltr() responsible for IFF_PROMISC handling first checks if any other VSI is set as default forwarding one and if so the function does not do anything. At this point it is not possible to enable promisc mode on PF without re-probe device. To resolve the issue this patch clear default forwarding VSI during ice_vsi_release() when the VSI to be released is the default one. Fixes: 01b5e89aab49 ("ice: Add VF promiscuous support") Signed-off-by: Ivan Vecera Reviewed-by: Michal Swiatkowski Reviewed-by: Maciej Fijalkowski Signed-off-by: Alice Michael Signed-off-by: David S. Miller drivers/net/ethernet/intel/ice/ice_lib.c | 2 ++ 1 file changed, 2 insertions(+) commit 066dfc4290406b1b0b014ae3267d4266a344efd1 Author: Vladimir Oltean Date: Thu Mar 31 16:28:54 2022 +0300 Revert "net: dsa: stop updating master MTU from master.c" This reverts commit a1ff94c2973c43bc1e2677ac63ebb15b1d1ff846. Switch drivers that don't implement ->port_change_mtu() will cause the DSA master to remain with an MTU of 1500, since we've deleted the other code path. In turn, this causes a regression for those systems, where MTU-sized traffic can no longer be terminated. Revert the change taking into account the fact that rtnl_lock() is now taken top-level from the callers of dsa_master_setup() and dsa_master_teardown(). Also add a comment in order for it to be absolutely clear why it is still needed. Fixes: a1ff94c2973c ("net: dsa: stop updating master MTU from master.c") Reported-by: Luiz Angelo Daros de Luca Signed-off-by: Vladimir Oltean Tested-by: Luiz Angelo Daros de Luca Signed-off-by: David S. Miller net/dsa/master.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) commit 1effe8ca4e34c34cdd9318436a4232dcb582ebf4 Author: Jean-Philippe Brucker Date: Thu Mar 31 11:24:41 2022 +0100 skbuff: fix coalescing for page_pool fragment recycling Fix a use-after-free when using page_pool with page fragments. We encountered this problem during normal RX in the hns3 driver: (1) Initially we have three descriptors in the RX queue. The first one allocates PAGE1 through page_pool, and the other two allocate one half of PAGE2 each. Page references look like this: RX_BD1 _______ PAGE1 RX_BD2 _______ PAGE2 RX_BD3 _________/ (2) Handle RX on the first descriptor. Allocate SKB1, eventually added to the receive queue by tcp_queue_rcv(). (3) Handle RX on the second descriptor. Allocate SKB2 and pass it to netif_receive_skb(): netif_receive_skb(SKB2) ip_rcv(SKB2) SKB3 = skb_clone(SKB2) SKB2 and SKB3 share a reference to PAGE2 through skb_shinfo()->dataref. The other ref to PAGE2 is still held by RX_BD3: SKB2 ---+- PAGE2 SKB3 __/ / RX_BD3 _________/ (3b) Now while handling TCP, coalesce SKB3 with SKB1: tcp_v4_rcv(SKB3) tcp_try_coalesce(to=SKB1, from=SKB3) // succeeds kfree_skb_partial(SKB3) skb_release_data(SKB3) // drops one dataref SKB1 _____ PAGE1 \____ SKB2 _____ PAGE2 / RX_BD3 _________/ In skb_try_coalesce(), __skb_frag_ref() takes a page reference to PAGE2, where it should instead have increased the page_pool frag reference, pp_frag_count. Without coalescing, when releasing both SKB2 and SKB3, a single reference to PAGE2 would be dropped. Now when releasing SKB1 and SKB2, two references to PAGE2 will be dropped, resulting in underflow. (3c) Drop SKB2: af_packet_rcv(SKB2) consume_skb(SKB2) skb_release_data(SKB2) // drops second dataref page_pool_return_skb_page(PAGE2) // drops one pp_frag_count SKB1 _____ PAGE1 \____ PAGE2 / RX_BD3 _________/ (4) Userspace calls recvmsg() Copies SKB1 and releases it. Since SKB3 was coalesced with SKB1, we release the SKB3 page as well: tcp_eat_recv_skb(SKB1) skb_release_data(SKB1) page_pool_return_skb_page(PAGE1) page_pool_return_skb_page(PAGE2) // drops second pp_frag_count (5) PAGE2 is freed, but the third RX descriptor was still using it! In our case this causes IOMMU faults, but it would silently corrupt memory if the IOMMU was disabled. Change the logic that checks whether pp_recycle SKBs can be coalesced. We still reject differing pp_recycle between 'from' and 'to' SKBs, but in order to avoid the situation described above, we also reject coalescing when both 'from' and 'to' are pp_recycled and 'from' is cloned. The new logic allows coalescing a cloned pp_recycle SKB into a page refcounted one, because in this case the release (4) will drop the right reference, the one taken by skb_try_coalesce(). Fixes: 53e0961da1c7 ("page_pool: add frag page recycling support in page pool") Suggested-by: Alexander Duyck Signed-off-by: Jean-Philippe Brucker Reviewed-by: Yunsheng Lin Reviewed-by: Alexander Duyck Acked-by: Ilias Apalodimas Acked-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller net/core/skbuff.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) commit 012d69fbfcc739f846766c1da56ef8b493b803b5 Author: Eyal Birger Date: Thu Mar 31 10:26:43 2022 +0300 vrf: fix packet sniffing for traffic originating from ip tunnels in commit 048939088220 ("vrf: add mac header for tunneled packets when sniffer is attached") an Ethernet header was cooked for traffic originating from tunnel devices. However, the header is added based on whether the mac_header is unset and ignores cases where the device doesn't expose a mac header to upper layers, such as in ip tunnels like ipip and gre. Traffic originating from such devices still appears garbled when capturing on the vrf device. Fix by observing whether the original device exposes a header to upper layers, similar to the logic done in af_packet. In addition, skb->mac_len needs to be adjusted after adding the Ethernet header for the skb_push/pull() surrounding dev_queue_xmit_nit() to work on these packets. Fixes: 048939088220 ("vrf: add mac header for tunneled packets when sniffer is attached") Signed-off-by: Eyal Birger Reviewed-by: David Ahern Signed-off-by: David S. Miller drivers/net/vrf.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) commit 9381fe8c849cfbe50245ac01fc077554f6eaa0e2 Author: Ziyang Xuan Date: Thu Mar 31 15:04:28 2022 +0800 net/tls: fix slab-out-of-bounds bug in decrypt_internal The memory size of tls_ctx->rx.iv for AES128-CCM is 12 setting in tls_set_sw_offload(). The return value of crypto_aead_ivsize() for "ccm(aes)" is 16. So memcpy() require 16 bytes from 12 bytes memory space will trigger slab-out-of-bounds bug as following: ================================================================== BUG: KASAN: slab-out-of-bounds in decrypt_internal+0x385/0xc40 [tls] Read of size 16 at addr ffff888114e84e60 by task tls/10911 Call Trace: dump_stack_lvl+0x34/0x44 print_report.cold+0x5e/0x5db ? decrypt_internal+0x385/0xc40 [tls] kasan_report+0xab/0x120 ? decrypt_internal+0x385/0xc40 [tls] kasan_check_range+0xf9/0x1e0 memcpy+0x20/0x60 decrypt_internal+0x385/0xc40 [tls] ? tls_get_rec+0x2e0/0x2e0 [tls] ? process_rx_list+0x1a5/0x420 [tls] ? tls_setup_from_iter.constprop.0+0x2e0/0x2e0 [tls] decrypt_skb_update+0x9d/0x400 [tls] tls_sw_recvmsg+0x3c8/0xb50 [tls] Allocated by task 10911: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x81/0xa0 tls_set_sw_offload+0x2eb/0xa20 [tls] tls_setsockopt+0x68c/0x700 [tls] __sys_setsockopt+0xfe/0x1b0 Replace the crypto_aead_ivsize() with prot->iv_size + prot->salt_size when memcpy() iv value in TLS_1_3_VERSION scenario. Fixes: f295b3ae9f59 ("net/tls: Add support of AES128-CCM based ciphers") Signed-off-by: Ziyang Xuan Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller net/tls/tls_sw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 059a47f1da93811d37533556d67e72f2261b1127 Author: Taehee Yoo Date: Wed Mar 30 16:37:03 2022 +0000 net: sfc: add missing xdp queue reinitialization After rx/tx ring buffer size is changed, kernel panic occurs when it acts XDP_TX or XDP_REDIRECT. When tx/rx ring buffer size is changed(ethtool -G), sfc driver reallocates and reinitializes rx and tx queues and their buffer (tx_queue->buffer). But it misses reinitializing xdp queues(efx->xdp_tx_queues). So, while it is acting XDP_TX or XDP_REDIRECT, it uses the uninitialized tx_queue->buffer. A new function efx_set_xdp_channels() is separated from efx_set_channels() to handle only xdp queues. Splat looks like: BUG: kernel NULL pointer dereference, address: 000000000000002a #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#4] PREEMPT SMP NOPTI RIP: 0010:efx_tx_map_chunk+0x54/0x90 [sfc] CPU: 2 PID: 0 Comm: swapper/2 Tainted: G D 5.17.0+ #55 e8beeee8289528f11357029357cf Code: 48 8b 8d a8 01 00 00 48 8d 14 52 4c 8d 2c d0 44 89 e0 48 85 c9 74 0e 44 89 e2 4c 89 f6 48 80 RSP: 0018:ffff92f121e45c60 EFLAGS: 00010297 RIP: 0010:efx_tx_map_chunk+0x54/0x90 [sfc] RAX: 0000000000000040 RBX: ffff92ea506895c0 RCX: ffffffffc0330870 RDX: 0000000000000001 RSI: 00000001139b10ce RDI: ffff92ea506895c0 RBP: ffffffffc0358a80 R08: 00000001139b110d R09: 0000000000000000 R10: 0000000000000001 R11: ffff92ea414c0088 R12: 0000000000000040 R13: 0000000000000018 R14: 00000001139b10ce R15: ffff92ea506895c0 FS: 0000000000000000(0000) GS:ffff92f121ec0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Code: 48 8b 8d a8 01 00 00 48 8d 14 52 4c 8d 2c d0 44 89 e0 48 85 c9 74 0e 44 89 e2 4c 89 f6 48 80 CR2: 000000000000002a CR3: 00000003e6810004 CR4: 00000000007706e0 RSP: 0018:ffff92f121e85c60 EFLAGS: 00010297 PKRU: 55555554 RAX: 0000000000000040 RBX: ffff92ea50689700 RCX: ffffffffc0330870 RDX: 0000000000000001 RSI: 00000001145a90ce RDI: ffff92ea50689700 RBP: ffffffffc0358a80 R08: 00000001145a910d R09: 0000000000000000 R10: 0000000000000001 R11: ffff92ea414c0088 R12: 0000000000000040 R13: 0000000000000018 R14: 00000001145a90ce R15: ffff92ea50689700 FS: 0000000000000000(0000) GS:ffff92f121e80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000002a CR3: 00000003e6810005 CR4: 00000000007706e0 PKRU: 55555554 Call Trace: efx_xdp_tx_buffers+0x12b/0x3d0 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] __efx_rx_packet+0x5c3/0x930 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] efx_rx_packet+0x28c/0x2e0 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] efx_ef10_ev_process+0x5f8/0xf40 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] ? enqueue_task_fair+0x95/0x550 efx_poll+0xc4/0x360 [sfc 84c94b8e32d44d296c17e10a634d3ad454de4ba5] Fixes: 3990a8fffbda ("sfc: allocate channels for XDP tx queues") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller drivers/net/ethernet/sfc/efx_channels.c | 146 ++++++++++++++++++-------------- 1 file changed, 81 insertions(+), 65 deletions(-) commit 41022eff9c2d21e658c7a6fcd31005bf514d28b7 Author: Paul Cercueil Date: Thu Mar 31 17:42:00 2022 +0100 MIPS: crypto: Fix CRC32 code Commit 67512a8cf5a7 ("MIPS: Avoid macro redefinitions") changed how the MIPS register macros were defined, in order to allow the code to compile under LLVM/Clang. The MIPS CRC32 code however wasn't updated accordingly, causing a build bug when using a MIPS32r6 toolchain without CRC support. Update the CRC32 code to use the macros correctly, to fix the build failures. Fixes: 67512a8cf5a7 ("MIPS: Avoid macro redefinitions") Cc: Signed-off-by: Paul Cercueil Reported-by: kernel test robot Signed-off-by: Thomas Bogendoerfer arch/mips/crypto/crc32-mips.c | 46 ++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 20 deletions(-) commit 61a891efbb1099bb7bdcedfc50f802fabbe46a0e Author: Kalle Valo Date: Wed Mar 30 17:40:46 2022 +0300 MAINTAINERS: mark wil6210 as orphan Maya is not working on wil6210 anymore so mark it as orphan. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220330144046.11229-1-kvalo@kernel.org MAINTAINERS | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 598be865ee00905f16ef3d0355fefe319cac981a Author: Johannes Berg Date: Mon Mar 28 11:40:30 2022 +0200 MAINTAINERS: claim include/uapi/linux/wireless.h As much as I don't really want to maintain this legacy cruft that we started replacing 15+ years ago, for now it still falls on me to take care of it. Add a missing file to the list. Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220328114029.526fbb42784d.If7c79b4ca827dfe82a545689f2d31fcedabd8387@changeid MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit 037250f0a45cf9ecf5b52d4b9ff8eadeb609c800 Author: Toke Høiland-Jørgensen Date: Wed Mar 30 18:44:09 2022 +0200 ath9k: Properly clear TX status area before reporting to mac80211 The ath9k driver was not properly clearing the status area in the ieee80211_tx_info struct before reporting TX status to mac80211. Instead, it was manually filling in fields, which meant that fields introduced later were left as-is. Conveniently, mac80211 actually provides a helper to zero out the status area, so use that to make sure we zero everything. The last commit touching the driver function writing the status information seems to have actually been fixing an issue that was also caused by the area being uninitialised; but it only added clearing of a single field instead of the whole struct. That is now redundant, though, so revert that commit and use it as a convenient Fixes tag. Fixes: cc591d77aba1 ("ath9k: Make sure to zero status.tx_time before reporting TX status") Reported-by: Bagas Sanjaya Cc: Signed-off-by: Toke Høiland-Jørgensen Tested-by: Bagas Sanjaya Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220330164409.16645-1-toke@toke.dk drivers/net/wireless/ath/ath9k/xmit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 4fe87e818ea492ade079cc01a31d088e445f8539 Author: Christoph Hellwig Date: Thu Mar 31 08:01:21 2022 +0200 dma-mapping: move pgprot_decrypted out of dma_pgprot pgprot_decrypted is used by AMD SME systems to allow access to memory that was set to not encrypted using set_memory_decrypted. That only happens for dma-direct memory as the IOMMU solves the addressing challenges for the encryption bit using its own remapping. Move the pgprot_decrypted call out of dma_pgprot which is also used by the IOMMU mappings and into dma-direct so that it is only used with memory that was set decrypted. Fixes: f5ff79fddf0e ("dma-mapping: remove CONFIG_DMA_REMAP") Reported-by: Alex Xu (Hello71) Signed-off-by: Christoph Hellwig Tested-by: Alex Xu (Hello71) kernel/dma/direct.c | 10 ++++++++-- kernel/dma/mapping.c | 2 -- 2 files changed, 8 insertions(+), 4 deletions(-) commit 8b188fba75195745026e11d408e4a7e94e01d701 Author: José Expósito Date: Thu Mar 31 21:15:36 2022 -0700 Revert "Input: clear BTN_RIGHT/MIDDLE on buttonpads" This reverts commit 37ef4c19b4c659926ce65a7ac709ceaefb211c40. The touchpad present in the Dell Precision 7550 and 7750 laptops reports a HID_DG_BUTTONTYPE of type MT_BUTTONTYPE_CLICKPAD. However, the device is not a clickpad, it is a touchpad with physical buttons. In order to fix this issue, a quirk for the device was introduced in libinput [1] [2] to disable the INPUT_PROP_BUTTONPAD property: [Precision 7x50 Touchpad] MatchBus=i2c MatchUdevType=touchpad MatchDMIModalias=dmi:*svnDellInc.:pnPrecision7?50* AttrInputPropDisable=INPUT_PROP_BUTTONPAD However, because of the change introduced in 37ef4c19b4 ("Input: clear BTN_RIGHT/MIDDLE on buttonpads") the BTN_RIGHT key bit is not mapped anymore breaking the device right click button and making impossible to workaround it in user space. In order to avoid breakage on other present or future devices, revert the patch causing the issue. Signed-off-by: José Expósito Reviewed-by: Hans de Goede Acked-by: Peter Hutterer Acked-by: Benjamin Tissoires Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220321184404.20025-1-jose.exposito89@gmail.com Signed-off-by: Dmitry Torokhov drivers/input/input.c | 6 ------ 1 file changed, 6 deletions(-) commit a4a3d8c52d952ab1f5c8b8b67b57f2e01936628d Author: Yuezhang Mo Date: Sat Mar 19 11:08:03 2022 +0900 exfat: do not clear VolumeDirty in writeback Before this commit, VolumeDirty will be cleared first in writeback if 'dirsync' or 'sync' is not enabled. If the power is suddenly cut off after cleaning VolumeDirty but other updates are not written, the exFAT filesystem will not be able to detect the power failure in the next mount. And VolumeDirty will be set again but not cleared when updating the parent directory. It means that BootSector will be written at least once in each write-back, which will shorten the life of the device. Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru Signed-off-by: Yuezhang Mo Signed-off-by: Namjae Jeon fs/exfat/file.c | 2 -- fs/exfat/namei.c | 5 ----- fs/exfat/super.c | 10 ++-------- 3 files changed, 2 insertions(+), 15 deletions(-) commit 9ec784bf774c2d3b35a7577fc6441cfbd60aefea Author: Vasant Karasulli Date: Thu Mar 17 10:50:47 2022 +0100 exfat: allow access to paths with trailing dots The Linux kernel exfat driver currently unconditionally strips trailing periods '.' from path components. This isdone intentionally, loosely following Windows behaviour and specifications which state: #exFAT The concatenated file name has the same set of illegal characters as other FAT-based file systems (see Table 31). #FAT ... Leading and trailing spaces in a long name are ignored. Leading and embedded periods are allowed in a name and are stored in the long name. Trailing periods are ignored. Note: Leading and trailing space ' ' characters are currently retained by Linux kernel exfat, in conflict with the above specification. On Windows 10, trailing and leading space ' ' characters are stripped from the filenames. Some implementations, such as fuse-exfat, don't perform path trailer removal. When mounting images which contain trailing-dot paths, these paths are unreachable, e.g.: + mount.exfat-fuse /dev/zram0 /mnt/test/ FUSE exfat 1.3.0 + cd /mnt/test/ + touch fuse_created_dots... ' fuse_created_spaces ' + ls -l total 0 -rwxrwxrwx 1 root 0 0 Aug 18 09:45 ' fuse_created_spaces ' -rwxrwxrwx 1 root 0 0 Aug 18 09:45 fuse_created_dots... + cd / + umount /mnt/test/ + mount -t exfat /dev/zram0 /mnt/test + cd /mnt/test + ls -l ls: cannot access 'fuse_created_dots...': No such file or directory total 0 -rwxr-xr-x 1 root 0 0 Aug 18 09:45 ' fuse_created_spaces ' -????????? ? ? ? ? ? fuse_created_dots... + touch kexfat_created_dots... ' kexfat_created_spaces ' + ls -l ls: cannot access 'fuse_created_dots...': No such file or directory total 0 -rwxr-xr-x 1 root 0 0 Aug 18 09:45 ' fuse_created_spaces ' -rwxr-xr-x 1 root 0 0 Aug 18 09:45 ' kexfat_created_spaces ' -????????? ? ? ? ? ? fuse_created_dots... -rwxr-xr-x 1 root 0 0 Aug 18 09:45 kexfat_created_dots + cd / + umount /mnt/test/ This commit adds "keep_last_dots" mount option that controls whether or not trailing periods '.' are stripped from path components during file lookup or file creation. This mount option can be used to access paths with trailing periods and disallow creating files with names with trailing periods. E.g. continuing from the previous example: + mount -t exfat -o keep_last_dots /dev/zram0 /mnt/test + cd /mnt/test + ls -l total 0 -rwxr-xr-x 1 root 0 0 Aug 18 10:32 ' fuse_created_spaces ' -rwxr-xr-x 1 root 0 0 Aug 18 10:32 ' kexfat_created_spaces ' -rwxr-xr-x 1 root 0 0 Aug 18 10:32 fuse_created_dots... -rwxr-xr-x 1 root 0 0 Aug 18 10:32 kexfat_created_dots + echo > kexfat_created_dots_again... sh: kexfat_created_dots_again...: Invalid argument Link: https://bugzilla.suse.com/show_bug.cgi?id=1188964 Link: https://lore.kernel.org/linux-fsdevel/003b01d755e4$31fb0d80$95f12880$ @samsung.com/ Link: https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification Suggested-by: Takashi Iwai Signed-off-by: Vasant Karasulli Co-developed-by: David Disseldorp Signed-off-by: David Disseldorp Signed-off-by: Namjae Jeon fs/exfat/exfat_fs.h | 3 ++- fs/exfat/namei.c | 50 ++++++++++++++++++++++++++++++++++++-------------- fs/exfat/super.c | 7 +++++++ 3 files changed, 45 insertions(+), 15 deletions(-) commit 1464d00b27b2e29a5556f6a4099cf083886e883f Author: Palmer Dabbelt Date: Wed Mar 30 16:47:38 2022 -0700 RISC-V: K210 defconfigs: Drop redundant MEMBARRIER=n As of 93917ad50972 ("RISC-V: Add support for restartable sequence") we have support for restartable sequences, which default to enabled. These select MEMBARRIER, so disabling it is now redundant. Signed-off-by: Palmer Dabbelt arch/riscv/configs/nommu_k210_defconfig | 1 - arch/riscv/configs/nommu_k210_sdcard_defconfig | 1 - arch/riscv/configs/nommu_virt_defconfig | 1 - 3 files changed, 3 deletions(-) commit 6f562570b9c5d6a3e30d87aec60a9d8f22a3203c Author: Palmer Dabbelt Date: Wed Mar 30 16:47:37 2022 -0700 RISC-V: defconfig: Drop redundant SBI HVC and earlycon As of 3938d5a2f936 ("riscv: default to CONFIG_RISCV_SBI_V01=n") we no longer default to enabling SBI-0.1 support, so these dependent configs no longer have any effect. Remove them to avoid clutter. Signed-off-by: Palmer Dabbelt arch/riscv/configs/defconfig | 2 -- arch/riscv/configs/rv32_defconfig | 2 -- 2 files changed, 4 deletions(-) commit 0e8eb5e8acbad19ac2e1856b2fb2320184299b33 Author: Tzung-Bi Shih Date: Wed Feb 9 13:11:30 2022 +0800 platform/chrome: cros_ec_debugfs: detach log reader wq from devm Debugfs console_log uses devm memory (e.g. debug_info in cros_ec_console_log_poll()). However, lifecycles of device and debugfs are independent. An use-after-free issue is observed if userland program operates the debugfs after the memory has been freed. The call trace: do_raw_spin_lock _raw_spin_lock_irqsave remove_wait_queue ep_unregister_pollwait ep_remove do_epoll_ctl A Python example to reproduce the issue: ... import select ... p = select.epoll() ... f = open('/sys/kernel/debug/cros_scp/console_log') ... p.register(f, select.POLLIN) ... p.poll(1) [(4, 1)] # 4=fd, 1=select.POLLIN [ shutdown cros_scp at the point ] ... p.poll(1) [(4, 16)] # 4=fd, 16=select.POLLHUP ... p.unregister(f) An use-after-free issue raises here. It called epoll_ctl with EPOLL_CTL_DEL which in turn to use the workqueue in the devm (i.e. log_wq). Detaches log reader's workqueue from devm to make sure it is persistent even if the device has been removed. Signed-off-by: Tzung-Bi Shih Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220209051130.386175-1-tzungbi@google.com Signed-off-by: Benson Leung drivers/platform/chrome/cros_ec_debugfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit eabd9a3807e17e211690e6c40f1405b427b64c48 Author: Gwendal Grignou Date: Fri Jan 21 16:13:01 2022 -0800 platform: chrome: Split trace include file cros_ec_trace.h defined 5 tracing events, 2 for cros_ec_proto and 3 for cros_ec_sensorhub_ring. These 2 files are in different kernel modules, the traces are defined twice in the kernel which leads to problem enabling only some traces. Move sensorhub traces from cros_ec_trace.h to cros_ec_sensorhub_trace.h and enable them only in cros_ec_sensorhub kernel module. Check we can now enable any single traces: without this patch, we can only enable all sensorhub traces or none. Fixes: d453ceb6549a ("platform/chrome: sensorhub: Add trace events for sample") Signed-off-by: Gwendal Grignou Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220122001301.640337-1-gwendal@chromium.org Signed-off-by: Benson Leung drivers/platform/chrome/Makefile | 3 +- drivers/platform/chrome/cros_ec_sensorhub_ring.c | 3 +- drivers/platform/chrome/cros_ec_sensorhub_trace.h | 123 ++++++++++++++++++++++ drivers/platform/chrome/cros_ec_trace.h | 95 ----------------- 4 files changed, 127 insertions(+), 97 deletions(-) commit 8933e7f2e37549cf54ad1133476bda8ec05b68ea Author: Bagas Sanjaya Date: Tue Mar 29 15:44:28 2022 +0700 Documentation: riscv: remove non-existent directory from table of contents This subdir no longer exists: it was there to document some of the quirks and paths forward for handling them, but those have been dealt with as of Atish's recent patch set. Fixes: 23b1f18326ec ("Documentation: riscv: Remove the old documentation") Link: https://lore.kernel.org/linux-next/20220329133412.591d6882@canb.auug.org.au/ Reported-by: Stephen Rothwell Signed-off-by: Bagas Sanjaya [Palmer: commit text] Signed-off-by: Palmer Dabbelt Documentation/riscv/index.rst | 1 - 1 file changed, 1 deletion(-) commit e8b767f5e04097aaedcd6e06e2270f9fe5282696 Merge: a87a08e3bf2d 82017457957a Author: Linus Torvalds Date: Thu Mar 31 16:16:58 2022 -0700 Merge tag 'for-linus-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML updates from Richard Weinberger: - Devicetree support (for testing) - Various cleanups and fixes: UBD, port_user, uml_mconsole - Maintainer update * tag 'for-linus-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: run_helper: Write error message to kernel log on exec failure on host um: port_user: Improve error handling when port-helper is not found um: port_user: Allow setting path to port-helper using UML_PORT_HELPER envvar um: port_user: Search for in.telnetd in PATH um: clang: Strip out -mno-global-merge from USER_CFLAGS docs: UML: Mention telnetd for port channel um: Remove unused timeval_to_ns() function um: Fix uml_mconsole stop/go um: Cleanup syscall_handler_t definition/cast, fix warning uml: net: vector: fix const issue um: Fix WRITE_ZEROES in the UBD Driver um: Migrate vector drivers to NAPI um: Fix order of dtb unflatten/early init um: fix and optimize xor select template for CONFIG64 and timetravel mode um: Document dtb command line option lib/logic_iomem: correct fallback config references um: Remove duplicated include in syscalls_64.c MAINTAINERS: Update UserModeLinux entry commit a87a08e3bf2decaed29c4dfde3916676f9b966a8 Merge: 3d198e42ce25 705757274599 Author: Linus Torvalds Date: Thu Mar 31 16:09:41 2022 -0700 Merge tag 'for-linus-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs Pull JFFS2, UBI and UBIFS updates from Richard Weinberger: "JFFS2: - Fixes for various memory issues UBI: - Fix for a race condition in cdev ioctl handler UBIFS: - Fixes for O_TMPFILE and whiteout handling - Fixes for various memory issues" * tag 'for-linus-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: ubifs: rename_whiteout: correct old_dir size computing jffs2: fix memory leak in jffs2_scan_medium jffs2: fix memory leak in jffs2_do_mount_fs jffs2: fix use-after-free in jffs2_clear_xattr_subsystem fs/jffs2: fix comments mentioning i_mutex ubi: fastmap: Return error code if memory allocation fails in add_aeb() ubifs: Fix to add refcount once page is set private ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock() ubifs: setflags: Make dirtied_ino_d 8 bytes aligned ubifs: Rectify space amount budget for mkdir/tmpfile operations ubifs: Fix 'ui->dirty' race between do_tmpfile() and writeback work ubifs: Rename whiteout atomically ubifs: Add missing iput if do_tmpfile() failed in rename whiteout ubifs: Fix wrong number of inodes locked by ui_mutex in ubifs_inode comment ubifs: Fix deadlock in concurrent rename whiteout and inode writeback ubifs: rename_whiteout: Fix double free for whiteout_ui->data ubi: Fix race condition between ctrl_cdev_ioctl and ubi_cdev_ioctl commit 2651ee5ae43241831ca63d7158bb2b151a6a0e1f Author: Jakob Koschel Date: Fri Apr 1 00:03:49 2022 +0200 drbd: remove check of list iterator against head past the loop body When list_for_each_entry() completes the iteration over the whole list without breaking the loop, the iterator value will be a bogus pointer computed based on the head element. While it is safe to use the pointer to determine if it was computed based on the head element, either with list_entry_is_head() or &pos->member == head, using the iterator variable after the loop should be avoided. In preparation to limit the scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Reviewed-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220331220349.885126-2-jakobkoschel@gmail.com Signed-off-by: Jens Axboe drivers/block/drbd/drbd_req.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) commit 901aeda62efa21f2eae937bccb71b49ae531be06 Author: Jakob Koschel Date: Fri Apr 1 00:03:48 2022 +0200 drbd: remove usage of list iterator variable after loop In preparation to limit the scope of a list iterator to the list traversal loop, use a dedicated pointer to iterate through the list [1]. Since that variable should not be used past the loop iteration, a separate variable is used to 'remember the current location within the loop'. To either continue iterating from that position or skip the iteration (if the previous iteration was complete) list_prepare_entry() is used. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220331220349.885126-1-jakobkoschel@gmail.com Signed-off-by: Jens Axboe drivers/block/drbd/drbd_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 3d198e42ce25cb1d58ff7052c036407271ebfb51 Merge: f008b1d6e1e0 27ca8273fda3 Author: Linus Torvalds Date: Thu Mar 31 15:57:50 2022 -0700 Merge tag 'gfs2-v5.17-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 fixes from Andreas Gruenbacher: - To avoid deadlocks, actively cancel dlm locking requests when we give up on them. Further dlm operations on the same lock will return -EBUSY until the cancel has been completed, so in that case, wait and repeat. (This is rare.) - Lock inversion fixes in gfs2_inode_lookup() and gfs2_create_inode(). - Some more fallout from the gfs2 mmap + page fault deadlock fixes (merged in commit c03098d4b9ad7: "Merge tag 'gfs2-v5.15-rc5-mmap-fault'"). - Various other minor bug fixes and cleanups. * tag 'gfs2-v5.17-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Make sure FITRIM minlen is rounded up to fs block size gfs2: Make sure not to return short direct writes gfs2: Remove dead code in gfs2_file_read_iter gfs2: Fix gfs2_file_buffered_write endless loop workaround gfs2: Minor retry logic cleanup gfs2: Disable page faults during lockless buffered reads gfs2: Fix should_fault_in_pages() logic gfs2: Remove return value for gfs2_indirect_init gfs2: Initialize gh_error in gfs2_glock_nq gfs2: Make use of list_is_first gfs2: Switch lock order of inode and iopen glock gfs2: cancel timed-out glock requests gfs2: Expect -EBUSY after canceling dlm locking requests gfs2: gfs2_setattr_size error path fix gfs2: assign rgrp glock before compute_bitstructs commit f008b1d6e1e06bb61e9402aa8a1cfa681510e375 Merge: 478f74a3d808 ab487a4cdfca Author: Linus Torvalds Date: Thu Mar 31 15:49:36 2022 -0700 Merge tag 'netfs-prep-20220318' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull netfs updates from David Howells: "Netfs prep for write helpers. Having had a go at implementing write helpers and content encryption support in netfslib, it seems that the netfs_read_{,sub}request structs and the equivalent write request structs were almost the same and so should be merged, thereby requiring only one set of alloc/get/put functions and a common set of tracepoints. Merging the structs also has the advantage that if a bounce buffer is added to the request struct, a read operation can be performed to fill the bounce buffer, the contents of the buffer can be modified and then a write operation can be performed on it to send the data wherever it needs to go using the same request structure all the way through. The I/O handlers would then transparently perform any required crypto. This should make it easier to perform RMW cycles if needed. The potentially common functions and structs, however, by their names all proclaim themselves to be associated with the read side of things. The bulk of these changes alter this in the following ways: - Rename struct netfs_read_{,sub}request to netfs_io_{,sub}request. - Rename some enums, members and flags to make them more appropriate. - Adjust some comments to match. - Drop "read"/"rreq" from the names of common functions. For instance, netfs_get_read_request() becomes netfs_get_request(). - The ->init_rreq() and ->issue_op() methods become ->init_request() and ->issue_read(). I've kept the latter as a read-specific function and in another branch added an ->issue_write() method. The driver source is then reorganised into a number of files: fs/netfs/buffered_read.c Create read reqs to the pagecache fs/netfs/io.c Dispatchers for read and write reqs fs/netfs/main.c Some general miscellaneous bits fs/netfs/objects.c Alloc, get and put functions fs/netfs/stats.c Optional procfs statistics. and future development can be fitted into this scheme, e.g.: fs/netfs/buffered_write.c Modify the pagecache fs/netfs/buffered_flush.c Writeback from the pagecache fs/netfs/direct_read.c DIO read support fs/netfs/direct_write.c DIO write support fs/netfs/unbuffered_write.c Write modifications directly back Beyond the above changes, there are also some changes that affect how things work: - Make fscache_end_operation() generally available. - In the netfs tracing header, generate enums from the symbol -> string mapping tables rather than manually coding them. - Add a struct for filesystems that uses netfslib to put into their inode wrapper structs to hold extra state that netfslib is interested in, such as the fscache cookie. This allows netfslib functions to be set in filesystem operation tables and jumped to directly without having to have a filesystem wrapper. - Add a member to the struct added above to track the remote inode length as that may differ if local modifications are buffered. We may need to supply an appropriate EOF pointer when storing data (in AFS for example). - Pass extra information to netfs_alloc_request() so that the ->init_request() hook can access it and retain information to indicate the origin of the operation. - Make the ->init_request() hook return an error, thereby allowing a filesystem that isn't allowed to cache an inode (ceph or cifs, for example) to skip readahead. - Switch to using refcount_t for subrequests and add tracepoints to log refcount changes for the request and subrequest structs. - Add a function to consolidate dispatching a read request. Similar code is used in three places and another couple are likely to be added in the future" Link: https://lore.kernel.org/all/2639515.1648483225@warthog.procyon.org.uk/ * tag 'netfs-prep-20220318' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Maintain netfs_i_context::remote_i_size netfs: Keep track of the actual remote file size netfs: Split some core bits out into their own file netfs: Split fs/netfs/read_helper.c netfs: Rename read_helper.c to io.c netfs: Prepare to split read_helper.c netfs: Add a function to consolidate beginning a read netfs: Add a netfs inode context ceph: Make ceph_init_request() check caps on readahead netfs: Change ->init_request() to return an error code netfs: Refactor arguments for netfs_alloc_read_request netfs: Adjust the netfs_failure tracepoint to indicate non-subreq lines netfs: Trace refcounting on the netfs_io_subrequest struct netfs: Trace refcounting on the netfs_io_request struct netfs: Adjust the netfs_rreq tracepoint slightly netfs: Split netfs_io_* object handling out netfs: Finish off rename of netfs_read_request to netfs_io_request netfs: Rename netfs_read_*request to netfs_io_*request netfs: Generate enums from trace symbol mapping lists fscache: export fscache_end_operation() commit e634ff7733ba3c03a18fb47cc355700a5a01014f Author: Randy Dunlap Date: Mon Mar 28 15:04:17 2022 -0700 riscv: cpu.c: don't use kernel-doc markers for comments Repair kernel-doc build warnings caused by using "/**" kernel-doc markers for comments that are not in kernel-doc format: cpu.c:89: warning: cannot understand function prototype: 'struct riscv_isa_ext_data isa_ext_arr[] = ' cpu.c:114: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Signed-off-by: Randy Dunlap Reported-by: kernel test robot Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/kernel/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit eeeb4f1075d71d67083c75f69247206e9b3d9f4a Author: Kuldeep Singh Date: Sat Mar 26 09:53:12 2022 +0530 arm64: dts: ls1046a: Update i2c node dma properties Reorder dmas and dma-names properties for i2c controller node to make it compliant with bindings. Fixes: 8126d88162a5 ("arm64: dts: add QorIQ LS1046A SoC support") Signed-off-by: Kuldeep Singh CC: soc@kernel.org Link: https://lore.kernel.org/r/20220326042313.97862-5-singh.kuldeep87k@gmail.com' Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit aa4df840d1c5eab2bb33695efe4409b3e5526749 Author: Kuldeep Singh Date: Sat Mar 26 09:53:11 2022 +0530 arm64: dts: ls1043a: Update i2c dma properties Reorder dmas and dma-names properties for i2c controller node to make it compliant with bindings. Fixes: 6d453cd22357 ("arm64: dts: add Freescale LS1043a SoC support") Signed-off-by: Kuldeep Singh CC: soc@kernel.org Link: https://lore.kernel.org/r/20220326042313.97862-4-singh.kuldeep87k@gmail.com' Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 583d6b0062640def86f3265aa1042ecb6672516e Author: Kuldeep Singh Date: Sat Mar 26 09:53:10 2022 +0530 ARM: dts: spear1340: Update serial node properties Reorder dma and dma-names property for serial node to make it compliant with bindings. Fixes: 6e8887f60f60 ("ARM: SPEAr13xx: Pass generic DW DMAC platform data from DT") Signed-off-by: Kuldeep Singh Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220326042313.97862-3-singh.kuldeep87k@gmail.com' Signed-off-by: Arnd Bergmann arch/arm/boot/dts/spear1340.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 31d3687d6017c7ce6061695361598d9cda70807a Author: Kuldeep Singh Date: Sat Mar 26 09:53:09 2022 +0530 ARM: dts: spear13xx: Update SPI dma properties Reorder dmas and dma-names property for spi controller node to make it compliant with bindings. Fixes: 6e8887f60f60 ("ARM: SPEAr13xx: Pass generic DW DMAC platform data from DT") Signed-off-by: Kuldeep Singh Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220326042313.97862-2-singh.kuldeep87k@gmail.com' Signed-off-by: Arnd Bergmann arch/arm/boot/dts/spear13xx.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 478f74a3d8085076dfcb481aa9361b808a6aae94 Merge: 354b8bf222ee 1754abb3e758 Author: Linus Torvalds Date: Thu Mar 31 14:51:34 2022 -0700 Merge tag 'random-5.18-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator fixes from Jason Donenfeld: - If a hardware random number generator passes a sufficiently large chunk of entropy to random.c during early boot, we now skip the "fast_init" business and let it initialize the RNG. This makes CONFIG_RANDOM_TRUST_BOOTLOADER=y actually useful. - We already have the command line `random.trust_cpu=0/1` option for RDRAND, which let distros enable CONFIG_RANDOM_TRUST_CPU=y while placating concerns of more paranoid users. Now we add `random.trust_bootloader=0/1` so that distros can similarly enable CONFIG_RANDOM_TRUST_BOOTLOADER=y. - Re-add a comment that got removed by accident in the recent revert. - Add the spec-compliant ACPI CID for vmgenid, which Microsoft added to the vmgenid spec at Ard's request during earlier review. - Restore build-time randomness via the latent entropy plugin, which was lost when we transitioned to using a hash function. * tag 'random-5.18-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: mix build-time latent entropy into pool at init virt: vmgenid: recognize new CID added by Hyper-V random: re-add removed comment about get_random_{u32,u64} reseeding random: treat bootloader trust toggle the same way as cpu trust toggle random: skip fast_init if hwrng provides large chunk of entropy commit 354b8bf222ee15bf9aac3d870ba8e0880dd9bc8d Merge: d4f1db771599 826270373f17 Author: Linus Torvalds Date: Thu Mar 31 14:14:03 2022 -0700 Merge tag 'linux-watchdog-5.18-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - add support for BCM4908 - renesas_wdt: add R-Car Gen4 support - improve watchdog_dev function documentation - sp5100_tco: replace the cd6h/cd7h port I/O with MMIO accesses during initialization - several other small improvements and fixes * tag 'linux-watchdog-5.18-rc1' of git://www.linux-watchdog.org/linux-watchdog: Watchdog: sp5100_tco: Enable Family 17h+ CPUs Watchdog: sp5100_tco: Add initialization using EFCH MMIO Watchdog: sp5100_tco: Refactor MMIO base address initialization Watchdog: sp5100_tco: Move timer initialization into function watchdog: ixp4xx: Implement restart watchdog: orion_wdt: support pretimeout on Armada-XP watchdog: allow building BCM7038_WDT for BCM4908 watchdog: renesas_wdt: Add R-Car Gen4 support dt-bindings: watchdog: renesas-wdt: Document r8a779f0 support watchdog: Improve watchdog_dev function documentation watchdog: aspeed: add nowayout support watchdog: rti-wdt: Add missing pm_runtime_disable() in probe function watchdog: imx2_wdg: Alow ping on suspend commit d4f1db771599852713fc2bbb7d3cc6cf9ace3b54 Merge: f4f5d7cfb2e5 13de23494f38 Author: Linus Torvalds Date: Thu Mar 31 14:05:05 2022 -0700 Merge tag 'auxdisplay-for-linus-v5.18-rc1' of https://github.com/ojeda/linux Pull auxdisplay updates from Miguel Ojeda: "A few auxdisplay lcd2s improvements from Andy Shevchenko" * tag 'auxdisplay-for-linus-v5.18-rc1' of https://github.com/ojeda/linux: auxdisplay: lcd2s: Use array size explicitly in lcd2s_gotoxy() auxdisplay: lcd2s: Switch to i2c ->probe_new() auxdisplay: lcd2s: use module_i2c_driver to simplify the code auxdisplay: lcd2s: make use of device property API auxdisplay: lcd2s: Fix multi-line comment style commit f4f5d7cfb2e57fafd12dabd971b892f83ce02bfe Merge: e729dbe8ea1c ad6dc1daaf29 Author: Linus Torvalds Date: Thu Mar 31 13:57:15 2022 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio updates from Michael Tsirkin: - vdpa generic device type support - more virtio hardening for broken devices (but on the same theme, revert some virtio hotplug hardening patches - they were misusing some interrupt flags and had to be reverted) - RSS support in virtio-net - max device MTU support in mlx5 vdpa - akcipher support in virtio-crypto - shared IRQ support in ifcvf vdpa - a minor performance improvement in vhost - enable virtio mem for ARM64 - beginnings of advance dma support - cleanups, fixes all over the place * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (33 commits) vdpa/mlx5: Avoid processing works if workqueue was destroyed vhost: handle error while adding split ranges to iotlb vdpa: support exposing the count of vqs to userspace vdpa: change the type of nvqs to u32 vdpa: support exposing the config size to userspace vdpa/mlx5: re-create forwarding rules after mac modified virtio: pci: check bar values read from virtio config space Revert "virtio_pci: harden MSI-X interrupts" Revert "virtio-pci: harden INTX interrupts" drivers/net/virtio_net: Added RSS hash report control. drivers/net/virtio_net: Added RSS hash report. drivers/net/virtio_net: Added basic RSS support. drivers/net/virtio_net: Fixed padded vheader to use v1 with hash. virtio: use virtio_device_ready() in virtio_device_restore() tools/virtio: compile with -pthread tools/virtio: fix after premapped buf support virtio_ring: remove flags check for unmap packed indirect desc virtio_ring: remove flags check for unmap split indirect desc virtio_ring: rename vring_unmap_state_packed() to vring_unmap_extra_packed() net/mlx5: Add support for configuring max device MTU ... commit 1754abb3e7583c570666fa1e1ee5b317e88c89a0 Author: Jason A. Donenfeld Date: Thu Mar 31 11:01:01 2022 -0400 random: mix build-time latent entropy into pool at init Prior, the "input_pool_data" array needed no real initialization, and so it was easy to mark it with __latent_entropy to populate it during compile-time. In switching to using a hash function, this required us to specifically initialize it to some specific state, which means we dropped the __latent_entropy attribute. An unfortunate side effect was this meant the pool was no longer seeded using compile-time random data. In order to bring this back, we declare an array in rand_initialize() with __latent_entropy and call mix_pool_bytes() on that at init, which accomplishes the same thing as before. We make this __initconst, so that it doesn't take up space at runtime after init. Fixes: 6e8ec2552c7d ("random: use computational hash for entropy extraction") Reviewed-by: Dominik Brodowski Reviewed-by: Theodore Ts'o Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 5 +++++ 1 file changed, 5 insertions(+) commit 8cf8df89678aa5ab3eb206ccc7c8dee7c528bf50 Author: Tony Lindgren Date: Thu Mar 31 20:17:37 2022 +0300 ARM: OMAP2+: Fix regression for smc calls for vmap stack Commit 9c46929e7989 ("ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems") started triggering an issue with smc calls hanging on boot as VMAP_STACK is now enabled by default. Based on discussions on the #armlinux irc channel, Arnd noticed that omaps are using __pa() for stack for smc calls. This does not work with vmap stack. Let's fix the issue by changing the param arrays to use static param[5] for each function for __pa() to work. This consumes a bit more memory compared to adding a single static buffer, but avoids potential races with the smc calls initializing the shared buffer. For omap_secure_dispatcher(), we need to use a cpu specific buffer as there's nothing currently ensuring it only gets called from cpu0. Fixes: 9c46929e7989 ("ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems") Link: https://lore.kernel.org/r/20220331171737.48211-1-tony@atomide.com Suggested-by: Ard Biesheuvel Suggested-by: Arnd Bergmann Signed-off-by: Tony Lindgren Reviewed-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm/mach-omap2/omap-secure.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit 2e7451fb57632454aaccc8ca1aac167751df9fca Author: Anup Patel Date: Thu Mar 24 11:00:20 2022 +0530 RISC-V: Enable profiling by default Let us enable profiling by default in RV32 and RV64 defconfigs so that we can use RISC-V PMU drivers on various RISC-V platforms. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/configs/defconfig | 1 + arch/riscv/configs/rv32_defconfig | 1 + 2 files changed, 2 insertions(+) commit 617487600b94b83c9733d8e3cb55a3f09beee194 Author: Wu Caize Date: Thu Mar 24 10:09:21 2022 +0800 RISC-V: module: fix apply_r_riscv_rcv_branch_rela typo This function name was spelled incorrectly, likely to do a typo. Signed-off-by: Wu Caize Signed-off-by: Palmer Dabbelt arch/riscv/kernel/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e729dbe8ea1c6145ae7b9efd6a00a5613746d3b0 Merge: b4a5ea09b293 4a13e559af0b Author: Linus Torvalds Date: Thu Mar 31 13:08:13 2022 -0700 Merge tag 'acpi-5.18-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "These are fixes and cleanup on top of the previously merged ACPI material. Specifics: - Avoid out-of-bounds access when parsing _CPC data (Rafael Wysocki) - Change default error code and clean up debug messages in ACPI CPPC probe (Rafael Wysocki) - Replace usage of found with dedicated list iterator variable in the ACPI IPMI driver (Jakob Koschel) - Clean up variable name confusion in APEI (Jakob Koschel) - Make LAPIC_ADDR_OVR address readable in a message parsed during MADT parsing (Vasant Hegde)" * tag 'acpi-5.18-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: CPPC: Change default error code and clean up debug messages in probe ACPI: CPPC: Avoid out of bounds access when parsing _CPC data ACPI: tables: Make LAPIC_ADDR_OVR address readable in message ACPI: IPMI: replace usage of found with dedicated list iterator variable ACPI, APEI: Use the correct variable for sizeof() commit 55037ed7bdc62151a726f5685f88afa6a82959b1 Author: Tadeusz Struk Date: Tue Mar 29 10:12:52 2022 -0700 uapi/linux/stddef.h: Add include guards Add include guard wrapper define to uapi/linux/stddef.h to prevent macro redefinition errors when stddef.h is included more than once. This was not needed before since the only contents already used a redefinition test. Signed-off-by: Tadeusz Struk Link: https://lore.kernel.org/r/20220329171252.57279-1-tadeusz.struk@linaro.org Fixes: 50d7bd38c3aa ("stddef: Introduce struct_group() helper macro") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook include/uapi/linux/stddef.h | 4 ++++ 1 file changed, 4 insertions(+) commit f1de125766d6f377a4b5d5821bc12928f929a4eb Author: Atish Patra Date: Wed Mar 23 10:17:26 2022 -0700 RISC-V: Declare per cpu boot data as static The per cpu boot data is only used within the cpu_ops_sbi.c. It can be delcared as static. Fixes: 9a2451f18663 ("RISC-V: Avoid using per cpu array for ordered booting") Reported-by: kernel test robot Signed-off-by: Atish Patra Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt arch/riscv/kernel/cpu_ops_sbi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b4a5ea09b29371c2e6a10783faa3593428404343 Merge: b8321ed4a40c 022bb490c797 Author: Linus Torvalds Date: Thu Mar 31 12:10:42 2022 -0700 Merge tag 'docs-5.18-2' of git://git.lwn.net/linux Pull more documentation updates from Jonathan Corbet: "Some late-arriving documentation improvements. This is mostly build-system fixes from Mauro and Akira; I also took the liberty of dropping in my 'messy diffstat' document" * tag 'docs-5.18-2' of git://git.lwn.net/linux: docs: Add a document on how to fix a messy diffstat docs: sphinx/requirements: Limit jinja2<3.1 Documentation: kunit: Fix cross-referencing warnings scripts/kernel-doc: change the line number meta info scripts/get_abi: change the file/line number meta info docs: kernel_include.py: add sphinx build dependencies docs: kernel_abi.py: add sphinx build dependencies docs: kernel_feat.py: add build dependencies scripts/get_feat.pl: allow output the parsed file names docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs' Documentation: Fix duplicate statement about raw_spinlock_t type commit b8321ed4a40c02054f930ca59d3570caa27bc86c Merge: f87cbd0565eb e9c281928c24 Author: Linus Torvalds Date: Thu Mar 31 11:59:03 2022 -0700 Merge tag 'kbuild-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Add new environment variables, USERCFLAGS and USERLDFLAGS to allow additional flags to be passed to user-space programs. - Fix missing fflush() bugs in Kconfig and fixdep - Fix a minor bug in the comment format of the .config file - Make kallsyms ignore llvm's local labels, .L* - Fix UAPI compile-test for cross-compiling with Clang - Extend the LLVM= syntax to support LLVM= form for using a particular version of LLVm, and LLVM= form for using custom LLVM in a particular directory path. - Clean up Makefiles * tag 'kbuild-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: Make $(LLVM) more flexible kbuild: add --target to correctly cross-compile UAPI headers with Clang fixdep: use fflush() and ferror() to ensure successful write to files arch: syscalls: simplify uapi/kapi directory creation usr/include: replace extra-y with always-y certs: simplify empty certs creation in certs/Makefile certs: include certs/signing_key.x509 unconditionally kallsyms: ignore all local labels prefixed by '.L' kconfig: fix missing '# end of' for empty menu kconfig: add fflush() before ferror() check kbuild: replace $(if A,A,B) with $(or A,B) kbuild: Add environment variables for userprogs flags kbuild: unify cmd_copy and cmd_shipped commit 8d7829ebc1e48208b3c02c2a10c5f8856246033c Author: Tom Rix Date: Thu Mar 31 11:54:58 2022 -0700 blk-wbt: remove wbt_track stub cppcheck returns this warning [block/blk-wbt.h:104] -> [block/blk-wbt.c:592]: (warning) Function 'wbt_track' argument order different: declaration 'rq, flags, ' definition 'rqos, rq, bio' In commit c1c80384c8f4 ("block: remove external dependency on wbt_flags") wbt_track was removed for the real declaration, its stub should have been as well. Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220331185458.3427454-1-trix@redhat.com Signed-off-by: Jens Axboe block/blk-wbt.h | 3 --- 1 file changed, 3 deletions(-) commit f87cbd0565eb7e2fa15296c74210658db1346431 Merge: 2975dbdc3989 229a08a4f4e4 Author: Linus Torvalds Date: Thu Mar 31 11:43:01 2022 -0700 Merge tag 'hardening-v5.18-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull hardening updates from Kees Cook: "This addresses an -Warray-bounds warning found under a few ARM defconfigs, and disables long-broken HARDENED_USERCOPY_PAGESPAN" * tag 'hardening-v5.18-rc1-fix1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: ARM/dma-mapping: Remove CMA code when not built with CMA usercopy: Disable CONFIG_HARDENED_USERCOPY_PAGESPAN commit 27ca8273fda398638ca994a207323a85b6d81190 Author: Andrew Price Date: Tue Mar 22 19:05:51 2022 +0000 gfs2: Make sure FITRIM minlen is rounded up to fs block size Per fstrim(8) we must round up the minlen argument to the fs block size. The current calculation doesn't take into account devices that have a discard granularity and requested minlen less than 1 fs block, so the value can get shifted away to zero in the translation to fs blocks. The zero minlen passed to gfs2_rgrp_send_discards() then allows sb_issue_discard() to be called with nr_sects == 0 which returns -EINVAL and results in gfs2_rgrp_send_discards() returning -EIO. Make sure minlen is never < 1 fs block by taking the max of the requested minlen and the fs block size before comparing to the device's discard granularity and shifting to fs blocks. Fixes: 076f0faa764ab ("GFS2: Fix FITRIM argument handling") Signed-off-by: Andrew Price Signed-off-by: Andreas Gruenbacher fs/gfs2/rgrp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 2975dbdc3989cd66a4cb5a7c5510de2de8ee4d14 Merge: 93235e3df29c 9d570741aec1 Author: Linus Torvalds Date: Thu Mar 31 11:23:31 2022 -0700 Merge tag 'net-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull more networking updates from Jakub Kicinski: "Networking fixes and rethook patches. Features: - kprobes: rethook: x86: replace kretprobe trampoline with rethook Current release - regressions: - sfc: avoid null-deref on systems without NUMA awareness in the new queue sizing code Current release - new code bugs: - vxlan: do not feed vxlan_vnifilter_dump_dev with non-vxlan devices - eth: lan966x: fix null-deref on PHY pointer in timestamp ioctl when interface is down Previous releases - always broken: - openvswitch: correct neighbor discovery target mask field in the flow dump - wireguard: ignore v6 endpoints when ipv6 is disabled and fix a leak - rxrpc: fix call timer start racing with call destruction - rxrpc: fix null-deref when security type is rxrpc_no_security - can: fix UAF bugs around echo skbs in multiple drivers Misc: - docs: move netdev-FAQ to the 'process' section of the documentation" * tag 'net-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (57 commits) vxlan: do not feed vxlan_vnifilter_dump_dev with non vxlan devices openvswitch: Add recirc_id to recirc warning rxrpc: fix some null-ptr-deref bugs in server_key.c rxrpc: Fix call timer start racing with call destruction net: hns3: fix software vlan talbe of vlan 0 inconsistent with hardware net: hns3: fix the concurrency between functions reading debugfs docs: netdev: move the netdev-FAQ to the process pages docs: netdev: broaden the new vs old code formatting guidelines docs: netdev: call out the merge window in tag checking docs: netdev: add missing back ticks docs: netdev: make the testing requirement more stringent docs: netdev: add a question about re-posting frequency docs: netdev: rephrase the 'should I update patchwork' question docs: netdev: rephrase the 'Under review' question docs: netdev: shorten the name and mention msgid for patch status docs: netdev: note that RFC postings are allowed any time docs: netdev: turn the net-next closed into a Warning docs: netdev: move the patch marking section up docs: netdev: minor reword docs: netdev: replace references to old archives ... commit 229a08a4f4e4f9949801cc39b6480ddc9c487183 Author: Kees Cook Date: Wed Mar 9 09:37:31 2022 -0800 ARM/dma-mapping: Remove CMA code when not built with CMA The MAX_CMA_AREAS could be set to 0, which would result in code that would attempt to operate beyond the end of a zero-sized array. If CONFIG_CMA is disabled, just remove this code entirely. Found when building arm on GCC 10.x for several defconfigs (e.g. axm55xx_defconfig) under -Warray-bounds: arch/arm/mm/dma-mapping.c:396:22: warning: array subscript is outside array bounds of 'struct dma_contig_early_reserve[0]' [-Warray-bounds] 396 | dma_mmu_remap[dma_mmu_remap_num].size = size; | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ arch/arm/mm/dma-mapping.c:389:40: note: while referencing 'dma_mmu_remap' 389 | static struct dma_contig_early_reserve dma_mmu_remap[MAX_CMA_AREAS] __initdata; | ^~~~~~~~~~~~~ Cc: Russell King Cc: Logan Gunthorpe Cc: Martin Oliveira Cc: David Hildenbrand Cc: Andrew Morton Cc: Stephen Rothwell Cc: Zi Yan Cc: Hari Bathini Cc: Minchan Kim Cc: Mike Kravetz Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/all/6243ee60.1c69fb81.16de6.7dbf@mx.google.com/ Signed-off-by: Kees Cook Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/lkml/20220310070041.GA24874@lst.de Reviewed-by: David Hildenbrand Link: https://lore.kernel.org/lkml/9059fa71-330f-f04f-b155-2850abb72a71@redhat.com arch/arm/mm/dma-mapping.c | 2 ++ arch/arm/mm/mm.h | 4 ++++ include/linux/cma.h | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) commit 93235e3df29c084a37e0daed17801c6adfce4cb6 Merge: 787af64d05cd aa8e73eed7d3 Author: Linus Torvalds Date: Thu Mar 31 11:17:39 2022 -0700 Merge tag 'v5.18-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: - Missing Kconfig dependency on arm that leads to boot failure - x86 SLS fixes - Reference leak in the stm32 driver * tag 'v5.18-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: x86/sm3 - Fixup SLS crypto: x86/poly1305 - Fixup SLS crypto: x86/chacha20 - Avoid spurious jumps to other functions crypto: stm32 - fix reference leak in stm32_crc_remove crypto: arm/aes-neonbs-cbc - Select generic cbc and aes commit 4a13e559af0b177eb934c39338f100a9f692a37b Merge: f21a35098422 26de0ab9841a 0b1be2c085ab fa3416509605 Author: Rafael J. Wysocki Date: Thu Mar 31 18:42:07 2022 +0200 Merge branches 'acpi-ipmi', 'acpi-tables' and 'acpi-apei' Merge IMPI driver changes, ACPI tables parsing code changes and additional APEI changes for v5.18-rc1: - Replace usage of found with dedicated list iterator variable in the ACPI IPMI driver (Jakob Koschel). - Make LAPIC_ADDR_OVR address readable in a message parsed during MADT parsing (Vasant Hegde). - Clean up variable name confusion in APEI (Jakob Koschel). * acpi-ipmi: ACPI: IPMI: replace usage of found with dedicated list iterator variable * acpi-tables: ACPI: tables: Make LAPIC_ADDR_OVR address readable in message * acpi-apei: ACPI, APEI: Use the correct variable for sizeof() commit 9d570741aec1e1ebd37823b34a2958f24809ff24 Author: Eric Dumazet Date: Wed Mar 30 12:46:43 2022 -0700 vxlan: do not feed vxlan_vnifilter_dump_dev with non vxlan devices vxlan_vnifilter_dump_dev() assumes it is called only for vxlan devices. Make sure it is the case. BUG: KASAN: slab-out-of-bounds in vxlan_vnifilter_dump_dev+0x9a0/0xb40 drivers/net/vxlan/vxlan_vnifilter.c:349 Read of size 4 at addr ffff888060d1ce70 by task syz-executor.3/17662 CPU: 0 PID: 17662 Comm: syz-executor.3 Tainted: G W 5.17.0-syzkaller-12888-g77c9387c0c5b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 vxlan_vnifilter_dump_dev+0x9a0/0xb40 drivers/net/vxlan/vxlan_vnifilter.c:349 vxlan_vnifilter_dump+0x3ff/0x650 drivers/net/vxlan/vxlan_vnifilter.c:428 netlink_dump+0x4b5/0xb70 net/netlink/af_netlink.c:2270 __netlink_dump_start+0x647/0x900 net/netlink/af_netlink.c:2375 netlink_dump_start include/linux/netlink.h:245 [inline] rtnetlink_rcv_msg+0x70c/0xb80 net/core/rtnetlink.c:5953 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2496 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e2/0x800 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f87b8e89049 Fixes: f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device") Signed-off-by: Eric Dumazet Reported-by: syzbot Acked-by: Roopa Prabhu Link: https://lore.kernel.org/r/20220330194643.2706132-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski drivers/net/vxlan/vxlan_vnifilter.c | 6 ++++++ 1 file changed, 6 insertions(+) commit ea07af2e71cdf2c08251d8ead196ce1c9466e38c Author: Stéphane Graber Date: Wed Mar 30 15:42:45 2022 -0400 openvswitch: Add recirc_id to recirc warning When hitting the recirculation limit, the kernel would currently log something like this: [ 58.586597] openvswitch: ovs-system: deferred action limit reached, drop recirc action Which isn't all that useful to debug as we only have the interface name to go on but can't track it down to a specific flow. With this change, we now instead get: [ 58.586597] openvswitch: ovs-system: deferred action limit reached, drop recirc action (recirc_id=0x9e) Which can now be correlated with the flow entries from OVS. Suggested-by: Frode Nordahl Signed-off-by: Stéphane Graber Tested-by: Stephane Graber Acked-by: Eelco Chaudron Link: https://lore.kernel.org/r/20220330194244.3476544-1-stgraber@ubuntu.com Signed-off-by: Jakub Kicinski net/openvswitch/actions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 46b556205dcead1ec180329b771c2593d81c6b9b Merge: ff8376ade4f6 50d34a0d151d Author: Jakub Kicinski Date: Thu Mar 31 08:36:17 2022 -0700 Merge tag 'linux-can-fixes-for-5.18-20220331' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-03-31 The first patch is by Oliver Hartkopp and fixes MSG_PEEK feature in the CAN ISOTP protocol (broken in net-next for v5.18 only). Tom Rix's patch for the mcp251xfd driver fixes the propagation of an error value in case of an error. A patch by me for the m_can driver fixes a use-after-free in the xmit handler for m_can IP cores v3.0.x. Hangyu Hua contributes 3 patches fixing the same double free in the error path of the xmit handler in the ems_usb, usb_8dev and mcba_usb USB CAN driver. Pavel Skripkin contributes a patch for the mcba_usb driver to properly check the endpoint type. The last patch is by me and fixes a mem leak in the gs_usb, which was introduced in net-next for v5.18. * tag 'linux-can-fixes-for-5.18-20220331' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: gs_usb: gs_make_candev(): fix memory leak for devices with extended bit timing configuration can: mcba_usb: properly check endpoint type can: mcba_usb: mcba_usb_start_xmit(): fix double dev_kfree_skb in error path can: usb_8dev: usb_8dev_start_xmit(): fix double dev_kfree_skb() in error path can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path can: m_can: m_can_tx_handler(): fix use after free of skb can: mcp251xfd: mcp251xfd_register_get_dev_id(): fix return of error value can: isotp: restore accidentally removed MSG_PEEK feature ==================== Link: https://lore.kernel.org/r/ Signed-off-by: Jakub Kicinski commit 22ef7ee3eeb2a41e07f611754ab9a2663232fedf Author: YueHaibing Date: Thu Mar 17 16:51:30 2022 +0800 PCI: hv: Remove unused hv_set_msi_entry_from_desc() Fix the following build error: drivers/pci/controller/pci-hyperv.c:769:13: error: ‘hv_set_msi_entry_from_desc’ defined but not used [-Werror=unused-function] 769 | static void hv_set_msi_entry_from_desc(union hv_msi_entry *msi_entry, The arm64 implementation of hv_set_msi_entry_from_desc() is not used after d06957d7a692 ("PCI: hv: Avoid the retarget interrupt hypercall in irq_unmask() on ARM64"), so remove it. Fixes: d06957d7a692 ("PCI: hv: Avoid the retarget interrupt hypercall in irq_unmask() on ARM64") Link: https://lore.kernel.org/r/20220317085130.36388-1-yuehaibing@huawei.com Signed-off-by: YueHaibing Signed-off-by: Bjorn Helgaas Reviewed-by: Nathan Chancellor Acked-by: Boqun Feng drivers/pci/controller/pci-hyperv.c | 8 -------- 1 file changed, 8 deletions(-) commit 24f71ae5447e661813228677d343208d624fc141 Author: Kris Bahnsen Date: Tue Mar 29 13:14:26 2022 -0700 gpio: ts5500: Fix Links to Technologic Systems web resources Technologic Systems has rebranded as embeddedTS with the current domain eventually going offline. Update web/doc URLs to correct resource locations. Signed-off-by: Kris Bahnsen Signed-off-by: Bartosz Golaszewski drivers/gpio/gpio-ts5500.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 999397926ab3f78c7d1235cc4ca6e3c89d2769bf Author: Trond Myklebust Date: Thu Mar 31 09:54:02 2022 -0400 nfsd: Clean up nfsd_file_put() Make it a little less racy, by removing the refcount_read() test. Then remove the redundant 'is_hashed' variable. Signed-off-by: Trond Myklebust Signed-off-by: Chuck Lever fs/nfsd/filecache.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) commit d6f5e358452479fa8a773b5c6ccc9e4ec5a20880 Author: Paulo Alcantara Date: Tue Mar 29 16:20:06 2022 -0300 cifs: fix NULL ptr dereference in smb2_ioctl_query_info() When calling smb2_ioctl_query_info() with invalid smb_query_info::flags, a NULL ptr dereference is triggered when trying to kfree() uninitialised rqst[n].rq_iov array. This also fixes leaked paths that are created in SMB2_open_init() which required SMB2_open_free() to properly free them. Here is a small C reproducer that triggers it #include #include #include #include #include #include #define die(s) perror(s), exit(1) #define QUERY_INFO 0xc018cf07 int main(int argc, char *argv[]) { int fd; if (argc < 2) exit(1); fd = open(argv[1], O_RDONLY); if (fd == -1) die("open"); if (ioctl(fd, QUERY_INFO, (uint32_t[]) { 0, 0, 0, 4, 0, 0}) == -1) die("ioctl"); close(fd); return 0; } mount.cifs //srv/share /mnt -o ... gcc repro.c && ./a.out /mnt/f0 [ 1832.124468] CIFS: VFS: \\w22-dc.zelda.test\test Invalid passthru query flags: 0x4 [ 1832.125043] general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN NOPTI [ 1832.125764] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] [ 1832.126241] CPU: 3 PID: 1133 Comm: a.out Not tainted 5.17.0-rc8 #2 [ 1832.126630] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014 [ 1832.127322] RIP: 0010:smb2_ioctl_query_info+0x7a3/0xe30 [cifs] [ 1832.127749] Code: 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 6c 05 00 00 48 b8 00 00 00 00 00 fc ff df 4d 8b 74 24 28 4c 89 f2 48 c1 ea 03 <80> 3c 02 00 0f 85 cb 04 00 00 49 8b 3e e8 bb fc fa ff 48 89 da 48 [ 1832.128911] RSP: 0018:ffffc90000957b08 EFLAGS: 00010256 [ 1832.129243] RAX: dffffc0000000000 RBX: ffff888117e9b850 RCX: ffffffffa020580d [ 1832.129691] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffffa043a2c0 [ 1832.130137] RBP: ffff888117e9b878 R08: 0000000000000001 R09: 0000000000000003 [ 1832.130585] R10: fffffbfff4087458 R11: 0000000000000001 R12: ffff888117e9b800 [ 1832.131037] R13: 00000000ffffffea R14: 0000000000000000 R15: ffff888117e9b8a8 [ 1832.131485] FS: 00007fcee9900740(0000) GS:ffff888151a00000(0000) knlGS:0000000000000000 [ 1832.131993] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1832.132354] CR2: 00007fcee9a1ef5e CR3: 0000000114cd2000 CR4: 0000000000350ee0 [ 1832.132801] Call Trace: [ 1832.132962] [ 1832.133104] ? smb2_query_reparse_tag+0x890/0x890 [cifs] [ 1832.133489] ? cifs_mapchar+0x460/0x460 [cifs] [ 1832.133822] ? rcu_read_lock_sched_held+0x3f/0x70 [ 1832.134125] ? cifs_strndup_to_utf16+0x15b/0x250 [cifs] [ 1832.134502] ? lock_downgrade+0x6f0/0x6f0 [ 1832.134760] ? cifs_convert_path_to_utf16+0x198/0x220 [cifs] [ 1832.135170] ? smb2_check_message+0x1080/0x1080 [cifs] [ 1832.135545] cifs_ioctl+0x1577/0x3320 [cifs] [ 1832.135864] ? lock_downgrade+0x6f0/0x6f0 [ 1832.136125] ? cifs_readdir+0x2e60/0x2e60 [cifs] [ 1832.136468] ? rcu_read_lock_sched_held+0x3f/0x70 [ 1832.136769] ? __rseq_handle_notify_resume+0x80b/0xbe0 [ 1832.137096] ? __up_read+0x192/0x710 [ 1832.137327] ? __ia32_sys_rseq+0xf0/0xf0 [ 1832.137578] ? __x64_sys_openat+0x11f/0x1d0 [ 1832.137850] __x64_sys_ioctl+0x127/0x190 [ 1832.138103] do_syscall_64+0x3b/0x90 [ 1832.138378] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 1832.138702] RIP: 0033:0x7fcee9a253df [ 1832.138937] 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 [ 1832.140107] RSP: 002b:00007ffeba94a8a0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 1832.140606] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fcee9a253df [ 1832.141058] RDX: 00007ffeba94a910 RSI: 00000000c018cf07 RDI: 0000000000000003 [ 1832.141503] RBP: 00007ffeba94a930 R08: 00007fcee9b24db0 R09: 00007fcee9b45c4e [ 1832.141948] R10: 00007fcee9918d40 R11: 0000000000000246 R12: 00007ffeba94aa48 [ 1832.142396] R13: 0000000000401176 R14: 0000000000403df8 R15: 00007fcee9b78000 [ 1832.142851] [ 1832.142994] Modules linked in: cifs cifs_arc4 cifs_md4 bpf_preload [last unloaded: cifs] Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French fs/cifs/smb2ops.c | 124 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 65 insertions(+), 59 deletions(-) commit b92e358757b91c2827af112cae9af513f26a3f34 Author: Paulo Alcantara Date: Tue Mar 29 16:20:05 2022 -0300 cifs: prevent bad output lengths in smb2_ioctl_query_info() When calling smb2_ioctl_query_info() with smb_query_info::flags=PASSTHRU_FSCTL and smb_query_info::output_buffer_length=0, the following would return 0x10 buffer = memdup_user(arg + sizeof(struct smb_query_info), qi.output_buffer_length); if (IS_ERR(buffer)) { kfree(vars); return PTR_ERR(buffer); } rather than a valid pointer thus making IS_ERR() check fail. This would then cause a NULL ptr deference in @buffer when accessing it later in smb2_ioctl_query_ioctl(). While at it, prevent having a @buffer smaller than 8 bytes to correctly handle SMB2_SET_INFO FileEndOfFileInformation requests when smb_query_info::flags=PASSTHRU_SET_INFO. Here is a small C reproducer which triggers a NULL ptr in @buffer when passing an invalid smb_query_info::flags #include #include #include #include #include #include #define die(s) perror(s), exit(1) #define QUERY_INFO 0xc018cf07 int main(int argc, char *argv[]) { int fd; if (argc < 2) exit(1); fd = open(argv[1], O_RDONLY); if (fd == -1) die("open"); if (ioctl(fd, QUERY_INFO, (uint32_t[]) { 0, 0, 0, 4, 0, 0}) == -1) die("ioctl"); close(fd); return 0; } mount.cifs //srv/share /mnt -o ... gcc repro.c && ./a.out /mnt/f0 [ 114.138620] general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN NOPTI [ 114.139310] KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] [ 114.139775] CPU: 2 PID: 995 Comm: a.out Not tainted 5.17.0-rc8 #1 [ 114.140148] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014 [ 114.140818] RIP: 0010:smb2_ioctl_query_info+0x206/0x410 [cifs] [ 114.141221] Code: 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 c8 01 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 7b 28 4c 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 9c 01 00 00 49 8b 3f e8 58 02 fb ff 48 8b 14 24 [ 114.142348] RSP: 0018:ffffc90000b47b00 EFLAGS: 00010256 [ 114.142692] RAX: dffffc0000000000 RBX: ffff888115503200 RCX: ffffffffa020580d [ 114.143119] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffffa043a380 [ 114.143544] RBP: ffff888115503278 R08: 0000000000000001 R09: 0000000000000003 [ 114.143983] R10: fffffbfff4087470 R11: 0000000000000001 R12: ffff888115503288 [ 114.144424] R13: 00000000ffffffea R14: ffff888115503228 R15: 0000000000000000 [ 114.144852] FS: 00007f7aeabdf740(0000) GS:ffff888151600000(0000) knlGS:0000000000000000 [ 114.145338] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 114.145692] CR2: 00007f7aeacfdf5e CR3: 000000012000e000 CR4: 0000000000350ee0 [ 114.146131] Call Trace: [ 114.146291] [ 114.146432] ? smb2_query_reparse_tag+0x890/0x890 [cifs] [ 114.146800] ? cifs_mapchar+0x460/0x460 [cifs] [ 114.147121] ? rcu_read_lock_sched_held+0x3f/0x70 [ 114.147412] ? cifs_strndup_to_utf16+0x15b/0x250 [cifs] [ 114.147775] ? dentry_path_raw+0xa6/0xf0 [ 114.148024] ? cifs_convert_path_to_utf16+0x198/0x220 [cifs] [ 114.148413] ? smb2_check_message+0x1080/0x1080 [cifs] [ 114.148766] ? rcu_read_lock_sched_held+0x3f/0x70 [ 114.149065] cifs_ioctl+0x1577/0x3320 [cifs] [ 114.149371] ? lock_downgrade+0x6f0/0x6f0 [ 114.149631] ? cifs_readdir+0x2e60/0x2e60 [cifs] [ 114.149956] ? rcu_read_lock_sched_held+0x3f/0x70 [ 114.150250] ? __rseq_handle_notify_resume+0x80b/0xbe0 [ 114.150562] ? __up_read+0x192/0x710 [ 114.150791] ? __ia32_sys_rseq+0xf0/0xf0 [ 114.151025] ? __x64_sys_openat+0x11f/0x1d0 [ 114.151296] __x64_sys_ioctl+0x127/0x190 [ 114.151549] do_syscall_64+0x3b/0x90 [ 114.151768] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 114.152079] RIP: 0033:0x7f7aead043df [ 114.152306] 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 [ 114.153431] RSP: 002b:00007ffc2e0c1f80 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 114.153890] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7aead043df [ 114.154315] RDX: 00007ffc2e0c1ff0 RSI: 00000000c018cf07 RDI: 0000000000000003 [ 114.154747] RBP: 00007ffc2e0c2010 R08: 00007f7aeae03db0 R09: 00007f7aeae24c4e [ 114.155192] R10: 00007f7aeabf7d40 R11: 0000000000000246 R12: 00007ffc2e0c2128 [ 114.155642] R13: 0000000000401176 R14: 0000000000403df8 R15: 00007f7aeae57000 [ 114.156071] [ 114.156218] Modules linked in: cifs cifs_arc4 cifs_md4 bpf_preload [ 114.156608] ---[ end trace 0000000000000000 ]--- [ 114.156898] RIP: 0010:smb2_ioctl_query_info+0x206/0x410 [cifs] [ 114.157792] Code: 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 c8 01 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 7b 28 4c 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 9c 01 00 00 49 8b 3f e8 58 02 fb ff 48 8b 14 24 [ 114.159293] RSP: 0018:ffffc90000b47b00 EFLAGS: 00010256 [ 114.159641] RAX: dffffc0000000000 RBX: ffff888115503200 RCX: ffffffffa020580d [ 114.160093] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffffa043a380 [ 114.160699] RBP: ffff888115503278 R08: 0000000000000001 R09: 0000000000000003 [ 114.161196] R10: fffffbfff4087470 R11: 0000000000000001 R12: ffff888115503288 [ 114.155642] R13: 0000000000401176 R14: 0000000000403df8 R15: 00007f7aeae57000 [ 114.156071] [ 114.156218] Modules linked in: cifs cifs_arc4 cifs_md4 bpf_preload [ 114.156608] ---[ end trace 0000000000000000 ]--- [ 114.156898] RIP: 0010:smb2_ioctl_query_info+0x206/0x410 [cifs] [ 114.157792] Code: 00 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 c8 01 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 7b 28 4c 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 9c 01 00 00 49 8b 3f e8 58 02 fb ff 48 8b 14 24 [ 114.159293] RSP: 0018:ffffc90000b47b00 EFLAGS: 00010256 [ 114.159641] RAX: dffffc0000000000 RBX: ffff888115503200 RCX: ffffffffa020580d [ 114.160093] RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffffa043a380 [ 114.160699] RBP: ffff888115503278 R08: 0000000000000001 R09: 0000000000000003 [ 114.161196] R10: fffffbfff4087470 R11: 0000000000000001 R12: ffff888115503288 [ 114.161823] R13: 00000000ffffffea R14: ffff888115503228 R15: 0000000000000000 [ 114.162274] FS: 00007f7aeabdf740(0000) GS:ffff888151600000(0000) knlGS:0000000000000000 [ 114.162853] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 114.163218] CR2: 00007f7aeacfdf5e CR3: 000000012000e000 CR4: 0000000000350ee0 [ 114.163691] Kernel panic - not syncing: Fatal exception [ 114.164087] Kernel Offset: disabled [ 114.164316] ---[ end Kernel panic - not syncing: Fatal exception ]--- Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French fs/cifs/smb2ops.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) commit 6b8a94332ee4f7d9a8ae0cbac7609f79c212f06c Author: Trond Myklebust Date: Thu Mar 31 09:54:01 2022 -0400 nfsd: Fix a write performance regression The call to filemap_flush() in nfsd_file_put() is there to ensure that we clear out any writes belonging to a NFSv3 client relatively quickly and avoid situations where the file can't be evicted by the garbage collector. It also ensures that we detect write errors quickly. The problem is this causes a regression in performance for some workloads. So try to improve matters by deferring writeback until we're ready to close the file, and need to detect errors so that we can force the client to resend. Tested-by: Jan Kara Fixes: b6669305d35a ("nfsd: Reduce the number of calls to nfsd_file_gc()") Signed-off-by: Trond Myklebust Link: https://lore.kernel.org/all/20220330103457.r4xrhy2d6nhtouzk@quack3.lan Signed-off-by: Chuck Lever fs/nfsd/filecache.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) commit c7803b05f74bc3941b127f3155671e1944f632ae Author: Steve French Date: Mon Mar 28 17:45:55 2022 -0500 smb3: fix ksmbd bigendian bug in oplock break, and move its struct to smbfs_common Fix an endian bug in ksmbd for one remaining use of Persistent/VolatileFid that unnecessarily converted it (it is an opaque endian field that does not need to be and should not be converted) in oplock_break for ksmbd, and move the definitions for the oplock and lease break protocol requests and responses to fs/smbfs_common/smb2pdu.h Also move a few more definitions for various protocol requests that were duplicated (in fs/cifs/smb2pdu.h and fs/ksmbd/smb2pdu.h) into fs/smbfs_common/smb2pdu.h including: - various ioctls and reparse structures - validate negotiate request and response structs - duplicate extents structs Reviewed-by: Paulo Alcantara (SUSE) Reviewed-by: Namjae Jeon Signed-off-by: Steve French fs/cifs/smb2pdu.h | 112 --------------------------------------------- fs/ksmbd/oplock.c | 4 +- fs/ksmbd/smb2pdu.c | 8 ++-- fs/ksmbd/smb2pdu.h | 73 ------------------------------ fs/smbfs_common/smb2pdu.h | 113 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 119 insertions(+), 191 deletions(-) commit 6d35d04a9e18990040e87d2bbf72689252669d54 Author: Zhang Wensheng Date: Thu Mar 10 17:32:24 2022 +0800 nbd: fix possible overflow on 'first_minor' in nbd_dev_add() When 'index' is a big numbers, it may become negative which forced to 'int'. then 'index << part_shift' might overflow to a positive value that is not greater than '0xfffff', then sysfs might complains about duplicate creation. Because of this, move the 'index' judgment to the front will fix it and be better. Fixes: b0d9111a2d53 ("nbd: use an idr to keep track of nbd devices") Fixes: 940c264984fd ("nbd: fix possible overflow for 'first_minor' in nbd_dev_add()") Signed-off-by: Zhang Wensheng Reviewed-by: Josef Bacik Link: https://lore.kernel.org/r/20220310093224.4002895-1-zhangwensheng5@huawei.com Signed-off-by: Jens Axboe drivers/block/nbd.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) commit 48ec13d36d3ff716a8a08e6583a925def7a2564d Author: Joey Gouly Date: Fri Mar 18 12:12:33 2022 +0000 gpio: Properly document parent data union Suppress a warning in the html docs by documenting these fields separately. Signed-off-by: Joey Gouly Link: https://lore.kernel.org/lkml/20211027220118.71a229ab@canb.auug.org.au/ Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: Marc Zyngier Cc: Stephen Rothwell Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski include/linux/gpio/driver.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit 576892a84f37875c7deb20eee11d5b88dd5e1097 Author: Kris Bahnsen Date: Fri Mar 11 10:19:58 2022 -0800 gpio: ts4900: Fix comment formatting and grammar The issues were pointed out after the prior commit was applied. Signed-off-by: Kris Bahnsen Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski drivers/gpio/gpio-ts4900.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit db0a1550407e9bb227a31ce7e2f77489986f47e0 Author: Christoph Böhmwalder Date: Thu Mar 31 15:42:36 2022 +0200 MAINTAINERS: add drbd co-maintainer In light of the recent controversy surrounding the (lack of) maintenance of the in-tree DRBD driver, we have decided to add myself as co-maintainer. This allows us to better distribute the workload and reduce the chance of patches getting lost. I will be keeping an eye on the mailing list in order to ensure that all patches get the attention they need. Signed-off-by: Christoph Böhmwalder Link: https://lore.kernel.org/r/20220331134236.776524-1-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit 8b2360c7157b462c4870d447d1e65d30ef31f9aa Author: Randy Dunlap Date: Sat Mar 12 07:36:09 2022 +0100 ARM: 9187/1: JIVE: fix return value of __setup handler __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything to obsolete_checksetup() -- only non-zero (usually 1) or zero. So return 1 from jive_mtdset(). Fixes: 9db829f485c5 ("[ARM] JIVE: Initial machine support for Logitech Jive") Signed-off-by: Randy Dunlap Cc: Ben Dooks Cc: Krzysztof Kozlowski Cc: Alim Akhtar Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: patches@armlinux.org.uk Signed-off-by: Russell King (Oracle) arch/arm/mach-s3c/mach-jive.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 9c6d6652e950fb34295f446676a811f6df5b8561 Author: Masahiro Yamada Date: Thu Mar 31 09:47:09 2022 +0100 ARM: 9189/1: decompressor: fix unneeded rebuilds of library objects Since commit 251cc826be7d ("ARM: 9154/1: decompressor: do not copy source files while building"), the following three are rebuilt every time. AS arch/arm/boot/compressed/lib1funcs.o AS arch/arm/boot/compressed/ashldi3.o AS arch/arm/boot/compressed/bswapsdi2.o Move the "OBJS += ..." line up so these objects are added to 'targets'. Fixes: 251cc826be7d ("ARM: 9154/1: decompressor: do not copy source files while building") Reported-by: Russell King (Oracle) Signed-off-by: Masahiro Yamada Signed-off-by: Russell King (Oracle) arch/arm/boot/compressed/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ff8376ade4f668130385839cef586a0990f8ef87 Author: Xiaolong Huang Date: Wed Mar 30 15:22:14 2022 +0100 rxrpc: fix some null-ptr-deref bugs in server_key.c Some function calls are not implemented in rxrpc_no_security, there are preparse_server_key, free_preparse_server_key and destroy_server_key. When rxrpc security type is rxrpc_no_security, user can easily trigger a null-ptr-deref bug via ioctl. So judgment should be added to prevent it The crash log: user@syzkaller:~$ ./rxrpc_preparse_s [ 37.956878][T15626] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 37.957645][T15626] #PF: supervisor instruction fetch in kernel mode [ 37.958229][T15626] #PF: error_code(0x0010) - not-present page [ 37.958762][T15626] PGD 4aadf067 P4D 4aadf067 PUD 4aade067 PMD 0 [ 37.959321][T15626] Oops: 0010 [#1] PREEMPT SMP [ 37.959739][T15626] CPU: 0 PID: 15626 Comm: rxrpc_preparse_ Not tainted 5.17.0-01442-gb47d5a4f6b8d #43 [ 37.960588][T15626] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1 04/01/2014 [ 37.961474][T15626] RIP: 0010:0x0 [ 37.961787][T15626] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. [ 37.962480][T15626] RSP: 0018:ffffc9000d9abdc0 EFLAGS: 00010286 [ 37.963018][T15626] RAX: ffffffff84335200 RBX: ffff888012a1ce80 RCX: 0000000000000000 [ 37.963727][T15626] RDX: 0000000000000000 RSI: ffffffff84a736dc RDI: ffffc9000d9abe48 [ 37.964425][T15626] RBP: ffffc9000d9abe48 R08: 0000000000000000 R09: 0000000000000002 [ 37.965118][T15626] R10: 000000000000000a R11: f000000000000000 R12: ffff888013145680 [ 37.965836][T15626] R13: 0000000000000000 R14: ffffffffffffffec R15: ffff8880432aba80 [ 37.966441][T15626] FS: 00007f2177907700(0000) GS:ffff88803ec00000(0000) knlGS:0000000000000000 [ 37.966979][T15626] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 37.967384][T15626] CR2: ffffffffffffffd6 CR3: 000000004aaf1000 CR4: 00000000000006f0 [ 37.967864][T15626] Call Trace: [ 37.968062][T15626] [ 37.968240][T15626] rxrpc_preparse_s+0x59/0x90 [ 37.968541][T15626] key_create_or_update+0x174/0x510 [ 37.968863][T15626] __x64_sys_add_key+0x139/0x1d0 [ 37.969165][T15626] do_syscall_64+0x35/0xb0 [ 37.969451][T15626] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 37.969824][T15626] RIP: 0033:0x43a1f9 Signed-off-by: Xiaolong Huang Tested-by: Xiaolong Huang Signed-off-by: David Howells Acked-by: Marc Dionne cc: linux-afs@lists.infradead.org Link: http://lists.infradead.org/pipermail/linux-afs/2022-March/005069.html Fixes: 12da59fcab5a ("rxrpc: Hand server key parsing off to the security class") Link: https://lore.kernel.org/r/164865013439.2941502.8966285221215590921.stgit@warthog.procyon.org.uk Signed-off-by: Paolo Abeni net/rxrpc/server_key.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 3ed4bb77156da0bc732847c8c9df92454c1fbeea Author: Matthew Wilcox (Oracle) Date: Thu Mar 31 08:27:09 2022 -0400 XArray: Update the LRU list in xas_split() When splitting a value entry, we may need to add the new nodes to the LRU list and remove the parent node from the LRU list. The WARN_ON checks in shadow_lru_isolate() catch this oversight. This bug was latent until we stopped splitting folios in shrink_page_list() with commit 820c4e2e6f51 ("mm/vmscan: Free non-shmem folios without splitting them"). That allows the creation of large shadow entries, and subsequently when trying to page in a small page, we will split the large shadow entry in __filemap_add_folio(). Fixes: 8fc75643c5e1 ("XArray: add xas_split") Reported-by: Hugh Dickins Signed-off-by: Matthew Wilcox (Oracle) lib/xarray.c | 2 ++ 1 file changed, 2 insertions(+) commit e4ff77598a109bd36789ad5e80aba66fc53d0ffb Author: Srikar Dronamraju Date: Wed Mar 30 19:21:23 2022 +0530 powerpc/numa: Handle partially initialized numa nodes With commit 09f49dca570a ("mm: handle uninitialized numa nodes gracefully") NODE_DATA for even a memoryless/cpuless node is partially initialized at boot time. Before onlining the node, current Powerpc code checks for NODE_DATA to be NULL. However since NODE_DATA is partially initialized, this check will end up always being false. This causes hotplugging a CPU to a memoryless/cpuless node to fail. Before adding CPUs: $ numactl -H available: 1 nodes (4) node 4 cpus: 0 1 2 3 4 5 6 7 node 4 size: 97372 MB node 4 free: 95545 MB node distances: node 4 4: 10 $ lparstat System Configuration type=Dedicated mode=Capped smt=8 lcpu=1 mem=99709440 kB cpus=0 ent=1.00 %user %sys %wait %idle physc %entc lbusy app vcsw phint ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 2.66 2.67 0.16 94.51 0.00 0.00 5.33 0.00 67749 0 After hotplugging 32 cores: $ numactl -H node 4 cpus: 0 1 2 3 4 5 6 7 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 node 4 size: 97372 MB node 4 free: 93636 MB node distances: node 4 4: 10 $ lparstat System Configuration type=Dedicated mode=Capped smt=8 lcpu=33 mem=99709440 kB cpus=0 ent=33.00 %user %sys %wait %idle physc %entc lbusy app vcsw phint ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 0.04 0.02 0.00 99.94 0.00 0.00 0.06 0.00 1128751 3 As we can see numactl is listing only 8 cores while lparstat is showing 33 cores. Also dmesg is showing messages like: [ 2261.318350 ] BUG: arch topology borken [ 2261.318357 ] the DIE domain not a subset of the NODE domain Fixes: 09f49dca570a ("mm: handle uninitialized numa nodes gracefully") Reported-by: Geetika Moolchandani Signed-off-by: Srikar Dronamraju Acked-by: Michal Hocko Acked-by: Oscar Salvador Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220330135123.1868197-1-srikar@linux.vnet.ibm.com arch/powerpc/mm/numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4a3b666e0ea977dd40adb56c37a91370f76fa19e Author: Jakob Koschel Date: Thu Mar 31 11:12:18 2022 +0200 block: use dedicated list iterator variable To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable instead of a found boolean [1]. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ [1] Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220331091218.641532-1-jakobkoschel@gmail.com [axboe: move lookup to where return value is checked] Signed-off-by: Jens Axboe block/blk-mq.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) commit 4a7f62f91933c8ae5308f9127fd8ea48188b6bc3 Author: David Howells Date: Wed Mar 30 15:39:16 2022 +0100 rxrpc: Fix call timer start racing with call destruction The rxrpc_call struct has a timer used to handle various timed events relating to a call. This timer can get started from the packet input routines that are run in softirq mode with just the RCU read lock held. Unfortunately, because only the RCU read lock is held - and neither ref or other lock is taken - the call can start getting destroyed at the same time a packet comes in addressed to that call. This causes the timer - which was already stopped - to get restarted. Later, the timer dispatch code may then oops if the timer got deallocated first. Fix this by trying to take a ref on the rxrpc_call struct and, if successful, passing that ref along to the timer. If the timer was already running, the ref is discarded. The timer completion routine can then pass the ref along to the call's work item when it queues it. If the timer or work item where already queued/running, the extra ref is discarded. Fixes: a158bdd3247b ("rxrpc: Fix call timeouts") Reported-by: Marc Dionne Signed-off-by: David Howells Reviewed-by: Marc Dionne Tested-by: Marc Dionne cc: linux-afs@lists.infradead.org Link: http://lists.infradead.org/pipermail/linux-afs/2022-March/005073.html Link: https://lore.kernel.org/r/164865115696.2943015.11097991776647323586.stgit@warthog.procyon.org.uk Signed-off-by: Paolo Abeni include/trace/events/rxrpc.h | 8 +++++++- net/rxrpc/ar-internal.h | 15 +++++++-------- net/rxrpc/call_event.c | 2 +- net/rxrpc/call_object.c | 40 +++++++++++++++++++++++++++++++++++----- 4 files changed, 50 insertions(+), 15 deletions(-) commit e74e024434d0e50c2a945cc9c4c380baaa3ba506 Merge: 1e71cfcf3a22 7ed258f12ec5 Author: Paolo Abeni Date: Thu Mar 31 11:40:02 2022 +0200 Merge branch 'net-hns3-add-two-fixes-for-net' Guangbin Huang says: ==================== net: hns3: add two fixes for -net This series adds two fixes for the HNS3 ethernet driver. ==================== Link: https://lore.kernel.org/r/20220330134506.36635-1-huangguangbin2@huawei.com Signed-off-by: Paolo Abeni commit 7ed258f12ec5ce855f15cdfb5710361dc82fe899 Author: Guangbin Huang Date: Wed Mar 30 21:45:06 2022 +0800 net: hns3: fix software vlan talbe of vlan 0 inconsistent with hardware When user delete vlan 0, as driver will not delete vlan 0 for hardware in function hclge_set_vlan_filter_hw(), so vlan 0 in software vlan talbe should not be deleted. Fixes: fe4144d47eef ("net: hns3: sync VLAN filter entries when kill VLAN ID failed") Signed-off-by: Guangbin Huang Signed-off-by: Paolo Abeni drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 9c9a04212fa380d2e7d1412bb281309955c0a781 Author: Yufeng Mo Date: Wed Mar 30 21:45:05 2022 +0800 net: hns3: fix the concurrency between functions reading debugfs Currently, the debugfs mechanism is that all functions share a global variable to save the pointer for obtaining data. When different functions concurrently access the same file node, repeated release exceptions occur. Therefore, the granularity of the pointer for storing the obtained data is adjusted to be private for each function. Fixes: 5e69ea7ee2a6 ("net: hns3: refactor the debugfs process") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: Paolo Abeni drivers/net/ethernet/hisilicon/hns3/hnae3.h | 1 + drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 15 +++++++++++---- drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h | 1 - 3 files changed, 12 insertions(+), 5 deletions(-) commit 1e71cfcf3a225091add95435954299c14d18020d Merge: f9512d654f62 8df0136376dc Author: Paolo Abeni Date: Thu Mar 31 10:49:42 2022 +0200 Merge branch 'docs-update-and-move-the-netdev-faq' Jakub Kicinski says: ==================== docs: update and move the netdev-FAQ A section of documentation for tree-specific process quirks had been created a while back. There's only one tree in it, so far, the tip tree, but the contents seem to answer similar questions as we answer in the netdev-FAQ. Move the netdev-FAQ. Take this opportunity to touch up and update a few sections. v3: remove some confrontational? language from patch 7 v2: remove non-git in patch 3 add patch 5 ==================== Link: https://lore.kernel.org/r/20220330042505.2902770-1-kuba@kernel.org Signed-off-by: Paolo Abeni commit 8df0136376dc9227a45fd6a1420016f58792b5d0 Author: Jakub Kicinski Date: Tue Mar 29 21:25:05 2022 -0700 docs: netdev: move the netdev-FAQ to the process pages The documentation for the tip tree is really in quite a similar spirit to the netdev-FAQ. Move the netdev-FAQ to the process docs as well. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/bpf/bpf_devel_QA.rst | 2 +- Documentation/networking/index.rst | 3 ++- Documentation/process/maintainer-handbooks.rst | 1 + .../{networking/netdev-FAQ.rst => process/maintainer-netdev.rst} | 0 MAINTAINERS | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) commit 08767a26f095909423f963c864f15db50c0ce9a7 Author: Jakub Kicinski Date: Tue Mar 29 21:25:04 2022 -0700 docs: netdev: broaden the new vs old code formatting guidelines Convert the "should I use new or old comment formatting" to cover all formatting. This makes the question itself shorter. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 99eba4e5cbd462db47dcb949af6d5474acdac953 Author: Jakub Kicinski Date: Tue Mar 29 21:25:03 2022 -0700 docs: netdev: call out the merge window in tag checking Add the most important case to the question about "where are we in the cycle" - the case of net-next being closed. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit a300597318771f889136db36f9f0dcfd26b84f18 Author: Jakub Kicinski Date: Tue Mar 29 21:25:02 2022 -0700 docs: netdev: add missing back ticks I think double back ticks are more correct. Add where they are missing. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 3eca381457ca58fbde16f827ddfaaecde3d61127 Author: Jakub Kicinski Date: Tue Mar 29 21:25:01 2022 -0700 docs: netdev: make the testing requirement more stringent These days we often ask for selftests so let's update our testing requirements. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) commit b8ba106378a058711d8abd0889351ff9c81850c1 Author: Jakub Kicinski Date: Tue Mar 29 21:25:00 2022 -0700 docs: netdev: add a question about re-posting frequency We have to tell people to stop reposting to often lately, or not to repost while the discussion is ongoing. Document this. Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) commit 724c1a7443c5ccb7cda9bfb5ccab84bcece2c50c Author: Jakub Kicinski Date: Tue Mar 29 21:24:59 2022 -0700 docs: netdev: rephrase the 'should I update patchwork' question Make the question shorter and adjust the start of the answer accordingly. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 8f785c1bb84f7c8ca07c408dc96e8d8358b02bb3 Author: Jakub Kicinski Date: Tue Mar 29 21:24:58 2022 -0700 docs: netdev: rephrase the 'Under review' question The semantics of "Under review" have shifted. Reword the question about it a bit and focus it on the response time. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 5d84921ac750d2b2e42c7102890b978cb2c2729e Author: Jakub Kicinski Date: Tue Mar 29 21:24:57 2022 -0700 docs: netdev: shorten the name and mention msgid for patch status Cut down the length of the question so it renders better in docs. Mention that Message-ID can be used to search patchwork. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 0e242e3fb7a7f6c120195c5a57faf78a321dbf65 Author: Jakub Kicinski Date: Tue Mar 29 21:24:56 2022 -0700 docs: netdev: note that RFC postings are allowed any time Document that RFCs are allowed during the merge window. Signed-off-by: Jakub Kicinski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 3 +++ 1 file changed, 3 insertions(+) commit 2fd4c50dbff19eb3d798236074bfa3226b5df4a6 Author: Jakub Kicinski Date: Tue Mar 29 21:24:55 2022 -0700 docs: netdev: turn the net-next closed into a Warning Use the sphinx Warning box to make the net-next being closed stand out more. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit c82d90b14f6c23f4e7cd89944f9a89f89223dc58 Author: Jakub Kicinski Date: Tue Mar 29 21:24:54 2022 -0700 docs: netdev: move the patch marking section up We want people to mark their patches with net and net-next in the subject. Many miss doing that. Move the FAQ section which points that out up, and place it after the section which enumerates the trees, that seems like a pretty logical place for it. Since the two sections are together we can remove a little bit (not too much) of the repetition. v2: also remove the text for non-git setups, we want people to use git. Signed-off-by: Jakub Kicinski Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) commit 30cddd30532a72f857abf9d7c80d8b620fd3e5a1 Author: Jakub Kicinski Date: Tue Mar 29 21:24:53 2022 -0700 docs: netdev: minor reword that -> those Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 50386f7526dd7fd71a390966ea9736c8420aa31f Author: Jakub Kicinski Date: Tue Mar 29 21:24:52 2022 -0700 docs: netdev: replace references to old archives Most people use (or should use) lore at this point. Replace the pointers to older archiving systems. Signed-off-by: Jakub Kicinski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Documentation/networking/netdev-FAQ.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 7dd5ad2d3e82fb55229e3fe18e09160878e77e20 Author: Thomas Gleixner Date: Thu Mar 31 10:36:55 2022 +0200 Revert "signal, x86: Delay calling signals in atomic on RT enabled kernels" Revert commit bf9ad37dc8a. It needs to be better encapsulated and generalized. Signed-off-by: Thomas Gleixner Cc: "Eric W. Biederman" Cc: Oleg Nesterov Cc: Sebastian Andrzej Siewior arch/x86/Kconfig | 1 - include/linux/sched.h | 3 --- kernel/Kconfig.preempt | 12 +----------- kernel/entry/common.c | 14 -------------- kernel/signal.c | 40 ---------------------------------------- 5 files changed, 1 insertion(+), 69 deletions(-) commit 50d34a0d151dc7abbdbec781bd7f09f2b3cbf01a Author: Marc Kleine-Budde Date: Tue Mar 29 21:29:43 2022 +0200 can: gs_usb: gs_make_candev(): fix memory leak for devices with extended bit timing configuration Some CAN-FD capable devices offer extended bit timing information for the data bit timing. The information must be read with an USB control message. The memory for this message is allocated but not free()ed (in the non error case). This patch adds the missing free. Fixes: 6679f4c5e5a6 ("can: gs_usb: add extended bt_const feature") Link: https://lore.kernel.org/all/20220329193450.659726-1-mkl@pengutronix.de Reported-by: syzbot+4d0ae90a195b269f102d@syzkaller.appspotmail.com Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 2 ++ 1 file changed, 2 insertions(+) commit 136bed0bfd3bc9c95c88aafff2d22ecb3a919f23 Author: Pavel Skripkin Date: Sun Mar 13 13:09:03 2022 +0300 can: mcba_usb: properly check endpoint type Syzbot reported warning in usb_submit_urb() which is caused by wrong endpoint type. We should check that in endpoint is actually present to prevent this warning. Found pipes are now saved to struct mcba_priv and code uses them directly instead of making pipes in place. Fail log: | usb 5-1: BOGUS urb xfer, pipe 3 != type 1 | WARNING: CPU: 1 PID: 49 at drivers/usb/core/urb.c:502 usb_submit_urb+0xed2/0x18a0 drivers/usb/core/urb.c:502 | Modules linked in: | CPU: 1 PID: 49 Comm: kworker/1:2 Not tainted 5.17.0-rc6-syzkaller-00184-g38f80f42147f #0 | Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 | Workqueue: usb_hub_wq hub_event | RIP: 0010:usb_submit_urb+0xed2/0x18a0 drivers/usb/core/urb.c:502 | ... | Call Trace: | | mcba_usb_start drivers/net/can/usb/mcba_usb.c:662 [inline] | mcba_usb_probe+0x8a3/0xc50 drivers/net/can/usb/mcba_usb.c:858 | usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396 | call_driver_probe drivers/base/dd.c:517 [inline] Fixes: 51f3baad7de9 ("can: mcba_usb: Add support for Microchip CAN BUS Analyzer") Link: https://lore.kernel.org/all/20220313100903.10868-1-paskripkin@gmail.com Reported-and-tested-by: syzbot+3bc1dce0cc0052d60fde@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Reviewed-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/mcba_usb.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) commit 04c9b00ba83594a29813d6b1fb8fdc93a3915174 Author: Hangyu Hua Date: Fri Mar 11 16:02:08 2022 +0800 can: mcba_usb: mcba_usb_start_xmit(): fix double dev_kfree_skb in error path There is no need to call dev_kfree_skb() when usb_submit_urb() fails because can_put_echo_skb() deletes original skb and can_free_echo_skb() deletes the cloned skb. Fixes: 51f3baad7de9 ("can: mcba_usb: Add support for Microchip CAN BUS Analyzer") Link: https://lore.kernel.org/all/20220311080208.45047-1-hbh25y@gmail.com Signed-off-by: Hangyu Hua Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/mcba_usb.c | 1 - 1 file changed, 1 deletion(-) commit 3d3925ff6433f98992685a9679613a2cc97f3ce2 Author: Hangyu Hua Date: Fri Mar 11 16:06:14 2022 +0800 can: usb_8dev: usb_8dev_start_xmit(): fix double dev_kfree_skb() in error path There is no need to call dev_kfree_skb() when usb_submit_urb() fails because can_put_echo_skb() deletes original skb and can_free_echo_skb() deletes the cloned skb. Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices") Link: https://lore.kernel.org/all/20220311080614.45229-1-hbh25y@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Hangyu Hua Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/usb_8dev.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) commit c70222752228a62135cee3409dccefd494a24646 Author: Hangyu Hua Date: Mon Feb 28 16:36:39 2022 +0800 can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path There is no need to call dev_kfree_skb() when usb_submit_urb() fails beacause can_put_echo_skb() deletes the original skb and can_free_echo_skb() deletes the cloned skb. Link: https://lore.kernel.org/all/20220228083639.38183-1-hbh25y@gmail.com Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface") Cc: stable@vger.kernel.org Cc: Sebastian Haas Signed-off-by: Hangyu Hua Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/ems_usb.c | 1 - 1 file changed, 1 deletion(-) commit 2e8e79c416aae1de224c0f1860f2e3350fa171f8 Author: Marc Kleine-Budde Date: Thu Mar 17 08:57:35 2022 +0100 can: m_can: m_can_tx_handler(): fix use after free of skb can_put_echo_skb() will clone skb then free the skb. Move the can_put_echo_skb() for the m_can version 3.0.x directly before the start of the xmit in hardware, similar to the 3.1.x branch. Fixes: 80646733f11c ("can: m_can: update to support CAN FD features") Link: https://lore.kernel.org/all/20220317081305.739554-1-mkl@pengutronix.de Cc: stable@vger.kernel.org Reported-by: Hangyu Hua Signed-off-by: Marc Kleine-Budde drivers/net/can/m_can/m_can.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit fa7b514d2b2894e052b8e94c7a29feb98e90093f Author: Tom Rix Date: Sat Mar 19 08:31:28 2022 -0700 can: mcp251xfd: mcp251xfd_register_get_dev_id(): fix return of error value Clang static analysis reports this issue: | mcp251xfd-core.c:1813:7: warning: The left operand | of '&' is a garbage value | FIELD_GET(MCP251XFD_REG_DEVID_ID_MASK, dev_id), | ^ ~~~~~~ dev_id is set in a successful call to mcp251xfd_register_get_dev_id(). Though the status of calls made by mcp251xfd_register_get_dev_id() are checked and handled, their status' are not returned. So return err. Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN") Link: https://lore.kernel.org/all/20220319153128.2164120-1-trix@redhat.com Signed-off-by: Tom Rix Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e382fea8ae54f5bb62869c6b69b33993d43adeca Author: Oliver Hartkopp Date: Mon Mar 28 13:36:11 2022 +0200 can: isotp: restore accidentally removed MSG_PEEK feature In commit 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket") a new check for recvmsg flags has been introduced that only checked for the flags that are handled in isotp_recvmsg() itself. This accidentally removed the MSG_PEEK feature flag which is processed later in the call chain in __skb_try_recv_from_queue(). Add MSG_PEEK to the set of valid flags to restore the feature. Fixes: 42bf50a1795a ("can: isotp: support MSG_TRUNC flag when reading from socket") Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1079554254 Link: https://lore.kernel.org/all/20220328113611.3691-1-socketcan@hartkopp.net Reported-by: Derek Will Suggested-by: Derek Will Tested-by: Derek Will Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde net/can/isotp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8a122a66c77034d7dc8f692e1b5c7a3b60c374b3 Author: Atish Patra Date: Fri Mar 18 19:26:33 2022 -0700 RISC-V: Fix a comment typo in riscv_of_parent_hartid() This fixes a typo in a comment that is both obvious and went unnoticed. Signed-off-by: Atish Patra Fixes: a9b202606c69 ("RISC-V: Improve /proc/cpuinfo output for ISA extensions") Signed-off-by: Palmer Dabbelt arch/riscv/kernel/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b81d591386c3a50b96dddcf663628ea0df0bf2b3 Author: Dmitry Vyukov Date: Mon Mar 14 10:06:52 2022 +0100 riscv: Increase stack size under KASAN KASAN requires more stack space because of compiler instrumentation. Increase stack size as other arches do. Signed-off-by: Dmitry Vyukov Reported-by: syzbot+0600986d88e2d4d7ebb8@syzkaller.appspotmail.com Fixes: 8ad8b72721d0 ("riscv: Add KASAN support") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt arch/riscv/include/asm/thread_info.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 2b2b574ac587ec5bd7716a356492a85ab8b0ce9f Author: Nikita Shubin Date: Fri Mar 11 09:58:15 2022 +0300 riscv: Fix fill_callchain return value perf_callchain_store return 0 on success, -1 otherwise, fix fill_callchain to return correct bool value. Fixes: dbeb90b0c1eb ("riscv: Add perf callchain support") Signed-off-by: Nikita Shubin Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt arch/riscv/kernel/perf_callchain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6846d656106add3aeefcd6eda0dc885787deaa6e Author: Niklas Cassel Date: Tue Mar 8 14:28:05 2022 +0100 riscv: dts: canaan: Fix SPI3 bus width According to the K210 Standalone SDK Programming guide: https://canaan-creative.com/wp-content/uploads/2020/03/kendryte_standalone_programming_guide_20190311144158_en.pdf Section 15.4.3.3: SPI0 and SPI1 supports: standard, dual, quad and octal transfers. SPI3 supports: standard, dual and quad transfers (octal is not supported). In order to support quad transfers (Quad SPI), SPI3 must have four IO wires connected to the SPI flash. Update the device tree to specify the correct bus width. Tested on maix bit, maix dock and maixduino, which all have the same SPI flash (gd25lq128d) connected to SPI3. maix go is untested, but it would not make sense for this k210 board to be designed differently. Signed-off-by: Niklas Cassel Reviewed-by: Damien Le Moal Fixes: 8f5b0e79f3e5 ("riscv: Add SiPeed MAIXDUINO board device tree") Fixes: 8194f08bda18 ("riscv: Add SiPeed MAIX GO board device tree") Fixes: a40f920964c4 ("riscv: Add SiPeed MAIX DOCK board device tree") Fixes: 97c279bcf813 ("riscv: Add SiPeed MAIX BiT board device tree") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt arch/riscv/boot/dts/canaan/sipeed_maix_bit.dts | 2 ++ arch/riscv/boot/dts/canaan/sipeed_maix_dock.dts | 2 ++ arch/riscv/boot/dts/canaan/sipeed_maix_go.dts | 2 ++ arch/riscv/boot/dts/canaan/sipeed_maixduino.dts | 2 ++ 4 files changed, 8 insertions(+) commit 5710faba8a2a15349c9001bd4b2cd958e56c90fa Merge: 5600f6986628 a949087c2285 Author: Dmitry Torokhov Date: Wed Mar 30 21:14:18 2022 -0700 Merge branch 'next' into for-linus Prepare input updates for 5.18 merge window. commit e9c281928c24dfeb86b11c31b53757b6a127f8aa Author: Nathan Chancellor Date: Fri Mar 4 10:08:14 2022 -0700 kbuild: Make $(LLVM) more flexible The LLVM make variable allows a developer to quickly switch between the GNU and LLVM tools. However, it does not handle versioned binaries, such as the ones shipped by Debian, as LLVM=1 just defines the tool variables with the unversioned binaries. There was some discussion during the review of the patch that introduces LLVM=1 around versioned binaries, ultimately coming to the conclusion that developers can just add the folder that contains the unversioned binaries to their PATH, as Debian's versioned suffixed binaries are really just symlinks to the unversioned binaries in /usr/lib/llvm-#/bin: $ realpath /usr/bin/clang-14 /usr/lib/llvm-14/bin/clang $ PATH=/usr/lib/llvm-14/bin:$PATH make ... LLVM=1 However, that can be cumbersome to developers who are constantly testing series with different toolchains and versions. It is simple enough to support these versioned binaries directly in the Kbuild system by allowing the developer to specify the version suffix with LLVM=, which is shorter than the above suggestion: $ make ... LLVM=-14 It does not change the meaning of LLVM=1 (which will continue to use unversioned binaries) and it does not add too much additional complexity to the existing $(LLVM) code, while allowing developers to quickly test their series with different versions of the whole LLVM suite of tools. Some developers may build LLVM from source but not add the binaries to their PATH, as they may not want to use that toolchain systemwide. Support those developers by allowing them to supply the directory that the LLVM tools are available in, as it is no more complex to support than the version suffix change above. $ make ... LLVM=/path/to/llvm/ Update and reorder the documentation to reflect these new additions. At the same time, notate that LLVM=0 is not the same as just omitting it altogether, which has confused people in the past. Link: https://lore.kernel.org/r/20200317215515.226917-1-ndesaulniers@google.com/ Link: https://lore.kernel.org/r/20220224151322.072632223@infradead.org/ Suggested-by: Masahiro Yamada Suggested-by: Peter Zijlstra Signed-off-by: Nathan Chancellor Reviewed-by: Kees Cook Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada Documentation/kbuild/llvm.rst | 31 +++++++++++++++++++++++++------ Makefile | 26 ++++++++++++++++---------- tools/scripts/Makefile.include | 22 ++++++++++++++-------- tools/testing/selftests/lib.mk | 8 +++++++- 4 files changed, 62 insertions(+), 25 deletions(-) commit 9fbed27a7a1101c926718dfa9b49aff1d04477b5 Author: Masahiro Yamada Date: Sat Mar 5 21:56:05 2022 +0900 kbuild: add --target to correctly cross-compile UAPI headers with Clang When you compile-test UAPI headers (CONFIG_UAPI_HEADER_TEST=y) with Clang, they are currently compiled for the host target (likely x86_64) regardless of the given ARCH=. In fact, some exported headers include libc headers. For example, include/uapi/linux/agpgart.h includes after being exported. The header search paths should match to the target we are compiling them for. Pick up the --target triple from KBUILD_CFLAGS in the same ways as commit 7f58b487e9ff ("kbuild: make Clang build userprogs for target architecture"). Signed-off-by: Masahiro Yamada Reviewed-by: Nathan Chancellor Reviewed-by: Nick Desaulniers usr/include/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 69304379ff036ce8ecf41efc2aeea4b29dd0c43f Author: Masahiro Yamada Date: Sun Mar 6 16:25:35 2022 +0900 fixdep: use fflush() and ferror() to ensure successful write to files Currently, fixdep checks the return value from (v)printf(), but it does not ensure the complete write to the .cmd file. printf() just writes data to the internal buffer, which usually succeeds. (Of course, it may fail for another reason, for example when the file descriptor is closed, but that is another story.) When the buffer (4k?) is full, an actual write occurs, and printf() may really fail. One of typical cases is "No space left on device" when the disk is full. The data remaining in the buffer will be pushed out to the file when the program exits, but we never know if it is successful. One straight-forward fix would be to add the following code at the end of the program. ret = fflush(stdout); if (ret < 0) { /* error handling */ } However, it is tedious to check the return code in all the call sites of printf(), fflush(), fclose(), and whatever can cause actual writes to the end device. Doing that lets the program bail out at the first failure but is usually not worth the effort. Instead, let's check the error status from ferror(). This is 'sticky', so you need to check it just once. You still need to call fflush(). Signed-off-by: Masahiro Yamada Reviewed-by: David Laight Reviewed-by: Nick Desaulniers scripts/basic/fixdep.c | 46 +++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) commit bbc90bc1bd4a63121bae9cbfafe1e1f0beaf24b1 Author: Masahiro Yamada Date: Sun Feb 27 18:10:24 2022 +0900 arch: syscalls: simplify uapi/kapi directory creation $(shell ...) expands to empty. There is no need to assign it to _dummy. Signed-off-by: Masahiro Yamada Acked-by: Geert Uytterhoeven arch/alpha/kernel/syscalls/Makefile | 3 +-- arch/arm/tools/Makefile | 3 +-- arch/ia64/kernel/syscalls/Makefile | 3 +-- arch/m68k/kernel/syscalls/Makefile | 3 +-- arch/microblaze/kernel/syscalls/Makefile | 3 +-- arch/mips/kernel/syscalls/Makefile | 3 +-- arch/parisc/kernel/syscalls/Makefile | 3 +-- arch/powerpc/kernel/syscalls/Makefile | 3 +-- arch/s390/kernel/syscalls/Makefile | 3 +-- arch/sh/kernel/syscalls/Makefile | 3 +-- arch/sparc/kernel/syscalls/Makefile | 3 +-- arch/x86/entry/syscalls/Makefile | 3 +-- arch/xtensa/kernel/syscalls/Makefile | 3 +-- 13 files changed, 13 insertions(+), 26 deletions(-) commit c1ea04d82778ed04ed0943eb85c55c221d9d3a5b Author: Masahiro Yamada Date: Sun Feb 27 18:03:35 2022 +0900 usr/include: replace extra-y with always-y extra-y is not run for 'make modules'. The header compile test should be executed irrespective of the build target. always-y is a better fit. Signed-off-by: Masahiro Yamada usr/include/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0a210af6d0a0595fef566e7eeb072f10f37774be Author: Martin KaFai Lau Date: Tue Mar 29 18:15:02 2022 -0700 bpf: selftests: Test fentry tracing a struct_ops program This patch tests attaching an fentry prog to a struct_ops prog. Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220330011502.2985292-1-kafai@fb.com .../selftests/bpf/prog_tests/dummy_st_ops.c | 23 ++++++++++++++++++++++ .../selftests/bpf/progs/trace_dummy_st_ops.c | 21 ++++++++++++++++++++ 2 files changed, 44 insertions(+) commit 4a9c7bbe2ed4d2b240674b1fb606c41d3940c412 Author: Martin KaFai Lau Date: Tue Mar 29 18:14:56 2022 -0700 bpf: Resolve to prog->aux->dst_prog->type only for BPF_PROG_TYPE_EXT The commit 7e40781cc8b7 ("bpf: verifier: Use target program's type for access verifications") fixes the verifier checking for BPF_PROG_TYPE_EXT (extension) prog such that the verifier looks for things based on the target prog type that it is extending instead of the BPF_PROG_TYPE_EXT itself. The current resolve_prog_type() returns the target prog type. It checks for nullness on prog->aux->dst_prog. However, when loading a BPF_PROG_TYPE_TRACING prog and it is tracing another bpf prog instead of a kernel function, prog->aux->dst_prog is not NULL also. In this case, the verifier should still verify as the BPF_PROG_TYPE_TRACING type instead of the traced prog type in prog->aux->dst_prog->type. An oops has been reported when tracing a struct_ops prog. A NULL dereference happened in check_return_code() when accessing the prog->aux->attach_func_proto->type and prog->aux->attach_func_proto is NULL here because the traced struct_ops prog has the "unreliable" set. This patch is to change the resolve_prog_type() to only return the target prog type if the prog being verified is BPF_PROG_TYPE_EXT. Fixes: 7e40781cc8b7 ("bpf: verifier: Use target program's type for access verifications") Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220330011456.2984509-1-kafai@fb.com include/linux/bpf_verifier.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit a2fb49833cad07a53651c23dce508127085fae2d Author: Masami Hiramatsu Date: Thu Mar 31 10:11:17 2022 +0900 rethook: Fix to use WRITE_ONCE() for rethook:: Handler Since the function pointered by rethook::handler never be removed when the rethook is alive, it doesn't need to use rcu_assign_pointer() to update it. Just use WRITE_ONCE(). Reported-by: Alexei Starovoitov Signed-off-by: Masami Hiramatsu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164868907688.21983.1606862921419988152.stgit@devnote2 kernel/trace/rethook.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f9512d654f62604664251dedd437a22fe484974a Author: Randy Dunlap Date: Tue Mar 29 18:20:25 2022 -0700 net: sparx5: uses, depends on BRIDGE or !BRIDGE Fix build errors when BRIDGE=m and SPARX5_SWITCH=y: riscv64-linux-ld: drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.o: in function `.L305': sparx5_switchdev.c:(.text+0xdb0): undefined reference to `br_vlan_enabled' riscv64-linux-ld: drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.o: in function `.L283': sparx5_switchdev.c:(.text+0xee0): undefined reference to `br_vlan_enabled' Fixes: 3cfa11bac9bb ("net: sparx5: add the basic sparx5 driver") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Horatiu Vultur Cc: Lars Povlsen Cc: Steen Hegelund Cc: UNGLinuxDriver@microchip.com Cc: Paolo Abeni Link: https://lore.kernel.org/r/20220330012025.29560-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski drivers/net/ethernet/microchip/sparx5/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 1f686f2b3e17505b00c9e8ff88354debc843d94d Merge: c9ad266bbef5 77fc73ac89be Author: Jakub Kicinski Date: Wed Mar 30 19:14:11 2022 -0700 Merge branch 'wireguard-patches-for-5-18-rc1' Jason A. Donenfeld says: ==================== wireguard patches for 5.18-rc1 Here's a small set of fixes for the next net push: 1) Pipacs reported a CFI violation in a cleanup routine, which he triggered using grsec's RAP. I haven't seen reports of this yet from the Android/CFI world yet, but it's only a matter of time there. 2) A small rng cleanup to the self test harness to make it initialize faster on 5.18. 3) Wang reported and fixed a skb leak for CONFIG_IPV6=n. 4) After Wang's fix for the direct leak, I investigated how that code path even could be hit, and found that the netlink layer still handles IPv6 endpoints, when it probably shouldn't. ==================== Link: https://lore.kernel.org/r/20220330013127.426620-1-Jason@zx2c4.com Signed-off-by: Jakub Kicinski commit 77fc73ac89be96ec8f39e8efa53885caa7cb3645 Author: Jason A. Donenfeld Date: Tue Mar 29 21:31:27 2022 -0400 wireguard: socket: ignore v6 endpoints when ipv6 is disabled The previous commit fixed a memory leak on the send path in the event that IPv6 is disabled at compile time, but how did a packet even arrive there to begin with? It turns out we have previously allowed IPv6 endpoints even when IPv6 support is disabled at compile time. This is awkward and inconsistent. Instead, let's just ignore all things IPv6, the same way we do other malformed endpoints, in the case where IPv6 is disabled. Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski drivers/net/wireguard/socket.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit bbbf962d9460194993ee1943a793a0a0af4a7fbf Author: Wang Hai Date: Tue Mar 29 21:31:26 2022 -0400 wireguard: socket: free skb in send6 when ipv6 is disabled I got a memory leak report: unreferenced object 0xffff8881191fc040 (size 232): comm "kworker/u17:0", pid 23193, jiffies 4295238848 (age 3464.870s) 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: [] slab_post_alloc_hook+0x84/0x3b0 [] kmem_cache_alloc_node+0x167/0x340 [] __alloc_skb+0x1db/0x200 [] wg_socket_send_buffer_to_peer+0x3d/0xc0 [] wg_packet_send_handshake_initiation+0xfa/0x110 [] wg_packet_handshake_send_worker+0x21/0x30 [] process_one_work+0x2e8/0x770 [] worker_thread+0x4a/0x4b0 [] kthread+0x120/0x160 [] ret_from_fork+0x1f/0x30 In function wg_socket_send_buffer_as_reply_to_skb() or wg_socket_send_ buffer_to_peer(), the semantics of send6() is required to free skb. But when CONFIG_IPV6 is disable, kfree_skb() is missing. This patch adds it to fix this bug. Signed-off-by: Wang Hai Fixes: e7096c131e51 ("net: WireGuard secure network tunnel") Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski drivers/net/wireguard/socket.c | 1 + 1 file changed, 1 insertion(+) commit ca93ca23409b827b48a2fc0a692496d3f7b67944 Author: Jason A. Donenfeld Date: Tue Mar 29 21:31:25 2022 -0400 wireguard: selftests: simplify RNG seeding The seed_rng() function was written to work across lots of old kernels, back when WireGuard used a big compatibility layer. Now that things have evolved, we can vastly simplify this, by just marking the RNG as seeded. Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski tools/testing/selftests/wireguard/qemu/init.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) commit ec59f128a9bd4255798abb1e06ac3b442f46ef68 Author: Jason A. Donenfeld Date: Tue Mar 29 21:31:24 2022 -0400 wireguard: queueing: use CFI-safe ptr_ring cleanup function We make too nuanced use of ptr_ring to entirely move to the skb_array wrappers, but we at least should avoid the naughty function pointer cast when cleaning up skbs. Otherwise RAP/CFI will honk at us. This patch uses the __skb_array_destroy_skb wrapper for the cleanup, rather than directly providing kfree_skb, which is what other drivers in the same situation do too. Reported-by: PaX Team Fixes: 886fcee939ad ("wireguard: receive: use ring buffer for incoming handshakes") Signed-off-by: Jason A. Donenfeld Signed-off-by: Jakub Kicinski drivers/net/wireguard/queueing.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit bee7fbc38579ba86948689107518c855247d0b49 Merge: fdecfea09328 c5179ef1ca0c Author: Palmer Dabbelt Date: Wed Mar 30 16:17:54 2022 -0700 RISC-V CPU Idle Support This series adds RISC-V CPU Idle support using SBI HSM suspend function. The RISC-V SBI CPU idle driver added by this series is highly inspired from the ARM PSCI CPU idle driver. Special thanks Sandeep Tripathy for providing early feeback on SBI HSM support in all above projects (RISC-V SBI specification, OpenSBI, and Linux RISC-V). * palmer/riscv-idle: RISC-V: Enable RISC-V SBI CPU Idle driver for QEMU virt machine dt-bindings: Add common bindings for ARM and RISC-V idle states cpuidle: Add RISC-V SBI CPU idle driver cpuidle: Factor-out power domain related code from PSCI domain driver RISC-V: Add SBI HSM suspend related defines RISC-V: Add arch functions for non-retentive suspend entry/exit RISC-V: Rename relocate() and make it global RISC-V: Enable CPU_IDLE drivers commit 787af64d05cd528aac9ad16752d11bb1c6061bb9 Author: Zi Yan Date: Wed Mar 30 15:45:43 2022 -0700 mm: page_alloc: validate buddy before check its migratetype. Whenever a buddy page is found, page_is_buddy() should be called to check its validity. Add the missing check during pageblock merge check. Fixes: 1dd214b8f21c ("mm: page_alloc: avoid merging non-fallbackable pageblocks with others") Link: https://lore.kernel.org/all/20220330154208.71aca532@gandalf.local.home/ Reported-and-tested-by: Steven Rostedt Signed-off-by: Zi Yan Signed-off-by: Linus Torvalds mm/page_alloc.c | 3 +++ 1 file changed, 3 insertions(+) commit fdecfea09328b33fd08a4d418237cce9fd176d69 Author: Kees Cook Date: Wed Feb 23 22:04:11 2022 -0800 riscv: Rename "sp_in_global" to "current_stack_pointer" To follow the existing per-arch conventions, rename "sp_in_global" to "current_stack_pointer". This will let it be used in non-arch places (like HARDENED_USERCOPY). Signed-off-by: Kees Cook Signed-off-by: Palmer Dabbelt arch/riscv/Kconfig | 1 + arch/riscv/include/asm/current.h | 2 ++ arch/riscv/kernel/stacktrace.c | 6 ++---- 3 files changed, 5 insertions(+), 4 deletions(-) commit d5fd43bac8396c9b213faf14cd4560d73b30f618 Merge: 57c06b6e1e74 a9fe7fa7d874 Author: Linus Torvalds Date: Wed Mar 30 15:11:26 2022 -0700 Merge tag 'for-5.18/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull more parisc architecture updates from Helge Deller: - Revert a patch to the invalidate/flush vmap routines which broke kernel patching functions on older PA-RISC machines. - Fix the kernel patching code wrt locking and flushing. Works now on B160L machine as well. - Fix CPU IRQ affinity for LASI, WAX and Dino chips - Add CPU hotplug support - Detect the hppa-suse-linux-gcc compiler when cross-compiling * tag 'for-5.18/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fix patch code locking and flushing parisc: Find a new timesync master if current CPU is removed parisc: Move common_stext into .text section when CONFIG_HOTPLUG_CPU=y parisc: Rewrite arch_cpu_idle_dead() for CPU hotplugging parisc: Implement __cpu_die() and __cpu_disable() for CPU hotplugging parisc: Add PDC locking functions for rendezvous code parisc: Move disable_sr_hashing_asm() into .text section parisc: Move CPU startup-related functions into .text section parisc: Move store_cpu_topology() into text section parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY parisc: Ensure set_firmware_width() is called only once parisc: Add constants for control registers and clean up mfctl() parisc: Detect hppa-suse-linux-gcc compiler for cross-building parisc: Clean up cpu_check_affinity() and drop cpu_set_affinity_irq() parisc: Fix CPU affinity for Lasi, WAX and Dino chips Revert "parisc: Fix invalidate/flush vmap routines" commit 57c06b6e1e74b62eabaacacbe40bdb29c7e990eb Merge: 74164d284b29 dc0ce6cc4b13 Author: Linus Torvalds Date: Wed Mar 30 15:06:31 2022 -0700 Merge tag 'modules-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull module update from Luis Chamberlain: "There is only one patch which qualifies for modules for v5.18-rc1 and its a small fix from Dan Carpenter for lib/test_kmod module. The rest of the changes are too major and landed in modules-testing too late for inclusion. The good news is that most of the major changes for v5.19 is going to be tested very early through linux-next. This simple fix is all we have for modules for v5.18-rc1" * tag 'modules-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: lib/test: use after free in register_test_dev_kmod() commit 022bb490c79799229ef467d9ccc3e5966001b0ae Author: Jonathan Corbet Date: Fri Mar 25 15:51:35 2022 -0600 docs: Add a document on how to fix a messy diffstat A branch with merges in will sometimes create a diffstat containing a lot of unrelated work at "git request-pull" time. Create a document based on Linus's advice (found in the links below) and add it to the maintainer manual in the hope of saving some wear on Linus's keyboard going forward. Link: https://lore.kernel.org/lkml/CAHk-=wg3wXH2JNxkQi+eLZkpuxqV+wPiHhw_Jf7ViH33Sw7PHA@mail.gmail.com/ Link: https://lore.kernel.org/lkml/CAHk-=wgXbSa8yq8Dht8at+gxb_idnJ7X5qWZQWRBN4_CUPr=eQ@mail.gmail.com/ Acked-by: Borislav Petkov Reviewed-by: Akira Yokosawa Signed-off-by: Jonathan Corbet Documentation/maintainer/index.rst | 1 + Documentation/maintainer/messy-diffstat.rst | 96 +++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) commit be78837ca3c88eebd405103a7a2ce891c466b0db Author: Akira Yokosawa Date: Tue Mar 29 15:07:02 2022 +0900 docs: sphinx/requirements: Limit jinja2<3.1 jinja2 release 3.1.0 (March 24, 2022) broke Sphinx<4.0. This looks like the result of deprecating Python 3.6. It has been tested against Sphinx 4.3.0 and later. Setting an upper limit of <3.1 to junja2 can unbreak Sphinx<4.0 including Sphinx 2.4.4. Signed-off-by: Akira Yokosawa Cc: Mauro Carvalho Chehab Cc: stable@vger.kernel.org # v5.15+ Link: https://lore.kernel.org/r/7dbff8a0-f4ff-34a0-71c7-1987baf471f9@gmail.com Signed-off-by: Jonathan Corbet Documentation/sphinx/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) commit c9ad266bbef58dcbb6e74a6dbc5c4c2ed166e9b7 Author: Martin Habets Date: Tue Mar 29 17:07:49 2022 +0100 sfc: Avoid NULL pointer dereference on systems without numa awareness On such systems cpumask_of_node() returns NULL, which bitmap operations are not happy with. Fixes: c265b569a45f ("sfc: default config to 1 channel/core in local NUMA node only") Fixes: 09a99ab16c60 ("sfc: set affinity hints in local NUMA node only") Signed-off-by: Martin Habets Reviewed-by: Íñigo Huguet Link: https://lore.kernel.org/r/164857006953.8140.3265568858101821256.stgit@palantir17.mph.net Signed-off-by: Jakub Kicinski drivers/net/ethernet/sfc/efx_channels.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) commit 8f0588e80e33273c2fa219da4622affab0cdd22f Author: Jonathan Lemon Date: Tue Mar 29 09:03:54 2022 -0700 ptp: ocp: handle error from nvmem_device_find nvmem_device_find returns a valid pointer or IS_ERR(). Handle this properly. Fixes: 0cfcdd1ebcfe ("ptp: ocp: add nvmem interface for accessing eeprom") Signed-off-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220329160354.4035-1-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski drivers/ptp/ptp_ocp.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) commit 866b7a278cdb51eb158cd8513bc7438fc857804a Author: Zheng Yongjun Date: Tue Mar 29 09:08:00 2022 +0000 net: dsa: felix: fix possible NULL pointer dereference As the possible failure of the allocation, kzalloc() may return NULL pointer. Therefore, it should be better to check the 'sgi' in order to prevent the dereference of NULL pointer. Fixes: 23ae3a7877718 ("net: dsa: felix: add stream gate settings for psfp"). Signed-off-by: Zheng Yongjun Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220329090800.130106-1-zhengyongjun3@huawei.com Signed-off-by: Jakub Kicinski drivers/net/dsa/ocelot/felix_vsc9959.c | 4 ++++ 1 file changed, 4 insertions(+) commit f4329d1f848ac35757d9cc5487669d19dfc5979c Author: Lars Ellenberg Date: Wed Mar 30 20:55:51 2022 +0200 drbd: fix potential silent data corruption Scenario: --------- bio chain generated by blk_queue_split(). Some split bio fails and propagates its error status to the "parent" bio. But then the (last part of the) parent bio itself completes without error. We would clobber the already recorded error status with BLK_STS_OK, causing silent data corruption. Reproducer: ----------- How to trigger this in the real world within seconds: DRBD on top of degraded parity raid, small stripe_cache_size, large read_ahead setting. Drop page cache (sysctl vm.drop_caches=1, fadvise "DONTNEED", umount and mount again, "reboot"). Cause significant read ahead. Large read ahead request is split by blk_queue_split(). Parts of the read ahead that are already in the stripe cache, or find an available stripe cache to use, can be serviced. Parts of the read ahead that would need "too much work", would need to wait for a "stripe_head" to become available, are rejected immediately. For larger read ahead requests that are split in many pieces, it is very likely that some "splits" will be serviced, but then the stripe cache is exhausted/busy, and the remaining ones will be rejected. Signed-off-by: Lars Ellenberg Signed-off-by: Christoph Böhmwalder Cc: # 4.13.x Link: https://lore.kernel.org/r/20220330185551.3553196-1-christoph.boehmwalder@linbit.com Signed-off-by: Jens Axboe drivers/block/drbd/drbd_req.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit bf64f7fe151b9568443c9b0cf643b3542d36870c Author: Jackie Liu Date: Wed Mar 30 20:09:21 2022 +0800 MIPS: rb532: move GPIOD definition into C-files My kernel robot reports build error from drivers/iio/adc/da9150-gpadc.c, drivers/iio/adc/da9150-gpadc.c:254:13: error: ‘DA9150_GPADC_CHAN_0x08’ undeclared here (not in a function); did you mean ‘DA9150_GPADC_CHAN_TBAT’? 254 | .channel = DA9150_GPADC_CHAN_##_id, We define GPIOD in rb.h, in fact it should only be used in gpio.c, but it affects the driver da9150-gpadc.c which goes against the original intention of the design, just move it to its scope. Fixes: 1b432840d0a4 ("MIPS: RB532: GPIO register offsets are relative to GPIOBASE") Suggested-by: Jonathan Cameron Suggested-by: Andy Shevchenko Reported-by: k2ci Signed-off-by: Jackie Liu Signed-off-by: Thomas Bogendoerfer arch/mips/include/asm/mach-rc32434/rb.h | 9 --------- arch/mips/rb532/gpio.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) commit 34123208bbcc8c884a0489f543a23fe9eebb5514 Author: Xiaoke Wang Date: Fri Mar 25 19:49:41 2022 +0800 MIPS: lantiq: check 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 the return value of it to prevent potential wrong memory access or memory leak. Signed-off-by: Xiaoke Wang Signed-off-by: Thomas Bogendoerfer arch/mips/lantiq/falcon/sysctrl.c | 2 ++ arch/mips/lantiq/xway/gptu.c | 2 ++ arch/mips/lantiq/xway/sysctrl.c | 46 +++++++++++++++++++++++++-------------- 3 files changed, 34 insertions(+), 16 deletions(-) commit f93e2a100ee73a4b84d96d7d1881baaac36e586e Author: Xiaoke Wang Date: Fri Mar 25 18:57:18 2022 +0800 mips: sgi-ip22: add a check for the return 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 Signed-off-by: Thomas Bogendoerfer arch/mips/sgi-ip22/ip22-gio.c | 2 ++ 1 file changed, 2 insertions(+) commit 74164d284b2909de0ba13518cc063e9ea9334749 Merge: 4f3730117f16 ed14d36498c8 Author: Linus Torvalds Date: Wed Mar 30 11:00:33 2022 -0700 Merge tag 'pwm/for-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "This contains conversions of some more drivers to the atomic API as well as the addition of new chip support for some existing drivers. There are also various minor fixes and cleanups across the board, from drivers to device tree bindings" * tag 'pwm/for-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: (45 commits) pwm: rcar: Simplify multiplication/shift logic dt-bindings: pwm: renesas,tpu: Do not require pwm-cells twice dt-bindings: pwm: tiehrpwm: Do not require pwm-cells twice dt-bindings: pwm: tiecap: Do not require pwm-cells twice dt-bindings: pwm: samsung: Do not require pwm-cells twice dt-bindings: pwm: intel,keembay: Do not require pwm-cells twice dt-bindings: pwm: brcm,bcm7038: Do not require pwm-cells twice dt-bindings: pwm: toshiba,visconti: Include generic PWM schema dt-bindings: pwm: renesas,pwm: Include generic PWM schema dt-bindings: pwm: sifive: Include generic PWM schema dt-bindings: pwm: rockchip: Include generic PWM schema dt-bindings: pwm: mxs: Include generic PWM schema dt-bindings: pwm: iqs620a: Include generic PWM schema dt-bindings: pwm: intel,lgm: Include generic PWM schema dt-bindings: pwm: imx: Include generic PWM schema dt-bindings: pwm: allwinner,sun4i-a10: Include generic PWM schema pwm: pwm-mediatek: Beautify error messages text pwm: pwm-mediatek: Allocate clk_pwms with devm_kmalloc_array pwm: pwm-mediatek: Simplify error handling with dev_err_probe() pwm: brcmstb: Remove useless locking ... commit 4f3730117f162b17147795eaad44421cc65178c7 Merge: 2a44cdaa0183 aefe5fc3000a Author: Linus Torvalds Date: Wed Mar 30 10:58:28 2022 -0700 Merge tag 'regulator-fix-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "A couple of fixes for the rt4831 driver which fix features that didn't work due to incomplete description of the register configuration" * tag 'regulator-fix-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: rt4831: Add active_discharge_on to fix discharge API regulator: rt4831: Add bypass mask to fix set_bypass API work commit 2a44cdaa01837355b14b9221e87d75963846296c Merge: 2c54e1840634 b95044b38425 Author: Linus Torvalds Date: Wed Mar 30 10:54:49 2022 -0700 Merge tag 'dmaengine-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine updates from Vinod Koul: "This time we have bunch of driver updates and some new device support. New support: - Document RZ/V2L and RZ/G2UL dma binding - TI AM62x k3-udma and k3-psil support Updates: - Yaml conversion for Mediatek uart apdma schema - Removal of DMA-32 fallback configuration for various drivers - imx-sdma updates for channel restart" * tag 'dmaengine-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (23 commits) dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma dmaengine: dw-axi-dmac: cleanup comments dmaengine: fsl-dpaa2-qdma: Drop comma after SoC match table sentinel dt-bindings: dma: Convert mtk-uart-apdma to DT schema dmaengine: ppc4xx: Make use of the helper macro LIST_HEAD() dmaengine: idxd: Remove useless DMA-32 fallback configuration dmaengine: qcom_hidma: Remove useless DMA-32 fallback configuration dmaengine: sh: Kconfig: Add ARCH_R9A07G054 dependency for RZ_DMAC config option dmaengine: ti: k3-psil: Add AM62x PSIL and PDMA data dmaengine: ti: k3-udma: Add AM62x DMSS support dmaengine: ti: cleanup comments dmaengine: imx-sdma: clean up some inconsistent indenting dmaengine: Revert "dmaengine: shdma: Fix runtime PM imbalance on error" dmaengine: idxd: restore traffic class defaults after wq reset dmaengine: altera-msgdma: Remove useless DMA-32 fallback configuration dmaengine: stm32-dma: set dma_device max_sg_burst dmaengine: imx-sdma: fix cyclic buffer race condition dmaengine: imx-sdma: restart cyclic channel if needed dmaengine: iot: Remove useless DMA-32 fallback configuration dmaengine: ptdma: handle the cases based on DMA is complete ... commit 2c54e18406345b939d78a2cd755c44800bc31829 Merge: d177850d5d58 59983c74fc42 Author: Linus Torvalds Date: Wed Mar 30 10:50:48 2022 -0700 Merge tag 'rproc-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: "In the remoteproc core, it's now possible to mark the sysfs attributes read only on a per-instance basis, which is then used by the TI wkup M3 driver. Also, the rproc_shutdown() interface propagates errors to the caller and an array underflow is fixed in the debugfs interface. The rproc_da_to_va() API is moved to the public API to allow e.g. child rpmsg devices to acquire pointers to memory shared with the remote processor. The TI K3 R5F and DSP drivers gains support for attaching to instances already started by the bootloader, aka IPC-only mode. The Mediatek remoteproc driver gains support for the MT8186 SCP. The driver's probe function is reordered and moved to use the devres version of rproc_alloc() to save a few gotos. The driver's probe function is also transitioned to use dev_err_probe() to provide better debug support. Support for the Qualcomm SC7280 Wireless Subsystem (WPSS) is introduced. The Hexagon based remoteproc drivers gains support for voting for interconnect bandwidth during launch of the remote processor. The modem subsystem (MSS) driver gains support for probing the BAM-DMUX driver, which provides the network interface towards the modem on a set of older Qualcomm platforms. In addition a number a bug fixes are introduces in the Qualcomm drivers. Lastly Qualcomm ADSP DeviceTree binding is converted to YAML format, to allow validation of DeviceTree source files" * tag 'rproc-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (22 commits) remoteproc: qcom_q6v5_mss: Create platform device for BAM-DMUX remoteproc: qcom: q6v5_wpss: Add support for sc7280 WPSS dt-bindings: remoteproc: qcom: Add SC7280 WPSS support dt-bindings: remoteproc: qcom: adsp: Convert binding to YAML remoteproc: k3-dsp: Add support for IPC-only mode for all K3 DSPs remoteproc: k3-dsp: Refactor mbox request code in start remoteproc: k3-r5: Add support for IPC-only mode for all R5Fs remoteproc: k3-r5: Refactor mbox request code in start remoteproc: Change rproc_shutdown() to return a status remoteproc: qcom: q6v5: Add interconnect path proxy vote remoteproc: mediatek: Support mt8186 scp dt-bindings: remoteproc: mediatek: Add binding for mt8186 scp remoteproc: qcom_q6v5_mss: Fix some leaks in q6v5_alloc_memory_region remoteproc: qcom_wcnss: Add missing of_node_put() in wcnss_alloc_memory_region remoteproc: qcom: Fix missing of_node_put in adsp_alloc_memory_region remoteproc: move rproc_da_to_va declaration to remoteproc.h remoteproc: wkup_m3: Set sysfs_read_only flag remoteproc: Introduce sysfs_read_only flag remoteproc: Fix count check in rproc_coredump_write() remoteproc: mtk_scp: Use dev_err_probe() where possible ... commit d177850d5d58320a573dd69eb3f3564856a48a88 Merge: 3312db01db06 9a41358972eb Author: Linus Torvalds Date: Wed Mar 30 10:47:48 2022 -0700 Merge tag 'hwlock-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull hwspinlock updates from Bjorn Andersson: "This updates sprd and srm32 drivers to use struct_size() instead of their open-coded equivalents. It also cleans up the omap dt-bindings example" * tag 'hwlock-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: hwspinlock: sprd: Use struct_size() helper in devm_kzalloc() hwspinlock: stm32: Use struct_size() helper in devm_kzalloc() dt-bindings: hwlock: omap: Remove redundant binding example commit 3312db01db06ace51bb4934e9de64da62fac3f38 Merge: f18e345dd156 8109517b394e Author: Linus Torvalds Date: Wed Mar 30 10:43:19 2022 -0700 Merge tag 'rpmsg-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull rpmsg updates from Bjorn Andersson: "The major part of the rpmsg changes for v5.18 relates to improvements in the rpmsg char driver, which now allow automatically attaching to rpmsg channels as well as initiating new communication channels from the Linux side. The SMD driver is moved to arch_initcall with the purpose of registering root clocks earlier during boot. Also in the SMD driver, a workaround for the resource power management (RPM) channel is introduced to resolve an issue where both the RPM and Linux side waits for the other to close the communication established by the bootloader - this unblocks support for clocks and regulators on some older Qualcomm platforms" * tag 'rpmsg-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: ctrl: Introduce new RPMSG_CREATE/RELEASE_DEV_IOCTL controls rpmsg: char: Introduce the "rpmsg-raw" channel rpmsg: char: Add possibility to use default endpoint of the rpmsg device rpmsg: char: Refactor rpmsg_chrdev_eptdev_create function rpmsg: Update rpmsg_chrdev_register_device function rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl rpmsg: Create the rpmsg class in core instead of in rpmsg char rpmsg: char: Export eptdev create and destroy functions rpmsg: char: treat rpmsg_trysend() ENOMEM as EAGAIN rpmsg: qcom_smd: Fix redundant channel->registered assignment rpmsg: use struct_size over open coded arithmetic rpmsg: smd: allow opening rpm_requests even if already opened rpmsg: qcom_smd: Promote to arch_initcall commit f18e345dd156cc0fcf4a4911af2f959120613871 Merge: 95124339875c 6cbf8b38dfe3 Author: Linus Torvalds Date: Wed Mar 30 10:36:41 2022 -0700 Merge tag 'i3c/for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c updates from Alexandre Belloni: - support dynamic addition of i2c devices * tag 'i3c/for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: fix uninitialized variable use in i2c setup i3c: support dynamically added i2c devices i3c: remove i2c board info from i2c_dev_desc commit 95124339875c8d9c092eb2fa3993e4751e1be48d Merge: ee96dd9614f1 cf683abd3913 Author: Linus Torvalds Date: Wed Mar 30 10:11:04 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: "There's one large change in the core clk framework here. We change how clk_set_rate_range() works so that the frequency is re-evaulated each time the rate is changed. Previously we wouldn't let clk providers see a rate that was different if it was still within the range, which could be bad for power if the clk could run slower when a range expands. Now the clk provider can decide to do something differently when the constraints change. This broke Nvidia's clk driver so we had to wait for the fix for that to bake a little more in -next. The rate range patch series also introduced a kunit suite for the clk framework that we're going to extend in the next release. It already made it easy to find corner cases in the rate range patches so I'm excited to see it cover more clk code and increase our confidence in core framework patches in the future. I also added a kunit test for the basic clk gate code and that work will continue to cover more basic clk types: muxes, dividers, etc. Beyond the core code we have the usual set of clk driver updates and additions. Qualcomm again dominates the diffstat here with lots more SoCs being supported and i.MX follows afer that with a similar number of SoCs gaining clk drivers. Beyond those large additions there's drivers being modernized to use clk_parent_data so we can move away from global string names for all the clks in an SoC. Finally there's lots of little fixes all over the clk drivers for typos, warnings, and missing clks that aren't critical and get batched up waiting for the next merge window to open. Nothing super big stands out in the driver pile. Full details are below. Core: - Make clk_set_rate_range() re-evaluate the limits each time - Introduce various clk_set_rate_range() tests - Add clk_drop_range() to drop a previously set range New Drivers: - i.MXRT1050 clock driver and bindings - i.MX8DXL clock driver and bindings - i.MX93 clock driver and bindings - NCO blocks on Apple SoCs - Audio clks on StarFive JH7100 RISC-V SoC - Add support for the new Renesas RZ/V2L SoC - Qualcomm SDX65 A7 PLL - Qualcomm SM6350 GPU clks - Qualcomm SM6125, SM6350, QCS2290 display clks - Qualcomm MSM8226 multimedia clks Updates: - Kunit tests for clk-gate implementation - Terminate arrays with sentinels and make that clearer - Cleanup SPDX tags - Fix typos in comments - Mark mux table as const in clk-mux - Make the all_lists array const - Convert Cirrus Logic CS2000P driver to regmap, yamlify DT binding and add support for dynamic mode - Clock configuration on Microchip PolarFire SoCs - Free allocations on probe error in Mediatek clk driver - Modernize Mediatek clk driver by consolidating code - Add watchdog (WDT), I2C, and pin function controller (PFC) clocks on Renesas R-Car S4-8 - Improve the clocks for the Rockchip rk3568 display outputs (parenting, pll-rates) - Use of_device_get_match_data() instead of open-coding on Rockchip rk3568 - Reintroduce the expected fractional-divider behaviour that disappeared with the addition of CLK_FRAC_DIVIDER_POWER_OF_TWO_PS - Remove SYS PLL 1/2 clock gates for i.MX8M* - Remove AUDIO MCLK ROOT from i.MX7D - Add fracn gppll clock type used by i.MX93 - Add new composite clock for i.MX93 - Add missing media mipi phy ref clock for i.MX8MP - Fix off by one in imx_lpcg_parse_clks_from_dt() - Rework for the imx pll14xx - sama7g5: One low priority fix for GCLK of PDMC - Add DMA engine (SYS-DMAC) clocks on Renesas R-Car S4-8 - Add MOST (MediaLB I/F) clocks on Renesas R-Car E3 and D3 - Add CAN-FD clocks on Renesas R-Car V3U - Qualcomm SC8280XP RPMCC - Add some missing clks on Qualcomm MSM8992/MSM8994/MSM8998 SoCs - Rework Qualcomm GCC bindings and convert SDM845 camera bindig to YAML - Convert various Qualcomm drivers to use clk_parent_data - Remove test clocks from various Qualcomm drivers - Crypto engine clks on Qualcomm IPQ806x + more freqs for SDCC/NSS - Qualcomm SM8150 EMAC, PCIe, UFS GDSCs - Better pixel clk frequency support on Qualcomm RCG2 clks" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (227 commits) clk: zynq: Update the parameters to zynq_clk_register_periph_clk clk: zynq: trivial warning fix clk: Drop the rate range on clk_put() clk: test: Test clk_set_rate_range on orphan mux clk: Initialize orphan req_rate dt-bindings: clock: drop useless consumer example dt-bindings: clock: renesas: Make example 'clocks' parsable clk: qcom: gcc-msm8994: Fix gpll4 width dt-bindings: clock: fix dt_binding_check error for qcom,gcc-other.yaml clk: rs9: Add Renesas 9-series PCIe clock generator driver clk: fixed-factor: Introduce devm_clk_hw_register_fixed_factor_index() clk: visconti: prevent array overflow in visconti_clk_register_gates() dt-bindings: clk: rs9: Add Renesas 9-series I2C PCIe clock generator clk: sifive: Move all stuff into SoCs header files from C files clk: sifive: Add SoCs prefix in each SoCs-dependent data riscv: dts: Change the macro name of prci in each device node dt-bindings: change the macro name of prci in header files and example clk: sifive: duplicate the macro definitions for the time being clk: qcom: sm6125-gcc: fix typos in comments clk: ti: clkctrl: fix typos in comments ... commit ee96dd9614f1c139e719dd2f296acbed7f1ab4b8 Merge: d888c83fcec7 ada8d8d337ee Author: Linus Torvalds Date: Wed Mar 30 10:04:11 2022 -0700 Merge tag 'libnvdimm-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: "The update for this cycle includes the deprecation of block-aperture mode and a new perf events interface for the papr_scm nvdimm driver. The perf events approach was acked by PeterZ. - Add perf support for nvdimm events, initially only for 'papr_scm' devices. - Deprecate the 'block aperture' support in libnvdimm, it only ever existed in the specification, not in shipping product" * tag 'libnvdimm-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: nvdimm/blk: Fix title level MAINTAINERS: remove section LIBNVDIMM BLK: MMIO-APERTURE DRIVER powerpc/papr_scm: Fix build failure when drivers/nvdimm: Fix build failure when CONFIG_PERF_EVENTS is not set nvdimm/region: Delete nd_blk_region infrastructure ACPI: NFIT: Remove block aperture support nvdimm/namespace: Delete nd_namespace_blk nvdimm/namespace: Delete blk namespace consideration in shared paths nvdimm/blk: Delete the block-aperture window driver nvdimm/region: Fix default alignment for small regions docs: ABI: sysfs-bus-nvdimm: Document sysfs event format entries for nvdimm pmu powerpc/papr_scm: Add perf interface support drivers/nvdimm: Add perf interface to expose nvdimm performance stats drivers/nvdimm: Add nvdimm pmu structure commit 49df34221804cfd6384135b28b03c9461a31d024 Author: Guo Xuenan Date: Wed Mar 30 09:49:28 2022 -0700 fs: fix an infinite loop in iomap_fiemap when get fiemap starting from MAX_LFS_FILESIZE, (maxbytes - *len) < start will always true , then *len set zero. because of start offset is beyond file size, for erofs filesystem it will always return iomap.length with zero,iomap iterate will enter infinite loop. it is necessary cover this corner case to avoid this situation. ------------[ cut here ]------------ WARNING: CPU: 7 PID: 905 at fs/iomap/iter.c:35 iomap_iter+0x97f/0xc70 Modules linked in: xfs erofs CPU: 7 PID: 905 Comm: iomap Tainted: G W 5.17.0-rc8 #27 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 RIP: 0010:iomap_iter+0x97f/0xc70 Code: 85 a1 fc ff ff e8 71 be 9c ff 0f 1f 44 00 00 e9 92 fc ff ff e8 62 be 9c ff 0f 0b b8 fb ff ff ff e9 fc f8 ff ff e8 51 be 9c ff <0f> 0b e9 2b fc ff ff e8 45 be 9c ff 0f 0b e9 e1 fb ff ff e8 39 be RSP: 0018:ffff888060a37ab0 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff888060a37bb0 RCX: 0000000000000000 RDX: ffff88807e19a900 RSI: ffffffff81a7da7f RDI: ffff888060a37be0 RBP: 7fffffffffffffff R08: 0000000000000000 R09: ffff888060a37c20 R10: ffff888060a37c67 R11: ffffed100c146f8c R12: 7fffffffffffffff R13: 0000000000000000 R14: ffff888060a37bd8 R15: ffff888060a37c20 FS: 00007fd3cca01540(0000) GS:ffff888108780000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020010820 CR3: 0000000054b92000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: iomap_fiemap+0x1c9/0x2f0 erofs_fiemap+0x64/0x90 [erofs] do_vfs_ioctl+0x40d/0x12e0 __x64_sys_ioctl+0xaa/0x1c0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae ---[ end trace 0000000000000000 ]--- watchdog: BUG: soft lockup - CPU#7 stuck for 26s! [iomap:905] Reported-by: Hulk Robot Signed-off-by: Guo Xuenan Reviewed-by: Christoph Hellwig [djwong: fix some typos] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f941c51eeac7ebe0f8ec30943bf78e7f60aad039 Author: Carlos Llamas Date: Tue Mar 29 20:18:15 2022 +0000 loop: fix ioctl calls using compat_loop_info Support for cryptoloop was deleted in commit 47e9624616c8 ("block: remove support for cryptoloop and the xor transfer"), making the usage of loop_info->lo_encrypt_type obsolete. However, this member was also removed from the compat_loop_info definition and this breaks userspace ioctl calls for 32-bit binaries and CONFIG_COMPAT=y. This patch restores the compat_loop_info->lo_encrypt_type member and marks it obsolete as well as in the uapi header definitions. Fixes: 47e9624616c8 ("block: remove support for cryptoloop and the xor transfer") Signed-off-by: Carlos Llamas Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220329201815.1347500-1-cmllamas@google.com Signed-off-by: Jens Axboe drivers/block/loop.c | 1 + include/uapi/linux/loop.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) commit 05b0ebd06ae6b9e72b747362e52abb400a175080 Author: Christoph Hellwig Date: Wed Mar 30 07:24:21 2022 +0200 PCI/doc: cleanup references to the legacy PCI DMA API Mention the regular DMA API calls instead of the now removed PCI DMA API. Signed-off-by: Christoph Hellwig Acked-by: Bjorn Helgaas Documentation/PCI/pci.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit edf5f0548fbb77e20b898460dc25281b0f4d974d Author: Jakob Koschel Date: Thu Mar 24 08:13:01 2022 +0100 ksmbd: replace usage of found with dedicated list iterator variable To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable instead of a found boolean [1]. This removes the need to use a found variable and simply checking if the variable was set, can determine if the break/goto was hit. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Signed-off-by: Jakob Koschel Reviewed-by: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Steve French fs/ksmbd/smb2pdu.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) commit 56b401fb0c506120f25c1b4feeb96d9117efe171 Author: Christophe JAILLET Date: Wed Mar 23 07:32:05 2022 +0100 ksmbd: Remove a redundant zeroing of memory fill_transform_hdr() has only one caller that already clears tr_buf (it is kzalloc'ed). So there is no need to clear it another time here. Remove the superfluous memset() and add a comment to remind that the caller must clear the buffer. Signed-off-by: Christophe JAILLET Acked-by: Hyunchul Lee Acked-by: Namjae Jeon Signed-off-by: Steve French fs/ksmbd/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 99e2aee3f925aab540b1675c8a8beb951e764f9e Author: Namjae Jeon Date: Tue Mar 22 09:48:40 2022 +0900 MAINTAINERS: ksmbd: switch Sergey to reviewer Sergey don't have the time to work ksmbd. He will continue to review ksmbd works at free time. This patch switches him from maintainer to reviewer. Cc: Sergey Senozhatsky Signed-off-by: Namjae Jeon Signed-off-by: Steve French MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit adc32821409aef8d7f6d868c20a96f4901f48705 Author: Steve French Date: Mon Mar 14 22:50:49 2022 -0500 ksmbd: shorten experimental warning on loading the module ksmbd is continuing to improve. Shorten the warning message logged the first time it is loaded to: "The ksmbd server is experimental" Acked-by: Namjae Jeon Signed-off-by: Steve French fs/ksmbd/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bc55cfd5718c7c23e5524582e9fa70b4d10f2433 Author: Takashi Iwai Date: Wed Mar 30 14:09:03 2022 +0200 ALSA: pcm: Fix potential AB/BA lock with buffer_mutex and mmap_lock syzbot caught a potential deadlock between the PCM runtime->buffer_mutex and the mm->mmap_lock. It was brought by the recent fix to cover the racy read/write and other ioctls, and in that commit, I overlooked a (hopefully only) corner case that may take the revert lock, namely, the OSS mmap. The OSS mmap operation exceptionally allows to re-configure the parameters inside the OSS mmap syscall, where mm->mmap_mutex is already held. Meanwhile, the copy_from/to_user calls at read/write operations also take the mm->mmap_lock internally, hence it may lead to a AB/BA deadlock. A similar problem was already seen in the past and we fixed it with a refcount (in commit b248371628aa). The former fix covered only the call paths with OSS read/write and OSS ioctls, while we need to cover the concurrent access via both ALSA and OSS APIs now. This patch addresses the problem above by replacing the buffer_mutex lock in the read/write operations with a refcount similar as we've used for OSS. The new field, runtime->buffer_accessing, keeps the number of concurrent read/write operations. Unlike the former buffer_mutex protection, this protects only around the copy_from/to_user() calls; the other codes are basically protected by the PCM stream lock. The refcount can be a negative, meaning blocked by the ioctls. If a negative value is seen, the read/write aborts with -EBUSY. In the ioctl side, OTOH, they check this refcount, too, and set to a negative value for blocking unless it's already being accessed. Reported-by: syzbot+6e5c88838328e99c7e1c@syzkaller.appspotmail.com Fixes: dca947d4d26d ("ALSA: pcm: Fix races among concurrent read/write and buffer changes") Cc: Link: https://lore.kernel.org/r/000000000000381a0d05db622a81@google.com Link: https://lore.kernel.org/r/20220330120903.4738-1-tiwai@suse.de Signed-off-by: Takashi Iwai include/sound/pcm.h | 1 + sound/core/pcm.c | 1 + sound/core/pcm_lib.c | 9 +++++---- sound/core/pcm_native.c | 39 ++++++++++++++++++++++++++++++++------- 4 files changed, 39 insertions(+), 11 deletions(-) commit 2609f635a20d3691e7b5725edc3bdadb7bedf8fb Author: Haowen Bai Date: Wed Mar 30 09:59:48 2022 +0800 selftests/bpf: Fix warning comparing pointer to 0 Avoid pointer type value compared with 0 to make code clear. Reported by coccicheck: tools/testing/selftests/bpf/progs/map_ptr_kern.c:370:21-22: WARNING comparing pointer to 0 tools/testing/selftests/bpf/progs/map_ptr_kern.c:397:21-22: WARNING comparing pointer to 0 Signed-off-by: Haowen Bai Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/1648605588-19269-1-git-send-email-baihaowen@meizu.com tools/testing/selftests/bpf/progs/map_ptr_kern.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit d31e0386a2f122b40b605eb0120a2fbcfca77868 Author: Jiri Olsa Date: Wed Mar 30 13:05:10 2022 +0200 bpf: Fix sparse warnings in kprobe_multi_resolve_syms Adding missing __user tags to fix sparse warnings: kernel/trace/bpf_trace.c:2370:34: warning: incorrect type in argument 2 (different address spaces) kernel/trace/bpf_trace.c:2370:34: expected void const [noderef] __user *from kernel/trace/bpf_trace.c:2370:34: got void const *usyms kernel/trace/bpf_trace.c:2376:51: warning: incorrect type in argument 2 (different address spaces) kernel/trace/bpf_trace.c:2376:51: expected char const [noderef] __user *src kernel/trace/bpf_trace.c:2376:51: got char const * kernel/trace/bpf_trace.c:2443:49: warning: incorrect type in argument 1 (different address spaces) kernel/trace/bpf_trace.c:2443:49: expected void const *usyms kernel/trace/bpf_trace.c:2443:49: got void [noderef] __user *[assigned] usyms Fixes: 0dcac2725406 ("bpf: Add multi kprobe link") Reported-by: Alexei Starovoitov Reported-by: Jakub Kicinski Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220330110510.398558-1-jolsa@kernel.org kernel/trace/bpf_trace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 522574fd7864e091d473765102e866414979b2ab Author: Delyan Kratunov Date: Mon Mar 21 23:29:18 2022 +0000 bpftool: Explicit errno handling in skeletons Andrii noticed that since f97b8b9bd630 ("bpftool: Fix a bug in subskeleton code generation") the subskeleton code allows bpf_object__destroy_subskeleton to overwrite the errno that subskeleton__open would return with. While this is not currently an issue, let's make it future-proof. This patch explicitly tracks err in subskeleton__open and skeleton__create (i.e. calloc failure is explicitly ENOMEM) and ensures that errno is -err on the error return path. The skeleton code had to be changed since maps and progs codegen is shared with subskeletons. Fixes: f97b8b9bd630 ("bpftool: Fix a bug in subskeleton code generation") Signed-off-by: Delyan Kratunov Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/3b6bfbb770c79ae64d8de26c1c1bd9d53a4b85f8.camel@fb.com tools/bpf/bpftool/gen.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) commit 21b5954d61fd467d0c4e25583845ba0621dfb4fb Merge: 6ddc2f749621 664d66dc0a64 Author: Takashi Iwai Date: Wed Mar 30 14:04:22 2022 +0200 Merge tag 'asoc-fix-v5.18' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.18 A few fixes that came in during the merge window, all fairly routine. commit d6d6d50f1e801a790a242c80eeda261e36c43b7b Author: Thomas Gleixner Date: Mon Mar 28 20:43:21 2022 +0200 x86/fpu/xstate: Consolidate size calculations Use the offset calculation to do the size calculation which avoids yet another series of CPUID instructions for each invocation. [ Fix the FP/SSE only case which missed to take the xstate header into account, as Reported-by: kernel test robot ] Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/87o81pgbp2.ffs@tglx arch/x86/kernel/fpu/xstate.c | 49 ++++++++------------------------------------ 1 file changed, 8 insertions(+), 41 deletions(-) commit 781c64bfcb735960717d1cb45428047ff6a5030c Author: Thomas Gleixner Date: Thu Mar 24 14:47:14 2022 +0100 x86/fpu/xstate: Handle supervisor states in XSTATE permissions The size calculation in __xstate_request_perm() fails to take supervisor states into account because the permission bitmap is only relevant for user states. Up to 5.17 this does not matter because there are no supervisor states supported, but the (re-)enabling of ENQCMD makes them available. Fixes: 7c1ef59145f1 ("x86/cpufeatures: Re-enable ENQCMD") Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220324134623.681768598@linutronix.de arch/x86/kernel/fpu/xstate.c | 3 +++ 1 file changed, 3 insertions(+) commit 7aa5128b5fea26cf224766303ea3b8df343f9a87 Author: Thomas Gleixner Date: Thu Mar 24 14:47:13 2022 +0100 x86/fpu/xsave: Handle compacted offsets correctly with supervisor states So far the cached fixed compacted offsets worked, but with (re-)enabling of ENQCMD this does no longer work with KVM fpstate. KVM does not have supervisor features enabled for the guest FPU, which means that KVM has then a different XSAVE area layout than the host FPU state. This in turn breaks the copy from/to UABI functions when invoked for a guest state. Remove the pre-calculated compacted offsets and calculate the offset of each component at runtime based on the XCOMP_BV field in the XSAVE header. The runtime overhead is not interesting because these copy from/to UABI functions are not used in critical fast paths. KVM uses them to save and restore FPU state during migration. The host uses them for ptrace and for the slow path of 32bit signal handling. Fixes: 7c1ef59145f1 ("x86/cpufeatures: Re-enable ENQCMD") Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220324134623.627636809@linutronix.de arch/x86/kernel/fpu/xstate.c | 86 +++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 45 deletions(-) commit 6afbb58cc2251c1d83472ca3005638206e73b6b8 Author: Thomas Gleixner Date: Thu Mar 24 14:47:12 2022 +0100 x86/fpu: Cache xfeature flags from CPUID In preparation for runtime calculation of XSAVE offsets cache the feature flags for each XSTATE component during feature enumeration via CPUID(0xD). EDX has two relevant bits: 0 Supervisor component 1 Feature storage must be 64 byte aligned These bits are currently only evaluated during init, but the alignment bit must be cached to make runtime calculation of XSAVE offsets efficient. Cache the full EDX content and use it for the existing alignment and supervisor checks. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220324134623.573656209@linutronix.de arch/x86/kernel/fpu/xstate.c | 49 ++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 36 deletions(-) commit 35a77d4503d9d9d0e19e3a2a0d3fc9ab09fb6857 Author: Thomas Gleixner Date: Thu Mar 24 14:47:11 2022 +0100 x86/fpu/xsave: Initialize offset/size cache early Reading XSTATE feature information from CPUID over and over does not make sense. The information has to be cached anyway, so it can be done early. Prepare for runtime calculation of XSTATE offsets and allow consolidation of the size calculation functions in a later step. Rename the function while at it as it does not setup any features. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220324134623.519411939@linutronix.de arch/x86/kernel/fpu/xstate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit d47f71f6de7970d504748d1a60a11c51af5bce47 Author: Thomas Gleixner Date: Thu Mar 24 14:47:09 2022 +0100 x86/fpu: Remove unused supervisor only offsets No users. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220324134623.465066249@linutronix.de arch/x86/kernel/fpu/xstate.c | 30 ------------------------------ 1 file changed, 30 deletions(-) commit 6ddc2f749621d5d45ca03edc9f0616bcda136d29 Author: Mohan Kumar Date: Tue Mar 29 21:29:40 2022 +0530 ALSA: hda: Avoid unsol event during RPM suspending There is a corner case with unsol event handling during codec runtime suspending state. When the codec runtime suspend call initiated, the codec->in_pm atomic variable would be 0, currently the codec runtime suspend function calls snd_hdac_enter_pm() which will just increments the codec->in_pm atomic variable. Consider unsol event happened just after this step and before snd_hdac_leave_pm() in the codec runtime suspend function. The snd_hdac_power_up_pm() in the unsol event flow in hdmi_present_sense_via_verbs() function would just increment the codec->in_pm atomic variable without calling pm_runtime_get_sync function. As codec runtime suspend flow is already in progress and in parallel unsol event is also accessing the codec verbs, as soon as codec suspend flow completes and clocks are switched off before completing the unsol event handling as both functions doesn't wait for each other. This will result in below errors [ 589.428020] tegra-hda 3510000.hda: azx_get_response timeout, switching to polling mode: last cmd=0x505f2f57 [ 589.428344] tegra-hda 3510000.hda: spurious response 0x80000074:0x5, last cmd=0x505f2f57 [ 589.428547] tegra-hda 3510000.hda: spurious response 0x80000065:0x5, last cmd=0x505f2f57 To avoid this, the unsol event flow should not perform any codec verb related operations during RPM_SUSPENDING state. Signed-off-by: Mohan Kumar Cc: Link: https://lore.kernel.org/r/20220329155940.26331-1-mkumard@nvidia.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_hdmi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 1c80cf031e0204fde471558ee40183695773ce13 Author: Jason Wang Date: Tue Mar 29 12:21:08 2022 +0800 vdpa: mlx5: synchronize driver status with CVQ Currently, CVQ doesn't have any synchronization with the driver status. Then CVQ emulation code run in the middle of: 1) device reset 2) device status changed 3) map updating The will lead several unexpected issue like trying to execute CVQ command after the driver has been teared down. Fixing this by using reslock to synchronize CVQ emulation code with the driver status changing: - protect the whole device reset, status changing and set_map() updating with reslock - protect the CVQ handler with the reslock and check VIRTIO_CONFIG_S_DRIVER_OK in the CVQ handler This will guarantee that: 1) CVQ handler won't work if VIRTIO_CONFIG_S_DRIVER_OK is not set 2) CVQ handler will see a consistent state of the driver instead of the partial one when it is running in the middle of the teardown_driver() or setup_driver(). Cc: 5262912ef3cfc ("vdpa/mlx5: Add support for control VQ and MAC setting") Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220329042109.4029-2-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin Acked-by: Eli Cohen drivers/vdpa/mlx5/net/mlx5_vnet.c | 51 ++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 14 deletions(-) commit 55ebf0d60e3cc6c9e8593399e185842c00e12f36 Author: Jason Wang Date: Tue Mar 29 12:21:07 2022 +0800 vdpa: mlx5: prevent cvq work from hogging CPU A userspace triggerable infinite loop could happen in mlx5_cvq_kick_handler() if userspace keeps sending a huge amount of cvq requests. Fixing this by introducing a quota and re-queue the work if we're out of the budget (currently the implicit budget is one) . While at it, using a per device work struct to avoid on demand memory allocation for cvq. Fixes: 5262912ef3cfc ("vdpa/mlx5: Add support for control VQ and MAC setting") Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220329042109.4029-1-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin Acked-by: Eli Cohen drivers/vdpa/mlx5/net/mlx5_vnet.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) commit c18c86808b78c4c2dc69f27f37c57abab14ee387 Author: Michael S. Tsirkin Date: Wed Mar 30 02:22:17 2022 -0400 Revert "virtio_config: introduce a new .enable_cbs method" This reverts commit d50497eb4e554e1f0351e1836ee7241c059592e6. The new callback ended up not being used, and it's asymmetrical: just enable, no disable. Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang include/linux/virtio_config.h | 6 ------ 1 file changed, 6 deletions(-) commit 7414539c5f2e43bad67ae88a3612455d01583429 Author: Michael S. Tsirkin Date: Wed Mar 30 02:19:16 2022 -0400 Revert "virtio: use virtio_device_ready() in virtio_device_restore()" This reverts commit 8d65bc9a5be3f23c5e2ab36b6b8ef40095165b18. We reverted the problematic changes, no more need for work arounds on restore. Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang drivers/virtio/virtio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit f30741cded62f87bb4b1cc58bc627f076abcaba8 Author: Kai-Heng Feng Date: Wed Mar 30 14:13:33 2022 +0800 ALSA: hda/realtek: Fix audio regression on Mi Notebook Pro 2020 Commit 5aec98913095 ("ALSA: hda/realtek - ALC236 headset MIC recording issue") is to solve recording issue met on AL236, by matching codec variant ALC269_TYPE_ALC257 and ALC269_TYPE_ALC256. This match can be too broad and Mi Notebook Pro 2020 is broken by the patch. Instead, use codec ID to be narrow down the scope, in order to make ALC256 unaffected. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215484 Fixes: 5aec98913095 ("ALSA: hda/realtek - ALC236 headset MIC recording issue") Reported-by: kernel test robot Reported-by: Dan Carpenter Cc: Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20220330061335.1015533-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 67bae5f28c895f8737a1974c3f31cf12b9170b14 Author: Paul Kocialkowski Date: Tue Mar 29 15:27:32 2022 +0200 drm: of: Properly try all possible cases for bridge/panel detection While bridge/panel detection was initially relying on the usual port/ports-based of graph detection, it was recently changed to perform the lookup on any child node that is not port/ports instead when such a node is available, with no fallback on the usual way. This results in breaking detection when a child node is present but does not contain any panel or bridge node, even when the usual port/ports-based of graph is there. In order to support both situations properly, this commit reworks the logic to try both options and not just one of the two: it will only return -EPROBE_DEFER when both have failed. Signed-off-by: Paul Kocialkowski Fixes: 80253168dbfd ("drm: of: Lookup if child node has panel or bridge") Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220329132732.628474-1-paul.kocialkowski@bootlin.com drivers/gpu/drm/drm_of.c | 99 ++++++++++++++++++++++++------------------------ 1 file changed, 50 insertions(+), 49 deletions(-) commit d888c83fcec75194a8a48ccd283953bdba7b2550 Author: Linus Torvalds Date: Tue Mar 29 23:29:18 2022 -0700 fs: fix fd table size alignment properly Jason Donenfeld reports that my commit 1c24a186398f ("fs: fd tables have to be multiples of BITS_PER_LONG") doesn't work, and the reason is an embarrassing brown-paper-bag bug. Yes, we want to align the number of fds to BITS_PER_LONG, and yes, the reason they might not be aligned is because the incoming 'max_fd' argument might not be aligned. But aligining the argument - while simple - will cause a "infinitely big" maxfd (eg NR_OPEN_MAX) to just overflow to zero. Which most definitely isn't what we want either. The obvious fix was always just to do the alignment last, but I had moved it earlier just to make the patch smaller and the code look simpler. Duh. It certainly made _me_ look simple. Fixes: 1c24a186398f ("fs: fd tables have to be multiples of BITS_PER_LONG") Reported-and-tested-by: Jason A. Donenfeld Cc: Fedor Pchelkin Cc: Alexey Khoroshilov Cc: Christian Brauner Signed-off-by: Linus Torvalds fs/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 7968778914e53788a01c2dee2692cab157de9ac0 Author: Christophe JAILLET Date: Wed Mar 9 20:50:39 2022 +0100 PCI: Remove the deprecated "pci-dma-compat.h" API Now that all usages of the functions defined in "pci-dma-compat.h" have been removed, it is time to remove this file as well. In order not to break builds, move the "#include " that was in "pci-dma-compat.h" into "include/linux/pci.h" Signed-off-by: Christophe JAILLET Acked-by: Bjorn Helgaas Signed-off-by: Christoph Hellwig include/linux/pci-dma-compat.h | 129 ----------------------------------------- include/linux/pci.h | 3 +- 2 files changed, 1 insertion(+), 131 deletions(-) commit aa8e73eed7d3084c18dd16d195748661c7e881b5 Author: Peter Zijlstra Date: Fri Mar 25 13:30:47 2022 +0100 crypto: x86/sm3 - Fixup SLS This missed the big asm update due to being merged through the crypto tree. Fixes: f94909ceb1ed ("x86: Prepare asm files for straight-line-speculation") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Herbert Xu arch/x86/crypto/sm3-avx-asm_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a6b758b0420bda28995ea6939ca0808fcec68be4 Author: Colin Ian King Date: Sat Mar 19 23:14:45 2022 +0000 scsi: bnx2i: Fix spelling mistake "mis-match" -> "mismatch" There are a few spelling mistakes in some error messages. Fix them. Link: https://lore.kernel.org/r/20220319231445.21696-1-colin.i.king@gmail.com Acked-by: Manish Rangankar Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen drivers/scsi/bnx2i/bnx2i_hwi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 7ff897b2a59558d919b72f1aef58b1aa63d19c61 Author: Colin Ian King Date: Sat Mar 19 23:11:22 2022 +0000 scsi: bnx2fc: Fix spelling mistake "mis-match" -> "mismatch" There are a few spelling mistakes in some error messages. Fix them. Link: https://lore.kernel.org/r/20220319231122.21476-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen drivers/scsi/bnx2fc/bnx2fc_hwi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 16ed828b872d12ccba8f07bcc446ae89ba662f9c Author: Christophe JAILLET Date: Sat Mar 19 08:01:24 2022 +0100 scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one() The error handling path of the probe releases a resource that is not freed in the remove function. In some cases, a ioremap() must be undone. Add the missing iounmap() call in the remove function. Link: https://lore.kernel.org/r/247066a3104d25f9a05de8b3270fc3c848763bcc.1647673264.git.christophe.jaillet@wanadoo.fr Fixes: 45804fbb00ee ("[SCSI] 53c700: Amiga Zorro NCR53c710 SCSI") Reviewed-by: Geert Uytterhoeven Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen drivers/scsi/zorro7xx.c | 2 ++ 1 file changed, 2 insertions(+) commit 37a9bd7090cdf6657ced3f693897819a66ee8d52 Author: Tom Rix Date: Tue Mar 22 07:46:48 2022 -0700 scsi: aic7xxx: Use standard PCI subsystem, subdevice defines Common defines should be used over custom defines. Change and remove these defines: - PCIR_SUBVEND_0 to PCI_SUBSYSTEM_VENDOR_ID - PCIR_SUBDEV_0 to PCI_SUBSYSTEM_ID Link: https://lore.kernel.org/r/20220322144648.2467777-1-trix@redhat.com Signed-off-by: Tom Rix Signed-off-by: Martin K. Petersen drivers/scsi/aic7xxx/aic79xx_osm.h | 2 -- drivers/scsi/aic7xxx/aic79xx_pci.c | 6 +++--- drivers/scsi/aic7xxx/aic7xxx_osm.h | 2 -- drivers/scsi/aic7xxx/aic7xxx_pci.c | 4 ++-- 4 files changed, 5 insertions(+), 9 deletions(-) commit 5ca0faf9c292029ec6f9edbfe7b42e97dcb87dca Author: Krzysztof Kozlowski Date: Mon Mar 21 16:18:53 2022 +0100 scsi: ufs: qcom: Drop custom Android boot parameters The QCOM UFS driver requires an androidboot.bootdevice command line argument matching the UFS device name. If the name is different, it refuses to probe. This androidboot.bootdevice is provided by stock/vendor (from an Android-based device) bootloader. This does not make sense from Linux point of view. Driver should be able to boot regardless of bootloader. Driver should not depend on some Android custom environment data. Link: https://lore.kernel.org/r/20220321151853.24138-1-krzk@kernel.org Tested-by: Amit Pundir Tested-by: Luca Weiss Reviewed-by: Brian Masney Reviewed-by: Bjorn Andersson Reviewed-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Signed-off-by: Martin K. Petersen drivers/scsi/ufs/ufs-qcom.c | 15 --------------- 1 file changed, 15 deletions(-) commit 99241e119f4a2077383f994a174b38ced21d6fca Author: Jackie Liu Date: Tue Mar 29 10:12:51 2022 +0800 scsi: core: sysfs: Remove comments that conflict with the actual logic Christoph Hellwig Says: ======================= I think we should just handle the error properly and remove the comment. There's no good reason to ignore bsg registration errors. In fact, after commit 92c4b58b15c5 ("scsi: core: Register sysfs attributes earlier"), we are already forced to return errno. We discuss this issue in [1]. [1] https://lore.kernel.org/all/20211022010201.426746-1-liu.yun@linux.dev/ Link: https://lore.kernel.org/r/20220329021251.123805-1-liu.yun@linux.dev Suggested-by: Christoph Hellwig Reviewed-by: Guenter Roeck Reviewed-by: Christoph Hellwig Signed-off-by: Jackie Liu Signed-off-by: Martin K. Petersen drivers/scsi/scsi_sysfs.c | 4 ---- 1 file changed, 4 deletions(-) commit 066f4c31945ce2cb30e840794ee01713dec73b74 Author: Dan Carpenter Date: Thu Mar 17 10:52:14 2022 +0300 scsi: hisi_sas: Remove stray fallthrough annotation This case statement doesn't fall through any more so remove the fallthrough annotation. Link: https://lore.kernel.org/r/20220317075214.GC25237@kili Acked-by: John Garry Signed-off-by: Dan Carpenter Signed-off-by: Martin K. Petersen drivers/scsi/hisi_sas/hisi_sas_main.c | 1 - 1 file changed, 1 deletion(-) commit 41b8c2a31472a97349fe54c3a6b3176d9cdc31be Author: Randy Dunlap Date: Wed Mar 16 12:20:06 2022 -0700 scsi: virtio-scsi: Eliminate anonymous module_init & module_exit Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Link: https://lore.kernel.org/r/20220316192010.19001-6-rdunlap@infradead.org Fixes: 4fe74b1cb051 ("[SCSI] virtio-scsi: SCSI driver for QEMU based virtual machines") Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Paolo Bonzini Cc: Stefan Hajnoczi Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Cc: virtualization@lists.linux-foundation.org Reviewed-by: Stefan Hajnoczi Reviewed-by: Ira Weiny Acked-by: Jason Wang Acked-by: Michael S. Tsirkin Signed-off-by: Randy Dunlap Signed-off-by: Martin K. Petersen drivers/scsi/virtio_scsi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit fac952bb546a9f103a769d7105194175e11abc99 Author: Colin Ian King Date: Wed Mar 16 23:56:15 2022 +0000 scsi: isci: Fix spelling mistake "doesnt" -> "doesn't" There are a few spelling mistakes in dev_warn and dev_err messages. Fix these. Link: https://lore.kernel.org/r/20220316235615.56683-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen drivers/scsi/isci/host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit eaba83b5b8506bbc9ee7ca2f10aeab3fff3719e7 Author: John Garry Date: Wed Mar 16 17:44:30 2022 +0800 scsi: core: Fix sbitmap depth in scsi_realloc_sdev_budget_map() In commit edb854a3680b ("scsi: core: Reallocate device's budget map on queue depth change"), the sbitmap for the device budget map may be reallocated after the slave device depth is configured. When the sbitmap is reallocated we use the result from scsi_device_max_queue_depth() for the sbitmap size, but don't resize to match the actual device queue depth. Fix by resizing the sbitmap after reallocating the budget sbitmap. We do this instead of init'ing the sbitmap to the device queue depth as the user may want to change the queue depth later via sysfs or other. Link: https://lore.kernel.org/r/1647423870-143867-1-git-send-email-john.garry@huawei.com Fixes: edb854a3680b ("scsi: core: Reallocate device's budget map on queue depth change") Tested-by: Damien Le Moal Reviewed-by: Ming Lei Reviewed-by: Bart Van Assche Signed-off-by: John Garry Signed-off-by: Martin K. Petersen drivers/scsi/scsi_scan.c | 5 +++++ 1 file changed, 5 insertions(+) commit 63221571ef77c71a37d3c604d604168ce1de5cab Author: Finn Thain Date: Thu Mar 24 08:29:37 2022 +1100 scsi: aha152x: Stop using struct scsi_pointer Remove aha152x_cmd_priv.scsi_pointer by moving the necessary members into aha152x_cmd_priv proper. Tested with an Adaptec SlimSCSI APA-1460A card. Link: https://lore.kernel.org/r/bdc1264b6dd331150bffb737958cab8c9c068fa1.1648070977.git.fthain@linux-m68k.org Cc: Christoph Hellwig Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Signed-off-by: Finn Thain Signed-off-by: Martin K. Petersen drivers/scsi/aha152x.c | 235 ++++++++++++++++++++++++------------------------- 1 file changed, 113 insertions(+), 122 deletions(-) commit 0bade8e53279157c7cc9dd95d573b7e82223d78a Author: Tyrel Datwyler Date: Tue Mar 22 12:44:43 2022 -0700 scsi: ibmvscsis: Increase INITIAL_SRP_LIMIT to 1024 The adapter request_limit is hardcoded to be INITIAL_SRP_LIMIT which is currently an arbitrary value of 800. Increase this value to 1024 which better matches the characteristics of the typical IBMi Initiator that supports 32 LUNs and a queue depth of 32. This change also has the secondary benefit of being a power of two as required by the kfifo API. Since, Commit ab9bb6318b09 ("Partially revert "kfifo: fix kfifo_alloc() and kfifo_init()"") the size of IU pool for each target has been rounded down to 512 when attempting to kfifo_init() those pools with the current request_limit size of 800. Link: https://lore.kernel.org/r/20220322194443.678433-1-tyreld@linux.ibm.com Signed-off-by: Tyrel Datwyler Signed-off-by: Martin K. Petersen drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bc5519c18a32ce855bb51b9f5eceb77a9489d080 Author: Kevin Groeneveld Date: Tue Mar 22 20:22:42 2022 -0400 scsi: sr: Fix typo in CDROM(CLOSETRAY|EJECT) handling Commit 2e27f576abc6 ("scsi: scsi_ioctl: Call scsi_cmd_ioctl() from scsi_ioctl()") seems to have a typo as it is checking ret instead of cmd in the if statement checking for CDROMCLOSETRAY and CDROMEJECT. This changes the behaviour of these ioctls as the cdrom_ioctl handling of these is more restrictive than the scsi_ioctl version. Link: https://lore.kernel.org/r/20220323002242.21157-1-kgroeneveld@lenbrook.com Fixes: 2e27f576abc6 ("scsi: scsi_ioctl: Call scsi_cmd_ioctl() from scsi_ioctl()") Reviewed-by: Christoph Hellwig Signed-off-by: Kevin Groeneveld Signed-off-by: Martin K. Petersen drivers/scsi/sr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f16aa285e6185271bc6812a176f7ae3dbd7fe28d Author: Christophe JAILLET Date: Sat Mar 26 13:48:15 2022 +0100 scsi: pmcraid: Remove the PMCRAID_PASSTHROUGH_IOCTL ioctl implementation The whole passthrough ioctl path looks completely broken. For example it DMA maps the scatterlist and after that copies data to it, which is prohibited by the DMA API contract. Moreover, in pmcraid_alloc_sglist(), the pointer returned by a sgl_alloc_order() call is not recorded anywhere which is pointless. So remove the PMCRAID_PASSTHROUGH_IOCTL ioctl implementation entirely. Should it be needed, we should reimplement it using the proper block layer request mapping helpers. Link: https://lore.kernel.org/r/7f27a70bec3f3dcaf46a29b1c630edd4792e71c0.1648298857.git.christophe.jaillet@wanadoo.fr Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen drivers/scsi/pmcraid.c | 491 ------------------------------------------------- drivers/scsi/pmcraid.h | 33 ---- 2 files changed, 524 deletions(-) commit f06aa52cb2723ec67e92df463827b800d6c477d1 Author: Tomas Henzl Date: Thu Mar 24 14:46:03 2022 +0100 scsi: core: scsi_logging: Fix a BUG The request_queue may be NULL in a request, for example when it comes from scsi_ioctl_reset(). Check it before use. Fixes: f3fa33acca9f ("block: remove the ->rq_disk field in struct request") Link: https://lore.kernel.org/r/20220324134603.28463-1-thenzl@redhat.com Reported-by: Changhui Zhong Reviewed-by: Christoph Hellwig Signed-off-by: Tomas Henzl Signed-off-by: Martin K. Petersen drivers/scsi/scsi_logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8ee15ea779c332f94d74d135212403f2d0defb5f Author: Keoseong Park Date: Thu Mar 24 16:01:46 2022 +0900 scsi: ufs: core: Remove unused field in struct ufs_hba Remove unused fields 'rpm_lvl_attr' and 'spm_lvl_attr' in struct ufs_hba. Commit cbb6813ee771 ("scsi: ufs: sysfs: attribute group for existing sysfs entries.") removed all code using that field. Link: https://lore.kernel.org/r/413601558.101648105683746.JavaMail.epsvc@epcpadp4 Reviewed-by: Bart Van Assche Acked-by: Avri Altman Signed-off-by: Keoseong Park Signed-off-by: Martin K. Petersen drivers/scsi/ufs/ufshcd.h | 2 -- 1 file changed, 2 deletions(-) commit c26bd6602e1d348bfa754dc55e5608c922dd2801 Author: James Smart Date: Wed Mar 23 13:55:45 2022 -0700 scsi: lpfc: Fix locking for lpfc_sli_iocbq_lookup() The rules changed for lpfc_sli_iocbq_lookup() vs locking. Prior, the routine properly took out the lock. In newly refactored code, the locks must be held when calling the routine. Fix lpfc_sli_process_sol_iocb() to take the locks before calling the routine. Fix lpfc_sli_handle_fast_ring_event() to not release the locks to call the routine. Link: https://lore.kernel.org/r/20220323205545.81814-3-jsmart2021@gmail.com Fixes: 1b64aa9eae28 ("scsi: lpfc: SLI path split: Refactor fast and slow paths to native SLI4") Co-developed-by: Dick Kennedy Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_sli.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 7294a9bcaa7ee0d3b96aab1a277317315fd46f09 Author: James Smart Date: Wed Mar 23 13:55:44 2022 -0700 scsi: lpfc: Fix broken SLI4 abort path There was a merge error in ther 14.2.0.0 patches that resulted in the SLI4 path using the SLI3 issue_abort_iotag() routine. This resulted in txcmplq corruption. Fix to use the SLI4 routine when SLI4. Link: https://lore.kernel.org/r/20220323205545.81814-2-jsmart2021@gmail.com Fixes: 31a59f75702f ("scsi: lpfc: SLI path split: Refactor Abort paths") Cc: # v5.2+ Co-developed-by: Dick Kennedy Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_scsi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 4f3beb36b1e46f1a04967a84e3a1bd55bf7a9e7a Author: James Smart Date: Wed Mar 16 20:27:37 2022 -0700 scsi: lpfc: Update lpfc version to 14.2.0.1 Update lpfc version to 14.2.0.1 Link: https://lore.kernel.org/r/20220317032737.45308-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 drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit df0101197c4d9596682901631f3ee193ed354873 Author: James Smart Date: Wed Mar 16 20:27:36 2022 -0700 scsi: lpfc: Fix queue failures when recovering from PCI parity error When recovering from a pci-parity error the driver is failing to re-create queues, causing recovery to fail. Looking deeper, it was found that the interrupt vector count allocated on the recovery was fewer than the vectors originally allocated. This disparity resulted in CPU map entries with stale information. When the driver tries to re-create the queues, it attempts to use the stale information which indicates an eq/interrupt vector that was no longer created. Fix by clearng the cpup map array before enabling and requesting the IRQs in the lpfc_sli_reset_slot_s4 routine(). Link: https://lore.kernel.org/r/20220317032737.45308-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 drivers/scsi/lpfc/lpfc_init.c | 2 ++ 1 file changed, 2 insertions(+) commit a4691038b4071ff0d9ae486d8822a2c0d41d5796 Author: James Smart Date: Wed Mar 16 20:27:35 2022 -0700 scsi: lpfc: Fix unload hang after back to back PCI EEH faults When injecting EEH errors the port is getting hung up waiting on the node list to empty, message number 0233. The driver is stuck at this point and also can't unload. The driver makes transport remoteport delete calls which try to abort I/O's, but the EEH daemon has already called the driver to detach and the detachment has set the global FC_UNLOADING flag. There are several code paths that will avoid I/O cleanup if the FC_UNLOADING flag is set, resulting in transports waiting for I/O while the driver is waiting on transports to clean up. Additionally, during study of the list, a locking issue was found in lpfc_sli_abort_iocb_ring that could corrupt the list. A special case was added to the lpfc_cleanup() routine to call lpfc_sli_flush_rings() if the driver is FC_UNLOADING and if the pci-slot is offline (e.g. EEH). The SLI4 part of lpfc_sli_abort_iocb_ring() is changed to use the ring_lock. Also added code to cancel the I/Os if the pci-slot is offline and added checks and returns for the FC_UNLOADING and HBA_IOQ_FLUSH flags to prevent trying to send an I/O that we cannot handle. Link: https://lore.kernel.org/r/20220317032737.45308-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 drivers/scsi/lpfc/lpfc_hbadisc.c | 1 + drivers/scsi/lpfc/lpfc_init.c | 26 ++++++++++++++++++--- drivers/scsi/lpfc/lpfc_nvme.c | 16 ++++++++++--- drivers/scsi/lpfc/lpfc_sli.c | 50 ++++++++++++++++++++++++++++------------ 4 files changed, 72 insertions(+), 21 deletions(-) commit 35ed9613d83f3c1f011877d591fd7d36f2666106 Author: James Smart Date: Wed Mar 16 20:27:34 2022 -0700 scsi: lpfc: Improve PCI EEH Error and Recovery Handling Following EEH errors, the driver can crash or hang when deleting the localport or when attempting to unload. The EEH handlers in the driver did not notify the NVMe-FC transport before tearing the driver down. This was delayed until the resume steps. This worked for SCSI because lpfc_block_scsi() would notify the scsi_fc_transport that the target was not available but it would not clean up all the references to the ndlp. The SLI3 prep for dev reset handler did the lpfc_offline_prep() and lpfc_offline() calls to get the port stopped before restarting. The SLI4 version of the prep for dev reset just destroyed the queues and did not stop NVMe from continuing. Also because the port was not really stopped the localport destroy would hang because the transport was still waiting for I/O. Additionally, a devloss tmo can fire and post events to a stopped worker thread creating another hang condition. lpfc_sli4_prep_dev_for_reset() is modified to call lpfc_offline_prep() and lpfc_offline() rather than just lpfc_scsi_dev_block() to ensure both SCSI and NVMe transports are notified to block I/O to the driver. Logic is added to devloss handler and worker thread to clean up ndlp references and quiesce appropriately. Link: https://lore.kernel.org/r/20220317032737.45308-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 drivers/scsi/lpfc/lpfc.h | 7 ++- drivers/scsi/lpfc/lpfc_crtn.h | 3 + drivers/scsi/lpfc/lpfc_hbadisc.c | 119 +++++++++++++++++++++++++++++++-------- drivers/scsi/lpfc/lpfc_init.c | 60 ++++++++++++-------- drivers/scsi/lpfc/lpfc_nvme.c | 11 ++-- drivers/scsi/lpfc/lpfc_sli.c | 15 +++-- 6 files changed, 157 insertions(+), 58 deletions(-) commit a6968f7a367f128d120447360734344d5a3d5336 Author: Xiaoguang Wang Date: Fri Mar 11 21:22:05 2022 +0800 scsi: target: tcmu: Fix possible page UAF tcmu_try_get_data_page() looks up pages under cmdr_lock, but it does not take refcount properly and just returns page pointer. When tcmu_try_get_data_page() returns, the returned page may have been freed by tcmu_blocks_release(). We need to get_page() under cmdr_lock to avoid concurrent tcmu_blocks_release(). Link: https://lore.kernel.org/r/20220311132206.24515-1-xiaoguang.wang@linux.alibaba.com Reviewed-by: Bodo Stroesser Signed-off-by: Xiaoguang Wang Signed-off-by: Martin K. Petersen drivers/target/target_core_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit ebfe3e0c5e805da3dd692bb120cd6269b7c19b80 Author: Wenchao Hao Date: Thu Mar 17 11:01:16 2022 -0400 scsi: libiscsi: Remove unnecessary memset() in iscsi_conn_setup() iscsi_cls_conn is alloced by kzalloc(), the whole iscsi_cls_conn is zero filled already including the dd_data. So it is unnecessary to call memset again. Link: https://lore.kernel.org/r/20220317150116.194140-1-haowenchao@huawei.com Reviewed-by: Wu Bo Reviewed-by: Lee Duncan Reviewed-by: Mike Christie Signed-off-by: Wenchao Hao Signed-off-by: Martin K. Petersen drivers/scsi/libiscsi.c | 1 - 1 file changed, 1 deletion(-) commit 87d663d40801dffc99a5ad3b0188ad3e2b4d1557 Author: Damien Le Moal Date: Tue Mar 22 14:57:02 2022 +0900 scsi: mpt3sas: Fix use after free in _scsih_expander_node_remove() The function mpt3sas_transport_port_remove() called in _scsih_expander_node_remove() frees the port field of the sas_expander structure, leading to the following use-after-free splat from KASAN when the ioc_info() call following that function is executed (e.g. when doing rmmod of the driver module): [ 3479.371167] ================================================================== [ 3479.378496] BUG: KASAN: use-after-free in _scsih_expander_node_remove+0x710/0x750 [mpt3sas] [ 3479.386936] Read of size 1 at addr ffff8881c037691c by task rmmod/1531 [ 3479.393524] [ 3479.395035] CPU: 18 PID: 1531 Comm: rmmod Not tainted 5.17.0-rc8+ #1436 [ 3479.401712] Hardware name: Supermicro Super Server/H12SSL-NT, BIOS 2.1 06/02/2021 [ 3479.409263] Call Trace: [ 3479.411743] [ 3479.413875] dump_stack_lvl+0x45/0x59 [ 3479.417582] print_address_description.constprop.0+0x1f/0x120 [ 3479.423389] ? _scsih_expander_node_remove+0x710/0x750 [mpt3sas] [ 3479.429469] kasan_report.cold+0x83/0xdf [ 3479.433438] ? _scsih_expander_node_remove+0x710/0x750 [mpt3sas] [ 3479.439514] _scsih_expander_node_remove+0x710/0x750 [mpt3sas] [ 3479.445411] ? _raw_spin_unlock_irqrestore+0x2d/0x40 [ 3479.452032] scsih_remove+0x525/0xc90 [mpt3sas] [ 3479.458212] ? mpt3sas_expander_remove+0x1d0/0x1d0 [mpt3sas] [ 3479.465529] ? down_write+0xde/0x150 [ 3479.470746] ? up_write+0x14d/0x460 [ 3479.475840] ? kernfs_find_ns+0x137/0x310 [ 3479.481438] pci_device_remove+0x65/0x110 [ 3479.487013] __device_release_driver+0x316/0x680 [ 3479.493180] driver_detach+0x1ec/0x2d0 [ 3479.498499] bus_remove_driver+0xe7/0x2d0 [ 3479.504081] pci_unregister_driver+0x26/0x250 [ 3479.510033] _mpt3sas_exit+0x2b/0x6cf [mpt3sas] [ 3479.516144] __x64_sys_delete_module+0x2fd/0x510 [ 3479.522315] ? free_module+0xaa0/0xaa0 [ 3479.527593] ? __cond_resched+0x1c/0x90 [ 3479.532951] ? lockdep_hardirqs_on_prepare+0x273/0x3e0 [ 3479.539607] ? syscall_enter_from_user_mode+0x21/0x70 [ 3479.546161] ? trace_hardirqs_on+0x1c/0x110 [ 3479.551828] do_syscall_64+0x35/0x80 [ 3479.556884] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 3479.563402] RIP: 0033:0x7f1fc482483b ... [ 3479.943087] ================================================================== Fix this by introducing the local variable port_id to store the port ID value before executing mpt3sas_transport_port_remove(). This local variable is then used in the call to ioc_info() instead of dereferencing the freed port structure. Link: https://lore.kernel.org/r/20220322055702.95276-1-damien.lemoal@opensource.wdc.com Fixes: 7d310f241001 ("scsi: mpt3sas: Get device objects using sas_address & portID") Cc: stable@vger.kernel.org Acked-by: Sreekanth Reddy Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen drivers/scsi/mpt3sas/mpt3sas_scsih.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit eb07d5a4da041fd2e30e386e5fd12d23bb31cf9e Author: NeilBrown Date: Wed Mar 30 11:48:37 2022 +1100 SUNRPC: handle malloc failure in ->request_prepare If ->request_prepare() detects an error, it sets ->rq_task->tk_status. This is easy for callers to ignore. The only caller is xprt_request_enqueue_receive() and it does ignore the error, as does call_encode() which calls it. This can result in a request being queued to receive a reply without an allocated receive buffer. So instead of setting rq_task->tk_status, return an error, and store in ->tk_status only in call_encode(); The call to xprt_request_enqueue_receive() is now earlier in call_encode(), where the error can still be handled. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust include/linux/sunrpc/xprt.h | 5 ++--- net/sunrpc/clnt.c | 6 +++--- net/sunrpc/xprt.c | 23 +++++++++++++++-------- net/sunrpc/xprtsock.c | 4 ++-- 4 files changed, 22 insertions(+), 16 deletions(-) commit b243874f6f9568b2daf1a00e9222cacdc15e159c Author: ChenXiaoSong Date: Tue Mar 29 19:32:08 2022 +0800 NFSv4: fix open failure with O_ACCMODE flag open() with O_ACCMODE|O_DIRECT flags secondly will fail. Reproducer: 1. mount -t nfs -o vers=4.2 $server_ip:/ /mnt/ 2. fd = open("/mnt/file", O_ACCMODE|O_DIRECT|O_CREAT) 3. close(fd) 4. fd = open("/mnt/file", O_ACCMODE|O_DIRECT) Server nfsd4_decode_share_access() will fail with error nfserr_bad_xdr when client use incorrect share access mode of 0. Fix this by using NFS4_SHARE_ACCESS_BOTH share access mode in client, just like firstly opening. Fixes: ce4ef7c0a8a05 ("NFS: Split out NFS v4 file operations") Signed-off-by: ChenXiaoSong Signed-off-by: Trond Myklebust fs/nfs/dir.c | 10 ---------- fs/nfs/internal.h | 10 ++++++++++ fs/nfs/nfs4file.c | 6 ++++-- 3 files changed, 14 insertions(+), 12 deletions(-) commit ab0fc21bc7105b54bafd85bd8b82742f9e68898a Author: ChenXiaoSong Date: Tue Mar 29 19:32:07 2022 +0800 Revert "NFSv4: Handle the special Linux file open access mode" This reverts commit 44942b4e457beda00981f616402a1a791e8c616e. After secondly opening a file with O_ACCMODE|O_DIRECT flags, nfs4_valid_open_stateid() will dereference NULL nfs4_state when lseek(). Reproducer: 1. mount -t nfs -o vers=4.2 $server_ip:/ /mnt/ 2. fd = open("/mnt/file", O_ACCMODE|O_DIRECT|O_CREAT) 3. close(fd) 4. fd = open("/mnt/file", O_ACCMODE|O_DIRECT) 5. lseek(fd) Reported-by: Lyu Tao Signed-off-by: ChenXiaoSong Signed-off-by: Trond Myklebust fs/nfs/inode.c | 1 - fs/nfs/nfs4file.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) commit 77c9387c0c5bd496fba3200024e3618356b2fd34 Merge: 6094e391e643 ccaff3d56acc Author: Jakub Kicinski Date: Tue Mar 29 18:59:14 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2022-03-29 We've added 16 non-merge commits during the last 1 day(s) which contain a total of 24 files changed, 354 insertions(+), 187 deletions(-). The main changes are: 1) x86 specific bits of fprobe/rethook, from Masami and Peter. 2) ice/xsk fixes, from Maciej and Magnus. 3) Various small fixes, from Andrii, Yonghong, Geliang and others. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: selftests/bpf: Fix clang compilation errors ice: xsk: Fix indexing in ice_tx_xsk_pool() ice: xsk: Stop Rx processing when ntc catches ntu ice: xsk: Eliminate unnecessary loop iteration xsk: Do not write NULL in SW ring at allocation failure x86,kprobes: Fix optprobe trampoline to generate complete pt_regs x86,rethook: Fix arch_rethook_trampoline() to generate a complete pt_regs x86,rethook,kprobes: Replace kretprobe with rethook on x86 kprobes: Use rethook for kretprobe if possible bpftool: Fix generated code in codegen_asserts selftests/bpf: fix selftest after random: Urandom_read tracepoint removal bpf: Fix maximum permitted number of arguments check bpf: Sync comments for bpf_get_stack fprobe: Fix sparse warning for acccessing __rcu ftrace_hash fprobe: Fix smatch type mismatch warning bpf/bpftool: Add unprivileged_bpf_disabled check against value of 2 ==================== Link: https://lore.kernel.org/r/20220329234924.39053-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski commit 965181d7ef7e1a863477536dc328c23a7ebc8a1d Merge: 1ec48f95519b 7c9d845f0612 Author: Linus Torvalds Date: Tue Mar 29 18:55:37 2022 -0700 Merge tag 'nfs-for-5.18-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs Pull NFS client updates from Trond Myklebust: "Highlights include: Features: - Switch NFS to use readahead instead of the obsolete readpages. - Readdir fixes to improve cacheability of large directories when there are multiple readers and writers. - Readdir performance improvements when doing a seekdir() immediately after opening the directory (common when re-exporting NFS). - NFS swap improvements from Neil Brown. - Loosen up memory allocation to permit direct reclaim and write back in cases where there is no danger of deadlocking the writeback code or NFS swap. - Avoid sillyrename when the NFSv4 server claims to support the necessary features to recover the unlinked but open file after reboot. Bugfixes: - Patch from Olga to add a mount option to control NFSv4.1 session trunking discovery, and default it to being off. - Fix a lockup in nfs_do_recoalesce(). - Two fixes for list iterator variables being used when pointing to the list head. - Fix a kernel memory scribble when reading from a non-socket transport in /sys/kernel/sunrpc. - Fix a race where reconnecting to a server could leave the TCP socket stuck forever in the connecting state. - Patch from Neil to fix a shutdown race which can leave the SUNRPC transport timer primed after we free the struct xprt itself. - Patch from Xin Xiong to fix reference count leaks in the NFSv4.2 copy offload. - Sunrpc patch from Olga to avoid resending a task on an offlined transport. Cleanups: - Patches from Dave Wysochanski to clean up the fscache code" * tag 'nfs-for-5.18-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (91 commits) NFSv4/pNFS: Fix another issue with a list iterator pointing to the head NFS: Don't loop forever in nfs_do_recoalesce() SUNRPC: Don't return error values in sysfs read of closed files SUNRPC: Do not dereference non-socket transports in sysfs NFSv4.1: don't retry BIND_CONN_TO_SESSION on session error SUNRPC don't resend a task on an offlined transport NFS: replace usage of found with dedicated list iterator variable SUNRPC: avoid race between mod_timer() and del_timer_sync() pNFS/files: Ensure pNFS allocation modes are consistent with nfsiod pNFS/flexfiles: Ensure pNFS allocation modes are consistent with nfsiod NFSv4/pnfs: Ensure pNFS allocation modes are consistent with nfsiod NFS: Avoid writeback threads getting stuck in mempool_alloc() NFS: nfsiod should not block forever in mempool_alloc() SUNRPC: Make the rpciod and xprtiod slab allocation modes consistent SUNRPC: Fix unx_lookup_cred() allocation NFS: Fix memory allocation in rpc_alloc_task() NFS: Fix memory allocation in rpc_malloc() SUNRPC: Improve accuracy of socket ENOBUFS determination SUNRPC: Replace internal use of SOCKWQ_ASYNC_NOSPACE SUNRPC: Fix socket waits for write buffer space ... commit 919edbadebe17a67193533f531c2920c03e40fa4 Author: Dave Chinner Date: Tue Mar 29 18:22:02 2022 -0700 xfs: drop async cache flushes from CIL commits. Jan Kara reported a performance regression in dbench that he bisected down to commit bad77c375e8d ("xfs: CIL checkpoint flushes caches unconditionally"). Whilst developing the journal flush/fua optimisations this cache was part of, it appeared to made a significant difference to performance. However, now that this patchset has settled and all the correctness issues fixed, there does not appear to be any significant performance benefit to asynchronous cache flushes. In fact, the opposite is true on some storage types and workloads, where additional cache flushes that can occur from fsync heavy workloads have measurable and significant impact on overall throughput. Local dbench testing shows little difference on dbench runs with sync vs async cache flushes on either fast or slow SSD storage, and no difference in streaming concurrent async transaction workloads like fs-mark. Fast NVME storage. From `dbench -t 30`, CIL scale: clients async sync BW Latency BW Latency 1 935.18 0.855 915.64 0.903 8 2404.51 6.873 2341.77 6.511 16 3003.42 6.460 2931.57 6.529 32 3697.23 7.939 3596.28 7.894 128 7237.43 15.495 7217.74 11.588 512 5079.24 90.587 5167.08 95.822 fsmark, 32 threads, create w/ 64 byte xattr w/32k logbsize create chown unlink async 1m41s 1m16s 2m03s sync 1m40s 1m19s 1m54s Slower SATA SSD storage: From `dbench -t 30`, CIL scale: clients async sync BW Latency BW Latency 1 78.59 15.792 83.78 10.729 8 367.88 92.067 404.63 59.943 16 564.51 72.524 602.71 76.089 32 831.66 105.984 870.26 110.482 128 1659.76 102.969 1624.73 91.356 512 2135.91 223.054 2603.07 161.160 fsmark, 16 threads, create w/32k logbsize create unlink async 5m06s 4m15s sync 5m00s 4m22s And on Jan's test machine: 5.18-rc8-vanilla 5.18-rc8-patched Amean 1 71.22 ( 0.00%) 64.94 * 8.81%* Amean 2 93.03 ( 0.00%) 84.80 * 8.85%* Amean 4 150.54 ( 0.00%) 137.51 * 8.66%* Amean 8 252.53 ( 0.00%) 242.24 * 4.08%* Amean 16 454.13 ( 0.00%) 439.08 * 3.31%* Amean 32 835.24 ( 0.00%) 829.74 * 0.66%* Amean 64 1740.59 ( 0.00%) 1686.73 * 3.09%* Performance and cache flush behaviour is restored to pre-regression levels. As such, we can now consider the async cache flush mechanism an unnecessary exercise in premature optimisation and hence we can now remove it and the infrastructure it requires completely. Fixes: bad77c375e8d ("xfs: CIL checkpoint flushes caches unconditionally") Reported-and-tested-by: Jan Kara Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_bio_io.c | 35 ----------------------------------- fs/xfs/xfs_linux.h | 2 -- fs/xfs/xfs_log.c | 36 +++++++++++------------------------- fs/xfs/xfs_log_cil.c | 42 +++++++++++++----------------------------- fs/xfs/xfs_log_priv.h | 3 +-- 5 files changed, 25 insertions(+), 93 deletions(-) commit 5652ef31705f240e1528fe5a45d99229752e1ec8 Author: Dave Chinner Date: Tue Mar 29 18:22:02 2022 -0700 xfs: shutdown during log recovery needs to mark the log shutdown When a checkpoint writeback is run by log recovery, corruption propagated from the log can result in writeback verifiers failing and calling xfs_force_shutdown() from xfs_buf_delwri_submit_buffers(). This results in the mount being marked as shutdown, but the log does not get marked as shut down because: /* * If this happens during log recovery then we aren't using the runtime * log mechanisms yet so there's nothing to shut down. */ if (!log || xlog_in_recovery(log)) return false; If there are other buffers that then fail (say due to detecting the mount shutdown), they will now hang in xfs_do_force_shutdown() waiting for the log to shut down like this: __schedule+0x30d/0x9e0 schedule+0x55/0xd0 xfs_do_force_shutdown+0x1cd/0x200 ? init_wait_var_entry+0x50/0x50 xfs_buf_ioend+0x47e/0x530 __xfs_buf_submit+0xb0/0x240 xfs_buf_delwri_submit_buffers+0xfe/0x270 xfs_buf_delwri_submit+0x3a/0xc0 xlog_do_recovery_pass+0x474/0x7b0 ? do_raw_spin_unlock+0x30/0xb0 xlog_do_log_recovery+0x91/0x140 xlog_do_recover+0x38/0x1e0 xlog_recover+0xdd/0x170 xfs_log_mount+0x17e/0x2e0 xfs_mountfs+0x457/0x930 xfs_fs_fill_super+0x476/0x830 xlog_force_shutdown() always needs to mark the log as shut down, regardless of whether recovery is in progress or not, so that multiple calls to xfs_force_shutdown() during recovery don't end up waiting for the log to be shut down like this. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_log.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit 3c4cb76bce4380aee99c275b3920049350939e47 Author: Dave Chinner Date: Tue Mar 29 18:22:01 2022 -0700 xfs: xfs_trans_commit() path must check for log shutdown If a shut races with xfs_trans_commit() and we have shut down the filesystem but not the log, we will still cancel the transaction. This can result in aborting dirty log items instead of committing and pinning them whilst the log is still running. Hence we can end up with dirty, unlogged metadata that isn't in the AIL in memory that can be flushed to disk via writeback clustering. This was discovered from a g/388 trace where an inode log item was having IO completed on it and it wasn't in the AIL, hence tripping asserts xfs_ail_check(). Inode cluster writeback started long after the filesystem shutdown started, and long after the transaction containing the dirty inode was aborted and the log item marked XFS_LI_ABORTED. The inode was seen as dirty and unpinned, so it was flushed. IO completion tried to remove the inode from the AIL, at which point stuff went bad: XFS (pmem1): Log I/O Error (0x6) detected at xfs_fs_goingdown+0xa3/0xf0 (fs/xfs/xfs_fsops.c:500). Shutting down filesystem. XFS: Assertion failed: in_ail, file: fs/xfs/xfs_trans_ail.c, line: 67 XFS (pmem1): Please unmount the filesystem and rectify the problem(s) Workqueue: xfs-buf/pmem1 xfs_buf_ioend_work RIP: 0010:assfail+0x27/0x2d Call Trace: xfs_ail_check+0xa8/0x180 xfs_ail_delete_one+0x3b/0xf0 xfs_buf_inode_iodone+0x329/0x3f0 xfs_buf_ioend+0x1f8/0x530 xfs_buf_ioend_work+0x15/0x20 process_one_work+0x1ac/0x390 worker_thread+0x56/0x3c0 kthread+0xf6/0x120 ret_from_fork+0x1f/0x30 xfs_trans_commit() needs to check log state for shutdown, not mount state. It cannot abort dirty log items while the log is still running as dirty items must remained pinned in memory until they are either committed to the journal or the log has shut down and they can be safely tossed away. Hence if the log has not shut down, the xfs_trans_commit() path must allow completed transactions to commit to the CIL and pin the dirty items even if a mount shutdown has started. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_trans.c | 48 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) commit 41e6362183589afd2cd51d653e277d256daab11f Author: Dave Chinner Date: Tue Mar 29 18:22:01 2022 -0700 xfs: xfs_do_force_shutdown needs to block racing shutdowns When we call xfs_forced_shutdown(), the caller often expects the filesystem to be completely shut down when it returns. However, if we have racing xfs_forced_shutdown() calls, the first caller sets the mount shutdown flag then goes to shutdown the log. The second caller sees the mount shutdown flag and returns immediately - it does not wait for the log to be shut down. Unfortunately, xfs_forced_shutdown() is used in some places that expect it to completely shut down the filesystem before it returns (e.g. xfs_trans_log_inode()). As such, returning before the log has been shut down leaves us in a place where the transaction failed to complete correctly but we still call xfs_trans_commit(). This situation arises because xfs_trans_log_inode() does not return an error and instead calls xfs_force_shutdown() to ensure that the transaction being committed is aborted. Unfortunately, we have a race condition where xfs_trans_commit() needs to check xlog_is_shutdown() because it can't abort log items before the log is shut down, but it needs to use xfs_is_shutdown() because xfs_forced_shutdown() does not block waiting for the log to shut down. To fix this conundrum, first we make all calls to xfs_forced_shutdown() block until the log is also shut down. This means we can then safely use xfs_forced_shutdown() as a mechanism that ensures the currently running transaction will be aborted by xfs_trans_commit() regardless of the shutdown check it uses. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_fsops.c | 6 +++++- fs/xfs/xfs_log.c | 1 + fs/xfs/xfs_log_priv.h | 11 +++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) commit b5f17bec1213a3ed2f4d79ad4c566e00cabe2a9b Author: Dave Chinner Date: Tue Mar 29 18:22:01 2022 -0700 xfs: log shutdown triggers should only shut down the log We've got a mess on our hands. 1. xfs_trans_commit() cannot cancel transactions because the mount is shut down - that causes dirty, aborted, unlogged log items to sit unpinned in memory and potentially get written to disk before the log is shut down. Hence xfs_trans_commit() can only abort transactions when xlog_is_shutdown() is true. 2. xfs_force_shutdown() is used in places to cause the current modification to be aborted via xfs_trans_commit() because it may be impractical or impossible to cancel the transaction directly, and hence xfs_trans_commit() must cancel transactions when xfs_is_shutdown() is true in this situation. But we can't do that because of #1. 3. Log IO errors cause log shutdowns by calling xfs_force_shutdown() to shut down the mount and then the log from log IO completion. 4. xfs_force_shutdown() can result in a log force being issued, which has to wait for log IO completion before it will mark the log as shut down. If #3 races with some other shutdown trigger that runs a log force, we rely on xfs_force_shutdown() silently ignoring #3 and avoiding shutting down the log until the failed log force completes. 5. To ensure #2 always works, we have to ensure that xfs_force_shutdown() does not return until the the log is shut down. But in the case of #4, this will result in a deadlock because the log Io completion will block waiting for a log force to complete which is blocked waiting for log IO to complete.... So the very first thing we have to do here to untangle this mess is dissociate log shutdown triggers from mount shutdowns. We already have xlog_forced_shutdown, which will atomically transistion to the log a shutdown state. Due to internal asserts it cannot be called multiple times, but was done simply because the only place that could call it was xfs_do_force_shutdown() (i.e. the mount shutdown!) and that could only call it once and once only. So the first thing we do is remove the asserts. We then convert all the internal log shutdown triggers to call xlog_force_shutdown() directly instead of xfs_force_shutdown(). This allows the log shutdown triggers to shut down the log without needing to care about mount based shutdown constraints. This means we shut down the log independently of the mount and the mount may not notice this until it's next attempt to read or modify metadata. At that point (e.g. xfs_trans_commit()) it will see that the log is shutdown, error out and shutdown the mount. To ensure that all the unmount behaviours and asserts track correctly as a result of a log shutdown, propagate the shutdown up to the mount if it is not already set. This keeps the mount and log state in sync, and saves a huge amount of hassle where code fails because of a log shutdown but only checks for mount shutdowns and hence ends up doing the wrong thing. Cleaning up that mess is an exercise for another day. This enables us to address the other problems noted above in followup patches. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_log.c | 32 +++++++++++++++++++++++--------- fs/xfs/xfs_log_cil.c | 4 ++-- fs/xfs/xfs_log_recover.c | 6 +++--- fs/xfs/xfs_mount.c | 1 + fs/xfs/xfs_trans_ail.c | 8 ++++---- 5 files changed, 33 insertions(+), 18 deletions(-) commit cd6f79d1fb324968a3bae92f82eeb7d28ca1fd22 Author: Dave Chinner Date: Tue Mar 29 18:22:00 2022 -0700 xfs: run callbacks before waking waiters in xlog_state_shutdown_callbacks Brian reported a null pointer dereference failure during unmount in xfs/006. He tracked the problem down to the AIL being torn down before a log shutdown had completed and removed all the items from the AIL. The failure occurred in this path while unmount was proceeding in another task: xfs_trans_ail_delete+0x102/0x130 [xfs] xfs_buf_item_done+0x22/0x30 [xfs] xfs_buf_ioend+0x73/0x4d0 [xfs] xfs_trans_committed_bulk+0x17e/0x2f0 [xfs] xlog_cil_committed+0x2a9/0x300 [xfs] xlog_cil_process_committed+0x69/0x80 [xfs] xlog_state_shutdown_callbacks+0xce/0xf0 [xfs] xlog_force_shutdown+0xdf/0x150 [xfs] xfs_do_force_shutdown+0x5f/0x150 [xfs] xlog_ioend_work+0x71/0x80 [xfs] process_one_work+0x1c5/0x390 worker_thread+0x30/0x350 kthread+0xd7/0x100 ret_from_fork+0x1f/0x30 This is processing an EIO error to a log write, and it's triggering a force shutdown. This causes the log to be shut down, and then it is running attached iclog callbacks from the shutdown context. That means the fs and log has already been marked as xfs_is_shutdown/xlog_is_shutdown and so high level code will abort (e.g. xfs_trans_commit(), xfs_log_force(), etc) with an error because of shutdown. The umount would have been blocked waiting for a log force completion inside xfs_log_cover() -> xfs_sync_sb(). The first thing for this situation to occur is for xfs_sync_sb() to exit without waiting for the iclog buffer to be comitted to disk. The above trace is the completion routine for the iclog buffer, and it is shutting down the filesystem. xlog_state_shutdown_callbacks() does this: { struct xlog_in_core *iclog; LIST_HEAD(cb_list); spin_lock(&log->l_icloglock); iclog = log->l_iclog; do { if (atomic_read(&iclog->ic_refcnt)) { /* Reference holder will re-run iclog callbacks. */ continue; } list_splice_init(&iclog->ic_callbacks, &cb_list); >>>>>> wake_up_all(&iclog->ic_write_wait); >>>>>> wake_up_all(&iclog->ic_force_wait); } while ((iclog = iclog->ic_next) != log->l_iclog); wake_up_all(&log->l_flush_wait); spin_unlock(&log->l_icloglock); >>>>>> xlog_cil_process_committed(&cb_list); } This wakes any thread waiting on IO completion of the iclog (in this case the umount log force) before shutdown processes all the pending callbacks. That means the xfs_sync_sb() waiting on a sync transaction in xfs_log_force() on iclog->ic_force_wait will get woken before the callbacks attached to that iclog are run. This results in xfs_sync_sb() returning an error, and so unmount unblocks and continues to run whilst the log shutdown is still in progress. Normally this is just fine because the force waiter has nothing to do with AIL operations. But in the case of this unmount path, the log force waiter goes on to tear down the AIL because the log is now shut down and so nothing ever blocks it again from the wait point in xfs_log_cover(). Hence it's a race to see who gets to the AIL first - the unmount code or xlog_cil_process_committed() killing the superblock buffer. To fix this, we just have to change the order of processing in xlog_state_shutdown_callbacks() to run the callbacks before it wakes any task waiting on completion of the iclog. Reported-by: Brian Foster Fixes: aad7272a9208 ("xfs: separate out log shutdown callback processing") Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_log.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) commit ab9c81ef321f90dd208b1d4809c196c2794e4b15 Author: Dave Chinner Date: Tue Mar 29 18:22:00 2022 -0700 xfs: shutdown in intent recovery has non-intent items in the AIL generic/388 triggered a failure in RUI recovery due to a corrupted btree record and the system then locked up hard due to a subsequent assert failure while holding a spinlock cancelling intents: XFS (pmem1): Corruption of in-memory data (0x8) detected at xfs_do_force_shutdown+0x1a/0x20 (fs/xfs/xfs_trans.c:964). Shutting down filesystem. XFS (pmem1): Please unmount the filesystem and rectify the problem(s) XFS: Assertion failed: !xlog_item_is_intent(lip), file: fs/xfs/xfs_log_recover.c, line: 2632 Call Trace: xlog_recover_cancel_intents.isra.0+0xd1/0x120 xlog_recover_finish+0xb9/0x110 xfs_log_mount_finish+0x15a/0x1e0 xfs_mountfs+0x540/0x910 xfs_fs_fill_super+0x476/0x830 get_tree_bdev+0x171/0x270 ? xfs_init_fs_context+0x1e0/0x1e0 xfs_fs_get_tree+0x15/0x20 vfs_get_tree+0x24/0xc0 path_mount+0x304/0xba0 ? putname+0x55/0x60 __x64_sys_mount+0x108/0x140 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Essentially, there's dirty metadata in the AIL from intent recovery transactions, so when we go to cancel the remaining intents we assume that all objects after the first non-intent log item in the AIL are not intents. This is not true. Intent recovery can log new intents to continue the operations the original intent could not complete in a single transaction. The new intents are committed before they are deferred, which means if the CIL commits in the background they will get inserted into the AIL at the head. Hence if we shut down the filesystem while processing intent recovery, the AIL may have new intents active at the current head. Hence this check: /* * We're done when we see something other than an intent. * There should be no intents left in the AIL now. */ if (!xlog_item_is_intent(lip)) { #ifdef DEBUG for (; lip; lip = xfs_trans_ail_cursor_next(ailp, &cur)) ASSERT(!xlog_item_is_intent(lip)); #endif break; } in both xlog_recover_process_intents() and log_recover_cancel_intents() is simply not valid. It was valid back when we only had EFI/EFD intents and didn't chain intents, but it hasn't been valid ever since intent recovery could create and commit new intents. Given that crashing the mount task like this pretty much prevents diagnosing what went wrong that lead to the initial failure that triggered intent cancellation, just remove the checks altogether. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_log_recover.c | 50 ++++++++++++++++-------------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) commit d2d7c0473586d2f22e85d615275f34cf19f94447 Author: Dave Chinner Date: Tue Mar 29 18:21:59 2022 -0700 xfs: aborting inodes on shutdown may need buffer lock Most buffer io list operations are run with the bp->b_lock held, but xfs_iflush_abort() can be called without the buffer lock being held resulting in inodes being removed from the buffer list while other list operations are occurring. This causes problems with corrupted bp->b_io_list inode lists during filesystem shutdown, leading to traversals that never end, double removals from the AIL, etc. Fix this by passing the buffer to xfs_iflush_abort() if we have it locked. If the inode is attached to the buffer, we're going to have to remove it from the buffer list and we'd have to get the buffer off the inode log item to do that anyway. If we don't have a buffer passed in (e.g. from xfs_reclaim_inode()) then we can determine if the inode has a log item and if it is attached to a buffer before we do anything else. If it does have an attached buffer, we can lock it safely (because the inode has a reference to it) and then perform the inode abort. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_icache.c | 2 +- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_inode_item.c | 162 +++++++++++++++++++++++++++++++++++++++--------- fs/xfs/xfs_inode_item.h | 1 + 4 files changed, 136 insertions(+), 31 deletions(-) commit 1ec48f95519bd3e920536118e8ddd30e28cde4ab Merge: 1c24a186398f a53046291020 Author: Linus Torvalds Date: Tue Mar 29 18:17:30 2022 -0700 Merge tag 'jfs-5.18' of https://github.com/kleikamp/linux-shaggy Pull jfs updates from Dave Kleikamp: "A couple bug fixes" * tag 'jfs-5.18' of https://github.com/kleikamp/linux-shaggy: jfs: prevent NULL deref in diFree jfs: fix divide error in dbNextAG commit 6094e391e643fddd65d4b938c1d499a838dd4907 Author: Vinod Koul Date: Sat Mar 26 01:37:31 2022 +0530 dt-bindings: net: qcom,ethqos: Document SM8150 SoC compatible SM8150 has an ethernet controller and it needs a different configuration, so add a new compatible for this. Acked-by: Rob Herring Signed-off-by: Vinod Koul [bhsharma: Massage the commit log] Signed-off-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20220325200731.1585554-1-bhupesh.sharma@linaro.org Signed-off-by: Jakub Kicinski Documentation/devicetree/bindings/net/qcom,ethqos.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit dc0ce6cc4b133f5f2beb8b47dacae13a7d283c2c Author: Dan Carpenter Date: Thu Mar 24 08:52:07 2022 +0300 lib/test: use after free in register_test_dev_kmod() The "test_dev" pointer is freed but then returned to the caller. Fixes: d9c6a72d6fa2 ("kmod: add test driver to stress test the module loader") Signed-off-by: Dan Carpenter Signed-off-by: Luis Chamberlain lib/test_kmod.c | 1 + 1 file changed, 1 insertion(+) commit 1c24a186398f59c80adb9a967486b65c1423a59d Author: Linus Torvalds Date: Tue Mar 29 15:06:39 2022 -0700 fs: fd tables have to be multiples of BITS_PER_LONG This has always been the rule: fdtables have several bitmaps in them, and as a result they have to be sized properly for bitmaps. We walk those bitmaps in chunks of 'unsigned long' in serveral cases, but even when we don't, we use the regular kernel bitops that are defined to work on arrays of 'unsigned long', not on some byte array. Now, the distinction between arrays of bytes and 'unsigned long' normally only really ends up being noticeable on big-endian systems, but Fedor Pchelkin and Alexey Khoroshilov reported that copy_fd_bitmaps() could be called with an argument that wasn't even a multiple of BITS_PER_BYTE. And then it fails to do the proper copy even on little-endian machines. The bug wasn't in copy_fd_bitmap(), but in sane_fdtable_size(), which didn't actually sanitize the fdtable size sufficiently, and never made sure it had the proper BITS_PER_LONG alignment. That's partly because the alignment historically came not from having to explicitly align things, but simply from previous fdtable sizes, and from count_open_files(), which counts the file descriptors by walking them one 'unsigned long' word at a time and thus naturally ends up doing sizing in the proper 'chunks of unsigned long'. But with the introduction of close_range(), we now have an external source of "this is how many files we want to have", and so sane_fdtable_size() needs to do a better job. This also adds that explicit alignment to alloc_fdtable(), although there it is mainly just for documentation at a source code level. The arithmetic we do there to pick a reasonable fdtable size already aligns the result sufficiently. In fact,clang notices that the added ALIGN() in that function doesn't actually do anything, and does not generate any extra code for it. It turns out that gcc ends up confusing itself by combining a previous constant-sized shift operation with the variable-sized shift operations in roundup_pow_of_two(). And probably due to that doesn't notice that the ALIGN() is a no-op. But that's a (tiny) gcc misfeature that doesn't matter. Having the explicit alignment makes sense, and would actually matter on a 128-bit architecture if we ever go there. This also adds big comments above both functions about how fdtable sizes have to have that BITS_PER_LONG alignment. Fixes: 60997c3d45d9 ("close_range: add CLOSE_RANGE_UNSHARE") Reported-by: Fedor Pchelkin Reported-by: Alexey Khoroshilov Link: https://lore.kernel.org/all/20220326114009.1690-1-aissur0002@gmail.com/ Tested-and-acked-by: Christian Brauner Signed-off-by: Linus Torvalds fs/file.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) commit 31818213170caa51d116eb5dc1167b88523b4fe1 Author: Jeremy Sowden Date: Sun Mar 27 23:36:25 2022 +0100 netfilter: bitwise: fix reduce comparisons The `nft_bitwise_reduce` and `nft_bitwise_fast_reduce` functions should compare the bitwise operation in `expr` with the tracked operation associated with the destination register of `expr`. However, instead of being called on `expr` and `track->regs[priv->dreg].selector`, `nft_expr_priv` is called on `expr` twice, so both reduce functions return true even when the operations differ. Fixes: be5650f8f47e ("netfilter: nft_bitwise: track register operations") Signed-off-by: Jeremy Sowden Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_bitwise.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 60210a3d86dc57ce4a76a366e7841dda746a33f7 Author: Fangrui Song Date: Mon Mar 21 18:26:17 2022 -0700 riscv module: remove (NOLOAD) On ELF, (NOLOAD) sets the section type to SHT_NOBITS[1]. It is conceptually inappropriate for .plt, .got, and .got.plt sections which are always SHT_PROGBITS. In GNU ld, if PLT entries are needed, .plt will be SHT_PROGBITS anyway and (NOLOAD) will be essentially ignored. In ld.lld, since https://reviews.llvm.org/D118840 ("[ELF] Support (TYPE=) to customize the output section type"), ld.lld will report a `section type mismatch` error (later changed to a warning). Just remove (NOLOAD) to fix the warning. [1] https://lld.llvm.org/ELF/linker_script.html As of today, "The section should be marked as not loadable" on https://sourceware.org/binutils/docs/ld/Output-Section-Type.html is outdated for ELF. Link: https://github.com/ClangBuiltLinux/linux/issues/1597 Fixes: ab1ef68e5401 ("RISC-V: Add sections of PLT and GOT for kernel module") Reported-by: Nathan Chancellor Signed-off-by: Fangrui Song Signed-off-by: Palmer Dabbelt arch/riscv/include/asm/module.lds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 915593a7a663b2ad08b895a5f3ba8b19d89d4ebf Author: Tom Rix Date: Sat Mar 26 12:42:36 2022 -0700 rtc: check if __rtc_read_time was successful Clang static analysis reports this issue interface.c:810:8: warning: Passed-by-value struct argument contains uninitialized data now = rtc_tm_to_ktime(tm); ^~~~~~~~~~~~~~~~~~~ tm is set by a successful call to __rtc_read_time() but its return status is not checked. Check if it was successful before setting the enabled flag. Move the decl of err to function scope. Fixes: 2b2f5ff00f63 ("rtc: interface: ignore expired timers when enqueuing new timers") Signed-off-by: Tom Rix Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220326194236.2916310-1-trix@redhat.com drivers/rtc/interface.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 4b2dc39ca024990abe36ad5d145c4fe0c06afd34 Author: Miaoqian Lin Date: Wed Mar 9 09:22:25 2022 +0000 rtc: gamecube: Fix refcount leak in gamecube_rtc_read_offset_from_sram The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Fixes: 86559400b3ef ("rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U") Signed-off-by: Miaoqian Lin Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309092225.6930-1-linmq006@gmail.com drivers/rtc/rtc-gamecube.c | 1 + 1 file changed, 1 insertion(+) commit 3ae8fd41573af4fb3a490c9ed947fc936ba87190 Author: Mario Limonciello Date: Tue Jan 11 16:57:50 2022 -0600 rtc: mc146818-lib: Fix the AltCentury for AMD platforms Setting the century forward has been failing on AMD platforms. There was a previous attempt at fixing this for family 0x17 as part of commit 7ad295d5196a ("rtc: Fix the AltCentury value on AMD/Hygon platform") but this was later reverted due to some problems reported that appeared to stem from an FW bug on a family 0x17 desktop system. The same comments mentioned in the previous commit continue to apply to the newer platforms as well. ``` MC146818 driver use function mc146818_set_time() to set register RTC_FREQ_SELECT(RTC_REG_A)'s bit4-bit6 field which means divider stage reset value on Intel platform to 0x7. While AMD/Hygon RTC_REG_A(0Ah)'s bit4 is defined as DV0 [Reference]: DV0 = 0 selects Bank 0, DV0 = 1 selects Bank 1. Bit5-bit6 is defined as reserved. DV0 is set to 1, it will select Bank 1, which will disable AltCentury register(0x32) access. As UEFI pass acpi_gbl_FADT.century 0x32 (AltCentury), the CMOS write will be failed on code: CMOS_WRITE(century, acpi_gbl_FADT.century). Correct RTC_REG_A bank select bit(DV0) to 0 on AMD/Hygon CPUs, it will enable AltCentury(0x32) register writing and finally setup century as expected. ``` However in closer examination the change previously submitted was also modifying bits 5 & 6 which are declared reserved in the AMD documentation. So instead modify just the DV0 bank selection bit. Being cognizant that there was a failure reported before, split the code change out to a static function that can also be used for exclusions if any regressions such as Mikhail's pop up again. Cc: Jinke Fan Cc: Mikhail Gavrilov Link: https://lore.kernel.org/all/CABXGCsMLob0DC25JS8wwAYydnDoHBSoMh2_YLPfqm3TTvDE-Zw@mail.gmail.com/ Link: https://www.amd.com/system/files/TechDocs/51192_Bolton_FCH_RRG.pdf Signed-off-by: Raul E Rangel Signed-off-by: Mario Limonciello Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220111225750.1699-1-mario.limonciello@amd.com drivers/rtc/rtc-mc146818-lib.c | 16 +++++++++++++++- include/linux/mc146818rtc.h | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) commit 3f1d52abf098c85b177b8c6f5b310e8347d1bc42 Author: Jens Axboe Date: Tue Mar 29 10:43:56 2022 -0600 io_uring: defer msg-ring file validity check until command issue In preparation for not using the file at prep time, defer checking if this file refers to a valid io_uring instance until issue time. Signed-off-by: Jens Axboe fs/io_uring.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit a9fe7fa7d874a536e0540469f314772c054a0323 Author: John David Anglin Date: Tue Mar 29 18:54:36 2022 +0000 parisc: Fix patch code locking and flushing This change fixes the following: 1) The flags variable is not initialized. Always use raw_spin_lock_irqsave and raw_spin_unlock_irqrestore to serialize patching. 2) flush_kernel_vmap_range is primarily intended for DMA flushes. Since __patch_text_multiple is often called with interrupts disabled, it is better to directly call flush_kernel_dcache_range_asm and flush_kernel_icache_range_asm. This avoids an extra call. 3) The final call to flush_icache_range is unnecessary. Signed-off-by: John David Anglin Signed-off-by: Helge Deller arch/parisc/kernel/patch.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) commit 1afde47d082c92c4fd3d9b322d944f8d87469834 Author: Helge Deller Date: Sun Mar 27 15:03:53 2022 +0200 parisc: Find a new timesync master if current CPU is removed When CPU hotplugging is enabled, the user may want to remove the current CPU which is providing the timer ticks. If this happens we need to find a new timesync master. Signed-off-by: Helge Deller arch/parisc/include/asm/processor.h | 1 + arch/parisc/kernel/smp.c | 6 ++++++ arch/parisc/kernel/time.c | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) commit ca45ec3cb44aabe0933f9e10dba1b6946afb2a13 Author: Helge Deller Date: Fri Mar 25 14:22:57 2022 +0100 parisc: Move common_stext into .text section when CONFIG_HOTPLUG_CPU=y Move the common_stext function into the non-init text section if hotplug is enabled. This function is called from the firmware when hotplugged CPUs are brought up. Signed-off-by: Helge Deller arch/parisc/kernel/head.S | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 98903688e6106d9ca68e44c7d218e61336d54631 Author: Helge Deller Date: Fri Mar 25 14:27:21 2022 +0100 parisc: Rewrite arch_cpu_idle_dead() for CPU hotplugging Let the PDC firmware put the CPU into firmware idle loop with the pdc_cpu_rendezvous() function. Signed-off-by: Helge Deller arch/parisc/kernel/process.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) commit 88b3aac6228baaac6a3bcc0808845083b9d9f08f Author: Helge Deller Date: Fri Mar 25 14:31:08 2022 +0100 parisc: Implement __cpu_die() and __cpu_disable() for CPU hotplugging Add relevant code to __cpu_die() and __cpu_disable() to finally enable the CPU hotplugging features. Reset the irq count values in smp_callin() to zero before bringing up the CPU. It seems that the firmware may need up to 8 seconds to fully stop a CPU in which no other PDC calls are allowed to be made. Use a timeout __cpu_die() to accommodate for this. Use "chcpu -d 1" to bring CPU1 down, and "chcpu -e 1" to bring it up. Signed-off-by: Helge Deller arch/parisc/Kconfig | 1 + arch/parisc/include/asm/smp.h | 9 +--- arch/parisc/kernel/smp.c | 102 +++++++++++++++++++++++++++++++++++------- 3 files changed, 90 insertions(+), 22 deletions(-) commit db2b0d76cdc4e781d32bf26d0c649ca2fe608c4e Author: Helge Deller Date: Tue Mar 29 14:15:29 2022 +0200 parisc: Add PDC locking functions for rendezvous code Add pdc_cpu_rendezvous_lock() and pdc_cpu_rendezvous_unlock() to lock PDC while CPU is transitioning into rendezvous state. This is needed, because the transition phase may take up to 8 seconds. Add pdc_pat_get_PDC_entrypoint() to get PDC entry point for current CPU. Signed-off-by: Helge Deller arch/parisc/include/asm/pdc.h | 3 +++ arch/parisc/include/asm/pdcpat.h | 3 ++- arch/parisc/kernel/firmware.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) commit 4d7d4c3fc1aed6bf95fa188c30bc9ba5901f6531 Author: Helge Deller Date: Fri Mar 25 12:52:24 2022 +0100 parisc: Move disable_sr_hashing_asm() into .text section Signed-off-by: Helge Deller arch/parisc/kernel/pacache.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit beb48dfd9672f82413e3b2bac220331073afbb02 Author: Helge Deller Date: Sat Mar 26 15:10:54 2022 +0100 parisc: Move CPU startup-related functions into .text section If CONFIG_HOTPLUG_CPU is enabled, those functions will be run again after bootup. So they need to reside in the .text section. Signed-off-by: Helge Deller arch/parisc/kernel/cache.c | 2 +- arch/parisc/kernel/irq.c | 2 +- arch/parisc/kernel/processor.c | 2 +- arch/parisc/kernel/time.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) commit 95370b4031ec67f9749e5873ae7139a53cc6bf53 Author: Helge Deller Date: Fri Mar 25 12:50:13 2022 +0100 parisc: Move store_cpu_topology() into text section Signed-off-by: Helge Deller arch/parisc/kernel/topology.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 62773112acc55d29727465d075fc61ed08a0a532 Author: Helge Deller Date: Thu Mar 24 19:46:50 2022 +0100 parisc: Switch from GENERIC_CPU_DEVICES to GENERIC_ARCH_TOPOLOGY Switch away from the own cpu topology code to common code which is used by ARM64 and RISCV. That will allow us to enable CPU hotplug later on. Signed-off-by: Helge Deller arch/parisc/Kconfig | 11 ++---- arch/parisc/include/asm/topology.h | 23 ++---------- arch/parisc/kernel/Makefile | 2 +- arch/parisc/kernel/processor.c | 4 ++- arch/parisc/kernel/topology.c | 72 ++++++++------------------------------ 5 files changed, 24 insertions(+), 88 deletions(-) commit 1e93848a385ed2c2df9cb246b073dc8c66d10793 Author: Helge Deller Date: Fri Mar 25 13:10:45 2022 +0100 parisc: Ensure set_firmware_width() is called only once Call set_firmware_width() only once at runtime. This prevents that hotplugged CPUs will get stuck in spinlocks later on. Signed-off-by: Helge Deller arch/parisc/kernel/firmware.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 7e0b2be94c3142c4ce1e9f7f28747dea4a1ef5bd Author: Helge Deller Date: Fri Mar 25 17:37:51 2022 +0100 parisc: Add constants for control registers and clean up mfctl() Clean up the code for the mfctl() and mtctl() functions and add often used constants. Signed-off-by: Helge Deller arch/parisc/include/asm/special_insns.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) commit ed9794812b0a61f62317991c5c3e6c78749a0bdc Author: Helge Deller Date: Mon Mar 21 22:02:01 2022 +0100 parisc: Detect hppa-suse-linux-gcc compiler for cross-building Allow the system to find the SUSE hppa compiler and linker to set CROSS32_COMPILE and CROSS_COMPILE. Suggested-by: Jiri Slaby Signed-off-by: Helge Deller arch/parisc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ac2dd327944548fe732b3f7173b983791bde42a4 Author: Helge Deller Date: Sun Mar 27 15:41:06 2022 +0200 parisc: Clean up cpu_check_affinity() and drop cpu_set_affinity_irq() The cpu_set_affinity_irq() isn't needed. Not the CPU irqs need to change, but the slave irq chips simply need to be reprogrammed to a new CPU irq with the txn_* functions. Signed-off-by: Helge Deller arch/parisc/kernel/irq.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) commit 939fc856676c266c3bc347c1c1661872a3725c0f Author: Helge Deller Date: Sun Mar 27 15:46:26 2022 +0200 parisc: Fix CPU affinity for Lasi, WAX and Dino chips Add the missing logic to allow Lasi, WAX and Dino to set the CPU affinity. This fixes IRQ migration to other CPUs when a CPU is shutdown which currently holds the IRQs for one of those chips. Signed-off-by: Helge Deller drivers/parisc/dino.c | 41 +++++++++++++++++++++++++++++++++-------- drivers/parisc/gsc.c | 31 +++++++++++++++++++++++++++++++ drivers/parisc/gsc.h | 1 + drivers/parisc/lasi.c | 7 +++---- drivers/parisc/wax.c | 7 +++---- 5 files changed, 71 insertions(+), 16 deletions(-) commit a9f84fb7158fea60cbcadef5c0166fb22b469091 Author: Thomas Gleixner Date: Thu Mar 24 14:47:08 2022 +0100 x86/fpu: Remove redundant XCOMP_BV initialization fpu_copy_uabi_to_guest_fpstate() initializes the XCOMP_BV field in the XSAVE header. That's a leftover from the old KVM FPU buffer handling code. Since d69c1382e1b7 ("x86/kvm: Convert FPU handling to a single swap buffer") KVM uses the FPU core allocation code, which initializes the XCOMP_BV field already. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20220324134623.408932232@linutronix.de arch/x86/kernel/fpu/core.c | 3 --- 1 file changed, 3 deletions(-) commit 13776ebb9964b2ea66ffb8c824c0762eed6da784 Merge: 1d59c3b669fa b2638e56c2ce Author: Linus Torvalds Date: Tue Mar 29 11:30:12 2022 -0700 Merge tag 'devprop-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull device properties code update from Rafael Wysocki: "This is based on new i2c material for 5.18-rc1 and simply reorganizes the code on top of it so as to group similar functions together (Andy Shevchenko)" * tag 'devprop-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: device property: Don't split fwnode_get_irq*() APIs in the code commit 1d59c3b669faddb91737f4e59c09305878a971d8 Merge: 5efabdadcf4a 3b65dd5be3c7 Author: Linus Torvalds Date: Tue Mar 29 11:06:55 2022 -0700 Merge tag 'pm-5.18-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 ARM cpufreq drivers, the OPP (Operating Performance Points) library and the power management documentation. Specifics: - Add per core DVFS support for QCom SoC (Bjorn Andersson), convert to yaml binding (Manivannan Sadhasivam) and various other fixes to the QCom drivers (Luca Weiss). - Add OPP table for imx7s SoC (Denys Drozdov) and minor fixes (Stefan Agner). - Fix CPPC driver's freq/performance conversions (Pierre Gondois). - Minor generic cleanups (Yury Norov). - Introduce opp-microwatt property to the OPP core, bindings, etc (Lukasz Luba). - Convert DT bindings to schema format and various related fixes (Yassine Oudjana). - Expose OPP's OF node in debugfs (Viresh Kumar). - Add Intel uncore frequency scaling documentation file to its MAINTAINERS entry (Srinivas Pandruvada). - Clean up the AMD P-state driver documentation (Jan Engelhardt)" * tag 'pm-5.18-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (24 commits) Documentation: amd-pstate: grammar and sentence structure updates dt-bindings: cpufreq: cpufreq-qcom-hw: Convert to YAML bindings dt-bindings: dvfs: Use MediaTek CPUFREQ HW as an example Documentation: EM: Describe new registration method using DT OPP: Add support of "opp-microwatt" for EM registration PM: EM: add macro to set .active_power() callback conditionally OPP: Add "opp-microwatt" supporting code dt-bindings: opp: Add "opp-microwatt" entry in the OPP MAINTAINERS: Add additional file to uncore frequency control cpufreq: blocklist Qualcomm sc8280xp and sa8540p in cpufreq-dt-platdev cpufreq: qcom-hw: Add support for per-core-dcvs dt-bindings: power: avs: qcom,cpr: Convert to DT schema arm64: dts: qcom: qcs404: Rename CPU and CPR OPP tables arm64: dts: qcom: msm8996: Rename cluster OPP tables dt-bindings: opp: Convert qcom-nvmem-cpufreq to DT schema dt-bindings: opp: qcom-opp: Convert to DT schema arm64: dts: qcom: msm8996-mtp: Add msm8996 compatible dt-bindings: arm: qcom: Add msm8996 and apq8096 compatibles opp: Expose of-node's name in debugfs cpufreq: CPPC: Fix performance/frequency conversion ... commit b1e34d325397a33d97d845e312d7cf2a8b646b44 Author: Vitaly Kuznetsov Date: Fri Mar 25 14:21:40 2022 +0100 KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC wasn't activated Setting non-zero values to SYNIC/STIMER MSRs activates certain features, this should not happen when KVM_CAP_HYPERV_SYNIC{,2} was not activated. Note, it would've been better to forbid writing anything to SYNIC/STIMER MSRs, including zeroes, however, at least QEMU tries clearing HV_X64_MSR_STIMER0_CONFIG without SynIC. HV_X64_MSR_EOM MSR is somewhat 'special' as writing zero there triggers an action, this also should not happen when SynIC wasn't activated. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220325132140.25650-4-vkuznets@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini arch/x86/kvm/hyperv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 00b5f37189d24ac3ed46cb7f11742094778c46ce Author: Vitaly Kuznetsov Date: Fri Mar 25 14:21:39 2022 +0100 KVM: x86: Avoid theoretical NULL pointer dereference in kvm_irq_delivery_to_apic_fast() When kvm_irq_delivery_to_apic_fast() is called with APIC_DEST_SELF shorthand, 'src' must not be NULL. Crash the VM with KVM_BUG_ON() instead of crashing the host. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220325132140.25650-3-vkuznets@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini arch/x86/kvm/lapic.c | 4 ++++ 1 file changed, 4 insertions(+) commit 7ec37d1cbe17d8189d9562178d8b29167fe1c31a Author: Vitaly Kuznetsov Date: Fri Mar 25 14:21:38 2022 +0100 KVM: x86: Check lapic_in_kernel() before attempting to set a SynIC irq When KVM_CAP_HYPERV_SYNIC{,2} is activated, KVM already checks for irqchip_in_kernel() so normally SynIC irqs should never be set. It is, however, possible for a misbehaving VMM to write to SYNIC/STIMER MSRs causing erroneous behavior. The immediate issue being fixed is that kvm_irq_delivery_to_apic() (kvm_irq_delivery_to_apic_fast()) crashes when called with 'irq.shorthand = APIC_DEST_SELF' and 'src == NULL'. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220325132140.25650-2-vkuznets@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini arch/x86/kvm/hyperv.c | 3 +++ 1 file changed, 3 insertions(+) commit cde363ab7ca7aea7a853851cd6a6745a9e1aaf5e Author: Paolo Bonzini Date: Tue Mar 22 12:07:12 2022 +0100 Documentation: KVM: add API issues section Add a section to document all the different ways in which the KVM API sucks. I am sure there are way more, give people a place to vent so that userspace authors are aware. Signed-off-by: Paolo Bonzini Message-Id: <20220322110712.222449-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/api.rst | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) commit 45016721de3c714902c6f475b705e10ae0bdd801 Author: Paolo Bonzini Date: Tue Mar 22 12:07:11 2022 +0100 Documentation: KVM: add virtual CPU errata documentation Add a file to document all the different ways in which the virtual CPU emulation is imperfect. Include an example to show how to document such errata. Signed-off-by: Paolo Bonzini Reviewed-by: Jim Mattson Reviewed-by: Oliver Upton Message-Id: <20220322110712.222449-3-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/x86/errata.rst | 39 +++++++++++++++++++++++++++++++++++ Documentation/virt/kvm/x86/index.rst | 1 + 2 files changed, 40 insertions(+) commit daec8d408308ee7322d86cdd2dc3332e9cdbedf9 Author: Paolo Bonzini Date: Tue Mar 22 12:07:10 2022 +0100 Documentation: KVM: add separate directories for architecture-specific documentation ARM already has an arm/ subdirectory, but s390 and x86 do not even though they have a relatively large number of files specific to them. Create new directories in Documentation/virt/kvm for these two architectures as well. While at it, group the API documentation and the developer documentation in the table of contents. Signed-off-by: Paolo Bonzini Message-Id: <20220322110712.222449-2-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/index.rst | 26 ++++++---------------- Documentation/virt/kvm/s390/index.rst | 12 ++++++++++ Documentation/virt/kvm/{ => s390}/s390-diag.rst | 0 Documentation/virt/kvm/{ => s390}/s390-pv-boot.rst | 0 Documentation/virt/kvm/{ => s390}/s390-pv.rst | 0 .../virt/kvm/{ => x86}/amd-memory-encryption.rst | 0 Documentation/virt/kvm/{ => x86}/cpuid.rst | 0 Documentation/virt/kvm/{ => x86}/halt-polling.rst | 0 Documentation/virt/kvm/{ => x86}/hypercalls.rst | 0 Documentation/virt/kvm/x86/index.rst | 18 +++++++++++++++ Documentation/virt/kvm/{ => x86}/mmu.rst | 0 Documentation/virt/kvm/{ => x86}/msr.rst | 0 Documentation/virt/kvm/{ => x86}/nested-vmx.rst | 0 .../virt/kvm/{ => x86}/running-nested-guests.rst | 0 Documentation/virt/kvm/{ => x86}/timekeeping.rst | 0 15 files changed, 37 insertions(+), 19 deletions(-) commit 99a17b77704a44a89ec22509d73b1727763f2930 Author: Paolo Bonzini Date: Tue Mar 22 12:07:20 2022 +0100 Documentation: kvm: include new locks kvm->mn_invalidate_lock and kvm->slots_arch_lock were not included in the documentation, add them. Signed-off-by: Paolo Bonzini Message-Id: <20220322110720.222499-3-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/locking.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit e9611bf9d24a259193290f6ac8d33844a054c8f7 Author: Paolo Bonzini Date: Tue Mar 22 12:07:19 2022 +0100 Documentation: kvm: fixes for locking.rst Separate the various locks clearly, and include the new names of blocked_vcpu_on_cpu_lock and blocked_vcpu_on_cpu. Signed-off-by: Paolo Bonzini Message-Id: <20220322110720.222499-2-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/locking.rst | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) commit 07ea4ab1f9b83953ff5c3f6ccfb84d581bfe0046 Author: Nathan Chancellor Date: Tue Mar 22 08:29:06 2022 -0700 KVM: x86: Fix clang -Wimplicit-fallthrough in do_host_cpuid() Clang warns: arch/x86/kvm/cpuid.c:739:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] default: ^ arch/x86/kvm/cpuid.c:739:2: note: insert 'break;' to avoid fall-through default: ^ break; 1 error generated. Clang is a little more pedantic than GCC, which does not warn when falling through to a case that is just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst, which states that all switch/case blocks must end in either break, fallthrough, continue, goto, or return. Add the missing break to silence the warning. Fixes: f144c49e8c39 ("KVM: x86: synthesize CPUID leaf 0x80000021h if useful") Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Message-Id: <20220322152906.112164-1-nathan@kernel.org> Signed-off-by: Paolo Bonzini arch/x86/kvm/cpuid.c | 1 + 1 file changed, 1 insertion(+) commit cf683abd3913d5e6e51169de75d65ea193452fbd Merge: c64dd8ea8e05 5e916932df63 c5601e0720ce Author: Stephen Boyd Date: Tue Mar 29 10:19:52 2022 -0700 Merge branches 'clk-sifive' and 'clk-visconti' into clk-next * clk-sifive: clk: sifive: Move all stuff into SoCs header files from C files clk: sifive: Add SoCs prefix in each SoCs-dependent data riscv: dts: Change the macro name of prci in each device node dt-bindings: change the macro name of prci in header files and example clk: sifive: duplicate the macro definitions for the time being * clk-visconti: clk: visconti: prevent array overflow in visconti_clk_register_gates() commit c64dd8ea8e05af69e9c793419452d19e8e89da15 Merge: 4222744d4057 7dabfa2bc480 ca85a66710a8 236541ace29e 71021db1c532 Author: Stephen Boyd Date: Tue Mar 29 10:19:36 2022 -0700 Merge branches 'clk-range', 'clk-uniphier', 'clk-apple' and 'clk-qcom' into clk-next - Make clk_set_rate_range() re-evaluate the limits each time - Introduce various clk_set_rate_range() tests - Add clk_drop_range() to drop a previously set range - Support for NCO blocks on Apple SoCs * clk-range: clk: Drop the rate range on clk_put() clk: test: Test clk_set_rate_range on orphan mux clk: Initialize orphan req_rate clk: bcm: rpi: Run some clocks at the minimum rate allowed clk: bcm: rpi: Set a default minimum rate clk: bcm: rpi: Add variant structure clk: Add clk_drop_range clk: Always set the rate on clk_set_range_rate clk: Use clamp instead of open-coding our own clk: Always clamp the rounded rate clk: Enforce that disjoints limits are invalid clk: Introduce Kunit Tests for the framework clk: Fix clk_hw_get_clk() when dev is NULL * clk-uniphier: clk: uniphier: Fix fixed-rate initialization * clk-apple: clk: clk-apple-nco: Allow and fix module building MAINTAINERS: Add clk-apple-nco under ARM/APPLE MACHINE clk: clk-apple-nco: Add driver for Apple NCO dt-bindings: clock: Add Apple NCO * clk-qcom: (61 commits) clk: qcom: gcc-msm8994: Fix gpll4 width dt-bindings: clock: fix dt_binding_check error for qcom,gcc-other.yaml clk: qcom: Add display clock controller driver for SM6125 dt-bindings: clock: add QCOM SM6125 display clock bindings clk: qcom: Fix sorting of SDX_GCC_65 in Makefile and Kconfig clk: qcom: gcc: Add emac GDSC support for SM8150 clk: qcom: gcc: sm8150: Fix some identation issues clk: qcom: gcc: Add UFS_CARD and UFS_PHY GDSCs for SM8150 clk: qcom: gcc: Add PCIe0 and PCIe1 GDSC for SM8150 clk: qcom: clk-rcg2: Update the frac table for pixel clock clk: qcom: clk-rcg2: Update logic to calculate D value for RCG clk: qcom: smd: Add missing MSM8998 RPM clocks clk: qcom: smd: Add missing RPM clocks for msm8992/4 dt-bindings: clock: qcom: rpmcc: Add RPM Modem SubSystem (MSS) clocks clk: qcom: gcc-ipq806x: add CryptoEngine resets dt-bindings: reset: add ipq8064 ce5 resets clk: qcom: gcc-ipq806x: add CryptoEngine clocks dt-bindings: clock: add ipq8064 ce5 clk define clk: qcom: gcc-ipq806x: add additional freq for sdc table clk: qcom: clk-rcg: add clk_rcg_floor_ops ops ... commit 4222744d40578824f3dacb452d7b7e6cd6496d01 Merge: 9babf9520320 3028181ea3b8 579cdf58b7e5 1fdfd517ce79 a6aa462c3efc Author: Stephen Boyd Date: Tue Mar 29 10:19:10 2022 -0700 Merge branches 'clk-starfive', 'clk-ti', 'clk-terminate' and 'clk-cleanup' into clk-next - Audio clks on StarFive JH7100 RISC-V SoC - Terminate arrays with sentinels and make that clearer - Cleanup SPDX tags - Fix typos in comments * clk-starfive: clk: starfive: Add JH7100 audio clock driver clk: starfive: jh7100: Support more clock types clk: starfive: jh7100: Make hw clock implementation reusable dt-bindings: clock: Add starfive,jh7100-audclk bindings dt-bindings: clock: Add JH7100 audio clock definitions clk: starfive: jh7100: Handle audio_div clock properly clk: starfive: jh7100: Don't round divisor up twice * clk-ti: clk: ti: Drop legacy compatibility clocks for dra7 clk: ti: Drop legacy compatibility clocks for am4 clk: ti: Drop legacy compatibility clocks for am3 clk: ti: Update component clocks to use ti_dt_clk_name() clk: ti: Update pll and clockdomain clocks to use ti_dt_clk_name() clk: ti: Add ti_dt_clk_name() helper to use clock-output-names clk: ti: Use clock-output-names for clkctrl clk: ti: Add ti_find_clock_provider() to use clock-output-names clk: ti: Optionally parse IO address from parent clock node clk: ti: Preserve node in ti_dt_clocks_register() clk: ti: Constify clkctrl_name * clk-terminate: clk: actions: Make sentinel elements more obvious clk: clps711x: Terminate clk_div_table with sentinel element clk: hisilicon: Terminate clk_div_table with sentinel element clk: loongson1: Terminate clk_div_table with sentinel element clk: actions: Terminate clk_div_table with sentinel element * clk-cleanup: clk: zynq: Update the parameters to zynq_clk_register_periph_clk clk: zynq: trivial warning fix clk: qcom: sm6125-gcc: fix typos in comments clk: ti: clkctrl: fix typos in comments clk: COMMON_CLK_LAN966X should depend on SOC_LAN966 clk: Use of_device_get_match_data() clk: bcm2835: Remove unused variable clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver clk: cleanup comments clk: socfpga: cleanup spdx tags commit 9babf9520320bbfff1c2104c5f616e898c004e59 Merge: f9fca892af88 b191fe39a5ff 8df64183b8b7 ec8b55780508 328212de9f84 Author: Stephen Boyd Date: Tue Mar 29 10:18:56 2022 -0700 Merge branches 'clk-mvebu', 'clk-const', 'clk-imx' and 'clk-rockchip' into clk-next - Mark mux table as const in clk-mux - Make the all_lists array const * clk-mvebu: clk: mvebu: use time_is_before_eq_jiffies() instead of open coding it * clk-const: clk: Mark clk_core_evict_parent_cache_subtree() 'target' const clk: Mark 'all_lists' as const clk: pistachio: Declare mux table as const u32[] clk: qcom: Declare mux table as const u32[] clk: mmp: Declare mux tables as const u32[] clk: hisilicon: Remove unnecessary cast of mux table to u32 * clk: mux: Declare u32 *table parameter as const clk: nxp: Declare mux table parameter as const u32 * clk: nxp: Remove unused variable * clk-imx: (28 commits) dt-bindings: clock: drop useless consumer example clk: imx: Select MXC_CLK for i.MX93 clock driver clk: imx: remove redundant re-assignment of pll->base MAINTAINERS: clk: imx: add git tree and dt-bindings files clk: imx: pll14xx: Support dynamic rates clk: imx: pll14xx: Add pr_fmt clk: imx: pll14xx: explicitly return lowest rate clk: imx: pll14xx: name variables after usage clk: imx: pll14xx: consolidate rate calculation clk: imx: pll14xx: Use FIELD_GET/FIELD_PREP clk: imx: pll14xx: Drop wrong shifting clk: imx: pll14xx: Use register defines consistently clk: imx8mp: remove SYS PLL 1/2 clock gates clk: imx8mn: remove SYS PLL 1/2 clock gates clk: imx8mm: remove SYS PLL 1/2 clock gates clk: imx: add i.MX93 clk clk: imx: support fracn gppll clk: imx: add i.MX93 composite clk dt-bindings: clock: add i.MX93 clock definition dt-bindings: clock: Add imx93 clock support ... * clk-rockchip: clk: rockchip: re-add rational best approximation algorithm to the fractional divider clk/rockchip: Use of_device_get_match_data() clk: rockchip: Add CLK_SET_RATE_PARENT to the HDMI reference clock on rk3568 clk: rockchip: drop CLK_SET_RATE_PARENT from dclk_vop* on rk3568 clk: rockchip: Add more PLL rates for rk3568 commit f9fca892af88e49fb150e570afde85700203d84b Merge: 407c04d6ad48 4917394e0c76 a992acbb219a 5edffb980519 3b1db05cee07 Author: Stephen Boyd Date: Tue Mar 29 10:18:37 2022 -0700 Merge branches 'clk-xilinx', 'clk-kunit', 'clk-cs2000' and 'clk-renesas' into clk-next - Kunit tests for clk-gate implementation - Convert Cirrus Logic CS2000P driver to regmap, yamlify DT binding and add support for dynamic mode * clk-xilinx: clk: zynqmp: replace warn_once with pr_debug for failed clock ops * clk-kunit: clk: gate: Add some kunit test suites * clk-cs2000: clk: cs2000-cp: convert driver to regmap clk: cs2000-cp: freeze config during register fiddling clk: cs2000-cp: make clock skip setting configurable clk: cs2000-cp: add support for dynamic mode clk: cs2000-cp: Make aux output function controllable dt-bindings: clock: cs2000-cp: document cirrus,dynamic-mode dt-bindings: clock: cs2000-cp: document cirrus,clock-skip flag dt-bindings: clock: cs2000-cp: document aux-output-source dt-bindings: clock: convert cs2000-cp bindings to yaml * clk-renesas: dt-bindings: clock: renesas: Make example 'clocks' parsable clk: rs9: Add Renesas 9-series PCIe clock generator driver clk: fixed-factor: Introduce devm_clk_hw_register_fixed_factor_index() dt-bindings: clk: rs9: Add Renesas 9-series I2C PCIe clock generator clk: renesas: r8a779f0: Add PFC clock clk: renesas: r8a779f0: Add I2C clocks clk: renesas: r8a779f0: Add WDT clock clk: renesas: r8a779f0: Fix RSW2 clock divider clk: renesas: rzg2l-cpg: Add support for RZ/V2L SoC dt-bindings: clock: renesas: Document RZ/V2L SoC dt-bindings: clock: Add R9A07G054 CPG Clock and Reset Definitions clk: renesas: r8a779a0: Add CANFD module clock clk: renesas: r9a07g044: Update multiplier and divider values for PLL2/3 clk: renesas: r8a7799[05]: Add MLP clocks clk: renesas: r8a779f0: Add SYS-DMAC clocks commit 407c04d6ad48692a9764fecf51db55f4d7b32be4 Merge: 754e0b0e3560 635e5e73370e 982c59537523 d54bb86b8955 34f749787653 e9ed1ef18a37 Author: Stephen Boyd Date: Tue Mar 29 10:18:21 2022 -0700 Merge branches 'clk-microchip', 'clk-si', 'clk-mtk', 'clk-at91' and 'clk-st' into clk-next - Clock configuration on Microchip PolarFire SoCs - Free allocations on probe error in Mediatek clk driver - Modernize Mediatek clk driver by consolidating code * clk-microchip: clk: microchip: Add driver for Microchip PolarFire SoC dt-bindings: clk: microchip: Add Microchip PolarFire host binding * clk-si: clk-si5341: replace snprintf in show functions with sysfs_emit clk: si5341: fix reported clk_rate when output divider is 2 * clk-mtk: (32 commits) clk: mediatek: Warn if clk IDs are duplicated clk: mediatek: mt8195: Implement remove functions clk: mediatek: mt8195: Implement error handling in probe functions clk: mediatek: mt8195: Hook up mtk_clk_simple_remove() clk: mediatek: Unregister clks in mtk_clk_simple_probe() error path clk: mediatek: mtk: Implement error handling in register APIs clk: mediatek: pll: Implement error handling in register API clk: mediatek: mux: Implement error handling in register API clk: mediatek: mux: Reverse check for existing clk to reduce nesting level clk: mediatek: gate: Implement error handling in register API clk: mediatek: cpumux: Implement error handling in register API clk: mediatek: mtk: Clean up included headers clk: mediatek: Add mtk_clk_simple_remove() clk: mediatek: Implement mtk_clk_unregister_composites() API clk: mediatek: Implement mtk_clk_unregister_divider_clks() API clk: mediatek: Implement mtk_clk_unregister_factors() API clk: mediatek: Implement mtk_clk_unregister_fixed_clks() API clk: mediatek: pll: Clean up included headers clk: mediatek: pll: Implement unregister API clk: mediatek: pll: Split definitions into separate header file ... * clk-at91: clk: at91: clk-master: remove dead code clk: at91: sama7g5: fix parents of PDMCs' GCLK clk: at91: sama7g5: Allow MCK1 to be exported and referenced in DT clk: at91: allow setting PMC_AUDIOPINCK clock parents via DT * clk-st: clk: stm32mp1: Add parent_data to ETHRX clock clk: stm32mp1: Split ETHCK_K into separate MUX and GATE clock commit a6aa462c3efc144808b0cf8a0fe993d4fe2c079a Author: Shubhrajyoti Datta Date: Tue Feb 22 18:39:03 2022 +0530 clk: zynq: Update the parameters to zynq_clk_register_periph_clk In case there are only one gate or the two_gate is 0 the clk1 clock passed is not used. We are passing 0 which is arm_pll. Pass a invalid clock instead. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220222130903.17235-3-shubhrajyoti.datta@xilinx.com Signed-off-by: Stephen Boyd drivers/clk/zynq/clkc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit d583804c97c5ae7a7eba9c44982adcb106c2d160 Author: Shubhrajyoti Datta Date: Tue Feb 22 18:39:02 2022 +0530 clk: zynq: trivial warning fix Fix the below warning WARNING: Missing a blank line after declarations + int enable = !!(fclk_enable & BIT(i - fclk0)); + zynq_clk_register_fclk(i, clk_output_name[i], Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20220222130903.17235-2-shubhrajyoti.datta@xilinx.com Signed-off-by: Stephen Boyd drivers/clk/zynq/clkc.c | 1 + 1 file changed, 1 insertion(+) commit 70375c2d8fa3fb9b0b59207a9c5df1e2e1205c10 Author: David Matlack Date: Thu Mar 3 18:33:28 2022 +0000 Revert "KVM: set owner of cpu and vm file operations" This reverts commit 3d3aab1b973b01bd2a1aa46307e94a1380b1d802. Now that the KVM module's lifetime is tied to kvm.users_count, there is no need to also tie it's lifetime to the lifetime of the VM and vCPU file descriptors. Suggested-by: Sean Christopherson Signed-off-by: David Matlack Message-Id: <20220303183328.1499189-3-dmatlack@google.com> Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini virt/kvm/kvm_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 5f6de5cbebee925a612856fce6f9182bb3eee0db Author: David Matlack Date: Thu Mar 3 18:33:27 2022 +0000 KVM: Prevent module exit until all VMs are freed Tie the lifetime the KVM module to the lifetime of each VM via kvm.users_count. This way anything that grabs a reference to the VM via kvm_get_kvm() cannot accidentally outlive the KVM module. Prior to this commit, the lifetime of the KVM module was tied to the lifetime of /dev/kvm file descriptors, VM file descriptors, and vCPU file descriptors by their respective file_operations "owner" field. This approach is insufficient because references grabbed via kvm_get_kvm() do not prevent closing any of the aforementioned file descriptors. This fixes a long standing theoretical bug in KVM that at least affects async page faults. kvm_setup_async_pf() grabs a reference via kvm_get_kvm(), and drops it in an asynchronous work callback. Nothing prevents the VM file descriptor from being closed and the KVM module from being unloaded before this callback runs. Fixes: af585b921e5d ("KVM: Halt vcpu if page it tries to access is swapped out") Fixes: 3d3aab1b973b ("KVM: set owner of cpu and vm file operations") Cc: stable@vger.kernel.org Suggested-by: Ben Gardon [ Based on a patch from Ben implemented for Google's kernel. ] Signed-off-by: David Matlack Message-Id: <20220303183328.1499189-2-dmatlack@google.com> Signed-off-by: Paolo Bonzini virt/kvm/kvm_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 3b65dd5be3c72b9d2013bfe6e9261e2b06222fa9 Merge: 79bc8bface87 7000ef38052b Author: Rafael J. Wysocki Date: Tue Mar 29 18:53:28 2022 +0200 Merge branch 'pm-docs' Merge additional power management documentation udates for 5.18-rc1: - Add Intel uncore frequency scaling documentation file to its MAINTAINERS entry (Srinivas Pandruvada). - Clean up the AMD P-state driver documentation (Jan Engelhardt). * pm-docs: Documentation: amd-pstate: grammar and sentence structure updates MAINTAINERS: Add additional file to uncore frequency control commit 79bc8bface8767078d6803debaef54f044117731 Merge: 2353828f3695 0474bcc9c174 Author: Rafael J. Wysocki Date: Tue Mar 29 18:52:32 2022 +0200 Merge branch 'pm-opp' Merge OPP (Operating Performance Points) changes for 5.18-rc1. * pm-opp: Documentation: EM: Describe new registration method using DT OPP: Add support of "opp-microwatt" for EM registration PM: EM: add macro to set .active_power() callback conditionally OPP: Add "opp-microwatt" supporting code dt-bindings: opp: Add "opp-microwatt" entry in the OPP dt-bindings: power: avs: qcom,cpr: Convert to DT schema arm64: dts: qcom: qcs404: Rename CPU and CPR OPP tables arm64: dts: qcom: msm8996: Rename cluster OPP tables dt-bindings: opp: Convert qcom-nvmem-cpufreq to DT schema dt-bindings: opp: qcom-opp: Convert to DT schema arm64: dts: qcom: msm8996-mtp: Add msm8996 compatible dt-bindings: arm: qcom: Add msm8996 and apq8096 compatibles opp: Expose of-node's name in debugfs commit 9666d4206e9a14ff612e374b6b572b3efc797d46 Author: Jens Axboe Date: Tue Mar 29 10:50:03 2022 -0600 io_uring: fail links if msg-ring doesn't succeeed We must always call req_set_fail() if the request is failed, otherwise we won't sever links for dependent chains correctly. Fixes: 4f57f06ce218 ("io_uring: add support for IORING_OP_MSG_RING command") Signed-off-by: Jens Axboe fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) commit 5efabdadcf4a5b9a37847ecc85ba71cf2eff0fcf Merge: 9ae2a143081f 22a41e9a5044 Author: Linus Torvalds Date: Tue Mar 29 08:55:16 2022 -0700 Merge tag 'devicetree-fixes-for-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Clean-up missing '/schemas' in $ref paths - Fix MediaTek Vcodec decoder example 'dma-ranges' errors - Expand available values of PBL for snps,dwmac to fix warnings in mediatek-dwmac.yaml example - Fix warnings in MediaTek display bindings * tag 'devicetree-fixes-for-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: Fix missing '/schemas' in $ref paths dt-bindings: media: mediatek,vcodec: Fix addressing cell sizes dt-bindings: net: snps,dwmac: modify available values of PBL dt-bindings: display: mediatek: Fix examples on new bindings dt-bindings: display: mediatek, ovl: Fix 'iommu' required property typo dt-bindings: display: mediatek, mutex: Fix mediatek, gce-events type Revert "dt-bindings: display: mediatek: add ethdr definition for mt8195" commit 9ae2a143081fa8fba5042431007b33d9a855b7a2 Merge: 37fcacb50be7 8ddde07a3d28 Author: Linus Torvalds Date: Tue Mar 29 08:50:14 2022 -0700 Merge tag 'dma-mapping-5.18' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - do not zero buffer in set_memory_decrypted (Kirill A. Shutemov) - fix return value of dma-debug __setup handlers (Randy Dunlap) - swiotlb cleanups (Robin Murphy) - remove most remaining users of the pci-dma-compat.h API (Christophe JAILLET) - share the ABI header for the DMA map_benchmark with userspace (Tian Tao) - update the maintainer for DMA MAPPING BENCHMARK (Xiang Chen) - remove CONFIG_DMA_REMAP (me) * tag 'dma-mapping-5.18' of git://git.infradead.org/users/hch/dma-mapping: dma-mapping: benchmark: extract a common header file for map_benchmark definition dma-debug: fix return value of __setup handlers dma-mapping: remove CONFIG_DMA_REMAP media: v4l2-pci-skeleton: Remove usage of the deprecated "pci-dma-compat.h" API rapidio/tsi721: Remove usage of the deprecated "pci-dma-compat.h" API sparc: Remove usage of the deprecated "pci-dma-compat.h" API agp/intel: Remove usage of the deprecated "pci-dma-compat.h" API alpha: Remove usage of the deprecated "pci-dma-compat.h" API MAINTAINERS: update maintainer list of DMA MAPPING BENCHMARK swiotlb: simplify array allocation swiotlb: tidy up includes swiotlb: simplify debugfs setup swiotlb: do not zero buffer in set_memory_decrypted() commit 37fcacb50be7071d146144a6c5c5bf0194b9a1cf Author: Geert Uytterhoeven Date: Tue Mar 29 14:56:31 2022 +0200 phy: PHY_FSL_LYNX_28G should depend on ARCH_LAYERSCAPE Freescale Layerscape Lynx 28G SerDes PHYs are only present on Freescale/NXP Layerscape SoCs. Move PHY_FSL_LYNX_28G outside the block for ARCH_MXC, as the latter is meant for i.MX8 SoCs, which is a different family than Layerscape. Add a dependency on ARCH_LAYERSCAPE, to prevent asking the user about this driver when configuring a kernel without Layerscape SoC support. Fixes: 02e2af20f4f9f2aa ("Merge tag 'char-misc-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc") Fixes: 8f73b37cf3fbda67 ("phy: add support for the Layerscape SerDes 28G") Signed-off-by: Geert Uytterhoeven Signed-off-by: Linus Torvalds drivers/phy/freescale/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 08a491b2e4b1c4c618ee82d3f4b0ff3b20c5acf5 Author: Helge Deller Date: Sun Mar 27 18:53:42 2022 +0200 Revert "parisc: Fix invalidate/flush vmap routines" This reverts commit 53d862fac4a09b9c56cca0433fa9de5732fd05a1. It turned out that flush_kernel_vmap_range() is being called with interrupts disabled. There's no way to flush entire cache with interrupts disabled. Signed-off-by: Helge Deller arch/parisc/kernel/cache.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) commit 4009a4ac82dd95b8cd2b62bd30019476983f0aff Author: Joerg Roedel Date: Mon Mar 21 10:33:51 2022 +0100 x86/sev: Unroll string mmio with CC_ATTR_GUEST_UNROLL_STRING_IO The io-specific memcpy/memset functions use string mmio accesses to do their work. Under SEV, the hypervisor can't emulate these instructions because they read/write directly from/to encrypted memory. KVM will inject a page fault exception into the guest when it is asked to emulate string mmio instructions for an SEV guest: BUG: unable to handle page fault for address: ffffc90000065068 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 8000100000067 P4D 8000100000067 PUD 80001000fb067 PMD 80001000fc067 PTE 80000000fed40173 Oops: 0000 [#1] PREEMPT SMP NOPTI CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.17.0-rc7 #3 As string mmio for an SEV guest can not be supported by the hypervisor, unroll the instructions for CC_ATTR_GUEST_UNROLL_STRING_IO enabled kernels. This issue appears when kernels are launched in recent libvirt-managed SEV virtual machines, because virt-install started to add a tpm-crb device to the guest by default and proactively because, raisins: https://github.com/virt-manager/virt-manager/commit/eb58c09f488b0633ed1eea012cd311e48864401e and as that commit says, the default adding of a TPM can be disabled with "virt-install ... --tpm none". The kernel driver for tpm-crb uses memcpy_to/from_io() functions to access MMIO memory, resulting in a page-fault injected by KVM and crashing the kernel at boot. [ bp: Massage and extend commit message. ] Fixes: d8aa7eea78a1 ('x86/mm: Add Secure Encrypted Virtualization (SEV) support') Signed-off-by: Joerg Roedel Signed-off-by: Borislav Petkov Reviewed-by: Tom Lendacky Cc: Link: https://lore.kernel.org/r/20220321093351.23976-1-joro@8bytes.org arch/x86/lib/iomem.c | 65 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 8 deletions(-) commit b6cae15b5710c8097aad26a2e5e752c323ee5348 Author: Michael Kelley Date: Sun Mar 27 08:25:10 2022 -0700 Drivers: hv: vmbus: Prevent load re-ordering when reading ring buffer When reading a packet from a host-to-guest ring buffer, there is no memory barrier between reading the write index (to see if there is a packet to read) and reading the contents of the packet. The Hyper-V host uses store-release when updating the write index to ensure that writes of the packet data are completed first. On the guest side, the processor can reorder and read the packet data before the write index, and sometimes get stale packet data. Getting such stale packet data has been observed in a reproducible case in a VM on ARM64. Fix this by using virt_load_acquire() to read the write index, ensuring that reads of the packet data cannot be reordered before it. Preventing such reordering is logically correct, and with this change, getting stale data can no longer be reproduced. Signed-off-by: Michael Kelley Reviewed-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/1648394710-33480-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu drivers/hv/ring_buffer.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) commit 1e06b3e71e07e0dd8801edc4f26ea1411d1d34c2 Merge: b2479de38d8f a4a6f3c8f61c Author: Jens Axboe Date: Tue Mar 29 06:22:38 2022 -0600 Merge tag 'nvme-5.18-2022-03-29' of git://git.infradead.org/nvme into for-5.18/drivers Pull NVMe fixes from Christoph: "- fix multipath hang when disk goes live over reconnect (Anton Eidelman) - fix RCU hole that allowed for endless looping in multipath round robin (Chris Leech) - remove redundant assignment after left shift (Colin Ian King) - add quirks for Samsung X5 SSDs (Monish Kumar R) - fix the read-only state for zoned namespaces with unsupposed features (Pankaj Raghav) - use a private workqueue instead of the system workqueue in nvmet (Sagi Grimberg) - allow duplicate NSIDs for private namespaces (Sungup Moon) - expose use_threaded_interrupts read-only in sysfs (Xin Hao)" * tag 'nvme-5.18-2022-03-29' of git://git.infradead.org/nvme: nvme-multipath: fix hang when disk goes live over reconnect nvme: fix RCU hole that allowed for endless looping in multipath round robin nvme: allow duplicate NSIDs for private namespaces nvmet: remove redundant assignment after left shift nvmet: use a private workqueue instead of the system workqueue nvme-pci: add quirks for Samsung X5 SSDs nvme-pci: expose use_threaded_interrupts read-only in sysfs nvme: fix the read-only state for zoned namespaces with unsupposed features commit 8d21732475c637c7efcdb91dc927a4c594e97898 Author: Michael Kelley Date: Thu Mar 24 09:14:52 2022 -0700 PCI: hv: Propagate coherence from VMbus device to PCI device PCI pass-thru devices in a Hyper-V VM are represented as a VMBus device and as a PCI device. The coherence of the VMbus device is set based on the VMbus node in ACPI, but the PCI device has no ACPI node and defaults to not hardware coherent. This results in extra software coherence management overhead on ARM64 when devices are hardware coherent. Fix this by setting up the PCI host bus so that normal PCI mechanisms will propagate the coherence of the VMbus device to the PCI device. There's no effect on x86/x64 where devices are always hardware coherent. Signed-off-by: Michael Kelley Acked-by: Boqun Feng Acked-by: Robin Murphy Link: https://lore.kernel.org/r/1648138492-2191-3-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu drivers/pci/controller/pci-hyperv.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 37200078ed6aa2ac3c88a01a64996133dccfdd34 Author: Michael Kelley Date: Thu Mar 24 09:14:51 2022 -0700 Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device VMbus synthetic devices are not represented in the ACPI DSDT -- only the top level VMbus device is represented. As a result, on ARM64 coherence information in the _CCA method is not specified for synthetic devices, so they default to not hardware coherent. Drivers for some of these synthetic devices have been recently updated to use the standard DMA APIs, and they are incurring extra overhead of unneeded software coherence management. Fix this by propagating coherence information from the VMbus node in ACPI to the individual synthetic devices. There's no effect on x86/x64 where devices are always hardware coherent. Signed-off-by: Michael Kelley Acked-by: Robin Murphy Link: https://lore.kernel.org/r/1648138492-2191-2-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu drivers/hv/hv_common.c | 11 +++++++++++ drivers/hv/vmbus_drv.c | 31 +++++++++++++++++++++++++++++++ include/asm-generic/mshyperv.h | 1 + 3 files changed, 43 insertions(+) commit 792f232d57ff28bbd5f9c4abe0466b23d5879dc8 Author: Guilherme G. Piccoli Date: Tue Mar 15 17:35:35 2022 -0300 Drivers: hv: vmbus: Fix potential crash on module unload The vmbus driver relies on the panic notifier infrastructure to perform some operations when a panic event is detected. Since vmbus can be built as module, it is required that the driver handles both registering and unregistering such panic notifier callback. After commit 74347a99e73a ("x86/Hyper-V: Unload vmbus channel in hv panic callback") though, the panic notifier registration is done unconditionally in the module initialization routine whereas the unregistering procedure is conditionally guarded and executes only if HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE capability is set. This patch fixes that by unconditionally unregistering the panic notifier in the module's exit routine as well. Fixes: 74347a99e73a ("x86/Hyper-V: Unload vmbus channel in hv panic callback") Signed-off-by: Guilherme G. Piccoli Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220315203535.682306-1-gpiccoli@igalia.com Signed-off-by: Wei Liu drivers/hv/vmbus_drv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 3a5469582c241abca22500f36a9cb8e9331969cf Author: Andrea Parri (Microsoft) Date: Tue Mar 15 15:10:53 2022 +0100 Drivers: hv: vmbus: Fix initialization of device object in vmbus_device_register() Initialize the device's dma_{mask,parms} pointers and the device's dma_mask value before invoking device_register(). Address the following trace with 5.17-rc7: [ 49.646839] WARNING: CPU: 0 PID: 189 at include/linux/dma-mapping.h:543 netvsc_probe+0x37a/0x3a0 [hv_netvsc] [ 49.646928] Call Trace: [ 49.646930] [ 49.646935] vmbus_probe+0x40/0x60 [hv_vmbus] [ 49.646942] really_probe+0x1ce/0x3b0 [ 49.646948] __driver_probe_device+0x109/0x180 [ 49.646952] driver_probe_device+0x23/0xa0 [ 49.646955] __device_attach_driver+0x76/0xe0 [ 49.646958] ? driver_allows_async_probing+0x50/0x50 [ 49.646961] bus_for_each_drv+0x84/0xd0 [ 49.646964] __device_attach+0xed/0x170 [ 49.646967] device_initial_probe+0x13/0x20 [ 49.646970] bus_probe_device+0x8f/0xa0 [ 49.646973] device_add+0x41a/0x8e0 [ 49.646975] ? hrtimer_init+0x28/0x80 [ 49.646981] device_register+0x1b/0x20 [ 49.646983] vmbus_device_register+0x5e/0xf0 [hv_vmbus] [ 49.646991] vmbus_add_channel_work+0x12d/0x190 [hv_vmbus] [ 49.646999] process_one_work+0x21d/0x3f0 [ 49.647002] worker_thread+0x4a/0x3b0 [ 49.647005] ? process_one_work+0x3f0/0x3f0 [ 49.647007] kthread+0xff/0x130 [ 49.647011] ? kthread_complete_and_exit+0x20/0x20 [ 49.647015] ret_from_fork+0x22/0x30 [ 49.647020] [ 49.647021] ---[ end trace 0000000000000000 ]--- Fixes: 743b237c3a7b0 ("scsi: storvsc: Add Isolation VM support for storvsc driver") Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220315141053.3223-1-parri.andrea@gmail.com Signed-off-by: Wei Liu drivers/hv/vmbus_drv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 9f8b577f7b43b2170628d6c537252785dcc2dcea Author: Andrea Parri (Microsoft) Date: Tue Mar 1 15:11:35 2022 +0100 Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests hv_panic_page might contain guest-sensitive information, do not dump it over to Hyper-V by default in isolated guests. While at it, update some comments in hyperv_{panic,die}_event(). Reported-by: Dexuan Cui Signed-off-by: Andrea Parri (Microsoft) Reviewed-by: Dexuan Cui Link: https://lore.kernel.org/r/20220301141135.2232-1-parri.andrea@gmail.com Signed-off-by: Wei Liu drivers/hv/vmbus_drv.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit ad7da1ce5749c0eb4f09dd7e5510123be56f10fb Author: Michael Walle Date: Tue Mar 29 00:03:50 2022 +0200 net: lan966x: fix kernel oops on ioctl when I/F is down ioctls handled by phy_mii_ioctl() will cause a kernel oops when the interface is down. Fix it by making sure there is a PHY attached. Fixes: 735fec995b21 ("net: lan966x: Implement SIOCSHWTSTAMP and SIOCGHWTSTAMP") Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220328220350.3118969-1-michael@walle.cc Signed-off-by: Paolo Abeni drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 3 +++ 1 file changed, 3 insertions(+) commit 807ca64e154638c7540f3dfb48a2b9a8a58385d0 Merge: f19c44452b58 82e31755e55f Author: Paolo Abeni Date: Tue Mar 29 10:24:37 2022 +0200 Merge branch 'fix-uaf-bugs-caused-by-ax25_release' Duoming Zhou says: ==================== Fix UAF bugs caused by ax25_release() The first patch fixes UAF bugs in ax25_send_control, and the second patch fixes UAF bugs in ax25 timers. ==================== Link: https://lore.kernel.org/r/cover.1648472006.git.duoming@zju.edu.cn Signed-off-by: Paolo Abeni commit 82e31755e55fbcea6a9dfaae5fe4860ade17cbc0 Author: Duoming Zhou Date: Mon Mar 28 21:00:15 2022 +0800 ax25: Fix UAF bugs in ax25 timers There are race conditions that may lead to UAF bugs in ax25_heartbeat_expiry(), ax25_t1timer_expiry(), ax25_t2timer_expiry(), ax25_t3timer_expiry() and ax25_idletimer_expiry(), when we call ax25_release() to deallocate ax25_dev. One of the UAF bugs caused by ax25_release() is shown below: (Thread 1) | (Thread 2) ax25_dev_device_up() //(1) | ... | ax25_kill_by_device() ax25_bind() //(2) | ax25_connect() | ... ax25_std_establish_data_link() | ax25_start_t1timer() | ax25_dev_device_down() //(3) mod_timer(&ax25->t1timer,..) | | ax25_release() (wait a time) | ... | ax25_dev_put(ax25_dev) //(4)FREE ax25_t1timer_expiry() | ax25->ax25_dev->values[..] //USE| ... ... | We increase the refcount of ax25_dev in position (1) and (2), and decrease the refcount of ax25_dev in position (3) and (4). The ax25_dev will be freed in position (4) and be used in ax25_t1timer_expiry(). The fail log is shown below: ============================================================== [ 106.116942] BUG: KASAN: use-after-free in ax25_t1timer_expiry+0x1c/0x60 [ 106.116942] Read of size 8 at addr ffff88800bda9028 by task swapper/0/0 [ 106.116942] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.17.0-06123-g0905eec574 [ 106.116942] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-14 [ 106.116942] Call Trace: ... [ 106.116942] ax25_t1timer_expiry+0x1c/0x60 [ 106.116942] call_timer_fn+0x122/0x3d0 [ 106.116942] __run_timers.part.0+0x3f6/0x520 [ 106.116942] run_timer_softirq+0x4f/0xb0 [ 106.116942] __do_softirq+0x1c2/0x651 ... This patch adds del_timer_sync() in ax25_release(), which could ensure that all timers stop before we deallocate ax25_dev. Signed-off-by: Duoming Zhou Signed-off-by: Paolo Abeni net/ax25/af_ax25.c | 5 +++++ 1 file changed, 5 insertions(+) commit 5352a761308397a0e6250fdc629bb3f615b94747 Author: Duoming Zhou Date: Mon Mar 28 21:00:14 2022 +0800 ax25: fix UAF bug in ax25_send_control() There are UAF bugs in ax25_send_control(), when we call ax25_release() to deallocate ax25_dev. The possible race condition is shown below: (Thread 1) | (Thread 2) ax25_dev_device_up() //(1) | | ax25_kill_by_device() ax25_bind() //(2) | ax25_connect() | ... ax25->state = AX25_STATE_1 | ... | ax25_dev_device_down() //(3) (Thread 3) ax25_release() | ax25_dev_put() //(4) FREE | case AX25_STATE_1: | ax25_send_control() | alloc_skb() //USE | The refcount of ax25_dev increases in position (1) and (2), and decreases in position (3) and (4). The ax25_dev will be freed before dereference sites in ax25_send_control(). The following is part of the report: [ 102.297448] BUG: KASAN: use-after-free in ax25_send_control+0x33/0x210 [ 102.297448] Read of size 8 at addr ffff888009e6e408 by task ax25_close/602 [ 102.297448] Call Trace: [ 102.303751] ax25_send_control+0x33/0x210 [ 102.303751] ax25_release+0x356/0x450 [ 102.305431] __sock_release+0x6d/0x120 [ 102.305431] sock_close+0xf/0x20 [ 102.305431] __fput+0x11f/0x420 [ 102.305431] task_work_run+0x86/0xd0 [ 102.307130] get_signal+0x1075/0x1220 [ 102.308253] arch_do_signal_or_restart+0x1df/0xc00 [ 102.308253] exit_to_user_mode_prepare+0x150/0x1e0 [ 102.308253] syscall_exit_to_user_mode+0x19/0x50 [ 102.308253] do_syscall_64+0x48/0x90 [ 102.308253] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 102.308253] RIP: 0033:0x405ae7 This patch defers the free operation of ax25_dev and net_device after all corresponding dereference sites in ax25_release() to avoid UAF. Fixes: 9fd75b66b8f6 ("ax25: Fix refcount leaks caused by ax25_cb_del()") Signed-off-by: Duoming Zhou Signed-off-by: Paolo Abeni net/ax25/af_ax25.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit f19c44452b58a84d95e209b847f5495d91c9983a Author: Martin Varghese Date: Mon Mar 28 11:11:48 2022 +0530 openvswitch: Fixed nd target mask field in the flow dump. IPv6 nd target mask was not getting populated in flow dump. In the function __ovs_nla_put_key the icmp code mask field was checked instead of icmp code key field to classify the flow as neighbour discovery. ufid:bdfbe3e5-60c2-43b0-a5ff-dfcac1c37328, recirc_id(0),dp_hash(0/0), skb_priority(0/0),in_port(ovs-nm1),skb_mark(0/0),ct_state(0/0), ct_zone(0/0),ct_mark(0/0),ct_label(0/0), eth(src=00:00:00:00:00:00/00:00:00:00:00:00, dst=00:00:00:00:00:00/00:00:00:00:00:00), eth_type(0x86dd), ipv6(src=::/::,dst=::/::,label=0/0,proto=58,tclass=0/0,hlimit=0/0,frag=no), icmpv6(type=135,code=0), nd(target=2001::2/::, sll=00:00:00:00:00:00/00:00:00:00:00:00, tll=00:00:00:00:00:00/00:00:00:00:00:00), packets:10, bytes:860, used:0.504s, dp:ovs, actions:ovs-nm2 Fixes: e64457191a25 (openvswitch: Restructure datapath.c and flow.c) Signed-off-by: Martin Varghese Link: https://lore.kernel.org/r/20220328054148.3057-1-martinvarghesenokia@gmail.com Signed-off-by: Paolo Abeni net/openvswitch/flow_netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a4a6f3c8f61c3cfbda4998ad94596059ad7e4332 Author: Anton Eidelman Date: Thu Mar 24 13:05:11 2022 -0600 nvme-multipath: fix hang when disk goes live over reconnect nvme_mpath_init_identify() invoked from nvme_init_identify() fetches a fresh ANA log from the ctrl. This is essential to have an up to date path states for both existing namespaces and for those scan_work may discover once the ctrl is up. This happens in the following cases: 1) A new ctrl is being connected. 2) An existing ctrl is successfully reconnected. 3) An existing ctrl is being reset. While in (1) ctrl->namespaces is empty, (2 & 3) may have namespaces, and nvme_read_ana_log() may call nvme_update_ns_ana_state(). This result in a hang when the ANA state of an existing namespace changes and makes the disk live: nvme_mpath_set_live() issues IO to the namespace through the ctrl, which does NOT have IO queues yet. See sample hang below. Solution: - nvme_update_ns_ana_state() to call set_live only if ctrl is live - nvme_read_ana_log() call from nvme_mpath_init_identify() therefore only fetches and parses the ANA log; any erros in this process will fail the ctrl setup as appropriate; - a separate function nvme_mpath_update() is called in nvme_start_ctrl(); this parses the ANA log without fetching it. At this point the ctrl is live, therefore, disks can be set live normally. Sample failure: nvme nvme0: starting error recovery nvme nvme0: Reconnecting in 10 seconds... block nvme0n6: no usable path - requeuing I/O INFO: task kworker/u8:3:312 blocked for more than 122 seconds. Tainted: G E 5.14.5-1.el7.elrepo.x86_64 #1 Workqueue: nvme-wq nvme_tcp_reconnect_ctrl_work [nvme_tcp] Call Trace: __schedule+0x2a2/0x7e0 schedule+0x4e/0xb0 io_schedule+0x16/0x40 wait_on_page_bit_common+0x15c/0x3e0 do_read_cache_page+0x1e0/0x410 read_cache_page+0x12/0x20 read_part_sector+0x46/0x100 read_lba+0x121/0x240 efi_partition+0x1d2/0x6a0 bdev_disk_changed.part.0+0x1df/0x430 bdev_disk_changed+0x18/0x20 blkdev_get_whole+0x77/0xe0 blkdev_get_by_dev+0xd2/0x3a0 __device_add_disk+0x1ed/0x310 device_add_disk+0x13/0x20 nvme_mpath_set_live+0x138/0x1b0 [nvme_core] nvme_update_ns_ana_state+0x2b/0x30 [nvme_core] nvme_update_ana_state+0xca/0xe0 [nvme_core] nvme_parse_ana_log+0xac/0x170 [nvme_core] nvme_read_ana_log+0x7d/0xe0 [nvme_core] nvme_mpath_init_identify+0x105/0x150 [nvme_core] nvme_init_identify+0x2df/0x4d0 [nvme_core] nvme_init_ctrl_finish+0x8d/0x3b0 [nvme_core] nvme_tcp_setup_ctrl+0x337/0x390 [nvme_tcp] nvme_tcp_reconnect_ctrl_work+0x24/0x40 [nvme_tcp] process_one_work+0x1bd/0x360 worker_thread+0x50/0x3d0 Signed-off-by: Anton Eidelman Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig drivers/nvme/host/core.c | 1 + drivers/nvme/host/multipath.c | 25 +++++++++++++++++++++++-- drivers/nvme/host/nvme.h | 4 ++++ 3 files changed, 28 insertions(+), 2 deletions(-) commit d6d6742772d712ed2238f5071b96baf4924f5fad Author: Chris Leech Date: Mon Mar 21 15:43:04 2022 -0700 nvme: fix RCU hole that allowed for endless looping in multipath round robin Make nvme_ns_remove match the assumptions elsewhere. 1) !NVME_NS_READY needs to be srcu synchronized to make sure nothing is running in __nvme_find_path or nvme_round_robin_path that will re-assign this ns to current_path. 2) Any matching current_path entries need to be cleared before removing from the siblings list, to prevent calling nvme_round_robin_path with an "old" ns that's off list. 3) Finally the list_del_rcu can happen, and then synchronize again before releasing any reference counts. Signed-off-by: Christoph Hellwig drivers/nvme/host/core.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 5974ea7ce0f9a5987fc8cf5e08ad6e3e70bb542e Author: Sungup Moon Date: Mon Mar 14 20:05:45 2022 +0900 nvme: allow duplicate NSIDs for private namespaces A NVMe subsystem with multiple controller can have private namespaces that use the same NSID under some conditions: "If Namespace Management, ANA Reporting, or NVM Sets are supported, the NSIDs shall be unique within the NVM subsystem. If the Namespace Management, ANA Reporting, and NVM Sets are not supported, then NSIDs: a) for shared namespace shall be unique; and b) for private namespace are not required to be unique." Reference: Section 6.1.6 NSID and Namespace Usage; NVM Express 1.4c spec. Make sure this specific setup is supported in Linux. Fixes: 9ad1927a3bc2 ("nvme: always search for namespace head") Signed-off-by: Sungup Moon [hch: refactored and fixed the controller vs subsystem based naming conflict] Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg drivers/nvme/host/core.c | 15 ++++++++++----- drivers/nvme/host/multipath.c | 7 ++++--- drivers/nvme/host/nvme.h | 19 +++++++++++++++++++ include/linux/nvme.h | 1 + 4 files changed, 34 insertions(+), 8 deletions(-) commit 63bc732c3aefaa0ad61e290fded9de0f5c8ccd0e Author: Colin Ian King Date: Fri Mar 18 01:30:14 2022 +0000 nvmet: remove redundant assignment after left shift The left shift is followed by a re-assignment back to cc_css, the assignment is redundant. Fix this by replacing the "<<=" operator with "<<" instead. This cleans up the clang scan build warning: drivers/nvme/target/core.c:1124:10: warning: Although the value stored to 'cc_css' is used in the enclosing expression, the value is never actually read from 'cc_css' [deadcode.DeadStores] Signed-off-by: Colin Ian King Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig drivers/nvme/target/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8832cf922151e9dfa2821736beb0ae2dd3968b6e Author: Sagi Grimberg Date: Mon Mar 21 13:57:27 2022 +0200 nvmet: use a private workqueue instead of the system workqueue Any attempt to flush kernel-global WQs has possibility of deadlock so we should simply stop using them, instead introduce nvmet_wq which is the generic nvmet workqueue for work elements that don't explicitly require a dedicated workqueue (by the mere fact that they are using the system_wq). Changes were done using the following replaces: - s/schedule_work(/queue_work(nvmet_wq, /g - s/schedule_delayed_work(/queue_delayed_work(nvmet_wq, /g - s/flush_scheduled_work()/flush_workqueue(nvmet_wq)/g Reported-by: Tetsuo Handa Signed-off-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig drivers/nvme/target/admin-cmd.c | 2 +- drivers/nvme/target/configfs.c | 2 +- drivers/nvme/target/core.c | 24 ++++++++++++++++++------ drivers/nvme/target/fc.c | 8 ++++---- drivers/nvme/target/fcloop.c | 16 ++++++++-------- drivers/nvme/target/io-cmd-file.c | 6 +++--- drivers/nvme/target/loop.c | 4 ++-- drivers/nvme/target/nvmet.h | 1 + drivers/nvme/target/passthru.c | 2 +- drivers/nvme/target/rdma.c | 12 ++++++------ drivers/nvme/target/tcp.c | 10 +++++----- 11 files changed, 50 insertions(+), 37 deletions(-) commit c42ee39c1e78224d3a81bdbe0600abe4581226ed Author: Christian König Date: Fri Mar 25 16:38:54 2022 +0100 dma-buf: handle empty dma_fence_arrays gracefully A bug inside the new sync-file merge code created empty dma_fence_array instances. Warn about that and handle those without crashing. Signed-off-by: Christian König Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220329070001.134180-2-christian.koenig@amd.com drivers/dma-buf/dma-fence-array.c | 5 +++++ 1 file changed, 5 insertions(+) commit 21d139d73f776aed1e86f3175a1e9fb8a10930c7 Author: Christian König Date: Tue Mar 29 08:45:04 2022 +0200 dma-buf/sync-file: fix logic error in new fence merge code When the array is empty because everything is signaled we can't use add_fence() to add something because that would filter the signaled fence again. Signed-off-by: Christian König Fixes: 519f490db07e ("dma-buf/sync-file: fix warning about fence containers") Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220329070001.134180-1-christian.koenig@amd.com drivers/dma-buf/sync_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ccaff3d56acc47c257a99b2807b7c78a9467cf09 Author: Yonghong Song Date: Fri Mar 25 13:03:04 2022 -0700 selftests/bpf: Fix clang compilation errors llvm upstream patch ([1]) added to issue warning for code like void test() { int j = 0; for (int i = 0; i < 1000; i++) j++; return; } This triggered several errors in selftests/bpf build since compilation flag -Werror is used. ... test_lpm_map.c:212:15: error: variable 'n_matches' set but not used [-Werror,-Wunused-but-set-variable] size_t i, j, n_matches, n_matches_after_delete, n_nodes, n_lookups; ^ test_lpm_map.c:212:26: error: variable 'n_matches_after_delete' set but not used [-Werror,-Wunused-but-set-variable] size_t i, j, n_matches, n_matches_after_delete, n_nodes, n_lookups; ^ ... prog_tests/get_stack_raw_tp.c:32:15: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable] static __u64 cnt; ^ ... For test_lpm_map.c, 'n_matches'/'n_matches_after_delete' are changed to be volatile in order to silent the warning. I didn't remove these two declarations since they are referenced in a commented code which might be used by people in certain cases. For get_stack_raw_tp.c, the variable 'cnt' is removed. [1] https://reviews.llvm.org/D122271 Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220325200304.2915588-1-yhs@fb.com tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c | 3 --- tools/testing/selftests/bpf/test_lpm_map.c | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) commit 9e928831113c64087fb173dd241fa97812e49490 Merge: 7df482e62282 1ac2524de7b3 Author: Alexei Starovoitov Date: Mon Mar 28 19:56:28 2022 -0700 Merge branch 'xsk: another round of fixes' Maciej Fijalkowski says: ==================== Hello, yet another fixes for XSK from Magnus and me. Magnus addresses the fact that xp_alloc() can return NULL, so this needs to be handled to avoid clearing entries in the SW ring on driver side. Then he addresses the off-by-one problem in Tx desc cleaning routine for ice ZC driver. From my side, I am adding protection to ZC Rx processing loop so that cleaning of descriptors wouldn't go over already processed entries. Then I also fix an issue with assigning XSK pool to Tx queues. This is directed to bpf tree. Thanks! Maciej Fijalkowski (2): ice: xsk: stop Rx processing when ntc catches ntu ice: xsk: fix indexing in ice_tx_xsk_pool() ==================== Acked-by: Alexander Lobakin Signed-off-by: Alexei Starovoitov commit 1ac2524de7b366633fc336db6c94062768d0ab03 Author: Maciej Fijalkowski Date: Mon Mar 28 16:21:23 2022 +0200 ice: xsk: Fix indexing in ice_tx_xsk_pool() Ice driver tries to always create XDP rings array to be num_possible_cpus() sized, regardless of user's queue count setting that can be changed via ethtool -L for example. Currently, ice_tx_xsk_pool() calculates the qid by decrementing the ring->q_index by the count of XDP queues, but ring->q_index is set to 'i + vsi->alloc_txq'. When user did ethtool -L $IFACE combined 1, alloc_txq is 1, but vsi->num_xdp_txq is still num_possible_cpus(). Then, ice_tx_xsk_pool() will do OOB access and in the final result ring would not get xsk_pool pointer assigned. Then, each ice_xsk_wakeup() call will fail with error and it will not be possible to get into NAPI and do the processing from driver side. Fix this by decrementing vsi->alloc_txq instead of vsi->num_xdp_txq from ring-q_index in ice_tx_xsk_pool() so the calculation is reflected to the setting of ring->q_index. Fixes: 22bf877e528f ("ice: introduce XDP_TX fallback path") Signed-off-by: Maciej Fijalkowski Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220328142123.170157-5-maciej.fijalkowski@intel.com drivers/net/ethernet/intel/ice/ice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0ec1713009c5cc24244c918def1cd14080be27e3 Author: Maciej Fijalkowski Date: Mon Mar 28 16:21:22 2022 +0200 ice: xsk: Stop Rx processing when ntc catches ntu This can happen with big budget values and some breakage of re-filling descriptors as we do not clear the entry that ntu is pointing at the end of ice_alloc_rx_bufs_zc. So if ntc is at ntu then it might be the case that status_error0 has an old, uncleared value and ntc would go over with processing which would result in false results. Break Rx loop when ntc == ntu to avoid broken behavior. Fixes: 3876ff525de7 ("ice: xsk: Handle SW XDP ring wrap and bump tail more often") Signed-off-by: Maciej Fijalkowski Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220328142123.170157-4-maciej.fijalkowski@intel.com drivers/net/ethernet/intel/ice/ice_xsk.c | 3 +++ 1 file changed, 3 insertions(+) commit 30d19d57d513821c58de4556e7445982ed22b923 Author: Magnus Karlsson Date: Mon Mar 28 16:21:21 2022 +0200 ice: xsk: Eliminate unnecessary loop iteration The NIC Tx ring completion routine cleans entries from the ring in batches. However, it processes one more batch than it is supposed to. Note that this does not matter from a functionality point of view since it will not find a set DD bit for the next batch and just exit the loop. But from a performance perspective, it is faster to terminate the loop before and not issue an expensive read over PCIe to get the DD bit. Fixes: 126cdfe1007a ("ice: xsk: Improve AF_XDP ZC Tx and use batching API") Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220328142123.170157-3-maciej.fijalkowski@intel.com drivers/net/ethernet/intel/ice/ice_xsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a95a4d9b39b0324402569ed7395aae59b8fd2b11 Author: Magnus Karlsson Date: Mon Mar 28 16:21:20 2022 +0200 xsk: Do not write NULL in SW ring at allocation failure For the case when xp_alloc_batch() is used but the batched allocation cannot be used, there is a slow path that uses the non-batched xp_alloc(). When it fails to allocate an entry, it returns NULL. The current code wrote this NULL into the entry of the provided results array (pointer to the driver SW ring usually) and returned. This might not be what the driver expects and to make things simpler, just write successfully allocated xdp_buffs into the SW ring,. The driver might have information in there that is still important after an allocation failure. Note that at this point in time, there are no drivers using xp_alloc_batch() that could trigger this slow path. But one might get added. Fixes: 47e4075df300 ("xsk: Batched buffer allocation for the pool") Signed-off-by: Magnus Karlsson Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220328142123.170157-2-maciej.fijalkowski@intel.com net/xdp/xsk_buff_pool.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 7df482e62282fb7839b033e332446f75b94e21c4 Merge: ef8a257b4e49 45c23bf4d1a4 Author: Alexei Starovoitov Date: Mon Mar 28 19:39:06 2022 -0700 Merge branch 'kprobes: rethook: x86: Replace kretprobe trampoline with rethook' Masami Hiramatsu says: ==================== Here are the 3rd version for generic kretprobe and kretprobe on x86 for replacing the kretprobe trampoline with rethook. The previous version is here[1] [1] https://lore.kernel.org/all/164821817332.2373735.12048266953420821089.stgit@devnote2/T/#u This version fixed typo and build issues for bpf-next and CONFIG_RETHOOK=y error. I also add temporary mitigation lines for ANNOTATE_NOENDBR macro issue for bpf-next tree [2/4]. This will be removed after merging kernel IBT series. Background: This rethook came from Jiri's request of multiple kprobe for bpf[2]. He tried to solve an issue that starting bpf with multiple kprobe will take a long time because bpf-kprobe will wait for RCU grace period for sync rcu events. Jiri wanted to attach a single bpf handler to multiple kprobes and he tried to introduce multiple-probe interface to kprobe. So I asked him to use ftrace and kretprobe-like hook if it is only for the function entry and exit, instead of adding ad-hoc interface to kprobes. For this purpose, I introduced the fprobe (kprobe like interface for ftrace) with the rethook (this is a generic return hook feature for fprobe exit handler)[3]. [2] https://lore.kernel.org/all/20220104080943.113249-1-jolsa@kernel.org/T/#u [3] https://lore.kernel.org/all/164191321766.806991.7930388561276940676.stgit@devnote2/T/#u The rethook is basically same as the kretprobe trampoline. I just made it decoupled from kprobes. Eventually, the all arch dependent kretprobe trampolines will be replaced with the rethook trampoline instead of cloning and set HAVE_RETHOOK=y. When I port the rethook for all arch which supports kretprobe, the legacy kretprobe specific code (which is for CONFIG_KRETPROBE_ON_RETHOOK=n) will be removed eventually. ==================== Acked-by: Peter Zijlstra (Intel) Signed-off-by: Alexei Starovoitov commit 45c23bf4d1a416d32e509f83719a7399e35bdaf9 Author: Masami Hiramatsu Date: Sat Mar 26 11:27:40 2022 +0900 x86,kprobes: Fix optprobe trampoline to generate complete pt_regs Currently the optprobe trampoline template code ganerate an almost complete pt_regs on-stack, everything except regs->ss. The 'regs->ss' points to the top of stack, which is not a valid segment decriptor. As same as the rethook does, complete the job by also pushing ss. Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Masami Hiramatsu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164826166027.2455864.14759128090648961900.stgit@devnote2 arch/x86/kernel/kprobes/opt.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) commit 0ef6f5c09371f17e142814e6996d6dfb8741925b Author: Peter Zijlstra Date: Sat Mar 26 11:27:28 2022 +0900 x86,rethook: Fix arch_rethook_trampoline() to generate a complete pt_regs Currently arch_rethook_trampoline() generates an almost complete pt_regs on-stack, everything except regs->ss that is, that currently points to the fake return address, which is not a valid segment descriptor. Since interpretation of regs->[sb]p should be done in the context of regs->ss, and we have code actually doing that (see arch/x86/lib/insn-eval.c for instance), complete the job by also pushing ss. This ensures that anybody who does do look at regs->ss doesn't mysteriously malfunction, avoiding much future pain. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Alexei Starovoitov Reviewed-by: Masami Hiramatsu Link: https://lore.kernel.org/bpf/164826164851.2455864.17272661073069737350.stgit@devnote2 arch/x86/kernel/rethook.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) commit f3a112c0c40dd96d53c8bdf3ea8d94d528f3b7b8 Author: Masami Hiramatsu Date: Sat Mar 26 11:27:17 2022 +0900 x86,rethook,kprobes: Replace kretprobe with rethook on x86 Replaces the kretprobe code with rethook on x86. With this patch, kretprobe on x86 uses the rethook instead of kretprobe specific trampoline code. Signed-off-by: Masami Hiramatsu Signed-off-by: Alexei Starovoitov Tested-by: Jiri Olsa Link: https://lore.kernel.org/bpf/164826163692.2455864.13745421016848209527.stgit@devnote2 arch/x86/Kconfig | 1 + arch/x86/include/asm/unwind.h | 23 ++++--- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/kprobes/common.h | 1 + arch/x86/kernel/kprobes/core.c | 107 --------------------------------- arch/x86/kernel/rethook.c | 125 +++++++++++++++++++++++++++++++++++++++ arch/x86/kernel/unwind_orc.c | 10 ++-- 7 files changed, 144 insertions(+), 124 deletions(-) commit 73f9b911faa74ac5107879de05c9489c419f41bb Author: Masami Hiramatsu Date: Sat Mar 26 11:27:05 2022 +0900 kprobes: Use rethook for kretprobe if possible Use rethook for kretprobe function return hooking if the arch sets CONFIG_HAVE_RETHOOK=y. In this case, CONFIG_KRETPROBE_ON_RETHOOK is set to 'y' automatically, and the kretprobe internal data fields switches to use rethook. If not, it continues to use kretprobe specific function return hooks. Suggested-by: Peter Zijlstra Signed-off-by: Masami Hiramatsu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164826162556.2455864.12255833167233452047.stgit@devnote2 arch/Kconfig | 8 ++- include/linux/kprobes.h | 51 +++++++++++++++++- kernel/Makefile | 1 + kernel/kprobes.c | 124 +++++++++++++++++++++++++++++++++++++------- kernel/trace/trace_kprobe.c | 4 +- 5 files changed, 163 insertions(+), 25 deletions(-) commit ef8a257b4e499a979364b1f9caf25a325f6ee8b8 Author: Jiri Olsa Date: Mon Mar 28 10:37:03 2022 +0200 bpftool: Fix generated code in codegen_asserts Arnaldo reported perf compilation fail with: $ make -k BUILD_BPF_SKEL=1 CORESIGHT=1 PYTHON=python3 ... In file included from util/bpf_counter.c:28: /tmp/build/perf//util/bpf_skel/bperf_leader.skel.h: In function ‘bperf_leader_bpf__assert’: /tmp/build/perf//util/bpf_skel/bperf_leader.skel.h:351:51: error: unused parameter ‘s’ [-Werror=unused-parameter] 351 | bperf_leader_bpf__assert(struct bperf_leader_bpf *s) | ~~~~~~~~~~~~~~~~~~~~~~~~~^ cc1: all warnings being treated as errors If there's nothing to generate in the new assert function, we will get unused 's' warn/error, adding 'unused' attribute to it. Fixes: 08d4dba6ae77 ("bpftool: Bpf skeletons assert type sizes") Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Tested-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/bpf/20220328083703.2880079-1-jolsa@kernel.org tools/bpf/bpftool/gen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 99dea2c664d7bc7e4f6f6947182d0d365165a998 Author: Andrii Nakryiko Date: Fri Mar 25 15:56:43 2022 -0700 selftests/bpf: fix selftest after random: Urandom_read tracepoint removal 14c174633f34 ("random: remove unused tracepoints") removed all the tracepoints from drivers/char/random.c, one of which, random:urandom_read, was used by stacktrace_build_id selftest to trigger stack trace capture. Fix breakage by switching to kprobing urandom_read() function. Suggested-by: Yonghong Song Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220325225643.2606-1-andrii@kernel.org tools/testing/selftests/bpf/progs/test_stacktrace_build_id.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) commit c29a4920dfcaa1433b09e2674f605f72767a385c Author: Yuntao Wang Date: Fri Mar 25 00:42:38 2022 +0800 bpf: Fix maximum permitted number of arguments check Since the m->arg_size array can hold up to MAX_BPF_FUNC_ARGS argument sizes, it's ok that nargs is equal to MAX_BPF_FUNC_ARGS. Signed-off-by: Yuntao Wang Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220324164238.1274915-1-ytcoode@gmail.com kernel/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 98870605b3742c38353b50b6dbad33fab9de415f Author: Geliang Tang Date: Thu Mar 24 16:37:32 2022 +0800 bpf: Sync comments for bpf_get_stack Commit ee2a098851bf missed updating the comments for helper bpf_get_stack in tools/include/uapi/linux/bpf.h. Sync it. Fixes: ee2a098851bf ("bpf: Adjust BPF stack helper functions to accommodate skip > 0") Signed-off-by: Geliang Tang Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/ce54617746b7ed5e9ba3b844e55e74cb8a60e0b5.1648110794.git.geliang.tang@suse.com tools/include/uapi/linux/bpf.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 76db1784c1982b3374cf25876691d20707f82dda Merge: 8c1b21198551 261608f3105c Author: Alexei Starovoitov Date: Mon Mar 28 19:05:41 2022 -0700 Merge branch 'fprobe: Fixes for Sparse and Smatch warnings' Masami Hiramatsu says: ==================== Hi, These fprobe patches are for fixing the warnings by Smatch and sparse. This is arch independent part of the fixes. Thank you, --- ==================== Signed-off-by: Alexei Starovoitov commit 261608f3105ce65e9fd01919f72ead74dcb9f14d Author: Masami Hiramatsu Date: Wed Mar 23 16:35:36 2022 +0900 fprobe: Fix sparse warning for acccessing __rcu ftrace_hash Since ftrace_ops::local_hash::filter_hash field is an __rcu pointer, we have to use rcu_access_pointer() to access it. Reported-by: kernel test robot Signed-off-by: Masami Hiramatsu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164802093635.1732982.4938094876018890866.stgit@devnote2 kernel/trace/fprobe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9052e4e83762c40d89f6650fec161ad9001e93f3 Author: Masami Hiramatsu Date: Wed Mar 23 16:35:26 2022 +0900 fprobe: Fix smatch type mismatch warning Fix the type mismatching warning of 'rethook_node vs fprobe_rethook_node' found by Smatch. Reported-by: Dan Carpenter Signed-off-by: Masami Hiramatsu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164802092611.1732982.12268174743437084619.stgit@devnote2 kernel/trace/fprobe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 8c1b21198551d795a44f08ad185f716732b47bbe Author: Milan Landaverde Date: Tue Mar 22 10:49:45 2022 -0400 bpf/bpftool: Add unprivileged_bpf_disabled check against value of 2 In [1], we added a kconfig knob that can set /proc/sys/kernel/unprivileged_bpf_disabled to 2 We now check against this value in bpftool feature probe [1] https://lore.kernel.org/bpf/74ec548079189e4e4dffaeb42b8987bb3c852eee.1620765074.git.daniel@iogearbox.net Signed-off-by: Milan Landaverde Signed-off-by: Alexei Starovoitov Acked-by: Quentin Monnet Acked-by: KP Singh Link: https://lore.kernel.org/bpf/20220322145012.1315376-1-milan@mdaverde.com tools/bpf/bpftool/feature.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 22a41e9a5044bf3519f05b4a00e99af34bfeb40c Author: Rob Herring Date: Fri Mar 25 16:56:52 2022 -0500 dt-bindings: Fix missing '/schemas' in $ref paths Absolute paths in $ref should always begin with '/schemas'. The tools mostly work with it omitted, but for correctness the path should be everything except the hostname as that is taken from the schema's $id value. This scheme is defined in the json-schema spec. Cc: Hector Martin Cc: Sven Peter Cc: Andrew Lunn Cc: Vivien Didelot Cc: Florian Fainelli Cc: Vladimir Oltean Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Mark Brown Cc: Chunfeng Yun Cc: Greg Kroah-Hartman Cc: Mukesh Savaliya Cc: Akash Asthana Cc: Bayi Cheng Cc: Chuanhong Guo Cc: Min Guo Cc: netdev@vger.kernel.org Cc: linux-spi@vger.kernel.org Cc: linux-usb@vger.kernel.org Signed-off-by: Rob Herring Acked-by: Jakub Kicinski Acked-by: Mark Brown Link: https://lore.kernel.org/r/20220325215652.525383-1-robh@kernel.org Documentation/devicetree/bindings/arm/apple/apple,pmgr.yaml | 2 +- Documentation/devicetree/bindings/net/dsa/dsa-port.yaml | 2 +- Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml | 2 +- Documentation/devicetree/bindings/spi/mediatek,spi-mtk-nor.yaml | 2 +- Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml | 2 +- Documentation/devicetree/bindings/spi/sprd,spi-adi.yaml | 2 +- Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml | 4 ++-- Documentation/devicetree/bindings/usb/mediatek,musb.yaml | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) commit a50e431bbc6fc5768ed26be5fab5b149b7b8b1fe Author: Rob Herring Date: Tue Mar 1 17:35:00 2022 -0600 dt-bindings: media: mediatek,vcodec: Fix addressing cell sizes 'dma-ranges' in the example is written for cell sizes of 2 cells, but the schema and example specify sizes of 1 cell. As the h/w has a bus address of >32-bits, cell sizes of 2 is correct. Update the schema's '#address-cells' and '#size-cells' to be 2 and adjust the example throughout. There's no error currently because dtc only checks 'dma-ranges' is a correct multiple number of cells (3) and the schema checking is based on bracketing of entries. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220301233501.2110047-1-robh@kernel.org .../media/mediatek,vcodec-subdev-decoder.yaml | 122 +++++++++++---------- 1 file changed, 64 insertions(+), 58 deletions(-) commit 09a2fb41ba67dcb45f259efd1d2baafe4a6be1a7 Author: Biao Huang Date: Thu Mar 24 09:21:12 2022 +0800 dt-bindings: net: snps,dwmac: modify available values of PBL PBL can be any of the following values: 1, 2, 4, 8, 16 or 32 according to the datasheet, so modify available values of PBL in snps,dwmac.yaml. Signed-off-by: Biao Huang Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220324012112.7016-2-biao.huang@mediatek.com Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit bff4e302a6679b0df8ac950979faabbc8f3ae961 Author: AngeloGioacchino Del Regno Date: Wed Mar 9 21:47:02 2022 +0800 dt-bindings: display: mediatek: Fix examples on new bindings To avoid failure of dt_binding_check perform a slight refactoring of the examples: the main block is kept, but that required fixing the address and size cells, plus the inclusion of missing dt-bindings headers, required to parse some of the values assigned to various properties. Fixes: 4ed545e7d100 ("dt-bindings: display: mediatek: disp: split each block to individual yaml") Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: jason-jh.lin Reviewed-by: Rob Herring Acked-by: Chun-Kuang Hu Tested-by: jason-jh.lin Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220309134702.9942-5-jason-jh.lin@mediatek.com .../bindings/display/mediatek/mediatek,aal.yaml | 23 ++++++---- .../bindings/display/mediatek/mediatek,ccorr.yaml | 23 ++++++---- .../bindings/display/mediatek/mediatek,color.yaml | 23 ++++++---- .../bindings/display/mediatek/mediatek,dither.yaml | 23 ++++++---- .../bindings/display/mediatek/mediatek,dpi.yaml | 3 +- .../bindings/display/mediatek/mediatek,dsc.yaml | 23 ++++++---- .../bindings/display/mediatek/mediatek,gamma.yaml | 23 ++++++---- .../bindings/display/mediatek/mediatek,merge.yaml | 49 ++++++++++------------ .../bindings/display/mediatek/mediatek,mutex.yaml | 25 +++++++---- .../bindings/display/mediatek/mediatek,od.yaml | 14 +++++-- .../bindings/display/mediatek/mediatek,ovl-2l.yaml | 26 ++++++++---- .../bindings/display/mediatek/mediatek,ovl.yaml | 26 ++++++++---- .../display/mediatek/mediatek,postmask.yaml | 23 ++++++---- .../bindings/display/mediatek/mediatek,rdma.yaml | 28 +++++++++---- .../bindings/display/mediatek/mediatek,split.yaml | 17 +++++--- .../bindings/display/mediatek/mediatek,ufoe.yaml | 19 ++++++--- .../bindings/display/mediatek/mediatek,wdma.yaml | 26 ++++++++---- 17 files changed, 260 insertions(+), 134 deletions(-) commit 10f17b2054a7ab3b86a8d333d99146fff3e9c728 Author: AngeloGioacchino Del Regno Date: Wed Mar 9 21:47:01 2022 +0800 dt-bindings: display: mediatek, ovl: Fix 'iommu' required property typo The property is called 'iommus' and not 'iommu'. Fix this typo. Fixes: 4ed545e7d100 ("dt-bindings: display: mediatek: disp: split each block to individual yaml") Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: jason-jh.lin Acked-by: Rob Herring Acked-by: Chun-Kuang Hu Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220309134702.9942-4-jason-jh.lin@mediatek.com Documentation/devicetree/bindings/display/mediatek/mediatek,ovl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ab487888d5dfb37b71a256114e8fa6fafdbb3163 Author: AngeloGioacchino Del Regno Date: Wed Mar 9 21:47:00 2022 +0800 dt-bindings: display: mediatek, mutex: Fix mediatek, gce-events type The mediatek,gce-events property needs as value an array of uint32 corresponding to the CMDQ events to listen to, and not any phandle. Fixes: 4ed545e7d100 ("dt-bindings: display: mediatek: disp: split each block to individual yaml") Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: jason-jh.lin Acked-by: Rob Herring Acked-by: Chun-Kuang Hu Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220309134702.9942-3-jason-jh.lin@mediatek.com Documentation/devicetree/bindings/display/mediatek/mediatek,mutex.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dcb09a08d8d4052f8e8567ae2baddfbaf1d9c11f Author: jason-jh.lin Date: Wed Mar 9 21:46:59 2022 +0800 Revert "dt-bindings: display: mediatek: add ethdr definition for mt8195" This reverts commit e7dcfe64204a5cd9a74a9ca7d9c7a22434dc7fe5. Because examples property of mediatek,ethdr.yaml should base on [1][2]. Reverting it until [1][2] are applied. [1] dt-bindings: mediatek: mt8195: Add binding for MM IOMMU https://patchwork.kernel.org/project/linux-mediatek/patch/20220217113453.13658-2-yong.wu@mediatek.com/ [2] dt-bindings: reset: mt8195: add vdosys1 reset control bit https://patchwork.kernel.org/project/linux-mediatek/patch/20220222100741.30138-5-nancy.lin@mediatek.com/ Signed-off-by: jason-jh.lin Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220309134702.9942-2-jason-jh.lin@mediatek.com .../bindings/display/mediatek/mediatek,ethdr.yaml | 147 --------------------- 1 file changed, 147 deletions(-) commit 1930a6e739c4b4a654a69164dbe39e554d228915 Merge: 0a815d0135f1 dcbc65aac283 Author: Linus Torvalds Date: Mon Mar 28 17:29:53 2022 -0700 Merge tag 'ptrace-cleanups-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ptrace cleanups from Eric Biederman: "This set of changes removes tracehook.h, moves modification of all of the ptrace fields inside of siglock to remove races, adds a missing permission check to ptrace.c The removal of tracehook.h is quite significant as it has been a major source of confusion in recent years. Much of that confusion was around task_work and TIF_NOTIFY_SIGNAL (which I have now decoupled making the semantics clearer). For people who don't know tracehook.h is a vestiage of an attempt to implement uprobes like functionality that was never fully merged, and was later superseeded by uprobes when uprobes was merged. For many years now we have been removing what tracehook functionaly a little bit at a time. To the point where anything left in tracehook.h was some weird strange thing that was difficult to understand" * tag 'ptrace-cleanups-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ptrace: Remove duplicated include in ptrace.c ptrace: Check PTRACE_O_SUSPEND_SECCOMP permission on PTRACE_SEIZE ptrace: Return the signal to continue with from ptrace_stop ptrace: Move setting/clearing ptrace_message into ptrace_stop tracehook: Remove tracehook.h resume_user_mode: Move to resume_user_mode.h resume_user_mode: Remove #ifdef TIF_NOTIFY_RESUME in set_notify_resume signal: Move set_notify_signal and clear_notify_signal into sched/signal.h task_work: Decouple TIF_NOTIFY_SIGNAL and task_work task_work: Call tracehook_notify_signal from get_signal on all architectures task_work: Introduce task_work_pending task_work: Remove unnecessary include from posix_timers.h ptrace: Remove tracehook_signal_handler ptrace: Remove arch_syscall_{enter,exit}_tracehook ptrace: Create ptrace_report_syscall_{entry,exit} in ptrace.h ptrace/arm: Rename tracehook_report_syscall report_syscall ptrace: Move ptrace_report_syscall into ptrace.h commit 0a815d0135f1be20c1a04d07f7573a26272ef846 Merge: d717e4cae0fe e97824ff663c Author: Linus Torvalds Date: Mon Mar 28 17:10:07 2022 -0700 Merge tag 'ucount-rlimit-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull shm ucounts fix from Eric Biederman: "The introduction of a new failure mode when the code was converted to ucounts resulted in user_shm_lock misbehaving. The change simplifies the code to make the code easier to follow and removes the known misbehaviors" * tag 'ucount-rlimit-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: mm/mlock: fix two bugs in user_shm_lock() commit d717e4cae0fe77e10a27e8545a967b8c379873ac Merge: cffb2b72d3ed 20695e9a9fd3 Author: Linus Torvalds Date: Mon Mar 28 17:02:04 2022 -0700 Merge tag 'net-5.18-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter. Current release - regressions: - llc: only change llc->dev when bind() succeeds, fix null-deref Current release - new code bugs: - smc: fix a memory leak in smc_sysctl_net_exit() - dsa: realtek: make interface drivers depend on OF Previous releases - regressions: - sched: act_ct: fix ref leak when switching zones Previous releases - always broken: - netfilter: egress: report interface as outgoing - vsock/virtio: enable VQs early on probe and finish the setup before using them Misc: - memcg: enable accounting for nft objects" * tag 'net-5.18-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (39 commits) Revert "selftests: net: Add tls config dependency for tls selftests" net/smc: Send out the remaining data in sndbuf before close net: move net_unlink_todo() out of the header net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator net: bnxt_ptp: fix compilation error selftests: net: Add tls config dependency for tls selftests memcg: enable accounting for nft objects net/sched: act_ct: fix ref leak when switching zones net/smc: fix a memory leak in smc_sysctl_net_exit() selftests: tls: skip cmsg_to_pipe tests with TLS=n octeontx2-af: initialize action variable net: sparx5: switchdev: fix possible NULL pointer dereference net/x25: Fix null-ptr-deref caused by x25_disconnect qlcnic: dcb: default to returning -EOPNOTSUPP net: sparx5: depends on PTP_1588_CLOCK_OPTIONAL net: hns3: fix phy can not link up when autoneg off and reset net: hns3: add NULL pointer check for hns3_set/get_ringparam() net: hns3: add netdev reset check for hns3_set_tunable() net: hns3: clean residual vf config after disable sriov net: hns3: add max order judgement for tx spare buffer ... commit 3e3c658055c002900982513e289398a1aad4a488 Author: Matthew Wilcox (Oracle) Date: Mon Mar 28 19:25:11 2022 -0400 XArray: Fix xas_create_range() when multi-order entry present If there is already an entry present that is of order >= XA_CHUNK_SHIFT when we call xas_create_range(), xas_create_range() will misinterpret that entry as a node and dereference xa_node->parent, generally leading to a crash that looks something like this: general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] CPU: 0 PID: 32 Comm: khugepaged Not tainted 5.17.0-rc8-syzkaller-00003-g56e337f2cf13 #0 RIP: 0010:xa_parent_locked include/linux/xarray.h:1207 [inline] RIP: 0010:xas_create_range+0x2d9/0x6e0 lib/xarray.c:725 It's deterministically reproducable once you know what the problem is, but producing it in a live kernel requires khugepaged to hit a race. While the problem has been present since xas_create_range() was introduced, I'm not aware of a way to hit it before the page cache was converted to use multi-index entries. Fixes: 6b24ca4a1a8d ("mm: Use multi-index entries in the page cache") Reported-by: syzbot+0d2b0bf32ca5cfd09f2e@syzkaller.appspotmail.com Signed-off-by: Matthew Wilcox (Oracle) lib/test_xarray.c | 22 ++++++++++++++++++++++ lib/xarray.c | 2 ++ 2 files changed, 24 insertions(+) commit 20695e9a9fd39103d1b0669470ae74030b7aa196 Author: Jakub Kicinski Date: Mon Mar 28 14:29:04 2022 -0700 Revert "selftests: net: Add tls config dependency for tls selftests" This reverts commit d9142e1cf3bbdaf21337767114ecab26fe702d47. The test is supposed to run cleanly with TLS is disabled, to test compatibility with TCP behavior. I can't repro the failure [1], the problem should be debugged rather than papered over. Link: https://lore.kernel.org/all/20220325161203.7000698c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/ [1] Fixes: d9142e1cf3bb ("selftests: net: Add tls config dependency for tls selftests") Signed-off-by: Jakub Kicinski Link: https://lore.kernel.org/r/20220328212904.2685395-1-kuba@kernel.org Signed-off-by: Jakub Kicinski tools/testing/selftests/net/config | 1 - 1 file changed, 1 deletion(-) commit 906b3d64913c19a50d5c553f21b54d2f4ce3ded7 Author: Wen Gu Date: Mon Mar 28 14:10:36 2022 +0800 net/smc: Send out the remaining data in sndbuf before close The current autocork algorithms will delay the data transmission in BH context to smc_release_cb() when sock_lock is hold by user. So there is a possibility that when connection is being actively closed (sock_lock is hold by user now), some corked data still remains in sndbuf, waiting to be sent by smc_release_cb(). This will cause: - smc_close_stream_wait(), which is called under the sock_lock, has a high probability of timeout because data transmission is delayed until sock_lock is released. - Unexpected data sends may happen after connction closed and use the rtoken which has been deleted by remote peer through LLC_DELETE_RKEY messages. So this patch will try to send out the remaining corked data in sndbuf before active close process, to ensure data integrity and avoid unexpected data transmission after close. Reported-by: Guangguan Wang Fixes: 6b88af839d20 ("net/smc: don't send in the BH context if sock_owned_by_user") Signed-off-by: Wen Gu Acked-by: Karsten Graul Link: https://lore.kernel.org/r/1648447836-111521-1-git-send-email-guwen@linux.alibaba.com Signed-off-by: Jakub Kicinski net/smc/smc_close.c | 3 +++ 1 file changed, 3 insertions(+) commit fdf59eb548e51bce81382c39f1a5fd4cb9403b78 Author: Steve French Date: Sun Mar 27 16:07:30 2022 -0500 smb3: cleanup and clarify status of tree connections Currently the way the tid (tree connection) status is tracked is confusing. The same enum is used for structs cifs_tcon and cifs_ses and TCP_Server_info, but each of these three has different states that they transition among. The current code also unnecessarily uses camelCase. Convert from use of statusEnum to a new tid_status_enum for tree connections. The valid states for a tid are: TID_NEW = 0, TID_GOOD, TID_EXITING, TID_NEED_RECON, TID_NEED_TCON, TID_IN_TCON, TID_NEED_FILES_INVALIDATE, /* unused, considering removing in future */ TID_IN_FILES_INVALIDATE It also removes CifsNeedTcon, CifsInTcon, CifsNeedFilesInvalidate and CifsInFilesInvalidate from the statusEnum used for session and TCP_Server_Info since they are not relevant for those. A follow on patch will fix the places where we use the tcon->need_reconnect flag to be more consistent with the tid->status. Also fixes a bug that was: Reported-by: kernel test robot Reviewed-by: Shyam Prasad N Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French fs/cifs/cifs_debug.c | 2 +- fs/cifs/cifsfs.c | 4 ++-- fs/cifs/cifsglob.h | 18 +++++++++++++----- fs/cifs/cifssmb.c | 11 +++++------ fs/cifs/connect.c | 32 ++++++++++++++++---------------- fs/cifs/misc.c | 2 +- fs/cifs/smb2pdu.c | 4 ++-- 7 files changed, 40 insertions(+), 33 deletions(-) commit cffb2b72d3ed47f5093d128bd44d9ce136b6b5af Merge: 023f3fef8386 c1cb81429df4 Author: Linus Torvalds Date: Mon Mar 28 15:00:42 2022 -0700 Merge tag 'kgdb-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux Pull kgdb update from Daniel Thompson: "Only a single patch this cycle. Fix an obvious mistake with the kdb memory accessors. It was a stupid mistake (to/from backwards) but it has been there for a long time since many architectures tolerated it with surprisingly good grace" * tag 'kgdb-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux: kdb: Fix the putarea helper function commit 023f3fef8386555a303f73d3bbd50c2237cb0adf Merge: b83d85a5c81c b0cf9b4b26e6 Author: Linus Torvalds Date: Mon Mar 28 14:53:00 2022 -0700 Merge tag 'hexagon-5.18-0' of git://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux Pull hexagon update from Brian Cain: "Maintainer email update" * tag 'hexagon-5.18-0' of git://git.kernel.org/pub/scm/linux/kernel/git/bcain/linux: MAINTAINERS: update hexagon maintainer email, tree commit b83d85a5c81c1f8227dc54636c779d3f20a4d731 Merge: d111c9f0344a fcc619621df5 Author: Linus Torvalds Date: Mon Mar 28 14:46:53 2022 -0700 Merge tag 'microblaze-v5.18' of git://git.monstr.eu/linux-2.6-microblaze Pull microblaze updates from Michal Simek: - Small fixups - Remove unused pci_phys_mem_access_prot() * tag 'microblaze-v5.18' of git://git.monstr.eu/linux-2.6-microblaze: microblaze/PCI: Remove pci_phys_mem_access_prot() dead code microblaze: add const to of_device_id microblaze: fix typo in a comment commit f32404ae1bb9a7428a3c77419672a28895d185bf Author: Johannes Berg Date: Fri Mar 25 22:50:23 2022 +0100 net: move net_unlink_todo() out of the header There's no reason for this to be in netdevice.h, it's all just used in dev.c. Also make it no longer inline and let the compiler decide to do that by itself. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220325225023.f49b9056fe1c.I6b901a2df00000837a9bd251a8dd259bd23f5ded@changeid Signed-off-by: Jakub Kicinski include/linux/netdevice.h | 10 ---------- net/core/dev.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) commit 6da69b1da130e7d96766042750cd9f902e890eba Author: Xiaomeng Tong Date: Mon Mar 28 11:24:31 2022 +0800 net: dsa: bcm_sf2_cfp: fix an incorrect NULL check on list iterator The bug is here: return rule; The list iterator value 'rule' 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. To fix the bug, return 'rule' when found, otherwise return NULL. Fixes: ae7a5aff783c7 ("net: dsa: bcm_sf2: Keep copy of inserted rules") Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220328032431.22538-1-xiam0nd.tong@gmail.com Signed-off-by: Jakub Kicinski drivers/net/dsa/bcm_sf2_cfp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit d111c9f0344a5e2454726553c663d25e24e38555 Merge: a701f370b521 e7dbd4d5369d Author: Linus Torvalds Date: Mon Mar 28 14:38:31 2022 -0700 Merge tag 'livepatching-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching Pull livepatching updates from Petr Mladek: - Forced transitions block only to-be-removed livepatches [Chengming] - Detect when ftrace handler could not be disabled in self-tests [David] - Calm down warning from a static analyzer [Tom] * tag 'livepatching-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: livepatch: Reorder to use before freeing a pointer livepatch: Don't block removal of patches that are safe to unload livepatch: Skip livepatch tests if ftrace cannot be configured commit 9df072c73b9891e44f7f59f3b7c8f852b4485e80 Author: David Gow Date: Sat Mar 26 13:44:15 2022 +0800 Documentation: kunit: Fix cross-referencing warnings The Architecture chapter of the KUnit documentation tried to include copies of the kernel-doc for a couple of things, despite these already existing in the API documentation. This lead to some warnings: architecture:31: ./include/kunit/test.h:3: WARNING: Duplicate C declaration, also defined at dev-tools/kunit/api/test:66. Declaration is '.. c:struct:: kunit_case'. architecture:163: ./include/kunit/test.h:1217: WARNING: Duplicate C declaration, also defined at dev-tools/kunit/api/test:1217. Declaration is '.. c:macro:: KUNIT_ARRAY_PARAM'. architecture.rst:3: WARNING: Duplicate C declaration, also defined at dev-tools/kunit/api/test:66. Declaration is '.. c:struct:: kunit_case'. architecture.rst:1217: WARNING: Duplicate C declaration, also defined at dev-tools/kunit/api/test:1217. Declaration is '.. c:macro:: KUNIT_ARRAY_PARAM'. Get rid of these, and cleanup the mentions of the struct and macro in question so that sphinx generates a link to the existing copy of the documentation in the api/test document. Fixes: bc145b370c11 ("Documentation: KUnit: Added KUnit Architecture") Signed-off-by: David Gow Reviewed-by: Brendan Higgins Tested-by: Brendan Higgins Link: https://lore.kernel.org/r/20220326054414.637293-1-davidgow@google.com Signed-off-by: Jonathan Corbet Documentation/dev-tools/kunit/architecture.rst | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) commit a701f370b521b2ed0654a9da7cf424b3ff8fa73d Merge: 7203062171db de2ae403b4c0 Author: Linus Torvalds Date: Mon Mar 28 14:32:39 2022 -0700 Merge tag 'for-linus-5.18-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - A bunch of minor cleanups - A fix for kexec in Xen dom0 when executed on a high cpu number - A fix for resuming after suspend of a Xen guest with assigned PCI devices - A fix for a crash due to not disabled preemption when resuming as Xen dom0 * tag 'for-linus-5.18-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: fix is_xen_pmu() xen: don't hang when resuming PCI device arch:x86:xen: Remove unnecessary assignment in xen_apic_read() xen/grant-table: remove readonly parameter from functions xen/grant-table: remove gnttab_*transfer*() functions drivers/xen: use helper macro __ATTR_RW x86/xen: Fix kerneldoc warning xen: delay xen_hvm_init_time_ops() if kdump is boot on vcpu>=32 xen: use time_is_before_eq_jiffies() instead of open coding it commit faf79934e65aff90284725518a5ec3c2241c65ae Author: Vasily Gorbik Date: Mon Mar 28 23:27:54 2022 +0200 s390/alternatives: avoid using jgnop mnemonic jgnop mnemonic is only available since binutils 2.36, kernel minimal required version is 2.23. Stick to brcl to avoid build errors. Reported-by: Nathan Chancellor Fixes: 4afeb670710e ("s390/alternatives: use instructions instead of byte patterns") Signed-off-by: Vasily Gorbik arch/s390/include/asm/alternative-asm.h | 2 +- arch/s390/include/asm/alternative.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit ad6dc1daaf29f97f23cc810d60ee01c0e83f4c6b Author: Eli Cohen Date: Mon Mar 21 16:13:03 2022 +0200 vdpa/mlx5: Avoid processing works if workqueue was destroyed If mlx5_vdpa gets unloaded while a VM is running, the workqueue will be destroyed. However, vhost might still have reference to the kick function and might attempt to push new works. This could lead to null pointer dereference. To fix this, set mvdev->wq to NULL just before destroying and verify that the workqueue is not NULL in mlx5_vdpa_kick_vq before attempting to push a new work. Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting") Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220321141303.9586-1-elic@nvidia.com Signed-off-by: Michael S. Tsirkin drivers/vdpa/mlx5/net/mlx5_vnet.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 03a91c9af2c42ae14afafb829a4b7e6589ab5892 Author: Anirudh Rayabharam Date: Sat Mar 12 19:41:21 2022 +0530 vhost: handle error while adding split ranges to iotlb vhost_iotlb_add_range_ctx() handles the range [0, ULONG_MAX] by splitting it into two ranges and adding them separately. The return value of adding the first range to the iotlb is currently ignored. Check the return value and bail out in case of an error. Signed-off-by: Anirudh Rayabharam Link: https://lore.kernel.org/r/20220312141121.4981-1-mail@anirudhrb.com Signed-off-by: Michael S. Tsirkin Fixes: e2ae38cf3d91 ("vhost: fix hung thread due to erroneous iotlb entries") Reviewed-by: Stefano Garzarella drivers/vhost/iotlb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit b04d910af330b55e1d5d6eb9ecd53a375a9cf81c Author: Longpeng Date: Tue Mar 15 11:25:53 2022 +0800 vdpa: support exposing the count of vqs to userspace - GET_VQS_COUNT: the count of virtqueues that exposed Signed-off-by: Longpeng Link: https://lore.kernel.org/r/20220315032553.455-4-longpeng2@huawei.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Signed-off-by: Longpeng <longpeng2@huawei.com>
Reviewed-by: Stefano Garzarella drivers/vhost/vdpa.c | 13 +++++++++++++ include/uapi/linux/vhost.h | 3 +++ 2 files changed, 16 insertions(+) commit 81d46d693173a5c86a9b0c648eca1817ad5c0ae5 Author: Longpeng Date: Tue Mar 15 11:25:52 2022 +0800 vdpa: change the type of nvqs to u32 Change vdpa_device.nvqs and vhost_vdpa.nvqs to use u32 Signed-off-by: Longpeng Link: https://lore.kernel.org/r/20220315032553.455-3-longpeng2@huawei.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Signed-off-by: Longpeng <longpeng2@huawei.com>

Acked-by: Jason Wang <jasowang@redhat.com>
 
Reviewed-by: Stefano Garzarella drivers/vdpa/vdpa.c | 6 +++--- drivers/vhost/vdpa.c | 10 ++++++---- include/linux/vdpa.h | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) commit a61280ddddaa45f95b60dd54c05f8e0e5b6810b7 Author: Longpeng Date: Tue Mar 15 11:25:51 2022 +0800 vdpa: support exposing the config size to userspace - GET_CONFIG_SIZE: return the size of the virtio config space. The size contains the fields which are conditional on feature bits. Acked-by: Jason Wang Signed-off-by: Longpeng Link: https://lore.kernel.org/r/20220315032553.455-2-longpeng2@huawei.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella drivers/vhost/vdpa.c | 17 +++++++++++++++++ include/linux/vdpa.h | 3 ++- include/uapi/linux/vhost.h | 4 ++++ 3 files changed, 23 insertions(+), 1 deletion(-) commit f1781bedea8cae7f26aa0f20a00017ab746d4d4c Author: Michael Qiu Date: Mon Mar 28 01:48:12 2022 -0400 vdpa/mlx5: re-create forwarding rules after mac modified When MAC Address has been modified in guest, we only re-add the Mac to mpfs, it is not enough, because the guest network will not work correctly: the reply package from outside will go straight away to the host VF net interface. This patch recreate the flow rules, and make it work correctly. Signed-off-by: Michael Qiu Link: https://lore.kernel.org/r/1648446492-17614-1-git-send-email-08005325@163.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Eli Cohen drivers/vdpa/mlx5/net/mlx5_vnet.c | 45 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) commit 3f63a1d7f6f500b6891b1003cec3e23ea4996a2e Author: Keir Fraser Date: Wed Mar 23 14:07:27 2022 +0000 virtio: pci: check bar values read from virtio config space virtio pci config structures may in future have non-standard bar values in the bar field. We should anticipate this by skipping any structures containing such a reserved value. The bar value should never change: check for harmful modified values we re-read it from the config space in vp_modern_map_capability(). Also clean up an existing check to consistently use PCI_STD_NUM_BARS. Signed-off-by: Keir Fraser Link: https://lore.kernel.org/r/20220323140727.3499235-1-keirf@google.com Signed-off-by: Michael S. Tsirkin drivers/virtio/virtio_pci_modern.c | 12 +++++++++--- drivers/virtio/virtio_pci_modern_dev.c | 9 ++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) commit eb4cecb453a19b34d5454b49532e09e9cb0c1529 Author: Jason Wang Date: Wed Mar 23 11:15:24 2022 +0800 Revert "virtio_pci: harden MSI-X interrupts" This reverts commit 9e35276a5344f74d4a3600fc4100b3dd251d5c56. Issue were reported for the drivers that are using affinity managed IRQ where manually toggling IRQ status is not expected. And we forget to enable the interrupts in the restore path as well. In the future, we will rework on the interrupt hardening. Fixes: 9e35276a5344 ("virtio_pci: harden MSI-X interrupts") Reported-by: Marc Zyngier Reported-by: Stefano Garzarella Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220323031524.6555-2-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin drivers/virtio/virtio_pci_common.c | 27 ++++++--------------------- drivers/virtio/virtio_pci_common.h | 6 ++---- drivers/virtio/virtio_pci_legacy.c | 5 ++--- drivers/virtio/virtio_pci_modern.c | 6 ++---- 4 files changed, 12 insertions(+), 32 deletions(-) commit 7b79edfb862d6b1ecc66479419ae67a7db2d02e3 Author: Jason Wang Date: Wed Mar 23 11:15:23 2022 +0800 Revert "virtio-pci: harden INTX interrupts" This reverts commit 080cd7c3ac8701081d143a15ba17dd9475313188. Since the MSI-X interrupts hardening will be reverted in the next patch. We will rework the interrupt hardening in the future. Fixes: 080cd7c3ac87 ("virtio-pci: harden INTX interrupts") Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220323031524.6555-1-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin drivers/virtio/virtio_pci_common.c | 23 ++--------------------- drivers/virtio/virtio_pci_common.h | 1 - 2 files changed, 2 insertions(+), 22 deletions(-) commit c11708209df216aee72adf97d13c72c093a4ffce Author: Andrew Melnychenko Date: Mon Mar 28 20:53:36 2022 +0300 drivers/net/virtio_net: Added RSS hash report control. Now it's possible to control supported hashflows. Added hashflow set/get callbacks. Also, disabling RXH_IP_SRC/DST for TCP would disable then for UDP. TCP and UDP supports only: ethtool -U eth0 rx-flow-hash tcp4 sd RXH_IP_SRC + RXH_IP_DST ethtool -U eth0 rx-flow-hash tcp4 sdfn RXH_IP_SRC + RXH_IP_DST + RXH_L4_B_0_1 + RXH_L4_B_2_3 Disabling happens because VirtioNET hashtype for IP doesn't check L4 proto, it works for all IP packets(TCP, UDP, ICMP, etc.). For TCP and UDP, it's possible to set IP+PORT hashes. But disabling IP hashes will disable them for TCP and UDP simultaneously. It's possible to set IP+PORT for TCP/UDP and disable/enable IP for everything else(UDP, ICMP, etc.). Signed-off-by: Andrew Melnychenko Link: https://lore.kernel.org/r/20220328175336.10802-5-andrew@daynix.com Signed-off-by: Michael S. Tsirkin drivers/net/virtio_net.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 140 insertions(+), 1 deletion(-) commit 91f41f01d2195d4d059ad7f141e41d40a45e1e1c Author: Andrew Melnychenko Date: Mon Mar 28 20:53:35 2022 +0300 drivers/net/virtio_net: Added RSS hash report. Added features for RSS hash report. If hash is provided - it sets to skb. Added checks if rss and/or hash are enabled together. Signed-off-by: Andrew Melnychenko Link: https://lore.kernel.org/r/20220328175336.10802-4-andrew@daynix.com Signed-off-by: Michael S. Tsirkin drivers/net/virtio_net.c | 55 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 6 deletions(-) commit c7114b1249fa3b5f3a434606ba4cc89c4a27d618 Author: Andrew Melnychenko Date: Mon Mar 28 20:53:34 2022 +0300 drivers/net/virtio_net: Added basic RSS support. Added features for RSS. Added initialization, RXHASH feature and ethtool ops. By default RSS/RXHASH is disabled. Virtio RSS "IPv6 extensions" hashes disabled. Added ethtools ops to set key and indirection table. Signed-off-by: Andrew Melnychenko Link: https://lore.kernel.org/r/20220328175336.10802-3-andrew@daynix.com Signed-off-by: Michael S. Tsirkin drivers/net/virtio_net.c | 192 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 186 insertions(+), 6 deletions(-) commit c1ddc42da2b2632545b76be884faf0ca363b3246 Author: Andrew Melnychenko Date: Mon Mar 28 20:53:33 2022 +0300 drivers/net/virtio_net: Fixed padded vheader to use v1 with hash. The header v1 provides additional info about RSS. Added changes to computing proper header length. In the next patches, the header may contain RSS hash info for the hash population. Signed-off-by: Andrew Melnychenko Link: https://lore.kernel.org/r/20220328175336.10802-2-andrew@daynix.com Signed-off-by: Michael S. Tsirkin drivers/net/virtio_net.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit 8d65bc9a5be3f23c5e2ab36b6b8ef40095165b18 Author: Stefano Garzarella Date: Tue Mar 22 12:43:13 2022 +0100 virtio: use virtio_device_ready() in virtio_device_restore() After waking up a suspended VM, the kernel prints the following trace for virtio drivers which do not directly call virtio_device_ready() in the .restore: PM: suspend exit irq 22: nobody cared (try booting with the "irqpoll" option) Call Trace: dump_stack_lvl+0x38/0x49 dump_stack+0x10/0x12 __report_bad_irq+0x3a/0xaf note_interrupt.cold+0xb/0x60 handle_irq_event+0x71/0x80 handle_fasteoi_irq+0x95/0x1e0 __common_interrupt+0x6b/0x110 common_interrupt+0x63/0xe0 asm_common_interrupt+0x1e/0x40 ? __do_softirq+0x75/0x2f3 irq_exit_rcu+0x93/0xe0 sysvec_apic_timer_interrupt+0xac/0xd0 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch_cpu_idle+0x12/0x20 default_idle_call+0x39/0xf0 do_idle+0x1b5/0x210 cpu_startup_entry+0x20/0x30 start_secondary+0xf3/0x100 secondary_startup_64_no_verify+0xc3/0xcb handlers: [<000000008f9bac49>] vp_interrupt [<000000008f9bac49>] vp_interrupt Disabling IRQ #22 This happens because we don't invoke .enable_cbs callback in virtio_device_restore(). That callback is used by some transports (e.g. virtio-pci) to enable interrupts. Let's fix it, by calling virtio_device_ready() as we do in virtio_dev_probe(). This function calls .enable_cts callback and sets DRIVER_OK status bit. This fix also avoids setting DRIVER_OK twice for those drivers that call virtio_device_ready() in the .restore. Fixes: d50497eb4e55 ("virtio_config: introduce a new .enable_cbs method") Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20220322114313.116516-1-sgarzare@redhat.com Signed-off-by: Michael S. Tsirkin drivers/virtio/virtio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit f03560a57c1f60db6ac23ffd9714e1c69e2f95c7 Author: Michael S. Tsirkin Date: Sun Mar 20 07:02:14 2022 -0400 tools/virtio: compile with -pthread When using pthreads, one has to compile and link with -lpthread, otherwise e.g. glibc is not guaranteed to be reentrant. This replaces -lpthread. Reported-by: Matthew Wilcox Signed-off-by: Michael S. Tsirkin tools/virtio/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 06f05bc52269e1f8286ce0fba03b565528fb1456 Author: Michael S. Tsirkin Date: Fri Mar 4 12:09:18 2022 -0500 tools/virtio: fix after premapped buf support Signed-off-by: Michael S. Tsirkin tools/virtio/linux/dma-mapping.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 920379a465da775ae0bf84d44c16f5432b5be575 Author: Xuan Zhuo Date: Thu Feb 24 19:03:56 2022 +0800 virtio_ring: remove flags check for unmap packed indirect desc When calling vring_unmap_desc_packed(), it will not encounter the situation that the flags contains VRING_DESC_F_INDIRECT. So remove this logic. Signed-off-by: Xuan Zhuo Link: https://lore.kernel.org/r/20220224110402.108161-4-xuanzhuo@linux.alibaba.com Signed-off-by: Michael S. Tsirkin drivers/virtio/virtio_ring.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) commit b4282ebc71aacfa69fc998173ca93b09235ce71f Author: Xuan Zhuo Date: Thu Feb 24 19:03:55 2022 +0800 virtio_ring: remove flags check for unmap split indirect desc When calling vring_unmap_one_split_indirect(), it will not encounter the situation that the flags contains VRING_DESC_F_INDIRECT. So remove this logic. Signed-off-by: Xuan Zhuo Link: https://lore.kernel.org/r/20220224110402.108161-3-xuanzhuo@linux.alibaba.com Signed-off-by: Michael S. Tsirkin drivers/virtio/virtio_ring.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) commit d80dc15bb6e76a6c6b838f683361ceb68950dbbd Author: Xuan Zhuo Date: Thu Feb 24 19:03:54 2022 +0800 virtio_ring: rename vring_unmap_state_packed() to vring_unmap_extra_packed() The actual parameter handled by vring_unmap_state_packed() is that vring_desc_extra, so this function should use "extra" instead of "state". Signed-off-by: Xuan Zhuo Link: https://lore.kernel.org/r/20220224110402.108161-2-xuanzhuo@linux.alibaba.com Signed-off-by: Michael S. Tsirkin drivers/virtio/virtio_ring.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) commit 1e00e821e4ca6355c7fff9f69a4c5ecd78e348a0 Author: Eli Cohen Date: Mon Feb 21 14:19:27 2022 +0200 net/mlx5: Add support for configuring max device MTU Allow an admin creating a vdpa device to specify the max MTU for the net device. For example, to create a device with max MTU of 1000, the following command can be used: $ vdpa dev add name vdpa-a mgmtdev auxiliary/mlx5_core.sf.1 mtu 1000 This configuration mechanism assumes that vdpa is the sole real user of the function. mlx5_core could theoretically change the mtu of the function using the ip command on the mlx5_core net device but this should not be done. Reviewed-by: Si-Wei Liu Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220221121927.194728-1-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang drivers/vdpa/mlx5/net/mlx5_vnet.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) commit ea993de113b85557ed34da8f7b4af0629550e023 Author: zhenwei pi Date: Wed Mar 2 11:39:17 2022 +0800 virtio-crypto: rename skcipher algs Suggested by Gonglei, rename virtio_crypto_algs.c to virtio_crypto_skcipher_algs.c. Also minor changes for function name. Thus the function of source files get clear: skcipher services in virtio_crypto_skcipher_algs.c and akcipher services in virtio_crypto_akcipher_algs.c. Signed-off-by: zhenwei pi Link: https://lore.kernel.org/r/20220302033917.1295334-5-pizhenwei@bytedance.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Gonglei drivers/crypto/virtio/Makefile | 2 +- drivers/crypto/virtio/virtio_crypto_common.h | 4 ++-- drivers/crypto/virtio/virtio_crypto_mgr.c | 8 ++++---- .../{virtio_crypto_algs.c => virtio_crypto_skcipher_algs.c} | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) commit 59ca6c93387d325e96577d8bd4c23c78c1491c11 Author: zhenwei pi Date: Wed Mar 2 11:39:16 2022 +0800 virtio-crypto: implement RSA algorithm Support rsa & pkcs1pad(rsa,sha1) with priority 150. Test with QEMU built-in backend, it works fine. 1, The self-test framework of crypto layer works fine in guest kernel 2, Test with Linux guest(with asym support), the following script test(note that pkey_XXX is supported only in a newer version of keyutils): - both public key & private key - create/close session - encrypt/decrypt/sign/verify basic driver operation - also test with kernel crypto layer(pkey add/query) All the cases work fine. rm -rf *.der *.pem *.pfx modprobe pkcs8_key_parser # if CONFIG_PKCS8_PRIVATE_KEY_PARSER=m rm -rf /tmp/data dd if=/dev/random of=/tmp/data count=1 bs=226 openssl req -nodes -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -subj "/C=CN/ST=BJ/L=HD/O=qemu/OU=dev/CN=qemu/emailAddress=qemu@qemu.org" openssl pkcs8 -in key.pem -topk8 -nocrypt -outform DER -out key.der openssl x509 -in cert.pem -inform PEM -outform DER -out cert.der 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 keyctl pkey_query $PRIV_KEY_ID 0 keyctl pkey_query $PUB_KEY_ID 0 echo "Enc with priv key..." keyctl pkey_encrypt $PRIV_KEY_ID 0 /tmp/data enc=pkcs1 >/tmp/enc.priv echo "Dec with pub key..." keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.priv enc=pkcs1 >/tmp/dec cmp /tmp/data /tmp/dec echo "Sign with priv key..." keyctl pkey_sign $PRIV_KEY_ID 0 /tmp/data enc=pkcs1 hash=sha1 > /tmp/sig echo "Verify with pub key..." keyctl pkey_verify $PRIV_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1 echo "Enc with pub key..." keyctl pkey_encrypt $PUB_KEY_ID 0 /tmp/data enc=pkcs1 >/tmp/enc.pub echo "Dec with priv key..." keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.pub enc=pkcs1 >/tmp/dec cmp /tmp/data /tmp/dec echo "Verify with pub key..." keyctl pkey_verify $PUB_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1 [1 compiling warning during development] Reported-by: kernel test robot Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenwei pi Link: https://lore.kernel.org/r/20220302033917.1295334-4-pizhenwei@bytedance.com Reviewed-by: Gonglei Signed-off-by: Nathan Chancellor #Kconfig tweaks Link: https://lore.kernel.org/r/20220308205309.2192502-1-nathan@kernel.org Signed-off-by: Michael S. Tsirkin drivers/crypto/virtio/Kconfig | 3 + drivers/crypto/virtio/Makefile | 1 + .../crypto/virtio/virtio_crypto_akcipher_algs.c | 585 +++++++++++++++++++++ drivers/crypto/virtio/virtio_crypto_common.h | 3 + drivers/crypto/virtio/virtio_crypto_core.c | 6 +- drivers/crypto/virtio/virtio_crypto_mgr.c | 11 + 6 files changed, 608 insertions(+), 1 deletion(-) commit 24e19590628b58578748eeaec8140bf9c9dc00d9 Author: zhenwei pi Date: Wed Mar 2 11:39:15 2022 +0800 virtio-crypto: introduce akcipher service Introduce asymmetric service definition, asymmetric operations and several well known algorithms. Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenwei pi Link: https://lore.kernel.org/r/20220302033917.1295334-3-pizhenwei@bytedance.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Gonglei include/uapi/linux/virtio_crypto.h | 81 +++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) commit 13d640a3e9a3ac7ec694843d3d3b785e85fb8cb8 Author: zhenwei pi Date: Wed Mar 2 11:39:14 2022 +0800 virtio_crypto: Introduce VIRTIO_CRYPTO_NOSPC Base on the lastest virtio crypto spec, define VIRTIO_CRYPTO_NOSPC. Reviewed-by: Gonglei Signed-off-by: zhenwei pi Link: https://lore.kernel.org/r/20220302033917.1295334-2-pizhenwei@bytedance.com Signed-off-by: Michael S. Tsirkin include/uapi/linux/virtio_crypto.h | 1 + 1 file changed, 1 insertion(+) commit 90a6951b58e935124eeb7ecd9fbc2426f841ac0c Author: Gautam Dawar Date: Tue Feb 15 11:04:29 2022 +0530 Add definition of VIRTIO_F_IN_ORDER feature bit This patch adds the definition of VIRTIO_F_IN_ORDER feature bit in the relevant header file to make it available in QEMU's linux standard header file virtio_config.h, which is updated using scripts/update-linux-headers.sh Signed-off-by: Gautam Dawar Link: https://lore.kernel.org/r/20220215053430.24650-1-gdawar@xilinx.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang include/uapi/linux/virtio_config.h | 6 ++++++ 1 file changed, 6 insertions(+) commit 504c1cabe325df65c18ef38365ddd1a41c6b591b Author: Miaohe Lin Date: Tue Jan 25 21:22:21 2022 +0800 mm/balloon_compaction: make balloon page compaction callbacks static Since commit b1123ea6d3b3 ("mm: balloon: use general non-lru movable page feature"), these functions are called via balloon_aops callbacks. They're not called directly outside this file. So make them static and clean up the relevant code. Signed-off-by: Miaohe Lin Link: https://lore.kernel.org/r/20220125132221.2220-1-linmiaohe@huawei.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Muchun Song include/linux/balloon_compaction.h | 22 ---------------------- mm/balloon_compaction.c | 6 +++--- 2 files changed, 3 insertions(+), 25 deletions(-) commit 6f84622db395456f071910a1851fda66325855bd Author: Zhu Lingshan Date: Tue Feb 22 19:54:28 2022 +0800 vDPA/ifcvf: cacheline alignment for ifcvf_hw This commit introduces a new cacheline aligned layout for ifcvf_hw. Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/20220222115428.998334-6-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin drivers/vdpa/ifcvf/ifcvf_base.c | 4 ---- drivers/vdpa/ifcvf/ifcvf_base.h | 10 +++++----- 2 files changed, 5 insertions(+), 9 deletions(-) commit 9b3e814834009a7d197ab6f93d6e061c0c4ee7e6 Author: Zhu Lingshan Date: Tue Feb 22 19:54:27 2022 +0800 vDPA/ifcvf: implement shared IRQ feature On some platforms/devices, there may not be enough MSI vectors allocated for the virtqueues and config changes. In such a case, the interrupt sources(virtqueues, config changes) must share an IRQ/vector, to avoid initialization failures, keep the device functional. This commit handles three cases: (1) number of the allocated vectors == the number of virtqueues + 1 (config changes), every virtqueue and the config interrupt has a separated vector/IRQ, the best and the most likely case. (2) number of the allocated vectors is less than the best case, but greater than 1. In this case, all virtqueues share a vector/IRQ, the config interrupt has a separated vector/IRQ (3) only one vector is allocated, in this case, the virtqueues and the config interrupt share a vector/IRQ. The worst and most unlikely case. Otherwise, it needs to fail. This commit introduces some helper functions: ifcvf_set_vq_vector() and ifcvf_set_config_vector() sets virtqueue vector and config vector in the device config space, so that the device can send interrupt DMA. Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/20220222115428.998334-5-lingshan.zhu@intel.com Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220315124130.1710030-1-trix@redhat.com Signed-off-by: Michael S. Tsirkin drivers/vdpa/ifcvf/ifcvf_base.c | 48 ++++--- drivers/vdpa/ifcvf/ifcvf_base.h | 15 +- drivers/vdpa/ifcvf/ifcvf_main.c | 294 +++++++++++++++++++++++++++++++++++----- 3 files changed, 300 insertions(+), 57 deletions(-) commit ad5c5690de57f0bd3888ecade4685d4181a4e85c Author: Zhu Lingshan Date: Tue Feb 22 19:54:26 2022 +0800 vDPA/ifcvf: implement device MSIX vector allocator This commit implements a MSIX vector allocation helper for vqs and config interrupts. Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/20220222115428.998334-4-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin drivers/vdpa/ifcvf/ifcvf_main.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) commit cce0ab2b2a39072d81f98017f7b076f3410ef740 Author: Zhu Lingshan Date: Tue Feb 22 19:54:25 2022 +0800 vhost_vdpa: don't setup irq offloading when irq_num < 0 When irq number is negative(e.g., -EINVAL), the virtqueue may be disabled or the virtqueues are sharing a device irq. In such case, we should not setup irq offloading for a virtqueue. Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/20220222115428.998334-3-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin drivers/vhost/vdpa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 8897d6d0fcc9ce54f53c0d14de2ada35e9527e8b Author: Zhu Lingshan Date: Tue Feb 22 19:54:24 2022 +0800 vDPA/ifcvf: make use of virtio pci modern IO helpers in ifcvf This commit discards ifcvf_ioreadX()/writeX(), use virtio pci modern IO helpers instead Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/20220222115428.998334-2-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin drivers/vdpa/ifcvf/ifcvf_base.c | 104 +++++++++++++--------------------------- drivers/vdpa/ifcvf/ifcvf_base.h | 1 + drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- 3 files changed, 36 insertions(+), 71 deletions(-) commit d3bb267bbdcba199568f1325743d9d501dea0560 Author: Stefano Garzarella Date: Fri Jan 21 16:31:08 2022 +0100 vhost: cache avail index in vhost_enable_notify() In vhost_enable_notify() we enable the notifications and we read the avail index to check if new buffers have become available in the meantime. We are not caching the avail index, so when the device will call vhost_get_vq_desc(), it will find the old value in the cache and it will read the avail index again. It would be better to refresh the cache every time we read avail index, so let's change vhost_enable_notify() caching the value in `avail_idx` and compare it with `last_avail_idx` to check if there are new buffers available. We don't expect a significant performance boost because the above path is not very common, indeed vhost_enable_notify() is often called with unlikely(), expecting that avail index has not been updated. We ran virtio-test/vhost-test and noticed minimal improvement as expected. To stress the patch more, we modified vhost_test.ko to call vhost_enable_notify()/vhost_disable_notify() on every cycle when calling vhost_get_vq_desc(); in this case we observed a more evident improvement, with a reduction of the test execution time of about 3.7%. Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20220121153108.187291-1-sgarzare@redhat.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi drivers/vhost/vhost.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 6f4abbaa1bd3c87f3190a6c5c07ee5e55d7ea322 Author: Gavin Shan Date: Wed Jan 19 09:05:51 2022 +0800 drivers/virtio: Enable virtio mem for ARM64 This enables virtio-mem device support by allowing to enable the corresponding kernel config option (CONFIG_VIRTIO_MEM) on the architecture. Signed-off-by: Gavin Shan Acked-by: David Hildenbrand Acked-by: Jonathan Cameron Acked-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20220119010551.181405-1-gshan@redhat.com Signed-off-by: Michael S. Tsirkin Signed-off-by: Gavin Shan Acked-by: David Hildenbrand Acked-by: Jonathan Cameron Acked-by: Michael S. Tsirkin drivers/virtio/Kconfig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit b0cf9b4b26e697886bf0986579953c16cf92d3d2 Author: Brian Cain Date: Fri Jan 28 10:46:30 2022 -0600 MAINTAINERS: update hexagon maintainer email, tree Some email infrastructure changes required this switch. Signed-off-by: Brian Cain MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit dcf500065fabe27676dfe7b4ba521a4f1e0fc8ac Author: Damien Le Moal Date: Mon Mar 28 15:27:08 2022 +0900 net: bnxt_ptp: fix compilation error The Broadcom bnxt_ptp driver does not compile with GCC 11.2.2 when CONFIG_WERROR is enabled. The following error is generated: drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c: In function ‘bnxt_ptp_enable’: drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:400:43: error: array subscript 255 is above array bounds of ‘struct pps_pin[4]’ [-Werror=array-bounds] 400 | ptp->pps_info.pins[pin_id].event = BNXT_PPS_EVENT_EXTERNAL; | ~~~~~~~~~~~~~~~~~~^~~~~~~~ In file included from drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c:20: drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h:75:24: note: while referencing ‘pins’ 75 | struct pps_pin pins[BNXT_MAX_TSIO_PINS]; | ^~~~ cc1: all warnings being treated as errors This is due to the function ptp_find_pin() returning a pin ID of -1 when a valid pin is not found and this error never being checked. Change the TSIO_PIN_VALID() function to also check that a pin ID is not negative and use this macro in bnxt_ptp_enable() to check the result of the calls to ptp_find_pin() to return an error early for invalid pins. This fixes the compilation error. Cc: Fixes: 9e518f25802c ("bnxt_en: 1PPS functions to configure TSIO pins") Signed-off-by: Damien Le Moal Reviewed-by: Michael Chan Link: https://lore.kernel.org/r/20220328062708.207079-1-damien.lemoal@opensource.wdc.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 6 +++++- drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) commit 7203062171db6669f746d14148c4af76af619e74 Merge: dfdc1de64248 b31c41339f4f Author: Linus Torvalds Date: Mon Mar 28 13:00:51 2022 -0700 Merge tag 'tty-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver updates from Greg KH: "Here are the big set of tty and serial driver changes for 5.18-rc1. Nothing major, some more good cleanups from Jiri and 2 new serial drivers. Highlights include: - termbits cleanups - export symbol cleanups and other core cleanups from Jiri Slaby - new sunplus and mvebu uart drivers (amazing that people are still creating new uarts...) - samsung serial driver cleanups - ldisc 29 is now "reserved" for experimental/development line disciplines - lots of other tiny fixes and cleanups to serial drivers and bindings All of these have been in linux-next for a while with no reported issues" * tag 'tty-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (104 commits) vt_ioctl: fix potential spectre v1 in VT_DISALLOCATE serial: 8250: fix XOFF/XON sending when DMA is used tty: serial: samsung: Add ARTPEC-8 support dt-bindings: serial: samsung: Add ARTPEC-8 UART serial: sc16is7xx: Clear RS485 bits in the shutdown tty: serial: samsung: simplify getting OF match data tty: serial: samsung: constify variables and pointers tty: serial: samsung: constify s3c24xx_serial_drv_data members tty: serial: samsung: constify UART name tty: serial: samsung: constify s3c24xx_serial_drv_data tty: serial: samsung: reduce number of casts tty: serial: samsung: embed s3c2410_uartcfg in parent structure tty: serial: samsung: embed s3c24xx_uart_info in parent structure serial: 8250_tegra: mark acpi_device_id as unused with !ACPI tty: serial: bcm63xx: use more precise Kconfig symbol serial: SERIAL_SUNPLUS should depend on ARCH_SUNPLUS tty: serial: jsm: fix two assignments in if conditions tty: serial: jsm: remove redundant assignments to variable linestatus serial: 8250_mtk: make two read-only arrays static const serial: samsung_tty: do not unlock port->lock for uart_write_wakeup() ... commit b79dfef0e2fcf41c736e7012c59d1260aa60f075 Author: Mauro Carvalho Chehab Date: Sat Mar 26 11:27:24 2022 +0100 scripts/kernel-doc: change the line number meta info In order to make it more standard and ReST compatible, change the meta-tag used with --enable-lineno from: #define LINENO to .. LINENO In practice, no functional changes. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/40725032b5a4a33db740bf1de397523af958ff8a.1648290305.git.mchehab@kernel.org Signed-off-by: Jonathan Corbet Documentation/sphinx/kerneldoc.py | 2 +- scripts/kernel-doc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit 92b6de17b21cf74448d2397ef92d5ca856c6419f Author: Mauro Carvalho Chehab Date: Sat Mar 26 11:27:23 2022 +0100 scripts/get_abi: change the file/line number meta info In order to make it more standard and ReST compatible, change the meta-tag used with --enable-lineno from: #define LINENO to .. LINENO In practice, no functional changes. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/125ffd31fbc77ad9eee4d6906e1830b8162fa6ca.1648290305.git.mchehab@kernel.org Signed-off-by: Jonathan Corbet Documentation/sphinx/kernel_abi.py | 2 +- scripts/get_abi.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit bcf0a536bff913f3c77c4c469bff13fd9ebeb1e9 Author: Mauro Carvalho Chehab Date: Sat Mar 26 11:27:22 2022 +0100 docs: kernel_include.py: add sphinx build dependencies The files included by kernel-include should be added as build dependencies, in order for sphinx-build to rebuild the corresponding docs if any changes at the included file happens. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/d30fc4fa422a13b7e1623d690945c46b58a55e79.1648290305.git.mchehab@kernel.org Signed-off-by: Jonathan Corbet Documentation/sphinx/kernel_include.py | 3 +++ 1 file changed, 3 insertions(+) commit b4541803d858dc058e6ba5f1817ab89af95c9c21 Author: Mauro Carvalho Chehab Date: Sat Mar 26 11:27:21 2022 +0100 docs: kernel_abi.py: add sphinx build dependencies Ensure that Sphinx-build will handle the files parsed by get_abi.pl as dependencies. This way, if they are touched, the ABI output will be regenerated. Reported-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/10bc3d3bc74f514a539cd3b48b9d287d2b6f99e2.1648290305.git.mchehab@kernel.org Signed-off-by: Jonathan Corbet Documentation/sphinx/kernel_abi.py | 4 ++++ 1 file changed, 4 insertions(+) commit 85999f03147e73fc5c0a0a3c0db1fad368ca75e4 Author: Mauro Carvalho Chehab Date: Sat Mar 26 11:27:20 2022 +0100 docs: kernel_feat.py: add build dependencies Ensure that the feature files will be regenerated if any changes happen at the Documentation/features files that were processed by gen_feat.pl. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/5cdf7a8300019129dcc09d4c2557f75908754445.1648290305.git.mchehab@kernel.org Signed-off-by: Jonathan Corbet Documentation/sphinx/kernel_feat.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) commit 01096e5cfe3ce5b26ccc933ad20401e24074a76a Author: Mauro Carvalho Chehab Date: Sat Mar 26 11:27:19 2022 +0100 scripts/get_feat.pl: allow output the parsed file names Such output could be helpful while debugging it, but its main goal is to tell kernel_feat.py about what files were used by the script. Thie way, kernel_feat.py can add those as documentation dependencies. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/11b438ee01e00c866f5ea197d6aecc26e9f86945.1648290305.git.mchehab@kernel.org Signed-off-by: Jonathan Corbet scripts/get_feat.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) commit d987d5ae51ecfa75e61f4de56c7e2bb77be57fea Author: Akira Yokosawa Date: Sat Mar 26 16:48:39 2022 +0900 docs: kfigure.py: Don't warn of missing PDF converter in 'make htmldocs' SVG -> PDF conversion is not required in "make htmldocs". It is pointless to always warn of a missing converter. Demote the log message in setupTools() to verbose. For "make pdfdocs" (or "make latexdocs"), promote the dynamic message of "include SVG raw" to a warn. Expand the message and recommend installing Inkscape or ImageMagick. Fixes: 8ccd05697a9d ("docs: sphinx/kfigure.py: Use inkscape(1) for SVG -> PDF conversion") Signed-off-by: Akira Yokosawa Cc: Jonathan Corbet Cc: Mauro Carvalho Chehab Cc: linux-doc@vger.kernel.org Acked-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/c80e1481-10d4-7151-fe59-e846259eb0d4@gmail.com Signed-off-by: Jonathan Corbet Documentation/sphinx/kfigure.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit dfdc1de64248b5e1024d8188aeaf0e59ec6cecd5 Merge: 266d17a8c0d8 41197a5f11a4 Author: Linus Torvalds Date: Mon Mar 28 12:50:50 2022 -0700 Merge tag 'staging-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the big set of staging driver updates for 5.18-rc1. Loads of tiny cleanups for almost all staging drivers in here, nothing major at all. Highlights include: - remove the ashmem Android driver. It is long-dead and if there are any legacy userspace applications still using it, the Android kernel images will maintain it, the community shouldn't care about it anymore - wfx wifi driver major cleanups. Should be ready to merge out of staging soon, and will coordinate with the wifi maintainers after -rc1 is out - major cleanups and unwinding of the layers of the r8188eu driver. It's amazing just how many unneeded layers of abstraction is in there, just when we think it's done, another is found... - lots of tiny coding style cleanups in many other staging drivers. All have been in linux-next for a while with no reported problems" * tag 'staging-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (455 commits) staging: r8188eu: remove unnecessary memset in r8188eu staging: greybus: introduce pwm_ops::apply staging: rts5208: Resolve checkpatch.pl issues. staging: sm750fb: fix naming style staging: fbtft: Consider type of init sequence values in fbtft_init_display() staging: fbtft: Constify buf parameter in fbtft_dbg_hex() staging: mmal-vchiq: clear redundant item named bulk_scratch mips: dts: ralink: add MT7621 SoC staging: r8188eu: remove some unused local ieee80211 macros staging: r8188eu: make rtl8188e_process_phy_info static staging: r8188eu: remove unused function prototype staging: r8188eu: remove three unused receive defines staging: r8188eu: remove unnecessary initializations staging: rtl8192e: Fix spelling mistake "RESQUEST" -> "REQUEST" MAINTAINERS: remove the obsolete file entry for staging in ANDROID DRIVERS staging: r8188eu: proper error handling in rtw_init_drv_sw staging: r8188eu: call _cancel_timer_ex from _rtw_free_recv_priv staging: vt6656: Removed unused variable vt3342_vnt_threshold staging: vt6656: Removed unused variable bb_vga_0 staging: remove ashmem ... commit 266d17a8c0d857a579813ad185cd1640b0d6ccac Merge: 02e2af20f4f9 88d99e870143 Author: Linus Torvalds Date: Mon Mar 28 12:41:28 2022 -0700 Merge tag 'driver-core-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the set of driver core changes for 5.18-rc1. Not much here, primarily it was a bunch of cleanups and small updates: - kobj_type cleanups for default_groups - documentation updates - firmware loader minor changes - component common helper added and take advantage of it in many drivers (the largest part of this pull request). All of these have been in linux-next for a while with no reported problems" * tag 'driver-core-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (54 commits) Documentation: update stable review cycle documentation drivers/base/dd.c : Remove the initial value of the global variable Documentation: update stable tree link Documentation: add link to stable release candidate tree devres: fix typos in comments Documentation: add note block surrounding security patch note samples/kobject: Use sysfs_emit instead of sprintf base: soc: Make soc_device_match() simpler and easier to read driver core: dd: fix return value of __setup handler driver core: Refactor sysfs and drv/bus remove hooks driver core: Refactor multiple copies of device cleanup scripts: get_abi.pl: Fix typo in help message kernfs: fix typos in comments kernfs: remove unneeded #if 0 guard ALSA: hda/realtek: Make use of the helper component_compare_dev_name video: omapfb: dss: Make use of the helper component_compare_dev power: supply: ab8500: Make use of the helper component_compare_dev ASoC: codecs: wcd938x: Make use of the helper component_compare/release_of iommu/mediatek: Make use of the helper component_compare/release_of drm: of: Make use of the helper component_release_of ... commit 02e2af20f4f9f2aa0c84e9a30a35c02f0fbb7daa Merge: ff61bc81b3fe 37fd83916da2 Author: Linus Torvalds Date: Mon Mar 28 12:27:35 2022 -0700 Merge tag 'char-misc-5.18-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 big set of char/misc and other small driver subsystem updates for 5.18-rc1. Included in here are merges from driver subsystems which contain: - iio driver updates and new drivers - fsi driver updates - fpga driver updates - habanalabs driver updates and support for new hardware - soundwire driver updates and new drivers - phy driver updates and new drivers - coresight driver updates - icc driver updates Individual changes include: - mei driver updates - interconnect driver updates - new PECI driver subsystem added - vmci driver updates - lots of tiny misc/char driver updates All of these have been in linux-next for a while with no reported problems" * tag 'char-misc-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (556 commits) firmware: google: Properly state IOMEM dependency kgdbts: fix return value of __setup handler firmware: sysfb: fix platform-device leak in error path firmware: stratix10-svc: add missing callback parameter on RSU arm64: dts: qcom: add non-secure domain property to fastrpc nodes misc: fastrpc: Add dma handle implementation misc: fastrpc: Add fdlist implementation misc: fastrpc: Add helper function to get list and page misc: fastrpc: Add support to secure memory map dt-bindings: misc: add fastrpc domain vmid property misc: fastrpc: check before loading process to the DSP misc: fastrpc: add secure domain support dt-bindings: misc: add property to support non-secure DSP misc: fastrpc: Add support to get DSP capabilities misc: fastrpc: add support for FASTRPC_IOCTL_MEM_MAP/UNMAP misc: fastrpc: separate fastrpc device from channel context dt-bindings: nvmem: brcm,nvram: add basic NVMEM cells dt-bindings: nvmem: make "reg" property optional nvmem: brcm_nvram: parse NVRAM content into NVMEM cells nvmem: dt-bindings: Fix the error of dt-bindings check ... commit ff61bc81b3feebcef4d0431a92e2e40e8d4fe8b3 Merge: 901c7280ca0d 4a6d01495a16 Author: Linus Torvalds Date: Mon Mar 28 11:52:53 2022 -0700 Merge tag 'pinctrl-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "No core changes this time. Just new driver code and improvements! New drivers: - New driver for the Broadcom BCM4908 SoC. - New subdriver for Tesla FSD (Full Self Driving) SoC, a derivative of the Samsung Exynos pin control driver. - New driver for the Amlogic Meson S4 SoC. - New driver for the Sunplus SP7021 SoC. - New driver for the Microsemi Ocelot family ServalT SoC. - New subdriver for Intel Alder Lake-M SoC. - New subdriver for Intel Ice Lake-N SoC, including PCH support. - New subdriver for Renesas R8A779F0 SoC. - New subdriver for Mediatek MT8186 SoC. - New subdriver for NXP Freescale i.MX93 SoC. - New driver for Nuvoton WPCM450 SoC. - New driver for Qualcomm SC8280XP SoC. Improvements: - Wakeup support on Samsung Exynos850 and ExynosAutov9. - Serious and voluminous maintenance cleanup and refactoring in the Renesas drivers. Mainly sharing similar data between the different SoC subdrivers. - Qualcomm SM8450 EGPIO support. - Drive strength support on the Mediatek MT8195. - Add some missing groups and functions to the Ralink RT2880" * tag 'pinctrl-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (188 commits) pinctrl: mediatek: common-v1: fix semicolon.cocci warnings pinctrl: nuvoton: wpcm450: Fix build error without OF pinctrl: qcom-pmic-gpio: Add support for pm8450 dt-bindings: pinctrl: aspeed: Update gfx node in example dt-bindings: pinctrl: rt2880: add missing pin groups and functions pinctrl: ingenic: Fix regmap on X series SoCs pinctrl: nuvoton: Fix return value check in wpcm450_gpio_register() pinctrl: nuvoton: wpcm450: off by one in wpcm450_gpio_register() pinctrl: nuvoton: wpcm450: select GENERIC_PINCTRL_GROUPS pinctrl: nuvoton: Fix sparse warning pinctrl: mediatek: mt8186: Account for probe refactoring pinctrl: mediatek: common-v1: Commonize spec_ies_smt_set callback pinctrl: mediatek: common-v1: Commonize spec_pupd callback pinctrl: mediatek: common-v1: Use common probe function pinctrl: mediatek: common-v1: Add common probe function pinctrl: mediatek: paris: Unify probe function by using OF match data pinctrl/rockchip: Add missing of_node_put() in rockchip_pinctrl_probe pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe pinctrl: berlin: fix error return code of berlin_pinctrl_build_state() pinctrl: qcom: Introduce sc8280xp TLMM driver ... commit 901c7280ca0d5e2b4a8929fbe0bfb007ac2a6544 Author: Linus Torvalds Date: Mon Mar 28 11:37:05 2022 -0700 Reinstate some of "swiotlb: rework "fix info leak with DMA_FROM_DEVICE"" Halil Pasic points out [1] that the full revert of that commit (revert in bddac7c1e02b), and that a partial revert that only reverts the problematic case, but still keeps some of the cleanups is probably better.  And that partial revert [2] had already been verified by Oleksandr Natalenko to also fix the issue, I had just missed that in the long discussion. So let's reinstate the cleanups from commit aa6f8dcbab47 ("swiotlb: rework "fix info leak with DMA_FROM_DEVICE""), and effectively only revert the part that caused problems. Link: https://lore.kernel.org/all/20220328013731.017ae3e3.pasic@linux.ibm.com/ [1] Link: https://lore.kernel.org/all/20220324055732.GB12078@lst.de/ [2] Link: https://lore.kernel.org/all/4386660.LvFx2qVVIh@natalenko.name/ [3] Suggested-by: Halil Pasic Tested-by: Oleksandr Natalenko Cc: Christoph Hellwig" Signed-off-by: Linus Torvalds Documentation/core-api/dma-attributes.rst | 8 -------- include/linux/dma-mapping.h | 8 -------- kernel/dma/swiotlb.c | 12 ++++++++---- 3 files changed, 8 insertions(+), 20 deletions(-) commit 5e2baa04e4cd94c2465b248b7d861fcff8c22fae Author: Vitaly Rodionov Date: Mon Mar 28 12:56:14 2022 +0100 ALSA: hda/cs8409: Add new Dolphin HW variants Add 5 new Dolphin Systems, same configuration as older systems. Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220328115614.15761-7-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_cs8409-tables.c | 5 +++++ 1 file changed, 5 insertions(+) commit 5e74a144837997e6efc52c56d6686fb6c11c627e Author: Stefan Binding Date: Mon Mar 28 12:56:13 2022 +0100 ALSA: hda/cs8409: Disable HSBIAS_SENSE_EN for Cyborg For ESD reasons, all variants should now set HSBIAS_SENSE_EN. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220328115614.15761-6-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_cs8409.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) commit 6581a045d54c6a8fe335dd2f343fc7cd2ebfe9e7 Author: Stefan Binding Date: Mon Mar 28 12:56:12 2022 +0100 ALSA: hda/cs8409: Support new Warlock MLK Variants Added 15 new laptops, with 2 variants: Warlock MLK and Warlock MLK with Dual Mic The only difference between the variants, is the the dual Mic variants use a stereo DMIC. These variants do no use reduce volume (Full Scale Volume) Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220328115614.15761-5-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_cs8409-tables.c | 29 +++++++++++++++++++++++++++++ sound/pci/hda/patch_cs8409.c | 15 +++++++++++++-- sound/pci/hda/patch_cs8409.h | 2 ++ 3 files changed, 44 insertions(+), 2 deletions(-) commit 342b6b610ae2a351de904022271e740c4c2b452b Author: Stefan Binding Date: Mon Mar 28 12:56:11 2022 +0100 ALSA: hda/cs8409: Fix Full Scale Volume setting for all variants All current variants (Bullseye/Warlock/Cyborg) should be using reduced volume (-6dB) for better speaker protection. Refactor to make more explicit the meaning and setting of Full Scale Volume setting to avoid future confusion. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220328115614.15761-4-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_cs8409.c | 29 ++++++++++++++++------------- sound/pci/hda/patch_cs8409.h | 3 +++ 2 files changed, 19 insertions(+), 13 deletions(-) commit bdc159dfda0acec5ca3adde1a1b58e1e0ddc8311 Author: Stefan Binding Date: Mon Mar 28 12:56:10 2022 +0100 ALSA: hda/cs8409: Re-order quirk table into ascending order To ensure consistency, the quirk table should be re-ordered in ascending order [ a typo fix in the patch description by tiwai ] Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220328115614.15761-3-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_cs8409-tables.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) commit 8a7724535bacbb94fd9441ec232a83d71006d2a9 Author: Stefan Binding Date: Mon Mar 28 12:56:09 2022 +0100 ALSA: hda/cs8409: Fix Warlock to use mono mic configuration Warlock/Bullseye Laptops have a mono DMIC, Cyborg uses a stereo DMIC, and the configuration should reflect this. Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220328115614.15761-2-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_cs8409.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit d9142e1cf3bbdaf21337767114ecab26fe702d47 Author: Naresh Kamboju Date: Mon Mar 28 19:16:50 2022 +0530 selftests: net: Add tls config dependency for tls selftests selftest net tls test cases need TLS=m without this the test hangs. Enabling config TLS solves this problem and runs to complete. - CONFIG_TLS=m Reported-by: Linux Kernel Functional Testing Signed-off-by: Naresh Kamboju Signed-off-by: David S. Miller tools/testing/selftests/net/config | 1 + 1 file changed, 1 insertion(+) commit 2aa2f88c970783633da3d248ab3df7e15a416eca Merge: bcb74e132a76 33758c891479 Author: David S. Miller Date: Mon Mar 28 08:57:10 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Incorrect output device in nf_egress hook, from Phill Sutter. 2) Preserve liberal flag in TCP conntrack state, reported by Sven Auhagen. 3) Use GFP_KERNEL_ACCOUNT flag for nf_tables objects, from Vasily Averin. ==================== Signed-off-by: David S. Miller commit 85bcfa26f9a3782be37d4feafd49668b98b8bdbe Author: Darrick J. Wong Date: Wed Mar 16 13:38:43 2022 -0700 xfs: don't report reserved bnobt space as available On a modern filesystem, we don't allow userspace to allocate blocks for data storage from the per-AG space reservations, the user-controlled reservation pool that prevents ENOSPC in the middle of internal operations, or the internal per-AG set-aside that prevents unwanted filesystem shutdowns due to ENOSPC during a bmap btree split. Since we now consider freespace btree blocks as unavailable for allocation for data storage, we shouldn't report those blocks via statfs either. This makes the numbers that we return via the statfs f_bavail and f_bfree fields a more conservative estimate of actual free space. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Dave Chinner fs/xfs/xfs_fsops.c | 2 +- fs/xfs/xfs_super.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) commit 82be38bcf8a2e056b4c99ce79a3827fa743df6ec Author: Darrick J. Wong Date: Thu Mar 24 10:57:07 2022 -0700 xfs: fix overfilling of reserve pool Due to cycling of m_sb_lock, it's possible for multiple callers of xfs_reserve_blocks to race at changing the pool size, subtracting blocks from fdblocks, and actually putting it in the pool. The result of all this is that we can overfill the reserve pool to hilarious levels. xfs_mod_fdblocks, when called with a positive value, already knows how to take freed blocks and either fill the reserve until it's full, or put them in fdblocks. Use that instead of setting m_resblks_avail directly. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner fs/xfs/xfs_fsops.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit 0baa2657dc4d79202148be79a3dc36c35f425060 Author: Darrick J. Wong Date: Thu Mar 24 12:43:32 2022 -0700 xfs: always succeed at setting the reserve pool size Nowadays, xfs_mod_fdblocks will always choose to fill the reserve pool with freed blocks before adding to fdblocks. Therefore, we can change the behavior of xfs_reserve_blocks slightly -- setting the target size of the pool should always succeed, since a deficiency will eventually be made up as blocks get freed. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner fs/xfs/xfs_fsops.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 15f04fdc75aaaa1cccb0b8b3af1be290e118a7bc Author: Darrick J. Wong Date: Fri Mar 11 10:56:01 2022 -0800 xfs: remove infinite loop when reserving free block pool Infinite loops in kernel code are scary. Calls to xfs_reserve_blocks should be rare (people should just use the defaults!) so we really don't need to try so hard. Simplify the logic here by removing the infinite loop. Cc: Brian Foster Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner fs/xfs/xfs_fsops.c | 50 ++++++++++++++++++++------------------------------ 1 file changed, 20 insertions(+), 30 deletions(-) commit c8c568259772751a14e969b7230990508de73d9d Author: Darrick J. Wong Date: Wed Mar 16 11:54:18 2022 -0700 xfs: don't include bnobt blocks when reserving free block pool xfs_reserve_blocks controls the size of the user-visible free space reserve pool. Given the difference between the current and requested pool sizes, it will try to reserve free space from fdblocks. However, the amount requested from fdblocks is also constrained by the amount of space that we think xfs_mod_fdblocks will give us. If we forget to subtract m_allocbt_blks before calling xfs_mod_fdblocks, it will will return ENOSPC and we'll hang the kernel at mount due to the infinite loop. In commit fd43cf600cf6, we decided that xfs_mod_fdblocks should not hand out the "free space" used by the free space btrees, because some portion of the free space btrees hold in reserve space for future btree expansion. Unfortunately, xfs_reserve_blocks' estimation of the number of blocks that it could request from xfs_mod_fdblocks was not updated to include m_allocbt_blks, so if space is extremely low, the caller hangs. Fix this by creating a function to estimate the number of blocks that can be reserved from fdblocks, which needs to exclude the set-aside and m_allocbt_blks. Found by running xfs/306 (which formats a single-AG 20MB filesystem) with an fstests configuration that specifies a 1k blocksize and a specially crafted log size that will consume 7/8 of the space (17920 blocks, specifically) in that AG. Cc: Brian Foster Fixes: fd43cf600cf6 ("xfs: set aside allocation btree blocks from block reservation") Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Dave Chinner fs/xfs/xfs_fsops.c | 2 +- fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_mount.h | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) commit 7c9d845f0612e5bcd23456a2ec43be8ac43458f1 Author: Trond Myklebust Date: Mon Mar 28 08:36:34 2022 -0400 NFSv4/pNFS: Fix another issue with a list iterator pointing to the head In nfs4_callback_devicenotify(), if we don't find a matching entry for the deviceid, we're left with a pointer to 'struct nfs_server' that actually points to the list of super blocks associated with our struct nfs_client. Furthermore, even if we have a valid pointer, nothing pins the super block, and so the struct nfs_server could end up getting freed while we're using it. Since all we want is a pointer to the struct pnfs_layoutdriver_type, let's skip all the iteration over super blocks, and just use APIs to find the layout driver directly. Reported-by: Xiaomeng Tong Fixes: 1be5683b03a7 ("pnfs: CB_NOTIFY_DEVICEID") Signed-off-by: Trond Myklebust fs/nfs/callback_proc.c | 27 +++++++++------------------ fs/nfs/pnfs.c | 11 +++++++++++ fs/nfs/pnfs.h | 2 ++ 3 files changed, 22 insertions(+), 18 deletions(-) commit d1868328dec5ae2cf210111025fcbc71f78dd5ca Author: Christophe JAILLET Date: Sat Mar 26 15:50:46 2022 +0100 block: Fix the maximum minor value is blk_alloc_ext_minor() ida_alloc_range(..., min, max, ...) returns values from min to max, inclusive. So, NR_EXT_DEVT is a valid idx returned by blk_alloc_ext_minor(). This is an issue because in device_add_disk(), this value is used in: ddev->devt = MKDEV(disk->major, disk->first_minor); and NR_EXT_DEVT is '(1 << MINORBITS)'. So, should 'disk->first_minor' be NR_EXT_DEVT, it would overflow. Fixes: 22ae8ce8b892 ("block: simplify bdev/disk lookup in blkdev_get") Signed-off-by: Christophe JAILLET Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/cc17199798312406b90834e433d2cefe8266823d.1648306232.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jens Axboe block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 15583a563cd5a7358e975599b7de7caacd9e9ce9 Author: Jiri Slaby Date: Mon Mar 28 10:59:28 2022 +0200 block: restore the old set_task_ioprio() behaviour wrt PF_EXITING PF_EXITING tasks were silently ignored before the below commits. Continue doing so. Otherwise python-psutil tests fail: ERROR: psutil.tests.test_process.TestProcess.test_zombie_process ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/build/lib.linux-x86_64-3.9/psutil/_pslinux.py", line 1661, in wrapper return fun(self, *args, **kwargs) File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/build/lib.linux-x86_64-3.9/psutil/_pslinux.py", line 2133, in ionice_set return cext.proc_ioprio_set(self.pid, ioclass, value) ProcessLookupError: [Errno 3] No such process During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/psutil/tests/test_process.py", line 1313, in test_zombie_process succeed_or_zombie_p_exc(fun) File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/psutil/tests/test_process.py", line 1288, in succeed_or_zombie_p_exc return fun() File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/build/lib.linux-x86_64-3.9/psutil/__init__.py", line 792, in ionice return self._proc.ionice_set(ioclass, value) File "/home/abuild/rpmbuild/BUILD/psutil-5.9.0/build/lib.linux-x86_64-3.9/psutil/_pslinux.py", line 1665, in wrapper raise NoSuchProcess(self.pid, self._name) psutil.NoSuchProcess: process no longer exists (pid=2057) Cc: Christoph Hellwig Cc: Jan Kara Cc: Jens Axboe Fixes: 5fc11eebb4 (block: open code create_task_io_context in set_task_ioprio) Fixes: a957b61254 (block: fix error in handling dead task for ioprio setting) Signed-off-by: Jiri Slaby Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220328085928.7899-1-jslaby@suse.cz Signed-off-by: Jens Axboe block/blk-ioc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit af41d2866f7d75bbb38d487f6ec7770425d70e45 Author: Christophe Leroy Date: Sun Mar 27 09:32:26 2022 +0200 powerpc/64: Fix build failure with allyesconfig in book3s_64_entry.S Using conditional branches between two files is hasardous, they may get linked too far from each other. arch/powerpc/kvm/book3s_64_entry.o:(.text+0x3ec): relocation truncated to fit: R_PPC64_REL14 (stub) against symbol `system_reset_common' defined in .text section in arch/powerpc/kernel/head_64.o Reorganise the code to use non conditional branches. Fixes: 89d35b239101 ("KVM: PPC: Book3S HV P9: Implement the rest of the P9 path in C") Signed-off-by: Christophe Leroy [mpe: Avoid odd-looking bne ., use named local labels] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/89cf27bf43ee07a0b2879b9e8e2f5cd6386a3645.1648366338.git.christophe.leroy@csgroup.eu arch/powerpc/kvm/book3s_64_entry.S | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 1aa940d97f8cee25d48faf05d18eddfbc2fe9554 Merge: f82da161ea75 f771b55731fc Author: Michael Ellerman Date: Mon Mar 28 21:11:24 2022 +1100 Merge branch 'topic/ppc-kvm' into next Merge some more commits from our KVM topic branch. In particular this brings in some commits that depend on a new capability that was merged via the KVM tree for v5.18. commit e7dbd4d5369df7d101d6fde5595229df7060939d Merge: 2957308343fa 5e6ded2e7a5d Author: Petr Mladek Date: Mon Mar 28 10:56:22 2022 +0200 Merge branch 'for-5.18/selftests-fixes' into for-linus commit 33758c891479ea1c736abfee64b5225925875557 Author: Vasily Averin Date: Thu Mar 24 21:05:50 2022 +0300 memcg: enable accounting for nft objects nftables replaces iptables, but it lacks memcg accounting. This patch account most of the memory allocation associated with nft and should protect the host from misusing nft inside a memcg restricted container. Signed-off-by: Vasily Averin Signed-off-by: Pablo Neira Ayuso net/netfilter/core.c | 2 +- net/netfilter/nf_tables_api.c | 44 +++++++++++++++++++++---------------------- 2 files changed, 23 insertions(+), 23 deletions(-) commit 5f7b839d47dbc74cf4a07beeab5191f93678673e Author: Haowen Bai Date: Mon Mar 28 10:48:59 2022 +0800 SUNRPC: Return true/false (not 1/0) from bool functions Return boolean values ("true" or "false") instead of 1 or 0 from bool functions. This fixes the following warnings from coccicheck: ./fs/nfsd/nfs2acl.c:289:9-10: WARNING: return of 0/1 in function 'nfsaclsvc_encode_accessres' with return type bool ./fs/nfsd/nfs2acl.c:252:9-10: WARNING: return of 0/1 in function 'nfsaclsvc_encode_getaclres' with return type bool Signed-off-by: Haowen Bai Signed-off-by: Chuck Lever fs/nfsd/nfs2acl.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) commit ae085d7f9365de7da27ab5c0d16b12d51ea7fca9 Author: Muchun Song Date: Sun Mar 27 13:18:52 2022 +0800 mm: kfence: fix missing objcg housekeeping for SLAB The objcg is not cleared and put for kfence object when it is freed, which could lead to memory leak for struct obj_cgroup and wrong statistics of NR_SLAB_RECLAIMABLE_B or NR_SLAB_UNRECLAIMABLE_B. Since the last freed object's objcg is not cleared, mem_cgroup_from_obj() could return the wrong memcg when this kfence object, which is not charged to any objcgs, is reallocated to other users. A real word issue [1] is caused by this bug. Link: https://lore.kernel.org/all/000000000000cabcb505dae9e577@google.com/ [1] Reported-by: syzbot+f8c45ccc7d5d45fc5965@syzkaller.appspotmail.com Fixes: d3fb45f370d9 ("mm, kfence: insert KFENCE hooks for SLAB") Signed-off-by: Muchun Song Cc: Dmitry Vyukov Cc: Marco Elver Cc: Andrew Morton Signed-off-by: Linus Torvalds mm/slab.c | 1 + 1 file changed, 1 insertion(+) commit f82da161ea75dc4db21b2499e4b1facd36dab275 Author: Stephen Rothwell Date: Mon Mar 28 08:55:39 2022 +1100 powerpc: restore removed #endif Fixes: 7001052160d1 ("Merge tag 'x86_core_for_5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") Signed-off-by: Stephen Rothwell Brown-paper-bag-by: Linus Torvalds Signed-off-by: Linus Torvalds arch/powerpc/include/asm/livepatch.h | 1 + 1 file changed, 1 insertion(+) commit 29cbaa3e60dfe48e341a3a5ce1c2d8f3d9e9667c Merge: 50d602d81f35 aea0b9f2486d Author: Linus Torvalds Date: Sun Mar 27 14:26:47 2022 -0700 Merge tag 'landlock-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux Pull landlock updates from Mickaël Salaün: "These two commits contain a minor fix for the sandboxer sample, and a Landlock ruleset FD name standardization" * tag 'landlock-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mic/linux: landlock: Use square brackets around "landlock-ruleset" samples/landlock: Fix path_list memory leak commit 50d602d81f35621042fa0cdae25808662caffda8 Merge: dfb0a0b715fd 1b0d0f7c12d5 Author: Linus Torvalds Date: Sun Mar 27 14:21:57 2022 -0700 Merge tag 'mailbox-v5.18' of git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: "qcom: - add support for MSM8976 mtk: - enable mt8186 - add ADSP controller driver ti: - use poll mode during suspend tegra: - fix tx channel flush imx: - add i.MX8 SECO MU support - prepare for, and add iMX93 support" * tag 'mailbox-v5.18' of git://git.linaro.org/landing-teams/working/fujitsu/integration: dt-bindings: mailbox: add definition for mt8186 mailbox: ti-msgmgr: Operate mailbox in polled mode during system suspend mailbox: ti-msgmgr: Refactor message read during interrupt handler mailbox: imx: support i.MX93 S401 MU mailbox: imx: support dual interrupts mailbox: imx: extend irq to an array dt-bindings: mailbox: imx-mu: add i.MX93 S4 MU support dt-bindings: mailbox: imx-mu: add i.MX93 MU mailbox: imx: add i.MX8 SECO MU support mailbox: imx: introduce rxdb callback dt-bindings: mailbox: imx-mu: add i.MX8 SECO MU support mailbox: imx: enlarge timeout while reading/writing messages to SCFW mailbox: imx: fix crash in resume on i.mx8ulp mailbox: imx: fix wakeup failure from freeze mode mailbox: mediatek: add support for adsp mailbox controller dt-bindings: mailbox: mtk,adsp-mbox: add mtk adsp-mbox document mailbox: qcom-apcs-ipc: Add compatible for MSM8976 SoC dt-bindings: mailbox: Add compatible for the MSM8976 mailbox: tegra-hsp: Flush whole channel commit dfb0a0b715fdda25a5a1f54cb9c73e1410a868e8 Merge: 7b58b82b86c8 e26557a0aa68 Author: Linus Torvalds Date: Sun Mar 27 14:09:48 2022 -0700 Merge tag 'leds-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED updates from Pavel Machek: "Nothing major here, there are two drivers that need review and did not make it into this round" * tag 'leds-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: pca955x: Allow zero LEDs to be specified leds: pca955x: Make the gpiochip always expose all pins leds: simatic-ipc-leds: Don't directly deref ioremap_resource() returned ptr leds: simatic-ipc-leds: Make simatic_ipc_led_mem_res static leds: lm3692x: Return 0 from remove callback leds: sgm3140: Add ocs,ocp8110 compatible dt-bindings: vendor-prefixes: Add ocs prefix dt-bindings: leds: common: fix unit address in max77693 example commit 7b58b82b86c8b65a2b57a4c6cb96a460654f9e09 Merge: 02f9a04d76b7 ab0809af0bee Author: Linus Torvalds Date: Sun Mar 27 13:42:32 2022 -0700 Merge tag 'perf-tools-for-v5.18-2022-03-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools updates from Arnaldo Carvalho de Melo: "New features: perf ftrace: - Add -n/--use-nsec option to the 'latency' subcommand. Default: usecs: $ sudo perf ftrace latency -T dput -a sleep 1 # DURATION | COUNT | GRAPH | 0 - 1 us | 2098375 | ############################# | 1 - 2 us | 61 | | 2 - 4 us | 33 | | 4 - 8 us | 13 | | 8 - 16 us | 124 | | 16 - 32 us | 123 | | 32 - 64 us | 1 | | 64 - 128 us | 0 | | 128 - 256 us | 1 | | 256 - 512 us | 0 | | Better granularity with nsec: $ sudo perf ftrace latency -T dput -a -n sleep 1 # DURATION | COUNT | GRAPH | 0 - 1 us | 0 | | 1 - 2 ns | 0 | | 2 - 4 ns | 0 | | 4 - 8 ns | 0 | | 8 - 16 ns | 0 | | 16 - 32 ns | 0 | | 32 - 64 ns | 0 | | 64 - 128 ns | 1163434 | ############## | 128 - 256 ns | 914102 | ############# | 256 - 512 ns | 884 | | 512 - 1024 ns | 613 | | 1 - 2 us | 31 | | 2 - 4 us | 17 | | 4 - 8 us | 7 | | 8 - 16 us | 123 | | 16 - 32 us | 83 | | perf lock: - Add -c/--combine-locks option to merge lock instances in the same class into a single entry. # perf lock report -c Name acquired contended avg wait(ns) total wait(ns) max wait(ns) min wait(ns) rcu_read_lock 251225 0 0 0 0 0 hrtimer_bases.lock 39450 0 0 0 0 0 &sb->s_type->i_l... 10301 1 662 662 662 662 ptlock_ptr(page) 10173 2 701 1402 760 642 &(ei->i_block_re... 8732 0 0 0 0 0 &xa->xa_lock 8088 0 0 0 0 0 &base->lock 6705 0 0 0 0 0 &p->pi_lock 5549 0 0 0 0 0 &dentry->d_lockr... 5010 4 1274 5097 1844 789 &ep->lock 3958 0 0 0 0 0 - Add -F/--field option to customize the list of fields to output: $ perf lock report -F contended,wait_max -k avg_wait Name contended max wait(ns) avg wait(ns) slock-AF_INET6 1 23543 23543 &lruvec->lru_lock 5 18317 11254 slock-AF_INET6 1 10379 10379 rcu_node_1 1 2104 2104 &dentry->d_lockr... 1 1844 1844 &dentry->d_lockr... 1 1672 1672 &newf->file_lock 15 2279 1025 &dentry->d_lockr... 1 792 792 - Add --synth=no option for record, as there is no need to symbolize, lock names comes from the tracepoints. perf record: - Threaded recording, opt-in, via the new --threads command line option. - Improve AMD IBS (Instruction-Based Sampling) error handling messages. perf script: - Add 'brstackinsnlen' field (use it with -F) for branch stacks. - Output branch sample type in 'perf script'. perf report: - Add "addr_from" and "addr_to" sort dimensions. - Print branch stack entry type in 'perf report --dump-raw-trace' - Fix symbolization for chrooted workloads. Hardware tracing: Intel PT: - Add CFE (Control Flow Event) and EVD (Event Data) packets support. - Add MODE.Exec IFLAG bit support. Explanation about these features from the "Intel® 64 and IA-32 architectures software developer’s manual combined volumes: 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D, and 4" PDF at: https://cdrdv2.intel.com/v1/dl/getContent/671200 At page 3951: "32.2.4 Event Trace is a capability that exposes details about the asynchronous events, when they are generated, and when their corresponding software event handler completes execution. These include: o Interrupts, including NMI and SMI, including the interrupt vector when defined. o Faults, exceptions including the fault vector. - Page faults additionally include the page fault address, when in context. o Event handler returns, including IRET and RSM. o VM exits and VM entries.¹ - VM exits include the values written to the “exit reason” and “exit qualification” VMCS fields. INIT and SIPI events. o TSX aborts, including the abort status returned for the RTM instructions. o Shutdown. Additionally, it provides indication of the status of the Interrupt Flag (IF), to indicate when interrupts are masked" ARM CoreSight: - Use advertised caps/min_interval as default sample_period on ARM spe. - Update deduction of TRCCONFIGR register for branch broadcast on ARM's CoreSight ETM. Vendor Events (JSON): Intel: - Update events and metrics for: Alderlake, Broadwell, Broadwell DE, BroadwellX, CascadelakeX, Elkhartlake, Bonnell, Goldmont, GoldmontPlus, Westmere EP-DP, Haswell, HaswellX, Icelake, IcelakeX, Ivybridge, Ivytown, Jaketown, Knights Landing, Nehalem EP, Sandybridge, Silvermont, Skylake, Skylake Server, SkylakeX, Tigerlake, TremontX, Westmere EP-SP, and Westmere EX. ARM: - Add support for HiSilicon CPA PMU aliasing. perf stat: - Fix forked applications enablement of counters. - The 'slots' should only be printed on a different order than the one specified on the command line when 'topdown' events are present, fix it. Miscellaneous: - Sync msr-index, cpufeatures header files with the kernel sources. - Stop using some deprecated libbpf APIs in 'perf trace'. - Fix some spelling mistakes. - Refactor the maps pointers usage to pave the way for using refcount debugging. - Only offer the --tui option on perf top, report and annotate when perf was built with libslang. - Don't mention --to-ctf in 'perf data --help' when not linking with the required library, libbabeltrace. - Use ARRAY_SIZE() instead of ad hoc equivalent, spotted by array_size.cocci. - Enhance the matching of sub-commands abbreviations: 'perf c2c rec' -> 'perf c2c record' 'perf c2c recport -> error - Set build-id using build-id header on new mmap records. - Fix generation of 'perf --version' string. perf test: - Add test for the arm_spe event. - Add test to check unwinding using fame-pointer (fp) mode on arm64. - Make metric testing more robust in 'perf test'. - Add error message for unsupported branch stack cases. libperf: - Add API for allocating new thread map array. - Fix typo in perf_evlist__open() failure error messages in libperf tests. perf c2c: - Replace bitmap_weight() with bitmap_empty() where appropriate" * tag 'perf-tools-for-v5.18-2022-03-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (143 commits) perf evsel: Improve AMD IBS (Instruction-Based Sampling) error handling messages perf python: Add perf_env stubs that will be needed in evsel__open_strerror() perf tools: Enhance the matching of sub-commands abbreviations libperf tests: Fix typo in perf_evlist__open() failure error messages tools arm64: Import cputype.h perf lock: Add -F/--field option to control output perf lock: Extend struct lock_key to have print function perf lock: Add --synth=no option for record tools headers cpufeatures: Sync with the kernel sources tools headers cpufeatures: Sync with the kernel sources perf stat: Fix forked applications enablement of counters tools arch x86: Sync the msr-index.h copy with the kernel sources perf evsel: Make evsel__env() always return a valid env perf build-id: Fix spelling mistake "Cant" -> "Can't" perf header: Fix spelling mistake "could't" -> "couldn't" perf script: Add 'brstackinsnlen' for branch stacks perf parse-events: Move slots only with topdown perf ftrace latency: Update documentation perf ftrace latency: Add -n/--use-nsec option perf tools: Fix version kernel tag ... commit 02f9a04d76b76b80b05ddc33ceabe806b84fda3c Merge: 88b3be5c6391 58ffc34896db Author: Linus Torvalds Date: Sun Mar 27 13:36:06 2022 -0700 Merge tag 'memblock-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock updates from Mike Rapoport: "Test suite and a small cleanup: - A small cleanup of unused variable in __next_mem_pfn_range_in_zone - Initial test suite to simulate memblock behaviour in userspace" * tag 'memblock-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: (27 commits) memblock tests: Add TODO and README files memblock tests: Add memblock_alloc_try_nid tests for bottom up memblock tests: Add memblock_alloc_try_nid tests for top down memblock tests: Add memblock_alloc_from tests for bottom up memblock tests: Add memblock_alloc_from tests for top down memblock tests: Add memblock_alloc tests for bottom up memblock tests: Add memblock_alloc tests for top down memblock tests: Add simulation of physical memory memblock tests: Split up reset_memblock function memblock tests: Fix testing with 32-bit physical addresses memblock: __next_mem_pfn_range_in_zone: remove unneeded local variable nid memblock tests: Add memblock_free tests memblock tests: Add memblock_add_node test memblock tests: Add memblock_remove tests memblock tests: Add memblock_reserve tests memblock tests: Add memblock_add tests memblock tests: Add memblock reset function memblock tests: Add skeleton of the memblock simulator tools/include: Add debugfs.h stub tools/include: Add pfn.h stub ... commit 7dcfe50f58d28e0e2ba79e9e4333888bcf9442a4 Author: Niklas Schnelle Date: Mon Sep 20 09:47:29 2021 +0200 s390/pci: rename get_zdev_by_bus() to zdev_from_bus() Getting a zpci_dev via get_zdev_by_bus() uses the long lived reference held in zbus->function[devfn]. This is accounted for in pcibios_add_device() and pcibios_release_device(). Therefore there is no need to increment the reference count in get_zdev_by_bus() as is done for get_zdev_by_fid(). Instead callers must not access the device after pcibios_release_device() was called which is necessary for common PCI code anyway. With this though the very similar naming may be misleading so rename get_zdev_by_bus() to zdev_from_bus() emphasizing that we are directly referencing the zdev via the bus. Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Signed-off-by: Vasily Gorbik arch/s390/pci/pci.c | 4 ++-- arch/s390/pci/pci_bus.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) commit c122383d221dfa2f41cfe5e672540595de986fde Author: Niklas Schnelle Date: Mon Sep 20 09:32:21 2021 +0200 s390/pci: improve zpci_dev reference counting Currently zpci_dev uses kref based reference counting but only accounts for one original reference plus one reference from an added pci_dev to its underlying zpci_dev. Counting just the original reference worked until the pci_dev reference was added in commit 2a671f77ee49 ("s390/pci: fix use after free of zpci_dev") because once a zpci_dev goes away, i.e. enters the reserved state, it would immediately get released. However with the pci_dev reference this is no longer the case and the zpci_dev may still appear in multiple availability events indicating that it was reserved. This was solved by detecting when the zpci_dev is already on its way out but still hanging around. This has however shown some light on how unusual our zpci_dev reference counting is. Improve upon this by modelling zpci_dev reference counting on pci_dev. Analogous to pci_get_slot() increment the reference count in get_zdev_by_fid(). Thus all users of get_zdev_by_fid() must drop the reference once they are done with the zpci_dev. Similar to pci_scan_single_device(), zpci_create_device() returns the device with an initial count of 1 and the device added to the zpci_list (analogous to the PCI bus' device_list). In turn users of zpci_create_device() must only drop the reference once the device is gone from the point of view of the zPCI subsystem, it might still be referenced by the common PCI subsystem though. Reviewed-by: Matthew Rosato Signed-off-by: Niklas Schnelle Signed-off-by: Vasily Gorbik arch/s390/pci/pci.c | 1 + arch/s390/pci/pci_bus.h | 3 ++- arch/s390/pci/pci_clp.c | 9 +++++++-- arch/s390/pci/pci_event.c | 7 ++++++- 4 files changed, 16 insertions(+), 4 deletions(-) commit 7277b4216a1162157de06fd93cd54426c47d47b8 Author: Alexander Gordeev Date: Thu Mar 24 20:02:24 2022 +0100 s390/smp: use physical address for SIGP_SET_PREFIX command Signal processor SIGP_SET_PREFIX command expects physical address of the lowcore to be installed, but instead the virtual address is provided. Note: this does not fix a bug currently, since virtual and physical addresses are identical. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik arch/s390/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4f45c37ffd100522f890fc7f8bd71a3b8f79b6be Author: Yu Liao Date: Tue Mar 22 11:00:57 2022 +0800 s390: cleanup timer API use cleanup the s390's use of the timer API - del_timer() contains timer_pending() condition - mod_timer(timer, expires) is equivalent to: del_timer(timer); timer->expires = expires; add_timer(timer); If the timer is inactive it will be activated, using add_timer() on condition !timer_pending(&private->timer) is redundant. Just cleanup, no logic change. Signed-off-by: Yu Liao Link: https://lore.kernel.org/r/20220322030057.1243196-1-liaoyu15@huawei.com Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik drivers/s390/char/sclp.c | 4 +--- drivers/s390/char/sclp_con.c | 3 +-- drivers/s390/char/sclp_vt220.c | 6 ++---- drivers/s390/cio/device_fsm.c | 12 +++--------- drivers/s390/cio/eadm_sch.c | 12 +++--------- 5 files changed, 10 insertions(+), 27 deletions(-) commit 97f32e11730e05927df196bcc8e30d8f2bcbb181 Author: Jakob Koschel Date: Sat Mar 19 21:35:28 2022 +0100 s390/zcrypt: fix using the correct variable for sizeof() While the original code is valid, it is not the obvious choice for the sizeof() call and in preparation to limit the scope of the list iterator variable the sizeof should be changed to the size of the variable being allocated. Signed-off-by: Jakob Koschel Signed-off-by: Harald Freudenberger Signed-off-by: Vasily Gorbik drivers/s390/crypto/zcrypt_card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7107822004198f60dd46d102694a666db784d28b Author: Tony Krowiak Date: Fri Mar 18 16:17:35 2022 -0400 s390/vfio-ap: fix kernel doc and signature of group notifier functions The vfio_ap device driver registers a group notifier function to handle the VFIO_GROUP_NOTIFY_SET_KVM event signalling the KVM pointer has been set or cleared. There are two helper functions invoked by the handler function: One called when the KVM pointer has been set, and the other when the pointer is cleared. The kernel doc for both of these functions contains a comment introduced by commit 0cc00c8d4050 (s390/vfio-ap: fix circular lockdep when setting/clearing crypto masks) that is no longer valid. This patch removes this comment from the kernel doc of each helper function. Commit 86956e70761b (s390/vfio-ap: replace open coded locks for VFIO_GROUP_NOTIFY_SET_KVM notification) added a parameter to the signature of the helper function that handles the event indicating the KVM pointer has been cleared. The parameter added was the KVM pointer itself. One of the function's primary purposes is to clear the KVM pointer from the ap_matrix_mdev instance in which it is stored. Since the callers of this function derive the KVM pointer passed to the function from the ap_matrix_mdev object itself, it is completely unnecessary to include this parameter in the function's signature since it can simply be retrieved from the ap_matrix_mdev object which is also passed in. This patch removes the KVM pointer from the function's signature. Signed-off-by: Tony Krowiak Signed-off-by: Vasily Gorbik drivers/s390/crypto/vfio_ap_ops.c | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) commit ed0192bc644f3553d64a5cb461bdd0b1fbae3fdf Author: Alexander Gordeev Date: Thu Mar 17 15:03:03 2022 +0100 s390/maccess: rework absolute lowcore accessors Macro mem_assign_absolute() is able to access the whole memory, but is only used and makes sense when updating the absolute lowcore. Instead, introduce get_abs_lowcore() and put_abs_lowcore() macros that limit access to absolute lowcore addresses only. Suggested-by: Heiko Carstens Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik arch/s390/include/asm/processor.h | 17 ++++++++++++----- arch/s390/kernel/ipl.c | 4 ++-- arch/s390/kernel/machine_kexec.c | 2 +- arch/s390/kernel/os_info.c | 2 +- arch/s390/kernel/setup.c | 19 ++++++++++--------- arch/s390/kernel/smp.c | 12 ++++++------ 6 files changed, 32 insertions(+), 24 deletions(-) commit 9097fc793f74ef9c677f8c4aed0c24f6f07f0133 Author: Alexander Gordeev Date: Thu Mar 17 15:03:02 2022 +0100 s390/smp: cleanup control register update routines Get rid of duplicate code and redundant data. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik arch/s390/include/asm/ctl_reg.h | 16 +++++++++++----- arch/s390/kernel/smp.c | 36 ++++++++++++------------------------ 2 files changed, 23 insertions(+), 29 deletions(-) commit dc2ab23b992c9d5dab93b9bf01b10b10465e537e Author: Alexander Gordeev Date: Thu Mar 17 15:03:01 2022 +0100 s390/smp: cleanup target CPU callback starting Macro mem_assign_absolute() is used to initialize a target CPU lowcore callback parameters. But despite the macro name it writes to the absolute lowcore only if the target CPU is offline. In case the CPU is online the macro does implicitly write to the normal memory. That behaviour is correct, but extremely subtle. Sacrifice few program bits in favour of clarity and distinguish between online vs offline CPUs and normal vs absolute lowcore pointer. Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik arch/s390/kernel/smp.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) commit afacda5faabdfe0f0e91e89db3ff1dc0b46f669a Author: Vasily Gorbik Date: Sat Mar 5 19:10:49 2022 +0100 s390/test_unwind: verify __kretprobe_trampoline is replaced Reviewed-by: Tobias Huschle Signed-off-by: Vasily Gorbik arch/s390/lib/test_unwind.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 708b13763920ab3c191b31da555f2d90eef4c618 Author: Vasily Gorbik Date: Sat Mar 5 13:16:07 2022 +0100 s390/unwind: avoid duplicated unwinding entries for kretprobes Currently when unwinding starts from pt_regs or encounters pt_regs along the way unwinder tries to yield 2 unwinding entries: 1. (reliable) ip1: pt_regs->psw.addr, sp1: regs->gprs[15] 2. (non-reliable) ip2: sp1->gprs[8] (r14), sp2: regs->gprs[15] In case of kretprobes those are identical and serves no other purpose than causing confusion over duplicated entries and cause kprobes tests to fail. So, skip a duplicate non-reliable entry in this case. With that kretprobes and unwinder implementation now comply with ARCH_CORRECT_STACKTRACE_ON_KRETPROBE. Reviewed-by: Tobias Huschle Signed-off-by: Vasily Gorbik arch/s390/Kconfig | 1 + arch/s390/kernel/unwind_bc.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) commit d81675b60d0959cfa3727f03d5b90558fb457011 Author: Vasily Gorbik Date: Wed Apr 28 16:29:40 2021 +0200 s390/unwind: recover kretprobe modified return address in stacktrace Based on commit cd9bc2c92588 ("arm64: Recover kretprobe modified return address in stacktrace"). """ Since the kretprobe replaces the function return address with the __kretprobe_trampoline on the stack, stack unwinder shows it instead of the correct return address. This checks whether the next return address is the __kretprobe_trampoline(), and if so, try to find the correct return address from the kretprobe instance list. """ Original patch series: https://lore.kernel.org/all/163163030719.489837.2236069935502195491.stgit@devnote2/ Reviewed-by: Tobias Huschle Signed-off-by: Vasily Gorbik arch/s390/include/asm/unwind.h | 13 +++++++++++++ arch/s390/kernel/unwind_bc.c | 8 ++------ 2 files changed, 15 insertions(+), 6 deletions(-) commit 09bc20c8fb35cf1afed1612b287e9ddbe6a7d73c Author: Vasily Gorbik Date: Sat Mar 5 15:02:07 2022 +0100 s390/kprobes: enable kretprobes framepointer verification Use regs->gprs[15] for framepointer verification. This enables additional sanity checks for nested kretprobes. Reviewed-by: Tobias Huschle Signed-off-by: Vasily Gorbik arch/s390/kernel/kprobes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 0b452520477efbe4370cb747572c3c63c7cb3176 Author: Vasily Gorbik Date: Sat Mar 5 18:57:44 2022 +0100 s390/test_unwind: extend kretprobe test Verify unwinding from kretprobed function. Reviewed-by: Tobias Huschle Signed-off-by: Vasily Gorbik arch/s390/lib/test_unwind.c | 49 ++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 16 deletions(-) commit a7e196f579cdcc9cf723d5b1ea05575de2fe72f6 Author: Heiko Carstens Date: Mon Mar 14 20:48:57 2022 +0100 s390/ap: adjust whitespace Adjust indentation of inline assemblies, so all comments start at the same position. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/ap.h | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) commit 2d6c0008be64bd813008d2a796108e89edec1030 Author: Heiko Carstens Date: Mon Mar 14 20:45:32 2022 +0100 s390/ap: use insn format for new instructions Use insn format with instruction format specifier instead of plain longs. This way it is also more obvious that code instead of data is generated. The generated code is identical. Reviewed-by: Harald Freudenberger Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/ap.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit 6982dba181deba54c5ccb301aaed6f6ec14c6310 Author: Heiko Carstens Date: Sun Mar 13 22:39:27 2022 +0100 s390/alternatives: use insn format for new instructions Use insn format with instruction format specifier instead of plain longs. This way it is also more obvious that code instead of data is generated. The generated code is identical. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/spinlock.h | 2 +- arch/s390/kernel/entry.S | 10 +++++----- arch/s390/lib/spinlock.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) commit 4afeb670710efa5cd5ed8b1d9f2d22d6ce332bcc Author: Heiko Carstens Date: Sun Mar 13 22:04:10 2022 +0100 s390/alternatives: use instructions instead of byte patterns Use readable nop instructions within the code which generates the padding areas, instead of unreadable byte patterns. The generated code is identical. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/alternative-asm.h | 12 +++++++++--- arch/s390/include/asm/alternative.h | 15 +++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) commit f09354ffd84eef3c88efa8ba6df05efe50cfd16a Author: Heiko Carstens Date: Wed Mar 16 19:13:20 2022 +0100 s390/traps: improve panic message for translation-specification exception There are many different types of translation exceptions but only a translation-specification exception leads to a kernel panic since it indicates corrupted page tables, which must never happen. Improve the panic message so it is a bit more obvious what this is about. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/kernel/traps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 081397d13f9cfcc10e5bc903559419f6bfc31cca Author: Haowen Bai Date: Tue Mar 15 16:53:41 2022 +0800 s390/tape: use bitwise instead of arithmetic operator for flags This silences the following coccinelle warning: drivers/s390/char/tape_34xx.c:360:38-39: WARNING: sum of probable bitmasks, consider | Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1647334421-29989-1-git-send-email-baihaowen@meizu.com Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik drivers/s390/char/tape_34xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 6ffbeb3fac9d1518109b4adfbe605028883fb181 Author: Russell Currey Date: Fri Mar 4 19:01:09 2022 +1000 s390: fix typo in syscall_wrapper.h Looks like this endif comment was erroneously unchanged when copied over from the x86 version. Signed-off-by: Russell Currey Link: https://lore.kernel.org/r/20220304090109.29386-1-ruscur@russell.cc Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/syscall_wrapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0f210fb39e4a79a3687964c2502784db8075e5e8 Author: Haowen Bai Date: Tue Mar 15 16:01:04 2022 +0800 s390: crypto: Use min_t() instead of doing it manually Fix following coccicheck warning: drivers/s390/crypto/zcrypt_ep11misc.c:1112:25-26: WARNING opportunity for min() Signed-off-by: Haowen Bai Signed-off-by: Harald Freudenberger Signed-off-by: Vasily Gorbik drivers/s390/crypto/zcrypt_ep11misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f4272c03a32576de7bd1543bed764196d3d0dd2f Author: Julia Lawall Date: Mon Mar 14 12:53:50 2022 +0100 s390/pkey: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Harald Freudenberger Signed-off-by: Vasily Gorbik drivers/s390/crypto/pkey_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cfd68b33094e1a92249850ff3c3c92ae9112a541 Author: Juergen Christ Date: Wed Mar 9 14:30:05 2022 +0100 s390/zcrypt: Filter admin CPRBs on custom devices Add a filter for custom devices to check for allowed control domains of admin CPRBs. This filter only applies to custom devices and not to the main device. Signed-off-by: Juergen Christ Signed-off-by: Vasily Gorbik drivers/s390/crypto/zcrypt_api.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) commit 895ae58da4a2360d9c2d255cd9fc8de64e265022 Author: Juergen Christ Date: Wed Dec 15 19:23:29 2021 +0100 s390/zcrypt: Add admask to zcdn Zcrypt custom devices now support control domain masks. Users can set and modify this mask to allow custom devices to access certain control domains. Signed-off-by: Juergen Christ Signed-off-by: Vasily Gorbik drivers/s390/crypto/ap_bus.h | 1 + drivers/s390/crypto/zcrypt_api.c | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) commit 410ce3dd5055b3fa68fb7f99a6756be3a7e17f22 Author: Ingo Molnar Date: Thu Mar 24 09:31:13 2022 +0100 x86/config: Make the x86 defconfigs a bit more usable - Use 'make savedefconfig' to refresh & regenerate the files - Add in KVM boot enablers - Enable the cgroup features most distros rely on [ fix bug found by Nathan Chancellor ] Acked-by: Nathan Chancellor Cc: Linus Torvalds Cc: Borislav Petkov Cc: Thomas Gleixner Cc: Peter Zijlstra Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/YjwsUT/6PkRPjnHE@gmail.com arch/x86/configs/i386_defconfig | 51 +++++++++++++++++++++++++++------------ arch/x86/configs/x86_64_defconfig | 38 +++++++++++++++++++++-------- 2 files changed, 63 insertions(+), 26 deletions(-) commit 88b3be5c6391a5b4be1dcdc4bb8dca8438105438 Merge: 7001052160d1 862cf8d5fd98 Author: Linus Torvalds Date: Sun Mar 27 11:43:09 2022 -0700 Merge tag 'for-linus' of https://github.com/openrisc/linux Pull OpenRISC updates from Stafford Horne: "Not much for OpenRISC this merge window, I do have some things on the back burner like sparse warning cleanups and new defconfigs. But I didn't get time to polish the patches off for this round. There are OpenRISC updates coming in via other queues like removal of set_fs() and possibly new generic ticket locks. This just has a small fixup to remove duplicate initializer in memcpy from Kuniyuki Iwashima" * tag 'for-linus' of https://github.com/openrisc/linux: openrisc/boot: Remove unnecessary initialisation in memcpy(). commit 7001052160d172f6de06adeffde24dde9935ece8 Merge: f022814633e1 3986f65d4f40 Author: Linus Torvalds Date: Sun Mar 27 10:17:23 2022 -0700 Merge tag 'x86_core_for_5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 CET-IBT (Control-Flow-Integrity) support from Peter Zijlstra: "Add support for Intel CET-IBT, available since Tigerlake (11th gen), which is a coarse grained, hardware based, forward edge Control-Flow-Integrity mechanism where any indirect CALL/JMP must target an ENDBR instruction or suffer #CP. Additionally, since Alderlake (12th gen)/Sapphire-Rapids, speculation is limited to 2 instructions (and typically fewer) on branch targets not starting with ENDBR. CET-IBT also limits speculation of the next sequential instruction after the indirect CALL/JMP [1]. CET-IBT is fundamentally incompatible with retpolines, but provides, as described above, speculation limits itself" [1] https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/branch-history-injection.html * tag 'x86_core_for_5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (53 commits) kvm/emulate: Fix SETcc emulation for ENDBR x86/Kconfig: Only allow CONFIG_X86_KERNEL_IBT with ld.lld >= 14.0.0 x86/Kconfig: Only enable CONFIG_CC_HAS_IBT for clang >= 14.0.0 kbuild: Fixup the IBT kbuild changes x86/Kconfig: Do not allow CONFIG_X86_X32_ABI=y with llvm-objcopy x86: Remove toolchain check for X32 ABI capability x86/alternative: Use .ibt_endbr_seal to seal indirect calls objtool: Find unused ENDBR instructions objtool: Validate IBT assumptions objtool: Add IBT/ENDBR decoding objtool: Read the NOENDBR annotation x86: Annotate idtentry_df() x86,objtool: Move the ASM_REACHABLE annotation to objtool.h x86: Annotate call_on_stack() objtool: Rework ASM_REACHABLE x86: Mark __invalid_creds() __noreturn exit: Mark do_group_exit() __noreturn x86: Mark stop_this_cpu() __noreturn objtool: Ignore extra-symbol code objtool: Rename --duplicate to --lto ... commit 826270373f17fd8ebd10753ca0a5fd2ceb1dc38e Author: Terry Bowman Date: Wed Feb 2 09:35:25 2022 -0600 Watchdog: sp5100_tco: Enable Family 17h+ CPUs The driver currently uses a CPU family match of 17h to determine EFCH_PM_DECODEEN_WDT_TMREN register support. This family check will not support future AMD CPUs and instead will require driver updates to add support. Remove the family 17h family check and add a check for SMBus PCI revision ID 0x51 or greater. The MMIO access method has been available since at least SMBus controllers using PCI revision 0x51. This revision check will support family 17h and future AMD processors including EFCH functionality without requiring driver changes. Co-developed-by: Robert Richter Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Tested-by: Jean Delvare Reviewed-by: Jean Delvare Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220202153525.1693378-5-terry.bowman@amd.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/sp5100_tco.c | 16 ++++------------ drivers/watchdog/sp5100_tco.h | 1 + 2 files changed, 5 insertions(+), 12 deletions(-) commit 0578fff4aae5bce3f09875f58e68e9ffbab8daf5 Author: Terry Bowman Date: Wed Feb 2 09:35:24 2022 -0600 Watchdog: sp5100_tco: Add initialization using EFCH MMIO cd6h/cd7h port I/O can be disabled on recent AMD hardware. Read accesses to disabled cd6h/cd7h port I/O will return F's and written data is dropped. It is recommended to replace the cd6h/cd7h port I/O with MMIO. Co-developed-by: Robert Richter Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Tested-by: Jean Delvare Reviewed-by: Jean Delvare Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220202153525.1693378-4-terry.bowman@amd.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/sp5100_tco.c | 100 +++++++++++++++++++++++++++++++++++++++++- drivers/watchdog/sp5100_tco.h | 5 +++ 2 files changed, 104 insertions(+), 1 deletion(-) commit 1f182aca230086d4a4469c0f9136a6ea762d6385 Author: Terry Bowman Date: Wed Feb 2 09:35:23 2022 -0600 Watchdog: sp5100_tco: Refactor MMIO base address initialization Combine MMIO base address and alternate base address detection. Combine based on layout type. This will simplify the function by eliminating a switch case. Move existing request/release code into functions. This currently only supports port I/O request/release. The move into a separate function will make it ready for adding MMIO region support. Co-developed-by: Robert Richter Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Tested-by: Jean Delvare Reviewed-by: Jean Delvare Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220202153525.1693378-3-terry.bowman@amd.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/sp5100_tco.c | 155 ++++++++++++++++++++++-------------------- drivers/watchdog/sp5100_tco.h | 1 + 2 files changed, 82 insertions(+), 74 deletions(-) commit abd71a948f7aab47ca49d3e7fe6afa6c48c8aae0 Author: Terry Bowman Date: Wed Feb 2 09:35:22 2022 -0600 Watchdog: sp5100_tco: Move timer initialization into function Refactor driver's timer initialization into new function. This is needed inorder to support adding new device layouts while using common timer initialization. Co-developed-by: Robert Richter Signed-off-by: Robert Richter Signed-off-by: Terry Bowman Tested-by: Jean Delvare Reviewed-by: Jean Delvare Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220202153525.1693378-2-terry.bowman@amd.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/sp5100_tco.c | 65 ++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 29 deletions(-) commit 1aea522809e67f42295ceb1d21429d76c43697e4 Author: Linus Walleij Date: Mon Feb 7 00:00:28 2022 +0100 watchdog: ixp4xx: Implement restart Implement watchdog restart in the IXP4xx watchdog timer. Signed-off-by: Linus Walleij Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220206230028.476659-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/ixp4xx_wdt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit 7a6b3d8a432d18f48f3390de48f4361bc677712e Author: Chris Packham Date: Fri Feb 11 13:32:57 2022 +1300 watchdog: orion_wdt: support pretimeout on Armada-XP Commit e07a4c79ca75 ("watchdog: orion_wdt: use timer1 as a pretimeout") added support for a pretimeout on Armada-38x variants. Because the Armada-XP variants use armada370_start/armada370_stop (due to missing an explicit RSTOUT mask bit for the watchdog). Add the required pretimeout support to armada370_start/armada370_stop for Armada-XP. Signed-off-by: Chris Packham Reviewed-by: Gregory CLEMENT Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220211003257.2037332-3-chris.packham@alliedtelesis.co.nz Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/orion_wdt.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) commit cd91fb2776967b2b2dea27307a3f23ba3d9bbb32 Author: Rafał Miłecki Date: Wed Feb 9 21:32:02 2022 +0100 watchdog: allow building BCM7038_WDT for BCM4908 BCM4908 is a SoCs family that shares a lot of hardware with BCM63xx including the watchdog block. Allow building this driver for it. Signed-off-by: Rafał Miłecki Acked-by: Florian Fainelli Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220209203202.26395-1-zajec5@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 823a20e3c78be40a2bc88a5727a9c32ad6bb0b99 Author: Thanh Quan Date: Tue Jan 18 18:09:03 2022 +0100 watchdog: renesas_wdt: Add R-Car Gen4 support Add the compatible string for the R-Car Gen4 family. No further driver changes are needed. Signed-off-by: Thanh Quan Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/cc395105e1d34aab2c076d368c0737833970b9d2.1642525158.git.geert+renesas@glider.be Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/renesas_wdt.c | 1 + 1 file changed, 1 insertion(+) commit 7198d62c6687df98d8709503ec4107656dd2cd4d Author: Thanh Quan Date: Tue Jan 18 18:09:02 2022 +0100 dt-bindings: watchdog: renesas-wdt: Document r8a779f0 support Document support for the Watchdog Timer (WDT) Controller in the Renesas R-Car S4-8 (R8A779F0) SoC. Signed-off-by: Thanh Quan Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Acked-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/cca61a83ae82ecf5c23eb28e30c39f2f661f0e02.1642525158.git.geert+renesas@glider.be Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml | 5 +++++ 1 file changed, 5 insertions(+) commit ba6c89ab3b5878364d400b1db4b484e84965f347 Author: Daniel Bristot de Oliveira Date: Fri Feb 11 15:30:14 2022 +0100 watchdog: Improve watchdog_dev function documentation Adjust function comments to the kernel doc format. It also adjusts some variable names and adds return values. No functional change. Changes from V1: Change "Returns" to "Return:" (Randy Dunlap) Cc: Wim Van Sebroeck Cc: Guenter Roeck Cc: Randy Dunlap Cc: linux-watchdog@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Tested-by: Randy Dunlap Acked-by: Randy Dunlap Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/30378a03e9cd9b5f6e92ec9bf512edc38bad8627.1644589712.git.bristot@kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/watchdog_dev.c | 244 ++++++++++++++++++++-------------------- 1 file changed, 125 insertions(+), 119 deletions(-) commit 4ed1a6b6e66dd9ba0a1d56ed23f46c39fe9368c5 Author: Eduardo Valentin Date: Fri Feb 11 18:10:33 2022 -0800 watchdog: aspeed: add nowayout support Add support for not stopping the watchdog when the userspace application quits. At closing of the device, the driver cannot determine if this was a graceful closure or if the app crashed. If the support of nowayout on this driver, the system integrator can select the behaviour by setting the kernel config and enabling it. Cc: Wim Van Sebroeck (maintainer:WATCHDOG DEVICE DRIVERS) Cc: Guenter Roeck (maintainer:WATCHDOG DEVICE DRIVERS) Cc: Joel Stanley (supporter:ARM/ASPEED MACHINE SUPPORT) Cc: Andrew Jeffery (reviewer:ARM/ASPEED MACHINE SUPPORT) Cc: linux-watchdog@vger.kernel.org (open list:WATCHDOG DEVICE DRIVERS) Cc: linux-arm-kernel@lists.infradead.org (moderated list:ARM/ASPEED MACHINE SUPPORT) Cc: linux-aspeed@lists.ozlabs.org (moderated list:ARM/ASPEED MACHINE SUPPORT) Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Eduardo Valentin Signed-off-by: Eduardo Valentin Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220212021033.2344-1-eduval@amazon.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/aspeed_wdt.c | 7 +++++++ 1 file changed, 7 insertions(+) commit d055ef3a2c6919cff504ae3b710c96318d545fd2 Author: Miaoqian Lin Date: Wed Jan 5 09:21:13 2022 +0000 watchdog: rti-wdt: Add missing pm_runtime_disable() in probe function If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Fixes: 2d63908bdbfb ("watchdog: Add K3 RTI watchdog support") Signed-off-by: Miaoqian Lin Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220105092114.23932-1-linmq006@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/rti_wdt.c | 1 + 1 file changed, 1 insertion(+) commit cf6e4bc16dba2068fa4a115300185a8c56edc93f Author: Alistair Francis Date: Thu Jan 27 20:47:39 2022 +1000 watchdog: imx2_wdg: Alow ping on suspend The i.MX watchdog cannot be disabled by software once it has been enabled. This means that it can't be stopped before suspend. For systems that enter low power mode this is fine, as the watchdog will be automatically stopped by hardware in low power mode. Not all i.MX platforms support low power mode in the mainline kernel. For example the i.MX7D does not enter low power mode and so will be rebooted 2 minutes after entering sleep states. This patch introduces a device tree property "fsl,ping-during-suspend" that can be used to enable ping on suspend support for these systems. Signed-off-by: Alistair Francis Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220127104739.312592-1-alistair@alistair23.me Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck drivers/watchdog/imx2_wdt.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) commit 4a6d01495a167762de1691eb51e0413954db20eb Author: kernel test robot Date: Tue Mar 22 21:03:08 2022 +0800 pinctrl: mediatek: common-v1: fix semicolon.cocci warnings drivers/pinctrl/mediatek/pinctrl-mtk-common.c:171:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: 156f721704b5 ("pinctrl: mediatek: common-v1: Commonize spec_ies_smt_set callback") CC: AngeloGioacchino Del Regno Reported-by: kernel test robot Signed-off-by: kernel test robot Link: https://lore.kernel.org/r/20220322130308.GA21877@65fc916127a5 Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0112f822f8a6d8039c94e0bc9b264d7ffc5d4704 Author: Xiaomeng Tong Date: Sun Mar 27 14:08:22 2022 +0800 ALSA: cs4236: fix an incorrect NULL check on list iterator The bug is here: err = snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev); The list iterator value 'cdev' 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. To fix the bug, use a new variable 'iter' as the list iterator, while use the original variable 'cdev' as a dedicated pointer to point to the found element. And snd_card_cs423x_pnp() itself has NULL check for cdev. Cc: stable@vger.kernel.org Fixes: c2b73d1458014 ("ALSA: cs4236: cs4232 and cs4236 driver merge to solve PnP BIOS detection") Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220327060822.4735-1-xiam0nd.tong@gmail.com Signed-off-by: Takashi Iwai sound/isa/cs423x/cs4236.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 5a8738571747c1e275a40b69a608657603867b7e Author: Kai-Heng Feng Date: Sat Mar 26 00:05:00 2022 +0800 ALSA: hda/realtek: Enable headset mic on Lenovo P360 Lenovo P360 is another platform equipped with ALC897, and it needs ALC897_FIXUP_HEADSET_MIC_PIN quirk to make its headset mic work. Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20220325160501.705221-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) commit be1350004392961f4390f48c8001350712ed55f1 Author: Steve French Date: Sat Mar 26 16:17:03 2022 -0500 smb3: move defines for query info and query fsinfo to smbfs_common Includes moving to common code (from cifs and ksmbd protocol related headers) - query and query directory info levels and structs - set info structs - SMB2 lock struct and flags - SMB2 echo req Also shorten a few flag names (e.g. SMB2_LOCKFLAG_EXCLUSIVE_LOCK to SMB2_LOCKFLAG_EXCLUSIVE) Reviewed-by: Namjae Jeon Signed-off-by: Steve French fs/cifs/cifspdu.h | 2 +- fs/cifs/smb2ops.c | 28 ++-- fs/cifs/smb2pdu.h | 307 +------------------------------------------- fs/ksmbd/smb2pdu.h | 285 +---------------------------------------- fs/smbfs_common/smb2pdu.h | 316 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 335 insertions(+), 603 deletions(-) commit 15e7b6d753b815b19b375dcd4593534c0f157c66 Author: Steve French Date: Sat Mar 26 12:47:57 2022 -0500 smb3: move defines for ioctl protocol header and SMB2 sizes to smbfs_common The definitions for the ioctl SMB3 request and response as well as length of various fields defined in the protocol documentation were duplicated in fs/ksmbd and fs/cifs. Move these to the common code in fs/smbfs_common/smb2pdu.h Reviewed-by: Namjae Jeon Signed-off-by: Steve French fs/cifs/cifsglob.h | 6 ---- fs/cifs/cifspdu.h | 12 ------- fs/cifs/smb2glob.h | 11 ------ fs/cifs/smb2pdu.h | 41 ----------------------- fs/ksmbd/smb2pdu.c | 6 ++-- fs/ksmbd/smb2pdu.h | 70 -------------------------------------- fs/smbfs_common/smb2pdu.h | 85 +++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 88 insertions(+), 143 deletions(-) commit bcb74e132a76ce0502bb33d5b65533a4ed72d159 Author: Marcelo Ricardo Leitner Date: Thu Mar 24 16:22:10 2022 -0300 net/sched: act_ct: fix ref leak when switching zones When switching zones or network namespaces without doing a ct clear in between, it is now leaking a reference to the old ct entry. That's because tcf_ct_skb_nfct_cached() returns false and tcf_ct_flow_table_lookup() may simply overwrite it. The fix is to, as the ct entry is not reusable, free it already at tcf_ct_skb_nfct_cached(). Reported-by: Florian Westphal Fixes: 2f131de361f6 ("net/sched: act_ct: Fix flow table lookup after ct clear or switching zones") Signed-off-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller net/sched/act_ct.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit f022814633e1c600507b3a99691b4d624c2813f0 Merge: 710f5d627a98 eca344a7362e Author: Linus Torvalds Date: Sat Mar 26 14:54:41 2022 -0700 Merge tag 'trace-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull trace event string verifier fix from Steven Rostedt: "The run-time string verifier checks all trace event formats as they are read from the tracing file to make sure that the %s pointers are not reading something that no longer exists. However, it failed to account for the valid case of '%*.s' where the length given is zero, and the string is NULL. It incorrectly flagged it as a null pointer dereference and gave a WARN_ON()" * tag 'trace-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Have trace event string test handle zero length strings commit 5ae6acf1d00be462d7b08b4a8748798ef595ae5a Author: Eric Dumazet Date: Fri Mar 25 09:50:21 2022 -0700 net/smc: fix a memory leak in smc_sysctl_net_exit() Recently added smc_sysctl_net_exit() forgot to free the memory allocated from smc_sysctl_net_init() for non initial network namespace. Fixes: 462791bbfa35 ("net/smc: add sysctl interface for SMC") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Tony Lu Cc: Dust Li Signed-off-by: David S. Miller net/smc/smc_sysctl.c | 5 +++++ 1 file changed, 5 insertions(+) commit 5c7e49be96ea24776a5b5a07c732c477294add00 Author: Jakub Kicinski Date: Fri Mar 25 16:27:09 2022 -0700 selftests: tls: skip cmsg_to_pipe tests with TLS=n These are negative tests, testing TLS code rejects certain operations. They won't pass without TLS enabled, pure TCP accepts those operations. Reported-by: Linux Kernel Functional Testing Fixes: d87d67fd61ef ("selftests: tls: test splicing cmsgs") Signed-off-by: Jakub Kicinski Reviewed-by: Shuah Khan Signed-off-by: David S. Miller tools/testing/selftests/net/tls.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 33b5bc9e703383e396f275d51fc4bafa48dbae5a Author: Tom Rix Date: Sat Mar 26 09:03:06 2022 -0700 octeontx2-af: initialize action variable Clang static analysis reports this representative issue rvu_npc.c:898:15: warning: Assigned value is garbage or undefined req.match_id = action.match_id; ^ ~~~~~~~~~~~~~~~ The initial setting of action is conditional on if (is_mcam_entry_enabled(...)) The later check of action.op will sometimes be garbage. So initialize action. Reduce setting of *(u64 *)&action = 0x00; to *(u64 *)&action = 0; Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature") Signed-off-by: Tom Rix Signed-off-by: David S. Miller drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) commit 710f5d627a98e86f821aceb840b8f2f1fcc6cf75 Merge: 5627ecb8374a 46d2c20b0b10 Author: Linus Torvalds Date: Sat Mar 26 13:08:25 2022 -0700 Merge tag 'usb-5.18-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 changes for 5.18-rc1. Nothing major in here, just lots of little improvements and cleanups and new device support. Highlights are: - list iterator fixups for when we walk past the end of the list (a common problem that was cut/pasted in almost all USB gadget drivers) - xen USB driver "hardening" for malicious hosts - xhci driver updates and fixes for more hardware types - xhci debug cable fixes to make it actually work again - usb gadget audio driver improvements - usb gadget storage fixes to work with OS-X - lots of other small usb gadget fixes and updates - USB DWC3 driver improvements for more hardware types - Lots of other small USB driver improvements - DTS updates for some USB platforms All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (172 commits) usb: gadget: fsl_qe_udc: Add missing semicolon in qe_ep_dequeue() dt-bindings: usb: mtk-xhci: add compatible for mt8186 usb: dwc3: Issue core soft reset before enabling run/stop usb: gadget: Makefile: remove ccflags-y USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c usb: gadget: eliminate anonymous module_init & module_exit usb: usbip: eliminate anonymous module_init & module_exit xen/usb: harden xen_hcd against malicious backends usb: dwc3: gadget: Wait for ep0 xfers to complete during dequeue usb: dwc3: gadget: move cmd_endtransfer to extra function usb: dwc3: gadget: ep_queue simplify isoc start condition xen/usb: don't use arbitrary_virt_to_machine() usb: isp1760: remove redundant max_packet() macro usb: oxu210hp-hcd: remove redundant call to max_packet() macro usb: common: usb-conn-gpio: Make VBUS supply completely optional USB: storage: ums-realtek: fix error code in rts51x_read_mem() usb: early: xhci-dbc: Fix xdbc number parsing usb: early: xhci-dbc: Remove duplicate keep parsing x86/tsc: Be consistent about use_tsc_delay() usb: gadget: udc: s3c2410: remove usage of list iterator past the loop body ... commit 5627ecb8374a00163d90bc92c33f829ac27895b2 Merge: a060c9409e25 1a22aabf20ad Author: Linus Torvalds Date: Sat Mar 26 12:46:08 2022 -0700 Merge branch 'i2c/for-mergewindow' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: - tracepoints when Linux acts as an I2C client - added support for AMD PSP - whole subsystem now uses generic_handle_irq_safe() - piix4 driver gained MMIO access enabling so far missed controllers with AMD chipsets - a bulk of device driver updates, refactorization, and fixes. * 'i2c/for-mergewindow' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (61 commits) i2c: mux: demux-pinctrl: do not deactivate a master that is not active i2c: meson: Fix wrong speed use from probe i2c: add tracepoints for I2C slave events i2c: designware: Remove code duplication i2c: cros-ec-tunnel: Fix syntax errors in comments MAINTAINERS: adjust XLP9XX I2C DRIVER after removing the devicetree binding i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused i2c: mediatek: Add i2c compatible for Mediatek MT8168 dt-bindings: i2c: update bindings for MT8168 SoC i2c: mt65xx: Simplify with clk-bulk i2c: i801: Drop two outdated comments i2c: xiic: Make bus names unique i2c: i801: Add support for the Process Call command i2c: i801: Drop useless masking in i801_access i2c: tegra: Add SMBus block read function i2c: designware: Use the i2c_mark_adapter_suspended/resumed() helpers i2c: designware: Lock the adapter while setting the suspended flag i2c: mediatek: remove redundant null check i2c: mediatek: modify bus speed calculation formula i2c: designware: Fix improper usage of readl ... commit a060c9409e25d573c23fccb8e02f098aa33f812e Merge: b06a17583f6f 631f871f0717 Author: Linus Torvalds Date: Sat Mar 26 12:41:52 2022 -0700 Merge tag 'write-page-prefaulting' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull iomap fixlet from Andreas Gruenbacher: "Fix buffered write page prefaulting. I forgot to send it the previous merge window. I've only improved the patch description since" * tag 'write-page-prefaulting' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: fs/iomap: Fix buffered write page prefaulting commit b06a17583f6f810f620f95382b171cc5ce9848ee Merge: 4be240b18aa6 00a4f836eb36 Author: Linus Torvalds Date: Sat Mar 26 12:30:44 2022 -0700 Merge tag 'array-bounds-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull array-bounds updates from Kees Cook: "This enables -Warray-bounds and -Wzero-length-bounds, now that the many bug fixes have landed all over the place in the kernel, and in GCC itself[1]. A couple fixes[2] for known corner-case issues currently live in my "pending-fixes" tree which I'm expecting to send next week if other maintainers still haven't picked them up. I'm also expecting we can enable -Wstringop-overflow next cycle, as there are only a few stragglers[3], but it might even be possible for this release" [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 [2] https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=for-next/pending-fixes&id=2d253138910eec553fc706379914243d71de9b85 [3] https://github.com/KSPP/linux/issues/181 * tag 'array-bounds-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: Makefile: Enable -Wzero-length-bounds Makefile: Enable -Warray-bounds commit 4be240b18aa67b1144af546bea2d7cad1b75c19b Merge: 3f7282139fe1 281d0c962752 Author: Linus Torvalds Date: Sat Mar 26 12:19:04 2022 -0700 Merge tag 'memcpy-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull FORTIFY_SOURCE updates from Kees Cook: "This series consists of two halves: - strict compile-time buffer size checking under FORTIFY_SOURCE for the memcpy()-family of functions (for extensive details and rationale, see the first commit) - enabling FORTIFY_SOURCE for Clang, which has had many overlapping bugs that we've finally worked past" * tag 'memcpy-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: fortify: Add Clang support fortify: Make sure strlen() may still be used as a constant expression fortify: Use __diagnose_as() for better diagnostic coverage fortify: Make pointer arguments const Compiler Attributes: Add __diagnose_as for Clang Compiler Attributes: Add __overloadable for Clang Compiler Attributes: Add __pass_object_size for Clang fortify: Replace open-coded __gnu_inline attribute fortify: Update compile-time tests for Clang 14 fortify: Detect struct member overflows in memset() at compile-time fortify: Detect struct member overflows in memmove() at compile-time fortify: Detect struct member overflows in memcpy() at compile-time commit 3f7282139fe1594be464b90141d56738e7a0ea8a Merge: 752d422e74c4 1e21270685ae Author: Linus Torvalds Date: Sat Mar 26 12:01:35 2022 -0700 Merge tag 'for-5.18/64bit-pi-2022-03-25' of git://git.kernel.dk/linux-block Pull block layer 64-bit data integrity support from Jens Axboe: "This adds support for 64-bit data integrity in the block layer and in NVMe" * tag 'for-5.18/64bit-pi-2022-03-25' of git://git.kernel.dk/linux-block: crypto: fix crc64 testmgr digest byte order nvme: add support for enhanced metadata block: add pi for extended integrity crypto: add rocksoft 64b crc guard tag framework lib: add rocksoft model crc64 linux/kernel: introduce lower_48_bits function asm-generic: introduce be48 unaligned accessors nvme: allow integrity on extended metadata formats block: support pi with extended metadata commit 752d422e74c41084c3c9c9a159cb8d2795fa0c22 Merge: 561593a048d7 61285ff72ae5 Author: Linus Torvalds Date: Sat Mar 26 11:59:30 2022 -0700 Merge tag 'for-5.18/alloc-cleanups-2022-03-25' of git://git.kernel.dk/linux-block Pull bio allocation fix from Jens Axboe: "We got some reports of users seeing: Unexpected gfp: 0x2 (__GFP_HIGHMEM). Fixing up to gfp: 0x1192888 which is a regression caused by the bio allocation cleanups" * tag 'for-5.18/alloc-cleanups-2022-03-25' of git://git.kernel.dk/linux-block: fs: do not pass __GFP_HIGHMEM to bio_alloc in do_mpage_readpage commit 561593a048d7d6915889706f4b503a65435c033a Merge: 9bf3fc500785 7b12e49669c9 Author: Linus Torvalds Date: Sat Mar 26 11:51:46 2022 -0700 Merge tag 'for-5.18/write-streams-2022-03-18' of git://git.kernel.dk/linux-block Pull NVMe write streams removal from Jens Axboe: "This removes the write streams support in NVMe. No vendor ever really shipped working support for this, and they are not interested in supporting it. With the NVMe support gone, we have nothing in the tree that supports this. Remove passing around of the hints. The only discussion point in this patchset imho is the fact that the file specific write hint setting/getting fcntl helpers will now return -1/EINVAL like they did before we supported write hints. No known applications use these functions, I only know of one prototype that I help do for RocksDB, and that's not used. That said, with a change like this, it's always a bit controversial. Alternatively, we could just make them return 0 and pretend it worked. It's placement based hints after all" * tag 'for-5.18/write-streams-2022-03-18' of git://git.kernel.dk/linux-block: fs: remove fs.f_write_hint fs: remove kiocb.ki_hint block: remove the per-bio/request write hint nvme: remove support or stream based temperature hint commit 0906f3a3df07835e37077d8971aac65347f2ed57 Author: Zheng Yongjun Date: Sat Mar 26 08:12:39 2022 +0000 net: sparx5: switchdev: fix possible NULL pointer dereference As the possible failure of the allocation, devm_kzalloc() may return NULL pointer. Therefore, it should be better to check the 'db' in order to prevent the dereference of NULL pointer. Fixes: 10615907e9b51 ("net: sparx5: switchdev: adding frame DMA functionality") Signed-off-by: Zheng Yongjun Signed-off-by: David S. Miller drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c | 2 ++ 1 file changed, 2 insertions(+) commit 7781607938c8371d4c2b243527430241c62e39c2 Author: Duoming Zhou Date: Sat Mar 26 18:43:46 2022 +0800 net/x25: Fix null-ptr-deref caused by x25_disconnect When the link layer is terminating, x25->neighbour will be set to NULL in x25_disconnect(). As a result, it could cause null-ptr-deref bugs in x25_sendmsg(),x25_recvmsg() and x25_connect(). One of the bugs is shown below. (Thread 1) | (Thread 2) x25_link_terminated() | x25_recvmsg() x25_kill_by_neigh() | ... x25_disconnect() | lock_sock(sk) ... | ... x25->neighbour = NULL //(1) | ... | x25->neighbour->extended //(2) The code sets NULL to x25->neighbour in position (1) and dereferences x25->neighbour in position (2), which could cause null-ptr-deref bug. This patch adds lock_sock() in x25_kill_by_neigh() in order to synchronize with x25_sendmsg(), x25_recvmsg() and x25_connect(). What`s more, the sock held by lock_sock() is not NULL, because it is extracted from x25_list and uses x25_list_lock to synchronize. Fixes: 4becb7ee5b3d ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect") Signed-off-by: Duoming Zhou Reviewed-by: Lin Ma Signed-off-by: David S. Miller net/x25/af_x25.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit 1521db37f0d42334a88e8ff28198a27d1ed5cd7b Author: Tom Rix Date: Sat Mar 26 10:20:03 2022 -0700 qlcnic: dcb: default to returning -EOPNOTSUPP Clang static analysis reports this issue qlcnic_dcb.c:382:10: warning: Assigned value is garbage or undefined mbx_out = *val; ^ ~~~~ val is set in the qlcnic_dcb_query_hw_capability() wrapper. If there is no query_hw_capability op in dcp, success is returned without setting the val. For this and similar wrappers, return -EOPNOTSUPP. Fixes: 14d385b99059 ("qlcnic: dcb: Query adapter DCB capabilities.") Signed-off-by: Tom Rix Signed-off-by: David S. Miller drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 08be6b13db23f68146c600dd5adfd92e99d9ec6e Author: Randy Dunlap Date: Sat Mar 26 11:02:34 2022 -0700 net: sparx5: depends on PTP_1588_CLOCK_OPTIONAL Fix build errors when PTP_1588_CLOCK=m and SPARX5_SWTICH=y. arc-linux-ld: drivers/net/ethernet/microchip/sparx5/sparx5_ethtool.o: in function `sparx5_get_ts_info': sparx5_ethtool.c:(.text+0x146): undefined reference to `ptp_clock_index' arc-linux-ld: sparx5_ethtool.c:(.text+0x146): undefined reference to `ptp_clock_index' arc-linux-ld: drivers/net/ethernet/microchip/sparx5/sparx5_ptp.o: in function `sparx5_ptp_init': sparx5_ptp.c:(.text+0xd56): undefined reference to `ptp_clock_register' arc-linux-ld: sparx5_ptp.c:(.text+0xd56): undefined reference to `ptp_clock_register' arc-linux-ld: drivers/net/ethernet/microchip/sparx5/sparx5_ptp.o: in function `sparx5_ptp_deinit': sparx5_ptp.c:(.text+0xf30): undefined reference to `ptp_clock_unregister' arc-linux-ld: sparx5_ptp.c:(.text+0xf30): undefined reference to `ptp_clock_unregister' arc-linux-ld: sparx5_ptp.c:(.text+0xf38): undefined reference to `ptp_clock_unregister' arc-linux-ld: sparx5_ptp.c:(.text+0xf46): undefined reference to `ptp_clock_unregister' arc-linux-ld: drivers/net/ethernet/microchip/sparx5/sparx5_ptp.o:sparx5_ptp.c:(.text+0xf46): more undefined references to `ptp_clock_unregister' follow Fixes: 3cfa11bac9bb ("net: sparx5: add the basic sparx5 driver") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Horatiu Vultur Cc: UNGLinuxDriver@microchip.com Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Paolo Abeni Cc: Steen Hegelund Cc: Bjarni Jonasson Cc: Lars Povlsen Signed-off-by: David S. Miller drivers/net/ethernet/microchip/sparx5/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 9bf3fc5007856d5ca76d6e7a4652e3b67b683241 Merge: bddac7c1e02b 6b49f3409a09 Author: Linus Torvalds Date: Sat Mar 26 11:41:53 2022 -0700 Merge tag 'devicetree-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: - Add Krzysztof Kozlowski as co-maintainer for DT bindings providing much needed help. - DT schema validation now takes DTB files as input rather than intermediate YAML files. This decouples the validation from the source level syntax information. There's a bunch of schema fixes as a result of switching to DTB based validation which exposed some errors and incomplete schemas and examples. - Kbuild improvements to explicitly warn users running 'make dt_binding_check' on missing yamllint - Expand DT_SCHEMA_FILES kbuild variable to take just a partial filename or path instead of the full path to 1 file. - Convert various bindings to schema format: mscc,vsc7514-switch, multiple GNSS bindings, ahci-platform, i2c-at91, multiple UFS bindings, cortina,gemini-sata-bridge, cortina,gemini-ethernet, Atmel SHA, Atmel TDES, Atmel AES, armv7m-systick, Samsung Exynos display subsystem, nuvoton,npcm7xx-timer, samsung,s3c2410-i2c, zynqmp_dma, msm/mdp4, rda,8810pl-uart - New schemas for u-boot environment variable partition, TI clksel - New compatible strings for Renesas RZ/V2L SoC - Vendor prefixes for Xen, HPE, deprecated Synopsys, deprecated HiSilicon - Add/fix schemas for QEMU Arm 'virt' machine - Drop unused of_alias_get_alias_list() function - Add a script to check DT unittest EXPECT message output. Pass messages also now print by default at PR_INFO level to help test automation. * tag 'devicetree-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (96 commits) dt-bindings: kbuild: Make DT_SCHEMA_LINT a recursive variable dt-bindings: nvmem: add U-Boot environment variables binding dt-bindings: ufs: qcom: Add SM6350 compatible string dt-bindings: dmaengine: sifive,fu540-c000: include generic schema dt-bindings: gpio: pca95xx: drop useless consumer example Revert "of: base: Introduce of_alias_get_alias_list() to check alias IDs" dt-bindings: virtio,mmio: Allow setting devices 'dma-coherent' dt-bindings: gnss: Add two more chips dt-bindings: gnss: Rewrite sirfstar binding in YAML dt-bindings: gnss: Modify u-blox to use common bindings dt-bindings: gnss: Rewrite common bindings in YAML dt-bindings: ata: ahci-platform: Add rk3568-dwc-ahci compatible dt-bindings: ata: ahci-platform: Add power-domains property dt-bindings: ata: ahci-platform: Convert DT bindings to yaml dt-bindings: kbuild: Use DTB files for validation dt-bindings: kbuild: Pass DT_SCHEMA_FILES to dt-validate dt-bindings: Add QEMU virt machine compatible dt-bindings: arm: Convert QEMU fw-cfg to DT schema dt-bindings: i2c: at91: Add SAMA7G5 compatible strings list dt-bindings: i2c: convert i2c-at91 to json-schema ... commit bddac7c1e02ba47f0570e494c9289acea3062cc1 Author: Linus Torvalds Date: Sat Mar 26 10:42:04 2022 -0700 Revert "swiotlb: rework "fix info leak with DMA_FROM_DEVICE"" This reverts commit aa6f8dcbab473f3a3c7454b74caa46d36cdc5d13. It turns out this breaks at least the ath9k wireless driver, and possibly others. What the ath9k driver does on packet receive is to set up the DMA transfer with: int ath_rx_init(..) .. bf->bf_buf_addr = dma_map_single(sc->dev, skb->data, common->rx_bufsize, DMA_FROM_DEVICE); and then the receive logic (through ath_rx_tasklet()) will fetch incoming packets static bool ath_edma_get_buffers(..) .. dma_sync_single_for_cpu(sc->dev, bf->bf_buf_addr, common->rx_bufsize, DMA_FROM_DEVICE); ret = ath9k_hw_process_rxdesc_edma(ah, rs, skb->data); if (ret == -EINPROGRESS) { /*let device gain the buffer again*/ dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, common->rx_bufsize, DMA_FROM_DEVICE); return false; } and it's worth noting how that first DMA sync: dma_sync_single_for_cpu(..DMA_FROM_DEVICE); is there to make sure the CPU can read the DMA buffer (possibly by copying it from the bounce buffer area, or by doing some cache flush). The iommu correctly turns that into a "copy from bounce bufer" so that the driver can look at the state of the packets. In the meantime, the device may continue to write to the DMA buffer, but we at least have a snapshot of the state due to that first DMA sync. But that _second_ DMA sync: dma_sync_single_for_device(..DMA_FROM_DEVICE); is telling the DMA mapping that the CPU wasn't interested in the area because the packet wasn't there. In the case of a DMA bounce buffer, that is a no-op. Note how it's not a sync for the CPU (the "for_device()" part), and it's not a sync for data written by the CPU (the "DMA_FROM_DEVICE" part). Or rather, it _should_ be a no-op. That's what commit aa6f8dcbab47 broke: it made the code bounce the buffer unconditionally, and changed the DMA_FROM_DEVICE to just unconditionally and illogically be DMA_TO_DEVICE. [ Side note: purely within the confines of the swiotlb driver it wasn't entirely illogical: The reason it did that odd DMA_FROM_DEVICE -> DMA_TO_DEVICE conversion thing is because inside the swiotlb driver, it uses just a swiotlb_bounce() helper that doesn't care about the whole distinction of who the sync is for - only which direction to bounce. So it took the "sync for device" to mean that the CPU must have been the one writing, and thought it meant DMA_TO_DEVICE. ] Also note how the commentary in that commit was wrong, probably due to that whole confusion, claiming that the commit makes the swiotlb code "bounce unconditionally (that is, also when dir == DMA_TO_DEVICE) in order do avoid synchronising back stale data from the swiotlb buffer" which is nonsensical for two reasons: - that "also when dir == DMA_TO_DEVICE" is nonsensical, as that was exactly when it always did - and should do - the bounce. - since this is a sync for the device (not for the CPU), we're clearly fundamentally not coping back stale data from the bounce buffers at all, because we'd be copying *to* the bounce buffers. So that commit was just very confused. It confused the direction of the synchronization (to the device, not the cpu) with the direction of the DMA (from the device). Reported-and-bisected-by: Oleksandr Natalenko Reported-by: Olha Cherevyk Cc: Halil Pasic Cc: Christoph Hellwig Cc: Kalle Valo Cc: Robin Murphy Cc: Toke Høiland-Jørgensen Cc: Maxime Bizon Cc: Johannes Berg Signed-off-by: Linus Torvalds Documentation/core-api/dma-attributes.rst | 8 ++++++++ include/linux/dma-mapping.h | 8 ++++++++ kernel/dma/swiotlb.c | 23 ++++++++--------------- 3 files changed, 24 insertions(+), 15 deletions(-) commit 2eca426d37e7ca8caa0dbbce5982d3fd45d5fb2d Merge: b50d3b46f842 ad0ecaef6a2c Author: David S. Miller Date: Sat Mar 26 09:16:49 2022 -0700 Merge branch 'hns3-fixes' Guangbin Huang says: ==================== net: hns3: add some fixes for -net This series adds some fixes for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit ad0ecaef6a2c07e67ef9fe163c007f7b3dad8643 Author: Guangbin Huang Date: Sat Mar 26 17:51:05 2022 +0800 net: hns3: fix phy can not link up when autoneg off and reset Currently, function hclge_mdio_read() will return 0 if during reset(the cmd state will be set to disable). If use general phy driver, the phy_state_machine() will update phy speed every second in function genphy_read_status_fixed() when PHY is set to autoneg off, no matter of link down or link up. If phy driver happens to read BMCR register during reset, phy speed will be updated to 10Mpbs as BMCR register value is 0. So it may call phy can not link up if previous speed is not 10Mpbs. To fix this problem, function hclge_mdio_read() should return -EBUSY if the cmd state is disable. So does function hclge_mdio_write(). Fixes: 1c1249380992 ("net: hns3: bugfix for hclge_mdio_write and hclge_mdio_read") Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4d07c5936c2508ddd1cfd49b0a91d94cb4d1f0e8 Author: Hao Chen Date: Sat Mar 26 17:51:04 2022 +0800 net: hns3: add NULL pointer check for hns3_set/get_ringparam() When pci devices init failed and haven't reinit, priv->ring is NULL and hns3_set/get_ringparam() will access priv->ring. it causes call trace. So, add NULL pointer check for hns3_set/get_ringparam() to avoid this situation. Fixes: 5668abda0931 ("net: hns3: add support for set_ringparam") Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit f5cd60169f981ca737c9e49c446506dfafc90a35 Author: Hao Chen Date: Sat Mar 26 17:51:03 2022 +0800 net: hns3: add netdev reset check for hns3_set_tunable() When pci device reset failed, it does uninit operation and priv->ring is NULL, it causes accessing NULL pointer error. Add netdev reset check for hns3_set_tunable() to fix it. Fixes: 99f6b5fb5f63 ("net: hns3: use bounce buffer when rx page can not be reused") Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 671cb8cbb9c9e24b681d21b1bfae991e2386ac73 Author: Peng Li Date: Sat Mar 26 17:51:02 2022 +0800 net: hns3: clean residual vf config after disable sriov After disable sriov, VF still has some config and info need to be cleaned, which configured by PF. This patch clean the HW config and SW struct vport->vf_info. Fixes: fa8d82e853e8 ("net: hns3: Add support of .sriov_configure in HNS3 driver") Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hnae3.h | 3 ++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 18 ++++++++ .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 50 ++++++++++++++++++++++ 3 files changed, 71 insertions(+) commit a89cbb16995bf15582e0d1bdb922ad1a54a2fa8c Author: Hao Chen Date: Sat Mar 26 17:51:01 2022 +0800 net: hns3: add max order judgement for tx spare buffer Add max order judgement for tx spare buffer to avoid triggering call trace, print related fail information instead, when user set tx spare buf size to a large value which causes order exceeding 10. Fixes: e445f08af2b1 ("net: hns3: add support to set/get tx copybreak buf size via ethtool for hns3 driver") Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 8778372118023e2258612c03573c47efef41d755 Author: Hao Chen Date: Sat Mar 26 17:51:00 2022 +0800 net: hns3: fix ethtool tx copybreak buf size indicating not aligned issue When use ethtoool set tx copybreak buf size to a large value which causes order exceeding 10 or memory is not enough, it causes allocating tx copybreak buffer failed and print "the active tx spare buf is 0, not enabled tx spare buffer", however, use --get-tunable parameter query tx copybreak buf size and it indicates setting value not 0. So, it's necessary to change the print value from setting value to 0. Set kinfo.tx_spare_buf_size to 0 when set tx copybreak buf size failed. Fixes: e445f08af2b1 ("net: hns3: add support to set/get tx copybreak buf size via ethtool for hns3 driver") Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 20 ++++++++++++-------- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 3 ++- 2 files changed, 14 insertions(+), 9 deletions(-) commit ab0809af0bee88b689ba289ec8c40aa2be3a17ec Author: Kim Phillips Date: Tue Mar 22 15:15:15 2022 -0700 perf evsel: Improve AMD IBS (Instruction-Based Sampling) error handling messages Improve the error message returned on failed perf_event_open() on AMD systems when using IBS (Instruction-Based Sampling). Output of executing 'perf record -e ibs_op// true' as a non root user BEFORE this patch (perf will add the 'u' modifier at the end to exclude kernel/hypervisor sampling): The sys_perf_event_open() syscall returned with 22 (Invalid argument)for event (ibs_op//u). /bin/dmesg | grep -i perf may provide additional information. Output after: AMD IBS can't exclude kernel events. Try running at a higher privilege level. Output of executing 'sudo perf record -e ibs_op// true' BEFORE this patch: Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (ibs_op//). /bin/dmesg | grep -i perf may provide additional information. Output after: Error: Invalid event (ibs_op//) in per-thread mode, enable system wide with '-a'. Folowing the suggestion: $ sudo perf record -a -e ibs_op// true [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.664 MB perf.data (194 samples) ] $ Signed-off-by: Kim Phillips Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Boris Ostrovsky Cc: Ian Rogers Cc: Jiri Olsa Cc: João Martins Cc: Konrad Rzeszutek Wilk Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Ravi Bangoria Cc: Robert Richter Cc: Sandipan Das Cc: Song Liu Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20220322221517.2510440-12-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/evsel.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit b58230de3ccdc2f4566d576b34b5f1feceea2e73 Author: Arnaldo Carvalho de Melo Date: Fri Mar 25 19:31:36 2022 -0300 perf python: Add perf_env stubs that will be needed in evsel__open_strerror() The AMD IBS error message enhancements will use these, but we're not using evsel__open_strerror() in the python binding so far. Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/python.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) commit ae0f4eb34fc3014f7eba78fab90a0e98e441a4cd Author: Wei Li Date: Fri Mar 25 17:20:32 2022 +0800 perf tools: Enhance the matching of sub-commands abbreviations We support short command 'rec*' for 'record' and 'rep*' for 'report' in lots of sub-commands, but the matching is not quite strict currnetly. It may be puzzling sometime, like we mis-type a 'recport' to report but it will perform 'record' in fact without any message. To fix this, add a check to ensure that the short cmd is valid prefix of the real command. Committer testing: [root@quaco ~]# perf c2c re sleep 1 Usage: perf c2c {record|report} -v, --verbose be more verbose (show counter open errors, etc) # perf c2c rec sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.038 MB perf.data (16 samples) ] # perf c2c recport sleep 1 Usage: perf c2c {record|report} -v, --verbose be more verbose (show counter open errors, etc) # perf c2c record sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.038 MB perf.data (15 samples) ] # perf c2c records sleep 1 Usage: perf c2c {record|report} -v, --verbose be more verbose (show counter open errors, etc) # Signed-off-by: Wei Li Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Hanjun Guo Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Rui Xiang Link: http://lore.kernel.org/lkml/20220325092032.2956161-1-liwei391@huawei.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-c2c.c | 5 +++-- tools/perf/builtin-kmem.c | 2 +- tools/perf/builtin-kvm.c | 9 +++++---- tools/perf/builtin-lock.c | 5 +++-- tools/perf/builtin-mem.c | 5 +++-- tools/perf/builtin-sched.c | 4 ++-- tools/perf/builtin-script.c | 4 ++-- tools/perf/builtin-stat.c | 4 ++-- tools/perf/builtin-timechart.c | 3 ++- 9 files changed, 23 insertions(+), 18 deletions(-) commit c2eeac985657f61543e6c5a333b94f3bd18e6b9d Author: Shunsuke Nakamura Date: Fri Mar 25 13:38:23 2022 +0900 libperf tests: Fix typo in perf_evlist__open() failure error messages This patch corrects typos in error messages. I should be "evlist", not "evsel" as the function that fails is perf_evlist__open(). Fixes: 3ce311afb5583cf3 ("libperf: Move to tools/lib/perf") Fixes: a7f3713f6bf207e6 ("libperf tests: Add test_stat_multiplexing test") Signed-off-by: Shunsuke Nakamura Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220325043829.224045-2-nakamura.shun@fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo tools/lib/perf/tests/test-evlist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 1314376d495f2d79cc58753ff3034ccc503c43c9 Author: Ali Saidi Date: Thu Mar 24 18:33:20 2022 +0000 tools arm64: Import cputype.h Bring-in the kernel's arch/arm64/include/asm/cputype.h into tools/ for arm64 to make use of all the core-type definitions in perf. Replace sysreg.h with the version already imported into tools/. Committer notes: Added an entry to tools/perf/check-headers.sh, so that we get notified when the original file in the kernel sources gets modified. Tester notes: LGTM. I did the testing on both my x86 and Arm64 platforms, thanks for the fixing up. Signed-off-by: Ali Saidi Tested-by: Leo Yan Cc: Alexander Shishkin Cc: Andrew Kilroy Cc: Benjamin Herrenschmidt Cc: German Gomez Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Li Huafei Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Nick.Forrington@arm.com Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220324183323.31414-2-alisaidi@amazon.com Signed-off-by: Arnaldo Carvalho de Melo tools/arch/arm64/include/asm/cputype.h | 258 +++++++++++++++++++++++++++++++++ tools/perf/check-headers.sh | 1 + 2 files changed, 259 insertions(+) commit d02d81efc7564b4d5446a02e0214a164cf00b1f3 Author: Trond Myklebust Date: Fri Mar 25 21:51:03 2022 -0400 NFS: Don't loop forever in nfs_do_recoalesce() If __nfs_pageio_add_request() fails to add the request, it will return with either desc->pg_error < 0, or mirror->pg_recoalesce will be set, so we are guaranteed either to exit the function altogether, or to loop. However if there is nothing left in mirror->pg_list to coalesce, we must exit, so make sure that we clear mirror->pg_recoalesce every time we loop. Reported-by: Olga Kornievskaia Fixes: 70536bf4eb07 ("NFS: Clean up reset of the mirror accounting variables") Signed-off-by: Trond Myklebust fs/nfs/pagelist.c | 1 + 1 file changed, 1 insertion(+) commit 52d543b5497cf31d6baeb0bcfe5a5474c3238578 Merge: a452c4eb404d 8d10ea152e2f Author: Linus Torvalds Date: Fri Mar 25 17:46:22 2022 -0700 Merge tag 'for-linus-5.17-1' of https://github.com/cminyard/linux-ipmi Pull IPMI updates from Corey Minyard: - Little fixes for various things people have noticed. - One enhancement, the IPMI over IPMB (I2c) is modified to allow it to take a separate sender and receiver device. The Raspberry Pi has an I2C slave device that cannot send. * tag 'for-linus-5.17-1' of https://github.com/cminyard/linux-ipmi: ipmi: initialize len variable ipmi: kcs: aspeed: Remove old bindings support ipmi:ipmb: Add the ability to have a separate slave and master device ipmi:ipmi_ipmb: Unregister the SMI on remove ipmi: kcs: aspeed: Add AST2600 compatible string ipmi: ssif: replace strlcpy with strscpy ipmi/watchdog: Constify ident ipmi: Add the git repository to the MAINTAINERS file commit a452c4eb404df8a7f2a79a37ac77b90b6db1a2c9 Merge: a8988507e577 31e9dc49c2c0 Author: Linus Torvalds Date: Fri Mar 25 17:38:15 2022 -0700 Merge tag 'fs_for_v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull reiserfs updates from Jan Kara: "The biggest change in this pull is the addition of a deprecation message about reiserfs with the outlook that we'd eventually be able to remove it from the kernel. Because it is practically unmaintained and untested and odd enough that people don't want to bother with it anymore... Otherwise there are small udf and ext2 fixes" * tag 'fs_for_v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: udf: remove redundant assignment of variable etype reiserfs: Deprecate reiserfs ext2: correct max file size computing reiserfs: get rid of AOP_FLAG_CONT_EXPAND flag commit b50d3b46f84282d795ae3076111acb75ae1031f3 Author: Ido Schimmel Date: Thu Mar 24 22:05:14 2022 +0200 selftests: test_vxlan_under_vrf: Fix broken test case The purpose of the last test case is to test VXLAN encapsulation and decapsulation when the underlay lookup takes place in a non-default VRF. This is achieved by enslaving the physical device of the tunnel to a VRF. The binding of the VXLAN UDP socket to the VRF happens when the VXLAN device itself is opened, not when its physical device is opened. This was also mentioned in the cited commit ("tests that moving the underlay from a VRF to another works when down/up the VXLAN interface"), but the test did something else. Fix it by reopening the VXLAN device instead of its physical device. Before: # ./test_vxlan_under_vrf.sh Checking HV connectivity [ OK ] Check VM connectivity through VXLAN (underlay in the default VRF) [ OK ] Check VM connectivity through VXLAN (underlay in a VRF) [FAIL] After: # ./test_vxlan_under_vrf.sh Checking HV connectivity [ OK ] Check VM connectivity through VXLAN (underlay in the default VRF) [ OK ] Check VM connectivity through VXLAN (underlay in a VRF) [ OK ] Fixes: 03f1c26b1c56 ("test/net: Add script for VXLAN underlay in a VRF") Signed-off-by: Ido Schimmel Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220324200514.1638326-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski tools/testing/selftests/net/test_vxlan_under_vrf.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit bf8bfc4336f7a34e48b3bbd19b1542bf085bdc3d Author: Florian Fainelli Date: Thu Mar 24 16:24:38 2022 -0700 net: phy: broadcom: Fix brcm_fet_config_init() A Broadcom AC201 PHY (same entry as 5241) would be flagged by the Broadcom UniMAC MDIO controller as not completing the turn around properly since the PHY expects 65 MDC clock cycles to complete a write cycle, and the MDIO controller was only sending 64 MDC clock cycles as determined by looking at a scope shot. This would make the subsequent read fail with the UniMAC MDIO controller command field having MDIO_READ_FAIL set and we would abort the brcm_fet_config_init() function and thus not probe the PHY at all. After issuing a software reset, wait for at least 1ms which is well above the 1us reset delay advertised by the datasheet and issue a dummy read to let the PHY turn around the line properly. This read specifically ignores -EIO which would be returned by MDIO controllers checking for the line being turned around. If we have a genuine reaad failure, the next read of the interrupt status register would pick it up anyway. Fixes: d7a2ed9248a3 ("broadcom: Add AC131 phy support") Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20220324232438.1156812-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski drivers/net/phy/broadcom.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) commit a8988507e577a89ccaf66b48ea645bcf6e861270 Merge: cb7cbaae7fd9 f92ca72b0263 Author: Linus Torvalds Date: Fri Mar 25 16:58:51 2022 -0700 Merge tag 'fsnotify_for_v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify updates from Jan Kara: "A few fsnotify improvements and cleanups" * tag 'fsnotify_for_v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fsnotify: remove redundant parameter judgment fsnotify: optimize FS_MODIFY events with no ignored masks fsnotify: fix merge with parent's ignored mask commit 7dabfa2bc4803eed83d6f22bd6f045495f40636b Author: Maxime Ripard Date: Fri Mar 25 17:11:44 2022 +0100 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. Also add a few tests to make sure this case is covered. Fixes: c80ac50cbb37 ("clk: Always set the rate on clk_set_range_rate") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220325161144.1901695-4-maxime@cerno.tech [sboyd@kernel.org: Reword commit text] Signed-off-by: Stephen Boyd drivers/clk/clk.c | 42 ++++++++++++------- drivers/clk/clk_test.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+), 14 deletions(-) commit 2d327a79ee176930dc72c131a970c891d367c1dc Author: Eric Dumazet Date: Thu Mar 24 20:58:27 2022 -0700 llc: only change llc->dev when bind() succeeds My latest patch, attempting to fix the refcount leak in a minimal way turned out to add a new bug. Whenever the bind operation fails before we attempt to grab a reference count on a device, we might release the device refcount of a prior successful bind() operation. syzbot was not happy about this [1]. Note to stable teams: Make sure commit b37a46683739 ("netdevice: add the case if dev is NULL") is already present in your trees. [1] general protection fault, probably for non-canonical address 0xdffffc0000000070: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000380-0x0000000000000387] CPU: 1 PID: 3590 Comm: syz-executor361 Tainted: G W 5.17.0-syzkaller-04796-g169e77764adc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:llc_ui_connect+0x400/0xcb0 net/llc/af_llc.c:500 Code: 80 3c 02 00 0f 85 fc 07 00 00 4c 8b a5 38 05 00 00 48 b8 00 00 00 00 00 fc ff df 49 8d bc 24 80 03 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 a9 07 00 00 49 8b b4 24 80 03 00 00 4c 89 f2 48 RSP: 0018:ffffc900038cfcc0 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff8880756eb600 RCX: 0000000000000000 RDX: 0000000000000070 RSI: ffffc900038cfe3e RDI: 0000000000000380 RBP: ffff888015ee5000 R08: 0000000000000001 R09: ffff888015ee5535 R10: ffffed1002bdcaa6 R11: 0000000000000000 R12: 0000000000000000 R13: ffffc900038cfe37 R14: ffffc900038cfe38 R15: ffff888015ee5012 FS: 0000555555acd300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000280 CR3: 0000000077db6000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __sys_connect_file+0x155/0x1a0 net/socket.c:1900 __sys_connect+0x161/0x190 net/socket.c:1917 __do_sys_connect net/socket.c:1927 [inline] __se_sys_connect net/socket.c:1924 [inline] __x64_sys_connect+0x6f/0xb0 net/socket.c:1924 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+0x44/0xae RIP: 0033:0x7f016acb90b9 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:00007ffd417947f8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f016acb90b9 RDX: 0000000000000010 RSI: 0000000020000140 RDI: 0000000000000003 RBP: 00007f016ac7d0a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f016ac7d130 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:llc_ui_connect+0x400/0xcb0 net/llc/af_llc.c:500 Fixes: 764f4eb6846f ("llc: fix netdevice reference leaks in llc_ui_bind()") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: 赵子轩 Cc: Stoyan Manolov Link: https://lore.kernel.org/r/20220325035827.360418-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski net/llc/af_llc.c | 59 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 25 deletions(-) commit 481f541ced8fcf9af87bedf6f87c2023de22bf6e Author: Maxime Ripard Date: Fri Mar 25 17:11:43 2022 +0100 clk: test: Test clk_set_rate_range on orphan mux A bug recently affected the Tegra30 where calling clk_set_rate_range() on a clock would make it change its rate to the minimum. This was due to the clock in question being a mux that was orphan at registration, which lead to the clk_core req_rate being 0, and the clk_set_rate_range() function then calling clk_set_rate() with req_rate, effectively making that clock running at the minimum rate allowed, even though the initial rate was within that range. Make a test suite to create a mux initially orphan, and then make sure that if our clock rate was initially within a given range, then enforcing that range won't affect it. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220325161144.1901695-3-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/clk_test.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) commit 371d1ccf430903c26fb6f838473f005a31fb20b7 Merge: afec4980dc04 190cd8a72b01 Author: Jakub Kicinski Date: Fri Mar 25 16:37:49 2022 -0700 Merge branch 'net-hns3-add-some-fixes-for-net' Guangbin Huang says: ==================== net: hns3: add some fixes for -net This series adds some fixes for the HNS3 ethernet driver. ==================== Link: https://lore.kernel.org/r/20220324125450.56417-1-huangguangbin2@huawei.com Signed-off-by: Jakub Kicinski commit 190cd8a72b0181c543ecada6243be3a50636941b Author: Jian Shen Date: Thu Mar 24 20:54:50 2022 +0800 net: hns3: refine the process when PF set VF VLAN Currently, when PF set VF VLAN, it sends notify mailbox to VF if VF alive. VF stop its traffic, and send request mailbox to PF, then PF updates VF VLAN. It's a bit complex. If VF is killed before sending request, PF will not set VF VLAN without any log. This patch refines the process, PF can set VF VLAN direclty, and then notify the VF. If VF is resetting at that time, the notify may be dropped, so VF should query it after reset finished. Fixes: 92f11ea177cd ("net: hns3: fix set port based VLAN issue for VF") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski .../net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 18 +++++++++++++----- .../net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++++ 2 files changed, 18 insertions(+), 5 deletions(-) commit 1932a624ab88ff407d1a1d567fe581faa15dc725 Author: Jian Shen Date: Thu Mar 24 20:54:49 2022 +0800 net: hns3: add vlan list lock to protect vlan list When adding port base VLAN, vf VLAN need to remove from HW and modify the vlan state in vf VLAN list as false. If the periodicity task is freeing the same node, it may cause "use after free" error. This patch adds a vlan list lock to protect the vlan list. Fixes: c6075b193462 ("net: hns3: Record VF vlan tables") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 38 +++++++++++++++++++--- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 1 + 2 files changed, 35 insertions(+), 4 deletions(-) commit c0f46de30c965d4ba208b5bf1a6d3437a7556ee2 Author: Jian Shen Date: Thu Mar 24 20:54:48 2022 +0800 net: hns3: fix port base vlan add fail when concurrent with reset Currently, Port base vlan is initiated by PF and configured to its VFs, by using command "ip link set vf vlan ". When a global reset was triggered, the hardware vlan table and the soft recorded vlan information will be cleared by PF, and restored them until VFs were ready. There is a short time window between the table had been cleared and before table restored. If configured a new port base vlan tag at this moment, driver will check the soft recorded vlan information, and find there hasn't the old tag in it, which causing a warning print. Due to the port base vlan is managed by PF, so the VFs's port base vlan restoring should be handled by PF when PF was ready. This patch fixes it. Fixes: 039ba863e8d7 ("net: hns3: optimize the filter table entries handling when resetting") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 62 +++++++++++++++------- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 3 ++ 2 files changed, 46 insertions(+), 19 deletions(-) commit ccb18f05535c96d26e2d559d402acb87700fc5a7 Author: Jian Shen Date: Thu Mar 24 20:54:47 2022 +0800 net: hns3: fix bug when PF set the duplicate MAC address for VFs If the MAC address A is configured to vport A and then vport B. The MAC address of vport A in the hardware becomes invalid. If the address of vport A is changed to MAC address B, the driver needs to delete the MAC address A of vport A. Due to the MAC address A of vport A has become invalid in the hardware entry, so "-ENOENT" is returned. In this case, the "used_umv_size" value recorded in driver is not updated. As a result, the MAC entry status of the software is inconsistent with that of the hardware. Therefore, the driver updates the umv size even if the MAC entry cannot be found. Ensure that the software and hardware status is consistent. Fixes: ee4bcd3b7ae4 ("net: hns3: refactor the MAC address configure") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit afec4980dc0462d5c2c02d76243b06e8a489ee61 Merge: feb13dcb1818 ad238fc6de7d Author: Jakub Kicinski Date: Fri Mar 25 15:45:16 2022 -0700 Merge branch 'net-sparx5-refactor-based-on-feedback-on' Casper Andersson says: ==================== net: sparx5: Refactor based on feedback on This is a follow up to a previous patch that was merged before manufacturer could give feedback. This addresses the feedback. See link below for previous patch series. https://lore.kernel.org/netdev/20220322081823.wqbx7vud4q7qtjuq@wse-c0155/T/#t ==================== Link: https://lore.kernel.org/r/20220324113853.576803-1-casper.casan@gmail.com Signed-off-by: Jakub Kicinski commit ad238fc6de7d1adece5167df09464912c098b021 Author: Casper Andersson Date: Thu Mar 24 12:38:53 2022 +0100 net: sparx5: Refactor mdb handling according to feedback - Remove mact_lookup and use new mact_find instead. - Make pgid_read_mask function. - Set PGID arbiter to start searching at PGID_BASE + 8. This is according to feedback on previous patch. https://lore.kernel.org/netdev/20220322081823.wqbx7vud4q7qtjuq@wse-c0155/T/#t Signed-off-by: Casper Andersson Reviewed-by: Steen Hegelund Signed-off-by: Jakub Kicinski .../net/ethernet/microchip/sparx5/sparx5_mactable.c | 19 ++++--------------- drivers/net/ethernet/microchip/sparx5/sparx5_main.h | 3 ++- drivers/net/ethernet/microchip/sparx5/sparx5_pgid.c | 3 +++ .../net/ethernet/microchip/sparx5/sparx5_switchdev.c | 18 ++++++++---------- drivers/net/ethernet/microchip/sparx5/sparx5_vlan.c | 7 +++++++ 5 files changed, 24 insertions(+), 26 deletions(-) commit 264a9c5c9dff40f92a2a9ad1757d59a4438114fd Author: Casper Andersson Date: Thu Mar 24 12:38:52 2022 +0100 net: sparx5: Remove unused GLAG handling in PGID Removes PGID handling for GLAG since it is not used yet. According to feedback on previous patch. https://lore.kernel.org/netdev/20220322081823.wqbx7vud4q7qtjuq@wse-c0155/T/#t Signed-off-by: Casper Andersson Reviewed-by: Steen Hegelund Signed-off-by: Jakub Kicinski drivers/net/ethernet/microchip/sparx5/sparx5_main.h | 4 ---- drivers/net/ethernet/microchip/sparx5/sparx5_pgid.c | 17 ----------------- 2 files changed, 21 deletions(-) commit feb13dcb1818b775fbd9191f797be67cd605f03e Author: Vladimir Oltean Date: Thu Mar 24 18:12:10 2022 +0200 net: enetc: report software timestamping via SO_TIMESTAMPING Let user space properly determine that the enetc driver provides software timestamps. Fixes: 4caefbce06d1 ("enetc: add software timestamping") Signed-off-by: Vladimir Oltean Reviewed-by: Claudiu Manoil Link: https://lore.kernel.org/r/20220324161210.4122281-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/freescale/enetc/enetc_ethtool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit c86d18f4aa93e0e66cda0e55827cd03eea6bc5f8 Author: Pavel Begunkov Date: Fri Mar 25 16:36:31 2022 +0000 io_uring: fix memory leak of uid in files registration When there are no files for __io_sqe_files_scm() to process in the range, it'll free everything and return. However, it forgets to put uid. Fixes: 08a451739a9b5 ("io_uring: allow sparse fixed file sets") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/accee442376f33ce8aaebb099d04967533efde92.1648226048.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 1 + 1 file changed, 1 insertion(+) commit cb7cbaae7fd9cee64f19cdfd89d097d807b884f5 Merge: 46f538bf2404 2a81dba4b577 Author: Linus Torvalds Date: Fri Mar 25 14:57:47 2022 -0700 Merge tag 'drm-next-2022-03-25' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Some fixes were queued up in and in light of the fbdev regressions, I've pulled those in as well. core: - Make audio and color plane support checking only happen when a CEA extension block is found. - Small selftest fix. fbdev: - two regressions fixes from speedup patches. ttm: - Fix a small regression from ttm_resource_fini() i915: - Reject unsupported TMDS rates on ICL+ - Treat SAGV block time 0 as SAGV disabled - Fix PSF GV point mask when SAGV is not possible - Fix renamed INTEL_INFO->media.arch/ver field" * tag 'drm-next-2022-03-25' of git://anongit.freedesktop.org/drm/drm: fbdev: Fix cfb_imageblit() for arbitrary image widths fbdev: Fix sys_imageblit() for arbitrary image widths drm/edid: fix CEA extension byte #3 parsing drm/edid: check basic audio support on CEA extension block drm/i915: Fix renamed struct field drm/i915: Fix PSF GV point mask when SAGV is not possible drm/i915: Treat SAGV block time 0 as SAGV disabled drm/i915: Reject unsupported TMDS rates on ICL+ drm/selftest: plane_helper: Put test structures in static storage drm/ttm: Fix a kernel oops due to an invalid read commit 46f538bf2404ee9c32648deafb886f49144bfd5e Merge: 8350e8331b39 023a8830a628 Author: Linus Torvalds Date: Fri Mar 25 14:01:23 2022 -0700 Merge tag 'backlight-next-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "New Device Support: - Add support for PM6150L to Qualcomm WLED Fix-ups" - Use kcalloc() to avoid open-coding; pwm_bl - Device Tree changes; qcom-wled - Cleanup or simplify code; backlight" * tag 'backlight-next-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: backlight: Slighly simplify devm_of_find_backlight() backlight: qcom-wled: Add PM6150L compatible dt-bindings: backlight: qcom-wled: Add PM6150L compatible backlight: pwm_bl: Avoid open coded arithmetic in memory allocation commit 8350e8331b3971533d6e6112ab596eda2c2ffffd Merge: e35a4a4e13c3 d99460ed5cdc Author: Linus Torvalds Date: Fri Mar 25 13:56:18 2022 -0700 Merge tag 'mfd-next-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers: - Add support for Maxim MAX77714 PMIC Removed Drivers: - Remove support for ST-Ericsson AB8500 DebugFS New Device Support: - Add support for Silergy SY7636A to Simple MFD I2C - Add support for MediaTek MT6366 PMIC to MT6358 IRQ - Add support for Charger to Intel PMIC CRC - Add support for Raptor Lake to Intel LPSS PCI New Functionality: - Add support for Reboot to Rockchip RK808 Fix-ups: - Device Tree changes (includcing YAML conversion) for silergy,sy7636a, maxim,max77843, google,cros-ec, maxim,max14577, maxim,max77802, maxim,max77714, qcom,tcsr, qcom,spmi-pmic, stericsson,ab8500, stericsson,db8500-prcmu, samsung,exynos5433-lpass, mt6397, syscon, brcm,cru - Visible to menuconfig; simple-mfd-i2c - Clean-up or clarify code; max77686, intel_soc_pmic_crc - Improve error handling; mc13xxx-core, stmfx, asic3 - Pass device information to child devices; iqs62x, intel-lpss-acpi - Individually identify IRQ domains; intel_soc_pmic_core - Remove superfluous code; dbx500-prcmu, exynos-lpass - Staticify and constify; arizona-i2c - Mark sometimes used data as __maybe_unused; atmel-flexcom - Account for different ACPI tables on AOSP/Windows platforms; arizona-spi - Use provided (platform) APIs; ab8500-core - Trivial (whitespace, spelling); rohm-bd9576" * tag 'mfd-next-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (50 commits) dt-bindings: mfd: syscon: Add microchip,lan966x-cpu-syscon compatible mfd: bd9576: fix typos in comments mfd: Use platform_get_irq() to get the interrupt mfd: db8500-prcmu: Remove unused inline function mfd: arizona-spi: Add Android board ACPI table handling mfd: arizona-spi: Split Windows ACPI init code into its own function mfd: asic3: Add missing iounmap() on error asic3_mfd_probe MAINTAINERS: Rectify entry for ROHM MULTIFUNCTION BD9571MWV-M PMIC DEVICE DRIVERS mfd: intel-lpss: Provide an SSP type to the driver dt-bindings: mfd: brcm,cru: Rename pinctrl node dt-bindings: Add compatibles for undocumented trivial syscons mfd: atmel-flexcom: Fix compilation warning dt-bindings: mfd: Add compatible for the MediaTek MT6366 PMIC dt-bindings: mfd: samsung,exynos5433-lpass: Convert to dtschema mfd: exynos-lpass: Drop unneeded syscon.h include mfd: intel-lpss: Add Intel Raptor Lake PCH-S PCI IDs mfd: ab8500: Drop debugfs module mfd: sta2x11: Use GFP_KERNEL instead of GFP_ATOMIC mfd: ab8500: Rewrite bindings in YAML mfd: qcom-spmi-pmic: Add pm8953 compatible ... commit e35a4a4e13c35f500a8d38e836b5e335c7515494 Merge: 8eb48fc7c54e 6cadd424abb6 Author: Linus Torvalds Date: Fri Mar 25 13:35:34 2022 -0700 Merge tag 'mtd/changes-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD updates from Miquel Raynal: "There has been a lot of activity in the MTD subsystem recently, with a number of SPI-NOR cleanups as well as the introduction of ECC engines that can be used by SPI controllers (hence a few SPI patches in here). Core MTD changes: - Replace the expert mode symbols with a single helper - Fix misuses of of_match_ptr() - Remove partid and partname debugfs files - tests: Fix eraseblock read speed miscalculation for lower partition sizes - TRX parser: Allow to use on MediaTek MIPS SoCs MTD driver changes: - spear_smi: use GFP_KERNEL - mchp48l640: Add SPI ID table - mchp23k256: Add SPI ID table - blkdevs: Avoid soft lockups with some mtd/spi devices - aspeed-smc: Improve probe resilience Hyperbus changes: - HBMC_AM654 should depend on ARCH_K3 NAND core changes: - ECC: - Add infrastructure to support hardware engines - Add a new helper to retrieve the ECC context - Provide a helper to retrieve a pilelined engine device NAND-ECC changes: - Macronix ECC engine: - Add Macronix external ECC engine support - Support SPI pipelined mode - Make two read-only arrays static const - Fix compile test issue Raw NAND core changes: - Fix misuses of of_match_node() - Rework of_get_nand_bus_width() - Remove of_get_nand_on_flash_bbt() wrapper - Protect access to rawnand devices while in suspend - bindings: Document the wp-gpios property Rax NAND controller driver changes: - atmel: Fix refcount issue in atmel_nand_controller_init - nandsim: - Add NS_PAGE_BYTE_SHIFT macro to replace the repeat pattern - Merge repeat codes in ns_switch_state - Replace overflow check with kzalloc to single kcalloc - rockchip: Fix platform_get_irq.cocci warning - stm32_fmc2: Add NAND Write Protect support - pl353: Set the nand chip node as the flash node - brcmnand: Fix sparse warnings in bcma_nand - omap_elm: Remove redundant variable 'errors' - gpmi: - Support fast edo timings for mx28 - Validate controller clock rate - Fix controller timings setting - brcmnand: - Add BCMA shim - BCMA controller uses command shift of 0 - Allow platform data instantation - Add platform data structure for BCMA - Allow working without interrupts - Move OF operations out of brcmnand_init_cs() - Avoid pdev in brcmnand_init_cs() - Allow SoC to provide I/O operations - Assign soc as early as possible Onenand changes: - Check for error irq SPI-NAND core changes: - Delay a little bit the dirmap creation - Create direct mapping descriptors for ECC operations SPI-NAND driver changes: - macronix: Use random program load SPI NOR core changes: - Move vendor specific code out of the core into vendor drivers. - Unify all function and object names in the vendor modules. - Make setup() callback optional to improve readability. - Skip erase logic when the SPI_NOR_NO_ERASE flag is set at flash declaration. SPI changes: - Macronix SPI controller: - Fix the transmit path - Create a helper to configure the controller before an operation - Create a helper to ease the start of an operation - Add support for direct mapping - Add support for pipelined ECC operations - spi-mem: - Introduce a capability structure - Check the controller extra capabilities - cadence-quadspi/mxic: Provide capability structures - Kill the spi_mem_dtr_supports_op() helper - Add an ecc parameter to the spi_mem_op structure Binding changes: - Dropped mtd/cortina,gemini-flash.txt - Convert BCM47xx partitions to json-schema - Vendor prefixes: Clarify Macronix prefix - SPI NAND: Convert spi-nand description file to yaml - Raw NAND chip: Create a NAND chip description - Raw NAND controller: - Harmonize the property types - Fix a comment in the examples - Fix the reg property description - Describe Macronix NAND ECC engine - Macronix SPI controller: - Document the nand-ecc-engine property - Convert to yaml - The interrupt property is not mandatory" * tag 'mtd/changes-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (104 commits) mtd: nand: ecc: mxic: Fix compile test issue mtd: nand: mxic-ecc: make two read-only arrays static const mtd: hyperbus: HBMC_AM654 should depend on ARCH_K3 mtd: core: Remove partid and partname debugfs files dt-bindings: mtd: partitions: convert BCM47xx to the json-schema mtd: tests: Fix eraseblock read speed miscalculation for lower partition sizes mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init mtd: rawnand: rockchip: fix platform_get_irq.cocci warning mtd: spi-nor: Skip erase logic when SPI_NOR_NO_ERASE is set mtd: spi-nor: renumber flags mtd: spi-nor: slightly change code style in spi_nor_sr_ready() mtd: spi-nor: spansion: rename vendor specific functions and defines mtd: spi-nor: spansion: convert USE_CLSR to a manufacturer flag mtd: spi-nor: move all spansion specifics into spansion.c mtd: spi-nor: spansion: slightly rework control flow in late_init() mtd: spi-nor: micron-st: rename vendor specific functions and defines mtd: spi-nor: micron-st: convert USE_FSR to a manufacturer flag mtd: spi-nor: move all micron-st specifics into micron-st.c mtd: spi-nor: xilinx: correct the debug message mtd: spi-nor: xilinx: rename vendor specific functions and defines ... commit 8eb48fc7c54ed627a693a205570f0eceea64274c Merge: 148a65047695 c22fca40522e Author: Linus Torvalds Date: Fri Mar 25 13:31:02 2022 -0700 Merge tag 'for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "Power-supply core: - Introduce "Bypass" charging type used by USB PPS standard - Refactor power_supply_set_input_current_limit_from_supplier() - Add fwnode support to power_supply_get_battery_info() Drivers: - ab8500: continue migrating towards using standard core APIs - axp288 fuel-gauge: refactor driver to be fully resource managed - battery-samsung-sdi: new in-kernel provider for (constant) Samsung battery info - bq24190: disable boost regulator on shutdown - bq24190: add support for battery-info on ACPI based systems - bq25890: prepare driver for usage on ACPI based systems - bq25890: add boost regulator support - cpcap-battery: add NVMEM based battery detection support - injoinic ip5xxx: new driver for power bank IC - upi ug3105: new battery driver - misc small improvements and fixes" * tag 'for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (94 commits) power: ab8500_chargalg: Use CLOCK_MONOTONIC power: supply: Add a driver for Injoinic power bank ICs dt-bindings: trivial-devices: Add Injoinic power bank ICs dt-bindings: vendor-prefixes: Add Injoinic power: supply: ab8500: Remove unused variable power: supply: da9150-fg: Remove unnecessary print function dev_err() power: supply: ab8500: fix a handful of spelling mistakes power: supply: ab8500_fg: Account for line impedance dt-bindings: power: supply: ab8500_fg: Add line impedance power: supply: axp20x_usb_power: fix platform_get_irq.cocci warnings power: supply: axp20x_ac_power: fix platform_get_irq.cocci warning power: supply: wm8350-power: Add missing free in free_charger_irq power: supply: wm8350-power: Handle error for wm8350_register_irq power: supply: Static data for Samsung batteries power: supply: ab8500_fg: Use VBAT-to-Ri if possible power: supply: Support VBAT-to-Ri lookup tables power: supply: ab8500: Standardize BTI resistance power: supply: ab8500: Standardize alert mode charging power: supply: ab8500: Standardize maintenance charging power: supply: bq24190_charger: Delay applying charge_type changes when OTG 5V Vbus boost is on ... commit 44e445ed9413596760284c88870e25a1be0261ff Author: Zheng Bin Date: Fri Mar 25 15:44:50 2022 +0800 pinctrl: nuvoton: wpcm450: Fix build error without OF If OF is not set, bulding fails: drivers/pinctrl/nuvoton/pinctrl-wpcm450.o: In function `wpcm450_dt_node_to_map': pinctrl-wpcm450.c:(.text+0x404): undefined reference to `pinconf_generic_dt_node_to_map' Make PINCTRL_WPCM450 depends on OF to fix this. Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450") Reported-by: Hulk Robot Signed-off-by: Zheng Bin Link: https://lore.kernel.org/r/20220325074450.3228840-1-zhengbin13@huawei.com Signed-off-by: Linus Walleij drivers/pinctrl/nuvoton/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 148a650476955705482dd57e7ffcf105d8b65440 Merge: 636f64db07f3 611f841830aa Author: Linus Torvalds Date: Fri Mar 25 13:02:05 2022 -0700 Merge tag 'pci-v5.18-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci updates from Bjorn Helgaas: "Enumeration: - Move the VGA arbiter from drivers/gpu to drivers/pci because it's PCI-specific, not GPU-specific (Bjorn Helgaas) - Select the default VGA device consistently whether it's enumerated before or after VGA arbiter init, which fixes arches that enumerate PCI devices late (Huacai Chen) Resource management: - Support BAR sizes up to 8TB (Dongdong Liu) PCIe native device hotplug: - Fix "Command Completed" tracking to avoid spurious timouts when powering off empty slots (Liguang Zhang) - Quirk Qualcomm devices that don't implement Command Completed correctly, again to avoid spurious timeouts (Manivannan Sadhasivam) Peer-to-peer DMA: - Add Intel 3rd Gen Intel Xeon Scalable Processors to whitelist (Michael J. Ruhl) APM X-Gene PCIe controller driver: - Revert generic DT parsing changes that broke some machines in the field (Marc Zyngier) Freescale i.MX6 PCIe controller driver: - Allow controller probe to succeed even when no devices currently present to allow hot-add later (Fabio Estevam) - Enable power management on i.MX6QP (Richard Zhu) - Assert CLKREQ# on i.MX8MM so enumeration doesn't hang when no device is connected (Richard Zhu) Marvell Aardvark PCIe controller driver: - Fix MSI and MSI-X support (Marek Behún, Pali Rohár) - Add support for ERR and PME interrupts (Pali Rohár) Marvell MVEBU PCIe controller driver: - Add DT binding and support for "num-lanes" (Pali Rohár) - Add support for INTx interrupts (Pali Rohár) Microsoft Hyper-V host bridge driver: - Avoid unnecessary hypercalls when unmasking IRQs on ARM64 (Boqun Feng) Qualcomm PCIe controller driver: - Add SM8450 DT binding and driver support (Dmitry Baryshkov) Renesas R-Car PCIe controller driver: - Help the controller get to the L1 state since the hardware can't do it on its own (Marek Vasut) - Return PCI_ERROR_RESPONSE (~0) for reads that fail on PCIe (Marek Vasut) SiFive FU740 PCIe controller driver: - Drop redundant '-gpios' from DT GPIO lookup (Ben Dooks) - Force 2.5GT/s for initial device probe (Ben Dooks) Socionext UniPhier Pro5 controller driver: - Add NX1 DT binding and driver support (Kunihiko Hayashi) Synopsys DesignWare PCIe controller driver: - Restore MSI configuration so MSI works after resume (Jisheng Zhang)" * tag 'pci-v5.18-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (94 commits) x86/PCI: Add #includes to asm/pci_x86.h PCI: ibmphp: Remove unused assignments PCI: cpqphp: Remove unused assignments PCI: fu740: Remove unused assignments PCI: kirin: Remove unused assignments PCI: Remove unused assignments PCI: Declare pci_filp_private only when HAVE_PCI_MMAP PCI: Avoid broken MSI on SB600 USB devices PCI: fu740: Force 2.5GT/s for initial device probe PCI: xgene: Revert "PCI: xgene: Fix IB window setup" PCI: xgene: Revert "PCI: xgene: Use inbound resources for setup" PCI: imx6: Assert i.MX8MM CLKREQ# even if no device present PCI: imx6: Invoke the PHY exit function after PHY power off PCI: rcar: Use PCI_SET_ERROR_RESPONSE after read which triggered an exception PCI: rcar: Finish transition to L1 state in rcar_pcie_config_access() PCI: dwc: Restore MSI Receiver mask during resume PCI: fu740: Drop redundant '-gpios' from DT GPIO lookup PCI/VGA: Replace full MIT license text with SPDX identifier PCI/VGA: Use unsigned format string to print lock counts PCI/VGA: Log bridge control messages when adding devices ... commit 636f64db07f33a18630248b4c57e182cd315b0da Merge: ebcb577aee14 7f1b8e0d6360 Author: Linus Torvalds Date: Fri Mar 25 12:34:53 2022 -0700 Merge tag 'ras_core_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RAS updates from Borislav Petkov: - More noinstr fixes - Add an erratum workaround for Intel CPUs which, in certain circumstances, end up consuming an unrelated uncorrectable memory error when using fast string copy insns - Remove the MCE tolerance level control as it is not really needed or used anymore * tag 'ras_core_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Remove the tolerance level control x86/mce: Work around an erratum on fast string copy instructions x86/mce: Use arch atomic and bit helpers commit 8d6451b9a51b555be2c9a6c326a980b2de00741a Author: Guilherme G. Piccoli Date: Mon Mar 21 11:41:33 2022 -0300 Documentation: Fix duplicate statement about raw_spinlock_t type Unless it was duplicate on purpose, to emphasize that a raw_spinlock_t is always a spinning lock regardless of PREEMPT_RT or kernel config, it's a bit odd that this text is duplicate. So, this patch just clean it up, keeping the consistency with the other sections of the text. Cc: Thomas Gleixner Fixes: 919e9e6395cf ("Documentation: Add lock ordering and nesting documentation") Signed-off-by: Guilherme G. Piccoli Link: https://lore.kernel.org/r/20220321144133.49804-1-gpiccoli@igalia.com Signed-off-by: Jonathan Corbet Documentation/locking/locktypes.rst | 3 --- 1 file changed, 3 deletions(-) commit ebcb577aee1448fd60904fc4126cbf7ec012bd0b Merge: 5e206459f670 87ba5badc541 Author: Linus Torvalds Date: Fri Mar 25 12:28:23 2022 -0700 Merge tag 'gpio-updates-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "Relatively few updates for this release cycle. We have a single new driver and some minor changes in drivers, more work on limiting the usage of of_node in drivers and DT updates: - new driver: gpio-en7523 - dt-bindings: convertion of faraday,ftgpio010 to YAML, new compatible string in gpio-vf610 and a bugfix in an example - gpiolib core: several improvements and some code shrink - documentation: convert all public docs into kerneldoc format - set IRQ bus token in gpio-crystalcove (addresses a debugfs issue) - add a missing return value check for kstrdup() in gpio-merrifield - allow gpio-tps68470 to be built as module - more work on limiting usage of of_node in GPIO drivers - several sysfs interface improvements - use SDPX in gpio-ts4900" * tag 'gpio-updates-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: ts4900: Use SPDX header gpiolib: Use list_first_entry()/list_last_entry() gpiolib: sysfs: Simplify edge handling in the code gpiolib: sysfs: Move kstrtox() calls outside of the mutex lock gpiolib: sysfs: Move sysfs_emit() calls outside of the mutex lock gpiolib: make struct comments into real kernel docs dt-bindings: gpio: convert faraday,ftgpio01 to yaml dt-bindings: gpio: gpio-vf610: Add imx93 compatible string gpiolib: Simplify error path in gpiod_get_index() when requesting GPIO gpiolib: Use short form of ternary operator in gpiod_get_index() gpiolib: Introduce for_each_gpio_desc_with_flag() macro gpio: Add support for Airoha EN7523 GPIO controller dt-bindings: arm: airoha: Add binding for Airoha GPIO controller dt-bindings: gpio: fix gpio-hog example gpio: tps68470: Allow building as module gpio: tegra: Get rid of duplicate of_node assignment gpio: altera-a10sr: Switch to use fwnode instead of of_node gpio: merrifield: check the return value of devm_kstrdup() gpio: crystalcove: Set IRQ domain bus token to DOMAIN_BUS_WIRED commit de2ae403b4c0e79a3410e63bc448542fbb9f9bfc Author: Juergen Gross Date: Fri Mar 25 15:20:02 2022 +0100 xen: fix is_xen_pmu() is_xen_pmu() is taking the cpu number as parameter, but it is not using it. Instead it just tests whether the Xen PMU initialization on the current cpu did succeed. As this test is done by checking a percpu pointer, preemption needs to be disabled in order to avoid switching the cpu while doing the test. While resuming from suspend() this seems not to be the case: [ 88.082751] ACPI: PM: Low-level resume complete [ 88.087933] ACPI: EC: EC started [ 88.091464] ACPI: PM: Restoring platform NVS memory [ 88.097166] xen_acpi_processor: Uploading Xen processor PM info [ 88.103850] Enabling non-boot CPUs ... [ 88.108128] installing Xen timer for CPU 1 [ 88.112763] BUG: using smp_processor_id() in preemptible [00000000] code: systemd-sleep/7138 [ 88.122256] caller is is_xen_pmu+0x12/0x30 [ 88.126937] CPU: 0 PID: 7138 Comm: systemd-sleep Tainted: G W 5.16.13-2.fc32.qubes.x86_64 #1 [ 88.137939] Hardware name: Star Labs StarBook/StarBook, BIOS 7.97 03/21/2022 [ 88.145930] Call Trace: [ 88.148757] [ 88.151193] dump_stack_lvl+0x48/0x5e [ 88.155381] check_preemption_disabled+0xde/0xe0 [ 88.160641] is_xen_pmu+0x12/0x30 [ 88.164441] xen_smp_intr_init_pv+0x75/0x100 Fix that by replacing is_xen_pmu() by a simple boolean variable which reflects the Xen PMU initialization state on cpu 0. Modify xen_pmu_init() to return early in case it is being called for a cpu other than cpu 0 and the boolean variable not being set. Fixes: bf6dfb154d93 ("xen/PMU: PMU emulation code") Reported-by: Marek Marczykowski-Górecki Signed-off-by: Juergen Gross Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220325142002.31789-1-jgross@suse.com Signed-off-by: Boris Ostrovsky arch/x86/xen/pmu.c | 10 ++++------ arch/x86/xen/pmu.h | 3 ++- arch/x86/xen/smp_pv.c | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) commit 5e206459f670b579da9b7861a0f3ce3b989a68b6 Merge: 146467766294 b146dbbd3bc6 Author: Linus Torvalds Date: Fri Mar 25 12:22:16 2022 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - rework of generic input handling which ultimately makes the processing of tablet events more generic and reliable (Benjamin Tissoires) - fixes for handling unnumbered reports fully correctly in i2c-hid (Angela Czubak, Dmitry Torokhov) - untangling of intermingled code for sending and handling output reports in i2c-hid (Dmitry Torokhov) - Apple magic keyboard support improvements for newer models (José Expósito) - Apple T2 Macs support improvements (Aun-Ali Zaidi, Paul Pawlowski) - driver for Razer Blackwidow keyboards (Jelle van der Waa) - driver for SiGma Micro keyboards (Desmond Lim) - integration of first part of DIGImend patches in order to ultimately vastly improve Linux support of tablets (Nikolai Kondrashov, José Expósito) * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (55 commits) HID: intel-ish-hid: Use dma_alloc_coherent for firmware update Input: docs: add more details on the use of BTN_TOOL HID: input: accommodate priorities for slotted devices HID: input: remove the need for HID_QUIRK_INVERT HID: input: enforce Invert usage to be processed before InRange HID: core: for input reports, process the usages by priority list HID: compute an ordered list of input fields to process HID: input: move up out-of-range processing of input values HID: input: rework spaghetti code with switch statements HID: input: tag touchscreens as such if the physical is not there HID: core: split data fetching from processing in hid_input_field() HID: core: de-duplicate some code in hid_input_field() HID: core: statically allocate read buffers HID: uclogic: Support multiple frame input devices HID: uclogic: Define report IDs before their descriptors HID: uclogic: Put version first in rdesc namespace HID: uclogic: Use "frame" instead of "buttonpad" HID: uclogic: Use different constants for frame report IDs HID: uclogic: Specify total report size to buttonpad macro HID: uclogic: Switch to matching subreport bytes ... commit ff32baa1f39b1adb519479a51e7acbcbfdd2206c Author: Jakub Kądziołka Date: Wed Mar 23 02:21:03 2022 +0100 xen: don't hang when resuming PCI device If a xen domain with at least two VCPUs has a PCI device attached which enters the D3hot state during suspend, the kernel may hang while resuming, depending on the core on which an async resume task gets scheduled. The bug occurs because xen's do_suspend calls dpm_resume_start while only the timer of the boot CPU has been resumed (when xen_suspend called syscore_resume), before calling xen_arch_suspend to resume the timers of the other CPUs. This breaks pci_dev_d3_sleep. Thus this patch moves the call to xen_arch_resume before the call to dpm_resume_start, eliminating the hangs and restoring the stack-like structure of the suspend/restore procedure. Signed-off-by: Jakub Kądziołka Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220323012103.2537-1-niedzejkob@invisiblethingslab.com Signed-off-by: Boris Ostrovsky drivers/xen/manage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1464677662943738741500a6f16b85d36bbde2be Merge: 50560ce6a0bd b49f72e7f96d Author: Linus Torvalds Date: Fri Mar 25 12:14:39 2022 -0700 Merge tag 'platform-drivers-x86-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Hans de Goede: "New drivers: - AMD Host System Management Port (HSMP) - Intel Software Defined Silicon Removed drivers (functionality folded into other drivers): - intel_cht_int33fe_microb - surface3_button amd-pmc: - s2idle bug-fixes - Support for AMD Spill to DRAM STB feature hp-wmi: - Fix SW_TABLET_MODE detection method (and other fixes) - Support omen thermal profile policy v1 serial-multi-instantiate: - Add SPI device support - Add support for CS35L41 amplifiers used in new laptops think-lmi: - syfs-class-firmware-attributes Certificate authentication support thinkpad_acpi: - Fixes + quirks - Add platform_profile support on AMD based ThinkPads x86-android-tablets: - Improve Asus ME176C / TF103C support - Support Nextbook Ares 8, Lenovo Tab 2 830 and 1050 tablets Lots of various other small fixes and hardware-id additions" * tag 'platform-drivers-x86-v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (60 commits) platform/x86: think-lmi: Certificate authentication support Documentation: syfs-class-firmware-attributes: Lenovo Certificate support platform/x86: amd-pmc: Only report STB errors when STB enabled platform/x86: amd-pmc: Drop CPU QoS workaround platform/x86: amd-pmc: Output error codes in messages platform/x86: amd-pmc: Move to later in the suspend process ACPI / x86: Add support for LPS0 callback handler platform/x86: thinkpad_acpi: consistently check fan_get_status return. platform/x86: hp-wmi: support omen thermal profile policy v1 platform/x86: hp-wmi: Changing bios_args.data to be dynamically allocated platform/x86: hp-wmi: Fix 0x05 error code reported by several WMI calls platform/x86: hp-wmi: Fix SW_TABLET_MODE detection method platform/x86: hp-wmi: Fix hp_wmi_read_int() reporting error (0x05) platform/x86: amd-pmc: Validate entry into the deepest state on resume platform/x86: thinkpad_acpi: Don't use test_bit on an integer platform/x86: thinkpad_acpi: Fix compiler warning about uninitialized err variable platform/x86: thinkpad_acpi: clean up dytc profile convert platform/x86: x86-android-tablets: Depend on EFI and SPI platform/x86: amd-pmc: uninitialized variable in amd_pmc_s2d_init() platform/x86: intel-uncore-freq: fix uncore_freq_common_init() error codes ... commit 50560ce6a0bdab2fc37384c52aa02c7043909d2c Merge: 29c8c18363ee 1e24078113ae Author: Linus Torvalds Date: Fri Mar 25 11:48:01 2022 -0700 Merge tag 'kbuild-gnu11-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild update for C11 language base from Masahiro Yamada: "Kbuild -std=gnu11 updates for v5.18 Linus pointed out the benefits of C99 some years ago, especially variable declarations in loops [1]. At that time, we were not ready for the migration due to old compilers. Recently, Jakob Koschel reported a bug in list_for_each_entry(), which leaks the invalid pointer out of the loop [2]. In the discussion, we agreed that the time had come. Now that GCC 5.1 is the minimum compiler version, there is nothing to prevent us from going to -std=gnu99, or even straight to -std=gnu11. Discussions for a better list iterator implementation are ongoing, but this patch set must land first" [1] https://lore.kernel.org/all/CAHk-=wgr12JkKmRd21qh-se-_Gs69kbPgR9x4C+Es-yJV2GLkA@mail.gmail.com/ [2] https://lore.kernel.org/lkml/86C4CE7D-6D93-456B-AA82-F8ADEACA40B7@gmail.com/ * tag 'kbuild-gnu11-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS Kbuild: move to -std=gnu11 Kbuild: use -Wdeclaration-after-statement Kbuild: add -Wno-shift-negative-value where -Wextra is used commit 5f7e2af00807f2117650e711a58b7f0e986ce1df Author: Maxime Ripard Date: Fri Mar 25 17:11:42 2022 +0100 clk: Initialize orphan req_rate When registering a clock that doesn't have a recalc_rate implementation, and doesn't have its parent registered yet, we initialize the clk_core rate and 'req_rate' fields to 0. The rate field is later updated when the parent is registered in clk_core_reparent_orphans_nolock() using __clk_recalc_rates(), but the 'req_rate' field is never updated. This leads to an issue in clk_set_rate_range() and clk_put(), since those functions will call clk_set_rate() with the content of 'req_rate' to provide drivers with the opportunity to change the rate based on the new boundaries. In this case, we would call clk_set_rate() with a rate of 0, effectively enforcing the minimum allowed for this clock whenever we would call one of those two functions, even though the actual rate might be within range. Let's fix this by setting 'req_rate' in clk_core_reparent_orphans_nolock() with the rate field content just updated by the call to __clk_recalc_rates(). Fixes: 1c8e600440c7 ("clk: Add rate constraints to clocks") Reported-by: Dmitry Osipenko Tested-by: Dmitry Osipenko # T30 Nexus7 Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220325161144.1901695-2-maxime@cerno.tech [sboyd@kernel.org: Reword comment] Signed-off-by: Stephen Boyd drivers/clk/clk.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 4bd9cab59f17eeee5749bae58212e0c9b314322b Author: Namhyung Kim Date: Wed Mar 23 16:02:59 2022 -0700 perf lock: Add -F/--field option to control output The -F/--field option is to customize the list of fields to output: $ perf lock report -F contended,wait_max -k avg_wait Name contended max wait (ns) avg wait (ns) slock-AF_INET6 1 23543 23543 &lruvec->lru_lock 5 18317 11254 slock-AF_INET6 1 10379 10379 rcu_node_1 1 2104 2104 &dentry->d_lockr... 1 1844 1844 &dentry->d_lockr... 1 1672 1672 &newf->file_lock 15 2279 1025 &dentry->d_lockr... 1 792 792 Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220323230259.288494-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/Documentation/perf-lock.txt | 6 ++++ tools/perf/builtin-lock.c | 55 ++++++++++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 5 deletions(-) commit 64999e4402099f2993f485b28baa33e638c93fe1 Author: Namhyung Kim Date: Wed Mar 23 16:02:58 2022 -0700 perf lock: Extend struct lock_key to have print function And use it to print output for each key field. No functional change intended and the output should be identical. Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220323230259.288494-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-lock.c | 91 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 65 insertions(+), 26 deletions(-) commit 67b61f59a620450738caf69552efa85faa9637f9 Author: Namhyung Kim Date: Wed Mar 23 16:02:57 2022 -0700 perf lock: Add --synth=no option for record The perf lock command has nothing to symbolize and lock names come from the tracepoint. Moreover, kernel symbols are available even the --synth=no option is given. This will reduce the startup time by avoiding unnecessary synthesis. Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220323230259.288494-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7000ef38052b219583f17a10ef2e7ca99b5e585e Author: Jan Engelhardt Date: Wed Mar 23 11:26:02 2022 +0100 Documentation: amd-pstate: grammar and sentence structure updates Signed-off-by: Jan Engelhardt Reviewed-by: Randy Dunlap Signed-off-by: Rafael J. Wysocki Documentation/admin-guide/pm/amd-pstate.rst | 135 ++++++++++++++-------------- 1 file changed, 67 insertions(+), 68 deletions(-) commit ebbe788731cb52a0ef69cf962813b302ef5b399e Author: Trond Myklebust Date: Thu Mar 24 17:19:59 2022 -0400 SUNRPC: Don't return error values in sysfs read of closed files Instead of returning an error value, which ends up being the return value for the read() system call, it is more elegant to simply return the error as a string value. Signed-off-by: Trond Myklebust net/sunrpc/sysfs.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) commit 421ab1be43bd015ffe744f4ea25df4f19d1ce6fe Author: Trond Myklebust Date: Fri Mar 25 10:37:31 2022 -0400 SUNRPC: Do not dereference non-socket transports in sysfs Do not cast the struct xprt to a sock_xprt unless we know it is a UDP or TCP transport. Otherwise the call to lock the mutex will scribble over whatever structure is actually there. This has been seen to cause hard system lockups when the underlying transport was RDMA. Fixes: b49ea673e119 ("SUNRPC: lock against ->sock changing during sysfs read") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust include/linux/sunrpc/xprt.h | 3 +++ include/linux/sunrpc/xprtsock.h | 1 - net/sunrpc/sysfs.c | 55 ++++++++++++++++++++--------------------- net/sunrpc/xprtsock.c | 26 +++++++++++++++++-- 4 files changed, 54 insertions(+), 31 deletions(-) commit 29c8c18363eee546d19bd95daa1e33c64ee74414 Merge: aa5b537b0ecc 25fd2d41b505 Author: Linus Torvalds Date: Fri Mar 25 10:21:20 2022 -0700 Merge branch 'akpm' (patches from Andrew) Merge yet more updates from Andrew Morton: "This is the material which was staged after willystuff in linux-next. Subsystems affected by this patch series: mm (debug, selftests, pagecache, thp, rmap, migration, kasan, hugetlb, pagemap, madvise), and selftests" * emailed patches from Andrew Morton : (113 commits) selftests: kselftest framework: provide "finished" helper mm: madvise: MADV_DONTNEED_LOCKED mm: fix race between MADV_FREE reclaim and blkdev direct IO read mm: generalize ARCH_HAS_FILTER_PGPROT mm: unmap_mapping_range_tree() with i_mmap_rwsem shared mm: warn on deleting redirtied only if accounted mm/huge_memory: remove stale locking logic from __split_huge_pmd() mm/huge_memory: remove stale page_trans_huge_mapcount() mm/swapfile: remove stale reuse_swap_page() mm/khugepaged: remove reuse_swap_page() usage mm/huge_memory: streamline COW logic in do_huge_pmd_wp_page() mm: streamline COW logic in do_swap_page() mm: slightly clarify KSM logic in do_swap_page() mm: optimize do_wp_page() for fresh pages in local LRU pagevecs mm: optimize do_wp_page() for exclusive pages in the swapcache mm/huge_memory: make is_transparent_hugepage() static userfaultfd/selftests: enable hugetlb remap and remove event testing selftests/vm: add hugetlb madvise MADV_DONTNEED MADV_REMOVE test mm: enable MADV_DONTNEED for hugetlb mappings kasan: disable LOCKDEP when printing reports ... commit f21a3509842294565eec63a4332096cccab610ae Author: Rafael J. Wysocki Date: Tue Mar 22 17:03:23 2022 +0100 ACPI: CPPC: Change default error code and clean up debug messages in probe Change the default error code returned by acpi_cppc_processor_probe() from -EFAULT (which is completely inadequate) to -ENODATA and change the debug messages printed by it to contain more information and be more consistent. While at it, format some white space to follow the coding style. Signed-off-by: Rafael J. Wysocki Reviewed-by: Huang Rui drivers/acpi/cppc_acpi.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) commit 40d8abf364bcab23bc715a9221a3c8623956257b Author: Rafael J. Wysocki Date: Tue Mar 22 17:02:05 2022 +0100 ACPI: CPPC: Avoid out of bounds access when parsing _CPC data If the NumEntries field in the _CPC return package is less than 2, do not attempt to access the "Revision" element of that package, because it may not be present then. Fixes: 337aadff8e45 ("ACPI: Introduce CPU performance controls using CPPC") BugLink: https://lore.kernel.org/lkml/20220322143534.GC32582@xsang-OptiPlex-9020/ Reported-by: kernel test robot Signed-off-by: Rafael J. Wysocki Reviewed-by: Huang Rui drivers/acpi/cppc_acpi.c | 5 +++++ 1 file changed, 5 insertions(+) commit 0b1be2c085aba906c87309b765dc2ef0716e160f Author: Vasant Hegde Date: Thu Mar 17 12:12:20 2022 +0530 ACPI: tables: Make LAPIC_ADDR_OVR address readable in message Without fix: [ 0.005429] ACPI: LAPIC_ADDR_OVR (address[(____ptrval____)]) With fix: [ 0.005429] ACPI: LAPIC_ADDR_OVR (address[0x800fee00000]) Co-developed-by: Suravee Suthikulpanit Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki drivers/acpi/tables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit aa5b537b0ecc16992577b013f11112d54c7ce869 Merge: d710d370c491 bbde015227e8 Author: Linus Torvalds Date: Fri Mar 25 10:11:38 2022 -0700 Merge tag 'riscv-for-linus-5.18-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V updates from Palmer Dabbelt: - Support for Sv57-based virtual memory. - Various improvements for the MicroChip PolarFire SOC and the associated Icicle dev board, which should allow upstream kernels to boot without any additional modifications. - An improved memmove() implementation. - Support for the new Ssconfpmf and SBI PMU extensions, which allows for a much more useful perf implementation on RISC-V systems. - Support for restartable sequences. * tag 'riscv-for-linus-5.18-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (36 commits) rseq/selftests: Add support for RISC-V RISC-V: Add support for restartable sequence MAINTAINERS: Add entry for RISC-V PMU drivers Documentation: riscv: Remove the old documentation RISC-V: Add sscofpmf extension support RISC-V: Add perf platform driver based on SBI PMU extension RISC-V: Add RISC-V SBI PMU extension definitions RISC-V: Add a simple platform driver for RISC-V legacy perf RISC-V: Add a perf core library for pmu drivers RISC-V: Add CSR encodings for all HPMCOUNTERS RISC-V: Remove the current perf implementation RISC-V: Improve /proc/cpuinfo output for ISA extensions RISC-V: Do no continue isa string parsing without correct XLEN RISC-V: Implement multi-letter ISA extension probing framework RISC-V: Extract multi-letter extension names from "riscv, isa" RISC-V: Minimal parser for "riscv, isa" strings RISC-V: Correctly print supported extensions riscv: Fixed misaligned memory access. Fixed pointer comparison. MAINTAINERS: update riscv/microchip entry riscv: dts: microchip: add new peripherals to icicle kit device tree ... commit 26de0ab9841a1610a477d9b07c024b9bb6d39f98 Author: Jakob Koschel Date: Thu Mar 24 08:04:41 2022 +0100 ACPI: IPMI: replace usage of found with dedicated list iterator variable To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable instead of a found boolean [1]. This removes the need to use a found variable and simply checking if the variable was set, can determine if the break/goto was hit. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Signed-off-by: Jakob Koschel Signed-off-by: Rafael J. Wysocki drivers/acpi/acpi_ipmi.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) commit d710d370c4911e83da5d2bc43d4a2c3b56bd27e7 Merge: 744465da705f c65f677b62d6 Author: Linus Torvalds Date: Fri Mar 25 10:01:34 2022 -0700 Merge tag 's390-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Vasily Gorbik: - Raise minimum supported machine generation to z10, which comes with various cleanups and code simplifications (usercopy/spectre mitigation/etc). - Rework extables and get rid of anonymous out-of-line fixups. - Page table helpers cleanup. Add set_pXd()/set_pte() helper functions. Covert pte_val()/pXd_val() macros to functions. - Optimize kretprobe handling by avoiding extra kprobe on __kretprobe_trampoline. - Add support for CEX8 crypto cards. - Allow to trigger AP bus rescan via writing to /sys/bus/ap/scans. - Add CONFIG_EXPOLINE_EXTERN option to build the kernel without COMDAT group sections which simplifies kpatch support. - Always use the packed stack layout and extend kernel unwinder tests. - Add sanity checks for ftrace code patching. - Add s390dbf debug log for the vfio_ap device driver. - Various virtual vs physical address confusion fixes. - Various small fixes and improvements all over the code. * tag 's390-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (69 commits) s390/test_unwind: add kretprobe tests s390/kprobes: Avoid additional kprobe in kretprobe handling s390: convert ".insn" encoding to instruction names s390: assume stckf is always present s390/nospec: move to single register thunks s390: raise minimum supported machine generation to z10 s390/uaccess: Add copy_from/to_user_key functions s390/nospec: align and size extern thunks s390/nospec: add an option to use thunk-extern s390/nospec: generate single register thunks if possible s390/pci: make zpci_set_irq()/zpci_clear_irq() static s390: remove unused expoline to BC instructions s390/irq: use assignment instead of cast s390/traps: get rid of magic cast for per code s390/traps: get rid of magic cast for program interruption code s390/signal: fix typo in comments s390/asm-offsets: remove unused defines s390/test_unwind: avoid build warning with W=1 s390: remove .fixup section s390/bpf: encode register within extable entry ... commit 744465da705f7d8cd893e97738a47b91f3321ce2 Merge: 1f1c153e406a 1c4664faa389 Author: Linus Torvalds Date: Fri Mar 25 09:49:39 2022 -0700 Merge tag 'xtensa-20220325' of https://github.com/jcmvbkbc/linux-xtensa Pull Xtensa updates from Max Filippov: - remove dependency on the compiler's libgcc - allow selection of internal kernel ABI via Kconfig - enable compiler plugins support for gcc-12 or newer - various minor cleanups and fixes * tag 'xtensa-20220325' of https://github.com/jcmvbkbc/linux-xtensa: xtensa: define update_mmu_tlb function xtensa: fix xtensa_wsr always writing 0 xtensa: enable plugin support xtensa: clean up kernel exit assembly code xtensa: rearrange NMI exit path xtensa: merge stack alignment definitions xtensa: fix DTC warning unit_address_format xtensa: fix stop_machine_cpuslocked call in patch_text xtensa: make secondary reset vector support conditional xtensa: add kernel ABI selection to Kconfig xtensa: don't link with libgcc xtensa: add helpers for division, remainder and shifts xtensa: add missing XCHAL_HAVE_WINDOWED check xtensa: use XCHAL_NUM_AREGS as pt_regs::areg size xtensa: rename PT_SIZE to PT_KERNEL_SIZE xtensa: Remove unused early_read_config_byte() et al declarations xtensa: use strscpy to copy strings net: xtensa: use strscpy to copy strings commit 15f9cd4334c83716fa32647652a609e3ba6c998d Author: Prike Liang Date: Thu Mar 24 16:14:16 2022 +0800 drm/amdgpu/gfx10: enable gfx1037 clock counter retrieval function Enable gfx1037 clock counter retrieval function for KFDPerfCountersTest.ClockCountersBasicTest. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + 1 file changed, 1 insertion(+) commit 0dc386add50b07e1cf9341b4e6e4fea77295c98a Author: Prike Liang Date: Tue Mar 22 16:25:29 2022 +0800 drm/amdgpu: set noretry for gfx 10.3.7 Disable xnack on the gfx10.3.7 for the KFD test. Signed-off-by: Prike Liang Acked-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 + 1 file changed, 1 insertion(+) commit 609910db56e72e87755d9745442bfdfa009dc61b Author: Felix Kuehling Date: Wed Mar 2 15:18:18 2022 -0500 drm/amdgpu: set noretry=1 for GFX 10.3.4 Retry faults are not supported on GFX 10.3.4. Signed-off-by: Felix Kuehling Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 7057c81773ac32fd0dba00e2bb869928f008d3e2 Author: Yifan Zhang Date: Tue Mar 1 22:31:40 2022 +0800 drm/amdgpu: set noretry=1 for gc 10.3.6 this patch to set noretry=1 for gc 10.3.6. Signed-off-by: Yifan Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 1 + 1 file changed, 1 insertion(+) commit 5f3854f1f4e211f494018160b348a1c16e58013f Author: Alex Deucher Date: Thu Mar 24 18:04:00 2022 -0400 drm/amdgpu: add more cases to noretry=1 Port current list from amd-staging-drm-next. Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 3 +++ 1 file changed, 3 insertions(+) commit ebbb7bb9e80305820dc2328a371c1b35679f2667 Author: QintaoShen Date: Thu Mar 24 16:26:23 2022 +0800 drm/amdkfd: Check for potential null return of kmalloc_array() As the kmalloc_array() may return null, the 'event_waiters[i].wait' would lead to null-pointer dereference. Therefore, it is better to check the return value of kmalloc_array() to avoid this confusion. Signed-off-by: QintaoShen Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_events.c | 2 ++ 1 file changed, 2 insertions(+) commit 6ea239adc2a712eb318f04f5c29b018ba65ea38a Author: Tianci Yin Date: Wed Mar 23 23:54:58 2022 +0800 drm/amdgpu/vcn: improve vcn dpg stop procedure Prior to disabling dpg, VCN need unpausing dpg mode, or VCN will hang in S3 resuming. Reviewed-by: James Zhu Signed-off-by: Tianci Yin Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 3 +++ 1 file changed, 3 insertions(+) commit c5650327aba02d15cbd6a1846dcde9231493d549 Author: Divya Shikre Date: Tue Mar 22 15:00:12 2022 -0400 drm/amdkfd: Check use_xgmi_p2p before reporting hive_id Recently introduced commit 158a05a0b885 ("drm/amdgpu: Add use_xgmi_p2p module parameter") did not update XGMI iolinks when use_xgmi_p2p is disabled. Add fix to not create XGMI iolinks in KFD topology when this parameter is disabled. Fixes: 158a05a0b885 ("drm/amdgpu: Add use_xgmi_p2p module parameter") Signed-off-by: Divya Shikre Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit b7dfbd2e601f3fee545bc158feceba4f340fe7cf Author: Tushar Patel Date: Thu Mar 17 15:31:22 2022 -0400 drm/amdkfd: Fix Incorrect VMIDs passed to HWS Compute-only GPUs have more than 8 VMIDs allocated to KFD. Fix this by passing correct number of VMIDs to HWS v2: squash in warning fix (Alex) Signed-off-by: Tushar Patel Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) commit a572f7055067d95455850fd242d8b54ff5786cac Author: Charlene Liu Date: Tue Feb 22 15:53:32 2022 -0500 drm/amd/display: remove destructive verify link for TMDS [why and how] TMDS does not need destructive verify link Reviewed-by: Aric Cyr Acked-by: Alan Liu Acked-by: Alex Hung Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit e5fc78252ccd8dfc260f87d83905e9dffff6d975 Author: Gabe Teeger Date: Mon Mar 14 12:07:14 2022 -0400 drm/amd/display: Add support for zstate during extended vblank [why] When we enter FREESYNC_STATE_VIDEO, we want to use the extra vblank portion to enter zstate if possible. [how] When we enter freesync, a full update is triggered and the new vtotal with extra lines is passed to dml in a stream update. The time gained from extra vblank lines is calculated in microseconds. We allow zstate entry if the time gained is greater than 5 ms, which is the current policy. Furthermore, an optimized value for min_dst_y_next_start is calculated and written to its register. When exiting freesync, another full update is triggered and default values are restored. Reviewed-by: Nicholas Kazlauskas Acked-by: Alex Hung Signed-off-by: Gabe Teeger Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc.c | 19 +++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc.h | 6 +++++- drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 ++ drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 12 ++++++++++++ drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubp.c | 8 ++++++++ drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 1 + drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 18 +++++++++++++++--- .../amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c | 13 +++++++++++++ .../gpu/drm/amd/display/dc/dml/display_mode_structs.h | 2 ++ drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 3 +++ 10 files changed, 80 insertions(+), 4 deletions(-) commit 02fc996d5098f4c3f65bdf6cdb6b28e3f29ba789 Author: Emily Deng Date: Mon Mar 21 16:25:24 2022 +0800 drm/amdgpu/vcn: Fix the register setting for vcn1 Correct the code error for setting register UVD_GFX10_ADDR_CONFIG. Need to use inst_idx, or it only will set VCN0. Signed-off-by: Emily Deng Reviewed-by: James Zhu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c9fbf6435162ed5fb7201d1d4adf6585c6a8c327 Author: Leo (Hanghong) Ma Date: Fri Mar 11 11:35:29 2022 -0500 drm/amd/display: Update VTEM Infopacket definition [Why & How] The latest HDMI SPEC has updated the VTEM packet structure, so change the VTEM Infopacket defined in the driver side to align with the SPEC. Reviewed-by: Chris Park Acked-by: Alex Hung Signed-off-by: Leo (Hanghong) Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit bd219322dbb41cc7c753da3a6936ce09d502f113 Author: Oliver Logush Date: Tue Mar 8 10:34:04 2022 -0500 drm/amd/display: Add fSMC_MSG_SetDtbClk support [why] Needed to support dcn315 Reviewed-by: Charlene Liu Acked-by: Alex Hung Signed-off-by: Oliver Logush Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher .../drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c | 19 +++++++++++++++---- .../drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.h | 4 +++- 2 files changed, 18 insertions(+), 5 deletions(-) commit 7d56a154e22ffb3613fdebf83ec34d5225a22993 Author: Chiawen Huang Date: Thu Mar 10 00:07:59 2022 +0800 drm/amd/display: FEC check in timing validation [Why] disable/enable leads FEC mismatch between hw/sw FEC state. [How] check FEC status to fastboot on/off. Reviewed-by: Anthony Koo Acked-by: Alex Hung Signed-off-by: Chiawen Huang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++++ 1 file changed, 4 insertions(+) commit 6bf528ec91fb96e186461215c8f76265c5a35250 Author: Rodrigo Siqueira Date: Mon Feb 28 19:01:59 2022 -0500 drm/amd/display: Reduce stack size Linux kernel enabled more compilation restrictions related to the stack size, which caused compilation failures in our code. This commit reduces the allocation size by allocating the required memory dynamically. Reviewed-by: Harry Wentland Reviewed-by: Aric Cyr Acked-by: Alex Hung Signed-off-by: Rodrigo Siqueira Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 5e8a71cf13bc9184fee915b2220be71b4c6cac74 Author: Charlene Liu Date: Mon Mar 7 18:31:29 2022 -0500 drm/amd/display: fix audio format not updated after edid updated [why] for the case edid change only changed audio format. driver still need to update stream. Reviewed-by: Alvin Lee Reviewed-by: Aric Cyr Acked-by: Alex Hung Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3107e1a7ae088ee94323fe9ab05dbefd65b3077f Author: Nicholas Kazlauskas Date: Fri Mar 18 11:10:34 2022 -0400 drm/amd/display: Fix p-state allow debug index on dcn31 [Why] It changed since dcn30 but the hubbub31 constructor hasn't been modified to reflect this. [How] Update the value in the constructor to 0x6 so we're checking the right bits for p-state allow. It worked before by accident, but can falsely assert 0 depending on HW state transitions. The most frequent of which appears to be when all pipes turn off during IGT tests. Cc: Harry Wentland Fixes: e7031d8258f1b4 ("drm/amd/display: Add pstate verification and recovery for DCN31") Signed-off-by: Nicholas Kazlauskas Reviewed-by: Eric Yang Acked-by: Harry Wentland Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c | 2 ++ 1 file changed, 2 insertions(+) commit 93dde6ccd66d29502506e95f568fd0f49d575d27 Author: Stanley.Yang Date: Mon Mar 21 12:50:36 2022 +0800 drm/amdgpu/pm: add asic smu support check It must check asic whether support smu before call smu powerplay function, otherwise it may cause null point on no support smu asic. Signed-off-by: Stanley.Yang Reviewed-by: Evan Quan Signed-off-by: Alex Deucher drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 0d8e4eb337644cab528ff3844675d58496ec22db Author: Lang Yu Date: Tue Mar 8 11:26:41 2022 +0800 drm/amdgpu: add workarounds for VCN TMZ issue on CHIP_RAVEN It is a hardware issue that VCN can't handle a GTT backing stored TMZ buffer on CHIP_RAVEN series ASIC. Move such a TMZ buffer to VRAM domain before command submission as a workaround. v2: - Use patch_cs_in_place callback. v3: - Bail out early if unsecure IBs. Suggested-by: Christian König Signed-off-by: Lang Yu Reviewed-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 71 +++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) commit b818a5d374542ccec73dcfe578a081574029820e Author: Alex Deucher Date: Wed Mar 9 18:02:11 2022 -0500 drm/amdgpu/gmc: use PCI BARs for APUs in passthrough If the GPU is passed through to a guest VM, use the PCI BAR for CPU FB access rather than the physical address of carve out. The physical address is not valid in a guest. v2: Fix HDP handing as suggested by Michel Reviewed-by: Christian König Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 5 +++-- drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) commit 1647b54ed55d4d48c7199d439f8834626576cbe9 Author: Dan Carpenter Date: Wed Mar 16 11:41:48 2022 +0300 drm/amdgpu: fix off by one in amdgpu_gfx_kiq_acquire() This post-op should be a pre-op so that we do not pass -1 as the bit number to test_bit(). The current code will loop downwards from 63 to -1. After changing to a pre-op, it loops from 63 to 0. Fixes: 71c37505e7ea ("drm/amdgpu/gfx: move more common KIQ code to amdgpu_gfx.c") Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 60d61f4ed6ead43ad2de31ebb8d1d27c57290529 Author: Yifan Zhang Date: Tue Mar 15 18:19:06 2022 +0800 drm/amdgpu/pm: fix the Stable pstate Test in amdgpu_test If GFX DPM is disbaled, Stable pstate Test in amdgpu_test fails. Check GFX DPM statue before change clock level Log: [ 46.595274] [drm] Initialized amdgpu 3.46.0 20150101 for 0000:02:00.0 on minor 0 [ 46.599929] fbcon: amdgpudrmfb (fb0) is primary device [ 46.785753] Console: switching to colour frame buffer device 240x67 [ 46.811765] amdgpu 0000:02:00.0: [drm] fb0: amdgpudrmfb frame buffer device [ 131.398407] amdgpu 0000:02:00.0: amdgpu: Failed to set performance level! Signed-off-by: Yifan Zhang Acked-by: Huang Rui Signed-off-by: Alex Deucher drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2d505453f38e18d42ba7d5428aaa17aaa7752c65 Author: Guchun Chen Date: Tue Mar 15 14:59:28 2022 +0800 drm/amdgpu: conduct a proper cleanup of PDB bo Use amdgpu_bo_free_kernel instead of amdgpu_bo_unref to perform a proper cleanup of PDB bo. v2: update subject to be more accurate Signed-off-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 32f90e65251981f061eec883b0fe9e75d74e9665 Author: Guchun Chen Date: Tue Mar 15 14:46:28 2022 +0800 drm/amdgpu: prevent memory wipe in suspend/shutdown stage On GPUs with RAS enabled, below call trace is observed when suspending or shutting down device. The cause is we have enabled memory wipe flag for BOs on such GPUs by default, and such BOs will go to memory wipe by amdgpu_fill_buffer, however, because ring is off already, it fails to clean up the memory and throw this error message. So add a suspend/shutdown check before wipping memory. [drm:amdgpu_fill_buffer [amdgpu]] *ERROR* Trying to clear memory with ring turned off. v2: fix coding style issue Fixes: fc6ea4bee13071 ("drm/amdgpu: Wipe all VRAM on free when RAS is enabled") Signed-off-by: Guchun Chen Reviewed-by: Christian König Acked-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 1f1c153e406a7375ae0fc3d6000b64e7ba27cf8a Merge: 9a8b3d5f71eb fe2640bd7a62 Author: Linus Torvalds Date: Fri Mar 25 09:39:36 2022 -0700 Merge tag 'powerpc-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: "Livepatch support for 32-bit is probably the standout new feature, otherwise mostly just lots of bits and pieces all over the board. There's a series of commits cleaning up function descriptor handling, which touches a few other arches as well as LKDTM. It has acks from Arnd, Kees and Helge. Summary: - Enforce kernel RO, and implement STRICT_MODULE_RWX for 603. - Add support for livepatch to 32-bit. - Implement CONFIG_DYNAMIC_FTRACE_WITH_ARGS. - Merge vdso64 and vdso32 into a single directory. - Fix build errors with newer binutils. - Add support for UADDR64 relocations, which are emitted by some toolchains. This allows powerpc to build with the latest lld. - Fix (another) potential userspace r13 corruption in transactional memory handling. - Cleanups of function descriptor handling & related fixes to LKDTM. Thanks to Abdul Haleem, Alexey Kardashevskiy, Anders Roxell, Aneesh Kumar K.V, Anton Blanchard, Arnd Bergmann, Athira Rajeev, Bhaskar Chowdhury, Cédric Le Goater, Chen Jingwen, Christophe JAILLET, Christophe Leroy, Corentin Labbe, Daniel Axtens, Daniel Henrique Barboza, David Dai, Fabiano Rosas, Ganesh Goudar, Guo Zhengkui, Hangyu Hua, Haren Myneni, Hari Bathini, Igor Zhbanov, Jakob Koschel, Jason Wang, Jeremy Kerr, Joachim Wiberg, Jordan Niethe, Julia Lawall, Kajol Jain, Kees Cook, Laurent Dufour, Madhavan Srinivasan, Mamatha Inamdar, Maxime Bizon, Maxim Kiselev, Maxim Kochetkov, Michal Suchanek, Nageswara R Sastry, Nathan Lynch, Naveen N. Rao, Nicholas Piggin, Nour-eddine Taleb, Paul Menzel, Ping Fang, Pratik R. Sampat, Randy Dunlap, Ritesh Harjani, Rohan McLure, Russell Currey, Sachin Sant, Segher Boessenkool, Shivaprasad G Bhat, Sourabh Jain, Thierry Reding, Tobias Waldekranz, Tyrel Datwyler, Vaibhav Jain, Vladimir Oltean, Wedson Almeida Filho, and YueHaibing" * tag 'powerpc-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (179 commits) powerpc/pseries: Fix use after free in remove_phb_dynamic() powerpc/time: improve decrementer clockevent processing powerpc/time: Fix KVM host re-arming a timer beyond decrementer range powerpc/tm: Fix more userspace r13 corruption powerpc/xive: fix return value of __setup handler powerpc/64: Add UADDR64 relocation support powerpc: 8xx: fix a return value error in mpc8xx_pic_init powerpc/ps3: remove unneeded semicolons powerpc/64: Force inlining of prevent_user_access() and set_kuap() powerpc/bitops: Force inlining of fls() powerpc: declare unmodified attribute_group usages const powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n powerpc/secvar: fix refcount leak in format_show() powerpc/64e: Tie PPC_BOOK3E_64 to PPC_FSL_BOOK3E powerpc: Move C prototypes out of asm-prototypes.h powerpc/kexec: Declare kexec_paca static powerpc/smp: Declare current_set static powerpc: Cleanup asm-prototypes.c powerpc/ftrace: Use STK_GOT in ftrace_mprofile.S powerpc/ftrace: Regroup PPC64 specific operations in ftrace_mprofile.S ... commit 9a8b3d5f71eb74b1b95927bd320b1070866a119a Merge: 34af78c4e616 f8f9f21c7848 Author: Linus Torvalds Date: Fri Mar 25 09:35:19 2022 -0700 Merge tag 'mips_5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Thomas Bogendoerfer: - added support for QCN550x (ath79) - enabled KCSAN - removed TX39XX support - various cleanups and fixes * tag 'mips_5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (31 commits) MIPS: Fix build error for loongson64 and sgi-ip27 MIPS: ingenic: correct unit node address MIPS: Fix wrong comments in asm/prom.h MIPS: Remove redundant definitions of device_tree_init() MIPS: Remove redundant check in device_tree_init() MIPS: pgalloc: fix memory leak caused by pgd_free() MIPS: RB532: fix return value of __setup handler MIPS: Only use current_stack_pointer on GCC MIPS: boot/compressed: Use array reference for image bounds mips: cdmm: Fix refcount leak in mips_cdmm_phys_base mips: remove reference to "newer Loongson-3" mips: Always permit to build u-boot images MIPS: Sanitise Cavium switch cases in TLB handler synthesizers DEC: Limit PMAX memory probing to R3k systems mips: DEC: honor CONFIG_MIPS_FP_SUPPORT=n MIPS: fix fortify panic when copying asm exception handlers mips: ralink: fix a refcount leak in ill_acc_of_setup() mips: Implement "current_stack_pointer" MIPS: Remove TX39XX support MIPS: Modernize READ_IMPLIES_EXEC ... commit aefe5fc3000a24869edbf7bb657adf28372ec158 Author: ChiYuan Huang Date: Fri Mar 25 09:26:17 2022 +0800 regulator: rt4831: Add active_discharge_on to fix discharge API To use set_discharge helper function, active_discharge_on need to be added. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1648171577-9663-3-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown drivers/regulator/rt4831-regulator.c | 2 ++ 1 file changed, 2 insertions(+) commit 184ae0e32bc990bba203b60503df89c9f8865f13 Author: ChiYuan Huang Date: Fri Mar 25 09:26:16 2022 +0800 regulator: rt4831: Add bypass mask to fix set_bypass API work To use set/get_bypass helper function, bypass mask need to be specified. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1648171577-9663-2-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown drivers/regulator/rt4831-regulator.c | 1 + 1 file changed, 1 insertion(+) commit 664d66dc0a64b32e60a5ad59a9aebb08676a612b Author: Zheng Bin Date: Wed Mar 23 17:25:01 2022 +0800 ASoC: SOF: Intel: Fix build error without SND_SOC_SOF_PCI_DEV If SND_SOC_SOF_PCI_DEV is n, bulding fails: sound/soc/sof/intel/pci-tng.o:(.data+0x1c0): undefined reference to `sof_pci_probe' sound/soc/sof/intel/pci-tng.o:(.data+0x1c8): undefined reference to `sof_pci_remove' sound/soc/sof/intel/pci-tng.o:(.data+0x1e0): undefined reference to `sof_pci_shutdown' sound/soc/sof/intel/pci-tng.o:(.data+0x290): undefined reference to `sof_pci_pm' Make SND_SOC_SOF_MERRIFIELD select SND_SOC_SOF_PCI_DEV to fix this. Fixes: 8d4ba1be3d22 ("ASoC: SOF: pci: split PCI into different drivers") Reported-by: Hulk Robot Signed-off-by: Zheng Bin Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220323092501.145879-1-zhengbin13@huawei.com Signed-off-by: Mark Brown sound/soc/sof/intel/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 113be37d87449836ebbca4ca2909dc4e1db9663d Author: Steve French Date: Thu Mar 24 22:09:29 2022 -0500 [smb3] move more common protocol header definitions to smbfs_common We have duplicated definitions for various SMB3 PDUs in fs/ksmbd and fs/cifs. Some had already been moved to fs/smbfs_common/smb2pdu.h Move definitions for - error response - query info and various related protocol flags - various lease handling flags and the create lease context to smbfs_common/smb2pdu.h to reduce code duplication Reviewed-by: Namjae Jeon Signed-off-by: Steve French fs/cifs/smb2misc.c | 10 ++--- fs/cifs/smb2ops.c | 12 +++--- fs/cifs/smb2pdu.h | 100 --------------------------------------------- fs/ksmbd/smb2pdu.h | 95 ------------------------------------------- fs/smbfs_common/smb2pdu.h | 101 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 112 insertions(+), 206 deletions(-) commit 0396e46dc46523cba8401a0df84f67cc0b6067ab Author: Michael Kelley Date: Thu Mar 24 12:20:21 2022 -0700 virt: vmgenid: recognize new CID added by Hyper-V In the Windows spec for VM Generation ID, the originally specified CID is longer than allowed by the ACPI spec. Hyper-V has added "VMGENCTR" as a second valid CID that is conformant, while retaining the original CID for compatibility with Windows guests. Add this new CID to the list recognized by the driver. Signed-off-by: Michael Kelley Signed-off-by: Jason A. Donenfeld drivers/virt/vmgenid.c | 1 + 1 file changed, 1 insertion(+) commit dd7aa36e535797926d8eb311da7151919130139d Author: Jason A. Donenfeld Date: Tue Mar 22 22:21:52 2022 -0600 random: re-add removed comment about get_random_{u32,u64} reseeding The comment about get_random_{u32,u64}() not invoking reseeding got added in an unrelated commit, that then was recently reverted by 0313bc278dac ("Revert "random: block in /dev/urandom""). So this adds that little comment snippet back, and improves the wording a bit too. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit d97c68d178fbf8aaaf21b69b446f2dfb13909316 Author: Jason A. Donenfeld Date: Tue Mar 22 21:43:12 2022 -0600 random: treat bootloader trust toggle the same way as cpu trust toggle If CONFIG_RANDOM_TRUST_CPU is set, the RNG initializes using RDRAND. But, the user can disable (or enable) this behavior by setting `random.trust_cpu=0/1` on the kernel command line. This allows system builders to do reasonable things while avoiding howls from tinfoil hatters. (Or vice versa.) CONFIG_RANDOM_TRUST_BOOTLOADER is basically the same thing, but regards the seed passed via EFI or device tree, which might come from RDRAND or a TPM or somewhere else. In order to allow distros to more easily enable this while avoiding those same howls (or vice versa), this commit adds the corresponding `random.trust_bootloader=0/1` toggle. Cc: Theodore Ts'o Cc: Graham Christensen Reviewed-by: Ard Biesheuvel Reviewed-by: Dominik Brodowski Link: https://github.com/NixOS/nixpkgs/pull/165355 Signed-off-by: Jason A. Donenfeld Documentation/admin-guide/kernel-parameters.txt | 6 ++++++ drivers/char/Kconfig | 3 ++- drivers/char/random.c | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) commit af704c856e888fb044b058d731d61b46eeec499d Author: Jason A. Donenfeld Date: Mon Mar 21 18:48:05 2022 -0600 random: skip fast_init if hwrng provides large chunk of entropy At boot time, EFI calls add_bootloader_randomness(), which in turn calls add_hwgenerator_randomness(). Currently add_hwgenerator_randomness() feeds the first 64 bytes of randomness to the "fast init" non-crypto-grade phase. But if add_hwgenerator_randomness() gets called with more than POOL_MIN_BITS of entropy, there's no point in passing it off to the "fast init" stage, since that's enough entropy to bootstrap the real RNG. The "fast init" stage is just there to provide _something_ in the case where we don't have enough entropy to properly bootstrap the RNG. But if we do have enough entropy to bootstrap the RNG, the current logic doesn't serve a purpose. So, in the case where we're passed greater than or equal to POOL_MIN_BITS of entropy, this commit makes us skip the "fast init" phase. Cc: Dominik Brodowski Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 631f871f071746789e9242e514ab0f49067fa97a Author: Andreas Gruenbacher Date: Tue Nov 9 12:56:06 2021 +0100 fs/iomap: Fix buffered write page prefaulting When part of the user buffer passed to generic_perform_write() or iomap_file_buffered_write() cannot be faulted in for reading, the entire write currently fails. The correct behavior would be to write all the data that can be written, up to the point of failure. Commit a6294593e8a1 ("iov_iter: Turn iov_iter_fault_in_readable into fault_in_iov_iter_readable") gave us the information needed, so fix the page prefaulting in generic_perform_write() and iomap_write_iter() to only bail out when no pages could be faulted in. We already factor in that pages that are faulted in may no longer be resident by the time they are accessed. Paging out pages has the same effect as not faulting in those pages in the first place, so the code can already deal with that. Signed-off-by: Andreas Gruenbacher Reviewed-by: Catalin Marinas Reviewed-by: Christoph Hellwig fs/iomap/buffered-io.c | 2 +- mm/filemap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 8197b053a83335dd1b7eb7581a933924e25c1025 Author: Pavel Begunkov Date: Fri Mar 25 13:00:43 2022 +0000 io_uring: fix put_kbuf without proper locking io_put_kbuf_comp() should only be called while holding ->completion_lock, however there is no such assumption in io_clean_op() and thus it can corrupt ->io_buffer_comp. Take the lock there, and workaround the only user of io_clean_op() calling it with locks. Not the prettiest solution, but it's easier to refactor it for-next. Fixes: cc3cec8367cba ("io_uring: speedup provided buffer handling") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/743e2130b73ec6d48c4c5dd15db896c433431e6d.1648212967.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) commit ab0ac0959b028779ea43002db81daa12203cb57d Author: Pavel Begunkov Date: Fri Mar 25 13:00:42 2022 +0000 io_uring: fix invalid flags for io_put_kbuf() io_req_complete_failed() doesn't require callers to hold ->uring_lock, use IO_URING_F_UNLOCKED version of io_put_kbuf(). The only affected place is the fail path of io_apoll_task_func(). Also add a lockdep annotation to catch such bugs in the future. Fixes: 3b2b78a8eb7cc ("io_uring: extend provided buf return to fails") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ccf602dbf8df3b6a8552a262d8ee0a13a086fbc7.1648212967.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 519f490db07e1a539490612f376487f61e48e39c Author: Christian König Date: Fri Mar 11 10:32:26 2022 +0100 dma-buf/sync-file: fix warning about fence containers The dma_fence_chain containers can show up in sync_files as well resulting in warnings that those can't be added to dma_fence_array containers when merging multiple sync_files together. Solve this by using the dma_fence_unwrap iterator to deep dive into the contained fences and then add those flatten out into a dma_fence_array. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220311110244.1245-2-christian.koenig@amd.com drivers/dma-buf/sync_file.c | 141 +++++++++++++++++++++++--------------------- 1 file changed, 73 insertions(+), 68 deletions(-) commit 64a8f92fd783e750cdb81af75942dcd53bbf61bd Author: Christian König Date: Fri Mar 11 10:27:53 2022 +0100 dma-buf: add dma_fence_unwrap v2 Add a general purpose helper to deep dive into dma_fence_chain/dma_fence_array structures and iterate over all the fences in them. This is useful when we need to flatten out all fences in those structures. v2: some selftests cleanup, improved function naming and documentation Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220311110244.1245-1-christian.koenig@amd.com Documentation/driver-api/dma-buf.rst | 6 + drivers/dma-buf/Makefile | 1 + drivers/dma-buf/selftests.h | 1 + drivers/dma-buf/st-dma-fence-unwrap.c | 261 ++++++++++++++++++++++++++++++++++ include/linux/dma-fence-array.h | 2 + include/linux/dma-fence-chain.h | 2 + include/linux/dma-fence-unwrap.h | 95 +++++++++++++ 7 files changed, 368 insertions(+) commit caaf2ae712b7cc3c7717898fe267dbf882a502ef Author: Christian König Date: Mon Jan 24 14:03:24 2022 +0100 dma-buf: Add dma_fence_array_for_each (v2) Add a helper to iterate over all fences in a dma_fence_array object. v2 (Jason Ekstrand) - Return NULL from dma_fence_array_first if head == NULL. This matches the iterator behavior of dma_fence_chain_for_each in that it iterates zero times if head == NULL. - Return NULL from dma_fence_array_next if index > array->num_fences. Signed-off-by: Jason Ekstrand Reviewed-by: Jason Ekstrand Reviewed-by: Christian König Cc: Daniel Vetter Cc: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20210610210925.642582-2-jason@jlekstrand.net Signed-off-by: Christian König drivers/dma-buf/dma-fence-array.c | 27 +++++++++++++++++++++++++++ include/linux/dma-fence-array.h | 17 +++++++++++++++++ 2 files changed, 44 insertions(+) commit 41cdcc2202d4c466534b8f38975d2e6b16317c0c Author: Pavel Begunkov Date: Fri Mar 25 11:52:18 2022 +0000 io_uring: improve req fields comments Move a misplaced comment about req->creds and add a line with assumptions about req->link. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/1e51d1e6b1f3708c2d4127b4e371f9daa4c5f859.1648209006.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 52dd86406dfa322c8d42b3a4328858abdc6f1d85 Author: Dylan Yudaken Date: Fri Mar 25 02:37:55 2022 -0700 io_uring: enable EPOLLEXCLUSIVE for accept poll When polling sockets for accept, use EPOLLEXCLUSIVE. This is helpful when multiple accept SQEs are submitted. For O_NONBLOCK sockets multiple queued SQEs would previously have all completed at once, but most with -EAGAIN as the result. Now only one wakes up and completes. For sockets without O_NONBLOCK there is no user facing change, but internally the extra requests would previously be queued onto a worker thread as they would wake up with no connection waiting, and be punted. Now they do not wake up unnecessarily. Co-developed-by: Jens Axboe Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220325093755.4123343-1-dylany@fb.com Signed-off-by: Jens Axboe fs/io_uring.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 81c2f059ab90b221931e78503c80dcd8fbadac53 Author: Clément Léger Date: Tue Mar 8 14:35:05 2022 +0100 rtc: optee: add RTC driver for OP-TEE RTC PTA This drivers allows to communicate with a RTC PTA handled by OP-TEE [1]. This PTA allows to query RTC information, set/get time and set/get offset depending on the supported features. [1] https://github.com/OP-TEE/optee_os/pull/5179 Signed-off-by: Clément Léger Reviewed-by: Jens Wiklander Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220308133505.471601-1-clement.leger@bootlin.com MAINTAINERS | 6 + drivers/rtc/Kconfig | 10 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-optee.c | 362 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 379 insertions(+) commit 870c54e1a3e111613cd68e5cc867455dc4765cd6 Author: Loic Poulain Date: Thu Feb 17 10:36:18 2022 +0100 rtc: pm8xxx: Return -ENODEV if set_time disallowed Having !allow_set_time is equivalent to non-implemented set_time function, which is normally represented with -ENODEV error in RTC subsystem. Today we are returning -EACCES error code, which is not considered by RTC clients as a 'non implemented' feature, and which causes NTP to retry hw clk sync (update_rtc) indefinitely. Signed-off-by: Loic Poulain Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1645090578-20734-1-git-send-email-loic.poulain@linaro.org drivers/rtc/rtc-pm8xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b5bf5b283d07bd1f4d49657557fb99ec5fbfc588 Author: Loic Poulain Date: Wed Feb 16 16:24:42 2022 +0100 rtc: pm8xxx: Attach wake irq to device Attach the interrupt as a wake-irq to the device, so that: - A corresponding wakeup source is created (and reported in e.g /sys/kernel/debug/wakeup_sources). - The power subsystem take cares of arming/disarming irq-wake automatically on suspend/resume. Signed-off-by: Loic Poulain Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1645025082-6138-1-git-send-email-loic.poulain@linaro.org drivers/rtc/rtc-pm8xxx.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) commit 1521ca5b9f93e3d8c9782ac10a42bc5c3a3ba370 Author: Alexandre Belloni Date: Sun Mar 20 22:09:04 2022 +0100 clk: sunxi-ng: sun6i-rtc: include clk/sunxi-ng.h This solves: >> drivers/clk/sunxi-ng/ccu-sun6i-rtc.c:334:5: warning: no previous prototype for 'sun6i_rtc_ccu_probe' [-Wmissing-prototypes] 334 | int sun6i_rtc_ccu_probe(struct device *dev, void __iomem *reg) | ^~~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot Signed-off-by: Alexandre Belloni Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220320210905.6606-1-alexandre.belloni@bootlin.com drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 2 ++ 1 file changed, 2 insertions(+) commit 24b488061b97a6c6ff82c433e6843eaf54f41f3c Author: Lorenzo Bianconi Date: Thu Mar 24 12:10:55 2022 +0100 MAINTAINERS: update Lorenzo's email address Using my kernel.org email. Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/e98fcf759f8c23a9736f1c4d20ca0437e4b145de.1648120046.git.lorenzo@kernel.org MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7ed7aa4de9421229be6d331ed52d5cd09c99f409 Author: Peter Zijlstra Date: Thu Mar 24 00:05:55 2022 +0100 crypto: x86/poly1305 - Fixup SLS Due to being a perl generated asm file, it got missed by the mass convertion script. arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_init_x86_64()+0x3a: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_blocks_x86_64()+0xf2: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_emit_x86_64()+0x37: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: __poly1305_block()+0x6d: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: __poly1305_init_avx()+0x1e8: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_blocks_avx()+0x18a: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_blocks_avx()+0xaf8: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_emit_avx()+0x99: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_blocks_avx2()+0x18a: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_blocks_avx2()+0x776: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_blocks_avx512()+0x18a: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_blocks_avx512()+0x796: missing int3 after ret arch/x86/crypto/poly1305-x86_64-cryptogams.o: warning: objtool: poly1305_blocks_avx512()+0x10bd: missing int3 after ret Fixes: f94909ceb1ed ("x86: Prepare asm files for straight-line-speculation") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Herbert Xu arch/x86/crypto/poly1305-x86_64-cryptogams.pl | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) commit 4327d168515fd8b5b92fa1efdf1d219fb6514460 Author: Peter Zijlstra Date: Tue Mar 22 12:48:10 2022 +0100 crypto: x86/chacha20 - Avoid spurious jumps to other functions The chacha_Nblock_xor_avx512vl() functions all have their own, identical, .LdoneN label, however in one particular spot {2,4} jump to the 8 version instead of their own. Resulting in: arch/x86/crypto/chacha-x86_64.o: warning: objtool: chacha_2block_xor_avx512vl() falls through to next function chacha_8block_xor_avx512vl() arch/x86/crypto/chacha-x86_64.o: warning: objtool: chacha_4block_xor_avx512vl() falls through to next function chacha_8block_xor_avx512vl() Make each function consistently use its own done label. Reported-by: Stephen Rothwell Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Martin Willi Signed-off-by: Herbert Xu arch/x86/crypto/chacha-avx512vl-x86_64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e9a36feecee0ee5845f2e0656f50f9942dd0bed3 Author: Zheng Yongjun Date: Thu Mar 17 13:16:13 2022 +0000 crypto: stm32 - fix reference leak in stm32_crc_remove pm_runtime_get_sync() will increment pm usage counter even it failed. Forgetting to call pm_runtime_put_noidle will result in reference leak in stm32_crc_remove, so we should fix it. Signed-off-by: Zheng Yongjun Signed-off-by: Herbert Xu drivers/crypto/stm32/stm32-crc32.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit c8bd296cca3434b13b28b074eaeb78a23284de77 Author: Herbert Xu Date: Thu Mar 17 10:55:13 2022 +1200 crypto: arm/aes-neonbs-cbc - Select generic cbc and aes The algorithm __cbc-aes-neonbs requires a fallback so we need to select the config options for them or otherwise it will fail to register on boot-up. Fixes: 00b99ad2bac2 ("crypto: arm/aes-neonbs - Use generic cbc...") Signed-off-by: Herbert Xu arch/arm/crypto/Kconfig | 2 ++ 1 file changed, 2 insertions(+) commit 34af78c4e616c359ed428d79fe4758a35d2c5473 Merge: 6f2689a76628 e17c6debd4b2 Author: Linus Torvalds Date: Thu Mar 24 19:48:57 2022 -0700 Merge tag 'iommu-updates-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu updates from Joerg Roedel: - IOMMU Core changes: - Removal of aux domain related code as it is basically dead and will be replaced by iommu-fd framework - Split of iommu_ops to carry domain-specific call-backs separatly - Cleanup to remove useless ops->capable implementations - Improve 32-bit free space estimate in iova allocator - Intel VT-d updates: - Various cleanups of the driver - Support for ATS of SoC-integrated devices listed in ACPI/SATC table - ARM SMMU updates: - Fix SMMUv3 soft lockup during continuous stream of events - Fix error path for Qualcomm SMMU probe() - Rework SMMU IRQ setup to prepare the ground for PMU support - Minor cleanups and refactoring - AMD IOMMU driver: - Some minor cleanups and error-handling fixes - Rockchip IOMMU driver: - Use standard driver registration - MSM IOMMU driver: - Minor cleanup and change to standard driver registration - Mediatek IOMMU driver: - Fixes for IOTLB flushing logic * tag 'iommu-updates-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (47 commits) iommu/amd: Improve amd_iommu_v2_exit() iommu/amd: Remove unused struct fault.devid iommu/amd: Clean up function declarations iommu/amd: Call memunmap in error path iommu/arm-smmu: Account for PMU interrupts iommu/vt-d: Enable ATS for the devices in SATC table iommu/vt-d: Remove unused function intel_svm_capable() iommu/vt-d: Add missing "__init" for rmrr_sanity_check() iommu/vt-d: Move intel_iommu_ops to header file iommu/vt-d: Fix indentation of goto labels iommu/vt-d: Remove unnecessary prototypes iommu/vt-d: Remove unnecessary includes iommu/vt-d: Remove DEFER_DEVICE_DOMAIN_INFO iommu/vt-d: Remove domain and devinfo mempool iommu/vt-d: Remove iova_cache_get/put() iommu/vt-d: Remove finding domain in dmar_insert_one_dev_info() iommu/vt-d: Remove intel_iommu::domains iommu/mediatek: Always tlb_flush_all when each PM resume iommu/mediatek: Add tlb_lock in tlb_flush_all iommu/mediatek: Remove the power status checking in tlb flush all ... commit 6f2689a7662809ff39f2b24e452d11569c21ea2f Merge: b1f8ccdaae03 66daf3e6b993 Author: Linus Torvalds Date: Thu Mar 24 19:37:53 2022 -0700 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "This series consists of the usual driver updates (qla2xxx, pm8001, libsas, smartpqi, scsi_debug, lpfc, iscsi, mpi3mr) plus minor updates and bug fixes. The high blast radius core update is the removal of write same, which affects block and several non-SCSI devices. The other big change, which is more local, is the removal of the SCSI pointer" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (281 commits) scsi: scsi_ioctl: Drop needless assignment in sg_io() scsi: bsg: Drop needless assignment in scsi_bsg_sg_io_fn() scsi: lpfc: Copyright updates for 14.2.0.0 patches scsi: lpfc: Update lpfc version to 14.2.0.0 scsi: lpfc: SLI path split: Refactor BSG paths scsi: lpfc: SLI path split: Refactor Abort paths scsi: lpfc: SLI path split: Refactor SCSI paths scsi: lpfc: SLI path split: Refactor CT paths scsi: lpfc: SLI path split: Refactor misc ELS paths scsi: lpfc: SLI path split: Refactor VMID paths scsi: lpfc: SLI path split: Refactor FDISC paths scsi: lpfc: SLI path split: Refactor LS_RJT paths scsi: lpfc: SLI path split: Refactor LS_ACC paths scsi: lpfc: SLI path split: Refactor the RSCN/SCR/RDF/EDC/FARPR paths scsi: lpfc: SLI path split: Refactor PLOGI/PRLI/ADISC/LOGO paths scsi: lpfc: SLI path split: Refactor base ELS paths and the FLOGI path scsi: lpfc: SLI path split: Introduce lpfc_prep_wqe scsi: lpfc: SLI path split: Refactor fast and slow paths to native SLI4 scsi: lpfc: SLI path split: Refactor lpfc_iocbq scsi: lpfc: Use kcalloc() ... commit ec8b55780508044b19a6084d2a6a9bd8b96f1b0a Author: Krzysztof Kozlowski Date: Wed Mar 16 14:08:58 2022 +0100 dt-bindings: clock: drop useless consumer example Consumer examples in the bindings of resource providers are trivial, useless and duplication of code. Remove the example code for consumer Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220316130858.93455-2-krzysztof.kozlowski@canonical.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd .../devicetree/bindings/clock/bitmain,bm1880-clk.yaml | 12 ------------ Documentation/devicetree/bindings/clock/idt,versaclock5.yaml | 7 ------- Documentation/devicetree/bindings/clock/imx1-clock.yaml | 9 --------- Documentation/devicetree/bindings/clock/imx21-clock.yaml | 9 --------- Documentation/devicetree/bindings/clock/imx23-clock.yaml | 9 --------- Documentation/devicetree/bindings/clock/imx25-clock.yaml | 8 -------- Documentation/devicetree/bindings/clock/imx27-clock.yaml | 9 --------- Documentation/devicetree/bindings/clock/imx28-clock.yaml | 9 --------- Documentation/devicetree/bindings/clock/imx31-clock.yaml | 8 -------- Documentation/devicetree/bindings/clock/imx35-clock.yaml | 8 -------- .../devicetree/bindings/clock/imx7ulp-pcc-clock.yaml | 11 ----------- .../devicetree/bindings/clock/imx7ulp-scg-clock.yaml | 11 ----------- Documentation/devicetree/bindings/clock/imx8qxp-lpcg.yaml | 11 ----------- Documentation/devicetree/bindings/clock/imxrt1050-clock.yaml | 8 -------- .../devicetree/bindings/clock/nvidia,tegra124-car.yaml | 7 ------- .../devicetree/bindings/clock/nvidia,tegra20-car.yaml | 7 ------- 16 files changed, 143 deletions(-) commit b1f8ccdaae0310332d16f65bf0f622f9d4ae2391 Merge: 2dacc1e57b95 4d7bca13dd9a Author: Linus Torvalds Date: Thu Mar 24 19:25:24 2022 -0700 Merge tag 'for-5.18/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - Significant refactoring and fixing of how DM core does bio-based IO accounting with focus on fixing wildly inaccurate IO stats for dm-crypt (and other DM targets that defer bio submission in their own workqueues). End result is proper IO accounting, made possible by targets being updated to use the new dm_submit_bio_remap() interface. - Add hipri bio polling support (REQ_POLLED) to bio-based DM. - Reduce dm_io and dm_target_io structs so that a single dm_io (which contains dm_target_io and first clone bio) weighs in at 256 bytes. For reference the bio struct is 128 bytes. - Various other small cleanups, fixes or improvements in DM core and targets. - Update MAINTAINERS with my kernel.org email address to allow distinction between my "upstream" and "Red" Hats. * tag 'for-5.18/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: (46 commits) dm: consolidate spinlocks in dm_io struct dm: reduce size of dm_io and dm_target_io structs dm: switch dm_target_io booleans over to proper flags dm: switch dm_io booleans over to proper flags dm: update email address in MAINTAINERS dm: return void from __send_empty_flush dm: factor out dm_io_complete dm cache: use dm_submit_bio_remap dm: simplify dm_sumbit_bio_remap interface dm thin: use dm_submit_bio_remap dm: add WARN_ON_ONCE to dm_submit_bio_remap dm: support bio polling block: add ->poll_bio to block_device_operations dm mpath: use DMINFO instead of printk with KERN_INFO dm: stop using bdevname dm-zoned: remove the ->name field in struct dmz_dev dm: remove unnecessary local variables in __bind dm: requeue IO if mapping table not yet available dm io: remove stale comment block for dm_io() dm thin metadata: remove unused dm_thin_remove_block and __remove ... commit 3b1db05cee0738166cdd0f335ea93e8b0ecf6e08 Author: Rob Herring Date: Tue Mar 1 13:03:59 2022 -0600 dt-bindings: clock: renesas: Make example 'clocks' parsable 'clocks' in the example is not parsable with the 0 phandle value because the number of #clock-cells is unknown in the previous entry. Solve this by adding the clock provider node. Only 'cpg_clocks' is needed as the examples are built with fixups which can be used to identify phandles. This is in preparation to support schema validation on .dtb files. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220301190400.1644150-1-robh@kernel.org Acked-by: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Stephen Boyd .../devicetree/bindings/clock/renesas,cpg-div6-clock.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 2dacc1e57b95ebc42ddcbfc26cd74700b341f1df Merge: 85c7000fda00 87e0eacb176f Author: Linus Torvalds Date: Thu Mar 24 19:17:39 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: - Minor bug fixes in mlx5, mthca, pvrdma, rtrs, mlx4, hfi1, hns - Minor cleanups: coding style, useless includes and documentation - Reorganize how multicast processing works in rxe - Replace a red/black tree with xarray in rxe which improves performance - DSCP support and HW address handle re-use in irdma - Simplify the mailbox command handling in hns - Simplify iser now that FMR is eliminated * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (93 commits) RDMA/nldev: Prevent underflow in nldev_stat_set_counter_dynamic_doit() IB/iser: Fix error flow in case of registration failure IB/iser: Generalize map/unmap dma tasks IB/iser: Use iser_fr_desc as registration context IB/iser: Remove iser_reg_data_sg helper function RDMA/rxe: Use standard names for ref counting RDMA/rxe: Replace red-black trees by xarrays RDMA/rxe: Shorten pool names in rxe_pool.c RDMA/rxe: Move max_elem into rxe_type_info RDMA/rxe: Replace obj by elem in declaration RDMA/rxe: Delete _locked() APIs for pool objects RDMA/rxe: Reverse the sense of RXE_POOL_NO_ALLOC RDMA/rxe: Replace mr by rkey in responder resources RDMA/rxe: Fix ref error in rxe_av.c RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT RDMA/irdma: Add support for address handle re-use RDMA/qib: Fix typos in comments RDMA/mlx5: Fix memory leak in error flow for subscribe event routine Revert "RDMA/core: Fix ib_qp_usecnt_dec() called when error" RDMA/rxe: Remove useless argument for update_state() ... commit 25fd2d41b505d0640bdfe67aa77c549de2d3c18a Author: Kees Cook Date: Thu Mar 24 18:14:18 2022 -0700 selftests: kselftest framework: provide "finished" helper Instead of having each time that wants to use ksft_exit() have to figure out the internals of kselftest.h, add the helper ksft_finished() that makes sure the passes, xfails, and skips are equal to the test plan count. Link: https://lkml.kernel.org/r/20220201013717.2464392-1-keescook@chromium.org Signed-off-by: Kees Cook Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/kselftest.h | 10 ++++++++++ tools/testing/selftests/vm/memfd_secret.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) commit 9457056ac426e5ed0671356509c8dcce69f8dee0 Author: Johannes Weiner Date: Thu Mar 24 18:14:12 2022 -0700 mm: madvise: MADV_DONTNEED_LOCKED MADV_DONTNEED historically rejects mlocked ranges, but with MLOCK_ONFAULT and MCL_ONFAULT allowing to mlock without populating, there are valid use cases for depopulating locked ranges as well. Users mlock memory to protect secrets. There are allocators for secure buffers that want in-use memory generally mlocked, but cleared and invalidated memory to give up the physical pages. This could be done with explicit munlock -> mlock calls on free -> alloc of course, but that adds two unnecessary syscalls, heavy mmap_sem write locks, vma splits and re-merges - only to get rid of the backing pages. Users also mlockall(MCL_ONFAULT) to suppress sustained paging, but are okay with on-demand initial population. It seems valid to selectively free some memory during the lifetime of such a process, without having to mess with its overall policy. Why add a separate flag? Isn't this a pretty niche usecase? - MADV_DONTNEED has been bailing on locked vmas forever. It's at least conceivable that someone, somewhere is relying on mlock to protect data from perhaps broader invalidation calls. Changing this behavior now could lead to quiet data corruption. - It also clarifies expectations around MADV_FREE and maybe MADV_REMOVE. It avoids the situation where one quietly behaves different than the others. MADV_FREE_LOCKED can be added later. - The combination of mlock() and madvise() in the first place is probably niche. But where it happens, I'd say that dropping pages from a locked region once they don't contain secrets or won't page anymore is much saner than relying on mlock to protect memory from speculative or errant invalidation calls. It's just that we can't change the default behavior because of the two previous points. Given that, an explicit new flag seems to make the most sense. [hannes@cmpxchg.org: fix mips build] Link: https://lkml.kernel.org/r/20220304171912.305060-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Acked-by: Michal Hocko Reviewed-by: Mike Kravetz Reviewed-by: Shakeel Butt Acked-by: Vlastimil Babka Cc: Nadav Amit Cc: David Hildenbrand Cc: Dr. David Alan Gilbert Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/alpha/include/uapi/asm/mman.h | 2 ++ arch/mips/include/uapi/asm/mman.h | 2 ++ arch/parisc/include/uapi/asm/mman.h | 2 ++ arch/xtensa/include/uapi/asm/mman.h | 2 ++ include/uapi/asm-generic/mman-common.h | 2 ++ mm/madvise.c | 24 ++++++++++++++---------- 6 files changed, 24 insertions(+), 10 deletions(-) commit 6c8e2a256915a223f6289f651d6b926cd7135c9e Author: Mauricio Faria de Oliveira Date: Thu Mar 24 18:14:09 2022 -0700 mm: fix race between MADV_FREE reclaim and blkdev direct IO read Problem: ======= Userspace might read the zero-page instead of actual data from a direct IO read on a block device if the buffers have been called madvise(MADV_FREE) on earlier (this is discussed below) due to a race between page reclaim on MADV_FREE and blkdev direct IO read. - Race condition: ============== During page reclaim, the MADV_FREE page check in try_to_unmap_one() checks if the page is not dirty, then discards its rmap PTE(s) (vs. remap back if the page is dirty). However, after try_to_unmap_one() returns to shrink_page_list(), it might keep the page _anyway_ if page_ref_freeze() fails (it expects exactly _one_ page reference, from the isolation for page reclaim). Well, blkdev_direct_IO() gets references for all pages, and on READ operations it only sets them dirty _later_. So, if MADV_FREE'd pages (i.e., not dirty) are used as buffers for direct IO read from block devices, and page reclaim happens during __blkdev_direct_IO[_simple]() exactly AFTER bio_iov_iter_get_pages() returns, but BEFORE the pages are set dirty, the situation happens. The direct IO read eventually completes. Now, when userspace reads the buffers, the PTE is no longer there and the page fault handler do_anonymous_page() services that with the zero-page, NOT the data! A synthetic reproducer is provided. - Page faults: =========== If page reclaim happens BEFORE bio_iov_iter_get_pages() the issue doesn't happen, because that faults-in all pages as writeable, so do_anonymous_page() sets up a new page/rmap/PTE, and that is used by direct IO. The userspace reads don't fault as the PTE is there (thus zero-page is not used/setup). But if page reclaim happens AFTER it / BEFORE setting pages dirty, the PTE is no longer there; the subsequent page faults can't help: The data-read from the block device probably won't generate faults due to DMA (no MMU) but even in the case it wouldn't use DMA, that happens on different virtual addresses (not user-mapped addresses) because `struct bio_vec` stores `struct page` to figure addresses out (which are different from user-mapped addresses) for the read. Thus userspace reads (to user-mapped addresses) still fault, then do_anonymous_page() gets another `struct page` that would address/ map to other memory than the `struct page` used by `struct bio_vec` for the read. (The original `struct page` is not available, since it wasn't freed, as page_ref_freeze() failed due to more page refs. And even if it were available, its data cannot be trusted anymore.) Solution: ======== One solution is to check for the expected page reference count in try_to_unmap_one(). There should be one reference from the isolation (that is also checked in shrink_page_list() with page_ref_freeze()) plus one or more references from page mapping(s) (put in discard: label). Further references mean that rmap/PTE cannot be unmapped/nuked. (Note: there might be more than one reference from mapping due to fork()/clone() without CLONE_VM, which use the same `struct page` for references, until the copy-on-write page gets copied.) So, additional page references (e.g., from direct IO read) now prevent the rmap/PTE from being unmapped/dropped; similarly to the page is not freed per shrink_page_list()/page_ref_freeze()). - Races and Barriers: ================== The new check in try_to_unmap_one() should be safe in races with bio_iov_iter_get_pages() in get_user_pages() fast and slow paths, as it's done under the PTE lock. The fast path doesn't take the lock, but it checks if the PTE has changed and if so, it drops the reference and leaves the page for the slow path (which does take that lock). The fast path requires synchronization w/ full memory barrier: it writes the page reference count first then it reads the PTE later, while try_to_unmap() writes PTE first then it reads page refcount. And a second barrier is needed, as the page dirty flag should not be read before the page reference count (as in __remove_mapping()). (This can be a load memory barrier only; no writes are involved.) Call stack/comments: - try_to_unmap_one() - page_vma_mapped_walk() - map_pte() # see pte_offset_map_lock(): pte_offset_map() spin_lock() - ptep_get_and_clear() # write PTE - smp_mb() # (new barrier) GUP fast path - page_ref_count() # (new check) read refcount - page_vma_mapped_walk_done() # see pte_unmap_unlock(): pte_unmap() spin_unlock() - bio_iov_iter_get_pages() - __bio_iov_iter_get_pages() - iov_iter_get_pages() - get_user_pages_fast() - internal_get_user_pages_fast() # fast path - lockless_pages_from_mm() - gup_{pgd,p4d,pud,pmd,pte}_range() ptep = pte_offset_map() # not _lock() pte = ptep_get_lockless(ptep) page = pte_page(pte) try_grab_compound_head(page) # inc refcount # (RMW/barrier # on success) if (pte_val(pte) != pte_val(*ptep)) # read PTE put_compound_head(page) # dec refcount # go slow path # slow path - __gup_longterm_unlocked() - get_user_pages_unlocked() - __get_user_pages_locked() - __get_user_pages() - follow_{page,p4d,pud,pmd}_mask() - follow_page_pte() ptep = pte_offset_map_lock() pte = *ptep page = vm_normal_page(pte) try_grab_page(page) # inc refcount pte_unmap_unlock() - Huge Pages: ========== Regarding transparent hugepages, that logic shouldn't change, as MADV_FREE (aka lazyfree) pages are PageAnon() && !PageSwapBacked() (madvise_free_pte_range() -> mark_page_lazyfree() -> lru_lazyfree_fn()) thus should reach shrink_page_list() -> split_huge_page_to_list() before try_to_unmap[_one](), so it deals with normal pages only. (And in case unlikely/TTU_SPLIT_HUGE_PMD/split_huge_pmd_address() happens, which should not or be rare, the page refcount should be greater than mapcount: the head page is referenced by tail pages. That also prevents checking the head `page` then incorrectly call page_remove_rmap(subpage) for a tail page, that isn't even in the shrink_page_list()'s page_list (an effect of split huge pmd/pmvw), as it might happen today in this unlikely scenario.) MADV_FREE'd buffers: =================== So, back to the "if MADV_FREE pages are used as buffers" note. The case is arguable, and subject to multiple interpretations. The madvise(2) manual page on the MADV_FREE advice value says: 1) 'After a successful MADV_FREE ... data will be lost when the kernel frees the pages.' 2) 'the free operation will be canceled if the caller writes into the page' / 'subsequent writes ... will succeed and then [the] kernel cannot free those dirtied pages' 3) 'If there is no subsequent write, the kernel can free the pages at any time.' Thoughts, questions, considerations... respectively: 1) Since the kernel didn't actually free the page (page_ref_freeze() failed), should the data not have been lost? (on userspace read.) 2) Should writes performed by the direct IO read be able to cancel the free operation? - Should the direct IO read be considered as 'the caller' too, as it's been requested by 'the caller'? - Should the bio technique to dirty pages on return to userspace (bio_check_pages_dirty() is called/used by __blkdev_direct_IO()) be considered in another/special way here? 3) Should an upcoming write from a previously requested direct IO read be considered as a subsequent write, so the kernel should not free the pages? (as it's known at the time of page reclaim.) And lastly: Technically, the last point would seem a reasonable consideration and balance, as the madvise(2) manual page apparently (and fairly) seem to assume that 'writes' are memory access from the userspace process (not explicitly considering writes from the kernel or its corner cases; again, fairly).. plus the kernel fix implementation for the corner case of the largely 'non-atomic write' encompassed by a direct IO read operation, is relatively simple; and it helps. Reproducer: ========== @ test.c (simplified, but works) #define _GNU_SOURCE #include #include #include #include int main() { int fd, i; char *buf; fd = open(DEV, O_RDONLY | O_DIRECT); buf = mmap(NULL, BUF_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); for (i = 0; i < BUF_SIZE; i += PAGE_SIZE) buf[i] = 1; // init to non-zero madvise(buf, BUF_SIZE, MADV_FREE); read(fd, buf, BUF_SIZE); for (i = 0; i < BUF_SIZE; i += PAGE_SIZE) printf("%p: 0x%x\n", &buf[i], buf[i]); return 0; } @ block/fops.c (formerly fs/block_dev.c) +#include ... ... __blkdev_direct_IO[_simple](...) { ... + if (!strcmp(current->comm, "good")) + shrink_all_memory(ULONG_MAX); + ret = bio_iov_iter_get_pages(...); + + if (!strcmp(current->comm, "bad")) + shrink_all_memory(ULONG_MAX); ... } @ shell # NUM_PAGES=4 # PAGE_SIZE=$(getconf PAGE_SIZE) # yes | dd of=test.img bs=${PAGE_SIZE} count=${NUM_PAGES} # DEV=$(losetup -f --show test.img) # gcc -DDEV=\"$DEV\" \ -DBUF_SIZE=$((PAGE_SIZE * NUM_PAGES)) \ -DPAGE_SIZE=${PAGE_SIZE} \ test.c -o test # od -tx1 $DEV 0000000 79 0a 79 0a 79 0a 79 0a 79 0a 79 0a 79 0a 79 0a * 0040000 # mv test good # ./good 0x7f7c10418000: 0x79 0x7f7c10419000: 0x79 0x7f7c1041a000: 0x79 0x7f7c1041b000: 0x79 # mv good bad # ./bad 0x7fa1b8050000: 0x0 0x7fa1b8051000: 0x0 0x7fa1b8052000: 0x0 0x7fa1b8053000: 0x0 Note: the issue is consistent on v5.17-rc3, but it's intermittent with the support of MADV_FREE on v4.5 (60%-70% error; needs swap). [wrap do_direct_IO() in do_blockdev_direct_IO() @ fs/direct-io.c]. - v5.17-rc3: # for i in {1..1000}; do ./good; done \ | cut -d: -f2 | sort | uniq -c 4000 0x79 # mv good bad # for i in {1..1000}; do ./bad; done \ | cut -d: -f2 | sort | uniq -c 4000 0x0 # free | grep Swap Swap: 0 0 0 - v4.5: # for i in {1..1000}; do ./good; done \ | cut -d: -f2 | sort | uniq -c 4000 0x79 # mv good bad # for i in {1..1000}; do ./bad; done \ | cut -d: -f2 | sort | uniq -c 2702 0x0 1298 0x79 # swapoff -av swapoff /swap # for i in {1..1000}; do ./bad; done \ | cut -d: -f2 | sort | uniq -c 4000 0x79 Ceph/TCMalloc: ============= For documentation purposes, the use case driving the analysis/fix is Ceph on Ubuntu 18.04, as the TCMalloc library there still uses MADV_FREE to release unused memory to the system from the mmap'ed page heap (might be committed back/used again; it's not munmap'ed.) - PageHeap::DecommitSpan() -> TCMalloc_SystemRelease() -> madvise() - PageHeap::CommitSpan() -> TCMalloc_SystemCommit() -> do nothing. Note: TCMalloc switched back to MADV_DONTNEED a few commits after the release in Ubuntu 18.04 (google-perftools/gperftools 2.5), so the issue just 'disappeared' on Ceph on later Ubuntu releases but is still present in the kernel, and can be hit by other use cases. The observed issue seems to be the old Ceph bug #22464 [1], where checksum mismatches are observed (and instrumentation with buffer dumps shows zero-pages read from mmap'ed/MADV_FREE'd page ranges). The issue in Ceph was reasonably deemed a kernel bug (comment #50) and mostly worked around with a retry mechanism, but other parts of Ceph could still hit that (rocksdb). Anyway, it's less likely to be hit again as TCMalloc switched out of MADV_FREE by default. (Some kernel versions/reports from the Ceph bug, and relation with the MADV_FREE introduction/changes; TCMalloc versions not checked.) - 4.4 good - 4.5 (madv_free: introduction) - 4.9 bad - 4.10 good? maybe a swapless system - 4.12 (madv_free: no longer free instantly on swapless systems) - 4.13 bad [1] https://tracker.ceph.com/issues/22464 Thanks: ====== Several people contributed to analysis/discussions/tests/reproducers in the first stages when drilling down on ceph/tcmalloc/linux kernel: - Dan Hill - Dan Streetman - Dongdong Tao - Gavin Guo - Gerald Yang - Heitor Alves de Siqueira - Ioanna Alifieraki - Jay Vosburgh - Matthew Ruffell - Ponnuvel Palaniyappan Reviews, suggestions, corrections, comments: - Minchan Kim - Yu Zhao - Huang, Ying - John Hubbard - Christoph Hellwig [mfo@canonical.com: v4] Link: https://lkml.kernel.org/r/20220209202659.183418-1-mfo@canonical.comLink: https://lkml.kernel.org/r/20220131230255.789059-1-mfo@canonical.com Fixes: 802a3a92ad7a ("mm: reclaim MADV_FREE pages") Signed-off-by: Mauricio Faria de Oliveira Reviewed-by: "Huang, Ying" Cc: Minchan Kim Cc: Yu Zhao Cc: Yang Shi Cc: Miaohe Lin Cc: Dan Hill Cc: Dan Streetman Cc: Dongdong Tao Cc: Gavin Guo Cc: Gerald Yang Cc: Heitor Alves de Siqueira Cc: Ioanna Alifieraki Cc: Jay Vosburgh Cc: Matthew Ruffell Cc: Ponnuvel Palaniyappan Cc: Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/rmap.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) commit 24e988c7fd1ee701ea78fd138ed309e5f5f207b4 Author: Anshuman Khandual Date: Thu Mar 24 18:14:05 2022 -0700 mm: generalize ARCH_HAS_FILTER_PGPROT ARCH_HAS_FILTER_PGPROT config has duplicate definitions on platforms that subscribe it. Instead make it a generic config option which can be selected on applicable platforms when required. Link: https://lkml.kernel.org/r/1643004823-16441-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Acked-by: Catalin Marinas Cc: Will Deacon Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/x86/Kconfig | 3 --- mm/Kconfig | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) commit 2c8659951654fc14c0351e33ca7604cdf670341e Author: Hugh Dickins Date: Thu Mar 24 18:14:02 2022 -0700 mm: unmap_mapping_range_tree() with i_mmap_rwsem shared Revert 48ec833b7851 ("Revert "mm/memory.c: share the i_mmap_rwsem"") to reinstate c8475d144abb ("mm/memory.c: share the i_mmap_rwsem"): the unmap_mapping_range family of functions do the unmapping of user pages (ultimately via zap_page_range_single) without modifying the interval tree itself, and unmapping races are necessarily guarded by page table lock, thus the i_mmap_rwsem should be shared in unmap_mapping_pages() and unmap_mapping_folio(). Commit 48ec833b7851 was intended as a short-term measure, allowing the other shared lock changes into 3.19 final, before investigating three trinity crashes, one of which had been bisected to commit c8475d144ab: [1] https://lkml.org/lkml/2014/11/14/342 https://lore.kernel.org/lkml/5466142C.60100@oracle.com/ [2] https://lkml.org/lkml/2014/12/22/213 https://lore.kernel.org/lkml/549832E2.8060609@oracle.com/ [3] https://lkml.org/lkml/2014/12/9/741 https://lore.kernel.org/lkml/5487ACC5.1010002@oracle.com/ Two of those were Bad page states: free_pages_prepare() found PG_mlocked still set - almost certain to have been fixed by 4.4 commit b87537d9e2fe ("mm: rmap use pte lock not mmap_sem to set PageMlocked"). The NULL deref on rwsem in [2]: unclear, only happened once, not bisected to c8475d144ab. No change to the i_mmap_lock_write() around __unmap_hugepage_range_final() in unmap_single_vma(): IIRC that's a special usage, helping to serialize hugetlbfs page table sharing, not to be dabbled with lightly. No change to other uses of i_mmap_lock_write() by hugetlbfs. I am not aware of any significant gains from the concurrency allowed by this commit: it is submitted more to resolve an ancient misunderstanding. Link: https://lkml.kernel.org/r/e4a5e356-6c87-47b2-3ce8-c2a95ae84e20@google.com Signed-off-by: Hugh Dickins Cc: "Kirill A. Shutemov" Cc: Davidlohr Bueso Cc: Sasha Levin Cc: Mel Gorman Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 566d3362885aab04d6b0f885f12db3176ca3a032 Author: Hugh Dickins Date: Thu Mar 24 18:13:59 2022 -0700 mm: warn on deleting redirtied only if accounted filemap_unaccount_folio() has a WARN_ON_ONCE(folio_test_dirty(folio)). It is good to warn of late dirtying on a persistent filesystem, but late dirtying on tmpfs can only lose data which is expected to be thrown away; and it's a pity if that warning comes ONCE on tmpfs, then hides others which really matter. Make it conditional on mapping_cap_writeback(). Cleanup: then folio_account_cleaned() no longer needs to check that for itself, and so no longer needs to know the mapping. Link: https://lkml.kernel.org/r/b5a1106c-7226-a5c6-ad41-ad4832cae1f@google.com Signed-off-by: Hugh Dickins Cc: Matthew Wilcox Cc: Jan Kara Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/pagemap.h | 3 +-- mm/filemap.c | 14 +++++++++----- mm/page-writeback.c | 18 ++++++++---------- 3 files changed, 18 insertions(+), 17 deletions(-) commit 7f7609175ff2339a2cffa48ba2474ef928d7eafd Author: David Hildenbrand Date: Thu Mar 24 18:13:56 2022 -0700 mm/huge_memory: remove stale locking logic from __split_huge_pmd() Let's remove the stale logic that was required for reuse_swap_page(). [akpm@linux-foundation.org: simplification, per Yang Shi] Link: https://lkml.kernel.org/r/20220131162940.210846-10-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oleg Nesterov Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/huge_memory.c | 40 ++++------------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) commit 55c62fa7c53368a9011cd1276c001a1469078c6a Author: David Hildenbrand Date: Thu Mar 24 18:13:53 2022 -0700 mm/huge_memory: remove stale page_trans_huge_mapcount() All users are gone, let's remove it. Link: https://lkml.kernel.org/r/20220131162940.210846-9-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oleg Nesterov Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/mm.h | 5 ----- mm/huge_memory.c | 48 ------------------------------------------------ 2 files changed, 53 deletions(-) commit 03104c2c5db8918030788e607e4af980b2f42bb3 Author: David Hildenbrand Date: Thu Mar 24 18:13:50 2022 -0700 mm/swapfile: remove stale reuse_swap_page() All users are gone, let's remove it. We'll let SWP_STABLE_WRITES stick around for now, as it might come in handy in the near future. Link: https://lkml.kernel.org/r/20220131162940.210846-8-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oleg Nesterov Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/swap.h | 4 -- mm/swapfile.c | 104 --------------------------------------------------- 2 files changed, 108 deletions(-) commit 363106c4cefe7d08ca67cc77f3d38d4213190f31 Author: David Hildenbrand Date: Thu Mar 24 18:13:46 2022 -0700 mm/khugepaged: remove reuse_swap_page() usage reuse_swap_page() currently indicates if we can write to an anon page without COW. A COW is required if the page is shared by multiple processes (either already mapped or via swap entries) or if there is concurrent writeback that cannot tolerate concurrent page modifications. However, in the context of khugepaged we're not actually going to write to a read-only mapped page, we'll copy the page content to our newly allocated THP and map that THP writable. All we have to make sure is that the read-only mapped page we're about to copy won't get reused by another process sharing the page, otherwise, page content would get modified. But that is already guaranteed via multiple mechanisms (e.g., holding a reference, holding the page lock, removing the rmap after copying the page). The swapcache handling was introduced in commit 10359213d05a ("mm: incorporate read-only pages into transparent huge pages") and it sounds like it merely wanted to mimic what do_swap_page() would do when trying to map a page obtained via the swapcache writable. As that logic is unnecessary, let's just remove it, removing the last user of reuse_swap_page(). Link: https://lkml.kernel.org/r/20220131162940.210846-7-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Yang Shi Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oleg Nesterov Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/trace/events/huge_memory.h | 1 - mm/khugepaged.c | 11 ----------- 2 files changed, 12 deletions(-) commit 3bff7e3f1f16dc7305d12905c51c278b54970f0e Author: David Hildenbrand Date: Thu Mar 24 18:13:43 2022 -0700 mm/huge_memory: streamline COW logic in do_huge_pmd_wp_page() We currently have a different COW logic for anon THP than we have for ordinary anon pages in do_wp_page(): the effect is that the issue reported in CVE-2020-29374 is currently still possible for anon THP: an unintended information leak from the parent to the child. Let's apply the same logic (page_count() == 1), with similar optimizations to remove additional references first as we really want to avoid PTE-mapping the THP and copying individual pages best we can. If we end up with a page that has page_count() != 1, we'll have to PTE-map the THP and fallback to do_wp_page(), which will always copy the page. Note that KSM does not apply to THP. I. Interaction with the swapcache and writeback While a THP is in the swapcache, the swapcache holds one reference on each subpage of the THP. So with PageSwapCache() set, we expect as many additional references as we have subpages. If we manage to remove the THP from the swapcache, all these references will be gone. Usually, a THP is not split when entered into the swapcache and stays a compound page. However, try_to_unmap() will PTE-map the THP and use PTE swap entries. There are no PMD swap entries for that purpose, consequently, we always only swapin subpages into PTEs. Removing a page from the swapcache can fail either when there are remaining swap entries (in which case COW is the right thing to do) or if the page is currently under writeback. Having a locked, R/O PMD-mapped THP that is in the swapcache seems to be possible only in corner cases, for example, if try_to_unmap() failed after adding the page to the swapcache. However, it's comparatively easy to handle. As we have to fully unmap a THP before starting writeback, and swapin is always done on the PTE level, we shouldn't find a R/O PMD-mapped THP in the swapcache that is under writeback. This should at least leave writeback out of the picture. II. Interaction with GUP references Having a R/O PMD-mapped THP with GUP references (i.e., R/O references) will result in PTE-mapping the THP on a write fault. Similar to ordinary anon pages, do_wp_page() will have to copy sub-pages and result in a disconnect between the GUP references and the pages actually mapped into the page tables. To improve the situation in the future, we'll need additional handling to mark anonymous pages as definitely exclusive to a single process, only allow GUP pins on exclusive anon pages, and disallow sharing of exclusive anon pages with GUP pins e.g., during fork(). III. Interaction with references from LRU pagevecs There is no need to try draining the (local) LRU pagevecs in case we would stumble over a !PageLRU() page: folio_add_lru() and friends will always flush the affected pagevec after adding a compound page to it immediately -- pagevec_add_and_need_flush() always returns "true" for them. Note that the LRU pagevecs will hold a reference on the compound page for a very short time, between adding the page to the pagevec and draining it immediately afterwards. IV. Interaction with speculative/temporary references Similar to ordinary anon pages, other speculative/temporary references on the THP, for example, from the pagecache or page migration code, will disallow exclusive reuse of the page. We'll have to PTE-map the THP. Link: https://lkml.kernel.org/r/20220131162940.210846-6-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oleg Nesterov Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/huge_memory.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) commit c145e0b47c77ebeefdfd73dbb344577b2fc9b065 Author: David Hildenbrand Date: Thu Mar 24 18:13:40 2022 -0700 mm: streamline COW logic in do_swap_page() Currently we have a different COW logic when: * triggering a read-fault to swapin first and then trigger a write-fault -> do_swap_page() + do_wp_page() * triggering a write-fault to swapin -> do_swap_page() + do_wp_page() only if we fail reuse in do_swap_page() The COW logic in do_swap_page() is different than our reuse logic in do_wp_page(). The COW logic in do_wp_page() -- page_count() == 1 -- makes currently sure that we certainly don't have a remaining reference, e.g., via GUP, on the target page we want to reuse: if there is any unexpected reference, we have to copy to avoid information leaks. As do_swap_page() behaves differently, in environments with swap enabled we can currently have an unintended information leak from the parent to the child, similar as known from CVE-2020-29374: 1. Parent writes to anonymous page -> Page is mapped writable and modified 2. Page is swapped out -> Page is unmapped and replaced by swap entry 3. fork() -> Swap entries are copied to child 4. Child pins page R/O -> Page is mapped R/O into child 5. Child unmaps page -> Child still holds GUP reference 6. Parent writes to page -> Page is reused in do_swap_page() -> Child can observe changes Exchanging 2. and 3. should have the same effect. Let's apply the same COW logic as in do_wp_page(), conditionally trying to remove the page from the swapcache after freeing the swap entry, however, before actually mapping our page. We can change the order now that we use try_to_free_swap(), which doesn't care about the mapcount, instead of reuse_swap_page(). To handle references from the LRU pagevecs, conditionally drain the local LRU pagevecs when required, however, don't consider the page_count() when deciding whether to drain to keep it simple for now. Link: https://lkml.kernel.org/r/20220131162940.210846-5-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oleg Nesterov Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 55 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 12 deletions(-) commit 84d60fdd3733fb86c126f2adfd0361fdc44087c3 Author: David Hildenbrand Date: Thu Mar 24 18:13:37 2022 -0700 mm: slightly clarify KSM logic in do_swap_page() Let's make it clearer that KSM might only have to copy a page in case we have a page in the swapcache, not if we allocated a fresh page and bypassed the swapcache. While at it, add a comment why this is usually necessary and merge the two swapcache conditions. [akpm@linux-foundation.org: fix comment, per David] Link: https://lkml.kernel.org/r/20220131162940.210846-4-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oleg Nesterov Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) commit d4c470970d45c863fafc757521a82be2f80b1232 Author: David Hildenbrand Date: Thu Mar 24 18:13:34 2022 -0700 mm: optimize do_wp_page() for fresh pages in local LRU pagevecs For example, if a page just got swapped in via a read fault, the LRU pagevecs might still hold a reference to the page. If we trigger a write fault on such a page, the additional reference from the LRU pagevecs will prohibit reusing the page. Let's conditionally drain the local LRU pagevecs when we stumble over a !PageLRU() page. We cannot easily drain remote LRU pagevecs and it might not be desirable performance-wise. Consequently, this will only avoid copying in some cases. Add a simple "page_count(page) > 3" check first but keep the "page_count(page) > 1 + PageSwapCache(page)" check in place, as we want to minimize cases where we remove a page from the swapcache but won't be able to reuse it, for example, because another process has it mapped R/O, to not affect reclaim. We cannot easily handle the following cases and we will always have to copy: (1) The page is referenced in the LRU pagevecs of other CPUs. We really would have to drain the LRU pagevecs of all CPUs -- most probably copying is much cheaper. (2) The page is already PageLRU() but is getting moved between LRU lists, for example, for activation (e.g., mark_page_accessed()), deactivation (MADV_COLD), or lazyfree (MADV_FREE). We'd have to drain mostly unconditionally, which might be bad performance-wise. Most probably this won't happen too often in practice. Note that there are other reasons why an anon page might temporarily not be PageLRU(): for example, compaction and migration have to isolate LRU pages from the LRU lists first (isolate_lru_page()), moving them to temporary local lists and clearing PageLRU() and holding an additional reference on the page. In that case, we'll always copy. This change seems to be fairly effective with the reproducer [1] shared by Nadav, as long as writeback is done synchronously, for example, using zram. However, with asynchronous writeback, we'll usually fail to free the swapcache because the page is still under writeback: something we cannot easily optimize for, and maybe it's not really relevant in practice. [1] https://lkml.kernel.org/r/0480D692-D9B2-429A-9A88-9BBA1331AC3A@gmail.com Link: https://lkml.kernel.org/r/20220131162940.210846-3-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: Christoph Hellwig Cc: David Rientjes Cc: Don Dutile Cc: Hugh Dickins Cc: Jan Kara Cc: Jann Horn Cc: Jason Gunthorpe Cc: John Hubbard Cc: Kirill A. Shutemov Cc: Liang Zhang Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Mike Kravetz Cc: Mike Rapoport Cc: Nadav Amit Cc: Oleg Nesterov Cc: Peter Xu Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit 53a05ad9f21d858d24f76d12b3e990405f2036d1 Author: David Hildenbrand Date: Thu Mar 24 18:13:30 2022 -0700 mm: optimize do_wp_page() for exclusive pages in the swapcache Patch series "mm: COW fixes part 1: fix the COW security issue for THP and swap", v3. This series attempts to optimize and streamline the COW logic for ordinary anon pages and THP anon pages, fixing two remaining instances of CVE-2020-29374 in do_swap_page() and do_huge_pmd_wp_page(): information can leak from a parent process to a child process via anonymous pages shared during fork(). This issue, including other related COW issues, has been summarized in [2]: "1. Observing Memory Modifications of Private Pages From A Child Process Long story short: process-private memory might not be as private as you think once you fork(): successive modifications of private memory regions in the parent process can still be observed by the child process, for example, by smart use of vmsplice()+munmap(). The core problem is that pinning pages readable in a child process, such as done via the vmsplice system call, can result in a child process observing memory modifications done in the parent process the child is not supposed to observe. [1] contains an excellent summary and [2] contains further details. This issue was assigned CVE-2020-29374 [9]. For this to trigger, it's required to use a fork() without subsequent exec(), for example, as used under Android zygote. Without further details about an application that forks less-privileged child processes, one cannot really say what's actually affected and what's not -- see the details section the end of this mail for a short sshd/openssh analysis. While commit 17839856fd58 ("gup: document and work around "COW can break either way" issue") fixed this issue and resulted in other problems (e.g., ptrace on pmem), commit 09854ba94c6a ("mm: do_wp_page() simplification") re-introduced part of the problem unfortunately. The original reproducer can be modified quite easily to use THP [3] and make the issue appear again on upstream kernels. I modified it to use hugetlb [4] and it triggers as well. The problem is certainly less severe with hugetlb than with THP; it merely highlights that we still have plenty of open holes we should be closing/fixing. Regarding vmsplice(), the only known workaround is to disallow the vmsplice() system call ... or disable THP and hugetlb. But who knows what else is affected (RDMA? O_DIRECT?) to achieve the same goal -- in the end, it's a more generic issue" This security issue was first reported by Jann Horn on 27 May 2020 and it currently affects anonymous pages during swapin, anonymous THP and hugetlb. This series tackles anonymous pages during swapin and anonymous THP: - do_swap_page() for handling COW on PTEs during swapin directly - do_huge_pmd_wp_page() for handling COW on PMD-mapped THP during write faults With this series, we'll apply the same COW logic we have in do_wp_page() to all swappable anon pages: don't reuse (map writable) the page in case there are additional references (page_count() != 1). All users of reuse_swap_page() are remove, and consequently reuse_swap_page() is removed. In general, we're struggling with the following COW-related issues: (1) "missed COW": we miss to copy on write and reuse the page (map it writable) although we must copy because there are pending references from another process to this page. The result is a security issue. (2) "wrong COW": we copy on write although we wouldn't have to and shouldn't: if there are valid GUP references, they will become out of sync with the pages mapped into the page table. We fail to detect that such a page can be reused safely, especially if never more than a single process mapped the page. The result is an intra process memory corruption. (3) "unnecessary COW": we copy on write although we wouldn't have to: performance degradation and temporary increases swap+memory consumption can be the result. While this series fixes (1) for swappable anon pages, it tries to reduce reported cases of (3) first as good and easy as possible to limit the impact when streamlining. The individual patches try to describe in which cases we will run into (3). This series certainly makes (2) worse for THP, because a THP will now get PTE-mapped on write faults if there are additional references, even if there was only ever a single process involved: once PTE-mapped, we'll copy each and every subpage and won't reuse any subpage as long as the underlying compound page wasn't split. I'm working on an approach to fix (2) and improve (3): PageAnonExclusive to mark anon pages that are exclusive to a single process, allow GUP pins only on such exclusive pages, and allow turning exclusive pages shared (clearing PageAnonExclusive) only if there are no GUP pins. Anon pages with PageAnonExclusive set never have to be copied during write faults, but eventually during fork() if they cannot be turned shared. The improved reuse logic in this series will essentially also be the logic to reset PageAnonExclusive. This work will certainly take a while, but I'm planning on sharing details before having code fully ready. #1-#5 can be applied independently of the rest. #6-#9 are mostly only cleanups related to reuse_swap_page(). Notes: * For now, I'll leave hugetlb code untouched: "unnecessary COW" might easily break existing setups because hugetlb pages are a scarce resource and we could just end up having to crash the application when we run out of hugetlb pages. We have to be very careful and the security aspect with hugetlb is most certainly less relevant than for unprivileged anon pages. * Instead of lru_add_drain() we might actually just drain the lru_add list or even just remove the single page of interest from the lru_add list. This would require a new helper function, and could be added if the conditional lru_add_drain() turn out to be a problem. * I extended the test case already included in [1] to also test for the newly found do_swap_page() case. I'll send that out separately once/if this part was merged. [1] https://lkml.kernel.org/r/20211217113049.23850-1-david@redhat.com [2] https://lore.kernel.org/r/3ae33b08-d9ef-f846-56fb-645e3b9b4c66@redhat.com This patch (of 9): Liang Zhang reported [1] that the current COW logic in do_wp_page() is sub-optimal when it comes to swap+read fault+write fault of anonymous pages that have a single user, visible via a performance degradation in the redis benchmark. Something similar was previously reported [2] by Nadav with a simple reproducer. After we put an anon page into the swapcache and unmapped it from a single process, that process might read that page again and refault it read-only. If that process then writes to that page, the process is actually the exclusive user of the page, however, the COW logic in do_co_page() won't be able to reuse it due to the additional reference from the swapcache. Let's optimize for pages that have been added to the swapcache but only have an exclusive user. Try removing the swapcache reference if there is hope that we're the exclusive user. We will fail removing the swapcache reference in two scenarios: (1) There are additional swap entries referencing the page: copying instead of reusing is the right thing to do. (2) The page is under writeback: theoretically we might be able to reuse in some cases, however, we cannot remove the additional reference and will have to copy. Note that we'll only try removing the page from the swapcache when it's highly likely that we'll be the exclusive owner after removing the page from the swapache. As we're about to map that page writable and redirty it, that should not affect reclaim but is rather the right thing to do. Further, we might have additional references from the LRU pagevecs, which will force us to copy instead of being able to reuse. We'll try handling such references for some scenarios next. Concurrent writeback cannot be handled easily and we'll always have to copy. While at it, remove the superfluous page_mapcount() check: it's implicitly covered by the page_count() for ordinary anon pages. [1] https://lkml.kernel.org/r/20220113140318.11117-1-zhangliang5@huawei.com [2] https://lkml.kernel.org/r/0480D692-D9B2-429A-9A88-9BBA1331AC3A@gmail.com Link: https://lkml.kernel.org/r/20220131162940.210846-2-david@redhat.com Signed-off-by: David Hildenbrand Reported-by: Liang Zhang Reported-by: Nadav Amit Reviewed-by: Matthew Wilcox (Oracle) Acked-by: Vlastimil Babka Cc: Hugh Dickins Cc: David Rientjes Cc: Shakeel Butt Cc: John Hubbard Cc: Jason Gunthorpe Cc: Mike Kravetz Cc: Mike Rapoport Cc: Yang Shi Cc: Kirill A. Shutemov Cc: Jann Horn Cc: Michal Hocko Cc: Rik van Riel Cc: Roman Gushchin Cc: Andrea Arcangeli Cc: Peter Xu Cc: Don Dutile Cc: Christoph Hellwig Cc: Oleg Nesterov Cc: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) commit 562beb7235abfebdd8366e0664a5c3d1e597b990 Author: Miaohe Lin Date: Thu Mar 24 18:13:27 2022 -0700 mm/huge_memory: make is_transparent_hugepage() static It's only used inside the huge_memory.c now. Don't export it and make it static. We can thus reduce the size of huge_memory.o a bit. Without this patch: text data bss dec hex filename 32319 2965 4 35288 89d8 mm/huge_memory.o With this patch: text data bss dec hex filename 32042 2957 4 35003 88bb mm/huge_memory.o Link: https://lkml.kernel.org/r/20220302082145.12028-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Reviewed-by: Yang Shi Cc: Matthew Wilcox Cc: William Kucharski Cc: Hugh Dickins Cc: Peter Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/huge_mm.h | 6 ------ mm/huge_memory.c | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) commit 9ae8f2b849f7991cb88ba20c39cb488d0a4f7916 Author: Mike Kravetz Date: Thu Mar 24 18:13:24 2022 -0700 userfaultfd/selftests: enable hugetlb remap and remove event testing With MADV_DONTNEED support added to hugetlb mappings, mremap testing can also be enabled for hugetlb. Modify the tests to use madvise MADV_DONTNEED and MADV_REMOVE instead of fallocate hole puch for releasing hugetlb pages. Link: https://lkml.kernel.org/r/20220215002348.128823-4-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Axel Rasmussen Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Michal Hocko Cc: Mike Rapoport Cc: Mina Almasry Cc: Naoya Horiguchi Cc: Peter Xu Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/run_vmtests.sh | 3 +- tools/testing/selftests/vm/userfaultfd.c | 69 ++++++++++++++++--------------- 2 files changed, 36 insertions(+), 36 deletions(-) commit c4b6cb884011a5063722c15d14789d1ac5aad28a Author: Mike Kravetz Date: Thu Mar 24 18:13:21 2022 -0700 selftests/vm: add hugetlb madvise MADV_DONTNEED MADV_REMOVE test Now that MADV_DONTNEED support for hugetlb is enabled, add corresponding tests. MADV_REMOVE has been enabled for some time, but no tests exist so add them as well. Link: https://lkml.kernel.org/r/20220215002348.128823-3-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Shuah Khan Cc: Andrea Arcangeli Cc: Axel Rasmussen Cc: David Hildenbrand Cc: Michal Hocko Cc: Mike Rapoport Cc: Mina Almasry Cc: Naoya Horiguchi Cc: Peter Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/.gitignore | 1 + tools/testing/selftests/vm/Makefile | 1 + tools/testing/selftests/vm/hugetlb-madvise.c | 410 +++++++++++++++++++++++++++ tools/testing/selftests/vm/run_vmtests.sh | 12 + 4 files changed, 424 insertions(+) commit 90e7e7f5ef3f712da992d505aee2d921797c3f96 Author: Mike Kravetz Date: Thu Mar 24 18:13:18 2022 -0700 mm: enable MADV_DONTNEED for hugetlb mappings Patch series "Add hugetlb MADV_DONTNEED support", v3. Userfaultfd selftests for hugetlb does not perform UFFD_EVENT_REMAP testing. However, mremap support was recently added in commit 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma"). While attempting to enable mremap support in the test, it was discovered that the mremap test indirectly depends on MADV_DONTNEED. madvise does not allow MADV_DONTNEED for hugetlb mappings. However, that is primarily due to the check in can_madv_lru_vma(). By simply removing the check and adding huge page alignment, MADV_DONTNEED can be made to work for hugetlb mappings. Do note that there is no compelling use case for adding this support. This was discussed in the RFC [1]. However, adding support makes sense as it is fairly trivial and brings hugetlb functionality more in line with 'normal' memory. After enabling support, add selftest for MADV_DONTNEED as well as MADV_REMOVE. Then update userfaultfd selftest. If new functionality is accepted, then madvise man page will be updated to indicate hugetlb is supported. It will also be updated to clarify what happens to the passed length argument. This patch (of 3): MADV_DONTNEED is currently disabled for hugetlb mappings. This certainly makes sense in shared file mappings as the pagecache maintains a reference to the page and it will never be freed. However, it could be useful to unmap and free pages in private mappings. In addition, userfaultfd minor fault users may be able to simplify code by using MADV_DONTNEED. The primary thing preventing MADV_DONTNEED from working on hugetlb mappings is a check in can_madv_lru_vma(). To allow support for hugetlb mappings create and use a new routine madvise_dontneed_free_valid_vma() that allows hugetlb mappings in this specific case. For normal mappings, madvise requires the start address be PAGE aligned and rounds up length to the next multiple of PAGE_SIZE. Do similarly for hugetlb mappings: require start address be huge page size aligned and round up length to the next multiple of huge page size. Use the new madvise_dontneed_free_valid_vma routine to check alignment and round up length/end. zap_page_range requires this alignment for hugetlb vmas otherwise we will hit BUGs. Link: https://lkml.kernel.org/r/20220215002348.128823-1-mike.kravetz@oracle.com Link: https://lkml.kernel.org/r/20220215002348.128823-2-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Cc: Naoya Horiguchi Cc: David Hildenbrand Cc: Axel Rasmussen Cc: Mina Almasry Cc: Michal Hocko Cc: Peter Xu Cc: Andrea Arcangeli Cc: Shuah Khan Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/madvise.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) commit c32caa267b927b744610f4214bfde7ce7d55df1c Author: Andrey Konovalov Date: Thu Mar 24 18:13:15 2022 -0700 kasan: disable LOCKDEP when printing reports If LOCKDEP detects a bug while KASAN is printing a report and if panic_on_warn is set, KASAN will not be able to finish. Disable LOCKDEP while KASAN is printing a report. See https://bugzilla.kernel.org/show_bug.cgi?id=202115 for an example of the issue. Link: https://lkml.kernel.org/r/c48a2a3288200b07e1788b77365c2f02784cfeb4.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 80207910cd71b4e0e87140d165d82b5d3ff69e53 Author: Andrey Konovalov Date: Thu Mar 24 18:13:12 2022 -0700 kasan: move and hide kasan_save_enable/restore_multi_shot - Move kasan_save_enable/restore_multi_shot() declarations to mm/kasan/kasan.h, as there is no need for them to be visible outside of KASAN implementation. - Only define and export these functions when KASAN tests are enabled. - Move their definitions closer to other test-related code in report.c. Link: https://lkml.kernel.org/r/6ba637333b78447f027d775f2d55ab1a40f63c99.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kasan.h | 4 ---- mm/kasan/kasan.h | 7 +++++++ mm/kasan/report.c | 30 +++++++++++++++++------------- 3 files changed, 24 insertions(+), 17 deletions(-) commit 865bfa28eda6893b391cd0c00b99a57cd617d1d6 Author: Andrey Konovalov Date: Thu Mar 24 18:13:09 2022 -0700 kasan: reorder reporting functions Move print_error_description()'s, report_suppressed()'s, and report_enabled()'s definitions to improve the logical order of function definitions in report.c. No functional changes. Link: https://lkml.kernel.org/r/82aa926c411e00e76e97e645a551ede9ed0c5e79.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 82 +++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) commit c068664c97c7cffa9df706e247046aa5c796efc9 Author: Andrey Konovalov Date: Thu Mar 24 18:13:06 2022 -0700 kasan: respect KASAN_BIT_REPORTED in all reporting routines Currently, only kasan_report() checks the KASAN_BIT_REPORTED and KASAN_BIT_MULTI_SHOT flags. Make other reporting routines check these flags as well. Also add explanatory comments. Note that the current->kasan_depth check is split out into report_suppressed() and only called for kasan_report(). Link: https://lkml.kernel.org/r/715e346b10b398e29ba1b425299dcd79e29d58ce.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) commit 795b760fe741c0b82508947e7b76803a2cdabd13 Author: Andrey Konovalov Date: Thu Mar 24 18:13:03 2022 -0700 kasan: add comment about UACCESS regions to kasan_report Add a comment explaining why kasan_report() is the only reporting function that uses user_access_save/restore(). Link: https://lkml.kernel.org/r/1201ca3c2be42c7bd077c53d2e46f4a51dd1476a.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 5 +++++ 1 file changed, 5 insertions(+) commit c965cdd67540ae8a6ac3da05cce4b7da3e0be94c Author: Andrey Konovalov Date: Thu Mar 24 18:13:00 2022 -0700 kasan: rename kasan_access_info to kasan_report_info Rename kasan_access_info to kasan_report_info, as the latter name better reflects the struct's purpose. Link: https://lkml.kernel.org/r/158a4219a5d356901d017352558c989533a0782c.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/kasan.h | 4 ++-- mm/kasan/report.c | 8 ++++---- mm/kasan/report_generic.c | 6 +++--- mm/kasan/report_tags.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) commit bb2f967ce2130b57b49d21d4cbcd06e67f14a562 Author: Andrey Konovalov Date: Thu Mar 24 18:12:57 2022 -0700 kasan: move and simplify kasan_report_async Place kasan_report_async() next to the other main reporting routines. Also simplify printed information. Link: https://lkml.kernel.org/r/52d942ef3ffd29bdfa225bbe8e327bc5bda7ab09.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) commit 31c65110b90c76153b41b9b7e22c361ff2fb4525 Author: Andrey Konovalov Date: Thu Mar 24 18:12:55 2022 -0700 kasan: call print_report from kasan_report_invalid_free Call print_report() in kasan_report_invalid_free() instead of calling printing functions directly. Compared to the existing implementation of kasan_report_invalid_free(), print_report() makes sure that the buggy address has metadata before printing it. The change requires adding a report type field into kasan_access_info and using it accordingly. kasan_report_async() is left as is, as using print_report() will only complicate the code. Link: https://lkml.kernel.org/r/9ea6f0604c5d2e1fb28d93dc6c44232c1f8017fe.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/kasan.h | 6 ++++++ mm/kasan/report.c | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 16 deletions(-) commit be8631a17620ccf3d4fca74a6d6a218737e5b9cc Author: Andrey Konovalov Date: Thu Mar 24 18:12:52 2022 -0700 kasan: merge __kasan_report into kasan_report Merge __kasan_report() into kasan_report(). The code is simple enough to be readable without the __kasan_report() helper. Link: https://lkml.kernel.org/r/c8a125497ef82f7042b3795918dffb81a85a878e.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) commit b3bb1d700e51128e9ff818f76b930403b1ed2c7d Author: Andrey Konovalov Date: Thu Mar 24 18:12:49 2022 -0700 kasan: restructure kasan_report Restructure kasan_report() to make reviewing the subsequent patches easier. Link: https://lkml.kernel.org/r/ca28042889858b8cc4724d3d4378387f90d7a59d.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit b91328002d266da3f53703f753b3a2af0dc9b9c1 Author: Andrey Konovalov Date: Thu Mar 24 18:12:46 2022 -0700 kasan: simplify kasan_find_first_bad_addr call sites Move the addr_has_metadata() check into kasan_find_first_bad_addr(). Link: https://lkml.kernel.org/r/a49576f7a23283d786ba61579cb0c5057e8f0b9b.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 5 +---- mm/kasan/report_generic.c | 4 ++++ mm/kasan/report_hw_tags.c | 1 + mm/kasan/report_sw_tags.c | 4 ++++ 4 files changed, 10 insertions(+), 4 deletions(-) commit 9d7b7dd946924de43021f57a8bee122ff0744d93 Author: Andrey Konovalov Date: Thu Mar 24 18:12:43 2022 -0700 kasan: split out print_report from __kasan_report Split out the part of __kasan_report() that prints things into print_report(). One of the subsequent patches makes another error handler use print_report() as well. Includes lower-level changes: - Allow addr_has_metadata() accepting a tagged address. - Drop the const qualifier from the fields of kasan_access_info to avoid excessive type casts. - Change the type of the address argument of __kasan_report() and end_report() to void * to reduce the number of type casts. Link: https://lkml.kernel.org/r/9be3ed99dd24b9c4e1c4a848b69a0c6ecefd845e.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/kasan.h | 7 ++++--- mm/kasan/report.c | 58 +++++++++++++++++++++++++++++-------------------------- 2 files changed, 35 insertions(+), 30 deletions(-) commit 0a6e8a07dec75f7b013b70c2df3e69c64edf312f Author: Andrey Konovalov Date: Thu Mar 24 18:12:40 2022 -0700 kasan: move disable_trace_on_warning to start_report Move the disable_trace_on_warning() call, which enables the /proc/sys/kernel/traceoff_on_warning interface for KASAN bugs, to start_report(), so that it functions for all types of KASAN reports. Link: https://lkml.kernel.org/r/7c066c5de26234ad2cebdd931adfe437f8a95d58.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a260d2814e6d294e878840d9c6fdeca516205096 Author: Andrey Konovalov Date: Thu Mar 24 18:12:37 2022 -0700 kasan: move update_kunit_status to start_report Instead of duplicating calls to update_kunit_status() in every error report routine, call it once in start_report(). Pass the sync flag as an additional argument to start_report(). Link: https://lkml.kernel.org/r/cae5c845a0b6f3c867014e53737cdac56b11edc7.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 75 +++++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 41 deletions(-) commit 49d9977ac909a98a9bbd689a64b1d872ac10215b Author: Andrey Konovalov Date: Thu Mar 24 18:12:34 2022 -0700 kasan: check CONFIG_KASAN_KUNIT_TEST instead of CONFIG_KUNIT Check the more specific CONFIG_KASAN_KUNIT_TEST config option when defining things related to KUnit-compatible KASAN tests instead of CONFIG_KUNIT. Also put the kunit_kasan_status definition next to the definitons of other KASAN-related structs. Link: https://lkml.kernel.org/r/223592d38d2a601a160a3b2b3d5a9f9090350e62.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/kasan.h | 18 ++++++++---------- mm/kasan/report.c | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) commit 3784c299eafc6dd1ca5a23f4020f18ca565e07af Author: Andrey Konovalov Date: Thu Mar 24 18:12:31 2022 -0700 kasan: simplify kasan_update_kunit_status() and call sites - Rename kasan_update_kunit_status() to update_kunit_status() (the function is static). - Move the IS_ENABLED(CONFIG_KUNIT) to the function's definition instead of duplicating it at call sites. - Obtain and check current->kunit_test within the function. Link: https://lkml.kernel.org/r/dac26d811ae31856c3d7666de0b108a3735d962d.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) commit 476b1dc2bc34febc620b8a6cd459f0b3d9950c34 Author: Andrey Konovalov Date: Thu Mar 24 18:12:28 2022 -0700 kasan: simplify async check in end_report() Currently, end_report() does not call trace_error_report_end() for bugs detected in either async or asymm mode (when kasan_async_fault_possible() returns true), as the address of the bad access might be unknown. However, for asymm mode, the address is known for faults triggered by read operations. Instead of using kasan_async_fault_possible(), simply check that the addr is not NULL when calling trace_error_report_end(). Link: https://lkml.kernel.org/r/1c8ce43f97300300e62c941181afa2eb738965c5.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1e0f611fab9c5743719a95e09a2846e4052fd644 Author: Andrey Konovalov Date: Thu Mar 24 18:12:25 2022 -0700 kasan: print basic stack frame info for SW_TAGS Software Tag-Based mode tags stack allocations when CONFIG_KASAN_STACK is enabled. Print task name and id in reports for stack-related bugs. [andreyknvl@google.com: include linux/sched/task_stack.h] Link: https://lkml.kernel.org/r/d7598f11a34ed96e508f7640fa038662ed2305ec.1647099922.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/029aaa87ceadde0702f3312a34697c9139c9fb53.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/kasan.h | 2 +- mm/kasan/report_sw_tags.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) commit 16347c31890375d2a7eb9efb01d2baac28742de3 Author: Andrey Konovalov Date: Thu Mar 24 18:12:23 2022 -0700 kasan: improve stack frame info in reports - Print at least task name and id for reports affecting allocas (get_address_stack_frame_info() does not support them). - Capitalize first letter of each sentence. Link: https://lkml.kernel.org/r/aa613f097c12f7b75efb17f2618ae00480fb4bc3.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report_generic.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 0f9b35f38318d21470975bec61e0e93b4aab5c3c Author: Andrey Konovalov Date: Thu Mar 24 18:12:20 2022 -0700 kasan: rearrange stack frame info in reports - Move printing stack frame info before printing page info. - Add object_is_on_stack() check to print_address_description() and add a corresponding WARNING to kasan_print_address_stack_frame(). This looks more in line with the rest of the checks in this function and also allows to avoid complicating code logic wrt line breaks. - Clean up comments related to get_address_stack_frame_info(). Link: https://lkml.kernel.org/r/1ee113a4c111df97d168c820b527cda77a3cac40.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 12 +++++++++--- mm/kasan/report_generic.c | 15 ++++----------- 2 files changed, 13 insertions(+), 14 deletions(-) commit 038fd2b4cb42c64afa3cacad53f9e0f514b8d02a Author: Andrey Konovalov Date: Thu Mar 24 18:12:17 2022 -0700 kasan: more line breaks in reports Add a line break after each part that describes the buggy address. Improves readability of reports. Link: https://lkml.kernel.org/r/8682c4558e533cd0f99bdb964ce2fe741f2a9212.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 7131c883f995df9288f70879e501016119d4d971 Author: Andrey Konovalov Date: Thu Mar 24 18:12:14 2022 -0700 kasan: drop addr check from describe_object_addr Patch series "kasan: report clean-ups and improvements". A number of clean-up patches for KASAN reporting code. Most are non-functional and only improve readability. This patch (of 22): describe_object_addr() used to be called with NULL addr in the early days of KASAN. This no longer happens, so drop the check. Link: https://lkml.kernel.org/r/cover.1646237226.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/761f8e5a6ee040d665934d916a90afe9f322f745.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Marco Elver Cc: Dmitry Vyukov Cc: Andrey Ryabinin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 3 --- 1 file changed, 3 deletions(-) commit c056a364e9546bd513d1f5205f0ee316d8acb910 Author: Andrey Konovalov Date: Thu Mar 24 18:12:11 2022 -0700 kasan: print virtual mapping info in reports Print virtual mapping range and its creator in reports affecting virtual mappings. Also get physical page pointer for such mappings, so page information gets printed as well. Link: https://lkml.kernel.org/r/6ebb11210ae21253198e264d4bb0752c1fad67d7.1645548178.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Mark Rutland Cc: Marco Elver Cc: Alexander Potapenko Cc: Dmitriy Vyukov Cc: Andrey Ryabinin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) commit 2dfd1bd992322f7ab8db82d7862cb758c3be63fa Author: Peter Collingbourne Date: Thu Mar 24 18:12:08 2022 -0700 kasan: update function name in comments The function kasan_global_oob was renamed to kasan_global_oob_right, but the comments referring to it were not updated. Do so. Link: https://linux-review.googlesource.com/id/I20faa90126937bbee77d9d44709556c3dd4b40be Link: https://lkml.kernel.org/r/20220219012433.890941-1-pcc@google.com Signed-off-by: Peter Collingbourne Reviewed-by: Miaohe Lin Reviewed-by: Marco Elver Reviewed-by: Andrey Konovalov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/test_kasan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 09eb911d934561238d45fe298bf5d920759fa572 Author: tangmeng Date: Thu Mar 24 18:12:05 2022 -0700 mm/kasan: remove unnecessary CONFIG_KASAN option In mm/Makefile has: obj-$(CONFIG_KASAN) += kasan/ So that we don't need 'obj-$(CONFIG_KASAN) :=' in mm/kasan/Makefile, delete it from mm/kasan/Makefile. Link: https://lkml.kernel.org/r/20220221065421.20689-1-tangmeng@uniontech.com Signed-off-by: tangmeng Reviewed-by: Marco Elver Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitriy Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ed6d74446cbfb88c747d4b32477a9d46132694db Author: Andrey Konovalov Date: Thu Mar 24 18:12:02 2022 -0700 kasan: test: support async (again) and asymm modes for HW_TAGS Async mode support has already been implemented in commit e80a76aa1a91 ("kasan, arm64: tests supports for HW_TAGS async mode") but then got accidentally broken in commit 99734b535d9b ("kasan: detect false-positives in tests"). Restore the changes removed by the latter patch and adapt them for asymm mode: add a sync_fault flag to kunit_kasan_expectation that only get set if the MTE fault was synchronous, and reenable MTE on such faults in tests. Also rename kunit_kasan_expectation to kunit_kasan_status and move its definition to mm/kasan/kasan.h from include/linux/kasan.h, as this structure is only internally used by KASAN. Also put the structure definition under IS_ENABLED(CONFIG_KUNIT). Link: https://lkml.kernel.org/r/133970562ccacc93ba19d754012c562351d4a8c8.1645033139.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrey Ryabinin Cc: Vincenzo Frascino Cc: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kasan.h | 5 ----- lib/test_kasan.c | 39 ++++++++++++++++++++++----------------- mm/kasan/hw_tags.c | 18 +++++++++--------- mm/kasan/kasan.h | 14 ++++++++++++-- mm/kasan/report.c | 17 +++++++++-------- 5 files changed, 52 insertions(+), 41 deletions(-) commit 1a2473f0cbc059f345952654e393df317f7e270c Author: Andrey Konovalov Date: Thu Mar 24 18:11:59 2022 -0700 kasan: improve vmalloc tests Update the existing vmalloc_oob() test to account for the specifics of the tag-based modes. Also add a few new checks and comments. Add new vmalloc-related tests: - vmalloc_helpers_tags() to check that exported vmalloc helpers can handle tagged pointers. - vmap_tags() to check that SW_TAGS mode properly tags vmap() mappings. - vm_map_ram_tags() to check that SW_TAGS mode properly tags vm_map_ram() mappings. - vmalloc_percpu() to check that SW_TAGS mode tags regions allocated for __alloc_percpu(). The tagging of per-cpu mappings is best-effort; proper tagging is tracked in [1]. [1] https://bugzilla.kernel.org/show_bug.cgi?id=215019 [sfr@canb.auug.org.au: similar to "kasan: test: fix compatibility with FORTIFY_SOURCE"] Link: https://lkml.kernel.org/r/20220128144801.73f5ced0@canb.auug.org.au Link: https://lkml.kernel.org/r/865c91ba49b90623ab50c7526b79ccb955f544f0.1644950160.git.andreyknvl@google.com [andreyknvl@google.com: set_memory_rw/ro() are not exported to modules] Link: https://lkml.kernel.org/r/019ac41602e0c4a7dfe96dc8158a95097c2b2ebd.1645554036.git.andreyknvl@google.com [akpm@linux-foundation.org: fix build] Cc: Andrey Konovalov [andreyknvl@google.com: vmap_tags() and vm_map_ram_tags() pass invalid page array size] Link: https://lkml.kernel.org/r/bbdc1c0501c5275e7f26fdb8e2a7b14a40a9f36b.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Signed-off-by: Stephen Rothwell Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/test_kasan.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 188 insertions(+), 6 deletions(-) commit 8479d7b5be2fecaed2b78331c3bf443cc19dfcf5 Author: Andrey Konovalov Date: Thu Mar 24 18:11:56 2022 -0700 kasan: documentation updates Update KASAN documentation: - Bump Clang version requirement for HW_TAGS as ARM64_MTE depends on AS_HAS_LSE_ATOMICS as of commit 2decad92f4731 ("arm64: mte: Ensure TIF_MTE_ASYNC_FAULT is set atomically"), which requires Clang 12. - Add description of the new kasan.vmalloc command line flag. - Mention that SW_TAGS and HW_TAGS modes now support vmalloc tagging. - Explicitly say that the "Shadow memory" section is only applicable to software KASAN modes. - Mention that shadow-based KASAN_VMALLOC is supported on arm64. Link: https://lkml.kernel.org/r/a61189128fa3f9fbcfd9884ff653d401864b8e74.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/dev-tools/kasan.rst | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) commit f6f37d9320a11e9059f11a99fc59dfb8e307c07f Author: Andrey Konovalov Date: Thu Mar 24 18:11:53 2022 -0700 arm64: select KASAN_VMALLOC for SW/HW_TAGS modes Generic KASAN already selects KASAN_VMALLOC to allow VMAP_STACK to be selected unconditionally, see commit acc3042d62cb9 ("arm64: Kconfig: select KASAN_VMALLOC if KANSAN_GENERIC is enabled"). The same change is needed for SW_TAGS KASAN. HW_TAGS KASAN does not require enabling KASAN_VMALLOC for VMAP_STACK, they already work together as is. Still, selecting KASAN_VMALLOC still makes sense to make vmalloc() always protected. In case any bugs in KASAN's vmalloc() support are discovered, the command line kasan.vmalloc flag can be used to disable vmalloc() checking. Select KASAN_VMALLOC for all KASAN modes for arm64. Link: https://lkml.kernel.org/r/99d6b3ebf57fc1930ff71f9a4a71eea19881b270.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Catalin Marinas Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fbefb423f873a8713a2ad42b5dcb4585b3e58e01 Author: Andrey Konovalov Date: Thu Mar 24 18:11:50 2022 -0700 kasan: allow enabling KASAN_VMALLOC and SW/HW_TAGS Allow enabling CONFIG_KASAN_VMALLOC with SW_TAGS and HW_TAGS KASAN modes. Also adjust CONFIG_KASAN_VMALLOC description: - Mention HW_TAGS support. - Remove unneeded internal details: they have no place in Kconfig description and are already explained in the documentation. Link: https://lkml.kernel.org/r/bfa0fdedfe25f65e5caa4e410f074ddbac7a0b59.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/Kconfig.kasan | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit 551b2bcb7e7a9219f176a5abc56c6d981d8068cf Author: Andrey Konovalov Date: Thu Mar 24 18:11:47 2022 -0700 kasan: add kasan.vmalloc command line flag Allow disabling vmalloc() tagging for HW_TAGS KASAN via a kasan.vmalloc command line switch. This is a fail-safe switch intended for production systems that enable HW_TAGS KASAN. In case vmalloc() tagging ends up having an issue not detected during testing but that manifests in production, kasan.vmalloc allows to turn vmalloc() tagging off while leaving page_alloc/slab tagging on. Link: https://lkml.kernel.org/r/904f6d4dfa94870cc5fc2660809e093fd0d27c3b.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/hw_tags.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- mm/kasan/kasan.h | 6 ++++++ 2 files changed, 50 insertions(+), 1 deletion(-) commit 241944d1628e77f578d309ec57528b01cdef78d3 Author: Andrey Konovalov Date: Thu Mar 24 18:11:44 2022 -0700 kasan: clean up feature flags for HW_TAGS mode - Untie kasan_init_hw_tags() code from the default values of kasan_arg_mode and kasan_arg_stacktrace. - Move static_branch_enable(&kasan_flag_enabled) to the end of kasan_init_hw_tags_cpu(). - Remove excessive comments in kasan_arg_mode switch. - Add new comments. Link: https://lkml.kernel.org/r/76ebb340265be57a218564a497e1f52ff36a3879.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/hw_tags.c | 38 +++++++++++++++++++++----------------- mm/kasan/kasan.h | 2 +- 2 files changed, 22 insertions(+), 18 deletions(-) commit 1eeac51e6201c1c0980fcdae73dbbe34811f8503 Author: Andrey Konovalov Date: Thu Mar 24 18:11:41 2022 -0700 kasan: mark kasan_arg_stacktrace as __initdata As kasan_arg_stacktrace is only used in __init functions, mark it as __initdata instead of __ro_after_init to allow it be freed after boot. The other enums for KASAN args are used in kasan_init_hw_tags_cpu(), which is not marked as __init as a CPU can be hot-plugged after boot. Clarify this in a comment. Link: https://lkml.kernel.org/r/7fa090865614f8e0c6c1265508efb1d429afaa50.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Suggested-by: Marco Elver Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/hw_tags.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 36c4a73bf8d24721222d9ee4080ac955973fd388 Author: Andrey Konovalov Date: Thu Mar 24 18:11:38 2022 -0700 kasan, arm64: don't tag executable vmalloc allocations Besides asking vmalloc memory to be executable via the prot argument of __vmalloc_node_range() (see the previous patch), the kernel can skip that bit and instead mark memory as executable via set_memory_x(). Once tag-based KASAN modes start tagging vmalloc allocations, executing code from such allocations will lead to the PC register getting a tag, which is not tolerated by the kernel. Generic kernel code typically allocates memory via module_alloc() if it intends to mark memory as executable. (On arm64 module_alloc() uses __vmalloc_node_range() without setting the executable bit). Thus, reset pointer tags of pointers returned from module_alloc(). However, on arm64 there's an exception: the eBPF subsystem. Instead of using module_alloc(), it uses vmalloc() (via bpf_jit_alloc_exec()) to allocate its JIT region. Thus, reset pointer tags of pointers returned from bpf_jit_alloc_exec(). Resetting tags for these pointers results in untagged pointers being passed to set_memory_x(). This causes conflicts in arithmetic checks in change_memory_common(), as vm_struct->addr pointer returned by find_vm_area() is tagged. Reset pointer tag of find_vm_area(addr)->addr in change_memory_common(). Link: https://lkml.kernel.org/r/b7b2595423340cd7d76b770e5d519acf3b72f0ab.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Catalin Marinas Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/arm64/kernel/module.c | 3 ++- arch/arm64/mm/pageattr.c | 2 +- arch/arm64/net/bpf_jit_comp.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) commit f6e39794f4b6da7ca9b77f2f9ad11fd6f0ac83e5 Author: Andrey Konovalov Date: Thu Mar 24 18:11:35 2022 -0700 kasan, vmalloc: only tag normal vmalloc allocations The kernel can use to allocate executable memory. The only supported way to do that is via __vmalloc_node_range() with the executable bit set in the prot argument. (vmap() resets the bit via pgprot_nx()). Once tag-based KASAN modes start tagging vmalloc allocations, executing code from such allocations will lead to the PC register getting a tag, which is not tolerated by the kernel. Only tag the allocations for normal kernel pages. [andreyknvl@google.com: pass KASAN_VMALLOC_PROT_NORMAL to kasan_unpoison_vmalloc()] Link: https://lkml.kernel.org/r/9230ca3d3e40ffca041c133a524191fd71969a8d.1646233925.git.andreyknvl@google.com [andreyknvl@google.com: support tagged vmalloc mappings] Link: https://lkml.kernel.org/r/2f6605e3a358cf64d73a05710cb3da356886ad29.1646233925.git.andreyknvl@google.com [andreyknvl@google.com: don't unintentionally disabled poisoning] Link: https://lkml.kernel.org/r/de4587d6a719232e83c760113e46ed2d4d8da61e.1646757322.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/fbfd9939a4dc375923c9a5c6b9e7ab05c26b8c6b.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kasan.h | 7 ++++--- kernel/scs.c | 12 ++++++++---- mm/kasan/hw_tags.c | 7 +++++++ mm/kasan/shadow.c | 8 ++++++++ mm/vmalloc.c | 49 +++++++++++++++++++++++++++++-------------------- 5 files changed, 56 insertions(+), 27 deletions(-) commit 23689e91fb22c15b84ac6c22ad9942039792f3af Author: Andrey Konovalov Date: Thu Mar 24 18:11:32 2022 -0700 kasan, vmalloc: add vmalloc tagging for HW_TAGS Add vmalloc tagging support to HW_TAGS KASAN. The key difference between HW_TAGS and the other two KASAN modes when it comes to vmalloc: HW_TAGS KASAN can only assign tags to physical memory. The other two modes have shadow memory covering every mapped virtual memory region. Make __kasan_unpoison_vmalloc() for HW_TAGS KASAN: - Skip non-VM_ALLOC mappings as HW_TAGS KASAN can only tag a single mapping of normal physical memory; see the comment in the function. - Generate a random tag, tag the returned pointer and the allocation, and initialize the allocation at the same time. - Propagate the tag into the page stucts to allow accesses through page_address(vmalloc_to_page()). The rest of vmalloc-related KASAN hooks are not needed: - The shadow-related ones are fully skipped. - __kasan_poison_vmalloc() is kept as a no-op with a comment. Poisoning and zeroing of physical pages that are backing vmalloc() allocations are skipped via __GFP_SKIP_KASAN_UNPOISON and __GFP_SKIP_ZERO: __kasan_unpoison_vmalloc() does that instead. Enabling CONFIG_KASAN_VMALLOC with HW_TAGS is not yet allowed. Link: https://lkml.kernel.org/r/d19b2e9e59a9abc59d05b72dea8429dcaea739c6.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Co-developed-by: Vincenzo Frascino Signed-off-by: Vincenzo Frascino Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kasan.h | 36 +++++++++++++++++--- kernel/scs.c | 4 +-- mm/kasan/hw_tags.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++ mm/kasan/shadow.c | 10 +++++- mm/vmalloc.c | 51 ++++++++++++++++++++++------ 5 files changed, 175 insertions(+), 18 deletions(-) commit 9353ffa6e9e90d2b6348209cf2b95a8ffee18711 Author: Andrey Konovalov Date: Thu Mar 24 18:11:29 2022 -0700 kasan, page_alloc: allow skipping memory init for HW_TAGS Add a new GFP flag __GFP_SKIP_ZERO that allows to skip memory initialization. The flag is only effective with HW_TAGS KASAN. This flag will be used by vmalloc code for page_alloc allocations backing vmalloc() mappings in a following patch. The reason to skip memory initialization for these pages in page_alloc is because vmalloc code will be initializing them instead. With the current implementation, when __GFP_SKIP_ZERO is provided, __GFP_ZEROTAGS is ignored. This doesn't matter, as these two flags are never provided at the same time. However, if this is changed in the future, this particular implementation detail can be changed as well. Link: https://lkml.kernel.org/r/0d53efeff345de7d708e0baa0d8829167772521e.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/gfp.h | 18 +++++++++++------- include/trace/events/mmflags.h | 1 + mm/page_alloc.c | 13 ++++++++++++- 3 files changed, 24 insertions(+), 8 deletions(-) commit 53ae233c30a623ff44ff2f83854e92530c5d9fc2 Author: Andrey Konovalov Date: Thu Mar 24 18:11:26 2022 -0700 kasan, page_alloc: allow skipping unpoisoning for HW_TAGS Add a new GFP flag __GFP_SKIP_KASAN_UNPOISON that allows skipping KASAN poisoning for page_alloc allocations. The flag is only effective with HW_TAGS KASAN. This flag will be used by vmalloc code for page_alloc allocations backing vmalloc() mappings in a following patch. The reason to skip KASAN poisoning for these pages in page_alloc is because vmalloc code will be poisoning them instead. Also reword the comment for __GFP_SKIP_KASAN_POISON. Link: https://lkml.kernel.org/r/35c97d77a704f6ff971dd3bfe4be95855744108e.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/gfp.h | 21 +++++++++++++-------- include/trace/events/mmflags.h | 5 +++-- mm/page_alloc.c | 31 ++++++++++++++++++++++--------- 3 files changed, 38 insertions(+), 19 deletions(-) commit f49d9c5bb15cc5c470097078ec1f26ff605ae1a2 Author: Andrey Konovalov Date: Thu Mar 24 18:11:23 2022 -0700 kasan, mm: only define ___GFP_SKIP_KASAN_POISON with HW_TAGS Only define the ___GFP_SKIP_KASAN_POISON flag when CONFIG_KASAN_HW_TAGS is enabled. This patch it not useful by itself, but it prepares the code for additions of new KASAN-specific GFP patches. Link: https://lkml.kernel.org/r/44e5738a584c11801b2b8f1231898918efc8634a.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/gfp.h | 8 +++++++- include/trace/events/mmflags.h | 12 +++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) commit 19f1c3acf8f4431982355b2e8a78e42b884dd788 Author: Andrey Konovalov Date: Thu Mar 24 18:11:20 2022 -0700 kasan, vmalloc: unpoison VM_ALLOC pages after mapping Make KASAN unpoison vmalloc mappings after they have been mapped in when it's possible: for vmalloc() (indentified via VM_ALLOC) and vm_map_ram(). The reasons for this are: - For vmalloc() and vm_map_ram(): pages don't get unpoisoned in case mapping them fails. - For vmalloc(): HW_TAGS KASAN needs pages to be mapped to set tags via kasan_unpoison_vmalloc(). As a part of these changes, the return value of __vmalloc_node_range() is changed to area->addr. This is a non-functional change, as __vmalloc_area_node() returns area->addr anyway. Link: https://lkml.kernel.org/r/fcb98980e6fcd3c4be6acdcb5d6110898ef28548.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/vmalloc.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) commit 01d92c7f358ce892279ca830cf6ccf2862a17d1c Author: Andrey Konovalov Date: Thu Mar 24 18:11:16 2022 -0700 kasan, vmalloc, arm64: mark vmalloc mappings as pgprot_tagged HW_TAGS KASAN relies on ARM Memory Tagging Extension (MTE). With MTE, a memory region must be mapped as MT_NORMAL_TAGGED to allow setting memory tags via MTE-specific instructions. Add proper protection bits to vmalloc() allocations. These allocations are always backed by page_alloc pages, so the tags will actually be getting set on the corresponding physical memory. Link: https://lkml.kernel.org/r/983fc33542db2f6b1e77b34ca23448d4640bbb9e.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Co-developed-by: Vincenzo Frascino Signed-off-by: Vincenzo Frascino Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/arm64/include/asm/vmalloc.h | 6 ++++++ include/linux/vmalloc.h | 7 +++++++ mm/vmalloc.c | 9 +++++++++ 3 files changed, 22 insertions(+) commit 1d96320f8d5320423737da61e6e6937f6b475b5c Author: Andrey Konovalov Date: Thu Mar 24 18:11:13 2022 -0700 kasan, vmalloc: add vmalloc tagging for SW_TAGS Add vmalloc tagging support to SW_TAGS KASAN. - __kasan_unpoison_vmalloc() now assigns a random pointer tag, poisons the virtual mapping accordingly, and embeds the tag into the returned pointer. - __get_vm_area_node() (used by vmalloc() and vmap()) and pcpu_get_vm_areas() save the tagged pointer into vm_struct->addr (note: not into vmap_area->addr). This requires putting kasan_unpoison_vmalloc() after setup_vmalloc_vm[_locked](); otherwise the latter will overwrite the tagged pointer. The tagged pointer then is naturally propagateed to vmalloc() and vmap(). - vm_map_ram() returns the tagged pointer directly. As a result of this change, vm_struct->addr is now tagged. Enabling KASAN_VMALLOC with SW_TAGS is not yet allowed. Link: https://lkml.kernel.org/r/4a78f3c064ce905e9070c29733aca1dd254a74f1.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kasan.h | 16 ++++++++++------ mm/kasan/shadow.c | 6 ++++-- mm/vmalloc.c | 14 ++++++++------ 3 files changed, 22 insertions(+), 14 deletions(-) commit 51fb34de2a4c8fa0f221246313700bfe3b6c586d Author: Andrey Konovalov Date: Thu Mar 24 18:11:10 2022 -0700 kasan, arm64: reset pointer tags of vmapped stacks Once tag-based KASAN modes start tagging vmalloc() allocations, kernel stacks start getting tagged if CONFIG_VMAP_STACK is enabled. Reset the tag of kernel stack pointers after allocation in arch_alloc_vmap_stack(). For SW_TAGS KASAN, when CONFIG_KASAN_STACK is enabled, the instrumentation can't handle the SP register being tagged. For HW_TAGS KASAN, there's no instrumentation-related issues. However, the impact of having a tagged SP register needs to be properly evaluated, so keep it non-tagged for now. Note, that the memory for the stack allocation still gets tagged to catch vmalloc-into-stack out-of-bounds accesses. [andreyknvl@google.com: fix case when a stack is retrieved from cached_stacks] Link: https://lkml.kernel.org/r/f50c5f96ef896d7936192c888b0c0a7674e33184.1644943792.git.andreyknvl@google.com [dan.carpenter@oracle.com: remove unnecessary check in alloc_thread_stack_node()] Link: https://lkml.kernel.org/r/20220301080706.GB17208@kili Link: https://lkml.kernel.org/r/698c5ab21743c796d46c15d075b9481825973e34.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Signed-off-by: Dan Carpenter Acked-by: Catalin Marinas Acked-by: Marco Elver Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/arm64/include/asm/vmap_stack.h | 5 ++++- kernel/fork.c | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) commit c08e6a1206e6876c66e0528b3ec717f557b07dd4 Author: Andrey Konovalov Date: Thu Mar 24 18:11:07 2022 -0700 kasan, fork: reset pointer tags of vmapped stacks Once tag-based KASAN modes start tagging vmalloc() allocations, kernel stacks start getting tagged if CONFIG_VMAP_STACK is enabled. Reset the tag of kernel stack pointers after allocation in alloc_thread_stack_node(). For SW_TAGS KASAN, when CONFIG_KASAN_STACK is enabled, the instrumentation can't handle the SP register being tagged. For HW_TAGS KASAN, there's no instrumentation-related issues. However, the impact of having a tagged SP register needs to be properly evaluated, so keep it non-tagged for now. Note, that the memory for the stack allocation still gets tagged to catch vmalloc-into-stack out-of-bounds accesses. Link: https://lkml.kernel.org/r/c6c96f012371ecd80e1936509ebcd3b07a5956f7.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/fork.c | 2 ++ 1 file changed, 2 insertions(+) commit 4aff1dc4fb3a5a3be96b6ad8db8348d3e877d7d0 Author: Andrey Konovalov Date: Thu Mar 24 18:11:04 2022 -0700 kasan, vmalloc: reset tags in vmalloc functions In preparation for adding vmalloc support to SW/HW_TAGS KASAN, reset pointer tags in functions that use pointer values in range checks. vread() is a special case here. Despite the untagging of the addr pointer in its prologue, the accesses performed by vread() are checked. Instead of accessing the virtual mappings though addr directly, vread() recovers the physical address via page_address(vmalloc_to_page()) and acceses that. And as page_address() recovers the pointer tag, the accesses get checked. Link: https://lkml.kernel.org/r/046003c5f683cacb0ba18e1079e9688bb3dca943.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/vmalloc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit 579fb0ac085be2015529a5f7bd1061899a6374de Author: Andrey Konovalov Date: Thu Mar 24 18:11:01 2022 -0700 kasan: add wrappers for vmalloc hooks Add wrappers around functions that [un]poison memory for vmalloc allocations. These functions will be used by HW_TAGS KASAN and therefore need to be disabled when kasan=off command line argument is provided. This patch does no functional changes for software KASAN modes. Link: https://lkml.kernel.org/r/3b8728eac438c55389fb0f9a8a2145d71dd77487.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kasan.h | 17 +++++++++++++++-- mm/kasan/shadow.c | 5 ++--- 2 files changed, 17 insertions(+), 5 deletions(-) commit 5bd9bae22a455321327982d0b595a7e76d425fd0 Author: Andrey Konovalov Date: Thu Mar 24 18:10:58 2022 -0700 kasan: reorder vmalloc hooks Group functions that [de]populate shadow memory for vmalloc. Group functions that [un]poison memory for vmalloc. This patch does no functional changes but prepares KASAN code for adding vmalloc support to HW_TAGS KASAN. Link: https://lkml.kernel.org/r/aeef49eb249c206c4c9acce2437728068da74c28.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kasan.h | 20 +++++++++----------- mm/kasan/shadow.c | 43 ++++++++++++++++++++++--------------------- 2 files changed, 31 insertions(+), 32 deletions(-) commit 0b7ccc70ee1d5b499d1626c9d28f729507b1c036 Author: Andrey Konovalov Date: Thu Mar 24 18:10:55 2022 -0700 kasan, vmalloc: drop outdated VM_KASAN comment The comment about VM_KASAN in include/linux/vmalloc.c is outdated. VM_KASAN is currently only used to mark vm_areas allocated for kernel modules when CONFIG_KASAN_VMALLOC is disabled. Drop the comment. Link: https://lkml.kernel.org/r/780395afea83a147b3b5acc36cf2e38f7f8479f9.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/vmalloc.h | 11 ----------- 1 file changed, 11 deletions(-) commit 63840de296472f3914bb933b11ba2b764590755e Author: Andrey Konovalov Date: Thu Mar 24 18:10:52 2022 -0700 kasan, x86, arm64, s390: rename functions for modules shadow Rename kasan_free_shadow to kasan_free_module_shadow and kasan_module_alloc to kasan_alloc_module_shadow. These functions are used to allocate/free shadow memory for kernel modules when KASAN_VMALLOC is not enabled. The new names better reflect their purpose. Also reword the comment next to their declaration to improve clarity. Link: https://lkml.kernel.org/r/36db32bde765d5d0b856f77d2d806e838513fe84.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Catalin Marinas Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/arm64/kernel/module.c | 2 +- arch/s390/kernel/module.c | 2 +- arch/x86/kernel/module.c | 2 +- include/linux/kasan.h | 14 +++++++------- mm/kasan/shadow.c | 4 ++-- mm/vmalloc.c | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) commit 00a756133bb91388e63257a53e250865b94a0970 Author: Andrey Konovalov Date: Thu Mar 24 18:10:49 2022 -0700 kasan: define KASAN_VMALLOC_INVALID for SW_TAGS In preparation for adding vmalloc support to SW_TAGS KASAN, provide a KASAN_VMALLOC_INVALID definition for it. HW_TAGS KASAN won't be using this value, as it falls back onto page_alloc for poisoning freed vmalloc() memory. Link: https://lkml.kernel.org/r/1daaaafeb148a7ae8285265edc97d7ca07b6a07d.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/kasan.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit fe1ac91edb9a6170255c5c6882639bd4f2b20eb8 Author: Andrey Konovalov Date: Thu Mar 24 18:10:46 2022 -0700 kasan: clean up metadata byte definitions Most of the metadata byte values are only used for Generic KASAN. Remove KASAN_KMALLOC_FREETRACK definition for !CONFIG_KASAN_GENERIC case, and put it along with other metadata values for the Generic mode under a corresponding ifdef. Link: https://lkml.kernel.org/r/ac11d6e9e007c95e472e8fdd22efb6074ef3c6d8.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/kasan.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit e9d0ca9228162f5442b751edf8c9721b15dcfa1e Author: Andrey Konovalov Date: Thu Mar 24 18:10:43 2022 -0700 kasan, page_alloc: rework kasan_unpoison_pages call site Rework the checks around kasan_unpoison_pages() call in post_alloc_hook(). The logical condition for calling this function is: - If a software KASAN mode is enabled, we need to mark shadow memory. - Otherwise, HW_TAGS KASAN is enabled, and it only makes sense to set tags if they haven't already been cleared by tag_clear_highpage(), which is indicated by init_tags. This patch concludes the changes for post_alloc_hook(). Link: https://lkml.kernel.org/r/0ecebd0d7ccd79150e3620ea4185a32d3dfe912f.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) commit 7e3cbba65de22f20ad18a2de09f65238bfe84c5b Author: Andrey Konovalov Date: Thu Mar 24 18:10:40 2022 -0700 kasan, page_alloc: move kernel_init_free_pages in post_alloc_hook Pull the kernel_init_free_pages() call in post_alloc_hook() out of the big if clause for better code readability. This also allows for more simplifications in the following patch. This patch does no functional changes. Link: https://lkml.kernel.org/r/a7a76456501eb37ddf9fca6529cee9555e59cdb1.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit 89b2711633281b3d712b1df96c5065a82ccbfb9c Author: Andrey Konovalov Date: Thu Mar 24 18:10:37 2022 -0700 kasan, page_alloc: move SetPageSkipKASanPoison in post_alloc_hook Pull the SetPageSkipKASanPoison() call in post_alloc_hook() out of the big if clause for better code readability. This also allows for more simplifications in the following patches. Also turn the kasan_has_integrated_init() check into the proper kasan_hw_tags_enabled() one. These checks evaluate to the same value, but logically skipping kasan poisoning has nothing to do with integrated init. Link: https://lkml.kernel.org/r/7214c1698b754ccfaa44a792113c95cc1f807c48.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 9294b1281d0a212ef775a175b98ce71e6ac27b90 Author: Andrey Konovalov Date: Thu Mar 24 18:10:34 2022 -0700 kasan, page_alloc: combine tag_clear_highpage calls in post_alloc_hook Move tag_clear_highpage() loops out of the kasan_has_integrated_init() clause as a code simplification. This patch does no functional changes. Link: https://lkml.kernel.org/r/587e3fc36358b88049320a89cc8dc6deaecb0cda.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) commit b42090ae6f3aa07b0a39403545d688489548a6a8 Author: Andrey Konovalov Date: Thu Mar 24 18:10:31 2022 -0700 kasan, page_alloc: merge kasan_alloc_pages into post_alloc_hook Currently, the code responsible for initializing and poisoning memory in post_alloc_hook() is scattered across two locations: kasan_alloc_pages() hook for HW_TAGS KASAN and post_alloc_hook() itself. This is confusing. This and a few following patches combine the code from these two locations. Along the way, these patches do a step-by-step restructure the many performed checks to make them easier to follow. Replace the only caller of kasan_alloc_pages() with its implementation. As kasan_has_integrated_init() is only true when CONFIG_KASAN_HW_TAGS is enabled, moving the code does no functional changes. Also move init and init_tags variables definitions out of kasan_has_integrated_init() clause in post_alloc_hook(), as they have the same values regardless of what the if condition evaluates to. This patch is not useful by itself but makes the simplifications in the following patches easier to follow. Link: https://lkml.kernel.org/r/5ac7e0b30f5cbb177ec363ddd7878a3141289592.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kasan.h | 9 --------- mm/kasan/common.c | 2 +- mm/kasan/hw_tags.c | 22 ---------------------- mm/page_alloc.c | 20 +++++++++++++++----- 4 files changed, 16 insertions(+), 37 deletions(-) commit b8491b9052fef036aac0ca3afc18ef223aef6f61 Author: Andrey Konovalov Date: Thu Mar 24 18:10:28 2022 -0700 kasan, page_alloc: refactor init checks in post_alloc_hook Separate code for zeroing memory from the code clearing tags in post_alloc_hook(). This patch is not useful by itself but makes the simplifications in the following patches easier to follow. This patch does no functional changes. Link: https://lkml.kernel.org/r/2283fde963adfd8a2b29a92066f106cc16661a3c.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit 1c0e5b24f11707e8c8300060bfdd9ae4ae76611b Author: Andrey Konovalov Date: Thu Mar 24 18:10:25 2022 -0700 kasan: only apply __GFP_ZEROTAGS when memory is zeroed __GFP_ZEROTAGS should only be effective if memory is being zeroed. Currently, hardware tag-based KASAN violates this requirement. Fix by including an initialization check along with checking for __GFP_ZEROTAGS. Link: https://lkml.kernel.org/r/f4f4593f7f675262d29d07c1938db5bd0cd5e285.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/hw_tags.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit c82ce3195fd17e57a370e4dc8f36c195b8807b95 Author: Andrey Konovalov Date: Thu Mar 24 18:10:22 2022 -0700 mm: clarify __GFP_ZEROTAGS comment __GFP_ZEROTAGS is intended as an optimization: if memory is zeroed during allocation, it's possible to set memory tags at the same time with little performance impact. Clarify this intention of __GFP_ZEROTAGS in the comment. Link: https://lkml.kernel.org/r/cdffde013973c5634a447513e10ec0d21e8eee29.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/gfp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 487a32ec24be819e747af8c2ab0d5c515508086a Author: Andrey Konovalov Date: Thu Mar 24 18:10:19 2022 -0700 kasan: drop skip_kasan_poison variable in free_pages_prepare skip_kasan_poison is only used in a single place. Call should_skip_kasan_poison() directly for simplicity. Link: https://lkml.kernel.org/r/1d33212e79bc9ef0b4d3863f903875823e89046f.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Suggested-by: Marco Elver Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit db8a04774a8195c529f1e87cd1df87f116559b52 Author: Andrey Konovalov Date: Thu Mar 24 18:10:16 2022 -0700 kasan, page_alloc: init memory of skipped pages on free Since commit 7a3b83537188 ("kasan: use separate (un)poison implementation for integrated init"), when all init, kasan_has_integrated_init(), and skip_kasan_poison are true, free_pages_prepare() doesn't initialize the page. This is wrong. Fix it by remembering whether kasan_poison_pages() performed initialization, and call kernel_init_free_pages() if it didn't. Reordering kasan_poison_pages() and kernel_init_free_pages() is OK, since kernel_init_free_pages() can handle poisoned memory. Link: https://lkml.kernel.org/r/1d97df75955e52727a3dc1c4e33b3b50506fc3fd.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit c3525330a04d0a47b4e11f5cf6d44e21a6520885 Author: Andrey Konovalov Date: Thu Mar 24 18:10:13 2022 -0700 kasan, page_alloc: simplify kasan_poison_pages call site Simplify the code around calling kasan_poison_pages() in free_pages_prepare(). This patch does no functional changes. Link: https://lkml.kernel.org/r/ae4f9bcf071577258e786bcec4798c145d718c46.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) commit 7c13c163e036c646b77753deacfe2f5478b654bc Author: Andrey Konovalov Date: Thu Mar 24 18:10:10 2022 -0700 kasan, page_alloc: merge kasan_free_pages into free_pages_prepare Currently, the code responsible for initializing and poisoning memory in free_pages_prepare() is scattered across two locations: kasan_free_pages() for HW_TAGS KASAN and free_pages_prepare() itself. This is confusing. This and a few following patches combine the code from these two locations. Along the way, these patches also simplify the performed checks to make them easier to follow. Replaces the only caller of kasan_free_pages() with its implementation. As kasan_has_integrated_init() is only true when CONFIG_KASAN_HW_TAGS is enabled, moving the code does no functional changes. This patch is not useful by itself but makes the simplifications in the following patches easier to follow. Link: https://lkml.kernel.org/r/303498d15840bb71905852955c6e2390ecc87139.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kasan.h | 8 -------- mm/kasan/common.c | 2 +- mm/kasan/hw_tags.c | 11 ----------- mm/page_alloc.c | 6 ++++-- 4 files changed, 5 insertions(+), 22 deletions(-) commit 5b2c07138cbd8c0c415c6d3ff5b8040532024814 Author: Andrey Konovalov Date: Thu Mar 24 18:10:07 2022 -0700 kasan, page_alloc: move tag_clear_highpage out of kernel_init_free_pages Currently, kernel_init_free_pages() serves two purposes: it either only zeroes memory or zeroes both memory and memory tags via a different code path. As this function has only two callers, each using only one code path, this behaviour is confusing. Pull the code that zeroes both memory and tags out of kernel_init_free_pages(). As a result of this change, the code in free_pages_prepare() starts to look complicated, but this is improved in the few following patches. Those improvements are not integrated into this patch to make diffs easier to read. This patch does no functional changes. Link: https://lkml.kernel.org/r/7719874e68b23902629c7cf19f966c4fd5f57979.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Acked-by: Marco Elver Cc: Andrey Ryabinin Cc: Catalin Marinas Cc: Dmitry Vyukov Cc: Evgenii Stepanov Cc: Mark Rutland Cc: Peter Collingbourne Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) commit 94ae8b83fefcdaf281e0bcfb76a19f5ed5019c8d Author: Andrey Konovalov Date: Thu Mar 24 18:10:04 2022 -0700 kasan, page_alloc: deduplicate should_skip_kasan_poison Patch series "kasan, vmalloc, arm64: add vmalloc tagging support for SW/HW_TAGS", v6. This patchset adds vmalloc tagging support for SW_TAGS and HW_TAGS KASAN modes. About half of patches are cleanups I went for along the way. None of them seem to be important enough to go through stable, so I decided not to split them out into separate patches/series. The patchset is partially based on an early version of the HW_TAGS patchset by Vincenzo that had vmalloc support. Thus, I added a Co-developed-by tag into a few patches. SW_TAGS vmalloc tagging support is straightforward. It reuses all of the generic KASAN machinery, but uses shadow memory to store tags instead of magic values. Naturally, vmalloc tagging requires adding a few kasan_reset_tag() annotations to the vmalloc code. HW_TAGS vmalloc tagging support stands out. HW_TAGS KASAN is based on Arm MTE, which can only assigns tags to physical memory. As a result, HW_TAGS KASAN only tags vmalloc() allocations, which are backed by page_alloc memory. It ignores vmap() and others. This patch (of 39): Currently, should_skip_kasan_poison() has two definitions: one for when CONFIG_DEFERRED_STRUCT_PAGE_INIT is enabled, one for when it's not. Instead of duplicating the checks, add a deferred_pages_enabled() helper and use it in a single should_skip_kasan_poison() definition. Also move should_skip_kasan_poison() closer to its caller and clarify all conditions in the comment. Link: https://lkml.kernel.org/r/cover.1643047180.git.andreyknvl@google.com Link: https://lkml.kernel.org/r/658b79f5fb305edaf7dc16bc52ea870d3220d4a8.1643047180.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrey Ryabinin Cc: Vincenzo Frascino Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Peter Collingbourne Cc: Evgenii Stepanov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 55 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 22 deletions(-) commit 4cc79b3303f224a920f3aff21f3d231749d73384 Author: Anshuman Khandual Date: Thu Mar 24 18:10:01 2022 -0700 mm/migration: add trace events for base page and HugeTLB migrations This adds two trace events for base page and HugeTLB page migrations. These events, closely follow the implementation details like setting and removing of PTE migration entries, which are essential operations for migration. The new CREATE_TRACE_POINTS in covers both and based trace events. Hence drop redundant CREATE_TRACE_POINTS from other places which could have otherwise conflicted during build. Link: https://lkml.kernel.org/r/1643368182-9588-3-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Reported-by: kernel test robot Cc: Steven Rostedt Cc: Ingo Molnar Cc: Zi Yan Cc: Naoya Horiguchi Cc: John Hubbard Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/x86/mm/init.c | 1 - include/trace/events/migrate.h | 31 +++++++++++++++++++++++++++++++ mm/migrate.c | 4 +++- mm/rmap.c | 6 ++++++ 4 files changed, 40 insertions(+), 2 deletions(-) commit 283fd6fe0528ae2fe0222a35ecfdfcbbaeee8159 Author: Anshuman Khandual Date: Thu Mar 24 18:09:58 2022 -0700 mm/migration: add trace events for THP migrations Patch series "mm/migration: Add trace events", v3. This adds trace events for all migration scenarios including base page, THP and HugeTLB. This patch (of 3): This adds two trace events for PMD based THP migration without split. These events closely follow the implementation details like setting and removing of PMD migration entries, which are essential operations for THP migration. This moves CREATE_TRACE_POINTS into generic THP from powerpc for these new trace events to be available on other platforms as well. Link: https://lkml.kernel.org/r/1643368182-9588-1-git-send-email-anshuman.khandual@arm.com Link: https://lkml.kernel.org/r/1643368182-9588-2-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Cc: Steven Rostedt Cc: Ingo Molnar Cc: Zi Yan Cc: Naoya Horiguchi Cc: John Hubbard Cc: Matthew Wilcox Cc: Michael Ellerman Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/powerpc/mm/book3s64/trace.c | 1 - include/trace/events/thp.h | 27 +++++++++++++++++++++++++++ mm/huge_memory.c | 5 +++++ 3 files changed, 32 insertions(+), 1 deletion(-) commit 5d543f13e2f5580828de885c751d68a35b6a493d Author: Hugh Dickins Date: Thu Mar 24 18:09:55 2022 -0700 mm/thp: fix NR_FILE_MAPPED accounting in page_*_file_rmap() NR_FILE_MAPPED accounting in mm/rmap.c (for /proc/meminfo "Mapped" and /proc/vmstat "nr_mapped" and the memcg's memory.stat "mapped_file") is slightly flawed for file or shmem huge pages. It is well thought out, and looks convincing, but there's a racy case when the careful counting in page_remove_file_rmap() (without page lock) gets discarded. So that in a workload like two "make -j20" kernel builds under memory pressure, with cc1 on hugepage text, "Mapped" can easily grow by a spurious 5MB or more on each iteration, ending up implausibly bigger than most other numbers in /proc/meminfo. And, hypothetically, might grow to the point of seriously interfering in mm/vmscan.c's heuristics, which do take NR_FILE_MAPPED into some consideration. Fixed by moving the __mod_lruvec_page_state() down to where it will not be missed before return (and I've grown a bit tired of that oft-repeated but-not-everywhere comment on the __ness: it gets lost in the move here). Does page_add_file_rmap() need the same change? I suspect not, because page lock is held in all relevant cases, and its skipping case looks safe; but it's much easier to be sure, if we do make the same change. Link: https://lkml.kernel.org/r/e02e52a1-8550-a57c-ed29-f51191ea2375@google.com Fixes: dd78fedde4b9 ("rmap: support file thp") Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: "Kirill A. Shutemov" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/rmap.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) commit 85207ad8ea21156387fd0273e5360189df163661 Author: Hugh Dickins Date: Thu Mar 24 18:09:52 2022 -0700 mm: filemap_unaccount_folio() large skip mapcount fixup The page_mapcount_reset() when folio_mapped() while mapping_exiting() was devised long before there were huge or compound pages in the cache. It is still valid for small pages, but not at all clear what's right to check and reset on large pages. Just don't try when folio_test_large(). Link: https://lkml.kernel.org/r/879c4426-4122-da9c-1a86-697f2c9a083@google.com Signed-off-by: Hugh Dickins Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/filemap.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) commit bb43b14b576228c580bdc7e1aeeded54d540b5ef Author: Hugh Dickins Date: Thu Mar 24 18:09:49 2022 -0700 mm: delete __ClearPageWaiters() The PG_waiters bit is not included in PAGE_FLAGS_CHECK_AT_FREE, and vmscan.c's free_unref_page_list() callers rely on that not to generate bad_page() alerts. So __page_cache_release(), put_pages_list() and release_pages() (and presumably copy-and-pasted free_zone_device_page()) are redundant and misleading to make a special point of clearing it (as the "__" implies, it could only safely be used on the freeing path). Delete __ClearPageWaiters(). Remark on this in one of the "possible" comments in folio_wake_bit(), and delete the superfluous comments. Link: https://lkml.kernel.org/r/3eafa969-5b1a-accf-88fe-318784c791a@google.com Signed-off-by: Hugh Dickins Tested-by: Yu Zhao Reviewed-by: Yang Shi Reviewed-by: David Hildenbrand Cc: Matthew Wilcox Cc: Nicholas Piggin Cc: Yu Zhao Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/page-flags.h | 2 +- mm/filemap.c | 23 ++++++++--------------- mm/memremap.c | 2 -- mm/swap.c | 4 ---- 4 files changed, 9 insertions(+), 22 deletions(-) commit 6f6a841fb77df0bc6383133b22feb9b015380a55 Author: Mike Rapoport Date: Thu Mar 24 18:09:46 2022 -0700 selftest/vm: add helpers to detect PAGE_SIZE and PAGE_SHIFT PAGE_SIZE is not 4096 in many configurations, particularly ppc64 uses 64K pages in majority of cases. Add helpers to detect PAGE_SIZE and PAGE_SHIFT dynamically. Without this tests are broken w.r.t reading /proc/self/pagemap if (pread(pagemap_fd, ent, sizeof(ent), (uintptr_t)ptr >> (PAGE_SHIFT - 3)) != sizeof(ent)) err(2, "read pagemap"); Link: https://lkml.kernel.org/r/20220307054355.149820-2-aneesh.kumar@linux.ibm.com Signed-off-by: Mike Rapoport Signed-off-by: Aneesh Kumar K.V Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/gup_test.c | 3 ++- tools/testing/selftests/vm/util.h | 27 ++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) commit 90647d9d725068ad27d39f80d2b4a5150d041038 Author: Aneesh Kumar K.V Date: Thu Mar 24 18:09:43 2022 -0700 selftest/vm: add util.h and and move helper functions there Avoid code duplication by adding util.h. No functional change in this patch. Link: https://lkml.kernel.org/r/20220307054355.149820-1-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Cc: Shuah Khan Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/ksm_tests.c | 38 +-------------------- tools/testing/selftests/vm/transhuge-stress.c | 41 ++--------------------- tools/testing/selftests/vm/util.h | 48 +++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 75 deletions(-) commit 1a9762b2d7a56e9926a22a627972423840a1aabb Author: Christoph Hellwig Date: Thu Mar 24 18:09:40 2022 -0700 mm: unexport page_init_poison page_init_poison is only used in core MM code, so unexport it. Link: https://lkml.kernel.org/r/20220207063446.1833404-1-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/debug.c | 1 - 1 file changed, 1 deletion(-) commit 9c8a0a8e599f4a949ef18207ba495fb557dd1016 Author: Jiajian Ye Date: Thu Mar 24 18:09:38 2022 -0700 tools/vm/page_owner_sort.c: support for user-defined culling rules When viewing page owner information, we may want to cull blocks of information with our own rules. So it is important to enhance culling function to provide the support for customizing culling rules. Therefore, following adjustments are made: 1. Add --cull option to support the culling of blocks of information with user-defined culling rules. ./page_owner_sort --cull= ./page_owner_sort --cull is a single argument in the form of a comma-separated list to specify individual culling rules, by the sequence of keys k1,k2, .... Mixed use of abbreviated and complete-form of keys is allowed. For reference, please see the document(Documentation/vm/page_owner.rst). Now, assuming two blocks in the input file are as follows: Page allocated via order 0, mask xxxx, pid 1, tgid 1 (task_name_demo) PFN xxxx prep_new_page+0xd0/0xf8 get_page_from_freelist+0x4a0/0x1290 __alloc_pages+0x168/0x340 alloc_pages+0xb0/0x158 Page allocated via order 0, mask xxxx, pid 32, tgid 32 (task_name_demo) PFN xxxx prep_new_page+0xd0/0xf8 get_page_from_freelist+0x4a0/0x1290 __alloc_pages+0x168/0x340 alloc_pages+0xb0/0x158 If we want to cull the blocks by stacktrace and task command name, we can use this command: ./page_owner_sort --cull=stacktrace,name The output would be like: 2 times, 2 pages, task_comm_name: task_name_demo prep_new_page+0xd0/0xf8 get_page_from_freelist+0x4a0/0x1290 __alloc_pages+0x168/0x340 alloc_pages+0xb0/0x158 As we can see, these two blocks are culled successfully, for they share the same pid and task command name. However, if we want to cull the blocks by pid, stacktrace and task command name, we can this command: ./page_owner_sort --cull=stacktrace,name,pid The output would be like: 1 times, 1 pages, PID 1, task_comm_name: task_name_demo prep_new_page+0xd0/0xf8 get_page_from_freelist+0x4a0/0x1290 __alloc_pages+0x168/0x340 alloc_pages+0xb0/0x158 1 times, 1 pages, PID 32, task_comm_name: task_name_demo prep_new_page+0xd0/0xf8 get_page_from_freelist+0x4a0/0x1290 __alloc_pages+0x168/0x340 alloc_pages+0xb0/0x158 As we can see, these two blocks are failed to cull, for their PIDs are different. 2. Add explanations of --cull options to the document. This work is coauthored by Yixuan Cao Shenghong Han Yinan Zhang Chongxi Zhao Yuhong Feng Link: https://lkml.kernel.org/r/20220312145834.624-1-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Yixuan Cao Cc: Shenghong Han Cc: Yinan Zhang Cc: Chongxi Zhao Cc: Yuhong Feng Cc: Stephen Rothwell Cc: Sean Anderson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/page_owner.rst | 29 +++++++- tools/vm/page_owner_sort.c | 150 ++++++++++++++++++++++++++++++++++------ 2 files changed, 157 insertions(+), 22 deletions(-) commit 8ea8613a616aff184df9e3ea2d3ec39d90832867 Author: Jiajian Ye Date: Thu Mar 24 18:09:34 2022 -0700 tools/vm/page_owner_sort.c: support for selecting by PID, TGID or task command name When viewing page owner information, we may also need to select the blocks by PID, TGID or task command name, which helps to get more accurate page allocation information as needed. Therefore, following adjustments are made: 1. Add three new options, including --pid, --tgid and --name, to support the selection of information blocks by a specific pid, tgid and task command name. In addtion, multiple options are allowed to be used at the same time. ./page_owner_sort [input] [output] --pid ./page_owner_sort [input] [output] --tgid ./page_owner_sort [input] [output] --name Assuming a scenario when a multi-threaded program, ./demo (PID = 5280), is running, and ./demo creates a child process (PID = 5281). $ps PID TTY TIME CMD 5215 pts/0 00:00:00 bash 5280 pts/0 00:00:00 ./demo 5281 pts/0 00:00:00 ./demo 5282 pts/0 00:00:00 ps It would be better to filter out the records with tgid=5280 and the task name "demo" when debugging the parent process, and the specific usage is ./page_owner_sort [input] [output] --tgid 5280 --name demo 2. Add explanations of three new options, including --pid, --tgid and --name, to the document. This work is coauthored by Shenghong Han , Yixuan Cao , Yinan Zhang , Chongxi Zhao , Yuhong Feng . Link: https://lkml.kernel.org/r/1646835223-7584-1-git-send-email-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Sean Anderson Cc: Stephen Rothwell Cc: Zhenliang Wei Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/page_owner.rst | 5 ++ tools/vm/page_owner_sort.c | 120 +++++++++++++++++++++++++++++++--------- 2 files changed, 98 insertions(+), 27 deletions(-) commit 194d52d771b8f7cf5bcf0f81f87dd76e492c355c Author: Jiajian Ye Date: Thu Mar 24 18:09:31 2022 -0700 tools/vm/page_owner_sort: support for sorting by task command name When viewing page owner information, we may also need to the block to be sorted by task command name. Therefore, the following adjustments are made: 1. Add a member variable to record task command name of block. 2. Add a new -n option to sort the information of blocks by task command name. 3. Add -n option explanation in the document. Link: https://lkml.kernel.org/r/20220306030640.43054-2-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Stephen Rothwell Cc: Sean Anderson Cc: Yixuan Cao Cc: Zhenliang Wei Cc: Cc: Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/page_owner.rst | 1 + tools/vm/page_owner_sort.c | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) commit 578d8f2761a828f6c3409d0931b036bf3a999246 Author: Jiajian Ye Date: Thu Mar 24 18:09:29 2022 -0700 tools/vm/page_owner_sort: fix three trivival places The following adjustments are made: 1. Instead of using another array to cull the blocks after sorting, reuse the old array. So there is no need to malloc a new array. 2. When enabling '-f' option to filter out the blocks which have been released, only add those have not been released in the list, rather than add all of blocks in the list and then do the filtering when printing the result. 3. When enabling '-c' option to cull the blocks by comparing stacktrace, print the stacetrace rather than the total block. Link: https://lkml.kernel.org/r/20220306030640.43054-1-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Cc: Sean Anderson Cc: Stephen Rothwell Cc: Yixuan Cao Cc: Cc: Zhenliang Wei Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) commit cf3c2c8678a0b21052d00b64d7a5903f3b1d1197 Author: Jiajian Ye Date: Thu Mar 24 18:09:26 2022 -0700 tools/vm/page_owner_sort.c: support sorting by tgid and update documentation When the "page owner" information is read, the information sorted by TGID is expected. As a result, the following adjustments have been made: 1. Add a new -P option to sort the information of blocks by TGID in ascending order. 2. Adjust the order of member variables in block_list strust to avoid one 4 byte hole. 3. Add -P option explanation in the document. Link: https://lkml.kernel.org/r/20220301151438.166118-3-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Stephen Rothwell Cc: Yixuan Cao Cc: Zhenliang Wei Cc: Yinan Zhang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/page_owner.rst | 1 + tools/vm/page_owner_sort.c | 40 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) commit 56465a38305f22bca3469c2738d7320a0c333e72 Author: Jiajian Ye Date: Thu Mar 24 18:09:23 2022 -0700 tools/vm/page_owner_sort.c: add a security check Add a security check after using malloc() to allocate memory. Link: https://lkml.kernel.org/r/20220301151438.166118-2-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Stephen Rothwell Cc: Yinan Zhang Cc: Yixuan Cao Cc: Zhenliang Wei Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 59d7cb27d528eae2f060d548dcd14d292b19fda3 Author: Jiajian Ye Date: Thu Mar 24 18:09:20 2022 -0700 tools/vm/page_owner_sort.c: fix comments Two adjustments are made: 1. Correct a grammatical error: replace the "what" in "Do the job what you want to debug" with "that". 2. Replace "has not been" with "has been" in the description of the -f option: According to Commit b1c9ba071e7d ("tools/vm/page_owner_sort.c: fix the instructions for use"), the description of the "-f" option is "Filter out the information of blocks whose memory has been released." Link: https://lkml.kernel.org/r/20220301151438.166118-1-yejiajian2018@email.szu.edu.cn Signed-off-by: Jiajian Ye Cc: Stephen Rothwell Cc: Yinan Zhang Cc: Yixuan Cao Cc: Zhenliang Wei Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/page_owner.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 49e495a015e9cc127728b0f353a15d16da138fb8 Author: Yixuan Cao Date: Thu Mar 24 18:09:17 2022 -0700 tools/vm/page_owner_sort.c: fix the instructions for use I noticed a discrepancy between the usage method and the code logic. If we enable the -f option, it should be "Filter out the information of blocks whose memory has been released". Link: https://lkml.kernel.org/r/20220219143106.2805-1-caoyixuan2019@email.szu.edu.cn Signed-off-by: Yixuan Cao Cc: Stephen Rothwell Cc: Sean Anderson Cc: Muchun Song Cc: Zhenliang Wei Cc: Tang Bin Cc: Yinan Zhang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bf215eab785a30756ea1e53b62a5638d1177a795 Author: Yixuan Cao Date: Thu Mar 24 18:09:14 2022 -0700 mm/page_owner.c: record tgid In a single-threaded process, the pid in kernel task_struct is the same as the tgid, which can mark the process of page allocation. But in a multithreaded process, only the task_struct of the thread leader has the same pid as tgid, and the pids of other threads are different from tgid. Therefore, tgid is recorded to provide effective information for debugging and data statistics of multithreaded programs. This can also be achieved by observing the task name (executable file name) for a specific process. However, when the same program is started multiple times, the task name is the same and the tgid is different. Therefore, in the debugging of multi-threaded programs, combined with the task name and tgid, more accurate runtime information of a certain run of the program can be obtained. Link: https://lkml.kernel.org/r/20220219180450.2399-1-caoyixuan2019@email.szu.edu.cn Signed-off-by: Yixuan Cao Cc: Waiman Long Cc: Rafael Aquini Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_owner.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit 865ed6a3278654ce4a55eb74c5283eeb82ad4699 Author: Waiman Long Date: Thu Mar 24 18:09:11 2022 -0700 mm/page_owner: record task command name The page_owner information currently includes the pid of the calling task. That is useful as long as the task is still running. Otherwise, the number is meaningless. To have more information about the allocating tasks that had exited by the time the page_owner information is retrieved, we need to store the command name of the task. Add a new comm field into page_owner structure to store the command name and display it when the page_owner information is retrieved. Link: https://lkml.kernel.org/r/20220202203036.744010-5-longman@redhat.com Signed-off-by: Waiman Long Acked-by: Rafael Aquini Cc: Andy Shevchenko Cc: David Rientjes Cc: Ira Weiny Cc: Johannes Weiner Cc: Michal Hocko Cc: Mike Rapoport Cc: Petr Mladek Cc: Rasmus Villemoes Cc: Roman Gushchin Cc: Sergey Senozhatsky Cc: Steven Rostedt (Google) Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_owner.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit fcf8935832b86d3437f00e732c6d0d4d2819d6a9 Author: Waiman Long Date: Thu Mar 24 18:09:08 2022 -0700 mm/page_owner: print memcg information It was found that a number of offline memcgs were not freed because they were pinned by some charged pages that were present. Even "echo 1 > /proc/sys/vm/drop_caches" wasn't able to free those pages. These offline but not freed memcgs tend to increase in number over time with the side effect that percpu memory consumption as shown in /proc/meminfo also increases over time. In order to find out more information about those pages that pin offline memcgs, the page_owner feature is extended to print memory cgroup information especially whether the cgroup is offline or not. RCU read lock is taken when memcg is being accessed to make sure that it won't be freed. Link: https://lkml.kernel.org/r/20220202203036.744010-4-longman@redhat.com Signed-off-by: Waiman Long Acked-by: David Rientjes Acked-by: Roman Gushchin Acked-by: Rafael Aquini Acked-by: Mike Rapoport Cc: Roman Gushchin Cc: Andy Shevchenko Cc: Ira Weiny Cc: Johannes Weiner Cc: Michal Hocko Cc: Petr Mladek Cc: Rasmus Villemoes Cc: Sergey Senozhatsky Cc: Steven Rostedt (Google) Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_owner.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) commit 3ebc439761273274ea00258da84d997841f01e72 Author: Waiman Long Date: Thu Mar 24 18:09:05 2022 -0700 mm/page_owner: use scnprintf() to avoid excessive buffer overrun check The snprintf() function can return a length greater than the given input size. That will require a check for buffer overrun after each invocation of snprintf(). scnprintf(), on the other hand, will never return a greater length. By using scnprintf() in selected places, we can avoid some buffer overrun checks except after stack_depot_snprint() and after the last snprintf(). Link: https://lkml.kernel.org/r/20220202203036.744010-3-longman@redhat.com Signed-off-by: Waiman Long Acked-by: David Rientjes Reviewed-by: Sergey Senozhatsky Acked-by: Rafael Aquini Acked-by: Mike Rapoport Cc: Andy Shevchenko Cc: Ira Weiny Cc: Johannes Weiner Cc: Michal Hocko Cc: Petr Mladek Cc: Rasmus Villemoes Cc: Roman Gushchin Cc: Steven Rostedt (Google) Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_owner.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) commit ef62c8ff1de437ec2e0582205c1293c7dbbc4484 Author: Waiman Long Date: Thu Mar 24 18:09:02 2022 -0700 lib/vsprintf: avoid redundant work with 0 size Patch series "mm/page_owner: Extend page_owner to show memcg information", v4. While debugging the constant increase in percpu memory consumption on a system that spawned large number of containers, it was found that a lot of offline mem_cgroup structures remained in place without being freed. Further investigation indicated that those mem_cgroup structures were pinned by some pages. In order to find out what those pages are, the existing page_owner debugging tool is extended to show memory cgroup information and whether those memcgs are offline or not. With the enhanced page_owner tool, the following is a typical page that pinned the mem_cgroup structure in my test case: Page allocated via order 0, mask 0x1100cca(GFP_HIGHUSER_MOVABLE), pid 162970 (podman), ts 1097761405537 ns, free_ts 1097760838089 ns PFN 1925700 type Movable Block 3761 type Movable Flags 0x17ffffc00c001c(uptodate|dirty|lru|reclaim|swapbacked|node=0|zone=2|lastcpupid=0x1fffff) prep_new_page+0xac/0xe0 get_page_from_freelist+0x1327/0x14d0 __alloc_pages+0x191/0x340 alloc_pages_vma+0x84/0x250 shmem_alloc_page+0x3f/0x90 shmem_alloc_and_acct_page+0x76/0x1c0 shmem_getpage_gfp+0x281/0x940 shmem_write_begin+0x36/0xe0 generic_perform_write+0xed/0x1d0 __generic_file_write_iter+0xdc/0x1b0 generic_file_write_iter+0x5d/0xb0 new_sync_write+0x11f/0x1b0 vfs_write+0x1ba/0x2a0 ksys_write+0x59/0xd0 do_syscall_64+0x37/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Charged to offline memcg libpod-conmon-15e4f9c758422306b73b2dd99f9d50a5ea53cbb16b4a13a2c2308a4253cc0ec8. So the page was not freed because it was part of a shmem segment. That is useful information that can help users to diagnose similar problems. With cgroup v1, /proc/cgroups can be read to find out the total number of memory cgroups (online + offline). With cgroup v2, the cgroup.stat of the root cgroup can be read to find the number of dying cgroups (most likely pinned by dying memcgs). The page_owner feature is not supposed to be enabled for production system due to its memory overhead. However, if it is suspected that dying memcgs are increasing over time, a test environment with page_owner enabled can then be set up with appropriate workload for further analysis on what may be causing the increasing number of dying memcgs. This patch (of 4): For *scnprintf(), vsnprintf() is always called even if the input size is 0. That is a waste of time, so just return 0 in this case. Note that vsnprintf() will never return -1 to indicate an error. So skipping the call to vsnprintf() when size is 0 will have no functional impact at all. Link: https://lkml.kernel.org/r/20220202203036.744010-1-longman@redhat.com Link: https://lkml.kernel.org/r/20220202203036.744010-2-longman@redhat.com Signed-off-by: Waiman Long Acked-by: David Rientjes Reviewed-by: Sergey Senozhatsky Acked-by: Roman Gushchin Acked-by: Rafael Aquini Acked-by: Mike Rapoport Cc: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Petr Mladek Cc: Steven Rostedt (Google) Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Ira Weiny Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/vsprintf.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 2e9449856b94bb89bc826695bf8d6d21547e7209 Author: Shuah Khan Date: Thu Mar 24 18:08:59 2022 -0700 Documentation/vm/page_owner.rst: fix unexpected indentation warns Fix Unexpected indentation warns in page_owner: Documentation/vm/page_owner.rst:92: WARNING: Unexpected indentation. Documentation/vm/page_owner.rst:96: WARNING: Unexpected indentation. Documentation/vm/page_owner.rst:107: WARNING: Unexpected indentation. Link: https://lkml.kernel.org/r/20211215001929.47866-1-skhan@linuxfoundation.org Signed-off-by: Shuah Khan Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/page_owner.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 57f2b54a937987847e666aaf56d207aa457adee6 Author: Shenghong Han Date: Thu Mar 24 18:08:56 2022 -0700 Documentation/vm/page_owner.rst: update the documentation Update the documentation of ``page_owner``. [akpm@linux-foundation.org: small grammatical tweaks] Link: https://lkml.kernel.org/r/20211214134736.2569-1-hanshenghong2019@email.szu.edu.cn Signed-off-by: Shenghong Han Cc: Jonathan Corbet Cc: Vlastimil Babka Cc: Georgi Djakov Cc: Liam Mark Cc: Tang Bin Cc: Zhang Shengju Cc: Zhenliang Wei Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/page_owner.rst | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) commit 41ed64347b5db8f6c9359d4f87f768db1a83bd79 Author: Yixuan Cao Date: Thu Mar 24 18:08:53 2022 -0700 tools/vm/page_owner_sort.c: delete invalid duplicate code I noticed that there is two invalid lines of duplicate code. It's better to delete it. Link: https://lkml.kernel.org/r/20211213095743.3630-1-caoyixuan2019@email.szu.edu.cn Signed-off-by: Yixuan Cao Cc: Mark Brown Cc: Sean Anderson Cc: Zhenliang Wei Cc: Tang Bin Cc: Yinan Zhang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 2 -- 1 file changed, 2 deletions(-) commit e7a3f6776905b4e0b61692add3d0808315379c89 Author: Shenghong Han Date: Thu Mar 24 18:08:50 2022 -0700 tools/vm/page_owner_sort.c: two trivial fixes 1) There is an unused variable. It's better to delete it. 2) One case is missing in the usage(). Link: https://lkml.kernel.org/r/20211213164518.2461-1-hanshenghong2019@email.szu.edu.cn Signed-off-by: Shenghong Han Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 8f9c447e2e2b53c2db4fac85fc42ecada8b39e52 Author: Chongxi Zhao Date: Thu Mar 24 18:08:47 2022 -0700 tools/vm/page_owner_sort.c: support sorting pid and time When viewing the page owner information, we expect that the information can be sorted by PID, so that we can quickly combine PID with the program to check the information together. We also expect that the information can be sorted by time. Time sorting helps to view the running status of the program according to the time interval when the program hangs up. Finally, we hope to pass the page_ owner_ Sort. C can reduce part of the output and only output the plate information whose memory has not been released, which can make us locate the problem of the program faster. Therefore, the following adjustments have been made: 1. Add the static functions search_pattern and check_regcomp to improve the cleanliness. 2. Add member attributes and their corresponding sorting methods. In terms of comparison time, int will overflow because the data of ull is too large, so the ternary operator is used 3. Add the -f parameter to filter out the information of blocks whose memory has not been released Link: https://lkml.kernel.org/r/20211206165653.5093-1-zhaochongxi2019@email.szu.edu.cn Signed-off-by: Chongxi Zhao Reviewed-by: Sean Anderson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 177 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 148 insertions(+), 29 deletions(-) commit cd75ea0e32620c622aeaef531ef7b9f59c67f7a6 Author: Yinan Zhang Date: Thu Mar 24 18:08:44 2022 -0700 tools/vm/page_owner_sort.c: add switch between culling by stacktrace and txt Culling by comparing stacktrace would casue loss of some information. For example, if there exists 2 blocks which have the same stacktrace and the different head info Page allocated via order 0, mask 0x108c48(...), pid 73696, ts 1578829190639010 ns, free_ts 1576583851324450 ns prep_new_page+0x80/0xb8 get_page_from_freelist+0x924/0xee8 __alloc_pages+0x138/0xc18 alloc_pages+0x80/0xf0 __page_cache_alloc+0x90/0xc8 Page allocated via order 0, mask 0x108c48(...), pid 61806, ts 1354113726046100 ns, free_ts 1354104926841400 ns prep_new_page+0x80/0xb8 get_page_from_freelist+0x924/0xee8 __alloc_pages+0x138/0xc18 alloc_pages+0x80/0xf0 __page_cache_alloc+0x90/0xc8 After culling, it would be like this 2 times, 2 pages: Page allocated via order 0, mask 0x108c48(...), pid 73696, ts 1578829190639010 ns, free_ts 1576583851324450 ns prep_new_page+0x80/0xb8 get_page_from_freelist+0x924/0xee8 __alloc_pages+0x138/0xc18 alloc_pages+0x80/0xf0 __page_cache_alloc+0x90/0xc8 The info of second block missed. So, add -c to turn on culling by stacktrace. By default, it will cull by txt. Link: https://lkml.kernel.org/r/20211129145658.2491-1-zhangyinan2019@email.szu.edu.cn Signed-off-by: Yinan Zhang Cc: Changhee Han Cc: Sean Anderson Cc: Stephen Rothwell Cc: Tang Bin Cc: Zhang Shengju Cc: Zhenliang Wei Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) commit 82f5ebc2beb3c803bf17bead4e38c1d5bf2c8d78 Author: Sean Anderson Date: Thu Mar 24 18:08:41 2022 -0700 tools/vm/page_owner_sort.c: support sorting by stack trace This adds the ability to sort by stacktraces. This is helpful when comparing multiple dumps of page_owner taken at different times, since blocks will not be reordered if they were allocated/free'd. Link: https://lkml.kernel.org/r/20211124193709.1805776-2-seanga2@gmail.com Signed-off-by: Sean Anderson Cc: Zhenliang Wei Cc: Changhee Han Cc: Tang Bin Cc: Zhang Shengju Cc: Stephen Rothwell Cc: Yinan Zhang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) commit ba5a396be51cd232d6647f70f7d792c6dcc63223 Author: Sean Anderson Date: Thu Mar 24 18:08:38 2022 -0700 tools/vm/page_owner_sort.c: sort by stacktrace before culling The contents of page_owner have changed to include more information than the stack trace. On a modern kernel, the blocks look like Page allocated via order 0, mask 0x0(), pid 1, ts 165564237 ns, free_ts 0 ns register_early_stack+0x4b/0x90 init_page_owner+0x39/0x250 kernel_init_freeable+0x11e/0x242 kernel_init+0x16/0x130 Sorting by the contents of .txt will result in almost no repeated pages, as the pid, ts, and free_ts will almost never be the same. Instead, sort by the contents of the stack trace, which we assume to be whatever is after the first line. [seanga2@gmail.com: fix NULL-pointer dereference when comparing stack traces] Link: https://lkml.kernel.org/r/20211125162653.1855958-1-seanga2@gmail.com Link: https://lkml.kernel.org/r/20211124193709.1805776-1-seanga2@gmail.com Signed-off-by: Sean Anderson Cc: Changhee Han Cc: Tang Bin Cc: Zhang Shengju Cc: Zhenliang Wei Cc: Stephen Rothwell Cc: Yinan Zhang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/vm/page_owner_sort.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit a81687886ca9a64c0aeefefcbc6e7a64ce083ab0 Merge: 9fe087dda5bf 88704454ef8b Author: Jakub Kicinski Date: Thu Mar 24 18:36:38 2022 -0700 Merge branch 'vsock-virtio-enable-vqs-early-on-probe-and-finish-the-setup-before-using-them' Stefano Garzarella says: ==================== vsock/virtio: enable VQs early on probe and finish the setup before using them The first patch fixes a virtio-spec violation. The other two patches complete the driver configuration before using the VQs in the probe. The patch order should simplify backporting in stable branches. v2: https://lore.kernel.org/netdev/20220323084954.11769-1-sgarzare@redhat.com/ v1: https://lore.kernel.org/netdev/20220322103823.83411-1-sgarzare@redhat.com/ ==================== Link: https://lore.kernel.org/r/20220323173625.91119-1-sgarzare@redhat.com Signed-off-by: Jakub Kicinski commit 88704454ef8b00ea91537ae0d47d9348077e0e72 Author: Stefano Garzarella Date: Wed Mar 23 18:36:25 2022 +0100 vsock/virtio: enable VQs early on probe virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, but virtio-vsock driver uses VQs in the probe function to fill rx and event VQs with new buffers. Let's fix this, calling virtio_device_ready() before using VQs in the probe function. Fixes: 0ea9e1d3a9e3 ("VSOCK: Introduce virtio_transport.ko") Signed-off-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Signed-off-by: Jakub Kicinski net/vmw_vsock/virtio_transport.c | 2 ++ 1 file changed, 2 insertions(+) commit c1011c0b3a9c8d2065f425407475cbcc812540b7 Author: Stefano Garzarella Date: Wed Mar 23 18:36:24 2022 +0100 vsock/virtio: read the negotiated features before using VQs Complete the driver configuration, reading the negotiated features, before using the VQs in the virtio_vsock_probe(). Fixes: 53efbba12cc7 ("virtio/vsock: enable SEQPACKET for transport") Suggested-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Signed-off-by: Jakub Kicinski net/vmw_vsock/virtio_transport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 4b5f1ad5566ada230aaa2ce861b28d1895f1ea68 Author: Stefano Garzarella Date: Wed Mar 23 18:36:23 2022 +0100 vsock/virtio: initialize vdev->priv before using VQs When we fill VQs with empty buffers and kick the host, it may send an interrupt. `vdev->priv` must be initialized before this since it is used in the virtqueue callbacks. Fixes: 0deab087b16a ("vsock/virtio: use RCU to avoid use-after-free on the_virtio_vsock") Suggested-by: Michael S. Tsirkin Signed-off-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Signed-off-by: Jakub Kicinski net/vmw_vsock/virtio_transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 85c7000fda0029ec16569b1eec8fd3a8d026be73 Merge: b1b07ba356f0 f639d9867eea Author: Linus Torvalds Date: Thu Mar 24 18:32:48 2022 -0700 Merge tag 'ceph-for-5.18-rc1' of https://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: "The highlights are: - several changes to how snap context and snap realms are tracked (Xiubo Li). In particular, this should resolve a long-standing issue of high kworker CPU usage and various stalls caused by needless iteration over all inodes in the snap realm. - async create fixes to address hangs in some edge cases (Jeff Layton) - support for getvxattr MDS op for querying server-side xattrs, such as file/directory layouts and ephemeral pins (Milind Changire) - average latency is now maintained for all metrics (Venky Shankar) - some tweaks around handling inline data to make it fit better with netfs helper library (David Howells) Also a couple of memory leaks got plugged along with a few assorted fixups. Last but not least, Xiubo has stepped up to serve as a CephFS co-maintainer" * tag 'ceph-for-5.18-rc1' of https://github.com/ceph/ceph-client: (27 commits) ceph: fix memory leak in ceph_readdir when note_last_dentry returns error ceph: uninitialized variable in debug output ceph: use tracked average r/w/m latencies to display metrics in debugfs ceph: include average/stdev r/w/m latency in mds metrics ceph: track average r/w/m latency ceph: use ktime_to_timespec64() rather than jiffies_to_timespec64() ceph: assign the ci only when the inode isn't NULL ceph: fix inode reference leakage in ceph_get_snapdir() ceph: misc fix for code style and logs ceph: allocate capsnap memory outside of ceph_queue_cap_snap() ceph: do not release the global snaprealm until unmounting ceph: remove incorrect and unused CEPH_INO_DOTDOT macro MAINTAINERS: add Xiubo Li as cephfs co-maintainer ceph: eliminate the recursion when rebuilding the snap context ceph: do not update snapshot context when there is no new snapshot ceph: zero the dir_entries memory when allocating it ceph: move to a dedicated slabcache for ceph_cap_snap ceph: add getvxattr op libceph: drop else branches in prepare_read_data{,_cont} ceph: fix comments mentioning i_mutex ... commit 9fe087dda5bf097007b263664051bc0e84f6580d Author: Greg Jesionowski Date: Wed Mar 23 15:00:24 2022 -0700 net: usb: ax88179_178a: add Allied Telesis AT-UMCs Adds the driver_info and IDs for the AX88179 based Allied Telesis AT-UMC family of devices. Signed-off-by: Greg Jesionowski Link: https://lore.kernel.org/r/20220323220024.GA36800@test-HP-EliteDesk-800-G1-SFF Signed-off-by: Jakub Kicinski drivers/net/usb/ax88179_178a.c | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) commit b1b07ba356f04268230e16a8e1813fe1b19dac54 Merge: f0614eefbf82 01728b44ef1b Author: Linus Torvalds Date: Thu Mar 24 18:28:01 2022 -0700 Merge tag 'xfs-5.18-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Darrick Wong: "The biggest change this cycle is bringing XFS' inode attribute setting code back towards alignment with what the VFS does. IOWs, setgid bit handling should be a closer match with ext4 and btrfs behavior. The rest of the branch is bug fixes around the filesystem -- patching gaps in quota enforcement, removing bogus selinux audit messages, and fixing log corruption and problems with log recovery. There will be a second pull request later on in the merge window with more bug fixes. Dave Chinner will be taking over as XFS maintainer for one release cycle, starting from the day 5.18-rc1 drops until 5.19-rc1 is tagged so that I can focus on starting a massive design review for the (feature complete after five years) online repair feature. Summary: - Fix some incorrect mapping state being passed to iomap during COW - Don't create bogus selinux audit messages when deciding to degrade gracefully due to lack of privilege - Fix setattr implementation to use VFS helpers so that we drop setgid consistently with the other filesystems - Fix link/unlink/rename to check quota limits - Constify xfs_name_dotdot to prevent abuse of in-kernel symbols - Fix log livelock between the AIL and inodegc threads during recovery - Fix a log stall when the AIL races with pushers - Fix stalls in CIL flushes due to pinned inode cluster buffers during recovery - Fix log corruption due to incorrect usage of xfs_is_shutdown vs xlog_is_shutdown because during an induced fs shutdown, AIL writeback must continue until the log is shut down, even if the filesystem has already shut down" * tag 'xfs-5.18-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: xfs_is_shutdown vs xlog_is_shutdown cage fight xfs: AIL should be log centric xfs: log items should have a xlog pointer, not a mount xfs: async CIL flushes need pending pushes to be made stable xfs: xfs_ail_push_all_sync() stalls when racing with updates xfs: check buffer pin state after locking in delwri_submit xfs: log worker needs to start before intent/unlink recovery xfs: constify xfs_name_dotdot xfs: constify the name argument to various directory functions xfs: reserve quota for target dir expansion when renaming files xfs: reserve quota for dir expansion when linking/unlinking files xfs: refactor user/group quota chown in xfs_setattr_nonsize xfs: use setattr_copy to set vfs inode attributes xfs: don't generate selinux audit messages for capability testing xfs: add missing cmap->br_state = XFS_EXT_NORM update commit f0614eefbf829a2914ac9a82cb8bbeaf1af28f9d Merge: b9132c32e019 db8cd5efeebc Author: Linus Torvalds Date: Thu Mar 24 18:12:09 2022 -0700 Merge tag 'dax-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull DAX updates from Dan Williams: "Andrew has been shepherding major dax features that touch the core -mm through his tree, but I still collect the dax updates that are core-mm independent. - Fix a crash due to a missing rcu_barrier() in dax_fs_exit() - Fix two miscellaneous doc issues" * tag 'dax-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: dax: Fix missing kdoc for dax_device dax: make sure inodes are flushed before destroy cache fsdax: fix function description commit b9132c32e01976686efa26252cc246944a0d2cab Merge: b14ffae378aa 05e815539f3f Author: Linus Torvalds Date: Thu Mar 24 18:07:03 2022 -0700 Merge tag 'cxl-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull CXL (Compute Express Link) updates from Dan Williams: "This development cycle extends the subsystem to discover CXL resources throughout a CXL/PCIe switch topology and respond to hot add/remove events anywhere in that topology. This is more foundational infrastructure in preparation for dynamic memory region provisioning support. Recall that CXL memory regions, as the new "Theory of Operation" section of Documentation/driver-api/cxl/memory-devices.rst describes, bring storage volume striping semantics to memory. The hot add/remove behavior is validated with extensions to the cxl_test unit test environment and this test in the cxl-cli test suite: https://github.com/pmem/ndctl/blob/djbw/for-74/cxl/test/cxl-topology.sh Summary: - Add a driver for 'struct cxl_memdev' objects responsible for CXL.mem operation as distinct from 'cxl_pci' mailbox operations. Its primary responsibility is enumerating an endpoint 'struct cxl_port' and all the 'struct cxl_port' instances between an endpoint and the CXL platform root. - Add a driver for 'struct cxl_port' objects responsible for enumerating and operating all Host-managed Device Memory (HDM) decoder resources between the platform-level CXL memory description, all intervening host bridges / switches, and the HDM resources in endpoints. - Update the cxl_pci driver to validate CXL.mem operation precursors to HDM decoder operation like ready-polling, and legacy CXL 1.1 DVSEC based CXL.mem configuration. - Add basic lockdep coverage for usage of device_lock() on CXL subsystem objects similar to what exists for LIBNVDIMM. Include a compile-time switch for which subsystem to validate at run-time. - Update cxl_test to emulate a one level switch topology. - Document a "Theory of Operation" for the subsystem. - Add 'numa_node' and 'serial' attributes to cxl_memdev sysfs - Include miscellaneous fixes for spec / QEMU CXL emulation compatibility and static analysis reports" * tag 'cxl-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: (48 commits) cxl/core/port: Fix NULL but dereferenced coccicheck error cxl/port: Hold port reference until decoder release cxl/port: Fix endpoint refcount leak cxl/core: Fix cxl_device_lock() class detection cxl/core/port: Fix unregister_port() lock assertion cxl/regs: Fix size of CXL Capability Header Register cxl/core/port: Handle invalid decoders cxl/core/port: Fix / relax decoder target enumeration tools/testing/cxl: Add a physical_node link tools/testing/cxl: Enumerate mock decoders tools/testing/cxl: Mock one level of switches tools/testing/cxl: Fix root port to host bridge assignment tools/testing/cxl: Mock dvsec_ranges() cxl/core/port: Add endpoint decoders cxl/core: Move target_list out of base decoder attributes cxl/mem: Add the cxl_mem driver cxl/core/port: Add switch port enumeration cxl/memdev: Add numa_node attribute cxl/pci: Emit device serial number cxl/pci: Implement wait for media active ... commit 71021db1c532c2545ae53b9ee85b37b7154f51d4 Author: Konrad Dybcio Date: Sat Mar 19 18:49:40 2022 +0100 clk: qcom: gcc-msm8994: Fix gpll4 width The gpll4 postdiv is actually a div4, so make sure that Linux is aware of this. This fixes the following error messages: mmc1: Card appears overclocked; req 200000000 Hz, actual 343999999 Hz mmc1: Card appears overclocked; req 400000000 Hz, actual 687999999 Hz Fixes: aec89f78cf01 ("clk: qcom: Add support for msm8994 global clock controller") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20220319174940.341137-1-konrad.dybcio@somainline.org Tested-by: Petr Vorel Reviewed-by: Petr Vorel Signed-off-by: Stephen Boyd drivers/clk/qcom/gcc-msm8994.c | 1 + 1 file changed, 1 insertion(+) commit 109d899452ba17996eccec7ae8249fb1f8900a16 Author: Alvin Šipraga Date: Wed Mar 23 13:42:25 2022 +0100 net: dsa: realtek: make interface drivers depend on OF The kernel test robot reported build warnings with a randconfig that built realtek-{smi,mdio} without CONFIG_OF set. Since both interface drivers are using OF and will not probe without, add the corresponding dependency to Kconfig. Link: https://lore.kernel.org/all/202203231233.Xx73Y40o-lkp@intel.com/ Link: https://lore.kernel.org/all/202203231439.ycl0jg50-lkp@intel.com/ Fixes: aac94001067d ("net: dsa: realtek: add new mdio interface for drivers") Fixes: 765c39a4fafe ("net: dsa: realtek: convert subdrivers into modules") Signed-off-by: Alvin Šipraga Reviewed-by: Andrew Lunn Acked-by: Luiz Angelo Daros de Luca Link: https://lore.kernel.org/r/20220323124225.91763-1-alvin@pqrs.dk Signed-off-by: Jakub Kicinski drivers/net/dsa/realtek/Kconfig | 2 ++ 1 file changed, 2 insertions(+) commit adbf85aaf7da509e666dc33eca5b907080d8d9fd Author: Ansuel Smith Date: Wed Mar 23 20:42:48 2022 +0100 dt-bindings: clock: fix dt_binding_check error for qcom,gcc-other.yaml qcom,gcc-other Documentation lacks a '|' for the description. This cause dt_binding_check to incorrectly parse "See also:" as a new value. Add the missing '|' to correctly parse the description. Fixes: a03965ed1310 ("dt-bindings: clock: split qcom,gcc.yaml to common and specific schema") Signed-off-by: Ansuel Smith Link: https://lore.kernel.org/r/20220323194248.26970-1-ansuelsmth@gmail.com Reviewed-by: Krzysztof Kozlowski Reported-by: Rob Herring Signed-off-by: Stephen Boyd Documentation/devicetree/bindings/clock/qcom,gcc-other.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ffba2123e1714a27e9362fda57c42155dda37efc Author: Bjorn Andersson Date: Tue Mar 22 20:32:55 2022 -0700 net: stmmac: dwmac-qcom-ethqos: Enable RGMII functional clock on resume When the Qualcomm ethqos driver is properly described in its associated GDSC power-domain, the hardware will be powered down and loose its state between qcom_ethqos_probe() and stmmac_init_dma_engine(). The result of this is that the functional clock from the RGMII IO macro is no longer provides and the DMA software reset in dwmac4_dma_reset() will time out, due to lacking clock signal. Re-enable the functional clock, as part of the Qualcomm specific clock enablement sequence to avoid this problem. The final clock configuration will be adjusted by ethqos_fix_mac_speed() once the link is being brought up. Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos") Signed-off-by: Bjorn Andersson Tested-and-reviewed-by: Bhupesh Sharma Link: https://lore.kernel.org/r/20220323033255.2282930-1-bjorn.andersson@linaro.org Signed-off-by: Jakub Kicinski drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 2a81dba4b577099717cea86d429f053e85e74d96 Author: Thomas Zimmermann Date: Sun Mar 13 20:29:52 2022 +0100 fbdev: Fix cfb_imageblit() for arbitrary image widths Commit 0d03011894d2 ("fbdev: Improve performance of cfb_imageblit()") broke cfb_imageblit() for image widths that are not aligned to 8-bit boundaries. Fix this by handling the trailing pixels on each line separately. The performance improvements in the original commit do not regress by this change. Signed-off-by: Thomas Zimmermann Fixes: 0d03011894d2 ("fbdev: Improve performance of cfb_imageblit()") Reported-by: Marek Szyprowski Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Sam Ravnborg Tested-by: Marek Szyprowski Acked-by: Daniel Vetter Reviewed-by: Javier Martinez Canillas Tested-by: Guenter Roeck Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20220313192952.12058-3-tzimmermann@suse.de drivers/video/fbdev/core/cfbimgblt.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) commit 40faaf80c463b2c99a0351d28bd74d75d64ed017 Author: Thomas Zimmermann Date: Sun Mar 13 20:29:51 2022 +0100 fbdev: Fix sys_imageblit() for arbitrary image widths Commit 6f29e04938bf ("fbdev: Improve performance of sys_imageblit()") broke sys_imageblit() for image width that are not aligned to 8-bit boundaries. Fix this by handling the trailing pixels on each line separately. The performance improvements in the original commit do not regress by this change. Signed-off-by: Thomas Zimmermann Fixes: 6f29e04938bf ("fbdev: Improve performance of sys_imageblit()") Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Sam Ravnborg Tested-by: Geert Uytterhoeven Reviewed-by: Javier Martinez Canillas Signed-off-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20220313192952.12058-2-tzimmermann@suse.de drivers/video/fbdev/core/sysimgblt.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) commit c73c3576a2227492b448f9be41428ce6a0b5855a Merge: 21050a39a3b6 7344bad7fb6d Author: Dave Airlie Date: Fri Mar 25 09:51:47 2022 +1000 Merge tag 'drm-misc-next-fixes-2022-03-24-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next-fixes for v5.18-rc1: - Make audio and color plane support checking only happen when a CEA extension block is found. - Fix a small regression from ttm_resource_fini() - Small selftest fix. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/fafe7517-fb98-4992-e059-88429ac488bc@linux.intel.com commit 21050a39a3b676fbaed4ad6c5871b917a91abe9d Merge: c6e90a1c6608 00f4150d27d2 Author: Dave Airlie Date: Fri Mar 25 09:44:16 2022 +1000 Merge tag 'drm-intel-next-fixes-2022-03-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Reject unsupported TMDS rates on ICL+ (Ville Syrjälä) - Treat SAGV block time 0 as SAGV disabled (Ville Syrjälä) - Fix PSF GV point mask when SAGV is not possible (Ville Syrjälä) - Fix renamed INTEL_INFO->media.arch/ver field (Lucas De Marchi) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YjwvgGzYNAX5rxHN@tursulin-mobl2 commit b14ffae378aa1db993e62b01392e70d1e585fb23 Merge: 52deda9551a0 c6e90a1c6608 Author: Linus Torvalds Date: Thu Mar 24 16:19:43 2022 -0700 Merge tag 'drm-next-2022-03-24' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "Lots of work all over, Intel improving DG2 support, amdkfd CRIU support, msm new hw support, and faster fbdev support. dma-buf: - rename dma-buf-map to iosys-map core: - move buddy allocator to core - add pci/platform init macros - improve EDID parser deep color handling - EDID timing type 7 support - add GPD Win Max quirk - add yes/no helpers to string_helpers - flatten syncobj chains - add nomodeset support to lots of drivers - improve fb-helper clipping support - add default property value interface fbdev: - improve fbdev ops speed ttm: - add a backpointer from ttm bo->ttm resource dp: - move displayport headers - add a dp helper module bridge: - anx7625 atomic support, HDCP support panel: - split out panel-lvds and lvds bindings - find panels in OF subnodes privacy: - add chromeos privacy screen support fb: - hot unplug fw fb on forced removal simpledrm: - request region instead of marking ioresource busy - add panel oreintation property udmabuf: - fix oops with 0 pages amdgpu: - power management code cleanup - Enable freesync video mode by default - RAS code cleanup - Improve VRAM access for debug using SDMA - SR-IOV rework special register access and fixes - profiling power state request ioctl - expose IP discovery via sysfs - Cyan skillfish updates - GC 10.3.7, SDMA 5.2.7, DCN 3.1.6 updates - expose benchmark tests via debugfs - add module param to disable XGMI for testing - GPU reset debugfs register dumping support amdkfd: - CRIU support - SDMA queue fixes radeon: - UVD suspend fix - iMac backlight fix i915: - minimal parallel submission for execlists - DG2-G12 subplatform added - DG2 programming workarounds - DG2 accelerated migration support - flat CCS and CCS engine support for XeHP - initial small BAR support - drop fake LMEM support - ADL-N PCH support - bigjoiner updates - introduce VMA resources and async unbinding - register definitions cleanups - multi-FBC refactoring - DG1 OPROM over SPI support - ADL-N platform enabling - opregion mailbox #5 support - DP MST ESI improvements - drm device based logging - async flip optimisation for DG2 - CPU arch abstraction fixes - improve GuC ADS init to work on aarch64 - tweak TTM LRU priority hint - GuC 69.0.3 support - remove short term execbuf pins nouveau: - higher DP/eDP bitrates - backlight fixes msm: - dpu + dp support for sc8180x - dp support for sm8350 - dpu + dsi support for qcm2290 - 10nm dsi phy tuning support - bridge support for dp encoder - gpu support for additional 7c3 SKUs ingenic: - HDMI support for JZ4780 - aux channel EDID support ast: - AST2600 support - add wide screen support - create DP/DVI connectors omapdrm: - fix implicit dma_buf fencing vc4: - add CSC + full range support - better display firmware handoff panfrost: - add initial dual-core GPU support stm: - new revision support - fb handover support mediatek: - transfer display binding document to yaml format. - add mt8195 display device binding. - allow commands to be sent during video mode. - add wait_for_event for crtc disable by cmdq. tegra: - YUV format support rcar-du: - LVDS support for M3-W+ (R8A77961) exynos: - BGR pixel format for FIMD device" * tag 'drm-next-2022-03-24' of git://anongit.freedesktop.org/drm/drm: (1529 commits) drm/i915/display: Do not re-enable PSR after it was marked as not reliable drm/i915/display: Fix HPD short pulse handling for eDP drm/amdgpu: Use drm_mode_copy() drm/radeon: Use drm_mode_copy() drm/amdgpu: Use ternary operator in `vcn_v1_0_start()` drm/amdgpu: Remove pointless on stack mode copies drm/amd/pm: fix indenting in __smu_cmn_reg_print_error() drm/amdgpu/dc: fix typos in comments drm/amdgpu: fix typos in comments drm/amd/pm: fix typos in comments drm/amdgpu: Add stolen reserved memory for MI25 SRIOV. drm/amdgpu: Merge get_reserved_allocation to get_vbios_allocations. drm/amdkfd: evict svm bo worker handle error drm/amdgpu/vcn: fix vcn ring test failure in igt reload test drm/amdgpu: only allow secure submission on rings which support that drm/amdgpu: fixed the warnings reported by kernel test robot drm/amd/display: 3.2.177 drm/amd/display: [FW Promotion] Release 0.0.108.0 drm/amd/display: Add save/restore PANEL_PWRSEQ_REF_DIV2 drm/amd/display: Wait for hubp read line for Pollock ... commit 34d2bfe7d4b65b375d0edf704133a6b6970f9d81 Author: Jens Axboe Date: Thu Mar 24 10:17:44 2022 -0600 io_uring: improve task work cache utilization While profiling task_work intensive workloads, I noticed that most of the time in tctx_task_work() is spending stalled on loading 'req'. This is one of the unfortunate side effects of using linked lists, particularly when they end up being passe around. Prefetch the next request, if there is one. There's a sufficient amount of work in between that this makes it available for the next loop. While fiddling with the cache layout, move the link outside of the hot completion cacheline. It's rarely used in hot workloads, so better to bring in kbuf which is used for networked loads with provided buffers. This reduces tctx_task_work() overhead from ~3% to 1-1.5% in my testing. Signed-off-by: Jens Axboe fs/io_uring.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit ef3e787c21d1efcd297f0cf2e9535e76188fb831 Author: Kees Cook Date: Thu Mar 24 15:57:25 2022 -0700 usercopy: Disable CONFIG_HARDENED_USERCOPY_PAGESPAN CONFIG_HARDENED_USERCOPY_PAGESPAN has been mostly broken for a while, and it has become hard to ignore with some recent scsi changes[1]. While there is a more complete series to replace it with better checks[2], it should have more soak time in -next. Instead, disable the config now, with the expectation that it will be fully replaced in the next kernel release. [1] https://lore.kernel.org/lkml/20220324064846.GA12961@lst.de/ [2] https://lore.kernel.org/linux-hardening/20220110231530.665970-1-willy@infradead.org/ Suggested-by: Christoph Hellwig Cc: "Matthew Wilcox (Oracle)" Signed-off-by: Kees Cook security/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3bde4c48586074202044456285a97ccdf9048988 Author: Andreas Gruenbacher Date: Thu Mar 24 23:13:26 2022 +0100 gfs2: Make sure not to return short direct writes When direct writes fail with -ENOTBLK because we're writing into a hole (gfs2_iomap_begin()) or because of a page invalidation failure (iomap_dio_rw()), we're falling back to buffered writes. In that case, when we lose the inode glock in gfs2_file_buffered_write(), we want to re-acquire it instead of returning a short write. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 11661835f90153bdfc5325e550d2b72d0f47cb3e Author: Andreas Gruenbacher Date: Thu Mar 24 22:40:20 2022 +0100 gfs2: Remove dead code in gfs2_file_read_iter Function iomap_dio_rw() only returns -ENOTBLK for write requests and gfs2_file_direct_read() no longer returns -ENOTBLK since commit 1d45bb7f9d2a5 ("gfs2: Use iomap for stuffed direct I/O reads"), so there is no need to check for -ENOTBLK in gfs2_file_read_iter() anymore. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) commit 46f3e0421ccb5474b5c006b0089b9dfd42534bb6 Author: Andreas Gruenbacher Date: Thu Mar 17 14:47:24 2022 +0100 gfs2: Fix gfs2_file_buffered_write endless loop workaround Since commit 554c577cee95b, gfs2_file_buffered_write() can accidentally return a truncated iov_iter, which might confuse callers. Fix that. Fixes: 554c577cee95b ("gfs2: Prevent endless loops in gfs2_file_buffered_write") Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 1 + 1 file changed, 1 insertion(+) commit 168a0abf05a8da919397552d9cd2a798c4104e8a Author: Dmitry Baryshkov Date: Tue Mar 15 12:11:06 2022 +0300 pinctrl: qcom-pmic-gpio: Add support for pm8450 PM8450 provides 4 GPIOs. Add a compatible entry for this GPIO block. Signed-off-by: Dmitry Baryshkov Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220315091106.613153-1-dmitry.baryshkov@linaro.org Signed-off-by: Linus Walleij Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 1 + drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 + 2 files changed, 2 insertions(+) commit 6ed23c312ab13486935b4449744ec2721587ed0b Author: Joel Stanley Date: Fri Mar 4 10:33:10 2022 +1030 dt-bindings: pinctrl: aspeed: Update gfx node in example The example needs updating to match the to be added yaml bindings for the gfx node. Signed-off-by: Joel Stanley Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220304000311.970267-2-joel@jms.id.au Signed-off-by: Linus Walleij .../bindings/pinctrl/aspeed,ast2500-pinctrl.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit a73825ba70c93e1eb39a845bb3d9885a787f8ffe Author: Dylan Yudaken Date: Thu Mar 24 07:34:35 2022 -0700 io_uring: fix async accept on O_NONBLOCK sockets Do not set REQ_F_NOWAIT if the socket is non blocking. When enabled this causes the accept to immediately post a CQE with EAGAIN, which means you cannot perform an accept SQE on a NONBLOCK socket asynchronously. By removing the flag if there is no pending accept then poll is armed as usual and when a connection comes in the CQE is posted. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220324143435.2875844-1-dylany@fb.com Signed-off-by: Jens Axboe fs/io_uring.c | 3 --- 1 file changed, 3 deletions(-) commit 52deda9551a01879b3562e7b41748e85c591f14c Merge: 169e77764adc b027471adaf9 Author: Linus Torvalds Date: Thu Mar 24 14:14:07 2022 -0700 Merge branch 'akpm' (patches from Andrew) Merge more updates from Andrew Morton: "Various misc subsystems, before getting into the post-linux-next material. 41 patches. Subsystems affected by this patch series: procfs, misc, core-kernel, lib, checkpatch, init, pipe, minix, fat, cgroups, kexec, kdump, taskstats, panic, kcov, resource, and ubsan" * emailed patches from Andrew Morton : (41 commits) Revert "ubsan, kcsan: Don't combine sanitizer with kcov on clang" kernel/resource: fix kfree() of bootmem memory again kcov: properly handle subsequent mmap calls kcov: split ioctl handling into locked and unlocked parts panic: move panic_print before kmsg dumpers panic: add option to dump all CPUs backtraces in panic_print docs: sysctl/kernel: add missing bit to panic_print taskstats: remove unneeded dead assignment kasan: no need to unset panic_on_warn in end_report() ubsan: no need to unset panic_on_warn in ubsan_epilogue() panic: unset panic_on_warn inside panic() docs: kdump: add scp example to write out the dump file docs: kdump: update description about sysfs file system support arm64: mm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef x86/setup: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef riscv: mm: init: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef kexec: make crashk_res, crashk_low_res and crash_notes symbols always visible cgroup: use irqsave in cgroup_rstat_flush_locked(). fat: use pointer to simple type in put_user() minix: fix bug when opening a file with O_DIRECT ... commit d16d30f48c1ca3051115e5093934263e84dc1390 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: fa31a4d669bd471e ("x86/cpufeatures: Put the AMX macros in the word 18 block") 7b8f40b3de75c971 ("x86/cpu: Add definitions for the Intel Hardware Feedback Interface") 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: Borislav Petkov Cc: Jim Mattson Cc: Rafael J. Wysocki Cc: Ricardo Neri Link: https://lore.kernel.org/lkml/YjzZPxdyLjf76gM+@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/arch/x86/include/asm/cpufeatures.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 1efe4cbd7ac568e8eea93f71d887a112d3230496 Author: Arnaldo Carvalho de Melo Date: Thu Dec 17 15:44:29 2020 -0300 tools headers cpufeatures: Sync with the kernel sources To pick the changes in: 7c1ef59145f1c8bf ("x86/cpufeatures: Re-enable ENQCMD") That causes only these 'perf bench' objects to rebuild: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o And addresses these perf build warnings: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h' diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h Cc: Borislav Petkov Cc: Fenghua Yu Link: https://lore.kernel.org/lkml/YjzX+PknzGoKaGMX@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/arch/x86/include/asm/disabled-features.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit d0a0a511493d269514fcbd852481cdca32c95350 Author: Thomas Richter Date: Thu Mar 17 16:53:46 2022 +0100 perf stat: Fix forked applications enablement of counters I have run into the following issue: # perf stat -a -e new_pmu/INSTRUCTION_7/ -- mytest -c1 7 Performance counter stats for 'system wide': 0 new_pmu/INSTRUCTION_7/ 0.000366428 seconds time elapsed # The new PMU for s390 counts the execution of certain CPU instructions. The root cause is the extremely small run time of the mytest program. It just executes some assembly instructions and then exits. In above invocation the instruction is executed exactly one time (-c1 option). The PMU is expected to report this one time execution by a counter value of one, but fails to do so in some cases, not all. Debugging reveals the invocation of the child process is done *before* the counter events are installed and enabled. Tracing reveals that sometimes the child process starts and exits before the event is installed on all CPUs. The more CPUs the machine has, the more often this miscount happens. Fix this by reversing the start of the work load after the events have been installed on the specified CPUs. Now the comment also matches the code. Output after: # perf stat -a -e new_pmu/INSTRUCTION_7/ -- mytest -c1 7 Performance counter stats for 'system wide': 1 new_pmu/INSTRUCTION_7/ 0.000366428 seconds time elapsed # Now the correct result is reported rock solid all the time regardless how many CPUs are online. Reviewers notes: Jiri: Right, without -a the event has enable_on_exec so the race does not matter, but it's a problem for system wide with fork. Namhyung: Agreed. Also we may move the enable_counters() and the clock code out of the if block to be shared with the else block. Fixes: acf2892270dcc428 ("perf stat: Use perf_evlist__prepare/start_workload()") Signed-off-by: Thomas Richter Acked-by: Jiri Olsa Acked-by: Namhyung Kim Acked-by: Sumanth Korikkar Cc: Heiko Carstens Cc: Sven Schnelle Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20220317155346.577384-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 61726144c9c91c54cb1e8126017ba0fc5a7999e3 Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:32:18 2021 -0300 tools arch x86: Sync the msr-index.h copy with the kernel sources To pick up the changes from these csets: 7b8f40b3de75c971 ("x86/cpu: Add definitions for the Intel Hardware Feedback Interface") That cause no changes to tooling: $ 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 $ Just silences this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Cc: Rafael J. Wysocki Cc: Ricardo Neri Link: https://lore.kernel.org/lkml/YjzVt8CjAORAsTCo@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/arch/x86/include/asm/msr-index.h | 6 ++++++ 1 file changed, 6 insertions(+) commit 169e77764adc041b1dacba84ea90516a895d43b2 Merge: 7403e6d82639 89695196f0ba Author: Linus Torvalds Date: Thu Mar 24 13:13:26 2022 -0700 Merge tag 'net-next-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull networking updates from Jakub Kicinski: "The sprinkling of SPI drivers is because we added a new one and Mark sent us a SPI driver interface conversion pull request. Core ---- - Introduce XDP multi-buffer support, allowing the use of XDP with jumbo frame MTUs and combination with Rx coalescing offloads (LRO). - Speed up netns dismantling (5x) and lower the memory cost a little. Remove unnecessary per-netns sockets. Scope some lists to a netns. Cut down RCU syncing. Use batch methods. Allow netdev registration to complete out of order. - Support distinguishing timestamp types (ingress vs egress) and maintaining them across packet scrubbing points (e.g. redirect). - Continue the work of annotating packet drop reasons throughout the stack. - Switch netdev error counters from an atomic to dynamically allocated per-CPU counters. - Rework a few preempt_disable(), local_irq_save() and busy waiting sections problematic on PREEMPT_RT. - Extend the ref_tracker to allow catching use-after-free bugs. BPF --- - Introduce "packing allocator" for BPF JIT images. JITed code is marked read only, and used to be allocated at page granularity. Custom allocator allows for more efficient memory use, lower iTLB pressure and prevents identity mapping huge pages from getting split. - Make use of BTF type annotations (e.g. __user, __percpu) to enforce the correct probe read access method, add appropriate helpers. - Convert the BPF preload to use light skeleton and drop the user-mode-driver dependency. - Allow XDP BPF_PROG_RUN test infra to send real packets, enabling its use as a packet generator. - Allow local storage memory to be allocated with GFP_KERNEL if called from a hook allowed to sleep. - Introduce fprobe (multi kprobe) to speed up mass attachment (arch bits to come later). - Add unstable conntrack lookup helpers for BPF by using the BPF kfunc infra. - Allow cgroup BPF progs to return custom errors to user space. - Add support for AF_UNIX iterator batching. - Allow iterator programs to use sleepable helpers. - Support JIT of add, and, or, xor and xchg atomic ops on arm64. - Add BTFGen support to bpftool which allows to use CO-RE in kernels without BTF info. - Large number of libbpf API improvements, cleanups and deprecations. Protocols --------- - Micro-optimize UDPv6 Tx, gaining up to 5% in test on dummy netdev. - Adjust TSO packet sizes based on min_rtt, allowing very low latency links (data centers) to always send full-sized TSO super-frames. - Make IPv6 flow label changes (AKA hash rethink) more configurable, via sysctl and setsockopt. Distinguish between server and client behavior. - VxLAN support to "collect metadata" devices to terminate only configured VNIs. This is similar to VLAN filtering in the bridge. - Support inserting IPv6 IOAM information to a fraction of frames. - Add protocol attribute to IP addresses to allow identifying where given address comes from (kernel-generated, DHCP etc.) - Support setting socket and IPv6 options via cmsg on ping6 sockets. - Reject mis-use of ECN bits in IP headers as part of DSCP/TOS. Define dscp_t and stop taking ECN bits into account in fib-rules. - Add support for locked bridge ports (for 802.1X). - tun: support NAPI for packets received from batched XDP buffs, doubling the performance in some scenarios. - IPv6 extension header handling in Open vSwitch. - Support IPv6 control message load balancing in bonding, prevent neighbor solicitation and advertisement from using the wrong port. Support NS/NA monitor selection similar to existing ARP monitor. - SMC - improve performance with TCP_CORK and sendfile() - support auto-corking - support TCP_NODELAY - MCTP (Management Component Transport Protocol) - add user space tag control interface - I2C binding driver (as specified by DMTF DSP0237) - Multi-BSSID beacon handling in AP mode for WiFi. - Bluetooth: - handle MSFT Monitor Device Event - add MGMT Adv Monitor Device Found/Lost events - Multi-Path TCP: - add support for the SO_SNDTIMEO socket option - lots of selftest cleanups and improvements - Increase the max PDU size in CAN ISOTP to 64 kB. Driver API ---------- - Add HW counters for SW netdevs, a mechanism for devices which offload packet forwarding to report packet statistics back to software interfaces such as tunnels. - Select the default NIC queue count as a fraction of number of physical CPU cores, instead of hard-coding to 8. - Expose devlink instance locks to drivers. Allow device layer of drivers to use that lock directly instead of creating their own which always runs into ordering issues in devlink callbacks. - Add header/data split indication to guide user space enabling of TCP zero-copy Rx. - Allow configuring completion queue event size. - Refactor page_pool to enable fragmenting after allocation. - Add allocation and page reuse statistics to page_pool. - Improve Multiple Spanning Trees support in the bridge to allow reuse of topologies across VLANs, saving HW resources in switches. - DSA (Distributed Switch Architecture): - replay and offload of host VLAN entries - offload of static and local FDB entries on LAG interfaces - FDB isolation and unicast filtering New hardware / drivers ---------------------- - Ethernet: - LAN937x T1 PHYs - Davicom DM9051 SPI NIC driver - Realtek RTL8367S, RTL8367RB-VB switch and MDIO - Microchip ksz8563 switches - Netronome NFP3800 SmartNICs - Fungible SmartNICs - MediaTek MT8195 switches - WiFi: - mt76: MediaTek mt7916 - mt76: MediaTek mt7921u USB adapters - brcmfmac: Broadcom BCM43454/6 - Mobile: - iosm: Intel M.2 7360 WWAN card Drivers ------- - Convert many drivers to the new phylink API built for split PCS designs but also simplifying other cases. - Intel Ethernet NICs: - add TTY for GNSS module for E810T device - improve AF_XDP performance - GTP-C and GTP-U filter offload - QinQ VLAN support - Mellanox Ethernet NICs (mlx5): - support xdp->data_meta - multi-buffer XDP - offload tc push_eth and pop_eth actions - Netronome Ethernet NICs (nfp): - flow-independent tc action hardware offload (police / meter) - AF_XDP - Other Ethernet NICs: - at803x: fiber and SFP support - xgmac: mdio: preamble suppression and custom MDC frequencies - r8169: enable ASPM L1.2 if system vendor flags it as safe - macb/gem: ZynqMP SGMII - hns3: add TX push mode - dpaa2-eth: software TSO - lan743x: multi-queue, mdio, SGMII, PTP - axienet: NAPI and GRO support - Mellanox Ethernet switches (mlxsw): - source and dest IP address rewrites - RJ45 ports - Marvell Ethernet switches (prestera): - basic routing offload - multi-chain TC ACL offload - NXP embedded Ethernet switches (ocelot & felix): - PTP over UDP with the ocelot-8021q DSA tagging protocol - basic QoS classification on Felix DSA switch using dcbnl - port mirroring for ocelot switches - Microchip high-speed industrial Ethernet (sparx5): - offloading of bridge port flooding flags - PTP Hardware Clock - Other embedded switches: - lan966x: PTP Hardward Clock - qca8k: mdio read/write operations via crafted Ethernet packets - Qualcomm 802.11ax WiFi (ath11k): - add LDPC FEC type and 802.11ax High Efficiency data in radiotap - enable RX PPDU stats in monitor co-exist mode - Intel WiFi (iwlwifi): - UHB TAS enablement via BIOS - band disablement via BIOS - channel switch offload - 32 Rx AMPDU sessions in newer devices - MediaTek WiFi (mt76): - background radar detection - thermal management improvements on mt7915 - SAR support for more mt76 platforms - MBSSID and 6 GHz band on mt7915 - RealTek WiFi: - rtw89: AP mode - rtw89: 160 MHz channels and 6 GHz band - rtw89: hardware scan - Bluetooth: - mt7921s: wake on Bluetooth, SCO over I2S, wide-band-speed (WBS) - Microchip CAN (mcp251xfd): - multiple RX-FIFOs and runtime configurable RX/TX rings - internal PLL, runtime PM handling simplification - improve chip detection and error handling after wakeup" * tag 'net-next-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2521 commits) llc: fix netdevice reference leaks in llc_ui_bind() drivers: ethernet: cpsw: fix panic when interrupt coaleceing is set via ethtool ice: don't allow to run ice_send_event_to_aux() in atomic ctx ice: fix 'scheduling while atomic' on aux critical err interrupt net/sched: fix incorrect vlan_push_eth dest field net: bridge: mst: Restrict info size queries to bridge ports net: marvell: prestera: add missing destroy_workqueue() in prestera_module_init() drivers: net: xgene: Fix regression in CRC stripping net: geneve: add missing netlink policy and size for IFLA_GENEVE_INNER_PROTO_INHERIT net: dsa: fix missing host-filtered multicast addresses net/mlx5e: Fix build warning, detected write beyond size of field iwlwifi: mvm: Don't fail if PPAG isn't supported selftests/bpf: Fix kprobe_multi test. Revert "rethook: x86: Add rethook x86 implementation" Revert "arm64: rethook: Add arm64 rethook implementation" Revert "powerpc: Add rethook support" Revert "ARM: rethook: Add rethook arm implementation" netdevice: add missing dm_private kdoc net: bridge: mst: prevent NULL deref in br_mst_info_size() selftests: forwarding: Use same VRF for port and VLAN upper ... commit 7403e6d8263937dea206dd201fed1ceed190ca18 Merge: 66711cfea642 f621eb13facb Author: Linus Torvalds Date: Thu Mar 24 12:35:59 2022 -0700 Merge tag 'vfio-v5.18-rc1' of https://github.com/awilliam/linux-vfio Pull VFIO updates from Alex Williamson: - Introduce new device migration uAPI and implement device specific mlx5 vfio-pci variant driver supporting new protocol (Jason Gunthorpe, Yishai Hadas, Leon Romanovsky) - New HiSilicon acc vfio-pci variant driver, also supporting migration interface (Shameer Kolothum, Longfang Liu) - D3hot fixes for vfio-pci-core (Abhishek Sahu) - Document new vfio-pci variant driver acceptance criteria (Alex Williamson) - Fix UML build unresolved ioport_{un}map() functions (Alex Williamson) - Fix MAINTAINERS due to header movement (Lukas Bulwahn) * tag 'vfio-v5.18-rc1' of https://github.com/awilliam/linux-vfio: (31 commits) vfio-pci: Provide reviewers and acceptance criteria for variant drivers MAINTAINERS: adjust entry for header movement in hisilicon qm driver hisi_acc_vfio_pci: Use its own PCI reset_done error handler hisi_acc_vfio_pci: Add support for VFIO live migration crypto: hisilicon/qm: Set the VF QM state register hisi_acc_vfio_pci: Add helper to retrieve the struct pci_driver hisi_acc_vfio_pci: Restrict access to VF dev BAR2 migration region hisi_acc_vfio_pci: add new vfio_pci driver for HiSilicon ACC devices hisi_acc_qm: Move VF PCI device IDs to common header crypto: hisilicon/qm: Move few definitions to common header crypto: hisilicon/qm: Move the QM header to include/linux vfio/mlx5: Fix to not use 0 as NULL pointer PCI/IOV: Fix wrong kernel-doc identifier vfio/mlx5: Use its own PCI reset_done error handler vfio/pci: Expose vfio_pci_core_aer_err_detected() vfio/mlx5: Implement vfio_pci driver for mlx5 devices vfio/mlx5: Expose migration commands over mlx5 device vfio: Remove migration protocol v1 documentation vfio: Extend the device migration protocol with RUNNING_P2P vfio: Define device migration protocol v2 ... commit 66711cfea642a162bc99abdefe1645b26dbd778f Merge: 1ebdbeb03efe eeda29db98f4 Author: Linus Torvalds Date: Thu Mar 24 12:30:37 2022 -0700 Merge tag 'hyperv-next-signed-20220322' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv updates from Wei Liu: "Minor patches from various people" * tag 'hyperv-next-signed-20220322' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: x86/hyperv: Output host build info as normal Windows version number hv_balloon: rate-limit "Unhandled message" warning drivers: hv: log when enabling crash_kexec_post_notifiers hv_utils: Add comment about max VMbus packet size in VSS driver Drivers: hv: Compare cpumasks and not their weights in init_vp_index() Drivers: hv: Rename 'alloced' to 'allocated' Drivers: hv: vmbus: Use struct_size() helper in kmalloc() commit f164935f6f15b2e3496eab7d6aed293a6a98d221 Author: Arınç ÜNAL Date: Thu Mar 10 17:05:42 2022 +0300 dt-bindings: pinctrl: rt2880: add missing pin groups and functions Add the missing pin groups: jtag, wdt Add the missing functions: i2s, jtag, pcie refclk, pcie rst, pcm, spdif2, spdif3, wdt refclk, wdt rst Sort pin groups and functions in alphabetical order. Fix a typo. Signed-off-by: Arınç ÜNAL Acked-by: Rob Herring Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20220310140542.7483-1-arinc.unal@arinc9.com Signed-off-by: Linus Walleij .../devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit 9279c00fa40250e5cb23a8423dce7dbc6516a0ea Author: Aidan MacDonald Date: Thu Mar 17 00:07:40 2022 +0000 pinctrl: ingenic: Fix regmap on X series SoCs The X series Ingenic SoCs have a shadow GPIO group which is at a higher offset than the other groups, and is used for all GPIO configuration. The regmap did not take this offset into account and set max_register too low, so the regmap API blocked writes to the shadow group, which made the pinctrl driver unable to configure any pins. Fix this by adding regmap access tables to the chip info. The way that max_register was computed was also off by one, since max_register is an inclusive bound, not an exclusive bound; this has been fixed. Cc: stable@vger.kernel.org Signed-off-by: Aidan MacDonald Fixes: 6626a76ef857 ("pinctrl: ingenic: Add .max_register in regmap_config") Reviewed-by: Paul Cercueil Link: https://lore.kernel.org/r/20220317000740.1045204-1-aidanmacdonald.0x0@gmail.com Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-ingenic.c | 46 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) commit 283fb4ea08c5876150b4158e9c20c14309214ce2 Author: Jialin Zhang Date: Thu Mar 17 14:58:51 2022 +0800 pinctrl: nuvoton: Fix return value check in wpcm450_gpio_register() In case of error, the function devm_platform_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450") Reported-by: Hulk Robot Signed-off-by: Jialin Zhang Reviewed-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20220317065851.495394-1-zhangjialin11@huawei.com Signed-off-by: Linus Walleij drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit ce2076ba209e5e5258b71c44065988d8f7fa2976 Author: Dan Carpenter Date: Fri Mar 18 10:11:31 2022 +0300 pinctrl: nuvoton: wpcm450: off by one in wpcm450_gpio_register() The > WPCM450_NUM_BANKS should be >= or it leads to an out of bounds access on the next line. Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450") Signed-off-by: Dan Carpenter Reviewed-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20220318071131.GA29472@kili Signed-off-by: Linus Walleij drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0bb850887c1e27ca81d1b4cd19db83f40a61dd30 Author: Jonathan Neuschäfer Date: Thu Mar 17 12:44:12 2022 +0100 pinctrl: nuvoton: wpcm450: select GENERIC_PINCTRL_GROUPS CONFIG_GENERIC_PINCTRL_GROUPS must be selected in order for struct group_desc to be defined in pinctrl/core.h. Add the missing select line to CONFIG_PINCTRL_WPCM450. Reported-by: kernel test robot Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450") Signed-off-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20220317114413.1418484-1-j.neuschaefer@gmx.net Signed-off-by: Linus Walleij drivers/pinctrl/nuvoton/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 6ef00b42f9019143e4534738f83af8e663bf7695 Author: Linus Walleij Date: Wed Mar 23 00:12:55 2022 +0100 pinctrl: nuvoton: Fix sparse warning Sparse complains: drivers/pinctrl/nuvoton/pinctrl-wpcm450.c:626:9: sparse: sparse: obsolete array initializer, use C99 syntax This is because no equal sign is between the array index and the assignments, in the macro. Fix it up. Reviewed-by: Jonathan Neuschäfer Reported-by: kernel test robot Signed-off-by: Linus Walleij drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 2 +- drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit 042a6362ce4dae201c9aa345ec2acce659edddca Author: Linus Walleij Date: Wed Mar 23 00:01:21 2022 +0100 pinctrl: mediatek: mt8186: Account for probe refactoring The new MT8186 drive came in and the probe calls were refactored at the same time. Fix it up. Fixes a build issue. Cc: Guodong Liu Cc: AngeloGioacchino Del Regno Reported-by: kernel test robot Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-mt8186.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) commit 1ebdbeb03efe89f01f15df038a589077df3d21f5 Merge: efee6c79298f c9b8fecddb5b Author: Linus Torvalds Date: Thu Mar 24 11:58:57 2022 -0700 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm updates from Paolo Bonzini: "ARM: - Proper emulation of the OSLock feature of the debug architecture - Scalibility improvements for the MMU lock when dirty logging is on - New VMID allocator, which will eventually help with SVA in VMs - Better support for PMUs in heterogenous systems - PSCI 1.1 support, enabling support for SYSTEM_RESET2 - Implement CONFIG_DEBUG_LIST at EL2 - Make CONFIG_ARM64_ERRATUM_2077057 default y - Reduce the overhead of VM exit when no interrupt is pending - Remove traces of 32bit ARM host support from the documentation - Updated vgic selftests - Various cleanups, doc updates and spelling fixes RISC-V: - Prevent KVM_COMPAT from being selected - Optimize __kvm_riscv_switch_to() implementation - RISC-V SBI v0.3 support s390: - memop selftest - fix SCK locking - adapter interruptions virtualization for secure guests - add Claudio Imbrenda as maintainer - first step to do proper storage key checking x86: - Continue switching kvm_x86_ops to static_call(); introduce static_call_cond() and __static_call_ret0 when applicable. - Cleanup unused arguments in several functions - Synthesize AMD 0x80000021 leaf - Fixes and optimization for Hyper-V sparse-bank hypercalls - Implement Hyper-V's enlightened MSR bitmap for nested SVM - Remove MMU auditing - Eager splitting of page tables (new aka "TDP" MMU only) when dirty page tracking is enabled - Cleanup the implementation of the guest PGD cache - Preparation for the implementation of Intel IPI virtualization - Fix some segment descriptor checks in the emulator - Allow AMD AVIC support on systems with physical APIC ID above 255 - Better API to disable virtualization quirks - Fixes and optimizations for the zapping of page tables: - Zap roots in two passes, avoiding RCU read-side critical sections that last too long for very large guests backed by 4 KiB SPTEs. - Zap invalid and defunct roots asynchronously via concurrency-managed work queue. - Allowing yielding when zapping TDP MMU roots in response to the root's last reference being put. - Batch more TLB flushes with an RCU trick. Whoever frees the paging structure now holds RCU as a proxy for all vCPUs running in the guest, i.e. to prolongs the grace period on their behalf. It then kicks the the vCPUs out of guest mode before doing rcu_read_unlock(). Generic: - Introduce __vcalloc and use it for very large allocations that need memcg accounting" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (246 commits) KVM: use kvcalloc for array allocations KVM: x86: Introduce KVM_CAP_DISABLE_QUIRKS2 kvm: x86: Require const tsc for RT KVM: x86: synthesize CPUID leaf 0x80000021h if useful KVM: x86: add support for CPUID leaf 0x80000021 KVM: x86: do not use KVM_X86_OP_OPTIONAL_RET0 for get_mt_mask Revert "KVM: x86/mmu: Zap only TDP MMU leafs in kvm_zap_gfn_range()" kvm: x86/mmu: Flush TLB before zap_gfn_range releases RCU KVM: arm64: fix typos in comments KVM: arm64: Generalise VM features into a set of flags KVM: s390: selftests: Add error memop tests KVM: s390: selftests: Add more copy memop tests KVM: s390: selftests: Add named stages for memop test KVM: s390: selftests: Add macro as abstraction for MEM_OP KVM: s390: selftests: Split memop tests KVM: s390x: fix SCK locking RISC-V: KVM: Implement SBI HSM suspend call RISC-V: KVM: Add common kvm_riscv_vcpu_wfi() function RISC-V: Add SBI HSM suspend related defines RISC-V: KVM: Implement SBI v0.3 SRST extension ... commit efee6c79298fd823c569d501d041de85caa102a6 Merge: 3ce62cf4dc3b 39844b7e3084 Author: Linus Torvalds Date: Thu Mar 24 11:54:37 2022 -0700 Merge tag 'tomoyo-pr-20220322' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1 Pull tomoyo update from Tetsuo Handa: "Avoid unnecessarily leaking kernel command line arguments" * tag 'tomoyo-pr-20220322' of git://git.osdn.net/gitroot/tomoyo/tomoyo-test1: TOMOYO: fix __setup handlers return values commit 6a2f0b2d3b74e3e4002dc4143887637cd216e531 Author: Ard Biesheuvel Date: Tue Dec 3 15:23:06 2019 +0000 dt: amd-seattle: add a description of the CPUs and caches Add a DT description of the CPU and cache hierarchy as found on the AMD Seattle SOC. Given the tight coupling of the PMU with the CPUs, move the PMU node into the cpu .dtsi file as well, and add the missing affinity description. Signed-off-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/amd/amd-overdrive-rev-b0.dts | 1 + arch/arm64/boot/dts/amd/amd-overdrive-rev-b1.dts | 1 + arch/arm64/boot/dts/amd/amd-seattle-cpus.dtsi | 224 +++++++++++++++++++++++ arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 12 -- 4 files changed, 226 insertions(+), 12 deletions(-) commit e0db1597a71a7de661a107090554f8b187e77a08 Author: Ard Biesheuvel Date: Tue Dec 3 15:23:05 2019 +0000 dt: amd-seattle: disable IPMI controller and some GPIO blocks on B0 Disable some peripherals that are not usable on B0 silicon based Overdrives. Signed-off-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/amd/amd-overdrive-rev-b0.dts | 12 ------------ 1 file changed, 12 deletions(-) commit 429863e767a084e5de6934d768946cda5793b691 Author: Ard Biesheuvel Date: Tue Dec 3 15:23:04 2019 +0000 dt: amd-seattle: add description of the SATA/CCP SMMUs Add descriptions of the SMMUs that cover the SATA controller(s) on the AMD Seattle SOC. The CCP crypto accelerator shares its SMMU with the second SATA controller, which is only enabled on B1 silicon. Signed-off-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) commit dd5c160655e24c1a86b1f23e870b69f6aaa80646 Author: Ard Biesheuvel Date: Tue Dec 3 15:23:03 2019 +0000 dt: amd-seattle: add a description of the PCIe SMMU Add a description of the SMMU that covers the PCIe host bridge on AMD Seattle. Signed-off-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) commit acd9208ef8a4e1dc0e1d835fab284ca717a01f93 Author: Ard Biesheuvel Date: Tue Dec 3 15:23:02 2019 +0000 dt: amd-seattle: fix PCIe legacy interrupt routing The AMD Seattle SOC can be configured to expose up to 3 PCIe root ports, each of which is wired to 4 dedicated SPI wired interrupts for legacy INTx support. Update the SOC DT description to reflect this. Fix a stale comment about the size of the MMIO64 resource window while at it. Signed-off-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) commit 9bd9a063accf15b8ddae15e17d9d6312a31e4464 Author: Ard Biesheuvel Date: Tue Dec 3 15:23:01 2019 +0000 dt: amd-seattle: upgrade AMD Seattle XGBE to new SMMU binding Upgrade the DT descriptions of the AMD Seattle XGBE network controllers to use the current SMMU bindings. Signed-off-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/amd/amd-seattle-xgbe-b.dtsi | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) commit f179eb6b3cc35b451820468a3d09fe169416d4bc Author: Ard Biesheuvel Date: Tue Dec 3 15:23:00 2019 +0000 dt: amd-seattle: remove Overdrive revision A0 support Support for AMD Seattle silicon revision A0 is no longer relevant, since we no longer have a driver for the network controller, and the PCIe on these boards was very unreliable. So drop the DTS description of the A0 version of the overdrive board. Signed-off-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/amd/Makefile | 3 +- arch/arm64/boot/dts/amd/amd-overdrive.dts | 66 ------------------------------- 2 files changed, 1 insertion(+), 68 deletions(-) commit a4eb44a6435d6d8f9e642407a4a06f65eb90ca04 Author: Ard Biesheuvel Date: Tue Dec 3 15:22:59 2019 +0000 dt: amd-seattle: remove Husky platform The Huskyboard never made it to production, and its successor the Celloboard was only shipped in very limited quantities with ACPI only firmware, so the historical significance of husky.dts is highly questionable. Let's drop it. Signed-off-by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/amd/Makefile | 3 +- arch/arm64/boot/dts/amd/husky.dts | 84 --------------------------------------- 2 files changed, 1 insertion(+), 86 deletions(-) commit 3ce62cf4dc3b01d1cbee1293049ca5d4c7d6d749 Merge: cd4699c5fd66 5224f7909617 Author: Linus Torvalds Date: Thu Mar 24 11:39:32 2022 -0700 Merge tag 'flexible-array-transformations-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux Pull flexible-array transformations from Gustavo Silva: "Treewide patch that replaces zero-length arrays with flexible-array members. This has been baking in linux-next for a whole development cycle" * tag 'flexible-array-transformations-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: treewide: Replace zero-length arrays with flexible-array members commit cd4699c5fd66b00211f4709b9957bfd7b0a02ddc Merge: 2e2d4650b34f 18c91bb2d872 Author: Linus Torvalds Date: Thu Mar 24 10:16:00 2022 -0700 Merge tag 'prlimit-tasklist_lock-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull tasklist_lock optimizations from Eric Biederman: "prlimit and getpriority tasklist_lock optimizations The tasklist_lock popped up as a scalability bottleneck on some testing workloads. The readlocks in do_prlimit and set/getpriority are not necessary in all cases. Based on a cycles profile, it looked like ~87% of the time was spent in the kernel, ~42% of which was just trying to get *some* spinlock (queued_spin_lock_slowpath, not necessarily the tasklist_lock). The big offenders (with rough percentages in cycles of the overall trace): - do_wait 11% - setpriority 8% (done previously in commit 7f8ca0edfe07) - kill 8% - do_exit 5% - clone 3% - prlimit64 2% (this patchset) - getrlimit 1% (this patchset) I can't easily test this patchset on the original workload for various reasons. Instead, I used the microbenchmark below to at least verify there was some improvement. This patchset had a 28% speedup (12% from baseline to set/getprio, then another 14% for prlimit). This series used to do the setpriority case, but an almost identical change was merged as commit 7f8ca0edfe07 ("kernel/sys.c: only take tasklist_lock for get/setpriority(PRIO_PGRP)") so that has been dropped from here. One interesting thing is that my libc's getrlimit() was calling prlimit64, so hoisting the read_lock(tasklist_lock) into sys_prlimit64 had no effect - it essentially optimized the older syscalls only. I didn't do that in this patchset, but figured I'd mention it since it was an option from the previous patch's discussion" micobenchmark.c: --------------- int main(int argc, char **argv) { pid_t child; struct rlimit rlim[1]; fork(); fork(); fork(); fork(); fork(); fork(); for (int i = 0; i < 5000; i++) { child = fork(); if (child < 0) exit(1); if (child > 0) { usleep(1000); kill(child, SIGTERM); waitpid(child, NULL, 0); } else { for (;;) { setpriority(PRIO_PROCESS, 0, getpriority(PRIO_PROCESS, 0)); getrlimit(RLIMIT_CPU, rlim); } } } return 0; } Link: https://lore.kernel.org/lkml/20211213220401.1039578-1-brho@google.com/ [v1] Link: https://lore.kernel.org/lkml/20220105212828.197013-1-brho@google.com/ [v2] Link: https://lore.kernel.org/lkml/20220106172041.522167-1-brho@google.com/ [v3] * tag 'prlimit-tasklist_lock-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: prlimit: do not grab the tasklist_lock prlimit: make do_prlimit() static commit 2e2d4650b34ffe0a39f70acc9429a58d94e39236 Merge: 15f2e3d6c1f7 0f8821da4845 Author: Linus Torvalds Date: Thu Mar 24 10:06:43 2022 -0700 Merge tag 'fs.rt.v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull mount attributes PREEMPT_RT update from Christian Brauner: "This contains Sebastian's fix to make changing mount attributes/getting write access compatible with CONFIG_PREEMPT_RT. The change only applies when users explicitly opt-in to real-time via CONFIG_PREEMPT_RT otherwise things are exactly as before. We've waited quite a long time with this to make sure folks could take a good look" * tag 'fs.rt.v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: fs/namespace: Boost the mount_lock.lock owner instead of spinning on PREEMPT_RT. commit 15f2e3d6c1f713050d2d51f822fc4253f67ae7ac Merge: ed4643521e6a e257039f0fc7 Author: Linus Torvalds Date: Thu Mar 24 09:55:15 2022 -0700 Merge tag 'fs.v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull mount_setattr updates from Christian Brauner: "This contains a few more patches to massage the mount_setattr() codepaths and one minor fix to reuse a helper we added some time back. The final two patches do similar cleanups in different ways. One patch is mine and the other is Al's who was nice enough to give me a branch for it. Since his came in later and my branch had been sitting in -next for quite some time we just put his on top instead of swap them" * tag 'fs.v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: mount_setattr(): clean the control flow and calling conventions fs: clean up mount_setattr control flow fs: don't open-code mnt_hold_writers() fs: simplify check in mount_setattr_commit() fs: add mnt_allow_writers() and simplify mount_setattr_prepare() commit 60021bd754c6ca0addc6817994f20290a321d8d6 Author: Kaiwen Hu Date: Wed Mar 23 15:10:32 2022 +0800 btrfs: prevent subvol with swapfile from being deleted A subvolume with an active swapfile must not be deleted otherwise it would not be possible to deactivate it. After the subvolume is deleted, we cannot swapoff the swapfile in this deleted subvolume because the path is unreachable. The swapfile is still active and holding references, the filesystem cannot be unmounted. The test looks like this: mkfs.btrfs -f $dev > /dev/null mount $dev $mnt btrfs sub create $mnt/subvol touch $mnt/subvol/swapfile chmod 600 $mnt/subvol/swapfile chattr +C $mnt/subvol/swapfile dd if=/dev/zero of=$mnt/subvol/swapfile bs=1K count=4096 mkswap $mnt/subvol/swapfile swapon $mnt/subvol/swapfile btrfs sub delete $mnt/subvol swapoff $mnt/subvol/swapfile # failed: No such file or directory swapoff --all unmount $mnt # target is busy. To prevent above issue, we simply check that whether the subvolume contains any active swapfile, and stop the deleting process. This behavior is like snapshot ioctl dealing with a swapfile. CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Robbie Ko Reviewed-by: Qu Wenruo Reviewed-by: Filipe Manana Signed-off-by: Kaiwen Hu Signed-off-by: David Sterba fs/btrfs/inode.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) commit a7d16d9a07bbcb7dcd5214a1bea75c808830bc0d Author: Josef Bacik Date: Wed Mar 23 11:30:36 2022 -0400 btrfs: do not warn for free space inode in cow_file_range This is a long time leftover from when I originally added the free space inode, the point was to catch cases where we weren't honoring the NOCOW flag. However there exists a race with relocation, if we allocate our free space inode in a block group that is about to be relocated, we could trigger the COW path before the relocation has the opportunity to find the extents and delete the free space cache. In production where we have auto-relocation enabled we're seeing this WARN_ON_ONCE() around 5k times in a 2 week period, so not super common but enough that it's at the top of our metrics. We're properly handling the error here, and with us phasing out v1 space cache anyway just drop the WARN_ON_ONCE. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/inode.c | 1 - 1 file changed, 1 deletion(-) commit 75a36a7d3ea904cef2e5b56af0c58cc60dcf947a Author: Qu Wenruo Date: Tue Mar 15 19:28:05 2022 +0800 btrfs: avoid defragging extents whose next extents are not targets [BUG] There is a report that autodefrag is defragging single sector, which is completely waste of IO, and no help for defragging: btrfs-cleaner-808 defrag_one_locked_range: root=256 ino=651122 start=0 len=4096 [CAUSE] In defrag_collect_targets(), we check if the current range (A) can be merged with next one (B). If mergeable, we will add range A into target for defrag. However there is a catch for autodefrag, when checking mergeability against range B, we intentionally pass 0 as @newer_than, hoping to get a higher chance to merge with the next extent. But in the next iteration, range B will looked up by defrag_lookup_extent(), with non-zero @newer_than. And if range B is not really newer, it will rejected directly, causing only range A being defragged, while we expect to defrag both range A and B. [FIX] Since the root cause is the difference in check condition of defrag_check_next_extent() and defrag_collect_targets(), we fix it by: 1. Pass @newer_than to defrag_check_next_extent() 2. Pass @extent_thresh to defrag_check_next_extent() This makes the check between defrag_collect_targets() and defrag_check_next_extent() more consistent. While there is still some minor difference, the remaining checks are focus on runtime flags like writeback/delalloc, which are mostly transient and safe to be checked only in defrag_collect_targets(). Link: https://github.com/btrfs/linux/issues/423#issuecomment-1066981856 CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba fs/btrfs/ioctl.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) commit 05fd9564e9faf0f23b4676385e27d9405cef6637 Author: Darrick J. Wong Date: Mon Mar 14 10:55:32 2022 -0700 btrfs: fix fallocate to use file_modified to update permissions consistently Since the initial introduction of (posix) fallocate back at the turn of the century, it has been possible to use this syscall to change the user-visible contents of files. This can happen by extending the file size during a preallocation, or through any of the newer modes (punch, zero range). Because the call can be used to change file contents, we should treat it like we do any other modification to a file -- update the mtime, and drop set[ug]id privileges/capabilities. The VFS function file_modified() does all this for us if pass it a locked inode, so let's make fallocate drop permissions correctly. Reviewed-by: Filipe Manana Signed-off-by: Darrick J. Wong Signed-off-by: David Sterba fs/btrfs/file.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit bbac58698a55cc0a6f0c0d69a6dcd3f9f3134c11 Author: Qu Wenruo Date: Tue Mar 8 13:36:38 2022 +0800 btrfs: remove device item and update super block in the same transaction [BUG] There is a report that a btrfs has a bad super block num devices. This makes btrfs to reject the fs completely. BTRFS error (device sdd3): super_num_devices 3 mismatch with num_devices 2 found here BTRFS error (device sdd3): failed to read chunk tree: -22 BTRFS error (device sdd3): open_ctree failed [CAUSE] During btrfs device removal, chunk tree and super block num devs are updated in two different transactions: btrfs_rm_device() |- btrfs_rm_dev_item(device) | |- trans = btrfs_start_transaction() | | Now we got transaction X | | | |- btrfs_del_item() | | Now device item is removed from chunk tree | | | |- btrfs_commit_transaction() | Transaction X got committed, super num devs untouched, | but device item removed from chunk tree. | (AKA, super num devs is already incorrect) | |- cur_devices->num_devices--; |- cur_devices->total_devices--; |- btrfs_set_super_num_devices() All those operations are not in transaction X, thus it will only be written back to disk in next transaction. So after the transaction X in btrfs_rm_dev_item() committed, but before transaction X+1 (which can be minutes away), a power loss happen, then we got the super num mismatch. [FIX] Instead of starting and committing a transaction inside btrfs_rm_dev_item(), start a transaction in side btrfs_rm_device() and pass it to btrfs_rm_dev_item(). And only commit the transaction after everything is done. Reported-by: Luca Béla Palkovics Link: https://lore.kernel.org/linux-btrfs/CA+8xDSpvdm_U0QLBAnrH=zqDq_cWCOH5TiV46CKmp3igr44okQ@mail.gmail.com/ CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba fs/btrfs/volumes.c | 65 +++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 37 deletions(-) commit c1cb81429df462eca1b6ba615cddd21dd3103c46 Author: Daniel Thompson Date: Fri Jan 28 14:40:55 2022 +0000 kdb: Fix the putarea helper function Currently kdb_putarea_size() uses copy_from_kernel_nofault() to write *to* arbitrary kernel memory. This is obviously wrong and means the memory modify ('mm') command is a serious risk to debugger stability: if we poke to a bad address we'll double-fault and lose our debug session. Fix this the (very) obvious way. Note that there are two Fixes: tags because the API was renamed and this patch will only trivially backport as far as the rename (and this is probably enough). Nevertheless Christoph's rename did not introduce this problem so I wanted to record that! Fixes: fe557319aa06 ("maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault") Fixes: 5d5314d6795f ("kdb: core for kgdb back end (1 of 2)") Signed-off-by: Daniel Thompson Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20220128144055.207267-1-daniel.thompson@linaro.org kernel/debug/kdb/kdb_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1d15d121cc2ad4d016a7dc1493132a9696f91fc5 Author: Olga Kornievskaia Date: Thu Mar 24 10:38:42 2022 -0400 NFSv4.1: don't retry BIND_CONN_TO_SESSION on session error There is no reason to retry the operation if a session error had occurred in such case result structure isn't filled out. Fixes: dff58530c4ca ("NFSv4.1: fix handling of backchannel binding in BIND_CONN_TO_SESSION") Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust fs/nfs/nfs4proc.c | 1 + 1 file changed, 1 insertion(+) commit 82ee41b85cef16b4be1f4732650012d9baaedddd Author: Olga Kornievskaia Date: Thu Mar 24 10:22:58 2022 -0400 SUNRPC don't resend a task on an offlined transport When a task is being retried, due to an NFS error, if the assigned transport has been put offline and the task is relocatable pick a new transport. Fixes: 6f081693e7b2b ("sunrpc: remove an offlined xprt using sysfs") Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust net/sunrpc/clnt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 3de24f3d7078f90c8488fc67446671503f44d63e Author: Jakob Koschel Date: Thu Mar 24 08:15:23 2022 +0100 NFS: replace usage of found with dedicated list iterator variable To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable instead of a found boolean [1]. This removes the need to use a found variable and simply checking if the variable was set, can determine if the break/goto was hit. Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Signed-off-by: Jakob Koschel Signed-off-by: Trond Myklebust fs/nfs/nfs42proc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit 05241de1f69eb7f56b0a5e0bec96a7752fad1b2f Author: Dmitry Baryshkov Date: Thu Mar 24 14:55:36 2022 +0300 dt-bindings: display/msm: another fix for the dpu-qcm2290 example Make dpu-qcm2290 example really follow the defined schema: - Drop qcom,mdss compatible. It's only used for MDP5 devices. - Change display controller name to display-controller as specified in the yaml Reported-by: Rob Herring Cc: Loic Poulain Fixes: 164f69d9d45a ("dt-bindings: msm: disp: add yaml schemas for QCM2290 DPU bindings") Signed-off-by: Dmitry Baryshkov Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220324115536.2090818-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark Documentation/devicetree/bindings/display/msm/dpu-qcm2290.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ac3e4f42d5ec459f701743debd9c1ad2f2247402 Author: Rob Clark Date: Thu Mar 17 11:45:49 2022 -0700 drm/msm: Add missing put_task_struct() in debugfs path Fixes: 25faf2f2e065 ("drm/msm: Show process names in gem_describe") Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220317184550.227991-1-robdclark@gmail.com drivers/gpu/drm/msm/msm_gem.c | 1 + 1 file changed, 1 insertion(+) commit 7242795d520d3fb48e005e3c96ba54bb59639d6e Author: Rob Clark Date: Thu Mar 10 15:46:06 2022 -0800 drm/msm/gpu: Remove mutex from wait_event condition The mutex wasn't really protecting anything before. Before the previous patch we could still be racing with the scheduler's kthread, as that is not necessarily frozen yet. Now that we've parked the sched threads, the only race is with jobs retiring, and that is harmless, ie. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220310234611.424743-4-robdclark@gmail.com drivers/gpu/drm/msm/adreno/adreno_device.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) commit 7e4167c9e021afb01fb69abae8642d781c8907b6 Author: Rob Clark Date: Thu Mar 10 15:46:05 2022 -0800 drm/msm/gpu: Park scheduler threads for system suspend In the system suspend path, we don't want to be racing with the scheduler kthreads pushing additional queued up jobs to the hw queue (ringbuffer). So park them first. While we are at it, move the wait for active jobs to complete into the new system- suspend path. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220310234611.424743-3-robdclark@gmail.com drivers/gpu/drm/msm/adreno/adreno_device.c | 68 ++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 4 deletions(-) commit f7eab1ddb9f8bc99206e3efa8d34ca1d2faca209 Author: Rob Clark Date: Thu Mar 10 15:46:04 2022 -0800 drm/msm/gpu: Rename runtime suspend/resume functions Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220310234611.424743-2-robdclark@gmail.com drivers/gpu/drm/msm/adreno/adreno_device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit f2dd495a8d589371289981d5ed33e6873df94ecc Author: Pablo Neira Ayuso Date: Mon Mar 21 11:38:32 2022 +0100 netfilter: nf_conntrack_tcp: preserve liberal flag in tcp options Do not reset IP_CT_TCP_FLAG_BE_LIBERAL flag in out-of-sync scenarios coming before the TCP window tracking, otherwise such connections will fail in the window check. Update tcp_options() to leave this flag in place and add a new helper function to reset the tcp window state. Based on patch from Sven Auhagen. Fixes: c4832c7bbc3f ("netfilter: nf_ct_tcp: improve out-of-sync situation in TCP tracking") Tested-by: Sven Auhagen Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_conntrack_proto_tcp.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) commit d645552e9bd96671079b27015294ec7f9748fa2b Author: Phil Sutter Date: Thu Mar 24 15:02:40 2022 +0100 netfilter: egress: Report interface as outgoing Otherwise packets in egress chains seem like they are being received by the interface, not sent out via it. Fixes: 42df6e1d221dd ("netfilter: Introduce egress hook") Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal include/linux/netfilter_netdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ce18f905a500879e86ca998963a55f99d413a462 Author: Kai-Heng Feng Date: Thu Mar 24 14:21:58 2022 +0800 ALSA: hda/realtek: Add mute and micmut LED support for Zbook Fury 17 G9 Zbook Fury 17 G9 requires the same ALC285_FIXUP_HP_GPIO_LED quirk to make its audio LEDs work. So apply the quirk, and make it the last one since it's an LED quirk. Fixes: 07bcab93946c ("ALSA: hda/realtek: Add support for HP Laptops") Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20220324062159.241313-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 7ef66d186eb95f987a97fb3329b65c840e2dc9bf Author: Jens Axboe Date: Thu Mar 24 06:53:18 2022 -0600 io_uring: remove IORING_CQE_F_MSG This was introduced with the message ring opcode, but isn't strictly required for the request itself. The sender can encode what is needed in user_data, which is passed to the receiver. It's unclear if having a separate flag that essentially says "This CQE did not originate from an SQE on this ring" provides any real utility to applications. While we can always re-introduce a flag to provide this information, we cannot take it away at a later point in time. Remove the flag while we still can, before it's in a released kernel. Signed-off-by: Jens Axboe fs/io_uring.c | 3 +-- include/uapi/linux/io_uring.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) commit 7344bad7fb6daa4877a1c064b52c7d5f9182c41b Author: Jani Nikula Date: Wed Mar 23 12:04:38 2022 +0200 drm/edid: fix CEA extension byte #3 parsing Only an EDID CEA extension has byte #3, while the CTA DisplayID Data Block does not. Don't interpret bogus data for color formats. For most displays it's probably an unlikely scenario you'd have a CTA DisplayID Data Block without a CEA extension, but they do exist. Fixes: e28ad544f462 ("drm/edid: parse CEA blocks embedded in DisplayID") Cc: Cc: Shawn C Lee Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220323100438.1757295-1-jani.nikula@intel.com drivers/gpu/drm/drm_edid.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit 5662abf6e21338be6d085d6375d3732ac6147fd2 Author: Cooper Chiou Date: Thu Mar 24 14:12:18 2022 +0800 drm/edid: check basic audio support on CEA extension block Tag code stored in bit7:5 for CTA block byte[3] is not the same as CEA extension block definition. Only check CEA block has basic audio support. v3: update commit message. Cc: stable@vger.kernel.org Cc: Jani Nikula Cc: Shawn C Lee Cc: intel-gfx Signed-off-by: Cooper Chiou Signed-off-by: Lee Shawn C Fixes: e28ad544f462 ("drm/edid: parse CEA blocks embedded in DisplayID") Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220324061218.32739-1-shawn.c.lee@intel.com drivers/gpu/drm/drm_edid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit f8f9f21c7848e63133c16c899f3d84aa54eb79fe Author: Feiyang Chen Date: Sat Mar 19 17:40:02 2022 +0800 MIPS: Fix build error for loongson64 and sgi-ip27 Select HAVE_ARCH_NODEDATA_EXTENSION for loongson64 to fix build error when CONFIG_NUMA=y: mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init': (.init.text+0x1714): undefined reference to `node_data' mips64el-unknown-linux-gnu-ld: (.init.text+0x1730): undefined reference to `node_data' Also, select HAVE_ARCH_NODEDATA_EXTENSION for sgi-ip27 to fix build error: mips64el-unknown-linux-gnu-ld: mm/page_alloc.o: in function `free_area_init': page_alloc.c:(.init.text+0x1ba8): undefined reference to `node_data' mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bcc): undefined reference to `node_data' mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1be4): undefined reference to `node_data' mips64el-unknown-linux-gnu-ld: page_alloc.c:(.init.text+0x1bf4): undefined reference to `node_data' Signed-off-by: Feiyang Chen Reviewed-by: Huacai Chen Signed-off-by: Thomas Bogendoerfer arch/mips/Kconfig | 5 +++++ arch/mips/loongson64/numa.c | 10 ++++++++++ arch/mips/sgi-ip27/ip27-memory.c | 10 ++++++++++ 3 files changed, 25 insertions(+) commit b9080ba4a6ec56447f263082825a4fddb873316b Author: Borislav Petkov Date: Wed Mar 23 12:21:10 2022 +0100 x86/defconfig: Enable WERROR To quote Linus: "EVERYBODY should have CONFIG_WERROR=y on at least x86-64 and other serious architectures, unless you have some completely random experimental (and broken) compiler. New compiler warnings are not acceptable." So this should make at least the most obvious and common ones not go unnoticed. Acked-by: Linus Torvalds Signed-off-by: Borislav Petkov Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/YjsCpoRK7W4l6tSh@zn.tnic arch/x86/configs/i386_defconfig | 1 + arch/x86/configs/x86_64_defconfig | 1 + 2 files changed, 2 insertions(+) commit b027471adaf955efde6153d67f391fe1604b7292 Author: Marco Elver Date: Wed Mar 23 16:07:21 2022 -0700 Revert "ubsan, kcsan: Don't combine sanitizer with kcov on clang" This reverts commit ea91a1d45d19469001a4955583187b0d75915759. Since df05c0e9496c ("Documentation: Raise the minimum supported version of LLVM to 11.0.0") the minimum Clang version is now 11.0, which fixed the UBSAN/KCSAN vs. KCOV incompatibilities. Link: https://bugs.llvm.org/show_bug.cgi?id=45831 Link: https://lkml.kernel.org/r/YaodyZzu0MTCJcvO@elver.google.com Link: https://lkml.kernel.org/r/20220128105631.509772-1-elver@google.com Signed-off-by: Marco Elver Reviewed-by: Nathan Chancellor Reviewed-by: Kees Cook Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/Kconfig.kcsan | 11 ----------- lib/Kconfig.ubsan | 12 ------------ 2 files changed, 23 deletions(-) commit 0cbcc92917c5de80f15c24d033566539ad696892 Author: Miaohe Lin Date: Wed Mar 23 16:07:18 2022 -0700 kernel/resource: fix kfree() of bootmem memory again Since commit ebff7d8f270d ("mem hotunplug: fix kfree() of bootmem memory"), we could get a resource allocated during boot via alloc_resource(). And it's required to release the resource using free_resource(). Howerver, many people use kfree directly which will result in kernel BUG. In order to fix this without fixing every call site, just leak a couple of bytes in such corner case. Link: https://lkml.kernel.org/r/20220217083619.19305-1-linmiaohe@huawei.com Fixes: ebff7d8f270d ("mem hotunplug: fix kfree() of bootmem memory") Signed-off-by: Miaohe Lin Suggested-by: David Hildenbrand Cc: Dan Williams Cc: Alistair Popple Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/resource.c | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) commit b3d7fe86fbd06638c71dd851ba921adf50d912ce Author: Aleksandr Nogikh Date: Wed Mar 23 16:07:15 2022 -0700 kcov: properly handle subsequent mmap calls Allocate the kcov buffer during KCOV_MODE_INIT in order to untie mmapping of a kcov instance and the actual coverage collection process. Modify kcov_mmap, so that it can be reliably used any number of times once KCOV_MODE_INIT has succeeded. These changes to the user-facing interface of the tool only weaken the preconditions, so all existing user space code should remain compatible with the new version. Link: https://lkml.kernel.org/r/20220117153634.150357-3-nogikh@google.com Signed-off-by: Aleksandr Nogikh Reviewed-by: Dmitry Vyukov Reviewed-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Marco Elver Cc: Sebastian Andrzej Siewior Cc: Taras Madan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/kcov.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) commit 17581aa13680e1c38759cbb0ed32d04aa8849bea Author: Aleksandr Nogikh Date: Wed Mar 23 16:07:12 2022 -0700 kcov: split ioctl handling into locked and unlocked parts Patch series "kcov: improve mmap processing", v3. Subsequent mmaps of the same kcov descriptor currently do not update the virtual memory of the task and yet return 0 (success). This is counter-intuitive and may lead to unexpected memory access errors. Also, this unnecessarily limits the functionality of kcov to only the simplest usage scenarios. Kcov instances are effectively forever attached to their first address spaces and it becomes impossible to e.g. reuse the same kcov handle in forked child processes without mmapping the memory first. This is exactly what we tried to do in syzkaller and inadvertently came upon this behavior. This patch series addresses the problem described above. This patch (of 3): Currently all ioctls are de facto processed under a spinlock in order to serialise them. This, however, prohibits the use of vmalloc and other memory management functions in the implementations of those ioctls, unnecessary complicating any further changes to the code. Let all ioctls first be processed inside the kcov_ioctl() function which should execute the ones that are not compatible with spinlock and then pass control to kcov_ioctl_locked() for all other ones. KCOV_REMOTE_ENABLE is processed both in kcov_ioctl() and kcov_ioctl_locked() as the steps are easily separable. Although it is still compatible with a spinlock, move KCOV_INIT_TRACE handling to kcov_ioctl(), so that the changes from the next commit are easier to follow. Link: https://lkml.kernel.org/r/20220117153634.150357-1-nogikh@google.com Link: https://lkml.kernel.org/r/20220117153634.150357-2-nogikh@google.com Signed-off-by: Aleksandr Nogikh Reviewed-by: Dmitry Vyukov Reviewed-by: Andrey Konovalov Cc: Marco Elver Cc: Alexander Potapenko Cc: Taras Madan Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/kcov.c | 68 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 31 deletions(-) commit f953f140f318a641c443b0b8c618155ed90a7a10 Author: Guilherme G. Piccoli Date: Wed Mar 23 16:07:09 2022 -0700 panic: move panic_print before kmsg dumpers The panic_print setting allows users to collect more information in a panic event, like memory stats, tasks, CPUs backtraces, etc. This is an interesting debug mechanism, but currently the print event happens *after* kmsg_dump(), meaning that pstore, for example, cannot collect a dmesg with the panic_print extra information. This patch changes that in 2 steps: (a) The panic_print setting allows to replay the existing kernel log buffer to the console (bit 5), besides the extra information dump. This functionality makes sense only at the end of the panic() function. So, we hereby allow to distinguish the two situations by a new boolean parameter in the function panic_print_sys_info(). (b) With the above change, we can safely call panic_print_sys_info() before kmsg_dump(), allowing to dump the extra information when using pstore or other kmsg dumpers. The additional messages from panic_print could overwrite the oldest messages when the buffer is full. The only reasonable solution is to use a large enough log buffer, hence we added an advice into the kernel parameters documentation about that. Link: https://lkml.kernel.org/r/20220214141308.841525-1-gpiccoli@igalia.com Signed-off-by: Guilherme G. Piccoli Acked-by: Baoquan He Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Cc: Feng Tang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/kernel-parameters.txt | 4 ++++ kernel/panic.c | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) commit 8d470a45d1a65e6a308aeee5da7f5b37d3303c04 Author: Guilherme G. Piccoli Date: Wed Mar 23 16:07:06 2022 -0700 panic: add option to dump all CPUs backtraces in panic_print Currently the "panic_print" parameter/sysctl allows some interesting debug information to be printed during a panic event. This is useful for example in cases the user cannot kdump due to resource limits, or if the user collects panic logs in a serial output (or pstore) and prefers a fast reboot instead of a kdump. Happens that currently there's no way to see all CPUs backtraces in a panic using "panic_print" on architectures that support that. We do have "oops_all_cpu_backtrace" sysctl, but although partially overlapping in the functionality, they are orthogonal in nature: "panic_print" is a panic tuning (and we have panics without oopses, like direct calls to panic() or maybe other paths that don't go through oops_enter() function), and the original purpose of "oops_all_cpu_backtrace" is to provide more information on oopses for cases in which the users desire to continue running the kernel even after an oops, i.e., used in non-panic scenarios. So, we hereby introduce an additional bit for "panic_print" to allow dumping the CPUs backtraces during a panic event. Link: https://lkml.kernel.org/r/20211109202848.610874-3-gpiccoli@igalia.com Signed-off-by: Guilherme G. Piccoli Reviewed-by: Feng Tang Cc: Iurii Zaikin Cc: Kees Cook Cc: Luis Chamberlain Cc: Samuel Iglesias Gonsalvez Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/kernel-parameters.txt | 1 + Documentation/admin-guide/sysctl/kernel.rst | 1 + kernel/panic.c | 4 ++++ 3 files changed, 6 insertions(+) commit a1ff1de00db21ecb956213f046b79741b64c6b65 Author: Guilherme G. Piccoli Date: Wed Mar 23 16:07:03 2022 -0700 docs: sysctl/kernel: add missing bit to panic_print Patch series "Some improvements on panic_print". This is a mix of a documentation fix with some additions to the "panic_print" syscall / parameter. The goal here is being able to collect all CPUs backtraces during a panic event and also to enable "panic_print" in a kdump event - details of the reasoning and design choices in the patches. This patch (of 3): Commit de6da1e8bcf0 ("panic: add an option to replay all the printk message in buffer") added a new bit to the sysctl/kernel parameter "panic_print", but the documentation was added only in kernel-parameters.txt, not in the sysctl guide. Fix it here by adding bit 5 to sysctl admin-guide documentation. [rdunlap@infradead.org: fix table format warning] Link: https://lkml.kernel.org/r/20220109055635.6999-1-rdunlap@infradead.org Link: https://lkml.kernel.org/r/20211109202848.610874-1-gpiccoli@igalia.com Link: https://lkml.kernel.org/r/20211109202848.610874-2-gpiccoli@igalia.com Fixes: de6da1e8bcf0 ("panic: add an option to replay all the printk message in buffer") Signed-off-by: Guilherme G. Piccoli Reviewed-by: Feng Tang Cc: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: Samuel Iglesias Gonsalvez Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/sysctl/kernel.rst | 1 + 1 file changed, 1 insertion(+) commit 92333baaceb399c7878c7f868a0746d7d22f9b77 Author: Lukas Bulwahn Date: Wed Mar 23 16:07:00 2022 -0700 taskstats: remove unneeded dead assignment make clang-analyzer on x86_64 defconfig caught my attention with: kernel/taskstats.c:120:2: warning: Value stored to 'rc' is never read \ [clang-analyzer-deadcode.DeadStores] rc = 0; ^ Commit d94a041519f3 ("taskstats: free skb, avoid returns in send_cpu_listeners") made send_cpu_listeners() not return a value and hence, the rc variable remained only to be used within the loop where it is always assigned before read and it does not need any other initialisation. So, simply remove this unneeded dead initializing assignment. As compilers will detect this unneeded assignment and optimize this anyway, the resulting object code is identical before and after this change. No functional change. No change to object code. [akpm@linux-foundation.org: reduce scope of `rc'] Link: https://lkml.kernel.org/r/20220307093942.21310-1-lukas.bulwahn@gmail.com Signed-off-by: Lukas Bulwahn Reviewed-by: Nick Desaulniers Cc: Balbir Singh Cc: Tom Rix Cc: Nathan Chancellor Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/taskstats.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit e7ce7500375a63348e1d3a703c8d5003cbe3fea6 Author: Tiezhu Yang Date: Wed Mar 23 16:06:57 2022 -0700 kasan: no need to unset panic_on_warn in end_report() panic_on_warn is unset inside panic(), so no need to unset it before calling panic() in end_report(). Link: https://lkml.kernel.org/r/1644324666-15947-6-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Reviewed-by: Marco Elver Cc: Andrey Ryabinin Cc: Baoquan He Cc: Jonathan Corbet Cc: Xuefeng Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kasan/report.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) commit d83ce027a54068fabb70d2c252e1ce2da86784a4 Author: Tiezhu Yang Date: Wed Mar 23 16:06:54 2022 -0700 ubsan: no need to unset panic_on_warn in ubsan_epilogue() panic_on_warn is unset inside panic(), so no need to unset it before calling panic() in ubsan_epilogue(). Link: https://lkml.kernel.org/r/1644324666-15947-5-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Reviewed-by: Marco Elver Cc: Andrey Ryabinin Cc: Baoquan He Cc: Jonathan Corbet Cc: Xuefeng Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/ubsan.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) commit 1a2383e8b84c0451fd9b1eec3b9aab16f30b597c Author: Tiezhu Yang Date: Wed Mar 23 16:06:51 2022 -0700 panic: unset panic_on_warn inside panic() In the current code, the following three places need to unset panic_on_warn before calling panic() to avoid recursive panics: kernel/kcsan/report.c: print_report() kernel/sched/core.c: __schedule_bug() mm/kfence/report.c: kfence_report_error() In order to avoid copy-pasting "panic_on_warn = 0" all over the places, it is better to move it inside panic() and then remove it from the other places. Link: https://lkml.kernel.org/r/1644324666-15947-4-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Reviewed-by: Marco Elver Cc: Andrey Ryabinin Cc: Baoquan He Cc: Jonathan Corbet Cc: Xuefeng Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/panic.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) commit ae6694c1aa8f97c20b448622e4d6ba9adeca082d Author: Tiezhu Yang Date: Wed Mar 23 16:06:48 2022 -0700 docs: kdump: add scp example to write out the dump file Except cp and makedumpfile, add scp example to write out the dump file. Link: https://lkml.kernel.org/r/1644324666-15947-3-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Acked-by: Baoquan He Cc: Andrey Ryabinin Cc: Jonathan Corbet Cc: Marco Elver Cc: Xuefeng Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/kdump/kdump.rst | 4 ++++ 1 file changed, 4 insertions(+) commit b2377d4b94519dd84364a82ba14c79c50ac34fa9 Author: Tiezhu Yang Date: Wed Mar 23 16:06:45 2022 -0700 docs: kdump: update description about sysfs file system support Patch series "Update doc and fix some issues about kdump", v2. This patch (of 5): After commit 6a108a14fa35 ("kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT"), "Configure standard kernel features (for small systems)" is not exist, we should use "Configure standard kernel features (expert users)" now. Link: https://lkml.kernel.org/r/1644324666-15947-1-git-send-email-yangtiezhu@loongson.cn Link: https://lkml.kernel.org/r/1644324666-15947-2-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Acked-by: Baoquan He Cc: Baoquan He Cc: Jonathan Corbet Cc: Marco Elver Cc: Andrey Ryabinin Cc: Xuefeng Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/kdump/kdump.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit d339f1584f0acf32b32326627fa3b48e6e65c599 Author: Jisheng Zhang Date: Wed Mar 23 16:06:42 2022 -0700 arm64: mm: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" by a check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code and increase compile coverage. Link: https://lkml.kernel.org/r/20211206160514.2000-5-jszhang@kernel.org Signed-off-by: Jisheng Zhang Acked-by: Catalin Marinas Acked-by: Baoquan He Cc: Albert Ou Cc: Alexandre Ghiti Cc: Borislav Petkov Cc: Dave Hansen Cc: Eric W. Biederman Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Palmer Dabbelt Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Russell King Cc: Russell King (Oracle) Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/arm64/mm/init.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) commit 4ece09be9913a87ff99ea347fd7e7adad5bdbc8f Author: Jisheng Zhang Date: Wed Mar 23 16:06:39 2022 -0700 x86/setup: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" by a check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code and increase compile coverage. Link: https://lkml.kernel.org/r/20211206160514.2000-4-jszhang@kernel.org Signed-off-by: Jisheng Zhang Acked-by: Baoquan He Cc: Albert Ou Cc: Alexandre Ghiti Cc: Borislav Petkov Cc: Catalin Marinas Cc: Dave Hansen Cc: Eric W. Biederman Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Palmer Dabbelt Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Russell King Cc: Russell King (Oracle) Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/x86/kernel/setup.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) commit d414cb379ac35e3523484e1d866b27832c2218c7 Author: Jisheng Zhang Date: Wed Mar 23 16:06:36 2022 -0700 riscv: mm: init: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" by a check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code and increase compile coverage. Link: https://lkml.kernel.org/r/20211206160514.2000-3-jszhang@kernel.org Signed-off-by: Jisheng Zhang Acked-by: Palmer Dabbelt Acked-by: Baoquan He Cc: Albert Ou Cc: Alexandre Ghiti Cc: Borislav Petkov Cc: Catalin Marinas Cc: Dave Hansen Cc: Eric W. Biederman Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Russell King Cc: Russell King (Oracle) Cc: Thomas Gleixner Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/riscv/mm/init.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit f05fa10901aa4b11a84257ecb7ac7f8fe7c4ee1b Author: Jisheng Zhang Date: Wed Mar 23 16:06:33 2022 -0700 kexec: make crashk_res, crashk_low_res and crash_notes symbols always visible Patch series "kexec: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef", v2. Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" by a check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code and increase compile coverage. I only modified x86, arm, arm64 and riscv, other architectures such as sh, powerpc and s390 are better to be kept kexec code as-is so they are not touched. This patch (of 5): Make the forward declarations of crashk_res, crashk_low_res and crash_notes always visible. Code referring to these symbols can then just check for IS_ENABLED(CONFIG_KEXEC_CORE), instead of requiring conditional compilation using an #ifdef, thus preparing to increase compile coverage and simplify the code. Link: https://lkml.kernel.org/r/20211206160514.2000-1-jszhang@kernel.org Link: https://lkml.kernel.org/r/20211206160514.2000-2-jszhang@kernel.org Signed-off-by: Jisheng Zhang Acked-by: Baoquan He Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Eric W. Biederman Cc: Alexandre Ghiti Cc: Palmer Dabbelt Cc: Russell King (Oracle) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kexec.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit b1e2c8df0f007f34c373925471c7b493c9e16620 Author: Sebastian Andrzej Siewior Date: Wed Mar 23 16:06:29 2022 -0700 cgroup: use irqsave in cgroup_rstat_flush_locked(). All callers of cgroup_rstat_flush_locked() acquire cgroup_rstat_lock either with spin_lock_irq() or spin_lock_irqsave(). cgroup_rstat_flush_locked() itself acquires cgroup_rstat_cpu_lock which is a raw_spin_lock. This lock is also acquired in cgroup_rstat_updated() in IRQ context and therefore requires _irqsave() locking suffix in cgroup_rstat_flush_locked(). Since there is no difference between spin_lock_t and raw_spin_lock_t on !RT lockdep does not complain here. On RT lockdep complains because the interrupts were not disabled here and a deadlock is possible. Acquire the raw_spin_lock_t with disabled interrupts. Link: https://lkml.kernel.org/r/20220301122143.1521823-2-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Acked-by: Tejun Heo Cc: Johannes Weiner Cc: Thomas Gleixner Cc: Zefan Li From: Sebastian Andrzej Siewior Subject: cgroup: add a comment to cgroup_rstat_flush_locked(). Add a comment why spin_lock_irq() -> raw_spin_lock_irqsave() is needed. Link: https://lkml.kernel.org/r/Yh+DOK73hfVV5ThX@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Acked-by: Tejun Heo Cc: Johannes Weiner Cc: Thomas Gleixner Cc: Zefan Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/cgroup/rstat.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit 2cd50532ce5c798c029a39234ad7f48a174e15ec Author: Helge Deller Date: Wed Mar 23 16:06:26 2022 -0700 fat: use pointer to simple type in put_user() The put_user(val,ptr) macro wants a pointer to a simple type, but in fat_ioctl_filldir() the d_name field references an "array of chars". Be more accurate and explicitly give the pointer to the first character of the d_name[] array. I noticed that issue while trying to optimize the parisc put_user() macro and used an intermediate variable to store the pointer. In that case I got this error: In file included from include/linux/uaccess.h:11, from include/linux/compat.h:17, from fs/fat/dir.c:18: fs/fat/dir.c: In function `fat_ioctl_filldir': fs/fat/dir.c:725:33: error: invalid initializer 725 | if (put_user(0, d2->d_name) || \ | ^~ include/asm/uaccess.h:152:33: note: in definition of macro `__put_user' 152 | __typeof__(ptr) __ptr = ptr; \ | ^~~ fs/fat/dir.c:759:1: note: in expansion of macro `FAT_IOCTL_FILLDIR_FUNC' 759 | FAT_IOCTL_FILLDIR_FUNC(fat_ioctl_filldir, __fat_dirent) Andreas Schwab suggested to use __typeof__(&*(ptr)) __ptr = ptr; instead. This works, but nevertheless it's probably reasonable to fix the original caller too. Link: https://lkml.kernel.org/r/Ygo+A9MREmC1H3kr@p100 Signed-off-by: Helge Deller Acked-by: OGAWA Hirofumi Cc: David Laight Cc: Andreas Schwab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/fat/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9ce3c0d26c42d279b6c378a03cd6a61d828f19ca Author: Qinghua Jin Date: Wed Mar 23 16:06:23 2022 -0700 minix: fix bug when opening a file with O_DIRECT Testcase: 1. create a minix file system and mount it 2. open a file on the file system with O_RDWR|O_CREAT|O_TRUNC|O_DIRECT 3. open fails with -EINVAL but leaves an empty file behind. All other open() failures don't leave the failed open files behind. It is hard to check the direct_IO op before creating the inode. Just as ext4 and btrfs do, this patch will resolve the issue by allowing to create the file with O_DIRECT but returning error when writing the file. Link: https://lkml.kernel.org/r/20220107133626.413379-1-qhjin.dev@gmail.com Signed-off-by: Qinghua Jin Reported-by: Colin Ian King Reviewed-by: Jan Kara Acked-by: Christian Brauner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/minix/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit aeb213cddeb5c31f8d418180e0b9956bfd53b018 Author: Andrei Vagin Date: Wed Mar 23 16:06:20 2022 -0700 fs/pipe.c: local vars have to match types of proper pipe_inode_info fields head, tail, ring_size are declared as unsigned int, so all local variables that operate with these fields have to be unsigned to avoid signed integer overflow. Right now, it isn't an issue because the maximum pipe size is limited by 1U<<31. Link: https://lkml.kernel.org/r/20220106171946.36128-1-avagin@gmail.com Signed-off-by: Andrei Vagin Suggested-by: Dmitry Safonov <0x7f454c46@gmail.com> Acked-by: Christian Brauner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5a519c8fe4d620912385f94372fc8472fa98c662 Author: Andrei Vagin Date: Wed Mar 23 16:06:17 2022 -0700 fs/pipe: use kvcalloc to allocate a pipe_buffer array Right now, kcalloc is used to allocate a pipe_buffer array. The size of the pipe_buffer struct is 40 bytes. kcalloc allows allocating reliably chunks with sizes less or equal to PAGE_ALLOC_COSTLY_ORDER (3). It means that the maximum pipe size is 3.2MB in this case. In CRIU, we use pipes to dump processes memory. CRIU freezes a target process, injects a parasite code into it and then this code splices memory into pipes. If a maximum pipe size is small, we need to do many iterations or create many pipes. kvcalloc attempt to allocate physically contiguous memory, but upon failure, fall back to non-contiguous (vmalloc) allocation and so it isn't limited by PAGE_ALLOC_COSTLY_ORDER. The maximum pipe size for non-root users is limited by the /proc/sys/fs/pipe-max-size sysctl that is 1MB by default, so only the root user will be able to trigger vmalloc allocations. Link: https://lkml.kernel.org/r/20220104171058.22580-1-avagin@gmail.com Signed-off-by: Andrei Vagin Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Alexander Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/pipe.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit f9a40b0890658330c83c95511f9d6b396610defc Author: Randy Dunlap Date: Wed Mar 23 16:06:14 2022 -0700 init/main.c: return 1 from handled __setup() functions initcall_blacklist() should return 1 to indicate that it handled its cmdline arguments. set_debug_rodata() should return 1 to indicate that it handled its cmdline arguments. Print a warning if the option string is invalid. This prevents these strings from being added to the 'init' program's environment as they are not init arguments/parameters. Link: https://lkml.kernel.org/r/20220221050901.23985-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Cc: Ingo Molnar Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds init/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit abc7da58c4b388ab9f6a756c0f297c29d3af665f Author: Randy Dunlap Date: Wed Mar 23 16:06:11 2022 -0700 init.h: improve __setup and early_param documentation Igor noted in [1] that there are quite a few __setup() handling functions that return incorrect values. Doing this can be harmless, but it can also cause strings to be added to init's argument or environment list, polluting them. Since __setup() handling and return values are not documented, first add documentation for that. Also add more documentation for early_param() handling and return values. For __setup() functions, returning 0 (not handled) has questionable value if it is just a malformed option value, as in rodata=junk since returning 0 would just cause "rodata=junk" to be added to init's environment unnecessarily: Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux splash=native rodata=junk Also, there are no recommendations on whether to print a warning when an unknown parameter value is seen. I am not addressing that here. [1] lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Link: https://lkml.kernel.org/r/20220221050852.1147-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Cc: Ingo Molnar Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/init.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 105e8c2e47788a612bbc0fc135a3c75ef25f29e4 Author: Mark-PK Tsai Date: Wed Mar 23 16:06:08 2022 -0700 init: use ktime_us_delta() to make initcall_debug log more precise Use ktime_us_delta() to make the initcall_debug log more precise than right shifting the result of ktime_to_ns() by 10 bits. Link: https://lkml.kernel.org/r/20220209053350.15771-1-mark-pk.tsai@mediatek.com Signed-off-by: Mark-PK Tsai Reviewed-by: Andrew Halaney Tested-by: Andrew Halaney Cc: Steven Rostedt Cc: Matthias Brugger Cc: Masami Hiramatsu Cc: Vlastimil Babka Cc: Kefeng Wang Cc: Rasmus Villemoes Cc: Kees Cook Cc: Valentin Schneider Cc: Peter Zijlstra Cc: YJ Chiang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds init/main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) commit c882c6b1cb3105d378768aa168d2283f50b6e304 Author: Sagar Patel Date: Wed Mar 23 16:06:05 2022 -0700 checkpatch: use python3 to find codespell dictionary Commit 0ee3e7b8893e ("checkpatch: get default codespell dictionary path from package location") introduced the ability to search for the codespell dictionary rather than hardcoding its path. codespell requires Python 3.6 or above, but on some systems, the python executable is a Python 2.7 interpreter. In this case, searching for the dictionary fails, subsequently making codespell fail: No codespell typos will be found - file '/usr/share/codespell/dictionary.txt': No such file or directory So, use python3 to remove ambiguity. In addition, when searching for dictionary.txt, do not check if the codespell executable exists since, - checkpatch.pl only uses dictionary.txt, not the codespell executable. - codespell can be installed via a Python package manager, in which case the codespell executable may not be present in a typical $PATH, but a dictionary does exist. Link: https://lkml.kernel.org/r/20220309180048.147672-1-sagarmp@cs.unc.edu Signed-off-by: Sagar Patel Reviewed-by: Peter Ujfalusi Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 05dc40e694e0ff527011d0b09542f08da60e28cc Author: Joe Perches Date: Wed Mar 23 16:06:02 2022 -0700 checkpatch: add early_param exception to blank line after struct/function test Add early_param as another exception to the blank line preferred after function/struct/union declaration or definition test. Link: https://lkml.kernel.org/r/3bd6ada59f411a7685d7e64eeb670540d4bfdcde.camel@perches.com Signed-off-by: Joe Perches Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 481efd7bd6f28febddf189e7a970bb0bc5a53de8 Author: Joe Perches Date: Wed Mar 23 16:05:59 2022 -0700 checkpatch: add --fix option for some TRAILING_STATEMENTS Single line code like: if (foo) bar; should generally be written: if (foo) bar; Add a --fix test to do so. This fix is not done when an ASSIGN_IN_IF in the same line exists. Link: https://lkml.kernel.org/r/20220128185924.80137-2-joe@perches.com Signed-off-by: Joe Perches Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds scripts/checkpatch.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) commit 6e8f42dc9c8548c6b37566f3b8bda1873700c4a6 Author: Joe Perches Date: Wed Mar 23 16:05:56 2022 -0700 checkpatch: prefer MODULE_LICENSE("GPL") over MODULE_LICENSE("GPL v2") There is no effective difference. Given the large number of uses of "GPL v2", emit this message only for patches as a trivial treeside sed could be done one day. Ref: commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs. "GPL v2" bogosity") Link: https://lkml.kernel.org/r/20220128185924.80137-1-joe@perches.com Signed-off-by: Joe Perches Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+) commit 2699e5143c9b071d68b12b9a86b6312866a6160b Author: Randy Dunlap Date: Wed Mar 23 16:05:53 2022 -0700 lib: bitmap: fix many kernel-doc warnings Fix kernel-doc warings in lib/bitmap.c: lib/bitmap.c:498: warning: Function parameter or member 'buf' not described in 'bitmap_print_to_buf' lib/bitmap.c:498: warning: Function parameter or member 'maskp' not described in 'bitmap_print_to_buf' lib/bitmap.c:498: warning: Function parameter or member 'nmaskbits' not described in 'bitmap_print_to_buf' lib/bitmap.c:498: warning: Function parameter or member 'off' not described in 'bitmap_print_to_buf' lib/bitmap.c:498: warning: Function parameter or member 'count' not described in 'bitmap_print_to_buf' lib/bitmap.c:561: warning: contents before sections lib/bitmap.c:606: warning: Function parameter or member 'buf' not described in 'bitmap_print_list_to_buf' lib/bitmap.c:606: warning: Function parameter or member 'maskp' not described in 'bitmap_print_list_to_buf' lib/bitmap.c:606: warning: Function parameter or member 'nmaskbits' not described in 'bitmap_print_list_to_buf' lib/bitmap.c:606: warning: Function parameter or member 'off' not described in 'bitmap_print_list_to_buf' lib/bitmap.c:606: warning: Function parameter or member 'count' not described in 'bitmap_print_list_to_buf' lib/bitmap.c:819: warning: missing initial short description on line: * bitmap_parselist_user() This still leaves 15 warnings for function return values not described, similar to this one: bitmap.c:890: warning: No description found for return value of 'bitmap_parse' Link: https://lkml.kernel.org/r/20220306065823.5153-1-rdunlap@infradead.org Fixes: 1fae562983ca ("cpumask: introduce cpumap_print_list/bitmask_to_buf to support large bitmask and list") Fixes: 4b060420a596 ("bitmap, irq: add smp_affinity_list interface to /proc/irq") Signed-off-by: Randy Dunlap Cc: Yury Norov Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Tian Tao Cc: Mike Travis Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/bitmap.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) commit 1bf18da62106225dbc47aab41efee2aeb99caccd Author: Feng Tang Date: Wed Mar 23 16:05:50 2022 -0700 lib/Kconfig.debug: add ARCH dependency for FUNCTION_ALIGN option 0Day robots reported there is compiling issue for 'csky' ARCH when CONFIG_DEBUG_FORCE_DATA_SECTION_ALIGNED is enabled [1]: All errors (new ones prefixed by >>): {standard input}: Assembler messages: >> {standard input}:2277: Error: pcrel offset for branch to .LS000B too far (0x3c) Which was discussed in [2]. And as there is no solution for csky yet, add some dependency for this config to limit it to several ARCHs which have no compiling issue so far. [1]. https://lore.kernel.org/lkml/202202271612.W32UJAj2-lkp@intel.com/ [2]. https://www.spinics.net/lists/linux-kbuild/msg30298.html Link: https://lkml.kernel.org/r/20220304021100.GN4548@shbuild999.sh.intel.com Reported-by: kernel test robot Signed-off-by: Feng Tang Cc: Guo Ren Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/Kconfig.debug | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 25cb5b7ac6a7f7943e22a6831b74a6aa964d2a0c Author: Andy Shevchenko Date: Wed Mar 23 16:05:47 2022 -0700 bitfield: add explicit inclusions to the example It's not obvious that bitfield.h doesn't guarantee the bits.h inclusion and the example in the former is confusing. Some developers think that it's okay to just include bitfield.h to get it working. Change example to explicitly include necessary headers in order to avoid confusion. Link: https://lkml.kernel.org/r/20220207123341.47533-1-andriy.shevchenko@linux.intel.com Fixes: 3e9b3112ec74 ("add basic register-field manipulation macros") Depends-on: 8bd9cb51daac ("locking/atomics, asm-generic: Move some macros from to a new file") Signed-off-by: Andy Shevchenko Reported-by: Jan Dąbroś Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/bitfield.h | 3 +++ 1 file changed, 3 insertions(+) commit f334f5668bedf7307f6df1d98b14f55902931926 Author: Christophe Leroy Date: Wed Mar 23 16:05:44 2022 -0700 ilog2: force inlining of __ilog2_u32() and __ilog2_u64() Building a kernel with CONFIG_CC_OPTIMISE_FOR_SIZE leads to __ilog2_u32() being duplicated 50 times and __ilog2_u64() 3 times in vmlinux on a tiny powerpc32 config. __ilog2_u32() being 2 instructions it is not worth being kept out of line, so force inlining. Allthough the u64 version is a bit bigger, there is still a small benefit in keeping it inlined. On a 64 bits config there's a real benefit. With this change the size of vmlinux text is reduced by 1 kbytes, which is approx 50% more than the size of the removed functions. Before the patch there is for instance: c00d2a94 <__ilog2_u32>: c00d2a94: 7c 63 00 34 cntlzw r3,r3 c00d2a98: 20 63 00 1f subfic r3,r3,31 c00d2a9c: 4e 80 00 20 blr c00d36d8 <__order_base_2>: c00d36d8: 28 03 00 01 cmplwi r3,1 c00d36dc: 40 81 00 2c ble c00d3708 <__order_base_2+0x30> c00d36e0: 94 21 ff f0 stwu r1,-16(r1) c00d36e4: 7c 08 02 a6 mflr r0 c00d36e8: 38 63 ff ff addi r3,r3,-1 c00d36ec: 90 01 00 14 stw r0,20(r1) c00d36f0: 4b ff f3 a5 bl c00d2a94 <__ilog2_u32> c00d36f4: 80 01 00 14 lwz r0,20(r1) c00d36f8: 38 63 00 01 addi r3,r3,1 c00d36fc: 7c 08 03 a6 mtlr r0 c00d3700: 38 21 00 10 addi r1,r1,16 c00d3704: 4e 80 00 20 blr c00d3708: 38 60 00 00 li r3,0 c00d370c: 4e 80 00 20 blr With the patch it has become: c00d356c <__order_base_2>: c00d356c: 28 03 00 01 cmplwi r3,1 c00d3570: 40 81 00 14 ble c00d3584 <__order_base_2+0x18> c00d3574: 38 63 ff ff addi r3,r3,-1 c00d3578: 7c 63 00 34 cntlzw r3,r3 c00d357c: 20 63 00 20 subfic r3,r3,32 c00d3580: 4e 80 00 20 blr c00d3584: 38 60 00 00 li r3,0 c00d3588: 4e 80 00 20 blr No more need for __order_base_2() to setup a stack frame and save/restore caller address. And the following 'add 1' is merged in the subtract. Another typical use of it: c080ff28 : ... c080fff8: 7f c3 f3 78 mr r3,r30 c080fffc: 4b 8f 81 f1 bl c01081ec <__ilog2_u32> c0810000: 38 63 ff f2 addi r3,r3,-14 ... Becomes c080ff1c : ... c080ffec: 7f c3 00 34 cntlzw r3,r30 c080fff0: 20 63 00 11 subfic r3,r3,17 ... Here no need to move r30 argument to r3 then substract 14 to result. Just work on r30 and merge the 'sub 14' with the 'sub from 31'. Link: https://lkml.kernel.org/r/803a2ac3d923ebcfd0dd40f5886b05cae7bb0aba.1644243860.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/log2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 14e83077d55ff4b88fe39f5e98fb8230c2ccb4fb Author: Rasmus Villemoes Date: Wed Mar 23 16:05:41 2022 -0700 include: drop pointless __compiler_offsetof indirection (1) compiler_types.h is unconditionally included via an -include flag (see scripts/Makefile.lib), and it defines __compiler_offsetof unconditionally. So testing for definedness of __compiler_offsetof is mostly pointless. (2) Every relevant compiler provides __builtin_offsetof (even sparse has had that for 14 years), and if for whatever reason one would end up picking up the poor man's fallback definition (C file compiler with completely custom CFLAGS?), newer clang versions won't treat the result as an Integer Constant Expression, so if used in place where such is required (static initializer or static_assert), one would get errors like t.c:11:16: error: static_assert expression is not an integral constant expression t.c:11:16: note: cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression t.c:4:33: note: expanded from macro 'offsetof' #define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER) So just define offsetof unconditionally and directly in terms of __builtin_offsetof. Link: https://lkml.kernel.org/r/20220202102147.326672-1-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Reviewed-by: Miguel Ojeda Reviewed-by: Nathan Chancellor Reviewed-by: Kees Cook Acked-by: Nick Desaulniers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/compiler_types.h | 2 -- include/linux/stddef.h | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) commit f9b3cd24578401e7a392974b3353277286e49cee Author: Kees Cook Date: Wed Mar 23 16:05:38 2022 -0700 Kconfig.debug: make DEBUG_INFO selectable from a choice Currently it's not possible to enable DEBUG_INFO for an all*config build, since it is marked as "depends on !COMPILE_TEST". This generally makes sense because a debug build of an all*config target ends up taking much longer and the output is much larger. Having this be "default off" makes sense. However, there are cases where enabling DEBUG_INFO for such builds is useful for doing treewide A/B comparisons of build options, etc. Make DEBUG_INFO selectable from any of the DWARF version choice options, with DEBUG_INFO_NONE being the default for COMPILE_TEST. The mutually exclusive relationship between DWARF5 and BTF must be inverted, but the result remains the same. Additionally moves DEBUG_KERNEL and DEBUG_MISC up to the top of the menu because they were enabling features _above_ it, making it weird to navigate menuconfig. [keescook@chromium.org: make DEBUG_INFO always default=n] Link: https://lkml.kernel.org/r/20220128214131.580131-1-keescook@chromium.org Link: https://lore.kernel.org/lkml/YfRY6+CaQxX7O8vF@dev-arch.archlinux-ax161 Link: https://lkml.kernel.org/r/20220125075126.891825-1-keescook@chromium.org Signed-off-by: Kees Cook Suggested-by: Arnd Bergmann Reviewed-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Reviewed-by: Masahiro Yamada Cc: Nick Desaulniers Cc: Tetsuo Handa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/Kconfig.debug | 139 +++++++++++++++++++++++++++++------------------------- 1 file changed, 74 insertions(+), 65 deletions(-) commit a7cd9a5376aa188529393a802329645dc8c5a63c Author: Miaohe Lin Date: Wed Mar 23 16:05:35 2022 -0700 kernel/ksysfs.c: use helper macro __ATTR_RW Use helper macro __ATTR_RW to define kobj_attribute to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220222112034.48298-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds kernel/ksysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 179fd6ba3bacbf7b19cbdf9b14be109d54318394 Author: Bjorn Helgaas Date: Wed Mar 23 16:05:32 2022 -0700 Documentation/sparse: add hints about __CHECKER__ Several attributes depend on __CHECKER__, but previously there was no clue in the tree about when __CHECKER__ might be defined. Add hints at the most common places (__kernel, __user, __iomem, __bitwise) and in the sparse documentation. Link: https://lkml.kernel.org/r/20220310220927.245704-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: "Michael S . Tsirkin" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/dev-tools/sparse.rst | 2 ++ include/linux/compiler_types.h | 1 + include/uapi/linux/types.h | 1 + 3 files changed, 4 insertions(+) commit c724c866bb70cb8c607081a26823a1f0ebde4387 Author: Bjorn Helgaas Date: Wed Mar 23 16:05:29 2022 -0700 linux/types.h: remove unnecessary __bitwise__ There are no users of "__bitwise__" except the definition of "__bitwise". Remove __bitwise__ and define __bitwise directly. This is a follow-up to 05de97003c77 ("linux/types.h: enable endian checks for all sparse builds"). [akpm@linux-foundation.org: change the tools/include/linux/types.h definition also] Link: https://lkml.kernel.org/r/20220310220927.245704-2-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Michael S. Tsirkin Cc: Jonathan Corbet Cc: Nathan Chancellor Cc: Nick Desaulniers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/uapi/linux/types.h | 5 ++--- tools/include/linux/types.h | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) commit e9f5d1017c50db2ec3976d026d48daa5800b0ee1 Author: Yang Li Date: Wed Mar 23 16:05:26 2022 -0700 proc/vmcore: fix vmcore_alloc_buf() kernel-doc comment Fix a spelling problem to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/proc/vmcore.c:492: warning: Function parameter or member 'size' not described in 'vmcore_alloc_buf' fs/proc/vmcore.c:492: warning: Excess function parameter 'sizez' description in 'vmcore_alloc_buf' Link: https://lkml.kernel.org/r/20220129011449.105278-1-yang.lee@linux.alibaba.com Signed-off-by: Yang Li Reported-by: Abaci Robot Acked-by: Baoquan He Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/proc/vmcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5039b170369d22613ebc07e81410891f52280a45 Author: David Hildenbrand Date: Wed Mar 23 16:05:23 2022 -0700 proc/vmcore: fix possible deadlock on concurrent mmap and read Lockdep noticed that there is chance for a deadlock if we have concurrent mmap, concurrent read, and the addition/removal of a callback. As nicely explained by Boqun: "Lockdep warned about the above sequences because rw_semaphore is a fair read-write lock, and the following can cause a deadlock: TASK 1 TASK 2 TASK 3 ====== ====== ====== down_write(mmap_lock); down_read(vmcore_cb_rwsem) down_write(vmcore_cb_rwsem); // blocked down_read(vmcore_cb_rwsem); // cannot get the lock because of the fairness down_read(mmap_lock); // blocked IOW, a reader can block another read if there is a writer queued by the second reader and the lock is fair" To fix this, convert to srcu to make this deadlock impossible. We need srcu as our callbacks can sleep. With this change, I cannot trigger any lockdep warnings. ====================================================== WARNING: possible circular locking dependency detected 5.17.0-0.rc0.20220117git0c947b893d69.68.test.fc36.x86_64 #1 Not tainted ------------------------------------------------------ makedumpfile/542 is trying to acquire lock: ffffffff832d2eb8 (vmcore_cb_rwsem){.+.+}-{3:3}, at: mmap_vmcore+0x340/0x580 but task is already holding lock: ffff8880af226438 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x84/0x150 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&mm->mmap_lock#2){++++}-{3:3}: lock_acquire+0xc3/0x1a0 __might_fault+0x4e/0x70 _copy_to_user+0x1f/0x90 __copy_oldmem_page+0x72/0xc0 read_from_oldmem+0x77/0x1e0 read_vmcore+0x2c2/0x310 proc_reg_read+0x47/0xa0 vfs_read+0x101/0x340 __x64_sys_pread64+0x5d/0xa0 do_syscall_64+0x43/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae -> #0 (vmcore_cb_rwsem){.+.+}-{3:3}: validate_chain+0x9f4/0x2670 __lock_acquire+0x8f7/0xbc0 lock_acquire+0xc3/0x1a0 down_read+0x4a/0x140 mmap_vmcore+0x340/0x580 proc_reg_mmap+0x3e/0x90 mmap_region+0x504/0x880 do_mmap+0x38a/0x520 vm_mmap_pgoff+0xc1/0x150 ksys_mmap_pgoff+0x178/0x200 do_syscall_64+0x43/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_lock#2); lock(vmcore_cb_rwsem); lock(&mm->mmap_lock#2); lock(vmcore_cb_rwsem); *** DEADLOCK *** 1 lock held by makedumpfile/542: #0: ffff8880af226438 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x84/0x150 stack backtrace: CPU: 0 PID: 542 Comm: makedumpfile Not tainted 5.17.0-0.rc0.20220117git0c947b893d69.68.test.fc36.x86_64 #1 Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 Call Trace: __lock_acquire+0x8f7/0xbc0 lock_acquire+0xc3/0x1a0 down_read+0x4a/0x140 mmap_vmcore+0x340/0x580 proc_reg_mmap+0x3e/0x90 mmap_region+0x504/0x880 do_mmap+0x38a/0x520 vm_mmap_pgoff+0xc1/0x150 ksys_mmap_pgoff+0x178/0x200 do_syscall_64+0x43/0x90 Link: https://lkml.kernel.org/r/20220119193417.100385-1-david@redhat.com Fixes: cc5f2704c934 ("proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks") Signed-off-by: David Hildenbrand Reported-by: Baoquan He Acked-by: Baoquan He Cc: Vivek Goyal Cc: Dave Young Cc: "Paul E. McKenney" Cc: Josh Triplett Cc: Peter Zijlstra Cc: Boqun Feng Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/proc/vmcore.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) commit 3a72917ccfbb2eecabefc86aade8acd4a1e85888 Author: Hao Lee Date: Wed Mar 23 16:05:20 2022 -0700 proc: alloc PATH_MAX bytes for /proc/${pid}/fd/ symlinks It's not a standard approach that use __get_free_page() to alloc path buffer directly. We'd better use kmalloc and PATH_MAX. PAGE_SIZE is different on different archs. An unlinked file with very long canonical pathname will readlink differently because "(deleted)" eats into a buffer. --adobriyan [akpm@linux-foundation.org: remove now-unneeded cast] Link: https://lkml.kernel.org/r/Ye1fCxyZZ0I5lgOL@localhost.localdomain Signed-off-by: Hao Lee Signed-off-by: Alexey Dobriyan Cc: Christian Brauner Cc: Kees Cook Cc: James Morris Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/proc/base.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit ed4643521e6af8ab8ed1e467630a85884d2696cf Merge: b4bc93bd76d4 bcea9aaa4373 Author: Linus Torvalds Date: Wed Mar 23 18:37:22 2022 -0700 Merge tag 'arm-dt-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM devicetree updates from Arnd Bergmann: "After a somewhat quiet 5.17 release, the size of the DT changes is a bit larger again. There are nine new SoC that get added, all of them related to existing platforms: - Airoha (formerly Mediatek/EcoNet) EN7523 networking SoC and EVB - Mediatek mt6582 tablet platform with the Prestigio PMT5008 3G tablet - Microchip Lan966 networking SoC and it evaluation board - Qualcomm Snapdragon 625/632 midrange phone SoCs, with the LG Nexus 5X and Fairphone FP3 phones - Renesas RZ/G2LC and RZ/V2L general-purpose embedded SoCs, along with their evaluation boards - Samsung Exynos 850 phone SoC and reference board - Samsung Exynos7885 with the Samsung Galaxy A8 (2018) phone - Tesla FSD (Fully Self-Driving), an automotive SoC loosely derived from the Samsung Exynos family. - TI K3/AM62 SoC and reference board Support for additional functionality in existing dts files is added all over the place: Samsung, Renesas, Mstar, wpcm450, OMAP, AT91, Allwinner, i.MX, Tegra, Aspeed, Oxnas, Qualcomm, Mediatek, and Broadcom. Samsung has a rework for its pinctrl schema that is a bit tricky and requires driver changes to be included here. A few more platforms only have smaller cleanups and DT Schema fixes, this includes SoCFPGA, ux500, ixp4xx, STi, Xilinx Zynq, LG, and Juno. The new machines are really too many to list, but I'll do it anyway: Allwinner: - A20-Marsboard development board Amlogic: - Amediatek X96-AIR (Amlogic S905X3) - CYX A95XF3-AIR (Amlogic S905X3) - Haochuangy H96-Max (Amlogic S905X3) - Amlogic AQ222 (Amlogic S4) - OSMC Vero 4K+ (Amlogic S905D) Arm Juno: - Separate DT depending on SCMI firmware version Aspeed: - Quanta S6Q BMC (AST2600) - ASRock ROMED8HM3 (AST2500) Broadcom: - Raspberry Pi Zero 2 W Marvell MVEBU/Armada: - Ctera C200 V1 NAS (kirkwood) - Ctera C200 V2 NAS (armada-370) Mstar: - DongShanPiOne, a low-end embedded board - Miyoo Mini handheld game console NXP i.MX: - Numerous i.MX8M Mini based boards in even more variations, but none based on other SoCs this time: Protonic PRT8MM, emCON-MX8M Mini, Toradex Verdin, and Gateworks GW7903 Qualcomm: - Google Herobrine R1 Chromebook platform (Snapdragon 7c Gen 3) - SHIFT6mq phone (Snapdragon 845) - Samsung Galaxy Book2 (Snapdragon 850) - Snapdragon 8 Gen 1 Hardware Development Kit TI OMAP: - SanCloud BeagleBone Enhanced WiFi Rockchip: - Pine64 PineNote ereader tablet (rk356x) - Bananapi-R2-Pro (rk356x) STM32: - emtrion emSBS-Argon embedded board (stm32mp157c)" * tag 'arm-dt-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (627 commits) arm64: dts: n5x: drop invalid property and fix edac node name arm64: dts: fsd: Add the MCT support arm64: dts: stingray: Fix spi clock name arm64: dts: ns2: Fix spi clock name ARM: dts: rockchip: Update regulator name for PX3 ARM: dts: rockchip: Add #clock-cells value for rk805 arm64: dts: rockchip: Add #clock-cells value for rk805 arm64: dts: rockchip: Remove vcc13 and vcc14 for rk808 arm64: dts: rockchip: Fix SDIO regulator supply properties on rk3399-firefly ARM: dts: at91: sama7g5: Add NAND support ARM: dts: at91: sama7g5: add eic node ARM: dts: at91: sama7g5: Remove unused properties in i2c nodes ARM: dts: at91: sam9x60ek: modify vdd_1v5 regulator to vdd_1v15 arm64: dts: lg: align pl330 node name with dtschema arm64: dts: lg: add dma-cells to pl330 node arm64: dts: juno: align pl330 node name with dtschema arm64: dts: broadcom: Fix sata nodename arm64: dts: n5x: add sdr edac support arm64: dts: agilex/stratix10: add clock-names to USB DWC2 node dt-bindings: usb: dwc2: add disable-over-current ... commit b4bc93bd76d4da32600795cd323c971f00a2e788 Merge: baaa68a9796e 339ac71b233e Author: Linus Torvalds Date: Wed Mar 23 18:23:13 2022 -0700 Merge tag 'arm-drivers-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM driver updates from Arnd Bergmann: "There are a few separately maintained driver subsystems that we merge through the SoC tree, notable changes are: - Memory controller updates, mainly for Tegra and Mediatek SoCs, and clarifications for the memory controller DT bindings - SCMI firmware interface updates, in particular a new transport based on OPTEE and support for atomic operations. - Cleanups to the TEE subsystem, refactoring its memory management For SoC specific drivers without a separate subsystem, changes include - Smaller updates and fixes for TI, AT91/SAMA5, Qualcomm and NXP Layerscape SoCs. - Driver support for Microchip SAMA5D29, Tesla FSD, Renesas RZ/G2L, and Qualcomm SM8450. - Better power management on Mediatek MT81xx, NXP i.MX8MQ and older NVIDIA Tegra chips" * tag 'arm-drivers-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (154 commits) ARM: spear: fix typos in comments soc/microchip: fix invalid free in mpfs_sys_controller_delete soc: s4: Add support for power domains controller dt-bindings: power: add Amlogic s4 power domains bindings ARM: at91: add support in soc driver for new SAMA5D29 soc: mediatek: mmsys: add sw0_rst_offset in mmsys driver data dt-bindings: memory: renesas,rpc-if: Document RZ/V2L SoC memory: emif: check the pointer temp in get_device_details() memory: emif: Add check for setup_interrupts dt-bindings: arm: mediatek: mmsys: add support for MT8186 dt-bindings: mediatek: add compatible for MT8186 pwrap soc: mediatek: pwrap: add pwrap driver for MT8186 SoC soc: mediatek: mmsys: add mmsys reset control for MT8186 soc: mediatek: mtk-infracfg: Disable ACP on MT8192 soc: ti: k3-socinfo: Add AM62x JTAG ID soc: mediatek: add MTK mutex support for MT8186 soc: mediatek: mmsys: add mt8186 mmsys routing table soc: mediatek: pm-domains: Add support for mt8186 dt-bindings: power: Add MT8186 power domains soc: mediatek: pm-domains: Add support for mt8195 ... commit baaa68a9796ef2cadfe5caaf4c730412eda0f31c Merge: 8ffa5709e577 2f618d5ef5dd Author: Linus Torvalds Date: Wed Mar 23 18:20:09 2022 -0700 Merge tag 'arm-soc-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC updates from Arnd Bergmann: "SoC specific code is generally used for older platforms that don't (yet) use device tree to do the same things. - Support is added for i.MXRT10xx, a Cortex-M7 based microcontroller from NXP. At the moment this is still incomplete as other portions are merged through different trees. - Long abandoned support for running NOMMU ARMv4 or ARMv5 platforms gets removed, now the Arm NOMMU platforms are limited to the Cortex-M family of microcontrollers - Two old PXA boards get removed, along with corresponding driver bits. - Continued cleanup of the Intel IXP4xx platforms, removing some remnants of the old board files. - Minor Cleanups and fixes for Orion, PXA, MMP, Mstar, Samsung - CPU idle support for AT91 - A system controller driver for Polarfire" * tag 'arm-soc-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (29 commits) ARM: remove support for NOMMU ARMv4/v5 ARM: PXA: fix up decompressor code soc: microchip: make mpfs_sys_controller_put static ARM: pxa: remove Intel Imote2 and Stargate 2 boards ARM: mmp: Fix failure to remove sram device ARM: mstar: Select ARM_ERRATA_814220 soc: add microchip polarfire soc system controller ARM: at91: Kconfig: select PM_OPP ARM: at91: PM: add cpu idle support for sama7g5 ARM: at91: ddr: fix typo to align with datasheet naming ARM: at91: ddr: align macro definitions ARM: at91: ddr: remove CONFIG_SOC_SAMA7 dependency ARM: ixp4xx: Convert to SPARSE_IRQ and P2V ARM: ixp4xx: Drop all common code ARM: ixp4xx: Drop custom DMA coherency and bouncing ARM: ixp4xx: Remove feature bit accessors net: ixp4xx_hss: Check features using syscon net: ixp4xx_eth: Drop platform data support soc: ixp4xx-npe: Access syscon regs using regmap soc: ixp4xx: Add features from regmap helper ... commit 8ffa5709e577385a1c8d20fb434cb02732f1d991 Merge: 194dfe88d62e cf38326010ae Author: Linus Torvalds Date: Wed Mar 23 18:11:04 2022 -0700 Merge tag 'arm-defconfig-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM defconfig updates from Arnd Bergmann: "Various updates for the 32-bit and 64-bit defconfig files, mostly to enable additional hardware drivers for more machines, specifically for the Allwinner F1C100, Altera SoCFPGA, Broadcom, Microchip, Qualcomm, Airoha, Tegra, Renesas, and i.NX. The multi_v5_defconfig for older ARMv5 configs gets a rework for Andre Przywara to cleans up the multi_v5_defconfig for some cruft that has accumulated and drivers that got disabled unintentionally, while Anders Roxell makes it more useful for running under Qemu" * tag 'arm-defconfig-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (41 commits) ARM: configs: multi_v5: Enable Allwinner F1C100 ARM: configs: clean up multi_v5_defconfig ARM: configs: multi_v5_defconfig: re-enable DRM_PANEL and FB_xxx ARM: configs: multi_v5_defconfig: re-enable CONFIG_V4L_PLATFORM_DRIVERS ARM: configs: multi_v5_defconfig: remove deleted platforms ARM: defconfig: add SMB347 charger driver for p4note arm: multi_v5: enable configs for versatile arm64: defconfig: enable Layerscape SFP driver ARM: configs: at91: sama7: Unselect CONFIG_DMATEST ARM: configs: at91: add eic arm64: defconfig: enable the CVP driver ARM: multi_v7_defconfig: Add support for Airoha EN7523 SoC ARM: multi_v7_defconfig: Enable BCM23550 and BCM53573 ARM: multi_v7_defconfig: Enable Broadcom STB USB drivers ARM: configs: at91: sama7: add config for cpufreq ARM: configs: at91: sama7: enable cpu idle ARM: configs: at91: sama7: Enable crypto IPs and software algs ARM: configs: at91: sama7: Enable UBIFS_FS ARM: configs: at91: sama7: Enable NAND / SMC arm64: defconfig: tegra: Enable GPCDMA ... commit 194dfe88d62ed12d0cf30f6f20734c2d0d111533 Merge: 9c0e6a89b592 aec499c75cf8 Author: Linus Torvalds Date: Wed Mar 23 18:03:08 2022 -0700 Merge tag 'asm-generic-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic updates from Arnd Bergmann: "There are three sets of updates for 5.18 in the asm-generic tree: - The set_fs()/get_fs() infrastructure gets removed for good. This was already gone from all major architectures, but now we can finally remove it everywhere, which loses some particularly tricky and error-prone code. There is a small merge conflict against a parisc cleanup, the solution is to use their new version. - The nds32 architecture ends its tenure in the Linux kernel. The hardware is still used and the code is in reasonable shape, but the mainline port is not actively maintained any more, as all remaining users are thought to run vendor kernels that would never be updated to a future release. - A series from Masahiro Yamada cleans up some of the uapi header files to pass the compile-time checks" * tag 'asm-generic-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: (27 commits) nds32: Remove the architecture uaccess: remove CONFIG_SET_FS ia64: remove CONFIG_SET_FS support sh: remove CONFIG_SET_FS support sparc64: remove CONFIG_SET_FS support lib/test_lockup: fix kernel pointer check for separate address spaces uaccess: generalize access_ok() uaccess: fix type mismatch warnings from access_ok() arm64: simplify access_ok() m68k: fix access_ok for coldfire MIPS: use simpler access_ok() MIPS: Handle address errors for accesses above CPU max virtual user address uaccess: add generic __{get,put}_kernel_nofault nios2: drop access_ok() check from __put_user() x86: use more conventional access_ok() definition x86: remove __range_not_ok() sparc64: add __{get,put}_kernel_nofault() nds32: fix access_ok() checks in get/put_user uaccess: fix nios2 and microblaze get_user_8() sparc64: fix building assembly files ... commit ada8d8d337ee970860c9844126e634df8076aa11 Author: Tom Rix Date: Mon Mar 21 15:04:08 2022 -0700 nvdimm/blk: Fix title level make htmldocs fails with Sphinx parallel build error: docutils.utils.SystemMessage: ...nvdimm.rst:146: (SEVERE/4) Title level inconsistent: PMEM-REGIONs, Atomic Sectors, and DAX ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The PMEM vs BLK section was removed without changing the PMEM-REGIONS... title line. Replace '^' with '_'. Fixes: f8669f1d6a86 ("nvdimm/blk: Delete the block-aperture window driver") Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220321220408.2381974-1-trix@redhat.com Signed-off-by: Dan Williams Documentation/driver-api/nvdimm/nvdimm.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9c0e6a89b592f4c4e4d769dbc22d399ab0685159 Merge: e6aef3496a00 234a0f202a09 Author: Linus Torvalds Date: Wed Mar 23 17:35:57 2022 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: "Updates for IRQ stacks and virtually mapped stack support, and ftrace: - Support for IRQ and vmap'ed stacks This covers all the work related to implementing IRQ stacks and vmap'ed stacks for all 32-bit ARM systems that are currently supported by the Linux kernel, including RiscPC and Footbridge. It has been submitted for review in four different waves: - IRQ stacks support for v7 SMP systems [0] - vmap'ed stacks support for v7 SMP systems[1] - extending support for both IRQ stacks and vmap'ed stacks for all remaining configurations, including v6/v7 SMP multiplatform kernels and uniprocessor configurations including v7-M [2] - fixes and updates in [3] - ftrace fixes and cleanups Make all flavors of ftrace available on all builds, regardless of ISA choice, unwinder choice or compiler [4]: - use ADD not POP where possible - fix a couple of Thumb2 related issues - enable HAVE_FUNCTION_GRAPH_FP_TEST for robustness - enable the graph tracer with the EABI unwinder - avoid clobbering frame pointer registers to make Clang happy - Fixes for the above" [0] https://lore.kernel.org/linux-arm-kernel/20211115084732.3704393-1-ardb@kernel.org/ [1] https://lore.kernel.org/linux-arm-kernel/20211122092816.2865873-1-ardb@kernel.org/ [2] https://lore.kernel.org/linux-arm-kernel/20211206164659.1495084-1-ardb@kernel.org/ [3] https://lore.kernel.org/linux-arm-kernel/20220124174744.1054712-1-ardb@kernel.org/ [4] https://lore.kernel.org/linux-arm-kernel/20220203082204.1176734-1-ardb@kernel.org/ * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: (62 commits) ARM: fix building NOMMU ARMv4/v5 kernels ARM: unwind: only permit stack switch when unwinding call_with_stack() ARM: Revert "unwind: dump exception stack from calling frame" ARM: entry: fix unwinder problems caused by IRQ stacks ARM: unwind: set frame.pc correctly for current-thread unwinding ARM: 9184/1: return_address: disable again for CONFIG_ARM_UNWIND=y ARM: 9183/1: unwind: avoid spurious warnings on bogus code addresses Revert "ARM: 9144/1: forbid ftrace with clang and thumb2_kernel" ARM: mach-bcm: disable ftrace in SMC invocation routines ARM: cacheflush: avoid clobbering the frame pointer ARM: kprobes: treat R7 as the frame pointer register in Thumb2 builds ARM: ftrace: enable the graph tracer with the EABI unwinder ARM: unwind: track location of LR value in stack frame ARM: ftrace: enable HAVE_FUNCTION_GRAPH_FP_TEST ARM: ftrace: avoid unnecessary literal loads ARM: ftrace: avoid redundant loads or clobbering IP ARM: ftrace: use trampolines to keep .init.text in branching range ARM: ftrace: use ADD not POP to counter PUSH at entry ARM: ftrace: ensure that ADR takes the Thumb bit into account ARM: make get_current() and __my_cpu_offset() __always_inline ... commit e6aef3496a00a12e78a571f61d98300cf0a86e6a Merge: 40037e4f8b2f e6e1e7b19fa1 Author: Linus Torvalds Date: Wed Mar 23 16:50:38 2022 -0700 Merge tag 'm68knommu-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu Pull m68knommu updates from Greg Ungerer: "A few fixes, nothing too exciting. Fix warnings when building for dragen2 targets (sparse and "screen_bits") and ucsimm targets. Fix compilation problems when test compiling for ColdFire targets with the mcf_edma driver enabled. Remove an incorrect clock definition for the ColdFire m5441x. Summary: - fix 'screen_bits' defined but not used - fix ucsimm sparse warnings - fix dragen2 warnings - fix test builds with the mcf_edma driver enabled" * tag 'm68knommu-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: coldfire/device.c: only build for MCF_EDMA when h/w macros are defined m68k: m5441x: remove erroneous clock disable m68knommu: fix ucsimm sparse warnings m68knommu: fix 'screen_bits' defined but not used m68knommu: fix warning: no previous prototype for 'init_dragen2' commit 6b49f3409a090c8e9d1f46ff2705c479b45a54d4 Author: Nathan Chancellor Date: Tue Mar 15 13:25:43 2022 -0700 dt-bindings: kbuild: Make DT_SCHEMA_LINT a recursive variable A recent change added a warning when yamllint is not installed, as it is needed for 'make dt_binding_check'. However, it also changed DT_SCHEMA_LINT to be a simple make variable, which is evaluated when a Makefile is evaluated. This causes a warning when running 'make clean', as Documentation/devicetree/bindings/Makefile has a "clean-files" variable: $ make -s clean which: no yamllint in (...) warning: python package 'yamllint' not installed, skipping Make DT_SCHEMA_LINT a recursive variable so it is evaluated only when it is used. The warning still triggers when 'make dt_binding_check' is run. Fixes: b3e664a7f449 ("dt-bindings: kbuild: Print a warning if yamllint is not found") Signed-off-by: Nathan Chancellor Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220315202542.2071351-1-nathan@kernel.org Documentation/devicetree/bindings/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5db1c2dbc04c161d9e6b3f93457452e2ee904bde Author: Rafał Miłecki Date: Mon Feb 28 14:12:50 2022 +0100 dt-bindings: nvmem: add U-Boot environment variables binding U-Boot uses environment variables for storing device setup data. It usually needs to be accessed by a bootloader, kernel and often user-space. This binding allows describing environment data located in a raw flash partition. It's treated as NVMEM device and can be reused later for other storage devices. Using DT should be cleaner than hardcoding & duplicating such info in multiple places. Bootloader & kernel can share DTS and user-space can try reading it too or just have correct data exposed by a kernel. A custom "compatible" string allows system to automatically load relevant NVMEM driver but phandle can be also used for reading raw location. Signed-off-by: Rafał Miłecki Reviewed-by: Tom Rini Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220228131250.16943-1-zajec5@gmail.com .../devicetree/bindings/nvmem/u-boot,env.yaml | 62 ++++++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 67 insertions(+) commit 8a3e8ee56417f5e0e66580d93941ed9d6f4c8274 Author: Jens Axboe Date: Wed Mar 23 09:30:05 2022 -0600 io_uring: add flag for disabling provided buffer recycling If we need to continue doing this IO, then we don't want a potentially selected buffer recycled. Add a flag for that. Set this for recv/recvmsg if they do partial IO. Signed-off-by: Jens Axboe fs/io_uring.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 7ba89d2af17aa879dda30f5d5d3f152e587fc551 Author: Jens Axboe Date: Wed Mar 23 09:32:35 2022 -0600 io_uring: ensure recv and recvmsg handle MSG_WAITALL correctly We currently don't attempt to get the full asked for length even if MSG_WAITALL is set, if we get a partial receive. If we do see a partial receive, then just note how many bytes we did and return -EAGAIN to get it retried. The iov is advanced appropriately for the vector based case, and we manually bump the buffer and remainder for the non-vector case. Cc: stable@vger.kernel.org Reported-by: Constantine Gavrilov Signed-off-by: Jens Axboe fs/io_uring.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) commit b642b52d0b50f4d398cb4293f64992d0eed2e2ce Author: Ethan Lien Date: Mon Mar 7 18:00:04 2022 +0800 btrfs: fix qgroup reserve overflow the qgroup limit We use extent_changeset->bytes_changed in qgroup_reserve_data() to record how many bytes we set for EXTENT_QGROUP_RESERVED state. Currently the bytes_changed is set as "unsigned int", and it will overflow if we try to fallocate a range larger than 4GiB. The result is we reserve less bytes and eventually break the qgroup limit. Unlike regular buffered/direct write, which we use one changeset for each ordered extent, which can never be larger than 256M. For fallocate, we use one changeset for the whole range, thus it no longer respects the 256M per extent limit, and caused the problem. The following example test script reproduces the problem: $ cat qgroup-overflow.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj mkfs.btrfs -f $DEV mount $DEV $MNT # Set qgroup limit to 2GiB. btrfs quota enable $MNT btrfs qgroup limit 2G $MNT # Try to fallocate a 3GiB file. This should fail. echo echo "Try to fallocate a 3GiB file..." fallocate -l 3G $MNT/3G.file # Try to fallocate a 5GiB file. echo echo "Try to fallocate a 5GiB file..." fallocate -l 5G $MNT/5G.file # See we break the qgroup limit. echo sync btrfs qgroup show -r $MNT umount $MNT When running the test: $ ./qgroup-overflow.sh (...) Try to fallocate a 3GiB file... fallocate: fallocate failed: Disk quota exceeded Try to fallocate a 5GiB file... qgroupid         rfer         excl     max_rfer --------         ----         ----     -------- 0/5           5.00GiB      5.00GiB      2.00GiB Since we have no control of how bytes_changed is used, it's better to set it to u64. CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Qu Wenruo Signed-off-by: Ethan Lien Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/extent_io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 62ed0bf7315b524973bb5fb9174b60e353289835 Author: Johannes Thumshirn Date: Mon Mar 7 02:47:18 2022 -0800 btrfs: zoned: remove left over ASSERT checking for single profile With commit dcf5652291f6 ("btrfs: zoned: allow DUP on meta-data block groups") we started allowing DUP on metadata block groups, so the ASSERT()s in btrfs_can_activate_zone() and btrfs_zoned_get_device() are no longer valid and in fact even harmful. Fixes: dcf5652291f6 ("btrfs: zoned: allow DUP on meta-data block groups") CC: stable@vger.kernel.org # 5.17 Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/zoned.c | 4 ---- 1 file changed, 4 deletions(-) commit 0b9e66762aa0cda2a9c2d5542d64e04dac528fa6 Author: Johannes Thumshirn Date: Mon Mar 7 02:47:17 2022 -0800 btrfs: zoned: traverse devices under chunk_mutex in btrfs_can_activate_zone btrfs_can_activate_zone() can be called with the device_list_mutex already held, which will lead to a deadlock: insert_dev_extents() // Takes device_list_mutex `-> insert_dev_extent() `-> btrfs_insert_empty_item() `-> btrfs_insert_empty_items() `-> btrfs_search_slot() `-> btrfs_cow_block() `-> __btrfs_cow_block() `-> btrfs_alloc_tree_block() `-> btrfs_reserve_extent() `-> find_free_extent() `-> find_free_extent_update_loop() `-> can_allocate_chunk() `-> btrfs_can_activate_zone() // Takes device_list_mutex again Instead of using the RCU on fs_devices->device_list we can use fs_devices->alloc_list, protected by the chunk_mutex to traverse the list of active devices. We are in the chunk allocation thread. The newer chunk allocation happens from the devices in the fs_device->alloc_list protected by the chunk_mutex. btrfs_create_chunk() lockdep_assert_held(&info->chunk_mutex); gather_device_info list_for_each_entry(device, &fs_devices->alloc_list, dev_alloc_list) Also, a device that reappears after the mount won't join the alloc_list yet and, it will be in the dev_list, which we don't want to consider in the context of the chunk alloc. [15.166572] WARNING: possible recursive locking detected [15.167117] 5.17.0-rc6-dennis #79 Not tainted [15.167487] -------------------------------------------- [15.167733] kworker/u8:3/146 is trying to acquire lock: [15.167733] ffff888102962ee0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: find_free_extent+0x15a/0x14f0 [btrfs] [15.167733] [15.167733] but task is already holding lock: [15.167733] ffff888102962ee0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: btrfs_create_pending_block_groups+0x20a/0x560 [btrfs] [15.167733] [15.167733] other info that might help us debug this: [15.167733] Possible unsafe locking scenario: [15.167733] [15.171834] CPU0 [15.171834] ---- [15.171834] lock(&fs_devs->device_list_mutex); [15.171834] lock(&fs_devs->device_list_mutex); [15.171834] [15.171834] *** DEADLOCK *** [15.171834] [15.171834] May be due to missing lock nesting notation [15.171834] [15.171834] 5 locks held by kworker/u8:3/146: [15.171834] #0: ffff888100050938 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1c3/0x5a0 [15.171834] #1: ffffc9000067be80 ((work_completion)(&fs_info->async_data_reclaim_work)){+.+.}-{0:0}, at: process_one_work+0x1c3/0x5a0 [15.176244] #2: ffff88810521e620 (sb_internal){.+.+}-{0:0}, at: flush_space+0x335/0x600 [btrfs] [15.176244] #3: ffff888102962ee0 (&fs_devs->device_list_mutex){+.+.}-{3:3}, at: btrfs_create_pending_block_groups+0x20a/0x560 [btrfs] [15.176244] #4: ffff8881152e4b78 (btrfs-dev-00){++++}-{3:3}, at: __btrfs_tree_lock+0x27/0x130 [btrfs] [15.179641] [15.179641] stack backtrace: [15.179641] CPU: 1 PID: 146 Comm: kworker/u8:3 Not tainted 5.17.0-rc6-dennis #79 [15.179641] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1.fc35 04/01/2014 [15.179641] Workqueue: events_unbound btrfs_async_reclaim_data_space [btrfs] [15.179641] Call Trace: [15.179641] [15.179641] dump_stack_lvl+0x45/0x59 [15.179641] __lock_acquire.cold+0x217/0x2b2 [15.179641] lock_acquire+0xbf/0x2b0 [15.183838] ? find_free_extent+0x15a/0x14f0 [btrfs] [15.183838] __mutex_lock+0x8e/0x970 [15.183838] ? find_free_extent+0x15a/0x14f0 [btrfs] [15.183838] ? find_free_extent+0x15a/0x14f0 [btrfs] [15.183838] ? lock_is_held_type+0xd7/0x130 [15.183838] ? find_free_extent+0x15a/0x14f0 [btrfs] [15.183838] find_free_extent+0x15a/0x14f0 [btrfs] [15.183838] ? _raw_spin_unlock+0x24/0x40 [15.183838] ? btrfs_get_alloc_profile+0x106/0x230 [btrfs] [15.187601] btrfs_reserve_extent+0x131/0x260 [btrfs] [15.187601] btrfs_alloc_tree_block+0xb5/0x3b0 [btrfs] [15.187601] __btrfs_cow_block+0x138/0x600 [btrfs] [15.187601] btrfs_cow_block+0x10f/0x230 [btrfs] [15.187601] btrfs_search_slot+0x55f/0xbc0 [btrfs] [15.187601] ? lock_is_held_type+0xd7/0x130 [15.187601] btrfs_insert_empty_items+0x2d/0x60 [btrfs] [15.187601] btrfs_create_pending_block_groups+0x2b3/0x560 [btrfs] [15.187601] __btrfs_end_transaction+0x36/0x2a0 [btrfs] [15.192037] flush_space+0x374/0x600 [btrfs] [15.192037] ? find_held_lock+0x2b/0x80 [15.192037] ? btrfs_async_reclaim_data_space+0x49/0x180 [btrfs] [15.192037] ? lock_release+0x131/0x2b0 [15.192037] btrfs_async_reclaim_data_space+0x70/0x180 [btrfs] [15.192037] process_one_work+0x24c/0x5a0 [15.192037] worker_thread+0x4a/0x3d0 Fixes: a85f05e59bc1 ("btrfs: zoned: avoid chunk allocation if active block group has enough space") CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Anand Jain Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/zoned.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 40037e4f8b2f7d33b8d266f139bf345962c48d46 Merge: 182966e1cd74 ef248d9bd616 Author: Linus Torvalds Date: Wed Mar 23 15:11:12 2022 -0700 Merge tag 'sound-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "It's been a fairly calm development cycle. There are a few last-minute ALSA core fixes, most notably for covering PCM ioctl races, but the most of rest are device-specific changes. Below are some highlights: ALSA core: - Fixes for PCM ioctl races that may lead to UAF - Fix for oversized allocations in PCM OSS layer ASoC: - Start of moving SoF to support multiple IPC mechanisms - Use of NHLT ACPI table to reduce the amount of quirking required for Intel systems - Preliminary works forthcoming Intel AVS driver for legacy Intel DSP firmwares - Support for AMD PDM, Atmel PDMC, Awinic AW8738, i.MX cards with TLV320AIC31xx, Intel machines with CS35L41 and ESSX8336, Mediatek MT8181 wideband bluetooth, nVidia Tegra234, Qualcomm SC7280, Renesas RZ/V2L, Texas Instruments TAS585M HD-audio: - Driver re-binding fix for HD-audio - Updates for Intel ADL and Tegra234, various platform quirks for Dell, HP, Lenovo, ASUS, Samsung and Clevo machines USB-audio: - Quirk updates for Scarlett2, RODE, Corsair devices" * tag 'sound-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (486 commits) ALSA: hda/realtek: Add alc256-samsung-headphone fixup ALSA: pci: fix reading of swapped values from pcmreg in AC97 codec ALSA: pcm: Add stream lock during PCM reset ioctl operations ALSA: pcm: Fix races among concurrent prealloc proc writes ALSA: pcm: Fix races among concurrent prepare and hw_params/hw_free calls ALSA: pcm: Fix races among concurrent read/write and buffer changes ALSA: pcm: Fix races among concurrent hw_params and hw_free calls ASoC: atmel: mchp-pdmc: print the correct property name MAINTAINERS: Add Shengjiu to maintainer list of sound/soc/fsl ASoC: SOF: Add a new dai_get_clk topology IPC op ASoC: SOF: topology: Add ops for setting up and tearing down pipelines ASoC: SOF: expose sof_route_setup() ASoC: SOF: Add dai_link_fixup PCM op for IPC3 ASoC: SOF: Add trigger PCM op for IPC3 ASoC: SOF: Define hw_params PCM op for IPC3 ASoC: SOF: Introduce IPC3 PCM hw_free op ASoC: SOF: pcm: expose the sof_pcm_setup_connected_widgets() function ASoC: SOF: Introduce IPC-specific PCM ops ASoC: SOF: Add bytes_ext control IPC ops for IPC3 ASoC: SOF: Add bytes_get/put control IPC ops for IPC3 ... commit 182966e1cd74ec0e326cd376de241803ee79741b Merge: 9c4b86ebf5bf ba2c670ae84b Author: Linus Torvalds Date: Wed Mar 23 14:51:35 2022 -0700 Merge tag 'media/v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - a major reorg at platform Kconfig/Makefile files, organizing them per vendor. The other media Kconfig/Makefile files also sorted - New sensor drivers: hi847, isl7998x, ov08d10 - New Amphion vpu decoder stateful driver - New Atmel microchip csi2dc driver - tegra-vde driver promoted from staging - atomisp: some fixes for it to work on BYT - imx7-mipi-csis driver promoted from staging and renamed - camss driver got initial support for VFE hardware version Titan 480 - mtk-vcodec has gained support for MT8192 - lots of driver changes, fixes and improvements * tag 'media/v5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (417 commits) media: nxp: Restrict VIDEO_IMX_MIPI_CSIS to ARCH_MXC or COMPILE_TEST media: amphion: cleanup media device if register it fail media: amphion: fix some issues to improve robust media: amphion: fix some error related with undefined reference to __divdi3 media: amphion: fix an issue that using pm_runtime_get_sync incorrectly media: vidtv: use vfree() for memory allocated with vzalloc() media: m5mols/m5mols.h: document new reset field media: pixfmt-yuv-planar.rst: fix PIX_FMT labels media: platform: Remove unnecessary print function dev_err() media: amphion: Add missing of_node_put() in vpu_core_parse_dt() media: mtk-vcodec: Add missing of_node_put() in mtk_vdec_hw_prob_done() media: platform: amphion: Fix build error without MAILBOX media: spi: Kconfig: Place SPI drivers on a single menu media: i2c: Kconfig: move camera drivers to the top media: atomisp: fix bad usage at error handling logic media: platform: rename mediatek/mtk-jpeg/ to mediatek/jpeg/ media: media/*/Kconfig: sort entries media: Kconfig: cleanup VIDEO_DEV dependencies media: platform/*/Kconfig: make manufacturer menus more uniform media: platform: Create vendor/{Makefile,Kconfig} files ... commit 9c4b86ebf5bfdaceba4bedbaf76e4ff745db17ef Merge: 5bebe2c9ae0e e445c8b2aa2d Author: Linus Torvalds Date: Wed Mar 23 14:45:01 2022 -0700 Merge tag 'for-5.18/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev updates from Helge Deller: "Lots of small fixes and code cleanups across most of the fbdev drivers. This includes conversions to use helper functions, const conversions, spelling fixes, help text updates, adding return value checks, small build fixes, and much more" * tag 'for-5.18/fbdev-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: (59 commits) video: fbdev: kyro: make read-only array ODValues static const video: fbdev: offb: fix warning comparing pointer to 0 video: fbdev: omapfb: Add missing of_node_put() in dvic_probe_of video: fbdev: sm712fb: Fix crash in smtcfb_write() video: fbdev: s3c-fb: fix platform_get_irq.cocci warning video: fbdev: sm712fb: Fix crash in smtcfb_read() video: fbdev: via: check the return value of kstrdup() video: fbdev: au1100fb: Spelling s/palette/palette/ video: fbdev: atari: Atari 2 bpp (STe) palette bugfix video: fbdev: atari: Remove unused atafb_setcolreg() video: fbdev: atari: Convert to standard round_up() helper video: fbdev: atari: Fix TT High video mode video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit video: fbdev: omapfb: panel-tpo-td043mtea1: Use sysfs_emit() instead of snprintf() video: fbdev: omapfb: panel-dsi-cm: Use sysfs_emit() instead of snprintf() video: fbdev: omapfb: Use sysfs_emit() instead of snprintf() video: fbdev: s3c-fb: Use platform_get_irq() to get the interrupt video: fbdev: Fix wrong file path for pvr2fb.c in Kconfig help text video: fbdev: pxa3xx-gcu: Remove unnecessary print function dev_err() video: fbdev: pxa168fb: Remove unnecessary print function dev_err() ... commit 5bebe2c9ae0e0d3c6b25b8e1048bf66b1a3df621 Merge: c7d4b15372bd dc3d879c6ffa Author: Linus Torvalds Date: Wed Mar 23 14:39:51 2022 -0700 Merge tag 'mmc-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: "MMC core: - Convert to sysfs_emit() in favor of sprintf() - Improve fallback to speed modes if eMMC HS200 fails MMC host: - dw_mmc: Allow variants to set minimal supported clock rate - dw-mmc-rockchip: Fix problems with invalid clock rates - litex_mmc: Add new DT based driver for the LiteX's LiteSDCard interface - litex_mmc: Add Gabriel Somlo and Joel Stanley as co-maintainers for LiteX - mtk-sd: Add support for the Mediatek MT8186 variant - renesas_sdhi: Add support for RZ/G2UL variant - renesas_sdhi: Add support for RZ/V2L variant - rtsx_pci: Adjust power-on sequence to conform to the SD spec - sdhci-am654: Add support for TI's AM62 variant - sdhci_am654: Fixup support for TI's AM64 variant - sdhci-esdhc-imx: Add support for the imx93 variant - sdhci-msm: Add support for the msm8953 variant - sdhci-pci-gli: Add support for runtime PM for the GL9763E variant - sdhci-pci-gli: Adjustments of the SSC function for the GL975x variants - sdhci-tegra: Add support for wake on SD card event - sunxi-mmc: Add support for Allwinner's F1c100s variant - sunxi-mmc: Add support for D1 MMC variant" * tag 'mmc-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (37 commits) dt-bindings: mmc: renesas,sdhi: Document RZ/G2UL SoC mmc: tmio: remove outdated members from host struct mmc: mtk-sd: Silence delay phase calculation debug log mmc: davinci_mmc: Handle error for clk_enable mmc: sdhci-pci-gli: Add runtime PM for GL9763E mmc: core: Drop HS400 caps unless 8-bit bus is supported too mmc: host: Return an error when ->enable_sdio_irq() ops is missing mmc: core: Improve fallback to speed modes if eMMC HS200 fails dt-bindings: mmc: sunxi: add Allwinner F1c100s compatible mmc: dw-mmc-rockchip: Fix handling invalid clock rates mmc: dw_mmc: Support setting f_min from host drivers mmc: host: Drop commas after SoC match table sentinels mmc: rtsx: add 74 Clocks in power on flow dt-bindings: mmc: renesas,sdhi: Document RZ/V2L SoC mmc: sh_mmcif: Simplify division/shift logic mmc: sdhci_am654: Add Support for TI's AM62 SoC dt-bindings: mmc: imx-esdhc: Add imx93 compatible string dt-bindings: mmc: sdhci-am654: Add compatible string for AM62 SoC mmc: sdhci_am654: Fix the driver data of AM64 SoC mmc: core: use sysfs_emit() instead of sprintf() ... commit c7d4b15372bde442059c7d6415afeba073a09474 Merge: d51b1b33c51d d268afa1ff6f Author: Linus Torvalds Date: Wed Mar 23 14:35:59 2022 -0700 Merge tag 'ata-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata updates from Damien Le Moal: "For this cycle, no big change but many small fixes and code cleanup to libata, the ahci driver and various pata drivers. In more details: - Code simplification in pata_platform using platform_get_mem_or_io(), from Lad. - Fix read-only arrays declarations as const in pata_atiixp and pata_pdc202xx_old, from Colin. - Various cleanups and code simplification in libata-scsi, from me. - Remove dead code in libata-acpi, from Sergey. - Skip device scan deboune delay for Marvell 88SE9235 adapters (ahci) to speedup boot, from Paul. - Simplify functions declaration and use for functions always returning 0 in libata-core, from Sergey. - Non-fatal error fixes and in the pata_hpt366 and pata_hpt3x2n drivers, from Sergey. - Various code cleanup in the pata_artop, pata_hpt37x, pata_hpt366, pata_hpt3x2n, pata_samsung_cf and sata_rcar drivers, from Sergey. - Some libata-sff and libata-scsi code cleanup (e.g. change functions to return "bool"), from Sergey. - Renae ahci_board_mobile to board_ahci_low_power to be more descriptive of the feature as that is also used on PC and server AHCI adapters, from Mario. - Cleanup of OF match tables, from Geert. - Simplify the pata_pxa driver initialization using platform_get_irq(), from Minghao" * tag 'ata-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: (38 commits) ata: pata_pxa: Use platform_get_irq() to get the interrupt ata: Drop commas after OF match table sentinels ata: ahci: Rename CONFIG_SATA_LPM_MOBILE_POLICY configuration item ata: ahci: Rename `AHCI_HFLAG_IS_MOBILE` ata: ahci: Rename board_ahci_mobile ata: pata_hpt37x: merge transfer mode setting methods ata: libata-sff: use *switch* statement in ata_sff_dev_classify() ata: add/use ata_taskfile::{error|status} fields ata: Kconfig: fix sata gemini compile test condition ata: libata-scsi: use *switch* statements to check SCSI command codes ata: libata-sff: refactor ata_sff_altstatus() ata: libata-sff: refactor ata_sff_set_devctl() ata: libata-sff: make ata_resources_present() return 'bool' ata: pata_hpt3x2n: disable fast interrupts in prereset() method ata: pata_hpt37x: disable fast interrupts in prereset() method ata: pata_hpt366: disable fast interrupts in prereset() method ata: pata_mpc52xx: use GFP_KERNEL ata: sata_rcar: drop unused #define's ata: pata_hpt366: check channel enable bits ata: sata_rcar: make sata_rcar_ata_devchk() return 'bool' ... commit 20df737561484cb2d42e537663c03a7311d2b3c1 Author: Chang S. Bae Date: Sat Jan 29 09:36:47 2022 -0800 selftests/x86/amx: Update the ARCH_REQ_XCOMP_PERM test Update the arch_prctl test to check the permission bitmap whether the requested feature is added as expected or not. Every non-dynamic feature that is enabled is permitted already for use. TILECFG is not dynamic feature. Ensure the bit is always on from ARCH_GET_XCOMP_PERM. Signed-off-by: Chang S. Bae Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20220129173647.27981-3-chang.seok.bae@intel.com tools/testing/selftests/x86/amx.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) commit 063452fd94d153d4eb38ad58f210f3d37a09cca4 Author: Yang Zhong Date: Sat Jan 29 09:36:46 2022 -0800 x86/fpu/xstate: Fix the ARCH_REQ_XCOMP_PERM implementation ARCH_REQ_XCOMP_PERM is supposed to add the requested feature to the permission bitmap of thread_group_leader()->fpu. But the code overwrites the bitmap with the requested feature bit only rather than adding it. Fix the code to add the requested feature bit to the master bitmask. Fixes: db8268df0983 ("x86/arch_prctl: Add controls for dynamic XSTATE components") Signed-off-by: Yang Zhong Signed-off-by: Chang S. Bae Signed-off-by: Thomas Gleixner Cc: Paolo Bonzini Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220129173647.27981-2-chang.seok.bae@intel.com arch/x86/kernel/fpu/xstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a96c94481f5993eac2271f9fb4d009b7dc076c24 Author: Xiaomeng Tong Date: Sun Mar 20 21:50:15 2022 +0800 cifs: fix incorrect use of list iterator after the loop The bug is here: if (!tcon) { resched = true; list_del_init(&ses->rlist); cifs_put_smb_ses(ses); Because the list_for_each_entry() never exits early (without any break/goto/return inside the loop), the iterator 'ses' after the loop will always be an pointer to a invalid struct containing the HEAD (&pserver->smb_ses_list). As a result, the uses of 'ses' above will lead to a invalid memory access. The original intention should have been to walk each entry 'ses' in '&tmp_ses_list', delete '&ses->rlist' and put 'ses'. So fix it with a list_for_each_entry_safe(). Cc: stable@vger.kernel.org # 5.17 Fixes: 3663c9045f51a ("cifs: check reconnects for channels of active tcons too") Signed-off-by: Xiaomeng Tong Reviewed-by: Shyam Prasad N Signed-off-by: Steve French fs/cifs/smb2pdu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 2d004c6cae567e33ab2e197757181c72a322451f Author: Paulo Alcantara Date: Mon Mar 21 13:08:26 2022 -0300 ksmbd: store fids as opaque u64 integers There is no need to store the fids as le64 integers as they are opaque to the client and only used for equality. Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Tom Talpey Acked-by: Namjae Jeon Signed-off-by: Steve French fs/ksmbd/smb2pdu.c | 94 ++++++++++++++++++++++-------------------------------- fs/ksmbd/smb2pdu.h | 34 ++++++++++---------- 2 files changed, 56 insertions(+), 72 deletions(-) commit 351a59dace0e0e31795145acdec2660e3bc2a58d Author: Paulo Alcantara Date: Mon Mar 21 13:08:25 2022 -0300 cifs: fix bad fids sent over wire The client used to partially convert the fids to le64, while storing or sending them by using host endianness. This broke the client on big-endian machines. Instead of converting them to le64, store them as opaque integers and then avoid byteswapping when sending them over wire. Signed-off-by: Paulo Alcantara (SUSE) Reviewed-by: Namjae Jeon Reviewed-by: Tom Talpey Signed-off-by: Steve French fs/cifs/smb2misc.c | 4 +-- fs/cifs/smb2ops.c | 8 +++--- fs/cifs/smb2pdu.c | 63 +++++++++++++++++++++-------------------------- fs/smbfs_common/smb2pdu.h | 24 +++++++++--------- 4 files changed, 46 insertions(+), 53 deletions(-) commit 8708b107604789dbb25057981919c7709828db16 Author: Ronnie Sahlberg Date: Tue Mar 22 16:29:03 2022 +1000 cifs: change smb2_query_info_compound to use a cached fid, if available This will reduce the number of Open/Close we send on the wire and replace a Open/GetInfo/Close compound with just a simple GetInfo request IF we have a cached handle for the object. Signed-off-by: Ronnie Sahlberg Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French fs/cifs/smb2ops.c | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) commit 5e0c969e9ed23745251ce8114778b7fad66df434 Author: Ronnie Sahlberg Date: Tue Mar 22 16:29:02 2022 +1000 cifs: convert the path to utf16 in smb2_query_info_compound and not in the callers. Signed-off-by: Ronnie Sahlberg Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French fs/cifs/smb2ops.c | 23 ++++++++++++----------- fs/cifs/smb2proto.h | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) commit d51b1b33c51d147b757f042b4d336603b699f362 Merge: 23d1dea55520 5debe5bfa02c Author: Linus Torvalds Date: Wed Mar 23 12:56:39 2022 -0700 Merge tag 'linux-kselftest-kunit-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit updates from Shuah Khan: - changes to decrease macro layering string, integer, EQ/NE asserts - remove unused macros - several cleanups and fixes - new list tests for list_del_init_careful(), list_is_head() and list_entry_is_head() * tag 'linux-kselftest-kunit-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: list: test: Add a test for list_entry_is_head() list: test: Add a test for list_is_head() list: test: Add test for list_del_init_careful() kunit: cleanup assertion macro internal variables kunit: factor out str constants from binary assertion structs kunit: consolidate KUNIT_INIT_BINARY_ASSERT_STRUCT macros kunit: remove va_format from kunit_assert kunit: tool: drop mostly unused KunitResult.result field kunit: decrease macro layering for EQ/NE asserts kunit: decrease macro layering for integer asserts kunit: reduce layering in string assertion macros kunit: drop unused intermediate macros for ptr inequality checks kunit: make KUNIT_EXPECT_EQ() use KUNIT_EXPECT_EQ_MSG(), etc. kunit: drop unused assert_type from kunit_assert and clean up macros kunit: split out part of kunit_assert into a static const kunit: factor out kunit_base_assert_format() call into kunit_fail() kunit: drop unused kunit* field in kunit_assert kunit: move check if assertion passed into the macros kunit: add example test case showing off all the expect macros commit 23d1dea55520c5cf89849279cd25de4da8392687 Merge: 2fce7ea0e096 f6d344cd5fa6 Author: Linus Torvalds Date: Wed Mar 23 12:53:00 2022 -0700 Merge tag 'linux-kselftest-next-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest updates from Shuah Khan: "Several build and cleanup fixes: - removing obsolete config options - removing dependency on internal kernel macros - adding config options - several build fixes related to headers and install paths" * tag 'linux-kselftest-next-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (22 commits) selftests: Fix build when $(O) points to a relative path selftests: netfilter: fix a build error on openSUSE selftests: kvm: add generated file to the .gitignore selftests/exec: add generated files to .gitignore selftests: add kselftest_install to .gitignore selftests/rtc: continuously read RTC in a loop for 30s selftests/lkdtm: Add UBSAN config selftests/lkdtm: Remove dead config option selftests/exec: Rename file binfmt_script to binfmt_script.py selftests: Use -isystem instead of -I to include headers selftests: vm: remove dependecy from internal kernel macros selftests: vm: Add the uapi headers include variable selftests: mptcp: Add the uapi headers include variable selftests: net: Add the uapi headers include variable selftests: landlock: Add the uapi headers include variable selftests: kvm: Add the uapi headers include variable selftests: futex: Add the uapi headers include variable selftests: Correct the headers install path selftests: Add and export a kernel uapi headers path selftests: set the BUILD variable to absolute path ... commit 2fce7ea0e0964e598cf9da8985d2d811f8c6a4a7 Merge: 78383162605e f9da322e864e Author: Linus Torvalds Date: Wed Mar 23 12:43:35 2022 -0700 Merge branch 'for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: "All trivial cleanups without meaningful behavior changes" * 'for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: cleanup comments cgroup: Fix cgroup_can_fork() and cgroup_post_fork() kernel-doc comment cgroup: rstat: retrieve current bstat to delta directly cgroup: rstat: use same convention to assign cgroup_base_stat commit 78383162605e22a2aad88e417bb8fcaf808f147a Merge: c5c009e2503d bc35f7ef9628 Author: Linus Torvalds Date: Wed Mar 23 12:40:51 2022 -0700 Merge branch 'for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue updates from Tejun Heo: "Nothing major. Just follow-up cleanups from Lai after the earlier synchronization simplification" * 'for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Convert the type of pool->nr_running to int workqueue: Use wake_up_worker() in wq_worker_sleeping() instead of open code workqueue: Change the comments of the synchronization about the idle_list workqueue: Remove the mb() pair between wq_worker_sleeping() and insert_work() commit c5c009e2503d4c027591c65b49a98f420cb4fa56 Merge: 1bc191051dca 94fa31e99b57 Author: Linus Torvalds Date: Wed Mar 23 12:33:21 2022 -0700 Merge tag 'slab-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab updates from Vlastimil Babka: - A few non-trivial SLUB code cleanups, most notably a refactoring of deactivate_slab(). - A bunch of trivial changes, such as removal of unused parameters, making stuff static, and employing helper functions. * tag 'slab-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm: slub: Delete useless parameter of alloc_slab_page() mm: slab: Delete unused SLAB_DEACTIVATED flag mm/slub: remove forced_order parameter in calculate_sizes mm/slub: refactor deactivate_slab() mm/slub: limit number of node partial slabs only in cache creation mm/slub: use helper macro __ATTR_XX_MODE for SLAB_ATTR(_RO) mm/slab_common: use helper function is_power_of_2() mm/slob: make kmem_cache_boot static commit 11cddee9c19f57bba335cff9787f23fb2d6d6f26 Author: Lukas Bulwahn Date: Wed Mar 16 06:21:33 2022 +0100 MAINTAINERS: remove section LIBNVDIMM BLK: MMIO-APERTURE DRIVER Commit f8669f1d6a86 ("nvdimm/blk: Delete the block-aperture window driver") removes the file drivers/nvdimm/blk.c, but misses to adjust MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. The section LIBNVDIMM BLK: MMIO-APERTURE DRIVER refers to the driver in blk.c, and some more generic nvdimm code in region_devs.c. As the driver is deleted, delete the section LIBNVDIMM BLK: MMIO-APERTURE DRIVER in MAINTAINERS as well. The remaining file region_devs.c is still covered by the section LIBNVDIMM: NON-VOLATILE MEMORY DEVICE SUBSYSTEM, and all patches to region_devs.c will still reach the same developers as before. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220316052133.26212-1-lukas.bulwahn@gmail.com Signed-off-by: Dan Williams MAINTAINERS | 11 ----------- 1 file changed, 11 deletions(-) commit d0007eb15c2a8113e847143c783ea83d93963741 Author: Kajol Jain Date: Wed Mar 23 22:15:50 2022 +0530 powerpc/papr_scm: Fix build failure when The following build failure occurs when CONFIG_PERF_EVENTS is not set as generic pmu functions are not visible in that scenario. arch/powerpc/platforms/pseries/papr_scm.c:372:35: error: ‘struct perf_event’ has no member named ‘attr’ p->nvdimm_events_map[event->attr.config], ^~ In file included from ./include/linux/list.h:5, from ./include/linux/kobject.h:19, from ./include/linux/of.h:17, from arch/powerpc/platforms/pseries/papr_scm.c:5: arch/powerpc/platforms/pseries/papr_scm.c: In function ‘papr_scm_pmu_event_init’: arch/powerpc/platforms/pseries/papr_scm.c:389:49: error: ‘struct perf_event’ has no member named ‘pmu’ struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu); ^~ ./include/linux/container_of.h:18:26: note: in definition of macro ‘container_of’ void *__mptr = (void *)(ptr); \ ^~~ arch/powerpc/platforms/pseries/papr_scm.c:389:30: note: in expansion of macro ‘to_nvdimm_pmu’ struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu); ^~~~~~~~~~~~~ In file included from ./include/linux/bits.h:22, from ./include/linux/bitops.h:6, from ./include/linux/of.h:15, from arch/powerpc/platforms/pseries/papr_scm.c:5: Fix the build issue by adding check for CONFIG_PERF_EVENTS config option and also add stub function for papr_scm_pmu_register to handle the CONFIG_PERF_EVENTS=n case. Also move the position of macro "to_nvdimm_pmu" inorder to merge it in CONFIG_PERF_EVENTS=y block. based on libnvdimm-for-next tree) Fixes: 4c08d4bbc089 ("powerpc/papr_scm: Add perf interface support") (Commit id Signed-off-by: Kajol Jain Link: https://lore.kernel.org/r/20220323164550.109768-2-kjain@linux.ibm.com Signed-off-by: Dan Williams arch/powerpc/platforms/pseries/papr_scm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit de7a9e949f4f094741f708cd05572f932d009d02 Author: Kajol Jain Date: Wed Mar 23 22:15:49 2022 +0530 drivers/nvdimm: Fix build failure when CONFIG_PERF_EVENTS is not set The following build failure occurs when CONFIG_PERF_EVENTS is not set as generic pmu functions are not visible in that scenario. |-- s390-randconfig-r044-20220313 | |-- nd_perf.c:(.text):undefined-reference-to-perf_pmu_migrate_context | |-- nd_perf.c:(.text):undefined-reference-to-perf_pmu_register | `-- nd_perf.c:(.text):undefined-reference-to-perf_pmu_unregister Similar build failure in nds32 architecture: nd_perf.c:(.text+0x21e): undefined reference to `perf_pmu_migrate_context' nd_perf.c:(.text+0x434): undefined reference to `perf_pmu_register' nd_perf.c:(.text+0x57c): undefined reference to `perf_pmu_unregister' Fix this issue by adding check for CONFIG_PERF_EVENTS config option and disabling the nvdimm perf interface incase this config is not set. Also remove function declaration of perf_pmu_migrate_context, perf_pmu_register, perf_pmu_unregister functions from nd.h as these are common pmu functions which are part of perf_event.h and since we are disabling nvdimm perf interface incase CONFIG_PERF_EVENTS option is not set, we not need to declare them in nd.h Also move the platform_device header file addition part from nd.h to nd_perf.c and add stub functions for register_nvdimm_pmu and unregister_nvdimm_pmu functions to handle CONFIG_PERF_EVENTS=n case. Fixes: 0fab1ba6ad6b ("drivers/nvdimm: Add perf interface to expose nvdimm performance stats") (Commit id based on libnvdimm-for-next tree) Signed-off-by: Kajol Jain Link: https://lore.kernel.org/all/62317124.YBQFU33+s%2FwdvWGj%25lkp@intel.com/ Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220323164550.109768-1-kjain@linux.ibm.com Signed-off-by: Dan Williams drivers/nvdimm/Makefile | 2 +- drivers/nvdimm/nd_perf.c | 1 + include/linux/nd.h | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) commit 1a31d63632553a54af6c0c3c5b5930e931a94ee4 Author: Alexandre Belloni Date: Wed Mar 9 17:23:00 2022 +0100 rtc: remove uie_unsupported uie_unsupported is not used by any drivers anymore, remove it. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-29-alexandre.belloni@bootlin.com drivers/rtc/class.c | 3 --- include/linux/rtc.h | 2 -- 2 files changed, 5 deletions(-) commit ed90e3e20d35bf07b650f7028728e159c1741be1 Author: Alexandre Belloni Date: Wed Mar 9 17:22:59 2022 +0100 rtc: xgene: stop using uie_unsupported Remove bogus use of uie_unsupported. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-28-alexandre.belloni@bootlin.com drivers/rtc/rtc-xgene.c | 2 -- 1 file changed, 2 deletions(-) commit 7e1df2f1c58185aff7b2658e34a46924cf0ab503 Author: Alexandre Belloni Date: Wed Mar 9 17:22:58 2022 +0100 rtc: hym8563: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-27-alexandre.belloni@bootlin.com drivers/rtc/rtc-hym8563.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit e6b7d19d393850452dbc2a10879f36cb25a24613 Author: Alexandre Belloni Date: Wed Mar 9 17:22:57 2022 +0100 rtc: hym8563: let the core handle the alarm resolution Set RTC_FEATURE_ALARM_RES_MINUTE, so the core knows alarms have a resolution of a minute. Also, the core will properly round down the alarm instead of up. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-26-alexandre.belloni@bootlin.com drivers/rtc/rtc-hym8563.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) commit 07398602c84adf49a0b908313f85370792e8cc68 Author: Alexandre Belloni Date: Wed Mar 9 17:22:56 2022 +0100 rtc: hym8563: switch to devm_rtc_allocate_device Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows for further improvement of the driver. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-25-alexandre.belloni@bootlin.com drivers/rtc/rtc-hym8563.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 1350b94c94ccd8cc585709e21bad6380d50112e1 Author: Alexandre Belloni Date: Wed Mar 9 17:22:55 2022 +0100 rtc: efi: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Also the driver doesn't supports UIE because it doesn't handle interrupts so set RTC_FEATURE_ALARM_WAKEUP_ONLY,. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-24-alexandre.belloni@bootlin.com drivers/rtc/rtc-efi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 8aa74363969f172c845b270b47a3d22871d7e156 Author: Alexandre Belloni Date: Wed Mar 9 17:22:54 2022 +0100 rtc: efi: switch to devm_rtc_allocate_device Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows for further improvement of the driver. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-23-alexandre.belloni@bootlin.com drivers/rtc/rtc-efi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit e99653afeb9585350644c5ae4b0ca987cbe8d053 Author: Alexandre Belloni Date: Wed Mar 9 17:22:53 2022 +0100 rtc: add new RTC_FEATURE_ALARM_WAKEUP_ONLY feature Some RTCs have an IRQ pin that is not connected to a CPU interrupt but rather directly to a PMIC or power supply. In that case, it is still useful to be able to set alarms but we shouldn't expect interrupts. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-22-alexandre.belloni@bootlin.com include/uapi/linux/rtc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a87a07a111443adbf69cb815187e9532319e8530 Author: Alexandre Belloni Date: Wed Mar 9 17:22:52 2022 +0100 rtc: spear: fix spear_rtc_read_time The reference manual doesn't specify whether the registers are latched and they probably aren't, ensure the read time and date are consistent. Signed-off-by: Alexandre Belloni Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220309162301.61679-21-alexandre.belloni@bootlin.com drivers/rtc/rtc-spear.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 343597e29eecb391fec144e600b1af84999a5045 Author: Alexandre Belloni Date: Wed Mar 9 17:22:51 2022 +0100 rtc: spear: drop uie_unsupported Since commitc9f5c7e7a84f ("rtc: rtc-spear: Provide flag for no support of UIE mode") which was in 2012, the core changed a lot and UIE are now supported using regular alarms. Drop uie_unsupported now to reflect that. Signed-off-by: Alexandre Belloni Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220309162301.61679-20-alexandre.belloni@bootlin.com drivers/rtc/rtc-spear.c | 1 - 1 file changed, 1 deletion(-) commit f395e1d3b28d7c2c67b73bd467c4fb79523e1c65 Author: Alexandre Belloni Date: Wed Mar 9 17:22:50 2022 +0100 rtc: spear: set range While the RTC can store dates from year 0000 to 9999, leap years where not tested fro 2100. The driver currently stores tm_year directly which will probably fail at that time or more probably in 2300. Signed-off-by: Alexandre Belloni Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220309162301.61679-19-alexandre.belloni@bootlin.com drivers/rtc/rtc-spear.c | 2 ++ 1 file changed, 2 insertions(+) commit 4fc4d3339f0f6f53ccc001f4e56a86fa1d027e87 Author: Alexandre Belloni Date: Wed Mar 9 17:22:49 2022 +0100 rtc: spear: switch to devm_rtc_allocate_device Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows for further improvement of the driver. Signed-off-by: Alexandre Belloni Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220309162301.61679-18-alexandre.belloni@bootlin.com drivers/rtc/rtc-spear.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit d28a0e144e5ee146c7e821a5d54571363da7dce7 Author: Alexandre Belloni Date: Wed Mar 9 17:22:48 2022 +0100 rtc: pcf8563: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-17-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf8563.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cf4521ed7ba5b5b0c72f74f180b6e9557f130522 Author: Alexandre Belloni Date: Wed Mar 9 17:22:47 2022 +0100 rtc: pcf8563: let the core handle the alarm resolution Set RTC_FEATURE_ALARM_RES_MINUTE, so the core knows alarms have a resolution of a minute. Also, the core will properly round down the alarm instead of up. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-16-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf8563.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) commit e51cdef0819e171abdf4ceaea0385f21e29df46b Author: Alexandre Belloni Date: Wed Mar 9 17:22:46 2022 +0100 rtc: pcf8523: let the core handle the alarm resolution Set RTC_FEATURE_ALARM_RES_MINUTE, so the core knows alarms have a resolution of a minute. Also, the core will properly round down the alarm instead of up. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-15-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf8523.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) commit c1325e730caf66b81e629d6587415571ae0c20dc Author: Alexandre Belloni Date: Wed Mar 9 17:22:45 2022 +0100 rtc: pcf8523: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-14-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf8523.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a9f2d5bb662295f6c742d0e0366fcbaf93a923be Author: Alexandre Belloni Date: Wed Mar 9 17:22:44 2022 +0100 rtc: pcf85063: set RTC_FEATURE_ALARM_RES_2S The PCF85063 doesn't support UIE because setting an alarm to fire every second confuses the chip and the fastest we can go is an alarm every 2 seconds. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-13-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf85063.c | 1 + 1 file changed, 1 insertion(+) commit 11316c2463740d02e6c9680501b974e56555a85f Author: Alexandre Belloni Date: Wed Mar 9 17:22:43 2022 +0100 rtc: pcf85063: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-12-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf85063.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bda1027358e72e6255f11a4b59c375f138a2dd10 Author: Alexandre Belloni Date: Wed Mar 9 17:22:42 2022 +0100 rtc: pcf2127: set RTC_FEATURE_ALARM_RES_2S The PCF2127 doesn't support UIE because setting an alarm to fire every second confuses the chip and the fastest we can go is an alarm every 2 seconds. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-11-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf2127.c | 1 + 1 file changed, 1 insertion(+) commit 689fafd5b53ac223ba7c7b83aebe1c78ce7db46c Author: Alexandre Belloni Date: Wed Mar 9 17:22:41 2022 +0100 rtc: pcf2127: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-10-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf2127.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c7e91f7c1baa8b0bf1864c8abe44ca4b8732eb49 Author: Alexandre Belloni Date: Wed Mar 9 17:22:40 2022 +0100 rtc: pcf2123: set RTC_FEATURE_ALARM_RES_MINUTE Alarms have a resolution of a minute. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-9-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf2123.c | 1 + 1 file changed, 1 insertion(+) commit fff36f79681602d1196be34a8f5a7cc0c5a7a582 Author: Alexandre Belloni Date: Wed Mar 9 17:22:39 2022 +0100 rtc: pcf2123: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-8-alexandre.belloni@bootlin.com drivers/rtc/rtc-pcf2123.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 965994736554aa6b356ddcd9751cc5c450aaf5f8 Author: Alexandre Belloni Date: Wed Mar 9 17:22:38 2022 +0100 rtc: opal: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-7-alexandre.belloni@bootlin.com drivers/rtc/rtc-opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ba39374bc988c6a8ff81811d05839490457e79a5 Author: Alexandre Belloni Date: Wed Mar 9 17:22:37 2022 +0100 rtc: m41t80: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-6-alexandre.belloni@bootlin.com drivers/rtc/rtc-m41t80.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 14e6fc13a979ef87aa269a4386854d4dcc2cc836 Author: Alexandre Belloni Date: Wed Mar 9 17:22:36 2022 +0100 rtc: mpc5121: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-5-alexandre.belloni@bootlin.com drivers/rtc/rtc-mpc5121.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9597f8cc80b2044b02579961cffc6cd0d0d2f099 Author: Alexandre Belloni Date: Wed Mar 9 17:22:35 2022 +0100 rtc: mpc5121: let the core handle the alarm resolution Set RTC_FEATURE_ALARM_RES_MINUTE, so the core knows alarms have a resolution of a minute. Also, the core will properly round down the alarm instead of up. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-4-alexandre.belloni@bootlin.com drivers/rtc/rtc-mpc5121.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) commit 000bf045c69b40f5fd9aac61414cbb44f322e7c0 Author: Alexandre Belloni Date: Wed Mar 9 17:22:34 2022 +0100 rtc: ds1307: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-3-alexandre.belloni@bootlin.com drivers/rtc/rtc-ds1307.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5c0a04a663019dd14cb000d370cff0ced6df7ef1 Author: Alexandre Belloni Date: Wed Mar 9 17:22:33 2022 +0100 rtc: ds1685: drop no_irq No platforms are currently setting no_irq. Anyway, letting platform_get_irq fail is fine as this means that there is no IRQ. In that case, clear RTC_FEATURE_ALARM so the core knows there are no alarms. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-2-alexandre.belloni@bootlin.com drivers/rtc/rtc-ds1685.c | 14 +++++--------- include/linux/rtc/ds1685.h | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) commit 9e02e8032ae546c75b3bbb5c821eb11bdec286ad Author: Alexandre Belloni Date: Wed Mar 9 17:22:32 2022 +0100 rtc: ds1685: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. There is currently a missing information as to why this is not supported on ioc3. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220309162301.61679-1-alexandre.belloni@bootlin.com drivers/rtc/rtc-ds1685.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1738890a3165ccd0da98ebd3e2d5f9b230d5afa8 Author: Samuel Holland Date: Wed Feb 2 20:17:36 2022 -0600 clk: sunxi-ng: sun6i-rtc: Add support for H6 H6 supports IOSC calibration and an ext-osc32k input. Unlike newer SoCs, it has a single parent for its fanout clock. Add support for H6 in the CCU driver, replacing the support in the existing early OF clock provider. Signed-off-by: Samuel Holland Acked-by: Stephen Boyd Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220203021736.13434-7-samuel@sholland.org drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 15 +++++++++++++++ drivers/rtc/rtc-sun6i.c | 17 ----------------- 2 files changed, 15 insertions(+), 17 deletions(-) commit d91612d7f01aca454469976d25db761c5085ae4d Author: Samuel Holland Date: Wed Feb 2 20:17:35 2022 -0600 clk: sunxi-ng: Add support for the sun6i RTC clocks The RTC power domain in sun6i and newer SoCs manages the 16 MHz RC oscillator (called "IOSC" or "osc16M") and the optional 32 kHz crystal oscillator (called "LOSC" or "osc32k"). Starting with the H6, this power domain also handles the 24 MHz DCXO (called variously "HOSC", "dcxo24M", or "osc24M") as well. The H6 also adds a calibration circuit for IOSC. Later SoCs introduce further variations on the design: - H616 adds an additional mux for the 32 kHz fanout source. - R329 adds an additional mux for the RTC timekeeping clock, a clock for the SPI bus between power domains inside the RTC, and removes the IOSC calibration functionality. Take advantage of the CCU framework to handle this increased complexity. This driver is intended to be a drop-in replacement for the existing RTC clock provider. So some runtime adjustment of the clock parents is needed, both to handle hardware differences, and to support the old binding which omitted some of the input clocks. Signed-off-by: Samuel Holland Acked-by: Stephen Boyd Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220203021736.13434-6-samuel@sholland.org drivers/clk/sunxi-ng/Kconfig | 5 + drivers/clk/sunxi-ng/Makefile | 2 + drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 378 +++++++++++++++++++++++++++++++++++ drivers/clk/sunxi-ng/ccu-sun6i-rtc.h | 15 ++ drivers/rtc/rtc-sun6i.c | 7 + include/linux/clk/sunxi-ng.h | 2 + 6 files changed, 409 insertions(+) commit 7fc46339c33e60218bbb1f542d55da1678919d11 Author: Samuel Holland Date: Wed Feb 2 20:17:34 2022 -0600 clk: sunxi-ng: mux: Allow muxes to have keys The muxes in the RTC can only be updated when setting a key field to a specific value. Add a feature flag to denote muxes with this property. Since so far the key value is always the same, it does not need to be provided separately for each mux. Signed-off-by: Samuel Holland Acked-by: Stephen Boyd Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220203021736.13434-5-samuel@sholland.org drivers/clk/sunxi-ng/ccu_common.h | 1 + drivers/clk/sunxi-ng/ccu_mux.c | 7 +++++++ 2 files changed, 8 insertions(+) commit 43f0269b6b89c1eec4ef83c48035608f4dcdd886 Author: Jiasheng Jiang Date: Thu Mar 3 16:50:30 2022 +0800 rtc: wm8350: Handle error for wm8350_register_irq As the potential failure of the wm8350_register_irq(), it should be better to check it and return error if fails. Also, it need not free 'wm_rtc->rtc' since it will be freed automatically. Fixes: 077eaf5b40ec ("rtc: rtc-wm8350: add support for WM8350 RTC") Signed-off-by: Jiasheng Jiang Acked-by: Charles Keepax Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220303085030.291793-1-jiasheng@iscas.ac.cn drivers/rtc/rtc-wm8350.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 8a93720329d4d24c352b035e0532f756c8ecf546 Author: Andre Przywara Date: Fri Feb 11 12:26:31 2022 +0000 rtc: sun6i: Add Allwinner H616 support The H616 RTC changes its day storage to the newly introduced linear day scheme, so pair the new compatible string with this feature flag. The RTC clock parts are handled in a separate driver now, so we skip the clock parts in this driver completely. Signed-off-by: Andre Przywara Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220211122643.1343315-7-andre.przywara@arm.com drivers/rtc/rtc-sun6i.c | 2 ++ 1 file changed, 2 insertions(+) commit 7878fec4b5445b708f5aa068bbc600e59308a165 Author: Andre Przywara Date: Fri Feb 11 12:26:30 2022 +0000 rtc: sun6i: Add support for broken-down alarm registers Newer versions of the Allwinner RTC, for instance as found in the H616 SoC, not only store the current day as a linear number, but also change the way the alarm is handled: There are now two registers, that explicitly store the wakeup time, in the same format as the current time. Add support for that variant by writing the requested wakeup time directly into the registers, instead of programming the seconds left, as the old SoCs required. Reviewed by: Jernej Skrabec Signed-off-by: Andre Przywara Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220211122643.1343315-6-andre.przywara@arm.com drivers/rtc/rtc-sun6i.c | 57 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 17 deletions(-) commit 648c151ab5d8b05bf1c539c92fcb080f475f20b9 Author: Andre Przywara Date: Fri Feb 11 12:26:29 2022 +0000 rtc: sun6i: Add support for linear day storage Newer versions of the Allwinner RTC, as for instance found in the H616 SoC, no longer store a broken-down day/month/year representation in the RTC_DAY_REG, but just a linear day number. The user manual does not give any indication about the expected epoch time of this day count, but the BSP kernel uses the UNIX epoch, which allows easy support due to existing conversion functions in the kernel. Allow tagging a compatible string with a flag, and use that to mark those new RTCs. Then convert between a UNIX day number (converted into seconds) and the broken-down day representation using mktime64() and time64_to_tm() in the set_time/get_time functions. That enables support for the RTC in those new chips. Signed-off-by: Andre Przywara Reviewed-by: Jernej Skrabec Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220211122643.1343315-5-andre.przywara@arm.com drivers/rtc/rtc-sun6i.c | 69 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 23 deletions(-) commit 9f6cd82eca7e91a0d0311242a87c6aa3c2737968 Author: Andre Przywara Date: Fri Feb 11 12:26:28 2022 +0000 rtc: sun6i: Fix time overflow handling Using "unsigned long" for UNIX timestamps is never a good idea, and comparing the value of such a variable against U32_MAX does not do anything useful on 32-bit systems. Use the proper time64_t type when dealing with timestamps, and avoid cutting down the time range unnecessarily. This also fixes the flawed check for the alarm time being too far into the future. The check for this condition is actually somewhat theoretical, as the RTC counts till 2033 only anyways, and 2^32 seconds from now is not before the year 2157 - at which point I hope nobody will be using this hardware anymore. Signed-off-by: Andre Przywara Reviewed-by: Jernej Skrabec Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220211122643.1343315-4-andre.przywara@arm.com drivers/rtc/rtc-sun6i.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) commit ea6af39f3da50c86367a71eb3cc674ade3ed244c Author: Ali Pouladi Date: Fri Feb 25 08:19:24 2022 -0800 rtc: pl031: fix rtc features null pointer dereference When there is no interrupt line, rtc alarm feature is disabled. The clearing of the alarm feature bit was being done prior to allocations of ldata->rtc device, resulting in a null pointer dereference. Clear RTC_FEATURE_ALARM after the rtc device is allocated. Fixes: d9b0dd54a194 ("rtc: pl031: use RTC_FEATURE_ALARM") Cc: stable@vger.kernel.org Signed-off-by: Ali Pouladi Signed-off-by: Elliot Berman Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220225161924.274141-1-quic_eberman@quicinc.com drivers/rtc/rtc-pl031.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 811f5559270f25c34c338d6eaa2ece2544c3d3bd Author: Mateusz Jończyk Date: Sun Feb 20 10:04:03 2022 +0100 rtc: mc146818-lib: fix locking in mc146818_set_time In mc146818_set_time(), CMOS_READ(RTC_CONTROL) was performed without the rtc_lock taken, which is required for CMOS accesses. Fix this. Nothing in kernel modifies RTC_DM_BINARY, so a separate critical section is allowed here. Fixes: dcf257e92622 ("rtc: mc146818: Reduce spinlock section in mc146818_set_time()") Signed-off-by: Mateusz Jończyk Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: Thomas Gleixner Cc: stable@vger.kernel.org Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220220090403.153928-1-mat.jonczyk@o2.pl drivers/rtc/rtc-mc146818-lib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit eb74f47bb6b0c0494d7c90491ee321f3b699f93f Author: Alexandre Belloni Date: Tue Mar 8 16:57:35 2022 +0100 dt-bindings: rtc: at91: rename rtt bindings file atmel,at91sam9-rtc is a confusing name for this file as it is documenting the RTT used as an RTC and not the other regular RTC (atmel,at91rm9200-rtc and atmel,at91sam9x5-rtc) Signed-off-by: Alexandre Belloni Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220308155735.54146-1-alexandre.belloni@bootlin.com .../rtc/{atmel,at91sam9-rtc.yaml => atmel,at91sam9260-rtt.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3848e96edf4788f772d83990022fa7023a233d83 Author: NeilBrown Date: Tue Mar 8 13:42:17 2022 +1100 SUNRPC: avoid race between mod_timer() and del_timer_sync() xprt_destory() claims XPRT_LOCKED and then calls del_timer_sync(). Both xprt_unlock_connect() and xprt_release() call ->release_xprt() which drops XPRT_LOCKED and *then* xprt_schedule_autodisconnect() which calls mod_timer(). This may result in mod_timer() being called *after* del_timer_sync(). When this happens, the timer may fire long after the xprt has been freed, and run_timer_softirq() will probably crash. The pairing of ->release_xprt() and xprt_schedule_autodisconnect() is always called under ->transport_lock. So if we take ->transport_lock to call del_timer_sync(), we can be sure that mod_timer() will run first (if it runs at all). Cc: stable@vger.kernel.org Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust net/sunrpc/xprt.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 1bc191051dca28fa6d20fd1dc34a1903e7d4fb62 Merge: 20f463fb3868 795301d3c289 Author: Linus Torvalds Date: Wed Mar 23 11:40:25 2022 -0700 Merge tag 'trace-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing updates from Steven Rostedt: - New user_events interface. User space can register an event with the kernel describing the format of the event. Then it will receive a byte in a page mapping that it can check against. A privileged task can then enable that event like any other event, which will change the mapped byte to true, telling the user space application to start writing the event to the tracing buffer. - Add new "ftrace_boot_snapshot" kernel command line parameter. When set, the tracing buffer will be saved in the snapshot buffer at boot up when the kernel hands things over to user space. This will keep the traces that happened at boot up available even if user space boot up has tracing as well. - Have TRACE_EVENT_ENUM() also update trace event field type descriptions. Thus if a static array defines its size with an enum, the user space trace event parsers can still know how to parse that array. - Add new TRACE_CUSTOM_EVENT() macro. This acts the same as the TRACE_EVENT() macro, but will attach to an existing tracepoint. This will make one tracepoint be able to trace different content and not be stuck at only what the original TRACE_EVENT() macro exports. - Fixes to tracing error logging. - Better saving of cmdlines to PIDs when tracing (use the wakeup events for mapping). * tag 'trace-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (30 commits) tracing: Have type enum modifications copy the strings user_events: Add trace event call as root for low permission cases tracing/user_events: Use alloc_pages instead of kzalloc() for register pages tracing: Add snapshot at end of kernel boot up tracing: Have TRACE_DEFINE_ENUM affect trace event types as well tracing: Fix strncpy warning in trace_events_synth.c user_events: Prevent dyn_event delete racing with ioctl add/delete tracing: Add TRACE_CUSTOM_EVENT() macro tracing: Move the defines to create TRACE_EVENTS into their own files tracing: Add sample code for custom trace events tracing: Allow custom events to be added to the tracefs directory tracing: Fix last_cmd_set() string management in histogram code user_events: Fix potential uninitialized pointer while parsing field tracing: Fix allocation of last_cmd in last_cmd_set() user_events: Add documentation file user_events: Add sample code for typical usage user_events: Add self-test for validator boundaries user_events: Add self-test for perf_event integration user_events: Add self-test for dynamic_events integration user_events: Add self-test for ftrace integration ... commit 20f463fb38686dd3fe7e6903cab56bdbbf756238 Merge: 3ef4ea3d84ca 75016ca3acd0 Author: Linus Torvalds Date: Wed Mar 23 11:08:10 2022 -0700 Merge tag 'trace-rtla-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull RTLA tracing tool updates from Steven Rostedt: "Real Time Analysis Tool updatesfor 5.18: - Support for adjusting tracing_threashold - Add -a (auto) option to make it easier for users to debug in the field - Add -e option to add more events to the trace - Add --trigger option to add triggers to events - Add --filter option to filter events - Add support to save histograms to the file - Add --dma-latency to set /dev/cpu_dma_latency - Other fixes and cleanups" * tag 'trace-rtla-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: rtla: Tools main loop cleanup rtla/timerlat: Add --dma-latency option rtla/osnoise: Fix osnoise hist stop tracing message rtla: Check for trace off also in the trace instance rtla/trace: Save event histogram output to a file rtla: Add --filter support rtla/trace: Add trace event filter helpers rtla: Add --trigger support rtla/trace: Add trace event trigger helpers rtla: Add -e/--event support rtla/trace: Add trace events helpers rtla/timerlat: Add the automatic trace option rtla/osnoise: Add the automatic trace option rtla/osnoise: Add an option to set the threshold rtla/osnoise: Add support to adjust the tracing_thresh commit 3ef4ea3d84ca568dcd57816b9521e82e3bd94f08 Merge: 30d024b5058e 5eb17c1f458c Author: Linus Torvalds Date: Wed Mar 23 10:54:27 2022 -0700 Merge tag 'printk-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk updates from Petr Mladek: - Make %pK behave the same as %p for kptr_restrict == 0 also with no_hash_pointers parameter - Ignore the default console in the device tree also when console=null or console="" is used on the command line - Document console=null and console="" behavior - Prevent a deadlock and a livelock caused by console_lock in panic() - Make console_lock available for panicking CPU - Fast query for the next to-be-used sequence number - Use the expected return values in printk.devkmsg __setup handler - Use the correct atomic operations in wake_up_klogd() irq_work handler - Avoid possible unaligned access when handling %4cc printing format * tag 'printk-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk: fix return value of printk.devkmsg __setup handler vsprintf: Fix %pK with kptr_restrict == 0 printk: make suppress_panic_printk static printk: Set console_set_on_cmdline=1 when __add_preferred_console() is called with user_specified == true Docs: printk: add 'console=null|""' to admin/kernel-parameters printk: use atomic updates for klogd work printk: Drop console_sem during panic printk: Avoid livelock with heavy printk during panic printk: disable optimistic spin during panic printk: Add panic_in_progress helper vsprintf: Move space out of string literals in fourcc_string() vsprintf: Fix potential unaligned access printk: ringbuffer: Improve prb_next_seq() performance commit 89695196f0ba78a17453f9616355f2ca6b293402 Merge: 764f4eb6846f f92fcb5c00dc Author: Jakub Kicinski Date: Wed Mar 23 10:52:56 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Merge in overtime fixes, no conflicts. Signed-off-by: Jakub Kicinski commit 764f4eb6846f5475f1244767d24d25dd86528a4a Author: Eric Dumazet Date: Tue Mar 22 17:41:47 2022 -0700 llc: fix netdevice reference leaks in llc_ui_bind() Whenever llc_ui_bind() and/or llc_ui_autobind() took a reference on a netdevice but subsequently fail, they must properly release their reference or risk the infamous message from unregister_netdevice() at device dismantle. unregister_netdevice: waiting for eth0 to become free. Usage count = 3 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Reported-by: 赵子轩 Reported-by: Stoyan Manolov Link: https://lore.kernel.org/r/20220323004147.1990845-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski net/llc/af_llc.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 2844e2434385819f674d1fb4130c308c50ba681e Author: Sondhauß, Jan Date: Wed Mar 23 08:47:33 2022 +0000 drivers: ethernet: cpsw: fix panic when interrupt coaleceing is set via ethtool cpsw_ethtool_begin directly returns the result of pm_runtime_get_sync when successful. pm_runtime_get_sync returns -error code on failure and 0 on successful resume but also 1 when the device is already active. So the common case for cpsw_ethtool_begin is to return 1. That leads to inconsistent calls to pm_runtime_put in the call-chain so that pm_runtime_put is called one too many times and as result leaving the cpsw dev behind suspended. The suspended cpsw dev leads to an access violation later on by different parts of the cpsw driver. Fix this by calling the return-friendly pm_runtime_resume_and_get function. Fixes: d43c65b05b84 ("ethtool: runtime-resume netdev parent in ethnl_ops_begin") Signed-off-by: Jan Sondhauss Reviewed-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20220323084725.65864-1-jan.sondhauss@wago.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/ti/cpsw_ethtool.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit f92fcb5c00dc924a4661d5bf68de7937040f26b8 Merge: 6a7d8cff4a33 5a3156932da0 Author: Jakub Kicinski Date: Wed Mar 23 10:40:43 2022 -0700 Merge branch 'ice-avoid-sleeping-scheduling-in-atomic-contexts' Alexander Lobakin says: ==================== ice: avoid sleeping/scheduling in atomic contexts The `ice_misc_intr() + ice_send_event_to_aux()` infamous pair failed once again. Fix yet another (hopefully last one) 'scheduling while atomic' splat and finally plug the hole to gracefully return prematurely when invoked in wrong context instead of panicking. ==================== Link: https://lore.kernel.org/r/20220323124353.2762181-1-alexandr.lobakin@intel.com Signed-off-by: Jakub Kicinski commit 5a3156932da06f09953764de113419f254086faf Author: Alexander Lobakin Date: Wed Mar 23 13:43:53 2022 +0100 ice: don't allow to run ice_send_event_to_aux() in atomic ctx ice_send_event_to_aux() eventually descends to mutex_lock() (-> might_sched()), so it must not be called under non-task context. However, at least two fixes have happened already for the bug splats occurred due to this function being called from atomic context. To make the emergency landings softer, bail out early when executed in non-task context emitting a warn splat only once. This way we trade some events being potentially lost for system stability and avoid any related hangs and crashes. Fixes: 348048e724a0e ("ice: Implement iidc operations") Signed-off-by: Alexander Lobakin Tested-by: Michal Kubiak Reviewed-by: Maciej Fijalkowski Acked-by: Tony Nguyen Signed-off-by: Jakub Kicinski drivers/net/ethernet/intel/ice/ice_idc.c | 3 +++ 1 file changed, 3 insertions(+) commit 32d53c0aa3a7b727243473949bad2a830b908edc Author: Alexander Lobakin Date: Wed Mar 23 13:43:52 2022 +0100 ice: fix 'scheduling while atomic' on aux critical err interrupt There's a kernel BUG splat on processing aux critical error interrupts in ice_misc_intr(): [ 2100.917085] BUG: scheduling while atomic: swapper/15/0/0x00010000 ... [ 2101.060770] Call Trace: [ 2101.063229] [ 2101.065252] dump_stack+0x41/0x60 [ 2101.068587] __schedule_bug.cold.100+0x4c/0x58 [ 2101.073060] __schedule+0x6a4/0x830 [ 2101.076570] schedule+0x35/0xa0 [ 2101.079727] schedule_preempt_disabled+0xa/0x10 [ 2101.084284] __mutex_lock.isra.7+0x310/0x420 [ 2101.088580] ? ice_misc_intr+0x201/0x2e0 [ice] [ 2101.093078] ice_send_event_to_aux+0x25/0x70 [ice] [ 2101.097921] ice_misc_intr+0x220/0x2e0 [ice] [ 2101.102232] __handle_irq_event_percpu+0x40/0x180 [ 2101.106965] handle_irq_event_percpu+0x30/0x80 [ 2101.111434] handle_irq_event+0x36/0x53 [ 2101.115292] handle_edge_irq+0x82/0x190 [ 2101.119148] handle_irq+0x1c/0x30 [ 2101.122480] do_IRQ+0x49/0xd0 [ 2101.125465] common_interrupt+0xf/0xf [ 2101.129146] ... As Andrew correctly mentioned previously[0], the following call ladder happens: ice_misc_intr() <- hardirq ice_send_event_to_aux() device_lock() mutex_lock() might_sleep() might_resched() <- oops Add a new PF state bit which indicates that an aux critical error occurred and serve it in ice_service_task() in process context. The new ice_pf::oicr_err_reg is read-write in both hardirq and process contexts, but only 3 bits of non-critical data probably aren't worth explicit synchronizing (and they're even in the same byte [31:24]). [0] https://lore.kernel.org/all/YeSRUVmrdmlUXHDn@lunn.ch Fixes: 348048e724a0e ("ice: Implement iidc operations") Signed-off-by: Alexander Lobakin Tested-by: Michal Kubiak Acked-by: Tony Nguyen Signed-off-by: Jakub Kicinski drivers/net/ethernet/intel/ice/ice.h | 2 ++ drivers/net/ethernet/intel/ice/ice_main.c | 25 +++++++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) commit 054d5575cd6ed2792611a7cbb8c88663cc873780 Author: Louis Peens Date: Wed Mar 23 11:25:06 2022 +0200 net/sched: fix incorrect vlan_push_eth dest field Seems like a potential copy-paste bug slipped in here, the second memcpy should of course be populating src and not dest. Fixes: ab95465cde23 ("net/sched: add vlan push_eth and pop_eth action to the hardware IR") Signed-off-by: Louis Peens Link: https://lore.kernel.org/r/20220323092506.21639-1-louis.peens@corigine.com Signed-off-by: Jakub Kicinski include/net/tc_act/tc_vlan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a911ad18a56aeecf87a098ad1cdc4de91d7f60de Author: Tobias Waldekranz Date: Tue Mar 22 14:30:01 2022 +0100 net: bridge: mst: Restrict info size queries to bridge ports Ensure that no bridge masters are ever considered for MST info dumping. MST states are only supported on bridge ports, not bridge masters - which br_mst_info_size relies on. Fixes: 122c29486e1f ("net: bridge: mst: Support setting and reporting MST port states") Signed-off-by: Tobias Waldekranz Link: https://lore.kernel.org/r/20220322133001.16181-1-tobias@waldekranz.com Signed-off-by: Jakub Kicinski net/bridge/br_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4a6806cfcbca2cd7bae94b2d4244dab3aaa1b333 Author: Yang Yingliang Date: Tue Mar 22 17:02:36 2022 +0800 net: marvell: prestera: add missing destroy_workqueue() in prestera_module_init() Add the missing destroy_workqueue() before return from prestera_module_init() in the error handling case. Fixes: 4394fbcb78cf ("net: marvell: prestera: handle fib notifications") Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220322090236.1439649-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/marvell/prestera/prestera_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit e9e6faeafaa00da1851bcf47912b0f1acae666b4 Author: Stephane Graber Date: Tue Mar 22 18:42:06 2022 -0400 drivers: net: xgene: Fix regression in CRC stripping All packets on ingress (except for jumbo) are terminated with a 4-bytes CRC checksum. It's the responsability of the driver to strip those 4 bytes. Unfortunately a change dating back to March 2017 re-shuffled some code and made the CRC stripping code effectively dead. This change re-orders that part a bit such that the datalen is immediately altered if needed. Fixes: 4902a92270fb ("drivers: net: xgene: Add workaround for errata 10GE_8/ENET_11") Cc: stable@vger.kernel.org Signed-off-by: Stephane Graber Tested-by: Stephane Graber Link: https://lore.kernel.org/r/20220322224205.752795-1-stgraber@ubuntu.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 30d024b5058e0433914022f87d917a97a9527632 Author: Herbert Xu Date: Wed Mar 23 15:35:10 2022 +1200 cacheflush.h: Add forward declaration for struct folio The struct folio is not declared in cacheflush.h so we need to provide a forward declaration as otherwise users of this header file may get warnings. Reported-by: Guenter Roeck Fixes: 522a0032af00 ("Add linux/cacheflush.h") Signed-off-by: Herbert Xu Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Linus Torvalds include/linux/cacheflush.h | 2 ++ 1 file changed, 2 insertions(+) commit 6cadd424abb63120f8346a4509dc43bddc9401d3 Merge: 4e371d996590 fecbd4a317c9 Author: Miquel Raynal Date: Wed Mar 23 18:07:51 2022 +0100 Merge tag 'nand/for-5.18' into mtd/next Raw NAND core changes: * Rework of_get_nand_bus_width() * Remove of_get_nand_on_flash_bbt() wrapper * Protect access to rawnand devices while in suspend * bindings: Document the wp-gpios property Rax NAND controller driver changes: * atmel: Fix refcount issue in atmel_nand_controller_init * nandsim: - Add NS_PAGE_BYTE_SHIFT macro to replace the repeat pattern - Merge repeat codes in ns_switch_state - Replace overflow check with kzalloc to single kcalloc * rockchip: Fix platform_get_irq.cocci warning * stm32_fmc2: Add NAND Write Protect support * pl353: Set the nand chip node as the flash node * brcmnand: Fix sparse warnings in bcma_nand * omap_elm: Remove redundant variable 'errors' * gpmi: - Support fast edo timings for mx28 - Validate controller clock rate - Fix controller timings setting * brcmnand: - Add BCMA shim - BCMA controller uses command shift of 0 - Allow platform data instantation - Add platform data structure for BCMA - Allow working without interrupts - Move OF operations out of brcmnand_init_cs() - Avoid pdev in brcmnand_init_cs() - Allow SoC to provide I/O operations - Assign soc as early as possible Onenand changes: * Check for error irq Signed-off-by: Miquel Raynal commit e97824ff663ce3509fe040431c713182c2f058b1 Author: Miaohe Lin Date: Tue Mar 22 16:09:18 2022 +0800 mm/mlock: fix two bugs in user_shm_lock() user_shm_lock forgets to set allowed to 0 when get_ucounts fails. So the later user_shm_unlock might do the extra dec_rlimit_ucounts. Also in the RLIM_INFINITY case, user_shm_lock will success regardless of the value of memlock where memblock == LONG_MAX && !capable(CAP_IPC_LOCK) should fail. Fix all of these by changing the code to leave lock_limit at ULONG_MAX aka RLIM_INFINITY, leave "allowed" initialized to 0 and remove the special case of RLIM_INFINITY as nothing can be greater than ULONG_MAX. Credit goes to Eric W. Biederman for proposing simplifying the code and thus catching the later bug. Fixes: d7c9e99aee48 ("Reimplement RLIMIT_MEMLOCK on top of ucounts") Signed-off-by: Miaohe Lin Cc: stable@vger.kernel.org v1: https://lkml.kernel.org/r/20220310132417.41189-1-linmiaohe@huawei.com v2: https://lkml.kernel.org/r/20220314064039.62972-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220322080918.59861-1-linmiaohe@huawei.com Signed-off-by: Eric W. Biederman mm/mlock.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit dcbc65aac28360df5f5a3b613043ccc0e81da3cf Author: Yang Li Date: Wed Mar 16 07:51:48 2022 +0800 ptrace: Remove duplicated include in ptrace.c Fix following includecheck warning: ./arch/m68k/kernel/ptrace.c: linux/ptrace.h is included more than once. Reported-by: Abaci Robot Signed-off-by: Yang Li Fixes: 153474ba1a4a ("ptrace: Create ptrace_report_syscall_{entry,exit} in ptrace.h") Link: https://lkml.kernel.org/r/20220315235148.54253-1-yang.lee@linux.alibaba.com Signed-off-by: Eric W. Biederman arch/m68k/kernel/ptrace.c | 1 - 1 file changed, 1 deletion(-) commit 124c458a401a2497f796e4f2d6cafac6edbea8e9 Author: Andreas Gruenbacher Date: Thu Mar 17 14:20:38 2022 +0100 gfs2: Minor retry logic cleanup Clean up the retry logic in the read and write functions somewhat. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) commit 52f3f033a5dbd023307520af1ff551cadfd7f037 Author: Andreas Gruenbacher Date: Mon Mar 14 18:32:02 2022 +0100 gfs2: Disable page faults during lockless buffered reads During lockless buffered reads, filemap_read() holds page cache page references while trying to copy data to the user-space buffer. The calling process isn't holding the inode glock, but the page references it holds prevent those pages from being removed from the page cache, and that prevents the underlying inode glock from being moved to another node. Thus, we can end up in the same kinds of distributed deadlock situations as with normal (non-lockless) buffered reads. Fix that by disabling page faults during lockless reads as well. Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit bb7f5d96aaa87d5aee2f5eb98ae0b84f08988489 Author: Andreas Gruenbacher Date: Mon Mar 7 23:30:03 2022 +0100 gfs2: Fix should_fault_in_pages() logic Fix the fault-in window size logic: * Use a maximum window size of 1 MiB instead of BIO_MAX_VECS * PAGE_SIZE. The previous window size was always one page because the pages variable was accidentally being defined and then redefined in should_fault_in_pages(). * The nr_dirtied heuristic for guessing when there might be memory pressure often results in very small window sizes. Don't let nr_dirtied drop below 8 pages (as btrfs does). * Compute the window size in units of bytes, not pages. * Account for page overlap (unaligned iterators). Signed-off-by: Andreas Gruenbacher fs/gfs2/file.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit 61285ff72ae59e1603f908b13363e99883d67e09 Author: Christoph Hellwig Date: Wed Mar 23 16:39:52 2022 +0100 fs: do not pass __GFP_HIGHMEM to bio_alloc in do_mpage_readpage The mpage bio alloc cleanup accidentally removed clearing ~GFP_KERNEL bits from the mask passed to bio_alloc. Fix this up in a slightly less obsfucated way that mirrors what iomap does in its readpage code. Fixes: 77c436de01c0 ("mpage: pass the operation to bio_alloc") Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig Tested-by: Ryusuke Konishi Link: https://lore.kernel.org/r/20220323153952.1418560-1-hch@lst.de Signed-off-by: Jens Axboe fs/mpage.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit d99460ed5cdcc28feba6b992630b04650e410902 Author: Michael Walle Date: Sun Mar 13 01:31:22 2022 +0100 dt-bindings: mfd: syscon: Add microchip,lan966x-cpu-syscon compatible Add the Microchip LAN966x CPU system registers compatible. Signed-off-by: Michael Walle Acked-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220313003122.19155-1-michael@walle.cc Documentation/devicetree/bindings/mfd/syscon.yaml | 1 + 1 file changed, 1 insertion(+) commit eca344a7362e0f34f179298fd8366bcd556eede1 Author: Steven Rostedt (Google) Date: Wed Mar 23 10:32:51 2022 -0400 tracing: Have trace event string test handle zero length strings If a trace event has in its TP_printk(): "%*.s", len, len ? __get_str(string) : NULL It is perfectly valid if len is zero and passing in the NULL. Unfortunately, the runtime string check at time of reading the trace sees the NULL and flags it as a bad string and produces a WARN_ON(). Handle this case by passing into the test function if the format has an asterisk (star) and if so, if the length is zero, then mark it as safe. Link: https://lore.kernel.org/all/YjsWzuw5FbWPrdqq@bfoster/ Cc: stable@vger.kernel.org Reported-by: Brian Foster Tested-by: Brian Foster Fixes: 9a6944fee68e2 ("tracing: Add a verifier to check string pointers for trace events") Signed-off-by: Steven Rostedt (Google) kernel/trace/trace.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit def387a2395708ccba333ccc0cea82ef5108f9be Author: Julia Lawall Date: Mon Mar 14 12:53:52 2022 +0100 mfd: bd9576: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Matti Vaittinen Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220314115354.144023-29-Julia.Lawall@inria.fr drivers/mfd/rohm-bd9576.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fc832ac98752950e267081d1ea6048d948969037 Author: Minghao Chi (CGEL ZTE) Date: Wed Mar 9 03:56:07 2022 +0000 mfd: Use platform_get_irq() to get the interrupt It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting. platform_get_irq() instead is a recommended way for getting IRQ even if it was not retrieved earlier. It also makes code simpler because we're getting "int" value right away and no conversion from resource to int is required. The print function dev_err() is redundant because platform_get_irq() already prints an error. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Reviewed-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220309035607.2080884-1-chi.minghao@zte.com.cn drivers/mfd/ab8500-core.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) commit 553f685ebf9689e701ec6b95c0ca3595cf1a743f Author: YueHaibing Date: Fri Mar 11 20:55:18 2022 +0800 mfd: db8500-prcmu: Remove unused inline function commit b0e846248de5 ("mfd: db8500-prcmu: Remove dead code for a non-existing config") left behind this, remove it. Signed-off-by: YueHaibing Reviewed-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220311125518.31064-1-yuehaibing@huawei.com include/linux/mfd/dbx500-prcmu.h | 4 ---- 1 file changed, 4 deletions(-) commit 9ed55e9ac536a3d60e5dd75def3e9158d1d09f5e Author: Hans de Goede Date: Mon Mar 7 18:38:44 2022 +0100 mfd: arizona-spi: Add Android board ACPI table handling x86/ACPI boards with an arizona WM5102 codec ship with either Windows or Android as factory installed OS. The ACPI fwnode for the codec on Android boards misses 2 things compared to the Windows boards (this is hardcoded in the Android board kernels): 1. There is no CLKE ACPI method to enabe the 32 KHz clock the codec needs for jack-detection. 2. The GPIOs used by the codec are not listed in the fwnode for the codec. The ACPI tables on x86/ACPI boards shipped with Android being incomplete happens a lot. The special drivers/platform/x86/x86-android-tablets.c module contains DMI based per model handling to compensate for this. This module will enable the 32KHz clock through the pinctrl framework to fix 1. and it will also register a gpio-lookup table for all GPIOs needed by the codec + machine driver, including the GPIOs coming from the codec itself. Add an arizona_spi_acpi_android_probe() function which waits for the x86-android-tablets to have set things up before continue with probing the arizona WM5102 codec. Acked-by: Charles Keepax Signed-off-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220307173844.199135-2-hdegoede@redhat.com drivers/mfd/arizona-spi.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) commit 3cf2b4344b651b94d62411963e666c9cb5b99e62 Author: Hans de Goede Date: Mon Mar 7 18:38:43 2022 +0100 mfd: arizona-spi: Split Windows ACPI init code into its own function x86/ACPI boards with an arizona WM5102 codec ship with either Windows or Android as factory installed OS. The ACPI fwnode describing the codec differs depending on the factory OS, and the current arizona_spi_acpi_probe() function is tailored for use with the Windows board ACPI tables. Split out the Windows board ACPI tables specific bits into a new arizona_spi_acpi_windows_probe() function in preparation for also adding support for the Android board ACPI tables. Signed-off-by: Hans de Goede Acked-by: Charles Keepax Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220307173844.199135-1-hdegoede@redhat.com drivers/mfd/arizona-spi.c | 52 +++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 20 deletions(-) commit e84ee1a75f944a0fe3c277aaa10c426603d2b0bc Author: Miaoqian Lin Date: Mon Mar 7 07:29:47 2022 +0000 mfd: asic3: Add missing iounmap() on error asic3_mfd_probe Add the missing iounmap() before return from asic3_mfd_probe in the error handling case. Fixes: 64e8867ba809 ("mfd: tmio_mmc hardware abstraction for CNF area") Signed-off-by: Miaoqian Lin Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220307072947.5369-1-linmq006@gmail.com drivers/mfd/asic3.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) commit e4f8e06515e2ed015e36f1a1ef6ebc811f446d10 Author: Lukas Bulwahn Date: Tue Mar 8 09:51:36 2022 +0100 MAINTAINERS: Rectify entry for ROHM MULTIFUNCTION BD9571MWV-M PMIC DEVICE DRIVERS Commit 983b62975e90 ("dt-bindings: mfd: bd9571mwv: Convert to json-schema") converts bd9571mwv.txt to rohm,bd9571mwv.yaml, but missed to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in ROHM MULTIFUNCTION BD9571MWV-M PMIC DEVICE DRIVERS. Signed-off-by: Lukas Bulwahn Reviewed-by: Geert Uytterhoeven Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220308085136.30753-1-lukas.bulwahn@gmail.com MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5a2d27c283db049e46c7fac5092ea45c6add2d47 Author: Andy Shevchenko Date: Tue Mar 1 22:50:56 2022 +0200 mfd: intel-lpss: Provide an SSP type to the driver The SPI driver wants to know the exact type of the controller. Provide this information to it, hence it allows to fix the Intel Cannon Lake and others in the future. Signed-off-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220301205056.79810-1-andriy.shevchenko@linux.intel.com drivers/mfd/intel-lpss-acpi.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) commit e7391b021e3f7bac37ec485f2ed1ca6787a800a7 Author: Rafał Miłecki Date: Wed Feb 16 12:29:28 2022 +0100 dt-bindings: mfd: brcm,cru: Rename pinctrl node This matches pinctrl.yaml requirement and fixes: Documentation/devicetree/bindings/mfd/brcm,cru.example.dt.yaml: pin-controller@1c0: $nodename:0: 'pin-controller@1c0' does not match '^(pinctrl|pinmux)(@[0-9a-f]+)?$' From schema: Documentation/devicetree/bindings/pinctrl/brcm,ns-pinmux.yaml Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220216112928.5330-1-zajec5@gmail.com Documentation/devicetree/bindings/mfd/brcm,cru.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9876ef1d7ea038a9d0a6cb850cc8b12f9098dc45 Author: Rob Herring Date: Mon Feb 28 16:15:37 2022 -0600 dt-bindings: Add compatibles for undocumented trivial syscons 'intel,lgm-syscon', 'marvell,armada-3700-usb2-host-misc', 'mediatek,mt8135-pctl-a-syscfg', and 'mediatek,mt8135-pctl-b-syscfg' are all used in DT binding examples and/or dts files, but are not documented. Add them to syscon.yaml as they are all trivial cases. Signed-off-by: Rob Herring Reviewed-by: Matthias Brugger Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220228221537.1700071-1-robh@kernel.org Documentation/devicetree/bindings/mfd/syscon.yaml | 4 ++++ 1 file changed, 4 insertions(+) commit 748718bcc0a2bc3bdc03ea86819bdf60dc6412e7 Author: Claudiu Beznea Date: Tue Dec 7 13:15:15 2021 +0200 mfd: atmel-flexcom: Fix compilation warning Fix "unused variable 'atmel_flexcom_pm_ops' [-Wunused-const-variable]" compilation warning by using __maybe_unused on PM ops. Reported-by: kernel test robot Signed-off-by: Claudiu Beznea Acked-by: Nicolas Ferre Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211207111515.814653-1-claudiu.beznea@microchip.com drivers/mfd/atmel-flexcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5e6ded2e7a5d9c71186acc8f51989ef6e6addda4 Author: Tom Rix Date: Sat Mar 19 18:51:43 2022 -0700 livepatch: Reorder to use before freeing a pointer Clang static analysis reports this issue livepatch-shadow-fix1.c:113:2: warning: Use of memory after it is freed pr_info("%s: dummy @ %p, prevented leak @ %p\n", ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The pointer is freed in the previous statement. Reorder the pr_info to report before the free. Similar issue in livepatch-shadow-fix2.c Note that it is a false positive. pr_info() just prints the address. The freed memory is not accessed. Well, the static analyzer could not know this easily. Signed-off-by: Tom Rix Reviewed-by: Petr Mladek Acked-by: David Vernet Acked-by: Joe Lawrence [pmladek@suse.com: Note about that it was false positive.] Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220320015143.2208591-1-trix@redhat.com samples/livepatch/livepatch-shadow-fix1.c | 2 +- samples/livepatch/livepatch-shadow-fix2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 4d55f238f8b89124f73e50abbd05e413def514fe Author: Jens Axboe Date: Tue Mar 22 14:12:33 2022 -0600 io_uring: don't recycle provided buffer if punted to async worker We only really need to recycle the buffer when going async for a file type that has an indefinite reponse time (eg non-file/bdev). And for files that to arm poll, the async worker will arm poll anyway and the buffer will get recycled there. In that latter case, we're not holding ctx->uring_lock. Ensure we take the issue_flags into account and acquire it if we need to. Fixes: b1c62645758e ("io_uring: recycle provided buffers if request goes async") Reported-by: Stefan Roesch Signed-off-by: Jens Axboe fs/io_uring.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit d89a4fac0fbc6fe5fc24d1c9a889440dcf410368 Author: Jens Axboe Date: Tue Mar 22 13:11:28 2022 -0600 io_uring: fix assuming triggered poll waitqueue is the single poll syzbot reports a recent regression: BUG: KASAN: use-after-free in __wake_up_common+0x637/0x650 kernel/sched/wait.c:101 Read of size 8 at addr ffff888011e8a130 by task syz-executor413/3618 CPU: 0 PID: 3618 Comm: syz-executor413 Tainted: G W 5.17.0-syzkaller-01402-g8565d64430f8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x303 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 __wake_up_common+0x637/0x650 kernel/sched/wait.c:101 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:138 tty_release+0x657/0x1200 drivers/tty/tty_io.c:1781 __fput+0x286/0x9f0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xaff/0x29d0 kernel/exit.c:806 do_group_exit+0xd2/0x2f0 kernel/exit.c:936 __do_sys_exit_group kernel/exit.c:947 [inline] __se_sys_exit_group kernel/exit.c:945 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:945 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+0x44/0xae RIP: 0033:0x7f439a1fac69 which is due to leaving the request on the waitqueue mistakenly. The reproducer is using a tty device, which means we end up arming the same poll queue twice (it uses the same poll waitqueue for both), but in io_poll_wake() we always just clear REQ_F_SINGLE_POLL regardless of which entry triggered. This leaves one waitqueue potentially armed after we're done, which then blows up in tty when the waitqueue is attempted removed. We have no room to store this information, so simply encode it in the wait_queue_entry->private where we store the io_kiocb request pointer. Fixes: 91eac1c69c20 ("io_uring: cache poll/double-poll state with a request flag") Reported-by: syzbot+09ad4050dd3a120bfccd@syzkaller.appspotmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) commit e2c0cb7c0cc72939b61a7efee376206725796625 Author: Jens Axboe Date: Tue Mar 22 06:57:25 2022 -0600 io_uring: bump poll refs to full 31-bits The previous commit: 1bc84c40088 ("io_uring: remove poll entry from list when canceling all") removed a potential overflow condition for the poll references. They are currently limited to 20-bits, even if we have 31-bits available. The upper bit is used to mark for cancelation. Bump the poll ref space to 31-bits, making that kind of situation much harder to trigger in general. We'll separately add overflow checking and handling. Fixes: aa43477b0402 ("io_uring: poll rework") Signed-off-by: Jens Axboe fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2f45a4e2897793cc6ae25f5fe78b485ce7fd01d0 Author: Meng Tang Date: Fri Mar 18 18:01:46 2022 +0800 ASoC: rockchip: i2s_tdm: Fixup config for SND_SOC_DAIFMT_DSP_A/B SND_SOC_DAIFMT_DSP_A: PCM delay 1 bit mode, L data MSB after FRM LRC SND_SOC_DAIFMT_DSP_B: PCM no delay mode, L data MSB during FRM LRC Fixes: 081068fd64140 (ASoC: rockchip: add support for i2s-tdm controller) Signed-off-by: Meng Tang Link: https://lore.kernel.org/r/20220318100146.23991-1-tangmeng@uniontech.com Signed-off-by: Mark Brown sound/soc/rockchip/rockchip_i2s_tdm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit cf38326010aebf39855977475a901c4c7a3e0b63 Author: Andre Przywara Date: Thu Mar 17 18:30:43 2022 +0000 ARM: configs: multi_v5: Enable Allwinner F1C100 The Kconfig symbols required for the Allwinner F1C100 (MACH_SUNIV) are currently not selected by any defconfig. sunxi_defconfig only covers the v7 SoCs, but the F1C100s is ARMv5, so we cannot share a single image. Add the required symbols to multi_v5_defconfig, to give people some sane default config when playing around with this chip. This is probably more important as there are surely not many distros out there supporting ARMv5 out of the box. This allows my LicheePi Nano board to boot to a busybox prompt. The zImage size grows by about 50 KB, in detail: text data bss dec hex filename 10510000 4400700 687740 15598440 ee0368 vmlinux-old 10588592 4469096 686812 15744500 f03df4 vmlinux-new 14922908 arch/arm/boot/Image-old 15067388 arch/arm/boot/Image-new 6388016 arch/arm/boot/zImage-old 6440064 arch/arm/boot/zImage-new Signed-off-by: Andre Przywara Link: https://lore.kernel.org/r/20220317183043.948432-6-andre.przywara@arm.com' Signed-off-by: Arnd Bergmann arch/arm/configs/multi_v5_defconfig | 5 +++++ 1 file changed, 5 insertions(+) commit b146dbbd3bc61678165f3de7904ab613865385ba Merge: bda3c85a00b0 337fa051d9b8 Author: Jiri Kosina Date: Wed Mar 23 10:10:56 2022 +0100 Merge branch 'for-5.18/uclogic' into for-linus - integration of first part of DIGImend [1] patches in order to vastly improve Linux support of tablets (Nikolai Kondrashov, José Expósito) [1] https://github.com/DIGImend/digimend-kernel-drivers commit bda3c85a00b07668f7acca41e84607c2c5bee3b4 Merge: 1fe30b497ca0 976734041b6c Author: Jiri Kosina Date: Wed Mar 23 10:09:34 2022 +0100 Merge branch 'for-5.18/sigma-micro' into for-linus - driver for SiGma Micro keyboards (Desmond Lim) commit 1fe30b497ca02dbf8562536116e24ce41c61f8fa Merge: 5d3ab41394f7 047b6188b66e Author: Jiri Kosina Date: Wed Mar 23 10:08:57 2022 +0100 Merge branch 'for-5.18/razer' into for-linus - driver for Razer Blackwidow keyboards (Jelle van der Waa) commit 5d3ab41394f70a4398b586c24a2d15d7ac3cb442 Merge: e0464ad24666 269ecc0c894c Author: Jiri Kosina Date: Wed Mar 23 10:04:40 2022 +0100 Merge branch 'for-5.18/i2c-hid' into for-linus - fixes for handling unnumbered reports fully correctly (Angela Czubak Dmitry Torokhov) - untangling of intermingled code for sending and handling output reports in __i2c_hid_command() (Dmitry Torokhov) commit e0464ad24666f6e35236e3ac8263911efb9099e7 Merge: a2ff0059270f 01f1269fbb0e Author: Jiri Kosina Date: Wed Mar 23 10:03:54 2022 +0100 Merge branch 'for-5.18/google' into for-linus commit a2ff0059270fd35770c6bb22dca86a491b832fb2 Merge: 412370414c3c 42764f97e6eb Author: Jiri Kosina Date: Wed Mar 23 10:01:56 2022 +0100 Merge branch 'for-5.18/core' into for-linus - rework of generic input handling which ultimately makes the processing of tablet events more generic and reliable (Benjamin Tissoires) commit 412370414c3c7cfe504e2af1d8c98d7a912e6c9a Merge: b690490d6d46 ed9f4f961260 Author: Jiri Kosina Date: Wed Mar 23 09:59:26 2022 +0100 Merge branch 'for-5.18/apple' into for-linus - Apple magic keyboard support improvements for newer models (José Expósito) - Apple T2 Macs support improvements (Aun-Ali Zaidi, Paul Pawlowski) commit b690490d6d466972ade172ee2e7f6ffa49e7e910 Merge: f97ec5d75e92 0f2039482307 Author: Jiri Kosina Date: Wed Mar 23 09:58:40 2022 +0100 Merge branch 'for-5.18/amd-sfh' into for-linus - dead code elimination (Christophe JAILLET) commit bc360b0b1611566e1bd47384daf49af6a1c51837 Author: Monish Kumar R Date: Wed Mar 16 13:24:49 2022 +0530 nvme-pci: add quirks for Samsung X5 SSDs Add quirks to not fail the initialization and to have quick resume latency after cold/warm reboot. Signed-off-by: Monish Kumar R Signed-off-by: Christoph Hellwig drivers/nvme/host/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 2e21e4454bd3435ef6e3b84492dcbfaaf9d8769c Author: Xin Hao Date: Tue Mar 22 10:35:12 2022 +0800 nvme-pci: expose use_threaded_interrupts read-only in sysfs Allow reading /sys/module/nvme/parameters/use_threaded_interrupts to see if the use_threaded_interrupts module parameter is in use. Signed-off-by: Xin Hao Signed-off-by: Christoph Hellwig drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 726be2c72efc0a64c206e854b8996ad3ab9c7507 Author: Pankaj Raghav Date: Tue Mar 22 10:20:48 2022 +0100 nvme: fix the read-only state for zoned namespaces with unsupposed features commit 2f4c9ba23b88 ("nvme: export zoned namespaces without Zone Append support read-only") marks zoned namespaces without append support read-only. It does iso by setting NVME_NS_FORCE_RO in ns->flags in nvme_update_zone_info and checking for that flag later in nvme_update_disk_info to mark the disk as read-only. But commit 73d90386b559 ("nvme: cleanup zone information initialization") rearranged nvme_update_disk_info to be called before nvme_update_zone_info and thus not marking the disk as read-only. The call order cannot be just reverted because nvme_update_zone_info sets certain queue parameters such as zone_write_granularity that depend on the prior call to nvme_update_disk_info. Remove the call to set_disk_ro in nvme_update_disk_info. and call set_disk_ro after nvme_update_zone_info and nvme_update_disk_info to set the permission for ZNS drives correctly. The same applies to the multipath disk path. Fixes: 73d90386b559 ("nvme: cleanup zone information initialization") Signed-off-by: Pankaj Raghav Signed-off-by: Christoph Hellwig drivers/nvme/host/core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 36c2e31ad25bd087756b8db9584994d1d80c236b Author: Eyal Birger Date: Tue Mar 22 06:39:54 2022 +0200 net: geneve: add missing netlink policy and size for IFLA_GENEVE_INNER_PROTO_INHERIT Add missing netlink attribute policy and size calculation. Also enable strict validation from this new attribute onwards. Fixes: 435fe1c0c1f7 ("net: geneve: support IPv4/IPv6 as inner protocol") Signed-off-by: Eyal Birger Link: https://lore.kernel.org/r/20220322043954.3042468-1-eyal.birger@gmail.com Signed-off-by: Jakub Kicinski drivers/net/geneve.c | 3 +++ 1 file changed, 3 insertions(+) commit 5077e2c8cf4d6b22a95a6c54a917f764e8887978 Author: Vladimir Oltean Date: Tue Mar 22 02:37:01 2022 +0200 net: dsa: fix missing host-filtered multicast addresses DSA ports are stacked devices, so they use dev_mc_add() to sync their address list to their lower interface (DSA master). But they are also hardware devices, so they program those addresses to hardware using the __dev_mc_add() sync and unsync callbacks. Unfortunately both cannot work at the same time, and it seems that the multicast addresses which are already present on the DSA master, like 33:33:00:00:00:01 (added by addrconf.c as in6addr_linklocal_allnodes) are synced to the master via dev_mc_sync(), but not to hardware by __dev_mc_sync(). This happens because both the dev_mc_sync() -> __hw_addr_sync_one() code path, as well as __dev_mc_sync() -> __hw_addr_sync_dev(), operate on the same variable: ha->sync_cnt, in a way that causes the "sync" method (dsa_slave_sync_mc) to no longer be called. To fix the issue we need to work with the API in the way in which it was intended to be used, and therefore, call dev_uc_add() and friends for each individual hardware address, from the sync and unsync callbacks. Fixes: 5e8a1e03aa4d ("net: dsa: install secondary unicast and multicast addresses as host FDB/MDB") Link: https://lore.kernel.org/netdev/20220321163213.lrn5sk7m6grighbl@skbuf/ Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220322003701.2056895-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski net/dsa/slave.c | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) commit d578c770c85233af592e54537f93f3831bde7e9a Author: Ming Lei Date: Wed Mar 23 09:13:08 2022 +0800 block: avoid calling blkg_free() in atomic context blkg_free() can currently be called in atomic context, either spin lock is held, or run in rcu callback. Meantime either request queue's release handler or ->pd_free_fn can sleep. Fix the issue by scheduling a work function for freeing blkcg_gq the instance. [ 148.553894] BUG: sleeping function called from invalid context at block/blk-sysfs.c:767 [ 148.557381] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/13 [ 148.560741] preempt_count: 101, expected: 0 [ 148.562577] RCU nest depth: 0, expected: 0 [ 148.564379] 1 lock held by swapper/13/0: [ 148.566127] #0: ffffffff82615f80 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire+0x0/0x1b [ 148.569640] Preemption disabled at: [ 148.569642] [] ___slab_alloc+0x554/0x661 [ 148.573559] CPU: 13 PID: 0 Comm: swapper/13 Kdump: loaded Not tainted 5.17.0_up+ #110 [ 148.576834] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-1.fc33 04/01/2014 [ 148.579768] Call Trace: [ 148.580567] [ 148.581262] dump_stack_lvl+0x56/0x7c [ 148.582367] ? ___slab_alloc+0x554/0x661 [ 148.583526] __might_resched+0x1af/0x1c8 [ 148.584678] blk_release_queue+0x24/0x109 [ 148.585861] kobject_cleanup+0xc9/0xfe [ 148.586979] blkg_free+0x46/0x63 [ 148.587962] rcu_do_batch+0x1c5/0x3db [ 148.589057] rcu_core+0x14a/0x184 [ 148.590065] __do_softirq+0x14d/0x2c7 [ 148.591167] __irq_exit_rcu+0x7a/0xd4 [ 148.592264] sysvec_apic_timer_interrupt+0x82/0xa5 [ 148.593649] [ 148.594354] [ 148.595058] asm_sysvec_apic_timer_interrupt+0x12/0x20 Cc: Tejun Heo Fixes: 0a9a25ca7843 ("block: let blkcg_gq grab request queue's refcnt") Reported-by: Christoph Hellwig Link: https://lore.kernel.org/linux-block/20220322093322.GA27283@lst.de/ Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220323011308.2010380-1-ming.lei@redhat.com Signed-off-by: Jens Axboe block/blk-cgroup.c | 32 ++++++++++++++++++++++---------- include/linux/blk-cgroup.h | 5 ++++- 2 files changed, 26 insertions(+), 11 deletions(-) commit 1e21270685ae4c14361dd501da62cdc4be867d4e Author: Keith Busch Date: Tue Mar 22 08:21:07 2022 -0600 crypto: fix crc64 testmgr digest byte order The result is set in little endian, so the expected digest needs to be consistent for big endian machines. Fixes: f3813f4b287e ("crypto: add rocksoft 64b crc guard tag framework") Reported-by: Vasily Gorbik Reported-by: Corentin Labbe Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20220322142107.4581-1-kbusch@kernel.org Signed-off-by: Jens Axboe crypto/testmgr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 6b1f86f8e9c7f9de7ca1cb987b2cf25e99b1ae3a Merge: 9030fb0bb9d6 3a3bae50af5d Author: Linus Torvalds Date: Tue Mar 22 18:26:56 2022 -0700 Merge tag 'folio-5.18b' of git://git.infradead.org/users/willy/pagecache Pull filesystem folio updates from Matthew Wilcox: "Primarily this series converts some of the address_space operations to take a folio instead of a page. Notably: - a_ops->is_partially_uptodate() takes a folio instead of a page and changes the type of the 'from' and 'count' arguments to make it obvious they're bytes. - a_ops->invalidatepage() becomes ->invalidate_folio() and has a similar type change. - a_ops->launder_page() becomes ->launder_folio() - a_ops->set_page_dirty() becomes ->dirty_folio() and adds the address_space as an argument. There are a couple of other misc changes up front that weren't worth separating into their own pull request" * tag 'folio-5.18b' of git://git.infradead.org/users/willy/pagecache: (53 commits) fs: Remove aops ->set_page_dirty fb_defio: Use noop_dirty_folio() fs: Convert __set_page_dirty_no_writeback to noop_dirty_folio fs: Convert __set_page_dirty_buffers to block_dirty_folio nilfs: Convert nilfs_set_page_dirty() to nilfs_dirty_folio() mm: Convert swap_set_page_dirty() to swap_dirty_folio() ubifs: Convert ubifs_set_page_dirty to ubifs_dirty_folio f2fs: Convert f2fs_set_node_page_dirty to f2fs_dirty_node_folio f2fs: Convert f2fs_set_data_page_dirty to f2fs_dirty_data_folio f2fs: Convert f2fs_set_meta_page_dirty to f2fs_dirty_meta_folio afs: Convert afs_dir_set_page_dirty() to afs_dir_dirty_folio() btrfs: Convert extent_range_redirty_for_io() to use folios fs: Convert trivial uses of __set_page_dirty_nobuffers to filemap_dirty_folio btrfs: Convert from set_page_dirty to dirty_folio fscache: Convert fscache_set_page_dirty() to fscache_dirty_folio() fs: Add aops->dirty_folio fs: Remove aops->launder_page orangefs: Convert launder_page to launder_folio nfs: Convert from launder_page to launder_folio fuse: Convert from launder_page to launder_folio ... commit 9030fb0bb9d607908d51f9ee02efdbe01da355ee Merge: 3bf03b9a0839 2a3c4bce3edb Author: Linus Torvalds Date: Tue Mar 22 17:03:12 2022 -0700 Merge tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache Pull folio updates from Matthew Wilcox: - Rewrite how munlock works to massively reduce the contention on i_mmap_rwsem (Hugh Dickins): https://lore.kernel.org/linux-mm/8e4356d-9622-a7f0-b2c-f116b5f2efea@google.com/ - Sort out the page refcount mess for ZONE_DEVICE pages (Christoph Hellwig): https://lore.kernel.org/linux-mm/20220210072828.2930359-1-hch@lst.de/ - Convert GUP to use folios and make pincount available for order-1 pages. (Matthew Wilcox) - Convert a few more truncation functions to use folios (Matthew Wilcox) - Convert page_vma_mapped_walk to use PFNs instead of pages (Matthew Wilcox) - Convert rmap_walk to use folios (Matthew Wilcox) - Convert most of shrink_page_list() to use a folio (Matthew Wilcox) - Add support for creating large folios in readahead (Matthew Wilcox) * tag 'folio-5.18c' of git://git.infradead.org/users/willy/pagecache: (114 commits) mm/damon: minor cleanup for damon_pa_young selftests/vm/transhuge-stress: Support file-backed PMD folios mm/filemap: Support VM_HUGEPAGE for file mappings mm/readahead: Switch to page_cache_ra_order mm/readahead: Align file mappings for non-DAX mm/readahead: Add large folio readahead mm: Support arbitrary THP sizes mm: Make large folios depend on THP mm: Fix READ_ONLY_THP warning mm/filemap: Allow large folios to be added to the page cache mm: Turn can_split_huge_page() into can_split_folio() mm/vmscan: Convert pageout() to take a folio mm/vmscan: Turn page_check_references() into folio_check_references() mm/vmscan: Account large folios correctly mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios mm/vmscan: Free non-shmem folios without splitting them mm/rmap: Constify the rmap_walk_control argument mm/rmap: Convert rmap_walk() to take a folio mm: Turn page_anon_vma() into folio_anon_vma() mm/rmap: Turn page_lock_anon_vma_read() into folio_lock_anon_vma_read() ... commit 2af7e566a8616c278e1d7287ce86cd3900bed943 Author: Saeed Mahameed Date: Tue Mar 22 10:22:24 2022 -0700 net/mlx5e: Fix build warning, detected write beyond size of field When merged with Linus tree, the cited patch below will cause the following build warning: In function 'fortify_memset_chk', inlined from 'mlx5e_xmit_xdp_frame' at drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c:438:3: include/linux/fortify-string.h:242: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] 242 | __write_overflow_field(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix that by grouping the fields to memeset in struct_group() to avoid the false alarm. Fixes: 9ded70fa1d81 ("net/mlx5e: Don't prefill WQEs in XDP SQ in the multi buffer mode") Reported-by: Stephen Rothwell Suggested-by: Stephen Rothwell Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20220322172224.31849-1-saeed@kernel.org Signed-off-by: Jakub Kicinski drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 3 +-- include/linux/mlx5/qp.h | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) commit bbde015227e89f1da21bd3b84523d62c4a445c06 Merge: 6ae1af9ca0e8 6d1a6f464efd Author: Palmer Dabbelt Date: Tue Mar 22 15:48:59 2022 -0700 RISC-V: add support for restartable sequences Add support for RSEQ, restartable sequences, for RISC-V. This also adds support for the related selftests. Note: the selftests require a linker with 3e7bd7f2414 ("RISC-V: Fix linker problems with tls copy relocs."), which was first released in 2.33 (from 2019). * palmer/riscv-rseq: rseq/selftests: Add support for RISC-V RISC-V: Add support for restartable sequence commit b20bdd9cc9740ac1f2138adab25ddd51245c67be Author: Miri Korenblit Date: Tue Mar 22 17:39:43 2022 +0200 iwlwifi: mvm: Don't fail if PPAG isn't supported When we're copying the PPAG table into the cmd structure we're failing if the table doesn't exist in ACPI or is invalid, or if the FW doesn't support PPAG setting etc. This is wrong because those are valid scenarios. Fix this by not failing in those cases. Fixes: e8e10a37c51c ("iwlwifi: acpi: move ppag code from mvm to fw/acpi") Tested-by: Oliver Hartkopp Signed-off-by: Miri Korenblit Signed-off-by: Luca Coelho Acked-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220322173828.fa47f369b717.I6a9c65149c2c3c11337f3a802dff22f514a3a436@changeid Signed-off-by: Jakub Kicinski drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 3bf03b9a0839c9fb06927ae53ebd0f960b19d408 Merge: 3fe2f7446f1e 15423a52cc84 Author: Linus Torvalds Date: Tue Mar 22 16:11:53 2022 -0700 Merge branch 'akpm' (patches from Andrew) Merge updates from Andrew Morton: - A few misc subsystems: kthread, scripts, ntfs, ocfs2, block, and vfs - Most the MM patches which precede the patches in Willy's tree: kasan, pagecache, gup, swap, shmem, memcg, selftests, pagemap, mremap, sparsemem, vmalloc, pagealloc, memory-failure, mlock, hugetlb, userfaultfd, vmscan, compaction, mempolicy, oom-kill, migration, thp, cma, autonuma, psi, ksm, page-poison, madvise, memory-hotplug, rmap, zswap, uaccess, ioremap, highmem, cleanups, kfence, hmm, and damon. * emailed patches from Andrew Morton : (227 commits) mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release() Docs/ABI/testing: add DAMON sysfs interface ABI document Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface selftests/damon: add a test for DAMON sysfs interface mm/damon/sysfs: support DAMOS stats mm/damon/sysfs: support DAMOS watermarks mm/damon/sysfs: support schemes prioritization mm/damon/sysfs: support DAMOS quotas mm/damon/sysfs: support DAMON-based Operation Schemes mm/damon/sysfs: support the physical address space monitoring mm/damon/sysfs: link DAMON for virtual address spaces monitoring mm/damon: implement a minimal stub for sysfs-based DAMON interface mm/damon/core: add number of each enum type values mm/damon/core: allow non-exclusive DAMON start/stop Docs/damon: update outdated term 'regions update interval' Docs/vm/damon/design: update DAMON-Idle Page Tracking interference handling Docs/vm/damon: call low level monitoring primitives the operations mm/damon: remove unnecessary CONFIG_DAMON option mm/damon/paddr,vaddr: remove damon_{p,v}a_{target_valid,set_operations}() mm/damon/dbgfs-test: fix is_target_id() change ... commit 15423a52cc84e23bc11e4a903cd775adc7c6ab00 Author: Xin Hao Date: Tue Mar 22 14:50:00 2022 -0700 mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release() In damon_sysfs_kdamond_release(), we have use container_of() to get "kdamond" pointer, so there no need to get it once again. Link: https://lkml.kernel.org/r/20220303075314.22502-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f968c6a4c66ec25e97ca8801eada103abfe9b295 Author: SeongJae Park Date: Tue Mar 22 14:49:58 2022 -0700 Docs/ABI/testing: add DAMON sysfs interface ABI document This commit adds DAMON sysfs interface ABI document under Documentation/ABI/testing. Link: https://lkml.kernel.org/r/20220228081314.5770-14-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/ABI/testing/sysfs-kernel-mm-damon | 274 ++++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 275 insertions(+) commit b18402726bd10e122c65eecc244ca1cdcb868cc8 Author: SeongJae Park Date: Tue Mar 22 14:49:55 2022 -0700 Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface This commit adds detailed usage of DAMON sysfs interface in the admin-guide document for DAMON. Link: https://lkml.kernel.org/r/20220228081314.5770-13-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/mm/damon/usage.rst | 350 ++++++++++++++++++++++++++- 1 file changed, 344 insertions(+), 6 deletions(-) commit 40184e484def1bea48e6be8c80ea7f992b8df16a Author: SeongJae Park Date: Tue Mar 22 14:49:52 2022 -0700 selftests/damon: add a test for DAMON sysfs interface This commit adds a selftest for DAMON sysfs interface. It tests the functionality of 'nr' files and existence of files in each directory of the hierarchy. Link: https://lkml.kernel.org/r/20220228081314.5770-12-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/damon/Makefile | 1 + tools/testing/selftests/damon/sysfs.sh | 306 +++++++++++++++++++++++++++++++++ 2 files changed, 307 insertions(+) commit 0ac32b8affb5a384253dbb8339bd2d0e91add0b7 Author: SeongJae Park Date: Tue Mar 22 14:49:49 2022 -0700 mm/damon/sysfs: support DAMOS stats This commit makes DAMON sysfs interface supports the DAMOS stats feature. Specifically, this commit adds 'stats' directory under each scheme directory, and update the contents of the files under the directory according to the latest monitoring results, when the user writes special keyword, 'update_schemes_stats' to the 'state' file of the kdamond. As a result, the files hierarchy becomes as below: /sys/kernel/mm/damon/admin │ kdamonds/nr_kdamonds │ │ 0/state,pid │ │ │ contexts/nr_contexts │ │ │ │ 0/operations │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ targets/nr_targets │ │ │ │ │ │ 0/pid_target │ │ │ │ │ │ │ regions/nr_regions │ │ │ │ │ │ │ │ 0/start,end │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ │ schemes/nr_schemes │ │ │ │ │ │ 0/action │ │ │ │ │ │ │ access_pattern/ │ │ │ │ │ │ │ │ sz/min,max │ │ │ │ │ │ │ │ nr_accesses/min,max │ │ │ │ │ │ │ │ age/min,max │ │ │ │ │ │ │ quotas/ms,sz,reset_interval_ms │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil │ │ │ │ │ │ │ watermarks/metric,interval_us,high,mid,low │ │ │ │ │ │ │ stats/ <- NEW DIRECTORY │ │ │ │ │ │ │ │ nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... Link: https://lkml.kernel.org/r/20220228081314.5770-11-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/sysfs.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) commit 1b32234ab087d15f4afcac644dbe036100bcc1c1 Author: SeongJae Park Date: Tue Mar 22 14:49:46 2022 -0700 mm/damon/sysfs: support DAMOS watermarks This commit makes DAMON sysfs interface supports the DAMOS watermarks feature. Specifically, this commit adds 'watermarks' directory under each scheme directory and makes kdamond 'state' file writing respects the contents in the directory. As a result, the files hierarchy becomes as below: /sys/kernel/mm/damon/admin │ kdamonds/nr_kdamonds │ │ 0/state,pid │ │ │ contexts/nr_contexts │ │ │ │ 0/operations │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ targets/nr_targets │ │ │ │ │ │ 0/pid_target │ │ │ │ │ │ │ regions/nr_regions │ │ │ │ │ │ │ │ 0/start,end │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ │ schemes/nr_schemes │ │ │ │ │ │ 0/action │ │ │ │ │ │ │ access_pattern/ │ │ │ │ │ │ │ │ sz/min,max │ │ │ │ │ │ │ │ nr_accesses/min,max │ │ │ │ │ │ │ │ age/min,max │ │ │ │ │ │ │ quotas/ms,sz,reset_interval_ms │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil │ │ │ │ │ │ │ watermarks/ <- NEW DIRECTORY │ │ │ │ │ │ │ │ metric,interval_us,high,mid,lo │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... [sj@kernel.org: fix out-of-bound array access for wmark_metric_strs[]] Link: https://lkml.kernel.org/r/20220301185619.2904-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220228081314.5770-10-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Cc: Colin Ian King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/sysfs.c | 220 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 215 insertions(+), 5 deletions(-) commit 1c78b2bcd240c43690f3766a87bcfa7eb25d37ae Author: SeongJae Park Date: Tue Mar 22 14:49:43 2022 -0700 mm/damon/sysfs: support schemes prioritization This commit makes DAMON sysfs interface supports the DAMOS' regions prioritization weights feature under quotas limitation. Specifically, this commit adds 'weights' directory under each scheme directory and makes kdamond 'state' file writing respects the contents in the directory. /sys/kernel/mm/damon/admin │ kdamonds/nr │ │ 0/state,pid │ │ │ contexts/nr │ │ │ │ 0/operations │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ targets/nr │ │ │ │ │ │ 0/pid │ │ │ │ │ │ │ regions/nr │ │ │ │ │ │ │ │ 0/start,end │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ │ schemes/nr │ │ │ │ │ │ 0/action │ │ │ │ │ │ │ access_pattern/ │ │ │ │ │ │ │ │ sz/min,max │ │ │ │ │ │ │ │ nr_accesses/min,max │ │ │ │ │ │ │ │ age/min,max │ │ │ │ │ │ │ quotas/ms,bytes,reset_interval_ms │ │ │ │ │ │ │ │ weights/ <- NEW DIRECTORY │ │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... Link: https://lkml.kernel.org/r/20220228081314.5770-9-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/sysfs.c | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 149 insertions(+), 3 deletions(-) commit 9bbb820a5bd5f406ae5e0819cc31f2c2e6f4d990 Author: SeongJae Park Date: Tue Mar 22 14:49:40 2022 -0700 mm/damon/sysfs: support DAMOS quotas This commit makes DAMON sysfs interface supports the DAMOS quotas feature. Specifically, this commit adds 'quotas' directory under each scheme directory and makes kdamond 'state' file writing respects the contents in the directory. As a result, the files hierarchy becomes as below: /sys/kernel/mm/damon/admin │ kdamonds/nr_kdamonds │ │ 0/state,pid │ │ │ contexts/nr_contexts │ │ │ │ 0/operations │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ targets/nr_targets │ │ │ │ │ │ 0/pid_target │ │ │ │ │ │ │ regions/nr_regions │ │ │ │ │ │ │ │ 0/start,end │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ │ schemes/nr_schemes │ │ │ │ │ │ 0/action │ │ │ │ │ │ │ access_pattern/ │ │ │ │ │ │ │ │ sz/min,max │ │ │ │ │ │ │ │ nr_accesses/min,max │ │ │ │ │ │ │ │ age/min,max │ │ │ │ │ │ │ quotas/ms,bytes,reset_interval_ms <- NEW DIRECTORY │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... Link: https://lkml.kernel.org/r/20220228081314.5770-8-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/sysfs.c | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 145 insertions(+), 1 deletion(-) commit 7e84b1f8212a038ebeee06de56db7181148fa0cd Author: SeongJae Park Date: Tue Mar 22 14:49:37 2022 -0700 mm/damon/sysfs: support DAMON-based Operation Schemes This commit makes DAMON sysfs interface supports the DAMON-based operation schemes (DAMOS) feature. Specifically, this commit adds 'schemes' directory under each context direcotry, and makes kdamond 'state' file writing respects the contents in the directory. Note that this commit doesn't support all features of DAMOS but only the target access pattern and action feature. Supports for quotas, prioritization, watermarks will follow. As a result, the files hierarchy becomes as below: /sys/kernel/mm/damon/admin │ kdamonds/nr_kdamonds │ │ 0/state,pid │ │ │ contexts/nr_contexts │ │ │ │ 0/operations │ │ │ │ │ monitoring_attrs/intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ targets/nr_targets │ │ │ │ │ │ 0/pid_target │ │ │ │ │ │ │ regions/nr_regions │ │ │ │ │ │ │ │ 0/start,end │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ │ schemes/nr_schemes <- NEW DIRECTORY │ │ │ │ │ │ 0/action │ │ │ │ │ │ │ access_pattern/ │ │ │ │ │ │ │ │ sz/min,max │ │ │ │ │ │ │ │ nr_accesses/min,max │ │ │ │ │ │ │ │ age/min,max │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... Link: https://lkml.kernel.org/r/20220228081314.5770-7-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/sysfs.c | 410 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 410 insertions(+) commit 2031b14ea757361fd5fceb481a6f0c1bf9e3462f Author: SeongJae Park Date: Tue Mar 22 14:49:34 2022 -0700 mm/damon/sysfs: support the physical address space monitoring This commit makes DAMON sysfs interface supports the physical address space monitoring. Specifically, this commit adds support of the initial monitoring regions set feature by adding 'regions' directory under each target directory and makes context operations file to receive 'paddr' in addition to 'vaddr'. As a result, the files hierarchy becomes as below: /sys/kernel/mm/damon/admin │ kdamonds/nr_kdamonds │ │ 0/state,pid │ │ │ contexts/nr_contexts │ │ │ │ 0/operations │ │ │ │ │ monitoring_attrs/ │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ targets/nr_targets │ │ │ │ │ │ 0/pid_target │ │ │ │ │ │ │ regions/nr_regions <- NEW DIRECTORY │ │ │ │ │ │ │ │ 0/start,end │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... Link: https://lkml.kernel.org/r/20220228081314.5770-6-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/sysfs.c | 276 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 271 insertions(+), 5 deletions(-) commit a61ea561c87139992fe32afdee48a6f6b85d824a Author: SeongJae Park Date: Tue Mar 22 14:49:30 2022 -0700 mm/damon/sysfs: link DAMON for virtual address spaces monitoring This commit links the DAMON sysfs interface to DAMON so that users can control DAMON via the interface. In detail, this commit makes writing 'on' to 'state' file constructs DAMON contexts based on values that users have written to relevant sysfs files and start the context. It supports only virtual address spaces monitoring at the moment, though. The files hierarchy of DAMON sysfs interface after this commit is shown below. In the below figure, parents-children relations are represented with indentations, each directory is having ``/`` suffix, and files in each directory are separated by comma (","). /sys/kernel/mm/damon/admin │ kdamonds/nr_kdamonds │ │ 0/state,pid │ │ │ contexts/nr_contexts │ │ │ │ 0/operations │ │ │ │ │ monitoring_attrs/ │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ targets/nr_targets │ │ │ │ │ │ 0/pid_target │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... The usage is straightforward. Writing a number ('N') to each 'nr_*' file makes directories named '0' to 'N-1'. Users can construct DAMON contexts by writing proper values to the files in the straightforward manner and start each kdamond by writing 'on' to 'kdamonds//state'. Link: https://lkml.kernel.org/r/20220228081314.5770-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/sysfs.c | 192 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 189 insertions(+), 3 deletions(-) commit c951cd3b89010c7a4751b9d4ea074007e44851e6 Author: SeongJae Park Date: Tue Mar 22 14:49:27 2022 -0700 mm/damon: implement a minimal stub for sysfs-based DAMON interface DAMON's debugfs-based user interface served very well, so far. However, it unnecessarily depends on debugfs, while DAMON is not aimed to be used for only debugging. Also, the interface receives multiple values via one file. For example, schemes file receives 18 values separated by white spaces. As a result, it is ineffient, hard to be used, and difficult to be extended. Especially, keeping backward compatibility of user space tools is getting only challenging. It would be better to implement another reliable and flexible interface and deprecate the debugfs interface in long term. To this end, this commit implements a stub of a part of the new user interface of DAMON using sysfs. Specifically, this commit implements the sysfs control parts for virtual address space monitoring. More specifically, the idea of the new interface is, using directory hierarchies and making one file for one value. The hierarchy that this commit is introducing is as below. In the below figure, parents-children relations are represented with indentations, each directory is having ``/`` suffix, and files in each directory are separated by comma (","). /sys/kernel/mm/damon/admin │ kdamonds/nr_kdamonds │ │ 0/state,pid │ │ │ contexts/nr_contexts │ │ │ │ 0/operations │ │ │ │ │ monitoring_attrs/ │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ targets/nr_targets │ │ │ │ │ │ 0/pid_target │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... Writing a number to each 'nr' file makes directories of name <0> to in the directory of the 'nr' file. That's all this commit does. Writing proper values to relevant files will construct the DAMON contexts, and writing a special keyword, 'on', to 'state' files for each kdamond will ask DAMON to start the constructed contexts. For a short example, using below commands for monitoring virtual address spaces of a given workload is imaginable: # cd /sys/kernel/mm/damon/admin/ # echo 1 > kdamonds/nr_kdamonds # echo 1 > kdamonds/0/contexts/nr_contexts # echo vaddr > kdamonds/0/contexts/0/operations # echo 1 > kdamonds/0/contexts/0/targets/nr_targets # echo $(pidof ) > kdamonds/0/contexts/0/targets/0/pid_target # echo on > kdamonds/0/state Please note that this commit is implementing only the sysfs part stub as abovely mentioned. This commit doesn't implement the special keywords for 'state' files. Following commits will do that. [jiapeng.chong@linux.alibaba.com: fix missing error code in damon_sysfs_attrs_add_dirs()] Link: https://lkml.kernel.org/r/20220302111120.24984-1-jiapeng.chong@linux.alibaba.com Link: https://lkml.kernel.org/r/20220228081314.5770-4-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Jiapeng Chong Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/Kconfig | 7 + mm/damon/Makefile | 1 + mm/damon/sysfs.c | 1084 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1092 insertions(+) commit 5257f36ec289d544532f2889cbed11abbb06cf0c Author: SeongJae Park Date: Tue Mar 22 14:49:24 2022 -0700 mm/damon/core: add number of each enum type values This commit declares the number of legal values for each DAMON enum types to make traversals of such DAMON enum types easy and safe. Link: https://lkml.kernel.org/r/20220228081314.5770-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Greg Kroah-Hartman Cc: Jonathan Corbet Cc: Shuah Khan Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/damon.h | 4 ++++ 1 file changed, 4 insertions(+) commit 8b9b0d335a345cbc590baa5aa8aa02c467c1e4e8 Author: SeongJae Park Date: Tue Mar 22 14:49:21 2022 -0700 mm/damon/core: allow non-exclusive DAMON start/stop Patch series "Introduce DAMON sysfs interface", v3. Introduction ============ DAMON's debugfs-based user interface (DAMON_DBGFS) served very well, so far. However, it unnecessarily depends on debugfs, while DAMON is not aimed to be used for only debugging. Also, the interface receives multiple values via one file. For example, schemes file receives 18 values. As a result, it is inefficient, hard to be used, and difficult to be extended. Especially, keeping backward compatibility of user space tools is getting only challenging. It would be better to implement another reliable and flexible interface and deprecate DAMON_DBGFS in long term. For the reason, this patchset introduces a sysfs-based new user interface of DAMON. The idea of the new interface is, using directory hierarchies and having one dedicated file for each value. For a short example, users can do the virtual address monitoring via the interface as below: # cd /sys/kernel/mm/damon/admin/ # echo 1 > kdamonds/nr_kdamonds # echo 1 > kdamonds/0/contexts/nr_contexts # echo vaddr > kdamonds/0/contexts/0/operations # echo 1 > kdamonds/0/contexts/0/targets/nr_targets # echo $(pidof ) > kdamonds/0/contexts/0/targets/0/pid_target # echo on > kdamonds/0/state A brief representation of the files hierarchy of DAMON sysfs interface is as below. Childs are represented with indentation, directories are having '/' suffix, and files in each directory are separated by comma. /sys/kernel/mm/damon/admin │ kdamonds/nr_kdamonds │ │ 0/state,pid │ │ │ contexts/nr_contexts │ │ │ │ 0/operations │ │ │ │ │ monitoring_attrs/ │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max │ │ │ │ │ targets/nr_targets │ │ │ │ │ │ 0/pid_target │ │ │ │ │ │ │ regions/nr_regions │ │ │ │ │ │ │ │ 0/start,end │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ │ schemes/nr_schemes │ │ │ │ │ │ 0/action │ │ │ │ │ │ │ access_pattern/ │ │ │ │ │ │ │ │ sz/min,max │ │ │ │ │ │ │ │ nr_accesses/min,max │ │ │ │ │ │ │ │ age/min,max │ │ │ │ │ │ │ quotas/ms,bytes,reset_interval_ms │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil │ │ │ │ │ │ │ watermarks/metric,interval_us,high,mid,low │ │ │ │ │ │ │ stats/nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... Detailed usage of the files will be described in the final Documentation patch of this patchset. Main Difference Between DAMON_DBGFS and DAMON_SYSFS --------------------------------------------------- At the moment, DAMON_DBGFS and DAMON_SYSFS provides same features. One important difference between them is their exclusiveness. DAMON_DBGFS works in an exclusive manner, so that no DAMON worker thread (kdamond) in the system can run concurrently and interfere somehow. For the reason, DAMON_DBGFS asks users to construct all monitoring contexts and start them at once. It's not a big problem but makes the operation a little bit complex and unflexible. For more flexible usage, DAMON_SYSFS moves the responsibility of preventing any possible interference to the admins and work in a non-exclusive manner. That is, users can configure and start contexts one by one. Note that DAMON respects both exclusive groups and non-exclusive groups of contexts, in a manner similar to that of reader-writer locks. That is, if any exclusive monitoring contexts (e.g., contexts that started via DAMON_DBGFS) are running, DAMON_SYSFS does not start new contexts, and vice versa. Future Plan of DAMON_DBGFS Deprecation ====================================== Once this patchset is merged, DAMON_DBGFS development will be frozen. That is, we will maintain it to work as is now so that no users will be break. But, it will not be extended to provide any new feature of DAMON. The support will be continued only until next LTS release. After that, we will drop DAMON_DBGFS. User-space Tooling Compatibility -------------------------------- As DAMON_SYSFS provides all features of DAMON_DBGFS, all user space tooling can move to DAMON_SYSFS. As we will continue supporting DAMON_DBGFS until next LTS kernel release, user space tools would have enough time to move to DAMON_SYSFS. The official user space tool, damo[1], is already supporting both DAMON_SYSFS and DAMON_DBGFS. Both correctness tests[2] and performance tests[3] of DAMON using DAMON_SYSFS also passed. [1] https://github.com/awslabs/damo [2] https://github.com/awslabs/damon-tests/tree/master/corr [3] https://github.com/awslabs/damon-tests/tree/master/perf Sequence of Patches =================== First two patches (patches 1-2) make core changes for DAMON_SYSFS. The first one (patch 1) allows non-exclusive DAMON contexts so that DAMON_SYSFS can work in non-exclusive mode, while the second one (patch 2) adds size of DAMON enum types so that DAMON API users can safely iterate the enums. Third patch (patch 3) implements basic sysfs stub for virtual address spaces monitoring. Note that this implements only sysfs files and DAMON is not linked. Fourth patch (patch 4) links the DAMON_SYSFS to DAMON so that users can control DAMON using the sysfs files. Following six patches (patches 5-10) implements other DAMON features that DAMON_DBGFS supports one by one (physical address space monitoring, DAMON-based operation schemes, schemes quotas, schemes prioritization weights, schemes watermarks, and schemes stats). Following patch (patch 11) adds a simple selftest for DAMON_SYSFS, and the final one (patch 12) documents DAMON_SYSFS. This patch (of 13): To avoid interference between DAMON contexts monitoring overlapping memory regions, damon_start() works in an exclusive manner. That is, damon_start() does nothing bug fails if any context that started by another instance of the function is still running. This makes its usage a little bit restrictive. However, admins could aware each DAMON usage and address such interferences on their own in some cases. This commit hence implements non-exclusive mode of the function and allows the callers to select the mode. Note that the exclusive groups and non-exclusive groups of contexts will respect each other in a manner similar to that of reader-writer locks. Therefore, this commit will not cause any behavioral change to the exclusive groups. Link: https://lkml.kernel.org/r/20220228081314.5770-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220228081314.5770-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Cc: Shuah Khan Cc: David Rientjes Cc: Xin Hao Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/damon.h | 2 +- mm/damon/core.c | 23 +++++++++++++++-------- mm/damon/dbgfs.c | 2 +- mm/damon/reclaim.c | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) commit 4c1f287f8c80268a870d8a51012ac4adf8fcbec5 Author: SeongJae Park Date: Tue Mar 22 14:49:18 2022 -0700 Docs/damon: update outdated term 'regions update interval' Before DAMON is merged in the mainline, the concept of 'regions update interval' has generalized to be used as the time interval for update of any monitoring operations related data structure, but the document has not updated properly. This commit updates the document for better consistency. Link: https://lkml.kernel.org/r/20220222170100.17068-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/mm/damon/usage.rst | 6 +++--- Documentation/vm/damon/design.rst | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) commit 742cc2bfce5a94ad629a3a0bd408ef61c8be2826 Author: SeongJae Park Date: Tue Mar 22 14:49:15 2022 -0700 Docs/vm/damon/design: update DAMON-Idle Page Tracking interference handling In DAMON's early development stage before it be merged in the mainline, it was first designed to work exclusively with Idle page tracking to avoid any interference between each other. Later, but still before be merged in the mainline, because Idle page tracking is fully under the control of sysadmins, we made the resolving of conflict as the responsibility of sysadmins. The document is not updated for the change, though. This commit updates the document for that. Link: https://lkml.kernel.org/r/20220222170100.17068-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/damon/design.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 561f4fc4972443f1273f7abbd8270fd949e6584b Author: SeongJae Park Date: Tue Mar 22 14:49:12 2022 -0700 Docs/vm/damon: call low level monitoring primitives the operations Patch series "Docs/damon: Update documents for better consistency". Some of DAMON document are not properly updated for latest version. This patchset updates such parts. This patch (of 3): DAMON code calls the low level monitoring primitives implementations the monitoring operations. The documentation would have no problem at still calling those primitives implementation because there is no real difference in the concepts, but making it more consistent with the code would make it better. This commit therefore convert sentences in the doc specifically pointing the implementations of the primitives to call it monitoring operations. Link: https://lkml.kernel.org/r/20220222170100.17068-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220222170100.17068-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/vm/damon/design.rst | 24 ++++++++++++------------ Documentation/vm/damon/faq.rst | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) commit 3213a3c10fc81e8dd441b74b6555bb9cb287f898 Author: tangmeng Date: Tue Mar 22 14:49:09 2022 -0700 mm/damon: remove unnecessary CONFIG_DAMON option In mm/Makefile has: obj-$(CONFIG_DAMON) += damon/ So that we don't need 'obj-$(CONFIG_DAMON) :=' in mm/damon/Makefile, delete it from mm/damon/Makefile. Link: https://lkml.kernel.org/r/20220221065255.19991-1-tangmeng@uniontech.com Signed-off-by: tangmeng Cc: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 851040566a008f7248cb754d5bb9a3e34f2effe5 Author: SeongJae Park Date: Tue Mar 22 14:49:07 2022 -0700 mm/damon/paddr,vaddr: remove damon_{p,v}a_{target_valid,set_operations}() Because DAMON debugfs interface and DAMON-based proactive reclaim are now using monitoring operations via registration mechanism, damon_{p,v}a_{target_valid,set_operations}() functions have no user. This commit clean them up. Link: https://lkml.kernel.org/r/20220215184603.1479-9-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/damon.h | 10 ---------- mm/damon/paddr.c | 20 +------------------- mm/damon/vaddr.c | 15 +-------------- 3 files changed, 2 insertions(+), 43 deletions(-) commit 999b9467974f75aae96b285337a77c098c9f1e07 Author: SeongJae Park Date: Tue Mar 22 14:49:04 2022 -0700 mm/damon/dbgfs-test: fix is_target_id() change DAMON kunit tests for DAMON debugfs interface fails because it still assumes setting empty monitoring operations makes DAMON debugfs interface believe the target of the context don't have pid. This commit fixes the kunit test fails by explicitly setting the context's monitoring operations with the operations for the physical address space, which let debugfs knows the target will not have pid. Link: https://lkml.kernel.org/r/20220215184603.1479-8-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/dbgfs-test.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 4a20865b0744c987655472425203345d970da7a0 Author: SeongJae Park Date: Tue Mar 22 14:49:01 2022 -0700 mm/damon/dbgfs: use operations id for knowing if the target has pid DAMON debugfs interface depends on monitoring operations for virtual address spaces because it knows if the target has pid or not by seeing if the context is configured to use one of the virtual address space monitoring operation functions. We can replace that check with 'enum damon_ops_id' now, to make it independent. This commit makes the change. Link: https://lkml.kernel.org/r/20220215184603.1479-7-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/dbgfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit da7aaca05f4f88f5e723f315771808a629b3d32b Author: SeongJae Park Date: Tue Mar 22 14:48:58 2022 -0700 mm/damon/dbgfs: use damon_select_ops() instead of damon_{v,p}a_set_operations() This commit makes DAMON debugfs interface to select the registered monitoring operations for the physical address space or virtual address spaces depending on user requests instead of setting it on its own. Note that DAMON debugfs interface is still dependent to DAMON_VADDR with this change, because it is also using its symbol, 'damon_va_target_valid'. Link: https://lkml.kernel.org/r/20220215184603.1479-6-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/dbgfs.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) commit 4d69c3457821100a39fa8c6e0c23ed910bb6c29d Author: SeongJae Park Date: Tue Mar 22 14:48:55 2022 -0700 mm/damon/reclaim: use damon_select_ops() instead of damon_{v,p}a_set_operations() This commit makes DAMON_RECLAIM to select the registered monitoring operations for the physical address space instead of setting it on its own. This allows DAMON_RECLAIM be independent of DAMON_PADDR, but leave the dependency as is, because it's the only one monitoring operations it use, and therefore it makes no sense to build DAMON_RECLAIM without DAMON_PADDR. Link: https://lkml.kernel.org/r/20220215184603.1479-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/reclaim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 7752925fbc081f31bef6a410fb8a06830daaf460 Author: SeongJae Park Date: Tue Mar 22 14:48:52 2022 -0700 mm/damon/paddr,vaddr: register themselves to DAMON in subsys_initcall This commit makes the monitoring operations for the physical address space and virtual address spaces register themselves to DAMON in the subsys_initcall step. Later, in-kernel DAMON user code can use them via damon_select_ops() without have to unnecessarily depend on all possible monitoring operations implementations. Link: https://lkml.kernel.org/r/20220215184603.1479-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/paddr.c | 20 ++++++++++++++++++++ mm/damon/vaddr.c | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) commit 9f7b053a0f6121f89e00d1688bfca0bf278caa25 Author: SeongJae Park Date: Tue Mar 22 14:48:49 2022 -0700 mm/damon: let monitoring operations can be registered and selected In-kernel DAMON user code like DAMON debugfs interface should set 'struct damon_operations' of its 'struct damon_ctx' on its own. Therefore, the client code should depend on all supporting monitoring operations implementations that it could use. For example, DAMON debugfs interface depends on both vaddr and paddr, while some of the users are not always interested in both. To minimize such unnecessary dependencies, this commit makes the monitoring operations can be registered by implementing code and then dynamically selected by the user code without build-time dependency. Link: https://lkml.kernel.org/r/20220215184603.1479-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Xin Hao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/damon.h | 18 ++++++++++++++ mm/damon/core.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) commit f7d911c39cbbb88d625216a0cfd0517a3047c46e Author: SeongJae Park Date: Tue Mar 22 14:48:46 2022 -0700 mm/damon: rename damon_primitives to damon_operations Patch series "Allow DAMON user code independent of monitoring primitives". In-kernel DAMON user code is required to configure the monitoring context (struct damon_ctx) with proper monitoring primitives (struct damon_primitive). This makes the user code dependent to all supporting monitoring primitives. For example, DAMON debugfs interface depends on both DAMON_VADDR and DAMON_PADDR, though some users have interest in only one use case. As more monitoring primitives are introduced, the problem will be bigger. To minimize such unnecessary dependency, this patchset makes monitoring primitives can be registered by the implemnting code and later dynamically searched and selected by the user code. In addition to that, this patchset renames monitoring primitives to monitoring operations, which is more easy to intuitively understand what it means and how it would be structed. This patch (of 8): DAMON has a set of callback functions called monitoring primitives and let it can be configured with various implementations for easy extension for different address spaces and usages. However, the word 'primitive' is not so explicit. Meanwhile, many other structs resembles similar purpose calls themselves 'operations'. To make the code easier to be understood, this commit renames 'damon_primitives' to 'damon_operations' before it is too late to rename. Link: https://lkml.kernel.org/r/20220215184603.1479-1-sj@kernel.org Link: https://lkml.kernel.org/r/20220215184603.1479-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Xin Hao Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/damon.h | 48 +++++++++++------------ mm/damon/Kconfig | 12 +++--- mm/damon/Makefile | 4 +- mm/damon/core.c | 65 ++++++++++++++++--------------- mm/damon/dbgfs-test.h | 2 +- mm/damon/dbgfs.c | 10 ++--- mm/damon/{prmtv-common.c => ops-common.c} | 2 +- mm/damon/{prmtv-common.h => ops-common.h} | 0 mm/damon/paddr.c | 22 +++++------ mm/damon/reclaim.c | 2 +- mm/damon/vaddr-test.h | 2 +- mm/damon/vaddr.c | 22 +++++------ 12 files changed, 96 insertions(+), 95 deletions(-) commit 242e10a09f2637f61356a739ea9ed69235a47ce5 Author: Baolin Wang Date: Tue Mar 22 14:48:43 2022 -0700 mm/damon: remove redundant page validation It will never get a NULL page by pte_page() as discussed in thread [1], thus remove the redundant page validation to fix below Smatch static checker warning. mm/damon/vaddr.c:405 damon_hugetlb_mkold() warn: 'page' can't be NULL. [1] https://lore.kernel.org/linux-mm/20220106091200.GA14564@kili/ Link: https://lkml.kernel.org/r/6d32f7d201b8970d53f51b6c5717d472aed2987c.1642386715.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reported-by: Dan Carpenter Reviewed-by: SeongJae Park Acked-by: David Rientjes Acked-by: Souptick Joarder Reviewed-by: Miaohe Lin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/vaddr.c | 6 ------ 1 file changed, 6 deletions(-) commit 1971bd630452e943380429336a851c55b027eed1 Author: SeongJae Park Date: Tue Mar 22 14:48:40 2022 -0700 mm/damon: remove the target id concept DAMON asks each monitoring target ('struct damon_target') to have one 'unsigned long' integer called 'id', which should be unique among the targets of same monitoring context. Meaning of it is, however, totally up to the monitoring primitives that registered to the monitoring context. For example, the virtual address spaces monitoring primitives treats the id as a 'struct pid' pointer. This makes the code flexible, but ugly, not well-documented, and type-unsafe[1]. Also, identification of each target can be done via its index. For the reason, this commit removes the concept and uses clear type definition. For now, only 'struct pid' pointer is used for the virtual address spaces monitoring. If DAMON is extended in future so that we need to put another identifier field in the struct, we will use a union for such primitives-dependent fields and document which primitives are using which type. [1] https://lore.kernel.org/linux-mm/20211013154535.4aaeaaf9d0182922e405dd1e@linux-foundation.org/ Link: https://lkml.kernel.org/r/20211230100723.2238-5-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/damon.h | 11 ++-- mm/damon/core-test.h | 18 +++--- mm/damon/core.c | 4 +- mm/damon/dbgfs-test.h | 63 ++++++++------------- mm/damon/dbgfs.c | 152 ++++++++++++++++++++++++++++++-------------------- mm/damon/reclaim.c | 3 +- mm/damon/vaddr-test.h | 6 +- mm/damon/vaddr.c | 4 +- 8 files changed, 133 insertions(+), 128 deletions(-) commit 436428255d5981e49ff015fc8e398ecf2ba10c24 Author: SeongJae Park Date: Tue Mar 22 14:48:37 2022 -0700 mm/damon/core: move damon_set_targets() into dbgfs damon_set_targets() function is defined in the core for general use cases, but called from only dbgfs. Also, because the function is for general use cases, dbgfs does additional handling of pid type target id case. To make the situation simpler, this commit moves the function into dbgfs and makes it to do the pid type case handling on its own. Link: https://lkml.kernel.org/r/20211230100723.2238-4-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/damon.h | 2 -- mm/damon/core-test.h | 5 ++++- mm/damon/core.c | 32 ------------------------------- mm/damon/dbgfs-test.h | 14 +++++++------- mm/damon/dbgfs.c | 53 +++++++++++++++++++++++++++++++++++++++------------ 5 files changed, 52 insertions(+), 54 deletions(-) commit 8041c87b915b9b7ecb2870f1c529a75aaa2483be Author: SeongJae Park Date: Tue Mar 22 14:48:34 2022 -0700 Docs/admin-guide/mm/damon/usage: update for changed initail_regions file input A previous commit made init_regions debugfs file to use target index instead of target id for specifying the target of the init regions. This commit updates the usage document to reflect the change. Link: https://lkml.kernel.org/r/20211230100723.2238-3-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/mm/damon/usage.rst | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) commit 144760f8e0c3c0c9fe1b78e178a4d3d300ebec7f Author: SeongJae Park Date: Tue Mar 22 14:48:31 2022 -0700 mm/damon/dbgfs/init_regions: use target index instead of target id Patch series "Remove the type-unclear target id concept". DAMON asks each monitoring target ('struct damon_target') to have one 'unsigned long' integer called 'id', which should be unique among the targets of same monitoring context. Meaning of it is, however, totally up to the monitoring primitives that registered to the monitoring context. For example, the virtual address spaces monitoring primitives treats the id as a 'struct pid' pointer. This makes the code flexible but ugly, not well-documented, and type-unsafe[1]. Also, identification of each target can be done via its index. For the reason, this patchset removes the concept and uses clear type definition. [1] https://lore.kernel.org/linux-mm/20211013154535.4aaeaaf9d0182922e405dd1e@linux-foundation.org/ This patch (of 4): Target id is a 'unsigned long' data, which can be interpreted differently by each monitoring primitives. For example, it means 'struct pid *' for the virtual address spaces monitoring, while it means nothing but an integer to be displayed to debugfs interface users for the physical address space monitoring. It's flexible but makes code ugly and type-unsafe[1]. To be prepared for eventual removal of the concept, this commit removes a use case of the concept in 'init_regions' debugfs file handling. In detail, this commit replaces use of the id with the index of each target in the context's targets list. [1] https://lore.kernel.org/linux-mm/20211013154535.4aaeaaf9d0182922e405dd1e@linux-foundation.org/ Link: https://lkml.kernel.org/r/20211230100723.2238-1-sj@kernel.org Link: https://lkml.kernel.org/r/20211230100723.2238-2-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/damon/dbgfs-test.h | 20 ++++++++++---------- mm/damon/dbgfs.c | 25 ++++++++++++------------- 2 files changed, 22 insertions(+), 23 deletions(-) commit d0977efab8ffb13c092c92dba0af22edcb754571 Author: Miaohe Lin Date: Tue Mar 22 14:48:28 2022 -0700 mm/hmm.c: remove unneeded local variable ret The local variable ret is always 0. Remove it to make code more tight. Link: https://lkml.kernel.org/r/20220125124833.39718-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/hmm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 737b6a10ac19e41877aa1911bf6b361a72a88ad9 Author: Marco Elver Date: Tue Mar 22 14:48:25 2022 -0700 kfence: allow use of a deferrable timer Allow the use of a deferrable timer, which does not force CPU wake-ups when the system is idle. A consequence is that the sample interval becomes very unpredictable, to the point that it is not guaranteed that the KFENCE KUnit test still passes. Nevertheless, on power-constrained systems this may be preferable, so let's give the user the option should they accept the above trade-off. Link: https://lkml.kernel.org/r/20220308141415.3168078-1-elver@google.com Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/dev-tools/kfence.rst | 12 ++++++++++++ lib/Kconfig.kfence | 12 ++++++++++++ mm/kfence/core.c | 15 +++++++++++++-- 3 files changed, 37 insertions(+), 2 deletions(-) commit 3cb1c9620eeeb67c614c0732a35861b0b1efdc53 Author: Peng Liu Date: Tue Mar 22 14:48:22 2022 -0700 kfence: test: try to avoid test_gfpzero trigger rcu_stall When CONFIG_KFENCE_NUM_OBJECTS is set to a big number, kfence kunit-test-case test_gfpzero will eat up nearly all the CPU's resources and rcu_stall is reported as the following log which is cut from a physical server. rcu: INFO: rcu_sched self-detected stall on CPU rcu: 68-....: (14422 ticks this GP) idle=6ce/1/0x4000000000000002 softirq=592/592 fqs=7500 (t=15004 jiffies g=10677 q=20019) Task dump for CPU 68: task:kunit_try_catch state:R running task stack: 0 pid: 9728 ppid: 2 flags:0x0000020a Call trace: dump_backtrace+0x0/0x1e4 show_stack+0x20/0x2c sched_show_task+0x148/0x170 ... rcu_sched_clock_irq+0x70/0x180 update_process_times+0x68/0xb0 tick_sched_handle+0x38/0x74 ... gic_handle_irq+0x78/0x2c0 el1_irq+0xb8/0x140 kfree+0xd8/0x53c test_alloc+0x264/0x310 [kfence_test] test_gfpzero+0xf4/0x840 [kfence_test] kunit_try_run_case+0x48/0x20c kunit_generic_run_threadfn_adapter+0x28/0x34 kthread+0x108/0x13c ret_from_fork+0x10/0x18 To avoid rcu_stall and unacceptable latency, a schedule point is added to test_gfpzero. Link: https://lkml.kernel.org/r/20220309083753.1561921-4-liupeng256@huawei.com Signed-off-by: Peng Liu Reviewed-by: Marco Elver Tested-by: Brendan Higgins Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Wang Kefeng Cc: Daniel Latypov Cc: David Gow Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kfence/kfence_test.c | 1 + 1 file changed, 1 insertion(+) commit bdd015f7b71b92c2e4ecabac689642cc72553e04 Author: Peng Liu Date: Tue Mar 22 14:48:19 2022 -0700 kunit: make kunit_test_timeout compatible with comment In function kunit_test_timeout, it is declared "300 * MSEC_PER_SEC" represent 5min. However, it is wrong when dealing with arm64 whose default HZ = 250, or some other situations. Use msecs_to_jiffies to fix this, and kunit_test_timeout will work as desired. Link: https://lkml.kernel.org/r/20220309083753.1561921-3-liupeng256@huawei.com Fixes: 5f3e06208920 ("kunit: test: add support for test abort") Signed-off-by: Peng Liu Reviewed-by: Marco Elver Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins Tested-by: Brendan Higgins Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Wang Kefeng Cc: David Gow Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/kunit/try-catch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit adf505457032c11b79b5a7c277c62ff5d61b17c2 Author: Peng Liu Date: Tue Mar 22 14:48:16 2022 -0700 kunit: fix UAF when run kfence test case test_gfpzero Patch series "kunit: fix a UAF bug and do some optimization", v2. This series is to fix UAF (use after free) when running kfence test case test_gfpzero, which is time costly. This UAF bug can be easily triggered by setting CONFIG_KFENCE_NUM_OBJECTS = 65535. Furthermore, some optimization for kunit tests has been done. This patch (of 3): Kunit will create a new thread to run an actual test case, and the main process will wait for the completion of the actual test thread until overtime. The variable "struct kunit test" has local property in function kunit_try_catch_run, and will be used in the test case thread. Task kunit_try_catch_run will free "struct kunit test" when kunit runs overtime, but the actual test case is still run and an UAF bug will be triggered. The above problem has been both observed in a physical machine and qemu platform when running kfence kunit tests. The problem can be triggered when setting CONFIG_KFENCE_NUM_OBJECTS = 65535. Under this setting, the test case test_gfpzero will cost hours and kunit will run to overtime. The follows show the panic log. BUG: unable to handle page fault for address: ffffffff82d882e9 Call Trace: kunit_log_append+0x58/0xd0 ... test_alloc.constprop.0.cold+0x6b/0x8a [kfence_test] test_gfpzero.cold+0x61/0x8ab [kfence_test] kunit_try_run_case+0x4c/0x70 kunit_generic_run_threadfn_adapter+0x11/0x20 kthread+0x166/0x190 ret_from_fork+0x22/0x30 Kernel panic - not syncing: Fatal exception Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014 To solve this problem, the test case thread should be stopped when the kunit frame runs overtime. The stop signal will send in function kunit_try_catch_run, and test_gfpzero will handle it. Link: https://lkml.kernel.org/r/20220309083753.1561921-1-liupeng256@huawei.com Link: https://lkml.kernel.org/r/20220309083753.1561921-2-liupeng256@huawei.com Signed-off-by: Peng Liu Reviewed-by: Marco Elver Reviewed-by: Brendan Higgins Tested-by: Brendan Higgins Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Wang Kefeng Cc: Daniel Latypov Cc: David Gow Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds lib/kunit/try-catch.c | 1 + mm/kfence/kfence_test.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) commit b33f778bba5ef3f76fe6708c611346c1ea03acd4 Author: Tianchen Ding Date: Tue Mar 22 14:48:13 2022 -0700 kfence: alloc kfence_pool after system startup Allow enabling KFENCE after system startup by allocating its pool via the page allocator. This provides the flexibility to enable KFENCE even if it wasn't enabled at boot time. Link: https://lkml.kernel.org/r/20220307074516.6920-3-dtcccc@linux.alibaba.com Signed-off-by: Tianchen Ding Reviewed-by: Marco Elver Tested-by: Peng Liu Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kfence/core.c | 111 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 90 insertions(+), 21 deletions(-) commit 698361bca2d59fd29d46c757163854454df477f1 Author: Tianchen Ding Date: Tue Mar 22 14:48:10 2022 -0700 kfence: allow re-enabling KFENCE after system startup Patch series "provide the flexibility to enable KFENCE", v3. If CONFIG_CONTIG_ALLOC is not supported, we fallback to try alloc_pages_exact(). Allocating pages in this way has limits about MAX_ORDER (default 11). So we will not support allocating kfence pool after system startup with a large KFENCE_NUM_OBJECTS. When handling failures in kfence_init_pool_late(), we pair free_pages_exact() to alloc_pages_exact() for compatibility consideration, though it actually does the same as free_contig_range(). This patch (of 2): If once KFENCE is disabled by: echo 0 > /sys/module/kfence/parameters/sample_interval KFENCE could never be re-enabled until next rebooting. Allow re-enabling it by writing a positive num to sample_interval. Link: https://lkml.kernel.org/r/20220307074516.6920-1-dtcccc@linux.alibaba.com Link: https://lkml.kernel.org/r/20220307074516.6920-2-dtcccc@linux.alibaba.com Signed-off-by: Tianchen Ding Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kfence/core.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) commit 56eb8e9416e85ca7db4550b58e93ac88d7993c13 Author: tangmeng Date: Tue Mar 22 14:48:07 2022 -0700 mm/kfence: remove unnecessary CONFIG_KFENCE option In mm/Makefile has: obj-$(CONFIG_KFENCE) += kfence/ So that we don't need 'obj-$(CONFIG_KFENCE) :=' in mm/kfence/Makefile, delete it from mm/kfence/Makefile. Link: https://lkml.kernel.org/r/20220221065525.21344-1-tangmeng@uniontech.com Signed-off-by: tangmeng Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitriy Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/kfence/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 597da28e1abb4ad9f7255cbb57354158fd853e19 Author: Dr. David Alan Gilbert Date: Tue Mar 22 14:48:04 2022 -0700 mm/page_table_check.c: use strtobool for param parsing Use strtobool rather than open coding "on" and "off" parsing. Link: https://lkml.kernel.org/r/20220227181038.126926-1-linux@treblig.org Signed-off-by: Dr. David Alan Gilbert Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_table_check.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) commit 7a3f2263d72d5055a56bc52ce97f5ded7853a41e Author: Miaohe Lin Date: Tue Mar 22 14:48:01 2022 -0700 mm/highmem: remove unnecessary done label Remove unnecessary done label to simplify the code. Link: https://lkml.kernel.org/r/20220126092542.64659-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Reviewed-by: David Hildenbrand Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/highmem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit d7ca25c53e25a9a628aaa19b5a031f115d8c353d Author: Ira Weiny Date: Tue Mar 22 14:47:58 2022 -0700 highmem: document kunmap_local() Some users of kmap() add an offset to the kmap() address to be used during the mapping. When converting to kmap_local_page() the base address does not need to be stored because any address within the page can be used in kunmap_local(). However, this was not clear from the documentation and cause some questions.[1] Document that any address in the page can be used in kunmap_local() to clarify this for future users. [1] https://lore.kernel.org/lkml/20211213154543.GM3538886@iweiny-DESK2.sc.intel.com/ [ira.weiny@intel.com: updates per Christoph] Link: https://lkml.kernel.org/r/20220124182138.816693-1-ira.weiny@intel.com Link: https://lkml.kernel.org/r/20220124013045.806718-1-ira.weiny@intel.com Signed-off-by: Ira Weiny Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/highmem-internal.h | 10 ++++++++++ 1 file changed, 10 insertions(+) commit be4893d92b6b426357978ed955190c0ead23a4b1 Author: Vlastimil Babka Date: Tue Mar 22 14:47:55 2022 -0700 mm/early_ioremap: declare early_memremap_pgprot_adjust() The mm/ directory can almost fully be built with W=1, which would help in local development. One remaining issue is missing prototype for early_memremap_pgprot_adjust(). Thus add a declaration for this function. Use mm/internal.h instead of asm/early_ioremap.h to avoid missing type definitions and unnecessary exposure. Link: https://lkml.kernel.org/r/20220314165724.16071-2-vbabka@suse.cz Signed-off-by: Vlastimil Babka Cc: Mel Gorman Cc: Matthew Wilcox Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/early_ioremap.c | 1 + mm/internal.h | 6 ++++++ 2 files changed, 7 insertions(+) commit 05fe3c103f7e6b8b4fca8a7001dfc9ed4628085b Author: Randy Dunlap Date: Tue Mar 22 14:47:52 2022 -0700 mm/usercopy: return 1 from hardened_usercopy __setup() handler __setup() handlers should return 1 if the command line option is handled and 0 if not (or maybe never return 0; it just pollutes init's environment). This prevents: Unknown kernel command line parameters \ "BOOT_IMAGE=/boot/bzImage-517rc5 hardened_usercopy=off", will be \ passed to user space. Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc5 hardened_usercopy=off or hardened_usercopy=on but when "hardened_usercopy=foo" is used, there is no Unknown kernel command line parameter. Return 1 to indicate that the boot option has been handled. Print a warning if strtobool() returns an error on the option string, but do not mark this as in unknown command line option and do not cause init's environment to be polluted with this string. Link: https://lkml.kernel.org/r/20220222034249.14795-1-rdunlap@infradead.org Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Fixes: b5cb15d9372ab ("usercopy: Allow boot cmdline disabling of hardening") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Acked-by: Chris von Recklinghausen Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/usercopy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit ad7489d5262d2aa775b5e5a1782793925fa90065 Author: Christophe Leroy Date: Tue Mar 22 14:47:49 2022 -0700 mm: uninline copy_overflow() While building a small config with CONFIG_CC_OPTIMISE_FOR_SIZE, I ended up with more than 50 times the following function in vmlinux because GCC doesn't honor the 'inline' keyword: c00243bc : c00243bc: 94 21 ff f0 stwu r1,-16(r1) c00243c0: 7c 85 23 78 mr r5,r4 c00243c4: 7c 64 1b 78 mr r4,r3 c00243c8: 3c 60 c0 62 lis r3,-16286 c00243cc: 7c 08 02 a6 mflr r0 c00243d0: 38 63 5e e5 addi r3,r3,24293 c00243d4: 90 01 00 14 stw r0,20(r1) c00243d8: 4b ff 82 45 bl c001c61c <__warn_printk> c00243dc: 0f e0 00 00 twui r0,0 c00243e0: 80 01 00 14 lwz r0,20(r1) c00243e4: 38 21 00 10 addi r1,r1,16 c00243e8: 7c 08 03 a6 mtlr r0 c00243ec: 4e 80 00 20 blr With -Winline, GCC tells: /include/linux/thread_info.h:212:20: warning: inlining failed in call to 'copy_overflow': call is unlikely and code size would grow [-Winline] copy_overflow() is a non conditional warning called by check_copy_size() on an error path. check_copy_size() have to remain inlined in order to benefit from constant folding, but copy_overflow() is not worth inlining. Uninline the warning when CONFIG_BUG is selected. When CONFIG_BUG is not selected, WARN() does nothing so skip it. This reduces the size of vmlinux by almost 4kbytes. Link: https://lkml.kernel.org/r/e1723b9cfa924bcefcd41f69d0025b38e4c9364e.1644819985.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Cc: David Laight Cc: Anshuman Khandual Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/thread_info.h | 5 ++++- mm/maccess.c | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) commit 6eada26ffc80bfe1f2db088be0c44ec82b5cd3dc Author: Christophe Leroy Date: Tue Mar 22 14:47:46 2022 -0700 mm: remove usercopy_warn() Users of usercopy_warn() were removed by commit 53944f171a89 ("mm: remove HARDENED_USERCOPY_FALLBACK") Remove it. Link: https://lkml.kernel.org/r/5f26643fc70b05f8455b60b99c30c17d635fa640.1644231910.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Reviewed-by: Miaohe Lin Reviewed-by: Stephen Kitt Reviewed-by: Muchun Song Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/uaccess.h | 2 -- mm/usercopy.c | 11 ----------- 2 files changed, 13 deletions(-) commit cb325ddde5616219848ac0e100a781919a0ce55b Author: Maciej S. Szmigiero Date: Tue Mar 22 14:47:43 2022 -0700 mm/zswap.c: allow handling just same-value filled pages Zswap has an ability to efficiently store same-value filled pages, which can be turned on and off using the "same_filled_pages_enabled" parameter. However, there is currently no way to enable just this (lightweight) functionality, while not making use of the whole compressed page storage machinery. Add a "non_same_filled_pages_enabled" parameter which allows disabling handling of pages that aren't same-value filled. This way zswap can be run in such lightweight same-value filled pages only mode. Link: https://lkml.kernel.org/r/7dbafa963e8bab43608189abbe2067f4b9287831.1641247624.git.maciej.szmigiero@oracle.com Signed-off-by: Maciej S. Szmigiero Cc: Seth Jennings Cc: Dan Streetman Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/mm/zswap.rst | 22 +++++++++++++++++++--- mm/zswap.c | 15 ++++++++++++++- 2 files changed, 33 insertions(+), 4 deletions(-) commit bd55b0c2d64e84a75575f548a33a3dfecc135b65 Author: Hugh Dickins Date: Tue Mar 22 14:47:40 2022 -0700 mm/thp: ClearPageDoubleMap in first page_add_file_rmap() PageDoubleMap is maintained differently for anon and for shmem+file: the shmem+file one was never cleared, because a safe place to do so could not be found; so it would blight future use of the cached hugepage until evicted. See https://lore.kernel.org/lkml/1571938066-29031-1-git-send-email-yang.shi@linux.alibaba.com/ But page_add_file_rmap() does provide a safe place to do so (though later than one might wish): allowing testing to return to an initial state without a damaging drop_caches. Link: https://lkml.kernel.org/r/61c5cf99-a962-9a25-597a-53ab1bd8fbc0@google.com Fixes: 9a73f61bdb8a ("thp, mlock: do not mlock PTE-mapped file huge pages") Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: "Kirill A. Shutemov" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/rmap.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit 734c15700cdf9062ae98d8b131c6fe873dfad26d Author: Oscar Salvador Date: Tue Mar 22 14:47:37 2022 -0700 mm: only re-generate demotion targets when a numa node changes its N_CPU state Abhishek reported that after patch [1], hotplug operations are taking roughly double the expected time. [2] The reason behind is that the CPU callbacks that migrate_on_reclaim_init() sets always call set_migration_target_nodes() whenever a CPU is brought up/down. But we only care about numa nodes going from having cpus to become cpuless, and vice versa, as that influences the demotion_target order. We do already have two CPU callbacks (vmstat_cpu_online() and vmstat_cpu_dead()) that check exactly that, so get rid of the CPU callbacks in migrate_on_reclaim_init() and only call set_migration_target_nodes() from vmstat_cpu_{dead,online}() whenever a numa node change its N_CPU state. [1] https://lore.kernel.org/linux-mm/20210721063926.3024591-2-ying.huang@intel.com/ [2] https://lore.kernel.org/linux-mm/eb438ddd-2919-73d4-bd9f-b7eecdd9577a@linux.vnet.ibm.com/ [osalvador@suse.de: add feedback from Huang Ying] Link: https://lkml.kernel.org/r/20220314150945.12694-1-osalvador@suse.de Link: https://lkml.kernel.org/r/20220310120749.23077-1-osalvador@suse.de Fixes: 884a6e5d1f93b ("mm/migrate: update node demotion order on hotplug events") Signed-off-by: Oscar Salvador Reviewed-by: Baolin Wang Tested-by: Baolin Wang Reported-by: Abhishek Goel Cc: Dave Hansen Cc: "Huang, Ying" Cc: Abhishek Goel Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/migrate.h | 8 ++++++++ mm/migrate.c | 47 ++++++++++------------------------------------- mm/vmstat.c | 13 ++++++++++++- 3 files changed, 30 insertions(+), 38 deletions(-) commit 2aa065f7afb28aabb475cc27f24cb18c5141173d Author: David Hildenbrand Date: Tue Mar 22 14:47:34 2022 -0700 drivers/base/memory: clarify adding and removing of memory blocks Let's make it clearer at which places we actually add and remove memory blocks -- streamlining the terminology -- and highlight which memory block start out online and which start out as offline. * rename add_memory_block -> add_boot_memory_block * rename init_memory_block -> add_memory_block * rename unregister_memory -> remove_memory_block * rename register_memory -> __add_memory_block * add add_hotplug_memory_block * mark add_boot_memory_block with __init (suggested by Oscar) __add_memory_block() is a pure helper for add_memory_block(), remove the somewhat obvious comment. Link: https://lkml.kernel.org/r/20220221154531.11382-1-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Greg Kroah-Hartman Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds drivers/base/memory.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) commit 395f6081bad49f9c54abafebab49ee23aa985bbd Author: David Hildenbrand Date: Tue Mar 22 14:47:31 2022 -0700 drivers/base/memory: determine and store zone for single-zone memory blocks test_pages_in_a_zone() is just another nasty PFN walker that can easily stumble over ZONE_DEVICE memory ranges falling into the same memory block as ordinary system RAM: the memmap of parts of these ranges might possibly be uninitialized. In fact, we observed (on an older kernel) with UBSAN: UBSAN: Undefined behaviour in ./include/linux/mm.h:1133:50 index 7 is out of range for type 'zone [5]' CPU: 121 PID: 35603 Comm: read_all Kdump: loaded Tainted: [...] Hardware name: Dell Inc. PowerEdge R7425/08V001, BIOS 1.12.2 11/15/2019 Call Trace: dump_stack+0x9a/0xf0 ubsan_epilogue+0x9/0x7a __ubsan_handle_out_of_bounds+0x13a/0x181 test_pages_in_a_zone+0x3c4/0x500 show_valid_zones+0x1fa/0x380 dev_attr_show+0x43/0xb0 sysfs_kf_seq_show+0x1c5/0x440 seq_read+0x49d/0x1190 vfs_read+0xff/0x300 ksys_read+0xb8/0x170 do_syscall_64+0xa5/0x4b0 entry_SYSCALL_64_after_hwframe+0x6a/0xdf RIP: 0033:0x7f01f4439b52 We seem to stumble over a memmap that contains a garbage zone id. While we could try inserting pfn_to_online_page() calls, it will just make memory offlining slower, because we use test_pages_in_a_zone() to make sure we're offlining pages that all belong to the same zone. Let's just get rid of this PFN walker and determine the single zone of a memory block -- if any -- for early memory blocks during boot. For memory onlining, we know the single zone already. Let's avoid any additional memmap scanning and just rely on the zone information available during boot. For memory hot(un)plug, we only really care about memory blocks that: * span a single zone (and, thereby, a single node) * are completely System RAM (IOW, no holes, no ZONE_DEVICE) If one of these conditions is not met, we reject memory offlining. Hotplugged memory blocks (starting out offline), always meet both conditions. There are three scenarios to handle: (1) Memory hot(un)plug A memory block with zone == NULL cannot be offlined, corresponding to our previous test_pages_in_a_zone() check. After successful memory onlining/offlining, we simply set the zone accordingly. * Memory onlining: set the zone we just used for onlining * Memory offlining: set zone = NULL So a hotplugged memory block starts with zone = NULL. Once memory onlining is done, we set the proper zone. (2) Boot memory with !CONFIG_NUMA We know that there is just a single pgdat, so we simply scan all zones of that pgdat for an intersection with our memory block PFN range when adding the memory block. If more than one zone intersects (e.g., DMA and DMA32 on x86 for the first memory block) we set zone = NULL and consequently mimic what test_pages_in_a_zone() used to do. (3) Boot memory with CONFIG_NUMA At the point in time we create the memory block devices during boot, we don't know yet which nodes *actually* span a memory block. While we could scan all zones of all nodes for intersections, overlapping nodes complicate the situation and scanning all nodes is possibly expensive. But that problem has already been solved by the code that sets the node of a memory block and creates the link in the sysfs -- do_register_memory_block_under_node(). So, we hook into the code that sets the node id for a memory block. If we already have a different node id set for the memory block, we know that multiple nodes *actually* have PFNs falling into our memory block: we set zone = NULL and consequently mimic what test_pages_in_a_zone() used to do. If there is no node id set, we do the same as (2) for the given node. Note that the call order in driver_init() is: -> memory_dev_init(): create memory block devices -> node_dev_init(): link memory block devices to the node and set the node id So in summary, we detect if there is a single zone responsible for this memory block and we consequently store the zone in that case in the memory block, updating it during memory onlining/offlining. Link: https://lkml.kernel.org/r/20220210184359.235565-3-david@redhat.com Signed-off-by: David Hildenbrand Reported-by: Rafael Parra Reviewed-by: Oscar Salvador Cc: "Rafael J. Wysocki" Cc: Greg Kroah-Hartman Cc: Michal Hocko Cc: Rafael Parra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds drivers/base/memory.c | 101 +++++++++++++++++++++++++++++++++++++++-- drivers/base/node.c | 13 ++---- include/linux/memory.h | 12 +++++ include/linux/memory_hotplug.h | 6 +-- mm/memory_hotplug.c | 50 ++++---------------- 5 files changed, 125 insertions(+), 57 deletions(-) commit cc6515591b25f08ce199e9379844a964f52a27f2 Author: David Hildenbrand Date: Tue Mar 22 14:47:28 2022 -0700 drivers/base/node: rename link_mem_sections() to register_memory_block_under_node() Patch series "drivers/base/memory: determine and store zone for single-zone memory blocks", v2. I remember talking to Michal in the past about removing test_pages_in_a_zone(), which we use for: * verifying that a memory block we intend to offline is really only managed by a single zone. We don't support offlining of memory blocks that are managed by multiple zones (e.g., multiple nodes, DMA and DMA32) * exposing that zone to user space via /sys/devices/system/memory/memory*/valid_zones Now that I identified some more cases where test_pages_in_a_zone() might go wrong, and we received an UBSAN report (see patch #3), let's get rid of this PFN walker. So instead of detecting the zone at runtime with test_pages_in_a_zone() by scanning the memmap, let's determine and remember for each memory block if it's managed by a single zone. The stored zone can then be used for the above two cases, avoiding a manual lookup using test_pages_in_a_zone(). This avoids eventually stumbling over uninitialized memmaps in corner cases, especially when ZONE_DEVICE ranges partly fall into memory block (that are responsible for managing System RAM). Handling memory onlining is easy, because we online to exactly one zone. Handling boot memory is more tricky, because we want to avoid scanning all zones of all nodes to detect possible zones that overlap with the physical memory region of interest. Fortunately, we already have code that determines the applicable nodes for a memory block, to create sysfs links -- we'll hook into that. Patch #1 is a simple cleanup I had laying around for a longer time. Patch #2 contains the main logic to remove test_pages_in_a_zone() and further details. [1] https://lkml.kernel.org/r/20220128144540.153902-1-david@redhat.com [2] https://lkml.kernel.org/r/20220203105212.30385-1-david@redhat.com This patch (of 2): Let's adjust the stale terminology, making it match unregister_memory_block_under_nodes() and do_register_memory_block_under_node(). We're dealing with memory block devices, which span 1..X memory sections. Link: https://lkml.kernel.org/r/20220210184359.235565-1-david@redhat.com Link: https://lkml.kernel.org/r/20220210184359.235565-2-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Oscar Salvador Cc: Greg Kroah-Hartman Cc: Michal Hocko Cc: "Rafael J. Wysocki" Cc: Rafael Parra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds drivers/base/node.c | 5 +++-- include/linux/node.h | 16 ++++++++-------- mm/memory_hotplug.c | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) commit 36ba30bc1df252ed65b8cae514b514985a7593c9 Author: Miaohe Lin Date: Tue Mar 22 14:47:24 2022 -0700 mm/memory_hotplug: fix misplaced comment in offline_pages It's misplaced since commit 7960509329c2 ("mm, memory_hotplug: print reason for the offlining failure"). Move it to the right place. Link: https://lkml.kernel.org/r/20220207133643.23427-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b27340a5bda4e35453d186e25622bacc3cf595c2 Author: Miaohe Lin Date: Tue Mar 22 14:47:22 2022 -0700 mm/memory_hotplug: clean up try_offline_node We can use helper macro node_spanned_pages to check whether node spans pages. And we can change the parameter of check_cpu_on_node to nid as that's what it really cares. Thus we can further get rid of the local variable pgdat and improve the readability a bit. Link: https://lkml.kernel.org/r/20220207133643.23427-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory_hotplug.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit d6aad2016a3f902153d7b8b7e02da2c7c50c10a4 Author: Miaohe Lin Date: Tue Mar 22 14:47:19 2022 -0700 mm/memory_hotplug: avoid calling zone_intersects() for ZONE_NORMAL If zid reaches ZONE_NORMAL, the caller will always get the NORMAL zone no matter what zone_intersects() returns. So we can save some possible cpu cycles by avoid calling zone_intersects() for ZONE_NORMAL. Link: https://lkml.kernel.org/r/20220207133643.23427-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2b6bf15f464620bbee08e8257d11f8f9f7f8725f Author: Miaohe Lin Date: Tue Mar 22 14:47:16 2022 -0700 mm/memory_hotplug: remove obsolete comment of __add_pages Patch series "A few cleanup patches around memory_hotplug". This series contains a few patches to fix obsolete and misplaced comments, clean up the try_offline_node function and so on. This patch (of 4): Since commit f1dd2cd13c4b ("mm, memory_hotplug: do not associate hotadded memory to zones until online"), there is no need to pass in the zone. [akpm@linux-foundation.org: remove the comment altogether, per David] Link: https://lkml.kernel.org/r/20220207133643.23427-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220207133643.23427-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory_hotplug.c | 6 ------ 1 file changed, 6 deletions(-) commit 2848a28b0a6052a4c8450397d2647d7d8e3f6f06 Author: David Hildenbrand Date: Tue Mar 22 14:47:13 2022 -0700 drivers/base/node: consolidate node device subsystem initialization in node_dev_init() ... and call node_dev_init() after memory_dev_init() from driver_init(), so before any of the existing arch/subsys calls. All online nodes should be known at that point: early during boot, arch code determines node and zone ranges and sets the relevant nodes online; usually this happens in setup_arch(). This is in line with memory_dev_init(), which initializes the memory device subsystem and creates all memory block devices. Similar to memory_dev_init(), panic() if anything goes wrong, we don't want to continue with such basic initialization errors. The important part is that node_dev_init() gets called after memory_dev_init() and after cpu_dev_init(), but before any of the relevant archs call register_cpu() to register the new cpu device under the node device. The latter should be the case for the current users of topology_init(). Link: https://lkml.kernel.org/r/20220203105212.30385-1-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Oscar Salvador Tested-by: Anatoly Pugachev (sparc64) Cc: Greg Kroah-Hartman Cc: Michal Hocko Cc: Oscar Salvador Cc: Mike Rapoport Cc: Catalin Marinas Cc: Will Deacon Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Yoshinori Sato Cc: Rich Felker Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/arm64/kernel/setup.c | 3 --- arch/ia64/kernel/topology.c | 10 ---------- arch/mips/kernel/topology.c | 5 ----- arch/powerpc/kernel/sysfs.c | 17 ----------------- arch/riscv/kernel/setup.c | 3 --- arch/s390/kernel/numa.c | 7 ------- arch/sh/kernel/topology.c | 5 ----- arch/sparc/kernel/sysfs.c | 12 ------------ arch/x86/kernel/topology.c | 5 ----- drivers/base/init.c | 1 + drivers/base/node.c | 30 +++++++++++++++++------------- include/linux/node.h | 4 ++++ 12 files changed, 22 insertions(+), 80 deletions(-) commit 7ea0d2d79da09d1f7d71c96a9c9bc1b5229360b5 Author: David Hildenbrand Date: Tue Mar 22 14:47:09 2022 -0700 drivers/base/memory: add memory block to memory group after registration succeeded If register_memory() fails, we freed the memory block but already added the memory block to the group list, not good. Let's defer adding the block to the memory group to after registering the memory block device. We do handle it properly during unregister_memory(), but that's not called when the registration fails. Link: https://lkml.kernel.org/r/20220128144540.153902-1-david@redhat.com Fixes: 028fc57a1c36 ("drivers/base/memory: introduce "memory groups" to logically group memory blocks") Signed-off-by: David Hildenbrand Reviewed-by: Oscar Salvador Acked-by: Michal Hocko Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds drivers/base/memory.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 8c9bb39816f01a309d30243da0ca91bd7e7bd1c2 Author: Wei Yang Date: Tue Mar 22 14:47:06 2022 -0700 memcg: do not tweak node in alloc_mem_cgroup_per_node_info alloc_mem_cgroup_per_node_info is allocated for each possible node and this used to be a problem because !node_online nodes didn't have appropriate data structure allocated. This has changed by "mm: handle uninitialized numa nodes gracefully" so we can drop the special casing here. Link: https://lkml.kernel.org/r/20220127085305.20890-7-mhocko@kernel.org Signed-off-by: Wei Yang Signed-off-by: Michal Hocko Cc: David Hildenbrand Cc: Alexey Makhalov Cc: Dennis Zhou Cc: Eric Dumazet Cc: Tejun Heo Cc: Christoph Lameter Cc: Nico Pache Cc: Wei Yang Cc: Mike Rapoport Cc: Oscar Salvador Cc: Rafael Aquini Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) commit 7c30daac20698cb035255089c896f230982b085e Author: Michal Hocko Date: Tue Mar 22 14:47:03 2022 -0700 mm: make free_area_init_node aware of memory less nodes free_area_init_node is also called from memory less node initialization path (free_area_init_memoryless_node). It doesn't really make much sense to display the physical memory range for those nodes: Initmem setup node XX [mem 0x0000000000000000-0x0000000000000000] Instead be explicit that the node is memoryless: Initmem setup node XX as memoryless Link: https://lkml.kernel.org/r/20220127085305.20890-6-mhocko@kernel.org Signed-off-by: Michal Hocko Acked-by: Rafael Aquini Acked-by: David Hildenbrand Reviewed-by: Mike Rapoport Reviewed-by: Oscar Salvador Cc: Alexey Makhalov Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Dumazet Cc: Nico Pache Cc: Tejun Heo Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit 70b5b46a754245d383811b4d2f2c76c34bb7e145 Author: Michal Hocko Date: Tue Mar 22 14:47:00 2022 -0700 mm, memory_hotplug: reorganize new pgdat initialization When a !node_online node is brought up it needs a hotplug specific initialization because the node could be either uninitialized yet or it could have been recycled after previous hotremove. hotadd_init_pgdat is responsible for that. Internal pgdat state is initialized at two places currently - hotadd_init_pgdat - free_area_init_core_hotplug There is no real clear cut what should go where but this patch's chosen to move the whole internal state initialization into free_area_init_core_hotplug. hotadd_init_pgdat is still responsible to pull all the parts together - most notably to initialize zonelists because those depend on the overall topology. This patch doesn't introduce any functional change. Link: https://lkml.kernel.org/r/20220127085305.20890-5-mhocko@kernel.org Signed-off-by: Michal Hocko Acked-by: Rafael Aquini Acked-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Alexey Makhalov Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Dumazet Cc: Mike Rapoport Cc: Nico Pache Cc: Tejun Heo Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/memory_hotplug.h | 2 +- mm/memory_hotplug.c | 28 +++------------------------- mm/page_alloc.c | 25 +++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 28 deletions(-) commit 390511e1476eb1cc41d420a7661b33f4d8584c3f Author: Michal Hocko Date: Tue Mar 22 14:46:57 2022 -0700 mm, memory_hotplug: drop arch_free_nodedata Prior to "mm: handle uninitialized numa nodes gracefully" memory hotplug used to allocate pgdat when memory has been added to a node (hotadd_init_pgdat) arch_free_nodedata has been only used in the failure path because once the pgdat is exported (to be visible by NODA_DATA(nid)) it cannot really be freed because there is no synchronization available for that. pgdat is allocated for each possible nodes now so the memory hotplug doesn't need to do the ever use arch_free_nodedata so drop it. This patch doesn't introduce any functional change. Link: https://lkml.kernel.org/r/20220127085305.20890-4-mhocko@kernel.org Signed-off-by: Michal Hocko Acked-by: Rafael Aquini Acked-by: David Hildenbrand Acked-by: Mike Rapoport Reviewed-by: Oscar Salvador Cc: Alexey Makhalov Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Dumazet Cc: Nico Pache Cc: Tejun Heo Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/ia64/mm/discontig.c | 5 ----- include/linux/memory_hotplug.h | 3 --- mm/memory_hotplug.c | 10 ---------- 3 files changed, 18 deletions(-) commit 09f49dca570a917a8c6bccd7e8c61f5141534e3a Author: Michal Hocko Date: Tue Mar 22 14:46:54 2022 -0700 mm: handle uninitialized numa nodes gracefully We have had several reports [1][2][3] that page allocator blows up when an allocation from a possible node is requested. The underlying reason is that NODE_DATA for the specific node is not allocated. NUMA specific initialization is arch specific and it can vary a lot. E.g. x86 tries to initialize all nodes that have some cpu affinity (see init_cpu_to_node) but this can be insufficient because the node might be cpuless for example. One way to address this problem would be to check for !node_online nodes when trying to get a zonelist and silently fall back to another node. That is unfortunately adding a branch into allocator hot path and it doesn't handle any other potential NODE_DATA users. This patch takes a different approach (following a lead of [3]) and it pre allocates pgdat for all possible nodes in an arch indipendent code - free_area_init. All uninitialized nodes are treated as memoryless nodes. node_state of the node is not changed because that would lead to other side effects - e.g. sysfs representation of such a node and from past discussions [4] it is known that some tools might have problems digesting that. Newly allocated pgdat only gets a minimal initialization and the rest of the work is expected to be done by the memory hotplug - hotadd_new_pgdat (renamed to hotadd_init_pgdat). generic_alloc_nodedata is changed to use the memblock allocator because neither page nor slab allocators are available at the stage when all pgdats are allocated. Hotplug doesn't allocate pgdat anymore so we can use the early boot allocator. The only arch specific implementation is ia64 and that is changed to use the early allocator as well. [1] http://lkml.kernel.org/r/20211101201312.11589-1-amakhalov@vmware.com [2] http://lkml.kernel.org/r/20211207224013.880775-1-npache@redhat.com [3] http://lkml.kernel.org/r/20190114082416.30939-1-mhocko@kernel.org [4] http://lkml.kernel.org/r/20200428093836.27190-1-srikar@linux.vnet.ibm.com [akpm@linux-foundation.org: replace comment, per Mike] Link: https://lkml.kernel.org/r/Yfe7RBeLCijnWBON@dhcp22.suse.cz Reported-by: Alexey Makhalov Tested-by: Alexey Makhalov Reported-by: Nico Pache Acked-by: Rafael Aquini Tested-by: Rafael Aquini Acked-by: David Hildenbrand Reviewed-by: Oscar Salvador Acked-by: Mike Rapoport Signed-off-by: Michal Hocko Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Dumazet Cc: Tejun Heo Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/ia64/mm/discontig.c | 4 ++-- include/linux/memory_hotplug.h | 2 +- mm/internal.h | 2 ++ mm/memory_hotplug.c | 21 +++++++++------------ mm/page_alloc.c | 40 ++++++++++++++++++++++++++++++++++++---- 5 files changed, 50 insertions(+), 19 deletions(-) commit e930d999715073a70d306fb59a394ea8b84d0b45 Author: Michal Hocko Date: Tue Mar 22 14:46:51 2022 -0700 mm, memory_hotplug: make arch_alloc_nodedata independent on CONFIG_MEMORY_HOTPLUG Patch series "mm, memory_hotplug: handle unitialized numa node gracefully". The core of the fix is patch 2 which also links existing bug reports. The high level goal is to have all possible numa nodes have their pgdat allocated and initialized so for_each_possible_node(nid) NODE_DATA(nid) will never return garbage. This has proven to be problem in several places when an offline numa node is used for an allocation just to realize that node_data and therefore allocation fallback zonelists are not initialized and such an allocation request blows up. There were attempts to address that by checking node_online in several places including the page allocator. This patchset approaches the problem from a different perspective and instead of special casing, which just adds a runtime overhead, it allocates pglist_data for each possible node. This can add some memory overhead for platforms with high number of possible nodes if they do not contain any memory. This should be a rather rare configuration though. How to test this? David has provided and excellent howto: http://lkml.kernel.org/r/6e5ebc19-890c-b6dd-1924-9f25c441010d@redhat.com Patches 1 and 3-6 are mostly cleanups. The patchset has been reviewed by Rafael (thanks!) and the core fix tested by Rafael and Alexey (thanks to both). David has tested as per instructions above and hasn't found any fallouts in the memory hotplug scenarios. This patch (of 6): This is a preparatory patch and it doesn't introduce any functional change. It merely pulls out arch_alloc_nodedata (and co) outside of CONFIG_MEMORY_HOTPLUG because the following patch will need to call this from the generic MM code. Link: https://lkml.kernel.org/r/20220127085305.20890-1-mhocko@kernel.org Link: https://lkml.kernel.org/r/20220127085305.20890-2-mhocko@kernel.org Signed-off-by: Michal Hocko Acked-by: Rafael Aquini Acked-by: David Hildenbrand Acked-by: Mike Rapoport Reviewed-by: Oscar Salvador Reviewed-by: Wei Yang Cc: Alexey Makhalov Cc: Christoph Lameter Cc: Dennis Zhou Cc: Eric Dumazet Cc: Nico Pache Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/ia64/mm/discontig.c | 2 - include/linux/memory_hotplug.h | 119 ++++++++++++++++++++--------------------- 2 files changed, 59 insertions(+), 62 deletions(-) commit 08095d6310a7ce43256b4251577bc66a25c6e1a6 Author: Charan Teja Kalla Date: Tue Mar 22 14:46:48 2022 -0700 mm: madvise: skip unmapped vma holes passed to process_madvise The process_madvise() system call is expected to skip holes in vma passed through 'struct iovec' vector list. But do_madvise, which process_madvise() calls for each vma, returns ENOMEM in case of unmapped holes, despite the VMA is processed. Thus process_madvise() should treat ENOMEM as expected and consider the VMA passed to as processed and continue processing other vma's in the vector list. Returning -ENOMEM to user, despite the VMA is processed, will be unable to figure out where to start the next madvise. Link: https://lkml.kernel.org/r/4f091776142f2ebf7b94018146de72318474e686.1647008754.git.quic_charante@quicinc.com Fixes: ecb8ac8b1f14("mm/madvise: introduce process_madvise() syscall: an external memory hinting API") Signed-off-by: Charan Teja Kalla Cc: David Rientjes Cc: Michal Hocko Cc: Minchan Kim Cc: Nadav Amit Cc: Stephen Rothwell Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/madvise.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 5bd009c7c9a9e888077c07535dc0c70aeab242c3 Author: Charan Teja Kalla Date: Tue Mar 22 14:46:44 2022 -0700 mm: madvise: return correct bytes advised with process_madvise Patch series "mm: madvise: return correct bytes processed with process_madvise", v2. With the process_madvise(), always choose to return non zero processed bytes over an error. This can help the user to know on which VMA, passed in the 'struct iovec' vector list, is failed to advise thus can take the decission of retrying/skipping on that VMA. This patch (of 2): The process_madvise() system call returns error even after processing some VMA's passed in the 'struct iovec' vector list which leaves the user confused to know where to restart the advise next. It is also against this syscall man page[1] documentation where it mentions that "return value may be less than the total number of requested bytes, if an error occurred after some iovec elements were already processed.". Consider a user passed 10 VMA's in the 'struct iovec' vector list of which 9 are processed but one. Then it just returns the error caused on that failed VMA despite the first 9 VMA's processed, leaving the user confused about on which VMA it is failed. Returning the number of bytes processed here can help the user to know which VMA it is failed on and thus can retry/skip the advise on that VMA. [1]https://man7.org/linux/man-pages/man2/process_madvise.2.html. Link: https://lkml.kernel.org/r/cover.1647008754.git.quic_charante@quicinc.com Link: https://lkml.kernel.org/r/125b61a0edcee5c2db8658aed9d06a43a19ccafc.1647008754.git.quic_charante@quicinc.com Fixes: ecb8ac8b1f14("mm/madvise: introduce process_madvise() syscall: an external memory hinting API") Signed-off-by: Charan Teja Kalla Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: David Rientjes Cc: Stephen Rothwell Cc: Minchan Kim Cc: Nadav Amit Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/madvise.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 531037a06518094aba283194aa0d4808b0c47656 Author: Miaohe Lin Date: Tue Mar 22 14:46:41 2022 -0700 mm/madvise: use vma_lookup() instead of find_vma() Using vma_lookup() verifies the start address is contained in the found vma. This results in easier to read the code. Link: https://lkml.kernel.org/r/20220311082731.63513-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/madvise.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit da358d5c0e589a7a594551951a9631091e5479b6 Author: Matthew Wilcox (Oracle) Date: Tue Mar 22 14:46:38 2022 -0700 mm/hwpoison: check the subpage, not the head page Hardware poison is tracked on a per-page basis, not on the head page. Link: https://lkml.kernel.org/r/20220130013042.1906881-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Naoya Horiguchi Reviewed-by: Yang Shi Cc: David Rientjes Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/rmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1bad2e5ca00b4c35cd2d62e380ba3aa7ec05b778 Author: Miaohe Lin Date: Tue Mar 22 14:46:35 2022 -0700 mm/ksm: use helper macro __ATTR_RW Use helper macro __ATTR_RW to define KSM_ATTR to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220221115809.26381-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/ksm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 4d45c3aff5ebf80d329eba0f90544d20224f612d Author: Yang Yang Date: Tue Mar 22 14:46:33 2022 -0700 mm/vmstat: add event for ksm swapping in copy When faults in from swap what used to be a KSM page and that page had been swapped in before, system has to make a copy, and leaves remerging the pages to a later pass of ksmd. That is not good for performace, we'd better to reduce this kind of copy. There are some ways to reduce it, for example lessen swappiness or madvise(, , MADV_MERGEABLE) range. So add this event to support doing this tuning. Just like this patch: "mm, THP, swap: add THP swapping out fallback counting". Link: https://lkml.kernel.org/r/20220113023839.758845-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Reviewed-by: Ran Xiaokai Cc: Hugh Dickins Cc: Yang Shi Cc: Dave Hansen Cc: Saravanan D Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/vm_event_item.h | 3 +++ mm/ksm.c | 3 +++ mm/vmstat.c | 3 +++ 3 files changed, 9 insertions(+) commit d8c47cc7bf602ef73384a00869a70148146c1191 Author: Johannes Weiner Date: Tue Mar 22 14:46:30 2022 -0700 mm: page_io: fix psi memory pressure error on cold swapins Once upon a time, all swapins counted toward memory pressure[1]. Then Joonsoo introduced workingset detection for anonymous pages and we gained the ability to distinguish hot from cold swapins[2][3]. But we failed to update swap_readpage() accordingly, and now we account partial memory pressure in the swapin path of cold memory. Not for all situations - which adds more inconsistency: paths using the conventional submit_bio() and lock_page() route will not see much pressure - unless storage itself is heavily congested and the bio submissions stall. ZRAM and ZSWAP do most of the work directly from swap_readpage() and will see all swapins reflected as pressure. IOW, a workload doing cold swapins could see little to no pressure reported with on-disk swap, but potentially high pressure with a zram or zswap backend. That confuses any psi-based health monitoring, load shedding, proactive reclaim, or userspace OOM killing schemes that might be in place for the workload. Restore consistency by making all swapin stall accounting conditional on the page actually being part of the workingset. [1] commit 937790699be9 ("mm/page_io.c: annotate refault stalls from swap_readpage") [2] commit aae466b0052e ("mm/swap: implement workingset detection for anonymous LRU") [3] commit cad8320b4b39 ("mm/swap: don't SetPageWorkingset unconditionally during swapin") Link: https://lkml.kernel.org/r/20220214214921.419687-1-hannes@cmpxchg.org Signed-off-by: Johannes Weiner Reported-by: CGEL Acked-by: Minchan Kim Cc: Joonsoo Kim Cc: Yu Zhao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_io.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit a1a3a2fc304df326ff67a1814364f640f2d5121c Author: Huang Ying Date: Tue Mar 22 14:46:27 2022 -0700 memory tiering: skip to scan fast memory If the NUMA balancing isn't used to optimize the page placement among sockets but only among memory types, the hot pages in the fast memory node couldn't be migrated (promoted) to anywhere. So it's unnecessary to scan the pages in the fast memory node via changing their PTE/PMD mapping to be PROT_NONE. So that the page faults could be avoided too. In the test, if only the memory tiering NUMA balancing mode is enabled, the number of the NUMA balancing hint faults for the DRAM node is reduced to almost 0 with the patch. While the benchmark score doesn't change visibly. Link: https://lkml.kernel.org/r/20220221084529.1052339-4-ying.huang@intel.com Signed-off-by: "Huang, Ying" Suggested-by: Dave Hansen Tested-by: Baolin Wang Reviewed-by: Baolin Wang Acked-by: Johannes Weiner Reviewed-by: Oscar Salvador Reviewed-by: Yang Shi Cc: Michal Hocko Cc: Rik van Riel Cc: Mel Gorman Cc: Peter Zijlstra Cc: Zi Yan Cc: Wei Xu Cc: Shakeel Butt Cc: zhongjiang-ali Cc: Feng Tang Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/huge_memory.c | 30 +++++++++++++++++++++--------- mm/mprotect.c | 13 ++++++++++++- 2 files changed, 33 insertions(+), 10 deletions(-) commit c574bbe917036c8968b984c82c7b13194fe5ce98 Author: Huang Ying Date: Tue Mar 22 14:46:23 2022 -0700 NUMA balancing: optimize page placement for memory tiering system With the advent of various new memory types, some machines will have multiple types of memory, e.g. DRAM and PMEM (persistent memory). The memory subsystem of these machines can be called memory tiering system, because the performance of the different types of memory are usually different. In such system, because of the memory accessing pattern changing etc, some pages in the slow memory may become hot globally. So in this patch, the NUMA balancing mechanism is enhanced to optimize the page placement among the different memory types according to hot/cold dynamically. In a typical memory tiering system, there are CPUs, fast memory and slow memory in each physical NUMA node. The CPUs and the fast memory will be put in one logical node (called fast memory node), while the slow memory will be put in another (faked) logical node (called slow memory node). That is, the fast memory is regarded as local while the slow memory is regarded as remote. So it's possible for the recently accessed pages in the slow memory node to be promoted to the fast memory node via the existing NUMA balancing mechanism. The original NUMA balancing mechanism will stop to migrate pages if the free memory of the target node becomes below the high watermark. This is a reasonable policy if there's only one memory type. But this makes the original NUMA balancing mechanism almost do not work to optimize page placement among different memory types. Details are as follows. It's the common cases that the working-set size of the workload is larger than the size of the fast memory nodes. Otherwise, it's unnecessary to use the slow memory at all. So, there are almost always no enough free pages in the fast memory nodes, so that the globally hot pages in the slow memory node cannot be promoted to the fast memory node. To solve the issue, we have 2 choices as follows, a. Ignore the free pages watermark checking when promoting hot pages from the slow memory node to the fast memory node. This will create some memory pressure in the fast memory node, thus trigger the memory reclaiming. So that, the cold pages in the fast memory node will be demoted to the slow memory node. b. Define a new watermark called wmark_promo which is higher than wmark_high, and have kswapd reclaiming pages until free pages reach such watermark. The scenario is as follows: when we want to promote hot-pages from a slow memory to a fast memory, but fast memory's free pages would go lower than high watermark with such promotion, we wake up kswapd with wmark_promo watermark in order to demote cold pages and free us up some space. So, next time we want to promote hot-pages we might have a chance of doing so. The choice "a" may create high memory pressure in the fast memory node. If the memory pressure of the workload is high, the memory pressure may become so high that the memory allocation latency of the workload is influenced, e.g. the direct reclaiming may be triggered. The choice "b" works much better at this aspect. If the memory pressure of the workload is high, the hot pages promotion will stop earlier because its allocation watermark is higher than that of the normal memory allocation. So in this patch, choice "b" is implemented. A new zone watermark (WMARK_PROMO) is added. Which is larger than the high watermark and can be controlled via watermark_scale_factor. In addition to the original page placement optimization among sockets, the NUMA balancing mechanism is extended to be used to optimize page placement according to hot/cold among different memory types. So the sysctl user space interface (numa_balancing) is extended in a backward compatible way as follow, so that the users can enable/disable these functionality individually. The sysctl is converted from a Boolean value to a bits field. The definition of the flags is, - 0: NUMA_BALANCING_DISABLED - 1: NUMA_BALANCING_NORMAL - 2: NUMA_BALANCING_MEMORY_TIERING We have tested the patch with the pmbench memory accessing benchmark with the 80:20 read/write ratio and the Gauss access address distribution on a 2 socket Intel server with Optane DC Persistent Memory Model. The test results shows that the pmbench score can improve up to 95.9%. Thanks Andrew Morton to help fix the document format error. Link: https://lkml.kernel.org/r/20220221084529.1052339-3-ying.huang@intel.com Signed-off-by: "Huang, Ying" Tested-by: Baolin Wang Reviewed-by: Baolin Wang Acked-by: Johannes Weiner Reviewed-by: Oscar Salvador Reviewed-by: Yang Shi Cc: Michal Hocko Cc: Rik van Riel Cc: Mel Gorman Cc: Peter Zijlstra Cc: Dave Hansen Cc: Zi Yan Cc: Wei Xu Cc: Shakeel Butt Cc: zhongjiang-ali Cc: Randy Dunlap Cc: Feng Tang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/sysctl/kernel.rst | 29 ++++++++++++++++++++--------- include/linux/mmzone.h | 1 + include/linux/sched/sysctl.h | 10 ++++++++++ kernel/sched/core.c | 21 +++++++++++++++++---- kernel/sysctl.c | 2 +- mm/migrate.c | 16 ++++++++++++++-- mm/page_alloc.c | 3 ++- mm/vmscan.c | 6 +++++- 8 files changed, 70 insertions(+), 18 deletions(-) commit e39bb6be9f2b39a6dbaeff484361de76021b175d Author: Huang Ying Date: Tue Mar 22 14:46:20 2022 -0700 NUMA Balancing: add page promotion counter Patch series "NUMA balancing: optimize memory placement for memory tiering system", v13 With the advent of various new memory types, some machines will have multiple types of memory, e.g. DRAM and PMEM (persistent memory). The memory subsystem of these machines can be called memory tiering system, because the performance of the different types of memory are different. After commit c221c0b0308f ("device-dax: "Hotplug" persistent memory for use like normal RAM"), the PMEM could be used as the cost-effective volatile memory in separate NUMA nodes. In a typical memory tiering system, there are CPUs, DRAM and PMEM in each physical NUMA node. The CPUs and the DRAM will be put in one logical node, while the PMEM will be put in another (faked) logical node. To optimize the system overall performance, the hot pages should be placed in DRAM node. To do that, we need to identify the hot pages in the PMEM node and migrate them to DRAM node via NUMA migration. In the original NUMA balancing, there are already a set of existing mechanisms to identify the pages recently accessed by the CPUs in a node and migrate the pages to the node. So we can reuse these mechanisms to build the mechanisms to optimize the page placement in the memory tiering system. This is implemented in this patchset. At the other hand, the cold pages should be placed in PMEM node. So, we also need to identify the cold pages in the DRAM node and migrate them to PMEM node. In commit 26aa2d199d6f ("mm/migrate: demote pages during reclaim"), a mechanism to demote the cold DRAM pages to PMEM node under memory pressure is implemented. Based on that, the cold DRAM pages can be demoted to PMEM node proactively to free some memory space on DRAM node to accommodate the promoted hot PMEM pages. This is implemented in this patchset too. We have tested the solution with the pmbench memory accessing benchmark with the 80:20 read/write ratio and the Gauss access address distribution on a 2 socket Intel server with Optane DC Persistent Memory Model. The test results shows that the pmbench score can improve up to 95.9%. This patch (of 3): In a system with multiple memory types, e.g. DRAM and PMEM, the CPU and DRAM in one socket will be put in one NUMA node as before, while the PMEM will be put in another NUMA node as described in the description of the commit c221c0b0308f ("device-dax: "Hotplug" persistent memory for use like normal RAM"). So, the NUMA balancing mechanism will identify all PMEM accesses as remote access and try to promote the PMEM pages to DRAM. To distinguish the number of the inter-type promoted pages from that of the inter-socket migrated pages. A new vmstat count is added. The counter is per-node (count in the target node). So this can be used to identify promotion imbalance among the NUMA nodes. Link: https://lkml.kernel.org/r/20220301085329.3210428-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20220221084529.1052339-1-ying.huang@intel.com Link: https://lkml.kernel.org/r/20220221084529.1052339-2-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Yang Shi Tested-by: Baolin Wang Reviewed-by: Baolin Wang Acked-by: Johannes Weiner Reviewed-by: Oscar Salvador Cc: Michal Hocko Cc: Rik van Riel Cc: Mel Gorman Cc: Peter Zijlstra Cc: Dave Hansen Cc: Zi Yan Cc: Wei Xu Cc: Shakeel Butt Cc: zhongjiang-ali Cc: Feng Tang Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/mmzone.h | 3 +++ include/linux/node.h | 5 +++++ mm/migrate.c | 13 ++++++++++--- mm/vmstat.c | 3 +++ 4 files changed, 21 insertions(+), 3 deletions(-) commit ee97347fe058d02035f354d59a5aa5aa6e1be4cc Author: Hari Bathini Date: Tue Mar 22 14:46:17 2022 -0700 powerpc/fadump: opt out from freeing pages on cma activation failure With commit a4e92ce8e4c8 ("powerpc/fadump: Reservationless firmware assisted dump"), Linux kernel's Contiguous Memory Allocator (CMA) based reservation was introduced in fadump. That change was aimed at using CMA to let applications utilize the memory reserved for fadump while blocking it from being used for kernel pages. The assumption was, even if CMA activation fails for whatever reason, the memory still remains reserved to avoid it from being used for kernel pages. But commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if activation of an area fails") breaks this assumption as it started exposing all pages to buddy allocator on CMA activation failure. It led to warning messages like below while running crash-utility on vmcore of a kernel having above two commits: crash: seek error: kernel virtual address: To fix this problem, opt out from exposing pages to buddy allocator on CMA activation failure for fadump reserved memory. Link: https://lkml.kernel.org/r/20220117075246.36072-3-hbathini@linux.ibm.com Signed-off-by: Hari Bathini Acked-by: David Hildenbrand Acked-by: Michael Ellerman Cc: Mahesh Salgaonkar Cc: Mike Kravetz Cc: Oscar Salvador Cc: Sourabh Jain Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/powerpc/kernel/fadump.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 27d121d0ec6d604d0147c5b579e4181b688a2d64 Author: Hari Bathini Date: Tue Mar 22 14:46:14 2022 -0700 mm/cma: provide option to opt out from exposing pages on activation failure Patch series "powerpc/fadump: handle CMA activation failure appropriately", v3. Commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if activation of an area fails") started exposing all pages to buddy allocator on CMA activation failure. But there can be CMA users that want to handle the reserved memory differently on CMA allocation failure. Provide an option to opt out from exposing pages to buddy for such cases. Link: https://lkml.kernel.org/r/20220117075246.36072-1-hbathini@linux.ibm.com Link: https://lkml.kernel.org/r/20220117075246.36072-2-hbathini@linux.ibm.com Signed-off-by: Hari Bathini Reviewed-by: David Hildenbrand Cc: Oscar Salvador Cc: Mike Kravetz Cc: Mahesh Salgaonkar Cc: Sourabh Jain Cc: Michael Ellerman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/cma.h | 2 ++ mm/cma.c | 11 +++++++++-- mm/cma.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) commit 9d84604b845c3888d1bede43d16ab3ebedb13e24 Author: Hugh Dickins Date: Tue Mar 22 14:46:11 2022 -0700 mm/thp: refix __split_huge_pmd_locked() for migration PMD Migration entries do not contribute to a page's reference count: move __split_huge_pmd_locked()'s page_ref_add() into pmd_migration's else block (along with the page_count() check - a page is quite likely to have reference count frozen to 0 when a migration entry is found). This will fix a very rare anonymous memory leak, after a split_huge_pmd() raced with an anon split_huge_page() or an anon THP migrate_pages(): since the wrongly raised refcount stopped the page (perhaps small, perhaps huge, depending on when the race hit) from ever being freed. At first I thought there were worse risks, from prematurely unfreezing a frozen page: but now think that would only affect page cache pages, which do not come this way (except for anonymous pages in swap cache, perhaps). Link: https://lkml.kernel.org/r/84792468-f512-e48f-378c-e34c3641e97@google.com Fixes: ec0abae6dcdf ("mm/thp: fix __split_huge_pmd_locked() for migration PMD") Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi Cc: Ralph Campbell Cc: Zi Yan Cc: "Kirill A. Shutemov" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/huge_memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 356ea3865687926e5da7579d1f3351d3f0a322a1 Author: andrew.yang Date: Tue Mar 22 14:46:08 2022 -0700 mm/migrate: fix race between lock page and clear PG_Isolated When memory is tight, system may start to compact memory for large continuous memory demands. If one process tries to lock a memory page that is being locked and isolated for compaction, it may wait a long time or even forever. This is because compaction will perform non-atomic PG_Isolated clear while holding page lock, this may overwrite PG_waiters set by the process that can't obtain the page lock and add itself to the waiting queue to wait for the lock to be unlocked. CPU1 CPU2 lock_page(page); (successful) lock_page(); (failed) __ClearPageIsolated(page); SetPageWaiters(page) (may be overwritten) unlock_page(page); The solution is to not perform non-atomic operation on page flags while holding page lock. Link: https://lkml.kernel.org/r/20220315030515.20263-1-andrew.yang@mediatek.com Signed-off-by: andrew.yang Cc: Matthias Brugger Cc: Matthew Wilcox Cc: "Vlastimil Babka" Cc: David Howells Cc: "William Kucharski" Cc: David Hildenbrand Cc: Yang Shi Cc: Marc Zyngier Cc: Nicholas Tang Cc: Kuan-Ying Lee Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/page-flags.h | 2 +- mm/migrate.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) commit fc89213a636c3735eb3386f10a34c082271b4192 Author: Huang Ying Date: Tue Mar 22 14:46:05 2022 -0700 mm,migrate: fix establishing demotion target In commit ac16ec835314 ("mm: migrate: support multiple target nodes demotion"), after the first demotion target node is found, we will continue to check the next candidate obtained via find_next_best_node(). This is to find all demotion target nodes with same NUMA distance. But one side effect of find_next_best_node() is that the candidate node returned will be set in "used" parameter, even if the candidate node isn't passed in the following NUMA distance checking, the candidate node will not be used as demotion target node for the following nodes. For example, for system as follows, node distances: node 0 1 2 3 0: 10 21 17 28 1: 21 10 28 17 2: 17 28 10 28 3: 28 17 28 10 when we establish demotion target node for node 0, in the first round node 2 is added to the demotion target node set. Then in the second round, node 3 is checked and failed because distance(0, 3) > distance(0, 2). But node 3 is set in "used" nodemask too. When we establish demotion target node for node 1, there is no available node. This is wrong, node 3 should be set as the demotion target of node 1. To fix this, if the candidate node is failed to pass the distance checking, it will be cleared in "used" nodemask. So that it can be used for the following node. The bug can be reproduced and fixed with this patch on a 2 socket server machine with DRAM and PMEM. Link: https://lkml.kernel.org/r/20220128055940.1792614-1-ying.huang@intel.com Fixes: ac16ec835314 ("mm: migrate: support multiple target nodes demotion") Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Cc: Baolin Wang Cc: Dave Hansen Cc: Zi Yan Cc: Oscar Salvador Cc: Yang Shi Cc: zhongjiang-ali Cc: Xunlei Pang Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/migrate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit bd8b77d653e84cf1387b8046c61315af8b7513fb Author: Miaohe Lin Date: Tue Mar 22 14:46:02 2022 -0700 mm/oom_kill: remove unneeded is_memcg_oom check oom_cpuset_eligible() is always called when !is_memcg_oom(). Remove this unnecessary check. Link: https://lkml.kernel.org/r/20220224115933.20154-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: David Rientjes Acked-by: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/oom_kill.c | 3 --- 1 file changed, 3 deletions(-) commit 4e0906008cdb56381638aa17d9c32734eae6d37a Author: Hugh Dickins Date: Tue Mar 22 14:45:59 2022 -0700 mempolicy: mbind_range() set_policy() after vma_merge() v2.6.34 commit 9d8cebd4bcd7 ("mm: fix mbind vma merge problem") introduced vma_merge() to mbind_range(); but unlike madvise, mlock and mprotect, it put a "continue" to next vma where its precedents go to update flags on current vma before advancing: that left vma with the wrong setting in the infamous vma_merge() case 8. v3.10 commit 1444f92c8498 ("mm: merging memory blocks resets mempolicy") tried to fix that in vma_adjust(), without fully understanding the issue. v3.11 commit 3964acd0dbec ("mm: mempolicy: fix mbind_range() && vma_adjust() interaction") reverted that, and went about the fix in the right way, but chose to optimize out an unnecessary mpol_dup() with a prior mpol_equal() test. But on tmpfs, that also pessimized out the vital call to its ->set_policy(), leaving the new mbind unenforced. The user visible effect was that the pages got allocated on the local node (happened to be 0), after the mbind() caller had specifically asked for them to be allocated on node 1. There was not any page migration involved in the case reported: the pages simply got allocated on the wrong node. Just delete that optimization now (though it could be made conditional on vma not having a set_policy). Also remove the "next" variable: it turned out to be blameless, but also pointless. Link: https://lkml.kernel.org/r/319e4db9-64ae-4bca-92f0-ade85d342ff@google.com Fixes: 3964acd0dbec ("mm: mempolicy: fix mbind_range() && vma_adjust() interaction") Signed-off-by: Hugh Dickins Acked-by: Oleg Nesterov Reviewed-by: Liam R. Howlett Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mempolicy.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit abd4349ff9b8d242376b67711254221f64f447c7 Author: Baolin Wang Date: Tue Mar 22 14:45:56 2022 -0700 mm: compaction: cleanup the compaction trace events As Steven suggested [1], we should access the pointers from the trace event to avoid dereferencing them to the tracepoint function when the tracepoint is disabled. [1] https://lkml.org/lkml/2021/11/3/409 Link: https://lkml.kernel.org/r/4cd393b4d57f8f01ed72c001509b28e3a3b1a8c1.1646985115.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Cc: Steven Rostedt (Google) Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/trace/events/compaction.h | 26 +++++++++++++------------- mm/compaction.c | 9 +++------ 2 files changed, 16 insertions(+), 19 deletions(-) commit 96bd3e79efee380ffe096b499d6f24102cf450ba Author: Charan Teja Kalla Date: Tue Mar 22 14:45:53 2022 -0700 mm: vmscan: fix documentation for page_check_references() Commit b518154e59aa ("mm/vmscan: protect the workingset on anonymous LRU") requires to look twice for both mapped anon/file pages are used more than once to take the decission of reclaim or activation. Correct the documentation accordingly. Link: https://lkml.kernel.org/r/1646925640-21324-1-git-send-email-quic_charante@quicinc.com Signed-off-by: Charan Teja Kalla Cc: Joonsoo Kim Cc: Michal Hocko Cc: Johannes Weiner Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2386eef2141cc72977e3a65feb304739ee8db6cb Author: Sebastian Andrzej Siewior Date: Tue Mar 22 14:45:50 2022 -0700 mm: workingset: replace IRQ-off check with a lockdep assert. Commit 68d48e6a2df57 ("mm: workingset: add vmstat counter for shadow nodes") introduced an IRQ-off check to ensure that a lock is held which also disabled interrupts. This does not work the same way on PREEMPT_RT because none of the locks, that are held, disable interrupts. Replace this check with a lockdep assert which ensures that the lock is held. Link: https://lkml.kernel.org/r/20220301122143.1521823-3-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Cc: Johannes Weiner Cc: Tejun Heo Cc: Zefan Li Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/workingset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit ff042f4a9b050895a42cae893cc01fa2ca81b95c Author: Marcelo Tosatti Date: Tue Mar 22 14:45:47 2022 -0700 mm: lru_cache_disable: replace work queue synchronization with synchronize_rcu On systems that run FIFO:1 applications that busy loop, any SCHED_OTHER task that attempts to execute on such a CPU (such as work threads) will not be scheduled, which leads to system hangs. Commit d479960e44f27e0e5 ("mm: disable LRU pagevec during the migration temporarily") relies on queueing work items on all online CPUs to ensure visibility of lru_disable_count. To fix this, replace the usage of work items with synchronize_rcu, which provides the same guarantees. Readers of lru_disable_count are protected by either disabling preemption or rcu_read_lock: preempt_disable, local_irq_disable [bh_lru_lock()] rcu_read_lock [rt_spin_lock CONFIG_PREEMPT_RT] preempt_disable [local_lock !CONFIG_PREEMPT_RT] Since v5.1 kernel, synchronize_rcu() is guaranteed to wait on preempt_disable() regions of code. So any CPU which sees lru_disable_count = 0 will have exited the critical section when synchronize_rcu() returns. Link: https://lkml.kernel.org/r/Yin7hDxdt0s/x+fp@fuller.cnet Signed-off-by: Marcelo Tosatti Reviewed-by: Nicolas Saenz Julienne Acked-by: Minchan Kim Cc: Matthew Wilcox Cc: Mel Gorman Cc: Juri Lelli Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Paul E. McKenney Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/swap.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) commit 405cc51fc1049c73ae03ce3771a2511a7cf8b240 Author: Waiman Long Date: Tue Mar 22 14:45:44 2022 -0700 mm/list_lru: optimize memcg_reparent_list_lru_node() Since commit 2c80cd57c743 ("mm/list_lru.c: fix list_lru_count_node() to be race free"), we are tracking the total number of lru entries in a list_lru_node in its nr_items field. In the case of memcg_reparent_list_lru_node(), there is nothing to be done if nr_items is 0. We don't even need to take the nlru->lock as no new lru entry could be added by a racing list_lru_add() to the draining src_idx memcg at this point. On systems that serve a lot of containers, it is possible that there can be thousands of list_lru's present due to the fact that each container may mount its own container specific filesystems. As a typical container uses only a few cpus, it is likely that only the list_lru_node that contains those cpus will be utilized while the rests may be empty. In other words, there can be a lot of list_lru_node with 0 nr_items. By skipping a lock/unlock operation and loading a cacheline from memcg_lrus, a sizeable number of cpu cycles can be saved. That can be substantial if we are talking about thousands of list_lru_node's with 0 nr_items. Link: https://lkml.kernel.org/r/20220309144000.1470138-1-longman@redhat.com Signed-off-by: Waiman Long Reviewed-by: Roman Gushchin Cc: Muchun Song Cc: Michal Hocko Cc: Johannes Weiner Cc: Shakeel Butt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/list_lru.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 89f6c88a6ab4a11deb14c270f7f1454cda4f73d6 Author: Hugh Dickins Date: Tue Mar 22 14:45:41 2022 -0700 mm: __isolate_lru_page_prepare() in isolate_migratepages_block() __isolate_lru_page_prepare() conflates two unrelated functions, with the flags to one disjoint from the flags to the other; and hides some of the important checks outside of isolate_migratepages_block(), where the sequence is better to be visible. It comes from the days of lumpy reclaim, before compaction, when the combination made more sense. Move what's needed by mm/compaction.c isolate_migratepages_block() inline there, and what's needed by mm/vmscan.c isolate_lru_pages() inline there. Shorten "isolate_mode" to "mode", so the sequence of conditions is easier to read. Declare a "mapping" variable, to save one call to page_mapping() (but not another: calling again after page is locked is necessary). Simplify isolate_lru_pages() with a "move_to" list pointer. Link: https://lkml.kernel.org/r/879d62a8-91cc-d3c6-fb3b-69768236df68@google.com Signed-off-by: Hugh Dickins Acked-by: David Rientjes Reviewed-by: Alex Shi Cc: Alexander Duyck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/swap.h | 1 - mm/compaction.c | 51 ++++++++++++++++++++++---- mm/vmscan.c | 101 +++++++++------------------------------------------ 3 files changed, 62 insertions(+), 91 deletions(-) commit b698f0a1773f7df73f2bb4bfe0e597ea1bb3881f Author: Hugh Dickins Date: Tue Mar 22 14:45:38 2022 -0700 mm/fs: delete PF_SWAPWRITE PF_SWAPWRITE has been redundant since v3.2 commit ee72886d8ed5 ("mm: vmscan: do not writeback filesystem pages in direct reclaim"). Coincidentally, NeilBrown's current patch "remove inode_congested()" deletes may_write_to_inode(), which appeared to be the one function which took notice of PF_SWAPWRITE. But if you study the old logic, and the conditions under which may_write_to_inode() was called, you discover that flag and function have been pointless for a decade. Link: https://lkml.kernel.org/r/75e80e7-742d-e3bd-531-614db8961e4@google.com Signed-off-by: Hugh Dickins Cc: NeilBrown Cc: Jan Kara Cc: "Darrick J. Wong" Cc: Dave Chinner Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/fs-writeback.c | 3 --- fs/xfs/libxfs/xfs_btree.c | 2 +- include/linux/sched.h | 1 - mm/migrate.c | 7 ------- mm/vmscan.c | 8 ++------ 5 files changed, 3 insertions(+), 18 deletions(-) commit d794103d52739f8e27b69c4895dbf5a5a7a805cc Author: Guo Zhengkui Date: Tue Mar 22 14:45:35 2022 -0700 userfaultfd/selftests: fix uninitialized_var.cocci warning Fix following coccicheck warning: tools/testing/selftests/vm/userfaultfd.c:556:23-24: WARNING this kind of initialization is deprecated `unsigned long page_nr = *(&page_nr)` has the same form of uninitialized_var() macro. I remove the redundant assignement. It has been tested with gcc (Debian 8.3.0-6) 8.3.0. The patch which removed uninitialized_var() is: https://lore.kernel.org/all/20121028102007.GA7547@gmail.com/ And there is very few "/* GCC */" comments in the Linux kernel code now. Link: https://lkml.kernel.org/r/20220304082333.9252-1-guozhengkui@vivo.com Signed-off-by: Guo Zhengkui Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/userfaultfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 824ddc601adc2cc48efb7f58b57997986c1c1276 Author: Nadav Amit Date: Tue Mar 22 14:45:32 2022 -0700 userfaultfd: provide unmasked address on page-fault Userfaultfd is supposed to provide the full address (i.e., unmasked) of the faulting access back to userspace. However, that is not the case for quite some time. Even running "userfaultfd_demo" from the userfaultfd man page provides the wrong output (and contradicts the man page). Notice that "UFFD_EVENT_PAGEFAULT event" shows the masked address (7fc5e30b3000) and not the first read address (0x7fc5e30b300f). Address returned by mmap() = 0x7fc5e30b3000 fault_handler_thread(): poll() returns: nready = 1; POLLIN = 1; POLLERR = 0 UFFD_EVENT_PAGEFAULT event: flags = 0; address = 7fc5e30b3000 (uffdio_copy.copy returned 4096) Read address 0x7fc5e30b300f in main(): A Read address 0x7fc5e30b340f in main(): A Read address 0x7fc5e30b380f in main(): A Read address 0x7fc5e30b3c0f in main(): A The exact address is useful for various reasons and specifically for prefetching decisions. If it is known that the memory is populated by certain objects whose size is not page-aligned, then based on the faulting address, the uffd-monitor can decide whether to prefetch and prefault the adjacent page. This bug has been for quite some time in the kernel: since commit 1a29d85eb0f1 ("mm: use vmf->address instead of of vmf->virtual_address") vmf->virtual_address"), which dates back to 2016. A concern has been raised that existing userspace application might rely on the old/wrong behavior in which the address is masked. Therefore, it was suggested to provide the masked address unless the user explicitly asks for the exact address. Add a new userfaultfd feature UFFD_FEATURE_EXACT_ADDRESS to direct userfaultfd to provide the exact address. Add a new "real_address" field to vmf to hold the unmasked address. Provide the address to userspace accordingly. Initialize real_address in various code-paths to be consistent with address, even when it is not used, to be on the safe side. [namit@vmware.com: initialize real_address on all code paths, per Jan] Link: https://lkml.kernel.org/r/20220226022655.350562-1-namit@vmware.com [akpm@linux-foundation.org: fix typo in comment, per Jan] Link: https://lkml.kernel.org/r/20220218041003.3508-1-namit@vmware.com Signed-off-by: Nadav Amit Acked-by: Peter Xu Reviewed-by: David Hildenbrand Acked-by: Mike Rapoport Reviewed-by: Jan Kara Cc: Andrea Arcangeli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/userfaultfd.c | 5 ++++- include/linux/mm.h | 3 ++- include/uapi/linux/userfaultfd.h | 8 +++++++- mm/hugetlb.c | 6 ++++-- mm/memory.c | 1 + mm/swapfile.c | 1 + 6 files changed, 19 insertions(+), 5 deletions(-) commit 87d2762e22f3ea6885862cb1fd419b77a5bcd8f7 Author: Miaohe Lin Date: Tue Mar 22 14:45:29 2022 -0700 mm: remove unneeded local variable follflags We can pass FOLL_GET | FOLL_DUMP to follow_page directly to simplify the code a bit in add_page_for_migration and split_huge_pages_pid. Link: https://lkml.kernel.org/r/20220311072002.35575-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Anshuman Khandual Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/huge_memory.c | 4 +--- mm/migrate.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) commit 4e936ecc013adde12649d572352d6f37655c39b7 Author: David Howells Date: Tue Mar 22 14:45:26 2022 -0700 mm/hugetlb.c: export PageHeadHuge() Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by such as folio_file_page() and folio_contains(). Matthew suggested I use the first of those instead of doing the same calculation manually - but I can't call it from a module. Kirill suggested rearranging things to put it in a header, but that introduces header dependencies because of where constants are defined. [akpm@linux-foundation.org: s/EXPORT_SYMBOL/EXPORT_SYMBOL_GPL/, per Christoph] Link: https://lkml.kernel.org/r/2494562.1646054576@warthog.procyon.org.uk Link: https://lore.kernel.org/r/163707085314.3221130.14783857863702203440.stgit@warthog.procyon.org.uk/ Signed-off-by: David Howells Cc: Matthew Wilcox (Oracle) Cc: Kirill A. Shutemov Cc: Christoph Hellwig Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/hugetlb.c | 1 + 1 file changed, 1 insertion(+) commit 98bc26ac770fe507b4c23f5ee748f641146fb076 Author: Miaohe Lin Date: Tue Mar 22 14:45:23 2022 -0700 mm/hugetlb: use helper macro __ATTR_RW Use helper macro __ATTR_RW to define HSTATE_ATTR to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220222112731.33479-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Reviewed-by: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/hugetlb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit f9317f77a6e06d15604a079a9d35a2f500c60c08 Author: Mike Kravetz Date: Tue Mar 22 14:45:20 2022 -0700 hugetlb: clean up potential spectre issue warnings Recently introduced code allows numa nodes to be specified on the kernel command line for hugetlb allocations or CMA reservations. The node values are user specified and used as indicies into arrays. This generated the following smatch warnings: mm/hugetlb.c:4170 hugepages_setup() warn: potential spectre issue 'default_hugepages_in_node' [w] mm/hugetlb.c:4172 hugepages_setup() warn: potential spectre issue 'parsed_hstate->max_huge_pages_node' [w] mm/hugetlb.c:6898 cmdline_parse_hugetlb_cma() warn: potential spectre issue 'hugetlb_cma_size_in_node' [w] (local cap) Clean up by using array_index_nospec to sanitize array indicies. The routine cmdline_parse_hugetlb_cma has the same overflow/truncation issue addressed in [1]. That is also fixed with this change. [1] https://lore.kernel.org/linux-mm/20220209134018.8242-1-liuyuntao10@huawei.com/ As Michal pointed out, this is unlikely to be exploitable because it is __init code. But the patch suppresses the warnings. [mike.kravetz@oracle.com: v2] Link: https://lkml.kernel.org/r/20220218212946.35441-1-mike.kravetz@oracle.com Link: https://lkml.kernel.org/r/20220217234218.192885-1-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Cc: Baolin Wang Cc: Zhenguo Yao Cc: Liu Yuntao Cc: Dan Carpenter Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/hugetlb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 07431506e8d752ff21c3d5fba0927fe8be4ed18f Author: Anshuman Khandual Date: Tue Mar 22 14:45:15 2022 -0700 mm/hugetlb: generalize ARCH_WANT_GENERAL_HUGETLB ARCH_WANT_GENERAL_HUGETLB config has duplicate definitions on platforms that subscribe it. Instead make it a generic config option which can be selected on applicable platforms when required. Link: https://lkml.kernel.org/r/1643718465-4324-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Cc: Russell King Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/arm/Kconfig | 4 +--- arch/riscv/Kconfig | 4 +--- arch/x86/Kconfig | 4 +--- mm/Kconfig | 3 +++ 4 files changed, 6 insertions(+), 9 deletions(-) commit e54084173487804f5e2f23facf107fd9336e637e Author: Muchun Song Date: Tue Mar 22 14:45:12 2022 -0700 mm: sparsemem: move vmemmap related to HugeTLB to CONFIG_HUGETLB_PAGE_FREE_VMEMMAP The vmemmap_remap_free/alloc are relevant to HugeTLB, so move those functiongs to the scope of CONFIG_HUGETLB_PAGE_FREE_VMEMMAP. Link: https://lkml.kernel.org/r/20211101031651.75851-6-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Barry Song Cc: Bodeddula Balasubramaniam Cc: Chen Huang Cc: David Hildenbrand Cc: Fam Zheng Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Cc: Mike Kravetz Cc: Oscar Salvador Cc: Qi Zheng Cc: Xiongchun Duan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/mm.h | 2 ++ mm/sparse-vmemmap.c | 2 ++ 2 files changed, 4 insertions(+) commit b147c89cd429321a59147368378c8aba17c8480f Author: Muchun Song Date: Tue Mar 22 14:45:09 2022 -0700 selftests: vm: add a hugetlb test case Since the head vmemmap page frame associated with each HugeTLB page is reused, we should hide the PG_head flag of tail struct page from the user. Add a tese case to check whether it is work properly. The test steps are as follows. 1) alloc 2MB hugeTLB 2) get each page frame 3) apply those APIs in each page frame 4) Those APIs work completely the same as before. Reading the flags of a page by /proc/kpageflags is done in stable_page_flags(), which has invoked PageHead(), PageTail(), PageCompound() and compound_head(). If those APIs work properly, the head page must have 15 and 17 bits set. And tail pages must have 16 and 17 bits set but 15 bit unset. Those flags are checked in check_page_flags(). Link: https://lkml.kernel.org/r/20211101031651.75851-5-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Barry Song Cc: Bodeddula Balasubramaniam Cc: Chen Huang Cc: David Hildenbrand Cc: Fam Zheng Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Cc: Mike Kravetz Cc: Oscar Salvador Cc: Qi Zheng Cc: Xiongchun Duan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/.gitignore | 1 + tools/testing/selftests/vm/Makefile | 1 + tools/testing/selftests/vm/hugepage-vmemmap.c | 144 ++++++++++++++++++++++++++ tools/testing/selftests/vm/run_vmtests.sh | 11 ++ 4 files changed, 157 insertions(+) commit d8d55f5616cf3b900a23a72dd24e7b07211e7859 Author: Muchun Song Date: Tue Mar 22 14:45:06 2022 -0700 mm: sparsemem: use page table lock to protect kernel pmd operations The init_mm.page_table_lock is used to protect kernel page tables, we can use it to serialize splitting vmemmap PMD mappings instead of mmap write lock, which can increase the concurrency of vmemmap_remap_free(). Actually, It increase the concurrency between allocations of HugeTLB pages. But it is not the only benefit. There are a lot of users of mmap read lock of init_mm. The mmap write lock is holding through vmemmap_remap_free(), removing mmap write lock usage to make it does not affect other users of mmap read lock. It is not making anything worse and always a win to move. Now the kernel page table walker does not hold the page_table_lock when walking pmd entries. There may be consistency issue of a pmd entry, because pmd entry might change from a huge pmd entry to a PTE page table. There is only one user of kernel page table walker, namely ptdump. The ptdump already considers the consistency, which use a local variable to cache the value of pmd entry. But we also need to update ->action to ACTION_CONTINUE to make sure the walker does not walk every pte entry again when concurrent thread has split the huge pmd. Link: https://lkml.kernel.org/r/20211101031651.75851-4-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Barry Song Cc: Bodeddula Balasubramaniam Cc: Chen Huang Cc: David Hildenbrand Cc: Fam Zheng Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Cc: Mike Kravetz Cc: Oscar Salvador Cc: Qi Zheng Cc: Xiongchun Duan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/ptdump.c | 16 ++++++++++++---- mm/sparse-vmemmap.c | 47 +++++++++++++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 20 deletions(-) commit a6b40850c442bf996e729e1d441d3dbc37cea171 Author: Muchun Song Date: Tue Mar 22 14:45:03 2022 -0700 mm: hugetlb: replace hugetlb_free_vmemmap_enabled with a static_key The page_fixed_fake_head() is used throughout memory management and the conditional check requires checking a global variable, although the overhead of this check may be small, it increases when the memory cache comes under pressure. Also, the global variable will not be modified after system boot, so it is very appropriate to use static key machanism. Link: https://lkml.kernel.org/r/20211101031651.75851-3-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Barry Song Cc: Bodeddula Balasubramaniam Cc: Chen Huang Cc: David Hildenbrand Cc: Fam Zheng Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Michal Hocko Cc: Mike Kravetz Cc: Oscar Salvador Cc: Qi Zheng Cc: Xiongchun Duan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/hugetlb.h | 6 ------ include/linux/page-flags.h | 16 ++++++++++++++-- mm/hugetlb_vmemmap.c | 12 ++++++------ mm/memory_hotplug.c | 2 +- 4 files changed, 21 insertions(+), 15 deletions(-) commit e7d324850bfcb30df563d144c0363cc44595277d Author: Muchun Song Date: Tue Mar 22 14:45:00 2022 -0700 mm: hugetlb: free the 2nd vmemmap page associated with each HugeTLB page Patch series "Free the 2nd vmemmap page associated with each HugeTLB page", v7. This series can minimize the overhead of struct page for 2MB HugeTLB pages significantly. It further reduces the overhead of struct page by 12.5% for a 2MB HugeTLB compared to the previous approach, which means 2GB per 1TB HugeTLB. It is a nice gain. Comments and reviews are welcome. Thanks. The main implementation and details can refer to the commit log of patch 1. In this series, I have changed the following four helpers, the following table shows the impact of the overhead of those helpers. +------------------+-----------------------+ | APIs | head page | tail page | +------------------+-----------+-----------+ | PageHead() | Y | N | +------------------+-----------+-----------+ | PageTail() | Y | N | +------------------+-----------+-----------+ | PageCompound() | N | N | +------------------+-----------+-----------+ | compound_head() | Y | N | +------------------+-----------+-----------+ Y: Overhead is increased. N: Overhead is _NOT_ increased. It shows that the overhead of those helpers on a tail page don't change between "hugetlb_free_vmemmap=on" and "hugetlb_free_vmemmap=off". But the overhead on a head page will be increased when "hugetlb_free_vmemmap=on" (except PageCompound()). So I believe that Matthew Wilcox's folio series will help with this. The users of PageHead() and PageTail() are much less than compound_head() and most users of PageTail() are VM_BUG_ON(), so I have done some tests about the overhead of compound_head() on head pages. I have tested the overhead of calling compound_head() on a head page, which is 2.11ns (Measure the call time of 10 million times compound_head(), and then average). For a head page whose address is not aligned with PAGE_SIZE or a non-compound page, the overhead of compound_head() is 2.54ns which is increased by 20%. For a head page whose address is aligned with PAGE_SIZE, the overhead of compound_head() is 2.97ns which is increased by 40%. Most pages are the former. I do not think the overhead is significant since the overhead of compound_head() itself is low. This patch (of 5): This patch minimizes the overhead of struct page for 2MB HugeTLB pages significantly. It further reduces the overhead of struct page by 12.5% for a 2MB HugeTLB compared to the previous approach, which means 2GB per 1TB HugeTLB (2MB type). After the feature of "Free sonme vmemmap pages of HugeTLB page" is enabled, the mapping of the vmemmap addresses associated with a 2MB HugeTLB page becomes the figure below. HugeTLB struct pages(8 pages) page frame(8 pages) +-----------+ ---virt_to_page---> +-----------+ mapping to +-----------+---> PG_head | | | 0 | -------------> | 0 | | | +-----------+ +-----------+ | | | 1 | -------------> | 1 | | | +-----------+ +-----------+ | | | 2 | ----------------^ ^ ^ ^ ^ ^ | | +-----------+ | | | | | | | | 3 | ------------------+ | | | | | | +-----------+ | | | | | | | 4 | --------------------+ | | | | 2MB | +-----------+ | | | | | | 5 | ----------------------+ | | | | +-----------+ | | | | | 6 | ------------------------+ | | | +-----------+ | | | | 7 | --------------------------+ | | +-----------+ | | | | | | +-----------+ As we can see, the 2nd vmemmap page frame (indexed by 1) is reused and remaped. However, the 2nd vmemmap page frame is also can be freed to the buddy allocator, then we can change the mapping from the figure above to the figure below. HugeTLB struct pages(8 pages) page frame(8 pages) +-----------+ ---virt_to_page---> +-----------+ mapping to +-----------+---> PG_head | | | 0 | -------------> | 0 | | | +-----------+ +-----------+ | | | 1 | ---------------^ ^ ^ ^ ^ ^ ^ | | +-----------+ | | | | | | | | | 2 | -----------------+ | | | | | | | +-----------+ | | | | | | | | 3 | -------------------+ | | | | | | +-----------+ | | | | | | | 4 | ---------------------+ | | | | 2MB | +-----------+ | | | | | | 5 | -----------------------+ | | | | +-----------+ | | | | | 6 | -------------------------+ | | | +-----------+ | | | | 7 | ---------------------------+ | | +-----------+ | | | | | | +-----------+ After we do this, all tail vmemmap pages (1-7) are mapped to the head vmemmap page frame (0). In other words, there are more than one page struct with PG_head associated with each HugeTLB page. We __know__ that there is only one head page struct, the tail page structs with PG_head are fake head page structs. We need an approach to distinguish between those two different types of page structs so that compound_head(), PageHead() and PageTail() can work properly if the parameter is the tail page struct but with PG_head. The following code snippet describes how to distinguish between real and fake head page struct. if (test_bit(PG_head, &page->flags)) { unsigned long head = READ_ONCE(page[1].compound_head); if (head & 1) { if (head == (unsigned long)page + 1) ==> head page struct else ==> tail page struct } else ==> head page struct } We can safely access the field of the @page[1] with PG_head because the @page is a compound page composed with at least two contiguous pages. [songmuchun@bytedance.com: restore lost comment changes] Link: https://lkml.kernel.org/r/20211101031651.75851-1-songmuchun@bytedance.com Link: https://lkml.kernel.org/r/20211101031651.75851-2-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Barry Song Cc: Mike Kravetz Cc: Oscar Salvador Cc: Michal Hocko Cc: David Hildenbrand Cc: Chen Huang Cc: Bodeddula Balasubramaniam Cc: Jonathan Corbet Cc: Matthew Wilcox Cc: Xiongchun Duan Cc: Fam Zheng Cc: Qi Zheng Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/kernel-parameters.txt | 2 +- include/linux/page-flags.h | 78 +++++++++++++++++++++++-- mm/hugetlb_vmemmap.c | 62 +++++++++++--------- mm/sparse-vmemmap.c | 21 +++++++ 4 files changed, 130 insertions(+), 33 deletions(-) commit 5c2a956c3eea173b2bc89f632507c0eeaebf6c4a Author: Miaohe Lin Date: Tue Mar 22 14:44:56 2022 -0700 mm/mlock: fix potential imbalanced rlimit ucounts adjustment user_shm_lock forgets to set allowed to 0 when get_ucounts fails. So the later user_shm_unlock might do the extra dec_rlimit_ucounts. Fix this by resetting allowed to 0. Link: https://lkml.kernel.org/r/20220310132417.41189-1-linmiaohe@huawei.com Fixes: d7c9e99aee48 ("Reimplement RLIMIT_MEMLOCK on top of ucounts") Signed-off-by: Miaohe Lin Reviewed-by: Andrew Morton Acked-by: Hugh Dickins Cc: Herbert van den Bergh Cc: Chris Mason Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mlock.c | 1 + 1 file changed, 1 insertion(+) commit 1e7a8181640a620300e98e22223ca3445b349840 Author: Vlastimil Babka Date: Tue Mar 22 14:44:53 2022 -0700 mm, fault-injection: declare should_fail_alloc_page() The mm/ directory can almost fully be built with W=1, which would help in local development. One remaining issue is missing prototype for should_fail_alloc_page(). Thus add it next to the should_failslab() prototype. Note the previous attempt by commit f7173090033c ("mm/page_alloc: make should_fail_alloc_page() static") had to be reverted by commit 54aa386661fe as it caused an unresolved symbol error with CONFIG_DEBUG_INFO_BTF=y Link: https://lkml.kernel.org/r/20220314165724.16071-1-vbabka@suse.cz Signed-off-by: Vlastimil Babka Cc: Mel Gorman Cc: Matthew Wilcox Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/fault-inject.h | 2 ++ 1 file changed, 2 insertions(+) commit bf6445bc8f778590ac754b06a8fe82ce5a9f818a Author: Miaohe Lin Date: Tue Mar 22 14:44:50 2022 -0700 mm/memory-failure.c: make non-LRU movable pages unhandlable We can not really handle non-LRU movable pages in memory failure. Typically they are balloon, zsmalloc, etc. Assuming we run into a base (4K) non-LRU movable page, we could reach as far as identify_page_state(), it should not fall into any category except me_unknown. For the non-LRU compound movable pages, they could be taken for transhuge pages but it's unexpected to split non-LRU movable pages using split_huge_page_to_list in memory_failure. So we could just simply make non-LRU movable pages unhandlable to avoid these possible nasty cases. Link: https://lkml.kernel.org/r/20220312074613.4798-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Suggested-by: Yang Shi Reviewed-by: Yang Shi Acked-by: Naoya Horiguchi Cc: Borislav Petkov Cc: Mike Kravetz Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) commit 593396b86ef6f79c71e09c183eae28040ccfeedf Author: Miaohe Lin Date: Tue Mar 22 14:44:47 2022 -0700 mm/memory-failure.c: avoid calling invalidate_inode_page() with unexpected pages Since commit 042c4f32323b ("mm/truncate: Inline invalidate_complete_page() into its one caller"), invalidate_inode_page() can invalidate the pages in the swap cache because the check of page->mapping != mapping is removed. But invalidate_inode_page() is not expected to deal with the pages in swap cache. Also non-lru movable page can reach here too. They're not page cache pages. Skip these pages by checking PageSwapCache and PageLRU. Link: https://lkml.kernel.org/r/20220312074613.4798-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Borislav Petkov Cc: Mike Kravetz Cc: Naoya Horiguchi Cc: Tony Luck Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 888af2701db79b9b27c7e37f9ede528a5ca53b76 Author: Miaohe Lin Date: Tue Mar 22 14:44:44 2022 -0700 mm/memory-failure.c: fix race with changing page compound again Patch series "A few fixup patches for memory failure", v2. This series contains a few patches to fix the race with changing page compound page, make non-LRU movable pages unhandlable and so on. More details can be found in the respective changelogs. There is a race window where we got the compound_head, the hugetlb page could be freed to buddy, or even changed to another compound page just before we try to get hwpoison page. Think about the below race window: CPU 1 CPU 2 memory_failure_hugetlb struct page *head = compound_head(p); hugetlb page might be freed to buddy, or even changed to another compound page. get_hwpoison_page -- page is not what we want now... If this race happens, just bail out. Also MF_MSG_DIFFERENT_PAGE_SIZE is introduced to record this event. [akpm@linux-foundation.org: s@/**@/*@, per Naoya Horiguchi] Link: https://lkml.kernel.org/r/20220312074613.4798-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220312074613.4798-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Cc: Tony Luck Cc: Borislav Petkov Cc: Mike Kravetz Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/mm.h | 1 + include/ras/ras_event.h | 1 + mm/memory-failure.c | 12 ++++++++++++ 3 files changed, 14 insertions(+) commit a06ad3c0c75297f0b0999b1a981e50224e690ee9 Author: luofei Date: Tue Mar 22 14:44:41 2022 -0700 mm/hwpoison: add in-use hugepage hwpoison filter judgement After successfully obtaining the reference count of the huge page, it is still necessary to call hwpoison_filter() to make a filter judgement, otherwise the filter hugepage will be unmaped and the related process may be killed. Link: https://lkml.kernel.org/r/20220223082254.2769757-1-luofei@unicloud.com Signed-off-by: luofei Reviewed-by: Miaohe Lin Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Naoya Horiguchi Cc: Thomas Gleixner Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit d1fe111fb62a1cf0446a2919f5effbb33ad0702c Author: luofei Date: Tue Mar 22 14:44:38 2022 -0700 mm/hwpoison: avoid the impact of hwpoison_filter() return value on mce handler When the hwpoison page meets the filter conditions, it should not be regarded as successful memory_failure() processing for mce handler, but should return a distinct value, otherwise mce handler regards the error page has been identified and isolated, which may lead to calling set_mce_nospec() to change page attribute, etc. Here memory_failure() return -EOPNOTSUPP to indicate that the error event is filtered, mce handler should not take any action for this situation and hwpoison injector should treat as correct. Link: https://lkml.kernel.org/r/20220223082135.2769649-1-luofei@unicloud.com Signed-off-by: luofei Acked-by: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Miaohe Lin Cc: Naoya Horiguchi Cc: Thomas Gleixner Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/x86/kernel/cpu/mce/core.c | 8 +++++--- drivers/base/memory.c | 2 ++ mm/hwpoison-inject.c | 3 ++- mm/madvise.c | 2 ++ mm/memory-failure.c | 9 +++++++-- 5 files changed, 18 insertions(+), 6 deletions(-) commit a581865ecd0a5a0b8464d6f1e668ae6681c1572f Author: Miaohe Lin Date: Tue Mar 22 14:44:35 2022 -0700 mm/hwpoison-inject: support injecting hwpoison to free page memory_failure() can handle free buddy page. Support injecting hwpoison to free page by adding is_free_buddy_page check when hwpoison filter is disabled. [akpm@linux-foundation.org: export is_free_buddy_page() to modules] Link: https://lkml.kernel.org/r/20220218092052.3853-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/hwpoison-inject.c | 4 ++-- mm/page_alloc.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) commit b04d3eebebf8372f83924db6c1e4fbdcab7cafc2 Author: Miaohe Lin Date: Tue Mar 22 14:44:33 2022 -0700 mm/memory-failure.c: remove unnecessary PageTransTail check When we reach here, we're guaranteed to have non-compound page as thp is already splited. Remove this unnecessary PageTransTail check. Link: https://lkml.kernel.org/r/20220218090118.1105-9-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2ab916790ff0bbaac557dc1238f08237dd7799cc Author: Miaohe Lin Date: Tue Mar 22 14:44:30 2022 -0700 mm/memory-failure.c: remove obsolete comment in __soft_offline_page Since commit add05cecef80 ("mm: soft-offline: don't free target page in successful page migration"), set_migratetype_isolate logic is removed. Remove this obsolete comment. Link: https://lkml.kernel.org/r/20220218090118.1105-8-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 4 ---- 1 file changed, 4 deletions(-) commit 357670f79efb7e520461d18bb093342605c7cbed Author: Miaohe Lin Date: Tue Mar 22 14:44:27 2022 -0700 mm/memory-failure.c: rework the try_to_unmap logic in hwpoison_user_mappings() Only for hugetlb pages in shared mappings, try_to_unmap should take semaphore in write mode here. Rework the code to make it clear. Link: https://lkml.kernel.org/r/20220218090118.1105-7-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) commit 67ff51c6a6d2ef99cf35a937e59269dc9a0c7fc2 Author: Miaohe Lin Date: Tue Mar 22 14:44:24 2022 -0700 mm/memory-failure.c: remove PageSlab check in hwpoison_filter_dev Since commit 03e5ac2fc3bf ("mm: fix crash when using XFS on loopback"), page_mapping() can handle the Slab pages. So remove this unnecessary PageSlab check and obsolete comment. Link: https://lkml.kernel.org/r/20220218090118.1105-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 6 ------ 1 file changed, 6 deletions(-) commit 75ee64b3c9a9695726056e9ec527e11dbf286500 Author: Miaohe Lin Date: Tue Mar 22 14:44:21 2022 -0700 mm/memory-failure.c: fix race with changing page more robustly We're only intended to deal with the non-Compound page after we split thp in memory_failure. However, the page could have changed compound pages due to race window. If this happens, we could retry once to hopefully handle the page next round. Also remove unneeded orig_head. It's always equal to the hpage. So we can use hpage directly and remove this redundant one. Link: https://lkml.kernel.org/r/20220218090118.1105-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) commit 49775047cf52a92e41444d41a0584180ec2c256b Author: Miaohe Lin Date: Tue Mar 22 14:44:18 2022 -0700 mm/memory-failure.c: rework the signaling logic in kill_proc BUS_MCEERR_AR code is only sent when MF_ACTION_REQUIRED is set and the target is current. Rework the code to make this clear. Link: https://lkml.kernel.org/r/20220218090118.1105-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) commit a994402bc4714cefea5770b2d906cef5b0f4dc5c Author: Miaohe Lin Date: Tue Mar 22 14:44:15 2022 -0700 mm/memory-failure.c: catch unexpected -EFAULT from vma_address() It's unexpected to walk the page table when vma_address() return -EFAULT. But dev_pagemap_mapping_shift() is called only when vma associated to the error page is found already in collect_procs_{file,anon}, so vma_address() should not return -EFAULT except with some bug, as Naoya pointed out. We can use VM_BUG_ON_VMA() to catch this bug here. Link: https://lkml.kernel.org/r/20220218090118.1105-3-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 1 + 1 file changed, 1 insertion(+) commit 577553f4897181dc8960351511c921018892e818 Author: Miaohe Lin Date: Tue Mar 22 14:44:12 2022 -0700 mm/memory-failure.c: minor clean up for memory_failure_dev_pagemap Patch series "A few cleanup and fixup patches for memory failure", v3. This series contains a few patches to simplify the code logic, remove unneeded variable and remove obsolete comment. Also we fix race changing page more robustly in memory_failure. More details can be found in the respective changelogs. This patch (of 8): The flags always has MF_ACTION_REQUIRED and MF_MUST_KILL set. So we do not need to check these flags again. Link: https://lkml.kernel.org/r/20220218090118.1105-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20220218090118.1105-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e53ac7374e64dede04d745ff0e70ff5048378d1f Author: Rik van Riel Date: Tue Mar 22 14:44:09 2022 -0700 mm: invalidate hwpoison page cache page in fault path Sometimes the page offlining code can leave behind a hwpoisoned clean page cache page. This can lead to programs being killed over and over and over again as they fault in the hwpoisoned page, get killed, and then get re-spawned by whatever wanted to run them. This is particularly embarrassing when the page was offlined due to having too many corrected memory errors. Now we are killing tasks due to them trying to access memory that probably isn't even corrupted. This problem can be avoided by invalidating the page from the page fault handler, which already has a branch for dealing with these kinds of pages. With this patch we simply pretend the page fault was successful if the page was invalidated, return to userspace, incur another page fault, read in the file from disk (to a new memory page), and then everything works again. Link: https://lkml.kernel.org/r/20220212213740.423efcea@imladris.surriel.com Signed-off-by: Rik van Riel Reviewed-by: Miaohe Lin Acked-by: Naoya Horiguchi Reviewed-by: Oscar Salvador Cc: John Hubbard Cc: Mel Gorman Cc: Johannes Weiner Cc: Matthew Wilcox Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 046545a661af2beec21de7b90ca0e35f05088a81 Author: Naoya Horiguchi Date: Tue Mar 22 14:44:06 2022 -0700 mm/hwpoison: fix error page recovered but reported "not recovered" When an uncorrected memory error is consumed there is a race between the CMCI from the memory controller reporting an uncorrected error with a UCNA signature, and the core reporting and SRAR signature machine check when the data is about to be consumed. If the CMCI wins that race, the page is marked poisoned when uc_decode_notifier() calls memory_failure() and the machine check processing code finds the page already poisoned. It calls kill_accessing_process() to make sure a SIGBUS is sent. But returns the wrong error code. Console log looks like this: mce: Uncorrected hardware memory error in user-access at 3710b3400 Memory failure: 0x3710b3: recovery action for dirty LRU page: Recovered Memory failure: 0x3710b3: already hardware poisoned Memory failure: 0x3710b3: Sending SIGBUS to einj_mem_uc:361438 due to hardware memory corruption mce: Memory error not recovered kill_accessing_process() is supposed to return -EHWPOISON to notify that SIGBUS is already set to the process and kill_me_maybe() doesn't have to send it again. But current code simply fails to do this, so fix it to make sure to work as intended. This change avoids the noise message "Memory error not recovered" and skips duplicate SIGBUSs. [tony.luck@intel.com: reword some parts of commit message] Link: https://lkml.kernel.org/r/20220113231117.1021405-1-naoya.horiguchi@linux.dev Fixes: a3f5d80ea401 ("mm,hwpoison: send SIGBUS with error virutal address") Signed-off-by: Naoya Horiguchi Reported-by: Youquan Song Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit ae483c20062695324202d19e5283819b11b83eaa Author: Naoya Horiguchi Date: Tue Mar 22 14:44:03 2022 -0700 mm/memory-failure.c: remove obsolete comment With the introduction of mf_mutex, most of memory error handling process is mutually exclusive, so the in-line comment about subtlety about double-checking PageHWPoison is no more correct. So remove it. Link: https://lkml.kernel.org/r/20220125025601.3054511-1-naoya.horiguchi@linux.dev Signed-off-by: Naoya Horiguchi Suggested-by: Mike Kravetz Reviewed-by: Miaohe Lin Reviewed-by: Anshuman Khandual Reviewed-by: Oscar Salvador Reviewed-by: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory-failure.c | 6 ------ 1 file changed, 6 deletions(-) commit 77fe7f136a7312954b1b8b7eeb4bc91fc3c14a3f Author: Mel Gorman Date: Tue Mar 22 14:44:00 2022 -0700 mm/page_alloc: check high-order pages for corruption during PCP operations Eric Dumazet pointed out that commit 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") only checks the head page during PCP refill and allocation operations. This was an oversight and all pages should be checked. This will incur a small performance penalty but it's necessary for correctness. Link: https://lkml.kernel.org/r/20220310092456.GJ15701@techsingularity.net Fixes: 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") Signed-off-by: Mel Gorman Reported-by: Eric Dumazet Acked-by: Eric Dumazet Reviewed-by: Shakeel Butt Acked-by: Vlastimil Babka Acked-by: David Rientjes Cc: Michal Hocko Cc: Wei Xu Cc: Greg Thelen Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) commit 3313204c8ad553cf93f1ee8cc89456c73a7df938 Author: Eric Dumazet Date: Tue Mar 22 14:43:57 2022 -0700 mm/page_alloc: call check_new_pages() while zone spinlock is not held For high order pages not using pcp, rmqueue() is currently calling the costly check_new_pages() while zone spinlock is held, and hard irqs masked. This is not needed, we can release the spinlock sooner to reduce zone spinlock contention. Note that after this patch, we call __mod_zone_freepage_state() before deciding to leak the page because it is in bad state. Link: https://lkml.kernel.org/r/20220304170215.1868106-1-eric.dumazet@gmail.com Signed-off-by: Eric Dumazet Reviewed-by: Shakeel Butt Acked-by: David Rientjes Acked-by: Mel Gorman Reviewed-by: Vlastimil Babka Cc: Michal Hocko Cc: Wei Xu Cc: Greg Thelen Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit fa7fc75f6319dcd044e332ad309a86126a610bdf Author: Suren Baghdasaryan Date: Tue Mar 22 14:43:54 2022 -0700 mm: count time in drain_all_pages during direct reclaim as memory pressure When page allocation in direct reclaim path fails, the system will make one attempt to shrink per-cpu page lists and free pages from high alloc reserves. Draining per-cpu pages into buddy allocator can be a very slow operation because it's done using workqueues and the task in direct reclaim waits for all of them to finish before proceeding. Currently this time is not accounted as psi memory stall. While testing mobile devices under extreme memory pressure, when allocations are failing during direct reclaim, we notices that psi events which would be expected in such conditions were not triggered. After profiling these cases it was determined that the reason for missing psi events was that a big chunk of time spent in direct reclaim is not accounted as memory stall, therefore psi would not reach the levels at which an event is generated. Further investigation revealed that the bulk of that unaccounted time was spent inside drain_all_pages call. A typical captured case when drain_all_pages path gets activated: __alloc_pages_slowpath took 44.644.613ns __perform_reclaim took 751.668ns (1.7%) drain_all_pages took 43.887.167ns (98.3%) PSI in this case records the time spent in __perform_reclaim but ignores drain_all_pages, IOW it misses 98.3% of the time spent in __alloc_pages_slowpath. Annotate __alloc_pages_direct_reclaim in its entirety so that delays from handling page allocation failure in the direct reclaim path are accounted as memory stall. Link: https://lkml.kernel.org/r/20220223194812.1299646-1-surenb@google.com Signed-off-by: Suren Baghdasaryan Reported-by: Tim Murray Acked-by: Johannes Weiner Acked-by: Michal Hocko Reviewed-by: Shakeel Butt Cc: Petr Mladek Cc: Peter Zijlstra Cc: Roman Gushchin Cc: Minchan Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 1ca75fa7f19d694c58af681fa023295072b03120 Author: Oscar Salvador Date: Tue Mar 22 14:43:51 2022 -0700 arch/x86/mm/numa: Do not initialize nodes twice On x86, prior to ("mm: handle uninitialized numa nodes gracecully"), NUMA nodes could be allocated at three different places. - numa_register_memblks - init_cpu_to_node - init_gi_nodes All these calls happen at setup_arch, and have the following order: setup_arch ... x86_numa_init numa_init numa_register_memblks ... init_cpu_to_node init_memory_less_node alloc_node_data free_area_init_memoryless_node init_gi_nodes init_memory_less_node alloc_node_data free_area_init_memoryless_node numa_register_memblks() is only interested in those nodes which have memory, so it skips over any memoryless node it founds. Later on, when we have read ACPI's SRAT table, we call init_cpu_to_node() and init_gi_nodes(), which initialize any memoryless node we might have that have either CPU or Initiator affinity, meaning we allocate pg_data_t struct for them and we mark them as ONLINE. So far so good, but the thing is that after ("mm: handle uninitialized numa nodes gracefully"), we allocate all possible NUMA nodes in free_area_init(), meaning we have a picture like the following: setup_arch x86_numa_init numa_init numa_register_memblks <-- allocate non-memoryless node x86_init.paging.pagetable_init ... free_area_init free_area_init_memoryless <-- allocate memoryless node init_cpu_to_node alloc_node_data <-- allocate memoryless node with CPU free_area_init_memoryless_node init_gi_nodes alloc_node_data <-- allocate memoryless node with Initiator free_area_init_memoryless_node free_area_init() already allocates all possible NUMA nodes, but init_cpu_to_node() and init_gi_nodes() are clueless about that, so they go ahead and allocate a new pg_data_t struct without checking anything, meaning we end up allocating twice. It should be mad clear that this only happens in the case where memoryless NUMA node happens to have a CPU/Initiator affinity. So get rid of init_memory_less_node() and just set the node online. Note that setting the node online is needed, otherwise we choke down the chain when bringup_nonboot_cpus() ends up calling __try_online_node()->register_one_node()->... and we blow up in bus_add_device(). As can be seen here: BUG: kernel NULL pointer dereference, address: 0000000000000060 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.17.0-rc4-1-default+ #45 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/4 RIP: 0010:bus_add_device+0x5a/0x140 Code: 8b 74 24 20 48 89 df e8 84 96 ff ff 85 c0 89 c5 75 38 48 8b 53 50 48 85 d2 0f 84 bb 00 004 RSP: 0000:ffffc9000022bd10 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff888100987400 RCX: ffff8881003e4e19 RDX: ffff8881009a5e00 RSI: ffff888100987400 RDI: ffff888100987400 RBP: 0000000000000000 R08: ffff8881003e4e18 R09: ffff8881003e4c98 R10: 0000000000000000 R11: ffff888100402bc0 R12: ffffffff822ceba0 R13: 0000000000000000 R14: ffff888100987400 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88853fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000060 CR3: 000000000200a001 CR4: 00000000001706b0 Call Trace: device_add+0x4c0/0x910 __register_one_node+0x97/0x2d0 __try_online_node+0x85/0xc0 try_online_node+0x25/0x40 cpu_up+0x4f/0x100 bringup_nonboot_cpus+0x4f/0x60 smp_init+0x26/0x79 kernel_init_freeable+0x130/0x2f1 kernel_init+0x17/0x150 ret_from_fork+0x22/0x30 The reason is simple, by the time bringup_nonboot_cpus() gets called, we did not register the node_subsys bus yet, so we crash when bus_add_device() tries to dereference bus()->p. The following shows the order of the calls: kernel_init_freeable smp_init bringup_nonboot_cpus ... bus_add_device() <- we did not register node_subsys yet do_basic_setup do_initcalls postcore_initcall(register_node_type); register_node_type subsys_system_register subsys_register bus_register <- register node_subsys bus Why setting the node online saves us then? Well, simply because __try_online_node() backs off when the node is online, meaning we do not end up calling register_one_node() in the first place. This is subtle, broken and deserves a deep analysis and thought about how to put this into shape, but for now let us have this easy fix for the leaking memory issue. [osalvador@suse.de: add comments] Link: https://lkml.kernel.org/r/20220221142649.3457-1-osalvador@suse.de Link: https://lkml.kernel.org/r/20220218224302.5282-2-osalvador@suse.de Fixes: da4490c958ad ("mm: handle uninitialized numa nodes gracefully") Signed-off-by: Oscar Salvador Acked-by: Michal Hocko Cc: David Hildenbrand Cc: Rafael Aquini Cc: Dave Hansen Cc: Wei Yang Cc: Dennis Zhou Cc: Alexey Makhalov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/x86/mm/numa.c | 33 ++++++++++++++++++++------------- include/linux/mm.h | 1 - mm/page_alloc.c | 2 +- 3 files changed, 21 insertions(+), 15 deletions(-) commit 2a791f4412cba41330453527a3045cf39818e72a Author: Mel Gorman Date: Tue Mar 22 14:43:48 2022 -0700 mm/page_alloc: do not prefetch buddies during bulk free free_pcppages_bulk() has taken two passes through the pcp lists since commit 0a5f4e5b4562 ("mm/free_pcppages_bulk: do not hold lock when picking pages to free") due to deferring the cost of selecting PCP lists until the zone lock is held. As the list processing now takes place under the zone lock, it's less clear that this will always benefit for two reasons. 1. There is a guaranteed cost to calculating the buddy which definitely has to be calculated again. However, as the zone lock is held and there is no deferring of buddy merging, there is no guarantee that the prefetch will have completed when the second buddy calculation takes place and buddies are being merged. With or without the prefetch, there may be further stalls depending on how many pages get merged. In other words, a stall due to merging is inevitable and at best only one stall might be avoided at the cost of calculating the buddy location twice. 2. As the zone lock is held, prefetch_nr makes less sense as once prefetch_nr expires, the cache lines of interest have already been merged. The main concern is that there is a definite cost to calculating the buddy location early for the prefetch and it is a "maybe win" depending on whether the CPU prefetch logic and memory is fast enough. Remove the prefetch logic on the basis that reduced instructions in a path is always a saving where as the prefetch might save one memory stall depending on the CPU and memory. In most cases, this has marginal benefit as the calculations are a small part of the overall freeing of pages. However, it was detectable on at least one machine. 5.17.0-rc3 5.17.0-rc3 mm-highpcplimit-v2r1 mm-noprefetch-v1r1 Min elapsed 630.00 ( 0.00%) 610.00 ( 3.17%) Amean elapsed 639.00 ( 0.00%) 623.00 * 2.50%* Max elapsed 660.00 ( 0.00%) 660.00 ( 0.00%) Link: https://lkml.kernel.org/r/20220221094119.15282-2-mgorman@techsingularity.net Signed-off-by: Mel Gorman Suggested-by: Aaron Lu Reviewed-by: Vlastimil Babka Reviewed-by: Aaron Lu Cc: Dave Hansen Cc: Michal Hocko Cc: Jesper Dangaard Brouer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 24 ------------------------ 1 file changed, 24 deletions(-) commit f26b3fa046116a7dedcaafe30083402113941451 Author: Mel Gorman Date: Tue Mar 22 14:43:45 2022 -0700 mm/page_alloc: limit number of high-order pages on PCP during bulk free When a PCP is mostly used for frees then high-order pages can exist on PCP lists for some time. This is problematic when the allocation pattern is all allocations from one CPU and all frees from another resulting in colder pages being used. When bulk freeing pages, limit the number of high-order pages that are stored on the PCP lists. Netperf running on localhost exhibits this pattern and while it does not matter for some machines, it does matter for others with smaller caches where cache misses cause problems due to reduced page reuse. Pages freed directly to the buddy list may be reused quickly while still cache hot where as storing on the PCP lists may be cold by the time free_pcppages_bulk() is called. Using perf kmem:mm_page_alloc, the 5 most used page frames were 5.17-rc3 13041 pfn=0x111a30 13081 pfn=0x5814d0 13097 pfn=0x108258 13121 pfn=0x689598 13128 pfn=0x5814d8 5.17-revert-highpcp 192009 pfn=0x54c140 195426 pfn=0x1081d0 200908 pfn=0x61c808 243515 pfn=0xa9dc20 402523 pfn=0x222bb8 5.17-full-series 142693 pfn=0x346208 162227 pfn=0x13bf08 166413 pfn=0x2711e0 166950 pfn=0x2702f8 The spread is wider as there is still time before pages freed to one PCP get released with a tradeoff between fast reuse and reduced zone lock acquisition. On the machine used to gather the traces, the headline performance was equivalent. netperf-tcp 5.17.0-rc3 5.17.0-rc3 5.17.0-rc3 vanilla mm-reverthighpcp-v1r1 mm-highpcplimit-v2 Hmean 64 839.93 ( 0.00%) 840.77 ( 0.10%) 841.02 ( 0.13%) Hmean 128 1614.22 ( 0.00%) 1622.07 * 0.49%* 1636.41 * 1.37%* Hmean 256 2952.00 ( 0.00%) 2953.19 ( 0.04%) 2977.76 * 0.87%* Hmean 1024 10291.67 ( 0.00%) 10239.17 ( -0.51%) 10434.41 * 1.39%* Hmean 2048 17335.08 ( 0.00%) 17399.97 ( 0.37%) 17134.81 * -1.16%* Hmean 3312 22628.15 ( 0.00%) 22471.97 ( -0.69%) 22422.78 ( -0.91%) Hmean 4096 25009.50 ( 0.00%) 24752.83 * -1.03%* 24740.41 ( -1.08%) Hmean 8192 32745.01 ( 0.00%) 31682.63 * -3.24%* 32153.50 * -1.81%* Hmean 16384 39759.59 ( 0.00%) 36805.78 * -7.43%* 38948.13 * -2.04%* On a 1-socket skylake machine with a small CPU cache that suffers more if cache misses are too high netperf-tcp 5.17.0-rc3 5.17.0-rc3 5.17.0-rc3 vanilla mm-reverthighpcp-v1 mm-highpcplimit-v2 Hmean 64 938.95 ( 0.00%) 941.50 * 0.27%* 943.61 * 0.50%* Hmean 128 1843.10 ( 0.00%) 1857.58 * 0.79%* 1861.09 * 0.98%* Hmean 256 3573.07 ( 0.00%) 3667.45 * 2.64%* 3674.91 * 2.85%* Hmean 1024 13206.52 ( 0.00%) 13487.80 * 2.13%* 13393.21 * 1.41%* Hmean 2048 22870.23 ( 0.00%) 23337.96 * 2.05%* 23188.41 * 1.39%* Hmean 3312 31001.99 ( 0.00%) 32206.50 * 3.89%* 31863.62 * 2.78%* Hmean 4096 35364.59 ( 0.00%) 36490.96 * 3.19%* 36112.54 * 2.11%* Hmean 8192 48497.71 ( 0.00%) 49954.05 * 3.00%* 49588.26 * 2.25%* Hmean 16384 58410.86 ( 0.00%) 60839.80 * 4.16%* 62282.96 * 6.63%* Note that this was a machine that did not benefit from caching high-order pages and performance is almost restored with the series applied. It's not fully restored as cache misses are still higher. This is a trade-off between optimising for a workload that does all allocs on one CPU and frees on another or more general workloads that need high-order pages for SLUB and benefit from avoiding zone->lock for every SLUB refill/drain. Link: https://lkml.kernel.org/r/20220217002227.5739-7-mgorman@techsingularity.net Signed-off-by: Mel Gorman Reviewed-by: Vlastimil Babka Tested-by: Aaron Lu Cc: Dave Hansen Cc: Jesper Dangaard Brouer Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) commit 8b10b465d0e18b002b290b2162145abc7167e53d Author: Mel Gorman Date: Tue Mar 22 14:43:42 2022 -0700 mm/page_alloc: free pages in a single pass during bulk free free_pcppages_bulk() has taken two passes through the pcp lists since commit 0a5f4e5b4562 ("mm/free_pcppages_bulk: do not hold lock when picking pages to free") due to deferring the cost of selecting PCP lists until the zone lock is held. Now that list selection is simplier, the main cost during selection is bulkfree_pcp_prepare() which in the normal case is a simple check and prefetching. As the list manipulations have cost in itself, go back to freeing pages in a single pass. The series up to this point was evaulated using a trunc microbenchmark that is truncating sparse files stored in page cache (mmtests config config-io-trunc). Sparse files were used to limit filesystem interaction. The results versus a revert of storing high-order pages in the PCP lists is 1-socket Skylake 5.17.0-rc3 5.17.0-rc3 5.17.0-rc3 vanilla mm-reverthighpcp-v1 mm-highpcpopt-v2 Min elapsed 540.00 ( 0.00%) 530.00 ( 1.85%) 530.00 ( 1.85%) Amean elapsed 543.00 ( 0.00%) 530.00 * 2.39%* 530.00 * 2.39%* Stddev elapsed 4.83 ( 0.00%) 0.00 ( 100.00%) 0.00 ( 100.00%) CoeffVar elapsed 0.89 ( 0.00%) 0.00 ( 100.00%) 0.00 ( 100.00%) Max elapsed 550.00 ( 0.00%) 530.00 ( 3.64%) 530.00 ( 3.64%) BAmean-50 elapsed 540.00 ( 0.00%) 530.00 ( 1.85%) 530.00 ( 1.85%) BAmean-95 elapsed 542.22 ( 0.00%) 530.00 ( 2.25%) 530.00 ( 2.25%) BAmean-99 elapsed 542.22 ( 0.00%) 530.00 ( 2.25%) 530.00 ( 2.25%) 2-socket CascadeLake 5.17.0-rc3 5.17.0-rc3 5.17.0-rc3 vanilla mm-reverthighpcp-v1 mm-highpcpopt-v2 Min elapsed 510.00 ( 0.00%) 500.00 ( 1.96%) 500.00 ( 1.96%) Amean elapsed 529.00 ( 0.00%) 521.00 ( 1.51%) 510.00 * 3.59%* Stddev elapsed 16.63 ( 0.00%) 12.87 ( 22.64%) 11.55 ( 30.58%) CoeffVar elapsed 3.14 ( 0.00%) 2.47 ( 21.46%) 2.26 ( 27.99%) Max elapsed 550.00 ( 0.00%) 540.00 ( 1.82%) 530.00 ( 3.64%) BAmean-50 elapsed 516.00 ( 0.00%) 512.00 ( 0.78%) 500.00 ( 3.10%) BAmean-95 elapsed 526.67 ( 0.00%) 518.89 ( 1.48%) 507.78 ( 3.59%) BAmean-99 elapsed 526.67 ( 0.00%) 518.89 ( 1.48%) 507.78 ( 3.59%) The original motivation for multi-passes was will-it-scale page_fault1 using $nr_cpu processes. 2-socket CascadeLake (40 cores, 80 CPUs HT enabled) 5.17.0-rc3 5.17.0-rc3 vanilla mm-highpcpopt-v2 Hmean page_fault1-processes-2 2694662.26 ( 0.00%) 2695780.35 ( 0.04%) Hmean page_fault1-processes-5 6425819.34 ( 0.00%) 6435544.57 * 0.15%* Hmean page_fault1-processes-8 9642169.10 ( 0.00%) 9658962.39 ( 0.17%) Hmean page_fault1-processes-12 12167502.10 ( 0.00%) 12190163.79 ( 0.19%) Hmean page_fault1-processes-21 15636859.03 ( 0.00%) 15612447.26 ( -0.16%) Hmean page_fault1-processes-30 25157348.61 ( 0.00%) 25169456.65 ( 0.05%) Hmean page_fault1-processes-48 27694013.85 ( 0.00%) 27671111.46 ( -0.08%) Hmean page_fault1-processes-79 25928742.64 ( 0.00%) 25934202.02 ( 0.02%) <-- Hmean page_fault1-processes-110 25730869.75 ( 0.00%) 25671880.65 * -0.23%* Hmean page_fault1-processes-141 25626992.42 ( 0.00%) 25629551.61 ( 0.01%) Hmean page_fault1-processes-172 25611651.35 ( 0.00%) 25614927.99 ( 0.01%) Hmean page_fault1-processes-203 25577298.75 ( 0.00%) 25583445.59 ( 0.02%) Hmean page_fault1-processes-234 25580686.07 ( 0.00%) 25608240.71 ( 0.11%) Hmean page_fault1-processes-265 25570215.47 ( 0.00%) 25568647.58 ( -0.01%) Hmean page_fault1-processes-296 25549488.62 ( 0.00%) 25543935.00 ( -0.02%) Hmean page_fault1-processes-320 25555149.05 ( 0.00%) 25575696.74 ( 0.08%) The differences are mostly within the noise and the difference close to $nr_cpus is negligible. Link: https://lkml.kernel.org/r/20220217002227.5739-6-mgorman@techsingularity.net Signed-off-by: Mel Gorman Reviewed-by: Vlastimil Babka Tested-by: Aaron Lu Cc: Dave Hansen Cc: Jesper Dangaard Brouer Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 56 +++++++++++++++++++++----------------------------------- 1 file changed, 21 insertions(+), 35 deletions(-) commit d61372bc41cfe91d6170434fc44b6af49cd2c755 Author: Mel Gorman Date: Tue Mar 22 14:43:38 2022 -0700 mm/page_alloc: drain the requested list first during bulk free Prior to the series, pindex 0 (order-0 MIGRATE_UNMOVABLE) was always skipped first and the precise reason is forgotten. A potential reason may have been to artificially preserve MIGRATE_UNMOVABLE but there is no reason why that would be optimal as it depends on the workload. The more likely reason is that it was less complicated to do a pre-increment instead of a post-increment in terms of overall code flow. As free_pcppages_bulk() now typically receives the pindex of the PCP list that exceeded high, always start draining that list. Link: https://lkml.kernel.org/r/20220217002227.5739-5-mgorman@techsingularity.net Signed-off-by: Mel Gorman Reviewed-by: Vlastimil Babka Tested-by: Aaron Lu Cc: Dave Hansen Cc: Jesper Dangaard Brouer Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 4 ++++ 1 file changed, 4 insertions(+) commit fd56eef258a17bbc8eda2ca773fa538f354c5f49 Author: Mel Gorman Date: Tue Mar 22 14:43:36 2022 -0700 mm/page_alloc: simplify how many pages are selected per pcp list during bulk free free_pcppages_bulk() selects pages to free by round-robining between lists. Originally this was to evenly shrink pages by migratetype but uneven freeing is inevitable due to high pages. Simplify list selection by starting with a list that definitely has pages on it in free_unref_page_commit() and for drain, it does not matter where draining starts as all pages are removed. Link: https://lkml.kernel.org/r/20220217002227.5739-4-mgorman@techsingularity.net Signed-off-by: Mel Gorman Reviewed-by: Vlastimil Babka Tested-by: Aaron Lu Cc: Dave Hansen Cc: Jesper Dangaard Brouer Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) commit 35b6d770e6334aa470080570f0f81c8b74a07afd Author: Mel Gorman Date: Tue Mar 22 14:43:33 2022 -0700 mm/page_alloc: track range of active PCP lists during bulk free free_pcppages_bulk() frees pages in a round-robin fashion. Originally, this was dealing only with migratetypes but storing high-order pages means that there can be many more empty lists that are uselessly checked. Track the minimum and maximum active pindex to reduce the search space. Link: https://lkml.kernel.org/r/20220217002227.5739-3-mgorman@techsingularity.net Signed-off-by: Mel Gorman Reviewed-by: Vlastimil Babka Tested-by: Aaron Lu Cc: Dave Hansen Cc: Jesper Dangaard Brouer Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) commit ca7b59b1de72450b3e696bada3506a519ac5455c Author: Mel Gorman Date: Tue Mar 22 14:43:30 2022 -0700 mm/page_alloc: fetch the correct pcp buddy during bulk free Patch series "Follow-up on high-order PCP caching", v2. Commit 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") was primarily aimed at reducing the cost of SLUB cache refills of high-order pages in two ways. Firstly, zone lock acquisitions was reduced and secondly, there were fewer buddy list modifications. This is a follow-up series fixing some issues that became apparant after merging. Patch 1 is a functional fix. It's harmless but inefficient. Patches 2-5 reduce the overhead of bulk freeing of PCP pages. While the overhead is small, it's cumulative and noticable when truncating large files. The changelog for patch 4 includes results of a microbench that deletes large sparse files with data in page cache. Sparse files were used to eliminate filesystem overhead. Patch 6 addresses issues with high-order PCP pages being stored on PCP lists for too long. Pages freed on a CPU potentially may not be quickly reused and in some cases this can increase cache miss rates. Details are included in the changelog. This patch (of 6): free_pcppages_bulk() prefetches buddies about to be freed but the order must also be passed in as PCP lists store multiple orders. Link: https://lkml.kernel.org/r/20220217002227.5739-1-mgorman@techsingularity.net Link: https://lkml.kernel.org/r/20220217002227.5739-2-mgorman@techsingularity.net Fixes: 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") Signed-off-by: Mel Gorman Reviewed-by: Vlastimil Babka Reviewed-by: Aaron Lu Tested-by: Aaron Lu Cc: Dave Hansen Cc: Michal Hocko Cc: Jesper Dangaard Brouer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit ddbc84f3f595cf1fc8234a191193b5d20ad43938 Author: Alistair Popple Date: Tue Mar 22 14:43:26 2022 -0700 mm/pages_alloc.c: don't create ZONE_MOVABLE beyond the end of a node ZONE_MOVABLE uses the remaining memory in each node. Its starting pfn is also aligned to MAX_ORDER_NR_PAGES. It is possible for the remaining memory in a node to be less than MAX_ORDER_NR_PAGES, meaning there is not enough room for ZONE_MOVABLE on that node. Unfortunately this condition is not checked for. This leads to zone_movable_pfn[] getting set to a pfn greater than the last pfn in a node. calculate_node_totalpages() then sets zone->present_pages to be greater than zone->spanned_pages which is invalid, as spanned_pages represents the maximum number of pages in a zone assuming no holes. Subsequently it is possible free_area_init_core() will observe a zone of size zero with present pages. In this case it will skip setting up the zone, including the initialisation of free_lists[]. However populated_zone() checks zone->present_pages to see if a zone has memory available. This is used by iterators such as walk_zones_in_node(). pagetypeinfo_showfree() uses this to walk the free_list of each zone in each node, which are assumed to be initialised due to the zone not being empty. As free_area_init_core() never initialised the free_lists[] this results in the following kernel crash when trying to read /proc/pagetypeinfo: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC NOPTI CPU: 0 PID: 456 Comm: cat Not tainted 5.16.0 #461 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 RIP: 0010:pagetypeinfo_show+0x163/0x460 Code: 9e 82 e8 80 57 0e 00 49 8b 06 b9 01 00 00 00 4c 39 f0 75 16 e9 65 02 00 00 48 83 c1 01 48 81 f9 a0 86 01 00 0f 84 48 02 00 00 <48> 8b 00 4c 39 f0 75 e7 48 c7 c2 80 a2 e2 82 48 c7 c6 79 ef e3 82 RSP: 0018:ffffc90001c4bd10 EFLAGS: 00010003 RAX: 0000000000000000 RBX: ffff88801105f638 RCX: 0000000000000001 RDX: 0000000000000001 RSI: 000000000000068b RDI: ffff8880163dc68b RBP: ffffc90001c4bd90 R08: 0000000000000001 R09: ffff8880163dc67e R10: 656c6261766f6d6e R11: 6c6261766f6d6e55 R12: ffff88807ffb4a00 R13: ffff88807ffb49f8 R14: ffff88807ffb4580 R15: ffff88807ffb3000 FS: 00007f9c83eff5c0(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000013c8e000 CR4: 0000000000350ef0 Call Trace: seq_read_iter+0x128/0x460 proc_reg_read_iter+0x51/0x80 new_sync_read+0x113/0x1a0 vfs_read+0x136/0x1d0 ksys_read+0x70/0xf0 __x64_sys_read+0x1a/0x20 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Fix this by checking that the aligned zone_movable_pfn[] does not exceed the end of the node, and if it does skip creating a movable zone on this node. Link: https://lkml.kernel.org/r/20220215025831.2113067-1-apopple@nvidia.com Fixes: 2a1e274acf0b ("Create the ZONE_MOVABLE zone") Signed-off-by: Alistair Popple Acked-by: David Hildenbrand Acked-by: Mel Gorman Cc: John Hubbard Cc: Zi Yan Cc: Anshuman Khandual Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit a4812d47deff0642b3315f0528d579f0a99c45c2 Author: Nathan Chancellor Date: Tue Mar 22 14:43:23 2022 -0700 mm/page_alloc: mark pagesets as __maybe_unused Commit 9983a9d577db ("locking/local_lock: Make the empty local_lock_*() function a macro.") in the -tip tree converted the local_lock_*() functions into macros, which causes a warning with clang with CONFIG_PREEMPT_RT=n + CONFIG_DEBUG_LOCK_ALLOC=n: mm/page_alloc.c:131:40: error: variable 'pagesets' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static DEFINE_PER_CPU(struct pagesets, pagesets) = { ^ 1 error generated. Prior to that change, clang was not able to tell that pagesets was unused in this configuration because it does not perform cross function analysis in the frontend. After that change, it sees that the macros just do a typecheck on the lock member of pagesets, which is evaluated at compile time (so the variable is technically "used"), meaning the variable is not needed in the final assembly, as the warning states. Mark the variable as __maybe_unused to make it clear to clang that this is expected in this configuration so there is no more warning. Link: https://github.com/ClangBuiltLinux/linux/issues/1593 Link: https://lkml.kernel.org/r/20220215184322.440969-1-nathan@kernel.org Signed-off-by: Nathan Chancellor Suggested-by: Nick Desaulniers Reported-by: "kernelci.org bot" Cc: Sebastian Andrzej Siewior Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b3d40a2b6d10c9d0424d2b398bf962fb6adad87e Author: David Hildenbrand Date: Tue Mar 22 14:43:20 2022 -0700 mm: enforce pageblock_order < MAX_ORDER Some places in the kernel don't really expect pageblock_order >= MAX_ORDER, and it looks like this is only possible in corner cases: 1) CONFIG_DEFERRED_STRUCT_PAGE_INIT we'll end up freeing pageblock_order pages via __free_pages_core(), which cannot possibly work. 2) find_zone_movable_pfns_for_nodes() will roundup the ZONE_MOVABLE start PFN to MAX_ORDER_NR_PAGES. Consequently with a bigger pageblock_order, we could have a single pageblock partially managed by two zones. 3) compaction code runs into __fragmentation_index() with order >= MAX_ORDER, when checking WARN_ON_ONCE(order >= MAX_ORDER). [1] 4) mm/page_reporting.c won't be reporting any pages with default page_reporting_order == pageblock_order, as we'll be skipping the reporting loop inside page_reporting_process_zone(). 5) __rmqueue_fallback() will never be able to steal with ALLOC_NOFRAGMENT. pageblock_order >= MAX_ORDER is weird either way: it's a pure optimization for making alloc_contig_range(), as used for allcoation of gigantic pages, a little more reliable to succeed. However, if there is demand for somewhat reliable allocation of gigantic pages, affected setups should be using CMA or boottime allocations instead. So let's make sure that pageblock_order < MAX_ORDER and simplify. [1] https://lkml.kernel.org/r/87r189a2ks.fsf@linux.ibm.com Link: https://lkml.kernel.org/r/20220214174132.219303-3-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Zi Yan Cc: Aneesh Kumar K.V Cc: Benjamin Herrenschmidt Cc: Christoph Hellwig Cc: Frank Rowand Cc: John Garry via iommu Cc: Marek Szyprowski Cc: Michael Ellerman Cc: Michael S. Tsirkin Cc: Minchan Kim Cc: Paul Mackerras Cc: Rob Herring Cc: Robin Murphy Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds drivers/virtio/virtio_mem.c | 9 +++------ include/linux/cma.h | 3 +-- include/linux/pageblock-flags.h | 7 +++++-- mm/Kconfig | 3 +++ mm/page_alloc.c | 32 ++++++++------------------------ 5 files changed, 20 insertions(+), 34 deletions(-) commit e16faf26780fc0c8dd693ea9ee8420a7706cb2f5 Author: David Hildenbrand Date: Tue Mar 22 14:43:17 2022 -0700 cma: factor out minimum alignment requirement Patch series "mm: enforce pageblock_order < MAX_ORDER". Having pageblock_order >= MAX_ORDER seems to be able to happen in corner cases and some parts of the kernel are not prepared for it. For example, Aneesh has shown [1] that such kernels can be compiled on ppc64 with 64k base pages by setting FORCE_MAX_ZONEORDER=8, which will run into a WARN_ON_ONCE(order >= MAX_ORDER) in comapction code right during boot. We can get pageblock_order >= MAX_ORDER when the default hugetlb size is bigger than the maximum allocation granularity of the buddy, in which case we are no longer talking about huge pages but instead gigantic pages. Having pageblock_order >= MAX_ORDER can only make alloc_contig_range() of such gigantic pages more likely to succeed. Reliable use of gigantic pages either requires boot time allcoation or CMA, no need to overcomplicate some places in the kernel to optimize for corner cases that are broken in other areas of the kernel. This patch (of 2): Let's enforce pageblock_order < MAX_ORDER and simplify. Especially patch #1 can be regarded a cleanup before: [PATCH v5 0/6] Use pageblock_order for cma and alloc_contig_range alignment. [2] [1] https://lkml.kernel.org/r/87r189a2ks.fsf@linux.ibm.com [2] https://lkml.kernel.org/r/20220211164135.1803616-1-zi.yan@sent.com Link: https://lkml.kernel.org/r/20220214174132.219303-2-david@redhat.com Signed-off-by: David Hildenbrand Reviewed-by: Zi Yan Acked-by: Rob Herring Cc: Aneesh Kumar K.V Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Frank Rowand Cc: Michael S. Tsirkin Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: Robin Murphy Cc: Minchan Kim Cc: Vlastimil Babka Cc: John Garry via iommu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/powerpc/include/asm/fadump-internal.h | 5 ----- arch/powerpc/kernel/fadump.c | 2 +- drivers/of/of_reserved_mem.c | 9 +++------ include/linux/cma.h | 9 +++++++++ kernel/dma/contiguous.c | 4 +--- mm/cma.c | 20 +++++--------------- 6 files changed, 19 insertions(+), 30 deletions(-) commit 566513775dca7f0d4ba15da4bc8394cdb2c98829 Author: Nicolas Saenz Julienne Date: Tue Mar 22 14:43:14 2022 -0700 mm/page_alloc: don't pass pfn to free_unref_page_commit() free_unref_page_commit() doesn't make use of its pfn argument, so get rid of it. Link: https://lkml.kernel.org/r/20220202140451.415928-1-nsaenzju@redhat.com Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Vlastimil Babka Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page_alloc.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) commit 7f37e49cbd60ef71b82d25cd55b039a65d06387c Author: Miaohe Lin Date: Tue Mar 22 14:43:11 2022 -0700 mm/mmzone.h: remove unused macros Remove pgdat_page_nr, nid_page_nr and NODE_MEM_MAP. They are unused now. Link: https://lkml.kernel.org/r/20220127093210.62293-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand Reviewed-by: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/mmzone.h | 7 ------- 1 file changed, 7 deletions(-) commit abe8b2ae64a31146748239a1525ffb275c4f360f Author: Peter Collingbourne Date: Tue Mar 22 14:43:08 2022 -0700 mm/mmzone.c: use try_cmpxchg() in page_cpupid_xchg_last() This will let us avoid an additional read from page->flags when retrying the compare-exchange on some architectures. Link: https://lkml.kernel.org/r/20220120011200.1322836-1-pcc@google.com Link: https://linux-review.googlesource.com/id/I2e1f5b5b080ac9c4e0eb7f98768dba6fd7821693 Signed-off-by: Peter Collingbourne Suggested-by: Peter Zijlstra Cc: Andrey Konovalov Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mmzone.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 1dd214b8f21ca46d5431be9b2db8513c59e07a26 Author: Zi Yan Date: Tue Mar 22 14:43:05 2022 -0700 mm: page_alloc: avoid merging non-fallbackable pageblocks with others This is done in addition to MIGRATE_ISOLATE pageblock merge avoidance. It prepares for the upcoming removal of the MAX_ORDER-1 alignment requirement for CMA and alloc_contig_range(). MIGRATE_HIGHATOMIC should not merge with other migratetypes like MIGRATE_ISOLATE and MIGRARTE_CMA[1], so this commit prevents that too. Remove MIGRATE_CMA and MIGRATE_ISOLATE from fallbacks list, since they are never used. [1] https://lore.kernel.org/linux-mm/20211130100853.GP3366@techsingularity.net/ Link: https://lkml.kernel.org/r/20220124175957.1261961-1-zi.yan@sent.com Signed-off-by: Zi Yan Acked-by: Mel Gorman Acked-by: David Hildenbrand Acked-by: Vlastimil Babka Acked-by: Mike Rapoport Reviewed-by: Oscar Salvador Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/mmzone.h | 11 +++++++++++ mm/page_alloc.c | 44 +++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 23 deletions(-) commit ff11a7ce1f0f8c1e7870de26860024b4ddbf5755 Author: Bang Li Date: Tue Mar 22 14:43:02 2022 -0700 mm/vmalloc: fix comments about vmap_area struct The vmap_area_root should be in the "busy" tree and the free_vmap_area_root should be in the "free" tree. Link: https://lkml.kernel.org/r/20220305011510.33596-1-libang.linuxer@gmail.com Fixes: 688fcbfc06e4 ("mm/vmalloc: modify struct vmap_area to reduce its size") Signed-off-by: Bang Li Reviewed-by: Uladzislau Rezki (Sony) Cc: Pengfei Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/vmalloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c3385e845824b8d435f1f323ebd38031fdec4590 Author: Jiapeng Chong Date: Tue Mar 22 14:42:59 2022 -0700 mm/vmalloc.c: fix "unused function" warning compute_subtree_max_size() is unused, when building with DEBUG_AUGMENT_PROPAGATE_CHECK=y. mm/vmalloc.c:785:1: warning: unused function 'compute_subtree_max_size' [-Wunused-function]. Link: https://lkml.kernel.org/r/20220129034652.75359-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Jiapeng Chong Reported-by: Abaci Robot Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/vmalloc.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) commit c3d77172dfc04c8443c327e8acb83e683f8c0193 Author: Uladzislau Rezki (Sony) Date: Tue Mar 22 14:42:56 2022 -0700 mm/vmalloc: eliminate an extra orig_gfp_mask That extra variable has been introduced just for keeping an original passed gfp_mask because it is updated with __GFP_NOWARN on entry, thus error handling messages were broken. Instead we can keep an original gfp_mask without modifying it and add an extra __GFP_NOWARN flag together with gfp_mask as a parameter to the vm_area_alloc_pages() function. It will make it less confused. Link: https://lkml.kernel.org/r/20220119143540.601149-3-urezki@gmail.com Signed-off-by: Uladzislau Rezki (Sony) Cc: Vasily Averin Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Nicholas Piggin Cc: Oleksiy Avramchenko Cc: Uladzislau Rezki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/vmalloc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit 9333fe98d0a61a590cc076bcc21711f59ed8d972 Author: Uladzislau Rezki Date: Tue Mar 22 14:42:53 2022 -0700 mm/vmalloc: add adjust_search_size parameter Extend the find_vmap_lowest_match() function with one more parameter. It is "adjust_search_size" boolean variable, so it is possible to control an accuracy of search block if a specific alignment is required. With this patch, a search size is always adjusted, to serve a request as fast as possible because of performance reason. But there is one exception though, it is short ranges where requested size corresponds to passed vstart/vend restriction together with a specific alignment request. In such scenario an adjustment wold not lead to success allocation. Link: https://lkml.kernel.org/r/20220119143540.601149-2-urezki@gmail.com Signed-off-by: Uladzislau Rezki Signed-off-by: Uladzislau Rezki (Sony) Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Nicholas Piggin Cc: Oleksiy Avramchenko Cc: Vasily Averin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/vmalloc.c | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) commit 690467c81b1a49de38a4b89eedc0ae85015f4c79 Author: Uladzislau Rezki (Sony) Date: Tue Mar 22 14:42:50 2022 -0700 mm/vmalloc: Move draining areas out of caller context A caller initiates the drain procces from its context once the drain threshold is reached or passed. There are at least two drawbacks of doing so: a) a caller can be a high-prio or RT task. In that case it can stuck in doing the actual drain of all lazily freed areas. This is not optimal because such tasks usually are latency sensitive where the control should be returned back as soon as possible in order to drive such workloads in time. See 96e2db456135 ("mm/vmalloc: rework the drain logic") b) It is not safe to call vfree() during holding a spinlock due to the vmap_purge_lock mutex. The was a report about this from Zeal Robot here: https://lore.kernel.org/all/20211222081026.484058-1-chi.minghao@zte.com.cn Moving the drain to the separate work context addresses those issues. v1->v2: - Added prefix "_work" to the drain worker function. v2->v3: - Remove the drain_vmap_work_in_progress. Extra queuing is expectable under heavy load but it can be disregarded because a work will bail out if nothing to be done. Link: https://lkml.kernel.org/r/20220131144058.35608-1-urezki@gmail.com Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Christoph Hellwig Cc: Matthew Wilcox Cc: Nicholas Piggin Cc: Oleksiy Avramchenko Cc: Uladzislau Rezki Cc: Vasily Averin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/vmalloc.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) commit 651d55ce096543c52f7e589d04dfa7393f90ff47 Author: Miaohe Lin Date: Tue Mar 22 14:42:47 2022 -0700 mm/vmalloc: remove unneeded function forward declaration The forward declaration for lazy_max_pages() is unnecessary. Remove it. Link: https://lkml.kernel.org/r/20220124133752.60663-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Uladzislau Rezki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/vmalloc.c | 1 - 1 file changed, 1 deletion(-) commit c7878534a1b61c5cc2effa3a539099f2cf87cd3a Author: Miaohe Lin Date: Tue Mar 22 14:42:44 2022 -0700 mm/sparse: make mminit_validate_memmodel_limits() static It's only used in the sparse.c now. So we can make it static and further clean up the relevant code. Link: https://lkml.kernel.org/r/20220127093221.63524-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/internal.h | 11 ----------- mm/sparse.c | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) commit 0e6799db9672dcdc995b0f4bfa5cde4420868c93 Author: Miaohe Lin Date: Tue Mar 22 14:42:41 2022 -0700 mm/mremap:: use vma_lookup() instead of find_vma() Using vma_lookup() verifies the address is contained in the found vma. This results in easier to read code. Link: https://lkml.kernel.org/r/20220312083118.48284-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Andrew Morton Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mremap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 360cd06173d6f139581b6b7cf322f66884860e0f Author: Miaohe Lin Date: Tue Mar 22 14:42:39 2022 -0700 mm/mmap: remove obsolete comment in ksys_mmap_pgoff RLIMIT_MEMLOCK is already reimplemented on top of ucounts now. And since commit 83c1fd763b32 ("mm,hugetlb: remove mlock ulimit for SHM_HUGETLB"), mlock ulimit for SHM_HUGETLB is further removed. So we should remove this obsolete comment. Link: https://lkml.kernel.org/r/20220309090623.13036-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mmap.c | 2 -- 1 file changed, 2 deletions(-) commit 1fc09228846dd41444bb1ac50995d1e6c3332015 Author: Hugh Dickins Date: Tue Mar 22 14:42:36 2022 -0700 mm: _install_special_mapping() apply VM_LOCKED_CLEAR_MASK _install_special_mapping() adds the VM_SPECIAL bit VM_DONTEXPAND (and never attempts to update locked_vm), so it ought to be consistent with mmap_region() and mlock_fixup(), making sure not to add VM_LOCKED or VM_LOCKONFAULT. I doubt that this fixes any problem in practice: just do it for consistency. Link: https://lkml.kernel.org/r/a85315a9-21d1-6133-c5fc-c89863dfb25b@google.com Signed-off-by: Hugh Dickins Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mmap.c | 1 + 1 file changed, 1 insertion(+) commit f9871da927437dc85bc3fec206fc9bfddea4a34b Author: Miaohe Lin Date: Tue Mar 22 14:42:33 2022 -0700 mm/memory.c: use helper macro min and max in unmap_mapping_range_tree() Use helper macro min and max to help simplify the code logic. Minor readability improvement. Link: https://lkml.kernel.org/r/20220224121134.35068-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) commit 88a359125a2b8f2437f09ab3b1af4815c89690d4 Author: Miaohe Lin Date: Tue Mar 22 14:42:30 2022 -0700 mm/memory.c: use helper function range_in_vma() Use helper function range_in_vma() to check if address, address + size are within the vma range. Minor readability improvement. Link: https://lkml.kernel.org/r/20220219021441.29173-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e6d094936988910ce6e8197570f2753898830081 Author: Randy Dunlap Date: Tue Mar 22 14:42:27 2022 -0700 mm/mmap: return 1 from stack_guard_gap __setup() handler __setup() handlers should return 1 if the command line option is handled and 0 if not (or maybe never return 0; it just pollutes init's environment). This prevents: Unknown kernel command line parameters \ "BOOT_IMAGE=/boot/bzImage-517rc5 stack_guard_gap=100", will be \ passed to user space. Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc5 stack_guard_gap=100 Return 1 to indicate that the boot option has been handled. Note that there is no warning message if someone enters: stack_guard_gap=anything_invalid and 'val' and stack_guard_gap are both set to 0 due to the use of simple_strtoul(). This could be improved by using kstrtoxxx() and checking for an error. It appears that having stack_guard_gap == 0 is valid (if unexpected) since using "stack_guard_gap=0" on the kernel command line does that. Link: https://lkml.kernel.org/r/20220222005817.11087-1-rdunlap@infradead.org Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Fixes: 1be7107fbe18e ("mm: larger stack guard gap, between vmas") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8018db8525947c2eeb9990a27ca0a50eecbfcd41 Author: Peter Xu Date: Tue Mar 22 14:42:24 2022 -0700 mm: rework swap handling of zap_pte_range Clean the code up by merging the device private/exclusive swap entry handling with the rest, then we merge the pte clear operation too. struct* page is defined in multiple places in the function, move it upward. free_swap_and_cache() is only useful for !non_swap_entry() case, put it into the condition. No functional change intended. Link: https://lkml.kernel.org/r/20220216094810.60572-5-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: John Hubbard Cc: David Hildenbrand Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Yang Shi Cc: Andrea Arcangeli Cc: Alistair Popple Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) commit 2e148f1e3d9af3270c602fc7571a90b297204fde Author: Peter Xu Date: Tue Mar 22 14:42:21 2022 -0700 mm: change zap_details.zap_mapping into even_cows Currently we have a zap_mapping pointer maintained in zap_details, when it is specified we only want to zap the pages that has the same mapping with what the caller has specified. But what we want to do is actually simpler: we want to skip zapping private (COW-ed) pages in some cases. We can refer to unmap_mapping_pages() callers where we could have passed in different even_cows values. The other user is unmap_mapping_folio() where we always want to skip private pages. According to Hugh, we used a mapping pointer for historical reason, as explained here: https://lore.kernel.org/lkml/391aa58d-ce84-9d4-d68d-d98a9c533255@google.com/ Quoting partly from Hugh: Which raises the question again of why I did not just use a boolean flag there originally: aah, I think I've found why. In those days there was a horrible "optimization", for better performance on some benchmark I guess, which when you read from /dev/zero into a private mapping, would map the zero page there (look up read_zero_pagealigned() and zeromap_page_range() if you dare). So there was another category of page to be skipped along with the anon COWs, and I didn't want multiple tests in the zap loop, so checking check_mapping against page->mapping did both. I think nowadays you could do it by checking for PageAnon page (or genuine swap entry) instead. This patch replaces the zap_details.zap_mapping pointer into the even_cows boolean, then we check it against PageAnon. Link: https://lkml.kernel.org/r/20220216094810.60572-4-peterx@redhat.com Signed-off-by: Peter Xu Suggested-by: Hugh Dickins Reviewed-by: John Hubbard Cc: David Hildenbrand Cc: Alistair Popple Cc: Andrea Arcangeli Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) commit 254ab940eb017e75574afc80951eb63bb74e0d34 Author: Peter Xu Date: Tue Mar 22 14:42:18 2022 -0700 mm: rename zap_skip_check_mapping() to should_zap_page() The previous name is against the natural way people think. Invert the meaning and also the return value. No functional change intended. Link: https://lkml.kernel.org/r/20220216094810.60572-3-peterx@redhat.com Signed-off-by: Peter Xu Suggested-by: David Hildenbrand Suggested-by: Hugh Dickins Reviewed-by: David Hildenbrand Reviewed-by: John Hubbard Cc: Alistair Popple Cc: Andrea Arcangeli Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) commit 5abfd71d936a8aefd9f9ccd299dea7a164a5d455 Author: Peter Xu Date: Tue Mar 22 14:42:15 2022 -0700 mm: don't skip swap entry even if zap_details specified Patch series "mm: Rework zap ptes on swap entries", v5. Patch 1 should fix a long standing bug for zap_pte_range() on zap_details usage. The risk is we could have some swap entries skipped while we should have zapped them. Migration entries are not the major concern because file backed memory always zap in the pattern that "first time without page lock, then re-zap with page lock" hence the 2nd zap will always make sure all migration entries are already recovered. However there can be issues with real swap entries got skipped errornoously. There's a reproducer provided in commit message of patch 1 for that. Patch 2-4 are cleanups that are based on patch 1. After the whole patchset applied, we should have a very clean view of zap_pte_range(). Only patch 1 needs to be backported to stable if necessary. This patch (of 4): The "details" pointer shouldn't be the token to decide whether we should skip swap entries. For example, when the callers specified details->zap_mapping==NULL, it means the user wants to zap all the pages (including COWed pages), then we need to look into swap entries because there can be private COWed pages that was swapped out. Skipping some swap entries when details is non-NULL may lead to wrongly leaving some of the swap entries while we should have zapped them. A reproducer of the problem: ===8<=== #define _GNU_SOURCE /* See feature_test_macros(7) */ #include #include #include #include #include int page_size; int shmem_fd; char *buffer; void main(void) { int ret; char val; page_size = getpagesize(); shmem_fd = memfd_create("test", 0); assert(shmem_fd >= 0); ret = ftruncate(shmem_fd, page_size * 2); assert(ret == 0); buffer = mmap(NULL, page_size * 2, PROT_READ | PROT_WRITE, MAP_PRIVATE, shmem_fd, 0); assert(buffer != MAP_FAILED); /* Write private page, swap it out */ buffer[page_size] = 1; madvise(buffer, page_size * 2, MADV_PAGEOUT); /* This should drop private buffer[page_size] already */ ret = ftruncate(shmem_fd, page_size); assert(ret == 0); /* Recover the size */ ret = ftruncate(shmem_fd, page_size * 2); assert(ret == 0); /* Re-read the data, it should be all zero */ val = buffer[page_size]; if (val == 0) printf("Good\n"); else printf("BUG\n"); } ===8<=== We don't need to touch up the pmd path, because pmd never had a issue with swap entries. For example, shmem pmd migration will always be split into pte level, and same to swapping on anonymous. Add another helper should_zap_cows() so that we can also check whether we should zap private mappings when there's no page pointer specified. This patch drops that trick, so we handle swap ptes coherently. Meanwhile we should do the same check upon migration entry, hwpoison entry and genuine swap entries too. To be explicit, we should still remember to keep the private entries if even_cows==false, and always zap them when even_cows==true. The issue seems to exist starting from the initial commit of git. [peterx@redhat.com: comment tweaks] Link: https://lkml.kernel.org/r/20220217060746.71256-2-peterx@redhat.com Link: https://lkml.kernel.org/r/20220217060746.71256-1-peterx@redhat.com Link: https://lkml.kernel.org/r/20220216094810.60572-1-peterx@redhat.com Link: https://lkml.kernel.org/r/20220216094810.60572-2-peterx@redhat.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Peter Xu Reviewed-by: John Hubbard Cc: David Hildenbrand Cc: Hugh Dickins Cc: Alistair Popple Cc: Andrea Arcangeli Cc: "Kirill A . Shutemov" Cc: Matthew Wilcox Cc: Vlastimil Babka Cc: Yang Shi Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) commit 3150be8fa89e4d1064d250bb3f8ea3665d1ec5e9 Author: Muchun Song Date: Tue Mar 22 14:42:11 2022 -0700 mm: replace multiple dcache flush with flush_dcache_folio() Simplify the code by using flush_dcache_folio(). Link: https://lkml.kernel.org/r/20220210123058.79206-8-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Cc: Axel Rasmussen Cc: David Rientjes Cc: Fam Zheng Cc: Kirill A. Shutemov Cc: Lars Persson Cc: Peter Xu Cc: Xiongchun Duan Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/migrate.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) commit 7c25a0b89a487878b0691e6524fb5a8827322194 Author: Muchun Song Date: Tue Mar 22 14:42:08 2022 -0700 mm: userfaultfd: fix missing cache flush in mcopy_atomic_pte() and __mcopy_atomic() userfaultfd calls mcopy_atomic_pte() and __mcopy_atomic() which do not do any cache flushing for the target page. Then the target page will be mapped to the user space with a different address (user address), which might have an alias issue with the kernel address used to copy the data from the user to. Fix this by insert flush_dcache_page() after copy_from_user() succeeds. Link: https://lkml.kernel.org/r/20220210123058.79206-7-songmuchun@bytedance.com Fixes: b6ebaedb4cb1 ("userfaultfd: avoid mmap_sem read recursion in mcopy_atomic") Fixes: c1a4de99fada ("userfaultfd: mcopy_atomic|mfill_zeropage: UFFDIO_COPY|UFFDIO_ZEROPAGE preparation") Signed-off-by: Muchun Song Cc: Axel Rasmussen Cc: David Rientjes Cc: Fam Zheng Cc: Kirill A. Shutemov Cc: Lars Persson Cc: Mike Kravetz Cc: Peter Xu Cc: Xiongchun Duan Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/userfaultfd.c | 3 +++ 1 file changed, 3 insertions(+) commit 19b482c29b6f3805f1d8e93015847b89e2f7f3b1 Author: Muchun Song Date: Tue Mar 22 14:42:05 2022 -0700 mm: shmem: fix missing cache flush in shmem_mfill_atomic_pte() userfaultfd calls shmem_mfill_atomic_pte() which does not do any cache flushing for the target page. Then the target page will be mapped to the user space with a different address (user address), which might have an alias issue with the kernel address used to copy the data from the user to. Insert flush_dcache_page() in non-zero-page case. And replace clear_highpage() with clear_user_highpage() which already considers the cache maintenance. Link: https://lkml.kernel.org/r/20220210123058.79206-6-songmuchun@bytedance.com Fixes: 8d1039634206 ("userfaultfd: shmem: add shmem_mfill_zeropage_pte for userfaultfd support") Fixes: 4c27fe4c4c84 ("userfaultfd: shmem: add shmem_mcopy_atomic_pte for userfaultfd support") Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Cc: Axel Rasmussen Cc: David Rientjes Cc: Fam Zheng Cc: Kirill A. Shutemov Cc: Lars Persson Cc: Peter Xu Cc: Xiongchun Duan Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/shmem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 348923665a0e50ad9fc0b3bb8127d3cb976691cc Author: Muchun Song Date: Tue Mar 22 14:42:02 2022 -0700 mm: hugetlb: fix missing cache flush in hugetlb_mcopy_atomic_pte() folio_copy() will copy the data from one page to the target page, then the target page will be mapped to the user space address, which might have an alias issue with the kernel address used to copy the data from the page to. There are 2 ways to fix this issue. 1) insert flush_dcache_page() after folio_copy(). 2) replace folio_copy() with copy_user_huge_page() which already considers the cache maintenance. We chose 2) way to fix the issue since architectures can optimize this situation. It is also make backports easier. Link: https://lkml.kernel.org/r/20220210123058.79206-5-songmuchun@bytedance.com Fixes: 8cc5fcbb5be8 ("mm, hugetlb: fix racy resv_huge_pages underflow on UFFDIO_COPY") Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Cc: Axel Rasmussen Cc: David Rientjes Cc: Fam Zheng Cc: Kirill A. Shutemov Cc: Lars Persson Cc: Peter Xu Cc: Xiongchun Duan Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/hugetlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e763243cc6cb1fcc720ec58cfd6e7c35ae90a479 Author: Muchun Song Date: Tue Mar 22 14:41:59 2022 -0700 mm: hugetlb: fix missing cache flush in copy_huge_page_from_user() userfaultfd calls copy_huge_page_from_user() which does not do any cache flushing for the target page. Then the target page will be mapped to the user space with a different address (user address), which might have an alias issue with the kernel address used to copy the data from the user to. Fix this issue by flushing dcache in copy_huge_page_from_user(). Link: https://lkml.kernel.org/r/20220210123058.79206-4-songmuchun@bytedance.com Fixes: fa4d75c1de13 ("userfaultfd: hugetlbfs: add copy_huge_page_from_user for hugetlb userfaultfd support") Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Cc: Axel Rasmussen Cc: David Rientjes Cc: Fam Zheng Cc: Kirill A. Shutemov Cc: Lars Persson Cc: Peter Xu Cc: Xiongchun Duan Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memory.c | 2 ++ 1 file changed, 2 insertions(+) commit 2771739a7162782c0aa6424b2e3dd874e884a15d Author: Muchun Song Date: Tue Mar 22 14:41:56 2022 -0700 mm: fix missing cache flush for all tail pages of compound page The D-cache maintenance inside move_to_new_page() only consider one page, there is still D-cache maintenance issue for tail pages of compound page (e.g. THP or HugeTLB). THP migration is only enabled on x86_64, ARM64 and powerpc, while powerpc and arm64 need to maintain the consistency between I-Cache and D-Cache, which depends on flush_dcache_page() to maintain the consistency between I-Cache and D-Cache. But there is no issues on arm64 and powerpc since they already considers the compound page cache flushing in their icache flush function. HugeTLB migration is enabled on arm, arm64, mips, parisc, powerpc, riscv, s390 and sh, while arm has handled the compound page cache flush in flush_dcache_page(), but most others do not. In theory, the issue exists on many architectures. Fix this by not using flush_dcache_folio() since it is not backportable. Link: https://lkml.kernel.org/r/20220210123058.79206-3-songmuchun@bytedance.com Fixes: 290408d4a250 ("hugetlb: hugepage migration core") Signed-off-by: Muchun Song Reviewed-by: Zi Yan Cc: Axel Rasmussen Cc: David Rientjes Cc: Fam Zheng Cc: Kirill A. Shutemov Cc: Lars Persson Cc: Mike Kravetz Cc: Peter Xu Cc: Xiongchun Duan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/migrate.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 5cbcf2258b71cbae358961796c3a879e1b06a9ff Author: Muchun Song Date: Tue Mar 22 14:41:53 2022 -0700 mm: thp: fix wrong cache flush in remove_migration_pmd() Patch series "Fix some cache flush bugs", v5. This series focuses on fixing cache maintenance. This patch (of 7): The flush_cache_range() is supposed to be justified only if the page is already placed in process page table, and that is done right after flush_cache_range(). So using this interface is wrong. And there is no need to invalite cache since it was non-present before in remove_migration_pmd(). So just to remove it. Link: https://lkml.kernel.org/r/20220210123058.79206-1-songmuchun@bytedance.com Link: https://lkml.kernel.org/r/20220210123058.79206-2-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Zi Yan Cc: Kirill A. Shutemov Cc: David Rientjes Cc: Lars Persson Cc: Mike Kravetz Cc: Zi Yan Cc: Xiongchun Duan Cc: Fam Zheng Cc: Muchun Song Cc: Axel Rasmussen Cc: Peter Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/huge_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit d6d224429a86a62263d0944f79c36dce010a4ebb Author: Stafford Horne Date: Tue Mar 22 14:41:50 2022 -0700 mm: remove mmu_gathers storage from remaining architectures Originally the mmu_gathers were removed in commit 1c3951769621 ("mm: now that all old mmu_gather code is gone, remove the storage"). However, the openrisc and hexagon architecture were merged around the same time and mmu_gathers was not removed. This patch removes them from openrisc, hexagon and nds32: Noticed while cleaning this warning: arch/openrisc/mm/init.c:41:1: warning: symbol 'mmu_gathers' was not declared. Should it be static? Link: https://lkml.kernel.org/r/20220205141956.3315419-1-shorne@gmail.com Signed-off-by: Stafford Horne Acked-by: Mike Rapoport Cc: Brian Cain Cc: Nick Hu Cc: Greentime Hu Cc: Vincent Chen Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Russell King Cc: David Hildenbrand Cc: Dave Hansen Cc: Kefeng Wang Cc: Christophe Leroy Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/hexagon/mm/init.c | 2 -- arch/nds32/mm/init.c | 1 - arch/openrisc/mm/init.c | 2 -- 3 files changed, 5 deletions(-) commit 16785bd7743104d57257a455001172b75afa7614 Author: Anshuman Khandual Date: Tue Mar 22 14:41:47 2022 -0700 mm: merge pte_mkhuge() call into arch_make_huge_pte() Each call into pte_mkhuge() is invariably followed by arch_make_huge_pte(). Instead arch_make_huge_pte() can accommodate pte_mkhuge() at the beginning. This updates generic fallback stub for arch_make_huge_pte() and available platforms definitions. This makes huge pte creation much cleaner and easier to follow. Link: https://lkml.kernel.org/r/1643860669-26307-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Reviewed-by: Christophe Leroy Acked-by: Mike Kravetz Acked-by: Catalin Marinas Cc: Will Deacon Cc: Michael Ellerman Cc: Paul Mackerras Cc: "David S. Miller" Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds arch/arm64/mm/hugetlbpage.c | 1 + arch/powerpc/include/asm/nohash/32/hugetlb-8xx.h | 4 ++-- arch/sparc/mm/hugetlbpage.c | 1 + include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 3 +-- mm/vmalloc.c | 1 - 6 files changed, 6 insertions(+), 6 deletions(-) commit ef696f93ed9778d570bd5ac58414421cdd4f1aab Author: Guillaume Tucker Date: Tue Mar 22 14:41:44 2022 -0700 selftests, x86: fix how check_cc.sh is being invoked The $(CC) variable used in Makefiles could contain several arguments such as "ccache gcc". These need to be passed as a single string to check_cc.sh, otherwise only the first argument will be used as the compiler command. Without quotes, the $(CC) variable is passed as distinct arguments which causes the script to fail to build trivial programs. Fix this by adding quotes around $(CC) when calling check_cc.sh to pass the whole string as a single argument to the script even if it has several words such as "ccache gcc". Link: https://lkml.kernel.org/r/d0d460d7be0107a69e3c52477761a6fe694c1840.1646991629.git.guillaume.tucker@collabora.com Fixes: e9886ace222e ("selftests, x86: Rework x86 target architecture detection") Signed-off-by: Guillaume Tucker Tested-by: "kernelci.org bot" Reviewed-by: Guenter Roeck Cc: Shuah Khan Cc: Borislav Petkov Cc: Dave Hansen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/vm/Makefile | 6 +++--- tools/testing/selftests/x86/Makefile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) commit c72d85923c62aa9d4e8c50d05189d9e116aa2628 Author: Vasily Averin Date: Tue Mar 22 14:41:41 2022 -0700 memcg: enable accounting for tty-related objects At each login the user forces the kernel to create a new terminal and allocate up to ~1Kb memory for the tty-related structures. By default it's allowed to create up to 4096 ptys with 1024 reserve for initial mount namespace only and the settings are controlled by host admin. Though this default is not enough for hosters with thousands of containers per node. Host admin can be forced to increase it up to NR_UNIX98_PTY_MAX = 1<<20. By default container is restricted by pty mount_opt.max = 1024, but admin inside container can change it via remount. As a result, one container can consume almost all allowed ptys and allocate up to 1Gb of unaccounted memory. It is not enough per-se to trigger OOM on host, however anyway, it allows to significantly exceed the assigned memcg limit and leads to troubles on the over-committed node. It makes sense to account for them to restrict the host's memory consumption from inside the memcg-limited container. Link: https://lkml.kernel.org/r/5d4bca06-7d4f-a905-e518-12981ebca1b3@virtuozzo.com Signed-off-by: Vasily Averin Cc: Michal Hocko Cc: Shakeel Butt Cc: Johannes Weiner Cc: Vladimir Davydov Cc: Roman Gushchin Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds drivers/tty/tty_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7c52f65de40ff0e44f821559eb61931d368a4c48 Author: Muchun Song Date: Tue Mar 22 14:41:38 2022 -0700 mm: memcontrol: rename memcg_cache_id to memcg_kmem_id The memcg_cache_id() introduced by commit 2633d7a02823 ("slab/slub: consider a memcg parameter in kmem_create_cache") is used to index in the kmem_cache->memcg_params->memcg_caches array. Since kmem_cache->memcg_params.memcg_caches has been removed by commit 9855609bde03 ("mm: memcg/slab: use a single set of kmem_caches for all accounted allocations"). So the name does not need to reflect cache related. Just rename it to memcg_kmem_id. And it can reflect kmem related. Link: https://lkml.kernel.org/r/20220228122126.37293-17-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Roman Gushchin Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/memcontrol.h | 4 ++-- mm/list_lru.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) commit d70110704d2d52a65a9fe43be409d8c3acce79fe Author: Muchun Song Date: Tue Mar 22 14:41:35 2022 -0700 mm: list_lru: rename list_lru_per_memcg to list_lru_memcg The name of list_lru_memcg was occupied before and became free since last commit. Rename list_lru_per_memcg to list_lru_memcg since the name is brief. Link: https://lkml.kernel.org/r/20220228122126.37293-16-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Roman Gushchin Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/list_lru.h | 2 +- mm/list_lru.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) commit be740503ed03ea04ca362330baf082e6a38fe462 Author: Muchun Song Date: Tue Mar 22 14:41:31 2022 -0700 mm: memcontrol: fix cannot alloc the maximum memcg ID The idr_alloc() does not include @max ID. So in the current implementation, the maximum memcg ID is 65534 instead of 65535. It seems a bug. So fix this. Link: https://lkml.kernel.org/r/20220228122126.37293-15-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Roman Gushchin Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit f9c69d6346bc6934369c80b316fa277bc96ffa77 Author: Muchun Song Date: Tue Mar 22 14:41:28 2022 -0700 mm: memcontrol: reuse memory cgroup ID for kmem ID There are two idrs being used by memory cgroup, one is for kmem ID, another is for memory cgroup ID. The maximum ID of both is 64Ki. Both of them can limit the total number of memory cgroups. Actually, we can reuse memory cgroup ID for kmem ID to simplify the code. Link: https://lkml.kernel.org/r/20220228122126.37293-14-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Roman Gushchin Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) commit bbca91cca9a902de2e9907370e9c1e0a3d1aab0f Author: Muchun Song Date: Tue Mar 22 14:41:25 2022 -0700 mm: list_lru: replace linear array with xarray If we run 10k containers in the system, the size of the list_lru_memcg->lrus can be ~96KB per list_lru. When we decrease the number containers, the size of the array will not be shrinked. It is not scalable. The xarray is a good choice for this case. We can save a lot of memory when there are tens of thousands continers in the system. If we use xarray, we also can remove the logic code of resizing array, which can simplify the code. [akpm@linux-foundation.org: remove unused local] Link: https://lkml.kernel.org/r/20220228122126.37293-13-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Roman Gushchin Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/list_lru.h | 13 +-- include/linux/memcontrol.h | 23 ----- mm/list_lru.c | 203 +++++++++++++++------------------------------ mm/memcontrol.c | 77 ++--------------- 4 files changed, 73 insertions(+), 243 deletions(-) commit 1f391eb270791359ee79031945dbe3afeaec6ce3 Author: Muchun Song Date: Tue Mar 22 14:41:22 2022 -0700 mm: list_lru: rename memcg_drain_all_list_lrus to memcg_reparent_list_lrus The purpose of the memcg_drain_all_list_lrus() is list_lrus reparenting. It is very similar to memcg_reparent_objcgs(). Rename it to memcg_reparent_list_lrus() so that the name can more consistent with memcg_reparent_objcgs(). Link: https://lkml.kernel.org/r/20220228122126.37293-12-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Roman Gushchin Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/list_lru.h | 2 +- mm/list_lru.c | 24 ++++++++++++------------ mm/memcontrol.c | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) commit 5abc1e37afa0335c52608d640fd30910b2eeda21 Author: Muchun Song Date: Tue Mar 22 14:41:19 2022 -0700 mm: list_lru: allocate list_lru_one only when needed In our server, we found a suspected memory leak problem. The kmalloc-32 consumes more than 6GB of memory. Other kmem_caches consume less than 2GB memory. After our in-depth analysis, the memory consumption of kmalloc-32 slab cache is the cause of list_lru_one allocation. crash> p memcg_nr_cache_ids memcg_nr_cache_ids = $2 = 24574 memcg_nr_cache_ids is very large and memory consumption of each list_lru can be calculated with the following formula. num_numa_node * memcg_nr_cache_ids * 32 (kmalloc-32) There are 4 numa nodes in our system, so each list_lru consumes ~3MB. crash> list super_blocks | wc -l 952 Every mount will register 2 list lrus, one is for inode, another is for dentry. There are 952 super_blocks. So the total memory is 952 * 2 * 3 MB (~5.6GB). But the number of memory cgroup is less than 500. So I guess more than 12286 containers have been deployed on this machine (I do not know why there are so many containers, it may be a user's bug or the user really want to do that). And memcg_nr_cache_ids has not been reduced to a suitable value. This can waste a lot of memory. Now the infrastructure for dynamic list_lru_one allocation is ready, so remove statically allocated memory code to save memory. Link: https://lkml.kernel.org/r/20220228122126.37293-11-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Roman Gushchin Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/list_lru.h | 7 +-- mm/list_lru.c | 121 ++++++++++++++++++++++++++--------------------- mm/memcontrol.c | 6 ++- 3 files changed, 77 insertions(+), 57 deletions(-) commit da0efe30944476275c902c52fbac812db0541d87 Author: Muchun Song Date: Tue Mar 22 14:41:15 2022 -0700 mm: memcontrol: move memcg_online_kmem() to mem_cgroup_css_online() It will simplify the code if moving memcg_online_kmem() to mem_cgroup_css_online() and do not need to set ->kmemcg_id to -1 to indicate the memcg is offline. In the next patch, ->kmemcg_id will be used to sync list lru reparenting which requires not to change ->kmemcg_id. Link: https://lkml.kernel.org/r/20220228122126.37293-10-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Roman Gushchin Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) commit 9bbdc0f324097f72b2354c2f8be4cdffd32679b6 Author: Muchun Song Date: Tue Mar 22 14:41:12 2022 -0700 xarray: use kmem_cache_alloc_lru to allocate xa_node The workingset will add the xa_node to the shadow_nodes list. So the allocation of xa_node should be done by kmem_cache_alloc_lru(). Using xas_set_lru() to pass the list_lru which we want to insert xa_node into to set up the xa_node reclaim context correctly. Link: https://lkml.kernel.org/r/20220228122126.37293-9-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Johannes Weiner Acked-by: Roman Gushchin Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/swap.h | 5 ++++- include/linux/xarray.h | 9 ++++++++- lib/xarray.c | 10 +++++----- mm/workingset.c | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) commit f53bf711d4d8e07de2caa3f13f6082c6e24145a4 Author: Muchun Song Date: Tue Mar 22 14:41:09 2022 -0700 mm: dcache: use kmem_cache_alloc_lru() to allocate dentry Like inode cache, the dentry will also be added to its memcg list_lru. So replace kmem_cache_alloc() with kmem_cache_alloc_lru() to allocate dentry. Link: https://lkml.kernel.org/r/20220228122126.37293-8-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Roman Gushchin Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/dcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 65d3af647b4016f134145591914102ee762350b1 Author: Muchun Song Date: Tue Mar 22 14:41:06 2022 -0700 f2fs: allocate inode by using alloc_inode_sb() The inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() to alloc_inode_sb(). Link: https://lkml.kernel.org/r/20220228122126.37293-6-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Roman Gushchin Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/f2fs/super.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit fd60b28842df833477c42da6a6d63d0d114a5fcc Author: Muchun Song Date: Tue Mar 22 14:41:03 2022 -0700 fs: allocate inode by using alloc_inode_sb() The inode allocation is supposed to use alloc_inode_sb(), so convert kmem_cache_alloc() of all filesystems to alloc_inode_sb(). Link: https://lkml.kernel.org/r/20220228122126.37293-5-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Theodore Ts'o [ext4] Acked-by: Roman Gushchin Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Shakeel Butt Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds block/bdev.c | 2 +- drivers/dax/super.c | 2 +- fs/9p/vfs_inode.c | 2 +- fs/adfs/super.c | 2 +- fs/affs/super.c | 2 +- fs/afs/super.c | 2 +- fs/befs/linuxvfs.c | 2 +- fs/bfs/inode.c | 2 +- fs/btrfs/inode.c | 2 +- fs/ceph/inode.c | 2 +- fs/cifs/cifsfs.c | 2 +- fs/coda/inode.c | 2 +- fs/ecryptfs/super.c | 2 +- fs/efs/super.c | 2 +- fs/erofs/super.c | 2 +- fs/exfat/super.c | 2 +- fs/ext2/super.c | 2 +- fs/ext4/super.c | 2 +- fs/fat/inode.c | 2 +- fs/freevxfs/vxfs_super.c | 2 +- fs/fuse/inode.c | 2 +- fs/gfs2/super.c | 2 +- fs/hfs/super.c | 2 +- fs/hfsplus/super.c | 2 +- fs/hostfs/hostfs_kern.c | 2 +- fs/hpfs/super.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/isofs/inode.c | 2 +- fs/jffs2/super.c | 2 +- fs/jfs/super.c | 2 +- fs/minix/inode.c | 2 +- fs/nfs/inode.c | 2 +- fs/nilfs2/super.c | 2 +- fs/ntfs/inode.c | 2 +- fs/ntfs3/super.c | 2 +- fs/ocfs2/dlmfs/dlmfs.c | 2 +- fs/ocfs2/super.c | 2 +- fs/openpromfs/inode.c | 2 +- fs/orangefs/super.c | 2 +- fs/overlayfs/super.c | 2 +- fs/proc/inode.c | 2 +- fs/qnx4/inode.c | 2 +- fs/qnx6/inode.c | 2 +- fs/reiserfs/super.c | 2 +- fs/romfs/super.c | 2 +- fs/squashfs/super.c | 2 +- fs/sysv/inode.c | 2 +- fs/ubifs/super.c | 2 +- fs/udf/super.c | 2 +- fs/ufs/super.c | 2 +- fs/vboxsf/super.c | 2 +- fs/xfs/xfs_icache.c | 2 +- fs/zonefs/super.c | 2 +- ipc/mqueue.c | 2 +- mm/shmem.c | 2 +- net/socket.c | 2 +- net/sunrpc/rpc_pipe.c | 2 +- 57 files changed, 57 insertions(+), 57 deletions(-) commit 8b9f3ac5b01db85c6cf74c2c3a71280cc3045c9c Author: Muchun Song Date: Tue Mar 22 14:41:00 2022 -0700 fs: introduce alloc_inode_sb() to allocate filesystems specific inode The allocated inode cache is supposed to be added to its memcg list_lru which should be allocated as well in advance. That can be done by kmem_cache_alloc_lru() which allocates object and list_lru. The file systems is main user of it. So introduce alloc_inode_sb() to allocate file system specific inodes and set up the inode reclaim context properly. The file system is supposed to use alloc_inode_sb() to allocate inodes. In later patches, we will convert all users to the new API. Link: https://lkml.kernel.org/r/20220228122126.37293-4-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Roman Gushchin Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/filesystems/porting.rst | 6 ++++++ fs/inode.c | 2 +- include/linux/fs.h | 11 +++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) commit 88f2ef73fd66491a2f9a82373d22ca6540f23c62 Author: Muchun Song Date: Tue Mar 22 14:40:56 2022 -0700 mm: introduce kmem_cache_alloc_lru We currently allocate scope for every memcg to be able to tracked on every superblock instantiated in the system, regardless of whether that superblock is even accessible to that memcg. These huge memcg counts come from container hosts where memcgs are confined to just a small subset of the total number of superblocks that instantiated at any given point in time. For these systems with huge container counts, list_lru does not need the capability of tracking every memcg on every superblock. What it comes down to is that adding the memcg to the list_lru at the first insert. So introduce kmem_cache_alloc_lru to allocate objects and its list_lru. In the later patch, we will convert all inode and dentry allocation from kmem_cache_alloc to kmem_cache_alloc_lru. Link: https://lkml.kernel.org/r/20220228122126.37293-3-songmuchun@bytedance.com Signed-off-by: Muchun Song Cc: Alex Shi Cc: Anna Schumaker Cc: Chao Yu Cc: Dave Chinner Cc: Fam Zheng Cc: Jaegeuk Kim Cc: Johannes Weiner Cc: Kari Argillander Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Cc: Roman Gushchin Cc: Shakeel Butt Cc: Theodore Ts'o Cc: Trond Myklebust Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Wei Yang Cc: Xiongchun Duan Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/list_lru.h | 4 ++ include/linux/memcontrol.h | 14 ++++++ include/linux/slab.h | 3 ++ mm/list_lru.c | 104 +++++++++++++++++++++++++++++++++++++++++---- mm/memcontrol.c | 14 ------ mm/slab.c | 39 +++++++++++------ mm/slab.h | 25 +++++++++-- mm/slob.c | 6 +++ mm/slub.c | 42 ++++++++++++------ 9 files changed, 198 insertions(+), 53 deletions(-) commit 6a6b7b77cc0fdc13f50c66c219c8c05500a8dfce Author: Muchun Song Date: Tue Mar 22 14:40:53 2022 -0700 mm: list_lru: transpose the array of per-node per-memcg lru lists Patch series "Optimize list lru memory consumption", v6. In our server, we found a suspected memory leak problem. The kmalloc-32 consumes more than 6GB of memory. Other kmem_caches consume less than 2GB memory. After our in-depth analysis, the memory consumption of kmalloc-32 slab cache is the cause of list_lru_one allocation. crash> p memcg_nr_cache_ids memcg_nr_cache_ids = $2 = 24574 memcg_nr_cache_ids is very large and memory consumption of each list_lru can be calculated with the following formula. num_numa_node * memcg_nr_cache_ids * 32 (kmalloc-32) There are 4 numa nodes in our system, so each list_lru consumes ~3MB. crash> list super_blocks | wc -l 952 Every mount will register 2 list lrus, one is for inode, another is for dentry. There are 952 super_blocks. So the total memory is 952 * 2 * 3 MB (~5.6GB). But now the number of memory cgroups is less than 500. So I guess more than 12286 memory cgroups have been created on this machine (I do not know why there are so many cgroups, it may be a user's bug or the user really want to do that). Because memcg_nr_cache_ids has not been reduced to a suitable value. It leads to waste a lot of memory. If we want to reduce memcg_nr_cache_ids, we have to *reboot* the server. This is not what we want. In order to reduce memcg_nr_cache_ids, I had posted a patchset [1] to do this. But this did not fundamentally solve the problem. We currently allocate scope for every memcg to be able to tracked on every superblock instantiated in the system, regardless of whether that superblock is even accessible to that memcg. These huge memcg counts come from container hosts where memcgs are confined to just a small subset of the total number of superblocks that instantiated at any given point in time. For these systems with huge container counts, list_lru does not need the capability of tracking every memcg on every superblock. What it comes down to is that the list_lru is only needed for a given memcg if that memcg is instatiating and freeing objects on a given list_lru. As Dave said, "Which makes me think we should be moving more towards 'add the memcg to the list_lru at the first insert' model rather than 'instantiate all at memcg init time just in case'." This patchset aims to optimize the list lru memory consumption from different aspects. I had done a easy test to show the optimization. I create 10k memory cgroups and mount 10k filesystems in the systems. We use free command to show how many memory does the systems comsumes after this operation (There are 2 numa nodes in the system). +-----------------------+------------------------+ | condition | memory consumption | +-----------------------+------------------------+ | without this patchset | 24464 MB | +-----------------------+------------------------+ | after patch 1 | 21957 MB | <--------+ +-----------------------+------------------------+ | | after patch 10 | 6895 MB | | +-----------------------+------------------------+ | | after patch 12 | 4367 MB | | +-----------------------+------------------------+ | | The more the number of nodes, the more obvious the effect---+ BTW, there was a recent discussion [2] on the same issue. [1] https://lore.kernel.org/all/20210428094949.43579-1-songmuchun@bytedance.com/ [2] https://lore.kernel.org/all/20210405054848.GA1077931@in.ibm.com/ This series not only optimizes the memory usage of list_lru but also simplifies the code. This patch (of 16): The current scheme of maintaining per-node per-memcg lru lists looks like: struct list_lru { struct list_lru_node *node; (for each node) struct list_lru_memcg *memcg_lrus; struct list_lru_one *lru[]; (for each memcg) } By effectively transposing the two-dimension array of list_lru_one's structures (per-node per-memcg => per-memcg per-node) it's possible to save some memory and simplify alloc/dealloc paths. The new scheme looks like: struct list_lru { struct list_lru_memcg *mlrus; struct list_lru_per_memcg *mlru[]; (for each memcg) struct list_lru_one node[0]; (for each node) } Memory savings are coming from not only 'struct rcu_head' but also some pointer arrays used to store the pointer to 'struct list_lru_one'. The array is per node and its size is 8 (a pointer) * num_memcgs. So the total size of the arrays is 8 * num_nodes * memcg_nr_cache_ids. After this patch, the size becomes 8 * memcg_nr_cache_ids. Link: https://lkml.kernel.org/r/20220228122126.37293-1-songmuchun@bytedance.com Link: https://lkml.kernel.org/r/20220228122126.37293-2-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Vladimir Davydov Cc: Shakeel Butt Cc: Yang Shi Cc: Alex Shi Cc: Wei Yang Cc: Dave Chinner Cc: Trond Myklebust Cc: Anna Schumaker Cc: Jaegeuk Kim Cc: Chao Yu Cc: Kari Argillander Cc: Vlastimil Babka Cc: Qi Zheng Cc: Xiongchun Duan Cc: Fam Zheng Cc: Roman Gushchin Cc: Theodore Ts'o Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/list_lru.h | 17 ++-- mm/list_lru.c | 206 +++++++++++++++++------------------------------ 2 files changed, 86 insertions(+), 137 deletions(-) commit 0790ed623847bbdd440ae29cc01da81c99834ea5 Author: Sebastian Andrzej Siewior Date: Tue Mar 22 14:40:50 2022 -0700 mm/memcg: disable migration instead of preemption in drain_all_stock(). Before the for-each-CPU loop, preemption is disabled so that so that drain_local_stock() can be invoked directly instead of scheduling a worker. Ensuring that drain_local_stock() completed on the local CPU is not correctness problem. It _could_ be that the charging path will be forced to reclaim memory because cached charges are still waiting for their draining. Disabling preemption before invoking drain_local_stock() is problematic on PREEMPT_RT due to the sleeping locks involved. To ensure that no CPU migrations happens across for_each_online_cpu() it is enouhg to use migrate_disable() which disables migration and keeps context preemptible to a sleeping lock can be acquired. A race with CPU hotplug is not a problem because pcp data is not going away. In the worst case we just schedule draining of an empty stock. Use migrate_disable() instead of get_cpu() around the for_each_online_cpu() loop. Link: https://lkml.kernel.org/r/20220226204144.1008339-7-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Acked-by: Michal Hocko Cc: Johannes Weiner Cc: kernel test robot Cc: Michal Hocko Cc: Michal Koutný Cc: Peter Zijlstra Cc: Roman Gushchin Cc: Shakeel Butt Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 5675114623872300aa9fcd72aef2b8b7f421fe12 Author: Sebastian Andrzej Siewior Date: Tue Mar 22 14:40:47 2022 -0700 mm/memcg: protect memcg_stock with a local_lock_t The members of the per-CPU structure memcg_stock_pcp are protected by disabling interrupts. This is not working on PREEMPT_RT because it creates atomic context in which actions are performed which require preemptible context. One example is obj_cgroup_release(). The IRQ-disable sections can be replaced with local_lock_t which preserves the explicit disabling of interrupts while keeps the code preemptible on PREEMPT_RT. drain_obj_stock() drops a reference on obj_cgroup which leads to an invocat= ion of obj_cgroup_release() if it is the last object. This in turn leads to recursive locking of the local_lock_t. To avoid this, obj_cgroup_release() = is invoked outside of the locked section. obj_cgroup_uncharge_pages() can be invoked with the local_lock_t acquired a= nd without it. This will lead later to a recursion in refill_stock(). To avoid the locking recursion provide obj_cgroup_uncharge_pages_locked() which uses the locked version of refill_stock(). - Replace disabling interrupts for memcg_stock with a local_lock_t. - Let drain_obj_stock() return the old struct obj_cgroup which is passed to obj_cgroup_put() outside of the locked section. - Provide obj_cgroup_uncharge_pages_locked() which uses the locked version of refill_stock() to avoid recursive locking in drain_obj_stock(). Link: https://lkml.kernel.org/r/20220209014709.GA26885@xsang-OptiPlex-9020 Link: https://lkml.kernel.org/r/20220226204144.1008339-6-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Reported-by: kernel test robot Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Michal Koutný Cc: Peter Zijlstra Cc: Roman Gushchin Cc: Shakeel Butt Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 59 +++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 21 deletions(-) commit af9a3b69e84bef996ce4620282fcf69a5786be3a Author: Johannes Weiner Date: Tue Mar 22 14:40:44 2022 -0700 mm/memcg: opencode the inner part of obj_cgroup_uncharge_pages() in drain_obj_stock() Provide the inner part of refill_stock() as __refill_stock() without disabling interrupts. This eases the integration of local_lock_t where recursive locking must be avoided. Open code obj_cgroup_uncharge_pages() in drain_obj_stock() and use __refill_stock(). The caller of drain_obj_stock() already disables interrupts. [bigeasy@linutronix.de: patch body around Johannes' diff] Link: https://lkml.kernel.org/r/20220226204144.1008339-5-bigeasy@linutronix.de Signed-off-by: Johannes Weiner Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Shakeel Butt Reviewed-by: Roman Gushchin Acked-by: Michal Hocko Cc: kernel test robot Cc: Michal Hocko Cc: Michal Koutný Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) commit be3e67b54b437123e6144da31cf312ddcaa5aef2 Author: Sebastian Andrzej Siewior Date: Tue Mar 22 14:40:41 2022 -0700 mm/memcg: protect per-CPU counter by disabling preemption on PREEMPT_RT where needed. The per-CPU counter are modified with the non-atomic modifier. The consistency is ensured by disabling interrupts for the update. On non PREEMPT_RT configuration this works because acquiring a spinlock_t typed lock with the _irq() suffix disables interrupts. On PREEMPT_RT configurations the RMW operation can be interrupted. Another problem is that mem_cgroup_swapout() expects to be invoked with disabled interrupts because the caller has to acquire a spinlock_t which is acquired with disabled interrupts. Since spinlock_t never disables interrupts on PREEMPT_RT the interrupts are never disabled at this point. The code is never called from in_irq() context on PREEMPT_RT therefore disabling preemption during the update is sufficient on PREEMPT_RT. The sections which explicitly disable interrupts can remain on PREEMPT_RT because the sections remain short and they don't involve sleeping locks (memcg_check_events() is doing nothing on PREEMPT_RT). Disable preemption during update of the per-CPU variables which do not explicitly disable interrupts. Link: https://lkml.kernel.org/r/20220226204144.1008339-4-bigeasy@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Acked-by: Roman Gushchin Reviewed-by: Shakeel Butt Cc: kernel test robot Cc: Michal Hocko Cc: Michal Hocko Cc: Michal Koutný Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) commit 2343e88d238f5de973d609d861c505890f94f22e Author: Sebastian Andrzej Siewior Date: Tue Mar 22 14:40:38 2022 -0700 mm/memcg: disable threshold event handlers on PREEMPT_RT During the integration of PREEMPT_RT support, the code flow around memcg_check_events() resulted in `twisted code'. Moving the code around and avoiding then would then lead to an additional local-irq-save section within memcg_check_events(). While looking better, it adds a local-irq-save section to code flow which is usually within an local-irq-off block on non-PREEMPT_RT configurations. The threshold event handler is a deprecated memcg v1 feature. Instead of trying to get it to work under PREEMPT_RT just disable it. There should be no users on PREEMPT_RT. From that perspective it makes even less sense to get it to work under PREEMPT_RT while having zero users. Make memory.soft_limit_in_bytes and cgroup.event_control return -EOPNOTSUPP on PREEMPT_RT. Make an empty memcg_check_events() and memcg_write_event_control() which return only -EOPNOTSUPP on PREEMPT_RT. Document that the two knobs are disabled on PREEMPT_RT. Link: https://lkml.kernel.org/r/20220226204144.1008339-3-bigeasy@linutronix.de Suggested-by: Michal Hocko Suggested-by: Michal Koutný Signed-off-by: Sebastian Andrzej Siewior Acked-by: Roman Gushchin Acked-by: Johannes Weiner Reviewed-by: Shakeel Butt Acked-by: Michal Hocko Cc: kernel test robot Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Waiman Long Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/cgroup-v1/memory.rst | 2 ++ mm/memcontrol.c | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) commit fead2b869764f89d524b79dc8862e61d5191be55 Author: Michal Hocko Date: Tue Mar 22 14:40:35 2022 -0700 mm/memcg: revert ("mm/memcg: optimize user context object stock access") Patch series "mm/memcg: Address PREEMPT_RT problems instead of disabling it", v5. This series aims to address the memcg related problem on PREEMPT_RT. I tested them on CONFIG_PREEMPT and CONFIG_PREEMPT_RT with the tools/testing/selftests/cgroup/* tests and I haven't observed any regressions (other than the lockdep report that is already there). This patch (of 6): The optimisation is based on a micro benchmark where local_irq_save() is more expensive than a preempt_disable(). There is no evidence that it is visible in a real-world workload and there are CPUs where the opposite is true (local_irq_save() is cheaper than preempt_disable()). Based on micro benchmarks, the optimisation makes sense on PREEMPT_NONE where preempt_disable() is optimized away. There is no improvement with PREEMPT_DYNAMIC since the preemption counter is always available. The optimization makes also the PREEMPT_RT integration more complicated since most of the assumption are not true on PREEMPT_RT. Revert the optimisation since it complicates the PREEMPT_RT integration and the improvement is hardly visible. [bigeasy@linutronix.de: patch body around Michal's diff] Link: https://lkml.kernel.org/r/20220226204144.1008339-1-bigeasy@linutronix.de Link: https://lore.kernel.org/all/YgOGkXXCrD%2F1k+p4@dhcp22.suse.cz Link: https://lkml.kernel.org/r/YdX+INO9gQje6d0S@linutronix.de Link: https://lkml.kernel.org/r/20220226204144.1008339-2-bigeasy@linutronix.de Signed-off-by: Michal Hocko Signed-off-by: Sebastian Andrzej Siewior Acked-by: Roman Gushchin Acked-by: Johannes Weiner Reviewed-by: Shakeel Butt Acked-by: Michal Hocko Cc: Johannes Weiner Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Vladimir Davydov Cc: Waiman Long Cc: kernel test robot Cc: Michal Hocko Cc: Michal Koutný Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 94 +++++++++++++++++---------------------------------------- 1 file changed, 27 insertions(+), 67 deletions(-) commit 460a79e18842caca6fa0c415de4a3ac1e671ac50 Author: Randy Dunlap Date: Tue Mar 22 14:40:31 2022 -0700 mm/memcontrol: return 1 from cgroup.memory __setup() handler __setup() handlers should return 1 if the command line option is handled and 0 if not (or maybe never return 0; it just pollutes init's environment). The only reason that this particular __setup handler does not pollute init's environment is that the setup string contains a '.', as in "cgroup.memory". This causes init/main.c::unknown_boottoption() to consider it to be an "Unused module parameter" and ignore it. (This is for parsing of loadable module parameters any time after kernel init.) Otherwise the string "cgroup.memory=whatever" would be added to init's environment strings. Instead of relying on this '.' quirk, just return 1 to indicate that the boot option has been handled. Note that there is no warning message if someone enters: cgroup.memory=anything_invalid Link: https://lkml.kernel.org/r/20220222005811.10672-1-rdunlap@infradead.org Fixes: f7e1cb6ec51b0 ("mm: memcontrol: account socket memory in unified hierarchy memory controller") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Reviewed-by: Michal Koutný Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Roman Gushchin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c9afe31ec443ea6d81d556159abc7ef0bc462ac0 Author: Shakeel Butt Date: Tue Mar 22 14:40:28 2022 -0700 memcg: synchronously enforce memory.high for large overcharges The high limit is used to throttle the workload without invoking the oom-killer. Recently we tried to use the high limit to right size our internal workloads. More specifically dynamically adjusting the limits of the workload without letting the workload get oom-killed. However due to the limitation of the implementation of high limit enforcement, we observed the mechanism fails for some real workloads. The high limit is enforced on return-to-userspace i.e. the kernel let the usage goes over the limit and when the execution returns to userspace, the high reclaim is triggered and the process can get throttled as well. However this mechanism fails for workloads which do large allocations in a single kernel entry e.g. applications that mlock() a large chunk of memory in a single syscall. Such applications bypass the high limit and can trigger the oom-killer. To make high limit enforcement more robust, this patch makes the limit enforcement synchronous only if the accumulated overcharge becomes larger than MEMCG_CHARGE_BATCH. So, most of the allocations would still be throttled on the return-to-userspace path but only the extreme allocations which accumulates large amount of overcharge without returning to the userspace will be throttled synchronously. The value MEMCG_CHARGE_BATCH is a bit arbitrary but most of other places in the memcg codebase uses this constant therefore for now uses the same one. Link: https://lkml.kernel.org/r/20220211064917.2028469-5-shakeelb@google.com Signed-off-by: Shakeel Butt Reviewed-by: Roman Gushchin Acked-by: Chris Down Cc: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 5 +++++ 1 file changed, 5 insertions(+) commit 6323ec54b4504070c1e001242e3e912837b3ae3a Author: Shakeel Butt Date: Tue Mar 22 14:40:25 2022 -0700 selftests: memcg: test high limit for single entry allocation Test the enforcement of memory.high limit for large amount of memory allocation within a single kernel entry. There are valid use-cases where the application can trigger large amount of memory allocation within a single syscall e.g. mlock() or mmap(MAP_POPULATE). Make sure memory.high limit enforcement works for such use-cases. Link: https://lkml.kernel.org/r/20220211064917.2028469-4-shakeelb@google.com Signed-off-by: Shakeel Butt Reviewed-by: Roman Gushchin Cc: Roman Gushchin Cc: Chris Down Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds tools/testing/selftests/cgroup/cgroup_util.c | 15 ++++- tools/testing/selftests/cgroup/cgroup_util.h | 1 + tools/testing/selftests/cgroup/test_memcontrol.c | 78 ++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 3 deletions(-) commit 1461e8c2b6af89e9662b5cbb714d7cb80baae3ca Author: Shakeel Butt Date: Tue Mar 22 14:40:22 2022 -0700 memcg: unify force charging conditions Currently the kernel force charges the allocations which have __GFP_HIGH flag without triggering the memory reclaim. __GFP_HIGH indicates that the caller is high priority and since commit 869712fd3de5 ("mm: memcontrol: fix network errors from failing __GFP_ATOMIC charges") the kernel lets such allocations do force charging. Please note that __GFP_ATOMIC has been replaced by __GFP_HIGH. __GFP_HIGH does not tell if the caller can block or can trigger reclaim. There are separate checks to determine that. So, there is no need to skip reclaiming for __GFP_HIGH allocations. So, handle __GFP_HIGH together with __GFP_NOFAIL which also does force charging. Please note that this is a noop change as there are no __GFP_HIGH allocators in the kernel which also have __GFP_ACCOUNT (or SLAB_ACCOUNT) and does not allow reclaim for now. Link: https://lkml.kernel.org/r/20220211064917.2028469-3-shakeelb@google.com Signed-off-by: Shakeel Butt Reviewed-by: Roman Gushchin Cc: Roman Gushchin Cc: Chris Down Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) commit becdf89d776c8f59e66071f567effa150068c338 Author: Shakeel Butt Date: Tue Mar 22 14:40:19 2022 -0700 memcg: refactor mem_cgroup_oom Patch series "memcg: robust enforcement of memory.high", v2. Due to the semantics of memory.high enforcement i.e. throttle the workload without oom-kill, we are trying to use it for right sizing the workloads in our production environment. However we observed the mechanism fails for some specific applications which does big chunck of allocations in a single syscall. The reason behind this failure is due to the limitation of the memory.high enforcement's current implementation. This patch series solves this issue by enforcing the memory.high synchronously if the current process has accumulated a large amount of high overcharge. This patch (of 4): The function mem_cgroup_oom returns enum which has four possible values but the caller does not care about such values and only cares if the return value is OOM_SUCCESS or not. So, remove the enum altogether and make mem_cgroup_oom returns a simple bool. Link: https://lkml.kernel.org/r/20220211064917.2028469-1-shakeelb@google.com Link: https://lkml.kernel.org/r/20220211064917.2028469-2-shakeelb@google.com Signed-off-by: Shakeel Butt Reviewed-by: Roman Gushchin Cc: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Chris Down Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) commit 486bc7060cb510fa60cb85a013d5ed51ce0fe456 Author: Wei Yang Date: Tue Mar 22 14:40:16 2022 -0700 mm/memcg: retrieve parent memcg from css.parent The parent we get from page_counter is correct, while this is two different hierarchy. Let's retrieve the parent memcg from css.parent just like parent_cs(), blkcg_parent(), etc. Link: https://lkml.kernel.org/r/20220201004643.8391-2-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Muchun Song Acked-by: Michal Hocko Reviewed-by: Roman Gushchin Reviewed-by: Shakeel Butt Cc: Roman Gushchin Cc: Johannes Weiner Cc: Vladimir Davydov Cc: Yang Shi Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/memcontrol.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit c857266dca8fe7af3d51343d0f4edf3ba4dd1542 Author: Wei Yang Date: Tue Mar 22 14:40:13 2022 -0700 mm/memcg: mem_cgroup_per_node is already set to 0 on allocation kzalloc_node() would set data to 0, so it's not necessary to set it again. Link: https://lkml.kernel.org/r/20220201004643.8391-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Muchun Song Acked-by: Michal Hocko Reviewed-by: Roman Gushchin Reviewed-by: Mike Rapoport Reviewed-by: Shakeel Butt Cc: Roman Gushchin Cc: Johannes Weiner Cc: Suren Baghdasaryan Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 2 -- 1 file changed, 2 deletions(-) commit a8c49af3be5f0b4e105ef678bcf14ef102c270be Author: Yosry Ahmed Date: Tue Mar 22 14:40:10 2022 -0700 memcg: add per-memcg total kernel memory stat Currently memcg stats show several types of kernel memory: kernel stack, page tables, sock, vmalloc, and slab. However, there are other allocations with __GFP_ACCOUNT (or supersets such as GFP_KERNEL_ACCOUNT) that are not accounted in any of those stats, a few examples are: - various kvm allocations (e.g. allocated pages to create vcpus) - io_uring - tmp_page in pipes during pipe_write() - bpf ringbuffers - unix sockets Keeping track of the total kernel memory is essential for the ease of migration from cgroup v1 to v2 as there are large discrepancies between v1's kmem.usage_in_bytes and the sum of the available kernel memory stats in v2. Adding separate memcg stats for all __GFP_ACCOUNT kernel allocations is an impractical maintenance burden as there a lot of those all over the kernel code, with more use cases likely to show up in the future. Therefore, add a "kernel" memcg stat that is analogous to kmem page counter, with added benefits such as using rstat infrastructure which aggregates stats more efficiently. Additionally, this provides a lighter alternative in case the legacy kmem is deprecated in the future [yosryahmed@google.com: v2] Link: https://lkml.kernel.org/r/20220203193856.972500-1-yosryahmed@google.com Link: https://lkml.kernel.org/r/20220201200823.3283171-1-yosryahmed@google.com Signed-off-by: Yosry Ahmed Acked-by: Shakeel Butt Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/admin-guide/cgroup-v2.rst | 5 +++++ include/linux/memcontrol.h | 1 + mm/memcontrol.c | 27 +++++++++++++++++++++------ 3 files changed, 27 insertions(+), 6 deletions(-) commit 086f694a75e1a283a11f9afa7bae258f30892b81 Author: Shakeel Butt Date: Tue Mar 22 14:40:07 2022 -0700 memcg: replace in_interrupt() with !in_task() Replace the deprecated in_interrupt() with !in_task() because in_interrupt() returns true for BH disabled even if the call happens in the task context. in_task() is the right interface to differentiate task context from NMI, hard IRQ and softirq contexts. Link: https://lkml.kernel.org/r/20220127162636.3461256-1-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Michal Hocko Cc: Vasily Averin Cc: Johannes Weiner Cc: Roman Gushchin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4bfa8ada803af1d073c76b43d079eee72a1d442a Author: Miaohe Lin Date: Tue Mar 22 14:40:04 2022 -0700 mm: shmem: use helper macro __ATTR_RW Use helper macro __ATTR_RW to define shmem_enabled_attr to make code more clear. Minor readability improvement. Link: https://lkml.kernel.org/r/20220312082252.55586-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/shmem.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 56a8c8eb1eaf21261be8cdc4e3715239ac087342 Author: Hugh Dickins Date: Tue Mar 22 14:40:01 2022 -0700 tmpfs: do not allocate pages on read Mikulas asked in "Do we still need commit a0ee5ec520ed ('tmpfs: allocate on read when stacked')?" in [1] Lukas noticed this unusual behavior of loop device backed by tmpfs in [2]. Normally, shmem_file_read_iter() copies the ZERO_PAGE when reading holes; but if it looks like it might be a read for "a stacking filesystem", it allocates actual pages to the page cache, and even marks them as dirty. And reads from the loop device do satisfy the test that is used. This oddity was added for an old version of unionfs, to help to limit its usage to the limited size of the tmpfs mount involved; but about the same time as the tmpfs mod went in (2.6.25), unionfs was reworked to proceed differently; and the mod kept just in case others needed it. Do we still need it? I cannot answer with more certainty than "Probably not". It's nasty enough that we really should try to delete it; but if a regression is reported somewhere, then we might have to revert later. It's not quite as simple as just removing the test (as Mikulas did): xfstests generic/013 hung because splice from tmpfs failed on page not up-to-date and page mapping unset. That can be fixed just by marking the ZERO_PAGE as Uptodate, which of course it is: do so in pagecache_init() - it might be useful to others than tmpfs. My intention, though, was to stop using the ZERO_PAGE here altogether: surely iov_iter_zero() is better for this case? Sadly not: it relies on clear_user(), and the x86 clear_user() is slower than its copy_user() [3]. But while we are still using the ZERO_PAGE, let's stop dirtying its struct page cacheline with unnecessary get_page() and put_page(). Link: https://lore.kernel.org/linux-mm/alpine.LRH.2.02.2007210510230.6959@file01.intranet.prod.int.rdu2.redhat.com/ [1] Link: https://lore.kernel.org/linux-mm/20211126075100.gd64odg2bcptiqeb@work/ [2] Link: https://lore.kernel.org/lkml/2f5ca5e4-e250-a41c-11fb-a7f4ebc7e1c9@google.com/ [3] Link: https://lkml.kernel.org/r/90bc5e69-9984-b5fa-a685-be55f2b64b@google.com Signed-off-by: Hugh Dickins Reported-by: Mikulas Patocka Reported-by: Lukas Czerner Acked-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Cc: Zdenek Kabelac Cc: "Darrick J. Wong" Cc: Miklos Szeredi Cc: Borislav Petkov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/filemap.c | 6 ++++++ mm/shmem.c | 20 ++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) commit bc7863906f70934834f196ffdfb773cf0ddb10d1 Author: Hugh Dickins Date: Tue Mar 22 14:39:58 2022 -0700 shmem: mapping_set_exiting() to help mapped resilience When I added page_mapped() resilience in __delete_from_page_cache() for the mapping_exiting() case, I missed that mapping_set_exiting() is done in truncate_inode_pages_final(), which is not actually called for shmem. (Today, it is folio_mapped() resilience in filemap_unaccount_folio().) So the fixup to avoid a memory leak in this case never worked on shmem: add a mapping_set_exiting() in shmem_evict_inode() at last. But this is hardly a candidate for stable, since it's only useful if "Bad page". Link: https://lkml.kernel.org/r/beefffda-6326-e36d-2d41-ed15b51af872@google.com Fixes: 06b241f32c71 ("mm: __delete_from_page_cache show Bad page if mapped") Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/shmem.c | 1 + 1 file changed, 1 insertion(+) commit f7cd16a55837f37b4c3835a2c646023e4d0f0e04 Author: Xavier Roche Date: Tue Mar 22 14:39:55 2022 -0700 tmpfs: support for file creation time Various filesystems (including ext4) now support file creation time. This adds such support for tmpfs-based filesystems. Note that using shmem_getattr() on other file types than regular requires that shmem_is_huge() check type, to stop incorrect HPAGE_PMD_SIZE blksize. [hughd@google.com: three tweaks to creation time patch] Link: https://lkml.kernel.org/r/b954973a-b8d1-cab8-63bd-6ea8063de3@google.com Link: https://lkml.kernel.org/r/20220314211150.GA123458@xavier-xps Link: https://lkml.kernel.org/r/b954973a-b8d1-cab8-63bd-6ea8063de3@google.com Link: https://lkml.kernel.org/r/20220211213628.GA1919658@xavier-xps Signed-off-by: Xavier Roche Signed-off-by: Hugh Dickins Tested-by: Jean Delvare Tested-by: Sylvain Bellone Reported-by: Xavier Grand Reviewed-by: Jean Delvare Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/shmem_fs.h | 1 + mm/shmem.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) commit 914c32e45dbcff2c9858589e11480b8b51140528 Author: Bang Li Date: Tue Mar 22 14:39:52 2022 -0700 mm/swap: fix confusing comment in folio_mark_accessed For unevictable pages, we don't need mark them. Link: https://lkml.kernel.org/r/20220311141519.59948-1-libang.linuxer@gmail.com Signed-off-by: Bang Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 73fd16d8080f7b1537ba7aa29917f64d6fffa664 Author: John Hubbard Date: Tue Mar 22 14:39:50 2022 -0700 mm/gup: remove unused get_user_pages_locked() Now that the last caller of get_user_pages_locked() is gone, remove it. Link: https://lkml.kernel.org/r/20220204020010.68930-6-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: Jan Kara Reviewed-by: Jason Gunthorpe Reviewed-by: Claudio Imbrenda Reviewed-by: Christoph Hellwig Cc: Alex Williamson Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lukas Bulwahn Cc: Matthew Wilcox (Oracle) Cc: Peter Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/mm.h | 2 -- mm/gup.c | 59 ------------------------------------------------------ 2 files changed, 61 deletions(-) commit f728b9c48d567b3f79b5fba8b993dd4f3e36bab2 Author: John Hubbard Date: Tue Mar 22 14:39:46 2022 -0700 mm: change lookup_node() to use get_user_pages_fast() The purpose of calling get_user_pages_locked() from lookup_node() was to allow for unlocking the mmap_lock when reading a page from the disk during a page fault (hidden behind VM_FAULT_RETRY). The idea was to reduce contention on the heavily-used mmap_lock. (Thanks to Jan Kara for clearly pointing that out, and in fact I've used some of his wording here.) However, it is unlikely for lookup_node() to take a page fault. With that in mind, change over to calling get_user_pages_fast(). This simplifies the code, runs a little faster in the expected case, and allows removing get_user_pages_locked() entirely, in a subsequent patch. Link: https://lkml.kernel.org/r/20220204020010.68930-5-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: Jan Kara Reviewed-by: Jason Gunthorpe Reviewed-by: Claudio Imbrenda Reviewed-by: Christoph Hellwig Cc: Alex Williamson Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lukas Bulwahn Cc: Matthew Wilcox (Oracle) Cc: Peter Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/mempolicy.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) commit ad6c441266dcd50be080a47e1178a1b15369923c Author: John Hubbard Date: Tue Mar 22 14:39:43 2022 -0700 mm/gup: remove unused pin_user_pages_locked() This routine was used for a short while, but then the calling code was refactored and the only caller was removed. Link: https://lkml.kernel.org/r/20220204020010.68930-4-jhubbard@nvidia.com Signed-off-by: John Hubbard Reviewed-by: David Hildenbrand Reviewed-by: Jason Gunthorpe Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Reviewed-by: Claudio Imbrenda Cc: Alex Williamson Cc: Andrea Arcangeli Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Cc: Lukas Bulwahn Cc: Matthew Wilcox (Oracle) Cc: Peter Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/mm.h | 2 -- mm/gup.c | 29 ----------------------------- 2 files changed, 31 deletions(-) commit 65462462ffb28fddf13d46c628c4fc55878ab397 Author: John Hubbard Date: Tue Mar 22 14:39:40 2022 -0700 mm/gup: follow_pfn_pte(): -EEXIST cleanup Remove a quirky special case from follow_pfn_pte(), and adjust its callers to match. Caller changes include: __get_user_pages(): Regardless of any FOLL_* flags, get_user_pages() and its variants should handle PFN-only entries by stopping early, if the caller expected **pages to be filled in. This makes for a more reliable API, as compared to the previous approach of skipping over such entries (and thus leaving them silently unwritten). move_pages(): squash the -EEXIST error return from follow_page() into -EFAULT, because -EFAULT is listed in the man page, whereas -EEXIST is not. Link: https://lkml.kernel.org/r/20220204020010.68930-3-jhubbard@nvidia.com Signed-off-by: John Hubbard Suggested-by: Jason Gunthorpe Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Cc: Peter Xu Cc: Lukas Bulwahn Cc: Matthew Wilcox Cc: Claudio Imbrenda Cc: Alex Williamson Cc: Andrea Arcangeli Cc: David Hildenbrand Cc: Jason Gunthorpe Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/gup.c | 13 ++++++++----- mm/migrate.c | 7 +++++++ 2 files changed, 15 insertions(+), 5 deletions(-) commit 7196040e19ad634293acd3eff7083149d7669031 Author: Peter Xu Date: Tue Mar 22 14:39:37 2022 -0700 mm: fix invalid page pointer returned with FOLL_PIN gups Patch series "mm/gup: some cleanups", v5. This patch (of 5): Alex reported invalid page pointer returned with pin_user_pages_remote() from vfio after upstream commit 4b6c33b32296 ("vfio/type1: Prepare for batched pinning with struct vfio_batch"). It turns out that it's not the fault of the vfio commit; however after vfio switches to a full page buffer to store the page pointers it starts to expose the problem easier. The problem is for VM_PFNMAP vmas we should normally fail with an -EFAULT then vfio will carry on to handle the MMIO regions. However when the bug triggered, follow_page_mask() returned -EEXIST for such a page, which will jump over the current page, leaving that entry in **pages untouched. However the caller is not aware of it, hence the caller will reference the page as usual even if the pointer data can be anything. We had that -EEXIST logic since commit 1027e4436b6a ("mm: make GUP handle pfn mapping unless FOLL_GET is requested") which seems very reasonable. It could be that when we reworked GUP with FOLL_PIN we could have overlooked that special path in commit 3faa52c03f44 ("mm/gup: track FOLL_PIN pages"), even if that commit rightfully touched up follow_devmap_pud() on checking FOLL_PIN when it needs to return an -EEXIST. Attaching the Fixes to the FOLL_PIN rework commit, as it happened later than 1027e4436b6a. [jhubbard@nvidia.com: added some tags, removed a reference to an out of tree module.] Link: https://lkml.kernel.org/r/20220207062213.235127-1-jhubbard@nvidia.com Link: https://lkml.kernel.org/r/20220204020010.68930-1-jhubbard@nvidia.com Link: https://lkml.kernel.org/r/20220204020010.68930-2-jhubbard@nvidia.com Fixes: 3faa52c03f44 ("mm/gup: track FOLL_PIN pages") Signed-off-by: Peter Xu Signed-off-by: John Hubbard Reviewed-by: Claudio Imbrenda Reported-by: Alex Williamson Debugged-by: Alex Williamson Tested-by: Alex Williamson Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Cc: Andrea Arcangeli Cc: Kirill A. Shutemov Cc: Jason Gunthorpe Cc: David Hildenbrand Cc: Lukas Bulwahn Cc: Matthew Wilcox (Oracle) Cc: Jason Gunthorpe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c0226eb8bde854e016a594a16f5c0d98aca426fa Author: Minchan Kim Date: Tue Mar 22 14:39:34 2022 -0700 mm: fs: fix lru_cache_disabled race in bh_lru Check lru_cache_disabled under bh_lru_lock. Otherwise, it could introduce race below and it fails to migrate pages containing buffer_head. CPU 0 CPU 1 bh_lru_install lru_cache_disable lru_cache_disabled = false atomic_inc(&lru_disable_count); invalidate_bh_lrus_cpu of CPU 0 bh_lru_lock __invalidate_bh_lrus bh_lru_unlock bh_lru_lock install the bh bh_lru_unlock WHen this race happens a CMA allocation fails, which is critical for the workload which depends on CMA. Link: https://lkml.kernel.org/r/20220308180709.2017638-1-minchan@kernel.org Fixes: 8cc621d2f45d ("mm: fs: invalidate BH LRU during page migration") Signed-off-by: Minchan Kim Cc: Chris Goldsworthy Cc: Marcelo Tosatti Cc: John Dias Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/buffer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 854d8e36168d79ad09a831d60bd4d835ad33e188 Author: Miaohe Lin Date: Tue Mar 22 14:39:31 2022 -0700 mm/writeback: minor clean up for highmem_dirtyable_memory Since commit a804552b9a15 ("mm/page-writeback.c: fix dirty_balance_reserve subtraction from dirtyable memory"), local variable x can not be negative. And it can not overflow when it is the total number of dirtyable highmem pages. Thus remove the unneeded comment and overflow check. Link: https://lkml.kernel.org/r/20220224115416.46089-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/page-writeback.c | 12 ------------ 1 file changed, 12 deletions(-) commit eb5279fb7e41804ecc15ed3cf716a9e2b419af57 Author: Miaohe Lin Date: Tue Mar 22 14:39:28 2022 -0700 filemap: remove find_get_pages() It's unused now. Remove it and clean up the relevant comment. Link: https://lkml.kernel.org/r/20220208134149.47299-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Christoph Hellwig Cc: Matthew Wilcox (Oracle) Cc: David Howells Cc: William Kucharski Cc: Vlastimil Babka Cc: Kirill A. Shutemov Cc: Johannes Weiner Cc: Andreas Gruenbacher Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/pagemap.h | 7 ------- mm/filemap.c | 11 ++++++----- 2 files changed, 6 insertions(+), 12 deletions(-) commit a74c6c00b1cb56386a98c2f2615f8966b3d1034d Author: Miaohe Lin Date: Tue Mar 22 14:39:25 2022 -0700 mm/memremap: avoid calling kasan_remove_zero_shadow() for device private memory For device private memory, we do not create a linear mapping for the memory because the device memory is un-accessible. Thus we do not add kasan zero shadow for it. So it's unnecessary to do kasan_remove_zero_shadow() for it. Link: https://lkml.kernel.org/r/20220126092602.1425-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/memremap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a128b054ce029554a4a52fc3abb8c1df8bafcaef Author: Anthony Iliopoulos Date: Tue Mar 22 14:39:22 2022 -0700 mount: warn only once about timestamp range expiration Commit f8b92ba67c5d ("mount: Add mount warning for impending timestamp expiry") introduced a mount warning regarding filesystem timestamp limits, that is printed upon each writable mount or remount. This can result in a lot of unnecessary messages in the kernel log in setups where filesystems are being frequently remounted (or mounted multiple times). Avoid this by setting a superblock flag which indicates that the warning has been emitted at least once for any particular mount, as suggested in [1]. Link: https://lore.kernel.org/CAHk-=wim6VGnxQmjfK_tDg6fbHYKL4EFkmnTjVr9QnRqjDBAeA@mail.gmail.com/ [1] Link: https://lkml.kernel.org/r/20220119202934.26495-1-ailiop@suse.com Signed-off-by: Anthony Iliopoulos Reviewed-by: Christoph Hellwig Acked-by: Christian Brauner Reviewed-by: Darrick J. Wong Cc: Alexander Viro Cc: Deepa Dinamani Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/namespace.c | 2 ++ include/linux/fs.h | 1 + 2 files changed, 3 insertions(+) commit a88f2096d5a2d91179db5dd9aa8f60dc3df9bb3e Author: NeilBrown Date: Tue Mar 22 14:39:19 2022 -0700 remove congestion tracking framework This framework is no longer used - so discard it. Link: https://lkml.kernel.org/r/164549983747.9187.6171768583526866601.stgit@noble.brown Signed-off-by: NeilBrown Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Jens Axboe Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Ryusuke Konishi Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/backing-dev-defs.h | 8 ------ include/linux/backing-dev.h | 2 -- include/trace/events/writeback.h | 28 -------------------- mm/backing-dev.c | 57 ---------------------------------------- 4 files changed, 95 deletions(-) commit f6bad159f5d5e5b33531aba3d9b860ad8618afe0 Author: NeilBrown Date: Tue Mar 22 14:39:16 2022 -0700 block/bfq-iosched.c: use "false" rather than "BLK_RW_ASYNC" bfq_get_queue() expects a "bool" for the third arg, so pass "false" rather than "BLK_RW_ASYNC" which will soon be removed. Link: https://lkml.kernel.org/r/164549983746.9187.7949730109246767909.stgit@noble.brown Signed-off-by: NeilBrown Acked-by: Jens Axboe Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Ryusuke Konishi Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds block/bfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a64239d0ef345208d8c15d7841a028a43a34c068 Author: NeilBrown Date: Tue Mar 22 14:39:13 2022 -0700 f2fs: replace congestion_wait() calls with io_schedule_timeout() As congestion is no longer tracked, congestion_wait() is effectively equivalent to io_schedule_timeout(). So introduce f2fs_io_schedule_timeout() which sets TASK_UNINTERRUPTIBLE and call that instead. Link: https://lkml.kernel.org/r/164549983744.9187.6425865370954230902.stgit@noble.brown Signed-off-by: NeilBrown Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Jens Axboe Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Ryusuke Konishi Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/f2fs/compress.c | 4 +--- fs/f2fs/data.c | 3 +-- fs/f2fs/f2fs.h | 6 ++++++ fs/f2fs/segment.c | 8 +++----- fs/f2fs/super.c | 6 ++---- 5 files changed, 13 insertions(+), 14 deletions(-) commit b9b1335e640308acc1b8f26c739b804c80a6c147 Author: NeilBrown Date: Tue Mar 22 14:39:10 2022 -0700 remove bdi_congested() and wb_congested() and related functions These functions are no longer useful as no BDIs report congestions any more. Removing the test on bdi_write_contested() in current_may_throttle() could cause a small change in behaviour, but only when PF_LOCAL_THROTTLE is set. So replace the calls by 'false' and simplify the code - and remove the functions. [akpm@linux-foundation.org: fix build] Link: https://lkml.kernel.org/r/164549983742.9187.2570198746005819592.stgit@noble.brown Signed-off-by: NeilBrown Acked-by: Ryusuke Konishi [nilfs] Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Jens Axboe Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds drivers/block/drbd/drbd_int.h | 3 --- drivers/block/drbd/drbd_req.c | 3 +-- fs/ext2/ialloc.c | 5 ----- fs/nilfs2/segbuf.c | 16 ---------------- fs/xfs/xfs_buf.c | 3 --- include/linux/backing-dev.h | 26 -------------------------- mm/vmscan.c | 4 +--- 7 files changed, 2 insertions(+), 58 deletions(-) commit fe55d563d4174f13839a9b7ef7309da5031b5d93 Author: NeilBrown Date: Tue Mar 22 14:39:07 2022 -0700 remove inode_congested() inode_congested() reports if the backing-device for the inode is congested. No bdi reports congestion any more, so this always returns 'false'. So remove inode_congested() and related functions, and remove the call sites, assuming that inode_congested() always returns 'false'. Link: https://lkml.kernel.org/r/164549983741.9187.2174285592262191311.stgit@noble.brown Signed-off-by: NeilBrown Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Jens Axboe Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Ryusuke Konishi Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/fs-writeback.c | 37 ------------------------------------- include/linux/backing-dev.h | 22 ---------------------- mm/fadvise.c | 5 ++--- mm/readahead.c | 6 ------ mm/vmscan.c | 17 +---------------- 5 files changed, 3 insertions(+), 84 deletions(-) commit 503d4fa6ee28e8d4d201c92ac3922d1b3526f844 Author: NeilBrown Date: Tue Mar 22 14:39:04 2022 -0700 ceph: remove reliance on bdi congestion The bdi congestion tracking in not widely used and will be removed. CEPHfs is one of a small number of filesystems that uses it, setting just the async (write) congestion flags at what it determines are appropriate times. The only remaining effect of the async flag is to cause (some) WB_SYNC_NONE writes to be skipped. So instead of setting the flag, set an internal flag and change: - .writepages to do nothing if WB_SYNC_NONE and the flag is set - .writepage to return AOP_WRITEPAGE_ACTIVATE if WB_SYNC_NONE and the flag is set. The writepages change causes a behavioural change in that pageout() can now return PAGE_ACTIVATE instead of PAGE_KEEP, so SetPageActive() will be called on the page which (I think) wil further delay the next attempt at writeout. This might be a good thing. Link: https://lkml.kernel.org/r/164549983739.9187.14895675781408171186.stgit@noble.brown Signed-off-by: NeilBrown Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Jens Axboe Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Ryusuke Konishi Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/ceph/addr.c | 22 +++++++++++++--------- fs/ceph/super.c | 1 + fs/ceph/super.h | 1 + 3 files changed, 15 insertions(+), 9 deletions(-) commit 6df25e58532be7a4cd6fb15bcd85805947402d91 Author: NeilBrown Date: Tue Mar 22 14:39:01 2022 -0700 nfs: remove reliance on bdi congestion The bdi congestion tracking in not widely used and will be removed. NFS is one of a small number of filesystems that uses it, setting just the async (write) congestion flag at what it determines are appropriate times. The only remaining effect of the async flag is to cause (some) WB_SYNC_NONE writes to be skipped. So instead of setting the flag, set an internal flag and change: - .writepages to do nothing if WB_SYNC_NONE and the flag is set - .writepage to return AOP_WRITEPAGE_ACTIVATE if WB_SYNC_NONE and the flag is set. The writepages change causes a behavioural change in that pageout() can now return PAGE_ACTIVATE instead of PAGE_KEEP, so SetPageActive() will be called on the page which (I think) wil further delay the next attempt at writeout. This might be a good thing. Link: https://lkml.kernel.org/r/164549983738.9187.3972219847989393182.stgit@noble.brown Signed-off-by: NeilBrown Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Jens Axboe Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Ryusuke Konishi Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/nfs/write.c | 14 +++++++++++--- include/linux/nfs_fs_sb.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) commit 670d21c6e17f67535fcf16e14c772209220da9ae Author: NeilBrown Date: Tue Mar 22 14:38:58 2022 -0700 fuse: remove reliance on bdi congestion The bdi congestion tracking in not widely used and will be removed. Fuse is one of a small number of filesystems that uses it, setting both the sync (read) and async (write) congestion flags at what it determines are appropriate times. The only remaining effect of the sync flag is to cause read-ahead to be skipped. The only remaining effect of the async flag is to cause (some) WB_SYNC_NONE writes to be skipped. So instead of setting the flags, change: - .readahead to stop when it has submitted all non-async pages for read. - .writepages to do nothing if WB_SYNC_NONE and the flag would be set - .writepage to return AOP_WRITEPAGE_ACTIVATE if WB_SYNC_NONE and the flag would be set. The writepages change causes a behavioural change in that pageout() can now return PAGE_ACTIVATE instead of PAGE_KEEP, so SetPageActive() will be called on the page which (I think) will further delay the next attempt at writeout. This might be a good thing. Link: https://lkml.kernel.org/r/164549983737.9187.2627117501000365074.stgit@noble.brown Signed-off-by: NeilBrown Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Jens Axboe Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Ryusuke Konishi Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/fuse/control.c | 17 ----------------- fs/fuse/dev.c | 8 -------- fs/fuse/file.c | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 25 deletions(-) commit 9fd472af84abd6da15376353c2283b3df9497646 Author: NeilBrown Date: Tue Mar 22 14:38:54 2022 -0700 mm: improve cleanup when ->readpages doesn't process all pages If ->readpages doesn't process all the pages, then it is best to act as though they weren't requested so that a subsequent readahead can try again. So: - remove any 'ahead' pages from the page cache so they can be loaded with ->readahead() rather then multiple ->read()s - update the file_ra_state to reflect the reads that were actually submitted. This allows ->readpages() to abort early due e.g. to congestion, which will then allow us to remove the inode_read_congested() test from page_Cache_async_ra(). Link: https://lkml.kernel.org/r/164549983736.9187.16755913785880819183.stgit@noble.brown Signed-off-by: NeilBrown Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Jens Axboe Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Ryusuke Konishi Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds mm/readahead.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) commit 84dacdbd5352bfef82423760fa2e8bffaeef9e05 Author: NeilBrown Date: Tue Mar 22 14:38:51 2022 -0700 mm: document and polish read-ahead code Add some "big-picture" documentation for read-ahead and polish the code to make it fit this documentation. The meaning of ->async_size is clarified to match its name. i.e. Any request to ->readahead() has a sync part and an async part. The caller will wait for the sync pages to complete, but will not wait for the async pages. The first async page is still marked PG_readahead Note that the current function names page_cache_sync_ra() and page_cache_async_ra() are misleading. All ra request are partly sync and partly async, so either part can be empty. A page_cache_sync_ra() request will usually set ->async_size non-zero, implying it is not all synchronous. When a non-zero req_count is passed to page_cache_async_ra(), the implication is that some prefix of the request is synchronous, though the calculation made there is incorrect - I haven't tried to fix it. Link: https://lkml.kernel.org/r/164549983734.9187.11586890887006601405.stgit@noble.brown Signed-off-by: NeilBrown Cc: Anna Schumaker Cc: Chao Yu Cc: Darrick J. Wong Cc: Ilya Dryomov Cc: Jaegeuk Kim Cc: Jan Kara Cc: Jeff Layton Cc: Jens Axboe Cc: Lars Ellenberg Cc: Miklos Szeredi Cc: Paolo Valente Cc: Philipp Reisner Cc: Ryusuke Konishi Cc: Trond Myklebust Cc: Wu Fengguang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Documentation/core-api/mm-api.rst | 19 +++++++- Documentation/filesystems/vfs.rst | 16 ++++--- include/linux/fs.h | 9 +++- mm/readahead.c | 99 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 133 insertions(+), 10 deletions(-) commit bf507030f312c68fdbb17c2d33f317cda109a484 Author: NeilBrown Date: Tue Mar 22 14:38:48 2022 -0700 doc: convert 'subsection' to 'section' in gfp.h Patch series "Remove remaining parts of congestion tracking code", v2. This patch (of 11): Various DOC: sections in gfp.h have subsection headers (~~~) but the place where they are included in mm-api.rst does not have section, only chapters. So convert to section headers (---) to avoid confusion. Specifically if sections are added later in mm-api.rst, an error results. Link: https://lkml.kernel.org/r/164549971112.9187.16871723439770288255.stgit@noble.brown Link: https://lkml.kernel.org/r/164549983733.9187.17894407453436115822.stgit@noble.brown Signed-off-by: NeilBrown Cc: Jan Kara Cc: Wu Fengguang Cc: Jaegeuk Kim Cc: Chao Yu Cc: Jeff Layton Cc: Ilya Dryomov Cc: Miklos Szeredi Cc: Trond Myklebust Cc: Anna Schumaker Cc: Ryusuke Konishi Cc: Darrick J. Wong Cc: Philipp Reisner Cc: Lars Ellenberg Cc: Paolo Valente Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/gfp.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 137cebf9432eae024d0334953ed92a2a78619b52 Author: hongnanli Date: Tue Mar 22 14:38:45 2022 -0700 fs/ocfs2: fix comments mentioning i_mutex inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix comments still mentioning i_mutex. Link: https://lkml.kernel.org/r/20220214031314.100094-1-hongnan.li@linux.alibaba.com Signed-off-by: hongnanli 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 Signed-off-by: Linus Torvalds fs/ocfs2/alloc.c | 2 +- fs/ocfs2/aops.c | 2 +- fs/ocfs2/cluster/nodemanager.c | 2 +- fs/ocfs2/dir.c | 4 ++-- fs/ocfs2/file.c | 4 ++-- fs/ocfs2/inode.c | 2 +- fs/ocfs2/localalloc.c | 6 +++--- fs/ocfs2/namei.c | 2 +- fs/ocfs2/ocfs2.h | 4 ++-- fs/ocfs2/quota_global.c | 2 +- fs/ocfs2/xattr.c | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) commit 38c9d2d3f38454d12e317dfbcad45e08e826a250 Author: Joseph Qi Date: Tue Mar 22 14:38:42 2022 -0700 ocfs2: cleanup some return variables Simply return directly instead of assign the return value to another variable. Link: https://lkml.kernel.org/r/20220114021641.13927-1-joseph.qi@linux.alibaba.com Signed-off-by: Joseph Qi Reported-by: Zeal Robot Cc: Minghao Chi Cc: CGEL ZTE Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/ocfs2/file.c | 9 +++------ fs/ocfs2/stack_user.c | 18 ++++++------------ 2 files changed, 9 insertions(+), 18 deletions(-) commit 714fbf2647b1a33d914edd695d4da92029c7e7c0 Author: Dongliang Mu Date: Tue Mar 22 14:38:39 2022 -0700 ntfs: add sanity check on allocation size ntfs_read_inode_mount invokes ntfs_malloc_nofs with zero allocation size. It triggers one BUG in the __ntfs_malloc function. Fix this by adding sanity check on ni->attr_list_size. Link: https://lkml.kernel.org/r/20220120094914.47736-1-dzm91@hust.edu.cn Reported-by: syzbot+3c765c5248797356edaa@syzkaller.appspotmail.com Signed-off-by: Dongliang Mu Acked-by: Anton Altaparmakov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds fs/ntfs/inode.c | 4 ++++ 1 file changed, 4 insertions(+) commit 2b76e68d7249f2f209b3ee3d15e8a2fb805220a3 Author: Colin Ian King Date: Tue Mar 22 14:38:36 2022 -0700 scripts/spelling.txt: add more spellings to spelling.txt Some of the more common spelling mistakes and typos that I've found while fixing up spelling mistakes in the kernel in the past four months. Link: https://lkml.kernel.org/r/20220216152343.105546-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds scripts/spelling.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit 62eb29526b48d20704668a2fdf97a49d01bf52ce Author: Rasmus Villemoes Date: Tue Mar 22 14:38:33 2022 -0700 linux/kthread.h: remove unused macros Ever since these macros were introduced in commit b56c0d8937e6 ("kthread: implement kthread_worker"), there has been precisely one user (commit 4d115420707a, "NVMe: Async IO queue deletion"), and that user went away in 2016 with db3cbfff5bcc ("NVMe: IO queue deletion re-write"). Apart from being unused, these macros are also awkward to use (which may contribute to them not being used): Having a way to statically (or on-stack) allocating the storage for the struct kthread_worker itself doesn't help much, since obviously one needs to have some code for actually _spawning_ the worker thread, which must have error checking. And these days we have the kthread_create_worker() interface which both allocates the struct kthread_worker and spawns the kthread. Link: https://lkml.kernel.org/r/20220314145343.494694-1-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Acked-by: Tejun Heo Cc: "Eric W. Biederman" Cc: Petr Mladek Cc: David Hildenbrand Cc: Yafang Shao Cc: Cai Huoqing Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds include/linux/kthread.h | 22 ---------------------- 1 file changed, 22 deletions(-) commit 611f841830aa5723ea67682628bd214cbc18df41 Merge: c1e10d81dac4 825da4e9cec6 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:27 2022 -0500 Merge branch 'remotes/lorenzo/pci/xgene' - Revert "PCI: xgene: Use inbound resources for setup" (Marc Zyngier) - Revert "PCI: xgene: Fix IB window setup" (Marc Zyngier) * remotes/lorenzo/pci/xgene: PCI: xgene: Revert "PCI: xgene: Fix IB window setup" PCI: xgene: Revert "PCI: xgene: Use inbound resources for setup" commit c1e10d81dac4508d8c795aaae5b4ca3912ae9cda Merge: 4b0f6ecaba3b 892fdf15b824 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:27 2022 -0500 Merge branch 'remotes/lorenzo/pci/uniphier' - Add DT binding and endpoint driver support for UniPhier NX1 SoC (Kunihiko Hayashi) * remotes/lorenzo/pci/uniphier: PCI: uniphier-ep: Add NX1 support PCI: uniphier-ep: Add SoC data structure dt-bindings: PCI: uniphier-ep: Add bindings for NX1 SoC commit 4b0f6ecaba3b90daa08b10d2936a82e901c3de16 Merge: 0c634fcb980d 6e36203bc14c Author: Bjorn Helgaas Date: Tue Mar 22 17:16:26 2022 -0500 Merge branch 'remotes/lorenzo/pci/rcar' - Finish transition to L1 state in rcar_pcie_config_access() because R-Car can't do it on its own (Marek Vasut) - Return PCI_ERROR_RESPONSE for reads that trigger PCIe errors (Marek Vasut) * remotes/lorenzo/pci/rcar: PCI: rcar: Use PCI_SET_ERROR_RESPONSE after read which triggered an exception PCI: rcar: Finish transition to L1 state in rcar_pcie_config_access() commit 0c634fcb980dc07a5286f975ff7453bb09e22f42 Merge: 9b2c25fa1299 1c5aa0372634 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:26 2022 -0500 Merge branch 'remotes/lorenzo/pci/qcom' - Save pointer to device match data instead of copying it (Dmitry Baryshkov) - Add ddrss_sf_tbu flag to device match data instead of checking OF compatible string (Dmitry Baryshkov) - Add SM8450 SoC PCIe DT bindings (Dmitry Baryshkov) - Add SM8450 PCIe support (Dmitry Baryshkov) * remotes/lorenzo/pci/qcom: PCI: qcom: Add SM8450 PCIe support PCI: qcom: Add ddrss_sf_tbu flag PCI: qcom: Remove redundancy between qcom_pcie and qcom_pcie_cfg dt-bindings: pci: qcom: Document PCIe bindings for SM8450 commit 9b2c25fa1299897d19f3befd9437055ee4b3213b Merge: 0888e08938e5 ec075262648f Author: Bjorn Helgaas Date: Tue Mar 22 17:16:25 2022 -0500 Merge branch 'remotes/lorenzo/pci/mvebu' - Add Pali Rohár as pci-mvebu.c maintainer (Pali Rohár) - Make struct pci_bridge_emul_ops const (Pali Rohár) - Rename PCI_BRIDGE_EMUL_NO_PREFETCHABLE_BAR to PCI_BRIDGE_EMUL_NO_PREFMEM_FORWARD since it doesn't apply to BARs (Pali Rohár) - Add new flag PCI_BRIDGE_EMUL_NO_IO_FORWARD for bridges that don't support IO forwarding (Pali Rohár) - Add Kconfig help text for CONFIG_PCI_MVEBU (Pali Rohár) - Remove duplicate nports assignment (Pali Rohár) - Set PCI_BRIDGE_EMUL_NO_IO_FORWARD when IO is unsupported (Pali Rohár) - Initialize vendor, device and revision of emulated bridge (Pali Rohár) - Fix Data Link Layer Link Active reporting on emulated bridge (Pali Rohár) - Rearrange tests in bridge emulation for easier maintenance (Russell King) - Add emulated bridge support for PCIe extended capabilities (Russell King) - Add emulated bridge support for bridge Subsystem Vendor ID capability (Pali Rohár) - Configure Maximum Link Width based on DT "num-lanes" property (Pali Rohár) - Emulate bridge Subsystem Vendor ID capability (Pali Rohár) - Emulate AER Capability (Pali Rohár) - Use PCI core bridge->ops and bridge->child_ops to separate config accesses to Root Port vs downstream devices (Pali Rohár) - Unmask all INTx interrupts; they're reported via a single shared GIC source (Pali Rohár) - Add INTx support (Pali Rohár) * remotes/lorenzo/pci/mvebu: PCI: mvebu: Implement support for legacy INTx interrupts PCI: mvebu: Fix macro names and comments about legacy interrupts dt-bindings: PCI: mvebu: Update information about intx interrupts PCI: mvebu: Use child_ops API PCI: mvebu: Add support for Advanced Error Reporting registers on emulated bridge PCI: mvebu: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge PCI: mvebu: Correctly configure x1/x4 mode dt-bindings: PCI: mvebu: Add num-lanes property PCI: pci-bridge-emul: Add support for PCI Bridge Subsystem Vendor ID capability PCI: pci-bridge-emul: Add support for PCIe extended capabilities PCI: pci-bridge-emul: Re-arrange register tests PCI: mvebu: Fix reporting Data Link Layer Link Active on emulated bridge PCI: mvebu: Update comment for PCI_EXP_LNKCTL register on emulated bridge PCI: mvebu: Update comment for PCI_EXP_LNKCAP register on emulated bridge PCI: mvebu: Properly initialize vendor, device and revision of emulated bridge PCI: mvebu: Set PCI_BRIDGE_EMUL_NO_IO_FORWARD when IO is unsupported PCI: mvebu: Remove duplicate nports assignment PCI: mvebu: Add help string for CONFIG_PCI_MVEBU option PCI: pci-bridge-emul: Add support for new flag PCI_BRIDGE_EMUL_NO_IO_FORWARD PCI: pci-bridge-emul: Rename PCI_BRIDGE_EMUL_NO_PREFETCHABLE_BAR to PCI_BRIDGE_EMUL_NO_PREFMEM_FORWARD PCI: pci-bridge-emul: Make struct pci_bridge_emul_ops as const MAINTAINERS: Add Pali Rohár as pci-mvebu.c maintainer commit 0888e08938e54b14b4176cd92e527c61ef68e4de Merge: f409855492fa 0cc62aed370d Author: Bjorn Helgaas Date: Tue Mar 22 17:16:25 2022 -0500 Merge branch 'remotes/lorenzo/pci/misc' - Add generic SZ_1T macro instead of a local one in pci-xgene.c (Christophe Leroy) * remotes/lorenzo/pci/misc: sizes.h: Add SZ_1T macro commit f409855492fa1dae3c4644e332ea8c0ad9260071 Merge: 8a43a7444884 45514f78c65c Author: Bjorn Helgaas Date: Tue Mar 22 17:16:24 2022 -0500 Merge branch 'remotes/lorenzo/pci/imx6' - Allow host controller driver to probe successfully (as other drivers do) even if link is currently down (Fabio Estevam) - Enable i.MX6QP PCIe power management (Richard Zhu) - Invoke PHY exit function after PHY power off (Richard Zhu) - Assert i.MX8MM CLKREQ# even if no device present to avoid boot hangs (Richard Zhu) * remotes/lorenzo/pci/imx6: PCI: imx6: Assert i.MX8MM CLKREQ# even if no device present PCI: imx6: Invoke the PHY exit function after PHY power off PCI: imx6: Enable i.MX6QP PCIe power management support PCI: imx6: Allow to probe when dw_pcie_wait_for_link() fails commit 8a43a7444884e8df18397a78a6a939bd35baa663 Merge: d93fefad2060 d06957d7a692 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:24 2022 -0500 Merge branch 'remotes/lorenzo/pci/hv' - Avoid retarget interrupt hypercall in irq_unmask() on ARM64 (Boqun Feng) * remotes/lorenzo/pci/hv: PCI: hv: Avoid the retarget interrupt hypercall in irq_unmask() on ARM64 commit d93fefad2060402028fcd2537ea5e784aca003d6 Merge: a69e89ba6c81 a382c757ec5e Author: Bjorn Helgaas Date: Tue Mar 22 17:16:24 2022 -0500 Merge branch 'pci/host/fu740' - Drop redundant '-gpios' from DT GPIO lookup (Ben Dooks) - Force 2.5GT/s for initial device probe to workaround enumeration issue on SiFive Unmatched board (Ben Dooks) * pci/host/fu740: PCI: fu740: Force 2.5GT/s for initial device probe PCI: fu740: Drop redundant '-gpios' from DT GPIO lookup commit a69e89ba6c810295b4ce795ce38088788857822f Merge: 0321da851e3e bf8d87c076f5 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:23 2022 -0500 Merge branch 'remotes/lorenzo/pci/endpoint' - Fix alignment fault error in copy tests (Hou Zhiqiang) - Fix misused goto label (Li Chen) * remotes/lorenzo/pci/endpoint: PCI: endpoint: Fix misused goto label PCI: endpoint: Fix alignment fault error in copy tests commit 0321da851e3ed1a61619f822f94d66e96f463c05 Merge: 7ec9ff94f5f7 815953dc2011 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:23 2022 -0500 Merge branch 'pci/host/dwc' - Restore MSI Receiver mask during resume (Jisheng Zhang) * pci/host/dwc: PCI: dwc: Restore MSI Receiver mask during resume commit 7ec9ff94f5f7416f501d1c0177c82e785974f9ec Merge: 816f8917046d 92f4ffecc417 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:22 2022 -0500 Merge branch 'remotes/lorenzo/pci/aardvark' - Use PCI_INTERRUPT_* definitions from PCI core instead of custom ones (Pali Rohár) - Derive MSI number from bit(s) set in PCIE_MSI_STATUS_REG, not from PCIE_MSI_PAYLOAD_REG (Pali Rohár) - Align multi-MSI vectors to power of two (Pali Rohár) - Rewrite IRQ code to use chained IRQ handler (Pali Rohár) - Check return value of generic_handle_domain_irq() and warn about spurious interrupts (Pali Rohár) - Make MSI irq_chip structures static to driver (Marek Behún) - Make msi_domain_info structure static to driver (Marek Behún) - Use dev_fwnode() instead of of_node_to_fwnode(dev->of_node) (Marek Behún) - Refactor unmasking of summary MSI interrupt (Pali Rohár) - Add support for masking MSI interrupts and leave them masked at setup (Pali Rohár) - Set MSI doorbell address to address of struct advk_pcie (Pali Rohár) - Enable MSI-X support (Pali Rohár) - Add support for ERR interrupt on emulated bridge (Pali Rohár) - Fix read of PCI_EXP_RTSTA_PME bit on emulated bridge (Pali Rohár) - Optimize writing PCI_EXP_RTCTL_PMEIE and PCI_EXP_RTSTA_PME on emulated bridge (Pali Rohár) - Add support for PME interrupts (Pali Rohár) - Fix support for PME requester on emulated bridge (Pali Rohár) - Use separate INTA interrupt for emulated Root Port so PME and AER interrupt is not shared with downstream devices (Pali Rohár) - Remove irq_mask_ack() callback for INTx interrupts (Pali Rohár) - Don't mask legacy INTx interrupts when mapping (Pali Rohár) - Drop unnecessary "__maybe_unused" from advk_pcie_disable_phy() (Marek Behún) - Update comment about why we check for link being up before issuing a config request (Marek Behún) * remotes/lorenzo/pci/aardvark: PCI: aardvark: Update comment about link going down after link-up PCI: aardvark: Drop __maybe_unused from advk_pcie_disable_phy() PCI: aardvark: Don't mask irq when mapping PCI: aardvark: Remove irq_mask_ack() callback for INTx interrupts PCI: aardvark: Use separate INTA interrupt for emulated root bridge PCI: aardvark: Fix support for PME requester on emulated bridge PCI: aardvark: Add support for PME interrupts PCI: aardvark: Optimize writing PCI_EXP_RTCTL_PMEIE and PCI_EXP_RTSTA_PME on emulated bridge PCI: aardvark: Fix reading PCI_EXP_RTSTA_PME bit on emulated bridge PCI: aardvark: Add support for ERR interrupt on emulated bridge PCI: aardvark: Enable MSI-X support PCI: aardvark: Fix setting MSI address PCI: aardvark: Add support for masking MSI interrupts PCI: aardvark: Refactor unmasking summary MSI interrupt PCI: aardvark: Use dev_fwnode() instead of of_node_to_fwnode(dev->of_node) PCI: aardvark: Make msi_domain_info structure a static driver structure PCI: aardvark: Make MSI irq_chip structures static driver structures PCI: aardvark: Check return value of generic_handle_domain_irq() when processing INTx IRQ PCI: aardvark: Rewrite IRQ code to chained IRQ handler PCI: aardvark: Fix support for MSI interrupts PCI: aardvark: Fix reading MSI interrupt number PCI: aardvark: Replace custom PCIE_CORE_INT_* macros with PCI_INTERRUPT_* commit 816f8917046de14e78a5715b72d462e10123a45c Merge: bdef65de39c2 f321c35feaee Author: Bjorn Helgaas Date: Tue Mar 22 17:16:22 2022 -0500 Merge branch 'pci/vga' - Move vgaarb.c from drivers/gpu/vga to drivers/pci (Bjorn Helgaas) - Factor out default VGA device selection (Huacai Chen) - Move firmware default device detection to ADD_DEVICE path so we can select a default device regardless of whether it is enumerated before or after vga_arb_device_init() (Huacai Chen) - Move non-legacy VGA detection to ADD_DEVICE path (Huacai Chen) - Move disabled VGA device detection to ADD_DEVICE path (Huacai Chen) * pci/vga: PCI/VGA: Replace full MIT license text with SPDX identifier PCI/VGA: Use unsigned format string to print lock counts PCI/VGA: Log bridge control messages when adding devices PCI/VGA: Remove empty vga_arb_device_card_gone() PCI/VGA: Move disabled VGA device detection to ADD_DEVICE path PCI/VGA: Move non-legacy VGA detection to ADD_DEVICE path PCI/VGA: Move firmware default device detection to ADD_DEVICE path PCI/VGA: Factor out default VGA device selection PCI/VGA: Factor out vga_select_framebuffer_device() PCI/VGA: Move vga_arb_integrated_gpu() earlier in file PCI/VGA: Move vgaarb to drivers/pci commit bdef65de39c2e0592038340a5b5746fdecce900f Merge: a6e0eba677f8 feaea1fe8b36 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:21 2022 -0500 Merge branch 'pci/p2pdma' - Add Intel 3rd Gen Intel Xeon Scalable Processors to P2PDMA whitelist (Michael J. Ruhl) * pci/p2pdma: PCI/P2PDMA: Add Intel 3rd Gen Intel Xeon Scalable Processors to whitelist commit a6e0eba677f8e9b58f8062205566a911c15e1f4f Merge: 73c82469bd88 63cd736f4494 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:21 2022 -0500 Merge branch 'pci/msi' - Avoid broken MSI on SB600 USB devices (Bjorn Helgaas) * pci/msi: PCI: Avoid broken MSI on SB600 USB devices commit 73c82469bd88ce1c9a4403f34582e544e77f4854 Merge: f787b6821423 b9fae6a47b8b Author: Bjorn Helgaas Date: Tue Mar 22 17:16:21 2022 -0500 Merge branch 'pci/misc' - Update the aer-inject URL (Yicong Yang) - Declare pci_filp_private only when HAVE_PCI_MMAP to avoid unused struct definition (Krzysztof Wilczyński) - Remove unused assignments (Bjorn Helgaas) - Add #includes to asm/pci_x86.h to prevent build errors (Randy Dunlap) * pci/misc: x86/PCI: Add #includes to asm/pci_x86.h PCI: ibmphp: Remove unused assignments PCI: cpqphp: Remove unused assignments PCI: fu740: Remove unused assignments PCI: kirin: Remove unused assignments PCI: Remove unused assignments PCI: Declare pci_filp_private only when HAVE_PCI_MMAP PCI/AER: Update aer-inject URL commit f787b6821423fe0d79b63ef29ff3cb48b99af34b Merge: a9af571b35aa 9f72d4757cbe Author: Bjorn Helgaas Date: Tue Mar 22 17:16:20 2022 -0500 Merge branch 'pci/hotplug' - Clear pciehp cmd_busy bit when command completes in polling mode to avoid spurious timeouts (Liguang Zhang) - Add quirk to work around Qualcomm hardware defect in Command Completed signaling (Manivannan Sadhasivam) * pci/hotplug: PCI: pciehp: Add Qualcomm quirk for Command Completed erratum PCI: pciehp: Clear cmd_busy bit in polling mode commit a9af571b35aadd1faa8a3e75172d18afbbc018cb Merge: fde14ee6293e 92c45b63ce22 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:20 2022 -0500 Merge branch 'pci/enumeration' - Support BAR sizes up to 8TB (Dongdong Liu) - Reduce warnings on hardware that doesn't support 8- or 16-bit PCI writes and hence may corrupt RW1C bits (Mark Tomlinson) * pci/enumeration: PCI: Reduce warnings on possible RW1C corruption PCI: Support BAR sizes up to 8TB commit fde14ee6293efc5bbde6caf7b8c6ebb2f1fb203a Merge: 05ca7e5058ab fe665816e0d4 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:20 2022 -0500 Merge branch 'pci/bridge-class-codes' - Add and use #defines for normal and subtractive PCI bridges (Pali Rohár) - Set all 24 bits of PCI class code for iproc (Pali Rohár) * pci/bridge-class-codes: PCI: iproc: Set all 24 bits of PCI class code PCI: Add defines for normal and subtractive PCI bridges commit 05ca7e5058ab564195f0b7ee5b81623ca36acb53 Merge: e783362eb54c 9a607a54a163 Author: Bjorn Helgaas Date: Tue Mar 22 17:16:19 2022 -0500 Merge branch 'pci/acpi' - Replace acpi_bus_get_device() with acpi_fetch_acpi_dev() so we can drop acpi_bus_get_device() (Rafael J. Wysocki) * pci/acpi: PCI/ACPI: Replace acpi_bus_get_device() with acpi_fetch_acpi_dev() commit 6d1a6f464efd596779d1b272b3dc8170c5fa189f Author: Vincent Chen Date: Tue Mar 8 16:32:53 2022 +0800 rseq/selftests: Add support for RISC-V Add support for RISC-V in the rseq selftests, which covers both 64-bit and 32-bit ISA with little endian mode. Signed-off-by: Vincent Chen Tested-by: Eric Lin Reviewed-by: Mathieu Desnoyers Signed-off-by: Palmer Dabbelt tools/testing/selftests/rseq/param_test.c | 23 + tools/testing/selftests/rseq/rseq-riscv.h | 677 ++++++++++++++++++++++++++++++ tools/testing/selftests/rseq/rseq.h | 2 + 3 files changed, 702 insertions(+) commit 93917ad50972e6298885d81b37b6a8602eb0b188 Author: Vincent Chen Date: Tue Mar 8 16:32:52 2022 +0800 RISC-V: Add support for restartable sequence Add calls to rseq_signal_deliver() and rseq_syscall() to introduce RSEQ support. 1. Call the rseq_signal_deliver() function to fixup on the pre-signal frame when a signal is delivered on top of a restartable sequence critical section. 2. Check that system calls are not invoked from within rseq critical sections by invoking rseq_signal() from ret_from_syscall(). With CONFIG_DEBUG_RSEQ, such behavior results in termination of the process with SIGSEGV. Signed-off-by: Vincent Chen Reviewed-by: Mathieu Desnoyers Signed-off-by: Palmer Dabbelt arch/riscv/Kconfig | 1 + arch/riscv/kernel/entry.S | 4 ++++ arch/riscv/kernel/signal.c | 2 ++ 3 files changed, 7 insertions(+) commit 3fe2f7446f1e029b220f7f650df6d138f91651f2 Merge: ebd326ce724d ffea9fb31936 Author: Linus Torvalds Date: Tue Mar 22 14:39:12 2022 -0700 Merge tag 'sched-core-2022-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: - Cleanups for SCHED_DEADLINE - Tracing updates/fixes - CPU Accounting fixes - First wave of changes to optimize the overhead of the scheduler build, from the fast-headers tree - including placeholder *_api.h headers for later header split-ups. - Preempt-dynamic using static_branch() for ARM64 - Isolation housekeeping mask rework; preperatory for further changes - NUMA-balancing: deal with CPU-less nodes - NUMA-balancing: tune systems that have multiple LLC cache domains per node (eg. AMD) - Updates to RSEQ UAPI in preparation for glibc usage - Lots of RSEQ/selftests, for same - Add Suren as PSI co-maintainer * tag 'sched-core-2022-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (81 commits) sched/headers: ARM needs asm/paravirt_api_clock.h too sched/numa: Fix boot crash on arm64 systems headers/prep: Fix header to build standalone: sched/headers: Only include when CONFIG_GENERIC_ENTRY=y cgroup: Fix suspicious rcu_dereference_check() usage warning sched/preempt: Tell about PREEMPT_DYNAMIC on kernel headers sched/topology: Remove redundant variable and fix incorrect type in build_sched_domains sched/deadline,rt: Remove unused parameter from pick_next_[rt|dl]_entity() sched/deadline,rt: Remove unused functions for !CONFIG_SMP sched/deadline: Use __node_2_[pdl|dle]() and rb_first_cached() consistently sched/deadline: Merge dl_task_can_attach() and dl_cpu_busy() sched/deadline: Move bandwidth mgmt and reclaim functions into sched class source file sched/deadline: Remove unused def_dl_bandwidth sched/tracing: Report TASK_RTLOCK_WAIT tasks as TASK_UNINTERRUPTIBLE sched/tracing: Don't re-read p->state when emitting sched_switch event sched/rt: Plug rt_mutex_setprio() vs push_rt_task() race sched/cpuacct: Remove redundant RCU read lock sched/cpuacct: Optimize away RCU read lock sched/cpuacct: Fix charge percpu cpuusage sched/headers: Reorganize, clean up and optimize kernel/sched/sched.h dependencies ... commit 7b830875d22d68f9a49a02a23c24272513ddb392 Author: Kim Phillips Date: Mon Oct 4 16:41:13 2021 -0500 perf evsel: Make evsel__env() always return a valid env It's possible to have an evsel and evsel->evlist populated without an evsel->evlist->env, when, e.g., cmd_record is in its error path. Future patches will add support for evsel__open_strerror to be able to customize error messaging based on perf_env__{arch,cpuid}, so let's have evsel__env return &perf_env instead of NULL in that case. Reviewed-by: Kajol Jain Signed-off-by: Kim Phillips Cc: Alexander Shishkin Cc: Boris Ostrovsky Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Joao Martins Cc: Konrad Rzeszutek Wilk Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Richter Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211004214114.188477-1-kim.phillips@amd.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/evsel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 011899cc0006baa9493f3244c7c11cb0e715b07a Author: Colin Ian King Date: Wed Mar 16 23:24:52 2022 +0000 perf build-id: Fix spelling mistake "Cant" -> "Can't" There is a spelling mistake in a pr_err message. Fix it. Signed-off-by: Colin Ian King Acked-by: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: kernel-janitors@vger.kernel.org Link: https://lore.kernel.org/r/20220316232452.53062-1-colin.i.king@gmail.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/build-id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ccbc9df9ae9a6deb40884e527402e945ab1ffa94 Author: Colin Ian King Date: Wed Mar 16 23:22:11 2022 +0000 perf header: Fix spelling mistake "could't" -> "couldn't" There is a spelling mistake in a pr_debug2 message. Fix it. Signed-off-by: Colin Ian King Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Namhyung Kim Cc: Peter Zijlstra Cc: kernel-janitors@vger.kernel.org Link: https://lore.kernel.org/r/20220316232212.52820-1-colin.i.king@gmail.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/header.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6f680c6aa276ceff7dde98d5ae3f19574cd12eff Author: Kan Liang Date: Mon Mar 21 07:00:12 2022 -0700 perf script: Add 'brstackinsnlen' for branch stacks When analyzing with 'perf script', it's useful to understand the captured instruction and the next sequential instruction. To calculate the address of the next sequential instruction, the length of the captured instruction is required. For example, you can’t know the next sequential instruction after an unconditional branch unless you calculate that based on its length. For branch stacks, 'perf script' only prints the instruction bytes with 'brstackinsn', but lacks the instruction length. Add 'brstackinsnlen' to print the instruction length. $ perf script -F ip,brstackinsn,brstackinsnlen --xed 7fa555be8f75 _start: 00007fa555be8090 mov %rsp, %rdi ilen: 3 00007fa555be8093 callq 0x7fa555be8ea0 ilen: 5 # PRED 102 cycles [102] 0.02 IPC _dl_start+38: 00007fa555be8ec6 movq %rdx,0x227853(%rip) ilen: 7 00007fa555be8ecd leaq 0x227f94(%rip),%rdx ilen: 7 Signed-off-by: Kan Liang Cc: Ahmad Yasin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Xing Zhengjun Link: https://lore.kernel.org/r/1647871212-184070-1-git-send-email-kan.liang@linux.intel.com [ Added the new field to tools/perf/Documentation/perf-script.txt ] Signed-off-by: Arnaldo Carvalho de Melo tools/perf/Documentation/perf-script.txt | 8 ++++-- tools/perf/builtin-script.c | 44 +++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 14 deletions(-) commit bc355822f0d9623b632069105d425c822d124cc8 Author: Ian Rogers Date: Mon Mar 21 15:33:44 2022 -0700 perf parse-events: Move slots only with topdown If slots isn't with a topdown event then moving it is unnecessary. For example {instructions, slots} is re-ordered: $ perf stat -e '{instructions,slots}' -a sleep 1 Performance counter stats for 'system wide': 936,600,825 slots 144,440,968 instructions 1.006061423 seconds time elapsed Which can break tools expecting the command line order to match the printed order. It is necessary to move the slots event first when it appears with topdown events. Add extra checking so that the slots event is only moved in the case of there being a topdown event like: $ perf stat -e '{instructions,slots,topdown-fe-bound}' -a sleep 1 Performance counter stats for 'system wide': 2427568570 slots 300927614 instructions 551021649 topdown-fe-bound 1.001771803 seconds time elapsed Fixes: 94dbfd6781a0e87b ("perf parse-events: Architecture specific leader override") Reported-by: Kan Liang Signed-off-by: Ian Rogers Tested-by: Kan Liang Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Xing Zhengjun Link: https://lore.kernel.org/r/20220321223344.1034479-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/arch/x86/util/evlist.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) commit 34fe4ccb777e2c15a3419fa8e733114f6ce2a3c6 Merge: feff08395b2c 519129040766 Author: Arnaldo Carvalho de Melo Date: Tue Mar 22 17:52:10 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes that went thru perf/urgent and now are fixed by an upcoming patch. Signed-off-by: Arnaldo Carvalho de Melo commit ef248d9bd616b04df8be25539a4dc5db4b6c56f4 Author: Matt Kramer Date: Tue Mar 22 13:48:17 2022 -0700 ALSA: hda/realtek: Add alc256-samsung-headphone fixup This fixes the near-silence of the headphone jack on the ALC256-based Samsung Galaxy Book Flex Alpha (NP730QCJ). The magic verbs were found through trial and error, using known ALC298 hacks as inspiration. The fixup is auto-enabled only when the NP730QCJ is detected. It can be manually enabled using model=alc256-samsung-headphone. Signed-off-by: Matt Kramer Link: https://lore.kernel.org/r/3168355.aeNJFYEL58@linus Signed-off-by: Takashi Iwai Documentation/sound/hd-audio/models.rst | 4 ++++ sound/pci/hda/patch_realtek.c | 11 +++++++++++ 2 files changed, 15 insertions(+) commit feff08395b2c427caadf00f8c22920cfb3306739 Author: Namhyung Kim Date: Mon Mar 21 16:46:09 2022 -0700 perf ftrace latency: Update documentation Add description of 'perf ftrace latency' subcommand. Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Changbin Du Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220321234609.90455-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/Documentation/perf-ftrace.txt | 75 ++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 23 deletions(-) commit ebd326ce724d5b2e5274724e6d6a46a046e28203 Merge: 95ab0e87683e cd27ccfc727e Author: Linus Torvalds Date: Tue Mar 22 13:44:21 2022 -0700 Merge tag 'locking-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking updates from Ingo Molnar: "Changes in this cycle were: Bitops & cpumask: - Always inline various generic helpers, to improve code generation, but also for instrumentation, found by noinstr validation. - Add a x86-specific cpumask_clear_cpu() helper to improve code generation Atomics: - Fix atomic64_{read_acquire,set_release} fallbacks Lockdep: - Fix /proc/lockdep output loop iteration for classes - Fix /proc/lockdep potential access to invalid memory - Add Mark Rutland as reviewer for atomic primitives - Minor cleanups Jump labels: - Clean up the code a bit Misc: - Add __sched annotations to percpu rwsem primitives - Enable RT_MUTEXES on PREEMPT_RT by default - Stray v8086_mode() inlining fix, result of noinstr objtool validation" * tag 'locking-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: jump_label: Refactor #ifdef of struct static_key jump_label: Avoid unneeded casts in STATIC_KEY_INIT_{TRUE,FALSE} locking/lockdep: Iterate lock_classes directly when reading lockdep files x86/ptrace: Always inline v8086_mode() for instrumentation cpumask: Add a x86-specific cpumask_clear_cpu() helper locking: Enable RT_MUTEXES by default on PREEMPT_RT. locking/local_lock: Make the empty local_lock_*() function a macro. atomics: Fix atomic64_{read_acquire,set_release} fallbacks locking: Add missing __sched attributes cpumask: Always inline helpers which use bit manipulation functions asm-generic/bitops: Always inline all bit manipulation helpers locking/lockdep: Avoid potential access of invalid memory in lock_class lockdep: Use memset_startat() helper in reinit_class() MAINTAINERS: add myself as reviewer for atomics commit 84005bb6148618cc8429d4011354f4a2f8a02914 Author: Namhyung Kim Date: Mon Mar 21 16:46:08 2022 -0700 perf ftrace latency: Add -n/--use-nsec option Sometimes we want to see nano-second granularity. $ sudo perf ftrace latency -T dput -a sleep 1 # DURATION | COUNT | GRAPH | 0 - 1 us | 2098375 | ############################# | 1 - 2 us | 61 | | 2 - 4 us | 33 | | 4 - 8 us | 13 | | 8 - 16 us | 124 | | 16 - 32 us | 123 | | 32 - 64 us | 1 | | 64 - 128 us | 0 | | 128 - 256 us | 1 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - 2 ms | 0 | | 2 - 4 ms | 0 | | 4 - 8 ms | 0 | | 8 - 16 ms | 0 | | 16 - 32 ms | 0 | | 32 - 64 ms | 0 | | 64 - 128 ms | 0 | | 128 - 256 ms | 0 | | 256 - 512 ms | 0 | | 512 - 1024 ms | 0 | | 1 - ... s | 0 | | $ sudo perf ftrace latency -T dput -a -n sleep 1 # DURATION | COUNT | GRAPH | 0 - 1 us | 0 | | 1 - 2 ns | 0 | | 2 - 4 ns | 0 | | 4 - 8 ns | 0 | | 8 - 16 ns | 0 | | 16 - 32 ns | 0 | | 32 - 64 ns | 0 | | 64 - 128 ns | 1163434 | ############## | 128 - 256 ns | 914102 | ############# | 256 - 512 ns | 884 | | 512 - 1024 ns | 613 | | 1 - 2 us | 31 | | 2 - 4 us | 17 | | 4 - 8 us | 7 | | 8 - 16 us | 123 | | 16 - 32 us | 83 | | 32 - 64 us | 0 | | 64 - 128 us | 0 | | 128 - 256 us | 0 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - ... ms | 0 | | Committer testing: Testing it with BPF: # perf ftrace latency -b -n -T dput -a sleep 1 # DURATION | COUNT | GRAPH | 0 - 1 us | 0 | | 1 - 2 ns | 0 | | 2 - 4 ns | 0 | | 4 - 8 ns | 0 | | 8 - 16 ns | 0 | | 16 - 32 ns | 0 | | 32 - 64 ns | 0 | | 64 - 128 ns | 0 | | 128 - 256 ns | 823489 | ############################################# | 256 - 512 ns | 3232 | | 512 - 1024 ns | 51 | | 1 - 2 us | 172 | | 2 - 4 us | 9 | | 4 - 8 us | 0 | | 8 - 16 us | 2 | | 16 - 32 us | 0 | | 32 - 64 us | 0 | | 64 - 128 us | 0 | | 128 - 256 us | 0 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - ... ms | 0 | | [root@quaco ~]# strace -e bpf perf ftrace latency -b -n -T dput -a sleep 1 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7ffe2bd574f0, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\20\0\0\0\20\0\0\0\5\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=45, btf_log_size=0, btf_log_level=0}, 28) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\t\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=81, btf_log_size=0, btf_log_level=0}, 28) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\08\0\0\08\0\0\0\t\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=89, btf_log_size=0, btf_log_level=0}, 28) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\f\0\0\0\f\0\0\0\7\0\0\0\1\0\0\0\0\0\0\20"..., btf_log_buf=NULL, btf_size=43, btf_log_size=0, btf_log_level=0}, 28) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\t\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=81, btf_log_size=0, btf_log_level=0}, 28) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\5\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=77, btf_log_size=0, btf_log_level=0}, 28) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0(\0\0\0(\0\0\0\5\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=69, btf_log_size=0, btf_log_level=0}, 28) = -1 EINVAL (Invalid argument) bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0<\3\0\0<\3\0\0\362\3\0\0\0\0\0\0\0\0\0\2"..., btf_log_buf=NULL, btf_size=1862, btf_log_size=0, btf_log_level=0}, 28) = 3 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=4, max_entries=1, map_flags=BPF_F_MMAPABLE, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 4 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7ffe2bd571c0, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="test", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 4 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=8, value_size=8, max_entries=10000, map_flags=0, inner_map_fd=0, map_name="functime", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 4 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=1, map_flags=0, inner_map_fd=0, map_name="cpu_filter", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 5 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=1, map_flags=0, inner_map_fd=0, map_name="task_filter", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 7 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_PERCPU_ARRAY, key_size=4, value_size=8, max_entries=22, map_flags=0, inner_map_fd=0, map_name="latency", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 8 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=32, max_entries=1, map_flags=0, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 9 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=5, insns=0x7ffe2bd57220, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 10 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=16, max_entries=1, map_flags=BPF_F_MMAPABLE, inner_map_fd=0, map_name="func_lat.bss", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=33, btf_vmlinux_value_type_id=0, map_extra=0}, 72) = 9 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=9, key=0x7ffe2bd57330, value=0x7f9a5fc39000, flags=BPF_ANY}, 144) = 0 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=42, insns=0x113daf0, license="", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(5, 16, 13), prog_flags=0, prog_name="func_begin", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=3, func_info_rec_size=8, func_info=0x113fb70, func_info_cnt=1, line_info_rec_size=16, line_info=0x113fb90, line_info_cnt=21, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 10 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=124, insns=0x113d360, license="", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(5, 16, 13), prog_flags=0, prog_name="func_end", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=3, func_info_rec_size=8, func_info=0x113fcf0, func_info_cnt=1, line_info_rec_size=16, line_info=0x1139770, line_info_cnt=60, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 11 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_TRACEPOINT, insn_cnt=2, insns=0x7ffe2bd57150, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0, fd_array=NULL}, 144) = 13 bpf(BPF_LINK_CREATE, {link_create={prog_fd=13, target_fd=-1, attach_type=BPF_PERF_EVENT, flags=0}}, 144) = -1 EBADF (Bad file descriptor) bpf(BPF_LINK_CREATE, {link_create={prog_fd=10, target_fd=12, attach_type=BPF_PERF_EVENT, flags=0}}, 144) = 13 bpf(BPF_LINK_CREATE, {link_create={prog_fd=11, target_fd=14, attach_type=BPF_PERF_EVENT, flags=0}}, 144) = 15 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=130075, si_uid=0, si_status=0, si_utime=0, si_stime=0} --- bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7ffe2bd57624, value=0x113fdd0, flags=BPF_ANY}, 144) = 0 # DURATION | COUNT | GRAPH | 0 - 1 us | 0 | | 1 - 2 ns | 0 | | 2 - 4 ns | 0 | | 4 - 8 ns | 0 | | 8 - 16 ns | 0 | | 16 - 32 ns | 0 | | 32 - 64 ns | 0 | | 64 - 128 ns | 0 | | 128 - 256 ns | 42519 | ########################################### | 256 - 512 ns | 2140 | ## | 512 - 1024 ns | 54 | | 1 - 2 us | 16 | | 2 - 4 us | 10 | | 4 - 8 us | 0 | | 8 - 16 us | 0 | | 16 - 32 us | 0 | | 32 - 64 us | 0 | | 64 - 128 us | 0 | | 128 - 256 us | 0 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - ... ms | 0 | | +++ exited with 0 +++ # Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Changbin Du Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220321234609.90455-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-ftrace.c | 24 +++++++++++++++--------- tools/perf/util/bpf_ftrace.c | 2 ++ tools/perf/util/bpf_skel/func_latency.bpf.c | 6 ++++-- tools/perf/util/ftrace.h | 1 + 4 files changed, 22 insertions(+), 11 deletions(-) commit 70ef38515b664a14a3c8a3007778a56ccd02d43f Author: David Howells Date: Mon Jan 24 23:15:18 2022 +0000 cifs: writeback fix Wait for the page to be written to the cache before we allow it to be modified Signed-off-by: David Howells Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French fs/cifs/file.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 17aaf0193392cb3451bf0ac75ba396ec4cbded6e Author: Giacomo Guiduzzi Date: Tue Mar 22 21:06:54 2022 +0100 ALSA: pci: fix reading of swapped values from pcmreg in AC97 codec Tests 72 and 78 for ALSA in kselftest fail due to reading inconsistent values from some devices on a VirtualBox Virtual Machine using the snd_intel8x0 driver for the AC'97 Audio Controller device. Taking for example test number 72, this is what the test reports: "Surround Playback Volume.0 expected 1 but read 0, is_volatile 0" "Surround Playback Volume.1 expected 0 but read 1, is_volatile 0" These errors repeat for each value from 0 to 31. Taking a look at these error messages it is possible to notice that the written values are read back swapped. When the write is performed, these values are initially stored in an array used to sanity-check them and write them in the pcmreg array. To write them, the two one-byte values are packed together in a two-byte variable through bitwise operations: the first value is shifted left by one byte and the second value is stored in the right byte through a bitwise OR. When reading the values back, right shifts are performed to retrieve the previously stored bytes. These shifts are executed in the wrong order, thus reporting the values swapped as shown above. This patch fixes this mistake by reversing the read operations' order. Signed-off-by: Giacomo Guiduzzi Signed-off-by: Paolo Valente Cc: Link: https://lore.kernel.org/r/20220322200653.15862-1-guiduzzi.giacomo@gmail.com Signed-off-by: Takashi Iwai sound/pci/ac97/ac97_codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 7572733b84997d23077ebd852703055034b7a1d2 Author: John Garry Date: Mon Feb 21 21:16:49 2022 +0800 perf tools: Fix version kernel tag Generating the version kernel tag relies on "git describe" command to get the latest Linus kernel tag. However, when working from clones of Linus' git we may not have the latest tag. For example, when working on Arnaldo's acme.git, we can have this: $ git branch perf/core $ head -n 5 ../../Makefile | tail -n 4 VERSION = 5 PATCHLEVEL = 17 SUBLEVEL = 0 EXTRAVERSION = -rc3 $ git describe --abbrev=0 --match "v[0-9].[0-9]*" v4.13-rc5 Indeed using tags is a problem as it relies on tags being pulled from Linus' git (and pushed to the clone). In commit a4147f0f91386540 ("perf tools: Fix perf version generation") Robert introduced a change to use the kernelversion rule to generate the kernel tag when no git tags are available. However, as mentioned above, the tag we generate may be incorrect, so just always use kernelversion to get the tag (apart from building perf out of tree). Signed-off-by: John Garry Tested-by: Arnaldo Carvalho de Melo Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Richter Link: https://lore.kernel.org/r/1645449409-158238-3-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/PERF-VERSION-GEN | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) commit 3986f65d4f408ce9d0a361e3226a3246a5fb701c Author: Peter Zijlstra Date: Mon Mar 21 10:13:12 2022 +0100 kvm/emulate: Fix SETcc emulation for ENDBR Companion patch for commit fe83f5eae432 ("kvm/emulate: Fix SETcc emulation function offsets with SLS"), now extending it to cover the additional ENDBR instruction. Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/YjMVpfe%2f9ldmWX8W@hirez.programming.kicks-ass.net arch/x86/kvm/emulate.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit b9067cd80fbc5b3ae061e5bde6efd19bbf02f9e2 Merge: f6a2c2b2de81 fe83f5eae432 Author: Peter Zijlstra Date: Mon Mar 21 10:57:51 2022 +0100 Merge branch 'kvm/kvm-sls-fix' Sync with the last minute SLS fix to extend it for IBT. Signed-off-by: Peter Zijlstra commit f6a2c2b2de817078ac5a7e58c10e746165e7825d Author: Nathan Chancellor Date: Fri Mar 18 16:07:47 2022 -0700 x86/Kconfig: Only allow CONFIG_X86_KERNEL_IBT with ld.lld >= 14.0.0 With CONFIG_X86_KERNEL_IBT=y and a version of ld.lld prior to 14.0.0, there are numerous objtool warnings along the lines of: warning: objtool: .plt+0x6: indirect jump found in RETPOLINE build This is a known issue that has been resolved in ld.lld 14.0.0. Prevent CONFIG_X86_KERNEL_IBT from being selectable when using one of these problematic ld.lld versions. Signed-off-by: Nathan Chancellor Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220318230747.3900772-3-nathan@kernel.org arch/x86/Kconfig | 2 ++ 1 file changed, 2 insertions(+) commit 262448f3d18959d175b10e28a3b65f41d1d7313f Author: Nathan Chancellor Date: Fri Mar 18 16:07:46 2022 -0700 x86/Kconfig: Only enable CONFIG_CC_HAS_IBT for clang >= 14.0.0 Commit 156ff4a544ae ("x86/ibt: Base IBT bits") added a check for a crash with 'clang -fcf-protection=branch -mfentry -pg', which intended to exclude Clang versions older than 14.0.0 from selecting CONFIG_X86_KERNEL_IBT. clang-11 does not have the issue that the check is testing for, so CONFIG_X86_KERNEL_IBT is selectable. Unfortunately, there is a different crash in clang-11 that was fixed in clang-12. To make matters worse, that crash does not appear to be entirely deterministic, as the same input to the compiler will sometimes crash and other times not, which makes dynamically checking for the crash like the '-pg' one unreliable. To make everything work properly for all common versions of clang, use a hard version check of 14.0.0, as that will be the first release upstream that has both bugs properly fixed. Signed-off-by: Nathan Chancellor Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220318230747.3900772-2-nathan@kernel.org arch/x86/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit d31ed5d767c0452b4f49846d80a0bfeafa3a4ded Author: Peter Zijlstra Date: Fri Mar 18 12:19:27 2022 +0100 kbuild: Fixup the IBT kbuild changes Masahiro-san deemed my kbuild changes to support whole module objtool runs too terrible to live and gracefully provided an alternative. Suggested-by: Masahiro Yamada Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/CAK7LNAQ2mYMnOKMQheVi+6byUFE3KEkjm1zcndNUfe0tORGvug@mail.gmail.com scripts/Makefile.build | 66 +++++++++++++++----------------------------------- scripts/Makefile.lib | 4 +-- scripts/mod/modpost.c | 12 ++++----- 3 files changed, 27 insertions(+), 55 deletions(-) commit 95ab0e87683edb6766e4992725aac13aca788ec6 Merge: 519129040766 02a08d78f5c4 Author: Linus Torvalds Date: Tue Mar 22 13:06:49 2022 -0700 Merge tag 'perf-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 perf event updates from Ingo Molnar: - Fix address filtering for Intel/PT,ARM/CoreSight - Enable Intel/PEBS format 5 - Allow more fixed-function counters for x86 - Intel/PT: Enable not recording Taken-Not-Taken packets - Add a few branch-types * tag 'perf-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/uncore: Fix the build on !CONFIG_PHYS_ADDR_T_64BIT perf: Add irq and exception return branch types perf/x86/intel/uncore: Make uncore_discovery clean for 64 bit addresses perf/x86/intel/pt: Add a capability and config bit for disabling TNTs perf/x86/intel/pt: Add a capability and config bit for event tracing perf/x86/intel: Increase max number of the fixed counters KVM: x86: use the KVM side max supported fixed counter perf/x86/intel: Enable PEBS format 5 perf/core: Allow kernel address filter when not filtering the kernel perf/x86/intel/pt: Fix address filter config for 32-bit kernel perf/core: Fix address filter parser for multiple filters x86: Share definition of __is_canonical_address() perf/x86/intel/pt: Relax address filter validation commit 1f68915b2efd0d6bfd6e124aa63c94b3c69f127c Author: Takashi Iwai Date: Tue Mar 22 18:13:25 2022 +0100 ALSA: pcm: Add stream lock during PCM reset ioctl operations snd_pcm_reset() is a non-atomic operation, and it's allowed to run during the PCM stream running. It implies that the manipulation of hw_ptr and other parameters might be racy. This patch adds the PCM stream lock at appropriate places in snd_pcm_*_reset() actions for covering that. Cc: Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220322171325.4355-1-tiwai@suse.de Signed-off-by: Takashi Iwai sound/core/pcm_native.c | 4 ++++ 1 file changed, 4 insertions(+) commit 69534c48ba8ce552ce383b3dfdb271ffe51820c3 Author: Takashi Iwai Date: Tue Mar 22 18:07:20 2022 +0100 ALSA: pcm: Fix races among concurrent prealloc proc writes We have no protection against concurrent PCM buffer preallocation changes via proc files, and it may potentially lead to UAF or some weird problem. This patch applies the PCM open_mutex to the proc write operation for avoiding the racy proc writes and the PCM stream open (and further operations). Cc: Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220322170720.3529-5-tiwai@suse.de Signed-off-by: Takashi Iwai sound/core/pcm_memory.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 3c3201f8c7bb77eb53b08a3ca8d9a4ddc500b4c0 Author: Takashi Iwai Date: Tue Mar 22 18:07:19 2022 +0100 ALSA: pcm: Fix races among concurrent prepare and hw_params/hw_free calls Like the previous fixes to hw_params and hw_free ioctl races, we need to paper over the concurrent prepare ioctl calls against hw_params and hw_free, too. This patch implements the locking with the existing runtime->buffer_mutex for prepare ioctls. Unlike the previous case for snd_pcm_hw_hw_params() and snd_pcm_hw_free(), snd_pcm_prepare() is performed to the linked streams, hence the lock can't be applied simply on the top. For tracking the lock in each linked substream, we modify snd_pcm_action_group() slightly and apply the buffer_mutex for the case stream_lock=false (formerly there was no lock applied) there. Cc: Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220322170720.3529-4-tiwai@suse.de Signed-off-by: Takashi Iwai sound/core/pcm_native.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) commit dca947d4d26dbf925a64a6cfb2ddbc035e831a3d Author: Takashi Iwai Date: Tue Mar 22 18:07:18 2022 +0100 ALSA: pcm: Fix races among concurrent read/write and buffer changes In the current PCM design, the read/write syscalls (as well as the equivalent ioctls) are allowed before the PCM stream is running, that is, at PCM PREPARED state. Meanwhile, we also allow to re-issue hw_params and hw_free ioctl calls at the PREPARED state that may change or free the buffers, too. The problem is that there is no protection against those mix-ups. This patch applies the previously introduced runtime->buffer_mutex to the read/write operations so that the concurrent hw_params or hw_free call can no longer interfere during the operation. The mutex is unlocked before scheduling, so we don't take it too long. Cc: Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220322170720.3529-3-tiwai@suse.de Signed-off-by: Takashi Iwai sound/core/pcm_lib.c | 4 ++++ 1 file changed, 4 insertions(+) commit 92ee3c60ec9fe64404dc035e7c41277d74aa26cb Author: Takashi Iwai Date: Tue Mar 22 18:07:17 2022 +0100 ALSA: pcm: Fix races among concurrent hw_params and hw_free calls Currently we have neither proper check nor protection against the concurrent calls of PCM hw_params and hw_free ioctls, which may result in a UAF. Since the existing PCM stream lock can't be used for protecting the whole ioctl operations, we need a new mutex to protect those racy calls. This patch introduced a new mutex, runtime->buffer_mutex, and applies it to both hw_params and hw_free ioctl code paths. Along with it, the both functions are slightly modified (the mmap_count check is moved into the state-check block) for code simplicity. Reported-by: Hu Jiahui Cc: Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220322170720.3529-2-tiwai@suse.de Signed-off-by: Takashi Iwai include/sound/pcm.h | 1 + sound/core/pcm.c | 2 ++ sound/core/pcm_native.c | 61 +++++++++++++++++++++++++++++++------------------ 3 files changed, 42 insertions(+), 22 deletions(-) commit a245832aaa9930f0ea91527cbd70521722b89313 Author: Trond Myklebust Date: Mon Mar 21 17:27:14 2022 -0400 pNFS/files: Ensure pNFS allocation modes are consistent with nfsiod Ensure that pNFS file commit allocations in rpciod/nfsiod callbacks can fail in low memory mode, so that the threads don't block and loop forever. Signed-off-by: Trond Myklebust fs/nfs/filelayout/filelayout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3e5f151e94c190c31a240d9458677caab4f6c44e Author: Trond Myklebust Date: Mon Mar 21 15:34:22 2022 -0400 pNFS/flexfiles: Ensure pNFS allocation modes are consistent with nfsiod Ensure that pNFS flexfile allocations in rpciod/nfsiod callbacks can fail in low memory mode, so that the threads don't block and loop forever. Signed-off-by: Trond Myklebust fs/nfs/flexfilelayout/flexfilelayout.c | 50 ++++++++++++++-------------------- 1 file changed, 21 insertions(+), 29 deletions(-) commit 63d8a41b1dbf24dfc2480cb28236e2f6844d89b9 Author: Trond Myklebust Date: Mon Mar 21 15:32:09 2022 -0400 NFSv4/pnfs: Ensure pNFS allocation modes are consistent with nfsiod Ensure that pNFS allocations that can be called from rpciod/nfsiod callback can fail in low memory mode, so that the threads don't block and loop forever. Signed-off-by: Trond Myklebust fs/nfs/nfs42proc.c | 2 +- fs/nfs/pnfs.c | 39 +++++++++++++++++---------------------- 2 files changed, 18 insertions(+), 23 deletions(-) commit 0bae835b63c53f86cdc524f5962e39409585b22c Author: Trond Myklebust Date: Mon Mar 21 13:48:36 2022 -0400 NFS: Avoid writeback threads getting stuck in mempool_alloc() In a low memory situation, allow the NFS writeback code to fail without getting stuck in infinite loops in mempool_alloc(). Signed-off-by: Trond Myklebust fs/nfs/pagelist.c | 10 +++++----- fs/nfs/write.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 7 deletions(-) commit 515dcdcd48736576c6f5c197814da6f81c60a21e Author: Trond Myklebust Date: Mon Mar 21 12:34:19 2022 -0400 NFS: nfsiod should not block forever in mempool_alloc() The concern is that since nfsiod is sometimes required to kick off a commit, it can get locked up waiting forever in mempool_alloc() instead of failing gracefully and leaving the commit until later. Try to allocate from the slab first, with GFP_KERNEL | __GFP_NORETRY, then fall back to a non-blocking attempt to allocate from the memory pool. Signed-off-by: Trond Myklebust fs/nfs/internal.h | 7 +++++++ fs/nfs/pnfs_nfs.c | 8 ++++++-- fs/nfs/write.c | 24 +++++++++--------------- include/linux/nfs_fs.h | 2 +- 4 files changed, 23 insertions(+), 18 deletions(-) commit b2648015d4521de21ed3c9f48f718e023860b8c1 Author: Trond Myklebust Date: Mon Mar 21 13:20:16 2022 -0400 SUNRPC: Make the rpciod and xprtiod slab allocation modes consistent Make sure that rpciod and xprtiod are always using the same slab allocation modes. Signed-off-by: Trond Myklebust net/sunrpc/backchannel_rqst.c | 8 ++++---- net/sunrpc/rpcb_clnt.c | 4 ++-- net/sunrpc/socklib.c | 3 ++- net/sunrpc/xprt.c | 5 +---- net/sunrpc/xprtsock.c | 11 ++++++----- 5 files changed, 15 insertions(+), 16 deletions(-) commit 059ee82b6462028ebace435bc94f5b082be0632a Author: Trond Myklebust Date: Mon Mar 21 17:46:30 2022 -0400 SUNRPC: Fix unx_lookup_cred() allocation Default to the same mempool allocation strategy as for rpc_malloc(). Signed-off-by: Trond Myklebust net/sunrpc/auth_unix.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit 910ad38697d95bd32f45ba70fd6952f6c2956f28 Author: Trond Myklebust Date: Mon Mar 21 17:37:01 2022 -0400 NFS: Fix memory allocation in rpc_alloc_task() As for rpc_malloc(), we first try allocating from the slab, then fall back to a non-waiting allocation from the mempool. Signed-off-by: Trond Myklebust net/sunrpc/sched.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) commit 33e5c765bc1ea5e06ea7603637f14d727e6fcdf3 Author: Trond Myklebust Date: Mon Mar 14 22:02:22 2022 -0400 NFS: Fix memory allocation in rpc_malloc() When in a low memory situation, we do want rpciod to kick off direct reclaim in the case where that helps, however we don't want it looping forever in mempool_alloc(). So first try allocating from the slab using GFP_KERNEL | __GFP_NORETRY, and then fall back to a GFP_NOWAIT allocation from the mempool. Ditto for rpc_alloc_task() Signed-off-by: Trond Myklebust include/linux/sunrpc/sched.h | 1 + net/sunrpc/sched.c | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) commit d0afde5fc6fb13531e2434fc4b6a65f131671f68 Author: Trond Myklebust Date: Mon Mar 14 23:05:07 2022 -0400 SUNRPC: Improve accuracy of socket ENOBUFS determination The current code checks for whether or not the socket is in a writeable state after we get an EAGAIN. That is racy, since we've dropped the socket lock, so the amount of free buffer may have changed. Instead, let's check whether the socket is writeable before we try to write to it. If that was the case, we do expect the message to be at least partially sent unless we're in a low memory situation. Signed-off-by: Trond Myklebust net/sunrpc/xprtsock.c | 53 +++++++++++++++++---------------------------------- 1 file changed, 18 insertions(+), 35 deletions(-) commit 2790a624d43084de590884934969e19c7a82316a Author: Trond Myklebust Date: Tue Mar 15 08:12:40 2022 -0400 SUNRPC: Replace internal use of SOCKWQ_ASYNC_NOSPACE The socket's SOCKWQ_ASYNC_NOSPACE can be cleared by various actors in the socket layer, so replace it with our own flag in the transport sock_state field. Reported-by: Chuck Lever Signed-off-by: Trond Myklebust include/linux/sunrpc/xprtsock.h | 1 + net/sunrpc/xprtsock.c | 22 ++++------------------ 2 files changed, 5 insertions(+), 18 deletions(-) commit 7496b59f588dd52886fdbac7633608097543a0a5 Author: Trond Myklebust Date: Mon Mar 14 21:02:10 2022 -0400 SUNRPC: Fix socket waits for write buffer space The socket layer requires that we use the socket lock to protect changes to the sock->sk_write_pending field and others. Reported-by: Chuck Lever Signed-off-by: Trond Myklebust net/sunrpc/xprtsock.c | 54 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 15 deletions(-) commit 3b21f757c309c84a23a26d8cab20b743e0719705 Author: Trond Myklebust Date: Wed Mar 16 19:18:25 2022 -0400 SUNRPC: Only save the TCP source port after the connection is complete Since the RPC client uses a non-blocking connect(), we do not expect to see it return '0' under normal circumstances. Signed-off-by: Trond Myklebust net/sunrpc/xprtsock.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 89f42494f92f448747bd8a7ab1ae8b5d5520577d Author: Trond Myklebust Date: Wed Mar 16 19:10:43 2022 -0400 SUNRPC: Don't call connect() more than once on a TCP socket Avoid socket state races due to repeated calls to ->connect() using the same socket. If connect() returns 0 due to the connection having completed, but we are in fact in a closing state, then we may leave the XPRT_CONNECTING flag set on the transport. Reported-by: Enrico Scholz Fixes: 3be232f11a3c ("SUNRPC: Prevent immediate close+reconnect") Signed-off-by: Trond Myklebust include/linux/sunrpc/xprtsock.h | 1 + net/sunrpc/xprtsock.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) commit e47a62df29a0714cc2d5129516a3618337c84554 Author: Trond Myklebust Date: Tue Mar 22 09:11:44 2022 -0400 NFS: Fix revalidation of empty readdir pages If the page is empty, we need to check the array->last_cookie instead of the first entry. Add a helper for the cases where we care. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 0db8640df59512dbd423c32077919f10cf35ebc6 Merge: 4a0cb83ba6e0 7f0059b58f02 Author: Jakub Kicinski Date: Tue Mar 22 10:36:56 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== pull-request: bpf-next 2022-03-21 v2 We've added 137 non-merge commits during the last 17 day(s) which contain a total of 143 files changed, 7123 insertions(+), 1092 deletions(-). The main changes are: 1) Custom SEC() handling in libbpf, from Andrii. 2) subskeleton support, from Delyan. 3) Use btf_tag to recognize __percpu pointers in the verifier, from Hao. 4) Fix net.core.bpf_jit_harden race, from Hou. 5) Fix bpf_sk_lookup remote_port on big-endian, from Jakub. 6) Introduce fprobe (multi kprobe) _without_ arch bits, from Masami. The arch specific bits will come later. 7) Introduce multi_kprobe bpf programs on top of fprobe, from Jiri. 8) Enable non-atomic allocations in local storage, from Joanne. 9) Various var_off ptr_to_btf_id fixed, from Kumar. 10) bpf_ima_file_hash helper, from Roberto. 11) Add "live packet" mode for XDP in BPF_PROG_RUN, from Toke. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (137 commits) selftests/bpf: Fix kprobe_multi test. Revert "rethook: x86: Add rethook x86 implementation" Revert "arm64: rethook: Add arm64 rethook implementation" Revert "powerpc: Add rethook support" Revert "ARM: rethook: Add rethook arm implementation" bpftool: Fix a bug in subskeleton code generation bpf: Fix bpf_prog_pack when PMU_SIZE is not defined bpf: Fix bpf_prog_pack for multi-node setup bpf: Fix warning for cast from restricted gfp_t in verifier bpf, arm: Fix various typos in comments libbpf: Close fd in bpf_object__reuse_map bpftool: Fix print error when show bpf map bpf: Fix kprobe_multi return probe backtrace Revert "bpf: Add support to inline bpf_get_func_ip helper on x86" bpf: Simplify check in btf_parse_hdr() selftests/bpf/test_lirc_mode2.sh: Exit with proper code bpf: Check for NULL return from bpf_get_btf_vmlinux selftests/bpf: Test skipping stacktrace bpf: Adjust BPF stack helper functions to accommodate skip > 0 bpf: Select proper size for bpf_prog_pack ... ==================== Link: https://lore.kernel.org/r/20220322050159.5507-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski commit 7f0059b58f0257d895fafd2f2e3afe3bbdf21e64 Author: Alexei Starovoitov Date: Mon Mar 21 21:54:19 2022 -0700 selftests/bpf: Fix kprobe_multi test. When compiler emits endbr insn the function address could be different than what bpf_get_func_ip() reports. This is a short term workaround. bpf_get_func_ip() will be fixed later. Signed-off-by: Alexei Starovoitov tools/testing/selftests/bpf/progs/kprobe_multi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 4e8ca13440b4b84873da44871f8824a12381d16b Author: Alexei Starovoitov Date: Mon Mar 21 21:40:53 2022 -0700 Revert "rethook: x86: Add rethook x86 implementation" This reverts commit 75caf33eda242e2f34f61e475d666359749ae5ff. Signed-off-by: Alexei Starovoitov arch/x86/Kconfig | 1 - arch/x86/include/asm/unwind.h | 8 +-- arch/x86/kernel/Makefile | 1 - arch/x86/kernel/kprobes/common.h | 1 - arch/x86/kernel/rethook.c | 119 --------------------------------------- 5 files changed, 1 insertion(+), 129 deletions(-) commit 0f8f8030038ae37c32a233186caab2c381396784 Author: Alexei Starovoitov Date: Mon Mar 21 21:40:51 2022 -0700 Revert "arm64: rethook: Add arm64 rethook implementation" This reverts commit 83acdce6894908337ca82973149d9709d28204d7. Signed-off-by: Alexei Starovoitov arch/arm64/Kconfig | 1 - arch/arm64/include/asm/stacktrace.h | 2 +- arch/arm64/kernel/probes/Makefile | 1 - arch/arm64/kernel/probes/rethook.c | 25 -------- arch/arm64/kernel/probes/rethook_trampoline.S | 87 --------------------------- arch/arm64/kernel/stacktrace.c | 7 +-- 6 files changed, 2 insertions(+), 121 deletions(-) commit 35df0155e68a1fb20646f34247f19131170693bd Author: Alexei Starovoitov Date: Mon Mar 21 21:40:49 2022 -0700 Revert "powerpc: Add rethook support" This reverts commit 02752bd99dc2daae05c12f7063bf0632e22b4c1c. Signed-off-by: Alexei Starovoitov arch/powerpc/Kconfig | 1 - arch/powerpc/kernel/Makefile | 1 - arch/powerpc/kernel/rethook.c | 72 ------------------------------------------- 3 files changed, 74 deletions(-) commit ecaed3b9deea9ff3e7d98b9ee8722c7d78de5d97 Author: Alexei Starovoitov Date: Mon Mar 21 21:40:45 2022 -0700 Revert "ARM: rethook: Add rethook arm implementation" This reverts commit 515a49173b80a4aabcbad9a4fa2a247042378ea1. Signed-off-by: Alexei Starovoitov arch/arm/Kconfig | 1 - arch/arm/include/asm/stacktrace.h | 4 +- arch/arm/kernel/stacktrace.c | 6 --- arch/arm/probes/Makefile | 1 - arch/arm/probes/rethook.c | 103 -------------------------------------- 5 files changed, 2 insertions(+), 113 deletions(-) commit ee1fee900537b5d9560e9f937402de5ddc8412f3 Author: Jann Horn Date: Sat Mar 19 02:08:37 2022 +0100 ptrace: Check PTRACE_O_SUSPEND_SECCOMP permission on PTRACE_SEIZE Setting PTRACE_O_SUSPEND_SECCOMP is supposed to be a highly privileged operation because it allows the tracee to completely bypass all seccomp filters on kernels with CONFIG_CHECKPOINT_RESTORE=y. It is only supposed to be settable by a process with global CAP_SYS_ADMIN, and only if that process is not subject to any seccomp filters at all. However, while these permission checks were done on the PTRACE_SETOPTIONS path, they were missing on the PTRACE_SEIZE path, which also sets user-specified ptrace flags. Move the permissions checks out into a helper function and let both ptrace_attach() and ptrace_setoptions() call it. Cc: stable@kernel.org Fixes: 13c4a90119d2 ("seccomp: add ptrace options for suspend/resume") Signed-off-by: Jann Horn Link: https://lkml.kernel.org/r/20220319010838.1386861-1-jannh@google.com Signed-off-by: Eric W. Biederman kernel/ptrace.c | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) commit fa3416509605621b8db263b0ee9aaf85285aee4b Author: Jakob Koschel Date: Sat Mar 19 22:54:47 2022 +0100 ACPI, APEI: Use the correct variable for sizeof() While the original code is valid, it is not the obvious choice for the sizeof() call and in preparation to limit the scope of the list iterator variable the sizeof should be changed to the size of the variable being allocated. Signed-off-by: Jakob Koschel Signed-off-by: Rafael J. Wysocki drivers/acpi/apei/apei-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5191290407668028179f2544a11ae9b57f0bcf07 Merge: 9b03992f0c88 d3e29967079c Author: Linus Torvalds Date: Tue Mar 22 10:51:40 2022 -0700 Merge tag 'for-5.18-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "This contains feature updates, performance improvements, preparatory and core work and some related VFS updates: Features: - encoded read/write ioctls, allows user space to read or write raw data directly to extents (now compressed, encrypted in the future), will be used by send/receive v2 where it saves processing time - zoned mode now works with metadata DUP (the mkfs.btrfs default) - error message header updates: - print error state: transaction abort, other error, log tree errors - print transient filesystem state: remount, device replace, ignored checksum verifications - tree-checker: verify the transaction id of the to-be-written dirty extent buffer Performance improvements for fsync: - directory logging speedups (up to -90% run time) - avoid logging all directory changes during renames (up to -60% run time) - avoid inode logging during rename and link when possible (up to -60% run time) - prepare extents to be logged before locking a log tree path (throughput +7%) - stop copying old file extents when doing a full fsync() - improved logging of old extents after truncate Core, fixes: - improved stale device identification by dev_t and not just path (for devices that are behind other layers like device mapper) - continued extent tree v2 preparatory work - disable features that won't work yet - add wrappers and abstractions for new tree roots - improved error handling - add super block write annotations around background block group reclaim - fix device scanning messages potentially accessing stale pointer - cleanups and refactoring VFS: - allow reflinks/deduplication from two different mounts of the same filesystem - export and add helpers for read/write range verification, for the encoded ioctls" * tag 'for-5.18-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (98 commits) btrfs: zoned: put block group after final usage btrfs: don't access possibly stale fs_info data in device_list_add btrfs: add lockdep_assert_held to need_preemptive_reclaim btrfs: verify the tranisd of the to-be-written dirty extent buffer btrfs: unify the error handling of btrfs_read_buffer() btrfs: unify the error handling pattern for read_tree_block() btrfs: factor out do_free_extent_accounting helper btrfs: remove last_ref from the extent freeing code btrfs: add a alloc_reserved_extent helper btrfs: remove BUG_ON(ret) in alloc_reserved_tree_block btrfs: add and use helper for unlinking inode during log replay btrfs: extend locking to all space_info members accesses btrfs: zoned: mark relocation as writing fs: allow cross-vfsmount reflink/dedupe btrfs: remove the cross file system checks from remap btrfs: pass btrfs_fs_info to btrfs_recover_relocation btrfs: pass btrfs_fs_info for deleting snapshots and cleaner btrfs: add filesystems state details to error messages btrfs: deal with unexpected extent type during reflinking btrfs: fix unexpected error path when reflinking an inline extent ... commit 05e815539f3f161585c13a9ab023341bade2c52f Author: Wan Jiabing Date: Mon Mar 7 17:41:48 2022 +0800 cxl/core/port: Fix NULL but dereferenced coccicheck error Fix the following coccicheck warning: ./drivers/cxl/core/port.c:913:21-24: ERROR: port is NULL but dereferenced. The put_device() is only relevent in the is_cxl_root() case. Fixes: 2703c16c75ae ("cxl/core/port: Add switch port enumeration") Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220307094158.404882-1-wanjiabing@vivo.com Signed-off-by: Dan Williams drivers/cxl/core/port.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 9b03992f0c88baef524842e411fbdc147780dd5d Merge: 14705fda8f62 919adbfec29d Author: Linus Torvalds Date: Tue Mar 22 10:36:55 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: "Fix some bugs in converting ext4 to use the new mount API, as well as more bug fixes and clean ups in the ext4 fast_commit feature (most notably, in the tracepoints). In the jbd2 layer, the t_handle_lock spinlock has been removed, with the last place where it was actually needed replaced with an atomic cmpxchg" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (35 commits) ext4: fix kernel doc warnings ext4: fix remaining two trace events to use same printk convention ext4: add commit tid info in ext4_fc_commit_start/stop trace events ext4: add commit_tid info in jbd debug log ext4: add transaction tid info in fc_track events ext4: add new trace event in ext4_fc_cleanup ext4: return early for non-eligible fast_commit track events ext4: do not call FC trace event in ext4_fc_commit() if FS does not support FC ext4: convert ext4_fc_track_dentry type events to use event class ext4: fix ext4_fc_stats trace point ext4: remove unused enum EXT4_FC_COMMIT_FAILED ext4: warn when dirtying page w/o buffers in data=journal mode doc: fixed a typo in ext4 documentation ext4: make mb_optimize_scan performance mount option work with extents ext4: make mb_optimize_scan option work with set/unset mount cmd ext4: don't BUG if someone dirty pages without asking ext4 first ext4: remove redundant assignment to variable split_flag1 ext4: fix underflow in ext4_max_bitmap_size() ext4: fix ext4_mb_clear_bb() kernel-doc comment ext4: fix fs corruption when tring to remove a non-empty directory with IO error ... commit 14705fda8f6273501930dfe1d679ad4bec209f52 Merge: 105b6c05c583 4fc5f5346592 Author: Linus Torvalds Date: Tue Mar 22 10:29:51 2022 -0700 Merge tag 'nfsd-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd updates from Chuck Lever: "New features: - NFSv3 support in NFSD is now always built - Added NFSD support for the NFSv4 birth-time file attribute - Added support for storing and displaying sockaddrs in trace points - NFSD now recognizes RPC_AUTH_TLS probes Performance improvements: - Optimized the svc transport enqueuing mechanism - Added micro-optimizations for the duplicate reply cache Notable bug fixes: - Allocation of the NFSD file cache hash table is more reliable" * tag 'nfsd-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (30 commits) nfsd: fix using the correct variable for sizeof() nfsd: use correct format characters NFSD: prevent integer overflow on 32 bit systems NFSD: prevent underflow in nfssvc_decode_writeargs() fs/lock: documentation cleanup. Replace inode->i_lock with flc_lock. NFSD: Fix nfsd_breaker_owns_lease() return values NFSD: Clean up _lm_ operation names arch: Remove references to CONFIG_NFSD_V3 in the default configs NFSD: Remove CONFIG_NFSD_V3 nfsd: more robust allocation failure handling in nfsd_file_cache_init SUNRPC: Teach server to recognize RPC_AUTH_TLS NFSD: Move svc_serv_ops::svo_function into struct svc_serv NFSD: Remove svc_serv_ops::svo_module SUNRPC: Remove svc_shutdown_net() SUNRPC: Rename svc_close_xprt() SUNRPC: Rename svc_create_xprt() SUNRPC: Remove svo_shutdown method SUNRPC: Merge svc_do_enqueue_xprt() into svc_enqueue_xprt() SUNRPC: Remove the .svo_enqueue_xprt method SUNRPC: Record endpoint information in trace log ... commit 105b6c05c58306c4d576b7fc098c2b5a421ab06d Merge: ef510682af3d dca65818c80c Author: Linus Torvalds Date: Tue Mar 22 10:24:16 2022 -0700 Merge tag '5.18-smb3-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6 Pull cfis updates from Steve French: "Handlecache, unmount, fiemap and two reconnect fixes" * tag '5.18-smb3-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6: cifs: use a different reconnect helper for non-cifsd threads cifs: we do not need a spinlock around the tree access during umount Adjust cifssb maximum read size cifs: truncate the inode and mapping when we simulate fcollapse cifs: fix handlecache and multiuser commit ef510682af3dbe2f9cdae7126a1461c94e010967 Merge: aab4ed5816ac 5b5b4f85b016 Author: Linus Torvalds Date: Tue Mar 22 10:00:31 2022 -0700 Merge tag 'f2fs-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "In this cycle, f2fs has some performance improvements for Android workloads such as using read-unfair rwsems and adding some sysfs entries to control GCs and discard commands in more details. In addtiion, it has some tunings to improve the recovery speed after sudden power-cut. Enhancement: - add reader-unfair rwsems with F2FS_UNFAIR_RWSEM: will replace with generic API support - adjust to make the readahead/recovery flow more efficiently - sysfs entries to control issue speeds of GCs and Discard commands - enable idmapped mounts Bug fix: - correct wrong error handling routines - fix missing conditions in quota - fix a potential deadlock between writeback and block plug routines - fix a deadlock btween freezefs and evict_inode We've added some boundary checks to avoid kernel panics on corrupted images, and several minor code clean-ups" * tag 'f2fs-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (27 commits) f2fs: fix to do sanity check on .cp_pack_total_block_count f2fs: make gc_urgent and gc_segment_mode sysfs node readable f2fs: use aggressive GC policy during f2fs_disable_checkpoint() f2fs: fix compressed file start atomic write may cause data corruption f2fs: initialize sbi->gc_mode explicitly f2fs: introduce gc_urgent_mid mode f2fs: compress: fix to print raw data size in error path of lz4 decompression f2fs: remove redundant parameter judgment f2fs: use spin_lock to avoid hang f2fs: don't get FREEZE lock in f2fs_evict_inode in frozen fs f2fs: remove unnecessary read for F2FS_FITS_IN_INODE f2fs: introduce F2FS_UNFAIR_RWSEM to support unfair rwsem f2fs: avoid an infinite loop in f2fs_sync_dirty_inodes f2fs: fix to do sanity check on curseg->alloc_type f2fs: fix to avoid potential deadlock f2fs: quota: fix loop condition at f2fs_quota_sync() f2fs: Restore rwsem lockdep support f2fs: fix missing free nid in f2fs_handle_failed_inode f2fs: support idmapped mounts f2fs: add a way to limit roll forward recovery time ... commit aab4ed5816acc0af8cce2680880419cd64982b1d Merge: 881b568756ae a1108dcd9373 Author: Linus Torvalds Date: Tue Mar 22 09:54:56 2022 -0700 Merge tag 'erofs-for-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs updates from Gao Xiang: "In this cycle, we continue converting to use meta buffers for all remaining uncompressed paths to prepare for the upcoming subpage, folio and fscache features. We also fixed a double-free issue when sysfs initialization fails, which was reported by syzbot. Besides, in order for the userspace to control per-file timestamp easier, we now switch to record mtime instead of ctime with a compatible feature marked. And there are also some code cleanups and documentation update as usual. Summary: - Avoid using page structure directly for all uncompressed paths - Fix a double-free issue when sysfs initialization fails - Complete DAX description for erofs - Use mtime instead since there's no (easy) way for users to control ctime - Several code cleanups" * tag 'erofs-for-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: rename ctime to mtime erofs: use meta buffers for inode lookup erofs: use meta buffers for reading directories fs: erofs: add sanity check for kobject in erofs_unregister_sysfs erofs: refine managed inode stuffs erofs: clean up z_erofs_extent_lookback erofs: silence warnings related to impossible m_plen Documentation/filesystem/dax: update DAX description on erofs erofs: clean up preload_compressed_pages() erofs: get rid of `struct z_erofs_collector' erofs: use meta buffers for erofs_read_superblock() commit 881b568756ae55ce7d87b9f001cbbe9d1289893e Merge: 0313bc278dac cdaa1b1941f6 Author: Linus Torvalds Date: Tue Mar 22 09:50:16 2022 -0700 Merge tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt Pull fscrypt updates from Eric Biggers: "Add support for direct I/O on encrypted files when blk-crypto (inline encryption) is being used for file contents encryption" * tag 'fscrypt-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt: fscrypt: update documentation for direct I/O support f2fs: support direct I/O with fscrypt using blk-crypto ext4: support direct I/O with fscrypt using blk-crypto iomap: support direct I/O with fscrypt using blk-crypto fscrypt: add functions for direct I/O support commit 1c4664faa38923330d478f046dc743a00c1e2dec Author: Max Filippov Date: Mon Jan 3 12:08:31 2022 -0800 xtensa: define update_mmu_tlb function Before the commit f9ce0be71d1f ("mm: Cleanup faultaround and finish_fault() codepaths") there was a call to update_mmu_cache in alloc_set_pte that used to invalidate TLB entry caching invalid PTE that caused a page fault. That commit removed that call so now invalid TLB entry survives causing repetitive page faults on the CPU that took the initial fault until that TLB entry is occasionally evicted. This issue is spotted by the xtensa TLB sanity checker. Fix this issue by defining update_mmu_tlb function that flushes TLB entry for the faulting address. Cc: stable@vger.kernel.org # 5.12+ Signed-off-by: Max Filippov arch/xtensa/include/asm/pgtable.h | 4 ++++ arch/xtensa/mm/tlb.c | 6 ++++++ 2 files changed, 10 insertions(+) commit b9fae6a47b8bcb397e6a482095431f6ba9648211 Author: Randy Dunlap Date: Sat Feb 26 13:37:03 2022 -0800 x86/PCI: Add #includes to asm/pci_x86.h uses raw_spinlock_t, __init, and EINVAL; #include the appropriate files to prevent build errors. ../arch/x86/include/asm/pci_x86.h:105:8: error: unknown type name ‘raw_spinlock_t’ ../arch/x86/include/asm/pci_x86.h:141:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘dmi_check_pciprobe’ ../arch/x86/include/asm/pci_x86.h:150:10: error: ‘EINVAL’ undeclared (first use in this function) Link: https://lore.kernel.org/r/20220226213703.24041-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Signed-off-by: Bjorn Helgaas Cc: Mark Brown Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen arch/x86/include/asm/pci_x86.h | 3 +++ 1 file changed, 3 insertions(+) commit 6a8fcf7d47a0679a0fe4239c783224ceb559e661 Author: Bjorn Helgaas Date: Sun Mar 13 14:29:33 2022 -0500 PCI: ibmphp: Remove unused assignments Remove variables and assignments that are never used. Found by Krzysztof using cppcheck, e.g.: $ cppcheck --enable=all --force unreadVariable drivers/pci/hotplug/ibmphp_res.c:1958 Variable 'bus_sec' is assigned a value that is never used. Reported-by: Krzysztof Wilczyński Link: https://lore.kernel.org/r/20220313192933.434746-6-helgaas@kernel.org Signed-off-by: Bjorn Helgaas drivers/pci/hotplug/ibmphp_hpc.c | 2 -- drivers/pci/hotplug/ibmphp_res.c | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) commit af8b8b6c044541430b287e549aeb5ffd622c8ac7 Author: Bjorn Helgaas Date: Sun Mar 13 14:29:32 2022 -0500 PCI: cpqphp: Remove unused assignments Remove variables and assignments that are never used. Found by Krzysztof using cppcheck, e.g.: $ cppcheck --enable=all --force unreadVariable drivers/pci/hotplug/cpqphp_core.c:1257 Variable 'rc' is assigned a value that is never used. Reported-by: Krzysztof Wilczyński Link: https://lore.kernel.org/r/20220313192933.434746-5-helgaas@kernel.org Signed-off-by: Bjorn Helgaas drivers/pci/hotplug/cpqphp_core.c | 2 +- drivers/pci/hotplug/cpqphp_ctrl.c | 22 +++++----------------- drivers/pci/hotplug/cpqphp_pci.c | 2 +- 3 files changed, 7 insertions(+), 19 deletions(-) commit 6f102550728838f0f83123f193740c06fdfbdd62 Author: Bjorn Helgaas Date: Sun Mar 13 14:29:31 2022 -0500 PCI: fu740: Remove unused assignments fu740_pcie_host_init() assigned "ret", but never used the value. Drop it. Found by Krzysztof using cppcheck: $ cppcheck --enable=all --force unreadVariable drivers/pci/controller/dwc/pcie-fu740.c:227 Variable 'ret' is assigned a value that is never used. Reported-by: Krzysztof Wilczyński Link: https://lore.kernel.org/r/20220313192933.434746-4-helgaas@kernel.org Signed-off-by: Bjorn Helgaas drivers/pci/controller/dwc/pcie-fu740.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b6829e0419e5b3deafce5455da588c39deda77fa Author: Bjorn Helgaas Date: Sun Mar 13 14:29:30 2022 -0500 PCI: kirin: Remove unused assignments hi3660_pcie_phy_init() assigned "pdev", but never used the value. Drop it. Found by Krzysztof using cppcheck: $ cppcheck --enable=all --force unreadVariable drivers/pci/controller/dwc/pcie-kirin.c:336 Variable 'pdev' is assigned a value that is never used. Reported-by: Krzysztof Wilczyński Link: https://lore.kernel.org/r/20220313192933.434746-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas drivers/pci/controller/dwc/pcie-kirin.c | 3 --- 1 file changed, 3 deletions(-) commit c50762a85da6a95a96a20043ed518264b62b47df Author: Bjorn Helgaas Date: Sun Mar 13 14:29:29 2022 -0500 PCI: Remove unused assignments Remove variables and assignments that are never used. Found by Krzysztof using cppcheck, e.g., $ cppcheck --enable=all --force uselessAssignmentPtrArg drivers/pci/proc.c:102 Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? unreadVariable drivers/pci/setup-bus.c:1528 Variable 'old_flags' is assigned a value that is never used. Reported-by: Krzysztof Wilczyński Link: https://lore.kernel.org/r/20220313192933.434746-2-helgaas@kernel.org Signed-off-by: Bjorn Helgaas drivers/pci/pci-sysfs.c | 7 +------ drivers/pci/proc.c | 4 ---- drivers/pci/setup-bus.c | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) commit cb2d0f846139b620ff2d11da15daa0eeb581d1a6 Author: Krzysztof Wilczyński Date: Tue Jul 6 00:31:45 2021 +0000 PCI: Declare pci_filp_private only when HAVE_PCI_MMAP The struct pci_filp_private has no users outside drivers/pci/proc.c and is only used when HAVE_PCI_MMAP is defined. Wrap the struct pci_filp_private definition itself in #ifdef HAVE_PCI_MMAP. Found by cppcheck: $ cppcheck --enable=all --force drivers/pci/proc.c drivers/pci/proc.c:192:6: style: struct member 'pci_filp_private::write_combine' is never used. [unusedStructMember] Link: https://lore.kernel.org/r/20210706003145.3054881-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas drivers/pci/proc.c | 2 ++ 1 file changed, 2 insertions(+) commit 0313bc278dac7cd9ce83a8d384581dc043156965 Author: Linus Torvalds Date: Tue Mar 22 09:17:20 2022 -0700 Revert "random: block in /dev/urandom" This reverts commit 6f98a4bfee72c22f50aedb39fb761567969865fe. It turns out we still can't do this. Way too many platforms that don't have any real source of randomness at boot and no jitter entropy because they don't even have a cycle counter. As reported by Guenter Roeck: "This causes a large number of qemu boot test failures for various architectures (arm, m68k, microblaze, sparc32, xtensa are the ones I observed). Common denominator is that boot hangs at 'Saving random seed:'" This isn't hugely unexpected - we tried it, it failed, so now we'll revert it. Link: https://lore.kernel.org/all/20220322155820.GA1745955@roeck-us.net/ Reported-and-bisected-by: Guenter Roeck Cc: Jason Donenfeld Signed-off-by: Linus Torvalds drivers/char/mem.c | 2 +- drivers/char/random.c | 72 ++++++++++++++++++++++++++++++++++++++------------ include/linux/random.h | 2 +- 3 files changed, 57 insertions(+), 19 deletions(-) commit a53046291020ec41e09181396c1e829287b48d47 Author: Haimin Zhang Date: Tue Mar 22 21:59:17 2022 +0800 jfs: prevent NULL deref in diFree Add validation check for JFS_IP(ipimap)->i_imap to prevent a NULL deref in diFree since diFree uses it without do any validations. When function jfs_mount calls diMount to initialize fileset inode allocation map, it can fail and JFS_IP(ipimap)->i_imap won't be initialized. Then it calls diFreeSpecial to close fileset inode allocation map inode and it will flow into jfs_evict_inode. Function jfs_evict_inode just validates JFS_SBI(inode->i_sb)->ipimap, then calls diFree. diFree use JFS_IP(ipimap)->i_imap directly, then it will cause a NULL deref. Reported-by: TCS Robot Signed-off-by: Haimin Zhang Signed-off-by: Dave Kleikamp fs/jfs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 2cc7cc01c15f57d056318c33705647f87dcd4aab Author: Pavel Skripkin Date: Sat Mar 19 22:30:00 2022 +0300 jfs: fix divide error in dbNextAG Syzbot reported divide error in dbNextAG(). The problem was in missing validation check for malicious image. Syzbot crafted an image with bmp->db_numag equal to 0. There wasn't any validation checks, but dbNextAG() blindly use bmp->db_numag in divide expression Fix it by validating bmp->db_numag in dbMount() and return an error if image is malicious Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-and-tested-by: syzbot+46f5c25af73eb8330eb6@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Dave Kleikamp fs/jfs/jfs_dmap.c | 7 +++++++ 1 file changed, 7 insertions(+) commit c5c948aa894a831f96fccd025e47186b1ee41615 Author: Aurabindo Pillai Date: Tue Mar 15 14:53:24 2022 -0400 drm/amd: Add USBC connector ID [Why&How] Add a dedicated AMDGPU specific ID for use with newer ASICs that support USB-C output Signed-off-by: Aurabindo Pillai Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/ObjectID.h | 1 + 1 file changed, 1 insertion(+) commit 4e666cdb06eede2069a7b1a96a1359d1c441a3eb Author: John Garry Date: Mon Feb 21 21:16:48 2022 +0800 perf tools: Fix dependency for version file creation The version generated by perf may not be correct by just changing the head commit, like this: $ git log --pretty=format:"%H" -n 1 b5d9d4708a24ac1889a30e9aedf8af8d73102139 $ perf -v perf version 5.16.gb5d9d4708a24 $ git reset --hard HEAD^ HEAD is now at 629f520b265f $ make ... $ ./perf -v perf version 5.16.gb5d9d4708a24 The dependency to building PERF-VERSION-FILE should also include ORIG_HEAD, as this changes when changing the head commit (while HEAD does not). Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Robert Richter Link: https://lore.kernel.org/r/1645449409-158238-2-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/Makefile.perf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 648a4548d622c4ae965058db1a6b5b95c062789a Author: Trond Myklebust Date: Mon Mar 21 22:27:13 2022 -0400 NFS: Don't deadlock when cookie hashes collide In the very rare case where the readdir reply contains multiple cookies that map to the same hash value, we can end up deadlocking waiting for a page lock that we already hold. In this case we should fail the page lock by using grab_cache_page_nowait(). Signed-off-by: Trond Myklebust fs/nfs/dir.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) commit 3d8fa7a22dcd54ccfdcea6ed0d9badbdb8594274 Author: Luca Weiss Date: Mon Mar 21 14:33:13 2022 +0100 dt-bindings: ufs: qcom: Add SM6350 compatible string Document the compatible for the UFS found on SM6350. Signed-off-by: Luca Weiss Reviewed-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220321133318.99406-2-luca.weiss@fairphone.com Documentation/devicetree/bindings/ufs/qcom,ufs.yaml | 2 ++ 1 file changed, 2 insertions(+) commit 4a0cb83ba6e0cd73a50fa4f84736846bf0029f2b Author: Jakub Kicinski Date: Mon Mar 21 22:10:53 2022 -0700 netdevice: add missing dm_private kdoc Building htmldocs complains: include/linux/netdevice.h:2295: warning: Function parameter or member 'dm_private' not described in 'net_device' Fixes: b26ef81c46ed ("drop_monitor: remove quadratic behavior") Signed-off-by: Jakub Kicinski Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220322051053.1883186-1-kuba@kernel.org Signed-off-by: Paolo Abeni include/linux/netdevice.h | 2 ++ 1 file changed, 2 insertions(+) commit cde3fc244b3d2e1bb32fc5869c718ec1cbb79481 Author: Eric Dumazet Date: Mon Mar 21 18:23:14 2022 -0700 net: bridge: mst: prevent NULL deref in br_mst_info_size() Call br_mst_info_size() only if vg pointer is not NULL. general protection fault, probably for non-canonical address 0xdffffc0000000058: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x00000000000002c0-0x00000000000002c7] CPU: 0 PID: 975 Comm: syz-executor.0 Tainted: G W 5.17.0-next-20220321-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:br_mst_info_size+0x97/0x270 net/bridge/br_mst.c:242 Code: 00 00 31 c0 e8 ba 10 53 f9 31 c0 b9 40 00 00 00 4c 8d 6c 24 30 4c 89 ef f3 48 ab 48 8d 83 c0 02 00 00 48 89 04 24 48 c1 e8 03 <80> 3c 28 00 0f 85 ae 01 00 00 48 8b 83 c0 02 00 00 41 bf 04 00 00 RSP: 0018:ffffc900153770a8 EFLAGS: 00010202 RAX: 0000000000000058 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000040000 RSI: ffffffff88259876 RDI: ffffc900153772d8 RBP: dffffc0000000000 R08: 0000000000000000 R09: ffffffff8db68957 R10: ffffffff881f737b R11: 0000000000000000 R12: 0000000000000000 R13: ffffc900153770d8 R14: 00000000000002a0 R15: 00000000ffffffff FS: 00007f18bbb6f700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020001a80 CR3: 000000001a7d9000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 00000000000000d8 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: br_get_link_af_size_filtered+0x6e9/0xc00 net/bridge/br_netlink.c:123 rtnl_link_get_af_size net/core/rtnetlink.c:598 [inline] if_nlmsg_size+0x40c/0xa50 net/core/rtnetlink.c:1040 rtnl_calcit.isra.0+0x25f/0x460 net/core/rtnetlink.c:3780 rtnetlink_rcv_msg+0xa65/0xb80 net/core/rtnetlink.c:5937 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2496 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f18baa89049 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:00007f18bbb6f168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f18bab9bf60 RCX: 00007f18baa89049 RDX: 0000000000000000 RSI: 0000000020001a80 RDI: 0000000000000004 RBP: 00007f18baae308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeedb2be2f R14: 00007f18bbb6f300 R15: 0000000000022000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:br_mst_info_size+0x97/0x270 net/bridge/br_mst.c:242 Code: 00 00 31 c0 e8 ba 10 53 f9 31 c0 b9 40 00 00 00 4c 8d 6c 24 30 4c 89 ef f3 48 ab 48 8d 83 c0 02 00 00 48 89 04 24 48 c1 e8 03 <80> 3c 28 00 0f 85 ae 01 00 00 48 8b 83 c0 02 00 00 41 bf 04 00 00 RSP: 0018:ffffc900153770a8 EFLAGS: 00010202 RAX: 0000000000000058 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000040000 RSI: ffffffff88259876 RDI: ffffc900153772d8 RBP: dffffc0000000000 R08: 0000000000000000 R09: ffffffff8db68957 R10: ffffffff881f737b R11: 0000000000000000 R12: 0000000000000000 R13: ffffc900153770d8 R14: 00000000000002a0 R15: 00000000ffffffff FS: 00007f18bbb6f700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2ca22000 CR3: 000000001a7d9000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 00000000000000d8 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Fixes: 122c29486e1f ("net: bridge: mst: Support setting and reporting MST port states") Reported-by: syzbot Signed-off-by: Eric Dumazet Cc: Tobias Waldekranz Cc: Nikolay Aleksandrov Reviewed-by: Tobias Waldekranz Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20220322012314.795187-1-eric.dumazet@gmail.com Signed-off-by: Paolo Abeni net/bridge/br_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0474bcc9c174158281bc55838b497e0f7b76fcbb Merge: 02b82b02c343 f48a0c475c2a Author: Rafael J. Wysocki Date: Tue Mar 22 12:29:22 2022 +0100 Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm into pm-opp Pull OPP (Operating Performance Points) changes for 5.18-rc1 from Viresh Kumar: "- Introduce opp-microwatt property to the OPP core, bindings, etc (Lukasz Luba). - Convert DT bindings to schema format and various related fixes (Yassine Oudjana). - Expose OPP's OF node in debugfs (Viresh Kumar)." * 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: Documentation: EM: Describe new registration method using DT OPP: Add support of "opp-microwatt" for EM registration PM: EM: add macro to set .active_power() callback conditionally OPP: Add "opp-microwatt" supporting code dt-bindings: opp: Add "opp-microwatt" entry in the OPP dt-bindings: power: avs: qcom,cpr: Convert to DT schema arm64: dts: qcom: qcs404: Rename CPU and CPR OPP tables arm64: dts: qcom: msm8996: Rename cluster OPP tables dt-bindings: opp: Convert qcom-nvmem-cpufreq to DT schema dt-bindings: opp: qcom-opp: Convert to DT schema arm64: dts: qcom: msm8996-mtp: Add msm8996 compatible dt-bindings: arm: qcom: Add msm8996 and apq8096 compatibles opp: Expose of-node's name in debugfs commit 2353828f3695ecbbc3fb4b695fa6c77323db42d0 Merge: 02b82b02c343 b7f2b0d3511a Author: Rafael J. Wysocki Date: Tue Mar 22 12:15:47 2022 +0100 Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull ARM cpufreq updates for 5.18-rc1 fron Viresh Kumar: "- Add per core DVFS support for QCom SoC (Bjorn Andersson), convert to yaml binding (Manivannan Sadhasivam) and various other fixes to the QCom drivers (Luca Weiss). - Add OPP table for imx7s SoC (Denys Drozdov) and minor fixes (Stefan Agner). - Fix CPPC driver's freq/performance conversions (Pierre Gondois). - Minor generic cleanups (Yury Norov)." * 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: dt-bindings: cpufreq: cpufreq-qcom-hw: Convert to YAML bindings dt-bindings: dvfs: Use MediaTek CPUFREQ HW as an example cpufreq: blocklist Qualcomm sc8280xp and sa8540p in cpufreq-dt-platdev cpufreq: qcom-hw: Add support for per-core-dcvs cpufreq: CPPC: Fix performance/frequency conversion cpufreq: Add i.MX7S to cpufreq-dt-platdev blocklist ARM: dts: imx7s: Define operating points table for cpufreq cpufreq: qcom-cpufreq-nvmem: fix reading of PVS Valid fuse cpufreq: replace cpumask_weight with cpumask_empty where appropriate commit 7b17d2d7d7bf5add35f1e9067ef9450698eac85e Merge: 4723832fa63f f70f5f1a8fff Author: Paolo Abeni Date: Tue Mar 22 11:09:28 2022 +0100 Merge branch 'selftests-forwarding-locked-bridge-port-fixes' Ido Schimmel says: ==================== selftests: forwarding: Locked bridge port fixes Two fixes for the locked bridge port selftest. ==================== Link: https://lore.kernel.org/r/20220321175102.978020-1-idosch@nvidia.com Signed-off-by: Paolo Abeni commit f70f5f1a8ffff4c943182aa80c600aeec1b9b001 Author: Ido Schimmel Date: Mon Mar 21 19:51:02 2022 +0200 selftests: forwarding: Use same VRF for port and VLAN upper The test creates a separate VRF for the VLAN upper, but does not destroy it during cleanup, resulting in "RTNETLINK answers: File exists" errors. Fix by using the same VRF for the port and its VLAN upper. This is OK since their IP addresses do not overlap. Before: # ./bridge_locked_port.sh TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] # ./bridge_locked_port.sh RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists RTNETLINK answers: File exists TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] After: # ./bridge_locked_port.sh TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] # ./bridge_locked_port.sh TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] Fixes: b2b681a41251 ("selftests: forwarding: tests of locked port feature") Signed-off-by: Ido Schimmel Signed-off-by: Paolo Abeni tools/testing/selftests/net/forwarding/bridge_locked_port.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) commit 917b149ac3d5c8b3a582559b9779ee29d69fad78 Author: Ido Schimmel Date: Mon Mar 21 19:51:01 2022 +0200 selftests: forwarding: Disable learning before link up Disable learning before bringing the bridge port up in order to avoid the FDB being populated and the test failing. Before: # ./bridge_locked_port.sh RTNETLINK answers: File exists TEST: Locked port ipv4 [FAIL] Ping worked after locking port, but before adding FDB entry TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] After: # ./bridge_locked_port.sh TEST: Locked port ipv4 [ OK ] TEST: Locked port ipv6 [ OK ] TEST: Locked port vlan [ OK ] Fixes: b2b681a41251 ("selftests: forwarding: tests of locked port feature") Signed-off-by: Ido Schimmel Signed-off-by: Paolo Abeni tools/testing/selftests/net/forwarding/bridge_locked_port.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 6a7d8cff4a3301087dd139293e9bddcf63827282 Author: Hoang Le Date: Mon Mar 21 11:22:29 2022 +0700 tipc: fix the timer expires after interval 100ms In the timer callback function tipc_sk_timeout(), we're trying to reschedule another timeout to retransmit a setup request if destination link is congested. But we use the incorrect timeout value (msecs_to_jiffies(100)) instead of (jiffies + msecs_to_jiffies(100)), so that the timer expires immediately, it's irrelevant for original description. In this commit we correct the timeout value in sk_reset_timer() Fixes: 6787927475e5 ("tipc: buffer overflow handling in listener socket") Acked-by: Ying Xue Signed-off-by: Hoang Le Link: https://lore.kernel.org/r/20220321042229.314288-1-hoang.h.le@dektech.com.au Signed-off-by: Paolo Abeni net/tipc/socket.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 4723832fa63f30c85cce3739b0497e4e193f684b Author: Bill Wendling Date: Sun Mar 20 19:31:55 2022 -0700 bnx2x: truncate value to original sizing The original behavior was to print out unsigned short or unsigned char values. The change in commit d65aea8e8298 ("bnx2x: use correct format characters") prints out the whole value if not truncated. So truncate the value to an unsigned {short|char} to retain the original behavior. Fixes: d65aea8e8298 ("bnx2x: use correct format characters") Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Bill Wendling Link: https://lore.kernel.org/r/20220321023155.106066-1-morbo@google.com Signed-off-by: Paolo Abeni drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 6b3c74550224c3be24c4cf6ab8c333602b458bff Author: Yang Yingliang Date: Sat Mar 19 11:24:50 2022 +0800 net: wwan: qcom_bam_dmux: fix wrong pointer passed to IS_ERR() It should check dmux->tx after calling dma_request_chan(). Fixes: 21a0ffd9b38c ("net: wwan: Add Qualcomm BAM-DMUX WWAN network driver") Signed-off-by: Yang Yingliang Reviewed-by: Stephan Gerhold Link: https://lore.kernel.org/r/20220319032450.3288224-1-yangyingliang@huawei.com Signed-off-by: Paolo Abeni drivers/net/wwan/qcom_bam_dmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ffea9fb319360b9ead8befac6bb2db2b54fd53e6 Author: Randy Dunlap Date: Wed Mar 16 13:41:46 2022 -0700 sched/headers: ARM needs asm/paravirt_api_clock.h too Add for arch/arm/, mapped to , to simplify #ifdeffery in generic code. Fixes this build error introduced by the scheduler tree: In file included from ../kernel/sched/core.c:81: ../kernel/sched/sched.h:87:11: fatal error: asm/paravirt_api_clock.h: No such file or directory 87 | # include Reviewed-by: Nathan Chancellor Fixes: 4ff8f2ca6ccd ("sched/headers: Reorganize, clean up and optimize kernel/sched/sched.h dependencies") Signed-off-by: Randy Dunlap Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20220316204146.14000-1-rdunlap@infradead.org arch/arm/include/asm/paravirt_api_clock.h | 1 + 1 file changed, 1 insertion(+) commit ab31c7fd2d37bc3580d9d712d5f2dfb69901fca9 Author: Huang, Ying Date: Tue Mar 22 08:39:22 2022 +0100 sched/numa: Fix boot crash on arm64 systems Qian Cai reported a boot crash on arm64 systems, caused by: 0fb3978b0aac ("sched/numa: Fix NUMA topology for systems with CPU-less nodes") The bug is that node_state() must be supplied a valid node_states[] array index, but in task_numa_placement() the max_nid search can fail with NUMA_NO_NODE, which is not a valid index. Fix it by checking that max_nid is a valid index. [ mingo: Added changelog. ] Fixes: 0fb3978b0aac ("sched/numa: Fix NUMA topology for systems with CPU-less nodes") Reported-by: Qian Cai Tested-by: Qian Cai Cc: Peter Zijlstra Cc: Linus Torvalds Signed-off-by: "Huang, Ying" Signed-off-by: Ingo Molnar kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit aa80511a93dbab1fb362ab414acc665a319c6522 Merge: c050f5e91b47 74529db3e01d Author: Jakub Kicinski Date: Mon Mar 21 22:33:04 2022 -0700 Merge branch 'net-mscc-miim-add-integrated-phy-reset-support' Michael Walle says: ==================== net: mscc-miim: add integrated PHY reset support The MDIO driver has support to release the integrated PHYs from reset. This was implemented for the SparX-5 for now. Now add support for the LAN966x, too. ==================== Link: https://lore.kernel.org/r/20220318201324.1647416-1-michael@walle.cc Signed-off-by: Jakub Kicinski commit 74529db3e01d6120f4a6212acac62d29a7faecc2 Author: Michael Walle Date: Fri Mar 18 21:13:24 2022 +0100 net: mdio: mscc-miim: add lan966x internal phy reset support The LAN966x has two internal PHYs which are in reset by default. The driver already supported the internal PHYs of the SparX-5. Now add support for the LAN966x, too. Add a new compatible to distinguish them. The LAN966x has additional control bits in this register, thus convert the regmap_write() to regmap_update_bits() to leave the remaining bits untouched. This doesn't change anything for the SparX-5 SoC, because there, the register consists only of reset bits. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski drivers/net/mdio/mdio-mscc-miim.c | 67 ++++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 18 deletions(-) commit 58ebdba3d851d03b40f181515c761810f3514303 Author: Michael Walle Date: Fri Mar 18 21:13:23 2022 +0100 net: mdio: mscc-miim: replace magic numbers for the bus reset Replace the magic numbers by macros which are already defined. It seems the original commit missed to use them. Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski drivers/net/mdio/mdio-mscc-miim.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit a2e4b5adfdf85d4a94af8a7a9f44e3ee254fd77e Author: Michael Walle Date: Fri Mar 18 21:13:22 2022 +0100 dt-bindings: net: mscc-miim: add lan966x compatible The MDIO controller has support to release the internal PHYs from reset by specifying a second memory resource. This is different between the currently supported SparX-5 and the LAN966x. Add a new compatible to distinguish between these two. Signed-off-by: Michael Walle Acked-by: Horatiu Vultur Signed-off-by: Jakub Kicinski Documentation/devicetree/bindings/net/mscc-miim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8fd36358ce82382519b50b05f437493e1e00c4a9 Author: Vladimir Oltean Date: Fri Mar 18 21:54:43 2022 +0200 net: dsa: fix panic on shutdown if multi-chip tree failed to probe DSA probing is atypical because a tree of devices must probe all at once, so out of N switches which call dsa_tree_setup_routing_table() during probe, for (N - 1) of them, "complete" will return false and they will exit probing early. The Nth switch will set up the whole tree on their behalf. The implication is that for (N - 1) switches, the driver binds to the device successfully, without doing anything. When the driver is bound, the ->shutdown() method may run. But if the Nth switch has failed to initialize the tree, there is nothing to do for the (N - 1) driver instances, since the slave devices have not been created, etc. Moreover, dsa_switch_shutdown() expects that the calling @ds has been in fact initialized, so it jumps at dereferencing the various data structures, which is incorrect. Avoid the ensuing NULL pointer dereferences by simply checking whether the Nth switch has previously set "ds->setup = true" for the switch which is currently shutting down. The entire setup is serialized under dsa2_mutex which we already hold. Fixes: 0650bf52b31f ("net: dsa: be compatible with masters which unregister on shutdown") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220318195443.275026-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski net/dsa/dsa2.c | 5 +++++ 1 file changed, 5 insertions(+) commit 60b44ca6bd7518dd38fa2719bc9240378b6172c3 Author: Aaron Conole Date: Fri Mar 18 08:43:19 2022 -0400 openvswitch: always update flow key after nat During NAT, a tuple collision may occur. When this happens, openvswitch will make a second pass through NAT which will perform additional packet modification. This will update the skb data, but not the flow key that OVS uses. This means that future flow lookups, and packet matches will have incorrect data. This has been supported since 5d50aa83e2c8 ("openvswitch: support asymmetric conntrack"). That commit failed to properly update the sw_flow_key attributes, since it only called the ovs_ct_nat_update_key once, rather than each time ovs_ct_nat_execute was called. As these two operations are linked, the ovs_ct_nat_execute() function should always make sure that the sw_flow_key is updated after a successful call through NAT infrastructure. Fixes: 5d50aa83e2c8 ("openvswitch: support asymmetric conntrack") Cc: Dumitru Ceara Cc: Numan Siddique Signed-off-by: Aaron Conole Acked-by: Eelco Chaudron Link: https://lore.kernel.org/r/20220318124319.3056455-1-aconole@redhat.com Signed-off-by: Jakub Kicinski net/openvswitch/conntrack.c | 118 ++++++++++++++++++++++---------------------- 1 file changed, 59 insertions(+), 59 deletions(-) commit 5d7e282541fc91b831a5c4477c5d72881c623df9 Author: Paulo Alcantara Date: Fri Mar 4 13:22:15 2022 -0300 cifs: do not skip link targets when an I/O fails When I/O fails in one of the currently connected DFS targets, retry it from other targets as specified in MS-DFSC "3.1.5.2 I/O Operation to +Target Fails with an Error Other Than STATUS_PATH_NOT_COVERED." Signed-off-by: Paulo Alcantara (SUSE) Cc: stable@vger.kernel.org Signed-off-by: Steve French fs/cifs/connect.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) commit b47d5a4f6b8d42f8a8fbe891b36215e4fddc53be Merge: c269497d248e 272ceeaea355 Author: Linus Torvalds Date: Mon Mar 21 20:53:11 2022 -0700 Merge tag 'audit-pr-20220321' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit update from Paul Moore: "Just one audit patch queued for v5.18: - Change the AUDIT_TIME_* record generation so that they are generated at syscall exit time and subject to all of the normal syscall exit filtering. This should help reduce noise and ensure those records which are most relevant to the admin's audit configuration are recorded in the audit log" * tag 'audit-pr-20220321' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: log AUDIT_TIME_* records only from rules commit c269497d248e43558aafc6b3f87b49d4dd3c2713 Merge: 7f313ff0acde cdbec3ede0b8 Author: Linus Torvalds Date: Mon Mar 21 20:47:54 2022 -0700 Merge tag 'selinux-pr-20220321' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux updates from Paul Moore: "We've got a number of SELinux patches queued up, the highlights are: - Fixup the security_fs_context_parse_param() LSM hook so it executes all of the LSM hook implementations unless a serious error occurs. We also correct the SELinux hook implementation so that it returns zero on success. - In addition to a few SELinux mount option parsing fixes, we simplified the parsing by moving it earlier in the process. The logic was that it was unlikely an admin/user would use the new mount API and not have the policy loaded before passing the SELinux options. - Properly fixed the LSM/SELinux/SCTP hooks with the addition of the security_sctp_assoc_established() hook. This work was done in conjunction with the netdev folks and should complete the move of the SCTP labeling from the endpoints to the associations. - Fixed a variety of sparse warnings caused by changes in the "__rcu" markings of some core kernel structures. - Ensure we access the superblock's LSM security blob using the stacking-safe accessors. - Added the ability for the kernel to always allow FIOCLEX and FIONCLEX if the "ioctl_skip_cloexec" policy capability is specified. - Various constifications improvements, type casting improvements, additional return value checks, and dead code/parameter removal. - Documentation fixes" * tag 'selinux-pr-20220321' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: (23 commits) selinux: shorten the policy capability enum names docs: fix 'make htmldocs' warning in SCTP.rst selinux: allow FIOCLEX and FIONCLEX with policy capability selinux: use correct type for context length selinux: drop return statement at end of void functions security: implement sctp_assoc_established hook in selinux security: add sctp_assoc_established hook selinux: parse contexts for mount options early selinux: various sparse fixes selinux: try to use preparsed sid before calling parse_sid() selinux: Fix selinux_sb_mnt_opts_compat() LSM: general protection fault in legacy_parse_param selinux: fix a type cast problem in cred_init_security() selinux: drop unused macro selinux: simplify cred_init_security selinux: do not discard const qualifier in cast selinux: drop unused parameter of avtab_insert_node selinux: drop cast to same type selinux: enclose macro arguments in parenthesis selinux: declare name parameter of hash_eval const ... commit 7f313ff0acdecf0926ab127533a2a93948a2f547 Merge: 2c5a5358feff 4a48b4c428dc Author: Linus Torvalds Date: Mon Mar 21 20:44:37 2022 -0700 Merge tag 'integrity-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity subsystem updates from Mimi Zohar: "Except for extending the 'encrypted' key type to support user provided data, the rest is code cleanup, __setup() usage bug fix, and a trivial change" * tag 'integrity-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: MAINTAINERS: add missing security/integrity/platform_certs EVM: fix the evm= __setup handler return value KEYS: encrypted: Instantiate key with user-provided decrypted data ima: define ima_max_digest_data struct without a flexible array variable ima: rename IMA_ACTION_FLAGS to IMA_NONACTION_FLAGS ima: Return error code obtained from securityfs functions MAINTAINERS: add missing "security/integrity" directory ima: Fix trivial typos in the comments commit 2c5a5358feff2c1e035a67a9b352c4358e669e5b Merge: 6ca014cd2ddb a5cd1ab7ab67 Author: Linus Torvalds Date: Mon Mar 21 20:42:32 2022 -0700 Merge tag 'Smack-for-5.18' of https://github.com/cschaufler/smack-next Pull smack update from Casey Schaufler: "A single fix to repair an incorrect use of ntohs() in IPv6 audit code. It's very minor and went unnoticed until lkp found it. It's been in next and passes all tests" * tag 'Smack-for-5.18' of https://github.com/cschaufler/smack-next: Fix incorrect type in assignment of ipv6 port for audit commit 6ca014cd2ddb5c56f962ec68f220be049fdcd7a3 Merge: 8565d64430f8 3d8dcf278b1e Author: Linus Torvalds Date: Mon Mar 21 20:38:53 2022 -0700 Merge branch 'keys-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull watch_queue fixes from David Howells: "Here are fixes for a couple more watch_queue bugs, both found by syzbot: - Fix error cleanup in watch_queue_set_size() where it tries to clean up all the pointers in the page list, even if they've not been allocated yet[1]. Unfortunately, __free_page() doesn't treat a NULL pointer as being "do nothing". A second report[2] looks like it's probably the same bug, but on arm64 rather than x86_64, but there's no reproducer. - Fix a missing kfree in free_watch() to actually free the watch[3]" Link: https://lore.kernel.org/r/000000000000b1807c05daad8f98@google.com/ [1] Link: https://lore.kernel.org/r/000000000000035b9c05daae8a5e@google.com/ [2] Link: https://lore.kernel.org/r/000000000000bc8eaf05dab91c63@google.com/ [3] * 'keys-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: watch_queue: Actually free the watch watch_queue: Fix NULL dereference in error cleanup commit 8565d64430f8278bea38dab0a3ab60b4e11c71e4 Merge: d0858cbdef50 fad278388e01 Author: Linus Torvalds Date: Mon Mar 21 19:58:27 2022 -0700 Merge tag 'bounds-fixes-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull bounds fixes from Kees Cook: "These are a handful of buffer and array bounds fixes that I've been carrying in preparation for the coming memcpy improvements and the enabling of '-Warray-bounds' globally. There are additional similar fixes in other maintainer's trees, but these ended up getting carried by me. :)" * tag 'bounds-fixes-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: media: omap3isp: Use struct_group() for memcpy() region tpm: vtpm_proxy: Check length to avoid compiler warning alpha: Silence -Warray-bounds warnings m68k: cmpxchg: Dereference matching size intel_th: msu: Use memset_startat() for clearing hw header KVM: x86: Replace memset() "optimization" with normal per-field writes commit d0858cbdef50d973ca6b38c0ed0cce54cb2b6182 Merge: 2142b7f0c6bb 02788ebcf521 Author: Linus Torvalds Date: Mon Mar 21 19:46:41 2022 -0700 Merge tag 'overflow-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull overflow updates from Kees Cook: "These changes come in roughly two halves: support of Gustavo A. R. Silva's struct_size() work via additional helpers for catching overflow allocation size calculations, and conversions of selftests to KUnit (which includes some tweaks for UML + Clang): - Convert overflow selftest to KUnit - Convert stackinit selftest to KUnit - Implement size_t saturating arithmetic helpers - Allow struct_size() to be used in initializers" * tag 'overflow-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: lib: stackinit: Convert to KUnit um: Allow builds with Clang lib: overflow: Convert to Kunit overflow: Provide constant expression struct_size overflow: Implement size_t saturating arithmetic helpers test_overflow: Regularize test reporting output commit 2142b7f0c6bbe1f9515ce3383de9f7a32a5a025b Merge: fd2d7a4a3545 afcf5441b9ff Author: Linus Torvalds Date: Mon Mar 21 19:32:04 2022 -0700 Merge tag 'hardening-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull kernel hardening updates from Kees Cook: - Add arm64 Shadow Call Stack support for GCC 12 (Dan Li) - Avoid memset with stack offset randomization under Clang (Marco Elver) - Clean up stackleak plugin to play nice with .noinstr (Kees Cook) - Check stack depth for greater usercopy hardening coverage (Kees Cook) * tag 'hardening-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: arm64: Add gcc Shadow Call Stack support m68k: Implement "current_stack_pointer" xtensa: Implement "current_stack_pointer" usercopy: Check valid lifetime via stack depth stack: Constrain and fix stack offset randomization with Clang builds stack: Introduce CONFIG_RANDOMIZE_KSTACK_OFFSET gcc-plugins/stackleak: Ignore .noinstr.text and .entry.text gcc-plugins/stackleak: Exactly match strings instead of prefixes gcc-plugins/stackleak: Provide verbose mode commit fd2d7a4a354539dc141f702c6c277bf3380e8778 Merge: b7a801f3956f 8126b1c73108 Author: Linus Torvalds Date: Mon Mar 21 19:24:47 2022 -0700 Merge tag 'pstore-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull pstore updates from Kees Cook: - Don't use semaphores in always-atomic-context code (Jann Horn) - Add "ECC:" prefix to ECC messages (Vincent Whitchurch) * tag 'pstore-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore: Don't use semaphores in always-atomic-context code pstore: Add prefix to ECC messages commit b7a801f3956f0c1409d0ece07feb9a2ff78cd15b Merge: ad9c6ee642a6 dd664099002d Author: Linus Torvalds Date: Mon Mar 21 19:16:02 2022 -0700 Merge tag 'execve-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull execve updates from Kees Cook: "Execve and binfmt updates. Eric and I have stepped up to be the active maintainers of this area, so here's our first collection. The bulk of the work was in coredump handling fixes; additional details are noted below: - Handle unusual AT_PHDR offsets (Akira Kawata) - Fix initial mapping size when PT_LOADs are not ordered (Alexey Dobriyan) - Move more code under CONFIG_COREDUMP (Alexey Dobriyan) - Fix missing mmap_lock in file_files_note (Eric W. Biederman) - Remove a.out support for alpha and m68k (Eric W. Biederman) - Include first pages of non-exec ELF libraries in coredump (Jann Horn) - Don't write past end of notes for regset gap in coredump (Rick Edgecombe) - Comment clean-ups (Tom Rix) - Force single empty string when argv is empty (Kees Cook) - Add NULL argv selftest (Kees Cook) - Properly redefine PT_GNU_* in terms of PT_LOOS (Kees Cook) - MAINTAINERS: Update execve entry with tree (Kees Cook) - Introduce initial KUnit testing for binfmt_elf (Kees Cook)" * tag 'execve-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: binfmt_elf: Don't write past end of notes for regset gap a.out: Stop building a.out/osf1 support on alpha and m68k coredump: Don't compile flat_core_dump when coredumps are disabled coredump: Use the vma snapshot in fill_files_note coredump/elf: Pass coredump_params into fill_note_info coredump: Remove the WARN_ON in dump_vma_snapshot coredump: Snapshot the vmas in do_coredump coredump: Move definition of struct coredump_params into coredump.h binfmt_elf: Introduce KUnit test ELF: Properly redefine PT_GNU_* in terms of PT_LOOS MAINTAINERS: Update execve entry with more details exec: cleanup comments fs/binfmt_elf: Refactor load_elf_binary function fs/binfmt_elf: Fix AT_PHDR for unusual ELF files binfmt: move more stuff undef CONFIG_COREDUMP selftests/exec: Test for empty string on NULL argv exec: Force single empty string when argv is empty coredump: Also dump first pages of non-executable ELF libraries ELF: fix overflow in total mapping size calculation commit 863a66cdb4df25fd146d9851c3289072298566d5 Author: Ming Lei Date: Wed Mar 16 09:27:08 2022 +0800 lib/sbitmap: allocate sb->map via kvzalloc_node sbitmap has been used in scsi for replacing atomic operations on sdev->device_busy, so IOPS on some fast scsi storage can be improved. However, sdev->device_busy can be changed in fast path, so we have to allocate the sb->map statically. sdev->device_busy has been capped to 1024, but some drivers may configure the default depth as < 8, then cause each sbitmap word to hold only one bit. Finally 1024 * 128( sizeof(sbitmap_word)) bytes is needed for sb->map, given it is order 5 allocation, sometimes it may fail. Avoid the issue by using kvzalloc_node() for allocating sb->map. Cc: Ewan D. Milne Signed-off-by: Ming Lei Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220316012708.354668-1-ming.lei@redhat.com Signed-off-by: Jens Axboe include/linux/sbitmap.h | 2 +- lib/sbitmap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit ad9c6ee642a61adae93dfa35582b5af16dc5173a Merge: d6ccf45113fb 89b35e3f2851 Author: Linus Torvalds Date: Mon Mar 21 18:33:57 2022 -0700 Merge tag 'spi-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "The overwhelming bulk of this pull request is a change from Uwe Kleine-König which changes the return type of the remove() function to void as part of some wider work he's doing to do this for all bus types, causing updates to most SPI device drivers. The branch with that on has been cross merged with a couple of other trees which added new SPI drivers this cycle, I'm not expecting any build issues resulting from the change. Otherwise it's been a relatively quiet release with some new device support, a few minor features and the welcome completion of the conversion of the subsystem to use GPIO descriptors rather than numbers: - Change return type of remove() to void. - Completion of the conversion of SPI controller drivers to use GPIO descriptors rather than numbers. - Quite a few DT schema conversions. - Support for multiple SPI devices on a bus in ACPI systems. - Big overhaul of the PXA2xx SPI driver. - Support for AMD AMDI0062, Intel Raptor Lake, Mediatek MT7986 and MT8186, nVidia Tegra210 and Tegra234, Renesas RZ/V2L, Tesla FSD and Sunplus SP7021" [ And this is obviously where that spi change that snuck into the regulator tree _should_ have been :^] * tag 'spi-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (124 commits) spi: fsi: Implement a timeout for polling status spi: Fix erroneous sgs value with min_t() spi: tegra20: Use of_device_get_match_data() spi: mediatek: add ipm design support for MT7986 spi: Add compatible for MT7986 spi: sun4i: fix typos in comments spi: mediatek: support tick_delay without enhance_timing spi: Update clock-names property for arm pl022 spi: rockchip-sfc: fix platform_get_irq.cocci warning spi: s3c64xx: Add spi port configuration for Tesla FSD SoC spi: dt-bindings: samsung: Add fsd spi compatible spi: topcliff-pch: Prevent usage of potentially stale DMA device spi: tegra210-quad: combined sequence mode spi: tegra210-quad: add acpi support spi: npcm-fiu: Fix typo ("npxm") spi: Fix Tegra QSPI example spi: qup: replace spin_lock_irqsave by spin_lock in hard IRQ spi: cadence: fix platform_get_irq.cocci warning spi: Update NXP Flexspi maintainer details dt-bindings: mfd: maxim,max77802: Convert to dtschema ... commit 09f724e196e5b84b578d558d755638dd802800d8 Author: Krzysztof Kozlowski Date: Fri Mar 18 17:20:43 2022 +0100 dt-bindings: dmaengine: sifive,fu540-c000: include generic schema Include generic dma-controller.yaml schema, which enforces node naming and other generic properties. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220318162044.169350-1-krzysztof.kozlowski@canonical.com Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit d6ccf45113fb6799885950293401e4b104c9b276 Merge: a50a8c383386 5999f85ddeb4 Author: Linus Torvalds Date: Mon Mar 21 18:27:05 2022 -0700 Merge tag 'regulator-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "Quite a quiet release for the regulator API, mainly a few new drivers plus a lot of fixes for the Raspberry Pi panel driver. There's also a SPI commit in here which I managed to apply to the wrong tree and then didn't notice until there were too many commits on top of it, sorry about that. - Make it easier to use the virtual consumer test driver with DT systems. - Substantial overhaul providing various fixes and robustness improvements for the Raspberry Pi panel driver. - Support for Qualcomm PMX65 and SDX65, Richtek RT5190A, and Texas Instruments TPS62864x" * tag 'regulator-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (26 commits) regulator: qcom-rpmh: Add support for SDX65 regulator: dt-bindings: Add PMX65 compatibles regulator: vctrl: Use min() instead of doing it manually regulator: rt5190a: Add support for Richtek RT5190A PMIC regulator: Add bindings for Richtek RT5190A PMIC regulator: Convert TPS62360 binding to json-schema regulator: cleanup comments regulator: virtual: add devicetree support regulator: virtual: warn against production use regulator: virtual: use dev_err_probe() regulator: tps62864: Fix bindings for SW property regulator: Add support for TPS6286x regulator: Add bindings for TPS62864x regulator/rpi-panel-attiny: Use two transactions for I2C read regulator/rpi-panel-attiny: Use the regmap cache regulator: rpi-panel: Remove get_brightness hook regulator: rpi-panel: Add GPIO control for panel and touch resets regulator: rpi-panel: Convert to drive lines directly regulator: rpi-panel: Ensure the backlight is off during probe. regulator: rpi-panel: Serialise operations. ... commit a50a8c3833864d959c18f742bf6aa1d38fbe28c9 Merge: fd276877917a 0074f3f2b1e4 Author: Linus Torvalds Date: Mon Mar 21 18:22:42 2022 -0700 Merge tag 'regmap-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "A couple of small fixes, plus some new features that enable us to handle devices that reformat register addresses depending on the bus used to handle the control interface more gracefully" * tag 'regmap-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: allow a defined reg_base to be added to every address regmap: add configurable downshift for addresses regmap: irq: cleanup comments regmap-irq: Fix typo in comment commit fd276877917ac6ea86c2541757d846bbd0cdc5bd Merge: d347ee54a70e 6ba463edccb9 Author: Linus Torvalds Date: Mon Mar 21 18:08:52 2022 -0700 Merge tag 'hwmon-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - Texas Instruments TMP464 and TMP468 driver - Vicor PLI1209BC Digital Supervisor driver - ASUS EC driver Improvements to existing drivers: - adt7x10: - Convert to use regmap - convert to use with_info API - use hwmon_notify_event - other cleanup - aquacomputer_d5next: - Add support for Aquacomputer Farbwerk 360 - asus_wmi_sensors: - Add ASUS ROG STRIX B450-F GAMING II - asus_wmi_ec_sensors: - Support T_Sensor on Prime X570-Pro - Deprecate driver (replaced by new driver) - axi-fan-control: - Use hwmon_notify_event - dell-smm: - Clean up CONFIG_I8K - disable fan type support for Inspiron 3505 - various other cleanup - hwmon core: - Report attribute name with udev events - Add "label" attribute to ABI, - Add support for pwm auto channels attribute - max6639: - Add regulator support - lm70: - Add support for TI TMP125 - lm83: - Cleanup, convert to use with_info API - mlxreg-fan: - Use pwm attribute for setting fan speed low limit - nct6775: - Add board ID's for ASUS ROG STRIX Z390/Z490/X570-* / PRIME X570-P, PRIME B550-PLUS, ASUS Pro B550M-C/PRIME B550M-A - Add support for TSI temperature registers - occ: - Add various new sysfs attributes - pmbus core: - Handle VIN unit off status - Add regulator supply into macro - Add get_error_flags support to regulator ops - pmbus/adm1275: - Allow setting sample averaging - pmbus/lm25066: - Add regulator support - pmbus/xdpe12284: - Add support for xdpe11280 - register as regulator - powr1220: - Convert to with_info API - Add support for Lattice's POWR1014 power manager IC - sch56xx: - Cleanup and minor improvements - sch5627: - Add pwmX_auto_channels_temp support - tc654: - Add thermal_cooling device support" * tag 'hwmon-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (86 commits) hwmon: (dell-smm) Add Inspiron 3505 to fan type blacklist hwmon: (pmbus) Add Vin unit off handling hwmon: (scpi-hwmon): Use of_device_get_match_data() hwmon: (axi-fan-control) Use hwmon_notify_event hwmon: (vexpress-hwmon) Use of_device_get_match_data() hwmon: Add driver for Texas Instruments TMP464 and TMP468 dt-bindings: hwmon: add tmp464.yaml dt-bindings: hwmon: Add sample averaging properties for ADM1275 hwmon: (adm1275) Allow setting sample averaging hwmon: (xdpe12284) Add regulator support hwmon: (xdpe12284) Add support for xdpe11280 dt-bindings: trivial-devices: Add xdpe11280 hwmon: (aquacomputer_d5next) Add support for Aquacomputer Farbwerk 360 hwmon: (sch5627) Add pwmX_auto_channels_temp support hwmon: (core) Add support for pwm auto channels attribute hwmon: (lm70) Add ti,tmp125 support dt-bindings: Add ti,tmp125 temperature sensor binding hwmon: (pmbus/pli1209bc) Add regulator support hwmon: (pmbus) Add support for pli1209bc dt-bindings:trivial-devices: Add pli1209bc ... commit 61bc84c4008812d784c398cfb54118c1ba396dfc Author: Jens Axboe Date: Mon Mar 21 19:03:24 2022 -0600 io_uring: remove poll entry from list when canceling all When the ring is exiting, as part of the shutdown, poll requests are removed. But io_poll_remove_all() does not remove entries when finding them, and since completions are done out-of-band, we can find and remove the same entry multiple times. We do guard the poll execution by poll ownership, but that does not exclude us from reissuing a new one once the previous removal ownership goes away. This can race with poll execution as well, where we then end up seeing req->apoll be NULL because a previous task_work requeue finished the request. Remove the poll entry when we find it and get ownership of it. This prevents multiple invocations from finding it. Fixes: aa43477b0402 ("io_uring: poll rework") Reported-by: Dylan Yudaken Signed-off-by: Jens Axboe fs/io_uring.c | 1 + 1 file changed, 1 insertion(+) commit d347ee54a70e45c082ca7a373fbdf0c34109d575 Merge: 69d1dea852b5 64bf0eef0171 Author: Linus Torvalds Date: Mon Mar 21 17:21:05 2022 -0700 Merge tag 'for-5.18/alloc-cleanups-2022-03-18' of git://git.kernel.dk/linux-block Pull bio_alloc() cleanups from Jens Axboe: "Filesystem cleanups to pass the bio op to bio_alloc() instead of setting it just before bio submission". * tag 'for-5.18/alloc-cleanups-2022-03-18' of git://git.kernel.dk/linux-block: f2fs: pass the bio operation to bio_alloc_bioset f2fs: don't pass a bio to f2fs_target_device nilfs2: pass the operation to bio_alloc ext4: pass the operation to bio_alloc mpage: pass the operation to bio_alloc commit 69d1dea852b54eecd8ad2ec92a7fd371e9aec4bd Merge: 616355cc818c ae53aea611b7 Author: Linus Torvalds Date: Mon Mar 21 17:16:01 2022 -0700 Merge tag 'for-5.18/drivers-2022-03-18' of git://git.kernel.dk/linux-block Pull block driver updates from Jens Axboe: - NVMe updates via Christoph: - add vectored-io support for user-passthrough (Kanchan Joshi) - add verbose error logging (Alan Adamson) - support buffered I/O on block devices in nvmet (Chaitanya Kulkarni) - central discovery controller support (Martin Belanger) - fix and extended the globally unique idenfier validation (Christoph) - move away from the deprecated IDA APIs (Sagi Grimberg) - misc code cleanup (Keith Busch, Max Gurtovoy, Qinghua Jin, Chaitanya Kulkarni) - add lockdep annotations for in-kernel sockets (Chris Leech) - use vmalloc for ANA log buffer (Hannes Reinecke) - kerneldoc fixes (Chaitanya Kulkarni) - cleanups (Guoqing Jiang, Chaitanya Kulkarni, Christoph) - warn about shared namespaces without multipathing (Christoph) - MD updates via Song with a set of cleanups (Christoph, Mariusz, Paul, Erik, Dirk) - loop cleanups and queue depth configuration (Chaitanya) - null_blk cleanups and fixes (Chaitanya) - Use descriptive init/exit names in virtio_blk (Randy) - Use bvec_kmap_local() in drivers (Christoph) - bcache fixes (Mingzhe) - xen blk-front persistent grant speedups (Juergen) - rnbd fix and cleanup (Gioh) - Misc fixes (Christophe, Colin) * tag 'for-5.18/drivers-2022-03-18' of git://git.kernel.dk/linux-block: (76 commits) virtio_blk: eliminate anonymous module_init & module_exit nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH nvme: remove nvme_alloc_request and nvme_alloc_request_qid nvme: cleanup how disk->disk_name is assigned nvmet: move the call to nvmet_ns_changed out of nvmet_ns_revalidate nvmet: use snprintf() with PAGE_SIZE in configfs nvmet: don't fold lines nvmet-rdma: fix kernel-doc warning for nvmet_rdma_device_removal nvmet-fc: fix kernel-doc warning for nvmet_fc_unregister_targetport nvmet-fc: fix kernel-doc warning for nvmet_fc_register_targetport nvme-tcp: lockdep: annotate in-kernel sockets nvme-tcp: don't fold the line nvme-tcp: don't initialize ret variable nvme-multipath: call bio_io_error in nvme_ns_head_submit_bio nvme-multipath: use vmalloc for ANA log buffer xen/blkfront: speed up purge_persistent_grants() raid5: initialize the stripe_head embeeded bios as needed raid5-cache: statically allocate the recovery ra bio raid5-cache: fully initialize flush_bio when needed raid5-ppl: fully initialize the bio in ppl_new_iounit ... commit 616355cc818c6ddadc393fdfd4491f94458cb715 Merge: b080cee72ef3 8f9e7b65f833 Author: Linus Torvalds Date: Mon Mar 21 16:48:55 2022 -0700 Merge tag 'for-5.18/block-2022-03-18' of git://git.kernel.dk/linux-block Pull block updates from Jens Axboe: - BFQ cleanups and fixes (Yu, Zhang, Yahu, Paolo) - blk-rq-qos completion fix (Tejun) - blk-cgroup merge fix (Tejun) - Add offline error return value to distinguish it from an IO error on the device (Song) - IO stats fixes (Zhang, Christoph) - blkcg refcount fixes (Ming, Yu) - Fix for indefinite dispatch loop softlockup (Shin'ichiro) - blk-mq hardware queue management improvements (Ming) - sbitmap dead code removal (Ming, John) - Plugging merge improvements (me) - Show blk-crypto capabilities in sysfs (Eric) - Multiple delayed queue run improvement (David) - Block throttling fixes (Ming) - Start deprecating auto module loading based on dev_t (Christoph) - bio allocation improvements (Christoph, Chaitanya) - Get rid of bio_devname (Christoph) - bio clone improvements (Christoph) - Block plugging improvements (Christoph) - Get rid of genhd.h header (Christoph) - Ensure drivers use appropriate flush helpers (Christoph) - Refcounting improvements (Christoph) - Queue initialization and teardown improvements (Ming, Christoph) - Misc fixes/improvements (Barry, Chaitanya, Colin, Dan, Jiapeng, Lukas, Nian, Yang, Eric, Chengming) * tag 'for-5.18/block-2022-03-18' of git://git.kernel.dk/linux-block: (127 commits) block: cancel all throttled bios in del_gendisk() block: let blkcg_gq grab request queue's refcnt block: avoid use-after-free on throttle data block: limit request dispatch loop duration block/bfq-iosched: Fix spelling mistake "tenative" -> "tentative" sr: simplify the local variable initialization in sr_block_open() block: don't merge across cgroup boundaries if blkcg is enabled block: fix rq-qos breakage from skipping rq_qos_done_bio() block: flush plug based on hardware and software queue order block: ensure plug merging checks the correct queue at least once block: move rq_qos_exit() into disk_release() block: do more work in elevator_exit block: move blk_exit_queue into disk_release block: move q_usage_counter release into blk_queue_release block: don't remove hctx debugfs dir from blk_mq_exit_queue block: move blkcg initialization/destroy into disk allocation/release handler sr: implement ->free_disk to simplify refcounting sd: implement ->free_disk to simplify refcounting sd: delay calling free_opal_dev sd: call sd_zbc_release_disk before releasing the scsi_device reference ... commit c050f5e91b47f8f5ae67b9158afd66f8be48f3dc Author: Tobias Waldekranz Date: Sat Mar 19 12:03:45 2022 +0100 net: dsa: mv88e6xxx: Fill in STU support for all supported chips Some chips using the split VTU/STU design will not accept VTU entries who's SID points to an invalid STU entry. Therefore, mark all those chips with either the mv88e6352_g1_stu_* or mv88e6390_g1_stu_* ops as appropriate. Notably, chips for the Opal Plus (6085/6097) era seem to use a different implementation than those from Agate (6352) and onwards, even though their external interface is the same. The former happily accepts VTU entries referencing invalid STU entries, while the latter does not. This fixes an issue where the driver would fail to probe switch trees that contained chips of the Agate/Topaz generation which did not declare STU support, as loaded VTU entries would be read back as invalid. Fixes: 49c98c1dc7d9 ("net: dsa: mv88e6xxx: Disentangle STU from VTU") Reported-by: Marek Behún Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Tested-by: Marek Behún Link: https://lore.kernel.org/r/20220319110345.555270-1-tobias@waldekranz.com Signed-off-by: Jakub Kicinski drivers/net/dsa/mv88e6xxx/chip.c | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) commit 94f19e1ec38ff67311b176f16f87685a8e110161 Author: Guo Zhengkui Date: Sat Mar 19 15:37:30 2022 +0800 selftests: net: change fprintf format specifiers `cur64`, `start64` and `ts_delta` are int64_t. Change format specifiers in fprintf from `"%lu"` to `"%" PRId64` to adapt to 32-bit and 64-bit systems. Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20220319073730.5235-1-guozhengkui@vivo.com Signed-off-by: Jakub Kicinski tools/testing/selftests/net/txtimestamp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit b080cee72ef355669cbc52ff55dc513d37433600 Merge: af472a9efdf6 1b6fe6e0dfec Author: Linus Torvalds Date: Mon Mar 21 16:29:24 2022 -0700 Merge tag 'for-5.18/io_uring-statx-2022-03-18' of git://git.kernel.dk/linux-block Pull io_uring statx fixes from Jens Axboe: "On top of the main io_uring branch, this is to ensure that the filename component of statx is stable after submit. That requires a few VFS related changes" * tag 'for-5.18/io_uring-statx-2022-03-18' of git://git.kernel.dk/linux-block: io-uring: Make statx API stable commit af472a9efdf65cbb3398cb6478ec0e89fbc84109 Merge: 93e220a62da3 5e929367468c Author: Linus Torvalds Date: Mon Mar 21 16:24:45 2022 -0700 Merge tag 'for-5.18/io_uring-2022-03-18' of git://git.kernel.dk/linux-block Pull io_uring updates from Jens Axboe: - Fixes for current file position. Still doesn't have the f_pos_lock sorted, but it's a step in the right direction (Dylan) - Tracing updates (Dylan, Stefan) - Improvements to io-wq locking (Hao) - Improvements for provided buffers (me, Pavel) - Support for registered file descriptors (me, Xiaoguang) - Support for ring messages (me) - Poll improvements (me) - Fix for fixed buffers and non-iterator reads/writes (me) - Support for NAPI on sockets (Olivier) - Ring quiesce improvements (Usama) - Misc fixes (Olivier, Pavel) * tag 'for-5.18/io_uring-2022-03-18' of git://git.kernel.dk/linux-block: (42 commits) io_uring: terminate manual loop iterator loop correctly for non-vecs io_uring: don't check unrelated req->open.how in accept request io_uring: manage provided buffers strictly ordered io_uring: fold evfd signalling under a slower path io_uring: thin down io_commit_cqring() io_uring: shuffle io_eventfd_signal() bits around io_uring: remove extra barrier for non-sqpoll iopoll io_uring: fix provided buffer return on failure for kiocb_done() io_uring: extend provided buf return to fails io_uring: refactor timeout cancellation cqe posting io_uring: normilise naming for fill_cqe* io_uring: cache poll/double-poll state with a request flag io_uring: cache req->apoll->events in req->cflags io_uring: move req->poll_refs into previous struct hole io_uring: make tracing format consistent io_uring: recycle apoll_poll entries io_uring: remove duplicated member check for io_msg_ring_prep() io_uring: allow submissions to continue on error io_uring: recycle provided buffers if request goes async io_uring: ensure reads re-import for selected buffers ... commit 6ae1af9ca0e81f7123d36eae9bf25de63722fbf6 Merge: 6b57ac02b45f 33363c336516 Author: Palmer Dabbelt Date: Mon Mar 21 16:07:12 2022 -0700 perf: RISC-V: Add support for SBI PMU and Sscofpmf This series improves perf support for RISC-V based system using SBI PMU and Sscofpmf extensions, by adding a new generic RISC-V perf framework along with a pair of drivers: one that usese the new performance-monitoring extensions and one that keeps support for the existing systems that only have the legacy counters. Tested-by: Nikita Shubin * palmer/riscv-pmu: MAINTAINERS: Add entry for RISC-V PMU drivers Documentation: riscv: Remove the old documentation RISC-V: Add sscofpmf extension support RISC-V: Add perf platform driver based on SBI PMU extension RISC-V: Add RISC-V SBI PMU extension definitions RISC-V: Add a simple platform driver for RISC-V legacy perf RISC-V: Add a perf core library for pmu drivers RISC-V: Add CSR encodings for all HPMCOUNTERS RISC-V: Remove the current perf implementation commit 93e220a62da36f766b3188e76e234607e41488f9 Merge: 5628b8de1228 0e03b8fd2936 Author: Linus Torvalds Date: Mon Mar 21 16:02:36 2022 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "API: - hwrng core now credits for low-quality RNG devices. Algorithms: - Optimisations for neon aes on arm/arm64. - Add accelerated crc32_be on arm64. - Add ffdheXYZ(dh) templates. - Disallow hmac keys < 112 bits in FIPS mode. - Add AVX assembly implementation for sm3 on x86. Drivers: - Add missing local_bh_disable calls for crypto_engine callback. - Ensure BH is disabled in crypto_engine callback path. - Fix zero length DMA mappings in ccree. - Add synchronization between mailbox accesses in octeontx2. - Add Xilinx SHA3 driver. - Add support for the TDES IP available on sama7g5 SoC in atmel" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (137 commits) crypto: xilinx - Turn SHA into a tristate and allow COMPILE_TEST MAINTAINERS: update HPRE/SEC2/TRNG driver maintainers list crypto: dh - Remove the unused function dh_safe_prime_dh_alg() hwrng: nomadik - Change clk_disable to clk_disable_unprepare crypto: arm64 - cleanup comments crypto: qat - fix initialization of pfvf rts_map_msg structures crypto: qat - fix initialization of pfvf cap_msg structures crypto: qat - remove unneeded assignment crypto: qat - disable registration of algorithms crypto: hisilicon/qm - fix memset during queues clearing crypto: xilinx: prevent probing on non-xilinx hardware crypto: marvell/octeontx - Use swap() instead of open coding it crypto: ccree - Fix use after free in cc_cipher_exit() crypto: ccp - ccp_dmaengine_unregister release dma channels crypto: octeontx2 - fix missing unlock hwrng: cavium - fix NULL but dereferenced coccicheck error crypto: cavium/nitrox - don't cast parameter in bit operations crypto: vmx - add missing dependencies MAINTAINERS: Add maintainer for Xilinx ZynqMP SHA3 driver crypto: xilinx - Add Xilinx SHA3 driver ... commit a53cbe5d628c0cbaa76b23a292c6b32e6c2ddcfe Author: Vladimir Oltean Date: Fri Mar 18 21:58:12 2022 +0200 net: dsa: felix: allow PHY_INTERFACE_MODE_INTERNAL on port 5 The Felix switch has 6 ports, 2 of which are internal. Due to some misunderstanding, my initial suggestion for vsc9959_port_modes[]: https://patchwork.kernel.org/project/netdevbpf/patch/20220129220221.2823127-10-colin.foster@in-advantage.com/#24718277 got translated by Colin into a 5-port array, leading to an all-zero port mode mask for port 5. Fixes: acf242fc739e ("net: dsa: felix: remove prevalidate_phy_mode interface") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220318195812.276276-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski drivers/net/dsa/ocelot/felix_vsc9959.c | 1 + 1 file changed, 1 insertion(+) commit 7ee776cdc7a0b87b766f4cace50c36fe405922cf Merge: e0c0ca3546ad bd48b911c88f Author: Jakub Kicinski Date: Mon Mar 21 15:51:53 2022 -0700 Merge branch 'net-dsa-mv88e6xxx-mst-fixes' Tobias Waldekranz says: ==================== net: dsa: mv88e6xxx: MST Fixes 1/2 fixes the issue reported by Marek here: https://lore.kernel.org/netdev/20220318182817.5ade8ecd@dellmb/ 2/2 adds a missing capability check to the new .vlan_msti_set callback. ==================== Link: https://lore.kernel.org/r/20220318201321.4010543-1-tobias@waldekranz.com Signed-off-by: Jakub Kicinski commit bd48b911c88f017a97b1943201d23d6962968d1a Author: Tobias Waldekranz Date: Fri Mar 18 21:13:21 2022 +0100 net: dsa: mv88e6xxx: Ensure STU support in VLAN MSTI callback In the same way that we check for STU support in the MST state callback, we should also verify it before trying to change a VLANs MSTI membership. Fixes: acaf4d2e36b3 ("net: dsa: mv88e6xxx: MST Offloading") Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Tested-by: Marek Behún Signed-off-by: Jakub Kicinski drivers/net/dsa/mv88e6xxx/chip.c | 3 +++ 1 file changed, 3 insertions(+) commit afaed2b142a1ab896764b03d8d26dc8778ea887c Author: Tobias Waldekranz Date: Fri Mar 18 21:13:20 2022 +0100 net: dsa: mv88e6xxx: Require ops be implemented to claim STU support Simply having a physical STU table in the device doesn't do us any good if there's no implementation of the relevant ops to access that table. So ensure that chips that claim STU support can also talk to the hardware. This fixes an issue where chips that had a their ->info->max_sid set (due to their family membership), but no implementation (due to their chip-specific ops struct) would fail to probe. Fixes: 49c98c1dc7d9 ("net: dsa: mv88e6xxx: Disentangle STU from VTU") Reported-by: Marek Behún Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Tested-by: Marek Behún Signed-off-by: Jakub Kicinski drivers/net/dsa/mv88e6xxx/chip.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 33363c336516e4beb9dd7e8265b369ff96d07dcb Author: Atish Patra Date: Fri Feb 18 16:47:00 2022 -0800 MAINTAINERS: Add entry for RISC-V PMU drivers Add myself and Anup as maintainer for RISC-V PMU drivers. Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) commit 23b1f18326ec3f6966ac8851b20b6d3d22380520 Author: Atish Patra Date: Fri Feb 18 16:46:59 2022 -0800 Documentation: riscv: Remove the old documentation The existing pmu documentation describes the limitation of perf infrastructure in RISC-V ISA and limited feature set of perf in RISC-V. However, SBI PMU extension and sscofpmf extension(ISA extension) allows to implement most of the required features of perf. Remove the old documentation which is not accurate anymore. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt Documentation/riscv/pmu.rst | 255 -------------------------------------------- 1 file changed, 255 deletions(-) commit 4905ec2fb7e6421c14c9fb7276f5aa92f60f2b98 Author: Atish Patra Date: Fri Feb 18 16:46:58 2022 -0800 RISC-V: Add sscofpmf extension support The sscofpmf extension allows counter overflow and filtering for programmable counters. Enable the perf driver to handle the overflow interrupt. The overflow interrupt is a hart local interrupt. Thus, per cpu overflow interrupts are setup as a child under the root INTC irq domain. Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/include/asm/csr.h | 8 +- arch/riscv/include/asm/hwcap.h | 1 + arch/riscv/kernel/cpu.c | 1 + arch/riscv/kernel/cpufeature.c | 2 + drivers/perf/riscv_pmu_sbi.c | 222 ++++++++++++++++++++++++++++++++++++++++- include/linux/perf/riscv_pmu.h | 2 + 6 files changed, 230 insertions(+), 6 deletions(-) commit e9991434596f5373dfd75857b445eb92a9253c56 Author: Atish Patra Date: Fri Feb 18 16:46:57 2022 -0800 RISC-V: Add perf platform driver based on SBI PMU extension RISC-V SBI specification added a PMU extension that allows to configure start/stop any pmu counter. The RISC-V perf can use most of the generic perf features except interrupt overflow and event filtering based on privilege mode which will be added in future. It also allows to monitor a handful of firmware counters that can provide insights into firmware activity during a performance analysis. Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt drivers/perf/Kconfig | 10 + drivers/perf/Makefile | 1 + drivers/perf/riscv_pmu.c | 2 + drivers/perf/riscv_pmu_sbi.c | 578 +++++++++++++++++++++++++++++++++++++++++ include/linux/cpuhotplug.h | 1 + include/linux/perf/riscv_pmu.h | 6 +- 6 files changed, 596 insertions(+), 2 deletions(-) commit 90beae5185c260074db409241247630036cf93a0 Author: Atish Patra Date: Fri Feb 18 16:46:56 2022 -0800 RISC-V: Add RISC-V SBI PMU extension definitions This patch adds all the definitions defined by the SBI PMU extension. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/include/asm/sbi.h | 95 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) commit 9b3e150e310ee71d7bae1e31c38a300cfa5e951b Author: Atish Patra Date: Fri Feb 18 16:46:55 2022 -0800 RISC-V: Add a simple platform driver for RISC-V legacy perf The old RISC-V perf implementation allowed counting of only cycle/instruction counters using perf. Restore that feature by implementing a simple platform driver under a separate config to provide backward compatibility. Any existing software stack will continue to work as it is. However, it provides an easy way out in future where we can remove the legacy driver. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt drivers/perf/Kconfig | 10 +++ drivers/perf/Makefile | 1 + drivers/perf/riscv_pmu_legacy.c | 142 ++++++++++++++++++++++++++++++++++++++++ include/linux/perf/riscv_pmu.h | 6 ++ 4 files changed, 159 insertions(+) commit f5bfa23f576fdcc8e0b7fbff44cf70bd69ff9bdb Author: Atish Patra Date: Fri Feb 18 16:46:54 2022 -0800 RISC-V: Add a perf core library for pmu drivers Implement a perf core library that can support all the essential perf features in future. It can also accommodate any type of PMU implementation in future. Currently, both SBI based perf driver and legacy driver implemented uses the library. Most of the common perf functionalities are kept in this core library wile PMU specific driver can implement PMU specific features. For example, the SBI specific functionality will be implemented in the SBI specific driver. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt drivers/perf/Kconfig | 10 ++ drivers/perf/Makefile | 1 + drivers/perf/riscv_pmu.c | 322 +++++++++++++++++++++++++++++++++++++++++ include/linux/perf/riscv_pmu.h | 65 +++++++++ 4 files changed, 398 insertions(+) commit e0c0ca3546adf6aaa9ba7c7232bd3b1792f3153b Merge: 351bdbb6419c b1a6f56b6506 Author: Jakub Kicinski Date: Mon Mar 21 14:58:20 2022 -0700 Merge branch 'net-tls-some-optimizations-for-tls' Ziyang Xuan says: ==================== net/tls: some optimizations for tls Do some small optimizations for tls, including jump instructions optimization, and judgement processes optimization. ==================== Link: https://lore.kernel.org/r/cover.1647658604.git.william.xuanziyang@huawei.com Signed-off-by: Jakub Kicinski commit c631121dd16ee57ceb0d6a48e1357382b98350fd Author: Atish Patra Date: Fri Feb 18 16:46:53 2022 -0800 RISC-V: Add CSR encodings for all HPMCOUNTERS Linux kernel can directly read these counters as the HPMCOUNTERS CSRs are accessible in S-mode. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/include/asm/csr.h | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) commit b1a6f56b6506c2cecef301b5c3804be656a8c334 Author: Ziyang Xuan Date: Sat Mar 19 11:15:20 2022 +0800 net/tls: optimize judgement processes in tls_set_device_offload() It is known that priority setting HW offload when set tls TX/RX offload by setsockopt(). Check netdevice whether support NETIF_F_HW_TLS_TX or not at the later stages in the whole tls_set_device_offload() process, some memory allocations have been done before that. We must release those memory and return error if we judge the netdevice not support NETIF_F_HW_TLS_TX. It is redundant. Move NETIF_F_HW_TLS_TX judgement forward, and move start_marker_record and offload_ctx memory allocation back slightly. Thus, we can get simpler exception handling process. Signed-off-by: Ziyang Xuan Signed-off-by: Jakub Kicinski net/tls/tls_device.c | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) commit 1ddcbfbf9dc9b59258dc5a4429f607a6828863d0 Author: Ziyang Xuan Date: Sat Mar 19 11:14:33 2022 +0800 net/tls: remove unnecessary jump instructions in do_tls_setsockopt_conf() Avoid using "goto" jump instruction unconditionally when we can return directly. Remove unnecessary jump instructions in do_tls_setsockopt_conf(). Signed-off-by: Ziyang Xuan Signed-off-by: Jakub Kicinski net/tls/tls_main.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) commit 9dc6ce80213635cdca611d8b89f74bf010c1a8c6 Author: Atish Patra Date: Fri Feb 18 16:46:52 2022 -0800 RISC-V: Remove the current perf implementation The current perf implementation in RISC-V is not very useful as it can not count any events other than cycle/instructions. Moreover, perf record can not be used or the events can not be started or stopped. Remove the implementation now for a better platform driver in future that will implement most of the missing functionality. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/Kconfig | 13 - arch/riscv/include/asm/perf_event.h | 72 ------ arch/riscv/kernel/Makefile | 1 - arch/riscv/kernel/perf_event.c | 485 ------------------------------------ 4 files changed, 571 deletions(-) commit 5628b8de1228436d47491c662dc521bc138a3d43 Merge: f400bea2d44b 3e504d2026eb Author: Linus Torvalds Date: Mon Mar 21 14:55:32 2022 -0700 Merge tag 'random-5.18-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator updates from Jason Donenfeld: "There have been a few important changes to the RNG's crypto, but the intent for 5.18 has been to shore up the existing design as much as possible with modern cryptographic functions and proven constructions, rather than actually changing up anything fundamental to the RNG's design. So it's still the same old RNG at its core as before: it still counts entropy bits, and collects from the various sources with the same heuristics as before, and so forth. However, the cryptographic algorithms that transform that entropic data into safe random numbers have been modernized. Just as important, if not more, is that the code has been cleaned up and re-documented. As one of the first drivers in Linux, going back to 1.3.30, its general style and organization was showing its age and becoming both a maintenance burden and an auditability impediment. Hopefully this provides a more solid foundation to build on for the future. I encourage you to open up the file in full, and maybe you'll remark, "oh, that's what it's doing," and enjoy reading it. That, at least, is the eventual goal, which this pull begins working toward. Here's a summary of the various patches in this pull: - /dev/urandom and /dev/random now do the same thing, per the patch we discussed on the list. I think this is worth trying out. If it does appear problematic, I've made sure to keep it standalone and revertible without any conflicts. - Fixes and cleanups for numerous integer type problems, locking issues, and general code quality concerns. - The input pool's LFSR has been replaced with a cryptographically secure hash function, which has security and performance benefits alike, and consequently allows us to count entropy bits linearly. - The pre-init injection now uses a real hash function too, instead of an LFSR or vanilla xor. - The interrupt handler's fast_mix() function now uses one round of SipHash, rather than the fake crypto that was there before. - All additions of RDRAND and RDSEED now go through the input pool's hash function, in part to mitigate ridiculous hypothetical CPU backdoors, but more so to have a consistent interface for ingesting entropy that's easy to analyze, making everything happen one way, instead of a potpourri of different ways. - The crng now works on per-cpu data, while also being in accordance with the actual "fast key erasure RNG" design. This allows us to fix several boot-time race complications associated with the prior dynamically allocated model, eliminates much locking, and makes our backtrack protection more robust. - Batched entropy now erases doled out values so that it's backtrack resistant. - Working closely with Sebastian, the interrupt handler no longer needs to take any locks at all, as we punt the synchronized/expensive operations to a workqueue. This is especially nice for PREEMPT_RT, where taking spinlocks in irq context is problematic. It also makes the handler faster for the rest of us. - Also working with Sebastian, we now do the right thing on CPU hotplug, so that we don't use stale entropy or fail to accumulate new entropy when CPUs come back online. - We handle virtual machines that fork / clone / snapshot, using the "vmgenid" ACPI specification for retrieving a unique new RNG seed, which we can use to also make WireGuard (and in the future, other things) safe across VM forks. - Around boot time, we now try to reseed more often if enough entropy is available, before settling on the usual 5 minute schedule. - Last, but certainly not least, the documentation in the file has been updated considerably" * tag 'random-5.18-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: (60 commits) random: check for signal and try earlier when generating entropy random: reseed more often immediately after booting random: make consistent usage of crng_ready() random: use SipHash as interrupt entropy accumulator wireguard: device: clear keys on VM fork random: provide notifier for VM fork random: replace custom notifier chain with standard one random: do not export add_vmfork_randomness() unless needed virt: vmgenid: notify RNG of VM fork and supply generation ID ACPI: allow longer device IDs random: add mechanism for VM forks to reinitialize crng random: don't let 644 read-only sysctls be written to random: give sysctl_random_min_urandom_seed a more sensible value random: block in /dev/urandom random: do crng pre-init loading in worker rather than irq random: unify cycles_t and jiffies usage and types random: cleanup UUID handling random: only wake up writers after zap if threshold was passed random: round-robin registers as ulong, not u32 random: clear fast pool, crng, and batches in cpuhp bring up ... commit f97b8b9bd630fb76c0e9e11cbf390e3d64a144d7 Author: Yonghong Song Date: Sat Mar 19 20:20:09 2022 -0700 bpftool: Fix a bug in subskeleton code generation Compiled with clang by adding LLVM=1 both kernel and selftests/bpf build, I hit the following compilation error: In file included from /.../tools/testing/selftests/bpf/prog_tests/subskeleton.c:6: ./test_subskeleton_lib.subskel.h:168:6: error: variable 'err' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (!s->progs) ^~~~~~~~~ ./test_subskeleton_lib.subskel.h:181:11: note: uninitialized use occurs here errno = -err; ^~~ ./test_subskeleton_lib.subskel.h:168:2: note: remove the 'if' if its condition is always false if (!s->progs) ^~~~~~~~~~~~~~ The compilation error is triggered by the following code ... int err; obj = (struct test_subskeleton_lib *)calloc(1, sizeof(*obj)); if (!obj) { errno = ENOMEM; goto err; } ... err: test_subskeleton_lib__destroy(obj); errno = -err; ... in test_subskeleton_lib__open(). The 'err' is not initialized, yet it is used in 'errno = -err' later. The fix is to remove 'errno = -err' since errno has been set properly in all incoming branches. Fixes: 00389c58ffe9 ("bpftool: Add support for subskeletons") Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220320032009.3106133-1-yhs@fb.com tools/bpf/bpftool/gen.c | 1 - 1 file changed, 1 deletion(-) commit f400bea2d44beec76f7e7f45e5372ef790336a4d Merge: f648372dfe3e ed945296bb90 Author: Linus Torvalds Date: Mon Mar 21 14:46:01 2022 -0700 Merge tag 'pnp-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull PnP update from Rafael Wysocki: "Replace acpi_bus_get_device() in the PNP code with acpi_fetch_acpi_dev() which is better" * tag 'pnp-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PNP: Replace acpi_bus_get_device() commit f648372dfe3e8e9dc8583c2b1790388be49bb47f Merge: 02b82b02c343 31035f3e20af Author: Linus Torvalds Date: Mon Mar 21 14:35:11 2022 -0700 Merge tag 'thermal-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control updates from Rafael Wysocki: "As far as new functionality is concerned, there is a new thermal driver for the Intel Hardware Feedback Interface (HFI) along with some intel-speed-select utility changes to support it. There are also new DT compatible strings for a couple of platforms, and thermal zones on some platforms will be registered as HWmon sensors now. Apart from the above, some drivers are updated (fixes mostly) and there is a new piece of documentation for the Intel DPTF (Dynamic Power and Thermal Framework) sysfs interface. Specifics: - Add a new thermal driver for the Intel Hardware Feedback Interface (HFI) including the HFI initialization, HFI notification interrupt handling and sending CPU capabilities change messages to user space via the thermal netlink interface (Ricardo Neri, Srinivas Pandruvada, Nathan Chancellor, Randy Dunlap). - Extend the intel-speed-select utility to handle out-of-band CPU configuration changes and add support for the CPU capabilities change messages sent over the thermal netlink interface by the new HFI thermal driver to it (Srinivas Pandruvada). - Convert the DT bindings to yaml format for the Exynos platform and fix and update the MAINTAINERS file for this driver (Krzysztof Kozlowski). - Register the thermal zones as HWmon sensors for the QCom's Tsens driver and TI thermal platforms (Dmitry Baryshkov, Romain Naour). - Add the msm8953 compatible documentation in the bindings (Luca Weiss). - Add the sm8150 platform support to the QCom LMh driver's DT binding (Thara Gopinath). - Check the command result from the IPC command to the BPMP in the Tegra driver (Mikko Perttunen). - Silence the error for normal configuration where the interrupt is optionnal in the Broadcom thermal driver (Florian Fainelli). - Remove remaining dead code from the TI thermal driver (Yue Haibing). - Don't use bitmap_weight() in end_power_clamp() in the powerclamp driver (Yury Norov). - Update the OS policy capabilities handshake in the int340x thermal driver (Srinivas Pandruvada). - Increase the policies bitmap size in int340x (Srinivas Pandruvada). - Replace acpi_bus_get_device() with acpi_fetch_acpi_dev() in the int340x thermal driver (Rafael Wysocki). - Check for NULL after calling kmemdup() in int340x (Jiasheng Jiang). - Add Intel Dynamic Power and Thermal Framework (DPTF) kernel interface documentation (Srinivas Pandruvada). - Fix bullet list warning in the thermal documentation (Randy Dunlap)" * tag 'thermal-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (30 commits) thermal: int340x: Update OS policy capability handshake thermal: int340x: Increase bitmap size Documentation: thermal: DPTF Documentation MAINTAINERS: thermal: samsung: update Krzysztof Kozlowski's email thermal/drivers/ti-soc-thermal: Remove unused function ti_thermal_get_temp() thermal/drivers/brcmstb_thermal: Interrupt is optional thermal: tegra-bpmp: Handle errors in BPMP response drivers/thermal/ti-soc-thermal: Add hwmon support dt-bindings: thermal: tsens: Add msm8953 compatible dt-bindings: thermal: Add sm8150 compatible string for LMh thermal/drivers/qcom/lmh: Add support for sm8150 thermal/drivers/tsens: register thermal zones as hwmon sensors MAINTAINERS: thermal: samsung: Drop obsolete properties dt-bindings: thermal: samsung: Convert to dtschema tools/power/x86/intel-speed-select: v1.12 release tools/power/x86/intel-speed-select: HFI support tools/power/x86/intel-speed-select: OOB daemon mode thermal: intel: hfi: INTEL_HFI_THERMAL depends on NET thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub thermal: Replace acpi_bus_get_device() ... commit ed0c99dc0f499ff8b6e75b5ae6092ab42be1ad39 Author: Jakub Kicinski Date: Mon Mar 21 09:59:57 2022 -0700 tcp: ensure PMTU updates are processed during fastopen tp->rx_opt.mss_clamp is not populated, yet, during TFO send so we rise it to the local MSS. tp->mss_cache is not updated, however: tcp_v6_connect(): tp->rx_opt.mss_clamp = IPV6_MIN_MTU - headers; tcp_connect(): tcp_connect_init(): tp->mss_cache = min(mtu, tp->rx_opt.mss_clamp) tcp_send_syn_data(): tp->rx_opt.mss_clamp = tp->advmss After recent fixes to ICMPv6 PTB handling we started dropping PMTU updates higher than tp->mss_cache. Because of the stale tp->mss_cache value PMTU updates during TFO are always dropped. Thanks to Wei for helping zero in on the problem and the fix! Fixes: c7bb4b89033b ("ipv6: tcp: drop silly ICMPv6 packet too big messages") Reported-by: Andre Nash Reported-by: Neil Spring Reviewed-by: Wei Wang Acked-by: Yuchung Cheng Acked-by: Martin KaFai Lau Signed-off-by: Jakub Kicinski Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220321165957.1769954-1-kuba@kernel.org Signed-off-by: Jakub Kicinski net/ipv4/tcp_output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 02b82b02c34321dde10d003aafcd831a769b2a8a Merge: 242ba6656d60 ec3d8b8365e9 Author: Linus Torvalds Date: Mon Mar 21 14:26:28 2022 -0700 Merge tag 'pm-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These are mostly fixes and cleanups all over the code and a new piece of documentation for Intel uncore frequency scaling. Functionality-wise, the intel_idle driver will support Sapphire Rapids Xeons natively now (with some extra facilities for controlling C-states more precisely on those systems), virtual guests will take the ACPI S4 hardware signature into account by default, the intel_pstate driver will take the defualt EPP value from the firmware, cpupower utility will support the AMD P-state driver added in the previous cycle, and there is a new tracer utility for that driver. Specifics: - Allow device_pm_check_callbacks() to be called from interrupt context without issues (Dmitry Baryshkov). - Modify devm_pm_runtime_enable() to automatically handle pm_runtime_dont_use_autosuspend() at driver exit time (Douglas Anderson). - Make the schedutil cpufreq governor use to_gov_attr_set() instead of open coding it (Kevin Hao). - Replace acpi_bus_get_device() with acpi_fetch_acpi_dev() in the cpufreq longhaul driver (Rafael Wysocki). - Unify show() and store() naming in cpufreq and make it use __ATTR_XX (Lianjie Zhang). - Make the intel_pstate driver use the EPP value set by the firmware by default (Srinivas Pandruvada). - Re-order the init checks in the powernow-k8 cpufreq driver (Mario Limonciello). - Make the ACPI processor idle driver check for architectural support for LPI to avoid using it on x86 by mistake (Mario Limonciello). - Add Sapphire Rapids Xeon support to the intel_idle driver (Artem Bityutskiy). - Add 'preferred_cstates' module argument to the intel_idle driver to work around C1 and C1E handling issue on Sapphire Rapids (Artem Bityutskiy). - Add core C6 optimization on Sapphire Rapids to the intel_idle driver (Artem Bityutskiy). - Optimize the haltpoll cpuidle driver a bit (Li RongQing). - Remove leftover text from intel_idle() kerneldoc comment and fix up white space in intel_idle (Rafael Wysocki). - Fix load_image_and_restore() error path (Ye Bin). - Fix typos in comments in the system wakeup hadling code (Tom Rix). - Clean up non-kernel-doc comments in hibernation code (Jiapeng Chong). - Fix __setup handler error handling in system-wide suspend and hibernation core code (Randy Dunlap). - Add device name to suspend_report_result() (Youngjin Jang). - Make virtual guests honour ACPI S4 hardware signature by default (David Woodhouse). - Block power off of a parent PM domain unless child is in deepest state (Ulf Hansson). - Use dev_err_probe() to simplify error handling for generic PM domains (Ahmad Fatoum). - Fix sleep-in-atomic bug caused by genpd_debug_remove() (Shawn Guo). - Document Intel uncore frequency scaling (Srinivas Pandruvada). - Add DTPM hierarchy description (Daniel Lezcano). - Change the locking scheme in DTPM (Daniel Lezcano). - Fix dtpm_cpu cleanup at exit time and missing virtual DTPM pointer release (Daniel Lezcano). - Make dtpm_node_callback[] static (kernel test robot). - Fix spelling mistake "initialze" -> "initialize" in dtpm_create_hierarchy() (Colin Ian King). - Add tracer tool for the amd-pstate driver (Jinzhou Su). - Fix PC6 displaying in turbostat on some systems (Artem Bityutskiy). - Add AMD P-State support to the cpupower utility (Huang Rui)" * tag 'pm-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (58 commits) cpufreq: powernow-k8: Re-order the init checks cpuidle: intel_idle: Drop redundant backslash at line end cpuidle: intel_idle: Update intel_idle() kerneldoc comment PM: hibernate: Honour ACPI hardware signature by default for virtual guests cpufreq: intel_pstate: Use firmware default EPP cpufreq: unify show() and store() naming and use __ATTR_XX PM: core: keep irq flags in device_pm_check_callbacks() cpuidle: haltpoll: Call cpuidle_poll_state_init() later Documentation: amd-pstate: add tracer tool introduction tools/power/x86/amd_pstate_tracer: Add tracer tool for AMD P-state tools/power/x86/intel_pstate_tracer: make tracer as a module cpufreq: amd-pstate: Add more tracepoint for AMD P-State module PM: sleep: Add device name to suspend_report_result() turbostat: fix PC6 displaying on some systems intel_idle: add core C6 optimization for SPR intel_idle: add 'preferred_cstates' module argument intel_idle: add SPR support PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend() ACPI: processor idle: Check for architectural support for LPI cpuidle: PSCI: Move the `has_lpi` check to the beginning of the function ... commit 8d3ea3d402db94b61075617e71b67459a714a502 Author: Jeremy Linton Date: Wed Mar 9 22:53:58 2022 -0600 net: bcmgenet: Use stronger register read/writes to assure ordering GCC12 appears to be much smarter about its dependency tracking and is aware that the relaxed variants are just normal loads and stores and this is causing problems like: [ 210.074549] ------------[ cut here ]------------ [ 210.079223] NETDEV WATCHDOG: enabcm6e4ei0 (bcmgenet): transmit queue 1 timed out [ 210.086717] WARNING: CPU: 1 PID: 0 at net/sched/sch_generic.c:529 dev_watchdog+0x234/0x240 [ 210.095044] Modules linked in: genet(E) 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] [ 210.146561] ACPI CPPC: PCC check channel failed for ss: 0. ret=-110 [ 210.146927] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G E 5.17.0-rc7G12+ #58 [ 210.153226] CPPC Cpufreq:cppc_scale_freq_workfn: failed to read perf counters [ 210.161349] Hardware name: Raspberry Pi Foundation Raspberry Pi 4 Model B/Raspberry Pi 4 Model B, BIOS EDK2-DEV 02/08/2022 [ 210.161353] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 210.161358] pc : dev_watchdog+0x234/0x240 [ 210.161364] lr : dev_watchdog+0x234/0x240 [ 210.161368] sp : ffff8000080a3a40 [ 210.161370] x29: ffff8000080a3a40 x28: ffffcd425af87000 x27: ffff8000080a3b20 [ 210.205150] x26: ffffcd425aa00000 x25: 0000000000000001 x24: ffffcd425af8ec08 [ 210.212321] x23: 0000000000000100 x22: ffffcd425af87000 x21: ffff55b142688000 [ 210.219491] x20: 0000000000000001 x19: ffff55b1426884c8 x18: ffffffffffffffff [ 210.226661] x17: 64656d6974203120 x16: 0000000000000001 x15: 6d736e617274203a [ 210.233831] x14: 2974656e65676d63 x13: ffffcd4259c300d8 x12: ffffcd425b07d5f0 [ 210.241001] x11: 00000000ffffffff x10: ffffcd425b07d5f0 x9 : ffffcd4258bdad9c [ 210.248171] x8 : 00000000ffffdfff x7 : 000000000000003f x6 : 0000000000000000 [ 210.255341] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000001000 [ 210.262511] x2 : 0000000000001000 x1 : 0000000000000005 x0 : 0000000000000044 [ 210.269682] Call trace: [ 210.272133] dev_watchdog+0x234/0x240 [ 210.275811] call_timer_fn+0x3c/0x15c [ 210.279489] __run_timers.part.0+0x288/0x310 [ 210.283777] run_timer_softirq+0x48/0x80 [ 210.287716] __do_softirq+0x128/0x360 [ 210.291392] __irq_exit_rcu+0x138/0x140 [ 210.295243] irq_exit_rcu+0x1c/0x30 [ 210.298745] el1_interrupt+0x38/0x54 [ 210.302334] el1h_64_irq_handler+0x18/0x24 [ 210.306445] el1h_64_irq+0x7c/0x80 [ 210.309857] arch_cpu_idle+0x18/0x2c [ 210.313445] default_idle_call+0x4c/0x140 [ 210.317470] cpuidle_idle_call+0x14c/0x1a0 [ 210.321584] do_idle+0xb0/0x100 [ 210.324737] cpu_startup_entry+0x30/0x8c [ 210.328675] secondary_start_kernel+0xe4/0x110 [ 210.333138] __secondary_switched+0x94/0x98 The assumption when these were relaxed seems to be that device memory would be mapped non reordering, and that other constructs (spinlocks/etc) would provide the barriers to assure that packet data and in memory rings/queues were ordered with respect to device register reads/writes. This itself seems a bit sketchy, but the real problem with GCC12 is that it is moving the actual reads/writes around at will as though they were independent operations when in truth they are not, but the compiler can't know that. When looking at the assembly dumps for many of these routines its possible to see very clean, but not strictly in program order operations occurring as the compiler would be free to do if these weren't actually register reads/write operations. Its possible to suppress the timeout with a liberal bit of dma_mb()'s sprinkled around but the device still seems unable to reliably send/receive data. A better plan is to use the safer readl/writel everywhere. Since this partially reverts an older commit, which notes the use of the relaxed variants for performance reasons. I would suggest that any performance problems with this commit are targeted at relaxing only the performance critical code paths after assuring proper barriers. Fixes: 69d2ea9c79898 ("net: bcmgenet: Use correct I/O accessors") Reported-by: Peter Robinson Signed-off-by: Jeremy Linton Acked-by: Peter Robinson Tested-by: Peter Robinson Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220310045358.224350-1-jeremy.linton@arm.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 242ba6656d604aa8dc87451fc08143cb28d5a587 Merge: 346658a5e189 1bde8bddb5db Author: Linus Torvalds Date: Mon Mar 21 14:17:20 2022 -0700 Merge tag 'acpi-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "From the new functionality perspective, the most significant items here are the new driver for the 'ARM Generic Diagnostic Dump and Reset' device, the extension of fine grain fan control in the ACPI fan driver, and the change making it possible to use CPPC information to obtain CPU capacity. There are also a few new quirks, a bunch of fixes, including the platform-level _OSC handling change to make it actually take the platform firmware response into account, some code and documentation cleanups, and a notable update of the ACPI device enumeration documentation. Specifics: - Use uintptr_t and offsetof() in the ACPICA code to avoid compiler warnings regarding NULL pointer arithmetic (Rafael Wysocki). - Fix possible NULL pointer dereference in acpi_ns_walk_namespace() when passed "acpi=off" in the command line (Rafael Wysocki). - Fix and clean up acpi_os_read/write_port() (Rafael Wysocki). - Introduce acpi_bus_for_each_dev() and use it for walking all ACPI device objects in the Type C code (Rafael Wysocki). - Fix the _OSC platform capabilities negotioation and prevent CPPC from being used if the platform firmware indicates that it not supported via _OSC (Rafael Wysocki). - Use ida_alloc() instead of ida_simple_get() for ACPI enumeration of devices (Rafael Wysocki). - Add AGDI and CEDT to the list of known ACPI table signatures (Ilkka Koskinen, Robert Kiraly). - Add power management debug messages related to suspend-to-idle in two places (Rafael Wysocki). - Fix __acpi_node_get_property_reference() return value and clean up that function (Andy Shevchenko, Sakari Ailus). - Fix return value of the __setup handler in the ACPI PM timer clock source driver (Randy Dunlap). - Clean up double words in two comments (Tom Rix). - Add "skip i2c clients" quirks for Lenovo Yoga Tablet 1050F/L and Nextbook Ares 8 (Hans de Goede). - Clean up frequency invariance handling on x86 in the ACPI CPPC library (Huang Rui). - Work around broken XSDT on the Advantech DAC-BJ01 board (Mark Cilissen). - Make wakeup events checks in the ACPI EC driver more straightforward and clean up acpi_ec_submit_event() (Rafael Wysocki). - Make it possible to obtain the CPU capacity with the help of CPPC information (Ionela Voinescu). - Improve fine grained fan control in the ACPI fan driver and document it (Srinivas Pandruvada). - Add device HID and quirk for Microsoft Surface Go 3 to the ACPI battery driver (Maximilian Luz). - Make the ACPI driver for Intel SoCs (LPSS) let the SPI driver know the exact type of the controller (Andy Shevchenko). - Force native backlight mode on Clevo NL5xRU and NL5xNU (Werner Sembach). - Fix return value of __setup handlers in the APEI code (Randy Dunlap). - Add Arm Generic Diagnostic Dump and Reset device driver (Ilkka Koskinen). - Limit printable size of BERT table data (Darren Hart). - Fix up HEST and GHES initialization (Shuai Xue). - Update the ACPI device enumeration documentation and unify the ASL style in GPIO-related examples (Andy Shevchenko)" * tag 'acpi-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (52 commits) clocksource: acpi_pm: fix return value of __setup handler ACPI: bus: Avoid using CPPC if not supported by firmware Revert "ACPI: Pass the same capabilities to the _OSC regardless of the query flag" ACPI: video: Force backlight native for Clevo NL5xRU and NL5xNU arm64, topology: enable use of init_cpu_capacity_cppc() arch_topology: obtain cpu capacity using information from CPPC x86, ACPI: rename init_freq_invariance_cppc() to arch_init_invariance_cppc() ACPI: AGDI: Add driver for Arm Generic Diagnostic Dump and Reset device ACPI: tables: Add AGDI to the list of known table signatures ACPI/APEI: Limit printable size of BERT table data ACPI: docs: gpio-properties: Unify ASL style for GPIO examples ACPI / x86: Work around broken XSDT on Advantech DAC-BJ01 board ACPI: APEI: fix return value of __setup handlers x86/ACPI: CPPC: Move init_freq_invariance_cppc() into x86 CPPC x86: Expose init_freq_invariance() to topology header x86/ACPI: CPPC: Move AMD maximum frequency ratio setting function into x86 CPPC x86/ACPI: CPPC: Rename cppc_msr.c to cppc.c ACPI / x86: Add skip i2c clients quirk for Lenovo Yoga Tablet 1050F/L ACPI / x86: Add skip i2c clients quirk for Nextbook Ares 8 ACPICA: Avoid walking the ACPI Namespace if it is not there ... commit 346658a5e189f35b61206fed2f9f60d4bb34b881 Merge: d2eb5500f1d9 75c05fabb873 Author: Linus Torvalds Date: Mon Mar 21 14:13:25 2022 -0700 Merge tag 'docs-5.18' of git://git.lwn.net/linux Pull documentation updates from Jonathan Corbet: "It has been a moderately busy cycle for documentation; some of the highlights are: - Numerous PDF-generation improvements - Kees's new document with guidelines for researchers studying the development community. - The ongoing stream of Chinese translations - Thorsten's new document on regression handling - A major reworking of the internal documentation for the kernel-doc script. Plus the usual stream of typo fixes and such" * tag 'docs-5.18' of git://git.lwn.net/linux: (80 commits) docs/kernel-parameters: update description of mem= docs/zh_CN: Add sched-nice-design Chinese translation docs: scheduler: Convert schedutil.txt to ReST Docs: ktap: add code-block type docs: serial: fix a reference file name in driver.rst docs: UML: Mention telnetd for port channel docs/zh_CN: add damon reclaim translation docs/zh_CN: add damon usage translation docs/zh_CN: add admin-guide damon start translation docs/zh_CN: add admin-guide damon index translation docs/zh_CN: Refactoring the admin-guide directory index zh_CN: Add translation for admin-guide/mm/index.rst zh_CN: Add translations for admin-guide/mm/ksm.rst Add Chinese translation for vm/ksm.rst docs/zh_CN: Add sched-stats Chinese translation docs/zh_CN: add devicetree of_unittest translation docs/zh_CN: add devicetree usage-model translation docs/zh_CN: add devicetree index translation Documentation: describe how to apply incremental stable patches docs/zh_CN: add peci subsystem translation ... commit d2eb5500f1d916c9b0815cdc63c48a6d615532cc Merge: 35dc0352bb6c e2b665f612ca Author: Linus Torvalds Date: Mon Mar 21 14:09:34 2022 -0700 Merge tag 'lkmm.2022.03.13a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull memory model doc update from Paul McKenney: "An improved explanation of syntactic and semantic dependencies from Alan Stern" * tag 'lkmm.2022.03.13a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: tools/memory-model: Explain syntactic and semantic dependencies commit cd6382d82752737e43ef3617bb9e72913d2b1d47 Author: German Gomez Date: Wed Mar 16 17:20:15 2022 +0000 perf test arm64: Test unwinding using fame-pointer (fp) mode Add a shell script to check that the call-graphs generated using frame pointers (--call-graph fp) are complete and not missing leaf functions: | $ perf test 88 -v | 88: Check Arm64 callgraphs are complete in fp mode : | --- start --- | test child forked, pid 8734 | + Compiling test program (/tmp/test_program.Cz3yL)... | + Recording (PID=8749)... | + Stopping perf-record... | test_program.Cz | 728 leaf | 753 parent | 76c main | test child finished with 0 | ---- end ---- | Check Arm SPE callgraphs are complete in fp mode: Ok It's supposed to work with both unwinders: | $ make                # for libunwind (default) | $ make NO_LIBUNWIND=1 # for libdw Tester notes: Ran it on N1SDP and it passes, and it fails if b9f6fbb3b2c29736 ("perf arm64: Inject missing frames when using 'perf record --call-graph=fp'") isn't applied. Fixes: b9f6fbb3b2c29736 ("perf arm64: Inject missing frames when using 'perf record --call-graph=fp'") Suggested-by: Jiri Olsa Reviewed-by: James Clark Tested-by: James Clark Signed-off-by: German Gomez Cc: Alexandre Truong Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220316172015.98000-1-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/tests/shell/test_arm_callgraph_fp.sh | 68 +++++++++++++++++++++++++ 1 file changed, 68 insertions(+) commit 35dc0352bb6cf611f01dba41b722fd2b9a819204 Merge: a04b1bf574e1 d5578190bed3 Author: Linus Torvalds Date: Mon Mar 21 14:00:56 2022 -0700 Merge tag 'rcu.2022.03.13a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull RCU updates from Paul McKenney: - Fix idle detection (Neeraj Upadhyay) and missing access marking detected by KCSAN. - Reduce coupling between rcu_barrier() and CPU-hotplug operations, so that rcu_barrier() no longer needs to do cpus_read_lock(). This may also someday allow system boot to bring CPUs online concurrently. - Enable more aggressive movement to per-CPU queueing when reacting to excessive lock contention due to workloads placing heavy update-side stress on RCU tasks. - Improvements to RCU priority boosting, including changes from Neeraj Upadhyay, Zqiang, and Alison Chaiken. - Various fixes improving test robustness and debug information. - Add tests for SRCU size transitions, further compress torture.sh build products, and improve debug output. - Miscellaneous fixes. * tag 'rcu.2022.03.13a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (49 commits) rcu: Replace cpumask_weight with cpumask_empty where appropriate rcu: Remove __read_mostly annotations from rcu_scheduler_active externs rcu: Uninline multi-use function: finish_rcuwait() rcu: Mark writes to the rcu_segcblist structure's ->flags field kasan: Record work creation stack trace with interrupts enabled rcu: Inline __call_rcu() into call_rcu() rcu: Add mutex for rcu boost kthread spawning and affinity setting rcu: Fix description of kvfree_rcu() MAINTAINERS: Add Frederic and Neeraj to their RCU files rcutorture: Provide non-power-of-two Tasks RCU scenarios rcutorture: Test SRCU size transitions torture: Make torture.sh help message match reality rcu-tasks: Set ->percpu_enqueue_shift to zero upon contention rcu-tasks: Use order_base_2() instead of ilog2() rcu: Create and use an rcu_rdp_cpu_online() rcu: Make rcu_barrier() no longer block CPU-hotplug operations rcu: Rework rcu_barrier() and callback-migration logic rcu: Refactor rcu_barrier() empty-list handling rcu: Kill rnp->ofl_seq and use only rcu_state.ofl_lock for exclusion torture: Change KVM environment variable to RCUTORTURE ... commit 93defd5a15dd74791532692cc59be3a1aaa045fe Author: Darrick J. Wong Date: Wed Mar 16 11:38:27 2022 -0700 xfs: document the XFS_ALLOC_AGFL_RESERVE constant Currently, we use this undocumented macro to encode the minimum number of blocks needed to replenish a completely empty AGFL when an AG is nearly full. This has lead to confusion on the part of the maintainers, so let's document what the value actually means, and move it to xfs_alloc.c since it's not used outside of that module. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner fs/xfs/libxfs/xfs_alloc.c | 28 +++++++++++++++++++++++----- fs/xfs/libxfs/xfs_alloc.h | 1 - 2 files changed, 23 insertions(+), 6 deletions(-) commit e581094167beb674c8a3bc2c27362f50dc5dd617 Author: Song Liu Date: Mon Mar 21 11:00:09 2022 -0700 bpf: Fix bpf_prog_pack when PMU_SIZE is not defined PMD_SIZE is not available in some special config, e.g. ARCH=arm with CONFIG_MMU=n. Use bpf_prog_pack of PAGE_SIZE in these cases. Fixes: ef078600eec2 ("bpf: Select proper size for bpf_prog_pack") Reported-by: kernel test robot Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220321180009.1944482-3-song@kernel.org kernel/bpf/core.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) commit 96805674e5624b3c79780a2b41c7a3d6bc38dc76 Author: Song Liu Date: Mon Mar 21 11:00:08 2022 -0700 bpf: Fix bpf_prog_pack for multi-node setup module_alloc requires num_online_nodes * PMD_SIZE to allocate huge pages. bpf_prog_pack uses pack of size num_online_nodes * PMD_SIZE. OTOH, module_alloc returns addresses that are PMD_SIZE aligned (instead of num_online_nodes * PMD_SIZE aligned). Therefore, PMD_MASK should be used to calculate pack_ptr in bpf_prog_pack_free(). Fixes: ef078600eec2 ("bpf: Select proper size for bpf_prog_pack") Reported-by: syzbot+c946805b5ce6ab87df0b@syzkaller.appspotmail.com Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220321180009.1944482-2-song@kernel.org kernel/bpf/core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit d56c9fe6a06820d5ef8188d96bf4345c7bdba249 Author: Joanne Koong Date: Mon Mar 21 11:58:02 2022 -0700 bpf: Fix warning for cast from restricted gfp_t in verifier This fixes the sparse warning reported by the kernel test robot: kernel/bpf/verifier.c:13499:47: sparse: warning: cast from restricted gfp_t kernel/bpf/verifier.c:13501:47: sparse: warning: cast from restricted gfp_t This fix can be verified locally by running: 1) wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O make.cross 2) chmod +x ~/bin/make.cross 3) COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 ./make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' Fixes: b00fa38a9c1c ("bpf: Enable non-atomic allocations in local storage") Reported-by: kernel test robot Signed-off-by: Joanne Koong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220321185802.824223-1-joannekoong@fb.com kernel/bpf/verifier.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 63cd736f449445edcd7f0bcc7d84453e9beec0aa Author: Bjorn Helgaas Date: Mon Mar 21 13:34:46 2022 -0500 PCI: Avoid broken MSI on SB600 USB devices Some ATI SB600 USB adapters advertise MSI, but if INTx is disabled by setting PCI_COMMAND_INTX_DISABLE, MSI doesn't work either. The PCI/PCIe specs do not require software to set PCI_COMMAND_INTX_DISABLE when enabling MSI, but Linux has done that for many years. Mick reported that 306c54d0edb6 ("usb: hcd: Try MSI interrupts on PCI devices") broke these devices. Prior to 306c54d0edb6, they used INTx. Starting with 306c54d0edb6, they use MSI, and and the fact that Linux sets PCI_COMMAND_INTX_DISABLE means both INTx and MSI are disabled on these devices. Avoid this SB600 defect by disabling MSI so we use INTx as before. Fixes: 306c54d0edb6 ("usb: hcd: Try MSI interrupts on PCI devices") Link: https://lore.kernel.org/r/20220321183446.1108325-1-helgaas@kernel.org Link: https://bugzilla.kernel.org/show_bug.cgi?id=215690 Link: https://lore.kernel.org/all/PxIByDyBRcsbpcmVhGSNDFAoUcMmb78ctXCkw6fbpx25TGlCHvA6SJjjFkNr1FfQZMntYPTNyvEnblxzAZ8a6jP9ddLpKeCN6Chi_2FuexU=@protonmail.com/ Link: https://lore.kernel.org/r/20220314101448.90074-1-andriy.shevchenko@linux.intel.com BugLink: https://lore.kernel.org/all/20200702143045.23429-1-andriy.shevchenko@linux.intel.com/ Reported-by: Mick Lorain Signed-off-by: Bjorn Helgaas drivers/pci/quirks.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit a382c757ec5ef83137a86125f43a4c43dc2ab50b Author: Ben Dooks Date: Fri Mar 18 15:24:30 2022 +0000 PCI: fu740: Force 2.5GT/s for initial device probe The fu740 PCIe core does not probe any devices on the SiFive Unmatched board without this fix (or having U-Boot explicitly start the PCIe via either boot-script or user command). The fix is to start the link at 2.5GT/s speeds and once the link is up then change the maximum speed back to the default. The U-Boot driver claims to set the link-speed to 2.5GT/s to get the probe to work (and U-Boot does print link up at 2.5GT/s) in the following code: https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/pci/pcie_dw_sifive.c?id=v2022.01#L271 Link: https://lore.kernel.org/r/20220318152430.526320-1-ben.dooks@codethink.co.uk Signed-off-by: Ben Dooks Signed-off-by: Bjorn Helgaas Acked-by: Palmer Dabbelt drivers/pci/controller/dwc/pcie-fu740.c | 51 ++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) commit a04b1bf574e1f4875ea91f5c62ca051666443200 Merge: 93287e28bcc8 53d862fac4a0 Author: Linus Torvalds Date: Mon Mar 21 13:09:39 2022 -0700 Merge tag 'for-5.18/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture updates from Helge Deller: - add vDSO support (allows us to use non-executable stacks) - many TLB and cache flush optimizations (by Dave Anglin) - fix handling of probe non-access faults (by Dave Anglin) - fix invalidate/flush vmap routines (by Dave Anglin) - avoid using hardware single-step in kprobes - enable ARCH_HAS_DEBUG_VM_PGTABLE - many cleanups in unaligned handlers, e.g. rewrite of existing assembly code - always use the self-extracting kernel feature - big refacturing and code reductions regarding space-register usage in get_user() and put_user() - add fillrect() support to stifb graphics driver * tag 'for-5.18/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: (23 commits) parisc: Fix invalidate/flush vmap routines parisc: Avoid flushing cache on cache-less machines parisc: Avoid using hardware single-step in kprobes parisc: Improve CPU socket and core bootup info text parisc: Enable ARCH_HAS_DEBUG_VM_PGTABLE parisc: Avoid calling SMP cache flush functions on cache-less machines parisc: Increase parisc_cache_flush_threshold setting parisc/unaligned: Enhance user-space visible output parisc/unaligned: Rewrite 32-bit inline assembly of emulate_sth() parisc/unaligned: Rewrite 32-bit inline assembly of emulate_ldd() parisc/unaligned: Rewrite inline assembly of emulate_ldw() parisc/unaligned: Rewrite inline assembly of emulate_ldh() parisc/unaligned: Use EFAULT fixup handler in unaligned handlers parisc: Reduce code size by optimizing get_current() function calls parisc: Use constants to encode the space registers like SR_KERNEL parisc: Use SR_USER and SR_KERNEL in get_user() and put_user() parisc: Add defines for various space register parisc: Always use the self-extracting kernel feature video/fbdev/stifb: Implement the stifb_fillrect() function parisc: Add vDSO support ... commit 93287e28bcc8bcb3f23d46196845bf7c311cb8aa Merge: 84c2e17951fe 411472ae5bb4 Author: Linus Torvalds Date: Mon Mar 21 13:03:00 2022 -0700 Merge tag 'irq-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull interrupt updates from Thomas Gleixner: "Core code: - Provide generic_handle_irq_safe() which can be invoked from any context (hard interrupt or threaded). This allows to remove ugly workarounds in drivers all over the place. - Use generic_handle_irq_safe() in the affected drivers. - The usual cleanups and improvements. Interrupt chip drivers: - Support for new interrupt chips or not yet supported variants: STM32MP14, Meson GPIO, Apple M1 PMU, Apple M1 AICv2, Qualcomm MPM - Convert the Xilinx driver to generic interrupt domains - Cleanup the irq_chip::name handling - The usual cleanups and improvements all over the place" * tag 'irq-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (52 commits) irqchip: Add Qualcomm MPM controller driver dt-bindings: interrupt-controller: Add Qualcomm MPM support irqchip/apple-aic: Add support for AICv2 irqchip/apple-aic: Support multiple dies irqchip/apple-aic: Dynamically compute register offsets irqchip/apple-aic: Switch to irq_domain_create_tree and sparse hwirqs irqchip/apple-aic: Add Fast IPI support dt-bindings: interrupt-controller: apple,aic2: New binding for AICv2 PCI: apple: Change MSI handling to handle 4-cell AIC fwspec form irqchip/apple-aic: Fix cpumask allocation for FIQs irqchip/meson-gpio: Add support for meson s4 SoCs irqchip/meson-gpio: add select trigger type callback irqchip/meson-gpio: support more than 8 channels gpio irq dt-bindings: interrupt-controller: New binding for Meson-S4 SoCs irqchip/xilinx: Switch to GENERIC_IRQ_MULTI_HANDLER staging: greybus: gpio: Use generic_handle_irq_safe(). net: usb: lan78xx: Use generic_handle_irq_safe(). mfd: ezx-pcap: Use generic_handle_irq_safe(). misc: hi6421-spmi-pmic: Use generic_handle_irq_safe(). irqchip/sifive-plic: Disable S-mode IRQs if running in M-mode ... commit 84c2e17951feeea08a1f3a01e71f8fa82b66332a Merge: bba90e096468 b166e52541f2 Author: Linus Torvalds Date: Mon Mar 21 12:53:14 2022 -0700 Merge tag 'timers-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer and timekeeping updates from Thomas Gleixner: "Core code: - Make the NOHZ handling of the timekeeping/tick core more robust to prevent a rare jiffies update stall. - Handle softirqs in the NOHZ/idle case correctly Drivers: - Add support for event stream scaling of the 1GHz counter on ARM(64) - Correct an error code check in the timer-of layer - The usual cleanups and improvements all over the place" * tag 'timers-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) lib/irq_poll: Declare IRQ_POLL softirq vector as ksoftirqd-parking safe tick/rcu: Stop allowing RCU_SOFTIRQ in idle tick/rcu: Remove obsolete rcu_needs_cpu() parameters tick: Detect and fix jiffies update stall clocksource/drivers/timer-of: Check return value of of_iomap in timer_of_base_init() clocksource/drivers/timer-microchip-pit64b: Use 5MHz for clockevent clocksource/drivers/timer-microchip-pit64b: Use notrace clocksource/drivers/timer-microchip-pit64b: Remove mmio selection dt-bindings: timer: Tegra: Convert text bindings to yaml clocksource/drivers/imx-tpm: Move tpm_read_sched_clock() under CONFIG_ARM clocksource/drivers/arm_arch_timer: Use event stream scaling when available clocksource/drivers/exynos_mct: Increase the size of name array clocksource/drivers/exynos_mct: Bump up mct max irq number clocksource/drivers/exynos_mct: Remove mct interrupt index enum clocksource/drivers/exynos_mct: Handle DTS with higher number of interrupts clocksource/drivers/timer-ti-dm: Fix regression from errata i940 fix clocksource/drivers/imx-tpm: Exclude sched clock for ARM64 clocksource: Add a Kconfig option for WATCHDOG_MAX_SKEW clocksource/drivers/imx-tpm: Update name of clkevt clocksource/drivers/imx-tpm: Add CLOCK_EVT_FEAT_DYNIRQ ... commit bba90e096468a3185649e9ab75873722ae4d6f96 Merge: 3fd33273a467 bf9ad37dc8a3 Author: Linus Torvalds Date: Mon Mar 21 12:37:33 2022 -0700 Merge tag 'core-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull core process handling RT latency updates from Thomas Gleixner: - Reduce the amount of work to release a task stack in context switch. There is no real reason to do cgroup accounting and memory freeing in this performance sensitive context. Aside of this the invoked functions cannot be called from this preemption disabled context on PREEMPT_RT enabled kernels. Solve this by moving the accounting into do_exit() and delaying the freeing of the stack unless the vmap stack can be cached. - Provide a mechanism to delay raising signals from atomic context on PREEMPT_RT enabled kernels as sighand::lock cannot be acquired. Store the information in the task struct and raise it in the exit path. * tag 'core-core-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: signal, x86: Delay calling signals in atomic on RT enabled kernels fork: Use IS_ENABLED() in account_kernel_stack() fork: Only cache the VMAP stack in finish_task_switch() fork: Move task stack accounting to do_exit() fork: Move memcg_charge_kernel_stack() into CONFIG_VMAP_STACK fork: Don't assign the stack pointer in dup_task_struct() fork, IA64: Provide alloc_thread_stack_node() for IA64 fork: Duplicate task_struct before stack allocation fork: Redo ifdefs around task stack handling commit 3fd33273a4675e819544ccbbf8d769e14672666b Merge: eaa54b1458ca 83aa52ffed5d Author: Linus Torvalds Date: Mon Mar 21 12:28:13 2022 -0700 Merge tag 'x86-pasid-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 PASID support from Thomas Gleixner: "Reenable ENQCMD/PASID support: - Simplify the PASID handling to allocate the PASID once, associate it to the mm of a process and free it on mm_exit(). The previous attempt of refcounted PASIDs and dynamic alloc()/free() turned out to be error prone and too complex. The PASID space is 20bits, so the case of resource exhaustion is a pure academic concern. - Populate the PASID MSR on demand via #GP to avoid racy updates via IPIs. - Reenable ENQCMD and let objtool check for the forbidden usage of ENQCMD in the kernel. - Update the documentation for Shared Virtual Addressing accordingly" * tag 'x86-pasid-2022-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Documentation/x86: Update documentation for SVA (Shared Virtual Addressing) tools/objtool: Check for use of the ENQCMD instruction in the kernel x86/cpufeatures: Re-enable ENQCMD x86/traps: Demand-populate PASID MSR via #GP sched: Define and initialize a flag to identify valid PASID in the task x86/fpu: Clear PASID when copying fpstate iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit kernel/fork: Initialize mm's PASID iommu/ioasid: Introduce a helper to check for valid PASIDs mm: Change CONFIG option for mm->pasid field iommu/sva: Rename CONFIG_IOMMU_SVA_LIB to CONFIG_IOMMU_SVA commit 351bdbb6419ca988802882badadc321d384d0254 Author: Sebastian Andrzej Siewior Date: Mon Mar 21 10:22:37 2022 +0100 net: Revert the softirq will run annotation in ____napi_schedule(). The lockdep annotation lockdep_assert_softirq_will_run() expects that either hard or soft interrupts are disabled because both guaranty that the "raised" soft-interrupts will be processed once the context is left. This triggers in flush_smp_call_function_from_idle() but it this case it explicitly calls do_softirq() in case of pending softirqs. Revert the "softirq will run" annotation in ____napi_schedule() and move the check back to __netif_rx() as it was. Keep the IRQ-off assert in ____napi_schedule() because this is always required. Fixes: fbd9a2ceba5c7 ("net: Add lockdep asserts to ____napi_schedule().") Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Jason A. Donenfeld Link: https://lore.kernel.org/r/YjhD3ZKWysyw8rc6@linutronix.de Signed-off-by: Jakub Kicinski include/linux/lockdep.h | 7 ------- net/core/dev.c | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) commit eaa54b1458ca84092e513d554dd6d234245e6bef Merge: 6b9bfb1365f4 d4c9df20a37d Author: Linus Torvalds Date: Mon Mar 21 11:49:16 2022 -0700 Merge tag 'x86_cleanups_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Borislav Petkov: - Remove a misleading message and an unused function * tag 'x86_cleanups_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/nmi: Remove the 'strange power saving mode' hint from unknown NMI handler x86/pat: Remove the unused set_pages_array_wt() function commit 94fa31e99b57ce4a56e93815421566d483186cb4 Merge: acbfab16ccd7 6d3a16d09bfa Author: Vlastimil Babka Date: Mon Mar 21 19:48:49 2022 +0100 Merge branch 'slab/for-5.18/cleanups' into slab/for-linus Non-trivial SLUB code cleanups, notably refactoring of deactivate_slab(). commit acbfab16ccd79937cabd6c60ab0e010e7ced9444 Merge: ffb217a13a2e a485e1dacdb0 Author: Vlastimil Babka Date: Mon Mar 21 19:46:05 2022 +0100 Merge branch 'slab/for-5.18/trivial' into slab/for-linus Trivial slab code changes: - deleting unused parameters and flags - using helper macros and functions - making structures static commit 6b9bfb1365f40f14b1ad908c44dff61672c6404a Merge: 61e2658e37b3 1e8c5971c249 Author: Linus Torvalds Date: Mon Mar 21 11:38:53 2022 -0700 Merge tag 'x86_cc_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 confidential computing updates from Borislav Petkov: - Add shared confidential computing code which will be used by both vendors instead of proliferating home-grown solutions for technologies (SEV/SNP and TDX) which are pretty similar * tag 'x86_cc_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm/cpa: Generalize __set_memory_enc_pgtable() x86/coco: Add API to handle encryption mask x86/coco: Explicitly declare type of confidential computing platform x86/cc: Move arch/x86/{kernel/cc_platform.c => coco/core.c} commit 61e2658e37b3c0c7c82aab84f4cc162e1b90f6ca Merge: 88f30ac22733 6170abb21e23 Author: Linus Torvalds Date: Mon Mar 21 11:37:17 2022 -0700 Merge tag 'x86_sgx_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 SGX updates from Borislav Petkov: - A couple of fixes and improvements to the SGX selftests * tag 'x86_sgx_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: selftests/sgx: Treat CC as one argument selftests/x86: Add validity check and allow field splitting selftests/sgx: Remove extra newlines in test output selftests/sgx: Ensure enclave data available during debug print selftests/sgx: Do not attempt enclave build without valid enclave selftests/sgx: Fix NULL-pointer-dereference upon early test failure commit 88f30ac22733f8cd518e42702042cb1e1c2c08a7 Merge: 35cbdaf75394 5f1170332434 Author: Linus Torvalds Date: Mon Mar 21 11:35:10 2022 -0700 Merge tag 'x86_sev_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 SEV fix from Borislav Petkov: - Add a missing function section annotation * tag 'x86_sev_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/head64: Add missing __head annotation to sme_postprocess_startup() commit 35cbdaf75394e1061a9bd64b4698915c6db58512 Merge: e10821b8a035 2e1f8e55f9e0 Author: Linus Torvalds Date: Mon Mar 21 11:28:24 2022 -0700 Merge tag 'x86_paravirt_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 paravirt improvement from Borislav Petkov: - Shorten CALL insns to pvops by a byte by using rip-relative addressing * tag 'x86_paravirt_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/paravirt: Use %rip-relative addressing in hook calls commit e10821b8a0350530bedcbe725c030ecfe5bd08c2 Merge: 22687350452c 4eda2bc3431e Author: Linus Torvalds Date: Mon Mar 21 11:25:41 2022 -0700 Merge tag 'x86_build_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 Kconfig fix from Borislav Petkov: - Correct Kconfig symbol visibility on x86 * tag 'x86_build_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/Kconfig: Select ARCH_SELECT_MEMORY_MODEL only if FLATMEM and SPARSEMEM are possible commit 3f9a07558f1e3420c9319f39606f06fe3ebc865e Author: Krzysztof Kozlowski Date: Wed Mar 16 14:08:57 2022 +0100 dt-bindings: gpio: pca95xx: drop useless consumer example Consumer examples in the bindings of resource providers are trivial, useless and duplication of code. Remove the example code for consumer Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220316130858.93455-1-krzysztof.kozlowski@canonical.com Documentation/devicetree/bindings/gpio/gpio-pca95xx.yaml | 8 -------- 1 file changed, 8 deletions(-) commit 22687350452c80c8e8d2c62d05c1511902c27f42 Merge: d752e2111465 686016f73242 Author: Linus Torvalds Date: Mon Mar 21 11:19:00 2022 -0700 Merge tag 'x86_misc_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc x86 updates from Borislav Petkov: - Add support for a couple new insn sets to the insn decoder: AVX512-FP16, AMX, other misc insns. - Update VMware-specific MAINTAINERS entries * tag 'x86_misc_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: MAINTAINERS: Mark VMware mailing list entries as email aliases MAINTAINERS: Add Zack as maintainer of vmmouse driver MAINTAINERS: Update maintainers for paravirt ops and VMware hypervisor interface x86/insn: Add AVX512-FP16 instructions to the x86 instruction decoder perf/tests: Add AVX512-FP16 instructions to x86 instruction decoder test x86/insn: Add misc instructions to x86 instruction decoder perf/tests: Add misc instructions to the x86 instruction decoder test x86/insn: Add AMX instructions to the x86 instruction decoder perf/tests: Add AMX instructions to x86 instruction decoder test commit 4d7bca13dd9a5033174b0735056c5658cb893e76 Author: Mike Snitzer Date: Sat Mar 19 18:41:16 2022 -0400 dm: consolidate spinlocks in dm_io struct No reason to have separate startio_lock and endio_lock given endio_lock could be used during submission anyway. This change leaves the dm_io struct weighing in at 256 bytes (down from 272 bytes, so saves a cacheline). Signed-off-by: Mike Snitzer drivers/md/dm-core.h | 3 +-- drivers/md/dm.c | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-) commit bd4a6dd241ae0a0bf36274d61e1a1fbf80b99ecb Author: Mike Snitzer Date: Sat Mar 19 18:29:50 2022 -0400 dm: reduce size of dm_io and dm_target_io structs Signed-off-by: Mike Snitzer drivers/md/dm-core.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 655f3aad7aa4858d06cdaca6c4b14635cc3c0eba Author: Mike Snitzer Date: Sat Mar 19 18:04:20 2022 -0400 dm: switch dm_target_io booleans over to proper flags Add flags to dm_target_io and manage them using the same pattern used for bi_flags in struct bio. Signed-off-by: Mike Snitzer drivers/md/dm-core.h | 21 +++++++++++++++++++-- drivers/md/dm.c | 31 +++++++++++++++++++------------ 2 files changed, 38 insertions(+), 14 deletions(-) commit 82f6cdcc3676c68abaad2aac51a32f4e5d67d01e Author: Mike Snitzer Date: Fri Mar 18 00:15:28 2022 -0400 dm: switch dm_io booleans over to proper flags Add flags to dm_io and manage them using the same pattern used for bi_flags in struct bio. Signed-off-by: Mike Snitzer drivers/md/dm-core.h | 22 ++++++++++++++++++++-- drivers/md/dm.c | 30 ++++++++++++++++++------------ 2 files changed, 38 insertions(+), 14 deletions(-) commit d752e211146586dd654537a8b5282a6cf08a568f Merge: 5e8919170ad6 08f253ec3767 Author: Linus Torvalds Date: Mon Mar 21 11:11:48 2022 -0700 Merge tag 'x86_cpu_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cpu feature updates from Borislav Petkov: - Merge the AMD and Intel PPIN code into a shared one by both vendors. Add the PPIN number to sysfs so that sockets can be identified when replacement is needed - Minor fixes and cleanups * tag 'x86_cpu_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu: Clear SME feature flag when not in use x86/cpufeatures: Put the AMX macros in the word 18 block topology/sysfs: Add PPIN in sysfs under cpu topology topology/sysfs: Add format parameter to macro defining "show" functions for proc x86/cpu: Read/save PPIN MSR during initialization x86/cpu: X86_FEATURE_INTEL_PPIN finally has a CPUID bit x86/cpu: Merge Intel and AMD ppin_init() functions x86/CPU/AMD: Use default_groups in kobj_type commit 5e8919170ad683436a1a1305e1795dc1d56f8906 Merge: 1b74b4600d03 1422df58e5eb Author: Linus Torvalds Date: Mon Mar 21 11:05:04 2022 -0700 Merge tag 'edac_updates_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC updates from Borislav Petkov: - Add support for newer AMD family 0x19, models 0x10-... CPUs to amd64_edac - The usual amount of improvements and fixes * tag 'edac_updates_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/altera: Add SDRAM ECC check for U-Boot EDAC/amd64: Add new register offset support and related changes EDAC/amd64: Set memory type per DIMM EDAC/mc: Remove unnecessary cast to char * in edac_align_ptr() EDAC: Use default_groups in kobj_type EDAC: Use proper list of struct attribute for attributes commit 1b74b4600d0318fd81aceb5a7b7d10432bc2306b Merge: 90ea15b7c972 0d52a01a266b Author: Linus Torvalds Date: Mon Mar 21 11:00:17 2022 -0700 Merge tag 'm68k-for-v5.18-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - Fix frame buffers backed by deferred I/O - defconfig updates - Minor fixes and improvements * tag 'm68k-for-v5.18-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: defconfig: Disable fbdev on Sun3/3x m68k: defconfig: Update defconfigs for v5.17-rc3 m68k: mm: Remove check for VM_IO to fix deferred I/O m68k: Add asm/config.h commit 90ea15b7c9729609116ac513ac48e9a58992bf50 Merge: 356a1adca877 9bc19d473014 Author: Linus Torvalds Date: Mon Mar 21 10:55:18 2022 -0700 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: - amba bus cleanups - conversion to use reserve_initrd_mem() - remove -nostdlib from vdso link * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9181/1: vdso: remove -nostdlib compiler flag ARM: 9175/1: Convert to reserve_initrd_mem() ARM: 9174/1: amba: Move EXPORT_SYMBOL() closer to definition ARM: 9173/1: amba: kill amba_find_match() ARM: 9172/1: amba: Cleanup amba pclk operation commit 356a1adca8774df407e8b6d3929e36da90679c0d Merge: 9d8e7007dc7c 641d80415729 Author: Linus Torvalds Date: Mon Mar 21 10:46:39 2022 -0700 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 updates from Will Deacon: - Support for including MTE tags in ELF coredumps - Instruction encoder updates, including fixes to 64-bit immediate generation and support for the LSE atomic instructions - Improvements to kselftests for MTE and fpsimd - Symbol aliasing and linker script cleanups - Reduce instruction cache maintenance performed for user mappings created using contiguous PTEs - Support for the new "asymmetric" MTE mode, where stores are checked asynchronously but loads are checked synchronously - Support for the latest pointer authentication algorithm ("QARMA3") - Support for the DDR PMU present in the Marvell CN10K platform - Support for the CPU PMU present in the Apple M1 platform - Use the RNDR instruction for arch_get_random_{int,long}() - Update our copy of the Arm optimised string routines for str{n}cmp() - Fix signal frame generation for CPUs which have foolishly elected to avoid building in support for the fpsimd instructions - Workaround for Marvell GICv3 erratum #38545 - Clarification to our Documentation (booting reqs. and MTE prctl()) - Miscellanous cleanups and minor fixes * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (90 commits) docs: sysfs-devices-system-cpu: document "asymm" value for mte_tcf_preferred arm64/mte: Remove asymmetric mode from the prctl() interface arm64: Add cavium_erratum_23154_cpus missing sentinel perf/marvell: Fix !CONFIG_OF build for CN10K DDR PMU driver arm64: mm: Drop 'const' from conditional arm64_dma_phys_limit definition Documentation: vmcoreinfo: Fix htmldocs warning kasan: fix a missing header include of static_keys.h drivers/perf: Add Apple icestorm/firestorm CPU PMU driver drivers/perf: arm_pmu: Handle 47 bit counters arm64: perf: Consistently make all event numbers as 16-bits arm64: perf: Expose some Armv9 common events under sysfs perf/marvell: cn10k DDR perf event core ownership perf/marvell: cn10k DDR perfmon event overflow handling perf/marvell: CN10k DDR performance monitor support dt-bindings: perf: marvell: cn10k ddr performance monitor arm64: clean up tools Makefile perf/arm-cmn: Update watchpoint format perf/arm-cmn: Hide XP PUB events for CMN-600 arm64: drop unused includes of arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones ... commit 9d8e7007dc7c4d7c8366739bbcd3f5e51dcd470f Merge: f443e374ae13 fb5abce6b2bb Author: Linus Torvalds Date: Mon Mar 21 10:26:29 2022 -0700 Merge tag 'tpmdd-next-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull tpm updates from Jarkko Sakkinen: "In order to split the work a bit we've aligned with David Howells more or less that I take more hardware/firmware aligned keyring patches, and he takes care more of the framework aligned patches. For TPM the patches worth of highlighting are the fixes for refcounting provided by Lino Sanfilippo and James Bottomley. Eric B. has done a bunch obvious (but important) fixes but there's one a bit controversial: removal of asym_tpm. It was added in 2018 when TPM1 was already declared as insecure and world had moved on to TPM2. I don't know how this has passed all the filters but I did not have a chance to see the patches when they were out. I simply cannot commit to maintaining this because it was from all angles just wrong to take it in the first place to the mainline kernel. Nobody should use this module really for anything. Finally, there is a new keyring '.machine' to hold MOK keys ('Machine Owner Keys'). In the mok side MokListTrustedRT UEFI variable can be set, from which kernel knows that MOK keys are kernel trusted keys and they are populated to the machine keyring. This keyring linked to the secondary trusted keyring, which means that can be used like any kernel trusted keys. This keyring of course can be used to hold other MOK'ish keys in other platforms in future" * tag 'tpmdd-next-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: (24 commits) tpm: use try_get_ops() in tpm-space.c KEYS: asymmetric: properly validate hash_algo and encoding KEYS: asymmetric: enforce that sig algo matches key algo KEYS: remove support for asym_tpm keys tpm: fix reference counting for struct tpm_chip integrity: Only use machine keyring when uefi_check_trust_mok_keys is true integrity: Trust MOK keys if MokListTrustedRT found efi/mokvar: move up init order KEYS: Introduce link restriction for machine keys KEYS: store reference to machine keyring integrity: add new keyring handler for mok keys integrity: Introduce a Linux keyring called machine integrity: Fix warning about missing prototypes KEYS: trusted: Avoid calling null function trusted_key_exit KEYS: trusted: Fix trusted key backends when building as module tpm: xen-tpmfront: Use struct_size() helper KEYS: x509: remove dead code that set ->unsupported_sig KEYS: x509: remove never-set ->unsupported_key flag KEYS: x509: remove unused fields KEYS: x509: clearly distinguish between key and signature algorithms ... commit 2a3c4bce3edb0d54983384aa8a88c0da330638f4 Author: Miaohe Lin Date: Wed Mar 16 16:15:28 2022 +0800 mm/damon: minor cleanup for damon_pa_young if need_lock is true but folio_trylock fails, we should return false instead of NULL to match the return value type exactly. No functional change intended. Signed-off-by: Miaohe Lin Reviewed-by: SeongJae Park Signed-off-by: Matthew Wilcox (Oracle) mm/damon/paddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 72e725887413f031fa72d27fea5795450bab1940 Author: Matthew Wilcox (Oracle) Date: Sat Jul 24 23:43:58 2021 -0400 selftests/vm/transhuge-stress: Support file-backed PMD folios Add a -f option to test PMD folios on files Signed-off-by: Matthew Wilcox (Oracle) tools/testing/selftests/vm/transhuge-stress.c | 35 ++++++++++++++++++--------- 1 file changed, 24 insertions(+), 11 deletions(-) commit 4687fdbb805a92ce5a9f23042c436dc64fef8b77 Author: Matthew Wilcox (Oracle) Date: Sat Jul 24 23:37:13 2021 -0400 mm/filemap: Support VM_HUGEPAGE for file mappings If the VM_HUGEPAGE flag is set, attempt to allocate PMD-sized folios during readahead, even if we have no history of readahead being successful. Signed-off-by: Matthew Wilcox (Oracle) mm/filemap.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) commit 56a4d67c264e37014b8392cba9869c7fe904ed1e Author: Matthew Wilcox (Oracle) Date: Sat Jul 24 23:26:14 2021 -0400 mm/readahead: Switch to page_cache_ra_order do_page_cache_ra() was being exposed for the benefit of do_sync_mmap_readahead(). Switch it over to page_cache_ra_order() partly because it's a better interface but mostly for the benefit of the next patch. Signed-off-by: Matthew Wilcox (Oracle) mm/filemap.c | 2 +- mm/internal.h | 4 ++-- mm/readahead.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) commit 1854bc6e2420472676c5c90d3d6b15f6cd640e40 Author: William Kucharski Date: Sun Sep 22 08:43:15 2019 -0400 mm/readahead: Align file mappings for non-DAX When we have the opportunity to use PMDs to map a file, we want to follow the same rules as DAX. Signed-off-by: William Kucharski Signed-off-by: Matthew Wilcox (Oracle) mm/huge_memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 793917d997df2e432f3e9ac126e4482d68256d01 Author: Matthew Wilcox (Oracle) Date: Wed Feb 5 11:27:01 2020 -0500 mm/readahead: Add large folio readahead Allocate large folios in the readahead code when the filesystem supports them and it seems worth doing. The heuristic for choosing which folio sizes will surely need some tuning, but this aggressive ramp-up has been good for testing. Signed-off-by: Matthew Wilcox (Oracle) mm/readahead.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 99 insertions(+), 7 deletions(-) commit 18788cfa236967741b83db1035ab24539e2a21bb Author: Matthew Wilcox (Oracle) Date: Fri May 29 20:54:38 2020 -0400 mm: Support arbitrary THP sizes For code which has not yet been converted from THP to folios, use the compound size of the page instead of assuming PTE or PMD size. Signed-off-by: Matthew Wilcox (Oracle) include/linux/huge_mm.h | 47 ----------------------------------------------- include/linux/mm.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 47 deletions(-) commit 421f1ab48452af48b64e205de1caca3d1ba415f4 Author: Matthew Wilcox (Oracle) Date: Sat Jan 15 23:27:08 2022 -0500 mm: Make large folios depend on THP Some parts of the VM still depend on THP to handle large folios correctly. Until those are fixed, prevent creating large folios if THP are disabled. Signed-off-by: Matthew Wilcox (Oracle) include/linux/pagemap.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 06d44142d49dc2e02d255ea9d72dc4c20f20388f Author: Matthew Wilcox (Oracle) Date: Sat Oct 10 11:47:55 2020 -0400 mm: Fix READ_ONLY_THP warning These counters only exist if CONFIG_READ_ONLY_THP_FOR_FS is defined, but we do not need to warn if the filesystem natively supports large folios. Signed-off-by: Matthew Wilcox (Oracle) include/linux/pagemap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit d68eccad370665830e16e5c77611fde78cd749b3 Author: Matthew Wilcox (Oracle) Date: Thu Sep 5 14:03:12 2019 -0400 mm/filemap: Allow large folios to be added to the page cache We return -EEXIST if there are any non-shadow entries in the page cache in the range covered by the folio. If there are multiple shadow entries in the range, we set *shadowp to one of them (currently the one at the highest index). If that turns out to be the wrong answer, we can implement something more complex. This is mostly modelled after the equivalent function in the shmem code. Signed-off-by: Matthew Wilcox (Oracle) mm/filemap.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) commit d4b4084ac3154c51ff5fa71f669264cc44429be2 Author: Matthew Wilcox (Oracle) Date: Fri Feb 4 14:13:31 2022 -0500 mm: Turn can_split_huge_page() into can_split_folio() This function already required a head page to be passed, so this just adds type-safety and removes a few implicit calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) include/linux/huge_mm.h | 4 ++-- mm/huge_memory.c | 15 ++++++++------- mm/vmscan.c | 6 +++--- 3 files changed, 13 insertions(+), 12 deletions(-) commit e0cd5e7ffa549487cf1a85452f371274cbf0a8f1 Author: Matthew Wilcox (Oracle) Date: Mon Jan 17 23:35:57 2022 -0500 mm/vmscan: Convert pageout() to take a folio We always write out an entire folio at once. This conversion removes a few calls to compound_head() and gets the NR_VMSCAN_WRITE statistic right when writing out a large folio. Signed-off-by: Matthew Wilcox (Oracle) include/trace/events/vmscan.h | 10 +++---- mm/vmscan.c | 64 +++++++++++++++++++++---------------------- 2 files changed, 37 insertions(+), 37 deletions(-) commit d92013d1e5e47fefd02be6920f8470b95b37ce7d Author: Matthew Wilcox (Oracle) Date: Tue Feb 15 13:44:40 2022 -0500 mm/vmscan: Turn page_check_references() into folio_check_references() This function only has one caller, and it already has a folio. This removes a number of calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) mm/vmscan.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) commit c79b7b96db8b1240887686720cd149f2c5d979d6 Author: Matthew Wilcox (Oracle) Date: Mon Jan 17 14:46:55 2022 -0500 mm/vmscan: Account large folios correctly The statistics we gather should count the number of pages, not the number of folios. The logic in this function is somewhat convoluted, but even if we split the folio, I think the accounting is now correct. Signed-off-by: Matthew Wilcox (Oracle) mm/vmscan.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 343b288834e84d0b175b20b4f48277bc33260986 Author: Matthew Wilcox (Oracle) Date: Sat Aug 15 19:28:51 2020 -0400 mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios A large folio which is smaller than a PMD does not need to do the extra work in try_to_unmap() of trying to split a PMD entry. Signed-off-by: Matthew Wilcox (Oracle) mm/vmscan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 820c4e2e6f517e4c0cee703265e275e3a08992e6 Author: Matthew Wilcox (Oracle) Date: Wed Sep 30 16:15:46 2020 -0400 mm/vmscan: Free non-shmem folios without splitting them We have to allocate memory in order to split a file-backed folio, so it's not a good idea to split them in the memory freeing path. It also doesn't work for XFS because pages have an extra reference count from page_has_private() and split_huge_page() expects that reference to have already been removed. Unfortunately, we still have to split shmem THPs because we can't handle swapping out an entire THP yet. Signed-off-by: Matthew Wilcox (Oracle) mm/vmscan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 84fbbe21894bb9be8e16df408cbfbb9466fe396d Author: Matthew Wilcox (Oracle) Date: Sat Jan 29 16:16:54 2022 -0500 mm/rmap: Constify the rmap_walk_control argument The rmap walking functions do not modify the rmap_walk_control, and page_idle_clear_pte_refs() takes advantage of that to move construction of the rmap_walk_control to compile time. This lets us remove an unclean cast. Signed-off-by: Matthew Wilcox (Oracle) include/linux/ksm.h | 4 ++-- include/linux/rmap.h | 4 ++-- mm/ksm.c | 2 +- mm/page_idle.c | 2 +- mm/rmap.c | 14 +++++++------- 5 files changed, 13 insertions(+), 13 deletions(-) commit 2f031c6f042cb8a9b221a8b6b80e69de5170f830 Author: Matthew Wilcox (Oracle) Date: Sat Jan 29 16:06:53 2022 -0500 mm/rmap: Convert rmap_walk() to take a folio This ripples all the way through to every calling and called function from rmap. Signed-off-by: Matthew Wilcox (Oracle) include/linux/ksm.h | 4 +- include/linux/rmap.h | 11 +++-- mm/damon/paddr.c | 15 ++++--- mm/folio-compat.c | 7 ---- mm/huge_memory.c | 2 +- mm/ksm.c | 12 +++--- mm/migrate.c | 10 ++--- mm/page_idle.c | 7 ++-- mm/rmap.c | 111 ++++++++++++++++++++++++--------------------------- 9 files changed, 80 insertions(+), 99 deletions(-) commit e05b34539d008ab819388f699b25eae962ba24ac Author: Matthew Wilcox (Oracle) Date: Sat Jan 29 11:52:52 2022 -0500 mm: Turn page_anon_vma() into folio_anon_vma() Move the prototype from mm.h to mm/internal.h and convert all callers to pass a folio. Signed-off-by: Matthew Wilcox (Oracle) include/linux/mm.h | 1 - mm/internal.h | 1 + mm/ksm.c | 3 ++- mm/rmap.c | 19 ++++++++++++------- mm/util.c | 3 +-- 5 files changed, 16 insertions(+), 11 deletions(-) commit 9595d76942b8714627d670a7e7ae543812c731ae Author: Matthew Wilcox (Oracle) Date: Tue Feb 1 23:33:08 2022 -0500 mm/rmap: Turn page_lock_anon_vma_read() into folio_lock_anon_vma_read() Add back page_lock_anon_vma_read() as a wrapper. This saves a few calls to compound_head(). If any callers were passing a tail page before, this would have failed to lock the anon VMA as page->mapping is not valid for tail pages. Signed-off-by: Matthew Wilcox (Oracle) include/linux/rmap.h | 1 + mm/folio-compat.c | 7 +++++++ mm/memory-failure.c | 3 ++- mm/rmap.c | 12 ++++++------ 4 files changed, 16 insertions(+), 7 deletions(-) commit c8423186078312d344474bcb9e2b1ce0a78dbde4 Author: Matthew Wilcox (Oracle) Date: Sat Jan 29 10:46:04 2022 -0500 mm/damon: Convert damon_pa_young() to use a folio Ensure that we're passing the entire folio to rmap_walk(). Signed-off-by: Matthew Wilcox (Oracle) mm/damon/paddr.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) commit 6d42dba3ccf326551f6e413fb497c31e8812b98f Author: Matthew Wilcox (Oracle) Date: Sat Jan 29 10:46:04 2022 -0500 mm/damon: Convert damon_pa_mkold() to use a folio Ensure that we're passing the entire folio to rmap_walk(). Signed-off-by: Matthew Wilcox (Oracle) mm/damon/paddr.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) commit 4eecb8b9163df82c87c91764a02fff228ef25f6d Author: Matthew Wilcox (Oracle) Date: Fri Jan 28 23:32:59 2022 -0500 mm/migrate: Convert remove_migration_ptes() to folios Convert the implementation and all callers. Signed-off-by: Matthew Wilcox (Oracle) include/linux/rmap.h | 2 +- mm/huge_memory.c | 24 ++++++++++++----------- mm/migrate.c | 55 ++++++++++++++++++++++++++++------------------------ mm/migrate_device.c | 15 +++++++++----- 4 files changed, 54 insertions(+), 42 deletions(-) commit 0d2514859ceda3cc42386f819d3131f782fd69d5 Author: Matthew Wilcox (Oracle) Date: Fri Jan 28 16:03:42 2022 -0500 mm/rmap: Convert make_device_exclusive_range() to use folios Move the PageTail check earlier so we can avoid even taking the folio lock on tail pages. Otherwise, this is a straightforward use of folios throughout. Signed-off-by: Matthew Wilcox (Oracle) mm/rmap.c | 58 +++++++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) commit 4b8554c527f3cfa183f6c06d231a9387873205a0 Author: Matthew Wilcox (Oracle) Date: Fri Jan 28 14:29:43 2022 -0500 mm/rmap: Convert try_to_migrate() to folios Convert the callers to pass a folio and the try_to_migrate_one() worker to use a folio throughout. Fixes an assumption that a folio must be <= PMD size. Signed-off-by: Matthew Wilcox (Oracle) include/linux/rmap.h | 2 +- mm/huge_memory.c | 4 ++-- mm/migrate.c | 6 ++++-- mm/migrate_device.c | 6 ++++-- mm/rmap.c | 59 +++++++++++++++++++++++++++------------------------- 5 files changed, 42 insertions(+), 35 deletions(-) commit 869f7ee6f6477341f859c8b0949ae81caf9ca7f3 Author: Matthew Wilcox (Oracle) Date: Tue Feb 15 09:28:49 2022 -0500 mm/rmap: Convert try_to_unmap() to take a folio Change all three callers and the worker function try_to_unmap_one(). Signed-off-by: Matthew Wilcox (Oracle) include/linux/rmap.h | 4 +-- mm/huge_memory.c | 3 +- mm/khugepaged.c | 3 +- mm/memory-failure.c | 7 +++-- mm/memory_hotplug.c | 13 ++++---- mm/rmap.c | 83 +++++++++++++++++++++++++++------------------------- mm/vmscan.c | 2 +- 7 files changed, 62 insertions(+), 53 deletions(-) commit af28a988b313a601c12c410a42e485ca46adcfee Author: Matthew Wilcox (Oracle) Date: Fri Jan 21 10:44:52 2022 -0500 mm/huge_memory: Convert __split_huge_pmd() to take a folio Convert split_huge_pmd_address() at the same time since it only passes the folio through, and its two callers already have a folio on hand. Removes numerous calls to compound_head() and removes an assumption that a page cannot be larger than a PMD. Signed-off-by: Matthew Wilcox (Oracle) include/linux/huge_mm.h | 8 ++++---- mm/huge_memory.c | 46 +++++++++++++++++++++++----------------------- mm/rmap.c | 6 ++++-- 3 files changed, 31 insertions(+), 29 deletions(-) commit b3ac04132c4b9bc5c9c14608424d410e7ca3b400 Author: Matthew Wilcox (Oracle) Date: Fri Jan 21 11:27:31 2022 -0500 mm/rmap: Turn page_referenced() into folio_referenced() Both its callers pass a page which was previously on an LRU list, so were passing a folio by definition. Use the type system to enforce that and remove a few calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig include/linux/rmap.h | 4 +-- mm/page_idle.c | 2 +- mm/rmap.c | 70 ++++++++++++++++++++++++++-------------------------- mm/vmscan.c | 20 +++++++++------ 4 files changed, 50 insertions(+), 46 deletions(-) commit dcc5d337c5e62761ee71f2e25c7aa890b1aa41a2 Author: Matthew Wilcox (Oracle) Date: Tue Feb 15 13:33:59 2022 -0500 mm/mlock: Add mlock_vma_folio() Convert mlock_page() into mlock_folio() and convert the callers. Keep mlock_vma_page() as a wrapper. Signed-off-by: Matthew Wilcox (Oracle) mm/internal.h | 15 +++++++++++---- mm/mlock.c | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 15 deletions(-) commit e83c09a24e3d229f84163c119224af4c8f6c54c1 Author: Matthew Wilcox (Oracle) Date: Thu Jan 20 18:20:07 2022 -0500 mm/rmap: Use a folio in page_mkclean_one() folio_mkclean() already passes down a head page, so convert it back to a folio. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig mm/rmap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 4aed23a2f8aaaafad0232d3392afcf493c3c3df3 Author: Matthew Wilcox (Oracle) Date: Sat Jan 29 15:53:59 2022 -0500 mm/page_idle: Convert page_idle_clear_pte_refs() to use a folio The PG_idle and PG_young bits are ignored if they're set on tail pages, so ensure we're passing a folio around. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig mm/page_idle.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) commit 2aff7a4755bed2870ee23b75bc88cdc8d76cdd03 Author: Matthew Wilcox (Oracle) Date: Thu Feb 3 11:40:17 2022 -0500 mm: Convert page_vma_mapped_walk to work on PFNs page_mapped_in_vma() really just wants to walk one page, but as the code stands, if passed the head page of a compound page, it will walk every page in the compound page. Extract pfn/nr_pages/pgoff from the struct page early, so they can be overridden by page_mapped_in_vma(). Signed-off-by: Matthew Wilcox (Oracle) include/linux/hugetlb.h | 5 +++++ include/linux/rmap.h | 17 ++++++++++----- mm/internal.h | 15 ++++++++----- mm/migrate.c | 5 +++-- mm/page_vma_mapped.c | 58 ++++++++++++++++++++++--------------------------- mm/rmap.c | 8 +++---- 6 files changed, 58 insertions(+), 50 deletions(-) commit aef13dec0a5fa3c4adc8949307fc8d8aac7337df Author: Matthew Wilcox (Oracle) Date: Tue Feb 15 17:50:17 2022 -0500 sparc32: Add pmd_pfn() We need to use this function in common code; pull it out of pmd_page(). Signed-off-by: Matthew Wilcox (Oracle) arch/sparc/include/asm/pgtable_32.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 9e996c2115e1b52e235261121f7c9c121262dda9 Author: Matthew Wilcox (Oracle) Date: Mon Feb 14 10:30:07 2022 -0500 powerpc: Add pmd_pfn() This is straightforward for everything except nohash64 where we indirect through pmd_page(). There must be a better way to do this. Signed-off-by: Matthew Wilcox (Oracle) arch/powerpc/include/asm/book3s/32/pgtable.h | 4 ++-- arch/powerpc/include/asm/nohash/32/pgtable.h | 7 +++---- arch/powerpc/include/asm/nohash/64/pgtable.h | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) commit 177bd2a9543fa057b9ff1fa35c65f35a0150c65f Author: Matthew Wilcox (Oracle) Date: Mon Feb 14 09:59:11 2022 -0500 mips: Make pmd_pfn() available in all configurations Whether or not the platform supports PMD sized pages, we need to provide pmd_pfn() for an upcoming patch. Signed-off-by: Matthew Wilcox (Oracle) arch/mips/include/asm/pgtable.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 7106c51ee9a1b65eff63496636fce36bf246c1a0 Author: Mike Rapoport Date: Fri Feb 4 13:49:20 2022 -0500 arch: Add pmd_pfn() where it is missing We need to use this function in common code, so define it for architectures and/or configrations that miss it. The result of pmd_pfn() will only be used if TRANSPARENT_HUGEPAGE is enabled, but a function or macro called pmd_pfn() must be defined, even on machines with two level page tables. Signed-off-by: Mike Rapoport Signed-off-by: Matthew Wilcox (Oracle) arch/alpha/include/asm/pgtable.h | 1 + arch/arc/include/asm/hugepage.h | 1 - arch/arc/include/asm/pgtable-levels.h | 1 + arch/arm/include/asm/pgtable-2level.h | 2 ++ arch/csky/include/asm/pgtable.h | 1 + arch/hexagon/include/asm/pgtable.h | 5 +++++ arch/ia64/include/asm/pgtable.h | 1 + arch/m68k/include/asm/mcf_pgtable.h | 1 + arch/m68k/include/asm/motorola_pgtable.h | 1 + arch/m68k/include/asm/sun3_pgtable.h | 1 + arch/microblaze/include/asm/pgtable.h | 3 +++ arch/nds32/include/asm/pgtable.h | 1 + arch/nios2/include/asm/pgtable.h | 1 + arch/openrisc/include/asm/pgtable.h | 1 + arch/parisc/include/asm/pgtable.h | 1 + arch/sh/include/asm/pgtable_32.h | 1 + arch/um/include/asm/pgtable.h | 1 + arch/xtensa/include/asm/pgtable.h | 1 + 18 files changed, 24 insertions(+), 1 deletion(-) commit eed05e54d275b3cfc5d8c79843c5276a5878e94a Author: Matthew Wilcox (Oracle) Date: Thu Feb 3 09:06:08 2022 -0500 mm: Add DEFINE_PAGE_VMA_WALK and DEFINE_FOLIO_VMA_WALK Instead of declaring a struct page_vma_mapped_walk directly, use these helpers to allow us to transition to a PFN approach in the following patches. Signed-off-by: Matthew Wilcox (Oracle) include/linux/rmap.h | 16 ++++++++++++++++ kernel/events/uprobes.c | 6 +----- mm/damon/paddr.c | 12 ++---------- mm/ksm.c | 5 +---- mm/migrate.c | 7 +------ mm/page_idle.c | 6 +----- mm/rmap.c | 31 +++++-------------------------- 7 files changed, 27 insertions(+), 56 deletions(-) commit f087b903fc2e4975bff9742a66ee7a837a2f545b Author: Matthew Wilcox (Oracle) Date: Wed Feb 2 23:29:45 2022 -0500 mm: Add folio_pgoff() This is the folio equivalent of page_to_pgoff(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig include/linux/pagemap.h | 11 +++++++++++ 1 file changed, 11 insertions(+) commit 346cf61311f6e348337e95aa2febe29e86137f42 Author: Matthew Wilcox (Oracle) Date: Tue Jan 18 08:56:47 2022 -0500 mm: Add split_folio_to_list() This is a convenience function; split_huge_page_to_list() can take any page in a folio (and does so on purpose because that page will be the one which keeps the refcount). But it's convenient for the callers to pass the folio instead of the first page in the folio. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig include/linux/huge_mm.h | 6 ++++++ mm/vmscan.c | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) commit 4ba1119cd53166d853050ff1a9d76079cd8f8e06 Author: Matthew Wilcox (Oracle) Date: Mon Jan 17 16:33:26 2022 -0500 mm: Add folio_mapcount() This implements the same algorithm as total_mapcount(), which is transformed into a wrapper function. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig include/linux/mm.h | 8 +++++++- mm/huge_memory.c | 24 ------------------------ mm/util.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 25 deletions(-) commit 74e8ee4708a8edabbbc7ab8c12ec24d7a561bb41 Author: Matthew Wilcox (Oracle) Date: Tue Jan 18 10:50:48 2022 -0500 mm: Turn head_compound_mapcount() into folio_entire_mapcount() Adjust documentation to be more clear. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig include/linux/mm.h | 17 +++++++++++------ mm/debug.c | 6 ++++-- 2 files changed, 15 insertions(+), 8 deletions(-) commit e20c41b1091a24dff7ad4cfd99cd5a4f527fe3c4 Author: Matthew Wilcox (Oracle) Date: Mon Jan 17 14:35:22 2022 -0500 mm/vmscan: Turn page_check_dirty_writeback() into folio_check_dirty_writeback() Saves a few calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig mm/vmscan.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit cbcc268bb1ce5b539e7652d398e08e9b83dc4cef Author: Matthew Wilcox (Oracle) Date: Sun Feb 13 17:23:58 2022 -0500 fs: Move many prototypes to pagemap.h These functions are page cache functionality and don't need to be declared in fs.h. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Miaohe Lin drivers/block/xen-blkback/xenbus.c | 1 + drivers/usb/gadget/function/f_mass_storage.c | 1 + fs/coda/file.c | 1 + fs/iomap/fiemap.c | 1 + fs/nfsd/filecache.c | 1 + fs/nfsd/vfs.c | 1 + fs/vboxsf/utils.c | 1 + include/linux/fs.h | 116 --------------------------- include/linux/pagemap.h | 114 ++++++++++++++++++++++++++ 9 files changed, 121 insertions(+), 116 deletions(-) commit c56109dd35c9204cd6c49d2116ef36e5044ef867 Author: Matthew Wilcox (Oracle) Date: Sun Feb 13 17:22:10 2022 -0500 mm/truncate: Combine invalidate_mapping_pagevec() and __invalidate_mapping_pages() We can save a function call by combining these two functions, which are identical except for the return value. Also move the prototype to mm/internal.h. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Miaohe Lin include/linux/fs.h | 4 ---- mm/internal.h | 2 ++ mm/truncate.c | 32 +++++++++++++------------------- 3 files changed, 15 insertions(+), 23 deletions(-) commit 261b6840ed10419ac2f554e515592d59dd5c82cf Author: Matthew Wilcox (Oracle) Date: Sun Feb 13 16:40:24 2022 -0500 mm: Turn deactivate_file_page() into deactivate_file_folio() This function has one caller which already has a reference to the page, so we don't need to use get_page_unless_zero(). Also move the prototype to mm/internal.h. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Miaohe Lin include/linux/swap.h | 1 - mm/internal.h | 1 + mm/swap.c | 35 ++++++++++++++++++----------------- mm/truncate.c | 2 +- 4 files changed, 20 insertions(+), 19 deletions(-) commit b4545f46533b7e69cb20e05c9fe987be76e1a3da Author: Matthew Wilcox (Oracle) Date: Sun Feb 13 16:38:07 2022 -0500 mm/truncate: Convert __invalidate_mapping_pages() to use a folio Now we can call mapping_evict_folio() instead of invalidate_inode_page() and save a few calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Miaohe Lin mm/truncate.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit d6c75dc22c755c567838f12f12a16f2a323ebd4e Author: Matthew Wilcox (Oracle) Date: Sun Feb 13 15:22:28 2022 -0500 mm/truncate: Split invalidate_inode_page() into mapping_evict_folio() Some of the callers already have the address_space and can avoid calling folio_mapping() and checking if the folio was already truncated. Also add kernel-doc and fix the return type (in case we ever support folios larger than 4TB). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Miaohe Lin include/linux/mm.h | 1 - mm/internal.h | 1 + mm/memory-failure.c | 4 ++-- mm/truncate.c | 34 +++++++++++++++++++++++----------- 4 files changed, 26 insertions(+), 14 deletions(-) commit 5100da38ef3c33d9ad8b60b29c2b671249bf7e1d Author: Matthew Wilcox (Oracle) Date: Sat Feb 12 22:48:55 2022 -0500 mm: Convert remove_mapping() to take a folio Add kernel-doc and return the number of pages removed in order to get the statistics right in __invalidate_mapping_pages(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Miaohe Lin fs/splice.c | 5 ++--- include/linux/swap.h | 2 +- mm/truncate.c | 2 +- mm/vmscan.c | 23 ++++++++++++++--------- 4 files changed, 18 insertions(+), 14 deletions(-) commit e41c81d0d30e1a6ebf408feaf561f80cac4457dc Author: Matthew Wilcox (Oracle) Date: Sat Feb 12 17:43:16 2022 -0500 mm/truncate: Replace page_mapped() call in invalidate_inode_page() folio_mapped() is expensive because it has to check each page's mapcount field. A cheaper check is whether there are any extra references to the page, other than the one we own, one from the page private data and the ones held by the page cache. The call to remove_mapping() will fail in any case if it cannot freeze the refcount, but failing here avoids cycling the i_pages spinlock. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Miaohe Lin mm/truncate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 4418481396b2caeded6d0eed11ac9052ab4c0763 Author: Matthew Wilcox (Oracle) Date: Sat Feb 12 17:39:10 2022 -0500 mm/truncate: Convert invalidate_inode_page() to use a folio This saves a number of calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Miaohe Lin mm/truncate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 1b8ddbeeb9b819e62b7190115023ce858a159f5c Author: Matthew Wilcox (Oracle) Date: Sat Feb 12 15:27:42 2022 -0500 mm/truncate: Inline invalidate_complete_page() into its one caller invalidate_inode_page() is the only caller of invalidate_complete_page() and inlining it reveals that the first check is unnecessary (because we hold the page locked, and we just retrieved the mapping from the page). Actually, it does make a difference, in that tail pages no longer fail at this check, so it's now possible to remove a tail page from a mapping. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig kernel/futex/core.c | 2 +- mm/truncate.c | 28 +++++----------------------- 2 files changed, 6 insertions(+), 24 deletions(-) commit b9ccad2e5d385ceaa19b5c05cf69a09de02eb35a Author: Matthew Wilcox (Oracle) Date: Fri Feb 11 23:39:03 2022 -0500 splice: Use a folio in page_cache_pipe_buf_try_steal() This saves a lot of calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Miaohe Lin fs/splice.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) commit be7c07d60e13ac1c3611de93be2e866af8e635d7 Author: Matthew Wilcox (Oracle) Date: Thu Dec 23 16:50:23 2021 -0500 mm/vmscan: Convert __remove_mapping() to take a folio This removes a few hidden calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig mm/vmscan.c | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) commit ca6d60f3f18b78d37b7a93262108ade0727d1441 Author: Matthew Wilcox (Oracle) Date: Fri Jan 21 08:41:46 2022 -0500 mm: Turn putback_lru_page() into folio_putback_lru() Add a putback_lru_page() wrapper. Removes a couple of compound_head() calls. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig mm/folio-compat.c | 5 +++++ mm/internal.h | 3 ++- mm/vmscan.c | 16 ++++++++-------- 3 files changed, 15 insertions(+), 9 deletions(-) commit 06d20bdb986815a75fb1addf34655756ba922e3a Author: Matthew Wilcox (Oracle) Date: Mon Jan 17 14:40:12 2022 -0500 mm: Add lru_to_folio() Since page->lru occupies the same bytes as compound_head, any page on the LRU list must be a folio. Signed-off-by: Matthew Wilcox (Oracle) include/linux/mm.h | 4 ++++ 1 file changed, 4 insertions(+) commit 3ecb0087ecee6213544a1e0b838826a0f4831ce5 Author: Matthew Wilcox (Oracle) Date: Mon Dec 27 21:11:34 2021 -0500 mm/memcg: Convert mem_cgroup_swapout() to take a folio This removes an assumption that THPs are the only kind of compound pages and removes a couple of hidden calls to compound_head. It also documents that you can't pass a tail page to mem_cgroup_swapout(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig include/linux/swap.h | 4 ++-- mm/memcontrol.c | 22 +++++++++++----------- mm/vmscan.c | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) commit 8927f6473e56e32e328ae8ed43736412f7f76a4e Author: Matthew Wilcox (Oracle) Date: Thu Dec 23 16:39:05 2021 -0500 mm/workingset: Convert workingset_eviction() to take a folio This removes an assumption that THPs are the only kind of compound pages and removes a few hidden calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig include/linux/swap.h | 2 +- mm/vmscan.c | 7 ++++--- mm/workingset.c | 25 +++++++++++++------------ 3 files changed, 18 insertions(+), 16 deletions(-) commit 1b7f7e58decccb52d6bc454413e3298f1ab3a9c6 Author: Matthew Wilcox (Oracle) Date: Thu Feb 17 12:46:35 2022 -0500 mm/gup: Convert check_and_migrate_movable_pages() to use a folio Switch from head pages to folios. This removes an assumption that THPs are the only way to have a high-order page. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) commit 536939ff516382b391a0039262e27fc80c7b3924 Author: Matthew Wilcox (Oracle) Date: Mon Mar 21 12:57:38 2022 -0400 mm: Add three folio wrappers folio_is_zone_device() is equivalent to is_zone_device_page(), folio_is_device_private() is equivalent to is_device_private_page(), and folio_is_pinnable() is equivalent to is_pinnable_page(). All of these tests return the same result for every page in the folio, so we can just pass the head page of the folio to the page variant of the function. Signed-off-by: Matthew Wilcox (Oracle) include/linux/memremap.h | 5 +++++ include/linux/mm.h | 10 ++++++++++ 2 files changed, 15 insertions(+) commit d1d8a3b4d06d8c9188f2b9b89ef053db0bf899de Author: Matthew Wilcox (Oracle) Date: Fri Dec 24 13:26:22 2021 -0500 mm: Turn isolate_lru_page() into folio_isolate_lru() Add isolate_lru_page() as a wrapper around isolate_lru_folio(). TestClearPageLRU() would have always failed on a tail page, so returning -EBUSY is the same behaviour. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski arch/powerpc/include/asm/mmu_context.h | 1 - mm/folio-compat.c | 8 +++++++ mm/internal.h | 3 ++- mm/vmscan.c | 43 +++++++++++++++------------------- 4 files changed, 29 insertions(+), 26 deletions(-) commit 659508f9c936aa6e3aaf6e9cf6a4a8836b8f8355 Author: Matthew Wilcox (Oracle) Date: Thu Dec 23 10:20:12 2021 -0500 mm/gup: Turn compound_range_next() into gup_folio_range_next() Convert the only caller to work on folios instead of pages. This removes the last caller of put_compound_head(), so delete it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski include/linux/mm.h | 4 ++-- mm/gup.c | 38 +++++++++++++++++--------------------- 2 files changed, 19 insertions(+), 23 deletions(-) commit 12521c7606b2037f8ac2a2fab19e955444a549cf Author: Matthew Wilcox (Oracle) Date: Wed Dec 22 23:43:16 2021 -0500 mm/gup: Turn compound_next() into gup_folio_next() Convert both callers to work on folios instead of pages. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) commit 2d7919a29275dbb9bc3b6e6b4ea015a1eefc463f Author: Matthew Wilcox (Oracle) Date: Wed Dec 22 22:30:29 2021 -0500 mm/gup: Convert gup_huge_pgd() to use a folio Use the new folio-based APIs. This was the last user of try_grab_compound_head(), so remove it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) commit 83afb52e47d5e31c7d58c07a6d31c43b5ef421a0 Author: Matthew Wilcox (Oracle) Date: Wed Dec 22 18:07:47 2021 -0500 mm/gup: Convert gup_huge_pud() to use a folio Use the new folio-based APIs. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit 667ed1f7bb3b1c1ec2512e64cec04a07df7c5068 Author: Matthew Wilcox (Oracle) Date: Wed Dec 22 16:57:23 2021 -0500 mm/gup: Convert gup_huge_pmd() to use a folio Use the new folio-based APIs. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit 09a1626effb89dddcde10c10f5e3c5e6f8b94136 Author: Matthew Wilcox (Oracle) Date: Wed Dec 22 16:38:30 2021 -0500 mm/gup: Convert gup_hugepte() to use a folio There should be little to no effect from this patch; just removing uses of some old APIs. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit b0496fe4effd83ef76c7440befb184f922b3ffbb Author: Matthew Wilcox (Oracle) Date: Fri Dec 10 15:54:11 2021 -0500 mm/gup: Convert gup_pte_range() to use a folio We still call try_grab_folio() once per PTE; a future patch could optimise to just adjust the reference count for each page within the folio. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) commit 822951d84684d7a0c4f45e7231c960e7fe786d8f Author: Matthew Wilcox (Oracle) Date: Sat Jan 8 00:15:04 2022 -0500 mm/hugetlb: Use try_grab_folio() instead of try_grab_compound_head() follow_hugetlb_page() only cares about success or failure, so it doesn't need to know the type of the returned pointer, only whether it's NULL or not. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski include/linux/mm.h | 3 --- mm/gup.c | 2 +- mm/hugetlb.c | 7 +++---- 3 files changed, 4 insertions(+), 8 deletions(-) commit d8ddc099c6b3dde887f9484da9a6677709d68b61 Author: Matthew Wilcox (Oracle) Date: Fri Dec 10 15:39:04 2021 -0500 mm/gup: Add gup_put_folio() Convert put_compound_head() to gup_put_folio() and hpage_pincount_sub() to folio_pincount_sub(). This removes the last call to put_page_refs(), so delete it. Add a temporary put_compound_head() wrapper which will be deleted by the end of this series. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) commit 40fcc7fc2c3838f3afe07a3a72709b45566e6cdb Author: Matthew Wilcox (Oracle) Date: Wed Dec 29 12:23:55 2021 -0500 mm: Remove page_cache_add_speculative() and page_cache_get_speculative() These wrappers have no more callers, so delete them. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski include/linux/mm.h | 7 +++---- include/linux/pagemap.h | 10 ---------- 2 files changed, 3 insertions(+), 14 deletions(-) commit 5fec0719908bdabdf9d017b0f488d18019ed00f7 Author: Matthew Wilcox (Oracle) Date: Fri Feb 4 10:32:01 2022 -0500 mm/gup: Convert try_grab_page() to use a folio Hoist the folio conversion and the folio_ref_count() check to the top of the function instead of using the one buried in try_get_page(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig mm/gup.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) commit ece1ed7bfa1208b527b3dc90bb45c55e0d139a88 Author: Matthew Wilcox (Oracle) Date: Fri Feb 4 10:27:40 2022 -0500 mm/gup: Add try_get_folio() and try_grab_folio() Convert try_get_compound_head() into try_get_folio() and convert try_grab_compound_head() into try_grab_folio(). Add a temporary try_grab_compound_head() wrapper around try_grab_folio() to let us convert callers individually. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 99 +++++++++++++++++++++++++++++------------------------------ mm/internal.h | 5 +++ 2 files changed, 54 insertions(+), 50 deletions(-) commit 0b90ddae13441c43a30d2e2689b8193a81891c92 Author: Matthew Wilcox (Oracle) Date: Mon Dec 27 18:40:41 2021 -0500 mm: Turn page_maybe_dma_pinned() into folio_maybe_dma_pinned() Replace three calls to compound_head() with one. This removes the last user of compound_pincount(), so remove that helper too. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski include/linux/mm.h | 129 ++++++++++++++++++++++++++--------------------------- 1 file changed, 63 insertions(+), 66 deletions(-) commit 3d11b225aeb184bc3dc9b4b27b302815a7c531aa Author: Matthew Wilcox (Oracle) Date: Mon Dec 27 18:28:58 2021 -0500 mm: Add folio_pincount_ptr() This is the folio equivalent of compound_pincount_ptr(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski include/linux/mm.h | 5 +++++ 1 file changed, 5 insertions(+) commit 5232c63f46fdd779303527ec36c518cc1e9c6b4e Author: Matthew Wilcox (Oracle) Date: Thu Jan 6 16:46:43 2022 -0500 mm: Make compound_pincount always available Move compound_pincount from the third page to the second page, which means it's available for all compound pages. That lets us delete hpage_pincount_available(). On 32-bit systems, there isn't enough space for both compound_pincount and compound_nr in the second page (it would collide with page->private, which is in use for pages in the swap cache), so revert the optimisation of storing both compound_order and compound_nr on 32-bit systems. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski Documentation/core-api/pin_user_pages.rst | 18 +++++++++--------- include/linux/mm.h | 21 ++++++++------------- include/linux/mm_types.h | 7 +++++-- mm/debug.c | 14 ++++---------- mm/gup.c | 20 +++++++++----------- mm/hugetlb.c | 4 ++++ mm/page_alloc.c | 3 +-- mm/rmap.c | 6 ++---- 8 files changed, 42 insertions(+), 51 deletions(-) commit 6315d8a23ce308433cf615e435ca2ee2aee7d11c Author: Matthew Wilcox (Oracle) Date: Fri Jan 7 14:19:39 2022 -0500 mm/gup: Remove hpage_pincount_sub() Move the assertion (and correct it to be a cheaper variant), and inline the atomic_sub() operation. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) commit 78d9d6ced31ad2f242e44bd24b774fd99c2d663d Author: Matthew Wilcox (Oracle) Date: Fri Jan 7 14:15:11 2022 -0500 mm/gup: Remove hpage_pincount_add() It's clearer to call atomic_add() in the callers; the assertions clearly can't fire there because they're part of the condition for calling atomic_add(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig mm/gup.c | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) commit 59409373f60a0a493fe2a1b85dc8c6299c4fef37 Author: Matthew Wilcox (Oracle) Date: Fri Jan 7 14:04:55 2022 -0500 mm/gup: Handle page split race more efficiently If we hit the page split race, the current code returns NULL which will presumably trigger a retry under the mmap_lock. This isn't necessary; we can just retry the compound_head() lookup. This is a very minor optimisation of an unlikely path, but conceptually it matches (eg) the page cache RCU-protected lookup. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 4c65422901154766e5cee17875ed680366a4a141 Author: Matthew Wilcox (Oracle) Date: Fri Jan 7 13:45:25 2022 -0500 mm/gup: Remove an assumption of a contiguous memmap This assumption needs the inverse of nth_page(), which is temporarily named page_nth() until it's renamed later in this series. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski include/linux/mm.h | 2 ++ mm/gup.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) commit c228afb11ac6938532703ac712992524497aff29 Author: Matthew Wilcox (Oracle) Date: Fri Jan 7 13:25:55 2022 -0500 mm/gup: Fix some contiguous memmap assumptions Several functions in gup.c assume that a compound page has virtually contiguous page structs. This isn't true for SPARSEMEM configs unless SPARSEMEM_VMEMMAP is also set. Fix them by using nth_page() instead of plain pointer arithmetic. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit 28297dbcad7ed3d7bac373eef121339cb0cac326 Author: Matthew Wilcox (Oracle) Date: Sun Jan 9 21:03:47 2022 -0500 mm/gup: Change the calling convention for compound_next() Return the head page instead of storing it to a passed parameter. Reorder the arguments to match the calling function's arguments. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit 0b046e12ae5d6d286415a2e805fcfdd724b7add1 Author: Matthew Wilcox (Oracle) Date: Sun Jan 9 16:21:23 2022 -0500 mm/gup: Optimise compound_range_next() By definition, a compound page has an order >= 1, so the second half of the test was redundant. Also, this cannot be a tail page since it's the result of calling compound_head(), so use PageHead() instead of PageCompound(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8f39f5fcb7963f0a01b8077c92e627af279de65e Author: Matthew Wilcox (Oracle) Date: Sun Jan 9 16:05:11 2022 -0500 mm/gup: Change the calling convention for compound_range_next() Return the head page instead of storing it to a passed parameter. Pass the start page directly instead of passing a pointer to it. Reorder the arguments to match the calling function's arguments. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski Reviewed-by: Christoph Hellwig mm/gup.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit e76027488640802633c646210781b63221c2fdd2 Author: Matthew Wilcox (Oracle) Date: Sat Jan 8 20:23:46 2022 -0500 mm/gup: Remove for_each_compound_head() This macro doesn't simplify the users; it's easier to just call compound_next() inside a standard loop. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) commit a5f100db6855dbfe2709887b7348ce727e990fb6 Author: Matthew Wilcox (Oracle) Date: Sat Jan 8 20:23:46 2022 -0500 mm/gup: Remove for_each_compound_range() This macro doesn't simplify the users; it's easier to just call compound_range_next() inside the loop. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski mm/gup.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) commit 8ea2979c1444cd455ddbe7f976de79cc09fdc38d Author: Matthew Wilcox (Oracle) Date: Fri Feb 4 09:24:26 2022 -0500 mm/gup: Increment the page refcount before the pincount We should always increase the refcount before doing anything else to the page so that other page users see the elevated refcount first. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig mm/gup.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) commit 028152260c5782504995e1fe3910ad39d4e4f34a Author: Rob Herring Date: Mon Mar 21 11:35:29 2022 -0500 Revert "of: base: Introduce of_alias_get_alias_list() to check alias IDs" This reverts commit b1078c355d76769b5ddefc67d143fbd9b6e52c05. The single user of of_alias_get_alias_list(), drivers/tty/serial/xilinx_uartps.c, has since been refactored and no longer needs this function. It also contained a Smatch checker warning: drivers/of/base.c:2038 of_alias_get_alias_list() warn: passing negative bit value 's32min-(-2),0-s32max' to 'set_bit()' Reported-by: Dan Carpenter Signed-off-by: Rob Herring drivers/of/base.c | 54 ------------------------------------------------------ include/linux/of.h | 10 ---------- 2 files changed, 64 deletions(-) commit 5b5b4f85b01604389f7a0f11ef180a725bf0e2d4 Author: Chao Yu Date: Mon Mar 21 23:22:11 2022 +0800 f2fs: fix to do sanity check on .cp_pack_total_block_count As bughunter reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215709 f2fs may hang when mounting a fuzzed image, the dmesg shows as below: __filemap_get_folio+0x3a9/0x590 pagecache_get_page+0x18/0x60 __get_meta_page+0x95/0x460 [f2fs] get_checkpoint_version+0x2a/0x1e0 [f2fs] validate_checkpoint+0x8e/0x2a0 [f2fs] f2fs_get_valid_checkpoint+0xd0/0x620 [f2fs] f2fs_fill_super+0xc01/0x1d40 [f2fs] mount_bdev+0x18a/0x1c0 f2fs_mount+0x15/0x20 [f2fs] legacy_get_tree+0x28/0x50 vfs_get_tree+0x27/0xc0 path_mount+0x480/0xaa0 do_mount+0x7c/0xa0 __x64_sys_mount+0x8b/0xe0 do_syscall_64+0x38/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is cp_pack_total_block_count field in checkpoint was fuzzed to one, as calcuated, two cp pack block locates in the same block address, so then read latter cp pack block, it will block on the page lock due to the lock has already held when reading previous cp pack block, fix it by adding sanity check for cp_pack_total_block_count. Cc: stable@vger.kernel.org Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/checkpoint.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit e60aeb2dee1a4c28591b8f97d4248787aed10769 Author: Daeho Jeong Date: Fri Mar 18 12:13:23 2022 -0700 f2fs: make gc_urgent and gc_segment_mode sysfs node readable Changed a way of showing values of them to use strings. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/sysfs.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) commit d8dc09a4db45e49cc1ee5170632833ec11fafa7e Author: Julia Lawall Date: Fri Mar 18 11:37:04 2022 +0100 bpf, arm: Fix various typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220318103729.157574-9-Julia.Lawall@inria.fr arch/arm/net/bpf_jit_32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 646b907e1559f006c79a752ee3eebe220ceb983d Merge: a6d4b685026c 49a24e9d9c74 Author: Takashi Iwai Date: Mon Mar 21 16:19:21 2022 +0100 Merge tag 'asoc-v5.18' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.18 Quite a quiet release for ASoC, lots of work on drivers and platforms but nothing too groundbreaking but not much on the core itself: - Start of moving SoF to support multiple IPC mechanisms. - Use of NHLT ACPI table to reduce the amount of quirking required for Intel systems. - Some building blocks for use in forthcoming Intel AVS driver for legacy Intel DSP firmwares. - Support for AMD PDM, Atmel PDMC, Awinic AW8738, i.MX cards with TLV320AIC31xx, Intel machines with CS35L41 and ESSX8336, Mediatek MT8181 wideband bluetooth, nVidia Tegra234, Qualcomm SC7280, Renesas RZ/V2L, Texas Instruments TAS585M commit a6d4b685026cfe9837b07532db5d1e1681b5d129 Merge: efb6402c3c4a 8a580a26760c Author: Takashi Iwai Date: Mon Mar 21 16:18:26 2022 +0100 Merge branch 'for-next' into for-linus Pull 5.18 development branch Signed-off-by: Takashi Iwai commit 02788ebcf521fe78c24eb221fd1ed7f86792c330 Author: Kees Cook Date: Wed Feb 16 16:03:41 2022 -0800 lib: stackinit: Convert to KUnit Convert stackinit unit tests to KUnit, for better integration into the kernel self test framework. Includes a rename of test_stackinit.c to stackinit_kunit.c, and CONFIG_TEST_STACKINIT to CONFIG_STACKINIT_KUNIT_TEST. Adjust expected test results based on which stack initialization method was chosen: $ CMD="./tools/testing/kunit/kunit.py run stackinit --raw_output \ --arch=x86_64 --kconfig_add" $ $CMD | grep stackinit: # stackinit: pass:36 fail:0 skip:29 total:65 $ $CMD CONFIG_GCC_PLUGIN_STRUCTLEAK_USER=y | grep stackinit: # stackinit: pass:37 fail:0 skip:28 total:65 $ $CMD CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF=y | grep stackinit: # stackinit: pass:55 fail:0 skip:10 total:65 $ $CMD CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y | grep stackinit: # stackinit: pass:62 fail:0 skip:3 total:65 $ $CMD CONFIG_INIT_STACK_ALL_PATTERN=y --make_option LLVM=1 | grep stackinit: # stackinit: pass:60 fail:0 skip:5 total:65 $ $CMD CONFIG_INIT_STACK_ALL_ZERO=y --make_option LLVM=1 | grep stackinit: # stackinit: pass:60 fail:0 skip:5 total:65 Temporarily remove the userspace-build mode, which will be restored in a later patch. Expand the size of the pre-case switch variable so it doesn't get accidentally cleared. Cc: David Gow Cc: Daniel Latypov Cc: Arnd Bergmann Signed-off-by: Kees Cook --- v1: https://lore.kernel.org/lkml/20220224055145.1853657-1-keescook@chromium.org v2: - split "userspace KUnit stub" into separate header and patch (Daniel) - Improve commit log and comments (David) - Provide mapping of expected XFAIL tests to CONFIGs (David) lib/Kconfig.debug | 22 +-- lib/Makefile | 4 +- lib/{test_stackinit.c => stackinit_kunit.c} | 269 +++++++++++----------------- 3 files changed, 121 insertions(+), 174 deletions(-) commit c7500c1b53bfc083e8968cdce13a5a9d1ca9bf83 Author: Kees Cook Date: Wed Feb 16 16:24:02 2022 -0800 um: Allow builds with Clang Add SUBARCH target for Clang+um (which must go last, not alphabetically, so the other SUBARCHes are assigned). Remove open-coded "DEFINE" macro, instead using linux/kbuild.h's version which was updated to use Clang-friendly assembly in commit cf0c3e68aa81 ("kbuild: fix asm-offset generation to work with clang"). Redefine "DEFINE_LONGS" in terms of "COMMENT" and "DEFINE" so that the intended coment actually has useful content. Add a missed "break" to avoid implicit fall-through warnings. This lets me run KUnit tests with Clang: $ ./tools/testing/kunit/kunit.py run --make_options LLVM=1 ... Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: Nathan Chancellor Cc: David Gow Cc: linux-um@lists.infradead.org Cc: linux-kbuild@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: kunit-dev@googlegroups.com Cc: llvm@lists.linux.dev Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/lkml/Yg2YubZxvYvx7%2Fnm@dev-arch.archlinux-ax161/ Tested-by: David Gow Link: https://lore.kernel.org/lkml/CABVgOSk=oFxsbSbQE-v65VwR2+mXeGXDDjzq8t7FShwjJ3+kUg@mail.gmail.com/ Signed-off-by: Kees Cook --- v1: https://lore.kernel.org/lkml/20220217002843.2312603-1-keescook@chromium.org v2: https://lore.kernel.org/lkml/20220224055831.1854786-1-keescook@chromium.org v3: - use kbuild.h to avoid duplication (Masahiro) - fix intended comments (Masahiro) - use SUBARCH (Nathan) arch/um/os-Linux/execvp.c | 1 + arch/x86/um/user-offsets.c | 9 ++++----- scripts/Makefile.clang | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) commit d0f325c34c2fbe15f6774f2b628224280b571ae9 Author: Hengqi Chen Date: Sat Mar 19 11:05:33 2022 +0800 libbpf: Close fd in bpf_object__reuse_map pin_fd is dup-ed and assigned in bpf_map__reuse_fd. Close it in bpf_object__reuse_map after reuse. Signed-off-by: Hengqi Chen Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220319030533.3132250-1-hengqi.chen@gmail.com tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a43bf604446414103b7535f38e739b65601c4fb2 Author: Olga Kornievskaia Date: Wed Mar 16 18:24:26 2022 -0400 NFSv4.1 provide mount option to toggle trunking discovery Introduce a new mount option -- trunkdiscovery,notrunkdiscovery -- to toggle whether or not the client will engage in actively discovery of trunking locations. v2 make notrunkdiscovery default Signed-off-by: Olga Kornievskaia Fixes: 1976b2b31462 ("NFSv4.1 query for fs_location attr on a new file system") Signed-off-by: Trond Myklebust fs/nfs/client.c | 3 ++- fs/nfs/fs_context.c | 8 ++++++++ include/linux/nfs_fs_sb.h | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) commit ba2c670ae84bad705ec023bfa7a48f7f8eab5e16 Author: Laurent Pinchart Date: Fri Mar 18 21:37:35 2022 +0100 media: nxp: Restrict VIDEO_IMX_MIPI_CSIS to ARCH_MXC or COMPILE_TEST The imx-mipi-csis driver is specific to NXP platforms. Restrict it to those by default, and enable compilation with COMPILE_TEST to keep a wide test coverage. Link: https://lore.kernel.org/linux-media/20220318203735.5923-1-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart Reviewed-by: Rui Miguel Silva Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/nxp/Kconfig | 1 + 1 file changed, 1 insertion(+) commit ca4f3f187b0885906ebac1abbf26545b5c514fba Merge: e7dc00f3d6c3 14e426bf1a4d Author: David S. Miller Date: Mon Mar 21 14:11:38 2022 +0000 Merge branch 'devlink-locking' Jakub Kicinski says: ==================== devlink: hold the instance lock in eswitch callbacks Series number 2 in the effort to hold the devlink instance lock in call driver callbacks. We have the following drivers using this API: - bnxt, nfp, netdevsim - their own locking is removed / simplified by this series; all of them needed a lock to protect from changes to the number of VFs while switching modes, now the VF config bus callback takes the devlink instance lock via devl_lock(); - ice - appears not to allow changing modes while SR-IOV enabled, so nothing to do there; - liquidio - does not contain any locking; - octeontx2/af - is very special but at least doesn't have locking so doesn't get in the way either; - mlx5 has a wealth of locks - I chickened out and dropped the lock in the callbacks so that I can leave the driver be, for now. The last one is obviously not ideal, but I would prefer to transition the API already as it make take longer. v2: use a wrapper in mlx5 and extend the comment ==================== Signed-off-by: David S. Miller commit 14e426bf1a4d77ac87d0fa2a964092a23f863e44 Author: Jakub Kicinski Date: Fri Mar 18 12:23:44 2022 -0700 devlink: hold the instance lock during eswitch_mode callbacks Make the devlink core hold the instance lock during eswitch_mode callbacks. Cheat in case of mlx5 (see the cover letter). Reviewed-by: Leon Romanovsky Reviewed-by: Jiri Pirko Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 22 +++------ .../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 54 +++++++++++++++++----- drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 7 +-- drivers/net/netdevsim/dev.c | 16 ++----- net/core/devlink.c | 6 --- 5 files changed, 54 insertions(+), 51 deletions(-) commit aff3a925094633a5b77058b9a715efbb12fc2698 Author: Jakub Kicinski Date: Fri Mar 18 12:23:43 2022 -0700 netdevsim: replace vfs_lock with devlink instance lock Similarly to the previous commit, use the devlink instance lock and let it replace the vfs_lock. nsim_esw_legacy_enable() was locked by both port lock and vfs lock so one set of lock/unlocks goes away. netdevsim's .eswitch_mode_set callback is now ready for the callback to take the instance lock. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller drivers/net/netdevsim/dev.c | 37 ++++++++++++++++++++----------------- drivers/net/netdevsim/netdevsim.h | 1 - 2 files changed, 20 insertions(+), 18 deletions(-) commit 76eea6c2e663f7e9fbc258c82811ad9e657e085f Author: Jakub Kicinski Date: Fri Mar 18 12:23:42 2022 -0700 netdevsim: replace port_list_lock with devlink instance lock Take advantage of the devlink instance lock for protecting the port list. This will simplify locking even more once all devlink callbacks hold the instance lock. We need to add locking in nsim_dev_port_add_all() which used to assume higher layer protection when accessing the list. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller drivers/net/netdevsim/dev.c | 40 +++++++++++++++++++-------------------- drivers/net/netdevsim/netdevsim.h | 1 - 2 files changed, 20 insertions(+), 21 deletions(-) commit 8879b32a3a809a183e6e2998725a0f33c4e42d41 Author: Jakub Kicinski Date: Fri Mar 18 12:23:41 2022 -0700 devlink: add explicitly locked flavor of the rate node APIs We'll need an explicitly locked rate node API for netdevsim to switch eswitch mode setting to locked. Reviewed-by: Jiri Pirko Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller include/net/devlink.h | 4 +++ net/core/devlink.c | 86 ++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 65 insertions(+), 25 deletions(-) commit 7a1b0b1a555e62734fd6c6fd9953d0add1d9c9b1 Author: Jakub Kicinski Date: Fri Mar 18 12:23:40 2022 -0700 bnxt: use the devlink instance lock to protect sriov In prep for .eswitch_mode_set being called with the devlink instance lock held use that lock explicitly instead of creating a local mutex just for the sriov reconfig. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 - drivers/net/ethernet/broadcom/bnxt/bnxt.h | 6 ------ drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 4 ++-- drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 4 ++-- 4 files changed, 4 insertions(+), 11 deletions(-) commit 1824d8ea75f275a5e69e5f6bc0ffe122ea9b938c Author: Yafang Shao Date: Sun Mar 20 06:08:14 2022 +0000 bpftool: Fix print error when show bpf map If there is no btf_id or frozen, it will not show the pids, but the pids don't depend on any one of them. Below is the result after this change: $ ./bpftool map show 2: lpm_trie flags 0x1 key 8B value 8B max_entries 1 memlock 4096B pids systemd(1) 3: lpm_trie flags 0x1 key 20B value 8B max_entries 1 memlock 4096B pids systemd(1) While before this change, the 'pids systemd(1)' can't be displayed. Fixes: 9330986c0300 ("bpf: Add bloom filter map implementation") Signed-off-by: Yafang Shao Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220320060815.7716-1-laoar.shao@gmail.com tools/bpf/bpftool/map.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit f70986902c86f88612ed45a96aa7cf4caa65f7c1 Author: Jiri Olsa Date: Mon Mar 21 08:01:13 2022 +0100 bpf: Fix kprobe_multi return probe backtrace Andrii reported that backtraces from kprobe_multi program attached as return probes are not complete and showing just initial entry [1]. It's caused by changing registers to have original function ip address as instruction pointer even for return probe, which will screw backtrace from return probe. This change keeps registers intact and store original entry ip and link address on the stack in bpf_kprobe_multi_run_ctx struct, where bpf_get_func_ip and bpf_get_attach_cookie helpers for kprobe_multi programs can find it. [1] https://lore.kernel.org/bpf/CAEf4BzZDDqK24rSKwXNp7XL3ErGD4bZa1M6c_c4EvDSt3jrZcg@mail.gmail.com/T/#m8d1301c0ea0892ddf9dc6fba57a57b8cf11b8c51 Fixes: ca74823c6e16 ("bpf: Add cookie support to programs attached with kprobe multi link") Reported-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220321070113.1449167-3-jolsa@kernel.org kernel/trace/bpf_trace.c | 67 ++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 30 deletions(-) commit f705ec764b34323412f14b9bd95412e9bcb8770b Author: Jiri Olsa Date: Mon Mar 21 08:01:12 2022 +0100 Revert "bpf: Add support to inline bpf_get_func_ip helper on x86" This reverts commit 97ee4d20ee67eb462581a7af01442de6586e390b. Following change is adding more complexity to bpf_get_func_ip helper for kprobe_multi programs, which can't be inlined easily. Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220321070113.1449167-2-jolsa@kernel.org kernel/bpf/verifier.c | 21 +-------------------- kernel/trace/bpf_trace.c | 1 - 2 files changed, 1 insertion(+), 21 deletions(-) commit 583669ab3aed29994e50bde6c66b52d44e1bdb73 Author: Yuntao Wang Date: Sun Mar 20 15:52:40 2022 +0800 bpf: Simplify check in btf_parse_hdr() Replace offsetof(hdr_len) + sizeof(hdr_len) with offsetofend(hdr_len) to simplify the check for correctness of btf_data_size in btf_parse_hdr() Signed-off-by: Yuntao Wang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220320075240.1001728-1-ytcoode@gmail.com kernel/bpf/btf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit ec80906b0fbd7be11e3e960813b977b1ffe5f8fe Author: Hangbin Liu Date: Mon Mar 21 10:41:49 2022 +0800 selftests/bpf/test_lirc_mode2.sh: Exit with proper code When test_lirc_mode2_user exec failed, the test report failed but still exit with 0. Fix it by exiting with an error code. Another issue is for the LIRCDEV checking. With bash -n, we need to quote the variable, or it will always be true. So if test_lirc_mode2_user was not run, just exit with skip code. Fixes: 6bdd533cee9a ("bpf: add selftest for lirc_mode2 type program") Signed-off-by: Hangbin Liu Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220321024149.157861-1-liuhangbin@gmail.com tools/testing/selftests/bpf/test_lirc_mode2.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 5eb17c1f458c3921cbfdc6544044642f48d09644 Merge: 1ccd85f5ac60 f244b4dc53e5 Author: Petr Mladek Date: Mon Mar 21 14:46:19 2022 +0100 Merge branch 'rework/fast-next-seq' into for-linus commit 1ccd85f5ac60be460bade24a873800ae6820fbd6 Merge: 0834c6f03b02 ce06e863f36f Author: Petr Mladek Date: Mon Mar 21 14:45:01 2022 +0100 Merge branch 'for-5.18-panic-deadlocks' into for-linus commit 0834c6f03b0279d58718f93630206305079645da Merge: b665eae7a788 f74a08fc6107 Author: Petr Mladek Date: Mon Mar 21 14:44:49 2022 +0100 Merge branch 'for-5.18-vsprintf-fourcc-fixup' into for-linus commit c9b8fecddb5bb4b67e351bbaeaa648a6f7456912 Author: Paolo Bonzini Date: Tue Mar 8 04:57:39 2022 -0500 KVM: use kvcalloc for array allocations Instead of using array_size, use a function that takes care of the multiplication. While at it, switch to kvcalloc since this allocation should not be very large. Signed-off-by: Paolo Bonzini arch/x86/kvm/cpuid.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 6d8491910fcd3324d0f0ece3bd68e85ead3a04d7 Author: Oliver Upton Date: Tue Mar 1 06:03:47 2022 +0000 KVM: x86: Introduce KVM_CAP_DISABLE_QUIRKS2 KVM_CAP_DISABLE_QUIRKS is irrevocably broken. The capability does not advertise the set of quirks which may be disabled to userspace, so it is impossible to predict the behavior of KVM. Worse yet, KVM_CAP_DISABLE_QUIRKS will tolerate any value for cap->args[0], meaning it fails to reject attempts to set invalid quirk bits. The only valid workaround for the quirky quirks API is to add a new CAP. Actually advertise the set of quirks that can be disabled to userspace so it can predict KVM's behavior. Reject values for cap->args[0] that contain invalid bits. Finally, add documentation for the new capability and describe the existing quirks. Signed-off-by: Oliver Upton Message-Id: <20220301060351.442881-5-oupton@google.com> Signed-off-by: Paolo Bonzini Documentation/virt/kvm/api.rst | 50 +++++++++++++++++++++++++++++++++++++++++ arch/x86/include/asm/kvm_host.h | 7 ++++++ arch/x86/kvm/x86.c | 8 +++++++ include/uapi/linux/kvm.h | 1 + 4 files changed, 66 insertions(+) commit 5e17b2ee45b941fb7bc46107810d727088be392e Author: Thomas Gleixner Date: Sun Nov 6 12:26:18 2011 +0100 kvm: x86: Require const tsc for RT Non constant TSC is a nightmare on bare metal already, but with virtualization it becomes a complete disaster because the workarounds are horrible latency wise. That's also a preliminary for running RT in a guest on top of a RT host. Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Message-Id: Signed-off-by: Paolo Bonzini arch/x86/kvm/x86.c | 6 ++++++ 1 file changed, 6 insertions(+) commit f144c49e8c3950add1b051e76ebf40a258984c9d Author: Paolo Bonzini Date: Thu Oct 21 17:19:27 2021 -0400 KVM: x86: synthesize CPUID leaf 0x80000021h if useful Guests X86_BUG_NULL_SEG if and only if the host has them. Use the info from static_cpu_has_bug to form the 0x80000021 CPUID leaf that was defined for Zen3. Userspace can then set the bit even on older CPUs that do not have the bug, such as Zen2. Do the same for X86_FEATURE_LFENCE_RDTSC as well, since various processors have had very different ways of detecting it and not all of them are available to userspace. Signed-off-by: Paolo Bonzini arch/x86/kvm/cpuid.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit 58b3d12c0a860cda34ed9d2378078ea5134e6812 Author: Paolo Bonzini Date: Thu Oct 28 13:26:38 2021 -0400 KVM: x86: add support for CPUID leaf 0x80000021 CPUID leaf 0x80000021 defines some features (or lack of bugs) of AMD processors. Expose the ones that make sense via KVM_GET_SUPPORTED_CPUID. Signed-off-by: Paolo Bonzini arch/x86/kvm/cpuid.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) commit bf07be36cd881b50684aca8f76d4b407da6cb058 Author: Maxim Levitsky Date: Fri Mar 18 12:27:41 2022 -0400 KVM: x86: do not use KVM_X86_OP_OPTIONAL_RET0 for get_mt_mask KVM_X86_OP_OPTIONAL_RET0 can only be used with 32-bit return values on 32-bit systems, because unsigned long is only 32-bits wide there and 64-bit values are returned in edx:eax. Reported-by: Maxim Levitsky Signed-off-by: Maxim Levitsky Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm-x86-ops.h | 2 +- arch/x86/kvm/svm/svm.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) commit e7dc00f3d6c323709c5515a7a3d05062a0034b83 Merge: a62551c988d2 dc97870682e1 Author: David S. Miller Date: Mon Mar 21 13:26:38 2022 +0000 Merge branch 'too-short' Tong Zhang says: ==================== fix typos: "to short" -> "too short" doing some code review and I found out there are a couple of places where "too short" is misspelled as "to short". ==================== Signed-off-by: David S. Miller commit dc97870682e19fb5260281e9b7636e796869075e Author: Tong Zhang Date: Mon Mar 21 00:18:18 2022 -0700 mISDN: fix typo "frame to short" -> "frame too short" "frame to short" -> "frame too short" Signed-off-by: Tong Zhang Signed-off-by: David S. Miller drivers/isdn/hardware/mISDN/mISDNipac.c | 2 +- drivers/isdn/hardware/mISDN/mISDNisar.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit d2d803d1c72bfdc3ad985b5833cc438b5d6e4ff9 Author: Tong Zhang Date: Mon Mar 21 00:18:08 2022 -0700 i825xx: fix typo "Frame to short" -> "Frame too short" "Frame to short" -> "Frame too short" Signed-off-by: Tong Zhang Signed-off-by: David S. Miller drivers/net/ethernet/i825xx/sun3_82586.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4f3dda8b4c4be154a0dacf063156c362268f5288 Author: Tong Zhang Date: Mon Mar 21 00:17:57 2022 -0700 s390/ctcm: fix typo "length to short" -> "length too short" "packet length to short" -> "packet length too short" Signed-off-by: Tong Zhang Signed-off-by: David S. Miller drivers/s390/net/ctcm_fsms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e94b99a40b997b547862d35ca05c7c6925a2ccfa Author: Tong Zhang Date: Mon Mar 21 00:17:28 2022 -0700 ar5523: fix typo "to short" -> "too short" "RX USB to short" -> "RX USB too short" Signed-off-by: Tong Zhang Signed-off-by: David S. Miller drivers/net/wireless/ath/ar5523/ar5523.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a62551c988d2e948cb0a227ba48419fee495b028 Merge: 57939fdc2cbe 3bacfccdcb2d Author: David S. Miller Date: Mon Mar 21 13:24:28 2022 +0000 Merge branch 'sparx5-mcast' Casper Andersson says: ==================== net: sparx5: Add multicast support Add multicast support to Sparx5. ==================== Signed-off-by: David S. Miller commit 3bacfccdcb2d3268adaf66d2ff4024251a93b916 Author: Casper Andersson Date: Mon Mar 21 11:14:46 2022 +0100 net: sparx5: Add mdb handlers Adds mdb handlers. Uses the PGID arbiter to find a free entry in the PGID table for the multicast group port mask. Signed-off-by: Casper Andersson Signed-off-by: David S. Miller .../ethernet/microchip/sparx5/sparx5_mactable.c | 33 ++++-- .../net/ethernet/microchip/sparx5/sparx5_main.h | 2 + .../ethernet/microchip/sparx5/sparx5_switchdev.c | 111 +++++++++++++++++++++ 3 files changed, 136 insertions(+), 10 deletions(-) commit af9b45d08eb44dcf3cba92a5ab2c93c6be615d0a Author: Casper Andersson Date: Mon Mar 21 11:14:45 2022 +0100 net: sparx5: Add arbiter for managing PGID table The PGID (Port Group ID) table holds port masks for different purposes. The first 72 are reserved for port destination masks, flood masks, and CPU forwarding. The rest are shared between multicast, link aggregation, and virtualization profiles. The GLAG area is reserved to not be used by anything else, since it is a subset of the MCAST area. The arbiter keeps track of which entries are in use. You can ask for a free ID or give back one you are done using. Signed-off-by: Casper Andersson Signed-off-by: David S. Miller drivers/net/ethernet/microchip/sparx5/Makefile | 2 +- .../net/ethernet/microchip/sparx5/sparx5_main.c | 3 ++ .../net/ethernet/microchip/sparx5/sparx5_main.h | 21 ++++++++ .../net/ethernet/microchip/sparx5/sparx5_pgid.c | 60 ++++++++++++++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) commit 57939fdc2cbe9e4b5c3fbbdcdc76414da8c57ea7 Merge: 4b45e07907d8 d9d950490a0a Author: David S. Miller Date: Mon Mar 21 13:21:17 2022 +0000 Merge branch 'nfp3800' Simon Horman says: ==================== nfp: support for NFP-3800 Yinjun Zhan says: This is the second of a two part series to support the NFP-3800 device. To utilize the new hardware features of the NFP-3800, driver adds support of a new data path NFDK. This series mainly does some refactor work to the data path related implementations. The data path specific implementations are now separated into nfd3 and nfdk directories respectively, and the common part is also moved into a new file. * The series starts with a small refinement in Patch 1/10. Patches 2/10 and 3/10 are the main refactoring of data path implementation, which prepares for the adding the NFDK data path. * Before the introduction of NFDK, there's some more preparation work for NFP-3800 features, such as multi-descriptor per-packet and write-back mechanism of TX pointer, which is done in patches 4/10, 5/10, 6/10, 7/10. * Patch 8/10 allows the driver to select data path according to firmware version. Finally, patches 9/10 and 10/10 introduce the new NFDK data path. Changes between v1 and v2 * Correct kdoc for nfp_nfdk_tx() * Correct build warnings on 32-bit Thanks to everyone who contributed to this work. ==================== Signed-off-by: David S. Miller commit d9d950490a0a5822ffeda291a588eb85d4f7b96f Author: Yinjun Zhang Date: Mon Mar 21 11:42:09 2022 +0100 nfp: nfdk: implement xdp tx path for NFDK Due to the different definition of txbuf in NFDK comparing to NFD3, there're no pre-allocated txbufs for xdp use in NFDK's implementation, we just use the existed rxbuf and recycle it when xdp tx is completed. For each packet to transmit in xdp path, we cannot use more than `NFDK_TX_DESC_PER_SIMPLE_PKT` txbufs, one is to stash virtual address, and another is for dma address, so currently the amount of transmitted bytes is not accumulated. Also we borrow the last bit of virtual addr to indicate a new transmitted packet due to address's alignment attribution. Signed-off-by: Yinjun Zhang Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 196 ++++++++++++++++++++++++- drivers/net/ethernet/netronome/nfp/nfdk/nfdk.h | 17 +++ 2 files changed, 208 insertions(+), 5 deletions(-) commit c10d12e3dce8efc24af2478d45b0313796b20387 Author: Jakub Kicinski Date: Mon Mar 21 11:42:08 2022 +0100 nfp: add support for NFDK data path Add new data path. The TX is completely different, each packet has multiple descriptor entries (between 2 and 32). TX ring is divided into blocks 32 descriptor, and descritors of one packet can't cross block bounds. The RX side is the same for now. ABI version 5 or later is required. There is no support for VLAN insertion on TX. XDP_TX action and AF_XDP zero-copy is not implemented in NFDK path. Changes to Jakub's work: * Move statistics of hw_csum_tx after jumbo packet's segmentation. * Set L3_CSUM flag to enable recaculating of L3 header checksum in ipv4 case. * Mark the case of TSO a packet with metadata prepended as unsupported. Signed-off-by: Jakub Kicinski Signed-off-by: Xingfeng Hu Signed-off-by: Yinjun Zhang Signed-off-by: Dianchao Wang Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/Makefile | 2 + drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 1338 ++++++++++++++++++++ drivers/net/ethernet/netronome/nfp/nfdk/nfdk.h | 112 ++ drivers/net/ethernet/netronome/nfp/nfdk/rings.c | 195 +++ drivers/net/ethernet/netronome/nfp/nfp_net.h | 27 +- .../net/ethernet/netronome/nfp/nfp_net_common.c | 40 + drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h | 1 + drivers/net/ethernet/netronome/nfp/nfp_net_dp.h | 2 + drivers/net/ethernet/netronome/nfp/nfp_net_xsk.c | 4 + 9 files changed, 1715 insertions(+), 6 deletions(-) commit d9e3c29918a80d2d18f0c3c059a578a368f6713c Author: Jakub Kicinski Date: Mon Mar 21 11:42:07 2022 +0100 nfp: choose data path based on version Prepare for choosing data path based on the firmware version field. Exploit one bit from the reserved byte in the firmware version field as the data path type. We need the firmware version right after vNIC is allocated, so it has to be read inside nfp_net_alloc(), callers don't have to set it afterwards. Following patches will bring the implementation of the second data path. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfp_net.h | 14 +++++++++----- .../net/ethernet/netronome/nfp/nfp_net_common.c | 22 ++++++++++++++++++---- drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h | 4 +++- .../net/ethernet/netronome/nfp/nfp_net_ethtool.c | 2 +- drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 9 +++++---- .../net/ethernet/netronome/nfp/nfp_netvf_main.c | 9 +++++---- 6 files changed, 41 insertions(+), 19 deletions(-) commit b94b6a1342ccce016f1139af32adc3b6bfab9656 Author: Jakub Kicinski Date: Mon Mar 21 11:42:06 2022 +0100 nfp: add per-data path feature mask Make sure that features supported only by some of the data paths are not enabled for all. Add a mask of supported features into the data path op structure. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfd3/rings.c | 15 +++++++++++++++ drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 3 +++ drivers/net/ethernet/netronome/nfp/nfp_net_dp.h | 2 ++ 3 files changed, 20 insertions(+) commit 0dcf7f500b0a56c0c58deeeac7692fe213aa08b1 Author: Jakub Kicinski Date: Mon Mar 21 11:42:05 2022 +0100 nfp: use TX ring pointer write back Newer versions of the PCIe microcode support writing back the position of the TX pointer back into host memory. This speeds up TX completions, because we avoid a read from device memory (replacing PCIe read with DMA coherent read). Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfd3/dp.c | 5 ++-- drivers/net/ethernet/netronome/nfp/nfp_net.h | 7 ++++++ .../net/ethernet/netronome/nfp/nfp_net_common.c | 9 ++++++- .../net/ethernet/netronome/nfp/nfp_net_debugfs.c | 5 +++- drivers/net/ethernet/netronome/nfp/nfp_net_dp.c | 29 +++++++++++++++++++--- drivers/net/ethernet/netronome/nfp/nfp_net_dp.h | 8 ++++++ 6 files changed, 56 insertions(+), 7 deletions(-) commit 07cd69c96bff4edf5edcd17b5a821f63343bf9cc Author: Jakub Kicinski Date: Mon Mar 21 11:42:04 2022 +0100 nfp: move tx_ring->qcidx into cold data QCidx is not used on fast path, move it to the lower cacheline. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfp_net.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit d6488c49c2530f6b39e7eabebaefc4411d61e791 Author: Jakub Kicinski Date: Mon Mar 21 11:42:03 2022 +0100 nfp: prepare for multi-part descriptors New datapaths may use multiple descriptor units to describe a single packet. Prepare for that by adding a descriptors per simple frame constant into ring size calculations. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfd3/rings.c | 1 + drivers/net/ethernet/netronome/nfp/nfp_net.h | 4 ++-- drivers/net/ethernet/netronome/nfp/nfp_net_dp.h | 2 ++ drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c | 8 +++++--- 4 files changed, 10 insertions(+), 5 deletions(-) commit 6fd86efa630effbfbc7bd276609d11cb5e18d487 Author: Jakub Kicinski Date: Mon Mar 21 11:42:02 2022 +0100 nfp: use callbacks for slow path ring related functions To reduce the coupling of slow path ring implementations and their callers, use callbacks instead. Changes to Jakub's work: * Also use callbacks for xmit functions Signed-off-by: Jakub Kicinski Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfd3/dp.c | 27 +---- drivers/net/ethernet/netronome/nfp/nfd3/nfd3.h | 28 +----- drivers/net/ethernet/netronome/nfp/nfd3/rings.c | 28 ++++-- drivers/net/ethernet/netronome/nfp/nfp_net.h | 4 + .../net/ethernet/netronome/nfp/nfp_net_common.c | 7 +- .../net/ethernet/netronome/nfp/nfp_net_debugfs.c | 2 +- drivers/net/ethernet/netronome/nfp/nfp_net_dp.c | 55 +++------- drivers/net/ethernet/netronome/nfp/nfp_net_dp.h | 111 ++++++++++++++++++--- 8 files changed, 148 insertions(+), 114 deletions(-) commit 62d033309d62653ff5be7e7a35b3ff30ffb4181f Author: Jakub Kicinski Date: Mon Mar 21 11:42:01 2022 +0100 nfp: move the fast path code to separate files In preparation for support for a new datapath format move all ring and fast path logic into separate files. It is basically a verbatim move with some wrapping functions, no new structures and functions added. The current data path is called NFD3 from the initial version of the driver ABI it used. The non-fast path, but ring related functions are moved to nfp_net_dp.c file. Changes to Jakub's work: * Rebase on xsk related code. * Split the patch, move the callback changes to next commit. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/Makefile | 4 + drivers/net/ethernet/netronome/nfp/nfd3/dp.c | 1368 +++++++++++++ drivers/net/ethernet/netronome/nfp/nfd3/nfd3.h | 126 ++ drivers/net/ethernet/netronome/nfp/nfd3/rings.c | 243 +++ drivers/net/ethernet/netronome/nfp/nfd3/xsk.c | 408 ++++ drivers/net/ethernet/netronome/nfp/nfp_net.h | 102 +- .../net/ethernet/netronome/nfp/nfp_net_common.c | 2041 +------------------- .../net/ethernet/netronome/nfp/nfp_net_debugfs.c | 46 +- drivers/net/ethernet/netronome/nfp/nfp_net_dp.c | 448 +++++ drivers/net/ethernet/netronome/nfp/nfp_net_dp.h | 120 ++ drivers/net/ethernet/netronome/nfp/nfp_net_xsk.c | 436 +---- drivers/net/ethernet/netronome/nfp/nfp_net_xsk.h | 16 +- 12 files changed, 2782 insertions(+), 2576 deletions(-) commit fc9769f62e5937b496139b07e9e9656896479018 Author: Jakub Kicinski Date: Mon Mar 21 11:42:00 2022 +0100 nfp: calculate ring masks without conditionals Ring enable masks are 64bit long. Replace mask calculation from: block_cnt == 64 ? 0xffffffffffffffffULL : (1 << block_cnt) - 1 with: (U64_MAX >> (64 - block_cnt)) to simplify the code. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 3d8dcf278b1ee1eff1e90be848fa2237db4c07a7 Author: David Howells Date: Mon Mar 21 11:18:54 2022 +0000 watch_queue: Actually free the watch free_watch() does everything barring actually freeing the watch object. Fix this by adding the missing kfree. kmemleak produces a report something like the following. Note that as an address can be seen in the first word, the watch would appear to have gone through call_rcu(). BUG: memory leak unreferenced object 0xffff88810ce4a200 (size 96): comm "syz-executor352", pid 3605, jiffies 4294947473 (age 13.720s) hex dump (first 32 bytes): e0 82 48 0d 81 88 ff ff 00 00 00 00 00 00 00 00 ..H............. 80 a2 e4 0c 81 88 ff ff 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc include/linux/slab.h:581 [inline] [] kzalloc include/linux/slab.h:714 [inline] [] keyctl_watch_key+0xec/0x2e0 security/keys/keyctl.c:1800 [] __do_sys_keyctl+0x3c4/0x490 security/keys/keyctl.c:2016 [] 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+0x44/0xae Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-and-tested-by: syzbot+6e2de48f06cdb2884bfc@syzkaller.appspotmail.com Signed-off-by: David Howells kernel/watch_queue.c | 1 + 1 file changed, 1 insertion(+) commit a635415a064e77bcfbf43da413fd9dfe0bbed9cb Author: David Howells Date: Mon Mar 21 08:11:52 2022 +0000 watch_queue: Fix NULL dereference in error cleanup In watch_queue_set_size(), the error cleanup code doesn't take account of the fact that __free_page() can't handle a NULL pointer when trying to free up buffer pages that did get allocated. Fix this by only calling __free_page() on the pages actually allocated. Without the fix, this can lead to something like the following: BUG: KASAN: null-ptr-deref in __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473 Read of size 4 at addr 0000000000000034 by task syz-executor168/3599 ... Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 __kasan_report mm/kasan/report.c:446 [inline] kasan_report.cold+0x66/0xdf mm/kasan/report.c:459 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] page_ref_count include/linux/page_ref.h:67 [inline] put_page_testzero include/linux/mm.h:717 [inline] __free_pages+0x1f/0x1b0 mm/page_alloc.c:5473 watch_queue_set_size+0x499/0x630 kernel/watch_queue.c:275 pipe_ioctl+0xac/0x2b0 fs/pipe.c:632 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 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+0x44/0xae Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-and-tested-by: syzbot+d55757faa9b80590767b@syzkaller.appspotmail.com Signed-off-by: David Howells Reviewed-by: Fabio M. De Francesco kernel/watch_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4b45e07907d87d0e218d9c4a125cdf1d9ea9b1c3 Merge: e6980b572fb7 217cff36e885 Author: David S. Miller Date: Mon Mar 21 12:36:03 2022 +0000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next The following patchset contains Netfilter updates for net-next. This patchset contains updates for the nf_tables register tracking infrastructure, disable bogus warning when attaching ct helpers, one namespace pollution fix and few cleanups for the flowtable. 1) Revisit conntrack gc routine to reduce chances of overruning the netlink buffer from the event path. From Florian Westphal. 2) Disable warning on explicit ct helper assignment, from Phil Sutter. 3) Read-only expressions do not update registers, mark them as NFT_REDUCE_READONLY. Add helper functions to update the register tracking information. This patch re-enables the register tracking infrastructure. 4) Cancel register tracking in case an expression fully/partially clobbers existing data. 5) Add register tracking support for remaining expressions: ct, lookup, meta, numgen, osf, hash, immediate, socket, xfrm, tunnel, fib, exthdr. 6) Rename init and exit functions for the conntrack h323 helper, from Randy Dunlap. 7) Remove redundant field in struct flow_offload_work. 8) Update nf_flow_table_iterate() to pass flowtable to callback. ==================== Signed-off-by: David S. Miller commit f639d9867eea647005dc824e0e24f39ffc50d4e4 Author: Xiubo Li Date: Sat Mar 5 19:52:59 2022 +0800 ceph: fix memory leak in ceph_readdir when note_last_dentry returns error Reset the last_readdir at the same time, and add a comment explaining why we don't free last_readdir when dir_emit returns false. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov fs/ceph/dir.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) commit c38af9825eff8ff76b9d57dd62ebc7ff6050464c Author: Dan Carpenter Date: Mon Mar 7 17:21:21 2022 +0300 ceph: uninitialized variable in debug output If read_mapping_folio() fails then "inline_version" is printed without being initialized. [ jlayton: use CEPH_INLINE_NONE instead of "-1" ] Fixes: 083db6fd3e73 ("ceph: uninline the data on a file opened for writing") Signed-off-by: Dan Carpenter Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov fs/ceph/addr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 271251f841a53ce20c4e49047278e06c205a8ebd Author: Venky Shankar Date: Tue Mar 8 07:42:19 2022 -0500 ceph: use tracked average r/w/m latencies to display metrics in debugfs Signed-off-by: Venky Shankar Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov fs/ceph/debugfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 54d7b821a37fdb805ffc8545e536fb228c1113b2 Author: Venky Shankar Date: Tue Mar 8 07:42:18 2022 -0500 ceph: include average/stdev r/w/m latency in mds metrics stdev is computed in `cephfs-top` tool - clients forward square of sums and IO count required to calculate stdev. Signed-off-by: Venky Shankar Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov fs/ceph/metric.c | 15 ++++++++++++--- fs/ceph/metric.h | 51 ++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 48 insertions(+), 18 deletions(-) commit 367290e6355ce13c17d17f3ec1075beb7ca3224a Author: Venky Shankar Date: Tue Mar 8 07:42:17 2022 -0500 ceph: track average r/w/m latency Make the math a bit simpler to understand (should not affect execution speeds). Signed-off-by: Venky Shankar Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov fs/ceph/metric.c | 29 +++++++++++++++-------------- fs/ceph/metric.h | 1 + 2 files changed, 16 insertions(+), 14 deletions(-) commit 8d728c769fd8e5aaaea36288741a4e3493111816 Author: Venky Shankar Date: Tue Mar 8 07:42:16 2022 -0500 ceph: use ktime_to_timespec64() rather than jiffies_to_timespec64() Latencies are of type ktime_t, coverting from jiffies is incorrect. Also, switch to "struct ceph_timespec" for r/w/m latencies. Signed-off-by: Venky Shankar Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov fs/ceph/metric.c | 19 +++++++++---------- fs/ceph/metric.h | 11 ++++------- 2 files changed, 13 insertions(+), 17 deletions(-) commit 1ad3bb28d336978e451980ca6c72be494b8fe2f1 Author: Xiubo Li Date: Wed Mar 2 15:29:51 2022 +0800 ceph: assign the ci only when the inode isn't NULL The ceph_find_inode() may will fail and return NULL. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov fs/ceph/caps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 322794d3355c33adcc4feace0045d85a8e4ed813 Author: Xiubo Li Date: Wed Mar 2 14:51:53 2022 +0800 ceph: fix inode reference leakage in ceph_get_snapdir() The ceph_get_inode() will search for or insert a new inode into the hash for the given vino, and return a reference to it. If new is non-NULL, its reference is consumed. We should release the reference when in error handing cases. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov fs/ceph/inode.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit b2479de38d8fc7ef13d5c78ff5ded6e5a1a4eac0 Author: Jackie Liu Date: Mon Mar 21 15:12:16 2022 +0800 n64cart: convert bi_disk to bi_bdev->bd_disk fix build My kernel robot report below: drivers/block/n64cart.c: In function ‘n64cart_submit_bio’: drivers/block/n64cart.c:91:26: error: ‘struct bio’ has no member named ‘bi_disk’ 91 | struct device *dev = bio->bi_disk->private_data; | ^~ CC drivers/slimbus/qcom-ctrl.o CC drivers/auxdisplay/hd44780.o CC drivers/watchdog/watchdog_core.o CC drivers/nvme/host/fault_inject.o AR drivers/accessibility/braille/built-in.a make[2]: *** [scripts/Makefile.build:288: drivers/block/n64cart.o] Error 1 Fixes: 309dca309fc3 ("block: store a block_device pointer in struct bio"); Reported-by: k2ci Signed-off-by: Jackie Liu Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220321071216.1549596-1-liu.yun@linux.dev Signed-off-by: Jens Axboe drivers/block/n64cart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 649bb75d19c93f5459f450191953dff4825fda3e Author: Almog Khaikin Date: Mon Mar 21 11:00:59 2022 +0200 io_uring: fix memory ordering when SQPOLL thread goes to sleep Without a full memory barrier between the store to the flags and the load of the SQ tail the two operations can be reordered and this can lead to a situation where the SQPOLL thread goes to sleep while the application writes to the SQ tail and doesn't see the wakeup flag. This memory barrier pairs with a full memory barrier in the application between its store to the SQ tail and its load of the flags. Signed-off-by: Almog Khaikin Link: https://lore.kernel.org/r/20220321090059.46313-1-almogkh@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 08719dd9176b4c55f547bd11812fd6cc35907d37 Author: Dongli Zhang Date: Thu Mar 17 15:09:30 2022 -0700 xen/blkfront: fix comment for need_copy The 'need_copy' is set when rq_data_dir(req) returns WRITE, in order to copy the written data to persistent page. ".need_copy = rq_data_dir(req) && info->feature_persistent," Signed-off-by: Dongli Zhang Fixes: c004a6fe0c40 ('block/xen-blkfront: Make it running on 64KB page granularity') Acked-by: Roger Pau Monné Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220317220930.5698-1-dongli.zhang@oracle.com Signed-off-by: Jens Axboe drivers/block/xen-blkfront.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 93b4e74789dbdefcffc7baac107069e74d98513c Author: Colin Ian King Date: Thu Mar 17 23:46:46 2022 +0000 xen-blkback: remove redundant assignment to variable i Variable i is being assigned a value that is never read, it is being re-assigned later in a for-loop. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/block/xen-blkback/blkback.c:934:14: warning: Although the value stored to 'i' is used in the enclosing expression, the value is never actually read from 'i' [deadcode.DeadStores] Signed-off-by: Colin Ian King Acked-by: Roger Pau Monné Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220317234646.78158-1-colin.i.king@gmail.com Signed-off-by: Jens Axboe drivers/block/xen-blkback/blkback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 53d862fac4a09b9c56cca0433fa9de5732fd05a1 Author: John David Anglin Date: Sat Mar 19 19:04:15 2022 +0000 parisc: Fix invalidate/flush vmap routines Cache move-in for virtual accesses is controlled by the TLB. Thus, we must generally purge TLB entries before flushing. The flush routines must use TLB entries that inhibit cache move-in. V2: Load physical address prior to flushing TLB. In flush_cache_page, flush TLB when flushing and purging. V3: Don't flush when start equals end. Signed-off-by: John David Anglin Signed-off-by: Helge Deller arch/parisc/kernel/cache.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) commit 5cb90dcb6ad569f4968da6dd841db10b91df5642 Author: Meng Tang Date: Mon Mar 21 14:57:54 2022 +0800 ASoC: fsl-asoc-card: Fix jack_event() always return 0 Today, hp_jack_event and mic_jack_event always return 0. However, snd_soc_dapm_disable_pin and snd_soc_dapm_enable_pin may return a non-zero value, this will cause the user who calling hp_jack_event and mic_jack_event don't know whether the operation was really successfully. Signed-off-by: Meng Tang Acked-by: Shengjiu Wang Reviewed-by: Christophe Leroy Link: https://lore.kernel.org/r/20220321065754.18307-1-tangmeng@uniontech.com Signed-off-by: Mark Brown sound/soc/fsl/fsl-asoc-card.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) commit 00f4150d27d2c01eaeffe1091fc311a7c0872c69 Author: Lucas De Marchi Date: Wed Mar 16 16:45:37 2022 -0700 drm/i915: Fix renamed struct field Earlier versions of commit a5b7ef27da60 ("drm/i915: Add struct to hold IP version") named "ver" as "arch" and then when it was renamed it missed the rename on MEDIA_VER_FULL() since it it's currently not used. Fixes: a5b7ef27da60 ("drm/i915: Add struct to hold IP version") Cc: José Roberto de Souza Cc: Matt Roper Signed-off-by: Lucas De Marchi Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220316234538.434357-1-lucas.demarchi@intel.com (cherry picked from commit b4ac33b973233dc08a56c8ef9d3c2edeab7a4370) Signed-off-by: Tvrtko Ursulin drivers/gpu/drm/i915/i915_drv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3ef8b5e19ead5a79600ea55f9549658281415893 Author: Ville Syrjälä Date: Wed Mar 9 18:49:46 2022 +0200 drm/i915: Fix PSF GV point mask when SAGV is not possible Don't just mask off all the PSF GV points when SAGV gets disabled. This should in fact cause the Pcode to reject the request since at least one PSF point must remain enabled at all times. Cc: stable@vger.kernel.org Cc: Stanislav Lisovskiy Fixes: 192fbfb76744 ("drm/i915: Implement PSF GV point support") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-7-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit 0fed4ddd18f064d2359b430c6e83ee60dd1f49b1) Signed-off-by: Tvrtko Ursulin drivers/gpu/drm/i915/display/intel_bw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 1937f3feb0e84089ae4065e09c871b8ab4676f01 Author: Ville Syrjälä Date: Wed Mar 9 18:49:41 2022 +0200 drm/i915: Treat SAGV block time 0 as SAGV disabled For modern platforms the spec explicitly states that a SAGV block time of zero means that SAGV is not supported. Let's extend that to all platforms. Supposedly there should be no systems where this isn't true, and it'll allow us to: - use the same code regardless of older vs. newer platform - wm latencies already treat 0 as disabled, so this fits well with other related code - make it a bit more clear when SAGV is used vs. not - avoid overflows from adding U32_MAX with a u16 wm0 latency value which could cause us to miscalculate the SAGV watermarks on tgl+ Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220309164948.10671-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit d8f5855b31c0523ea3b171db8dfb998830e8735d) Signed-off-by: Tvrtko Ursulin drivers/gpu/drm/i915/intel_pm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 9cddf03b2af07443bebdc73cba21acb360c079e8 Author: Ville Syrjälä Date: Fri Mar 11 23:28:45 2022 +0200 drm/i915: Reject unsupported TMDS rates on ICL+ ICL+ PLLs can't genenerate certain frequencies. Running the PLL algorithms through for all frequencies 25-594MHz we see a gap just above 500 MHz. Specifically 500-522.8MHZ for TC PLLs, and 500-533.2 MHz for combo PHY PLLs. Reject those frequencies hdmi_port_clock_valid() so that we properly filter out unsupported modes and/or color depths for HDMI. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5247 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220311212845.32358-1-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola (cherry picked from commit e5086cb3f3d3f94091be29eec38cf13f8a75a778) Signed-off-by: Tvrtko Ursulin drivers/gpu/drm/i915/display/intel_hdmi.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit a7663c89f4193dbf717572e46e5a3251940dbdc8 Author: Jiaxin Yu Date: Sat Mar 19 20:03:25 2022 +0800 ASoC: mediatek: mt6358: add missing EXPORT_SYMBOLs Fixes the following build errors when mt6358 is configured as module: >> ERROR: modpost: "mt6358_set_mtkaif_protocol" >> [sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.ko] undefined! >> ERROR: modpost: "mt6358_set_mtkaif_protocol" >> [sound/soc/mediatek/mt8186/mt8186-mt6366-da7219-max98357.ko] undefined! Fixes: 6a8d4198ca80 ("ASoC: mediatek: mt6358: add codec driver") Signed-off-by: Jiaxin Yu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220319120325.11882-1-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown sound/soc/codecs/mt6358.c | 4 ++++ 1 file changed, 4 insertions(+) commit e6980b572fb70bbd494dd62b4e2ca93a51d5fee5 Author: Casper Andersson Date: Fri Mar 18 13:53:31 2022 +0100 net: sparx5: Use vid 1 when bridge default vid 0 to avoid collision Standalone ports use vid 0. Let the bridge use vid 1 when "vlan_default_pvid 0" is set to avoid collisions. Since no VLAN is created when default pvid is 0 this is set at "PORT_ATTR_SET" and handled in the Switchdev fdb handler. Signed-off-by: Casper Andersson Signed-off-by: David S. Miller .../ethernet/microchip/sparx5/sparx5_switchdev.c | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) commit b8f7544a6cb384c079e3d626b3ee185086a7c0ef Author: Wan Jiabing Date: Fri Mar 18 17:31:53 2022 +0800 qed: remove unnecessary memset in qed_init_fw_funcs allocated_mem is allocated by kcalloc(). The memory is set to zero. It is unnecessary to call memset again. Signed-off-by: Wan Jiabing Signed-off-by: David S. Miller drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.c | 2 -- 1 file changed, 2 deletions(-) commit f22881de730ebd472e15bcc2c0d1d46e36a87b9c Author: Wang Yufen Date: Fri Mar 18 14:35:08 2022 +0800 netlabel: fix out-of-bounds memory accesses In calipso_map_cat_ntoh(), in the for loop, if the return value of netlbl_bitmap_walk() is equal to (net_clen_bits - 1), when netlbl_bitmap_walk() is called next time, out-of-bounds memory accesses of bitmap[byte_offset] occurs. The bug was found during fuzzing. The following is the fuzzing report BUG: KASAN: slab-out-of-bounds in netlbl_bitmap_walk+0x3c/0xd0 Read of size 1 at addr ffffff8107bf6f70 by task err_OH/252 CPU: 7 PID: 252 Comm: err_OH Not tainted 5.17.0-rc7+ #17 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x21c/0x230 show_stack+0x1c/0x60 dump_stack_lvl+0x64/0x7c print_address_description.constprop.0+0x70/0x2d0 __kasan_report+0x158/0x16c kasan_report+0x74/0x120 __asan_load1+0x80/0xa0 netlbl_bitmap_walk+0x3c/0xd0 calipso_opt_getattr+0x1a8/0x230 calipso_sock_getattr+0x218/0x340 calipso_sock_getattr+0x44/0x60 netlbl_sock_getattr+0x44/0x80 selinux_netlbl_socket_setsockopt+0x138/0x170 selinux_socket_setsockopt+0x4c/0x60 security_socket_setsockopt+0x4c/0x90 __sys_setsockopt+0xbc/0x2b0 __arm64_sys_setsockopt+0x6c/0x84 invoke_syscall+0x64/0x190 el0_svc_common.constprop.0+0x88/0x200 do_el0_svc+0x88/0xa0 el0_svc+0x128/0x1b0 el0t_64_sync_handler+0x9c/0x120 el0t_64_sync+0x16c/0x170 Reported-by: Hulk Robot Signed-off-by: Wang Yufen Acked-by: Paul Moore Signed-off-by: David S. Miller net/netlabel/netlabel_kapi.c | 2 ++ 1 file changed, 2 insertions(+) commit ed32641e06c62359020dacb873783f991c02566f Merge: 0caf6d992219 fc6d01ff9ef0 Author: David S. Miller Date: Mon Mar 21 10:56:19 2022 +0000 Merge branch 'ax25-fixes' Duoming Zhou says: ==================== Fix refcount leak and NPD bugs in ax25 The first patch fixes refcount leak in ax25 that could cause ax25-ex-connected-session-now-listening-state-bug. The second patch fixes NPD bugs in ax25 timers. ==================== Signed-off-by: David S. Miller commit fc6d01ff9ef03b66d4a3a23b46fc3c3d8cf92009 Author: Duoming Zhou Date: Fri Mar 18 08:54:05 2022 +0800 ax25: Fix NULL pointer dereferences in ax25 timers The previous commit 7ec02f5ac8a5 ("ax25: fix NPD bug in ax25_disconnect") move ax25_disconnect into lock_sock() in order to prevent NPD bugs. But there are race conditions that may lead to null pointer dereferences in ax25_heartbeat_expiry(), ax25_t1timer_expiry(), ax25_t2timer_expiry(), ax25_t3timer_expiry() and ax25_idletimer_expiry(), when we use ax25_kill_by_device() to detach the ax25 device. One of the race conditions that cause null pointer dereferences can be shown as below: (Thread 1) | (Thread 2) ax25_connect() | ax25_std_establish_data_link() | ax25_start_t1timer() | mod_timer(&ax25->t1timer,..) | | ax25_kill_by_device() (wait a time) | ... | s->ax25_dev = NULL; //(1) ax25_t1timer_expiry() | ax25->ax25_dev->values[..] //(2)| ... ... | We set null to ax25_cb->ax25_dev in position (1) and dereference the null pointer in position (2). The corresponding fail log is shown below: =============================================================== BUG: kernel NULL pointer dereference, address: 0000000000000050 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.17.0-rc6-00794-g45690b7d0 RIP: 0010:ax25_t1timer_expiry+0x12/0x40 ... Call Trace: call_timer_fn+0x21/0x120 __run_timers.part.0+0x1ca/0x250 run_timer_softirq+0x2c/0x60 __do_softirq+0xef/0x2f3 irq_exit_rcu+0xb6/0x100 sysvec_apic_timer_interrupt+0xa2/0xd0 ... This patch moves ax25_disconnect() before s->ax25_dev = NULL and uses del_timer_sync() to delete timers in ax25_disconnect(). If ax25_disconnect() is called by ax25_kill_by_device() or ax25->ax25_dev is NULL, the reason in ax25_disconnect() will be equal to ENETUNREACH, it will wait all timers to stop before we set null to s->ax25_dev in ax25_kill_by_device(). Fixes: 7ec02f5ac8a5 ("ax25: fix NPD bug in ax25_disconnect") Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller net/ax25/af_ax25.c | 4 ++-- net/ax25/ax25_subr.c | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) commit 9fd75b66b8f68498454d685dc4ba13192ae069b0 Author: Duoming Zhou Date: Fri Mar 18 08:54:04 2022 +0800 ax25: Fix refcount leaks caused by ax25_cb_del() The previous commit d01ffb9eee4a ("ax25: add refcount in ax25_dev to avoid UAF bugs") and commit feef318c855a ("ax25: fix UAF bugs of net_device caused by rebinding operation") increase the refcounts of ax25_dev and net_device in ax25_bind() and decrease the matching refcounts in ax25_kill_by_device() in order to prevent UAF bugs, but there are reference count leaks. The root cause of refcount leaks is shown below: (Thread 1) | (Thread 2) ax25_bind() | ... | ax25_addr_ax25dev() | ax25_dev_hold() //(1) | ... | dev_hold_track() //(2) | ... | ax25_destroy_socket() | ax25_cb_del() | ... | hlist_del_init() //(3) | | (Thread 3) | ax25_kill_by_device() | ... | ax25_for_each(s, &ax25_list) { | if (s->ax25_dev == ax25_dev) //(4) | ... | Firstly, we use ax25_bind() to increase the refcount of ax25_dev in position (1) and increase the refcount of net_device in position (2). Then, we use ax25_cb_del() invoked by ax25_destroy_socket() to delete ax25_cb in hlist in position (3) before calling ax25_kill_by_device(). Finally, the decrements of refcounts in ax25_kill_by_device() will not be executed, because no s->ax25_dev equals to ax25_dev in position (4). This patch adds decrements of refcounts in ax25_release() and use lock_sock() to do synchronization. If refcounts decrease in ax25_release(), the decrements of refcounts in ax25_kill_by_device() will not be executed and vice versa. Fixes: d01ffb9eee4a ("ax25: add refcount in ax25_dev to avoid UAF bugs") Fixes: 87563a043cef ("ax25: fix reference count leaks of ax25_dev") Fixes: feef318c855a ("ax25: fix UAF bugs of net_device caused by rebinding operation") Reported-by: Thomas Osterried Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller net/ax25/af_ax25.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) commit 825da4e9cec68713fbb02dc6f71fe1bf65fe8050 Author: Marc Zyngier Date: Mon Mar 21 10:48:43 2022 +0000 PCI: xgene: Revert "PCI: xgene: Fix IB window setup" Commit c7a75d07827a ("PCI: xgene: Fix IB window setup") tried to fix the damages that 6dce5aa59e0b ("PCI: xgene: Use inbound resources for setup") caused, but actually didn't improve anything for some plarforms (at least Mustang and m400 are still broken). Given that 6dce5aa59e0b has been reverted, revert this patch as well, restoring the PCIe support on XGene to its pre-5.5, working state. Link: https://lore.kernel.org/r/YjN8pT5e6/8cRohQ@xps13.dannf Link: https://lore.kernel.org/r/20220321104843.949645-3-maz@kernel.org Fixes: c7a75d07827a ("PCI: xgene: Fix IB window setup") Signed-off-by: Marc Zyngier Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org Cc: Rob Herring Cc: Toan Le Cc: Lorenzo Pieralisi Cc: Krzysztof Wilczyński Cc: Bjorn Helgaas Cc: Stéphane Graber Cc: dann frazier drivers/pci/controller/pci-xgene.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1874b6d7ab1bdc900e8398026350313ac29caddb Author: Marc Zyngier Date: Mon Mar 21 10:48:42 2022 +0000 PCI: xgene: Revert "PCI: xgene: Use inbound resources for setup" Commit 6dce5aa59e0b ("PCI: xgene: Use inbound resources for setup") killed PCIe on my XGene-1 box (a Mustang board). The machine itself is still alive, but half of its storage (over NVMe) is gone, and the NVMe driver just times out. Note that this machine boots with a device tree provided by the UEFI firmware (2016 vintage), which could well be non conformant with the spec, hence the breakage. With the patch reverted, the box boots 5.17-rc8 with flying colors. Link: https://lore.kernel.org/all/Yf2wTLjmcRj+AbDv@xps13.dannf Link: https://lore.kernel.org/r/20220321104843.949645-2-maz@kernel.org Fixes: 6dce5aa59e0b ("PCI: xgene: Use inbound resources for setup") Signed-off-by: Marc Zyngier Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org Cc: Rob Herring Cc: Toan Le Cc: Lorenzo Pieralisi Cc: Krzysztof Wilczyński Cc: Bjorn Helgaas Cc: Stéphane Graber Cc: dann frazier drivers/pci/controller/pci-xgene.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) commit 3387ce4d8a5f2956fab827edf499fe6780e83faa Author: Ingo Molnar Date: Mon Mar 21 11:05:50 2022 +0100 headers/prep: Fix header to build standalone: Add the dependency to , because cgroup_move_task() will dereference 'struct css_set'. ( Only older toolchains are affected, due to variations in the implementation of rcu_assign_pointer() et al. ) Cc: Peter Zijlstra Cc: Linus Torvalds Reported-by: Sachin Sant Reported-by: Andrew Morton Reported-by: Borislav Petkov Signed-off-by: Ingo Molnar include/linux/psi.h | 1 + 1 file changed, 1 insertion(+) commit a860f266a0e19f271b839451d291a6acf6ddcfe8 Author: Nathan Chancellor Date: Wed Mar 2 16:59:09 2022 -0700 drm/selftest: plane_helper: Put test structures in static storage Clang warns on certain 32-bit architectures: drivers/gpu/drm/selftests/test-drm_plane_helper.c:76:5: warning: stack frame size (1064) exceeds limit (1024) in 'igt_check_plane_state' [-Wframe-larger-than] int igt_check_plane_state(void *ignored) ^ 1 warning generated. The structures in igt_check_plane_state() total 1008 bytes, so any small amount of inlining will cause the stack frame to exceed the 32-bit limit of 1024, triggering the warning. Move these structures to static storage, which dramatically reduces the amount of stack space in igt_check_plane_state(). There is no testing impact, as igt_check_plane_state() is only called once in the driver. Fixes: 943e6a8beeac ("mock a drm_plane in igt_check_plane_state to make the test more robust") Link: https://github.com/ClangBuiltLinux/linux/issues/1600 Reported-by: kernel test robot Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220302235909.784935-1-nathan@kernel.org drivers/gpu/drm/selftests/test-drm_plane_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 1d204ee10817aed6666e020ef1b4c643d68bef11 Author: Zack Rusin Date: Fri Mar 18 13:43:32 2022 -0400 drm/ttm: Fix a kernel oops due to an invalid read The res is initialized here only if there's no errors so passing it to ttm_resource_fini in the error paths results in a kernel oops. In the error paths, instead of the unitialized res, we have to use to use node->base on which ttm_resource_init was called. Sample affected backtrace: Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d8 Mem abort info: ESR = 0x96000004 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=0000000106ac0000 [00000000000000d8] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 96000004 [#1] SMP Modules linked in: bnep vsock_loopback vmw_vsock_virtio_transport_common vsock snd_hda_codec_generic snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hwdep > CPU: 0 PID: 1197 Comm: gnome-shell Tainted: G U 5.17.0-rc2-vmwgfx #2 Hardware name: VMware, Inc. VBSA/VBSA, BIOS VEFI 12/31/2020 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : ttm_resource_fini+0x5c/0xac [ttm] lr : ttm_range_man_alloc+0x128/0x1e0 [ttm] sp : ffff80000d783510 x29: ffff80000d783510 x28: 0000000000000000 x27: ffff000086514400 x26: 0000000000000300 x25: ffff0000809f9e78 x24: 0000000000000000 x23: ffff80000d783680 x22: ffff000086514400 x21: 00000000ffffffe4 x20: ffff80000d7836a0 x19: ffff0000809f9e00 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000800 x12: ffff0000f2600a00 x11: 000000000000fc96 x10: 0000000000000000 x9 : ffff800001295c18 x8 : 0000000000000000 x7 : 0000000000000300 x6 : 0000000000000000 x5 : 0000000000000000 x4 : ffff0000f1034e20 x3 : ffff0000f1034600 x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000600000 Call trace: ttm_resource_fini+0x5c/0xac [ttm] ttm_range_man_alloc+0x128/0x1e0 [ttm] ttm_resource_alloc+0x58/0x90 [ttm] ttm_bo_mem_space+0xc8/0x3e4 [ttm] ttm_bo_validate+0xb4/0x134 [ttm] vmw_bo_pin_in_start_of_vram+0xbc/0x200 [vmwgfx] vmw_framebuffer_pin+0xc0/0x154 [vmwgfx] vmw_ldu_primary_plane_atomic_update+0x8c/0x6e0 [vmwgfx] drm_atomic_helper_commit_planes+0x11c/0x2e0 drm_atomic_helper_commit_tail+0x60/0xb0 commit_tail+0x1b0/0x210 drm_atomic_helper_commit+0x168/0x400 drm_atomic_commit+0x64/0x74 drm_atomic_helper_set_config+0xdc/0x11c drm_mode_setcrtc+0x1c4/0x780 drm_ioctl_kernel+0xd0/0x1a0 drm_ioctl+0x2c4/0x690 vmw_generic_ioctl+0xe0/0x174 [vmwgfx] vmw_unlocked_ioctl+0x24/0x30 [vmwgfx] __arm64_sys_ioctl+0xb4/0x100 invoke_syscall+0x78/0x100 el0_svc_common.constprop.0+0x54/0x184 do_el0_svc+0x34/0x9c el0_svc+0x48/0x1b0 el0t_64_sync_handler+0xa4/0x130 el0t_64_sync+0x1a4/0x1a8 Code: 35000260 f9401a81 52800002 f9403a60 (f9406c23) ---[ end trace 0000000000000000 ]--- Signed-off-by: Zack Rusin Fixes: de3688e469b0 ("drm/ttm: add ttm_resource_fini v2") Cc: Christian König Cc: Daniel Vetter Reviewed-by: Martin Krastev Reviewed-by: Christian König Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20220318174332.440068-6-zack@kde.org drivers/gpu/drm/ttm/ttm_range_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1422df58e5eb83dca131dc64e0f307a1f9e56078 Merge: e1bca853dddc 2151c84ece92 Author: Borislav Petkov Date: Mon Mar 21 10:34:57 2022 +0100 Merge branch 'edac-amd64' into edac-updates-for-v5.18 Signed-off-by: Borislav Petkov commit 873dd122172f8cce329113cfb0dfe3d2344d80c0 Author: Paolo Bonzini Date: Fri Mar 18 12:30:32 2022 -0400 Revert "KVM: x86/mmu: Zap only TDP MMU leafs in kvm_zap_gfn_range()" This reverts commit cf3e26427c08ad9015956293ab389004ac6a338e. Multi-vCPU Hyper-V guests started crashing randomly on boot with the latest kvm/queue and the problem can be bisected the problem to this particular patch. Basically, I'm not able to boot e.g. 16-vCPU guest successfully anymore. Both Intel and AMD seem to be affected. Reverting the commit saves the day. Reported-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 4 ++-- arch/x86/kvm/mmu/tdp_mmu.c | 41 ++++++++++++++++++++++++++++++----------- arch/x86/kvm/mmu/tdp_mmu.h | 8 +++++++- 3 files changed, 39 insertions(+), 14 deletions(-) commit fcb93eb6d09dd302cbef22bd95a5858af75e4156 Author: Paolo Bonzini Date: Mon Mar 21 05:05:08 2022 -0400 kvm: x86/mmu: Flush TLB before zap_gfn_range releases RCU Since "KVM: x86/mmu: Zap only TDP MMU leafs in kvm_zap_gfn_range()" is going to be reverted, it's not going to be true anymore that the zap-page flow does not free any 'struct kvm_mmu_page'. Introduce an early flush before tdp_mmu_zap_leafs() returns, to preserve bisectability. Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) commit a949087c2285c8de4f0f204cab2d4eece9d929a2 Author: Colin Ian King Date: Sun Mar 20 22:01:12 2022 -0700 Input: adi - remove redundant variable z Variable z is being assigned a value that is never read, the variable is redundant and can be removed. Cleans up clang scan build warning: drivers/input/joystick/adi.c:139:6: warning: Although the value stored to 'z' is used in the enclosing expression, the value is never actually read from 'z' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220318002318.80519-1-colin.i.king@gmail.com Signed-off-by: Dmitry Torokhov drivers/input/joystick/adi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a23ba3c043db9a2e8c967a3ff66dcedc5725afdf Author: Markuss Broks Date: Mon Mar 14 22:56:19 2022 -0700 Input: add Imagis touchscreen driver Add support for the IST3038C touchscreen IC from Imagis, based on downstream driver. The driver supports multi-touch (10 touch points) The IST3038C IC supports touch keys, but the support isn't added because the touch screen used for testing doesn't utilize touch keys. Looking at the downstream driver, it is possible to add support for other Imagis ICs of IST30**C series. Reviewed-by: Jeff LaBundy Signed-off-by: Markuss Broks Link: https://lore.kernel.org/r/20220305165330.13061-3-markuss.broks@gmail.com Signed-off-by: Dmitry Torokhov MAINTAINERS | 6 + drivers/input/touchscreen/Kconfig | 10 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/imagis.c | 367 +++++++++++++++++++++++++++++++++++++ 4 files changed, 384 insertions(+) commit 0ce25e4b6df8ae6b9cf7c04d219050c5129bfb87 Author: Markuss Broks Date: Mon Mar 14 22:56:04 2022 -0700 dt-bindings: input/touchscreen: bindings for Imagis This patch adds device-tree bindings for the Imagis IST3038C touch screen IC. Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Markuss Broks Link: https://lore.kernel.org/r/20220305165330.13061-2-markuss.broks@gmail.com Signed-off-by: Dmitry Torokhov .../input/touchscreen/imagis,ist3038c.yaml | 74 ++++++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + 2 files changed, 76 insertions(+) commit e4ce4d3a939d97bea045eafa13ad1195695f91ce Author: Matthew Haughton Date: Sun Mar 20 21:57:49 2022 -0700 Input: synaptics - enable InterTouch on ThinkPad T14/P14s Gen 1 AMD Confirmed LEN2064 on my P14s works with psmouse.synaptics_intertouch=1 By all accounts T14 and P14s are the same hardware which only differ by model identifier. Signed-off-by: Matthew Haughton Link: https://lore.kernel.org/r/20220318113949.32722-1-snafu109@gmail.com Signed-off-by: Dmitry Torokhov drivers/input/mouse/synaptics.c | 1 + 1 file changed, 1 insertion(+) commit 26623eea0da3476446909af96c980768df07bbd9 Author: Zheng Yongjun Date: Sun Mar 20 21:56:38 2022 -0700 Input: stmfts - fix reference leak in stmfts_input_open pm_runtime_get_sync() will increment pm usage counter even it failed. Forgetting to call pm_runtime_put_noidle will result in reference leak in stmfts_input_open, so we should fix it. Signed-off-by: Zheng Yongjun Link: https://lore.kernel.org/r/20220317131604.53538-1-zhengyongjun3@huawei.com Signed-off-by: Dmitry Torokhov drivers/input/touchscreen/stmfts.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 409353cbe9fe48f6bc196114c442b1cff05a39bc Author: Jeff LaBundy Date: Sun Mar 20 21:55:27 2022 -0700 Input: add bounds checking to input_set_capability() Update input_set_capability() to prevent kernel panic in case the event code exceeds the bitmap for the given event type. Suggested-by: Tomasz Moń Signed-off-by: Jeff LaBundy Reviewed-by: Tomasz Moń Link: https://lore.kernel.org/r/20220320032537.545250-1-jeff@labundy.com Signed-off-by: Dmitry Torokhov drivers/input/input.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) commit 07fc21b486081d8974239143089723f05e552157 Author: Jeff LaBundy Date: Sun Mar 20 21:54:32 2022 -0700 Input: iqs5xx - use local input_dev pointer Both iqs5xx_axis_init() and iqs5xx_irq() already define a local input_dev pointer 'input'. Use this instead of iqs5xx->input so as to make the code a bit smaller. Signed-off-by: Jeff LaBundy Link: https://lore.kernel.org/r/20220320025707.404544-1-jeff@labundy.com Signed-off-by: Dmitry Torokhov drivers/input/touchscreen/iqs5xx.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit c6e90a1c660874736bd09c1fec6312b4b4c2ff7b Merge: f11de8611fd6 426c89aa203b Author: Dave Airlie Date: Mon Mar 21 13:48:19 2022 +1000 Merge tag 'amd-drm-next-5.18-2022-03-18' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.18-2022-03-18: amdgpu: - Aldebaran fixes - SMU 13.0.5 fixes - DCN 3.1.5 fixes - DCN 3.1.6 fixes - Pipe split fixes - More display FP cleanup - DP 2.0 UHBR fix - DC GPU reset fix - DC deep color ratio fix - SMU robustness fixes - Runtime PM fix for APUs - IGT reload fixes - SR-IOV fix - Misc fixes and cleanups amdkfd: - CRIU fixes - SVM fixes UAPI: - Properly handle SDMA transfers with CRIU Proposed user mode change: https://github.com/checkpoint-restore/criu/pull/1709 Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220318203717.5833-1-alexander.deucher@amd.com commit 7ada3787e91c89b0aa7abf47682e8e587b855c13 Author: Kumar Kartikeya Dwivedi Date: Sun Mar 20 20:00:03 2022 +0530 bpf: Check for NULL return from bpf_get_btf_vmlinux When CONFIG_DEBUG_INFO_BTF is disabled, bpf_get_btf_vmlinux can return a NULL pointer. Check for it in btf_get_module_btf to prevent a NULL pointer dereference. While kernel test robot only complained about this specific case, let's also check for NULL in other call sites of bpf_get_btf_vmlinux. Fixes: 9492450fd287 ("bpf: Always raise reference in btf_get_module_btf") Reported-by: kernel test robot Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220320143003.589540-1-memxor@gmail.com kernel/bpf/btf.c | 6 +++++- net/core/bpf_sk_storage.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) commit fe2640bd7a62f1f7c3f55fbda31084085075bc30 Author: Michael Ellerman Date: Fri Mar 18 14:42:19 2022 +1100 powerpc/pseries: Fix use after free in remove_phb_dynamic() In remove_phb_dynamic() we use &phb->io_resource, after we've called device_unregister(&host_bridge->dev). But the unregister may have freed phb, because pcibios_free_controller_deferred() is the release function for the host_bridge. If there are no outstanding references when we call device_unregister() then phb will be freed out from under us. This has gone mainly unnoticed, but with slub_debug and page_poison enabled it can lead to a crash: PID: 7574 TASK: c0000000d492cb80 CPU: 13 COMMAND: "drmgr" #0 [c0000000e4f075a0] crash_kexec at c00000000027d7dc #1 [c0000000e4f075d0] oops_end at c000000000029608 #2 [c0000000e4f07650] __bad_page_fault at c0000000000904b4 #3 [c0000000e4f076c0] do_bad_slb_fault at c00000000009a5a8 #4 [c0000000e4f076f0] data_access_slb_common_virt at c000000000008b30 Data SLB Access [380] exception frame: R0: c000000000167250 R1: c0000000e4f07a00 R2: c000000002a46100 R3: c000000002b39ce8 R4: 00000000000000c0 R5: 00000000000000a9 R6: 3894674d000000c0 R7: 0000000000000000 R8: 00000000000000ff R9: 0000000000000100 R10: 6b6b6b6b6b6b6b6b R11: 0000000000008000 R12: c00000000023da80 R13: c0000009ffd38b00 R14: 0000000000000000 R15: 000000011c87f0f0 R16: 0000000000000006 R17: 0000000000000003 R18: 0000000000000002 R19: 0000000000000004 R20: 0000000000000005 R21: 000000011c87ede8 R22: 000000011c87c5a8 R23: 000000011c87d3a0 R24: 0000000000000000 R25: 0000000000000001 R26: c0000000e4f07cc8 R27: c00000004d1cc400 R28: c0080000031d00e8 R29: c00000004d23d800 R30: c00000004d1d2400 R31: c00000004d1d2540 NIP: c000000000167258 MSR: 8000000000009033 OR3: c000000000e9f474 CTR: 0000000000000000 LR: c000000000167250 XER: 0000000020040003 CCR: 0000000024088420 MQ: 0000000000000000 DAR: 6b6b6b6b6b6b6ba3 DSISR: c0000000e4f07920 Syscall Result: fffffffffffffff2 [NIP : release_resource+56] [LR : release_resource+48] #5 [c0000000e4f07a00] release_resource at c000000000167258 (unreliable) #6 [c0000000e4f07a30] remove_phb_dynamic at c000000000105648 #7 [c0000000e4f07ab0] dlpar_remove_slot at c0080000031a09e8 [rpadlpar_io] #8 [c0000000e4f07b50] remove_slot_store at c0080000031a0b9c [rpadlpar_io] #9 [c0000000e4f07be0] kobj_attr_store at c000000000817d8c #10 [c0000000e4f07c00] sysfs_kf_write at c00000000063e504 #11 [c0000000e4f07c20] kernfs_fop_write_iter at c00000000063d868 #12 [c0000000e4f07c70] new_sync_write at c00000000054339c #13 [c0000000e4f07d10] vfs_write at c000000000546624 #14 [c0000000e4f07d60] ksys_write at c0000000005469f4 #15 [c0000000e4f07db0] system_call_exception at c000000000030840 #16 [c0000000e4f07e10] system_call_vectored_common at c00000000000c168 To avoid it, we can take a reference to the host_bridge->dev until we're done using phb. Then when we drop the reference the phb will be freed. Fixes: 2dd9c11b9d4d ("powerpc/pseries: use pci_host_bridge.release_fn() to kfree(phb)") Reported-by: David Dai Signed-off-by: Michael Ellerman Tested-by: Sachin Sant Link: https://lore.kernel.org/r/20220318034219.1188008-1-mpe@ellerman.id.au arch/powerpc/platforms/pseries/pci_dlpar.c | 4 ++++ 1 file changed, 4 insertions(+) commit e1cc1f39981b06ba22a0c92e800e9fd8ba59d2d3 Author: Namhyung Kim Date: Mon Mar 14 11:20:42 2022 -0700 selftests/bpf: Test skipping stacktrace Add a test case for stacktrace with skip > 0 using a small sized buffer. It didn't support skipping entries greater than or equal to the size of buffer and filled the skipped part with 0. Signed-off-by: Namhyung Kim Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220314182042.71025-2-namhyung@kernel.org .../selftests/bpf/prog_tests/stacktrace_map_skip.c | 63 ++++++++++++++++++++ .../selftests/bpf/progs/stacktrace_map_skip.c | 68 ++++++++++++++++++++++ 2 files changed, 131 insertions(+) commit ee2a098851bfbe8bcdd964c0121f4246f00ff41e Author: Namhyung Kim Date: Mon Mar 14 11:20:41 2022 -0700 bpf: Adjust BPF stack helper functions to accommodate skip > 0 Let's say that the caller has storage for num_elem stack frames. Then, the BPF stack helper functions walk the stack for only num_elem frames. This means that if skip > 0, one keeps only 'num_elem - skip' frames. This is because it sets init_nr in the perf_callchain_entry to the end of the buffer to save num_elem entries only. I believe it was because the perf callchain code unwound the stack frames until it reached the global max size (sysctl_perf_event_max_stack). However it now has perf_callchain_entry_ctx.max_stack to limit the iteration locally. This simplifies the code to handle init_nr in the BPF callstack entries and removes the confusion with the perf_event's __PERF_SAMPLE_CALLCHAIN_EARLY which sets init_nr to 0. Also change the comment on bpf_get_stack() in the header file to be more explicit what the return value means. Fixes: c195651e565a ("bpf: add bpf_get_stack helper") Signed-off-by: Namhyung Kim Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/30a7b5d5-6726-1cc2-eaee-8da2828a9a9c@oracle.com Link: https://lore.kernel.org/bpf/20220314182042.71025-1-namhyung@kernel.org Based-on-patch-by: Eugene Loh include/uapi/linux/bpf.h | 8 +++---- kernel/bpf/stackmap.c | 56 +++++++++++++++++++++--------------------------- 2 files changed, 28 insertions(+), 36 deletions(-) commit ef078600eec20f20eb7833cf597d4a5edf2953c1 Author: Song Liu Date: Fri Mar 11 12:11:35 2022 -0800 bpf: Select proper size for bpf_prog_pack Using HPAGE_PMD_SIZE as the size for bpf_prog_pack is not ideal in some cases. Specifically, for NUMA systems, __vmalloc_node_range requires PMD_SIZE * num_online_nodes() to allocate huge pages. Also, if the system does not support huge pages (i.e., with cmdline option nohugevmalloc), it is better to use PAGE_SIZE packs. Add logic to select proper size for bpf_prog_pack. This solution is not ideal, as it makes assumption about the behavior of module_alloc and __vmalloc_node_range. However, it appears to be the easiest solution as it doesn't require changes in module_alloc and vmalloc code. Fixes: 57631054fae6 ("bpf: Introduce bpf_prog_pack allocator") Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220311201135.3573610-1-song@kernel.org kernel/bpf/core.c | 70 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 23 deletions(-) commit 46e9244b2563cc53acc63b57f5eb2999fa729c60 Merge: 30630e44b658 ce5236800116 Author: Alexei Starovoitov Date: Sun Mar 20 18:59:00 2022 -0700 Merge branch 'Make 2-byte access to bpf_sk_lookup->remote_port endian-agnostic' Jakub Sitnicki says: ==================== This patch set is a result of a discussion we had around the RFC patchset from Ilya [1]. The fix for the narrow loads from the RFC series is still relevant, but this series does not depend on it. Nor is it required to unbreak sk_lookup tests on BE, if this series gets applied. To summarize the takeaways from [1]: 1) we want to make 2-byte load from ctx->remote_port portable across LE and BE, 2) we keep the 4-byte load from ctx->remote_port as it is today - result varies on endianess of the platform. [1] https://lore.kernel.org/bpf/20220222182559.2865596-2-iii@linux.ibm.com/ v1 -> v2: - Remove needless check that 4-byte load is from &ctx->remote_port offset (Martin) [v1]: https://lore.kernel.org/bpf/20220317165826.1099418-1-jakub@cloudflare.com/ ==================== Signed-off-by: Alexei Starovoitov commit ce5236800116d18ac2c06c58f73930406e3ea4be Author: Jakub Sitnicki Date: Sat Mar 19 19:33:56 2022 +0100 selftests/bpf: Fix test for 4-byte load from remote_port on big-endian The context access converter rewrites the 4-byte load from bpf_sk_lookup->remote_port to a 2-byte load from bpf_sk_lookup_kern structure. It means that we cannot treat the destination register contents as a 32-bit value, or the code will not be portable across big- and little-endian architectures. This is exactly the same case as with 4-byte loads from bpf_sock->dst_port so follow the approach outlined in [1] and treat the register contents as a 16-bit value in the test. [1]: https://lore.kernel.org/bpf/20220317113920.1068535-5-jakub@cloudflare.com/ Fixes: 2ed0dc5937d3 ("selftests/bpf: Cover 4-byte load from remote_port in bpf_sk_lookup") Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220319183356.233666-4-jakub@cloudflare.com tools/testing/selftests/bpf/progs/test_sk_lookup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 3c69611b8926f8e74fcf76bd97ae0e5dafbeb26a Author: Jakub Sitnicki Date: Sat Mar 19 19:33:55 2022 +0100 selftests/bpf: Fix u8 narrow load checks for bpf_sk_lookup remote_port In commit 9a69e2b385f4 ("bpf: Make remote_port field in struct bpf_sk_lookup 16-bit wide") ->remote_port field changed from __u32 to __be16. However, narrow load tests which exercise 1-byte sized loads from offsetof(struct bpf_sk_lookup, remote_port) were not adopted to reflect the change. As a result, on little-endian we continue testing loads from addresses: - (__u8 *)&ctx->remote_port + 3 - (__u8 *)&ctx->remote_port + 4 which map to the zero padding following the remote_port field, and don't break the tests because there is no observable change. While on big-endian, we observe breakage because tests expect to see zeros for values loaded from: - (__u8 *)&ctx->remote_port - 1 - (__u8 *)&ctx->remote_port - 2 Above addresses map to ->remote_ip6 field, which precedes ->remote_port, and are populated during the bpf_sk_lookup IPv6 tests. Unsurprisingly, on s390x we observe: #136/38 sk_lookup/narrow access to ctx v4:OK #136/39 sk_lookup/narrow access to ctx v6:FAIL Fix it by removing the checks for 1-byte loads from offsets outside of the ->remote_port field. Fixes: 9a69e2b385f4 ("bpf: Make remote_port field in struct bpf_sk_lookup 16-bit wide") Suggested-by: Ilya Leoshkevich Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220319183356.233666-3-jakub@cloudflare.com tools/testing/selftests/bpf/progs/test_sk_lookup.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 058ec4a7d9cf77238c73ad9f1e1a3ed9a29afcab Author: Jakub Sitnicki Date: Sat Mar 19 19:33:54 2022 +0100 bpf: Treat bpf_sk_lookup remote_port as a 2-byte field In commit 9a69e2b385f4 ("bpf: Make remote_port field in struct bpf_sk_lookup 16-bit wide") the remote_port field has been split up and re-declared from u32 to be16. However, the accompanying changes to the context access converter have not been well thought through when it comes big-endian platforms. Today 2-byte wide loads from offsetof(struct bpf_sk_lookup, remote_port) are handled as narrow loads from a 4-byte wide field. This by itself is not enough to create a problem, but when we combine 1. 32-bit wide access to ->remote_port backed by a 16-wide wide load, with 2. inherent difference between litte- and big-endian in how narrow loads need have to be handled (see bpf_ctx_narrow_access_offset), we get inconsistent results for a 2-byte loads from &ctx->remote_port on LE and BE architectures. This in turn makes BPF C code for the common case of 2-byte load from ctx->remote_port not portable. To rectify it, inform the context access converter that remote_port is 2-byte wide field, and only 1-byte loads need to be treated as narrow loads. At the same time, we special-case the 4-byte load from &ctx->remote_port to continue handling it the same way as do today, in order to keep the existing BPF programs working. Fixes: 9a69e2b385f4 ("bpf: Make remote_port field in struct bpf_sk_lookup 16-bit wide") Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220319183356.233666-2-jakub@cloudflare.com net/core/filter.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) commit 30630e44b6580f17724b6c5921a2a540bf06d6af Merge: a8fee96202e2 0e790cbb1af9 Author: Alexei Starovoitov Date: Sun Mar 20 18:55:05 2022 -0700 Merge branch 'Enable non-atomic allocations in local storage' Joanne Koong says: ==================== From: Joanne Koong Currently, local storage memory can only be allocated atomically (GFP_ATOMIC). This restriction is too strict for sleepable bpf programs. In this patchset, sleepable programs can allocate memory in local storage using GFP_KERNEL, while non-sleepable programs always default to GFP_ATOMIC. v3 <- v2: * Add extra case to local_storage.c selftest to test associating multiple elements with the local storage, which triggers a GFP_KERNEL allocation in local_storage_update(). * Cast gfp_t to __s32 in verifier to fix the sparse warnings v2 <- v1: * Allocate the memory before/after the raw_spin_lock_irqsave, depending on the gfp flags * Rename mem_flags to gfp_flags * Reword the comment "*mem_flags* is set by the bpf verifier" to "*gfp_flags* is a hidden argument provided by the verifier" * Add a sentence to the commit message about existing local storage selftests covering both the GFP_ATOMIC and GFP_KERNEL paths in bpf_local_storage_update. ==================== Signed-off-by: Alexei Starovoitov commit 0e790cbb1af97473d3ea53616f8584a71f80fc3b Author: Joanne Koong Date: Thu Mar 17 21:55:53 2022 -0700 selftests/bpf: Test for associating multiple elements with the local storage This patch adds a few calls to the existing local storage selftest to test that we can associate multiple elements with the local storage. The sleepable program's call to bpf_sk_storage_get with sk_storage_map2 will lead to an allocation of a new selem under the GFP_KERNEL flag. Signed-off-by: Joanne Koong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220318045553.3091807-3-joannekoong@fb.com tools/testing/selftests/bpf/progs/local_storage.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) commit b00fa38a9c1cba044a32a601b49a55a18ed719d1 Author: Joanne Koong Date: Thu Mar 17 21:55:52 2022 -0700 bpf: Enable non-atomic allocations in local storage Currently, local storage memory can only be allocated atomically (GFP_ATOMIC). This restriction is too strict for sleepable bpf programs. In this patch, the verifier detects whether the program is sleepable, and passes the corresponding GFP_KERNEL or GFP_ATOMIC flag as a 5th argument to bpf_task/sk/inode_storage_get. This flag will propagate down to the local storage functions that allocate memory. Please note that bpf_task/sk/inode_storage_update_elem functions are invoked by userspace applications through syscalls. Preemption is disabled before bpf_task/sk/inode_storage_update_elem is called, which means they will always have to allocate memory atomically. Signed-off-by: Joanne Koong Signed-off-by: Alexei Starovoitov Acked-by: KP Singh Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220318045553.3091807-2-joannekoong@fb.com include/linux/bpf_local_storage.h | 7 +++-- kernel/bpf/bpf_inode_storage.c | 9 +++--- kernel/bpf/bpf_local_storage.c | 58 +++++++++++++++++++++++++-------------- kernel/bpf/bpf_task_storage.c | 10 ++++--- kernel/bpf/verifier.c | 20 ++++++++++++++ net/core/bpf_sk_storage.c | 21 ++++++++------ 6 files changed, 84 insertions(+), 41 deletions(-) commit a8fee96202e279441d0e52d83eb100bd4a6d6272 Author: Andrii Nakryiko Date: Sat Mar 19 17:19:11 2022 -0700 libbpf: Avoid NULL deref when initializing map BTF info If BPF object doesn't have an BTF info, don't attempt to search for BTF types describing BPF map key or value layout. Fixes: 262cfb74ffda ("libbpf: Init btf_{key,value}_type_id on internal map open") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220320001911.3640917-1-andrii@kernel.org tools/lib/bpf/libbpf.c | 3 +++ 1 file changed, 3 insertions(+) commit f63cf5192fe3418ad5ae1a4412eba5694b145f79 Author: Jens Axboe Date: Sun Mar 20 13:08:38 2022 -0600 io_uring: ensure that fsnotify is always called Ensure that we call fsnotify_modify() if we write a file, and that we do fsnotify_access() if we read it. This enables anyone using inotify on the file to get notified. Ditto for fallocate, ensure that fsnotify_modify() is called. Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe fs/io_uring.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 6ac02df3fff71ddacc71e2ae79b73c16873b41c5 Author: Rob Herring Date: Wed Mar 9 19:35:27 2022 -0600 dt-bindings: virtio,mmio: Allow setting devices 'dma-coherent' 'virtio,mmio' devices are always coherent within a guest. As Arm DTs are default non-coherent, the 'dma-coherent' property needs to be set on the virtio device to mark them as such. This aligns with the QEMU 'virt' machine DTB. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220310013528.549030-1-robh@kernel.org Documentation/devicetree/bindings/virtio/mmio.yaml | 2 ++ 1 file changed, 2 insertions(+) commit 094b10cb795a85e2f90f03c24b030888ab2f1fa3 Author: Linus Walleij Date: Thu Mar 17 23:58:43 2022 +0100 dt-bindings: gnss: Add two more chips The CSR GSD4t is a CSR product using the SiRFstarIV core, and the CSR CSRG05TA03-ICJE-R is a CSR product using the SiRFstarV core. These chips have a SRESETN line that can be pulled low to hard reset the chip and in some designs this is connected to a GPIO, so add this as an optional property. Update the example with a reset line so users see that it need to be tagged as active low. Cc: devicetree@vger.kernel.org Cc: Krzysztof Kozlowski Signed-off-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220317225844.1262643-4-linus.walleij@linaro.org Documentation/devicetree/bindings/gnss/sirfstar.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) commit 5505409e423f61c981d84f53dee2a93bf3ba5913 Author: Linus Walleij Date: Thu Mar 17 23:58:42 2022 +0100 dt-bindings: gnss: Rewrite sirfstar binding in YAML This rewrites the SiRFstar DT bindings in YAML. Cc: devicetree@vger.kernel.org Cc: Krzysztof Kozlowski Signed-off-by: Linus Walleij Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220317225844.1262643-3-linus.walleij@linaro.org .../devicetree/bindings/gnss/sirfstar.txt | 46 --------------- .../devicetree/bindings/gnss/sirfstar.yaml | 68 ++++++++++++++++++++++ 2 files changed, 68 insertions(+), 46 deletions(-) commit 069e6bc6dba532604050f559a5c06fb1525cec04 Author: Linus Walleij Date: Thu Mar 17 23:58:41 2022 +0100 dt-bindings: gnss: Modify u-blox to use common bindings This modifies the existing U-Blox GNSS bindings to reference the common GNSS YAML bindings. Fixed an unrelated whitespace error while at it. Cc: devicetree@vger.kernel.org Cc: Krzysztof Kozlowski Signed-off-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220317225844.1262643-2-linus.walleij@linaro.org Documentation/devicetree/bindings/gnss/u-blox,neo-6m.yaml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) commit dba529605f55e7eee725dd8e48a70f95ecdd612c Author: Linus Walleij Date: Thu Mar 17 23:58:40 2022 +0100 dt-bindings: gnss: Rewrite common bindings in YAML This rewrites the text-based GNSS common bindings to use a YAML schema. Cc: devicetree@vger.kernel.org Reviewed-by: Krzysztof Kozlowski Signed-off-by: Linus Walleij Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220317225844.1262643-1-linus.walleij@linaro.org .../devicetree/bindings/gnss/gnss-common.yaml | 55 ++++++++++++++++++++++ Documentation/devicetree/bindings/gnss/gnss.txt | 37 --------------- 2 files changed, 55 insertions(+), 37 deletions(-) commit 8d10ea152e2fb9b4a42b282cb90bfc4d98e319a3 Author: Tom Rix Date: Sun Mar 20 06:59:54 2022 -0700 ipmi: initialize len variable Clang static analysis reports this issue ipmi_ssif.c:1731:3: warning: 4th function call argument is an uninitialized value dev_info(&ssif_info->client->dev, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 4th parameter is the 'len' variable. len is only set by a successful call to do_cmd(). Initialize to len 0. Signed-off-by: Tom Rix Message-Id: <20220320135954.2258545-1-trix@redhat.com> Signed-off-by: Corey Minyard drivers/char/ipmi/ipmi_ssif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a3d0245c58f962ee99d4440ea0eaf45fb7f5a5cc Author: Max Filippov Date: Sun Mar 20 09:40:14 2022 -0700 xtensa: fix xtensa_wsr always writing 0 The commit cad6fade6e78 ("xtensa: clean up WSR*/RSR*/get_sr/set_sr") replaced 'WSR' macro in the function xtensa_wsr with 'xtensa_set_sr', but variable 'v' in the xtensa_set_sr body shadowed the argument 'v' passed to it, resulting in wrong value written to debug registers. Fix that by removing intermediate variable from the xtensa_set_sr macro body. Cc: stable@vger.kernel.org Fixes: cad6fade6e78 ("xtensa: clean up WSR*/RSR*/get_sr/set_sr") Signed-off-by: Max Filippov arch/xtensa/include/asm/processor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4fc5f5346592cdc91689455d83885b0af65d71b8 Author: Jakob Koschel Date: Sat Mar 19 21:27:04 2022 +0100 nfsd: fix using the correct variable for sizeof() While the original code is valid, it is not the obvious choice for the sizeof() call and in preparation to limit the scope of the list iterator variable the sizeof should be changed to the size of the destination. Signed-off-by: Jakob Koschel Signed-off-by: Chuck Lever fs/nfsd/nfs4layouts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1b699bf3a8786f7d41eebd9f6ba673185fa5b6bd Author: Tobias Klauser Date: Wed Mar 2 16:11:09 2022 +0100 ksmbd: use netif_is_bridge_port Use netif_is_bridge_port defined in instead of open-coding it. Acked-by: Namjae Jeon Signed-off-by: Tobias Klauser Signed-off-by: Steve French fs/ksmbd/transport_tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9c1666831817ce56482a1f1fd1fbb65dbc8acaab Author: Namjae Jeon Date: Fri Feb 4 07:30:01 2022 +0900 Documentation: ksmbd: update Feature Status table As RDMA connection with Windows client becomes possible, change SMB direct to Supported from Partially Supported in the Feature Status table. It also adds new RSS mode support. Signed-off-by: Namjae Jeon Signed-off-by: Steve French Documentation/filesystems/cifs/ksmbd.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 01728b44ef1b714756607be0210fbcf60c78efce Author: Dave Chinner Date: Thu Mar 17 09:09:13 2022 -0700 xfs: xfs_is_shutdown vs xlog_is_shutdown cage fight I've been chasing a recent resurgence in generic/388 recovery failure and/or corruption events. The events have largely been uninitialised inode chunks being tripped over in log recovery such as: XFS (pmem1): User initiated shutdown received. pmem1: writeback error on inode 12621949, offset 1019904, sector 12968096 XFS (pmem1): Log I/O Error (0x6) detected at xfs_fs_goingdown+0xa3/0xf0 (fs/xfs/xfs_fsops.c:500). Shutting down filesystem. XFS (pmem1): Please unmount the filesystem and rectify the problem(s) XFS (pmem1): Unmounting Filesystem XFS (pmem1): Mounting V5 Filesystem XFS (pmem1): Starting recovery (logdev: internal) XFS (pmem1): bad inode magic/vsn daddr 8723584 #0 (magic=1818) XFS (pmem1): Metadata corruption detected at xfs_inode_buf_verify+0x180/0x190, xfs_inode block 0x851c80 xfs_inode_buf_verify XFS (pmem1): Unmount and run xfs_repair XFS (pmem1): First 128 bytes of corrupted metadata buffer: 00000000: 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 ................ 00000010: 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 ................ 00000020: 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 ................ 00000030: 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 ................ 00000040: 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 ................ 00000050: 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 ................ 00000060: 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 ................ 00000070: 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 ................ XFS (pmem1): metadata I/O error in "xlog_recover_items_pass2+0x52/0xc0" at daddr 0x851c80 len 32 error 117 XFS (pmem1): log mount/recovery failed: error -117 XFS (pmem1): log mount failed There have been isolated random other issues, too - xfs_repair fails because it finds some corruption in symlink blocks, rmap inconsistencies, etc - but they are nowhere near as common as the uninitialised inode chunk failure. The problem has clearly happened at runtime before recovery has run; I can see the ICREATE log item in the log shortly before the actively recovered range of the log. This means the ICREATE was definitely created and written to the log, but for some reason the tail of the log has been moved past the ordered buffer log item that tracks INODE_ALLOC buffers and, supposedly, prevents the tail of the log moving past the ICREATE log item before the inode chunk buffer is written to disk. Tracing the fsstress processes that are running when the filesystem shut down immediately pin-pointed the problem: user shutdown marks xfs_mount as shutdown godown-213341 [008] 6398.022871: console: [ 6397.915392] XFS (pmem1): User initiated shutdown received. ..... aild tries to push ordered inode cluster buffer xfsaild/pmem1-213314 [001] 6398.022974: xfs_buf_trylock: dev 259:1 daddr 0x851c80 bbcount 0x20 hold 16 pincount 0 lock 0 flags DONE|INODES|PAGES caller xfs_inode_item_push+0x8e xfsaild/pmem1-213314 [001] 6398.022976: xfs_ilock_nowait: dev 259:1 ino 0x851c80 flags ILOCK_SHARED caller xfs_iflush_cluster+0xae xfs_iflush_cluster() checks xfs_is_shutdown(), returns true, calls xfs_iflush_abort() to kill writeback of the inode. Inode is removed from AIL, drops cluster buffer reference. xfsaild/pmem1-213314 [001] 6398.022977: xfs_ail_delete: dev 259:1 lip 0xffff88880247ed80 old lsn 7/20344 new lsn 7/21000 type XFS_LI_INODE flags IN_AIL xfsaild/pmem1-213314 [001] 6398.022978: xfs_buf_rele: dev 259:1 daddr 0x851c80 bbcount 0x20 hold 17 pincount 0 lock 0 flags DONE|INODES|PAGES caller xfs_iflush_abort+0xd7 ..... All inodes on cluster buffer are aborted, then the cluster buffer itself is aborted and removed from the AIL *without writeback*: xfsaild/pmem1-213314 [001] 6398.023011: xfs_buf_error_relse: dev 259:1 daddr 0x851c80 bbcount 0x20 hold 2 pincount 0 lock 0 flags ASYNC|DONE|STALE|INODES|PAGES caller xfs_buf_ioend_fail+0x33 xfsaild/pmem1-213314 [001] 6398.023012: xfs_ail_delete: dev 259:1 lip 0xffff8888053efde8 old lsn 7/20344 new lsn 7/20344 type XFS_LI_BUF flags IN_AIL The inode buffer was at 7/20344 when it was removed from the AIL. xfsaild/pmem1-213314 [001] 6398.023012: xfs_buf_item_relse: dev 259:1 daddr 0x851c80 bbcount 0x20 hold 2 pincount 0 lock 0 flags ASYNC|DONE|STALE|INODES|PAGES caller xfs_buf_item_done+0x31 xfsaild/pmem1-213314 [001] 6398.023012: xfs_buf_rele: dev 259:1 daddr 0x851c80 bbcount 0x20 hold 2 pincount 0 lock 0 flags ASYNC|DONE|STALE|INODES|PAGES caller xfs_buf_item_relse+0x39 ..... Userspace is still running, doing stuff. an fsstress process runs syncfs() or sync() and we end up in sync_fs_one_sb() which issues a log force. This pushes on the CIL: fsstress-213322 [001] 6398.024430: xfs_fs_sync_fs: dev 259:1 m_features 0x20000000019ff6e9 opstate (clean|shutdown|inodegc|blockgc) s_flags 0x70810000 caller sync_fs_one_sb+0x26 fsstress-213322 [001] 6398.024430: xfs_log_force: dev 259:1 lsn 0x0 caller xfs_fs_sync_fs+0x82 fsstress-213322 [001] 6398.024430: xfs_log_force: dev 259:1 lsn 0x5f caller xfs_log_force+0x7c <...>-194402 [001] 6398.024467: kmem_alloc: size 176 flags 0x14 caller xlog_cil_push_work+0x9f And the CIL fills up iclogs with pending changes. This picks up the current tail from the AIL: <...>-194402 [001] 6398.024497: xlog_iclog_get_space: dev 259:1 state XLOG_STATE_ACTIVE refcnt 1 offset 0 lsn 0x0 flags caller xlog_write+0x149 <...>-194402 [001] 6398.024498: xlog_iclog_switch: dev 259:1 state XLOG_STATE_ACTIVE refcnt 1 offset 0 lsn 0x700005408 flags caller xlog_state_get_iclog_space+0x37e <...>-194402 [001] 6398.024521: xlog_iclog_release: dev 259:1 state XLOG_STATE_WANT_SYNC refcnt 1 offset 32256 lsn 0x700005408 flags caller xlog_write+0x5f9 <...>-194402 [001] 6398.024522: xfs_log_assign_tail_lsn: dev 259:1 new tail lsn 7/21000, old lsn 7/20344, last sync 7/21448 And it moves the tail of the log to 7/21000 from 7/20344. This *moves the tail of the log beyond the ICREATE transaction* that was at 7/20344 and pinned by the inode cluster buffer that was cancelled above. .... godown-213341 [008] 6398.027005: xfs_force_shutdown: dev 259:1 tag logerror flags log_io|force_umount file fs/xfs/xfs_fsops.c line_num 500 godown-213341 [008] 6398.027022: console: [ 6397.915406] pmem1: writeback error on inode 12621949, offset 1019904, sector 12968096 godown-213341 [008] 6398.030551: console: [ 6397.919546] XFS (pmem1): Log I/O Error (0x6) detected at xfs_fs_goingdown+0xa3/0xf0 (fs/ And finally the log itself is now shutdown, stopping all further writes to the log. But this is too late to prevent the corruption that moving the tail of the log forwards after we start cancelling writeback causes. The fundamental problem here is that we are using the wrong shutdown checks for log items. We've long conflated mount shutdown with log shutdown state, and I started separating that recently with the atomic shutdown state changes in commit b36d4651e165 ("xfs: make forced shutdown processing atomic"). The changes in that commit series are directly responsible for being able to diagnose this issue because it clearly separated mount shutdown from log shutdown. Essentially, once we start cancelling writeback of log items and removing them from the AIL because the filesystem is shut down, we *cannot* update the journal because we may have cancelled the items that pin the tail of the log. That moves the tail of the log forwards without having written the metadata back, hence we have corrupt in memory state and writing to the journal propagates that to the on-disk state. What commit b36d4651e165 makes clear is that log item state needs to change relative to log shutdown, not mount shutdown. IOWs, anything that aborts metadata writeback needs to check log shutdown state because log items directly affect log consistency. Having them check mount shutdown state introduces the above race condition where we cancel metadata writeback before the log shuts down. To fix this, this patch works through all log items and converts shutdown checks to use xlog_is_shutdown() rather than xfs_is_shutdown(), so that we don't start aborting metadata writeback before we shut off journal writes. AFAICT, this race condition is a zero day IO error handling bug in XFS that dates back to the introduction of XLOG_IO_ERROR, XLOG_STATE_IOERROR and XFS_FORCED_SHUTDOWN back in January 1997. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_buf.c | 40 ++++++++++++++++++++++++++++++++-------- fs/xfs/xfs_icache.c | 10 +++++++++- fs/xfs/xfs_inode.c | 15 +++++++++++++-- fs/xfs/xfs_inode_item.c | 12 ++++++++++++ fs/xfs/xfs_qm.c | 8 ++++---- 5 files changed, 70 insertions(+), 15 deletions(-) commit 8eda87211097195d96d7d12be37dd39d6a7c8b80 Author: Dave Chinner Date: Thu Mar 17 09:09:12 2022 -0700 xfs: AIL should be log centric The AIL operates purely on log items, so it is a log centric subsystem. Divorce it from the xfs_mount and instead have it pass around xlog pointers. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_trans.c | 2 +- fs/xfs/xfs_trans_ail.c | 26 +++++++++++++------------- fs/xfs/xfs_trans_priv.h | 3 ++- 3 files changed, 16 insertions(+), 15 deletions(-) commit d86142dd7c4e10e50bdb3679b405d748214b2c28 Author: Dave Chinner Date: Thu Mar 17 09:09:12 2022 -0700 xfs: log items should have a xlog pointer, not a mount Log items belong to the log, not the xfs_mount. Convert the mount pointer in the log item to a xlog pointer in preparation for upcoming log centric changes to the log items. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_bmap_item.c | 2 +- fs/xfs/xfs_buf_item.c | 5 +++-- fs/xfs/xfs_extfree_item.c | 2 +- fs/xfs/xfs_log.c | 2 +- fs/xfs/xfs_log_cil.c | 2 +- fs/xfs/xfs_refcount_item.c | 2 +- fs/xfs/xfs_rmap_item.c | 2 +- fs/xfs/xfs_trace.h | 4 ++-- fs/xfs/xfs_trans.c | 2 +- fs/xfs/xfs_trans.h | 3 ++- 10 files changed, 14 insertions(+), 12 deletions(-) commit 70447e0ad9781f84e60e0990888bd8c84987f44e Author: Dave Chinner Date: Thu Mar 17 09:09:11 2022 -0700 xfs: async CIL flushes need pending pushes to be made stable When the AIL tries to flush the CIL, it relies on the CIL push ending up on stable storage without having to wait for and manipulate iclog state directly. However, if there is already a pending CIL push when the AIL tries to flush the CIL, it won't set the cil->xc_push_commit_stable flag and so the CIL push will not actively flush the commit record iclog. generic/530 when run on a single CPU test VM can trigger this fairly reliably. This test exercises unlinked inode recovery, and can result in inodes being pinned in memory by ongoing modifications to the inode cluster buffer to record unlinked list modifications. As a result, the first inode unlinked in a buffer can pin the tail of the log whilst the inode cluster buffer is pinned by the current checkpoint that has been pushed but isn't on stable storage because because the cil->xc_push_commit_stable was not set. This results in the log/AIL effectively deadlocking until something triggers the commit record iclog to be pushed to stable storage (i.e. the periodic log worker calling xfs_log_force()). The fix is two-fold - first we should always set the cil->xc_push_commit_stable when xlog_cil_flush() is called, regardless of whether there is already a pending push or not. Second, if the CIL is empty, we should trigger an iclog flush to ensure that the iclogs of the last checkpoint have actually been submitted to disk as that checkpoint may not have been run under stable completion constraints. Reported-and-tested-by: Matthew Wilcox Fixes: 0020a190cf3e ("xfs: AIL needs asynchronous CIL forcing") Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_log_cil.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) commit 941fbdfd6dd0f1d7961c28123b5460912f678cb5 Author: Dave Chinner Date: Thu Mar 17 09:09:11 2022 -0700 xfs: xfs_ail_push_all_sync() stalls when racing with updates xfs_ail_push_all_sync() has a loop like this: while max_ail_lsn { prepare_to_wait(ail_empty) target = max_ail_lsn wake_up(ail_task); schedule() } Which is designed to sleep until the AIL is emptied. When xfs_ail_update_finish() moves the tail of the log, it does: if (list_empty(&ailp->ail_head)) wake_up_all(&ailp->ail_empty); So it will only wake up the sync push waiter when the AIL goes empty. If, by the time the push waiter has woken, the AIL has more in it, it will reset the target, wake the push task and go back to sleep. The problem here is that if the AIL is having items added to it when xfs_ail_push_all_sync() is called, then they may get inserted into the AIL at a LSN higher than the target LSN. At this point, xfsaild_push() will see that the target is X, the item LSNs are (X+N) and skip over them, hence never pushing the out. The result of this the AIL will not get emptied by the AIL push thread, hence xfs_ail_finish_update() will never see the AIL being empty even if it moves the tail. Hence xfs_ail_push_all_sync() never gets woken and hence cannot update the push target to capture the items beyond the current target on the LSN. This is a TOCTOU type of issue so the way to avoid it is to not use the push target at all for sync pushes. We know that a sync push is being requested by the fact the ail_empty wait queue is active, hence the xfsaild can just set the target to max_ail_lsn on every push that we see the wait queue active. Hence we no longer will leave items on the AIL that are beyond the LSN sampled at the start of a sync push. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_trans_ail.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) commit dbd0f5299302f8506637592e2373891a748c6990 Author: Dave Chinner Date: Thu Mar 17 09:09:10 2022 -0700 xfs: check buffer pin state after locking in delwri_submit AIL flushing can get stuck here: [316649.005769] INFO: task xfsaild/pmem1:324525 blocked for more than 123 seconds. [316649.007807] Not tainted 5.17.0-rc6-dgc+ #975 [316649.009186] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [316649.011720] task:xfsaild/pmem1 state:D stack:14544 pid:324525 ppid: 2 flags:0x00004000 [316649.014112] Call Trace: [316649.014841] [316649.015492] __schedule+0x30d/0x9e0 [316649.017745] schedule+0x55/0xd0 [316649.018681] io_schedule+0x4b/0x80 [316649.019683] xfs_buf_wait_unpin+0x9e/0xf0 [316649.021850] __xfs_buf_submit+0x14a/0x230 [316649.023033] xfs_buf_delwri_submit_buffers+0x107/0x280 [316649.024511] xfs_buf_delwri_submit_nowait+0x10/0x20 [316649.025931] xfsaild+0x27e/0x9d0 [316649.028283] kthread+0xf6/0x120 [316649.030602] ret_from_fork+0x1f/0x30 in the situation where flushing gets preempted between the unpin check and the buffer trylock under nowait conditions: blk_start_plug(&plug); list_for_each_entry_safe(bp, n, buffer_list, b_list) { if (!wait_list) { if (xfs_buf_ispinned(bp)) { pinned++; continue; } Here >>>>>> if (!xfs_buf_trylock(bp)) continue; This means submission is stuck until something else triggers a log force to unpin the buffer. To get onto the delwri list to begin with, the buffer pin state has already been checked, and hence it's relatively rare we get a race between flushing and encountering a pinned buffer in delwri submission to begin with. Further, to increase the pin count the buffer has to be locked, so the only way we can hit this race without failing the trylock is to be preempted between the pincount check seeing zero and the trylock being run. Hence to avoid this problem, just invert the order of trylock vs pin check. We shouldn't hit that many pinned buffers here, so optimising away the trylock for pinned buffers should not matter for performance at all. Signed-off-by: Dave Chinner Reviewed-by: Chandan Babu R Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_buf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit a9a4bc8c76d747aa40b30e2dfc176c781f353a08 Author: Dave Chinner Date: Thu Mar 17 09:09:10 2022 -0700 xfs: log worker needs to start before intent/unlink recovery After 963 iterations of generic/530, it deadlocked during recovery on a pinned inode cluster buffer like so: XFS (pmem1): Starting recovery (logdev: internal) INFO: task kworker/8:0:306037 blocked for more than 122 seconds. Not tainted 5.17.0-rc6-dgc+ #975 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:kworker/8:0 state:D stack:13024 pid:306037 ppid: 2 flags:0x00004000 Workqueue: xfs-inodegc/pmem1 xfs_inodegc_worker Call Trace: __schedule+0x30d/0x9e0 schedule+0x55/0xd0 schedule_timeout+0x114/0x160 __down+0x99/0xf0 down+0x5e/0x70 xfs_buf_lock+0x36/0xf0 xfs_buf_find+0x418/0x850 xfs_buf_get_map+0x47/0x380 xfs_buf_read_map+0x54/0x240 xfs_trans_read_buf_map+0x1bd/0x490 xfs_imap_to_bp+0x4f/0x70 xfs_iunlink_map_ino+0x66/0xd0 xfs_iunlink_map_prev.constprop.0+0x148/0x2f0 xfs_iunlink_remove_inode+0xf2/0x1d0 xfs_inactive_ifree+0x1a3/0x900 xfs_inode_unlink+0xcc/0x210 xfs_inodegc_worker+0x1ac/0x2f0 process_one_work+0x1ac/0x390 worker_thread+0x56/0x3c0 kthread+0xf6/0x120 ret_from_fork+0x1f/0x30 task:mount state:D stack:13248 pid:324509 ppid:324233 flags:0x00004000 Call Trace: __schedule+0x30d/0x9e0 schedule+0x55/0xd0 schedule_timeout+0x114/0x160 __down+0x99/0xf0 down+0x5e/0x70 xfs_buf_lock+0x36/0xf0 xfs_buf_find+0x418/0x850 xfs_buf_get_map+0x47/0x380 xfs_buf_read_map+0x54/0x240 xfs_trans_read_buf_map+0x1bd/0x490 xfs_imap_to_bp+0x4f/0x70 xfs_iget+0x300/0xb40 xlog_recover_process_one_iunlink+0x4c/0x170 xlog_recover_process_iunlinks.isra.0+0xee/0x130 xlog_recover_finish+0x57/0x110 xfs_log_mount_finish+0xfc/0x1e0 xfs_mountfs+0x540/0x910 xfs_fs_fill_super+0x495/0x850 get_tree_bdev+0x171/0x270 xfs_fs_get_tree+0x15/0x20 vfs_get_tree+0x24/0xc0 path_mount+0x304/0xba0 __x64_sys_mount+0x108/0x140 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae task:xfsaild/pmem1 state:D stack:14544 pid:324525 ppid: 2 flags:0x00004000 Call Trace: __schedule+0x30d/0x9e0 schedule+0x55/0xd0 io_schedule+0x4b/0x80 xfs_buf_wait_unpin+0x9e/0xf0 __xfs_buf_submit+0x14a/0x230 xfs_buf_delwri_submit_buffers+0x107/0x280 xfs_buf_delwri_submit_nowait+0x10/0x20 xfsaild+0x27e/0x9d0 kthread+0xf6/0x120 ret_from_fork+0x1f/0x30 We have the mount process waiting on an inode cluster buffer read, inodegc doing unlink waiting on the same inode cluster buffer, and the AIL push thread blocked in writeback waiting for the inode cluster buffer to become unpinned. What has happened here is that the AIL push thread has raced with the inodegc process modifying, committing and pinning the inode cluster buffer here in xfs_buf_delwri_submit_buffers() here: blk_start_plug(&plug); list_for_each_entry_safe(bp, n, buffer_list, b_list) { if (!wait_list) { if (xfs_buf_ispinned(bp)) { pinned++; continue; } Here >>>>>> if (!xfs_buf_trylock(bp)) continue; Basically, the AIL has found the buffer wasn't pinned and got the lock without blocking, but then the buffer was pinned. This implies the processing here was pre-empted between the pin check and the lock, because the pin count can only be increased while holding the buffer locked. Hence when it has gone to submit the IO, it has blocked waiting for the buffer to be unpinned. With all executing threads now waiting on the buffer to be unpinned, we normally get out of situations like this via the background log worker issuing a log force which will unpinned stuck buffers like this. But at this point in recovery, we haven't started the log worker. In fact, the first thing we do after processing intents and unlinked inodes is *start the log worker*. IOWs, we start it too late to have it break deadlocks like this. Avoid this and any other similar deadlock vectors in intent and unlinked inode recovery by starting the log worker before we recover intents and unlinked inodes. This part of recovery runs as though the filesystem is fully active, so we really should have the same infrastructure running as we normally do at runtime. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Reviewed-by: Chandan Babu R Signed-off-by: Darrick J. Wong fs/xfs/xfs_log.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 795301d3c28996219d555023ac6863401b6076bc Author: Steven Rostedt (Google) Date: Fri Mar 18 15:34:32 2022 -0400 tracing: Have type enum modifications copy the strings When an enum is used in the visible parts of a trace event that is exported to user space, the user space applications like perf and trace-cmd do not have a way to know what the value of the enum is. To solve this, at boot up (or module load) the printk formats are modified to replace the enum with their numeric value in the string output. Array fields of the event are defined by [] in the type portion of the format file so that the user space parsers can correctly parse the array into the appropriate size chunks. But in some trace events, an enum is used in defining the size of the array, which once again breaks the parsing of user space tooling. This was solved the same way as the print formats were, but it modified the type strings of the trace event. This caused crashes in some architectures because, as supposed to the print string, is a const string value. This was not detected on x86, as it appears that const strings are still writable (at least in boot up), but other architectures this is not the case, and writing to a const string will cause a kernel fault. To fix this, use kstrdup() to copy the type before modifying it. If the trace event is for the core kernel there's no need to free it because the string will be in use for the life of the machine being on line. For modules, create a link list to store all the strings being allocated for modules and when the module is removed, free them. Link: https://lore.kernel.org/all/yt9dr1706b4i.fsf@linux.ibm.com/ Link: https://lkml.kernel.org/r/20220318153432.3984b871@gandalf.local.home Tested-by: Marc Zyngier Tested-by: Sven Schnelle Reported-by: Sven Schnelle Fixes: b3bc8547d3be ("tracing: Have TRACE_DEFINE_ENUM affect trace event types as well") Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events.c | 62 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) commit abdad709ed8fe4fd3b865ed1010de37a49601ff4 Author: Jens Axboe Date: Sat Mar 19 18:04:41 2022 -0600 io_uring: recycle provided before arming poll We currently have a race where we recycle the selected buffer if poll returns IO_APOLL_OK. But that's too late, as the poll could already be triggering or have triggered. If that race happens, then we're putting a buffer that's already being used. Fix this by recycling before we arm poll. This does mean that we'll sometimes almost instantly re-select the buffer, but it's rare enough in testing that it should not pose a performance issue. Fixes: b1c62645758e ("io_uring: recycle provided buffers if request goes async") Signed-off-by: Jens Axboe fs/io_uring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 1a22aabf20adf89cb216f566913196128766f25b Author: Peter Rosin Date: Wed Mar 2 12:22:35 2022 +0100 i2c: mux: demux-pinctrl: do not deactivate a master that is not active Attempting to rollback the activation of the current master when the current master has not been activated is bad. priv->cur_chan and priv->cur_adap are both still zeroed out and the rollback may result in attempts to revert an of changeset that has not been applied and do result in calls to both del and put the zeroed out i2c_adapter. Maybe it crashes, or whatever, but it's bad in any case. Fixes: e9d1a0a41d44 ("i2c: mux: demux-pinctrl: Fix an error handling path in 'i2c_demux_pinctrl_probe()'") Signed-off-by: Peter Rosin Signed-off-by: Wolfram Sang drivers/i2c/muxes/i2c-demux-pinctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 217cff36e885627c41a14e803fc44f9cbc945767 Author: Pablo Neira Ayuso Date: Fri Mar 18 13:11:24 2022 +0100 netfilter: flowtable: pass flowtable to nf_flow_table_iterate() The flowtable object is already passed as argument to nf_flow_table_iterate(), do use not data pointer to pass flowtable. Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_flow_table_core.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit bb321ed6bbaab6a2d21e8b94258d4248a0be45f4 Author: Pablo Neira Ayuso Date: Fri Mar 18 13:11:23 2022 +0100 netfilter: flowtable: remove redundant field in flow_offload_work struct Already available through the flowtable object, remove it. Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_flow_table_offload.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit fd4213929053bb58b0b2a080ca17f2dd1a9b6df4 Author: Randy Dunlap Date: Wed Mar 16 12:20:05 2022 -0700 netfilter: nf_nat_h323: eliminate anonymous module_init & module_exit Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: f587de0e2feb ("[NETFILTER]: nf_conntrack/nf_nat: add H.323 helper port") Signed-off-by: Randy Dunlap Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso net/ipv4/netfilter/nf_nat_h323.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit e86dbdb9d4619c3fd9b2ccec159ae1ca41e8ac36 Author: Florian Westphal Date: Mon Mar 14 18:23:13 2022 +0100 netfilter: nft_exthdr: add reduce support Check if we can elide the load. Cancel if the new candidate isn't identical to previous store. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_exthdr.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) commit 3c1eb413a45b6c6327fed394705081ec6202b31a Author: Florian Westphal Date: Mon Mar 14 18:23:12 2022 +0100 netfilter: nft_fib: add reduce support The fib expression stores to a register, so we can't add empty stub. Check that the register that is being written is in fact redundant. In most cases, this is expected to cancel tracking as re-use is unlikely. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso include/net/netfilter/nft_fib.h | 3 +++ net/ipv4/netfilter/nft_fib_ipv4.c | 2 ++ net/ipv6/netfilter/nft_fib_ipv6.c | 2 ++ net/netfilter/nft_fib.c | 42 +++++++++++++++++++++++++++++++++++++++ net/netfilter/nft_fib_inet.c | 1 + net/netfilter/nft_fib_netdev.c | 1 + 6 files changed, 51 insertions(+) commit 611580d2df1f873e035f3dca109e5fa27448e0c7 Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:11 2022 +0100 netfilter: nft_tunnel: track register operations Check if the destination register already contains the data that this tunnel expression performs. This allows to skip this redundant operation. If the destination contains a different selector, update the register tracking information. This patch does not perform bitwise tracking. Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_tunnel.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) commit 48f1910326eaf7318cab8356302258faede4f6b5 Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:10 2022 +0100 netfilter: nft_xfrm: track register operations Check if the destination register already contains the data that this xfrm expression performs. This allows to skip this redundant operation. If the destination contains a different selector, update the register tracking information. Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_xfrm.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) commit d77a721d212d48e2ff62334e00cc4cfcad751ff5 Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:09 2022 +0100 netfilter: nft_socket: track register operations Check if the destination register already contains the data that this socket expression performs. This allows to skip this redundant operation. If the destination contains a different selector, update the register tracking information. Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_socket.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) commit 71ef842d73f63b10ce84629dada75f402c6df36e Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:08 2022 +0100 netfilter: nft_immediate: cancel register tracking for data destination register The immediate expression might clobber existing data on the registers, cancel register tracking for the destination register. Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_immediate.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 5da03b56662618ac469461df0f33a1cf1dd18813 Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:07 2022 +0100 netfilter: nft_hash: track register operations Check if the destination register already contains the data that this osf expression performs. Always cancel register tracking for jhash since this requires tracking multiple source registers in case of concatenations. Perform register tracking (without bitwise) for symhash since input does not come from source register. Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_hash.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) commit ffe6488e624e1edd71efcac3cd512d234939a96d Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:06 2022 +0100 netfilter: nft_osf: track register operations Allow to recycle the previous output of the OS fingerprint expression if flags and ttl are the same. Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_osf.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit 4e2b29d8816805f3add34fb295e72539eba46a31 Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:05 2022 +0100 netfilter: nft_numgen: cancel register tracking Random and increment are stateful, each invocation results in fresh output. Cancel register tracking for these two expressions. Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_numgen.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) commit aaa7b20bd4d637fd4ef0d72b6c828c061b9bc5f7 Author: Florian Westphal Date: Mon Mar 14 18:23:04 2022 +0100 netfilter: nft_meta: extend reduce support to bridge family its enough to export the meta get reduce helper and then call it from nft_meta_bridge too. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso include/net/netfilter/nft_meta.h | 2 ++ net/bridge/netfilter/nft_meta_bridge.c | 1 + net/netfilter/nft_meta.c | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) commit e50ae445fb70e99f8bdb5493f0aac2d941028c34 Author: Florian Westphal Date: Mon Mar 14 18:23:03 2022 +0100 netfilter: nft_lookup: only cancel tracking for clobbered dregs In most cases, nft_lookup will be read-only, i.e. won't clobber registers. In case of map, we need to cancel the registers that will see stores. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_lookup.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 03858af0135f4efc90802e164bdc13477801afe2 Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:02 2022 +0100 netfilter: nft_ct: track register operations Check if the destination register already contains the data that this ct expression performs. This allows to skip this redundant operation. If the destination contains a different selector, update the register tracking information. Export nft_expr_reduce_bitwise as a symbol since nft_ct might be compiled as a module. Signed-off-by: Pablo Neira Ayuso net/netfilter/nft_bitwise.c | 1 + net/netfilter/nft_ct.c | 47 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) commit 34cc9e52884a16c62acbfb309863fb60e4c24f55 Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:01 2022 +0100 netfilter: nf_tables: cancel tracking for clobbered destination registers Output of expressions might be larger than one single register, this might clobber existing data. Reset tracking for all destination registers that required to store the expression output. This patch adds three new helper functions: - nft_reg_track_update: cancel previous register tracking and update it. - nft_reg_track_cancel: cancel any previous register tracking info. - __nft_reg_track_cancel: cancel only one single register tracking info. Partial register clobbering detection is also supported by checking the .num_reg field which describes the number of register that are used. This patch updates the following expressions: - meta_bridge - bitwise - byteorder - meta - payload to use these helper functions. Signed-off-by: Pablo Neira Ayuso include/net/netfilter/nf_tables.h | 14 +++++++++ include/net/netfilter/nft_meta.h | 1 + net/bridge/netfilter/nft_meta_bridge.c | 4 +-- net/netfilter/nf_tables_api.c | 52 ++++++++++++++++++++++++++++++++++ net/netfilter/nft_bitwise.c | 23 +++++++++------ net/netfilter/nft_byteorder.c | 3 +- net/netfilter/nft_meta.c | 14 ++++----- net/netfilter/nft_payload.c | 12 +++----- 8 files changed, 95 insertions(+), 28 deletions(-) commit b2d306542ff935a4edf7a88ba8145c108193442a Author: Pablo Neira Ayuso Date: Mon Mar 14 18:23:00 2022 +0100 netfilter: nf_tables: do not reduce read-only expressions Skip register tracking for expressions that perform read-only operations on the registers. Define and use a cookie pointer NFT_REDUCE_READONLY to avoid defining stubs for these expressions. This patch re-enables register tracking which was disabled in ed5f85d42290 ("netfilter: nf_tables: disable register tracking"). Follow up patches add remaining register tracking for existing expressions. Signed-off-by: Pablo Neira Ayuso include/net/netfilter/nf_tables.h | 8 ++++++++ net/bridge/netfilter/nft_reject_bridge.c | 1 + net/ipv4/netfilter/nft_dup_ipv4.c | 1 + net/ipv4/netfilter/nft_reject_ipv4.c | 1 + net/ipv6/netfilter/nft_dup_ipv6.c | 1 + net/ipv6/netfilter/nft_reject_ipv6.c | 1 + net/netfilter/nf_tables_api.c | 11 ++++++++++- net/netfilter/nft_cmp.c | 3 +++ net/netfilter/nft_compat.c | 1 + net/netfilter/nft_connlimit.c | 1 + net/netfilter/nft_counter.c | 1 + net/netfilter/nft_ct.c | 1 + net/netfilter/nft_dup_netdev.c | 1 + net/netfilter/nft_dynset.c | 1 + net/netfilter/nft_flow_offload.c | 1 + net/netfilter/nft_fwd_netdev.c | 2 ++ net/netfilter/nft_last.c | 1 + net/netfilter/nft_limit.c | 2 ++ net/netfilter/nft_log.c | 1 + net/netfilter/nft_masq.c | 3 +++ net/netfilter/nft_nat.c | 2 ++ net/netfilter/nft_objref.c | 2 ++ net/netfilter/nft_queue.c | 2 ++ net/netfilter/nft_quota.c | 1 + net/netfilter/nft_range.c | 1 + net/netfilter/nft_redir.c | 3 +++ net/netfilter/nft_reject_inet.c | 1 + net/netfilter/nft_reject_netdev.c | 1 + net/netfilter/nft_rt.c | 1 + net/netfilter/nft_synproxy.c | 1 + net/netfilter/nft_tproxy.c | 1 + 31 files changed, 58 insertions(+), 1 deletion(-) commit 31d0bb9763efad30377505f3467f958d1ebe1e3d Author: Phil Sutter Date: Wed Mar 2 22:02:55 2022 +0100 netfilter: conntrack: Add and use nf_ct_set_auto_assign_helper_warned() The function sets the pernet boolean to avoid the spurious warning from nf_ct_lookup_helper() when assigning conntrack helpers via nftables. Fixes: 1a64edf54f55 ("netfilter: nft_ct: add helper set support") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso include/net/netfilter/nf_conntrack_helper.h | 1 + net/netfilter/nf_conntrack_helper.c | 6 ++++++ net/netfilter/nft_ct.c | 3 +++ 3 files changed, 10 insertions(+) commit cb13aa16f34f794a9cee2626862af8a95f0f0ee9 Author: Lucas Tanure Date: Tue Mar 1 07:26:00 2022 +0000 i2c: meson: Fix wrong speed use from probe Having meson_i2c_set_clk_div after i2c_add_adapter causes issues for client drivers that try to use the bus before the requested speed is applied. The bus can be used just after i2c_add_adapter, so move i2c_add_adapter to the final step as meson_i2c_set_clk_div needs to be called before the bus is used. Fixes: 09af1c2fa490 ("i2c: meson: set clock divider in probe instead of setting it for each transfer") Signed-off-by: Lucas Tanure Reviewed-by: Neil Armstrong Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-meson.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit d714fb25e755ad96b699993fac47f48c4d6cebe9 Author: Jae Hyun Yoo Date: Fri Mar 18 13:41:33 2022 -0700 i2c: add tracepoints for I2C slave events I2C slave events tracepoints can be enabled by: echo 1 > /sys/kernel/tracing/events/i2c_slave/enable and logs in /sys/kernel/tracing/trace will look like: ... i2c_slave: i2c-0 a=010 ret=0 WR_REQ [] ... i2c_slave: i2c-0 a=010 ret=0 WR_RCV [02] ... i2c_slave: i2c-0 a=010 ret=0 WR_RCV [0c] ... i2c_slave: i2c-0 a=010 ret=0 STOP [] ... i2c_slave: i2c-0 a=010 ret=0 RD_REQ [04] ... i2c_slave: i2c-0 a=010 ret=0 RD_PRO [b4] ... i2c_slave: i2c-0 a=010 ret=0 STOP [] formatted as: i2c- a= ret= <- callback return value [] trace printings can be selected by adding a filter like: echo adapter_nr==1 >/sys/kernel/tracing/events/i2c_slave/filter Signed-off-by: Jae Hyun Yoo Signed-off-by: Wolfram Sang drivers/i2c/i2c-core-slave.c | 15 +++++++++ include/linux/i2c.h | 8 ++--- include/trace/events/i2c_slave.h | 67 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 6 deletions(-) commit 2cfadb761d3d0219412fd8150faea60c7e863833 Author: Florian Westphal Date: Wed Feb 16 16:43:05 2022 +0100 netfilter: conntrack: revisit gc autotuning as of commit 4608fdfc07e1 ("netfilter: conntrack: collect all entries in one cycle") conntrack gc was changed to run every 2 minutes. On systems where conntrack hash table is set to large value, most evictions happen from gc worker rather than the packet path due to hash table distribution. This causes netlink event overflows when events are collected. This change collects average expiry of scanned entries and reschedules to the average remaining value, within 1 to 60 second interval. To avoid event overflows, reschedule after each bucket and add a limit for both run time and number of evictions per run. If more entries have to be evicted, reschedule and restart 1 jiffy into the future. Reported-by: Karel Rericha Cc: Shmulik Ladkani Cc: Eyal Birger Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_conntrack_core.c | 85 +++++++++++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 17 deletions(-) commit 4bcf5f95c7fde202e75cfef8ae64dc7ec79f7d12 Author: Andre Przywara Date: Thu Mar 17 18:30:42 2022 +0000 ARM: configs: clean up multi_v5_defconfig Clean up some cruft accumulated over time: - The default definition of CONFIG_ZBOOT_ROM_* got fixed in commit 39c3e304567a ("ARM: 8984/1: Kconfig: set default ZBOOT_ROM_TEXT/BSS value to 0x0"), so we don't need the explicit setting anymore. - CONFIG_ABX500_CORE now explicitly depends on the ARMv7 ARCH_U8500, so we don't need to disable that symbol explicitly anymore. - CONFIG_DEBUG_FS was just moved around in the generated defconfig. No change to the generated .config or savedefconfig. Signed-off-by: Andre Przywara Link: https://lore.kernel.org/r/20220317183043.948432-5-andre.przywara@arm.com' Signed-off-by: Arnd Bergmann arch/arm/configs/multi_v5_defconfig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 9c44d0805f949c56121b4ae6949fb064537bf198 Author: Andre Przywara Date: Thu Mar 17 18:30:41 2022 +0000 ARM: configs: multi_v5_defconfig: re-enable DRM_PANEL and FB_xxx Commit 91185d55b32e ("drm: Remove DRM_KMS_FB_HELPER Kconfig option") led to de-selection of CONFIG_FB, which was a prerequisite for BACKLIGHT_CLASS_DEVICE, which CONFIG_DRM_PANEL_SIMPLE depended on. Explicitly set CONFIG_FB, to bring DRM_PANEL_SIMPLE, DRM_PANEL_EDP, FB_IMX and FB_ATMEL back into the generated .config. This also adds some new FB related features like fonts and the framebuffer console. See also commit 8c1768967e27 ("ARM: config: mutli v7: Reenable FB dependency"), which solved the same problem for multi_v7_defconfig. This relies on [1], to fix a broken Kconfig dependency. [1] https://lore.kernel.org/dri-devel/20220315084559.23510-1-tzimmermann@suse.de/raw Fixes: 91185d55b32e ("drm: Remove DRM_KMS_FB_HELPER Kconfig option") Signed-off-by: Andre Przywara Link: https://lore.kernel.org/r/20220317183043.948432-4-andre.przywara@arm.com' Signed-off-by: Arnd Bergmann arch/arm/configs/multi_v5_defconfig | 1 + 1 file changed, 1 insertion(+) commit f5eb04d7a0e419d61f784de3ced708259ddb71d7 Author: Andre Przywara Date: Thu Mar 17 18:30:40 2022 +0000 ARM: configs: multi_v5_defconfig: re-enable CONFIG_V4L_PLATFORM_DRIVERS Commit 06b93644f4d1 ("media: Kconfig: add an option to filter in/out platform drivers") introduced CONFIG_MEDIA_PLATFORM_SUPPORT, to allow more fine grained control over the inclusion of certain Kconfig files. multi_v5_defconfig was selecting some drivers described in drivers/media/platform/Kconfig, which now wasn't included anymore. Explicitly set the new symbol in multi_v5_defconfig to bring those drivers back. This enables some new V4L2 and VIDEOBUF2 features, but as modules only. Fixes: 06b93644f4d1 ("media: Kconfig: add an option to filter in/out platform drivers") Signed-off-by: Andre Przywara Link: https://lore.kernel.org/r/20220317183043.948432-3-andre.przywara@arm.com' Signed-off-by: Arnd Bergmann arch/arm/configs/multi_v5_defconfig | 1 + 1 file changed, 1 insertion(+) commit 30160c195596c709c6a255d959371ffbbcec11cd Author: Andre Przywara Date: Thu Mar 17 18:30:39 2022 +0000 ARM: configs: multi_v5_defconfig: remove deleted platforms Some ARMv5 platforms got removed from the kernel over time, so we don't need their symbols in the multi_v5_defconfig anymore: - ARCH_U300 got removed with commit ce1380c9f4bc ("ARM: remove u300 platform"), so CONFIG_ARCH_U300 is not around anymore. - ARCH_U300 was the only platform selecting ARCH_AMBA, which I2C_NOMADIK depends on. So we won't need this symbol anymore, and can't select it anyway. - i.MX27 got converted to DT in 879c0e5e0ac7 ("ARM: imx: Remove i.MX27 board files"). Remove the now obsolete board file version symbols. No change in the generated .config or savedefconfig. Signed-off-by: Andre Przywara Link: https://lore.kernel.org/r/20220317183043.948432-2-andre.przywara@arm.com' Signed-off-by: Arnd Bergmann arch/arm/configs/multi_v5_defconfig | 7 ------- 1 file changed, 7 deletions(-) commit bcea9aaa4373f2ee8ea3c758b76c479dffe85822 Author: Krzysztof Kozlowski Date: Fri Mar 18 13:10:44 2022 +0100 arm64: dts: n5x: drop invalid property and fix edac node name The intel,sysmgr-syscon in EDAC/memory controller node is not a recognized and documented property, so drop it to fix error: sdr_edac@f87f8000: 'intel,sysmgr-syscon' does not match any of the regexes: 'pinctrl-[0-9]+' Align also the node name with Devicetree specification (generic, not specific, and EDAC is purely Linux term). Fixes: ef82c9be844f ("arm64: dts: n5x: add sdr edac support") Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220318121044.108750-1-krzysztof.kozlowski@canonical.com' Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/intel/socfpga_n5x_socdk.dts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 339ac71b233ee9ab5036be3abca0e5df793b5f64 Author: Julia Lawall Date: Fri Mar 18 11:37:16 2022 +0100 ARM: spear: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220318103729.157574-21-Julia.Lawall@inria.fr' Signed-off-by: Arnd Bergmann arch/arm/mach-spear/spear13xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7dc0eb0b6d9f3e2b6a560a04f86ef065a4531a9f Author: Max Filippov Date: Sat Mar 19 05:49:24 2022 -0700 xtensa: enable plugin support Compiler plugins can be built starting with xtensa gcc 12. Enable plugin support for xtensa when gcc-12 or newer is used. Signed-off-by: Max Filippov arch/xtensa/Kconfig | 1 + 1 file changed, 1 insertion(+) commit e7e9614b6b3a4fb897d9766337858e3f5e1e1855 Author: Max Filippov Date: Sat Mar 19 05:52:07 2022 -0700 xtensa: clean up kernel exit assembly code Don't use numeric labels for complex branching logic. Mark each branch with named local label and use them. Rearrange exit back to kernel mode to avoid conditional label definition. Signed-off-by: Max Filippov arch/xtensa/kernel/entry.S | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) commit e6d423aaaea13e6dc48e42472aeebc8607ae2574 Author: Max Filippov Date: Sat Mar 19 05:58:21 2022 -0700 xtensa: rearrange NMI exit path NMI exit path to userspace should neither check TIF_DB_DISABLED nor call check_tlb_sanity because NMI shouldn't touch anything related to userspace. Drop kernel/userspace check in NMI exit path. Signed-off-by: Max Filippov arch/xtensa/kernel/entry.S | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) commit e94dc6bbdf29787a5ddb01c143a074c31e427dc7 Author: Max Filippov Date: Sat Mar 19 11:06:30 2022 -0700 xtensa: merge stack alignment definitions xtensa currently has two different definitions for stack alignment. Replace it with single definition usable in both C and assembly. Signed-off-by: Max Filippov arch/xtensa/include/asm/asmmacro.h | 2 -- arch/xtensa/include/asm/core.h | 7 +++++++ arch/xtensa/include/asm/processor.h | 6 +----- 3 files changed, 8 insertions(+), 7 deletions(-) commit 9492450fd28736262dea9143ebb3afc2c131ace1 Author: Kumar Kartikeya Dwivedi Date: Thu Mar 17 17:29:51 2022 +0530 bpf: Always raise reference in btf_get_module_btf Align it with helpers like bpf_find_btf_id, so all functions returning BTF in out parameter follow the same rule of raising reference consistently, regardless of module or vmlinux BTF. Adjust existing callers to handle the change accordinly. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220317115957.3193097-10-memxor@gmail.com kernel/bpf/btf.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) commit 092d992b76ed9d06389af0bc5efd5279d7b1ed9f Merge: 62f65554f5cf 5dc2b581cd2c Author: David S. Miller Date: Sat Mar 19 14:50:19 2022 +0000 Merge tag 'mlx5-updates-2022-03-18' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2022-03-18 1) XDP multi buffer support This series enables XDP on non-linear legacy RQ in multi buffer mode. When XDP is enabled, fragmentation scheme on non-linear legacy RQ is adjusted to comply to limitations of XDP multi buffer (fragments of the same size). DMA addresses of fragments are stored in struct page for the completion handler to be able to unmap them. XDP_TX is supported. XDP_REDIRECT is not yet supported, the XDP core blocks it for multi buffer packets at the moment. 2) Trivial cleanups ==================== Signed-off-by: David S. Miller commit 62f65554f5cffb17234e2b267d6376efc561d1c0 Merge: d5f497b88979 b58b1f563ab7 Author: David S. Miller Date: Sat Mar 19 14:49:08 2022 +0000 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ ipsec-next Steffen Klassert says: ==================== pull request (net-next): ipsec-next 2022-03-19 1) Delete duplicated functions that calls same xfrm_api_check. From Leon Romanovsky. 2) Align userland API of the default policy structure to the internal structures. From Nicolas Dichtel. ==================== Signed-off-by: David S. Miller commit 46d2c20b0b10cf07a2a24b047a09195ba96c84f7 Author: YueHaibing Date: Sat Mar 19 14:50:31 2022 +0800 usb: gadget: fsl_qe_udc: Add missing semicolon in qe_ep_dequeue() drivers/usb/gadget/udc/fsl_qe_udc.c: In function ‘qe_ep_dequeue’: drivers/usb/gadget/udc/fsl_qe_udc.c:1792:3: error: expected ‘;’ before ‘req’ req = iter; ^~~ Add missing semicolon to fix this. Fixes: 838884110f0d ("usb: gadget: fsl: remove usage of list iterator past the loop body") Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220319065031.36928-1-yuehaibing@huawei.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/fsl_qe_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0caf6d9922192dd1afa8dc2131abfb4df1443b9f Author: Petr Machata Date: Thu Mar 17 15:53:06 2022 +0100 af_netlink: Fix shift out of bounds in group mask calculation When a netlink message is received, netlink_recvmsg() fills in the address of the sender. One of the fields is the 32-bit bitfield nl_groups, which carries the multicast group on which the message was received. The least significant bit corresponds to group 1, and therefore the highest group that the field can represent is 32. Above that, the UB sanitizer flags the out-of-bounds shift attempts. Which bits end up being set in such case is implementation defined, but it's either going to be a wrong non-zero value, or zero, which is at least not misleading. Make the latter choice deterministic by always setting to 0 for higher-numbered multicast groups. To get information about membership in groups >= 32, userspace is expected to use nl_pktinfo control messages[0], which are enabled by NETLINK_PKTINFO socket option. [0] https://lwn.net/Articles/147608/ The way to trigger this issue is e.g. through monitoring the BRVLAN group: # bridge monitor vlan & # ip link add name br type bridge Which produces the following citation: UBSAN: shift-out-of-bounds in net/netlink/af_netlink.c:162:19 shift exponent 32 is too large for 32-bit type 'int' Fixes: f7fa9b10edbb ("[NETLINK]: Support dynamic number of multicast groups per netlink family") Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/2bef6aabf201d1fc16cca139a744700cff9dcb04.1647527635.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski net/netlink/af_netlink.c | 2 ++ 1 file changed, 2 insertions(+) commit d5f497b889794161facc1522d86720b587d1c0b7 Author: Dan Carpenter Date: Fri Mar 18 10:47:23 2022 +0300 ptp: ocp: use snprintf() in ptp_ocp_verify() This code is fine, but it's easier to review if we use snprintf() instead of sprintf(). Signed-off-by: Dan Carpenter Acked-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220318074723.GA6617@kili Signed-off-by: Jakub Kicinski drivers/ptp/ptp_ocp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 800c326bfa9cee38f0e173733ce9f93492c84c8b Author: Yang Yingliang Date: Fri Mar 18 15:27:28 2022 +0800 nfc: st21nfca: remove unnecessary skb check before kfree_skb() The skb will be checked in kfree_skb(), so remove the outside check. Signed-off-by: Yang Yingliang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220318072728.2659578-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski drivers/nfc/st21nfca/i2c.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 49270afa037bcaf88133329ff7304f2945cb871c Merge: 53fb430e2070 5d705de0cd34 Author: Jakub Kicinski Date: Fri Mar 18 21:38:20 2022 -0700 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 40GbE Intel Wired LAN Driver Updates 2022-03-17 This series contains updates to i40e and igb drivers. Tom Rix moves a conversion to little endian to occur only when the value is used for i40e. He also zeros out a structure to resolve possible use of garbage value for igb as reported by clang. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: igb: zero hwtstamp by default i40e: little endian only valid checksums ==================== Link: https://lore.kernel.org/r/20220317160236.3534321-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit dca65818c80cf06e0f08ba2cf94060a5236e73c2 Author: Shyam Prasad N Date: Tue Feb 15 13:55:40 2022 +0000 cifs: use a different reconnect helper for non-cifsd threads The cifs_demultiplexer_thread should only call cifs_reconnect. If any other thread wants to trigger a reconnect, they can do so by updating the server tcpStatus to CifsNeedReconnect. The last patch attempted to use the same helper function for both types of threads, but that causes other issues with lock dependencies. This patch creates a new helper for non-cifsd threads, that will indicate to cifsd that the server needs reconnect. Fixes: 2a05137a0575 ("cifs: mark sessions for reconnection in helper function") Signed-off-by: Shyam Prasad N Signed-off-by: Steve French fs/cifs/cifs_swn.c | 6 +++--- fs/cifs/cifsproto.h | 3 +++ fs/cifs/connect.c | 42 +++++++++++++++++++++++++++++++++++++++++- fs/cifs/dfs_cache.c | 2 +- fs/cifs/smb1ops.c | 2 +- fs/cifs/transport.c | 2 +- 6 files changed, 50 insertions(+), 7 deletions(-) commit 9a14b65d590105d393b63f5320e1594edda7c672 Author: Ronnie Sahlberg Date: Tue Mar 15 13:44:04 2022 +1000 cifs: we do not need a spinlock around the tree access during umount Remove the spinlock around the tree traversal as we are calling possibly sleeping functions. We do not need a spinlock here as there will be no modifications to this tree at this point. This prevents warnings like this to occur in dmesg: [ 653.774996] BUG: sleeping function called from invalid context at kernel/loc\ king/mutex.c:280 [ 653.775088] in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1827, nam\ e: umount [ 653.775152] preempt_count: 1, expected: 0 [ 653.775191] CPU: 0 PID: 1827 Comm: umount Tainted: G W OE 5.17.0\ -rc7-00006-g4eb628dd74df #135 [ 653.775195] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-\ 1.fc33 04/01/2014 [ 653.775197] Call Trace: [ 653.775199] [ 653.775202] dump_stack_lvl+0x34/0x44 [ 653.775209] __might_resched.cold+0x13f/0x172 [ 653.775213] mutex_lock+0x75/0xf0 [ 653.775217] ? __mutex_lock_slowpath+0x10/0x10 [ 653.775220] ? _raw_write_lock_irq+0xd0/0xd0 [ 653.775224] ? dput+0x6b/0x360 [ 653.775228] cifs_kill_sb+0xff/0x1d0 [cifs] [ 653.775285] deactivate_locked_super+0x85/0x130 [ 653.775289] cleanup_mnt+0x32c/0x4d0 [ 653.775292] ? path_umount+0x228/0x380 [ 653.775296] task_work_run+0xd8/0x180 [ 653.775301] exit_to_user_mode_loop+0x152/0x160 [ 653.775306] exit_to_user_mode_prepare+0x89/0xd0 [ 653.775315] syscall_exit_to_user_mode+0x12/0x30 [ 653.775322] do_syscall_64+0x48/0x90 [ 653.775326] entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: 187af6e98b44e5d8f25e1d41a92db138eb54416f ("cifs: fix handlecache and multiuser") Reported-by: kernel test robot Cc: stable@vger.kernel.org Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French fs/cifs/cifsfs.c | 2 -- 1 file changed, 2 deletions(-) commit 06a466565d54a1a42168f9033a062a3f5c40e73b Author: Rohith Surabattula Date: Mon Mar 7 18:37:22 2022 +0000 Adjust cifssb maximum read size When session gets reconnected during mount then read size in super block fs context gets set to zero and after negotiate, rsize is not modified which results in incorrect read with requested bytes as zero. Fixes intermittent failure of xfstest generic/240 Note that stable requires a different version of this patch which will be sent to the stable mailing list. Signed-off-by: Rohith Surabattula Acked-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French fs/cifs/cifsfs.c | 3 +++ fs/cifs/file.c | 10 ++++++++++ 2 files changed, 13 insertions(+) commit 84330d41efb12bc227899e54dbdbe7d9590cb2b7 Author: Ronnie Sahlberg Date: Wed Feb 23 11:14:16 2022 +1000 cifs: truncate the inode and mapping when we simulate fcollapse RHBZ:1997367 When we collapse a range in smb3_collapse_range() we must make sure we update the inode size and pagecache accordingly. If not, both inode size and pagecahce may be stale until it is refreshed. This can be demonstrated for the inode size by running : xfs_io -i -f -c "truncate 320k" -c "fcollapse 64k 128k" -c "fiemap -v" \ /mnt/testfile where we can see the result of stale data in the fiemap output. The third line of the output is wrong, all this data should be truncated. EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: hole 128 1: [128..383]: 128..383 256 0x1 2: [384..639]: hole 256 And the correct output, when the inode size has been updated correctly should look like this: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..127]: hole 128 1: [128..383]: 128..383 256 0x1 Reported-by: Xiaoli Feng Reported-by: kernel test robot Cc: stable@vger.kernel.org Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French fs/cifs/smb2ops.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) commit 47178c7722ac528ea08aa82c3ef9ffa178962d7a Author: Ronnie Sahlberg Date: Fri Mar 4 10:31:49 2022 +1000 cifs: fix handlecache and multiuser In multiuser each individual user has their own tcon structure for the share and thus their own handle for a cached directory. When we umount such a share we much make sure to release the pinned down dentry for each such tcon and not just the master tcon. Otherwise we will get nasty warnings on umount that dentries are still in use: [ 3459.590047] BUG: Dentry 00000000115c6f41{i=12000000019d95,n=/} still in use\ (2) [unmount of cifs cifs] ... [ 3459.590492] Call Trace: [ 3459.590500] d_walk+0x61/0x2a0 [ 3459.590518] ? shrink_lock_dentry.part.0+0xe0/0xe0 [ 3459.590526] shrink_dcache_for_umount+0x49/0x110 [ 3459.590535] generic_shutdown_super+0x1a/0x110 [ 3459.590542] kill_anon_super+0x14/0x30 [ 3459.590549] cifs_kill_sb+0xf5/0x104 [cifs] [ 3459.590773] deactivate_locked_super+0x36/0xa0 [ 3459.590782] cleanup_mnt+0x131/0x190 [ 3459.590789] task_work_run+0x5c/0x90 [ 3459.590798] exit_to_user_mode_loop+0x151/0x160 [ 3459.590809] exit_to_user_mode_prepare+0x83/0xd0 [ 3459.590818] syscall_exit_to_user_mode+0x12/0x30 [ 3459.590828] do_syscall_64+0x48/0x90 [ 3459.590833] entry_SYSCALL_64_after_hwframe+0x44/0xae Signed-off-by: Ronnie Sahlberg Acked-by: Paulo Alcantara (SUSE) Cc: stable@vger.kernel.org Signed-off-by: Steve French fs/cifs/cifsfs.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit 53fb430e2070dd2d87f7bd978973d04303d1876a Merge: 79fdce0513ac 726c0eb7cb15 Author: Jakub Kicinski Date: Fri Mar 18 17:17:19 2022 -0700 Merge tag 'for-net-next-2022-03-18' 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 support for Asus TF103C - Add support for Realtek RTL8852B - Add support for Realtek RTL8723BE - Add WBS support to mt7921s * tag 'for-net-next-2022-03-18' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: (24 commits) Bluetooth: ath3k: remove superfluous header files Bluetooth: bcm203x: remove superfluous header files Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table Bluetooth: mt7921s: Add WBS support Bluetooth: mt7921s: Add .btmtk_get_codec_config_data Bluetooth: mt7921s: Add .get_data_path_id Bluetooth: mt7921s: Set HCI_QUIRK_VALID_LE_STATES Bluetooth: btmtksdio: Fix kernel oops in btmtksdio_interrupt Bluetooth: btmtkuart: fix error handling in mtk_hci_wmt_sync() Bluetooth: call hci_le_conn_failed with hdev lock in hci_le_conn_failed Bluetooth: Send AdvMonitor Dev Found for all matched devices Bluetooth: msft: Clear tracked devices on resume Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready() Bluetooth: Don't assign twice the same value Bluetooth: btrtl: Add support for RTL8852B Bluetooth: hci_uart: add missing NULL check in h5_enqueue Bluetooth: Fix use after free in hci_send_acl Bluetooth: btusb: Use quirk to skip HCI_FLT_CLEAR_ALL on fake CSR controllers Bluetooth: hci_sync: Add a new quirk to skip HCI_FLT_CLEAR_ALL Bluetooth: btmtkuart: fix the conflict between mtk and msft vendor event ... ==================== Link: https://lore.kernel.org/r/20220318224752.1477292-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit edc3ec09ab706c45e955f7a52f0904b4ed649ca9 Author: Kumar Kartikeya Dwivedi Date: Thu Mar 17 17:29:43 2022 +0530 bpf: Factor out fd returning from bpf_btf_find_by_name_kind In next few patches, we need a helper that searches all kernel BTFs (vmlinux and module BTFs), and finds the type denoted by 'name' and 'kind'. Turns out bpf_btf_find_by_name_kind already does the same thing, but it instead returns a BTF ID and optionally fd (if module BTF). This is used for relocating ksyms in BPF loader code (bpftool gen skel -L). We extract the core code out into a new helper bpf_find_btf_id, which returns the BTF ID in the return value, and BTF pointer in an out parameter. The reference for the returned BTF pointer is always raised, hence user must either transfer it (e.g. to a fd), or release it after use. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220317115957.3193097-2-memxor@gmail.com kernel/bpf/btf.c | 90 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 37 deletions(-) commit 6ba463edccb978e3c0248c3a193b759436b51ac8 Author: Armin Wolf Date: Fri Mar 18 19:34:08 2022 +0100 hwmon: (dell-smm) Add Inspiron 3505 to fan type blacklist Sadly, while firmware 1.5 fixed temperature labels on my Inspiron 3505, it also caused fan type calls to take ca. 4 seconds with the fan being at full speed. Fix the resulting delays by adding the model to the blacklist. Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20220318183408.13286-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck drivers/hwmon/dell-smm-hwmon.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 411fadd62cecf74935693b7690b416af9bd4a332 Author: Helge Deller Date: Fri Mar 18 22:59:59 2022 +0100 parisc: Avoid flushing cache on cache-less machines Avoid flushing caches in __flush_cache_page() and __purge_cache_page() if the machine hasn't data or instruction caches - as e.g. in qemu. Signed-off-by: Helge Deller arch/parisc/kernel/cache.c | 4 ++++ 1 file changed, 4 insertions(+) commit 8e145bc705e738ebe7ed6c53d93278981d9af356 Author: Conor Dooley Date: Fri Mar 18 17:21:08 2022 +0000 soc/microchip: fix invalid free in mpfs_sys_controller_delete Fix an invalid kfree in mpfs_sys_controller_delete, by replacing the devm_kzalloc with a regular kzalloc. Change the error handling in the probe function to free the sys_controller struct if the probe fails. > cocci warnings: (new ones prefixed by >>) > >> drivers/soc/microchip/mpfs-sys-controller.c:73:1-6: WARNING: invalid free of devm_ allocated data Link: https://lore.kernel.org/linux-mm/202203180259.lgIylRZV-lkp@intel.com/ Fixes: d0054a470c33 ("soc: add microchip polarfire soc system controller") Reported-by: kernel test robot Signed-off-by: Conor Dooley Signed-off-by: Conor Dooley Signed-off-by: Arnd Bergmann drivers/soc/microchip/mpfs-sys-controller.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit 79fdce0513aceff7666e2e4dfa8fc28ea381d3a7 Author: Colin Ian King Date: Fri Mar 18 01:20:35 2022 +0000 qlcnic: remove redundant assignment to variable index Variable index is being assigned a value that is never read, it is being re-assigned later in a following for-loop. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c:1358:17: warning: Although the value stored to 'index' is used in the enclosing expression, the value is never actually read from 'index' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220318012035.89482-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0978e5919c2853c31971ccdf4b31eb690cc45fb5 Author: Colin Ian King Date: Fri Mar 18 00:50:21 2022 +0000 atl1c: remove redundant assignment to variable size Variable sie is being assigned a value that is never read. The The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/net/ethernet/atheros/atl1c/atl1c_main.c:1054:22: warning: Although the value stored to 'size' is used in the enclosing expression, the value is never actually read from 'size' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220318005021.82073-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 12a18341b5c3b6b897e52e8f387ab7cd7f7b6d85 Author: Yonglong Li Date: Thu Mar 17 15:14:44 2022 -0700 mptcp: send ADD_ADDR echo before create subflows In some corner cases, the peer handing an incoming ADD_ADDR option, can receive a retransmitted ADD_ADDR for the same address before the subflow creation completes. We can avoid the above issue by generating and sending the ADD_ADDR echo before starting the MPJ subflow connection. This slightly changes the behaviour of the packetdrill tests as the ADD_ADDR echo packet is sent earlier. Acked-by: Paolo Abeni Signed-off-by: Yonglong Li Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20220317221444.426335-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski net/mptcp/pm_netlink.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) commit 3ef3905aa3b5b3e222ee6eb0210bfd999417a8cc Author: Yonglong Li Date: Thu Mar 17 15:09:53 2022 -0700 mptcp: Fix crash due to tcp_tsorted_anchor was initialized before release skb Got crash when doing pressure test of mptcp: =========================================================================== dst_release: dst:ffffa06ce6e5c058 refcnt:-1 kernel tried to execute NX-protected page - exploit attempt? (uid: 0) BUG: unable to handle kernel paging request at ffffa06ce6e5c058 PGD 190a01067 P4D 190a01067 PUD 43fffb067 PMD 22e403063 PTE 8000000226e5c063 Oops: 0011 [#1] SMP PTI CPU: 7 PID: 7823 Comm: kworker/7:0 Kdump: loaded Tainted: G E Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.2.1 04/01/2014 Call Trace: ? skb_release_head_state+0x68/0x100 ? skb_release_all+0xe/0x30 ? kfree_skb+0x32/0xa0 ? mptcp_sendmsg_frag+0x57e/0x750 ? __mptcp_retrans+0x21b/0x3c0 ? __switch_to_asm+0x35/0x70 ? mptcp_worker+0x25e/0x320 ? process_one_work+0x1a7/0x360 ? worker_thread+0x30/0x390 ? create_worker+0x1a0/0x1a0 ? kthread+0x112/0x130 ? kthread_flush_work_fn+0x10/0x10 ? ret_from_fork+0x35/0x40 =========================================================================== In __mptcp_alloc_tx_skb skb was allocated and skb->tcp_tsorted_anchor will be initialized, in under memory pressure situation sk_wmem_schedule will return false and then kfree_skb. In this case skb->_skb_refdst is not null because_skb_refdst and tcp_tsorted_anchor are stored in the same mem, and kfree_skb will try to release dst and cause crash. Fixes: f70cad1085d1 ("mptcp: stop relying on tcp_tx_skb_cache") Reviewed-by: Paolo Abeni Signed-off-by: Yonglong Li Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20220317220953.426024-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski net/mptcp/protocol.c | 1 + 1 file changed, 1 insertion(+) commit 892e0ddea1aa6f70b68cb2dd8e16bf271e20e72f Author: Marek Vasut Date: Sat Feb 26 05:07:23 2022 +0100 clk: rs9: Add Renesas 9-series PCIe clock generator driver Add driver for Renesas 9-series PCIe clock generators. This driver is designed to support 9FGV/9DBV/9DMV/9FGL/9DML/9QXL/9SQ series I2C PCIe clock generators, currently the only tested and supported chip is 9FGV0241. The driver is capable of configuring per-chip spread spectrum mode and output amplitude, as well as per-output slew rate. Signed-off-by: Marek Vasut Cc: Michael Turquette Cc: Rob Herring Cc: Stephen Boyd Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20220226040723.143705-3-marex@denx.de [sboyd@kernel.org: Use non-underscore API for fixed factor] Signed-off-by: Stephen Boyd drivers/clk/Kconfig | 9 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-renesas-pcie.c | 322 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 332 insertions(+) commit 03e2777c1a01cdc072193b72ff6a96a0147944cd Merge: 6bd0c76bd704 ec730c3e1f0e Author: Jakub Kicinski Date: Fri Mar 18 14:06:58 2022 -0700 Merge branch 'ipv4-handle-tos-and-scope-properly-for-icmp-redirects-and-pmtu-updates' Guillaume Nault says: ==================== ipv4: Handle TOS and scope properly for ICMP redirects and PMTU updates ICMPv4 PMTU and redirect handlers didn't properly initialise the struct flowi4 they used for route lookups: * ECN bits sometimes weren't cleared from ->flowi4_tos. * The RTO_ONLINK flag wasn't taken into account for ->flowi4_scope. In some special cases, this resulted in ICMP redirects and PMTU updates not being taken into account because fib_lookup() couldn't retrieve the correct route. ==================== Link: https://lore.kernel.org/r/cover.1647519748.git.gnault@redhat.com Signed-off-by: Jakub Kicinski commit ec730c3e1f0e3a80612a9be2beb00e2b4f93fe70 Author: Guillaume Nault Date: Thu Mar 17 13:45:11 2022 +0100 selftest: net: Test IPv4 PMTU exceptions with DSCP and ECN Add two tests to pmtu.sh, for verifying that PMTU exceptions get properly created for routes that don't belong to the main table. A fib-rule based on the packet's DSCP field is used to jump to the correct table. ECN shouldn't interfere with this process, so each test has two components: one that only sets DSCP and one that sets both DSCP and ECN. One of the test triggers PMTU exceptions using ICMP Echo Requests, the other using UDP packets (to test different handlers in the kernel). A few adjustments are necessary in the rest of the script to allow policy routing scenarios: * Add global variable rt_table that allows setup_routing_*() to add routes to a specific routing table. By default rt_table is set to "main", so existing tests don't need to be modified. * Another global variable, policy_mark, is used to define which dsfield value is used for policy routing. This variable has no effect on tests that don't use policy routing. * The UDP version of the test uses socat. So cleanup() now also need to kill socat PIDs. * route_get_dst_pmtu_from_exception() and route_get_dst_exception() now take an optional third argument specifying the dsfield. If not specified, 0 is used, so existing users don't need to be modified. Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski tools/testing/selftests/net/pmtu.sh | 141 +++++++++++++++++++++++++++++++++++- 1 file changed, 137 insertions(+), 4 deletions(-) commit 544b4dd568e3b09c1ab38a759d3187e7abda11a0 Author: Guillaume Nault Date: Thu Mar 17 13:45:09 2022 +0100 ipv4: Fix route lookups when handling ICMP redirects and PMTU updates The PMTU update and ICMP redirect helper functions initialise their fl4 variable with either __build_flow_key() or build_sk_flow_key(). These initialisation functions always set ->flowi4_scope with RT_SCOPE_UNIVERSE and might set the ECN bits of ->flowi4_tos. This is not a problem when the route lookup is later done via ip_route_output_key_hash(), which properly clears the ECN bits from ->flowi4_tos and initialises ->flowi4_scope based on the RTO_ONLINK flag. However, some helpers call fib_lookup() directly, without sanitising the tos and scope fields, so the route lookup can fail and, as a result, the ICMP redirect or PMTU update aren't taken into account. Fix this by extracting the ->flowi4_tos and ->flowi4_scope sanitisation code into ip_rt_fix_tos(), then use this function in handlers that call fib_lookup() directly. Note 1: We can't sanitise ->flowi4_tos and ->flowi4_scope in a central place (like __build_flow_key() or flowi4_init_output()), because ip_route_output_key_hash() expects non-sanitised values. When called with sanitised values, it can erroneously overwrite RT_SCOPE_LINK with RT_SCOPE_UNIVERSE in ->flowi4_scope. Therefore we have to be careful to sanitise the values only for those paths that don't call ip_route_output_key_hash(). Note 2: The problem is mostly about sanitising ->flowi4_tos. Having ->flowi4_scope initialised with RT_SCOPE_UNIVERSE instead of RT_SCOPE_LINK probably wasn't really a problem: sockets with the SOCK_LOCALROUTE flag set (those that'd result in RTO_ONLINK being set) normally shouldn't receive ICMP redirects or PMTU updates. Fixes: 4895c771c7f0 ("ipv4: Add FIB nexthop exceptions.") Signed-off-by: Guillaume Nault Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski net/ipv4/route.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) commit 4edf21aa94ee33c75f819f2b6eb6dd52ef8a1628 Author: Kuniyuki Iwashima Date: Thu Mar 17 12:23:08 2022 +0900 af_unix: Remove unnecessary brackets around CONFIG_AF_UNIX_OOB. Let's remove unnecessary brackets around CONFIG_AF_UNIX_OOB. Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20220317032308.65372-1-kuniyu@amazon.co.jp Signed-off-by: Jakub Kicinski net/unix/af_unix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 0c125f87a84097c182c481be7497af9f816e5db5 Author: Marek Vasut Date: Sat Feb 26 05:07:22 2022 +0100 clk: fixed-factor: Introduce devm_clk_hw_register_fixed_factor_index() Add an API for a fixed factor clk that uses an index for the parent instead of a string name. This allows us to move drivers away from the string based method of describing parents and use the DT/firmware based method instead. Signed-off-by: Marek Vasut Cc: Michael Turquette Cc: Rob Herring Cc: Stephen Boyd Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20220226040723.143705-2-marex@denx.de [sboyd@kernel.org: Expose a new API instead of internal function] Signed-off-by: Stephen Boyd drivers/clk/clk-fixed-factor.c | 22 ++++++++++++++++++++++ include/linux/clk-provider.h | 3 +++ 2 files changed, 25 insertions(+) commit 5dc2b581cd2cf518d28d0c703478a0c1fd54436c Author: Saeed Mahameed Date: Tue Feb 9 14:41:05 2021 -0800 net/mlx5e: HTB, remove unused function declaration There is no function mlx5e_get_sq(), remove the declaration. Signed-off-by: Saeed Mahameed Signed-off-by: Moshe Tal Reviewed-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan drivers/net/ethernet/mellanox/mlx5/core/en/qos.h | 1 - 1 file changed, 1 deletion(-) commit 60796198b44ff8c2e3e513f794f96e89b513a64d Author: Tariq Toukan Date: Wed Mar 9 10:44:24 2022 +0200 net/mlx5e: Statify function mlx5_cmd_trigger_completions Starting from commit 4cab346bcf74 ("net/mlx5: No command allowed when command interface is not ready"), no calls to mlx5_cmd_trigger_completions() are external to cmd.c anymore. Make it a static function. Signed-off-by: Tariq Toukan Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) commit 08c34e95422bdecbc1bd67d35bc3ec307e2bafc2 Author: Maxim Mikityanskiy Date: Tue Feb 15 21:01:22 2022 +0200 net/mlx5e: Remove MLX5E_XDP_TX_DS_COUNT After introducing multi-buffer XDP_TX, the MLX5E_XDP_TX_DS_COUNT define became misleading. It's no longer the DS count of an XDP_TX WQE, this WQE can be longer because of fragments. As this define is only used at one place in mlx5e_open_xdpsq(), it's also not very useful anymore. This commit removes the define and puts the calculation of ds_count for prefilled single-fragment WQEs inline. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h | 1 - drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) commit 1b8a10bbfe770c53ef77eb84177ea13183cc0711 Author: Maxim Mikityanskiy Date: Tue Feb 1 14:21:26 2022 +0200 net/mlx5e: Permit XDP with non-linear legacy RQ Now that legacy RQ implements XDP in the non-linear mode, stop blocking this configuration. Allow non-linear mode only for programs aware of multi buffer. XDP performance with linear mode RQ hasn't changed. Baseline (MTU 1500, TX MPWQE, legacy RQ, single core): 60-byte packets, XDP_DROP: 11.25 Mpps 60-byte packets, XDP_TX: 9.0 Mpps 60-byte packets, XDP_PASS: 668 kpps Multi buffer (MTU 9000, TX MPWQE, legacy RQ, single core): 60-byte packets, XDP_DROP: 10.1 Mpps 60-byte packets, XDP_TX: 6.6 Mpps 60-byte packets, XDP_PASS: 658 kpps 8900-byte packets, XDP_DROP: 769 kpps (100% of sent packets) 8900-byte packets, XDP_TX: 674 kpps (100% of sent packets) 8900-byte packets, XDP_PASS: 637 kpps Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 39 ++++++++++++++++------- 1 file changed, 27 insertions(+), 12 deletions(-) commit a48ad58cec18702249a228267dec29d105bbe5a5 Author: Maxim Mikityanskiy Date: Mon Jan 31 19:43:53 2022 +0200 net/mlx5e: Support multi buffer XDP_TX This commit enables passing multi buffer XDP frames to the TX handlers on XDP_TX. Fragments are DMA synchronized to the device and queued to the xdpi_fifo for a subsequent unmapping. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 39 +++++++++++++++++++----- 1 file changed, 31 insertions(+), 8 deletions(-) commit fbeed25bcc45ef6df4b8fc35ec82edd895fc6587 Author: Maxim Mikityanskiy Date: Thu Mar 10 18:16:17 2022 +0200 net/mlx5e: Unindent the else-block in mlx5e_xmit_xdp_buff The next commit will add more indentation levels to mlx5e_xmit_xdp_buff. To keep indentation minimal, unindent the else-block of the if-statement by doing an early return. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 34 ++++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) commit 39a1665d16a2adba6c0b05019068749af3cd05ee Author: Maxim Mikityanskiy Date: Mon Jan 31 19:27:15 2022 +0200 net/mlx5e: Implement sending multi buffer XDP frames xmit_xdp_frame is extended to support sending fragmented XDP frames. The next commit will start using this functionality. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 96 +++++++++++++++++----- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h | 2 + .../net/ethernet/mellanox/mlx5/core/en/xsk/tx.c | 3 +- 4 files changed, 80 insertions(+), 22 deletions(-) commit 9ded70fa1d8186135090f09638db7d8126dca0db Author: Maxim Mikityanskiy Date: Mon Jan 31 17:41:31 2022 +0200 net/mlx5e: Don't prefill WQEs in XDP SQ in the multi buffer mode When MPWQE is disabled, mlx5e_open_xdpsq() prefills the common fields of WQEs in the XDP SQ to save time when sending packets. mlx5e_xmit_xdp_frame() runs on the prefilled fields, however, sending multi buffer XDP frames would require changing some of these fields on a per-packet basis. Besides that, mlx5e_xmit_xdp_frame() will be used as a fallback to send multi buffer XDP frames when MPWQE is enabled (MPWQE can only handle linear packets). In order to prepare for XDP multi buffer support, this commit introduces a mode for mlx5e_xmit_xdp_frame() that fills all the fields itself. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 + .../net/ethernet/mellanox/mlx5/core/en/params.c | 4 ++- .../net/ethernet/mellanox/mlx5/core/en/params.h | 2 ++ drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 32 ++++++++++++++++++++-- .../net/ethernet/mellanox/mlx5/core/en/xsk/setup.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 10 ++++++- 6 files changed, 46 insertions(+), 5 deletions(-) commit c090451633f89c292316e928f970d082d7e8295f Author: Maxim Mikityanskiy Date: Mon Jan 31 17:28:40 2022 +0200 net/mlx5e: Remove assignment of inline_hdr.sz on XDP TX When MPWQE is disabled, mlx5e_open_xdpsq prefills the common fields of WQEs in the XDP SQ to save time when sending packets. One of such fields is eseg->inline_hdr.sz, which can be either 0 or MLX5E_XDP_MIN_INLINE, depending on the inline mode of the SQ. The inline mode can't change during the lifetime of the SQ, so setting this field again in mlx5e_xmit_xdp_frame is redundant. Moreover, the xmit function only sets it to MLX5E_XDP_MIN_INLINE, but not to 0 in the other case. This commit removes the redundant assignment in mlx5e_xmit_xdp_frame. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 1 - 1 file changed, 1 deletion(-) commit 49529a1726850bddd7a991de6e8ef52c65c49fbe Author: Maxim Mikityanskiy Date: Fri Jan 28 16:43:14 2022 +0200 net/mlx5e: Move mlx5e_xdpi_fifo_push out of xmit_xdp_frame The implementations of xmit_xdp_frame get the xdpi parameter of type struct mlx5e_xdp_info for the sole purpose of calling mlx5e_xdpi_fifo_push() on success. This commit moves this call outside of xmit_xdp_frame, shifting this responsibility to the caller. It will allow more fine-grained handling of XDP info for cases when an xdp_frame is fragmented. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 - drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 17 ++++++++++------- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h | 2 -- drivers/net/ethernet/mellanox/mlx5/core/en/xsk/tx.c | 4 +++- 4 files changed, 13 insertions(+), 11 deletions(-) commit ddc87e7d477552084fd185b315a39d5067b01773 Author: Maxim Mikityanskiy Date: Fri Jan 28 13:13:11 2022 +0200 net/mlx5e: Store DMA address inside struct page Use page_pool_set_dma_addr() to store the DMA address of a page inside struct page, in order to avoid passing struct mlx5e_dma_info to XDP handlers. Previously, struct mlx5e_dma_info was used to pass both the DMA address and the page, and it worked well for the single-fragment case. When XDP multi buffer is in use, and a fragmented xdp_frame has to be transmitted, the driver needs to know the DMA addresses of fragments, however, the array of fragments in struct skb_shared_info doesn't contain them. In order to pass the DMA addresses, the driver puts them into struct page itself, which is accessible from the array of fragments in struct skb_shared_info. The existing XDP handlers are modified to remove the dependency on struct mlx5e_dma_info. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h | 6 ++-- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 14 ++++---- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 40 ++++++++++++----------- 6 files changed, 33 insertions(+), 33 deletions(-) commit ea5d49bdae8b4c9dcdac574eef96b1bd47000c2a Author: Maxim Mikityanskiy Date: Thu Jan 27 17:01:05 2022 +0200 net/mlx5e: Add XDP multi buffer support to the non-linear legacy RQ This commit adds XDP multi buffer support to the RX path in the non-linear legacy RQ mode. mlx5e_xdp_handle is called from mlx5e_skb_from_cqe_nonlinear. XDP_TX action for fragmented XDP frames is not yet supported and blocked. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 5 +++++ drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) commit d51f4a4cca6f629927b1871af0c6f5ce7a9022e9 Author: Maxim Mikityanskiy Date: Wed Feb 9 15:32:35 2022 +0200 net/mlx5e: Use page-sized fragments with XDP multi buffer The implementation of XDP in mlx5e assumes that the frame size is equal to the page size. Force this limitation in the non-linear mode for XDP multi buffer. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9cb9482ef10e7e524f73878cb20de138be7e1a1f Author: Maxim Mikityanskiy Date: Thu Jan 27 14:14:53 2022 +0200 net/mlx5e: Use fragments of the same size in non-linear legacy RQ with XDP XDP multi buffer implementation in the kernel assumes that all fragments have the same size. bpf_xdp_frags_increase_tail uses this assumption to get the size of the last fragment, and __xdp_build_skb_from_frame uses it to calculate truesize as nr_frags * xdpf->frame_sz. The current implementation of mlx5e uses fragments of different size in non-linear legacy RQ. Specifically, the last fragment can be larger than the others. It's an optimization for packets smaller than MTU. This commit adapts mlx5e to the kernel limitations and makes it use fragments of the same size, in order to add support for XDP multi buffer. The change is applied only if XDP is active, otherwise the old optimization still applies. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed .../net/ethernet/mellanox/mlx5/core/en/params.c | 28 +++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) commit 4e8231f1c22d36bbf1eed20b2a54609f2e4c49ed Author: Maxim Mikityanskiy Date: Wed Jan 26 17:43:33 2022 +0200 net/mlx5e: Prepare non-linear legacy RQ for XDP multi buffer support mlx5e_skb_from_cqe_nonlinear creates an xdp_buff first, putting the first fragment as the linear part, and the rest of fragments as fragments to struct skb_shared_info in the tailroom. Then it creates an SKB in place, based on the xdp_buff. The XDP program is not called in this commit yet. This commit contains no functional change, except the SKB is built over the whole frag_stride of the first fragment, instead of the minimal size required (headroom, data and skb_shared_info). Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 75 ++++++++++++++++++++----- 1 file changed, 61 insertions(+), 14 deletions(-) commit 49a24e9d9c740d3bd8b1200f225f67d45e3d68a5 Merge: c639e85e93aa 85f7a8b6e1be Author: Mark Brown Date: Fri Mar 18 20:11:08 2022 +0000 Make the SOF control, PCM and PM code IPC agnostic Merge series from Ranjani Sridharan : This series is a continuation to the SOF IPC abstraction work to support the new IPC version introduced in the SOF firmware. It makes the top-level control IO, PCM and PM code IPC-agnostic. Other than the first patch, the rest are purely for abstraction and include no changes in functionality. commit 13de23494f387315c6cfab6fe78fbed7d1b25586 Author: Andy Shevchenko Date: Tue Mar 8 17:11:19 2022 +0200 auxdisplay: lcd2s: Use array size explicitly in lcd2s_gotoxy() Currently the reading of the onstack array is confusing since two out of three members are of different types. Let it be more clear by explicitly set the array size, so everybody will understand that parameters are cast to the type of the array. While at it, add a missed space. Signed-off-by: Andy Shevchenko Signed-off-by: Miguel Ojeda drivers/auxdisplay/lcd2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8fefb3134f3493bd2e5e26de308ebfbe8c562b8f Author: Andy Shevchenko Date: Tue Mar 8 17:11:18 2022 +0200 auxdisplay: lcd2s: Switch to i2c ->probe_new() The deprecated i2c ->probe() functionality doesn't work with OF compatible strings, as it only checks for the i2c device id. While it's not a problem right now, it would still bring a better code. Switch to the new way of probing. Signed-off-by: Andy Shevchenko Signed-off-by: Miguel Ojeda drivers/auxdisplay/lcd2s.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit f15c3dea5ed75d6f646802656d97d779dd69e683 Author: Andy Shevchenko Date: Tue Mar 8 17:11:17 2022 +0200 auxdisplay: lcd2s: use module_i2c_driver to simplify the code Use the module_i2c_driver() macro to make the code smaller and a bit simpler. Signed-off-by: Andy Shevchenko Signed-off-by: Miguel Ojeda drivers/auxdisplay/lcd2s.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) commit 44bb3f038eb5583ae1fdd74f088e9e6235c3875e Author: Andy Shevchenko Date: Tue Mar 8 17:11:16 2022 +0200 auxdisplay: lcd2s: make use of device property API Make use of device property API in this driver so that both OF based system and ACPI based system can use this driver. Signed-off-by: Andy Shevchenko Signed-off-by: Miguel Ojeda drivers/auxdisplay/lcd2s.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit c726031a9d15c243e69c3755d94f7b0b170dd003 Author: Andy Shevchenko Date: Tue Mar 8 17:12:33 2022 +0200 auxdisplay: lcd2s: Fix multi-line comment style Fix multi-line comment style: - start sentences with Capital letter - use non-networking style of the first line Signed-off-by: Andy Shevchenko Signed-off-by: Miguel Ojeda drivers/auxdisplay/lcd2s.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) commit 4e371d996590f3a7e82a086d499c912c1930e968 Merge: 8f877b7eab9d 151c6b49d679 Author: Miquel Raynal Date: Fri Mar 18 20:14:12 2022 +0100 Merge tag 'spi-nor/for-5.18' into mtd/next SPI NOR core changes: - move vendor specific code out of the core into vendor drivers. - unify all function and object names in the vendor modules. - make setup() callback optional to improve readability. - skip erase logic when the SPI_NOR_NO_ERASE flag is set at flash declaration. Signed-off-by: Miquel Raynal commit 046e1537a3cf0adc68fe865b5dc9a7e731cc63b3 Author: Íñigo Huguet Date: Tue Mar 15 10:18:32 2022 +0100 net: set default rss queues num to physical cores / 2 Network drivers can call to netif_get_num_default_rss_queues to get the default number of receive queues to use. Right now, this default number is min(8, num_online_cpus()). Instead, as suggested by Jakub, use the number of physical cores divided by 2 as a way to avoid wasting CPU resources and to avoid using both CPU threads, but still allowing to scale for high-end processors with many cores. As an exception, select 2 queues for processors with 2 cores, because otherwise it won't take any advantage of RSS despite being SMP capable. Tested: Processor Intel Xeon E5-2620 (2 sockets, 6 cores/socket, 2 threads/core). NIC Broadcom NetXtreme II BCM57810 (10GBps). Ran some tests with `perf stat iperf3 -R`, with parallelisms of 1, 8 and 24, getting the following results: - Number of queues: 6 (instead of 8) - Network throughput: not affected - CPU usage: utilized 0.05-0.12 CPUs more than before (having 24 CPUs this is only 0.2-0.5% higher) - Reduced the number of context switches by 7-50%, being more noticeable when using a higher number of parallel threads. Suggested-by: Jakub Kicinski Signed-off-by: Íñigo Huguet Link: https://lore.kernel.org/r/20220315091832.13873-1-ihuguet@redhat.com Signed-off-by: Jakub Kicinski include/linux/netdevice.h | 1 - net/core/dev.c | 20 ++++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) commit 87e0eacb176f9500c2063d140c0a1d7fa51ab8a5 Author: Dan Carpenter Date: Wed Mar 16 11:39:48 2022 +0300 RDMA/nldev: Prevent underflow in nldev_stat_set_counter_dynamic_doit() This code checks "index" for an upper bound but it does not check for negatives. Change the type to unsigned to prevent underflows. Fixes: 3c3c1f141639 ("RDMA/nldev: Allow optional-counter status configuration through RDMA netlink") Link: https://lore.kernel.org/r/20220316083948.GC30941@kili Signed-off-by: Dan Carpenter Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/core/nldev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 31035f3e20af4ede5f1c8162068327ea0b35a96e Merge: 2d6fc1455f3f 2045d38a6546 Author: Rafael J. Wysocki Date: Fri Mar 18 19:00:26 2022 +0100 Merge branch 'thermal-hfi' Merge Intel Hardware Feedback Interface (HFI) thermal driver for 5.18-rc1 and update the intel-speed-select utility to support that driver. * thermal-hfi: tools/power/x86/intel-speed-select: v1.12 release tools/power/x86/intel-speed-select: HFI support tools/power/x86/intel-speed-select: OOB daemon mode thermal: intel: hfi: INTEL_HFI_THERMAL depends on NET thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub thermal: intel: hfi: Notify user space for HFI events thermal: netlink: Add a new event to notify CPU capabilities change thermal: intel: hfi: Enable notification interrupt thermal: intel: hfi: Handle CPU hotplug events thermal: intel: hfi: Minimally initialize the Hardware Feedback Interface x86/cpu: Add definitions for the Intel Hardware Feedback Interface x86/Documentation: Describe the Intel Hardware Feedback Interface commit 2d6fc1455f3f383499e013ebc4b19ff49c53c15e Merge: 6bf0f1c235fa a11cda8e2f18 c7ff29763989 16c02447f3e1 Author: Rafael J. Wysocki Date: Fri Mar 18 18:53:02 2022 +0100 Merge branches 'thermal-powerclamp', 'thermal-int340x' and 'thermal-docs' Merge powerclamp thermal driver changes, int340x thermal driver changes and thermal documentation changes for 5.18-rc1: - Don't use bitmap_weight() in end_power_clamp() in the powerclamp driver (Yury Norov). - Update the OS policy capabilities handshake in the int340x thermal driver (Srinivas Pandruvada). - Increase the policies bitmap size in int340x (Srinivas Pandruvada). - Replace acpi_bus_get_device() with acpi_fetch_acpi_dev() in the int340x thermal driver (Rafael Wysocki). - Check for NULL after calling kmemdup() in int340x (Jiasheng Jiang). - Add Intel Dynamic Power and Thermal Framework (DPTF) kernel interface documentation (Srinivas Pandruvada). - Fix bullet list warning in the thermal documentation (Randy Dunlap). * thermal-powerclamp: thermal: intel_powerclamp: don't use bitmap_weight() in end_power_clamp() * thermal-int340x: thermal: int340x: Update OS policy capability handshake thermal: int340x: Increase bitmap size thermal: Replace acpi_bus_get_device() thermal: int340x: Check for NULL after calling kmemdup() * thermal-docs: Documentation: thermal: DPTF Documentation thermal: fix Documentation bullet list warning commit ec3d8b8365e9865b43099e943ec5f0bc12f28f96 Merge: ac9f31096bc5 b020771a66e4 Author: Rafael J. Wysocki Date: Fri Mar 18 18:46:15 2022 +0100 Merge branch 'pm-tools' Merge power management utilities changes for 5.18-rc1: - Add tracer tool for the amd-pstate driver (Jinzhou Su). - Fix PC6 displaying in turbostat on some systems (Artem Bityutskiy). - Add AMD P-State support to the cpupower utility (Huang Rui). * pm-tools: Documentation: amd-pstate: add tracer tool introduction tools/power/x86/amd_pstate_tracer: Add tracer tool for AMD P-state tools/power/x86/intel_pstate_tracer: make tracer as a module cpufreq: amd-pstate: Add more tracepoint for AMD P-State module turbostat: fix PC6 displaying on some systems cpupower: Add "perf" option to print AMD P-State information cpupower: Add function to print AMD P-State performance capabilities cpupower: Move print_speed function into misc helper cpupower: Enable boost state support for AMD P-State module cpupower: Add AMD P-State sysfs definition and access helper cpupower: Introduce ACPI CPPC library cpupower: Add the function to get the sysfs value from specific table cpupower: Initial AMD P-State capability cpupower: Add the function to check AMD P-State enabled cpupower: Add AMD P-State capability flag tools/power/cpupower/{ToDo => TODO}: Rename the todo file tools: cpupower: fix typo in cpupower-idle-set(1) manpage commit 5e929367468c8f97cd1ffb0417316cecfebef94b Author: Jens Axboe Date: Fri Mar 18 11:28:13 2022 -0600 io_uring: terminate manual loop iterator loop correctly for non-vecs The fix for not advancing the iterator if we're using fixed buffers is broken in that it can hit a condition where we don't terminate the loop. This results in io-wq looping forever, asking to read (or write) 0 bytes for every subsequent loop. Reported-by: Joel Jaeschke Link: https://github.com/axboe/liburing/issues/549 Fixes: 16c8d2df7ec0 ("io_uring: ensure symmetry in handling iter types in loop_rw_iter()") Signed-off-by: Jens Axboe fs/io_uring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit ac9f31096bc5dc67f05de79ac4c537af12afde6f Merge: dfad78e07e93 55ddcd9f3226 Author: Rafael J. Wysocki Date: Fri Mar 18 18:40:38 2022 +0100 Merge branch 'powercap' Merge Dynamic Thermal Power Management (DTPM) changes for 5.18-rc1: - Add DTPM hierarchy description (Daniel Lezcano). - Change the locking scheme in DTPM (Daniel Lezcano). - Fix dtpm_cpu cleanup at exit time and missing virtual DTPM pointer release (Daniel Lezcano). - Make dtpm_node_callback[] static (kernel test robot). - Fix spelling mistake "initialze" -> "initialize" in dtpm_create_hierarchy() (Colin Ian King). * powercap: powercap: DTPM: Fix spelling mistake "initialze" -> "initialize" powercap: DTPM: dtpm_node_callback[] can be static dtpm/soc/rk3399: Add the ability to unload the module powercap/dtpm_cpu: Add exit function powercap/dtpm: Move the 'root' reset place powercap/dtpm: Destroy hierarchy function powercap/dtpm: Fixup kfree for virtual node powercap/dtpm_cpu: Reset per_cpu variable in the release function powercap/dtpm: Change locking scheme rockchip/soc/drivers: Add DTPM description for rk3399 powercap/drivers/dtpm: Add dtpm devfreq with energy model support powercap/drivers/dtpm: Add CPU DT initialization support powercap/drivers/dtpm: Add hierarchy creation powercap/drivers/dtpm: Convert the init table section to a simple array commit 2e11a5e459c1c4f1d27430d2707ec7ef77f371ca Author: Max Gurtovoy Date: Tue Mar 8 16:55:46 2022 +0200 IB/iser: Fix error flow in case of registration failure During READ/WRITE preparation, in case of failure in memory registration using iser_reg_mem_fastreg we must unmap previously mapped iser task. Link: https://lore.kernel.org/r/20220308145546.8372-5-mgurtovoy@nvidia.com Reviewed-by: Sergey Gorenko Signed-off-by: Max Gurtovoy Acked-by: Sagi Grimberg Signed-off-by: Jason Gunthorpe drivers/infiniband/ulp/iser/iser_initiator.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) commit 80303ee244907e720544da83e10fd0552875a6f0 Author: Max Gurtovoy Date: Tue Mar 8 16:55:45 2022 +0200 IB/iser: Generalize map/unmap dma tasks Avoid code duplication and add the mapping/unmapping of the protection buffers to the iser_dma_map_task_data/iser_dma_unmap_task_data functions. Link: https://lore.kernel.org/r/20220308145546.8372-4-mgurtovoy@nvidia.com Reviewed-by: Sergey Gorenko Signed-off-by: Max Gurtovoy Acked-by: Sagi Grimberg Signed-off-by: Jason Gunthorpe drivers/infiniband/ulp/iser/iscsi_iser.h | 5 ++-- drivers/infiniband/ulp/iser/iser_initiator.c | 40 ++-------------------------- drivers/infiniband/ulp/iser/iser_memory.c | 31 ++++++++++++++++++--- 3 files changed, 31 insertions(+), 45 deletions(-) commit ee4efeaea8837bb7018d188a9eb8837c7ff79561 Author: Max Gurtovoy Date: Tue Mar 8 16:55:44 2022 +0200 IB/iser: Use iser_fr_desc as registration context After removing the FMR support in iSER, there is only one type of registration context. Replace the void pointer with the explicit structure for registration (struct iser_fr_desc). Link: https://lore.kernel.org/r/20220308145546.8372-3-mgurtovoy@nvidia.com Reviewed-by: Sergey Gorenko Signed-off-by: Max Gurtovoy Acked-by: Sagi Grimberg Signed-off-by: Jason Gunthorpe drivers/infiniband/ulp/iser/iscsi_iser.h | 8 ++++---- drivers/infiniband/ulp/iser/iser_initiator.c | 4 ++-- drivers/infiniband/ulp/iser/iser_memory.c | 8 ++++---- drivers/infiniband/ulp/iser/iser_verbs.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) commit 7f68d7493ff07a0ad63f63c4a1a4e0781cec0dd2 Author: Max Gurtovoy Date: Tue Mar 8 16:55:43 2022 +0200 IB/iser: Remove iser_reg_data_sg helper function Open coding it makes the code more readable and simple. Link: https://lore.kernel.org/r/20220308145546.8372-2-mgurtovoy@nvidia.com Reviewed-by: Sergey Gorenko Signed-off-by: Max Gurtovoy Acked-by: Sagi Grimberg Signed-off-by: Jason Gunthorpe drivers/infiniband/ulp/iser/iser_memory.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) commit dfad78e07e93decdd5361c08473ea66898b817c7 Merge: 86c17c40d290 f6c46b1d62f8 f6bfe8b5b2c2 a644161ba11d Author: Rafael J. Wysocki Date: Fri Mar 18 18:29:21 2022 +0100 Merge branches 'pm-sleep', 'pm-domains' and 'pm-docs' Merge changes related to system sleep, PM domains changes and power management documentation changes for 5.18-rc1: - Fix load_image_and_restore() error path (Ye Bin). - Fix typos in comments in the system wakeup hadling code (Tom Rix). - Clean up non-kernel-doc comments in hibernation code (Jiapeng Chong). - Fix __setup handler error handling in system-wide suspend and hibernation core code (Randy Dunlap). - Add device name to suspend_report_result() (Youngjin Jang). - Make virtual guests honour ACPI S4 hardware signature by default (David Woodhouse). - Block power off of a parent PM domain unless child is in deepest state (Ulf Hansson). - Use dev_err_probe() to simplify error handling for generic PM domains (Ahmad Fatoum). - Fix sleep-in-atomic bug caused by genpd_debug_remove() (Shawn Guo). - Document Intel uncore frequency scaling (Srinivas Pandruvada). * pm-sleep: PM: hibernate: Honour ACPI hardware signature by default for virtual guests PM: sleep: Add device name to suspend_report_result() PM: suspend: fix return value of __setup handler PM: hibernate: fix __setup handler error handling PM: hibernate: Clean up non-kernel-doc comments PM: sleep: wakeup: Fix typos in comments PM: hibernate: fix load_image_and_restore() error path * pm-domains: PM: domains: Fix sleep-in-atomic bug caused by genpd_debug_remove() PM: domains: use dev_err_probe() to simplify error handling PM: domains: Prevent power off for parent unless child is in deepest state * pm-docs: Documentation: admin-guide: pm: Document uncore frequency scaling commit dd664099002db909912a23215f8775c97f7f4f10 Author: Rick Edgecombe Date: Thu Mar 17 12:20:13 2022 -0700 binfmt_elf: Don't write past end of notes for regset gap In fill_thread_core_info() the ptrace accessible registers are collected to be written out as notes in a core file. The note array is allocated from a size calculated by iterating the user regset view, and counting the regsets that have a non-zero core_note_type. However, this only allows for there to be non-zero core_note_type at the end of the regset view. If there are any gaps in the middle, fill_thread_core_info() will overflow the note allocation, as it iterates over the size of the view and the allocation would be smaller than that. There doesn't appear to be any arch that has gaps such that they exceed the notes allocation, but the code is brittle and tries to support something it doesn't. It could be fixed by increasing the allocation size, but instead just have the note collecting code utilize the array better. This way the allocation can stay smaller. Even in the case of no arch's that have gaps in their regset views, this introduces a change in the resulting indicies of t->notes. It does not introduce any changes to the core file itself, because any blank notes are skipped in write_note_info(). In case, the allocation logic between fill_note_info() and fill_thread_core_info() ever diverges from the usage logic, warn and skip writing any notes that would overflow the array. This fix is derrived from an earlier one[0] by Yu-cheng Yu. [0] https://lore.kernel.org/lkml/20180717162502.32274-1-yu-cheng.yu@intel.com/ Co-developed-by: Yu-cheng Yu Signed-off-by: Yu-cheng Yu Signed-off-by: Rick Edgecombe Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220317192013.13655-4-rick.p.edgecombe@intel.com fs/binfmt_elf.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) commit 86c17c40d290cee7353f9bf531f7adb3c88675c5 Merge: 524bb1da785a 3870a44d50fe 03eb65224e57 Author: Rafael J. Wysocki Date: Fri Mar 18 18:14:55 2022 +0100 Merge branches 'pm-cpufreq' and 'pm-cpuidle' Merge cpufreq and cpuidle changes for 5.18-rc1: - Make the schedutil cpufreq governor use to_gov_attr_set() instead of open coding it (Kevin Hao). - Replace acpi_bus_get_device() with acpi_fetch_acpi_dev() in the cpufreq longhaul driver (Rafael Wysocki). - Unify show() and store() naming in cpufreq and make it use __ATTR_XX (Lianjie Zhang). - Make the intel_pstate driver use the EPP value set by the firmware by default (Srinivas Pandruvada). - Re-order the init checks in the powernow-k8 cpufreq driver (Mario Limonciello). - Make the ACPI processor idle driver check for architectural support for LPI to avoid using it on x86 by mistake (Mario Limonciello). - Add Sapphire Rapids Xeon support to the intel_idle driver (Artem Bityutskiy). - Add 'preferred_cstates' module argument to the intel_idle driver to work around C1 and C1E handling issue on Sapphire Rapids (Artem Bityutskiy). - Add core C6 optimization on Sapphire Rapids to the intel_idle driver (Artem Bityutskiy). - Optimize the haltpoll cpuidle driver a bit (Li RongQing). - Remove leftover text from intel_idle() kerneldoc comment and fix up white space in intel_idle (Rafael Wysocki). * pm-cpufreq: cpufreq: powernow-k8: Re-order the init checks cpufreq: intel_pstate: Use firmware default EPP cpufreq: unify show() and store() naming and use __ATTR_XX cpufreq: longhaul: Replace acpi_bus_get_device() cpufreq: schedutil: Use to_gov_attr_set() to get the gov_attr_set cpufreq: Move to_gov_attr_set() to cpufreq.h * pm-cpuidle: cpuidle: intel_idle: Drop redundant backslash at line end cpuidle: intel_idle: Update intel_idle() kerneldoc comment cpuidle: haltpoll: Call cpuidle_poll_state_init() later intel_idle: add core C6 optimization for SPR intel_idle: add 'preferred_cstates' module argument intel_idle: add SPR support ACPI: processor idle: Check for architectural support for LPI cpuidle: PSCI: Move the `has_lpi` check to the beginning of the function commit 6bd0c76bd70447aedfeafa9e1fcc249991d6c678 Merge: 9905eed48e82 18b1ab7aa76b Author: Jakub Kicinski Date: Fri Mar 18 10:05:17 2022 -0700 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2022-03-18 We've added 2 non-merge commits during the last 18 day(s) which contain a total of 2 files changed, 50 insertions(+), 20 deletions(-). The main changes are: 1) Fix a race in XSK socket teardown code that can lead to a NULL pointer dereference, from Magnus. 2) Small MAINTAINERS doc update to remove Lorenz from sockmap, from Lorenz. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: xsk: Fix race at socket teardown bpf: Remove Lorenz Bauer from L7 BPF maintainers ==================== Link: https://lore.kernel.org/r/20220318152418.28638-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 1bde8bddb5db59e5bcd090b227c74d48965cedef Merge: 8a9bd50a9d68 830751d54b4a Author: Rafael J. Wysocki Date: Fri Mar 18 17:59:53 2022 +0100 Merge branch 'acpi-docs' Make ACPI documentation updates for 5.18-rc1: - Update the ACPI device enumeration documentation and unify the ASL style in GPIO-related examples (Andy Shevchenko). * acpi-docs: ACPI: docs: gpio-properties: Unify ASL style for GPIO examples ACPI: docs: enumeration: Unify Package () for properties ACPI: docs: enumeration: Drop comma for terminator entry ACPI: docs: enumeration: Drop ugly ifdeffery from the examples ACPI: docs: enumeration: Amend PWM enumeration ASL example ACPI: docs: enumeration: Remove redundant .owner assignment ACPI: docs: enumeration: Update UART serial bus resource documentation ACPI: docs: enumeration: Discourage to use custom _DSM methods commit adf3a9e9f556613197583a1884f0de40a8bb6fb9 Author: Jens Axboe Date: Mon Mar 14 17:26:19 2022 -0600 io_uring: don't check unrelated req->open.how in accept request Looks like a victim of too much copy/paste, we should not be looking at req->open.how in accept. The point is to check CLOEXEC and error out, which we don't invalid direct descriptors on exec. Hence any attempt to get a direct descriptor with CLOEXEC is invalid. No harm is done here, as req->open.how.flags overlaps with req->accept.flags, but it's very confusing and might change if either of those command structs are modified. Fixes: aaa4db12ef7b ("io_uring: accept directly into fixed file table") Signed-off-by: Jens Axboe fs/io_uring.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 08063b4bc1581bbdcae99da4a54f546a50045fc0 Author: Andrii Nakryiko Date: Fri Mar 18 08:01:06 2022 -0700 bpftool: Add BPF_TRACE_KPROBE_MULTI to attach type names table BPF_TRACE_KPROBE_MULTI is a new attach type name, add it to bpftool's table. This fixes a currently failing CI bpftool check. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220318150106.2933343-1-andrii@kernel.org tools/bpf/bpftool/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0074f3f2b1e43d3cedd97e47fb6980db6d2ba79e Author: Colin Foster Date: Sun Mar 13 15:45:24 2022 -0700 regmap: allow a defined reg_base to be added to every address There's an inconsistency that arises when a register set can be accessed internally via MMIO, or externally via SPI. The VSC7514 chip allows both modes of operation. When internally accessed, the system utilizes __iomem, devm_ioremap_resource, and devm_regmap_init_mmio. For SPI it isn't possible to utilize memory-mapped IO. To properly operate, the resource base must be added to the register before every operation. Signed-off-by: Colin Foster Link: https://lore.kernel.org/r/20220313224524.399947-3-colin.foster@in-advantage.com Signed-off-by: Mark Brown drivers/base/regmap/internal.h | 1 + drivers/base/regmap/regmap.c | 6 ++++++ include/linux/regmap.h | 3 +++ 3 files changed, 10 insertions(+) commit 86fc59ef818beb0e1945d17f8e734898baba7e4e Author: Colin Foster Date: Sun Mar 13 15:45:23 2022 -0700 regmap: add configurable downshift for addresses Add an additional reg_downshift to be applied to register addresses before any register accesses. An example of a device that uses this is a VSC7514 chip, which require each register address to be downshifted by two if the access is performed over a SPI bus. Signed-off-by: Colin Foster Link: https://lore.kernel.org/r/20220313224524.399947-2-colin.foster@in-advantage.com Signed-off-by: Mark Brown drivers/base/regmap/internal.h | 1 + drivers/base/regmap/regmap.c | 5 +++++ include/linux/regmap.h | 3 +++ 3 files changed, 9 insertions(+) commit 8a9bd50a9d68ba68c88cb5e8f64413a8520c33fe Merge: 24b2b094b556 620c803f42de c844d22fe0c0 a2a591fb76e6 Author: Rafael J. Wysocki Date: Fri Mar 18 17:48:55 2022 +0100 Merge branches 'acpi-soc', 'acpi-video' and 'acpi-apei' Merge ACPI SoC drivers changes, ACPI backlight driver changes and APEI changes for 5.18-rc1: - Make the ACPI driver for Intel SoCs (LPSS) let the SPI driver know the exact type of the controller (Andy Shevchenko). - Force native backlight mode on Clevo NL5xRU and NL5xNU (Werner Sembach). - Fix return value of __setup handlers in the APEI code (Randy Dunlap). - Add Arm Generic Diagnostic Dump and Reset device driver (Ilkka Koskinen). - Limit printable size of BERT table data (Darren Hart). - Fix up HEST and GHES initialization (Shuai Xue). * acpi-soc: ACPI: LPSS: Provide an SSP type to the driver ACPI: LPSS: Constify properties member in struct lpss_device_desc ACPI: platform: Constify properties parameter in acpi_create_platform_device() * acpi-video: ACPI: video: Force backlight native for Clevo NL5xRU and NL5xNU * acpi-apei: ACPI: AGDI: Add driver for Arm Generic Diagnostic Dump and Reset device ACPI/APEI: Limit printable size of BERT table data ACPI: APEI: fix return value of __setup handlers ACPI: APEI: rename ghes_init() with an "acpi_" prefix ACPI: APEI: explicit init of HEST and GHES in apci_init() commit 714797c98eddae34e81b444c906e60f890885678 Merge: cf5019816d87 21ea45784275 Author: Paolo Bonzini Date: Fri Mar 18 12:43:24 2022 -0400 Merge tag 'kvmarm-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 updates for 5.18 - Proper emulation of the OSLock feature of the debug architecture - Scalibility improvements for the MMU lock when dirty logging is on - New VMID allocator, which will eventually help with SVA in VMs - Better support for PMUs in heterogenous systems - PSCI 1.1 support, enabling support for SYSTEM_RESET2 - Implement CONFIG_DEBUG_LIST at EL2 - Make CONFIG_ARM64_ERRATUM_2077057 default y - Reduce the overhead of VM exit when no interrupt is pending - Remove traces of 32bit ARM host support from the documentation - Updated vgic selftests - Various cleanups, doc updates and spelling fixes commit 24b2b094b5567c1440f902bab892a23b9d98e398 Merge: 03d5c98d9158 13a62d0e1330 82909316caac 0750b8fcf313 7dacee0b9efc Author: Rafael J. Wysocki Date: Fri Mar 18 17:36:54 2022 +0100 Merge branches 'acpi-ec', 'acpi-cppc', 'acpi-fan' and 'acpi-battery' Merge ACPI EC driver changes, CPPC-related changes, ACPI fan driver changes and ACPI battery driver changes for 5.18-rc1: - Make wakeup events checks in the ACPI EC driver more straightforward and clean up acpi_ec_submit_event() (Rafael Wysocki). - Make it possible to obtain the CPU capacity with the help of CPPC information (Ionela Voinescu). - Improve fine grained fan control in the ACPI fan driver and document it (Srinivas Pandruvada). - Add device HID and quirk for Microsoft Surface Go 3 to the ACPI battery driver (Maximilian Luz). * acpi-ec: ACPI: EC: Rearrange code in acpi_ec_submit_event() ACPI: EC: Reduce indentation level in acpi_ec_submit_event() ACPI: EC: Do not return result from advance_transaction() * acpi-cppc: arm64, topology: enable use of init_cpu_capacity_cppc() arch_topology: obtain cpu capacity using information from CPPC x86, ACPI: rename init_freq_invariance_cppc() to arch_init_invariance_cppc() * acpi-fan: Documentation/admin-guide/acpi: Add documentation for fine grain control ACPI: fan: Add additional attributes for fine grain control ACPI: fan: Properly handle fine grain control ACPI: fan: Optimize struct acpi_fan_fif ACPI: fan: Separate file for attributes creation ACPI: fan: Fix error reporting to user space * acpi-battery: ACPI: battery: Add device HID and quirk for Microsoft Surface Go 3 commit c639e85e93aa10ea0512ee416eead60da466e161 Author: Codrin Ciubotariu Date: Fri Mar 18 11:26:09 2022 +0200 ASoC: atmel: mchp-pdmc: print the correct property name The correct property is 'microchip,mic-pos', not 'mchp,mic-pos', so replace all occurences of 'mchp,mic-pos' with 'microchip,mic-pos'. Fix a multi-line comment format while we are at it. Fixes: 50291652af52 ("ASoC: atmel: mchp-pdmc: add PDMC driver") Signed-off-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220318092609.130901-1-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown sound/soc/atmel/mchp-pdmc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit 03d5c98d91587291163c341883ddf067bb6ca00a Merge: 314b97cc97f0 977dc3082285 9978f446d406 6a861abceecb e702196bf857 Author: Rafael J. Wysocki Date: Fri Mar 18 17:23:05 2022 +0100 Merge branches 'acpi-pm', 'acpi-properties', 'acpi-misc' and 'acpi-x86' Merge ACPI power management changes, ACPI device properties handling changes, x86-specific ACPI changes and miscellaneous ACPI changes for 5.18-rc1: - Add power management debug messages related to suspend-to-idle in two places (Rafael Wysocki). - Fix __acpi_node_get_property_reference() return value and clean up that function (Andy Shevchenko, Sakari Ailus). - Fix return value of the __setup handler in the ACPI PM timer clock source driver (Randy Dunlap). - Clean up double words in two comments (Tom Rix). - Add "skip i2c clients" quirks for Lenovo Yoga Tablet 1050F/L and Nextbook Ares 8 (Hans de Goede). - Clean up frequency invariance handling on x86 in the ACPI CPPC library (Huang Rui). - Work around broken XSDT on the Advantech DAC-BJ01 board (Mark Cilissen). * acpi-pm: ACPI: EC / PM: Print additional debug message in acpi_ec_dispatch_gpe() ACPI: PM: Print additional debug message in acpi_s2idle_wake() * acpi-properties: ACPI: property: Get rid of redundant 'else' ACPI: properties: Consistently return -ENOENT if there are no more references * acpi-misc: clocksource: acpi_pm: fix return value of __setup handler ACPI: clean up double words in two comments * acpi-x86: ACPI / x86: Work around broken XSDT on Advantech DAC-BJ01 board x86/ACPI: CPPC: Move init_freq_invariance_cppc() into x86 CPPC x86: Expose init_freq_invariance() to topology header x86/ACPI: CPPC: Move AMD maximum frequency ratio setting function into x86 CPPC x86/ACPI: CPPC: Rename cppc_msr.c to cppc.c ACPI / x86: Add skip i2c clients quirk for Lenovo Yoga Tablet 1050F/L ACPI / x86: Add skip i2c clients quirk for Nextbook Ares 8 commit 98e92867b99761979f6d4c155b7d5a5b523412a3 Author: Chao Yu Date: Fri Mar 18 17:02:30 2022 +0800 f2fs: use aggressive GC policy during f2fs_disable_checkpoint() Let's enable GC_URGENT_HIGH mode during f2fs_disable_checkpoint(), so that we can use SSR allocator for GCed data/node persistence, it can improve the performance due to it avoiding migration of data/node locates in selected target segment of SSR allocator. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/super.c | 5 +++++ 1 file changed, 5 insertions(+) commit 9b56adcf525522e9ffa52471260298d91fc1d395 Author: Fengnan Chang Date: Fri Mar 18 09:23:04 2022 +0800 f2fs: fix compressed file start atomic write may cause data corruption When compressed file has blocks, f2fs_ioc_start_atomic_write will succeed, but compressed flag will be remained in inode. If write partial compreseed cluster and commit atomic write will cause data corruption. This is the reproduction process: Step 1: create a compressed file ,write 64K data , call fsync(), then the blocks are write as compressed cluster. Step2: iotcl(F2FS_IOC_START_ATOMIC_WRITE) --- this should be fail, but not. write page 0 and page 3. iotcl(F2FS_IOC_COMMIT_ATOMIC_WRITE) -- page 0 and 3 write as normal file, Step3: drop cache. read page 0-4 -- Since page 0 has a valid block address, read as non-compressed cluster, page 1 and 2 will be filled with compressed data or zero. The root cause is, after commit 7eab7a696827 ("f2fs: compress: remove unneeded read when rewrite whole cluster"), in step 2, f2fs_write_begin() only set target page dirty, and in f2fs_commit_inmem_pages(), we will write partial raw pages into compressed cluster, result in corrupting compressed cluster layout. Fixes: 4c8ff7095bef ("f2fs: support data compression") Fixes: 7eab7a696827 ("f2fs: compress: remove unneeded read when rewrite whole cluster") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Fengnan Chang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/data.c | 2 +- fs/f2fs/file.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) commit 726c0eb7cb15be3e5fe9a9f1c8aad12c5cbe4675 Author: Mianhan Liu Date: Wed Sep 29 03:47:30 2021 +0800 Bluetooth: ath3k: remove superfluous header files ath3k.c hasn't use any macro or function declared in linux/device.h. Thus, these files can be removed from ath3k.c safely without affecting the compilation of the ./drivers/bluetooth module Signed-off-by: Mianhan Liu Signed-off-by: Marcel Holtmann drivers/bluetooth/ath3k.c | 1 - 1 file changed, 1 deletion(-) commit 520e31a99100b786d82e518f89e4fd132570a349 Author: Mianhan Liu Date: Wed Sep 29 03:51:08 2021 +0800 Bluetooth: bcm203x: remove superfluous header files bcm203x.c hasn't use any macro or function declared in linux/atomic.h. Thus, these files can be removed from bcm203x.c safely without affecting the compilation of the ./drivers/bluetooth module Signed-off-by: Mianhan Liu Signed-off-by: Marcel Holtmann drivers/bluetooth/bcm203x.c | 1 - 1 file changed, 1 deletion(-) commit 27e8527e006f1f4281adc335cf7aa744f649f398 Author: Hans de Goede Date: Mon Feb 28 12:38:41 2022 +0100 Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table The DSDT for the Asus TF103C specifies a IOAPIC IRQ for the HCI -> host IRQ but this is not correct. Unlike the previous entries in the table, this time the correct GPIO to use instead is known; and the TF103C is battery powered making runtime-pm support more important. Extend the bcm_broken_irq_dmi_table mechanism to allow specifying the right GPIO instead of just always disabling runtime-pm and add an entry to it for the Asus TF103C. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann drivers/bluetooth/hci_bcm.c | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) commit 5ad80cfcf30006110075860b61a7101f215f665c Author: Yake Yang Date: Thu Mar 17 07:15:23 2022 +0800 Bluetooth: mt7921s: Add WBS support It is time to add wide band speech (WBS) support. Reviewed-by: Mark Chen Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Yake Yang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtksdio.c | 3 +++ 1 file changed, 3 insertions(+) commit f41b91fa178342b6a49f1088e514178c2da4176f Author: Yake Yang Date: Thu Mar 17 07:15:22 2022 +0800 Bluetooth: mt7921s: Add .btmtk_get_codec_config_data add .btmtk_get_codec_config_data to get codec configuration data. In HFP offload usecase, controllers need to be set codec details before opening SCO. This callback function is used to fetch vendor specific codec config data. This is a preliminary patch to add the WBS support to the MT7921 driver. Reviewed-by: Mark Chen Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Yake Yang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtksdio.c | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) commit d786105ef25c0c7640daffc10bcf6d6fcfa0d0e1 Author: Yake Yang Date: Thu Mar 17 07:15:21 2022 +0800 Bluetooth: mt7921s: Add .get_data_path_id Add .get_data_path_id to fetch data_path_id for MT7921 to support HFP offload use case. This is a preliminary patch to add the WBS support to the MT7921 driver. Reviewed-by: Mark Chen Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Yake Yang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtksdio.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) commit 546ff98eb3a019695aa5638a870c589cc2aa95df Author: Yake Yang Date: Thu Mar 17 07:15:20 2022 +0800 Bluetooth: mt7921s: Set HCI_QUIRK_VALID_LE_STATES The patch set HCI_QUIRK_VALID_LE_STATES to be consistent with the btusb for MT7921 and is required for the likes of experimental LE simultaneous roles. Reviewed-by: Mark Chen Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Yake Yang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtksdio.c | 3 +++ 1 file changed, 3 insertions(+) commit b062a0b9c1dc1ff63094337dccfe1568d5b62023 Author: Yake Yang Date: Thu Mar 17 07:15:19 2022 +0800 Bluetooth: btmtksdio: Fix kernel oops in btmtksdio_interrupt Fix the following kernel oops in btmtksdio_interrrupt [ 14.339134] btmtksdio_interrupt+0x28/0x54 [ 14.339139] process_sdio_pending_irqs+0x68/0x1a0 [ 14.339144] sdio_irq_work+0x40/0x70 [ 14.339154] process_one_work+0x184/0x39c [ 14.339160] worker_thread+0x228/0x3e8 [ 14.339168] kthread+0x148/0x3ac [ 14.339176] ret_from_fork+0x10/0x30 That happened because hdev->power_on is already called before sdio_set_drvdata which btmtksdio_interrupt handler relies on is not properly set up. The details are shown as the below: hci_register_dev would run queue_work(hdev->req_workqueue, &hdev->power_on) as WQ_HIGHPRI workqueue_struct to complete the power-on sequeunce and thus hci_power_on may run before sdio_set_drvdata is done in btmtksdio_probe. The hci_dev_do_open in hci_power_on would initialize the device and enable the interrupt and thus it is possible that btmtksdio_interrupt is being called right before sdio_set_drvdata is filled out. When btmtksdio_interrupt is being called and sdio_set_drvdata is not filled , the kernel oops is going to happen because btmtksdio_interrupt access an uninitialized pointer. Fixes: 9aebfd4a2200 ("Bluetooth: mediatek: add support for MediaTek MT7663S and MT7668S SDIO devices") Reviewed-by: Mark Chen Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Yake Yang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtksdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a76d269a4e86cfd7d4441e40adccfa67808fe6fa Author: Dan Carpenter Date: Thu Mar 17 10:57:40 2022 +0300 Bluetooth: btmtkuart: fix error handling in mtk_hci_wmt_sync() This code has an uninitialized variable warning: drivers/bluetooth/btmtkuart.c:184 mtk_hci_wmt_sync() error: uninitialized symbol 'wc'. But it also has error paths which have memory leaks. Fixes: 8f550f55b155 ("Bluetooth: btmtkuart: rely on BT_MTK module") Signed-off-by: Dan Carpenter Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtkuart.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 9fa6b4cda3b414e990f008f45f9bcecbcb54d4d1 Author: Niels Dossche Date: Wed Mar 16 16:33:50 2022 +0100 Bluetooth: call hci_le_conn_failed with hdev lock in hci_le_conn_failed hci_le_conn_failed function's documentation says that the caller must hold hdev->lock. The only callsite that does not hold that lock is hci_le_conn_failed. The other 3 callsites hold the hdev->lock very locally. The solution is to hold the lock during the call to hci_le_conn_failed. Fixes: 3c857757ef6e ("Bluetooth: Add directed advertising support through connect()") Signed-off-by: Niels Dossche Signed-off-by: Marcel Holtmann net/bluetooth/hci_conn.c | 2 ++ 1 file changed, 2 insertions(+) commit ff39fc1bc6b4053a9c3f193c7e3255a06ecfcc43 Author: Manish Mandlik Date: Sat Mar 12 02:08:59 2022 -0800 Bluetooth: Send AdvMonitor Dev Found for all matched devices When an Advertisement Monitor is configured with SamplingPeriod 0xFF, the controller reports only one adv report along with the MSFT Monitor Device event. When an advertiser matches multiple monitors, some controllers send one adv report for each matched monitor; whereas, some controllers send just one adv report for all matched monitors. In such a case, report Adv Monitor Device Found event for each matched monitor. Signed-off-by: Manish Mandlik Reviewed-by: Miao-chen Chou Signed-off-by: Marcel Holtmann net/bluetooth/mgmt.c | 70 +++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 33 deletions(-) commit 37b63c68194d09d358c8abd73692adf9a6ceaad3 Author: Manish Mandlik Date: Sat Mar 12 02:08:58 2022 -0800 Bluetooth: msft: Clear tracked devices on resume Clear already tracked devices on system resume. Once the monitors are reregistered after resume, matched devices in range will be found again. Signed-off-by: Manish Mandlik Reviewed-by: Miao-chen Chou Signed-off-by: Marcel Holtmann net/bluetooth/msft.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) commit da8912176fb0ff9fd60e14fa653108d96422b896 Author: Gavin Li Date: Mon Mar 14 15:42:52 2022 -0700 Bluetooth: fix incorrect nonblock bitmask in bt_sock_wait_ready() Callers pass msg->msg_flags as flags, which contains MSG_DONTWAIT instead of O_NONBLOCK. Signed-off-by: Gavin Li Signed-off-by: Marcel Holtmann include/net/bluetooth/bluetooth.h | 2 +- net/bluetooth/af_bluetooth.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit 1f667e157605a217f10fc45f1a7fb4a8354eb5e3 Author: Christophe JAILLET Date: Wed Mar 2 21:18:35 2022 +0100 Bluetooth: Don't assign twice the same value data.pid is set twice with the same value. Remove one of these redundant calls. Signed-off-by: Christophe JAILLET Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann net/bluetooth/l2cap_core.c | 1 - 1 file changed, 1 deletion(-) commit 18e8055c88142d8f6e23ebdc38c126ec37844e5d Author: Max Chou Date: Mon Mar 14 14:54:22 2022 +0800 Bluetooth: btrtl: Add support for RTL8852B Add the support for RTL8852B BT controller on USB interface. The necessary firmware file will be submitted to linux-firmware. Signed-off-by: Max Chou Signed-off-by: Marcel Holtmann drivers/bluetooth/btrtl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 32cb08e958696908a9aad5e49a78d74f7e32fffb Author: Pavel Skripkin Date: Sun Mar 13 20:49:36 2022 +0300 Bluetooth: hci_uart: add missing NULL check in h5_enqueue Syzbot hit general protection fault in __pm_runtime_resume(). The problem was in missing NULL check. hu->serdev can be NULL and we should not blindly pass &serdev->dev somewhere, since it will cause GPF. Reported-by: syzbot+b9bd12fbed3485a3e51f@syzkaller.appspotmail.com Fixes: d9dd833cf6d2 ("Bluetooth: hci_h5: Add runtime suspend") Signed-off-by: Pavel Skripkin Signed-off-by: Marcel Holtmann drivers/bluetooth/hci_h5.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit f63d24baff787e13b723d86fe036f84bdbc35045 Author: Luiz Augusto von Dentz Date: Fri Mar 11 13:19:33 2022 -0800 Bluetooth: Fix use after free in hci_send_acl This fixes the following trace caused by receiving HCI_EV_DISCONN_PHY_LINK_COMPLETE which does call hci_conn_del without first checking if conn->type is in fact AMP_LINK and in case it is do properly cleanup upper layers with hci_disconn_cfm: ================================================================== BUG: KASAN: use-after-free in hci_send_acl+0xaba/0xc50 Read of size 8 at addr ffff88800e404818 by task bluetoothd/142 CPU: 0 PID: 142 Comm: bluetoothd Not tainted 5.17.0-rc5-00006-gda4022eeac1a #7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x45/0x59 print_address_description.constprop.0+0x1f/0x150 kasan_report.cold+0x7f/0x11b hci_send_acl+0xaba/0xc50 l2cap_do_send+0x23f/0x3d0 l2cap_chan_send+0xc06/0x2cc0 l2cap_sock_sendmsg+0x201/0x2b0 sock_sendmsg+0xdc/0x110 sock_write_iter+0x20f/0x370 do_iter_readv_writev+0x343/0x690 do_iter_write+0x132/0x640 vfs_writev+0x198/0x570 do_writev+0x202/0x280 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RSP: 002b:00007ffce8a099b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 Code: 0f 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 14 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 RDX: 0000000000000001 RSI: 00007ffce8a099e0 RDI: 0000000000000015 RAX: ffffffffffffffda RBX: 00007ffce8a099e0 RCX: 00007f788fc3cf77 R10: 00007ffce8af7080 R11: 0000000000000246 R12: 000055e4ccf75580 RBP: 0000000000000015 R08: 0000000000000002 R09: 0000000000000001 R13: 000055e4ccf754a0 R14: 000055e4ccf75cd0 R15: 000055e4ccf4a6b0 Allocated by task 45: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x81/0xa0 hci_chan_create+0x9a/0x2f0 l2cap_conn_add.part.0+0x1a/0xdc0 l2cap_connect_cfm+0x236/0x1000 le_conn_complete_evt+0x15a7/0x1db0 hci_le_conn_complete_evt+0x226/0x2c0 hci_le_meta_evt+0x247/0x450 hci_event_packet+0x61b/0xe90 hci_rx_work+0x4d5/0xc50 process_one_work+0x8fb/0x15a0 worker_thread+0x576/0x1240 kthread+0x29d/0x340 ret_from_fork+0x1f/0x30 Freed by task 45: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 __kasan_slab_free+0xfb/0x130 kfree+0xac/0x350 hci_conn_cleanup+0x101/0x6a0 hci_conn_del+0x27e/0x6c0 hci_disconn_phylink_complete_evt+0xe0/0x120 hci_event_packet+0x812/0xe90 hci_rx_work+0x4d5/0xc50 process_one_work+0x8fb/0x15a0 worker_thread+0x576/0x1240 kthread+0x29d/0x340 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff88800c0f0500 The buggy address is located 24 bytes inside of which belongs to the cache kmalloc-128 of size 128 The buggy address belongs to the page: 128-byte region [ffff88800c0f0500, ffff88800c0f0580) flags: 0x100000000000200(slab|node=0|zone=1) page:00000000fe45cd86 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xc0f0 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 raw: 0100000000000200 ffffea00003a2c80 dead000000000004 ffff8880078418c0 page dumped because: kasan: bad access detected ffff88800c0f0400: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc Memory state around the buggy address: >ffff88800c0f0500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88800c0f0480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88800c0f0580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ================================================================== ffff88800c0f0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb Reported-by: Sönke Huster Tested-by: Sönke Huster Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann net/bluetooth/hci_event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit b3cf94c8b6b2f1a2b94825a025db291da2b151fd Author: Ismael Ferreras Morezuelas Date: Mon Mar 7 21:04:45 2022 +0100 Bluetooth: btusb: Use quirk to skip HCI_FLT_CLEAR_ALL on fake CSR controllers Another subset of the more recent batch of Chinese clones aren't specs-compliant and seem to lock up whenever they receive a HCI_OP_SET_EVENT_FLT with flt_type set to zero/HCI_FLT_CLEAR_ALL, which on Linux (until the recent HCI state-machine refactor) happened right at BR/EDR setup. As there are other less-straightforward ways of reaching those operations, this patch is still relevant. So, while all the previous efforts to wrangle the herd of fake CSRs seem to be paying off (and these also get detected as such) we still need to take care of this quirk; testers seem to agree that these dongles tend to work well enough afterwards. From some cursory USB packet capture on Windows it seems like that driver doesn't appear to use this clear-all functionality at all. This patch was tested on some really popular AliExpress-style dongles, in my case marked as "V5.0". Chip markings: UG8413, the backside of the PCB says "USB Dangel" (sic). Here is the `hciconfig -a` output; for completeness: hci0: Type: Primary Bus: USB BD Address: 00:1A:7D:DA:7X:XX ACL MTU: 679:8 SCO MTU: 48:16 UP RUNNING PSCAN ISCAN Features: 0xbf 0x3e 0x4d 0xfa 0xdb 0x3d 0x7b 0xc7 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH SNIFF Link mode: PERIPHERAL ACCEPT Name: 'CSR8510 A10.' Class: 0x7c0104 Service Classes: Rendering, Capturing, Object Transfer, Audio, Telephony Device Class: Computer, Desktop workstation HCI Version: 4.0 (0x6) Revision: 0x3120 LMP Version: 4.0 (0x6) Subversion: 0x22bb Manufacturer: Cambridge Silicon Radio (10) As well as the `lsusb -vv -d 0a12:0001`: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 224 Wireless bDeviceSubClass 1 Radio Frequency bDeviceProtocol 1 Bluetooth bMaxPacketSize0 64 idVendor 0x0a12 Cambridge Silicon Radio, Ltd idProduct 0x0001 Bluetooth Dongle (HCI mode) bcdDevice 88.91 iManufacturer 0 iProduct 2 BT DONGLE10 iSerial 0 bNumConfigurations 1 Also, changed the benign dmesg print that shows up whenever the generic force-suspend fails from bt_dev_err to bt_dev_warn; it's okay and done on a best-effort basis, not a problem if that does not work. Also, swapped the HCI subver and LMP subver numbers for the Barrot in the comment, which I copied wrong the last time around. Fixes: 81cac64ba258a ("Bluetooth: Deal with USB devices that are faking CSR vendor") Fixes: cde1a8a992875 ("Bluetooth: btusb: Fix and detect most of the Chinese Bluetooth controllers") Fixes: d74e0ae7e0303 ("Bluetooth: btusb: Fix detection of some fake CSR controllers with a bcdDevice val of 0x0134") Fixes: 0671c0662383e ("Bluetooth: btusb: Add workaround for remote-wakeup issues with Barrot 8041a02 fake CSR controllers") Fixes: f4292e2faf522 ("Bluetooth: btusb: Make the CSR clone chip force-suspend workaround more generic") Link: https://bugzilla.kernel.org/show_bug.cgi?id=60824 Link: https://gist.github.com/nevack/6b36b82d715dc025163d9e9124840a07 Cc: stable@vger.kernel.org Cc: Hans de Goede Tested-by: Gonzalo Tornaría Tested-by: Mateus Lemos Tested-by: Ismael Ferreras Morezuelas Signed-off-by: Ismael Ferreras Morezuelas Reviewed-by: Hans de Goede Signed-off-by: Marcel Holtmann drivers/bluetooth/btusb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 0eaecfb2e4814d51ab172df3823e35d7c488b6d2 Author: Ismael Ferreras Morezuelas Date: Mon Mar 7 21:04:44 2022 +0100 Bluetooth: hci_sync: Add a new quirk to skip HCI_FLT_CLEAR_ALL Some controllers have problems with being sent a command to clear all filtering. While the HCI code does not unconditionally send a clear-all anymore at BR/EDR setup (after the state machine refactor), there might be more ways of hitting these codepaths in the future as the kernel develops. Cc: stable@vger.kernel.org Cc: Hans de Goede Signed-off-by: Ismael Ferreras Morezuelas Reviewed-by: Hans de Goede Signed-off-by: Marcel Holtmann include/net/bluetooth/hci.h | 10 ++++++++++ net/bluetooth/hci_sync.c | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) commit 6ac034a76aa230c1acb5bce4442d47310b5aa2f3 Author: Sean Wang Date: Wed Mar 9 08:03:54 2022 +0800 Bluetooth: btmtkuart: fix the conflict between mtk and msft vendor event There is a conflict between MediaTek wmt event and msft vendor extension logic in the core layer since 145373cb1b1f ("Bluetooth: Add framework for Microsoft vendor extension") was introduced because we changed the type of mediatek wmt event to the type of msft vendor event in the driver. But the purpose we reported mediatek event to the core layer is for the diagnostic purpose with that we are able to see the full packet trace via monitoring socket with btmon. Thus, it is harmless we keep the original type of mediatek vendor event here to avoid breaking the msft extension function especially they can be supported by Mediatek future devices. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtkuart.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) commit 3640e7f4cb35353b39596816379def67ec9c58f4 Author: Sean Wang Date: Wed Mar 9 08:03:53 2022 +0800 Bluetooth: btmtkuart: add .set_bdaddr support add .set_bdaddr support Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtkuart.c | 1 + 1 file changed, 1 insertion(+) commit f5c3f98946e37a1f7ca07a6c6ab33b1223661aec Author: Sean Wang Date: Wed Mar 9 08:03:52 2022 +0800 Bluetooth: btmtkuart: rely on BT_MTK module Rely on btmtk module to reduce duplicated code Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann drivers/bluetooth/Kconfig | 1 + drivers/bluetooth/btmtk.c | 1 + drivers/bluetooth/btmtk.h | 1 + drivers/bluetooth/btmtkuart.c | 184 ++++++------------------------------------ 4 files changed, 29 insertions(+), 158 deletions(-) commit cc68a041d2f81edc50c4e0f822b329148468f346 Author: Takashi Iwai Date: Tue Mar 8 15:57:31 2022 +0100 Bluetooth: btusb: Add missing Chicony device for Realtek RTL8723BE Chicony Electronics BT device with 04f2:b49f seems to be a missing entry for Realtek RTL8723BE. T: Bus=02 Lev=01 Prnt=01 Port=03 Cnt=03 Dev#= 4 Spd=12 MxCh= 0 D: Ver= 2.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=04f2 ProdID=b49f Rev= 2.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 BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1196779 Signed-off-by: Takashi Iwai Signed-off-by: Marcel Holtmann drivers/bluetooth/btusb.c | 1 + 1 file changed, 1 insertion(+) commit 0ca8794a446c9fac951d9c2f26c2be7b8bd7c17b Author: Colin Ian King Date: Mon Mar 7 15:53:38 2022 +0000 Bluetooth: mgmt: remove redundant assignment to variable cur_len Variable cur_len is being ininitialized with a value in the start of a for-loop but this is never read, it is being re-assigned a new value on the first statement in the for-loop. The initialization is redundant and can be removed. Cleans up clang scan build warning: net/bluetooth/mgmt.c:7958:14: warning: Although the value stored to 'cur_len' is used in the enclosing expression, the value is never actually read from 'cur_len' [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Marcel Holtmann net/bluetooth/mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 314b97cc97f0d4bedc7b3a8eb35fe6d32d9d3641 Merge: bf978a83ed1d 0c9992315e73 2e433a94dab0 c42fa24b4475 e86801b0ff1c Author: Rafael J. Wysocki Date: Fri Mar 18 17:08:28 2022 +0100 Merge branches 'acpica', 'acpi-osl', 'acpi-bus' and 'acpi-tables' Merge ACPICA changes, ACPI OS-layer changes, ACPI bus-type and _OSC support changes and ACPI tables parsing changes for 5.18-rc1: - Use uintptr_t and offsetof() in the ACPICA code to avoid compiler warnings regarding NULL pointer arithmetic (Rafael Wysocki). - Fix possible NULL pointer dereference in acpi_ns_walk_namespace() when passed "acpi=off" in the command line (Rafael Wysocki). - Fix and clean up acpi_os_read/write_port() (Rafael Wysocki). - Introduce acpi_bus_for_each_dev() and use it for walking all ACPI device objects in the Type C code (Rafael Wysocki). - Fix the _OSC platform capabilities negotioation and prevent CPPC from being used if the platform firmware indicates that it not supported via _OSC (Rafael Wysocki). - Add AGDI and CEDT to the list of known ACPI table signatures (Ilkka Koskinen, Robert Kiraly). * acpica: ACPICA: Avoid walking the ACPI Namespace if it is not there ACPICA: Use uintptr_t and offsetof() in Linux kernel builds * acpi-osl: ACPI: OSL: Fix and clean up acpi_os_read/write_port() * acpi-bus: ACPI: bus: Avoid using CPPC if not supported by firmware Revert "ACPI: Pass the same capabilities to the _OSC regardless of the query flag" ACPI: bus: Introduce acpi_bus_for_each_dev() * acpi-tables: ACPI: tables: Add AGDI to the list of known table signatures ACPI: tables: Add CEDT signature to the list of known tables commit 89b35e3f28514087d3f1e28e8f5634fbfd07c554 Author: Eddie James Date: Thu Mar 17 16:14:26 2022 -0500 spi: fsi: Implement a timeout for polling status The data transfer routines must poll the status register to determine when more data can be shifted in or out. If the hardware gets into a bad state, these polling loops may never exit. Prevent this by returning an error if a timeout is exceeded. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220317211426.38940-1-eajames@linux.ibm.com Signed-off-by: Mark Brown drivers/spi/spi-fsi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 5999f85ddeb436b4007878f251a30ccc8b9c638b Author: Rohit Agarwal Date: Wed Mar 16 11:37:13 2022 +0530 regulator: qcom-rpmh: Add support for SDX65 Add support from RPMH regulators found in SDX65 platform. Signed-off-by: Rohit Agarwal Link: https://lore.kernel.org/r/1647410837-22537-3-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Mark Brown drivers/regulator/qcom-rpmh-regulator.c | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) commit e34855b99696433a26d86179552553c6c6fa69b8 Author: Rohit Agarwal Date: Wed Mar 16 11:37:12 2022 +0530 regulator: dt-bindings: Add PMX65 compatibles Add PMX65 compatibles for PMIC found in SDX65 platform. Signed-off-by: Rohit Agarwal Link: https://lore.kernel.org/r/1647410837-22537-2-git-send-email-quic_rohiagar@quicinc.com Signed-off-by: Mark Brown Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml | 2 ++ 1 file changed, 2 insertions(+) commit d1129bbe141bf08c19d44a701869ac0780754e86 Author: Nicolin Chen Date: Wed Mar 16 21:18:06 2022 -0700 MAINTAINERS: Add Shengjiu to maintainer list of sound/soc/fsl Shengjiu has been actively working on latest FSL platforms and keeping upstream effort as well, while I have been working on other subsystem lately and cannot guarantee audio patch review in the near term. So replacing with him in the maintainer list. Signed-off-by: Nicolin Chen Reviewed-by: Fabio Estevam Acked-by: Shengjiu Wang Link: https://lore.kernel.org/r/20220317041806.28230-1-nicoleotsuka@gmail.com Signed-off-by: Mark Brown MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 85f7a8b6e1bea0ad494fb786a5dd7d9715a976d2 Author: Ranjani Sridharan Date: Thu Mar 17 10:50:44 2022 -0700 ASoC: SOF: Add a new dai_get_clk topology IPC op This will help make the code for getting the mclk and bclk IPC specific. Add the implementation for IPC3 as well. Signed-off-by: Ranjani Sridharan Reviewed-by: Rander Wang Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220317175044.1752400-20-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 29 +++++++++++++++++++++++++++++ sound/soc/sof/sof-audio.c | 31 +++++++------------------------ sound/soc/sof/sof-audio.h | 6 ++++++ 3 files changed, 42 insertions(+), 24 deletions(-) commit 31cd6e469364c42c9c929750991c51e83a95e80b Author: Ranjani Sridharan Date: Thu Mar 17 10:50:43 2022 -0700 ASoC: SOF: topology: Add ops for setting up and tearing down pipelines Introduce two new ops, set_up_all_pipelines and tear_down_all_pipelines in struct ipc_tplg_ops and define these for IPC3. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220317175044.1752400-19-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 197 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/sof/pm.c | 17 ++-- sound/soc/sof/sof-audio.c | 186 --------------------------------------- sound/soc/sof/sof-audio.h | 6 +- sound/soc/sof/topology.c | 55 +++++------- 5 files changed, 235 insertions(+), 226 deletions(-) commit 3816bbea644202fd0a8410e54dbc30bd93f3292c Author: Ranjani Sridharan Date: Thu Mar 17 10:50:42 2022 -0700 ASoC: SOF: expose sof_route_setup() This will be used in IPC3-specific code. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-18-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.c | 4 ++-- sound/soc/sof/sof-audio.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) commit b243b437f4c46b09ec26fc02bea610ace4b45aa2 Author: Ranjani Sridharan Date: Thu Mar 17 10:50:41 2022 -0700 ASoC: SOF: Add dai_link_fixup PCM op for IPC3 Define the dai_link_fixup PCM op for IPC3 and use it Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220317175044.1752400-17-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-pcm.c | 186 +++++++++++++++++++++++++++++++++++++++++++++++ sound/soc/sof/pcm.c | 174 +------------------------------------------- 2 files changed, 189 insertions(+), 171 deletions(-) commit beac3f4cb66fa05e902768ae75ea691c4a2c0911 Author: Ranjani Sridharan Date: Thu Mar 17 10:50:40 2022 -0700 ASoC: SOF: Add trigger PCM op for IPC3 Add the trigger PCM op for IPC3 and use it. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-pcm.c | 43 +++++++++++++++++++++++++++++++++++++++++++ sound/soc/sof/pcm.c | 23 ++++++----------------- 2 files changed, 49 insertions(+), 17 deletions(-) commit 621fd48c8cc8d77101a3ac69f7f058d3f8afdbcc Author: Ranjani Sridharan Date: Thu Mar 17 10:50:39 2022 -0700 ASoC: SOF: Define hw_params PCM op for IPC3 Add the hw_params op for IPC3 and use it. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-15-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-pcm.c | 100 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/sof/pcm.c | 110 +++++++---------------------------------------- 2 files changed, 115 insertions(+), 95 deletions(-) commit 4123c24bd13caa8ff633d9e17fa2089d53b1f766 Author: Ranjani Sridharan Date: Thu Mar 17 10:50:38 2022 -0700 ASoC: SOF: Introduce IPC3 PCM hw_free op Add the IPC3 PCM ops, define the hw_free op and modify all users to use the op. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220317175044.1752400-14-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/Makefile | 2 +- sound/soc/sof/ipc.c | 5 +++-- sound/soc/sof/ipc3-ops.h | 1 + sound/soc/sof/ipc3-pcm.c | 43 +++++++++++++++++++++++++++++++++++++++++++ sound/soc/sof/ipc3.c | 1 + sound/soc/sof/pcm.c | 44 +++++++++++++++----------------------------- sound/soc/sof/sof-audio.c | 11 ++++++++--- 7 files changed, 72 insertions(+), 35 deletions(-) commit 442c7128219b1769af5685c5453b13711f6b84e2 Author: Ranjani Sridharan Date: Thu Mar 17 10:50:37 2022 -0700 ASoC: SOF: pcm: expose the sof_pcm_setup_connected_widgets() function It will be used in IPC-specific code. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-13-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/pcm.c | 5 ++--- sound/soc/sof/sof-audio.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) commit 967885ee45e48b669e0904a38f6aeb1a09b0d9a1 Author: Ranjani Sridharan Date: Thu Mar 17 10:50:36 2022 -0700 ASoC: SOF: Introduce IPC-specific PCM ops Introduce the IPC-specific PCM ops that will be used to abstract the PCM related IPC's. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.h | 17 +++++++++++++++++ sound/soc/sof/sof-priv.h | 3 +++ 2 files changed, 20 insertions(+) commit 67ec2a091630c28ea8d05db2bd7178a05b04b7e6 Author: Ranjani Sridharan Date: Thu Mar 17 10:50:35 2022 -0700 ASoC: SOF: Add bytes_ext control IPC ops for IPC3 Define and set the get/put/volatile_get control IPC ops for byte controls for IPC3. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/control.c | 197 ++++--------------------------------------- sound/soc/sof/ipc3-control.c | 171 +++++++++++++++++++++++++++++++++++++ 2 files changed, 188 insertions(+), 180 deletions(-) commit 544ac8858f249950b4d99c68e538cdc07300528f Author: Ranjani Sridharan Date: Thu Mar 17 10:50:34 2022 -0700 ASoC: SOF: Add bytes_get/put control IPC ops for IPC3 Define and set the bytes_get/put IPC control ops for IPC3. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/control.c | 64 +++++++----------------------------------- sound/soc/sof/ipc3-control.c | 67 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 54 deletions(-) commit 049307aad2a355f7b44736eeb5795d6d4499fd12 Author: Ranjani Sridharan Date: Thu Mar 17 10:50:33 2022 -0700 ASoC: SOF: Add enum_get/put control ops for IPC3 Define and set the enum_get/put control IPC ops for IPC3. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/control.c | 39 +++++++++++----------------------- sound/soc/sof/ipc3-control.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 27 deletions(-) commit a6668746436824c46b54b3f7fd72523f05f089eb Author: Ranjani Sridharan Date: Thu Mar 17 10:50:32 2022 -0700 ASoC: SOF: Add switch get/put IPC3 ops Add the switch_get/put control IPC ops for IPC3. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/control.c | 39 +++++++++++----------------------- sound/soc/sof/ipc3-control.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 27 deletions(-) commit 838d04f3e232c3fb8c421959e8ff09e3a918011e Author: Ranjani Sridharan Date: Thu Mar 17 10:50:31 2022 -0700 ASoC: SOF: Add volume_get/put IPC3 ops Define and set the volume_get/put control IPC ops for IPC3. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/control.c | 64 ++++++--------------------- sound/soc/sof/ipc3-control.c | 100 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 50 deletions(-) commit 10f461d79c2d1afb22344986cc1b4631169cf25e Author: Ranjani Sridharan Date: Thu Mar 17 10:50:30 2022 -0700 ASoC: SOF: Add IPC3 topology control ops Define the topology control IPC ops for IPC3, implement the control_notify op and use it. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/Makefile | 2 +- sound/soc/sof/control.c | 144 -------------------------------------- sound/soc/sof/ipc.c | 6 +- sound/soc/sof/ipc3-control.c | 156 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/sof/ipc3-ops.h | 1 + sound/soc/sof/ipc3-topology.c | 1 + sound/soc/sof/sof-audio.h | 6 +- 7 files changed, 166 insertions(+), 150 deletions(-) commit a0149a6bf0b4969a7f732528b2fb6ce32c309dfc Author: Ranjani Sridharan Date: Thu Mar 17 10:50:29 2022 -0700 ASoC: SOF: Introduce IPC ops for kcontrol IO Introduce IPC-specific ops for kcontrol IO in struct ipc_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) commit 657774acd00f3d63ebae06e5d15a74e013cee0ed Author: Ranjani Sridharan Date: Thu Mar 17 10:50:28 2022 -0700 ASoC: SOF: Make sof_suspend/resume IPC agnostic Add a new set of IPC ops for PM with the ctx_save and ctx_restore ops for suspend/resume and implement the ops for IPC3. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/Makefile | 2 +- sound/soc/sof/ipc.c | 1 + sound/soc/sof/ipc3-ops.h | 19 +++++++++++++ sound/soc/sof/ipc3-topology.c | 7 ++--- sound/soc/sof/ipc3.c | 44 ++++++++++++++++++++++++++++++ sound/soc/sof/pm.c | 63 +++++++++++++++++-------------------------- sound/soc/sof/sof-priv.h | 14 ++++++++-- 7 files changed, 104 insertions(+), 46 deletions(-) commit 051744b1bf0b13f63af5de3c296d04ab0cc6117c Author: Ranjani Sridharan Date: Thu Mar 17 10:50:27 2022 -0700 ASoC: SOF: Make sof_widget_setup/free IPC agnostic Add 3 new topology IPC ops for widget_setup, widget_free and dai_config in order to make the pipeline management code IPC agnostic and implement the ops for IPC3. Use the newly introduced tplg dai_config op to configure the DAI during BE DAI hw_params and hw_free. Also, in preparation for IPC4, modify BE hw_params callback to skip setting up the DAI widget. All widgets will be set up during FW hw_params and the DAI_CONFIG IPC should be sent only if the widget use_count is > 0. With setting up/freeing removed from the BE hw_params, remove the configured flag as it is no longer needed. Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220317175044.1752400-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/intel/hda-dai.c | 97 ++++-------------------- sound/soc/sof/intel/hda.c | 169 +++++++++++------------------------------- sound/soc/sof/intel/hda.h | 7 +- sound/soc/sof/ipc3-topology.c | 150 +++++++++++++++++++++++++++++++++++++ sound/soc/sof/sof-audio.c | 136 ++++++--------------------------- sound/soc/sof/sof-audio.h | 13 +++- 6 files changed, 246 insertions(+), 326 deletions(-) commit 40c2c63ac40d26bb0b8e17ada32e84541363f1b0 Author: Ranjani Sridharan Date: Thu Mar 17 10:50:26 2022 -0700 ASoC: SOF: set up scheduler widget before all other widgets in the pipeline For dynamic pipelines, We set up the DAI widget during BE DAI hw_params and this results in it getting set up before the scheduler widget for the pipeline it belongs to is set up. Move the scheduler widget set up into sof_widget_setup() to ensure that the scheduler widget is always the first widget in a pipeline to be set up and the last one to get freed after all the other widgets have been freed. Fixes: 5fcdbb2d45df ('ASoC: SOF: Add support for dynamic pipelines') Signed-off-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317175044.1752400-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.c | 82 +++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 38 deletions(-) commit 8f9e7b65f833cb9a4b2e2f54a049d74df394d906 Author: Yu Kuai Date: Fri Mar 18 21:01:44 2022 +0800 block: cancel all throttled bios in del_gendisk() Throttled bios can't be issued after del_gendisk() is done, thus it's better to cancel them immediately rather than waiting for throttle is done. For example, if user thread is throttled with low bps while it's issuing large io, and the device is deleted. The user thread will wait for a long time for io to return. Signed-off-by: Yu Kuai Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220318130144.1066064-4-ming.lei@redhat.com Signed-off-by: Jens Axboe block/blk-throttle.c | 36 +++++++++++++++++++++++++++++++++++- block/blk-throttle.h | 3 +++ block/genhd.c | 3 +++ 3 files changed, 41 insertions(+), 1 deletion(-) commit 0a9a25ca78437b39e691bcc3dc8240455b803d8d Author: Ming Lei Date: Fri Mar 18 21:01:43 2022 +0800 block: let blkcg_gq grab request queue's refcnt In the whole lifetime of blkcg_gq instance, ->q will be referred, such as, ->pd_free_fn() is called in blkg_free, and throtl_pd_free() still may touch the request queue via &tg->service_queue.pending_timer which is handled by throtl_pending_timer_fn(), so it is reasonable to grab request queue's refcnt by blkcg_gq instance. Previously blkcg_exit_queue() is called from blk_release_queue, and it is hard to avoid the use-after-free. But recently commit 1059699f87eb ("block: move blkcg initialization/destroy into disk allocation/release handler") is merged to for-5.18/block, it becomes simple to fix the issue by simply grabbing request queue's refcnt. Reported-by: Christoph Hellwig Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220318130144.1066064-3-ming.lei@redhat.com Signed-off-by: Jens Axboe block/blk-cgroup.c | 5 +++++ 1 file changed, 5 insertions(+) commit ee37eddbfa9e0401f13a01691cf4bbbacd2d16c9 Author: Ming Lei Date: Fri Mar 18 21:01:42 2022 +0800 block: avoid use-after-free on throttle data In throtl_pending_timer_fn(), request queue is retrieved from throttle data. And tg's pending timer is deleted synchronously when releasing the associated blkg, at that time, throttle data may have been freed since commit 1059699f87eb ("block: move blkcg initialization/destroy into disk allocation/release handler") moves freeing q->td to disk_release() from blk_release_queue(). So use-after-free on q->td in throtl_pending_timer_fn can be triggered. Fixes the issue by: - do nothing in case that disk is released, when there isn't any bio to dispatch - retrieve request queue from blkg instead of throttle data for non top-level pending timer. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220318130144.1066064-2-ming.lei@redhat.com Signed-off-by: Jens Axboe block/blk-throttle.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit e89600ebeeb14d18c0b062837a84196f72542830 Author: Krasnov Arseniy Vladimirovich Date: Thu Mar 17 08:33:23 2022 +0000 af_vsock: SOCK_SEQPACKET broken buffer test Add test where sender sends two message, each with own data pattern. Reader tries to read first to broken buffer: it has three pages size, but middle page is unmapped. Then, reader tries to read second message to valid buffer. Test checks, that uncopied part of first message was dropped and thus not copied as part of second message. Signed-off-by: Krasnov Arseniy Vladimirovich Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller tools/testing/vsock/vsock_test.c | 131 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) commit efb3719f4ab0c4646ce2fe16c610e6a9bb0e1b08 Author: Krasnov Arseniy Vladimirovich Date: Thu Mar 17 08:31:49 2022 +0000 af_vsock: SOCK_SEQPACKET receive timeout test Test for receive timeout check: connection is established, receiver sets timeout, but sender does nothing. Receiver's 'read()' call must return EAGAIN. Signed-off-by: Krasnov Arseniy Vladimirovich Reviewed-by: Stefano Garzarella Signed-off-by: David S. Miller tools/testing/vsock/vsock_test.c | 84 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) commit dca51fe7fbb11909cd80e81714f6de4515123a64 Merge: e913c09dbe3b 54f586a91532 Author: David S. Miller Date: Fri Mar 18 15:11:31 2022 +0000 Merge tag 'wireless-next-2022-03-18' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Kalle Valo says: ==================== wireless-next patches for v5.18 Third set of patches for v5.18. Smaller set this time, support for mt7921u and some work on MBSSID support. Also a workaround for rfkill userspace event. Major changes: mac80211 * MBSSID beacon handling in AP mode rfkill * make new event layout opt-in to workaround buggy user space rtlwifi * support On Networks N150 device id mt76 * mt7915: MBSSID and 6 GHz band support * new driver mt7921u ==================== Signed-off-by: David S. Miller commit 6487d1dab837214ec2fd3f0ddd5f787e63be7c20 Author: Eric W. Biederman Date: Thu Jan 27 12:19:13 2022 -0600 ptrace: Return the signal to continue with from ptrace_stop The signal a task should continue with after a ptrace stop is inconsistently read, cleared, and sent. Solve this by reading and clearing the signal to be sent in ptrace_stop. In an ideal world everything except ptrace_signal would share a common implementation of continuing with the signal, so ptracers could count on the signal they ask to continue with actually being delivered. For now retain bug compatibility and just return with the signal number the ptracer requested the code continue with. Link: https://lkml.kernel.org/r/875yoe7qdp.fsf_-_@email.froward.int.ebiederm.org Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" include/linux/ptrace.h | 12 ++++++------ kernel/signal.c | 32 +++++++++++++++++++------------- 2 files changed, 25 insertions(+), 19 deletions(-) commit 63cc8e20b384d5ea10a4df330d8b9cf2f14eb64c Merge: 60911970b016 deb594004644 Author: Daniel Borkmann Date: Fri Mar 18 15:46:59 2022 +0100 Merge branch 'bpf-fix-sock-field-tests' Jakub Sitnicki says: ==================== I think we have reached a consensus [1] on how the test for the 4-byte load from bpf_sock->dst_port and bpf_sk_lookup->remote_port should look, so here goes v3. I will submit a separate set of patches for bpf_sk_lookup->remote_port tests. This series has been tested on x86_64 and s390 on top of recent bpf-next - ad13baf45691 ("selftests/bpf: Test subprog jit when toggle bpf_jit_harden repeatedly"). [1] https://lore.kernel.org/bpf/87k0cwxkzs.fsf@cloudflare.com/ v2 -> v3: - Split what was previously patch 2 which was doing two things - Use BPF_TCP_* constants (Martin) - Treat the result of 4-byte load from dst_port as a 16-bit value (Martin) - Typo fixup and some rewording in patch 4 description v1 -> v2: - Limit read_sk_dst_port only to client traffic (patch 2) - Make read_sk_dst_port pass on litte- and big-endian (patch 3) v1: https://lore.kernel.org/bpf/20220225184130.483208-1-jakub@cloudflare.com/ v2: https://lore.kernel.org/bpf/20220227202757.519015-1-jakub@cloudflare.com/ ==================== Signed-off-by: Daniel Borkmann commit deb59400464468352b4d7827420e04f1add94726 Author: Jakub Sitnicki Date: Thu Mar 17 12:39:20 2022 +0100 selftests/bpf: Fix test for 4-byte load from dst_port on big-endian The check for 4-byte load from dst_port offset into bpf_sock is failing on big-endian architecture - s390. The bpf access converter rewrites the 4-byte load to a 2-byte load from sock_common at skc_dport offset, as shown below. * s390 / llvm-objdump -S --no-show-raw-insn 00000000000002a0 : 84: r1 = *(u32 *)(r1 + 48) 85: w0 = 1 86: if w1 == 51966 goto +1 87: w0 = 0 00000000000002c0 : 88: exit * s390 / bpftool prog dump xlated _Bool sk_dst_port__load_word(struct bpf_sock * sk): 35: (69) r1 = *(u16 *)(r1 +12) 36: (bc) w1 = w1 37: (b4) w0 = 1 38: (16) if w1 == 0xcafe goto pc+1 39: (b4) w0 = 0 40: (95) exit * x86_64 / llvm-objdump -S --no-show-raw-insn 00000000000002a0 : 84: r1 = *(u32 *)(r1 + 48) 85: w0 = 1 86: if w1 == 65226 goto +1 87: w0 = 0 00000000000002c0 : 88: exit * x86_64 / bpftool prog dump xlated _Bool sk_dst_port__load_word(struct bpf_sock * sk): 33: (69) r1 = *(u16 *)(r1 +12) 34: (b4) w0 = 1 35: (16) if w1 == 0xfeca goto pc+1 36: (b4) w0 = 0 37: (95) exit This leads to surprises if we treat the destination register contents as a 32-bit value, ignoring the fact that in reality it contains a 16-bit value. On little-endian the register contents reflect the bpf_sock struct definition, where the lower 16-bits contain the port number: struct bpf_sock { ... __be16 dst_port; /* offset 48 */ __u16 :16; ... }; However, on big-endian the register contents suggest that field the layout of bpf_sock struct is as so: struct bpf_sock { ... __u16 :16; /* offset 48 */ __be16 dst_port; ... }; Account for this quirky access conversion in the test case exercising the 4-byte load by treating the result as 16-bit wide. Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220317113920.1068535-5-jakub@cloudflare.com tools/testing/selftests/bpf/progs/test_sock_fields.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit e06b5bbcf3f107fb5e148714efe2decfb3b4e0ac Author: Jakub Sitnicki Date: Thu Mar 17 12:39:19 2022 +0100 selftests/bpf: Use constants for socket states in sock_fields test Replace magic numbers in BPF code with constants from bpf.h, so that they don't require an explanation in the comments. Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220317113920.1068535-4-jakub@cloudflare.com tools/testing/selftests/bpf/progs/test_sock_fields.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 2d2202ba858c112b03f84d546e260c61425831a1 Author: Jakub Sitnicki Date: Thu Mar 17 12:39:18 2022 +0100 selftests/bpf: Check dst_port only on the client socket cgroup_skb/egress programs which sock_fields test installs process packets flying in both directions, from the client to the server, and in reverse direction. Recently added dst_port check relies on the fact that destination port (remote peer port) of the socket which sends the packet is known ahead of time. This holds true only for the client socket, which connects to the known server port. Filter out any traffic that is not egressing from the client socket in the BPF program that tests reading the dst_port. Fixes: 8f50f16ff39d ("selftests/bpf: Extend verifier and bpf_sock tests for dst_port loads") Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220317113920.1068535-3-jakub@cloudflare.com tools/testing/selftests/bpf/progs/test_sock_fields.c | 4 ++++ 1 file changed, 4 insertions(+) commit a4c9fe0ed4a13e25e43fcd44d9f89bc19ba8fbb7 Author: Jakub Sitnicki Date: Thu Mar 17 12:39:17 2022 +0100 selftests/bpf: Fix error reporting from sock_fields programs The helper macro that records an error in BPF programs that exercise sock fields access has been inadvertently broken by adaptation work that happened in commit b18c1f0aa477 ("bpf: selftest: Adapt sock_fields test to use skel and global variables"). BPF_NOEXIST flag cannot be used to update BPF_MAP_TYPE_ARRAY. The operation always fails with -EEXIST, which in turn means the error never gets recorded, and the checks for errors always pass. Revert the change in update flags. Fixes: b18c1f0aa477 ("bpf: selftest: Adapt sock_fields test to use skel and global variables") Signed-off-by: Jakub Sitnicki Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220317113920.1068535-2-jakub@cloudflare.com tools/testing/selftests/bpf/progs/test_sock_fields.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 336d4b814bf078fa698488632c19beca47308896 Author: Eric W. Biederman Date: Thu Jan 27 12:15:32 2022 -0600 ptrace: Move setting/clearing ptrace_message into ptrace_stop Today ptrace_message is easy to overlook as it not a core part of ptrace_stop. It has been overlooked so much that there are places that set ptrace_message and don't clear it, and places that never set it. So if you get an unlucky sequence of events the ptracer may be able to read a ptrace_message that does not apply to the current ptrace stop. Move setting of ptrace_message into ptrace_stop so that it always gets set before the stop, and always gets cleared after the stop. This prevents non-sense from being reported to userspace and makes ptrace_message more visible in the ptrace helper functions so that kernel developers can see it. Link: https://lkml.kernel.org/r/87bky67qfv.fsf_-_@email.froward.int.ebiederm.org Acked-by: Oleg Nesterov Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" include/linux/ptrace.h | 9 +++------ include/uapi/linux/ptrace.h | 2 +- kernel/signal.c | 21 ++++++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) commit 5edc3c618bb877b3a071b7ea93450bef42f53850 Author: Ian Rogers Date: Thu Mar 17 11:28:58 2022 -0700 perf vendor events intel: Update events for TremontX Move from v1.17 to v1.19. The change: https://github.com/intel/event-converter-for-linux-perf/commit/fc680410402e394eed6a1ebd909c9f649d3ed3ef moved certain "other" type of events in to the cache, memory and pipeline topics. Update the perf JSON files for this change. Reviewed-by: Xing Zhengjun Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220317182858.484474-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/pmu-events/arch/x86/tremontx/cache.json | 839 +++++++++++- .../arch/x86/tremontx/floating-point.json | 12 + .../perf/pmu-events/arch/x86/tremontx/memory.json | 59 +- tools/perf/pmu-events/arch/x86/tremontx/other.json | 1362 ++------------------ .../pmu-events/arch/x86/tremontx/pipeline.json | 320 +++++ .../pmu-events/arch/x86/tremontx/uncore-other.json | 1 + .../arch/x86/tremontx/virtual-memory.json | 11 + 7 files changed, 1329 insertions(+), 1275 deletions(-) commit 42e80e1ac3291604abdd196b4c37b48c8413edba Author: Ian Rogers Date: Thu Mar 17 11:28:57 2022 -0700 perf vendor events intel: Update events for Tigerlake The change: https://github.com/intel/event-converter-for-linux-perf/commit/fc680410402e394eed6a1ebd909c9f649d3ed3ef moved certain "other" type of events in to the cache and pipeline topics. Update the perf JSON files for this change. Reviewed-by: Xing Zhengjun Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220317182858.484474-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo .../perf/pmu-events/arch/x86/tigerlake/cache.json | 86 ++++++++++++++ .../perf/pmu-events/arch/x86/tigerlake/other.json | 129 --------------------- .../pmu-events/arch/x86/tigerlake/pipeline.json | 43 +++++++ 3 files changed, 129 insertions(+), 129 deletions(-) commit 299d5dca772e3a4c5f7aa0167b85e2a9760456ae Author: Ian Rogers Date: Thu Mar 17 11:28:56 2022 -0700 perf vendor events intel: Update events for SkylakeX The change: https://github.com/intel/event-converter-for-linux-perf/commit/fc680410402e394eed6a1ebd909c9f649d3ed3ef moved certain "other" type of events in to the cache topic. Update the perf JSON files for this change. Reviewed-by: Xing Zhengjun Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220317182858.484474-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/pmu-events/arch/x86/skylakex/cache.json | 36 ++++++++++++++++++++++ tools/perf/pmu-events/arch/x86/skylakex/other.json | 36 ---------------------- 2 files changed, 36 insertions(+), 36 deletions(-) commit fd14311829f38f1360dfec99cdfd2f4ff89baa9e Author: Ian Rogers Date: Thu Mar 17 11:28:55 2022 -0700 perf vendor events intel: Update events for Skylake The change: https://github.com/intel/event-converter-for-linux-perf/commit/fc680410402e394eed6a1ebd909c9f649d3ed3ef moved certain "other" type of events in to the cache topic. Update the perf JSON files for this change. Reviewed-by: Xing Zhengjun Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220317182858.484474-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/pmu-events/arch/x86/skylake/cache.json | 36 +++++++++++++++++++++++ tools/perf/pmu-events/arch/x86/skylake/other.json | 36 ----------------------- 2 files changed, 36 insertions(+), 36 deletions(-) commit f25db21bbf9a47042665f7742d6054b5a27c0c2a Author: Ian Rogers Date: Thu Mar 17 11:28:54 2022 -0700 perf vendor events intel: Update events for IcelakeX Move from v1.11 to v1.12. The change: https://github.com/intel/event-converter-for-linux-perf/commit/fc680410402e394eed6a1ebd909c9f649d3ed3ef moved certain "other" type of events in to the cache, memory and pipeline topics. Update the perf JSON files for this change. Tested: ``` ... 6: Parse event definition strings : Ok ... 91: perf all PMU test : Ok ... ``` Reviewed-by: Xing Zhengjun Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220317182858.484474-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/pmu-events/arch/x86/icelakex/cache.json | 252 ++++++++++++++++++ .../perf/pmu-events/arch/x86/icelakex/memory.json | 26 +- tools/perf/pmu-events/arch/x86/icelakex/other.json | 287 ++------------------- .../pmu-events/arch/x86/icelakex/pipeline.json | 35 +++ 4 files changed, 324 insertions(+), 276 deletions(-) commit fb76811a8f6e037d6a989b1e97b2c99796a25b1c Author: Ian Rogers Date: Thu Mar 17 11:28:53 2022 -0700 perf vendor events intel: Update events for Icelake The change: https://github.com/intel/event-converter-for-linux-perf/commit/fc680410402e394eed6a1ebd909c9f649d3ed3ef moved certain "other" type of events in to the cache and pipeline topic. Update the perf JSON files for this change. Reviewed-by: Xing Zhengjun Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220317182858.484474-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/pmu-events/arch/x86/icelake/cache.json | 633 +++++++++++++++++ tools/perf/pmu-events/arch/x86/icelake/other.json | 752 +-------------------- .../perf/pmu-events/arch/x86/icelake/pipeline.json | 47 ++ 3 files changed, 716 insertions(+), 716 deletions(-) commit 3e75e95e80eee167e11b19b7bbf8ad7e4dab5048 Author: Ian Rogers Date: Thu Mar 17 11:28:52 2022 -0700 perf vendor events intel: Update events for Elkhartlake The change: https://github.com/intel/event-converter-for-linux-perf/commit/fc680410402e394eed6a1ebd909c9f649d3ed3ef moved certain "other" type of events in to the pipeline topic. Update the perf JSON files for this change. Reviewed-by: Xing Zhengjun Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20220317182858.484474-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo .../pmu-events/arch/x86/elkhartlake/other.json | 241 --------------------- .../pmu-events/arch/x86/elkhartlake/pipeline.json | 241 +++++++++++++++++++++ 2 files changed, 241 insertions(+), 241 deletions(-) commit 2c4d33b87c619a0227bcd6327c9c27741a4a6646 Author: Ian Rogers Date: Thu Mar 17 11:28:51 2022 -0700 perf vendor events intel: Update events for CascadelakeX The change: https://github.com/intel/event-converter-for-linux-perf/commit/fc680410402e394eed6a1ebd909c9f649d3ed3ef moved certain "other" type of events in to the cache topic. Update the perf JSON files for this change. Tested: ``` ... 6: Parse event definition strings : Ok 7: Simple expression parser : Ok 8: PERF_RECORD_* events & perf_sample fields : Ok 9: Parse perf pmu format : Ok 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 ... 68: Parse and process metrics : Ok ... 89: perf all metricgroups test : Ok 90: perf all metrics test : FAILED! 91: perf all PMU test : Ok ... ``` Test 90 failed due to MEM_PMM_Read_Latency as the test machine lacks optane memory, and the divide by 0 causes the metric not to print - which is intended behavior. Reviewed-by: Xing Zhengjun Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Xing Zhengjun Link: http://lore.kernel.org/lkml/20220317182858.484474-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo .../pmu-events/arch/x86/cascadelakex/cache.json | 6588 +++++++++++++++++ .../pmu-events/arch/x86/cascadelakex/other.json | 7446 ++------------------ 2 files changed, 7017 insertions(+), 7017 deletions(-) commit 21ea457842759a236eefed2cfaa8cc7e5dc967a0 Author: Julia Lawall Date: Fri Mar 18 11:37:19 2022 +0100 KVM: arm64: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220318103729.157574-24-Julia.Lawall@inria.fr arch/arm64/kvm/arm.c | 2 +- arch/arm64/kvm/guest.c | 2 +- arch/arm64/kvm/handle_exit.c | 2 +- arch/arm64/kvm/hyp/nvhe/page_alloc.c | 4 ++-- arch/arm64/kvm/mmu.c | 2 +- arch/arm64/kvm/vgic/vgic.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) commit 06394531b425794dc56f3d525b7994d25b8072f7 Author: Marc Zyngier Date: Fri Mar 11 17:39:47 2022 +0000 KVM: arm64: Generalise VM features into a set of flags We currently deal with a set of booleans for VM features, while they could be better represented as set of flags contained in an unsigned long, similarily to what we are doing on the CPU side. Signed-off-by: Marc Zyngier [Oliver: Flag-ify the 'ran_once' boolean] Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220311174001.605719-2-oupton@google.com arch/arm64/include/asm/kvm_host.h | 15 +++++++++------ arch/arm64/kvm/arm.c | 7 ++++--- arch/arm64/kvm/mmio.c | 3 ++- arch/arm64/kvm/pmu-emul.c | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) commit 6a861abceecb68497dd82a324fee45a5332dcece Author: Randy Dunlap Date: Thu Mar 17 08:39:39 2022 -0700 clocksource: acpi_pm: fix return value of __setup handler __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) environment strings. The __setup() handler interface isn't meant to handle negative return values -- they are non-zero, so they mean "handled" (like a return value of 1 does), but that's just a quirk. So return 1 from parse_pmtmr(). Also print a warning message if kstrtouint() returns an error. Fixes: 6b148507d3d0 ("pmtmr: allow command line override of ioport") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Signed-off-by: Rafael J. Wysocki drivers/clocksource/acpi_pm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit b31c41339f4f8a833cb9dc509f87aab6a159ffe4 Author: Xiaomeng Tong Date: Mon Mar 14 20:29:21 2022 +0800 vt_ioctl: fix potential spectre v1 in VT_DISALLOCATE In VT_ACTIVATE an almost identical code path has been patched with array_index_nospec. In the VT_DISALLOCATE path, the arg is the user input from a system call argument and lately used as a index for vc_cons[index].d access, which can be reached through path like vt_disallocate->vc_busy or vt_disallocate->vc_deallocate. For consistency both code paths should have the same mitigations applied. Also, the code style is adjusted as suggested by Jiri. Reviewed-by: Jiri Slaby Signed-off-by: Xiaomeng Tong Link: https://lore.kernel.org/r/20220314122921.31223-1-xiam0nd.tong@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/tty/vt/vt_ioctl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 88d99e870143199ba5bf42701dca06ce1d1388f0 Author: Bagas Sanjaya Date: Mon Mar 14 18:33:27 2022 +0700 Documentation: update stable review cycle documentation In recent times, the review cycle for stable releases have been changed. In particular, there is release candidate phase between ACKing patches and new stable release. Also, in case of failed submissions (fail to apply to stable tree), manual backport (Option 3) have to be submitted instead. Update the release cycle documentation on stable-kernel-rules.rst to reflect the above. Cc: Sasha Levin Cc: Jonathan Corbet Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220314113329.485372-4-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman Documentation/process/stable-kernel-rules.rst | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) commit 901581389eade09af969c1a4183e17ec663131d0 Author: lizhe Date: Wed Mar 9 05:54:18 2022 -0800 drivers/base/dd.c : Remove the initial value of the global variable The global variable driver_deferred_probe_enable has a default value of false and does not need to be initialized to false. Signed-off-by: lizhe Link: https://lore.kernel.org/r/20220309135418.31101-1-sensor1010@163.com Signed-off-by: Greg Kroah-Hartman drivers/base/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9905eed48e82dfe265e2b9e57f19f8e0d1b7d0d7 Merge: 4219196d1f66 d9a232d435dc Author: David S. Miller Date: Fri Mar 18 13:30:53 2022 +0000 Merge branch 'af_unix-OOB-fixes' Kuniyuki Iwashima says: ==================== af_unix: Fix some OOB implementation. This series fixes some data-races and adds a missing feature around the commit 314001f0bf92 ("af_unix: Add OOB support"). Changelog: - v3: - Add the first patch - v2: https://lore.kernel.org/netdev/20220315054801.72035-1-kuniyu@amazon.co.jp/ - Add READ_ONCE() to avoid a race reported by KCSAN (Eric) - Add IS_ENABLED(CONFIG_AF_UNIX_OOB) (Shoaib) - v1: https://lore.kernel.org/netdev/20220314052110.53634-1-kuniyu@amazon.co.jp/ ==================== Signed-off-by: David S. Miller commit d9a232d435dcc966738b0f414a86f7edf4f4c8c4 Author: Kuniyuki Iwashima Date: Thu Mar 17 12:08:09 2022 +0900 af_unix: Support POLLPRI for OOB. The commit 314001f0bf92 ("af_unix: Add OOB support") introduced OOB for AF_UNIX, but it lacks some changes for POLLPRI. Let's add the missing piece. In the selftest, normal datagrams are sent followed by OOB data, so this commit replaces `POLLIN | POLLPRI` with just `POLLPRI` in the first test case. Fixes: 314001f0bf92 ("af_unix: Add OOB support") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller net/unix/af_unix.c | 4 ++++ tools/testing/selftests/net/af_unix/test_unix_oob.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) commit e82025c623e2bf04d162bafceb66a59115814479 Author: Kuniyuki Iwashima Date: Thu Mar 17 12:08:08 2022 +0900 af_unix: Fix some data-races around unix_sk(sk)->oob_skb. Out-of-band data automatically places a "mark" showing wherein the sequence the out-of-band data would have been. If the out-of-band data implies cancelling everything sent so far, the "mark" is helpful to flush them. When the socket's read pointer reaches the "mark", the ioctl() below sets a non zero value to the arg `atmark`: The out-of-band data is queued in sk->sk_receive_queue as well as ordinary data and also saved in unix_sk(sk)->oob_skb. It can be used to test if the head of the receive queue is the out-of-band data meaning the socket is at the "mark". While testing that, unix_ioctl() reads unix_sk(sk)->oob_skb locklessly. Thus, all accesses to oob_skb need some basic protection to avoid load/store tearing which KCSAN detects when these are called concurrently: - ioctl(fd_a, SIOCATMARK, &atmark, sizeof(atmark)) - send(fd_b_connected_to_a, buf, sizeof(buf), MSG_OOB) BUG: KCSAN: data-race in unix_ioctl / unix_stream_sendmsg write to 0xffff888003d9cff0 of 8 bytes by task 175 on cpu 1: unix_stream_sendmsg (net/unix/af_unix.c:2087 net/unix/af_unix.c:2191) sock_sendmsg (net/socket.c:705 net/socket.c:725) __sys_sendto (net/socket.c:2040) __x64_sys_sendto (net/socket.c:2048) 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:113) read to 0xffff888003d9cff0 of 8 bytes by task 176 on cpu 0: unix_ioctl (net/unix/af_unix.c:3101 (discriminator 1)) sock_do_ioctl (net/socket.c:1128) sock_ioctl (net/socket.c:1242) __x64_sys_ioctl (fs/ioctl.c:52 fs/ioctl.c:874 fs/ioctl.c:860 fs/ioctl.c:860) 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:113) value changed: 0xffff888003da0c00 -> 0xffff888003da0d00 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 176 Comm: unix_race_oob_i Not tainted 5.17.0-rc5-59529-g83dc4c2af682 #12 Hardware name: Red Hat KVM, BIOS 1.11.0-2.amzn2 04/01/2014 Fixes: 314001f0bf92 ("af_unix: Add OOB support") Signed-off-by: Kuniyuki Iwashima Signed-off-by: David S. Miller net/unix/af_unix.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) commit 555d44932c67e617d89bc13c81c7efac5b51fcfa Author: Bagas Sanjaya Date: Mon Mar 14 18:33:29 2022 +0700 Documentation: update stable tree link The link to stable tree is redirected to https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git. Update accordingly. Cc: Greg Kroah-Hartman Cc: Sasha Levin Cc: Jonathan Corbet Cc: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220314113329.485372-6-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman Documentation/process/stable-kernel-rules.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 587d39b260c4d090166314d64be70b1f6a26b0b5 Author: Bagas Sanjaya Date: Mon Mar 14 18:33:28 2022 +0700 Documentation: add link to stable release candidate tree There is also stable release candidate tree. Mention it, however with a warning that the tree is for testing purposes. Cc: Greg Kroah-Hartman Cc: Sasha Levin Cc: Jonathan Corbet Cc: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220314113329.485372-5-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman Documentation/process/stable-kernel-rules.rst | 9 +++++++++ 1 file changed, 9 insertions(+) commit 451fd6ee1adb7ca28277023e450708cb9061edb2 Author: Julia Lawall Date: Mon Mar 14 12:53:42 2022 +0100 devres: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220314115354.144023-19-Julia.Lawall@inria.fr Signed-off-by: Greg Kroah-Hartman drivers/base/devres.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 615f3eea0d5f70524d071528e8c1aeaa6ccb73e3 Author: Bagas Sanjaya Date: Mon Mar 14 18:33:25 2022 +0700 Documentation: add note block surrounding security patch note Security patches have different handling than rest of patches for review. Enclose note paragraph about such patches in `.. note::` block. Cc: Sasha Levin Cc: Jonathan Corbet Cc: linux-kernel@vger.kernel.org Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220314113329.485372-2-bagasdotme@gmail.com Signed-off-by: Greg Kroah-Hartman Documentation/process/stable-kernel-rules.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 5a242d8547bdc5802d1e1200a85e69afc3c2d74e Author: Nguyen Dinh Phi Date: Fri Mar 4 02:36:18 2022 +0800 samples/kobject: Use sysfs_emit instead of sprintf sysfs_emit() is preferred over sprintf() when formatting the value to be returned to user space in show() functions, because it knows about sysfs buffer specifics and has sanity checks. Signed-off-by: Nguyen Dinh Phi Link: https://lore.kernel.org/r/20220303183618.1342358-1-phind.uet@gmail.com Signed-off-by: Greg Kroah-Hartman samples/kobject/kobject-example.c | 4 ++-- samples/kobject/kset-example.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) commit b0f6807d35667faae6de5e23ceffa4546c209bc8 Author: Geert Uytterhoeven Date: Tue Mar 1 12:10:35 2022 +0100 base: soc: Make soc_device_match() simpler and easier to read The function soc_device_match() is difficult to read for various reasons: - There are two loop conditions using different styles: "while (...)" (which is BTW always true) vs. "if ... break", - The are two return condition using different logic: "if ... return foo" vs. "if ... else return bar". Make the code easier to read by: 1. Removing the always-true "!ret" loop condition, and dropping the now unneeded pre-initialization of "ret", 2. Converting "if ... break" to a proper "while (...)" loop condition, 3. Inverting the logic of the second return condition. Reviewed-by: Arnd Bergmann Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/9f9107c06f7d065ae6581e5290ef5d72f7298fd1.1646132835.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman drivers/base/soc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) commit f2aad54703dbe630f9d8b235eb58e8c8cc78f37d Author: Randy Dunlap Date: Mon Feb 28 20:18:29 2022 -0800 driver core: dd: fix return value of __setup handler When "driver_async_probe=nulltty" is used on the kernel boot command line, it causes an Unknown parameter message and the string is added to init's environment strings, polluting them. Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc6 driver_async_probe=nulltty", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc6 driver_async_probe=nulltty Change the return value of the __setup function to 1 to indicate that the __setup option has been handled. Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Fixes: 1ea61b68d0f8 ("async: Add cmdline option to specify drivers to be async probed") Cc: Feng Tang Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Reported-by: Igor Zhbanov Reviewed-by: Feng Tang Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20220301041829.15137-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman drivers/base/dd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4b775aaf1ea9997f5eb1a792f357a7b81a1fc632 Author: Rob Herring Date: Wed Feb 23 16:52:57 2022 -0600 driver core: Refactor sysfs and drv/bus remove hooks There are 3 copies of the same device sysfs cleanup and drv/bus remove() hooks used for probe failure, testing re-probing, and device unbinding. Let's refactor the code to its own function. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220223225257.1681968-3-robh@kernel.org Signed-off-by: Greg Kroah-Hartman drivers/base/dd.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) commit 9ad307213fa4081f4bc2f2daa31d4f2d35d7a213 Author: Rob Herring Date: Wed Feb 23 16:52:56 2022 -0600 driver core: Refactor multiple copies of device cleanup There are 3 copies of the same device cleanup code used for probe failure, testing re-probing, and device unbinding. Changes to this code often miss at least one of the copies of the code. See commits d0243bbd5dd3 ("drivers core: Free dma_range_map when driver probe failed") and d8f7a5484f21 ("driver core: Free DMA range map when device is released") for example. Let's refactor the code to its own function. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220223225257.1681968-2-robh@kernel.org Signed-off-by: Greg Kroah-Hartman drivers/base/dd.c | 46 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) commit 5bff9632b538d63f61f1c4bba891a8f09f254369 Author: Michal Simek Date: Fri Feb 25 12:40:08 2022 +0100 scripts: get_abi.pl: Fix typo in help message Fix misspelled word in the script. (s/COMAND/COMMAND/). Reviewed-by: Mauro Carvalho Chehab Signed-off-by: Michal Simek Link: https://lore.kernel.org/r/1ff3605db3dead41bbde33fbbff6754900eceead.1645789205.git.michal.simek@xilinx.com Signed-off-by: Greg Kroah-Hartman scripts/get_abi.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4219196d1f662cb10a462eb9e076633a3fc31a15 Author: Sukadev Bhattiprolu Date: Wed Mar 16 18:12:31 2022 -0700 ibmvnic: fix race between xmit and reset There is a race between reset and the transmit paths that can lead to ibmvnic_xmit() accessing an scrq after it has been freed in the reset path. It can result in a crash like: Kernel attempted to read user page (0) - exploit attempt? (uid: 0) BUG: Kernel NULL pointer dereference on read at 0x00000000 Faulting instruction address: 0xc0080000016189f8 Oops: Kernel access of bad area, sig: 11 [#1] ... NIP [c0080000016189f8] ibmvnic_xmit+0x60/0xb60 [ibmvnic] LR [c000000000c0046c] dev_hard_start_xmit+0x11c/0x280 Call Trace: [c008000001618f08] ibmvnic_xmit+0x570/0xb60 [ibmvnic] (unreliable) [c000000000c0046c] dev_hard_start_xmit+0x11c/0x280 [c000000000c9cfcc] sch_direct_xmit+0xec/0x330 [c000000000bfe640] __dev_xmit_skb+0x3a0/0x9d0 [c000000000c00ad4] __dev_queue_xmit+0x394/0x730 [c008000002db813c] __bond_start_xmit+0x254/0x450 [bonding] [c008000002db8378] bond_start_xmit+0x40/0xc0 [bonding] [c000000000c0046c] dev_hard_start_xmit+0x11c/0x280 [c000000000c00ca4] __dev_queue_xmit+0x564/0x730 [c000000000cf97e0] neigh_hh_output+0xd0/0x180 [c000000000cfa69c] ip_finish_output2+0x31c/0x5c0 [c000000000cfd244] __ip_queue_xmit+0x194/0x4f0 [c000000000d2a3c4] __tcp_transmit_skb+0x434/0x9b0 [c000000000d2d1e0] __tcp_retransmit_skb+0x1d0/0x6a0 [c000000000d2d984] tcp_retransmit_skb+0x34/0x130 [c000000000d310e8] tcp_retransmit_timer+0x388/0x6d0 [c000000000d315ec] tcp_write_timer_handler+0x1bc/0x330 [c000000000d317bc] tcp_write_timer+0x5c/0x200 [c000000000243270] call_timer_fn+0x50/0x1c0 [c000000000243704] __run_timers.part.0+0x324/0x460 [c000000000243894] run_timer_softirq+0x54/0xa0 [c000000000ea713c] __do_softirq+0x15c/0x3e0 [c000000000166258] __irq_exit_rcu+0x158/0x190 [c000000000166420] irq_exit+0x20/0x40 [c00000000002853c] timer_interrupt+0x14c/0x2b0 [c000000000009a00] decrementer_common_virt+0x210/0x220 --- interrupt: 900 at plpar_hcall_norets_notrace+0x18/0x2c The immediate cause of the crash is the access of tx_scrq in the following snippet during a reset, where the tx_scrq can be either NULL or an address that will soon be invalid: ibmvnic_xmit() { ... tx_scrq = adapter->tx_scrq[queue_num]; txq = netdev_get_tx_queue(netdev, queue_num); ind_bufp = &tx_scrq->ind_buf; if (test_bit(0, &adapter->resetting)) { ... } But beyond that, the call to ibmvnic_xmit() itself is not safe during a reset and the reset path attempts to avoid this by stopping the queue in ibmvnic_cleanup(). However just after the queue was stopped, an in-flight ibmvnic_complete_tx() could have restarted the queue even as the reset is progressing. Since the queue was restarted we could get a call to ibmvnic_xmit() which can then access the bad tx_scrq (or other fields). We cannot however simply have ibmvnic_complete_tx() check the ->resetting bit and skip starting the queue. This can race at the "back-end" of a good reset which just restarted the queue but has not cleared the ->resetting bit yet. If we skip restarting the queue due to ->resetting being true, the queue would remain stopped indefinitely potentially leading to transmit timeouts. IOW ->resetting is too broad for this purpose. Instead use a new flag that indicates whether or not the queues are active. Only the open/ reset paths control when the queues are active. ibmvnic_complete_tx() and others wake up the queue only if the queue is marked active. So we will have: A. reset/open thread in ibmvnic_cleanup() and __ibmvnic_open() ->resetting = true ->tx_queues_active = false disable tx queues ... ->tx_queues_active = true start tx queues B. Tx interrupt in ibmvnic_complete_tx(): if (->tx_queues_active) netif_wake_subqueue(); To ensure that ->tx_queues_active and state of the queues are consistent, we need a lock which: - must also be taken in the interrupt path (ibmvnic_complete_tx()) - shared across the multiple queues in the adapter (so they don't become serialized) Use rcu_read_lock() and have the reset thread synchronize_rcu() after updating the ->tx_queues_active state. While here, consolidate a few boolean fields in ibmvnic_adapter for better alignment. Based on discussions with Brian King and Dany Madden. Fixes: 7ed5b31f4a66 ("net/ibmvnic: prevent more than one thread from running in reset") Reported-by: Vaishnavi Bhat Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller drivers/net/ethernet/ibm/ibmvnic.c | 63 ++++++++++++++++++++++++++++++-------- drivers/net/ethernet/ibm/ibmvnic.h | 7 +++-- 2 files changed, 55 insertions(+), 15 deletions(-) commit 37fd83916da2e4cae03d350015c82a67b1b334c4 Author: David Gow Date: Fri Feb 25 12:15:02 2022 +0800 firmware: google: Properly state IOMEM dependency The Google Coreboot implementation requires IOMEM functions (memmremap, memunmap, devm_memremap), but does not specify this is its Kconfig. This results in build errors when HAS_IOMEM is not set, such as on some UML configurations: /usr/bin/ld: drivers/firmware/google/coreboot_table.o: in function `coreboot_table_probe': coreboot_table.c:(.text+0x311): undefined reference to `memremap' /usr/bin/ld: coreboot_table.c:(.text+0x34e): undefined reference to `memunmap' /usr/bin/ld: drivers/firmware/google/memconsole-coreboot.o: in function `memconsole_probe': memconsole-coreboot.c:(.text+0x12d): undefined reference to `memremap' /usr/bin/ld: memconsole-coreboot.c:(.text+0x17e): undefined reference to `devm_memremap' /usr/bin/ld: memconsole-coreboot.c:(.text+0x191): undefined reference to `memunmap' /usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_section_destroy.isra.0': vpd.c:(.text+0x300): undefined reference to `memunmap' /usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_section_init': vpd.c:(.text+0x382): undefined reference to `memremap' /usr/bin/ld: vpd.c:(.text+0x459): undefined reference to `memunmap' /usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_probe': vpd.c:(.text+0x59d): undefined reference to `memremap' /usr/bin/ld: vpd.c:(.text+0x5d3): undefined reference to `memunmap' collect2: error: ld returned 1 exit status Fixes: a28aad66da8b ("firmware: coreboot: Collapse platform drivers into bus core") Acked-By: anton ivanov Acked-By: Julius Werner Signed-off-by: David Gow Link: https://lore.kernel.org/r/20220225041502.1901806-1-davidgow@google.com Signed-off-by: Greg Kroah-Hartman drivers/firmware/google/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 96c9e802c64014a7716865332d732cc9c7f24593 Author: Randy Dunlap Date: Mon Mar 7 19:32:55 2022 -0800 kgdbts: fix return value of __setup handler __setup() handlers should return 1 to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) environment strings. So return 1 from kgdbts_option_setup(). Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc7 kgdboc=kbd kgdbts=", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc7 kgdboc=kbd kgdbts= Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Fixes: e8d31c204e36 ("kgdb: add kgdb internal test suite") Cc: kgdb-bugreport@lists.sourceforge.net Cc: Jason Wessel Cc: Daniel Thompson Cc: Douglas Anderson Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Reported-by: Igor Zhbanov Reviewed-by: Douglas Anderson Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20220308033255.22118-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman drivers/misc/kgdbts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 202c08914ba50dd324e42d5ad99535a89f242560 Author: Johan Hovold Date: Thu Mar 3 19:05:19 2022 +0100 firmware: sysfb: fix platform-device leak in error path Make sure to free the platform device also in the unlikely event that registration fails. Fixes: 0589e8889dce ("drivers/firmware: Add missing platform_device_put() in sysfb_create_simplefb") Fixes: 8633ef82f101 ("drivers/firmware: consolidate EFI framebuffer setup for all arches") Cc: stable@vger.kernel.org # 5.14 Cc: Miaoqian Lin Cc: Javier Martinez Canillas Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20220303180519.3117-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman drivers/firmware/sysfb_simplefb.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) commit b850b7a8b369322adf699ef48ceff4d902525c8c Author: Ang Tien Sung Date: Wed Feb 23 08:41:46 2022 -0600 firmware: stratix10-svc: add missing callback parameter on RSU Fix a bug whereby, the return response of parameter a1 from an SMC call is not properly set to the callback data during an INTEL_SIP_SMC_RSU_ERROR command. Link: https://lore.kernel.org/lkml/20220216081513.28319-1-tien.sung.ang@intel.com Fixes: 6b50d882d38d ("firmware: add remote status update client support") Cc: stable@vger.kernel.org Signed-off-by: Ang Tien Sung Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20220223144146.399263-1-dinguyen@kernel.org Signed-off-by: Greg Kroah-Hartman drivers/firmware/stratix10-svc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8c8ce95b6f1bc34320ac7549b6040a19655dd7e6 Author: Jeya R Date: Mon Feb 14 16:10:02 2022 +0000 arm64: dts: qcom: add non-secure domain property to fastrpc nodes FastRPC DSP domain would be set as secure if non-secure dsp property is not added to the fastrpc DT node. Add this property to DT files of msm8916, sdm845, sm8150, sm8250 and sm8350 so that nothing is broken after secure domain patchset. This patch is purely for backward compatibility reasons. Signed-off-by: Jeya R Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-13-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman arch/arm64/boot/dts/qcom/msm8916.dtsi | 1 + arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 ++ arch/arm64/boot/dts/qcom/sm8150.dtsi | 3 +++ arch/arm64/boot/dts/qcom/sm8250.dtsi | 3 +++ arch/arm64/boot/dts/qcom/sm8350.dtsi | 3 +++ 5 files changed, 12 insertions(+) commit 35a82b87135def531f4ff3c07ba8171fe1794c9d Author: Vamsi Krishna Gattupalli Date: Mon Feb 14 16:10:01 2022 +0000 misc: fastrpc: Add dma handle implementation The remote arguments carry both remote buffers and dma handles. Add proper dma handle instructions to make it compatible with DSP implementation. Signed-off-by: Vamsi Krishna Gattupalli Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-12-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/misc/fastrpc.c | 52 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 19 deletions(-) commit 8f6c1d8c4f0cc316b0456788fff8373554d1d99d Author: Vamsi Krishna Gattupalli Date: Mon Feb 14 16:10:00 2022 +0000 misc: fastrpc: Add fdlist implementation Add fdlist implementation to support dma handles. fdlist is populated by DSP if any map is no longer used and it is freed during put_args. Signed-off-by: Vamsi Krishna Gattupalli Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-11-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/misc/fastrpc.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) commit 54f7c85be3d321b4309bf93ed34f3093d24a5518 Author: Vamsi Krishna Gattupalli Date: Mon Feb 14 16:09:59 2022 +0000 misc: fastrpc: Add helper function to get list and page Add helper functions to get invoke buffer and page start pointers. Signed-off-by: Vamsi Krishna Gattupalli Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-10-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/misc/fastrpc.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit e90d911906196bf987492c94e38f10ca611dfd7b Author: Vamsi Krishna Gattupalli Date: Mon Feb 14 16:09:58 2022 +0000 misc: fastrpc: Add support to secure memory map This patch adds support to secure memory allocations for DSP. It repurposes the reserved field in struct fastrpc_invoke_args to add attributes to invoke request, for example to setup a secure memory map for dsp. Secure memory is assigned to DSP Virtual Machine IDs using Qualcomm SCM calls. Signed-off-by: Vamsi Krishna Gattupalli Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-9-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/misc/Kconfig | 1 + drivers/misc/fastrpc.c | 65 ++++++++++++++++++++++++++++++++++++++------- include/uapi/misc/fastrpc.h | 5 +++- 3 files changed, 61 insertions(+), 10 deletions(-) commit 87ccc14ee640ee32c43796d3db4f46b12353debc Author: Vamsi Krishna Gattupalli Date: Mon Feb 14 16:09:57 2022 +0000 dt-bindings: misc: add fastrpc domain vmid property Add fastrpc domain virtual machine IDs property. This property is used to setup memory protection for remote processor. Acked-by: Rob Herring Signed-off-by: Vamsi Krishna Gattupalli Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-8-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Documentation/devicetree/bindings/misc/qcom,fastrpc.txt | 5 +++++ 1 file changed, 5 insertions(+) commit 7f1f481263c3ce5387d4fd5ad63ddaa8a295aab2 Author: Jeya R Date: Mon Feb 14 16:09:56 2022 +0000 misc: fastrpc: check before loading process to the DSP Reject session if DSP domain is secure, device node is non-secure and signed PD is requested. Secure device node can access DSP without any restriction. Unsigned PD offload is only allowed for the DSP domain that can support unsigned offloading. Signed-off-by: Jeya R Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-7-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/misc/fastrpc.c | 33 +++++++++++++++++++++++++++++++++ include/uapi/misc/fastrpc.h | 17 +++++++++++++++++ 2 files changed, 50 insertions(+) commit 3abe3ab3cdab71b2073ba6331edc0b2994643133 Author: Srinivas Kandagatla Date: Mon Feb 14 16:09:55 2022 +0000 misc: fastrpc: add secure domain support ADSP/MDSP/SDSP are by default secured, which means it can only be loaded with a Signed process. Where as CDSP can be either be secured/unsecured. non-secured Compute DSP would allow users to load unsigned process and run hexagon instructions, but blocking access to secured hardware within the DSP. Where as signed process with secure CDSP would be allowed to access all the dsp resources. This patch adds basic code to create device nodes as per device tree property. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-6-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/misc/fastrpc.c | 55 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 9 deletions(-) commit fb42387b2e46cd2b1a5aee9a8c7ffc6eaf2df4eb Author: Jeya R Date: Mon Feb 14 16:09:54 2022 +0000 dt-bindings: misc: add property to support non-secure DSP Add property to set DSP domain as non-secure. ADSP/MDSP/SDSP are by default secured, where as CDSP can be either be secured/unsecured. non-secured Compute DSP would allow users to load unsigned process and run hexagon instructions, but limiting access to secured hardware within the DSP. Based on this flag device nodes for secured and unsecured are created. Acked-by: Rob Herring Signed-off-by: Jeya R Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-5-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Documentation/devicetree/bindings/misc/qcom,fastrpc.txt | 5 +++++ 1 file changed, 5 insertions(+) commit 6c16fd8bdd4058d4a6aaca9d5a7b40e4cb281d5a Author: Jeya R Date: Mon Feb 14 16:09:53 2022 +0000 misc: fastrpc: Add support to get DSP capabilities Add support to get DSP capabilities. The capability information is cached on driver. Signed-off-by: Jeya R Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/misc/fastrpc.c | 112 ++++++++++++++++++++++++++++++++++++++++++++ include/uapi/misc/fastrpc.h | 8 ++++ 2 files changed, 120 insertions(+) commit 5c1b97c7d7b736e6439af4f43a65837bc72f56c1 Author: Jeya R Date: Mon Feb 14 16:09:52 2022 +0000 misc: fastrpc: add support for FASTRPC_IOCTL_MEM_MAP/UNMAP Add support for IOCTL requests to map and unmap on DSP based on map flags. Signed-off-by: Jeya R Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/misc/fastrpc.c | 154 ++++++++++++++++++++++++++++++++++++++++++++ include/uapi/misc/fastrpc.h | 51 +++++++++++++++ 2 files changed, 205 insertions(+) commit 965602eabb57d086466ad749e81941e3dd66b595 Author: Srinivas Kandagatla Date: Mon Feb 14 16:09:51 2022 +0000 misc: fastrpc: separate fastrpc device from channel context Currently fastrpc misc device instance is within channel context struct with a kref. So we have 2 structs with refcount, both of them managing the same channel context structure. Separate fastrpc device from channel context and by adding a dedicated fastrpc_device structure, this should clean the structures a bit and also help when adding secure device node support. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220214161002.6831-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/misc/fastrpc.c | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) commit 084973e944bec21804f8afb0515b25434438699a Author: Rafał Miłecki Date: Fri Feb 25 17:58:22 2022 +0000 dt-bindings: nvmem: brcm,nvram: add basic NVMEM cells NVRAM doesn't have cells at hardcoded addresses. They are stored in internal struct (custom & dynamic 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. Reviewed-by: Rob Herring Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220225175822.8293-5-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman .../devicetree/bindings/nvmem/brcm,nvram.yaml | 25 ++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) commit 82a05d81d82bbe00f58be6c32ec57a59e07e0c05 Author: Rafał Miłecki Date: Fri Feb 25 17:58:21 2022 +0000 dt-bindings: nvmem: make "reg" property optional Most NVMEM providers have cells at hardcoded addresses however there are some exceptions. Some devices store cells layout in internal structs using custom formats. It's important to allow NVMEM consumers to still reference such NVMEM cells. Making "reg" optional allows defining NVMEM cells by their names only and using them with phandles. Reviewed-by: Rob Herring Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220225175822.8293-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Documentation/devicetree/bindings/nvmem/nvmem.yaml | 3 --- 1 file changed, 3 deletions(-) commit 6e977eaa8280e957b87904b536661550f2a6b3e8 Author: Rafał Miłecki Date: Fri Feb 25 17:58:20 2022 +0000 nvmem: brcm_nvram: parse NVRAM content into NVMEM cells NVRAM consist of header and NUL separated key-value pairs. Parse it and create NVMEM cell for every key-value entry. Signed-off-by: Rafał Miłecki Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220225175822.8293-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/nvmem/brcm_nvram.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) commit cd9363018269636b4905012a5fc8706cfc7aa116 Author: Vincent Shih Date: Fri Feb 25 17:58:19 2022 +0000 nvmem: dt-bindings: Fix the error of dt-bindings check 1. Remove the unnecessary header file for dt-binding check 2. Replace OTPRX with 0x15 since it is not defined here. 3. Modify the name of the node of the clock driver. Fixes: 8fb29b450182 ("dt-bindings: nvmem: Add bindings doc for Sunplus OCOTP driver") Reported-by: Rob Herring Signed-off-by: Vincent Shih Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220225175822.8293-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Documentation/devicetree/bindings/nvmem/sunplus,sp7021-ocotp.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 6e07a33f97d618afda456610e2633256bb2e8f04 Author: Markus Reichl Date: Sun Mar 6 15:58:08 2022 +0100 w1: w1_therm: Add support for Maxim MAX31850 thermoelement IF. MAX31850 shares family number 0x3B with DS1825. The device is generally compatible with DS1825 but needs a different temperature readout. It operates always in 14 bit mode and has all 4 higher bits of the Config register set to 1. Conversion time is 100ms. Signed-off-by: Markus Reichl Link: https://lore.kernel.org/r/20220306145817.8753-1-m.reichl@fivetechno.de Signed-off-by: Greg Kroah-Hartman drivers/w1/slaves/w1_therm.c | 70 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 2 deletions(-) commit 6caf745d6172dc187d87438d753e187b0b68fed3 Author: Christian Vogel Date: Fri Mar 11 20:28:32 2022 +0100 w1/ds2490: remove spurious newlines within hexdump Multiple pr_infos generate newlines, so the hexdump looks like... > 0x81: count=16, status: > 01 > 00 > 20 (...16 lines...) We switch to a single %*ph hexdump, using the built-in %ph format, which leads to this: [52769.348789] usb 2-1.3.1: Clearing ep0x83. [52769.349729] usb 2-1.3.1: ep_status=0x81, count=16,... ...status=01:00:20:40:05:04:04:00:20:53:00:00:00:00:00:00 Signed-off-by: Christian Vogel Link: https://lore.kernel.org/r/20220311192833.1792-2-vogelchr@vogel.cx Signed-off-by: Greg Kroah-Hartman drivers/w1/masters/ds2490.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 04c633873c01ce0591b05404af6481100871a921 Author: Tom Rix Date: Tue Mar 15 15:38:57 2022 -0400 counter: add defaults to switch-statements Clang static analysis reports this representative problem counter-chrdev.c:482:3: warning: Undefined or garbage value returned to caller return ret; ^~~~~~~~~~ counter_get_data() has a multilevel switches, some without defaults, so ret is sometimes not set. Add returning -EINVAL similar to other defaults. Link: https://lore.kernel.org/r/20220227161746.82776-1-trix@redhat.com Reviewed-by: Jonathan Cameron Acked-by: Syed Nayyar Waris Signed-off-by: Tom Rix Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/b98d1a3ed4b0b324b261b23defd1bdddddba4d44.1647373009.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/counter/counter-chrdev.c | 4 ++++ 1 file changed, 4 insertions(+) commit cac229ed3fde01c7dd488032b77a8f7459362660 Author: William Breathitt Gray Date: Tue Mar 15 15:38:56 2022 -0400 MAINTAINERS: Add Counter subsystem git tree The Counter subsystem tree is now separate from the IIO tree. Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/41db1ea7bd9384da99fb332019ddc03067fe5311.1647373009.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit 257e3df40c62bdc2a7cfb2deb1dac8fcb931cc73 Author: Oleksij Rempel Date: Tue Mar 15 15:38:55 2022 -0400 counter: interrupt-cnt: add counter_push_event() Add counter_push_event() to notify user space about new pulses Link: https://lore.kernel.org/r/20220203135727.2374052-3-o.rempel@pengutronix.de Signed-off-by: Oleksij Rempel Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/9da3460113b5092e8658e12f23578567aab7cc5f.1647373009.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/counter/interrupt-cnt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 73799a889262b4675799bec20a2765be6d6a3f98 Author: Oleksij Rempel Date: Tue Mar 15 15:38:54 2022 -0400 counter: add new COUNTER_EVENT_CHANGE_OF_STATE Add new counter event to notify user space about every new counter pulse. Link: https://lore.kernel.org/r/20220203135727.2374052-2-o.rempel@pengutronix.de Signed-off-by: Oleksij Rempel Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/486a5de67414470449efb84d06a2f2214f4bb31d.1647373009.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman include/uapi/linux/counter.h | 2 ++ 1 file changed, 2 insertions(+) commit 4da08477ea1f0410c0df48cd956b12a54bc8217b Author: William Breathitt Gray Date: Tue Mar 15 15:38:53 2022 -0400 counter: Set counter device name Naming the counter device provides a convenient way to identify it in devres_log events and similar situations. This patch names the counter device by combining the prefix "counter" with the counter device's unique ID. Link: https://lore.kernel.org/r/20220204084551.16397-1-vilhelm.gray@gmail.com Acked-by: Uwe Kleine-König Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/87cc8eb4c84f49f89290577dc9231b2e4d7d3e8c.1647373009.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/counter/counter-core.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 95c211f03fc760329e2afcc58cec55556f07e1e9 Author: William Breathitt Gray Date: Tue Mar 15 15:38:52 2022 -0400 counter: 104-quad-8: Add COMPILE_TEST depends 104_QUAD_8 depends on X86, but compiles fine on ARCH=arm. This patch adds support for COMPILE_TEST which is useful for compile testing code changes to the driver and Counter subsystem. Link: https://lore.kernel.org/r/20220105094137.259111-1-vilhelm.gray@gmail.com Cc: Syed Nayyar Waris Suggested-by: Uwe Kleine-König Acked-by: Uwe Kleine-König Acked-by: Syed Nayyar Waris Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/3917721e792d362ee108b2f12cd2223675449d05.1647373009.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/counter/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bf978a83ed1db2806ee45284393b27cd59aa6552 Merge: 462ccc35a750 ad2f3b08d1ab Author: Rafael J. Wysocki Date: Fri Mar 18 14:03:10 2022 +0100 Merge back ACPI device enumeration material for v5.18. commit 3a1b8e281a2693c286f7dbaa57f6291e0d032c0c Author: Manivannan Sadhasivam Date: Tue Mar 1 21:33:08 2022 +0530 bus: mhi: Make mhi_state_str[] array static inline and move to common.h mhi_state_str[] array could be used by MHI endpoint stack also. So let's make the array as "static inline function" and move it inside the "common.h" header so that the endpoint stack could also make use of it. Reviewed-by: Hemant Kumar Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-11-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/mhi/common.h | 29 +++++++++++++++++++++++++---- drivers/bus/mhi/host/boot.c | 2 +- drivers/bus/mhi/host/debugfs.c | 6 +++--- drivers/bus/mhi/host/init.c | 12 ------------ drivers/bus/mhi/host/main.c | 8 ++++---- drivers/bus/mhi/host/pm.c | 14 +++++++------- 6 files changed, 40 insertions(+), 31 deletions(-) commit 8485149c7a84bbe9d2646b1d6b465d34dbf7ee02 Author: Manivannan Sadhasivam Date: Tue Mar 1 21:33:07 2022 +0530 bus: mhi: Move common MHI definitions out of host directory Move the common MHI definitions in host "internal.h" to "common.h" so that the endpoint code can make use of them. This also avoids duplicating the definitions in the endpoint stack. Reviewed-by: Hemant Kumar Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-10-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/mhi/common.h | 283 ++++++++++++++++++++++++++++++++++++++++ drivers/bus/mhi/host/internal.h | 264 +------------------------------------ 2 files changed, 284 insertions(+), 263 deletions(-) commit 84f5f31f110e5e8cd5581e8efdbf8c369e962eb9 Author: Manivannan Sadhasivam Date: Tue Mar 1 21:33:06 2022 +0530 bus: mhi: host: Rename "struct mhi_tre" to "struct mhi_ring_element" Structure "struct mhi_tre" is representing a generic MHI ring element and not specifically a Transfer Ring Element (TRE). Fix the naming. Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-9-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/mhi/host/init.c | 6 +++--- drivers/bus/mhi/host/internal.h | 2 +- drivers/bus/mhi/host/main.c | 20 ++++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) commit 792ba3218441c67ca91b094fed49fef4e6cf8b70 Author: Manivannan Sadhasivam Date: Tue Mar 1 21:33:05 2022 +0530 bus: mhi: Cleanup the register definitions used in headers Cleanup includes: 1. Using the GENMASK macro for masks 2. Removing brackets for single values 3. Using lowercase for hex values 4. Using two digits for hex values where applicable 5. Aligning the defines on same column Reviewed-by: Hemant Kumar Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-8-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/mhi/host/internal.h | 413 +++++++++++++++++++--------------------- 1 file changed, 199 insertions(+), 214 deletions(-) commit ba1d2b86b6a69e3bd7b8578faa5a325d9a91c2ef Author: Manivannan Sadhasivam Date: Tue Mar 1 21:33:04 2022 +0530 bus: mhi: Use bitfield operations for handling DWORDs of ring elements Instead of using the hardcoded bits in DWORD definitions, let's use the bitfield operations to make it more clear how the DWORDs are structured. Suggested-by: Alex Elder Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-7-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/mhi/host/internal.h | 58 +++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 25 deletions(-) commit d28cab4d4aa06cdb203196cefcd31208a8ccd808 Author: Manivannan Sadhasivam Date: Tue Mar 1 21:33:03 2022 +0530 bus: mhi: Use bitfield operations for register read and write Functions like mhi_read_reg_field(), mhi_poll_reg_field() and mhi_write_reg_field() could be modified to not depend on the shift value passed as an argument. Instead, the bitfield operation could be used to extract the shift value from the mask itself. This eliminates the need to define _SHIFT (and _SHFT) macros and simplifies the code a bit. For shift values those cannot be determined during build time, "__ffs()" helper is used find the shift value during runtime. While at it, let's also get rid of 32-bit masks like CHDBOFF_CHDBOFF_MASK by doing the full 32-bit register read. Suggested-by: Alex Elder Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-6-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/mhi/host/boot.c | 15 ++--- drivers/bus/mhi/host/debugfs.c | 10 ++-- drivers/bus/mhi/host/init.c | 67 ++++++++++------------ drivers/bus/mhi/host/internal.h | 120 ++++++++-------------------------------- drivers/bus/mhi/host/main.c | 16 +++--- drivers/bus/mhi/host/pm.c | 18 ++---- 6 files changed, 76 insertions(+), 170 deletions(-) commit a0f5a630668cb8b2ebf5204f08e957875e991780 Author: Manivannan Sadhasivam Date: Tue Mar 1 21:33:02 2022 +0530 bus: mhi: Move host MHI code to "host" directory In preparation of the endpoint MHI support, let's move the host MHI code to its own "host" directory and adjust the toplevel MHI Kconfig & Makefile. While at it, let's also move the "pci_generic" driver to "host" directory as it is a host MHI controller driver. Reviewed-by: Hemant Kumar Reviewed-by: Alex Elder Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-5-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/Makefile | 2 +- drivers/bus/mhi/Kconfig | 27 ++------------------------- drivers/bus/mhi/Makefile | 8 ++------ drivers/bus/mhi/host/Kconfig | 31 +++++++++++++++++++++++++++++++ drivers/bus/mhi/{core => host}/Makefile | 4 +++- drivers/bus/mhi/{core => host}/boot.c | 0 drivers/bus/mhi/{core => host}/debugfs.c | 0 drivers/bus/mhi/{core => host}/init.c | 0 drivers/bus/mhi/{core => host}/internal.h | 0 drivers/bus/mhi/{core => host}/main.c | 0 drivers/bus/mhi/{ => host}/pci_generic.c | 0 drivers/bus/mhi/{core => host}/pm.c | 0 12 files changed, 39 insertions(+), 33 deletions(-) commit ed2d980503235829aa3e0c7ae3b82374c30a081c Author: Paul Davey Date: Tue Mar 1 21:33:01 2022 +0530 bus: mhi: Fix MHI DMA structure endianness The MHI driver does not work on big endian architectures. The controller never transitions into mission mode. This appears to be due to the modem device expecting the various contexts and transfer rings to have fields in little endian order in memory, but the driver constructs them in native endianness. Fix MHI event, channel and command contexts and TRE handling macros to use explicit conversion to little endian. Mark fields in relevant structures as little endian to document this requirement. Fixes: a6e2e3522f29 ("bus: mhi: core: Add support for PM state transitions") Fixes: 6cd330ae76ff ("bus: mhi: core: Add support for ringing channel/event ring doorbells") Cc: stable@vger.kernel.org Reviewed-by: Manivannan Sadhasivam Reviewed-by: Alex Elder Signed-off-by: Paul Davey Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-4-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/mhi/core/debugfs.c | 26 ++++----- drivers/bus/mhi/core/init.c | 36 ++++++------ drivers/bus/mhi/core/internal.h | 119 ++++++++++++++++++++-------------------- drivers/bus/mhi/core/main.c | 22 ++++---- drivers/bus/mhi/core/pm.c | 4 +- 5 files changed, 104 insertions(+), 103 deletions(-) commit 64f93a9a27c1970fa8ee5ffc5a6ae2bda477ec5b Author: Paul Davey Date: Tue Mar 1 21:33:00 2022 +0530 bus: mhi: Fix pm_state conversion to string On big endian architectures the mhi debugfs files which report pm state give "Invalid State" for all states. This is caused by using find_last_bit which takes an unsigned long* while the state is passed in as an enum mhi_pm_state which will be of int size. Fix by using __fls to pass the value of state instead of find_last_bit. Also the current API expects "mhi_pm_state" enumerator as the function argument but the function only works with bitmasks. So as Alex suggested, let's change the argument to u32 to avoid confusion. Fixes: a6e2e3522f29 ("bus: mhi: core: Add support for PM state transitions") Cc: stable@vger.kernel.org [mani: changed the function argument to u32] Reviewed-by: Manivannan Sadhasivam Reviewed-by: Hemant Kumar Reviewed-by: Alex Elder Signed-off-by: Paul Davey Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-3-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/mhi/core/init.c | 10 ++++++---- drivers/bus/mhi/core/internal.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) commit 2413ffbf19a95cfcd7adf63135c5a9343a66d0a2 Author: Yonglin Tan Date: Tue Mar 1 21:32:59 2022 +0530 bus: mhi: pci_generic: Add mru_default for Quectel EM1xx series For default mechanism, the driver uses default MRU 3500 if mru_default is not initialized. The Qualcomm configured the MRU size to 32768 in the WWAN device FW. So, we align the driver setting with Qualcomm FW setting. Link: https://lore.kernel.org/r/MEYP282MB2374EE345DADDB591AFDA6AFFD2E9@MEYP282MB2374.AUSP282.PROD.OUTLOOK.COM Fixes: ac4bf60bbaa0 ("bus: mhi: pci_generic: Introduce quectel EM1XXGR-L support") Cc: stable@vger.kernel.org Reviewed-by: Manivannan Sadhasivam Signed-off-by: Yonglin Tan Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220301160308.107452-2-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/bus/mhi/pci_generic.c | 1 + 1 file changed, 1 insertion(+) commit 824a29ad44b6be1c6ef7cc562f701ce70d020708 Author: Colin Ian King Date: Tue Mar 15 22:22:53 2022 +0000 misc: sgi-gru: Fix spelling mistake "unexpect" -> "unexpected" There is a spelling mistake in an error message. Fix it. Acked-by: Dimitri Sivanich Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220315222253.2960047-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/misc/sgi-gru/grukservices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 66bcd06099bb866ee0e4349e7937ddb8f03db754 Author: Maciej W. Rozycki Date: Mon Feb 14 20:16:50 2022 +0000 parport_pc: Also enable driver for PCI systems Nowadays PC-style parallel ports come in the form of PCI and PCIe option cards and there are some combined parallel/serial option cards as well that we handle in the parport subsystem. There is nothing in particular that would prevent them from being used in any system equipped with PCI or PCIe connectivity, except that we do not permit the PARPORT_PC config option to be selected for platforms for which ARCH_MIGHT_HAVE_PC_PARPORT has not been set for. The only PCI platforms that actually can't make use of PC-style parallel port hardware are those newer PCIe systems that have no support for I/O cycles in the host bridge, required by such parallel ports. Notably, this includes the s390 arch, which has port I/O accessors that cause compilation warnings (promoted to errors with `-Werror'), and there are other cases such as the POWER9 PHB4 device, though this one has variable port I/O accessors that depend on the particular system. Also it is not clear whether the serial port side of devices enabled by PARPORT_SERIAL uses port I/O or MMIO. Finally Super I/O solutions are always either ISA or platform devices. Make the PARPORT_PC option selectable also for PCI systems then, except for the s390 arch, however limit the availability of PARPORT_PC_SUPERIO to platforms that enable ARCH_MIGHT_HAVE_PC_PARPORT. Update platforms accordingly for the required header. Acked-by: Sudip Mukherjee Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2202141955550.34636@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman arch/arm64/include/asm/Kbuild | 1 + arch/csky/include/asm/Kbuild | 1 + arch/riscv/include/asm/Kbuild | 1 + arch/um/include/asm/Kbuild | 1 + arch/xtensa/include/asm/Kbuild | 1 + drivers/parport/Kconfig | 4 ++-- 6 files changed, 7 insertions(+), 2 deletions(-) commit 8a580a26760cb14535c160613fe9cd0e4dc6f5c6 Author: Takashi Iwai Date: Fri Mar 18 09:21:57 2022 +0100 ALSA: oss: Release temporary buffers upon errors When the parameter changes fails, we don't need to keep the old temporary buffers. Release those (and plugin instances) upon errors for reducing dead memory footprint. Since we always call it at the exit of snd_pcm_oss_changes_params_locked(), the explicit calls of snd_pcm_oss_plugin_clear() can be dropped, too. Along with it, unify the buffer-free calls to a single helper and call it from the needed places. Link: https://lore.kernel.org/r/20220318082157.29769-1-tiwai@suse.de Signed-off-by: Takashi Iwai sound/core/oss/pcm_oss.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) commit e0de88dc7ba2cfd352f0e472044a9176c0a91cf1 Author: Andy Shevchenko Date: Thu Feb 10 15:49:43 2022 +0200 pps: generators: pps_gen_parport: Switch to use module_parport_driver() Switch to use module_parport_driver() to reduce boilerplate code. Note, it doesn't matter when we check the module parameter. If it was writable we even would have more flexibility of changing it at runtime (when built-in the kernel) after this patch. Acked-by: Rodolfo Giometti Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220210134943.62026-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/pps/generators/pps_gen_parport.c | 42 ++++++-------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) commit efb6402c3c4a7c26d97c92d70186424097b6e366 Author: Takashi Iwai Date: Fri Mar 18 09:20:36 2022 +0100 ALSA: oss: Fix PCM OSS buffer allocation overflow We've got syzbot reports hitting INT_MAX overflow at vmalloc() allocation that is called from snd_pcm_plug_alloc(). Although we apply the restrictions to input parameters, it's based only on the hw_params of the underlying PCM device. Since the PCM OSS layer allocates a temporary buffer for the data conversion, the size may become unexpectedly large when more channels or higher rates is given; in the reported case, it went over INT_MAX, hence it hits WARN_ON(). This patch is an attempt to avoid such an overflow and an allocation for too large buffers. First off, it adds the limit of 1MB as the upper bound for period bytes. This must be large enough for all use cases, and we really don't want to handle a larger temporary buffer than this size. The size check is performed at two places, where the original period bytes is calculated and where the plugin buffer size is calculated. In addition, the driver uses array_size() and array3_size() for multiplications to catch overflows for the converted period size and buffer bytes. Reported-by: syzbot+72732c532ac1454eeee9@syzkaller.appspotmail.com Suggested-by: Linus Torvalds Cc: Link: https://lore.kernel.org/r/00000000000085b1b305da5a66f3@google.com Link: https://lore.kernel.org/r/20220318082036.29699-1-tiwai@suse.de Signed-off-by: Takashi Iwai sound/core/oss/pcm_oss.c | 12 ++++++++---- sound/core/oss/pcm_plugin.c | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) commit ac484005767bb50cc76e56e26fdbb25a097e5bf8 Author: Allen-KH Cheng Date: Wed Feb 16 20:00:25 2022 +0800 dt-bindings: usb: mtk-xhci: add compatible for mt8186 Add compatible for mt8186 Acked-by: Rob Herring Acked-by: Chunfeng Yun Signed-off-by: Allen-KH Cheng Link: https://lore.kernel.org/r/20220216120025.29860-1-allen-kh.cheng@mediatek.com Signed-off-by: Greg Kroah-Hartman Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 1 + 1 file changed, 1 insertion(+) commit 1456277644b3d33e76f553724127184b1cd27974 Author: Lad Prabhakar Date: Wed Mar 9 20:23:27 2022 +0000 platform: goldfish: pipe: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220309202327.16627-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman drivers/platform/goldfish/goldfish_pipe.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 3b2e6a932eade9625fb6388c970004ae866601ee Author: Desmond Yan Date: Tue Mar 1 18:53:40 2022 -0800 misc: bcm-vk: Remove viper from device id table As bcm_vk driver is not the production driver for viper, remove its pci device id from table. Acked-by: Scott Branden Signed-off-by: Desmond Yan Link: https://lore.kernel.org/r/20220302025340.25602-1-desmond.yan@broadcom.com Signed-off-by: Greg Kroah-Hartman drivers/misc/bcm-vk/bcm_vk_dev.c | 1 - 1 file changed, 1 deletion(-) commit e913c09dbe3b4114ed4fadd15705a63fcfaaf48a Merge: 5edce151386e e432dd3bee2c Author: David S. Miller Date: Fri Mar 18 12:53:23 2022 +0000 Merge branch 'lan743x-PCI11010-#PCI11414' Raju Lakkaraju says: ==================== net: lan743x: PCI11010 / PCI11414 devices This patch series continues with the addition of supported features for the Ethernet function of the PCI11010 / PCI11414 devices to the LAN743x driver. ==================== Signed-off-by: David S. Miller commit e432dd3bee2c3ae9a2df22b7a378384fc0d8816d Author: Raju Lakkaraju Date: Thu Mar 17 16:13:10 2022 +0530 net: lan743x: Add support for PTP-IO Event Output (Periodic Output) Add support for PTP-IO Event Output (Periodic Output - perout) for PCI11010/PCI11414 chips Signed-off-by: Raju Lakkaraju Signed-off-by: David S. Miller drivers/net/ethernet/microchip/lan743x_main.h | 33 ++++ drivers/net/ethernet/microchip/lan743x_ptp.c | 218 +++++++++++++++++++++++++- drivers/net/ethernet/microchip/lan743x_ptp.h | 1 + 3 files changed, 250 insertions(+), 2 deletions(-) commit 60942c397af6094c04406b77982314dfe69ef3c4 Author: Raju Lakkaraju Date: Thu Mar 17 16:13:09 2022 +0530 net: lan743x: Add support for PTP-IO Event Input External Timestamp (extts) PTP-IOs block provides for time stamping PTP-IO input events. PTP-IOs are numbered from 0 to 11. When a PTP-IO is enabled by the corresponding bit in the PTP-IO Capture Configuration Register, a rising or falling edge, respectively, will capture the 1588 Local Time Counter Signed-off-by: Raju Lakkaraju Reported-by: kernel test robot Signed-off-by: David S. Miller drivers/net/ethernet/microchip/lan743x_main.h | 73 ++++++ drivers/net/ethernet/microchip/lan743x_ptp.c | 340 +++++++++++++++++++++++--- drivers/net/ethernet/microchip/lan743x_ptp.h | 9 + 3 files changed, 386 insertions(+), 36 deletions(-) commit d808f7ca8d23e3a69bed00317def7b85fbb74584 Author: Raju Lakkaraju Date: Thu Mar 17 16:13:08 2022 +0530 net: lan743x: Add support for OTP Add new the OTP read and write access functions for PCI11010/PCI11414 chips PCI11010/PCI11414 OTP module register offsets are different from LAN743x OTP module Signed-off-by: Raju Lakkaraju Signed-off-by: David S. Miller drivers/net/ethernet/microchip/lan743x_ethtool.c | 169 ++++++++++++++++++++++- drivers/net/ethernet/microchip/lan743x_main.h | 14 ++ 2 files changed, 180 insertions(+), 3 deletions(-) commit cdea83cc103a737a235d77d0cd21ab8a1108a1d9 Author: Raju Lakkaraju Date: Thu Mar 17 16:13:07 2022 +0530 net: lan743x: Add support for EEPROM Add new the EEPROM read and write access functions and system lock protection to access by devices for PCI11010/PCI11414 chips Signed-off-by: Raju Lakkaraju Signed-off-by: David S. Miller drivers/net/ethernet/microchip/lan743x_ethtool.c | 178 ++++++++++++++++++++++- drivers/net/ethernet/microchip/lan743x_main.c | 1 + drivers/net/ethernet/microchip/lan743x_main.h | 38 +++++ 3 files changed, 212 insertions(+), 5 deletions(-) commit bc1962e52333810c18ba7c2319784366d1eb3969 Author: Raju Lakkaraju Date: Thu Mar 17 16:13:06 2022 +0530 net: lan743x: Add support to display Tx Queue statistics Tx 4 queue statistics display through ethtool application Signed-off-by: Raju Lakkaraju Signed-off-by: David S. Miller drivers/net/ethernet/microchip/lan743x_ethtool.c | 31 ++++++++++++++++++++++++ drivers/net/ethernet/microchip/lan743x_main.c | 1 + drivers/net/ethernet/microchip/lan743x_main.h | 1 + 3 files changed, 33 insertions(+) commit f1bc423f56306b24fb15bc4a1612ef6c6ee24603 Author: Yang Li Date: Thu Mar 3 10:02:06 2022 +0800 misc: rtsx: clean up one inconsistent indenting Eliminate the follow smatch warning: drivers/misc/cardreader/rts5228.c:494 rts5228_extra_init_hw() warn: inconsistent indenting Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220303020206.98911-1-yang.lee@linux.alibaba.com Signed-off-by: Greg Kroah-Hartman drivers/misc/cardreader/rts5228.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ecd1735f14d6ac868ae5d8b7a2bf193fa11f388b Author: Xiaolong Huang Date: Tue Mar 8 17:20:47 2022 +0800 virt: acrn: fix a memory leak in acrn_dev_ioctl() The vm_param and cpu_regs need to be freed via kfree() before return -EINVAL error. Fixes: 9c5137aedd11 ("virt: acrn: Introduce VM management interfaces") Fixes: 2ad2aaee1bc9 ("virt: acrn: Introduce an ioctl to set vCPU registers state") Signed-off-by: Xiaolong Huang Signed-off-by: Fei Li Link: https://lore.kernel.org/r/20220308092047.1008409-1-butterflyhuangxx@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/virt/acrn/hsm.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) commit 8a6e85f75a83d16a71077e41f2720c691f432002 Author: Yonghua Huang Date: Mon Feb 28 05:22:12 2022 +0300 virt: acrn: obtain pa from VMA with PFNMAP flag acrn_vm_ram_map can't pin the user pages with VM_PFNMAP flag by calling get_user_pages_fast(), the PA(physical pages) may be mapped by kernel driver and set PFNMAP flag. This patch fixes logic to setup EPT mapping for PFN mapped RAM region by checking the memory attribute before adding EPT mapping for them. Fixes: 88f537d5e8dd ("virt: acrn: Introduce EPT mapping management") Signed-off-by: Yonghua Huang Signed-off-by: Fei Li Link: https://lore.kernel.org/r/20220228022212.419406-1-yonghua.huang@intel.com Signed-off-by: Greg Kroah-Hartman drivers/virt/acrn/mm.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) commit fbeac3dfc762871e72676a065ddd13e5087f26ab Author: Sebastian Andrzej Siewior Date: Tue Mar 8 13:27:15 2022 +0100 virt: acrn: Remove unsued acrn_irqfds_mutex. acrn_irqfds_mutex is not used, never was. Remove acrn_irqfds_mutex. Fixes: aa3b483ff1d71 ("virt: acrn: Introduce irqfd") Cc: Fei Li Signed-off-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/YidLo57Kw/u/cpA5@linutronix.de Signed-off-by: Greg Kroah-Hartman drivers/virt/acrn/irqfd.c | 1 - 1 file changed, 1 deletion(-) commit b734fed013985626b519f0ff1c97a4b5eca31a8d Author: Haowen Bai Date: Fri Mar 11 10:38:51 2022 +0800 virt: fsl_hypervisor: Directly return 0 instead of using local ret variable fixes coccinelle warning: drivers/virt/fsl_hypervisor.c:690:5-8: Unneeded variable: "ret". Return "0" on line 698 Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1646966331-16813-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman drivers/virt/fsl_hypervisor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit c10187b1c5ebb8681ca467ab7b0ded5ea415d258 Author: Alexander Usyskin Date: Tue Mar 8 11:59:26 2022 +0200 mei: avoid iterator usage outside of list_for_each_entry Usage of the iterator outside of the list_for_each_entry is considered harmful. https://lkml.org/lkml/2022/2/17/1032 Do not reference the loop variable outside of the loop, by rearranging the orders of execution. Instead of performing search loop and checking outside the loop if the end of the list was hit and no matching element was found, the execution is performed inside the loop upon a successful match followed by a goto statement to the next step, therefore no condition has to be performed after the loop has ended. Cc: Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20220308095926.300412-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman drivers/misc/mei/interrupt.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) commit 7bbbd0845818cffa9fa8ccfe52fa1cad58e7e4f2 Author: Alexander Usyskin Date: Tue Mar 1 09:11:15 2022 +0200 mei: me: add Alder Lake N device id. Add Alder Lake N device ID. Cc: Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20220301071115.96145-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman drivers/misc/mei/hw-me-regs.h | 1 + drivers/misc/mei/pci-me.c | 1 + 2 files changed, 2 insertions(+) commit c8e9b30ccae605bf1dbeaf03971f9b83f70b928d Author: Vishnu Dasa Date: Thu Mar 17 23:00:40 2022 -0700 VMCI: Release notification_bitmap in error path notification_bitmap may not be released when VMCI_CAPS_DMA_DATAGRAM capability is missing from the device. Add missing 'err_free_notification_bitmap' label and use it instead of 'err_free_data_buffers' to avoid this. Fixes: eed2298d9360 ("VMCI: dma dg: detect DMA datagram capability") Reported-by: Dan Carpenter Reviewed-by: Bryan Tan Reviewed-by: Rajesh Jalisatgi Signed-off-by: Vishnu Dasa Link: https://lore.kernel.org/r/20220318060040.31621-1-vdasa@vmware.com Signed-off-by: Greg Kroah-Hartman drivers/misc/vmw_vmci/vmci_guest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 5df0e734b8c39598effe0f17e5bd8ff7748a0693 Author: Vishnu Dasa Date: Thu Mar 17 22:58:43 2022 -0700 VMCI: Check exclusive_vectors when freeing interrupt 1 free_irq() may be called to free an interrupt that was not allocated. Add missing 'if' statement to check for exclusive_vectors when freeing interrupt 1. Fixes: cc68f2177fcb ("VMCI: dma dg: register dummy IRQ handlers for DMA datagrams") Reported-by: Dan Carpenter Reviewed-by: Bryan Tan Reviewed-by: Rajesh Jalisatgi Signed-off-by: Vishnu Dasa Link: https://lore.kernel.org/r/20220318055843.30606-1-vdasa@vmware.com Signed-off-by: Greg Kroah-Hartman drivers/misc/vmw_vmci/vmci_guest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit e70bcbcfa983580109c5daa2391ecb9d07dc7cfd Author: Jorgen Hansen Date: Sun Feb 27 13:05:39 2022 -0800 VMCI: Update maintainers for VMCI Remove myself as maintainer for the VMCI driver, and add Bryan and Rajesh. Acked-by: Rajesh Jalisatgi Acked-by: Bryan Tan Acked-by: Vishnu Dasa Signed-off-by: Jorgen Hansen Link: https://lore.kernel.org/r/20220227210539.19665-1-jhansen@vmware.com Signed-off-by: Greg Kroah-Hartman MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit fefb8a2a941338d871e2d83fbd65fbfa068857bd Author: Randy Dunlap Date: Wed Mar 16 12:20:03 2022 -0700 virtio_console: eliminate anonymous module_init & module_exit Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Signed-off-by: Randy Dunlap Reviewed-by: Amit Shah Cc: virtualization@lists.linux-foundation.org Cc: Arnd Bergmann Link: https://lore.kernel.org/r/20220316192010.19001-3-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman drivers/char/virtio_console.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 41197a5f11a4b2d11ac19bc62552022153032811 Author: Wan Jiabing Date: Fri Mar 18 17:24:48 2022 +0800 staging: r8188eu: remove unnecessary memset in r8188eu psetauthparm and precvpriv->pallocated_recv_buf are allocated by kzalloc(). It is unnecessary to call memset again. Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20220318092459.519225-1-wanjiabing@vivo.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_mlme.c | 1 - drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 1 - 2 files changed, 2 deletions(-) commit 832ce36f44a2c5dd3cb6be6dfb9003715f8dca2a Author: Song Chen Date: Fri Mar 18 17:57:12 2022 +0800 staging: greybus: introduce pwm_ops::apply Introduce newer .apply function in pwm_ops to replace legacy operations including enable, disable, config and set_polarity. This guarantees atomic changes of the pwm controller configuration. Reviewed-by: Alex Elder Signed-off-by: Song Chen Link: https://lore.kernel.org/r/1647597432-27586-1-git-send-email-chensong_2000@189.cn Signed-off-by: Greg Kroah-Hartman drivers/staging/greybus/pwm.c | 64 +++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 24 deletions(-) commit 56bd392be52eec994a6d191ce3d798cf83c34133 Author: Charlie Sands Date: Wed Mar 16 22:53:12 2022 -0400 staging: rts5208: Resolve checkpatch.pl issues. This patch removes unwanted use of dev_info for ftrace-like functionality as suggested by checkpatch.pl. Signed-off-by: Charlie Sands Link: https://lore.kernel.org/r/YjKimAdiRfRVfGl8@sckzor-linux.localdomain Signed-off-by: Greg Kroah-Hartman drivers/staging/rts5208/rtsx.c | 8 -------- 1 file changed, 8 deletions(-) commit 9314a822e56422f419e2b514ba1f355843ce3063 Author: Nam Cao Date: Wed Mar 16 22:49:41 2022 +0000 staging: sm750fb: fix naming style Fix CamelCase names defined in ddk750_dvi.c and ddk750_dvi.h, as reported by checkpatch.pl. Remove name suffixes such as pfn_ and g_. Signed-off-by: Nam Cao Link: https://lore.kernel.org/r/20220316224940.70107-1-cvn249@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/sm750fb/ddk750_dvi.c | 68 ++++++++++++++++++------------------ drivers/staging/sm750fb/ddk750_dvi.h | 64 ++++++++++++++++----------------- 2 files changed, 66 insertions(+), 66 deletions(-) commit 362e54e48b783d6f6ef4b9793903d02d449508aa Author: Andy Shevchenko Date: Wed Mar 16 18:53:51 2022 +0200 staging: fbtft: Consider type of init sequence values in fbtft_init_display() In the fbtft_init_display() the init sequence is printed for the debug purposes. Unfortunately the current code doesn't take into account that values in the buffer are of the s16 type. Consider that and replace the printing code with fbtft_par_dbg_hex() call. Fixes: b888897014a9 ("staging/fbtft: Remove all strcpy() uses") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220316165351.58107-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/staging/fbtft/fbtft-core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit 0e8cf2be5c0a324809389c81e5555e8ccb6ba123 Author: Andy Shevchenko Date: Wed Mar 16 18:53:50 2022 +0200 staging: fbtft: Constify buf parameter in fbtft_dbg_hex() It's obvious that we don't and shouldn't modify buffer that is about to be dumped. Constify parameter in fbtft_dbg_hex() to make it clear. Fixes: c296d5f9957c ("staging: fbtft: core support") Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220316165351.58107-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/staging/fbtft/fbtft-core.c | 2 +- drivers/staging/fbtft/fbtft.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 9b63000010a0ec3196bd6ecac5b828ba6e6b65dd Author: Xiaoke Wang Date: Wed Mar 16 01:24:12 2022 +0800 staging: mmal-vchiq: clear redundant item named bulk_scratch bulk_scratch is not used anywhere and the original allocation of it does not have proper check. Deleting it directly seems to be a good choice. Reviewed-by: Dan Carpenter Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_F721901366AB5C720E008AF7F02DA5D3FF07@qq.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 7 ------- 1 file changed, 7 deletions(-) commit 1970a0623002a13845b7db4c45a67402e11b3011 Author: Julia Lawall Date: Mon Mar 14 12:53:28 2022 +0100 kernfs: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220314115354.144023-5-Julia.Lawall@inria.fr Signed-off-by: Greg Kroah-Hartman fs/kernfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f58c252e30cf74f68b0054293adc03b5923b9f0e Author: Ilpo Järvinen Date: Mon Mar 14 11:14:32 2022 +0200 serial: 8250: fix XOFF/XON sending when DMA is used When 8250 UART is using DMA, x_char (XON/XOFF) is never sent to the wire. After this change, x_char is injected correctly. Create uart_xchar_out() helper for sending the x_char out and accounting related to it. It seems that almost every driver does these same steps with x_char. Except for 8250, however, almost all currently lack .serial_out so they cannot immediately take advantage of this new helper. The downside of this patch is that it might reintroduce the problems some devices faced with mixed DMA/non-DMA transfer which caused revert f967fc8f165f (Revert "serial: 8250_dma: don't bother DMA with small transfers"). However, the impact should be limited to cases with XON/XOFF (that didn't work with DMA capable devices to begin with so this problem is not very likely to cause a major issue, if any at all). Fixes: 9ee4b83e51f74 ("serial: 8250: Add support for dmaengine") Reported-by: Gilles Buloz Tested-by: Gilles Buloz Reviewed-by: Andy Shevchenko Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20220314091432.4288-2-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/8250/8250_dma.c | 11 ++++++++++- drivers/tty/serial/8250/8250_port.c | 4 +--- drivers/tty/serial/serial_core.c | 14 ++++++++++++++ include/linux/serial_core.h | 2 ++ 4 files changed, 27 insertions(+), 4 deletions(-) commit 1db536f95d0264a2b83fb032d5b057ba0113e622 Author: Vincent Whitchurch Date: Fri Mar 11 10:45:15 2022 +0100 tty: serial: samsung: Add ARTPEC-8 support Add support for the UART block on the ARTPEC-8 SoC. This is closely related to the variants used on the Exynos chips. The register layout is identical to Exynos850 et al but the fifo size is different (64 bytes in each direction for all instances). Reviewed-by: Krzysztof Kozlowski Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220311094515.3223023-3-vincent.whitchurch@axis.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/samsung_tty.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) commit 02a64ef64c4efb3707e670cdde27afe352c7c143 Author: Vincent Whitchurch Date: Fri Mar 11 10:45:14 2022 +0100 dt-bindings: serial: samsung: Add ARTPEC-8 UART Add a compatible for the UART on the ARTPEC-8 SoC. This hardware block is closely related to the variants used on the Exynos chips. The register layout is identical to Exynos850 et al but the fifo size is different (64 bytes in each direction for all instances). Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220311094515.3223023-2-vincent.whitchurch@axis.com Signed-off-by: Greg Kroah-Hartman Documentation/devicetree/bindings/serial/samsung_uart.yaml | 2 ++ 1 file changed, 2 insertions(+) commit 927728a34f11b5a27f4610bdb7068317d6fdc72a Author: Hui Wang Date: Tue Mar 8 19:00:42 2022 +0800 serial: sc16is7xx: Clear RS485 bits in the shutdown We tested RS485 function on an EVB which has SC16IS752, after finishing the test, we started the RS232 function test, but found the RTS is still working in the RS485 mode. That is because both startup and shutdown call port_update() to set the EFCR_REG, this will not clear the RS485 bits once the bits are set in the reconf_rs485(). To fix it, clear the RS485 bits in shutdown. Cc: Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20220308110042.108451-1-hui.wang@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/sc16is7xx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit f25fbd5b1ef3773bd975135f8a017dc2251626cc Author: Krzysztof Kozlowski Date: Tue Mar 8 09:09:19 2022 +0100 tty: serial: samsung: simplify getting OF match data Simplify the code with of_device_get_match_data() and use dev_of_node() to remove ifdef-erry. Tested-by: Alim Akhtar Reviewed-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308080919.152715-9-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) commit bb1d98187b09d44b43115f5086a6de5adce61c17 Author: Krzysztof Kozlowski Date: Tue Mar 8 09:09:18 2022 +0100 tty: serial: samsung: constify variables and pointers Constify variables, data pointed by several pointers and "udivslot_table" static array. This makes code a bit safer. Tested-by: Alim Akhtar Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308080919.152715-8-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) commit 8eea61c00f7cea81e8a7f461716be64ebef264a7 Author: Krzysztof Kozlowski Date: Tue Mar 8 09:09:17 2022 +0100 tty: serial: samsung: constify s3c24xx_serial_drv_data members The driver data (struct s3c24xx_serial_drv_data) is never modified, so also its members can be made const. Except code style this has no impact because the structure itself is always a const. Tested-by: Alim Akhtar Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308080919.152715-7-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 5d18bec0cf73370b2328dc311f28271f2b40d163 Author: Krzysztof Kozlowski Date: Tue Mar 8 09:09:16 2022 +0100 tty: serial: samsung: constify UART name The UART name from driver data holds only string literals. Tested-by: Alim Akhtar Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308080919.152715-6-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 97a6cfe8115b04296da6ee6589367234307f0c7d Author: Krzysztof Kozlowski Date: Tue Mar 8 09:09:15 2022 +0100 tty: serial: samsung: constify s3c24xx_serial_drv_data The driver data (struct s3c24xx_serial_drv_data) is only used to initialize the driver properly and is not modified. Make it const. Tested-by: Alim Akhtar Reviewed-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308080919.152715-5-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 58 ++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) commit 3aec400965500697179aed4497d9ad8dc9502e37 Author: Krzysztof Kozlowski Date: Tue Mar 8 09:09:14 2022 +0100 tty: serial: samsung: reduce number of casts The pointers to instances of "struct s3c24xx_serial_drv_data" are first cast to kernel_ulong_t and then either used directly (in "platform_device_id.driver_data") or cast again to void * (in "of_device_id.data"). One cast can be dropped, so at least for "of_device_id.data" case there will be no casts at all. This makes the code a bit simpler. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308080919.152715-4-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 72 ++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) commit 7483189d6b3c1dec7e91fa082a4d52cfc9dd1ef0 Author: Krzysztof Kozlowski Date: Tue Mar 8 09:09:13 2022 +0100 tty: serial: samsung: embed s3c2410_uartcfg in parent structure Embed "struct s3c2410_uartcfg" directly as a member of "struct s3c24xx_serial_drv_data" instead of keeping it as a pointer. This makes the code clearer (obvious ownership of "s3c2410_uartcfg s3c24xx_serial_drv_data") and saves one pointer. Tested-by: Alim Akhtar Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308080919.152715-3-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit d3a46d0d83f94b5780bcaaea4b4ddbe7c110b35c Author: Krzysztof Kozlowski Date: Tue Mar 8 09:09:12 2022 +0100 tty: serial: samsung: embed s3c24xx_uart_info in parent structure Embed "struct s3c24xx_uart_info" directly as a member of "struct s3c24xx_serial_drv_data" instead of keeping it as a pointer. This makes the code clearer (obvious ownership of "struct s3c24xx_serial_drv_data") and saves one pointer. Tested-by: Alim Akhtar Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308080919.152715-2-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit dffa58b64cca6ca266bc0310d8e6b27abd1f8048 Author: Krzysztof Kozlowski Date: Tue Mar 8 08:41:57 2022 +0100 serial: 8250_tegra: mark acpi_device_id as unused with !ACPI The driver's acpi_device_id table is referenced via ACPI_PTR() so it will be unused for !CONFIG_ACPI builds: drivers/tty/serial/8250/8250_tegra.c:178:36: warning: ‘tegra_uart_acpi_match’ defined but not used [-Wunused-const-variable=] Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308074157.113568-1-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/8250/8250_tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0dc0da881b4574d1e04a079ab2ea75da61f5ad2e Author: Rafał Miłecki Date: Fri Mar 11 10:32:33 2022 +0100 tty: serial: bcm63xx: use more precise Kconfig symbol Patches lowering SERIAL_BCM63XX dependencies led to a discussion and documentation change regarding "depends" usage. Adjust Kconfig entry to match current guidelines. Make this symbol available for relevant architectures only. Cc: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven Acked-by: Florian Fainelli Signed-off-by: Rafał Miłecki Ref: f35a07f92616 ("tty: serial: bcm63xx: lower driver dependencies") Ref: 18084e435ff6 ("Documentation/kbuild: Document platform dependency practises") Link: https://lore.kernel.org/r/20220311093233.10012-1-zajec5@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 1a282ef0a18fff8a37a60566da3a87b5d8daf1de Author: Geert Uytterhoeven Date: Tue Mar 15 14:52:32 2022 +0100 serial: SERIAL_SUNPLUS should depend on ARCH_SUNPLUS Sunplus serial ports are only present on Sunplus SoCs. Hence add a dependency on ARCH_SUNPLUS, to prevent asking the user about this driver when configuring a kernel without Sunplus SoC support. Fixes: 9e8d5470325f25be ("serial: sunplus-uart: Add Sunplus SoC UART Driver") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/59f46272ab5b16853acac4d585c3333cfd394223.1647352195.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b0db9263b0d599dbc4cf2b5679f873d937c60591 Author: Alexander Vorwerk Date: Tue Mar 15 03:07:45 2022 +0100 tty: serial: jsm: fix two assignments in if conditions Fixes two warnings reported of the form "ERROR: do not use assignment in if condition" reported by checkpatch.pl. Signed-off-by: Alexander Vorwerk Link: https://lore.kernel.org/r/20220315020745.15752-1-alexander.vorwerk@stud.uni-goettingen.de Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/jsm/jsm_neo.c | 3 ++- drivers/tty/serial/jsm/jsm_tty.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) commit 168b504bc1d2c4df352bd5bf5e6853aff0d229c9 Author: Colin Ian King Date: Mon Mar 7 15:30:47 2022 +0000 tty: serial: jsm: remove redundant assignments to variable linestatus Variable linestatus is being assigned values that are never read, the assignments are redundant and can be removed. Cleans up clang scan warnings: drivers/tty/serial/jsm/jsm_cls.c:369:2: warning: Value stored to 'linestatus' is never read [deadcode.DeadStores] drivers/tty/serial/jsm/jsm_cls.c:400:4: warning: Value stored to 'linestatus' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220307153047.139639-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/jsm/jsm_cls.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit a6cee01b4f9205ce664e3442ee7bd5aee0d650de Author: Colin Ian King Date: Mon Mar 7 23:00:55 2022 +0000 serial: 8250_mtk: make two read-only arrays static const Don't populate the read-only arrays fraction_L_mapping and fraction_M_mapping on the stack but instead make them static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220307230055.168241-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/8250/8250_mtk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 988c7c00691008ea1daaa1235680a0da49dab4e8 Author: Jiri Slaby Date: Tue Mar 8 12:51:53 2022 +0100 serial: samsung_tty: do not unlock port->lock for uart_write_wakeup() The commit c15c3747ee32 (serial: samsung: fix potential soft lockup during uart write) added an unlock of port->lock before uart_write_wakeup() and a lock after it. It was always problematic to write data from tty_ldisc_ops::write_wakeup and it was even documented that way. We fixed the line disciplines to conform to this recently. So if there is still a missed one, we should fix them instead of this workaround. On the top of that, s3c24xx_serial_tx_dma_complete() in this driver still holds the port->lock while calling uart_write_wakeup(). So revert the wrap added by the commit above. Cc: Thomas Abraham Cc: Kyungmin Park Cc: Hyeonkook Kim Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220308115153.4225-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 4f6f194f2be43c1df9ad031de86cdaffa5c8084d Author: Jiri Slaby Date: Mon Mar 7 06:43:47 2022 +0100 tty: serial: serial_txx9: remove struct uart_txx9_port It's only a wrapper to struct uart_port, so unwrap the whole code. No change in functionality is intended. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220307054348.31748-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/serial_txx9.c | 364 ++++++++++++++++++--------------------- 1 file changed, 167 insertions(+), 197 deletions(-) commit ab818c7aa7544bf8d2dd4bdf68878b17a02eb332 Author: Randy Dunlap Date: Tue Mar 8 19:30:18 2022 -0800 kgdboc: fix return value of __setup handler __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) environment strings. So return 1 from kgdboc_option_setup(). Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc7 kgdboc=kbd kgdbts=", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc7 kgdboc=kbd kgdbts= Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Fixes: 1bd54d851f50 ("kgdboc: Passing ekgdboc to command line causes panic") Fixes: f2d937f3bf00 ("consoles: polling support, kgdboc") Cc: He Zhe Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: kgdb-bugreport@lists.sourceforge.net Cc: Jason Wessel Cc: Daniel Thompson Cc: Douglas Anderson Cc: linux-serial@vger.kernel.org Reported-by: Igor Zhbanov Reviewed-by: Douglas Anderson Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20220309033018.17936-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/kgdboc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 53819a0d97aace1425bb042829e3446952a9e8a9 Author: Randy Dunlap Date: Mon Mar 7 18:42:28 2022 -0800 tty: hvc: fix return value of __setup handler __setup() handlers should return 1 to indicate that the boot option has been handled or 0 to indicate that it was not handled. Add a pr_warn() message if the option value is invalid and then always return 1. Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Fixes: 86b40567b917 ("tty: replace strict_strtoul() with kstrtoul()") Cc: Jingoo Han Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Michael Ellerman Cc: Julian Wiedmann Cc: Vasily Gorbik Cc: linuxppc-dev@lists.ozlabs.org Reported-by: Igor Zhbanov Signed-off-by: Randy Dunlap Link: https://lore.kernel.org/r/20220308024228.20477-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman drivers/tty/hvc/hvc_iucv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 0066472de157439d58454f4a55786f1045ea5681 Author: Wesley Cheng Date: Tue Mar 15 18:13:58 2022 -0700 usb: dwc3: Issue core soft reset before enabling run/stop It is recommended by the Synopsis databook to issue a DCTL.CSftReset when reconnecting from a device-initiated disconnect routine. This resolves issues with enumeration during fast composition switching cases, which result in an unknown device on the host. Reviewed-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220316011358.3057-1-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/core.c | 4 +--- drivers/usb/dwc3/core.h | 2 ++ drivers/usb/dwc3/gadget.c | 11 +++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) commit 5cd601e699f798dcf3017632f33c6bff4eeee2f8 Author: Linyu Yuan Date: Tue Mar 15 16:42:31 2022 +0800 usb: gadget: Makefile: remove ccflags-y No header file used from udc directory, so remove line below ccflags-y += -I$(srctree)/drivers/usb/gadget/udc. Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1647333751-32367-1-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/Makefile | 1 - 1 file changed, 1 deletion(-) commit 1892bf90677abcad7f06e897e308f5c3e3618dd4 Author: Alan Stern Date: Thu Mar 17 16:39:10 2022 -0400 USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c The kernel test robot found a problem with the ene_ub6250 subdriver in usb-storage: It uses structures containing bitfields to represent hardware bits in its SD_STATUS, MS_STATUS, and SM_STATUS bytes. This is not safe; it presumes a particular bit ordering and it assumes the compiler will not insert padding, neither of which is guaranteed. This patch fixes the problem by changing the structures to simple u8 values, with the bitfields replaced by bitmask constants. CC: Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YjOcbuU106UpJ/V8@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman drivers/usb/storage/ene_ub6250.c | 155 +++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 79 deletions(-) commit 6653b827613aa301de691842c38f01e874604f88 Author: Randy Dunlap Date: Wed Mar 16 12:20:07 2022 -0700 usb: gadget: eliminate anonymous module_init & module_exit Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: bd25a14edb75 ("usb: gadget: legacy/serial: allow dynamic removal") Fixes: 7bb5ea54be47 ("usb gadget serial: use composite gadget framework") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Randy Dunlap Reviewed-by: Ira Weiny Cc: Felipe Balbi Cc: Michał Mirosław Cc: Sebastian Andrzej Siewior Cc: linux-usb@vger.kernel.org Link: https://lore.kernel.org/r/20220316192010.19001-7-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/legacy/inode.c | 8 ++++---- drivers/usb/gadget/legacy/serial.c | 10 +++++----- drivers/usb/gadget/udc/dummy_hcd.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) commit 393dcd1f2b75e50783c805814a96bf6c8e11fe03 Author: Randy Dunlap Date: Wed Mar 16 12:20:08 2022 -0700 usb: usbip: eliminate anonymous module_init & module_exit Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 80fd9cd52de6 ("usbip: vudc: Add VUDC main file") Signed-off-by: Randy Dunlap Cc: Krzysztof Opasiak Cc: Igor Kotrasinski Cc: Valentina Manea Cc: Shuah Khan Cc: Shuah Khan Cc: linux-usb@vger.kernel.org Link: https://lore.kernel.org/r/20220316192010.19001-8-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman drivers/usb/usbip/vudc_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 6aec3bfe38e37363e32e5cf20ceb2ea0c4f99672 Merge: cc6ce5ac2c99 286f950545e0 Author: Greg Kroah-Hartman Date: Fri Mar 18 12:49:10 2022 +0100 Merge tag 'coresight-next-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux into char-misc-next Suzuki writes: coresight: changes for v5.18 The coresight update for v5.18 includes - TRBE erratum workarounds for Arm Cortex-A510 - Fixes for leaking root namespace PIDs into non-root namespace trace sessions - Miscellaneous fixes and cleanups Updated tag to reflect missing committer s-o-b tags. Signed-off-by: Suzuki K Poulose * tag 'coresight-next-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux: coresight: Drop unused 'none' enum value for each component coresight: etm3x: Don't trace PID for non-root PID namespace coresight: etm4x: Don't trace PID for non-root PID namespace coresight: etm4x: Don't use virtual contextID for non-root PID namespace coresight: etm4x: Add lock for reading virtual context ID comparator coresight: trbe: Move check for kernel page table isolation from EL0 to probe coresight: no-op refactor to make INSTP0 check more idiomatic hwtracing: coresight: Replace acpi_bus_get_device() coresight: syscfg: Fix memleak on registration failure in cscfg_create_device coresight: Fix TRCCONFIGR.QE sysfs interface coresight: trbe: Work around the trace data corruption coresight: trbe: Work around the invalid prohibited states coresight: trbe: Work around the ignored system register writes commit cc6ce5ac2c998d7e869d7289736e0097ce7d2ad1 Merge: d6cd2f85931f 0bf126163c3e Author: Greg Kroah-Hartman Date: Fri Mar 18 12:41:32 2022 +0100 Merge tag 'iio-for-5.18a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: First set of new device support, fixes, cleanups and features for IIO in 5.18 This cycle we had quite a few series that applied similar changes to lots of drivers. To keep this description manageable I have called those out in their own section rather than per driver. Particularly pleased to see the long running AFE precision series going in this cycle. Series includes some late breaking fixes. New device support * adi,ada4250 amplifier - New driver and dt bindings for this programmable gain amplifier. * adi,admv1014 microwave down-converter - New driver, dt bindings and some device specific ABI that may be generalized as more drivers for devices similar to this are added. * adi,admv4420 K Band down-converter. - New driver and dt bindings. * adi,adxl367 accelerometer driver. - New driver, dt-bindings + some new IIO ABI definitions to support reference magnitude events where an estimate of the acceleration due to gravity has been removed. - A few fixes as follow up patches. * adi,ltc2688 DAC with toggle and dither modes. - New driver and bindings. Includes some new driver specific (for now) ABI for handling toggle mode and the addition of a dither waveform to the DAC output. * AFE (analog front end) add support for additional types of analog device in front of an ADC. - RTD temperature sensors with dt bindings. - Temperature transducers wit dt bindings. - Related cleanup and features listed in other sections below. * maxim,ds3502 potentiometer. - Add support to ds1803 driver which required significant rework. * mediatek,mt2701-auxadc driver - Add mediatek,mt8186-auxadc - id table and chip specific info only. * semtech,sx9324, semtech,ax9360 - Substantial refactoring of sx9310 to extract core logic for reuse into a separate module - New driver using this supporting sx9324 proximity sensors. - New driver using this supporting sx9360 proximity sensors. * silan,sc7a20 - Compatible with the st,lis2dh (or nearly anyway) so add ID and chip specific info to enable support. Also silan vendor ID added for dt-bindings. Staging graduation * adi,ad7280a monitoring ADC for stacked lithium-ion batteries in electric cars and similar. - Substantial rework of driver required to bring inline with current IIO best practice. An unusual device in IIO so some interesting features we may see more of in future. Multiple driver/core cleanup - Use sysfs_emit() in simple locations where there is no path to change to various core created attributes. - Trivial white space fixes around inconsistency between space after { and before } in id tables. - Introduce new handling for fractional types to avoid repeated similar implementations. Use this in 3 drivers. Note this is also targeted at future use in the AFE driver and was motivated by discussions around the precision related work on that driver. - of related header cleanups - drop of*.h and add mod_devicetable.h as appropriate. - Move a number of symbol exports into IIO_* namespaces. Two categories, 1) Library used by multiple drivers e.g. st_sensors 2) Core driver module exporting functions used by bus specific modules. A few related cleanups in this set. - Switch from CONFIG_PM_* guards to new DEFINE_SIMPLE_DEV_PM_OPS() and similar to simplify drivers and take advantage of these new macros allowing the compiler to do the job or removing unused code without the need for __maybe_unused markings. Conversion of other drivers to these new macros ongoing. Features * adi,adf4350 - Switch from of specific to generic device properties enabling use with other firmware types. * adi,adx345 - Switch from of specific to generic device properties. - Add ACPI ID ADS0345 - Related driver cleanup. * adi,hmc425a - Switch from of specific to generic device properties. * afe analog rescaler driver - Wider range of types supported for scale. - Support offset. - Kunit tests. * atlas,ezo-sensor - Convert from of to device properties. * fsl,mma8452 - Support mount matrix. * infineon,dps310: - Add ACPI ID IFX3100. * invensense,mpu6050 - Convert to generic device properties. * maxim,ds1803 - Add out_raw_available before supporting more devices. - Convert from of specific to device properties. * samsung,ssp_sensors - Convert from of specific to device properties. * st,stm32-timer trigger - Convert from of specific to device properties. * ti,hdc101x - Add ACPI ID TXNW1010. * ti,tsc2046: - Add read_raw support to enable use of iio_hwmon and similar. Fixes / cleanup. * mailmap - Update for Cai Huoqing * MAINTAINERS - Fix Analog Devices related links. - Add entry for ADRF6780 - Add entry for ADMV1013 - Add entry for AD7293 - Add entry for ADMV8818 - Update files listed for adis-lib * iio core: - Fix wrong comment about current_mode being something a driver should ever access. - Use struct_size() rather than open coding in industrialio-hw-consumer * adi,axl355 - Use units.h definitions instead of local versions. * adi,adis-lib - Simplify *updated_bits() macro - Whitespace cleanup. * afe - Note many of these fixes only apply to particular configurations so the problems have probably not been seen in the wild, but will be visible with new usecases enabled this cycle. - Fix application of consumer scale for IIO_VAL_INT. - Apply a scale of 1 when no scale is provided. - Make best effort to establish a valid offset value for fractional cases. - Use s64 for scale calculations where parameters may be signed. - Tidy up include order. - Improve accuracy for small fractional sales - Reduce risk of integer overflow. * ams,as3935 - Use devm_delayed_work_autocancel() to replace open coded equivalent. * aspeed,adc - Fix wrong use of divider flag. * atmel,sama5d2-adc - Relax atmel,trigger-edge-type to optional. - Drop Ludovic Desroches from listed maintainers of the dt-binding inline with previous MAINTAINERS entry update. * fsl,mma8452 - Fix probing when i2c_device_id used. - dev_get_drvdata() on the iio_dev->dev, no longer returns iio_dev. Use dev_to_iio_dev() instead. Note the original path in here worked more by luck than design. * invensense,mpu6050 - Drop ACPI_PTR() protection to avoid an unused warning. - Use fact ACPI_COMPANION() returns null when ACPI_HANDLE() does to simplify handling. * motorola,cpcap-adc - Drop unused assignment. * qcom,spmi-adc - Fix wrong example of 'reg' in binding document. * renesas,rzg2l-adc - Trivial typo fix. * semtech,sx9360 - Fix wrong register handling for event generation. * st_sensors - Allow manual disabling of I2C or SPI module if not needed for a particular board. Default is still to enable the bus specific module if appropriate bus is supported. * st,lsm6dsx - dev_get_drvdata() on the iio_dev->dev, no longer returns iio_dev. Use dev_to_iio_dev() instead. * ti,palmas-gpadc - Split the interrupt fields in the dt-binding example * ti,tsc2046 - Rework state machine to improve readability after recent debugging of an issue fixed elsewhere. - Add a sanity check to avoid very large memory allocations if a crazy delay is specified. * ti,twl6030 - Add error handling if devm_request_threaded_irq() fails. * xilinx,ams - Use devm_delayed_work_autocancel() instead of open coding equivalent. - Fix missing required clock entry in dt-binding. - Fix miss counting of channels resulting in ps channels not being enabled. - Fix incorrect values written to sequencer registers. - Fix sequence for single channel reading. * tag 'iio-for-5.18a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (245 commits) iio: adc: xilinx-ams: Fix single channel switching sequence iio: adc: xilinx-ams: Fixed wrong sequencer register settings iio: adc: xilinx-ams: Fixed missing PS channels dt-bindings: iio: adc: zynqmp_ams: Add clock entry iio: accel: mma8452: use the correct logic to get mma8452_data iio: adc: aspeed: Add divider flag to fix incorrect voltage reading. iio: imu: st_lsm6dsx: use dev_to_iio_dev() to get iio_dev struct dt-bindings: iio: Add ltc2688 documentation iio: ABI: add ABI file for the LTC2688 DAC iio: dac: add support for ltc2688 dt-bindings: iio: afe: add bindings for temperature transducers dt-bindings: iio: afe: add bindings for temperature-sense-rtd iio: afe: rescale: add temperature transducers iio: afe: rescale: add RTD temperature sensor support iio: test: add basic tests for the iio-rescale driver iio: afe: rescale: reduce risk of integer overflow iio: afe: rescale: fix accuracy for small fractional scales iio: afe: rescale: add offset support iio: afe: rescale: add INT_PLUS_{MICRO,NANO} support iio: afe: rescale: expose scale processing function ... commit b49f72e7f96d4ed147447428f2ae5b4cea598ca7 Author: Mark Pearson Date: Thu Mar 17 17:40:08 2022 -0400 platform/x86: think-lmi: Certificate authentication support Implementation of certificate authentication feature for Lenovo platforms. This allows for signed updates of BIOS settings. Functionality supported: - Cert support available check. At initialisation check if BIOS supports certification authentication and if a certificate is installed. Enable the sysfs nodes appropriately - certificate and signature authentication attributes to enable a user to install, update and delete a certificate using signed signatures - certificate_thumbprint to confirm installed certificate details - support to go from certificate to password based authentication - signature and save_signature attributes needed for setting BIOS attributes using certificate authentication. Tested on X1 Carbon G10 and X1 Yoga G7. This feature is not generally available yet but will be released later this year. Note, I also cleaned up the formating of the GUIDs when I was adding the new defines. Hope that's OK to combine in this commit. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220317214008.3459-2-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/think-lmi.c | 520 +++++++++++++++++++++++++++++++-------- drivers/platform/x86/think-lmi.h | 5 + 2 files changed, 421 insertions(+), 104 deletions(-) commit 54f586a9153201c6cff55e1f561990c78bd99aa7 Author: Johannes Berg Date: Wed Mar 16 21:27:51 2022 +0100 rfkill: make new event layout opt-in Again new complaints surfaced that we had broken the ABI here, although previously all the userspace tools had agreed that it was their mistake and fixed it. Yet now there are cases (e.g. RHEL) that want to run old userspace with newer kernels, and thus are broken. Since this is a bit of a whack-a-mole thing, change the whole extensibility scheme of rfkill to no longer just rely on the message lengths, but instead require userspace to opt in via a new ioctl to a given maximum event size that it is willing to understand. By default, set that to RFKILL_EVENT_SIZE_V1 (8), so that the behaviour for userspace not calling the ioctl will look as if it's just running on an older kernel. Fixes: 14486c82612a ("rfkill: add a reason to the HW rfkill state") Cc: stable@vger.kernel.org # 5.11+ Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220316212749.16491491b270.Ifcb1950998330a596f29a2a162e00b7546a1d6d0@changeid include/uapi/linux/rfkill.h | 14 +++++++++++-- net/rfkill/core.c | 48 ++++++++++++++++++++++++++++++++------------- 2 files changed, 46 insertions(+), 16 deletions(-) commit 06384573a3e8335ac6797577e545c33dbf91b490 Author: Mark Pearson Date: Thu Mar 17 17:40:07 2022 -0400 Documentation: syfs-class-firmware-attributes: Lenovo Certificate support Certificate based authentication is available as an alternative to password based authentication. The WMI commands are cryptographically signed using a separate signing server and will be verified by the BIOS before being accepted. This commit details the fields that are needed to support that implementation. At present the changes are intended for Lenovo platforms, but have been designed to keep them as flexible as possible for future implementations from other vendors. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220317214008.3459-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede .../ABI/testing/sysfs-class-firmware-attributes | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) commit 0c2c21a1fa5b7612fa874b08252e06b34aa4e14a Author: Mario Limonciello Date: Thu Mar 17 14:03:01 2022 -0500 platform/x86: amd-pmc: Only report STB errors when STB enabled Currently if STB is disabled but an earlier function reported an error an incorrect error will be emitted about failing to write to STB. Correct this logic error by only showing errors when STB is enabled. Suggested-by: Hans de Goede Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220317190301.6818-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/amd-pmc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) commit 3364c0ef8732694084f8238ffd9c62819209fd7f Author: Jan Dabros Date: Mon Mar 14 10:03:23 2022 +0100 i2c: designware: Remove code duplication Simplify code by moving common part to one function. Signed-off-by: Jan Dabros Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-designware-amdpsp.c | 35 +++++++++++++----------------- 1 file changed, 15 insertions(+), 20 deletions(-) commit 4fa331b45da29765542ed3947d94e12615d298b5 Merge: 551acdc3c3d2 4c905f6740a3 Author: David S. Miller Date: Fri Mar 18 10:33:47 2022 +0000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Fix PPPoE and QinQ with flowtable inet family. 2) Missing register validation in nf_tables. 3) Initialize registers to avoid stack memleak to userspace. ==================== Signed-off-by: David S. Miller commit 5edce151386e90267c1713bea682fce31e5ceb09 Merge: 3e66fd54aeac 770c9a3a01af Author: David S. Miller Date: Fri Mar 18 10:30:00 2022 +0000 Merge tag 'mlx5-updates-2022-03-17' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2022-03-17 1) From Maxim Mikityanskiy, Datapath improvements in preparation for XDP multi buffer This series contains general improvements for the datapath that are useful for the upcoming XDP multi buffer support: a. Non-linear legacy RQ: validate MTU for robustness, build the linear part of SKB over the first hardware fragment (instead of copying the packet headers), adjust headroom calculations to allow enabling headroom in the non-linear mode (useful for XDP multi buffer). b. XDP: do the XDP program test before function call, optimize parameters of mlx5e_xdp_handle. 2) From Rongwei Liu, DR, reduce steering memory usage Currently, mlx5 driver uses mlx5_htbl/chunk/ste to organize steering logic. However there is a little memory waste. This update targets to reduce steering memory footprint by: a. Adjust struct member layout. b. Remove duplicated indicator by using simple functions call. With 500k TX rules(3 ste) plus 500k RX rules(6 stes), these patches can save around 17% memory. 3) Three cleanup commits at the end of this series. =================== Signed-off-by: David S. Miller commit d14eb80e27795b7b20060f7b151cdfe39722a813 Author: Daniel Mack Date: Thu Mar 17 23:55:37 2022 +0100 drm/panel: ili9341: fix optional regulator handling If the optional regulator lookup fails, reset the pointer to NULL. Other functions such as mipi_dbi_poweron_reset_conditional() only do a NULL pointer check and will otherwise dereference the error pointer. Fixes: 5a04227326b04c15 ("drm/panel: Add ilitek ili9341 panel driver") Signed-off-by: Daniel Mack Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220317225537.826302-1-daniel@zonque.org drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit ab487a4cdfca3d1ef12795a49eafe1144967e617 Author: David Howells Date: Mon Feb 14 14:11:25 2022 +0000 afs: Maintain netfs_i_context::remote_i_size Make afs use netfslib's tracking for the server's idea of what the current inode size is independently of inode->i_size. We really want to use this value when calculating the new vnode size when initiating a StoreData RPC op rather than the size stat() presents to the user (ie. inode->i_size) as the latter is affected by as-yet uncommitted writes. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/164623014626.3564931.8375344024648265358.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678220204.1200972.17408022517463940584.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692923592.2099075.5466132542956550401.stgit@warthog.procyon.org.uk/ # v3 fs/afs/inode.c | 1 + fs/afs/write.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) commit 4058f742105ecfcbdf99e1139e6c1f74fb8e6db9 Author: David Howells Date: Fri Nov 5 13:55:38 2021 +0000 netfs: Keep track of the actual remote file size Provide a place in which to keep track of the actual remote file size in the netfs context. This is needed because inode->i_size will be updated as we buffer writes in the pagecache, but the server file size won't get updated until we flush them back. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164623013727.3564931.17659955636985232717.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678219305.1200972.6459431995188365134.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692921865.2099075.5310757978508056134.stgit@warthog.procyon.org.uk/ # v3 include/linux/netfs.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit b900f4b89b4d44aa1a79111763b6dfab51e5e3af Author: David Howells Date: Tue Mar 1 15:25:00 2022 +0000 netfs: Split some core bits out into their own file Split some core bits out into their own file. More bits will be added to this file later. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164623006934.3564931.17932680017894039748.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678218407.1200972.1731208226140990280.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692920944.2099075.11990502173226013856.stgit@warthog.procyon.org.uk/ # v3 fs/netfs/Makefile | 1 + fs/netfs/internal.h | 7 +++++-- fs/netfs/io.c | 10 ---------- fs/netfs/main.c | 20 ++++++++++++++++++++ 4 files changed, 26 insertions(+), 12 deletions(-) commit 16211268fcb36672a84359362c2fc2c4695b0fc4 Author: David Howells Date: Tue Mar 1 14:35:58 2022 +0000 netfs: Split fs/netfs/read_helper.c Split fs/netfs/read_helper.c into two pieces, one to deal with buffered writes and one to deal with the I/O mechanism. Changes ======= ver #2) - Add kdoc reference to new file. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164623005586.3564931.6149556072728481767.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678217075.1200972.5101072043126828757.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692919953.2099075.7156989585513833046.stgit@warthog.procyon.org.uk/ # v3 fs/netfs/Makefile | 1 + fs/netfs/buffered_read.c | 428 +++++++++++++++++++++++++++++++++++++++++++++++ fs/netfs/io.c | 418 --------------------------------------------- 3 files changed, 429 insertions(+), 418 deletions(-) commit 3be01750d7ac5803ad6fa76801d4d80b3814229f Author: David Howells Date: Mon Mar 7 21:57:24 2022 +0000 netfs: Rename read_helper.c to io.c Rename the read_helper.c file to io.c before splitting out the buffered read functions and some other bits. Changes ======= ver #2) - Rename read_helper.c before splitting. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164678216109.1200972.16567696909952495832.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692918076.2099075.8120961172717347610.stgit@warthog.procyon.org.uk/ # v3 Documentation/filesystems/netfs_library.rst | 3 ++- fs/netfs/Makefile | 4 ++-- fs/netfs/internal.h | 14 +++++++------- fs/netfs/{read_helper.c => io.c} | 0 4 files changed, 11 insertions(+), 10 deletions(-) commit 93345c3ba55f62f6b7189cdab354c7293fd45d75 Author: David Howells Date: Tue Mar 1 15:55:15 2022 +0000 netfs: Prepare to split read_helper.c Rename netfs_rreq_unlock() to netfs_rreq_unlock_folios() to make it sound less like it's dropping a lock on an netfs_io_request struct. Remove the 'static' marker on netfs_rreq_unlock_folios() and declaring it in internal.h preparatory to splitting the file. Changes ======= ver #2) - Slide this patch to after the one adding netfs_begin_read(). - As a consequence, don't need to unstatic so many functions. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164623002861.3564931.17340149482236413375.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678215208.1200972.9761906209395002182.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692912709.2099075.4349905992838317797.stgit@warthog.procyon.org.uk/ # v3 fs/netfs/internal.h | 5 +++++ fs/netfs/read_helper.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) commit 4090b31422a6f24dfe701e31ffec7ba5804a7e2f Author: David Howells Date: Wed Mar 2 10:50:22 2022 +0000 netfs: Add a function to consolidate beginning a read Add a function to do the steps needed to begin a read request, allowing this code to be removed from several other functions and consolidated. Changes ======= ver #2) - Move before the unstaticking patch so that some functions can be left static. - Set uninitialised return code in netfs_begin_read()[1][2]. - Fixed a refleak caused by non-removal of a get from netfs_write_begin() when the request submission code got moved to netfs_begin_read(). - Use INIT_WORK() to (re-)init the request work_struct[3]. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/20220303163826.1120936-1-nathan@kernel.org/ [1] Link: https://lore.kernel.org/r/20220303235647.1297171-1-colin.i.king@gmail.com/ [2] Link: https://lore.kernel.org/r/9d69be49081bccff44260e4c6e0049c63d6d04a1.camel@redhat.com/ [3] Link: https://lore.kernel.org/r/164623004355.3564931.7275693529042495641.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678214287.1200972.16734134007649832160.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692911113.2099075.1060868473229451371.stgit@warthog.procyon.org.uk/ # v3 fs/netfs/internal.h | 2 +- fs/netfs/objects.c | 1 - fs/netfs/read_helper.c | 144 +++++++++++++++++++++---------------------- include/trace/events/netfs.h | 5 +- 4 files changed, 76 insertions(+), 76 deletions(-) commit bc899ee1c898e520574ff4d99356eb2e724a9265 Author: David Howells Date: Tue Jun 29 22:37:05 2021 +0100 netfs: Add a netfs inode context Add a netfs_i_context struct that should be included in the network filesystem's own inode struct wrapper, directly after the VFS's inode struct, e.g.: struct my_inode { struct { /* These must be contiguous */ struct inode vfs_inode; struct netfs_i_context netfs_ctx; }; }; The netfs_i_context struct so far contains a single field for the network filesystem to use - the cache cookie: struct netfs_i_context { ... struct fscache_cookie *cache; }; Three functions are provided to help with this: (1) void netfs_i_context_init(struct inode *inode, const struct netfs_request_ops *ops); Initialise the netfs context and set the operations. (2) struct netfs_i_context *netfs_i_context(struct inode *inode); Find the netfs context from the VFS inode. (3) struct inode *netfs_inode(struct netfs_i_context *ctx); Find the VFS inode from the netfs context. Changes ======= ver #4) - Fix netfs_is_cache_enabled() to check cookie->cache_priv to see if a cache is present[3]. - Fix netfs_skip_folio_read() to zero out all of the page, not just some of it[3]. ver #3) - Split out the bit to move ceph cap-getting on readahead into ceph_init_request()[1]. - Stick in a comment to the netfs inode structs indicating the contiguity requirements[2]. ver #2) - Adjust documentation to match. - Use "#if IS_ENABLED()" in netfs_i_cookie(), not "#ifdef". - Move the cap check from ceph_readahead() to ceph_init_request() to be called from netfslib. - Remove ceph_readahead() and use netfs_readahead() directly instead. Signed-off-by: David Howells Acked-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/8af0d47f17d89c06bbf602496dd845f2b0bf25b3.camel@kernel.org/ [1] Link: https://lore.kernel.org/r/beaf4f6a6c2575ed489adb14b257253c868f9a5c.camel@kernel.org/ [2] Link: https://lore.kernel.org/r/3536452.1647421585@warthog.procyon.org.uk/ [3] Link: https://lore.kernel.org/r/164622984545.3564931.15691742939278418580.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678213320.1200972.16807551936267647470.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692909854.2099075.9535537286264248057.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/306388.1647595110@warthog.procyon.org.uk/ # v4 Documentation/filesystems/netfs_library.rst | 101 ++++++++++++++++++++-------- fs/9p/cache.c | 10 ++- fs/9p/v9fs.c | 4 +- fs/9p/v9fs.h | 13 ++-- fs/9p/vfs_addr.c | 43 ++---------- fs/9p/vfs_inode.c | 13 +++- fs/afs/dynroot.c | 1 + fs/afs/file.c | 26 +------ fs/afs/inode.c | 31 ++++++--- fs/afs/internal.h | 19 ++++-- fs/afs/super.c | 4 +- fs/afs/write.c | 3 +- fs/ceph/addr.c | 31 ++------- fs/ceph/cache.c | 28 ++++---- fs/ceph/cache.h | 11 +-- fs/ceph/inode.c | 6 +- fs/ceph/super.h | 17 +++-- fs/cifs/cifsglob.h | 10 +-- fs/cifs/fscache.c | 11 +-- fs/cifs/fscache.h | 2 +- fs/netfs/internal.h | 18 ++++- fs/netfs/objects.c | 12 ++-- fs/netfs/read_helper.c | 100 +++++++++++++-------------- fs/netfs/stats.c | 1 - include/linux/netfs.h | 81 +++++++++++++++++++--- 25 files changed, 318 insertions(+), 278 deletions(-) commit a5c9dc4451394b2854493944dcc0ff71af9705a3 Author: David Howells Date: Wed Mar 9 21:45:22 2022 +0000 ceph: Make ceph_init_request() check caps on readahead Move the caps check from ceph_readahead() to ceph_init_request(), conditional on the origin being NETFS_READAHEAD so that in a future patch, ceph can point its ->readahead() vector directly at netfs_readahead(). Changes ======= ver #4) - Move the check for NETFS_READAHEAD up in ceph_init_request()[2]. ver #3) - Split from the patch to add a netfs inode context[1]. - Need to store the caps got in rreq->netfs_priv for later freeing. Signed-off-by: David Howells cc: ceph-devel@vger.kernel.org cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/8af0d47f17d89c06bbf602496dd845f2b0bf25b3.camel@kernel.org/ [1] Link: https://lore.kernel.org/r/dd054c962818716e718bd9b446ee5322ca097675.camel@redhat.com/ [2] Link: https://lore.kernel.org/r/164692907694.2099075.10081819855690054094.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/2533821.1647006574@warthog.procyon.org.uk/ # v4 fs/ceph/addr.c | 69 ++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 28 deletions(-) commit 2de160417315b8d64455fe03e9bb7d3308ac3281 Author: David Howells Date: Thu Jan 20 21:55:46 2022 +0000 netfs: Change ->init_request() to return an error code Change the request initialisation function to return an error code so that the network filesystem can return a failure (ENOMEM, for example). This will also allow ceph to abort a ->readahead() op if the server refuses to give it a cap allowing local caching from within the netfslib framework (errors aren't passed back through ->readahead(), so returning, say, -ENOBUFS will cause the op to be aborted). Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164678212401.1200972.16537041523832944934.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692905398.2099075.5238033621684646524.stgit@warthog.procyon.org.uk/ # v3 fs/9p/vfs_addr.c | 3 ++- fs/afs/file.c | 3 ++- fs/netfs/objects.c | 41 ++++++++++++++++++++++++----------------- fs/netfs/read_helper.c | 20 ++++++++++++-------- include/linux/netfs.h | 2 +- 5 files changed, 41 insertions(+), 28 deletions(-) commit 663dfb65c3b3ea4b8e1944680352992d58f3aa22 Author: David Howells Date: Thu Aug 26 09:24:42 2021 -0400 netfs: Refactor arguments for netfs_alloc_read_request Pass start and len to the rreq allocator. This should ensure that the fields are set so that ->init_request() can use them. Also add a parameter to indicates the origin of the request. Ceph can use this to tell whether to get caps. Changes ======= ver #3) - Change the author to me as Jeff feels that most of the patch is my changes now. ver #2) - Show the request origin in the netfs_rreq tracepoint. Signed-off-by: Jeff Layton Co-developed-by: David Howells Signed-off-by: David Howells cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164622989020.3564931.17517006047854958747.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678208569.1200972.12153682697842916557.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692904155.2099075.14717645623034355995.stgit@warthog.procyon.org.uk/ # v3 fs/netfs/internal.h | 7 +++++-- fs/netfs/objects.c | 13 ++++++++++--- fs/netfs/read_helper.c | 23 +++++++++++------------ include/linux/netfs.h | 7 +++++++ include/trace/events/netfs.h | 11 ++++++++++- 5 files changed, 43 insertions(+), 18 deletions(-) commit 5c88705e2aeaee5521b8586e68bef47aab359914 Author: David Howells Date: Fri Feb 25 16:24:03 2022 +0000 netfs: Adjust the netfs_failure tracepoint to indicate non-subreq lines Adjust the netfs_failure tracepoint to indicate a subrequest number of -1 when it's a full-request failure unrelated to any particular subrequest, such as a failure to encrypt its data buffer. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164623001948.3564931.2353852999649380059.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678204587.1200972.14893513018190383961.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692903233.2099075.15414355147237641274.stgit@warthog.procyon.org.uk/ # v3 include/trace/events/netfs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 6cd3d6fd1fe2feae5ff9f6a821081569bb140bf4 Author: David Howells Date: Thu Feb 17 15:01:24 2022 +0000 netfs: Trace refcounting on the netfs_io_subrequest struct Add refcount tracing for the netfs_io_subrequest structure. Changes ======= ver #3) - Switch 'W=' to 'R=' in the traceline to match other request debug IDs. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164622998584.3564931.5052255990645723639.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678202603.1200972.14726007419792315578.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692901860.2099075.4845820886851239935.stgit@warthog.procyon.org.uk/ # v3 fs/netfs/internal.h | 2 -- fs/netfs/objects.c | 32 +++++++++++++++++++++++--------- fs/netfs/read_helper.c | 20 +++++++++++--------- include/linux/netfs.h | 8 +++++++- include/trace/events/netfs.h | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 81 insertions(+), 21 deletions(-) commit de74023befa1876f64bc5871a2a4a51850517118 Author: David Howells Date: Thu Feb 17 21:13:05 2022 +0000 netfs: Trace refcounting on the netfs_io_request struct Add refcount tracing for the netfs_io_request structure. Changes ======= ver #3) - Switch 'W=' to 'R=' in the traceline to match other request debug IDs. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164622997668.3564931.14456171619219324968.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678200943.1200972.7241495532327787765.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692900920.2099075.11847712419940675791.stgit@warthog.procyon.org.uk/ # v3 fs/netfs/internal.h | 11 +++++++++-- fs/netfs/objects.c | 24 +++++++++++++++++------- fs/netfs/read_helper.c | 14 +++++++------- include/linux/netfs.h | 2 +- include/trace/events/netfs.h | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 17 deletions(-) commit 18b3ff9fe8b857557fd02bfae0d91834b2c380ca Author: David Howells Date: Sat Feb 19 23:05:40 2022 +0000 netfs: Adjust the netfs_rreq tracepoint slightly Adjust the netfs_rreq tracepoint to include the origin of the request and to increase the size of the "what trace" output strings by a character so that "ENCRYPT" and "DECRYPT" will fit without abbreviation. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164622996715.3564931.4252319907990358129.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678199468.1200972.17275585970238114726.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692898684.2099075.12153225958137716567.stgit@warthog.procyon.org.uk/ # v3 fs/netfs/read_helper.c | 2 +- include/trace/events/netfs.h | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) commit 3a4a38e66d2443ab3c27a689c62a6937b854010e Author: David Howells Date: Thu Feb 17 13:30:38 2022 +0000 netfs: Split netfs_io_* object handling out Split netfs_io_* object handling out into a file that's going to contain object allocation, get and put routines. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164622995118.3564931.6089530629052064470.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678197044.1200972.11511937252083343775.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692894693.2099075.7831091294248735173.stgit@warthog.procyon.org.uk/ # v3 fs/netfs/Makefile | 6 ++- fs/netfs/internal.h | 18 ++++++++ fs/netfs/objects.c | 123 +++++++++++++++++++++++++++++++++++++++++++++++++ fs/netfs/read_helper.c | 118 +---------------------------------------------- 4 files changed, 147 insertions(+), 118 deletions(-) commit f18a378580a761c8559b7d90afaa157269559c05 Author: David Howells Date: Thu Feb 17 10:14:32 2022 +0000 netfs: Finish off rename of netfs_read_request to netfs_io_request Adjust helper function names and comments after mass rename of struct netfs_read_*request to struct netfs_io_*request. Changes ======= ver #2) - Make the changes in the docs also. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164622992433.3564931.6684311087845150271.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678196111.1200972.5001114956865989528.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692892567.2099075.13895804222087028813.stgit@warthog.procyon.org.uk/ # v3 Documentation/filesystems/netfs_library.rst | 4 +- fs/9p/vfs_addr.c | 6 +-- fs/afs/file.c | 4 +- fs/cachefiles/io.c | 4 +- fs/ceph/addr.c | 6 +-- fs/netfs/read_helper.c | 83 +++++++++++++++-------------- include/linux/netfs.h | 22 ++++---- 7 files changed, 65 insertions(+), 64 deletions(-) commit 6a19114b8e7f1e24d80b0812e26d78d7ae1ec6dd Author: David Howells Date: Thu Feb 17 10:01:23 2022 +0000 netfs: Rename netfs_read_*request to netfs_io_*request Rename netfs_read_*request to netfs_io_*request so that the same structures can be used for the write helpers too. perl -p -i -e 's/netfs_read_(request|subrequest)/netfs_io_$1/g' \ `git grep -l 'netfs_read_\(sub\|\)request'` perl -p -i -e 's/nr_rd_ops/nr_outstanding/g' \ `git grep -l nr_rd_ops` perl -p -i -e 's/nr_wr_ops/nr_copy_ops/g' \ `git grep -l nr_wr_ops` perl -p -i -e 's/netfs_read_source/netfs_io_source/g' \ `git grep -l 'netfs_read_source'` perl -p -i -e 's/netfs_io_request_ops/netfs_request_ops/g' \ `git grep -l 'netfs_io_request_ops'` perl -p -i -e 's/init_rreq/init_request/g' \ `git grep -l 'init_rreq'` Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164622988070.3564931.7089670190434315183.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678195157.1200972.366609966927368090.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692891535.2099075.18435198075367420588.stgit@warthog.procyon.org.uk/ # v3 Documentation/filesystems/netfs_library.rst | 40 +++--- fs/9p/vfs_addr.c | 16 +-- fs/afs/file.c | 12 +- fs/afs/internal.h | 4 +- fs/cachefiles/io.c | 6 +- fs/ceph/addr.c | 16 +-- fs/ceph/cache.h | 4 +- fs/netfs/read_helper.c | 194 ++++++++++++++-------------- include/linux/netfs.h | 42 +++--- include/trace/events/cachefiles.h | 6 +- include/trace/events/netfs.h | 14 +- 11 files changed, 177 insertions(+), 177 deletions(-) commit 5ac417d24c6cc2fa9ac69d8b9f4510a38ec40486 Author: David Howells Date: Wed Feb 2 15:12:44 2022 +0000 netfs: Generate enums from trace symbol mapping lists netfs has a number of lists of symbols for use in tracing, listed in an enum and then listed again in a symbol->string mapping for use with __print_symbolic(). This is, however, redundant. Instead, use the symbol->string mapping list to also generate the enum where the enum is in the same file. Changes ======= ver #3) - #undef EM and E_ at the end of the trace file[1]. Signed-off-by: David Howells Acked-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/c2f4b3dc107b106e04c48f54945a12715cccfdf3.camel@redhat.com/ [1] Link: https://lore.kernel.org/r/164622980839.3564931.5673300162465266909.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678192454.1200972.4428834328108580460.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/CALF+zOkB38_MB5QwNUtqTU4WjMaLUJ5+Piwsn3pMxkO3d4J7Kg@mail.gmail.com/ # v2 Link: https://lore.kernel.org/r/164692890614.2099075.12960653141802151575.stgit@warthog.procyon.org.uk/ # v3 include/trace/events/netfs.h | 59 ++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 43 deletions(-) commit e9b57aaae605eb869a628fdc21fe7d2c77a2205d Author: Jeffle Xu Date: Wed Feb 9 14:00:47 2022 +0800 fscache: export fscache_end_operation() Export fscache_end_operation() to avoid code duplication. Besides, considering the paired fscache_begin_read_operation() is already exported, it shall make sense to also export fscache_end_operation(). Signed-off-by: Jeffle Xu Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/20220302125134.131039-2-jefflexu@linux.alibaba.com/ # Jeffle's v4 Link: https://lore.kernel.org/r/164622971432.3564931.12184135678781328146.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/164678190346.1200972.7453733431978569479.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/164692888334.2099075.5166283293894267365.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/20220316131723.111553-2-jefflexu@linux.alibaba.com/ # v5 fs/cifs/fscache.c | 8 -------- fs/fscache/internal.h | 11 ----------- fs/nfs/fscache.c | 8 -------- include/linux/fscache.h | 14 ++++++++++++++ 4 files changed, 14 insertions(+), 27 deletions(-) commit 7a19006b60b129ce2cbe787f4f910dc0ec5a1ec6 Author: Greg Kroah-Hartman Date: Fri Mar 18 08:34:52 2022 +0100 kernfs: remove unneeded #if 0 guard Commit f2eb478f2f32 ("kernfs: move struct kernfs_root out of the public view.") moved kernfs_root out of kernfs.h, but my debugging code of a #if 0 was left in accidentally. Fix that up by removing the guards. Fixes: f2eb478f2f32 ("kernfs: move struct kernfs_root out of the public view.") Cc: Tejun Heo Reported-by: Al Viro Link: https://lore.kernel.org/r/20220318073452.1486568-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman include/linux/kernfs.h | 20 -------------------- 1 file changed, 20 deletions(-) commit 8931ddd8d6a55fcefb20f44a38ba42bb746f0b62 Author: Krzysztof Kozlowski Date: Thu Mar 17 12:52:59 2022 +0100 MIPS: ingenic: correct unit node address Unit node addresses should not have leading 0x: Warning (unit_address_format): /nemc@13410000/efuse@d0/eth-mac-addr@0x22: unit name should not have leading "0x" Signed-off-by: Krzysztof Kozlowski Reviewed-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer arch/mips/boot/dts/ingenic/jz4780.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a893b7fc7b59cdf3fae01335c86537bee4407edc Author: Elijah Harding Date: Thu Mar 17 18:52:01 2022 -0700 ALSA: core: Fix typo in 'PCM Timer Interface' help Signed-off-by: Elijah Harding Link: https://lore.kernel.org/r/20220318015201.30871-1-eharding830@gmail.com Signed-off-by: Takashi Iwai sound/core/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 864cb14c0fa22344613ae93d68e155bf9bbbc9fb Author: Kai-Heng Feng Date: Fri Mar 18 06:11:33 2022 +0800 ALSA: hda/realtek: Fix LED on Zbook Studio G9 Commit 07bcab93946c ("ALSA: hda/realtek: Add support for HP Laptops") breaks mute and micmute LEDs because it changed the LED quirk from ALC285_FIXUP_HP_GPIO_LED to ALC245_FIXUP_HP_GPIO_LED, so change it back here. Also reorder the chain of quirks to ensure LED quirk is the last one being applied. Fixes: 07bcab93946c ("ALSA: hda/realtek: Add support for HP Laptops") Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20220317221134.566358-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9b046d0245cec982c72a65d3ea1b834959a9708b Author: Helge Deller Date: Tue Nov 9 22:25:02 2021 +0100 parisc: Avoid using hardware single-step in kprobes This patch changes the kprobe and kretprobe feature to use another break instruction instead of relying on the hardware single-step feature. That way those kprobes now work in qemu as well, because in qemu we don't emulate yet single-stepping. Signed-off-by: Helge Deller arch/parisc/include/asm/kprobes.h | 5 +++-- arch/parisc/kernel/kprobes.c | 28 +++++++++++++++++----------- arch/parisc/kernel/traps.c | 10 ++++------ 3 files changed, 24 insertions(+), 19 deletions(-) commit c86868bbc22be9487d10d3c6336dd8ccb49e8a62 Author: Chao Yu Date: Thu Mar 17 16:33:15 2022 +0800 f2fs: initialize sbi->gc_mode explicitly It needs to initialized sbi->gc_mode to GC_NORMAL explicitly. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/super.c | 1 + 1 file changed, 1 insertion(+) commit 47aa866f248c89b319b99ac7b21a0a961ed2264a Author: Ming Qian Date: Mon Mar 14 06:28:55 2022 +0100 media: amphion: cleanup media device if register it fail there is issue that driver forget to call media_device_cleanup if media_device_register fail, it will led to memory leak. Also driver should check the return value of vpu_add_func. Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/amphion/vpu_drv.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit a9f7224c67b3357e6585e6ddbcabd0523ca0f39f Author: Ming Qian Date: Fri Mar 11 06:17:07 2022 +0100 media: amphion: fix some issues to improve robust fix some issues reported by Dan, 1. fix some signedness bug 2. don't use u32 as function return value 3. prevent a divide by zero bug 4. Just return zero on success, don't return a known parameter 5. check the validity of some variables 6. reset buffer state when return buffers 7. make sure the ALIGN won't wrap to zero Signed-off-by: Ming Qian Reported-by: Dan Carpenter Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/amphion/vpu_core.c | 2 +- drivers/media/platform/amphion/vpu_helpers.c | 13 +++--- drivers/media/platform/amphion/vpu_helpers.h | 6 +-- drivers/media/platform/amphion/vpu_imx8q.c | 2 +- drivers/media/platform/amphion/vpu_imx8q.h | 2 +- drivers/media/platform/amphion/vpu_malone.c | 63 ++++++++++++++++++---------- drivers/media/platform/amphion/vpu_msgs.c | 6 +-- drivers/media/platform/amphion/vpu_rpc.c | 4 +- drivers/media/platform/amphion/vpu_rpc.h | 9 +++- drivers/media/platform/amphion/vpu_v4l2.c | 8 +++- drivers/media/platform/amphion/vpu_windsor.c | 6 +++ 11 files changed, 78 insertions(+), 43 deletions(-) commit 05a03eff34ba7de2d3e50a92961850d5e0f14f34 Author: Ming Qian Date: Fri Mar 11 06:16:34 2022 +0100 media: amphion: fix some error related with undefined reference to __divdi3 1. use ns_to_timespec64 instead of division method 2. use timespec64_to_ns instead of custom macro 3. remove unused custom macro 4. don't modify minus timestamp 5. remove some unused debug timestamp information Signed-off-by: Ming Qian Reported-by: kernel test robot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/amphion/vdec.c | 35 ---------------------------- drivers/media/platform/amphion/vpu_helpers.h | 3 --- drivers/media/platform/amphion/vpu_malone.c | 18 +++++++------- drivers/media/platform/amphion/vpu_v4l2.c | 5 +--- drivers/media/platform/amphion/vpu_windsor.c | 18 +++++++------- 5 files changed, 19 insertions(+), 60 deletions(-) commit f445014a2291fbee864754dfec8df42e2a44eb91 Author: Ming Qian Date: Thu Mar 10 07:38:56 2022 +0100 media: amphion: fix an issue that using pm_runtime_get_sync incorrectly pm_runtime_get_sync() also returns 1 on success. The documentation for pm_runtime_get_sync() suggests using pm_runtime_resume_and_get() instead Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/amphion/vpu_core.c | 8 ++++---- drivers/media/platform/amphion/vpu_dbg.c | 2 +- drivers/media/platform/amphion/vpu_drv.c | 6 ------ 3 files changed, 5 insertions(+), 11 deletions(-) commit 298cf3dfacc971350be102ddb55bbc2916e32e34 Author: Yihao Han Date: Tue Mar 8 10:41:32 2022 +0100 media: vidtv: use vfree() for memory allocated with vzalloc() It is allocated with vzalloc(), the corresponding release function should not be kfree(), use vfree() instead. Generated by: scripts/coccinelle/api/kfree_mismatch.cocci Signed-off-by: Yihao Han Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/test-drivers/vidtv/vidtv_s302m.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4df312b9caf289db5fbeada69d44eaa6daeaae3a Author: Hans Verkuil Date: Tue Mar 8 09:42:29 2022 +0100 media: m5mols/m5mols.h: document new reset field The new reset field in struct m5mols_info was not documented, add this. This fixes a kerneldoc warning: drivers/media/i2c/m5mols/m5mols.h:244: warning: Function parameter or member 'reset' not described in 'm5mols_info' Signed-off-by: Hans Verkuil Fixes: aaaf357fa61c (media: m5mols: Convert to use GPIO descriptors) Reviewed-by: Linus Walleij Signed-off-by: Mauro Carvalho Chehab drivers/media/i2c/m5mols/m5mols.h | 1 + 1 file changed, 1 insertion(+) commit f1b7d5ffc257915d0baf58aa8515cf3f70c93c77 Author: Hans Verkuil Date: Tue Mar 8 09:25:56 2022 +0100 media: pixfmt-yuv-planar.rst: fix PIX_FMT labels Two labels used _ instead of - so were never found and one new PIX_FMT was missing the label altogether. This led to these warnings: Documentation/output/videodev2.h.rst:6: WARNING: undefined label: v4l2-pix-fmt-nv12m-8l128 Documentation/output/videodev2.h.rst:6: WARNING: undefined label: v4l2-pix-fmt-nv12m-10be-8l128 Documentation/output/videodev2.h.rst:6: WARNING: undefined label: v4l2-pix-fmt-mm21 Signed-off-by: Hans Verkuil Fixes: 72a74c8f0a0d ("media: add nv12m_8l128 and nv12m_10be_8l128 video format.") Reported-by: Stephen Rothwell Acked-by: Nicolas Dufresne Signed-off-by: Mauro Carvalho Chehab Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit b58b1f563ab78955d37e9e43e02790a85c66ac05 Author: Nicolas Dichtel Date: Mon Mar 14 11:38:22 2022 +0100 xfrm: rework default policy structure This is a follow up of commit f8d858e607b2 ("xfrm: make user policy API complete"). The goal is to align userland API to the internal structures. Signed-off-by: Nicolas Dichtel Reviewed-by: Antony Antony Signed-off-by: Steffen Klassert include/net/netns/xfrm.h | 6 +----- include/net/xfrm.h | 48 ++++++++++++++++++------------------------------ net/xfrm/xfrm_policy.c | 10 +++++++--- net/xfrm/xfrm_user.c | 43 ++++++++++++++++++------------------------- 4 files changed, 44 insertions(+), 63 deletions(-) commit 60911970b0163f28495d4d3d669d8f5803df8cf1 Merge: 5a5c11ee3e65 3cccbaa03321 Author: Andrii Nakryiko Date: Thu Mar 17 23:11:16 2022 -0700 Merge branch 'Subskeleton support for BPF librariesThread-Topic: [PATCH bpf-next v4 0/5' Delyan Kratunov says: ==================== In the quest for ever more modularity, a new need has arisen - the ability to access data associated with a BPF library from a corresponding userspace library. The catch is that we don't want the userspace library to know about the structure of the final BPF object that the BPF library is linked into. In pursuit of this modularity, this patch series introduces *subskeletons.* Subskeletons are similar in use and design to skeletons with a couple of differences: 1. The generated storage types do not rely on contiguous storage for the library's variables because they may be interspersed randomly throughout the final BPF object's sections. 2. Subskeletons do not own objects and instead require a loaded bpf_object* to be passed at runtime in order to be initialized. By extension, symbols are resolved at runtime by parsing the final object's BTF. 3. Subskeletons allow access to all global variables, programs, and custom maps. They also expose the internal maps *of the final object*. This allows bpf_var_skeleton objects to contain a bpf_map** instead of a section name. Changes since v3: - Re-add key/value type lookup for legacy user maps (fixing btf test) - Minor cleanups (missed sanitize_identifier call, error messages, formatting) Changes since v2: - Reuse SEC_NAME strict mode flag - Init bpf_map->btf_value_type_id on open for internal maps *and* user BTF maps - Test custom section names (.data.foo) and overlapping kconfig externs between the final object and the library - Minor review comments in gen.c & libbpf.c Changes since v1: - Introduced new strict mode knob for single-routine-in-.text compatibility behavior, which disproportionately affects library objects. bpftool works in 1.0 mode so subskeleton generation doesn't have to worry about this now. - Made bpf_map_btf_value_type_id available earlier and used it wherever applicable. - Refactoring in bpftool gen.c per review comments. - Subskels now use typeof() for array and func proto globals to avoid the need for runtime split btf. - Expanded the subskeleton test to include arrays, custom maps, extern maps, weak symbols, and kconfigs. - selftests/bpf/Makefile now generates a subskel.h for every skel.h it would make. For reference, here is a shortened subskeleton header: #ifndef __TEST_SUBSKELETON_LIB_SUBSKEL_H__ #define __TEST_SUBSKELETON_LIB_SUBSKEL_H__ struct test_subskeleton_lib { struct bpf_object *obj; struct bpf_object_subskeleton *subskel; struct { struct bpf_map *map2; struct bpf_map *map1; struct bpf_map *data; struct bpf_map *rodata; struct bpf_map *bss; struct bpf_map *kconfig; } maps; struct { struct bpf_program *lib_perf_handler; } progs; struct test_subskeleton_lib__data { int *var6; int *var2; int *var5; } data; struct test_subskeleton_lib__rodata { int *var1; } rodata; struct test_subskeleton_lib__bss { struct { int var3_1; __s64 var3_2; } *var3; int *libout1; typeof(int[4]) *var4; typeof(int (*)()) *fn_ptr; } bss; struct test_subskeleton_lib__kconfig { _Bool *CONFIG_BPF_SYSCALL; } kconfig; static inline struct test_subskeleton_lib * test_subskeleton_lib__open(const struct bpf_object *src) { struct test_subskeleton_lib *obj; struct bpf_object_subskeleton *s; int err; ... s = (struct bpf_object_subskeleton *)calloc(1, sizeof(*s)); ... s->var_cnt = 9; ... s->vars[0].name = "var6"; s->vars[0].map = &obj->maps.data; s->vars[0].addr = (void**) &obj->data.var6; ... /* maps */ ... /* programs */ s->prog_cnt = 1; ... err = bpf_object__open_subskeleton(s); ... return obj; } #endif /* __TEST_SUBSKELETON_LIB_SUBSKEL_H__ */ ==================== Signed-off-by: Andrii Nakryiko commit 3cccbaa0332169d4ff05587062a7ed528aeddb60 Author: Delyan Kratunov Date: Wed Mar 16 23:37:31 2022 +0000 selftests/bpf: Test subskeleton functionality This patch changes the selftests/bpf Makefile to also generate a subskel.h for every skel.h it would have normally generated. Separately, it also introduces a new subskeleton test which tests library objects, externs, weak symbols, kconfigs, and user maps. Signed-off-by: Delyan Kratunov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1bd24956940bbbfe169bb34f7f87b11df52ef011.1647473511.git.delyank@fb.com tools/testing/selftests/bpf/.gitignore | 1 + tools/testing/selftests/bpf/Makefile | 12 +++- .../testing/selftests/bpf/prog_tests/subskeleton.c | 78 ++++++++++++++++++++++ .../testing/selftests/bpf/progs/test_subskeleton.c | 28 ++++++++ .../selftests/bpf/progs/test_subskeleton_lib.c | 61 +++++++++++++++++ .../selftests/bpf/progs/test_subskeleton_lib2.c | 16 +++++ 6 files changed, 194 insertions(+), 2 deletions(-) commit 00389c58ffe993782a8ba4bb5a34a102b1f6fe24 Author: Delyan Kratunov Date: Wed Mar 16 23:37:28 2022 +0000 bpftool: Add support for subskeletons Subskeletons are headers which require an already loaded program to operate. For example, when a BPF library is linked into a larger BPF object file, the library userspace needs a way to access its own global variables without requiring knowledge about the larger program at build time. As a result, subskeletons require a loaded bpf_object to open(). Further, they find their own symbols in the larger program by walking BTF type data at run time. At this time, programs, maps, and globals are supported through non-owning pointers. Signed-off-by: Delyan Kratunov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/ca8a48b4841c72d285ecce82371bef4a899756cb.1647473511.git.delyank@fb.com tools/bpf/bpftool/Documentation/bpftool-gen.rst | 25 + tools/bpf/bpftool/bash-completion/bpftool | 14 +- tools/bpf/bpftool/gen.c | 588 ++++++++++++++++++++---- 3 files changed, 542 insertions(+), 85 deletions(-) commit 430025e5dca5ad8902e7c3092b7c975acae154c5 Author: Delyan Kratunov Date: Wed Mar 16 23:37:33 2022 +0000 libbpf: Add subskeleton scaffolding In symmetry with bpf_object__open_skeleton(), bpf_object__open_subskeleton() performs the actual walking and linking of maps, progs, and globals described by bpf_*_skeleton objects. Signed-off-by: Delyan Kratunov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/6942a46fbe20e7ebf970affcca307ba616985b15.1647473511.git.delyank@fb.com tools/lib/bpf/libbpf.c | 139 ++++++++++++++++++++++++++++++++++++++++------- tools/lib/bpf/libbpf.h | 29 ++++++++++ tools/lib/bpf/libbpf.map | 2 + 3 files changed, 149 insertions(+), 21 deletions(-) commit 262cfb74ffdaed06e65b8b20e10241768a9a2e18 Author: Delyan Kratunov Date: Wed Mar 16 23:37:30 2022 +0000 libbpf: Init btf_{key,value}_type_id on internal map open For internal and user maps, look up the key and value btf types on open() and not load(), so that `bpf_map_btf_value_type_id` is usable in `bpftool gen`. Signed-off-by: Delyan Kratunov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/78dbe4e457b4a05e098fc6c8f50014b680c86e4e.1647473511.git.delyank@fb.com tools/lib/bpf/libbpf.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) commit bc380eb9d04812eda23fd1d2904389012b50d946 Author: Delyan Kratunov Date: Wed Mar 16 23:37:24 2022 +0000 libbpf: .text routines are subprograms in strict mode Currently, libbpf considers a single routine in .text to be a program. This is particularly confusing when it comes to library objects - a single routine meant to be used as an extern will instead be considered a bpf_program. This patch hides this compatibility behavior behind the pre-existing SEC_NAME strict mode flag. Signed-off-by: Delyan Kratunov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/018de8d0d67c04bf436055270d35d394ba393505.1647473511.git.delyank@fb.com tools/lib/bpf/libbpf.c | 7 +++++++ tools/lib/bpf/libbpf_legacy.h | 4 ++++ 2 files changed, 11 insertions(+) commit a5436af598779219b375c1977555c82def1c35d0 Author: Brandon Wyman Date: Thu Mar 17 23:21:23 2022 +0000 hwmon: (pmbus) Add Vin unit off handling If there is an input undervoltage fault, reported in STATUS_INPUT command response, there is quite likely a "Unit Off For Insufficient Input Voltage" condition as well. Add a constant for bit 3 of STATUS_INPUT. Update the Vin limit attributes to include both bits in the mask for clearing faults. If an input undervoltage fault occurs, causing a unit off for insufficient input voltage, but the unit is off bit is not cleared, the STATUS_WORD will not be updated to clear the input fault condition. Including the unit is off bit (bit 3) allows for the input fault condition to completely clear. Signed-off-by: Brandon Wyman Link: https://lore.kernel.org/r/20220317232123.2103592-1-bjwyman@gmail.com Fixes: b4ce237b7f7d3 ("hwmon: (pmbus) Introduce infrastructure to detect sensors and limit registers") [groeck: Dropped unnecessary ()] Signed-off-by: Guenter Roeck drivers/hwmon/pmbus/pmbus.h | 1 + drivers/hwmon/pmbus/pmbus_core.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) commit 71e6d0608e4d1b79069990c7dacb3600ced28a3b Author: Yang Li Date: Wed Mar 16 01:14:11 2022 +0100 media: platform: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq() already prints an error. Eliminate the follow coccicheck warnings: ./drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c:119:2-9: line 119 is redundant because platform_get_irq() already prints an error ./drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c:103:2-9: line 103 is redundant because platform_get_irq() already prints an error Link: https://lore.kernel.org/linux-media/20220316001411.80167-1-yang.lee@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 4 +--- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) commit 5d1ca138026ed133f3d11fe0785de82bdee3c648 Author: Xiongfeng Wang Date: Wed Mar 16 09:19:38 2022 +0100 media: amphion: Add missing of_node_put() in vpu_core_parse_dt() of_parse_phandle() will increment the refcount of the returned device_node. Calling of_node_put() to avoid the refcount leak. Link: https://lore.kernel.org/linux-media/20220316081938.80819-1-wangxiongfeng2@huawei.com Signed-off-by: Xiongfeng Wang Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/amphion/vpu_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 77119adb62dda4918cb21755775d3cacd3e83097 Author: Xiongfeng Wang Date: Wed Mar 16 13:34:52 2022 +0100 media: mtk-vcodec: Add missing of_node_put() in mtk_vdec_hw_prob_done() of_find_compatible_node() will increment the refcount of the returned device_node. Calling of_node_put() to avoid the refcount leak. Link: https://lore.kernel.org/linux-media/20220316123452.186166-1-wangxiongfeng2@huawei.com Signed-off-by: Xiongfeng Wang Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 2 ++ 1 file changed, 2 insertions(+) commit f4a4f9a54b2c52b0c6f40d0f37a129e9909fa62d Author: YueHaibing Date: Fri Mar 18 04:03:05 2022 +0100 media: platform: amphion: Fix build error without MAILBOX while COMPILE_TEST is y and MAILBOX is n, build fails: ERROR: modpost: "mbox_request_channel_byname" [drivers/media/platform/amphion/amphion-vpu.ko] undefined! ERROR: modpost: "mbox_free_channel" [drivers/media/platform/amphion/amphion-vpu.ko] undefined! ERROR: modpost: "mbox_send_message" [drivers/media/platform/amphion/amphion-vpu.ko] undefined! Adding a MAILBOX dependency in VIDEO_AMPHION_VPU to fix this. Link: https://lore.kernel.org/linux-media/20220318030305.39120-1-yuehaibing@huawei.com Fixes: 52b3a219dd4a ("media: platform: amphion: move config to its own file") Signed-off-by: YueHaibing Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/amphion/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 75080cc331e91b82f8b0f2273c0803045659ab15 Author: Mauro Carvalho Chehab Date: Tue Mar 15 07:04:01 2022 +0100 media: spi: Kconfig: Place SPI drivers on a single menu It makes no sense to have two menus for SPI drivers, each one with a single driver. Merge them and keep the Kconfig sorted. Suggested-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/spi/Kconfig | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) commit d94304f2c3ac1afad1af68347156f3431104dfb5 Author: Mauro Carvalho Chehab Date: Tue Mar 15 06:54:42 2022 +0100 media: i2c: Kconfig: move camera drivers to the top The camera drivers are the ones that suffer additions/changes on those days. Place them on the top of the I2C drivers. Suggested-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/i2c/Kconfig | 2128 ++++++++++++++++++++++----------------------- 1 file changed, 1064 insertions(+), 1064 deletions(-) commit fc0b582c858ed73f94c8f3375c203ea46f1f7402 Author: Mauro Carvalho Chehab Date: Mon Mar 14 18:11:38 2022 +0100 media: atomisp: fix bad usage at error handling logic As warned by sparse: atomisp: drivers/staging/media/atomisp/pci/atomisp_acc.c:508 atomisp_acc_load_extensions() warn: iterator used outside loop: 'acc_fw' The acc_fw interactor is used outside the loop, at the error handling logic. On most cases, this is actually safe there, but, if atomisp_css_set_acc_parameters() has an error, an attempt to use it will pick an invalid value for acc_fw. Reported-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/staging/media/atomisp/pci/atomisp_acc.c | 28 +++++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) commit 2023a99811110aebba9eee4aa09ef7bd21a8a249 Author: Mauro Carvalho Chehab Date: Mon Mar 14 16:31:09 2022 +0100 media: platform: rename mediatek/mtk-jpeg/ to mediatek/jpeg/ As the end goal is to have platform drivers split by vendor, rename mediatek/mtk-jpeg/ to mediatek/jpeg/. Requested-by: AngeloGioacchino Del Regno Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 10 +++++----- drivers/media/platform/mediatek/Kconfig | 8 ++++---- drivers/media/platform/mediatek/Makefile | 8 ++++---- drivers/media/platform/mediatek/{mtk-jpeg => jpeg}/Kconfig | 0 drivers/media/platform/mediatek/{mtk-jpeg => jpeg}/Makefile | 0 .../media/platform/mediatek/{mtk-jpeg => jpeg}/mtk_jpeg_core.c | 0 .../media/platform/mediatek/{mtk-jpeg => jpeg}/mtk_jpeg_core.h | 0 .../platform/mediatek/{mtk-jpeg => jpeg}/mtk_jpeg_dec_hw.c | 0 .../platform/mediatek/{mtk-jpeg => jpeg}/mtk_jpeg_dec_hw.h | 0 .../platform/mediatek/{mtk-jpeg => jpeg}/mtk_jpeg_dec_parse.c | 0 .../platform/mediatek/{mtk-jpeg => jpeg}/mtk_jpeg_dec_parse.h | 0 .../platform/mediatek/{mtk-jpeg => jpeg}/mtk_jpeg_dec_reg.h | 0 .../platform/mediatek/{mtk-jpeg => jpeg}/mtk_jpeg_enc_hw.c | 0 .../platform/mediatek/{mtk-jpeg => jpeg}/mtk_jpeg_enc_hw.h | 0 drivers/media/platform/mediatek/{mtk-mdp => mdp}/Kconfig | 0 drivers/media/platform/mediatek/{mtk-mdp => mdp}/Makefile | 2 +- .../media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_comp.c | 0 .../media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_comp.h | 0 .../media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_core.c | 0 .../media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_core.h | 0 drivers/media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_ipi.h | 0 drivers/media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_m2m.c | 0 drivers/media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_m2m.h | 0 .../media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_regs.c | 0 .../media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_regs.h | 0 drivers/media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_vpu.c | 0 drivers/media/platform/mediatek/{mtk-mdp => mdp}/mtk_mdp_vpu.h | 0 drivers/media/platform/mediatek/{mtk-vcodec => vcodec}/Kconfig | 0 .../media/platform/mediatek/{mtk-vcodec => vcodec}/Makefile | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_dec.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_dec.h | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_dec_drv.c | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_dec_hw.c | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_dec_hw.h | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_dec_pm.c | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_dec_pm.h | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_dec_stateful.c | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_dec_stateless.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_drv.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_enc.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_enc.h | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_enc_drv.c | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_enc_pm.c | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_enc_pm.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_fw.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_fw.h | 2 +- .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_fw_priv.h | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_fw_scp.c | 0 .../mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_fw_vpu.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_intr.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_intr.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_util.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/mtk_vcodec_util.h | 0 .../mediatek/{mtk-vcodec => vcodec}/vdec/vdec_h264_if.c | 0 .../mediatek/{mtk-vcodec => vcodec}/vdec/vdec_h264_req_if.c | 0 .../mediatek/{mtk-vcodec => vcodec}/vdec/vdec_vp8_if.c | 0 .../mediatek/{mtk-vcodec => vcodec}/vdec/vdec_vp9_if.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/vdec_drv_base.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/vdec_drv_if.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/vdec_drv_if.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/vdec_ipi_msg.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/vdec_msg_queue.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/vdec_msg_queue.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/vdec_vpu_if.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/vdec_vpu_if.h | 0 .../mediatek/{mtk-vcodec => vcodec}/venc/venc_h264_if.c | 0 .../mediatek/{mtk-vcodec => vcodec}/venc/venc_vp8_if.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/venc_drv_base.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/venc_drv_if.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/venc_drv_if.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/venc_ipi_msg.h | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/venc_vpu_if.c | 0 .../platform/mediatek/{mtk-vcodec => vcodec}/venc_vpu_if.h | 0 drivers/media/platform/mediatek/{mtk-vpu => vpu}/Kconfig | 0 drivers/media/platform/mediatek/{mtk-vpu => vpu}/Makefile | 0 drivers/media/platform/mediatek/{mtk-vpu => vpu}/mtk_vpu.c | 0 drivers/media/platform/mediatek/{mtk-vpu => vpu}/mtk_vpu.h | 0 77 files changed, 15 insertions(+), 15 deletions(-) commit 6cdc31b2d7095af3d39f001b0d4e367a6f32664e Author: Mauro Carvalho Chehab Date: Mon Mar 14 11:01:05 2022 +0100 media: media/*/Kconfig: sort entries Currently, the idems inside media Kconfig are out of order. Sort them using the script below: Signed-off-by: Mauro Carvalho Chehab drivers/media/common/Kconfig | 16 +- drivers/media/dvb-frontends/Kconfig | 661 +++++++++++++++---------------- drivers/media/i2c/Kconfig | 628 ++++++++++++++--------------- drivers/media/mmc/Kconfig | 1 + drivers/media/pci/Kconfig | 29 +- drivers/media/radio/Kconfig | 320 +++++++-------- drivers/media/rc/Kconfig | 376 +++++++++--------- drivers/media/test-drivers/Kconfig | 6 +- drivers/media/test-drivers/vidtv/Kconfig | 1 - drivers/media/tuners/Kconfig | 239 +++++------ drivers/media/usb/Kconfig | 33 +- drivers/media/usb/dvb-usb-v2/Kconfig | 26 +- drivers/media/usb/dvb-usb/Kconfig | 364 ++++++++--------- drivers/media/usb/gspca/Kconfig | 27 +- 14 files changed, 1378 insertions(+), 1349 deletions(-) commit 9958d30f38b96fb763a10d44d18ddad39127d5f4 Author: Mauro Carvalho Chehab Date: Sun Mar 13 07:25:46 2022 +0100 media: Kconfig: cleanup VIDEO_DEV dependencies media Kconfig has two entries associated to V4L API: VIDEO_DEV and VIDEO_V4L2. On Kernel 2.6.x, there were two V4L APIs, each one with its own flag. VIDEO_DEV were meant to: 1) enable Video4Linux and make its Kconfig options to appear; 2) it makes the Kernel build the V4L core. while VIDEO_V4L2 where used to distinguish between drivers that implement the newer API and drivers that implemented the former one. With time, such meaning changed, specially after the removal of all V4L version 1 drivers. At the current implementation, VIDEO_DEV only does (1): it enables the media options related to V4L, that now has: menu "Video4Linux options" visible if VIDEO_DEV source "drivers/media/v4l2-core/Kconfig" endmenu but it doesn't affect anymore the V4L core drivers. The rationale is that the V4L2 core has a "soft" dependency at the I2C bus, and now requires to select a number of other Kconfig options: config VIDEO_V4L2 tristate depends on (I2C || I2C=n) && VIDEO_DEV select RATIONAL select VIDEOBUF2_V4L2 if VIDEOBUF2_CORE default (I2C || I2C=n) && VIDEO_DEV In the past, merging them would be tricky, but it seems that it is now possible to merge those symbols, in order to simplify V4L dependencies. Let's keep VIDEO_DEV, as this one is used on some make *defconfig configurations. Suggested-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Neil Armstrong # for meson-vdec & meson-ge2d Acked-by: Andrzej Pietrasiewicz Acked-by: Łukasz Stelmach Signed-off-by: Mauro Carvalho Chehab drivers/input/rmi4/Kconfig | 2 +- drivers/input/touchscreen/Kconfig | 4 +- drivers/media/Kconfig | 3 + drivers/media/common/saa7146/Kconfig | 2 +- drivers/media/dvb-core/Kconfig | 2 +- drivers/media/dvb-frontends/Kconfig | 4 +- drivers/media/i2c/Kconfig | 250 ++++++++++----------- drivers/media/i2c/ccs/Kconfig | 2 +- drivers/media/i2c/cx25840/Kconfig | 2 +- drivers/media/i2c/et8ek8/Kconfig | 2 +- drivers/media/i2c/m5mols/Kconfig | 2 +- drivers/media/pci/Kconfig | 2 +- drivers/media/pci/bt8xx/Kconfig | 2 +- drivers/media/pci/cobalt/Kconfig | 2 +- drivers/media/pci/cx18/Kconfig | 2 +- drivers/media/pci/dt3155/Kconfig | 2 +- drivers/media/pci/intel/ipu3/Kconfig | 2 +- drivers/media/pci/ivtv/Kconfig | 2 +- drivers/media/pci/meye/Kconfig | 2 +- drivers/media/pci/saa7146/Kconfig | 6 +- drivers/media/pci/sta2x11/Kconfig | 2 +- drivers/media/pci/tw5864/Kconfig | 2 +- drivers/media/pci/tw68/Kconfig | 2 +- drivers/media/pci/tw686x/Kconfig | 2 +- drivers/media/platform/Kconfig | 6 +- drivers/media/platform/allegro-dvt/Kconfig | 2 +- drivers/media/platform/amlogic/meson-ge2d/Kconfig | 2 +- drivers/media/platform/amphion/Kconfig | 1 - drivers/media/platform/aspeed/Kconfig | 2 +- drivers/media/platform/atmel/Kconfig | 8 +- drivers/media/platform/cadence/Kconfig | 4 +- drivers/media/platform/chips-media/Kconfig | 2 +- drivers/media/platform/intel/Kconfig | 2 +- drivers/media/platform/marvell/Kconfig | 4 +- drivers/media/platform/mediatek/mtk-jpeg/Kconfig | 2 +- drivers/media/platform/mediatek/mtk-mdp/Kconfig | 2 +- drivers/media/platform/mediatek/mtk-vcodec/Kconfig | 2 +- drivers/media/platform/mediatek/mtk-vpu/Kconfig | 2 +- drivers/media/platform/nvidia/tegra-vde/Kconfig | 2 +- drivers/media/platform/nxp/Kconfig | 6 +- drivers/media/platform/nxp/imx-jpeg/Kconfig | 2 +- drivers/media/platform/qcom/camss/Kconfig | 2 +- drivers/media/platform/qcom/venus/Kconfig | 2 +- drivers/media/platform/renesas/Kconfig | 30 +-- drivers/media/platform/renesas/rcar-vin/Kconfig | 4 +- drivers/media/platform/rockchip/rga/Kconfig | 2 +- drivers/media/platform/rockchip/rkisp1/Kconfig | 2 +- drivers/media/platform/samsung/exynos-gsc/Kconfig | 2 +- drivers/media/platform/samsung/exynos4-is/Kconfig | 2 +- drivers/media/platform/samsung/s3c-camif/Kconfig | 2 +- drivers/media/platform/samsung/s5p-g2d/Kconfig | 2 +- drivers/media/platform/samsung/s5p-jpeg/Kconfig | 2 +- drivers/media/platform/samsung/s5p-mfc/Kconfig | 2 +- drivers/media/platform/st/sti/bdisp/Kconfig | 2 +- drivers/media/platform/st/sti/delta/Kconfig | 2 +- drivers/media/platform/st/sti/hva/Kconfig | 2 +- drivers/media/platform/st/stm32/Kconfig | 4 +- drivers/media/platform/sunxi/sun4i-csi/Kconfig | 2 +- drivers/media/platform/sunxi/sun6i-csi/Kconfig | 2 +- drivers/media/platform/sunxi/sun8i-di/Kconfig | 2 +- drivers/media/platform/sunxi/sun8i-rotate/Kconfig | 2 +- drivers/media/platform/ti/am437x/Kconfig | 2 +- drivers/media/platform/ti/davinci/Kconfig | 12 +- drivers/media/platform/ti/omap/Kconfig | 2 +- drivers/media/platform/ti/omap3isp/Kconfig | 2 +- drivers/media/platform/via/Kconfig | 2 +- drivers/media/platform/xilinx/Kconfig | 2 +- drivers/media/radio/Kconfig | 42 ++-- drivers/media/radio/si470x/Kconfig | 2 +- drivers/media/radio/wl128x/Kconfig | 2 +- drivers/media/spi/Kconfig | 4 +- drivers/media/test-drivers/Kconfig | 2 +- drivers/media/test-drivers/vicodec/Kconfig | 2 +- drivers/media/test-drivers/vimc/Kconfig | 2 +- drivers/media/test-drivers/vivid/Kconfig | 2 +- drivers/media/tuners/Kconfig | 6 +- drivers/media/tuners/e4000.c | 6 +- drivers/media/tuners/fc2580.c | 6 +- drivers/media/usb/airspy/Kconfig | 2 +- drivers/media/usb/au0828/Kconfig | 6 +- drivers/media/usb/cpia2/Kconfig | 2 +- drivers/media/usb/dvb-usb-v2/Kconfig | 8 +- drivers/media/usb/dvb-usb/Kconfig | 4 +- drivers/media/usb/gspca/Kconfig | 96 ++++---- drivers/media/usb/gspca/gl860/Kconfig | 2 +- drivers/media/usb/gspca/m5602/Kconfig | 2 +- drivers/media/usb/hackrf/Kconfig | 2 +- drivers/media/usb/hdpvr/Kconfig | 2 +- drivers/media/usb/msi2500/Kconfig | 2 +- drivers/media/usb/pvrusb2/Kconfig | 2 +- drivers/media/usb/pwc/Kconfig | 2 +- drivers/media/usb/s2255/Kconfig | 2 +- drivers/media/usb/stkwebcam/Kconfig | 2 +- drivers/media/usb/usbtv/Kconfig | 2 +- drivers/media/usb/uvc/Kconfig | 2 +- drivers/media/usb/zr364xx/Kconfig | 2 +- drivers/media/v4l2-core/Kconfig | 12 +- drivers/media/v4l2-core/Makefile | 2 +- drivers/staging/media/atomisp/Kconfig | 2 +- drivers/staging/media/atomisp/i2c/Kconfig | 14 +- drivers/staging/media/hantro/Kconfig | 2 +- drivers/staging/media/imx/Kconfig | 2 +- drivers/staging/media/ipu3/Kconfig | 2 +- drivers/staging/media/max96712/Kconfig | 2 +- drivers/staging/media/meson/vdec/Kconfig | 2 +- drivers/staging/media/omap4iss/Kconfig | 2 +- drivers/staging/media/rkvdec/Kconfig | 2 +- drivers/staging/media/sunxi/cedrus/Kconfig | 2 +- drivers/staging/media/tegra-video/Kconfig | 2 +- drivers/staging/media/zoran/Kconfig | 2 +- drivers/staging/most/video/Kconfig | 2 +- .../staging/vc04_services/bcm2835-camera/Kconfig | 2 +- drivers/usb/gadget/Kconfig | 2 +- drivers/usb/gadget/legacy/Kconfig | 2 +- sound/pci/Kconfig | 4 +- 115 files changed, 356 insertions(+), 374 deletions(-) commit 63fe3d27b226fe01746bace4d1f1f2164406140d Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:34:06 2022 +0100 media: platform/*/Kconfig: make manufacturer menus more uniform Do some adjustments at the per-vendor Kconfig, adding a comment at the beginning in order to identify the manufacturer, and adjust a few entries to make them look more uniform. Reviewed-by: Laurent Pinchart Acked-by: Jernej Skrabec # For sunxi Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/allegro-dvt/Kconfig | 3 +++ drivers/media/platform/amlogic/Kconfig | 3 +++ drivers/media/platform/aspeed/Kconfig | 3 +++ drivers/media/platform/atmel/Kconfig | 3 +++ drivers/media/platform/cadence/Kconfig | 13 +------------ drivers/media/platform/chips-media/Kconfig | 3 +++ drivers/media/platform/intel/Kconfig | 3 +++ drivers/media/platform/marvell/Kconfig | 3 +++ drivers/media/platform/mediatek/Kconfig | 3 +++ drivers/media/platform/nvidia/Kconfig | 3 +++ drivers/media/platform/nxp/Kconfig | 22 +++++----------------- drivers/media/platform/qcom/Kconfig | 2 ++ drivers/media/platform/renesas/Kconfig | 2 ++ drivers/media/platform/rockchip/Kconfig | 3 +++ drivers/media/platform/samsung/Kconfig | 3 +++ drivers/media/platform/st/Kconfig | 2 ++ drivers/media/platform/sunxi/Kconfig | 2 ++ drivers/media/platform/via/Kconfig | 3 +++ drivers/media/platform/xilinx/Kconfig | 7 +++---- 19 files changed, 53 insertions(+), 33 deletions(-) commit f2ab6d3e8c485f794b5e2de07c09d2bd653ef85e Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:21 2022 +0100 media: platform: Create vendor/{Makefile,Kconfig} files Instead of placing multiple per-vendor entries at the platform/{Makefile,Kconfig}, create them at the per-vendor directories. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 29 ++++++----------------------- drivers/media/platform/Makefile | 29 +++++++---------------------- drivers/media/platform/amlogic/Kconfig | 2 ++ drivers/media/platform/amlogic/Makefile | 2 ++ drivers/media/platform/amphion/Kconfig | 3 +++ drivers/media/platform/mediatek/Kconfig | 5 +++++ drivers/media/platform/mediatek/Makefile | 5 +++++ drivers/media/platform/nvidia/Kconfig | 2 ++ drivers/media/platform/qcom/Makefile | 3 +++ drivers/media/platform/rockchip/Makefile | 3 +++ drivers/media/platform/samsung/Kconfig | 7 +++++++ drivers/media/platform/samsung/Makefile | 7 +++++++ drivers/media/platform/st/Kconfig | 4 ++++ drivers/media/platform/st/Makefile | 7 +++++++ drivers/media/platform/st/sti/Makefile | 6 ++++++ drivers/media/platform/ti/Kconfig | 5 +++++ drivers/media/platform/ti/Makefile | 6 +++++- 17 files changed, 79 insertions(+), 46 deletions(-) commit 68f8ef61c659f2c5b674ed4716fea78a7bbb01f3 Author: Mauro Carvalho Chehab Date: Mon Mar 14 13:39:20 2022 +0100 media: platform: ti/Kconfig: move VPE/CAL entries to it In order to follow the changes made by the previous patch, which moved platform/ti-vpe to platform/ti, move the Kconfig entries to the same place. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/{ti-vpe => ti}/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 8148baabd1c4b02c0af3002d59a1c92975d2e719 Author: Pratyush Yadav Date: Fri Jan 21 19:59:00 2022 +0530 media: platform: re-structure TI drivers The ti-vpe/ sub-directory does not only contain the VPE-specific things. It also contains the CAL driver, which is a completely different subsystem. This is also not a good place to add new drivers for other TI platforms since they will all get mixed up. Separate the VPE and CAL parts into different sub-directories and rename the ti-vpe/ sub-directory to ti/. This is now the place where new TI platform drivers can be added. [mchehab: rebased to apple on the top of media/platform/Kconfig series] Signed-off-by: Pratyush Yadav Reviewed-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 3 ++- drivers/media/platform/Makefile | 6 +----- drivers/media/platform/ti/Makefile | 3 +++ drivers/media/platform/ti/cal/Makefile | 3 +++ drivers/media/platform/{ti-vpe => ti/cal}/cal-camerarx.c | 0 drivers/media/platform/{ti-vpe => ti/cal}/cal-video.c | 0 drivers/media/platform/{ti-vpe => ti/cal}/cal.c | 0 drivers/media/platform/{ti-vpe => ti/cal}/cal.h | 0 drivers/media/platform/{ti-vpe => ti/cal}/cal_regs.h | 0 drivers/media/platform/{ti-vpe => ti/vpe}/Makefile | 4 ---- drivers/media/platform/{ti-vpe => ti/vpe}/csc.c | 0 drivers/media/platform/{ti-vpe => ti/vpe}/csc.h | 0 drivers/media/platform/{ti-vpe => ti/vpe}/sc.c | 0 drivers/media/platform/{ti-vpe => ti/vpe}/sc.h | 0 drivers/media/platform/{ti-vpe => ti/vpe}/sc_coeff.h | 0 drivers/media/platform/{ti-vpe => ti/vpe}/vpdma.c | 0 drivers/media/platform/{ti-vpe => ti/vpe}/vpdma.h | 0 drivers/media/platform/{ti-vpe => ti/vpe}/vpdma_priv.h | 0 drivers/media/platform/{ti-vpe => ti/vpe}/vpe.c | 0 drivers/media/platform/{ti-vpe => ti/vpe}/vpe_regs.h | 0 20 files changed, 9 insertions(+), 10 deletions(-) commit 012e3ca3cb4d7f50699b983af86532aa92faa90f Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:20 2022 +0100 media: platform: rename omap/ to ti/omap/ As the end goal is to have platform drivers split by vendor, rename omap/ to ti/omap/. Reviewed-by: Laurent Pinchart Reviewed-by: Peter Ujfalusi Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => ti}/omap/Kconfig | 0 drivers/media/platform/{ => ti}/omap/Makefile | 0 drivers/media/platform/{ => ti}/omap/omap_vout.c | 0 drivers/media/platform/{ => ti}/omap/omap_vout_vrfb.c | 0 drivers/media/platform/{ => ti}/omap/omap_vout_vrfb.h | 0 drivers/media/platform/{ => ti}/omap/omap_voutdef.h | 0 drivers/media/platform/{ => ti}/omap/omap_voutlib.c | 0 drivers/media/platform/{ => ti}/omap/omap_voutlib.h | 0 10 files changed, 2 insertions(+), 2 deletions(-) commit ceafdaac46ea2c623a64eabaed64abd2fe7cb76f Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:20 2022 +0100 media: platform: rename omap3isp/ to ti/omap3isp/ As the end goal is to have platform drivers split by vendor, rename omap3isp/ to ti/omap3isp/. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Documentation/admin-guide/media/omap3isp.rst | 2 +- Documentation/admin-guide/media/omap4_camera.rst | 2 +- Documentation/driver-api/media/v4l2-event.rst | 2 +- MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => ti}/omap3isp/Kconfig | 0 drivers/media/platform/{ => ti}/omap3isp/Makefile | 0 drivers/media/platform/{ => ti}/omap3isp/cfa_coef_table.h | 0 drivers/media/platform/{ => ti}/omap3isp/gamma_table.h | 0 drivers/media/platform/{ => ti}/omap3isp/isp.c | 0 drivers/media/platform/{ => ti}/omap3isp/isp.h | 0 drivers/media/platform/{ => ti}/omap3isp/ispccdc.c | 0 drivers/media/platform/{ => ti}/omap3isp/ispccdc.h | 0 drivers/media/platform/{ => ti}/omap3isp/ispccp2.c | 0 drivers/media/platform/{ => ti}/omap3isp/ispccp2.h | 0 drivers/media/platform/{ => ti}/omap3isp/ispcsi2.c | 0 drivers/media/platform/{ => ti}/omap3isp/ispcsi2.h | 0 drivers/media/platform/{ => ti}/omap3isp/ispcsiphy.c | 0 drivers/media/platform/{ => ti}/omap3isp/ispcsiphy.h | 0 drivers/media/platform/{ => ti}/omap3isp/isph3a.h | 0 drivers/media/platform/{ => ti}/omap3isp/isph3a_aewb.c | 0 drivers/media/platform/{ => ti}/omap3isp/isph3a_af.c | 0 drivers/media/platform/{ => ti}/omap3isp/isphist.c | 0 drivers/media/platform/{ => ti}/omap3isp/isphist.h | 0 drivers/media/platform/{ => ti}/omap3isp/isppreview.c | 0 drivers/media/platform/{ => ti}/omap3isp/isppreview.h | 0 drivers/media/platform/{ => ti}/omap3isp/ispreg.h | 0 drivers/media/platform/{ => ti}/omap3isp/ispresizer.c | 0 drivers/media/platform/{ => ti}/omap3isp/ispresizer.h | 0 drivers/media/platform/{ => ti}/omap3isp/ispstat.c | 0 drivers/media/platform/{ => ti}/omap3isp/ispstat.h | 0 drivers/media/platform/{ => ti}/omap3isp/ispvideo.c | 0 drivers/media/platform/{ => ti}/omap3isp/ispvideo.h | 0 drivers/media/platform/{ => ti}/omap3isp/luma_enhance_table.h | 0 drivers/media/platform/{ => ti}/omap3isp/noise_filter_table.h | 0 drivers/media/platform/{ => ti}/omap3isp/omap3isp.h | 0 37 files changed, 6 insertions(+), 6 deletions(-) commit d24a170bde6543fa2879d3c422b7874716cdf038 Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:19 2022 +0100 media: platform: rename davinci/ to ti/davinci/ As the end goal is to have platform drivers split by vendor, rename davinci/ to ti/davinci/. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab .../driver-api/media/drivers/davinci-vpbe-devel.rst | 20 ++++++++++---------- MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => ti}/davinci/Kconfig | 0 drivers/media/platform/{ => ti}/davinci/Makefile | 0 .../media/platform/{ => ti}/davinci/ccdc_hw_device.h | 0 drivers/media/platform/{ => ti}/davinci/dm355_ccdc.c | 0 .../platform/{ => ti}/davinci/dm355_ccdc_regs.h | 0 .../media/platform/{ => ti}/davinci/dm644x_ccdc.c | 0 .../platform/{ => ti}/davinci/dm644x_ccdc_regs.h | 0 drivers/media/platform/{ => ti}/davinci/isif.c | 0 drivers/media/platform/{ => ti}/davinci/isif_regs.h | 0 drivers/media/platform/{ => ti}/davinci/vpbe.c | 0 .../media/platform/{ => ti}/davinci/vpbe_display.c | 0 drivers/media/platform/{ => ti}/davinci/vpbe_osd.c | 0 .../media/platform/{ => ti}/davinci/vpbe_osd_regs.h | 0 drivers/media/platform/{ => ti}/davinci/vpbe_venc.c | 0 .../media/platform/{ => ti}/davinci/vpbe_venc_regs.h | 0 .../media/platform/{ => ti}/davinci/vpfe_capture.c | 0 drivers/media/platform/{ => ti}/davinci/vpif.c | 0 drivers/media/platform/{ => ti}/davinci/vpif.h | 0 .../media/platform/{ => ti}/davinci/vpif_capture.c | 0 .../media/platform/{ => ti}/davinci/vpif_capture.h | 0 .../media/platform/{ => ti}/davinci/vpif_display.c | 0 .../media/platform/{ => ti}/davinci/vpif_display.h | 0 drivers/media/platform/{ => ti}/davinci/vpss.c | 0 27 files changed, 13 insertions(+), 13 deletions(-) commit 407965e2348e6875e113c985331bdc125d58bdbb Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:19 2022 +0100 media: platform: rename am437x/ to ti/am437x/ As the end goal is to have platform drivers split by vendor, rename am437x/ to ti/am437x/. Reviewed-by: Laurent Pinchart Reviewed-by: Lad Prabhakar Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 1 + drivers/media/platform/Makefile | 1 + drivers/media/platform/{ => ti}/am437x/Kconfig | 0 drivers/media/platform/{ => ti}/am437x/Makefile | 0 drivers/media/platform/{ => ti}/am437x/am437x-vpfe.c | 0 drivers/media/platform/{ => ti}/am437x/am437x-vpfe.h | 0 drivers/media/platform/{ => ti}/am437x/am437x-vpfe_regs.h | 0 8 files changed, 3 insertions(+), 1 deletion(-) commit e7b8153e2a4f0c9c8d1450aa7328d54ea64fe8b2 Author: Mauro Carvalho Chehab Date: Mon Mar 14 12:43:10 2022 +0100 media: platform: place stm32/ and sti/ under st/ dir As the end goal is to have platform drivers split by vendor, move both stm32/ and sti/ for them to be inside st/ directory. Acked-by: Hugues Fruchet Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 10 +++++----- drivers/media/platform/Kconfig | 4 ++-- drivers/media/platform/Makefile | 10 +++++----- drivers/media/platform/st/sti/Kconfig | 5 +++++ drivers/media/platform/{ => st}/sti/bdisp/Kconfig | 0 drivers/media/platform/{ => st}/sti/bdisp/Makefile | 0 drivers/media/platform/{ => st}/sti/bdisp/bdisp-debug.c | 0 drivers/media/platform/{ => st}/sti/bdisp/bdisp-filter.h | 0 drivers/media/platform/{ => st}/sti/bdisp/bdisp-hw.c | 0 drivers/media/platform/{ => st}/sti/bdisp/bdisp-reg.h | 0 drivers/media/platform/{ => st}/sti/bdisp/bdisp-v4l2.c | 0 drivers/media/platform/{ => st}/sti/bdisp/bdisp.h | 0 drivers/media/platform/{ => st}/sti/c8sectpfe/Kconfig | 0 drivers/media/platform/{ => st}/sti/c8sectpfe/Makefile | 0 .../media/platform/{ => st}/sti/c8sectpfe/c8sectpfe-common.c | 0 .../media/platform/{ => st}/sti/c8sectpfe/c8sectpfe-common.h | 0 drivers/media/platform/{ => st}/sti/c8sectpfe/c8sectpfe-core.c | 0 drivers/media/platform/{ => st}/sti/c8sectpfe/c8sectpfe-core.h | 0 .../media/platform/{ => st}/sti/c8sectpfe/c8sectpfe-debugfs.c | 0 .../media/platform/{ => st}/sti/c8sectpfe/c8sectpfe-debugfs.h | 0 drivers/media/platform/{ => st}/sti/c8sectpfe/c8sectpfe-dvb.c | 0 drivers/media/platform/{ => st}/sti/c8sectpfe/c8sectpfe-dvb.h | 0 drivers/media/platform/{ => st}/sti/delta/Kconfig | 0 drivers/media/platform/{ => st}/sti/delta/Makefile | 0 drivers/media/platform/{ => st}/sti/delta/delta-cfg.h | 0 drivers/media/platform/{ => st}/sti/delta/delta-debug.c | 0 drivers/media/platform/{ => st}/sti/delta/delta-debug.h | 0 drivers/media/platform/{ => st}/sti/delta/delta-ipc.c | 0 drivers/media/platform/{ => st}/sti/delta/delta-ipc.h | 0 drivers/media/platform/{ => st}/sti/delta/delta-mem.c | 0 drivers/media/platform/{ => st}/sti/delta/delta-mem.h | 0 drivers/media/platform/{ => st}/sti/delta/delta-mjpeg-dec.c | 0 drivers/media/platform/{ => st}/sti/delta/delta-mjpeg-fw.h | 0 drivers/media/platform/{ => st}/sti/delta/delta-mjpeg-hdr.c | 0 drivers/media/platform/{ => st}/sti/delta/delta-mjpeg.h | 0 drivers/media/platform/{ => st}/sti/delta/delta-v4l2.c | 0 drivers/media/platform/{ => st}/sti/delta/delta.h | 0 drivers/media/platform/{ => st}/sti/hva/Kconfig | 0 drivers/media/platform/{ => st}/sti/hva/Makefile | 0 drivers/media/platform/{ => st}/sti/hva/hva-debugfs.c | 0 drivers/media/platform/{ => st}/sti/hva/hva-h264.c | 0 drivers/media/platform/{ => st}/sti/hva/hva-hw.c | 0 drivers/media/platform/{ => st}/sti/hva/hva-hw.h | 0 drivers/media/platform/{ => st}/sti/hva/hva-mem.c | 0 drivers/media/platform/{ => st}/sti/hva/hva-mem.h | 0 drivers/media/platform/{ => st}/sti/hva/hva-v4l2.c | 0 drivers/media/platform/{ => st}/sti/hva/hva.h | 0 drivers/media/platform/{ => st}/stm32/Kconfig | 0 drivers/media/platform/{ => st}/stm32/Makefile | 0 drivers/media/platform/{ => st}/stm32/dma2d/dma2d-hw.c | 0 drivers/media/platform/{ => st}/stm32/dma2d/dma2d-regs.h | 0 drivers/media/platform/{ => st}/stm32/dma2d/dma2d.c | 0 drivers/media/platform/{ => st}/stm32/dma2d/dma2d.h | 0 drivers/media/platform/{ => st}/stm32/stm32-dcmi.c | 0 drivers/media/platform/sti/Kconfig | 5 ----- 55 files changed, 17 insertions(+), 17 deletions(-) commit 43ecec16c4face9a59e81771e7cbff4671c62117 Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:18 2022 +0100 media: platform: rename s5p-mfc/ to samsung/s5p-mfc/ As the end goal is to have platform drivers split by vendor, rename s5p-mfc/ to samsung/s5p-mfc/. Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/Kconfig | 0 drivers/media/platform/{ => samsung}/s5p-mfc/Makefile | 0 drivers/media/platform/{ => samsung}/s5p-mfc/regs-mfc-v10.h | 0 drivers/media/platform/{ => samsung}/s5p-mfc/regs-mfc-v6.h | 0 drivers/media/platform/{ => samsung}/s5p-mfc/regs-mfc-v7.h | 0 drivers/media/platform/{ => samsung}/s5p-mfc/regs-mfc-v8.h | 0 drivers/media/platform/{ => samsung}/s5p-mfc/regs-mfc.h | 0 drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc.c | 0 drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_cmd.c | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_cmd.h | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_cmd_v5.c | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_cmd_v5.h | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_cmd_v6.c | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_cmd_v6.h | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_common.h | 0 drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_ctrl.c | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_ctrl.h | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_debug.h | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_dec.c | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_dec.h | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_enc.c | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_enc.h | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_intr.c | 0 drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_intr.h | 0 drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_iommu.h | 0 drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_opr.c | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_opr.h | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_opr_v5.c | 0 drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_opr_v5.h | 0 drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_opr_v6.c | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_opr_v6.h | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_pm.c | 2 +- drivers/media/platform/{ => samsung}/s5p-mfc/s5p_mfc_pm.h | 2 +- 36 files changed, 22 insertions(+), 22 deletions(-) commit f4104b7851a8d8b9a70899dcbecdb393eb16cd8a Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:17 2022 +0100 media: platform: rename s5p-jpeg/ to samsung/s5p-jpeg/ As the end goal is to have platform drivers split by vendor, rename s5p-jpeg/ to samsung/s5p-jpeg/. Acked-by: Andrzej Pietrasiewicz Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 2 +- drivers/media/platform/renesas/rcar_jpu.c | 2 +- drivers/media/platform/{ => samsung}/s5p-jpeg/Kconfig | 0 drivers/media/platform/{ => samsung}/s5p-jpeg/Makefile | 0 drivers/media/platform/{ => samsung}/s5p-jpeg/jpeg-core.c | 2 +- drivers/media/platform/{ => samsung}/s5p-jpeg/jpeg-core.h | 2 +- drivers/media/platform/{ => samsung}/s5p-jpeg/jpeg-hw-exynos3250.c | 0 drivers/media/platform/{ => samsung}/s5p-jpeg/jpeg-hw-exynos3250.h | 2 +- drivers/media/platform/{ => samsung}/s5p-jpeg/jpeg-hw-exynos4.c | 0 drivers/media/platform/{ => samsung}/s5p-jpeg/jpeg-hw-exynos4.h | 0 drivers/media/platform/{ => samsung}/s5p-jpeg/jpeg-hw-s5p.c | 2 +- drivers/media/platform/{ => samsung}/s5p-jpeg/jpeg-hw-s5p.h | 2 +- drivers/media/platform/{ => samsung}/s5p-jpeg/jpeg-regs.h | 2 +- 16 files changed, 11 insertions(+), 11 deletions(-) commit a7f3b2d32dabd8e59854ec39ba257050b5e4949e Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:17 2022 +0100 media: platform: rename s5p-g2d/ to samsung/s5p-g2d/ As the end goal is to have platform drivers split by vendor, rename s5p-g2d/ to samsung/s5p-g2d/. Acked-by: Łukasz Stelmach Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => samsung}/s5p-g2d/Kconfig | 0 drivers/media/platform/{ => samsung}/s5p-g2d/Makefile | 0 drivers/media/platform/{ => samsung}/s5p-g2d/g2d-hw.c | 0 drivers/media/platform/{ => samsung}/s5p-g2d/g2d-regs.h | 0 drivers/media/platform/{ => samsung}/s5p-g2d/g2d.c | 0 drivers/media/platform/{ => samsung}/s5p-g2d/g2d.h | 0 9 files changed, 3 insertions(+), 3 deletions(-) commit c1024049033f923b80ec80f4c1857d6dbcdf5bc8 Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:16 2022 +0100 media: platform: rename s3c-camif/ to samsung/s3c-camif/ As the end goal is to have platform drivers split by vendor, rename s3c-camif/ to samsung/s3c-camif/. Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => samsung}/s3c-camif/Kconfig | 0 drivers/media/platform/{ => samsung}/s3c-camif/Makefile | 0 drivers/media/platform/{ => samsung}/s3c-camif/camif-capture.c | 0 drivers/media/platform/{ => samsung}/s3c-camif/camif-core.c | 0 drivers/media/platform/{ => samsung}/s3c-camif/camif-core.h | 0 drivers/media/platform/{ => samsung}/s3c-camif/camif-regs.c | 0 drivers/media/platform/{ => samsung}/s3c-camif/camif-regs.h | 0 10 files changed, 3 insertions(+), 3 deletions(-) commit 3bae07d4b44cf10bbffc6270e00816dda57e6e70 Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:16 2022 +0100 media: platform: rename exynos-gsc/ to samsung/exynos-gsc/ As the end goal is to have platform drivers split by vendor, rename exynos-gsc/ to samsung/exynos-gsc/. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => samsung}/exynos-gsc/Kconfig | 0 drivers/media/platform/{ => samsung}/exynos-gsc/Makefile | 0 drivers/media/platform/{ => samsung}/exynos-gsc/gsc-core.c | 0 drivers/media/platform/{ => samsung}/exynos-gsc/gsc-core.h | 0 drivers/media/platform/{ => samsung}/exynos-gsc/gsc-m2m.c | 0 drivers/media/platform/{ => samsung}/exynos-gsc/gsc-regs.c | 0 drivers/media/platform/{ => samsung}/exynos-gsc/gsc-regs.h | 0 9 files changed, 2 insertions(+), 2 deletions(-) commit 238c84f71120f41c45301359902a912a19370f3d Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:16 2022 +0100 media: platform: rename exynos4-is/ to samsung/exynos4-is/ As the end goal is to have platform drivers split by vendor, rename exynos4-is/ to samsung/exynos4-is/. Signed-off-by: Mauro Carvalho Chehab Documentation/admin-guide/media/fimc.rst | 2 +- Documentation/driver-api/media/drivers/fimc-devel.rst | 14 +++++++------- MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => samsung}/exynos4-is/Kconfig | 0 drivers/media/platform/{ => samsung}/exynos4-is/Makefile | 0 drivers/media/platform/{ => samsung}/exynos4-is/common.c | 0 drivers/media/platform/{ => samsung}/exynos4-is/common.h | 0 .../media/platform/{ => samsung}/exynos4-is/fimc-capture.c | 0 .../media/platform/{ => samsung}/exynos4-is/fimc-core.c | 0 .../media/platform/{ => samsung}/exynos4-is/fimc-core.h | 0 .../platform/{ => samsung}/exynos4-is/fimc-is-command.h | 0 .../platform/{ => samsung}/exynos4-is/fimc-is-errno.c | 0 .../platform/{ => samsung}/exynos4-is/fimc-is-errno.h | 0 .../media/platform/{ => samsung}/exynos4-is/fimc-is-i2c.c | 0 .../media/platform/{ => samsung}/exynos4-is/fimc-is-i2c.h | 0 .../platform/{ => samsung}/exynos4-is/fimc-is-param.c | 0 .../platform/{ => samsung}/exynos4-is/fimc-is-param.h | 0 .../media/platform/{ => samsung}/exynos4-is/fimc-is-regs.c | 0 .../media/platform/{ => samsung}/exynos4-is/fimc-is-regs.h | 0 .../platform/{ => samsung}/exynos4-is/fimc-is-sensor.c | 0 .../platform/{ => samsung}/exynos4-is/fimc-is-sensor.h | 0 drivers/media/platform/{ => samsung}/exynos4-is/fimc-is.c | 0 drivers/media/platform/{ => samsung}/exynos4-is/fimc-is.h | 0 .../platform/{ => samsung}/exynos4-is/fimc-isp-video.c | 0 .../platform/{ => samsung}/exynos4-is/fimc-isp-video.h | 0 drivers/media/platform/{ => samsung}/exynos4-is/fimc-isp.c | 0 drivers/media/platform/{ => samsung}/exynos4-is/fimc-isp.h | 0 .../platform/{ => samsung}/exynos4-is/fimc-lite-reg.c | 0 .../platform/{ => samsung}/exynos4-is/fimc-lite-reg.h | 0 .../media/platform/{ => samsung}/exynos4-is/fimc-lite.c | 0 .../media/platform/{ => samsung}/exynos4-is/fimc-lite.h | 0 drivers/media/platform/{ => samsung}/exynos4-is/fimc-m2m.c | 0 drivers/media/platform/{ => samsung}/exynos4-is/fimc-reg.c | 0 drivers/media/platform/{ => samsung}/exynos4-is/fimc-reg.h | 0 .../media/platform/{ => samsung}/exynos4-is/media-dev.c | 0 .../media/platform/{ => samsung}/exynos4-is/media-dev.h | 0 .../media/platform/{ => samsung}/exynos4-is/mipi-csis.c | 0 .../media/platform/{ => samsung}/exynos4-is/mipi-csis.h | 0 40 files changed, 11 insertions(+), 11 deletions(-) commit 9b18ef7c9ff408df170ac339c57a759145c055d2 Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:15 2022 +0100 media: platform: rename tegra/vde/ to nvidia/tegra-vde/ As the end goal is to have platform drivers split by vendor, rename tegra/vde/ to nvidia/tegra-vde/. Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/nvidia/Makefile | 3 +++ drivers/media/platform/{tegra/vde => nvidia/tegra-vde}/Kconfig | 0 drivers/media/platform/{tegra/vde => nvidia/tegra-vde}/Makefile | 0 drivers/media/platform/{tegra/vde => nvidia/tegra-vde}/dmabuf-cache.c | 0 drivers/media/platform/{tegra/vde => nvidia/tegra-vde}/h264.c | 0 drivers/media/platform/{tegra/vde => nvidia/tegra-vde}/iommu.c | 0 drivers/media/platform/{tegra/vde => nvidia/tegra-vde}/trace.h | 2 +- drivers/media/platform/{tegra/vde => nvidia/tegra-vde}/v4l2.c | 0 drivers/media/platform/{tegra/vde => nvidia/tegra-vde}/vde.c | 0 drivers/media/platform/{tegra/vde => nvidia/tegra-vde}/vde.h | 0 13 files changed, 7 insertions(+), 4 deletions(-) commit 574476a7d05dcfb0d66e90e43c2d20262f183b23 Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:14 2022 +0100 media: platform: rename mtk-vpu/ to mediatek/mtk-vpu/ As the end goal is to have platform drivers split by vendor, rename mtk-vpu/ to mediatek/mtk-vpu/. Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 4 ++-- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/mediatek/mtk-mdp/Makefile | 2 +- drivers/media/platform/{ => mediatek}/mtk-vpu/Kconfig | 0 drivers/media/platform/{ => mediatek}/mtk-vpu/Makefile | 0 drivers/media/platform/{ => mediatek}/mtk-vpu/mtk_vpu.c | 0 drivers/media/platform/{ => mediatek}/mtk-vpu/mtk_vpu.h | 0 8 files changed, 5 insertions(+), 5 deletions(-) commit 728dc4075accb2821b595f650b5a6a64f42a9abe Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:13 2022 +0100 media: platform: rename mtk-vcodec/ to mediatek/mtk-vcodec/ As the end goal is to have platform drivers split by vendor, rename mtk-vcodec/ to mediatek/mtk-vcodec/. Acked-by: Nicolas Dufresne Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => mediatek}/mtk-vcodec/Kconfig | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/Makefile | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_dec.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_dec.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_dec_drv.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_dec_hw.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_dec_hw.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_dec_pm.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_dec_pm.h | 0 .../media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_dec_stateful.c | 0 .../media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_dec_stateless.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_drv.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_enc.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_enc.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_enc_drv.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_enc_pm.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_enc_pm.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_fw.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_fw.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_fw_priv.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_fw_scp.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_fw_vpu.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_intr.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_intr.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_util.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/mtk_vcodec_util.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec/vdec_h264_if.c | 0 .../media/platform/{ => mediatek}/mtk-vcodec/vdec/vdec_h264_req_if.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec/vdec_vp8_if.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec/vdec_vp9_if.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec_drv_base.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec_drv_if.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec_drv_if.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec_ipi_msg.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec_msg_queue.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec_msg_queue.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec_vpu_if.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/vdec_vpu_if.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/venc/venc_h264_if.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/venc/venc_vp8_if.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/venc_drv_base.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/venc_drv_if.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/venc_drv_if.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/venc_ipi_msg.h | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/venc_vpu_if.c | 0 drivers/media/platform/{ => mediatek}/mtk-vcodec/venc_vpu_if.h | 0 49 files changed, 3 insertions(+), 3 deletions(-) commit 1cb72963fa1e3667936d069333923787037e9ffb Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:13 2022 +0100 media: platform: rename mtk-mdp/ to mediatek/mtk-mdp/ As the end goal is to have platform drivers split by vendor, rename mtk-mdp/ to mediatek/mtk-mdp/. Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => mediatek}/mtk-mdp/Kconfig | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/Makefile | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_comp.c | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_comp.h | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_core.c | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_core.h | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_ipi.h | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_m2m.c | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_m2m.h | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_regs.c | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_regs.h | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_vpu.c | 0 drivers/media/platform/{ => mediatek}/mtk-mdp/mtk_mdp_vpu.h | 0 16 files changed, 3 insertions(+), 3 deletions(-) commit 8bbc139c6bde391d00835dd74e2326f50045cde4 Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:13 2022 +0100 media: platform: rename mtk-jpeg/ to mediatek/mtk-jpeg/ As the end goal is to have platform drivers split by vendor, rename mtk-jpeg/ to mediatek/mtk-jpeg/. Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{ => mediatek}/mtk-jpeg/Kconfig | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/Makefile | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/mtk_jpeg_core.c | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/mtk_jpeg_core.h | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/mtk_jpeg_dec_hw.c | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/mtk_jpeg_dec_hw.h | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/mtk_jpeg_dec_parse.c | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/mtk_jpeg_dec_parse.h | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/mtk_jpeg_dec_reg.h | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/mtk_jpeg_enc_hw.c | 0 drivers/media/platform/{ => mediatek}/mtk-jpeg/mtk_jpeg_enc_hw.h | 0 14 files changed, 3 insertions(+), 3 deletions(-) commit c1f3caff2450048ab6c053e5b23698b58f286159 Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:12 2022 +0100 media: platform: rename meson/ge2d/ to amlogic/meson-ge2d/ As the end goal is to have platform drivers split by vendor, rename meson/ge2d/ to amlogic/meson-ge2d/. Acked-by: Neil Armstrong Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{meson/ge2d => amlogic/meson-ge2d}/Kconfig | 0 drivers/media/platform/{meson/ge2d => amlogic/meson-ge2d}/Makefile | 0 drivers/media/platform/{meson/ge2d => amlogic/meson-ge2d}/ge2d-regs.h | 0 drivers/media/platform/{meson/ge2d => amlogic/meson-ge2d}/ge2d.c | 0 7 files changed, 3 insertions(+), 3 deletions(-) commit dc7bbea90075b57772e9a28043061bf71d96f06f Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:12 2022 +0100 media: platform: rename marvell-ccic/ to marvell/ As the end goal is to have platform drivers split by vendor, rename marvell-ccic/ to marvell/. Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 2 +- drivers/media/platform/{marvell-ccic => marvell}/Kconfig | 0 drivers/media/platform/{marvell-ccic => marvell}/Makefile | 0 drivers/media/platform/{marvell-ccic => marvell}/cafe-driver.c | 0 drivers/media/platform/{marvell-ccic => marvell}/mcam-core.c | 0 drivers/media/platform/{marvell-ccic => marvell}/mcam-core.h | 0 drivers/media/platform/{marvell-ccic => marvell}/mmp-driver.c | 0 9 files changed, 3 insertions(+), 3 deletions(-) commit 64441979bda6c2d17fa40c022f7debec6c328793 Author: Mauro Carvalho Chehab Date: Sun Mar 13 11:18:11 2022 +0100 media: platform: rename coda/ to chips-media/ As the end goal is to have platform drivers split by vendor, rename coda/ to chips-media/. Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 2 +- drivers/media/platform/Makefile | 4 ++-- drivers/media/platform/{coda => chips-media}/Kconfig | 0 drivers/media/platform/{coda => chips-media}/Makefile | 0 drivers/media/platform/{coda => chips-media}/coda-bit.c | 0 drivers/media/platform/{coda => chips-media}/coda-common.c | 0 drivers/media/platform/{coda => chips-media}/coda-gdi.c | 0 drivers/media/platform/{coda => chips-media}/coda-h264.c | 0 drivers/media/platform/{coda => chips-media}/coda-jpeg.c | 0 drivers/media/platform/{coda => chips-media}/coda-mpeg2.c | 0 drivers/media/platform/{coda => chips-media}/coda-mpeg4.c | 0 drivers/media/platform/{coda => chips-media}/coda.h | 0 drivers/media/platform/{coda => chips-media}/coda_regs.h | 2 +- drivers/media/platform/{coda => chips-media}/imx-vdoa.c | 0 drivers/media/platform/{coda => chips-media}/imx-vdoa.h | 0 drivers/media/platform/{coda => chips-media}/trace.h | 2 +- 17 files changed, 6 insertions(+), 6 deletions(-) commit d7700ca98d7a03eda24489a0eedaefda1a301629 Author: Mauro Carvalho Chehab Date: Sun Mar 13 06:47:32 2022 +0100 media: platform: Kconfig: place platform drivers on a submenu Just like media bus drivers, place platform drivers on a submenu, in order to better organize user-selection: Media drivers ---> *** media drivers *** [*] Media USB Adapters ---> [*] Media PCI Adapters ---> -*- Radio Adapters ---> [*] Media platform devices ---> *** MMC/SDIO DVB adapters *** < > Siano SMS1xxx based MDTV via SDIO interface [*] V4L test drivers ---> [*] DVB test drivers ---> *** FireWire (IEEE 1394) Adapters *** <*> FireDTV and FloppyDTV *** common driver options *** [ ] Enable Remote Controller support for Siano devices [ ] Enable debugfs for smsdvb As this submenu depends on MEDIA_PLATFORM_DRIVERS and defaults to "y", there's no need to change already-existing .config entries, nor touch the several make *_defconfig. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab drivers/media/Kconfig | 8 +++++--- drivers/media/platform/Kconfig | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) commit 0461b70d0697fab7742e1ea4a5f63351ea821e04 Author: Mauro Carvalho Chehab Date: Fri Mar 11 14:20:46 2022 +0100 media: platform: move some manufacturer entries As there are 4 manufacturer's directories with multiple sources (qcom, rockchip, sti and sunxi), move the sources from platform/Kconfig to their specific Konfig files. Acked-by: Jernej Skrabec Reviewed-by: Robert Foss Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 13 +++---------- drivers/media/platform/qcom/Kconfig | 4 ++++ drivers/media/platform/rockchip/Kconfig | 3 +++ drivers/media/platform/sti/Kconfig | 5 +++++ drivers/media/platform/sunxi/Kconfig | 2 ++ 5 files changed, 17 insertions(+), 10 deletions(-) commit 32ccd1f5a116eb5b848aa722e70f6a1ec91e590f Author: Mauro Carvalho Chehab Date: Fri Mar 11 14:16:38 2022 +0100 media: platform: Kconfig: sort entries Now that each non-generic driver has their own directory, sort the entries. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 90 ++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 51 deletions(-) commit f879856a91daa91156f9b81c7be3dbf4f31bcd20 Author: Mauro Carvalho Chehab Date: Fri Mar 11 13:38:15 2022 +0100 media: platform: s5p-jpeg: move config to its own file In order to better organize the platform/Kconfig, place s5p-jpeg-specific config stuff on a separate Kconfig file. Acked-by: Andrzej Pietrasiewicz Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 13 +------------ drivers/media/platform/s5p-jpeg/Kconfig | 12 ++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) commit 1d031da4f6e7ec7a83b6920d663e3baec11f6a98 Author: Mauro Carvalho Chehab Date: Fri Mar 11 13:36:27 2022 +0100 media: platform: s5p-mfc: move config to its own file In order to better organize the platform/Kconfig, place s5p-mfc-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 9 +-------- drivers/media/platform/s5p-mfc/Kconfig | 9 +++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) commit 26e89e83dfb4ff8ea8fa0cf71e17476958388302 Author: Mauro Carvalho Chehab Date: Fri Mar 11 13:34:39 2022 +0100 media: platform: bdisp: move config to its own file In order to better organize the platform/Kconfig, place bdisp-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 10 +--------- drivers/media/platform/sti/bdisp/Kconfig | 10 ++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) commit f5a6e9176e209a7658214e6955e236241085c166 Author: Mauro Carvalho Chehab Date: Fri Mar 11 13:29:17 2022 +0100 media: platform: delta: move config to its own file In order to better organize the platform/Kconfig, place delta-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 36 +------------------------------- drivers/media/platform/sti/delta/Kconfig | 36 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 35 deletions(-) commit 2662ce2d08760cf749e47265d6275317db335b65 Author: Mauro Carvalho Chehab Date: Fri Mar 11 13:24:31 2022 +0100 media: platform: rkisp1: move config to its own file In order to better organize the platform/Kconfig, place rkisp1-specific config stuff on a separate Kconfig file. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 20 +------------------- drivers/media/platform/rockchip/rkisp1/Kconfig | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) commit 5cccbe83ff2f3f1c6dddfbb83a7e81901908c4a7 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:49:30 2022 +0100 media: platform: ti-vpe: move config to its own file In order to better organize the platform/Kconfig, place ti-vpe-specific config stuff on a separate Kconfig file. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 60 +-------------------------------- drivers/media/platform/ti-vpe/Kconfig | 62 +++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 59 deletions(-) commit 669f0cb5ea2523bea75c8e89cad4f2545d37eb84 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:47:45 2022 +0100 media: platform: vde: move config to its own file In order to better organize the platform/Kconfig, place vde-specific config stuff on a separate Kconfig file. Acked-by: Dmitry Osipenko Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 19 +------------------ drivers/media/platform/tegra/vde/Kconfig | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) commit e19e7b615c9c6932391f361c1c15f91800172664 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:43:29 2022 +0100 media: platform: sun8i-rotate: move config to its own file In order to better organize the platform/Kconfig, place sun8i-rotate-specific config stuff on a separate Kconfig file. Acked-by: Jernej Skrabec Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 14 +------------- drivers/media/platform/sunxi/sun8i-rotate/Kconfig | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) commit 7acd0dd9e9c62225773cc3b2dbec9b7c38176fc6 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:41:19 2022 +0100 media: platform: sun8i-di: move config to its own file In order to better organize the platform/Kconfig, place sun8i-di-specific config stuff on a separate Kconfig file. Acked-by: Jernej Skrabec Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 15 +-------------- drivers/media/platform/sunxi/sun8i-di/Kconfig | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) commit 72a91079218c44bae6904adc1d10095524a57671 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:40:11 2022 +0100 media: platform: stm32: move config to its own file In order to better organize the platform/Kconfig, place stm32-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 29 +---------------------------- drivers/media/platform/stm32/Kconfig | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 28 deletions(-) commit a97f41e9c3087402ec6b8f5d6b8936bee5761bfd Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:38:45 2022 +0100 media: platform: hva: move config to its own file In order to better organize the platform/Kconfig, place hva-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 28 +--------------------------- drivers/media/platform/sti/hva/Kconfig | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 27 deletions(-) commit bbb9ecf2abe68ee44f60fe779689ff9796695f26 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:37:24 2022 +0100 media: platform: s5p-g2d: move config to its own file In order to better organize the platform/Kconfig, place s5p-g2d-specific config stuff on a separate Kconfig file. Acked-by: Łukasz Stelmach Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 11 +---------- drivers/media/platform/s5p-g2d/Kconfig | 11 +++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) commit f11de8611fd6bb15bd979bbe5de0c4d59452f8d4 Merge: f6d790e5a7fe 278da06c0365 Author: Dave Airlie Date: Fri Mar 18 13:44:07 2022 +1000 Merge tag 'drm-intel-next-fixes-2022-03-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Do not re-enable PSR after it was marked as not reliable (Jose) - Add missing boundary check in vm_access to avoid out-of-bounds access (Mastan) - Naming fix for HPD short pulse handling for eDP (Jose) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YjLnofpe5sMHX7Pt@jlahtine-mobl.ger.corp.intel.com commit 5a5c11ee3e655744dbee79b8caaadb15de3377eb Merge: 245d94965520 318c812cebfc Author: Alexei Starovoitov Date: Thu Mar 17 17:30:51 2022 -0700 Merge branch 'bpf: Add kprobe multi link' Jiri Olsa says: ==================== hi, this patchset adds new link type BPF_TRACE_KPROBE_MULTI that attaches kprobe program through fprobe API [1] instroduced by Masami. The fprobe API allows to attach probe on multiple functions at once very fast, because it works on top of ftrace. On the other hand this limits the probe point to the function entry or return. With bpftrace support I see following attach speed: # perf stat --null -r 5 ./src/bpftrace -e 'kprobe:x* { } i:ms:1 { exit(); } ' Attaching 2 probes... Attaching 3342 functions ... 1.4960 +- 0.0285 seconds time elapsed ( +- 1.91% ) v3 changes: - based on latest fprobe post from Masami [2] - add acks - add extra comment to kprobe_multi_link_handler wrt entry ip setup [Masami] - keep swap_words_64 static and swap values directly in bpf_kprobe_multi_cookie_swap [Andrii] - rearrange locking/migrate setup in kprobe_multi_link_prog_run [Andrii] - move uapi fields [Andrii] - add bpf_program__attach_kprobe_multi_opts function [Andrii] - many small test changes [Andrii] - added tests for bpf_program__attach_kprobe_multi_opts - make kallsyms_lookup_name check for empty string [Andrii] v2 changes: - based on latest fprobe changes [1] - renaming the uapi interface to kprobe multi - adding support for sort_r to pass user pointer for swap functions and using that in cookie support to keep just single functions array - moving new link to kernel/trace/bpf_trace.c file - using single fprobe callback function for entry and exit - using kvzalloc, libbpf_ensure_mem functions - adding new k[ret]probe.multi sections instead of using current kprobe - used glob_match from test_progs.c, added '?' matching - move bpf_get_func_ip verifier inline change to seprate change - couple of other minor fixes Also available at: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/kprobe_multi thanks, jirka [1] https://lore.kernel.org/bpf/164458044634.586276.3261555265565111183.stgit@devnote2/ [2] https://lore.kernel.org/bpf/164735281449.1084943.12438881786173547153.stgit@devnote2/ ==================== Signed-off-by: Alexei Starovoitov commit 318c812cebfcfdf42f254e6c1e6490a46e7714f8 Author: Jiri Olsa Date: Wed Mar 16 13:24:19 2022 +0100 selftests/bpf: Add cookie test for bpf_program__attach_kprobe_multi_opts Adding bpf_cookie test for programs attached by bpf_program__attach_kprobe_multi_opts API. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220316122419.933957-14-jolsa@kernel.org .../testing/selftests/bpf/prog_tests/bpf_cookie.c | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) commit 9271a0c7ae7a914782759d8fe22ef28fffab82fe Author: Jiri Olsa Date: Wed Mar 16 13:24:18 2022 +0100 selftests/bpf: Add attach test for bpf_program__attach_kprobe_multi_opts Adding tests for bpf_program__attach_kprobe_multi_opts function, that test attach with pattern, symbols and addrs. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220316122419.933957-13-jolsa@kernel.org .../selftests/bpf/prog_tests/kprobe_multi_test.c | 204 +++++++++++++++++++-- 1 file changed, 193 insertions(+), 11 deletions(-) commit 2c6401c966ae1fbe07eb3b8a07256dc41b596928 Author: Jiri Olsa Date: Wed Mar 16 13:24:17 2022 +0100 selftests/bpf: Add kprobe_multi bpf_cookie test Adding bpf_cookie test for programs attached by kprobe_multi links. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220316122419.933957-12-jolsa@kernel.org .../testing/selftests/bpf/prog_tests/bpf_cookie.c | 109 +++++++++++++++++++++ tools/testing/selftests/bpf/progs/kprobe_multi.c | 41 ++++---- 2 files changed, 131 insertions(+), 19 deletions(-) commit f7a11eeccb11185437f4da1c80b66b857d1e906f Author: Jiri Olsa Date: Wed Mar 16 13:24:16 2022 +0100 selftests/bpf: Add kprobe_multi attach test Adding kprobe_multi attach test that uses new fprobe interface to attach kprobe program to multiple functions. The test is attaching programs to bpf_fentry_test* functions and uses single trampoline program bpf_prog_test_run to trigger bpf_fentry_test* functions. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220316122419.933957-11-jolsa@kernel.org .../selftests/bpf/prog_tests/kprobe_multi_test.c | 141 +++++++++++++++++++++ tools/testing/selftests/bpf/progs/kprobe_multi.c | 95 ++++++++++++++ tools/testing/selftests/bpf/trace_helpers.c | 7 + 3 files changed, 243 insertions(+) commit ddc6b04989eb099368d3e6b6eaf5a6b181a36f91 Author: Jiri Olsa Date: Wed Mar 16 13:24:15 2022 +0100 libbpf: Add bpf_program__attach_kprobe_multi_opts function Adding bpf_program__attach_kprobe_multi_opts function for attaching kprobe program to multiple functions. struct bpf_link * bpf_program__attach_kprobe_multi_opts(const struct bpf_program *prog, const char *pattern, const struct bpf_kprobe_multi_opts *opts); User can specify functions to attach with 'pattern' argument that allows wildcards (*?' supported) or provide symbols or addresses directly through opts argument. These 3 options are mutually exclusive. When using symbols or addresses, user can also provide cookie value for each symbol/address that can be retrieved later in bpf program with bpf_get_attach_cookie helper. struct bpf_kprobe_multi_opts { size_t sz; const char **syms; const unsigned long *addrs; const __u64 *cookies; size_t cnt; bool retprobe; size_t :0; }; Symbols, addresses and cookies are provided through opts object (syms/addrs/cookies) as array pointers with specified count (cnt). Each cookie value is paired with provided function address or symbol with the same array index. The program can be also attached as return probe if 'retprobe' is set. For quick usage with NULL opts argument, like: bpf_program__attach_kprobe_multi_opts(prog, "ksys_*", NULL) the 'prog' will be attached as kprobe to 'ksys_*' functions. Also adding new program sections for automatic attachment: kprobe.multi/ kretprobe.multi/ The symbol_pattern is used as 'pattern' argument in bpf_program__attach_kprobe_multi_opts function. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220316122419.933957-10-jolsa@kernel.org tools/lib/bpf/libbpf.c | 160 +++++++++++++++++++++++++++++++++++++++++++++++ tools/lib/bpf/libbpf.h | 23 +++++++ tools/lib/bpf/libbpf.map | 1 + 3 files changed, 184 insertions(+) commit 5117c26e877352bcabd4871e6bcdebed4857a88d Author: Jiri Olsa Date: Wed Mar 16 13:24:14 2022 +0100 libbpf: Add bpf_link_create support for multi kprobes Adding new kprobe_multi struct to bpf_link_create_opts object to pass multiple kprobe data to link_create attr uapi. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220316122419.933957-9-jolsa@kernel.org tools/lib/bpf/bpf.c | 9 +++++++++ tools/lib/bpf/bpf.h | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) commit 85153ac06283408e6ccaf002b02fd85f0bdab94b Author: Jiri Olsa Date: Wed Mar 16 13:24:13 2022 +0100 libbpf: Add libbpf_kallsyms_parse function Move the kallsyms parsing in internal libbpf_kallsyms_parse function, so it can be used from other places. It will be used in following changes. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220316122419.933957-8-jolsa@kernel.org tools/lib/bpf/libbpf.c | 62 +++++++++++++++++++++++++---------------- tools/lib/bpf/libbpf_internal.h | 5 ++++ 2 files changed, 43 insertions(+), 24 deletions(-) commit ca74823c6e16dd42b7cf60d9fdde80e2a81a67bb Author: Jiri Olsa Date: Wed Mar 16 13:24:12 2022 +0100 bpf: Add cookie support to programs attached with kprobe multi link Adding support to call bpf_get_attach_cookie helper from kprobe programs attached with kprobe multi link. The cookie is provided by array of u64 values, where each value is paired with provided function address or symbol with the same array index. When cookie array is provided it's sorted together with addresses (check bpf_kprobe_multi_cookie_swap). This way we can find cookie based on the address in bpf_get_attach_cookie helper. Suggested-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220316122419.933957-7-jolsa@kernel.org include/uapi/linux/bpf.h | 1 + kernel/bpf/syscall.c | 2 +- kernel/trace/bpf_trace.c | 114 ++++++++++++++++++++++++++++++++++++++++- tools/include/uapi/linux/bpf.h | 1 + 4 files changed, 116 insertions(+), 2 deletions(-) commit 97ee4d20ee67eb462581a7af01442de6586e390b Author: Jiri Olsa Date: Wed Mar 16 13:24:11 2022 +0100 bpf: Add support to inline bpf_get_func_ip helper on x86 Adding support to inline it on x86, because it's single load instruction. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220316122419.933957-6-jolsa@kernel.org kernel/bpf/verifier.c | 21 ++++++++++++++++++++- kernel/trace/bpf_trace.c | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) commit 42a5712094e89ef0a125ac0f9d0873f9233368b1 Author: Jiri Olsa Date: Wed Mar 16 13:24:10 2022 +0100 bpf: Add bpf_get_func_ip kprobe helper for multi kprobe link Adding support to call bpf_get_func_ip helper from kprobe programs attached by multi kprobe link. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220316122419.933957-5-jolsa@kernel.org kernel/trace/bpf_trace.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) commit 245d94965520a808f749a62f5ec41c9ae425925a Merge: e0999c8e5909 f4616fabab39 Author: Alexei Starovoitov Date: Thu Mar 17 17:23:13 2022 -0700 Merge branch 'fprobe: Introduce fprobe function entry/exit probe' Masami Hiramatsu says: ==================== Hi, Here is the 12th version of fprobe. This version fixes a possible gcc-11 issue which was reported as kretprobes on arm issue, and also I updated the fprobe document. The previous version (v11) is here[1]; [1] https://lore.kernel.org/all/164701432038.268462.3329725152949938527.stgit@devnote2/T/#u This series introduces the fprobe, the function entry/exit probe with multiple probe point support for x86, arm64 and powerpc64le. This also introduces the rethook for hooking function return as same as the kretprobe does. This abstraction will help us to generalize the fgraph tracer, because we can just switch to it from the rethook in fprobe, depending on the kernel configuration. The patch [1/12] is from Jiri's series[2]. [2] https://lore.kernel.org/all/20220104080943.113249-1-jolsa@kernel.org/T/#u And the patch [9/10] adds the FPROBE_FL_KPROBE_SHARED flag for the case if user wants to share the same code (or share a same resource) on the fprobe and the kprobes. I forcibly updated my kprobes/fprobe branch, you can pull this series from: https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/fprobe Thank you, --- Jiri Olsa (1): ftrace: Add ftrace_set_filter_ips function ==================== Signed-off-by: Alexei Starovoitov commit 0dcac272540613d41c05e89679e4ddb978b612f1 Author: Jiri Olsa Date: Wed Mar 16 13:24:09 2022 +0100 bpf: Add multi kprobe link Adding new link type BPF_LINK_TYPE_KPROBE_MULTI that attaches kprobe program through fprobe API. The fprobe API allows to attach probe on multiple functions at once very fast, because it works on top of ftrace. On the other hand this limits the probe point to the function entry or return. The kprobe program gets the same pt_regs input ctx as when it's attached through the perf API. Adding new attach type BPF_TRACE_KPROBE_MULTI that allows attachment kprobe to multiple function with new link. User provides array of addresses or symbols with count to attach the kprobe program to. The new link_create uapi interface looks like: struct { __u32 flags; __u32 cnt; __aligned_u64 syms; __aligned_u64 addrs; } kprobe_multi; The flags field allows single BPF_TRACE_KPROBE_MULTI bit to create return multi kprobe. Signed-off-by: Masami Hiramatsu Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220316122419.933957-4-jolsa@kernel.org include/linux/bpf_types.h | 1 + include/linux/trace_events.h | 7 ++ include/uapi/linux/bpf.h | 13 +++ kernel/bpf/syscall.c | 26 ++++- kernel/trace/bpf_trace.c | 211 +++++++++++++++++++++++++++++++++++++++++ tools/include/uapi/linux/bpf.h | 13 +++ 6 files changed, 266 insertions(+), 5 deletions(-) commit aecf489f2ce51436402818c96639ed6303b540f8 Author: Jiri Olsa Date: Wed Mar 16 13:24:08 2022 +0100 kallsyms: Skip the name search for empty string When kallsyms_lookup_name is called with empty string, it will do futile search for it through all the symbols. Skipping the search for empty string. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220316122419.933957-3-jolsa@kernel.org kernel/kallsyms.c | 4 ++++ 1 file changed, 4 insertions(+) commit a0019cd7d41a191253859349535d76ee28ab7d96 Author: Jiri Olsa Date: Wed Mar 16 13:24:07 2022 +0100 lib/sort: Add priv pointer to swap function Adding support to have priv pointer in swap callback function. Following the initial change on cmp callback functions [1] and adding SWAP_WRAPPER macro to identify sort call of sort_r. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Reviewed-by: Masami Hiramatsu Link: https://lore.kernel.org/bpf/20220316122419.933957-2-jolsa@kernel.org [1] 4333fb96ca10 ("media: lib/sort.c: implement sort() variant taking context argument") include/linux/sort.h | 2 +- include/linux/types.h | 1 + lib/sort.c | 40 ++++++++++++++++++++++++++++++---------- 3 files changed, 32 insertions(+), 11 deletions(-) commit f4616fabab39e084b5d7e15a32151d9a9aeab537 Author: Masami Hiramatsu Date: Tue Mar 15 23:02:35 2022 +0900 fprobe: Add a selftest for fprobe Add a KUnit based selftest for fprobe interface. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735295554.1084943.18347620679928750960.stgit@devnote2 lib/Kconfig.debug | 12 ++++ lib/Makefile | 2 + lib/test_fprobe.c | 174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 188 insertions(+) commit aba09b44a985f963f3ce22132694161f79e18984 Author: Masami Hiramatsu Date: Tue Mar 15 23:02:22 2022 +0900 docs: fprobe: Add fprobe description to ftrace-use.rst Add a documentation of fprobe for the user who needs this interface. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735294272.1084943.12372175959382037397.stgit@devnote2 Documentation/trace/fprobe.rst | 174 +++++++++++++++++++++++++++++++++++++++++ Documentation/trace/index.rst | 1 + 2 files changed, 175 insertions(+) commit ab51e15d535e07be9839e0df056a4ebe9c5bac83 Author: Masami Hiramatsu Date: Tue Mar 15 23:02:11 2022 +0900 fprobe: Introduce FPROBE_FL_KPROBE_SHARED flag for fprobe Introduce FPROBE_FL_KPROBE_SHARED flag for sharing fprobe callback with kprobes safely from the viewpoint of recursion. Since the recursion safety of the fprobe (and ftrace) is a bit different from the kprobes, this may cause an issue if user wants to run the same code from the fprobe and the kprobes. The kprobes has per-cpu 'current_kprobe' variable which protects the kprobe handler from recursion in any case. On the other hand, the fprobe uses only ftrace_test_recursion_trylock(), which will allow interrupt context calls another (or same) fprobe during the fprobe user handler is running. This is not a matter in cases if the common callback shared among the kprobes and the fprobe has its own recursion detection, or it can handle the recursion in the different contexts (normal/interrupt/NMI.) But if it relies on the 'current_kprobe' recursion lock, it has to check kprobe_running() and use kprobe_busy_*() APIs. Fprobe has FPROBE_FL_KPROBE_SHARED flag to do this. If your common callback code will be shared with kprobes, please set FPROBE_FL_KPROBE_SHARED *before* registering the fprobe, like; fprobe.flags = FPROBE_FL_KPROBE_SHARED; register_fprobe(&fprobe, "func*", NULL); This will protect your common callback from the nested call. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735293127.1084943.15687374237275817599.stgit@devnote2 include/linux/fprobe.h | 12 ++++++++++++ include/linux/kprobes.h | 3 +++ kernel/trace/fprobe.c | 19 ++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) commit 6ee64cc3020b5b5537827c71d8eaac814ad4d346 Author: Masami Hiramatsu Date: Tue Mar 15 23:02:00 2022 +0900 fprobe: Add sample program for fprobe Add a sample program for the fprobe. The sample_fprobe puts a fprobe on kernel_clone() by default. This dump stack and some called address info at the function entry and exit. The sample_fprobe.ko gets 2 parameters. - symbol: you can specify the comma separated symbols or wildcard symbol pattern (in this case you can not use comma) - stackdump: a bool value to enable or disable stack dump in the fprobe handler. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735291987.1084943.4449670993752806840.stgit@devnote2 samples/Kconfig | 7 +++ samples/Makefile | 1 + samples/fprobe/Makefile | 3 + samples/fprobe/fprobe_example.c | 120 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+) commit 5b0ab78998e32564a011b14c4c7f9c81e2d42b9d Author: Masami Hiramatsu Date: Tue Mar 15 23:01:48 2022 +0900 fprobe: Add exit_handler support Add exit_handler to fprobe. fprobe + rethook allows us to hook the kernel function return. The rethook will be enabled only if the fprobe::exit_handler is set. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735290790.1084943.10601965782208052202.stgit@devnote2 include/linux/fprobe.h | 6 +++ kernel/trace/Kconfig | 9 ++-- kernel/trace/fprobe.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 122 insertions(+), 9 deletions(-) commit 515a49173b80a4aabcbad9a4fa2a247042378ea1 Author: Masami Hiramatsu Date: Tue Mar 15 23:01:36 2022 +0900 ARM: rethook: Add rethook arm implementation Add rethook arm implementation. Most of the code has been copied from kretprobes on arm. Since the arm's ftrace implementation is a bit special, this needs a special care using from fprobe. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735289643.1084943.15184590256680485720.stgit@devnote2 arch/arm/Kconfig | 1 + arch/arm/include/asm/stacktrace.h | 4 +- arch/arm/kernel/stacktrace.c | 6 +++ arch/arm/probes/Makefile | 1 + arch/arm/probes/rethook.c | 103 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 113 insertions(+), 2 deletions(-) commit 02752bd99dc2daae05c12f7063bf0632e22b4c1c Author: Masami Hiramatsu Date: Tue Mar 15 23:01:25 2022 +0900 powerpc: Add rethook support Add rethook powerpc64 implementation. Most of the code has been copied from kretprobes on powerpc64. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735288495.1084943.539630613772422267.stgit@devnote2 arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/Makefile | 1 + arch/powerpc/kernel/rethook.c | 72 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) commit 83acdce6894908337ca82973149d9709d28204d7 Author: Masami Hiramatsu Date: Tue Mar 15 23:01:13 2022 +0900 arm64: rethook: Add arm64 rethook implementation Add rethook arm64 implementation. Most of the code has been copied from kretprobes on arm64. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735287344.1084943.9787335632585653418.stgit@devnote2 arch/arm64/Kconfig | 1 + arch/arm64/include/asm/stacktrace.h | 2 +- arch/arm64/kernel/probes/Makefile | 1 + arch/arm64/kernel/probes/rethook.c | 25 ++++++++ arch/arm64/kernel/probes/rethook_trampoline.S | 87 +++++++++++++++++++++++++++ arch/arm64/kernel/stacktrace.c | 7 ++- 6 files changed, 121 insertions(+), 2 deletions(-) commit 75caf33eda242e2f34f61e475d666359749ae5ff Author: Masami Hiramatsu Date: Tue Mar 15 23:01:02 2022 +0900 rethook: x86: Add rethook x86 implementation Add rethook for x86 implementation. Most of the code has been copied from kretprobes on x86. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735286243.1084943.7477055110527046644.stgit@devnote2 arch/x86/Kconfig | 1 + arch/x86/include/asm/unwind.h | 8 ++- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/kprobes/common.h | 1 + arch/x86/kernel/rethook.c | 119 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 129 insertions(+), 1 deletion(-) commit 54ecbe6f1ed5138c895bdff55608cf502755b20e Author: Masami Hiramatsu Date: Tue Mar 15 23:00:50 2022 +0900 rethook: Add a generic return hook Add a return hook framework which hooks the function return. Most of the logic came from the kretprobe, but this is independent from kretprobe. Note that this is expected to be used with other function entry hooking feature, like ftrace, fprobe, adn kprobes. Eventually this will replace the kretprobe (e.g. kprobe + rethook = kretprobe), but at this moment, this is just an additional hook. Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735285066.1084943.9259661137330166643.stgit@devnote2 include/linux/rethook.h | 100 +++++++++++++++ include/linux/sched.h | 3 + kernel/exit.c | 2 + kernel/fork.c | 3 + kernel/trace/Kconfig | 11 ++ kernel/trace/Makefile | 1 + kernel/trace/rethook.c | 317 ++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 437 insertions(+) commit cad9931f64dc7f5dbdec12cae9f30063360f9855 Author: Masami Hiramatsu Date: Tue Mar 15 23:00:38 2022 +0900 fprobe: Add ftrace based probe APIs The fprobe is a wrapper API for ftrace function tracer. Unlike kprobes, this probes only supports the function entry, but this can probe multiple functions by one fprobe. The usage is similar, user will set their callback to fprobe::entry_handler and call register_fprobe*() with probed functions. There are 3 registration interfaces, - register_fprobe() takes filtering patterns of the functin names. - register_fprobe_ips() takes an array of ftrace-location addresses. - register_fprobe_syms() takes an array of function names. The registered fprobes can be unregistered with unregister_fprobe(). e.g. struct fprobe fp = { .entry_handler = user_handler }; const char *targets[] = { "func1", "func2", "func3"}; ... ret = register_fprobe_syms(&fp, targets, ARRAY_SIZE(targets)); ... unregister_fprobe(&fp); Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735283857.1084943.1154436951479395551.stgit@devnote2 include/linux/fprobe.h | 87 ++++++++++++++++++++ kernel/trace/Kconfig | 12 +++ kernel/trace/Makefile | 1 + kernel/trace/fprobe.c | 211 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 311 insertions(+) commit 4f554e955614f19425cee86de4669351741a6280 Author: Jiri Olsa Date: Tue Mar 15 23:00:26 2022 +0900 ftrace: Add ftrace_set_filter_ips function Adding ftrace_set_filter_ips function to be able to set filter on multiple ip addresses at once. With the kprobe multi attach interface we have cases where we need to initialize ftrace_ops object with thousands of functions, so having single function diving into ftrace_hash_move_and_update_ops with ftrace_lock is faster. The functions ips are passed as unsigned long array with count. Signed-off-by: Jiri Olsa Signed-off-by: Steven Rostedt (Google) Tested-by: Steven Rostedt (Google) Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164735282673.1084943.18310504594134769804.stgit@devnote2 include/linux/ftrace.h | 3 +++ kernel/trace/ftrace.c | 58 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 52 insertions(+), 9 deletions(-) commit ae53aea611b7a532a52ba966281a8b7a8cfd008a Merge: bcfe9b6cbb44 ce8d78616a6b Author: Jens Axboe Date: Thu Mar 17 20:46:22 2022 -0600 Merge tag 'nvme-5.18-2022-03-17' of git://git.infradead.org/nvme into for-5.18/drivers Pull NVMe updates from Christoph: "Second round of nvme updates for Linux 5.18 - add lockdep annotations for in-kernel sockets (Chris Leech) - use vmalloc for ANA log buffer (Hannes Reinecke) - kerneldoc fixes (Chaitanya Kulkarni) - cleanups (Guoqing Jiang, Chaitanya Kulkarni, me) - warn about shared namespaces without multipathing (me)" * tag 'nvme-5.18-2022-03-17' of git://git.infradead.org/nvme: nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH nvme: remove nvme_alloc_request and nvme_alloc_request_qid nvme: cleanup how disk->disk_name is assigned nvmet: move the call to nvmet_ns_changed out of nvmet_ns_revalidate nvmet: use snprintf() with PAGE_SIZE in configfs nvmet: don't fold lines nvmet-rdma: fix kernel-doc warning for nvmet_rdma_device_removal nvmet-fc: fix kernel-doc warning for nvmet_fc_unregister_targetport nvmet-fc: fix kernel-doc warning for nvmet_fc_register_targetport nvme-tcp: lockdep: annotate in-kernel sockets nvme-tcp: don't fold the line nvme-tcp: don't initialize ret variable nvme-multipath: call bio_io_error in nvme_ns_head_submit_bio nvme-multipath: use vmalloc for ANA log buffer commit 572299f03afd676dd4e20669cdaf5ed0fe1379d4 Author: Shin'ichiro Kawasaki Date: Fri Mar 18 11:26:41 2022 +0900 block: limit request dispatch loop duration When IO requests are made continuously and the target block device handles requests faster than request arrival, the request dispatch loop keeps on repeating to dispatch the arriving requests very long time, more than a minute. Since the loop runs as a workqueue worker task, the very long loop duration triggers workqueue watchdog timeout and BUG [1]. To avoid the very long loop duration, break the loop periodically. When opportunity to dispatch requests still exists, check need_resched(). If need_resched() returns true, the dispatch loop already consumed its time slice, then reschedule the dispatch work and break the loop. With heavy IO load, need_resched() does not return true for 20~30 seconds. To cover such case, check time spent in the dispatch loop with jiffies. If more than 1 second is spent, reschedule the dispatch work and break the loop. [1] [ 609.691437] BUG: workqueue lockup - pool cpus=10 node=1 flags=0x0 nice=-20 stuck for 35s! [ 609.701820] Showing busy workqueues and worker pools: [ 609.707915] workqueue events: flags=0x0 [ 609.712615] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2 [ 609.712626] pending: drm_fb_helper_damage_work [drm_kms_helper] [ 609.712687] workqueue events_freezable: flags=0x4 [ 609.732943] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2 [ 609.732952] pending: pci_pme_list_scan [ 609.732968] workqueue events_power_efficient: flags=0x80 [ 609.751947] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2 [ 609.751955] pending: neigh_managed_work [ 609.752018] workqueue kblockd: flags=0x18 [ 609.769480] pwq 21: cpus=10 node=1 flags=0x0 nice=-20 active=3/256 refcnt=4 [ 609.769488] in-flight: 1020:blk_mq_run_work_fn [ 609.769498] pending: blk_mq_timeout_work, blk_mq_run_work_fn [ 609.769744] pool 21: cpus=10 node=1 flags=0x0 nice=-20 hung=35s workers=2 idle: 67 [ 639.899730] BUG: workqueue lockup - pool cpus=10 node=1 flags=0x0 nice=-20 stuck for 66s! [ 639.909513] Showing busy workqueues and worker pools: [ 639.915404] workqueue events: flags=0x0 [ 639.920197] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 refcnt=2 [ 639.920215] pending: drm_fb_helper_damage_work [drm_kms_helper] [ 639.920365] workqueue kblockd: flags=0x18 [ 639.939932] pwq 21: cpus=10 node=1 flags=0x0 nice=-20 active=3/256 refcnt=4 [ 639.939942] in-flight: 1020:blk_mq_run_work_fn [ 639.939955] pending: blk_mq_timeout_work, blk_mq_run_work_fn [ 639.940212] pool 21: cpus=10 node=1 flags=0x0 nice=-20 hung=66s workers=2 idle: 67 Fixes: 6e6fcbc27e778 ("blk-mq: support batching dispatch in case of io") Signed-off-by: Shin'ichiro Kawasaki Cc: stable@vger.kernel.org # v5.10+ Link: https://lore.kernel.org/linux-block/20220310091649.zypaem5lkyfadymg@shindev/ Link: https://lore.kernel.org/r/20220318022641.133484-1-shinichiro.kawasaki@wdc.com Signed-off-by: Jens Axboe block/blk-mq-sched.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 3e66fd54aeac0519de638a12d84778d8991bedad Merge: 2b341f7532d4 5e497497681e Author: Jakub Kicinski Date: Thu Mar 17 17:42:50 2022 -0700 Merge branch 'mirroring-for-ocelot-switches' Vladimir Oltean says: ==================== Mirroring for Ocelot switches This series adds support for tc-matchall (port-based) and tc-flower (flow-based) offloading of the tc-mirred action. Support has been added for both the ocelot switchdev driver and felix DSA driver. ==================== Link: https://lore.kernel.org/r/20220316204144.2679277-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 5e497497681ea0515d5ff70e54e0305f2b83cfb8 Author: Vladimir Oltean Date: Wed Mar 16 22:41:44 2022 +0200 net: dsa: felix: add port mirroring support Gain support for port mirroring using tc-matchall by forwarding the calls to the ocelot switch library. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/dsa/ocelot/felix.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) commit 0148bb50b8fd51baf357de8b237c0c6011506540 Author: Vladimir Oltean Date: Wed Mar 16 22:41:43 2022 +0200 net: dsa: pass extack to dsa_switch_ops :: port_mirror_add() Drivers might have error messages to propagate to user space, most common being that they support a single mirror port. Propagate the netlink extack so that they can inform user space in a verbal way of their limitations. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/dsa/b53/b53_common.c | 3 ++- drivers/net/dsa/b53/b53_priv.h | 3 ++- drivers/net/dsa/microchip/ksz8795.c | 2 +- drivers/net/dsa/microchip/ksz9477.c | 2 +- drivers/net/dsa/mt7530.c | 2 +- drivers/net/dsa/mv88e6xxx/chip.c | 3 ++- drivers/net/dsa/qca8k.c | 2 +- drivers/net/dsa/sja1105/sja1105_main.c | 2 +- include/net/dsa.h | 2 +- net/dsa/slave.c | 3 ++- 10 files changed, 14 insertions(+), 10 deletions(-) commit f2a0e216bee5d95e2c2d916a8815a659cd3703c2 Author: Vladimir Oltean Date: Wed Mar 16 22:41:42 2022 +0200 net: mscc: ocelot: offload per-flow mirroring using tc-mirred and VCAP IS2 Per-flow mirroring with the VCAP IS2 TCAM (in itself handled as an offload for tc-flower) is done by setting the MIRROR_ENA bit from the action vector of the filter. The packet is mirrored to the port mask configured in the ANA:ANA:MIRRORPORTS register (the same port mask as the destinations for port-based mirroring). Functionality was tested with: tc qdisc add dev swp3 clsact tc filter add dev swp3 ingress protocol ip \ flower skip_sw ip_proto icmp \ action mirred egress mirror dev swp1 and pinging through swp3, while seeing that the ICMP replies are mirrored towards swp1. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/ethernet/mscc/ocelot.c | 6 +++--- drivers/net/ethernet/mscc/ocelot.h | 4 ++++ drivers/net/ethernet/mscc/ocelot_flower.c | 21 +++++++++++++++++++++ drivers/net/ethernet/mscc/ocelot_vcap.c | 12 ++++++++++++ include/soc/mscc/ocelot_vcap.h | 2 ++ 5 files changed, 42 insertions(+), 3 deletions(-) commit c3d427eac90f8788f510d8d26931afd117bb6406 Author: Vladimir Oltean Date: Wed Mar 16 22:41:41 2022 +0200 net: mscc: ocelot: establish functions for handling VCAP aux resources Some VCAP filters utilize resources which are global to the switch, like for example VCAP IS2 policers take an index into a global policer pool. In commit c9a7fe1238e5 ("net: mscc: ocelot: add action of police on vcap_is2"), Xiaoliang expressed this by hooking into the low-level ocelot_vcap_filter_add_to_block() and ocelot_vcap_block_remove_filter() functions, and allocating/freeing the policers from there. Evaluating the code, there probably isn't a better place, but we'll need to do something similar for the mirror ports, and the code will start to look even more hacked up than it is right now. Create two ocelot_vcap_filter_{add,del}_aux_resources() functions to contain the madness, and pollute less the body of other functions such as ocelot_vcap_filter_add_to_block(). Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/ethernet/mscc/ocelot_vcap.c | 41 ++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 11 deletions(-) commit ccb6ed426f10ac4f742efa7d897c266aa10ac64a Author: Vladimir Oltean Date: Wed Mar 16 22:41:40 2022 +0200 net: mscc: ocelot: add port mirroring support using tc-matchall Ocelot switches perform port-based ingress mirroring if ANA:PORT:PORT_CFG field SRC_MIRROR_ENA is set, and egress mirroring if the port is in ANA:ANA:EMIRRORPORTS. Both ingress-mirrored and egress-mirrored frames are copied to the port mask from ANA:ANA:MIRRORPORTS. So the choice of limiting to a single mirror port via ocelot_mirror_get() and ocelot_mirror_put() may seem bizarre, but the hardware model doesn't map very well to the user space model. If the user wants to mirror the ingress of swp1 towards swp2 and the ingress of swp3 towards swp4, we'd have to program ANA:ANA:MIRRORPORTS with BIT(2) | BIT(4), and that would make swp1 be mirrored towards swp4 too, and swp3 towards swp2. But there are no tc-matchall rules to describe those actions. Now, we could offload a matchall rule with multiple mirred actions, one per desired mirror port, and force the user to stick to the multi-action rule format for subsequent matchall filters. But both DSA and ocelot have the flow_offload_has_one_action() check for the matchall offload, plus the fact that it will get cumbersome to cross-check matchall mirrors with flower mirrors (which will be added in the next patch). As a result, we limit the configuration to a single mirror port, with the possibility of lifting the restriction in the future. Frames injected from the CPU don't get egress-mirrored, since they are sent with the BYPASS bit in the injection frame header, and this bypasses the analyzer module (effectively also the mirroring logic). I don't know what to do/say about this. Functionality was tested with: tc qdisc add dev swp3 clsact tc filter add dev swp3 ingress \ matchall skip_sw \ action mirred egress mirror dev swp1 and pinging through swp3, while seeing that the ICMP replies are mirrored towards swp1. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/ethernet/mscc/ocelot.c | 76 ++++++++++++++++++++++++++++++++++ drivers/net/ethernet/mscc/ocelot.h | 3 +- drivers/net/ethernet/mscc/ocelot_net.c | 73 +++++++++++++++++++++++++++++++- include/soc/mscc/ocelot.h | 9 ++++ 4 files changed, 159 insertions(+), 2 deletions(-) commit 4fa72108029c090d581fdb2d7ce267ef6cb8acdd Author: Vladimir Oltean Date: Wed Mar 16 22:41:39 2022 +0200 net: mscc: ocelot: refactor policer work out of ocelot_setup_tc_cls_matchall In preparation for adding port mirroring support to the ocelot driver, the dispatching function ocelot_setup_tc_cls_matchall() must be free of action-specific code. Move port policer creation and deletion to separate functions. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski drivers/net/ethernet/mscc/ocelot_net.c | 110 +++++++++++++++++++++------------ 1 file changed, 71 insertions(+), 39 deletions(-) commit 2b341f7532d4f6c8b84206daad202a745962b844 Author: Jonathan Lemon Date: Wed Mar 16 09:53:47 2022 -0700 ptp: ocp: Make debugfs variables the correct bitwidth An earlier patch mistakenly changed these variables from u32 to u16, leading to unintended truncation. Restore the original logic. Fixes: a509a7c61e3b ("ptp: ocp: Add support for selectable SMA directions.") Reported-by: Dan Carpenter Signed-off-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220316165347.599154-1-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski drivers/ptp/ptp_ocp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 7b6e6235b6641284b28f6a2bbd6b823a2081bd5c Author: Oleksij Rempel Date: Wed Mar 16 13:55:29 2022 +0100 net: dsa: microchip: ksz8795: handle eee specif erratum According to erratum described in DS80000687C[1]: "Module 2: Link drops with some EEE link partners.", we need to "Disable the EEE next page exchange in EEE Global Register 2" 1 - https://ww1.microchip.com/downloads/en/DeviceDoc/KSZ87xx-Errata-DS80000687C.pdf Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220316125529.1489045-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski drivers/net/dsa/microchip/ksz8.h | 1 + drivers/net/dsa/microchip/ksz8795.c | 45 ++++++++++++++++++++++++++++++++- drivers/net/dsa/microchip/ksz8795_reg.h | 4 +++ drivers/net/dsa/microchip/ksz_common.h | 1 + 4 files changed, 50 insertions(+), 1 deletion(-) commit 82e94d4144d7a29e6e955e4b2ea681ed3f16d689 Merge: 54744510fa9c acaf4d2e36b3 Author: Jakub Kicinski Date: Thu Mar 17 16:50:03 2022 -0700 Merge branch 'net-bridge-multiple-spanning-trees' Tobias Waldekranz says: ==================== net: bridge: Multiple Spanning Trees The bridge has had per-VLAN STP support for a while now, since: https://lore.kernel.org/netdev/20200124114022.10883-1-nikolay@cumulusnetworks.com/ The current implementation has some problems: - The mapping from VLAN to STP state is fixed as 1:1, i.e. each VLAN is managed independently. This is awkward from an MSTP (802.1Q-2018, Clause 13.5) point of view, where the model is that multiple VLANs are grouped into MST instances. Because of the way that the standard is written, presumably, this is also reflected in hardware implementations. It is not uncommon for a switch to support the full 4k range of VIDs, but that the pool of MST instances is much smaller. Some examples: Marvell LinkStreet (mv88e6xxx): 4k VLANs, but only 64 MSTIs Marvell Prestera: 4k VLANs, but only 128 MSTIs Microchip SparX-5i: 4k VLANs, but only 128 MSTIs - By default, the feature is enabled, and there is no way to disable it. This makes it hard to add offloading in a backwards compatible way, since any underlying switchdevs have no way to refuse the function if the hardware does not support it - The port-global STP state has precedence over per-VLAN states. In MSTP, as far as I understand it, all VLANs will use the common spanning tree (CST) by default - through traffic engineering you can then optimize your network to group subsets of VLANs to use different trees (MSTI). To my understanding, the way this is typically managed in silicon is roughly: Incoming packet: .----.----.--------------.----.------------- | DA | SA | 802.1Q VID=X | ET | Payload ... '----'----'--------------'----'------------- | '->|\ .----------------------------. | +--> | VID | Members | ... | MSTI | PVID -->|/ |-----|---------|-----|------| | 1 | 0001001 | ... | 0 | | 2 | 0001010 | ... | 10 | | 3 | 0001100 | ... | 10 | '----------------------------' | .-----------------------------' | .------------------------. '->| MSTI | Fwding | Lrning | |------|--------|--------| | 0 | 111110 | 111110 | | 10 | 110111 | 110111 | '------------------------' What this is trying to show is that the STP state (whether MSTP is used, or ye olde STP) is always accessed via the VLAN table. If STP is running, all MSTI pointers in that table will reference the same index in the STP stable - if MSTP is running, some VLANs may point to other trees (like in this example). The fact that in the Linux bridge, the global state (think: index 0 in most hardware implementations) is supposed to override the per-VLAN state, is very awkward to offload. In effect, this means that when the global state changes to blocking, drivers will have to iterate over all MSTIs in use, and alter them all to match. This also means that you have to cache whether the hardware state is currently tracking the global state or the per-VLAN state. In the first case, you also have to cache the per-VLAN state so that you can restore it if the global state transitions back to forwarding. This series adds a new mst_enable bridge setting (as suggested by Nik) that can only be changed when no VLANs are configured on the bridge. Enabling this mode has the following effect: - The port-global STP state is used to represent the CST (Common Spanning Tree) (1/15) - Ingress STP filtering is deferred until the frame's VLAN has been resolved (1/15) - The preexisting per-VLAN states can no longer be controlled directly (1/15). They are instead placed under the MST module's control, which is managed using a new netlink interface (described in 3/15) - VLANs can br mapped to MSTIs in an arbitrary M:N fashion, using a new global VLAN option (2/15) Switchdev notifications are added so that a driver can track: - MST enabled state - VID to MSTI mappings - MST port states An offloading implementation is this provided for mv88e6xxx. ==================== Link: https://lore.kernel.org/r/20220316150857.2442916-1-tobias@waldekranz.com Signed-off-by: Jakub Kicinski commit acaf4d2e36b3466334af4d3ee6ac254c3316165c Author: Tobias Waldekranz Date: Wed Mar 16 16:08:57 2022 +0100 net: dsa: mv88e6xxx: MST Offloading Allocate a SID in the STU for each MSTID in use by a bridge and handle the mapping of MSTIDs to VLANs using the SID field of each VTU entry. Signed-off-by: Tobias Waldekranz Signed-off-by: Jakub Kicinski drivers/net/dsa/mv88e6xxx/chip.c | 250 +++++++++++++++++++++++++++++++++++++-- drivers/net/dsa/mv88e6xxx/chip.h | 13 ++ 2 files changed, 255 insertions(+), 8 deletions(-) commit 7dc96039b9676b9360b49d4fd117fa042f7d456f Author: Tobias Waldekranz Date: Wed Mar 16 16:08:56 2022 +0100 net: dsa: mv88e6xxx: Export STU as devlink region Export the raw STU data in a devlink region so that it can be inspected from userspace and compared to the current bridge configuration. Signed-off-by: Tobias Waldekranz Signed-off-by: Jakub Kicinski drivers/net/dsa/mv88e6xxx/chip.h | 1 + drivers/net/dsa/mv88e6xxx/devlink.c | 94 +++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) commit 49c98c1dc7d9ed2fe974a1f68aa887ec747e3f1a Author: Tobias Waldekranz Date: Wed Mar 16 16:08:55 2022 +0100 net: dsa: mv88e6xxx: Disentangle STU from VTU In early LinkStreet silicon (e.g. 6095/6185), the per-VLAN STP states were kept in the VTU - there was no concept of a SID. Later, the information was split into two tables, where the VTU only tracked memberships and deferred the STP state tracking to the STU via a pointer (SID). This meant that a group of VLANs could share the same STU entry. Most likely, this was done to align with MSTP (802.1Q-2018, Clause 13), which is built on this principle. While the VTU is still 4k lines on most devices, the STU is capped at 64 entries. This means that the current stategy, updating STU info whenever a VTU entry is updated, can not easily support MSTP because: - The maximum number of VIDs would also be capped at 64, as we would have to allocate one SID for every VTU entry - even if many VLANs would effectively share the same MST. - MSTP updates would be unnecessarily slow as you would have to iterate over all VLANs that share the same MST. In order to support MSTP offloading in the future, manage the STU as a separate entity from the VTU. Only add support for newer hardware with separate VTU and STU. VTU-only devices can also be supported, but essentially this requires a software implementation of an STU (fanning out state changed to all VLANs tied to the same MST). Signed-off-by: Tobias Waldekranz Signed-off-by: Jakub Kicinski drivers/net/dsa/mv88e6xxx/chip.c | 54 ++++++ drivers/net/dsa/mv88e6xxx/chip.h | 24 +++ drivers/net/dsa/mv88e6xxx/global1.h | 10 + drivers/net/dsa/mv88e6xxx/global1_vtu.c | 311 ++++++++++++++++++-------------- 4 files changed, 264 insertions(+), 135 deletions(-) commit 7414af30b7d80f117bed5ad6769e6ffb433573ba Author: Tobias Waldekranz Date: Wed Mar 16 16:08:54 2022 +0100 net: dsa: Handle MST state changes Add the usual trampoline functionality from the generic DSA layer down to the drivers for MST state changes. When a state changes to disabled/blocking/listening, make sure to fast age any dynamic entries in the affected VLANs (those controlled by the MSTI in question). Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski include/net/dsa.h | 3 ++ net/dsa/dsa_priv.h | 3 ++ net/dsa/port.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++----- net/dsa/slave.c | 6 ++++ 4 files changed, 89 insertions(+), 8 deletions(-) commit 8e6598a7b0fa834a563392d30017eac1b0102fcd Author: Tobias Waldekranz Date: Wed Mar 16 16:08:53 2022 +0100 net: dsa: Pass VLAN MSTI migration notifications to driver Add the usual trampoline functionality from the generic DSA layer down to the drivers for VLAN MSTI migrations. Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski include/net/dsa.h | 3 +++ net/dsa/dsa_priv.h | 2 ++ net/dsa/port.c | 16 +++++++++++++++- net/dsa/slave.c | 6 ++++++ 4 files changed, 26 insertions(+), 1 deletion(-) commit 332afc4c8c0da3a451745c5d809f908006745c0d Author: Tobias Waldekranz Date: Wed Mar 16 16:08:52 2022 +0100 net: dsa: Validate hardware support for MST When joining a bridge where MST is enabled, we validate that the proper offloading support is in place, otherwise we fallback to software bridging. When then mode is changed on a bridge in which we are members, we refuse the change if offloading is not supported. At the moment we only check for configurable learning, but this will be further restricted as we support more MST related switchdev events. Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Signed-off-by: Jakub Kicinski net/dsa/dsa_priv.h | 2 ++ net/dsa/port.c | 22 ++++++++++++++++++++++ net/dsa/slave.c | 6 ++++++ 3 files changed, 30 insertions(+) commit f54fd0e163068ced4d0d27db64cd3cbda95b74e4 Author: Tobias Waldekranz Date: Wed Mar 16 16:08:51 2022 +0100 net: bridge: mst: Add helper to query a port's MST state This is useful for switchdev drivers who are offloading MST states into hardware. As an example, a driver may wish to flush the FDB for a port when it transitions from forwarding to blocking - which means that the previous state must be discoverable. Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski include/linux/if_bridge.h | 6 ++++++ net/bridge/br_mst.c | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) commit 48d57b2e5f439246c4e12ed7705a5e3241294b03 Author: Tobias Waldekranz Date: Wed Mar 16 16:08:50 2022 +0100 net: bridge: mst: Add helper to check if MST is enabled This is useful for switchdev drivers that might want to refuse to join a bridge where MST is enabled, if the hardware can't support it. Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski include/linux/if_bridge.h | 6 ++++++ net/bridge/br_mst.c | 9 +++++++++ 2 files changed, 15 insertions(+) commit cceac97afa090284b3ceecd93ea6b7b527116767 Author: Tobias Waldekranz Date: Wed Mar 16 16:08:49 2022 +0100 net: bridge: mst: Add helper to map an MSTI to a VID set br_mst_get_info answers the question: "On this bridge, which VIDs are mapped to the given MSTI?" This is useful in switchdev drivers, which might have to fan-out operations, relating to an MSTI, per VLAN. An example: When a port's MST state changes from forwarding to blocking, a driver may choose to flush the dynamic FDB entries on that port to get faster reconvergence of the network, but this should only be done in the VLANs that are managed by the MSTI in question. Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski include/linux/if_bridge.h | 7 +++++++ net/bridge/br_mst.c | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) commit 7ae9147f4312903b97eae231c48571bbd95dc63f Author: Tobias Waldekranz Date: Wed Mar 16 16:08:48 2022 +0100 net: bridge: mst: Notify switchdev drivers of MST state changes Generate a switchdev notification whenever an MST state changes. This notification is keyed by the VLANs MSTI rather than the VID, since multiple VLANs may share the same MST instance. Signed-off-by: Tobias Waldekranz Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski include/net/switchdev.h | 7 +++++++ net/bridge/br_mst.c | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) commit 6284c723d9b9995cc27ab3c6368a9d95d67111ff Author: Tobias Waldekranz Date: Wed Mar 16 16:08:47 2022 +0100 net: bridge: mst: Notify switchdev drivers of VLAN MSTI migrations Whenever a VLAN moves to a new MSTI, send a switchdev notification so that switchdevs can track a bridge's VID to MSTI mappings. Signed-off-by: Tobias Waldekranz Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski include/net/switchdev.h | 7 +++++++ net/bridge/br_mst.c | 13 +++++++++++++ net/bridge/br_switchdev.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) commit 87c167bb94ee3fd49569d4aa2038b9b8840d906f Author: Tobias Waldekranz Date: Wed Mar 16 16:08:46 2022 +0100 net: bridge: mst: Notify switchdev drivers of MST mode changes Trigger a switchdev event whenever the bridge's MST mode is enabled/disabled. This allows constituent ports to either perform any required hardware config, or refuse the change if it not supported. Signed-off-by: Tobias Waldekranz Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski include/net/switchdev.h | 2 ++ net/bridge/br_mst.c | 11 +++++++++++ 2 files changed, 13 insertions(+) commit 122c29486e1ff78033c45d0d31c710e7dc8945a5 Author: Tobias Waldekranz Date: Wed Mar 16 16:08:45 2022 +0100 net: bridge: mst: Support setting and reporting MST port states Make it possible to change the port state in a given MSTI by extending the bridge port netlink interface (RTM_SETLINK on PF_BRIDGE).The proposed iproute2 interface would be: bridge mst set dev msti state Current states in all applicable MSTIs can also be dumped via a corresponding RTM_GETLINK. The proposed iproute interface looks like this: $ bridge mst port msti vb1 0 state forwarding 100 state disabled vb2 0 state forwarding 100 state forwarding The preexisting per-VLAN states are still valid in the MST mode (although they are read-only), and can be queried as usual if one is interested in knowing a particular VLAN's state without having to care about the VID to MSTI mapping (in this example VLAN 20 and 30 are bound to MSTI 100): $ bridge -d vlan port vlan-id vb1 10 state forwarding mcast_router 1 20 state disabled mcast_router 1 30 state disabled mcast_router 1 40 state forwarding mcast_router 1 vb2 10 state forwarding mcast_router 1 20 state forwarding mcast_router 1 30 state forwarding mcast_router 1 40 state forwarding mcast_router 1 Signed-off-by: Tobias Waldekranz Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski include/uapi/linux/if_bridge.h | 16 ++++++ include/uapi/linux/rtnetlink.h | 1 + net/bridge/br_mst.c | 126 +++++++++++++++++++++++++++++++++++++++++ net/bridge/br_netlink.c | 44 +++++++++++++- net/bridge/br_private.h | 23 ++++++++ 5 files changed, 209 insertions(+), 1 deletion(-) commit 8c678d60562f3e5f6d0a5f5465e27930ffedb8ca Author: Tobias Waldekranz Date: Wed Mar 16 16:08:44 2022 +0100 net: bridge: mst: Allow changing a VLAN's MSTI Allow a VLAN to move out of the CST (MSTI 0), to an independent tree. The user manages the VID to MSTI mappings via a global VLAN setting. The proposed iproute2 interface would be: bridge vlan global set dev br0 vid msti Changing the state in non-zero MSTIs is still not supported, but will be addressed in upcoming changes. Signed-off-by: Tobias Waldekranz Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski include/uapi/linux/if_bridge.h | 1 + net/bridge/br_mst.c | 42 ++++++++++++++++++++++++++++++++++++++++++ net/bridge/br_private.h | 1 + net/bridge/br_vlan_options.c | 15 +++++++++++++++ 4 files changed, 59 insertions(+) commit ec7328b59176227216c461601c6bd0e922232a9b Author: Tobias Waldekranz Date: Wed Mar 16 16:08:43 2022 +0100 net: bridge: mst: Multiple Spanning Tree (MST) mode Allow the user to switch from the current per-VLAN STP mode to an MST mode. Up to this point, per-VLAN STP states where always isolated from each other. This is in contrast to the MSTP standard (802.1Q-2018, Clause 13.5), where VLANs are grouped into MST instances (MSTIs), and the state is managed on a per-MSTI level, rather that at the per-VLAN level. Perhaps due to the prevalence of the standard, many switching ASICs are built after the same model. Therefore, add a corresponding MST mode to the bridge, which we can later add offloading support for in a straight-forward way. For now, all VLANs are fixed to MSTI 0, also called the Common Spanning Tree (CST). That is, all VLANs will follow the port-global state. Upcoming changes will make this actually useful by allowing VLANs to be mapped to arbitrary MSTIs and allow individual MSTI states to be changed. Signed-off-by: Tobias Waldekranz Acked-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski include/uapi/linux/if_bridge.h | 1 + net/bridge/Makefile | 2 +- net/bridge/br.c | 5 +++ net/bridge/br_input.c | 17 ++++++++- net/bridge/br_mst.c | 87 ++++++++++++++++++++++++++++++++++++++++++ net/bridge/br_private.h | 37 ++++++++++++++++++ net/bridge/br_stp.c | 6 +++ net/bridge/br_vlan.c | 20 +++++++++- net/bridge/br_vlan_options.c | 5 +++ 9 files changed, 176 insertions(+), 4 deletions(-) commit 4e1b04af4fe6679e63d1bc09f750424882ab701c Author: Bill Wendling Date: Thu Mar 17 11:42:22 2022 -0700 nfsd: use correct format characters When compiling with -Wformat, clang emits the following warnings: fs/nfsd/flexfilelayout.c:120:27: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] "%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~ %d fs/nfsd/flexfilelayout.c:120:38: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] "%s.%hhu.%hhu", addr, port >> 8, port & 0xff); ~~~~ ^~~~~~~~~~~ %d The types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Bill Wendling Signed-off-by: Chuck Lever Reviewed-by: Tom Haynes fs/nfsd/flexfilelayout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 54744510fa9c056d388a019c4518a93956bc8db5 Author: Heiner Kallweit Date: Wed Mar 16 22:31:00 2022 +0100 r8169: improve driver unload and system shutdown behavior on DASH-enabled systems There's a number of systems supporting DASH remote management. Driver unload and system shutdown can result in the PHY suspending, thus making DASH unusable. Improve this by handling DASH being enabled very similar to WoL being enabled. Tested-by: Yanko Kaneti Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/1de3b176-c09c-1654-6f00-9785f7a4f954@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/realtek/r8169_main.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) commit fad6c1f1a109ee6f9d7090756f8ea44bc300b4f5 Merge: 21c68644ff83 4c1202189e35 Author: Jakub Kicinski Date: Thu Mar 17 16:40:32 2022 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-03-16 This series contains updates to gtp and ice driver. Wojciech fixes smatch reported inconsistent indenting for gtp and ice. Yang Yingliang fixes a couple of return value checks for GNSS to IS_PTR instead of null. Jacob adds support for trace events on tx timestamps. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: add trace events for tx timestamps ice: fix return value check in ice_gnss.c ice: Fix inconsistent indenting in ice_switch gtp: Fix inconsistent indenting ==================== Link: https://lore.kernel.org/r/20220316204024.3201500-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 21c68644ff8305e486c6a70ccacfbcce8f0c75e1 Author: Colin Ian King Date: Wed Mar 16 23:46:20 2022 +0000 ethernet: sun: Fix spelling mistake "mis-matched" -> "mismatched" There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220316234620.55885-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/sun/niu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 30fb35989dcc6ccb65c5033e49e271c742d03522 Author: Colin Ian King Date: Wed Mar 16 23:34:55 2022 +0000 net: ethernet: ti: Fix spelling mistake and clean up message There is a spelling mistake in a dev_err message and the MAX_SKB_FRAGS value does not need to be printed between parentheses. Fix this. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220316233455.54541-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/ti/netcp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8624a95ecdea5ce6829bb42b0b9dcd8705961e04 Author: Bill Wendling Date: Wed Mar 16 14:31:25 2022 -0700 vlan: use correct format characters When compiling with -Wformat, clang emits the following warning: net/8021q/vlanproc.c:284:22: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat] mp->priority, ((mp->vlan_qos >> 13) & 0x7)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ The types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Bill Wendling Link: https://lore.kernel.org/r/20220316213125.2353370-1-morbo@google.com Signed-off-by: Jakub Kicinski net/8021q/vlanproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c011072c90353814a9d8e2b3cd111e77ae8601ed Author: Bill Wendling Date: Wed Mar 16 14:31:14 2022 -0700 net/fsl: xgmac_mdio: use correct format characters When compiling with -Wformat, clang emits the following warning: drivers/net/ethernet/freescale/xgmac_mdio.c:243:22: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] phy_id, dev_addr, regnum); ^~~~~~ ./include/linux/dev_printk.h:163:47: note: expanded from macro 'dev_dbg' dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ ./include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk' _dev_printk(level, dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ The types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Bill Wendling Link: https://lore.kernel.org/r/20220316213114.2352352-1-morbo@google.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/freescale/xgmac_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d65aea8e829815e3d2bd677d7bfdd842bcd3853b Author: Bill Wendling Date: Wed Mar 16 14:31:04 2022 -0700 bnx2x: use correct format characters When compiling with -Wformat, clang emits the following warnings: drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:6181:40: warning: format specifies type 'unsigned short' but the argument has type 'u32' (aka 'unsigned int') [-Wformat] ret = scnprintf(str, *len, "%hx.%hx", num >> 16, num); ~~~ ^~~~~~~~~ %x drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:6181:51: warning: format specifies type 'unsigned short' but the argument has type 'u32' (aka 'unsigned int') [-Wformat] ret = scnprintf(str, *len, "%hx.%hx", num >> 16, num); ~~~ ^~~ %x drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:6196:47: warning: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Wformat] ret = scnprintf(str, *len, "%hhx.%hhx.%hhx", num >> 16, num >> 8, num); ~~~~ ^~~~~~~~~ %x drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:6196:58: warning: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Wformat] ret = scnprintf(str, *len, "%hhx.%hhx.%hhx", num >> 16, num >> 8, num); ~~~~ ^~~~~~~~ %x drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:6196:68: warning: format specifies type 'unsigned char' but the argument has type 'u32' (aka 'unsigned int') [-Wformat] ret = scnprintf(str, *len, "%hhx.%hhx.%hhx", num >> 16, num >> 8, num); ~~~~ ^~~ %x The types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Bill Wendling Link: https://lore.kernel.org/r/20220316213104.2351651-1-morbo@google.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit df4d35e1f01f7a6d50bb098eaeed8b04ef422fdc Author: Bill Wendling Date: Wed Mar 16 14:31:09 2022 -0700 enetc: use correct format characters When compiling with -Wformat, clang emits the following warning: drivers/net/ethernet/freescale/enetc/enetc_mdio.c:151:22: warning: format specifies type 'unsigned char' but the argument has type 'int' [-Wformat] phy_id, dev_addr, regnum); ^~~~~~ ./include/linux/dev_printk.h:163:47: note: expanded from macro 'dev_dbg' dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ ./include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk' _dev_printk(level, dev, fmt, ##__VA_ARGS__); \ ~~~ ^~~~~~~~~~~ The types of these arguments are unconditionally defined, so this patch updates the format character to the correct ones for ints and unsigned ints. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Bill Wendling Reviewed-by: Claudiu Manoil Link: https://lore.kernel.org/r/20220316213109.2352015-1-morbo@google.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/freescale/enetc/enetc_mdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dbc7d452e7cf7d3ebc0064e68d30e28d86d3939a Author: Jens Axboe Date: Thu Mar 17 17:20:10 2022 -0600 io_uring: manage provided buffers strictly ordered Workloads using provided buffers benefit from using and returning buffers in the right order, and so does TLBs for that matter. Manage the internal buffer list in a straight list, rather than use the head buffer as the insertion node. Use a hashed list for the buffer group IDs instead of xarray, the overhead is much lower this way. xarray provides internal locking and other trickery that is handy for some uses cases, but io_uring already locks internally for the buffer manipulation and needs none of that. This is good for about a 2% reduction in overhead, combination of the improved management and the fact that the workload has an easier time bundling back provided buffers. Signed-off-by: Jens Axboe fs/io_uring.c | 154 +++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 92 insertions(+), 62 deletions(-) commit e0999c8e590935b13dd598a6480685eae9c1b3c5 Author: Kaixi Fan Date: Mon Mar 14 00:41:16 2022 +0800 selftests/bpf: Fix tunnel remote IP comments In namespace at_ns0, the IP address of tnl dev is 10.1.1.100 which is the overlay IP, and the ip address of veth0 is 172.16.1.100 which is the vtep IP. When doing 'ping 10.1.1.100' from root namespace, the remote_ip should be 172.16.1.100. Fixes: 933a741e3b82 ("selftests/bpf: bpf tunnel test.") Signed-off-by: Kaixi Fan Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220313164116.5889-1-fankaixi.li@bytedance.com Signed-off-by: Alexei Starovoitov tools/testing/selftests/bpf/test_tunnel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 705757274599e2e064dd3054aabc74e8af31a095 Author: Baokun Li Date: Tue Feb 15 12:07:36 2022 +0800 ubifs: rename_whiteout: correct old_dir size computing When renaming the whiteout file, the old whiteout file is not deleted. Therefore, we add the old dentry size to the old dir like XFS. Otherwise, an error may be reported due to `fscki->calc_sz != fscki->size` in check_indes. Fixes: 9e0a1fff8db56ea ("ubifs: Implement RENAME_WHITEOUT") Reported-by: Zhihao Cheng Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger fs/ubifs/dir.c | 3 +++ 1 file changed, 3 insertions(+) commit 46162ac2a6a425674b0e20a3e0668b21187f94bf Author: Helge Deller Date: Thu Mar 17 23:01:09 2022 +0100 parisc: Improve CPU socket and core bootup info text Improve CPU bootup info text from: CPU1: thread -1, cpu 0, socket 1 to CPU1: cpu core 0 of socket 1 Signed-off-by: Helge Deller arch/parisc/kernel/topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 2b41be484abd81c6a43d4b171943d67af6f7c5c3 Author: Helge Deller Date: Thu Mar 17 22:36:30 2022 +0100 parisc: Enable ARCH_HAS_DEBUG_VM_PGTABLE Allow to enable page table boot-up checks. Suggested-by: Rolf Eike Beer Signed-off-by: Helge Deller arch/parisc/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 6b57ac02b45f7f676c81b1357e7e5d63a974bf60 Merge: 9d1f0ec9f717 a9b202606c69 Author: Palmer Dabbelt Date: Thu Mar 17 14:09:16 2022 -0700 RISC-V: Provide a fraemework for RISC-V ISA extensions This series implements a generic framework to parse multi-letter ISA extensions. * palmer/riscv-isa: RISC-V: Improve /proc/cpuinfo output for ISA extensions RISC-V: Do no continue isa string parsing without correct XLEN RISC-V: Implement multi-letter ISA extension probing framework RISC-V: Extract multi-letter extension names from "riscv, isa" RISC-V: Minimal parser for "riscv, isa" strings RISC-V: Correctly print supported extensions commit e243f39685af1bd6d837fa7bff40c1afdf3eb7fa Merge: 1abea24af42c 551acdc3c3d2 Author: Jakub Kicinski Date: Thu Mar 17 13:56:06 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net No conflicts. Signed-off-by: Jakub Kicinski commit 7cda76d858a4e71ac4a04066c093679a12e1312c Author: Lorenzo Bianconi Date: Fri Mar 11 10:14:20 2022 +0100 veth: Allow jumbo frames in xdp mode Allow increasing the MTU over page boundaries on veth devices if the attached xdp program declares to support xdp fragments. Signed-off-by: Lorenzo Bianconi Signed-off-by: Daniel Borkmann Acked-by: Toke Høiland-Jørgensen Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/d5dc039c3d4123426e7023a488c449181a7bc57f.1646989407.git.lorenzo@kernel.org drivers/net/veth.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit 718a18a0c8a67f97781e40bdef7cdd055c430996 Author: Lorenzo Bianconi Date: Fri Mar 11 10:14:19 2022 +0100 veth: Rework veth_xdp_rcv_skb in order to accept non-linear skb Introduce veth_convert_skb_to_xdp_buff routine in order to convert a non-linear skb into a xdp buffer. If the received skb is cloned or shared, veth_convert_skb_to_xdp_buff will copy it in a new skb composed by order-0 pages for the linear and the fragmented area. Moreover veth_convert_skb_to_xdp_buff guarantees we have enough headroom for xdp. This is a preliminary patch to allow attaching xdp programs with frags support on veth devices. Signed-off-by: Lorenzo Bianconi Signed-off-by: Daniel Borkmann Acked-by: Toke Høiland-Jørgensen Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/8d228b106bc1903571afd1d77e797bffe9a5ea7c.1646989407.git.lorenzo@kernel.org drivers/net/veth.c | 177 ++++++++++++++++++++++++++++++++++++----------------- net/core/xdp.c | 1 + 2 files changed, 122 insertions(+), 56 deletions(-) commit 5142239a22219921a7863cf00c9ab853c00689d8 Author: Lorenzo Bianconi Date: Fri Mar 11 10:14:18 2022 +0100 net: veth: Account total xdp_frame len running ndo_xdp_xmit Even if this is a theoretical issue since it is not possible to perform XDP_REDIRECT on a non-linear xdp_frame, veth driver does not account paged area in ndo_xdp_xmit function pointer. Introduce xdp_get_frame_len utility routine to get the xdp_frame full length and account total frame size running XDP_REDIRECT of a non-linear xdp frame into a veth device. Signed-off-by: Lorenzo Bianconi Signed-off-by: Daniel Borkmann Acked-by: Toke Hoiland-Jorgensen Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/54f9fd3bb65d190daf2c0bbae2f852ff16cfbaa0.1646989407.git.lorenzo@kernel.org drivers/net/veth.c | 4 ++-- include/net/xdp.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) commit c5601e0720ce1a3ad895f94a5838530edde01ed3 Author: Dan Carpenter Date: Wed Mar 16 11:35:33 2022 +0300 clk: visconti: prevent array overflow in visconti_clk_register_gates() This code was using -1 to represent that there was no reset function. Unfortunately, the -1 was stored in u8 so the if (clks[i].rs_id >= 0) condition was always true. This lead to an out of bounds access in visconti_clk_register_gates(). Fixes: b4cbe606dc36 ("clk: visconti: Add support common clock driver and reset driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220316083533.GA30941@kili Acked-by: Nobuhiro Iwamatsu Signed-off-by: Stephen Boyd drivers/clk/visconti/clkc-tmpv770x.c | 2 +- drivers/clk/visconti/clkc.c | 2 +- drivers/clk/visconti/clkc.h | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) commit a9b202606c69312cdaa4db187837820ebf7213b2 Author: Atish Patra Date: Mon Mar 14 13:38:45 2022 -0700 RISC-V: Improve /proc/cpuinfo output for ISA extensions Currently, the /proc/cpuinfo outputs the entire riscv,isa string which is not ideal when we have multiple ISA extensions present in the ISA string. Some of them may not be enabled in kernel as well. Same goes for the single letter extensions as well which prints the entire ISA string. Some of they may not be valid ISA extensions as well (e.g 'su') Parse only the valid & enabled ISA extension and print them. Tested-by: Heiko Stuebner Signed-off-by: Atish Patra Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt arch/riscv/include/asm/hwcap.h | 7 +++++ arch/riscv/kernel/cpu.c | 65 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 70 insertions(+), 2 deletions(-) commit 3f96db125d68127ffef6fdeeb777d94ccf95c09f Author: Atish Patra Date: Mon Mar 14 13:38:44 2022 -0700 RISC-V: Do no continue isa string parsing without correct XLEN The isa string should begin with either rv64 or rv32. Otherwise, it is an incorrect isa string. Currently, the string parsing continues even if it doesnot begin with current XLEN. Fix this by checking if it found "rv64" or "rv32" in the beginning. Tested-by: Heiko Stuebner Signed-off-by: Atish Patra Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt arch/riscv/kernel/cpufeature.c | 5 +++++ 1 file changed, 5 insertions(+) commit 02d52fbd940af7d7fe0a523e99938113b2addd35 Author: Atish Patra Date: Mon Mar 14 13:38:43 2022 -0700 RISC-V: Implement multi-letter ISA extension probing framework Multi-letter extensions can be probed using exising riscv_isa_extension_available API now. It doesn't support versioning right now as there is no use case for it. Individual extension specific implementation will be added during each extension support. Tested-by: Heiko Stuebner Signed-off-by: Atish Patra Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt arch/riscv/include/asm/hwcap.h | 18 ++++++++++++++++++ arch/riscv/kernel/cpufeature.c | 22 ++++++++++++++++------ 2 files changed, 34 insertions(+), 6 deletions(-) commit 40a4d0dfbcf00c8534ab8724041705b3db6c5ce2 Author: Tsukasa OI Date: Mon Mar 14 13:38:42 2022 -0700 RISC-V: Extract multi-letter extension names from "riscv, isa" Currently, there is no usage for version numbers in extensions as any ratified non base ISA extension will always at v1.0. Extract the extension names in place for future parsing. Tested-by: Heiko Stuebner Reviewed-by: Anup Patel Signed-off-by: Tsukasa OI [Improved commit text and comments] Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/kernel/cpufeature.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) commit 2a31c54be097c74344b4fab20ea6104012d2cb8b Author: Tsukasa OI Date: Mon Mar 14 13:38:41 2022 -0700 RISC-V: Minimal parser for "riscv, isa" strings Current hart ISA ("riscv,isa") parser don't correctly parse: 1. Multi-letter extensions 2. Version numbers All ISA extensions ratified recently has multi-letter extensions (except 'H'). The current "riscv,isa" parser that is easily confused by multi-letter extensions and "p" in version numbers can be a huge problem for adding new extensions through the device tree. Leaving it would create incompatible hacks and would make "riscv,isa" value unreliable. This commit implements minimal parser for "riscv,isa" strings. With this, we can safely ignore multi-letter extensions and version numbers. [Improved commit text and fixed a bug around 's' in base extension] Signed-off-by: Atish Patra [Fixed workaround for QEMU] Signed-off-by: Tsukasa OI Tested-by: Heiko Stuebner Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt arch/riscv/kernel/cpufeature.c | 72 +++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 11 deletions(-) commit 58004f266918912771ee71f46bfb92bf64ab9108 Author: Tsukasa OI Date: Mon Mar 14 13:38:40 2022 -0700 RISC-V: Correctly print supported extensions This commit replaces BITS_PER_LONG with number of alphabet letters. Current ISA pretty-printing code expects extension 'a' (bit 0) through 'z' (bit 25). Although bit 26 and higher is not currently used (thus never cause an issue in practice), it will be an annoying problem if we start to use those in the future. This commit disables printing high bits for now. Reviewed-by: Anup Patel Tested-by: Heiko Stuebner Signed-off-by: Tsukasa OI Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/kernel/cpufeature.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 770c9a3a01af178a90368a78c75eb91707c7233c Author: Tariq Toukan Date: Thu May 20 15:34:57 2021 +0300 net/mlx5: Remove unused fill page array API function mlx5_fill_page_array API function is not used. Remove it, reduce the number of exported functions. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 13 ------------- include/linux/mlx5/driver.h | 1 - 2 files changed, 14 deletions(-) commit 4206fe40b2c01fb5988980cff6ea958b16578026 Author: Tariq Toukan Date: Tue Apr 27 16:30:32 2021 +0300 net/mlx5: Remove unused exported contiguous coherent buffer allocation API All WQ types moved to using the fragmented allocation API for coherent memory. Contiguous API is not used anymore. Remove it, reduce the number of exported functions. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 47 ------------------------- include/linux/mlx5/driver.h | 3 -- 2 files changed, 50 deletions(-) commit ebf04231cf14bca969a187a37a85bb64ffe0b54d Author: Paul Blakey Date: Wed Feb 23 15:37:50 2022 +0200 net/mlx5: CT: Remove extra rhashtable remove on tuple entries On tuple offload del command, tuples are tried to be removed twice from the hashtable, once directly via mlx5_tc_ct_entry_remove_from_tuples() and a second time in the following mlx5_tc_ct_entry_put()-> mlx5_tc_ct_entry_del()->mlx5_tc_ct_entry_remove_from_tuples() call. This doesn't cause any issue since rhashtable first checks if the removed object exists in the hashtable. Remove the extra mlx5_tc_ct_entry_remove_from_tuples(). Signed-off-by: Paul Blakey Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 1 - 1 file changed, 1 deletion(-) commit 0d7f1595bb96bcf1d673d6541eb453bec800f051 Author: Rongwei Liu Date: Fri Jan 28 06:15:12 2022 +0200 net/mlx5: DR, Remove hw_ste from mlx5dr_ste to reduce memory It can be calculated via function mlx5dr_ste_get_hw_ste(). Very simple and lightweight, no need to use a dedicated member. Reduce 8 bytes from struct mlx5dr_ste and its size is 48 bytes now. Signed-off-by: Rongwei Liu Reviewed-by: Shun Hao Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed .../ethernet/mellanox/mlx5/core/steering/dr_dbg.c | 3 +- .../ethernet/mellanox/mlx5/core/steering/dr_rule.c | 24 +++++---- .../ethernet/mellanox/mlx5/core/steering/dr_send.c | 3 +- .../ethernet/mellanox/mlx5/core/steering/dr_ste.c | 63 +++++++++++++--------- .../mellanox/mlx5/core/steering/dr_types.h | 2 +- 5 files changed, 55 insertions(+), 40 deletions(-) commit 597534bd56335c9e7bdb6c52d9abcb66e9cb9275 Author: Rongwei Liu Date: Fri Jan 28 06:14:16 2022 +0200 net/mlx5: DR, Remove 4 members from mlx5dr_ste_htbl to reduce memory Remove chunk_size in struct mlx5dr_icm_chunk and use chunk->size instead. Remove ste_arr/hw_ste_arr/miss_list since they can be accessed from htbl->chunk pointer, no need to keep a copy. This commit reduces 28 bytes from struct mlx5dr_ste_htbl and its size is 32 bytes now. Signed-off-by: Rongwei Liu Reviewed-by: Shun Hao Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed .../mellanox/mlx5/core/steering/dr_matcher.c | 16 +++++++------ .../ethernet/mellanox/mlx5/core/steering/dr_rule.c | 28 +++++++++++----------- .../ethernet/mellanox/mlx5/core/steering/dr_send.c | 10 ++++---- .../ethernet/mellanox/mlx5/core/steering/dr_ste.c | 18 ++++++-------- .../mellanox/mlx5/core/steering/dr_types.h | 11 ++------- 5 files changed, 37 insertions(+), 46 deletions(-) commit f51bb51793008d559d45a5fb0d856b2deb87890a Author: Rongwei Liu Date: Fri Jan 28 06:13:07 2022 +0200 net/mlx5: DR, Remove num_of_entries byte_size from struct mlx5_dr_icm_chunk Target to reduce the memory consumption in large scale of flow rules. They can be calculated quickly from buddy memory pool. 1. num_of_entries calls dr_icm_pool_get_chunk_num_of_entries(). 2. byte_size calls dr_icm_pool_get_chunk_byte_size(). Use chunk size in dr_icm_chunk to speed up and the one in dr_ste_htbl will be removed in the upcoming commit. This commit reduce 8 bytes from struct mlx5_dr_icm_chunk and its current size is 56 bytes. Signed-off-by: Rongwei Liu Reviewed-by: Shun Hao Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed .../mellanox/mlx5/core/steering/dr_icm_pool.c | 34 ++++++++++++++-------- .../ethernet/mellanox/mlx5/core/steering/dr_rule.c | 2 +- .../ethernet/mellanox/mlx5/core/steering/dr_send.c | 12 ++++---- .../ethernet/mellanox/mlx5/core/steering/dr_ste.c | 16 ++++++---- .../mellanox/mlx5/core/steering/dr_types.h | 5 ++-- 5 files changed, 42 insertions(+), 27 deletions(-) commit 5c4f9b6e91e8b3957abe95b18040cc519ce6edc0 Author: Rongwei Liu Date: Fri Jan 28 06:12:09 2022 +0200 net/mlx5: DR, Remove icm_addr from mlx5dr_icm_chunk to reduce memory It can be calculated quickly from buddy memory pool by function mlx5dr_icm_pool_get_chunk_icm_addr(). This function is very lightweight and straightforward. Reduce 8 bytes and current size of struct mlx5_dr_icm_chunk is 64 bytes. Signed-off-by: Rongwei Liu Reviewed-by: Shun Hao Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed .../ethernet/mellanox/mlx5/core/steering/dr_action.c | 12 +++++++----- .../net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c | 11 ++++++++--- .../mellanox/mlx5/core/steering/dr_icm_pool.c | 9 +++++++-- .../ethernet/mellanox/mlx5/core/steering/dr_matcher.c | 2 +- .../ethernet/mellanox/mlx5/core/steering/dr_rule.c | 19 +++++++++++-------- .../net/ethernet/mellanox/mlx5/core/steering/dr_ste.c | 14 +++++++++----- .../ethernet/mellanox/mlx5/core/steering/dr_table.c | 18 ++++++++++-------- .../ethernet/mellanox/mlx5/core/steering/dr_types.h | 2 +- 8 files changed, 54 insertions(+), 33 deletions(-) commit 003f4f9acb057e405375492e94732183e638be29 Author: Rongwei Liu Date: Fri Jan 28 06:10:54 2022 +0200 net/mlx5: DR, Remove mr_addr rkey from struct mlx5dr_icm_chunk Reduce memory footprint by removing mr_addr and rkey from mlx5_dr_icm_chunk. 1. mr_addr is calculated by mlx5dr_icm_pool_get_chunk_mr_addr() 2. rkey is calculated by mlx5dr_icm_pool_get_chunk_rkey() The two new functions are very lightweight and straightforward. Reduce 8 bytes from struct mlx5_dr_icm_chunk, its current size is 72 bytes. Signed-off-by: Rongwei Liu Reviewed-by: Shun Hao Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed .../net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c | 14 ++++++++++++-- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 11 ++++++----- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c | 2 +- .../net/ethernet/mellanox/mlx5/core/steering/dr_types.h | 5 +++-- 4 files changed, 22 insertions(+), 10 deletions(-) commit 8f85336503259b9d3be139cd44abb1a5ccbd1191 Author: Rongwei Liu Date: Fri Jan 28 05:56:28 2022 +0200 net/mlx5: DR, Adjust structure member to reduce memory hole Accord to profiling, mlx5dr_ste/mlx5dr_icm_chunk are the two hot structures. Their memory layout can be optimized by adjusting member sequences. Struct mlx5dr_ste size changes from 64 bytes to 56 bytes. In the upcoming commits, struct mlx5dr_icm_chunk memory layout will change automatically after removing some members. Keep it untouched here. Signed-off-by: Rongwei Liu Reviewed-by: Shun Hao Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 998923932f13d5694a0b6e73f9a350cc6949ac2f Author: Maxim Mikityanskiy Date: Mon Feb 14 20:57:56 2022 +0200 net/mlx5e: Drop cqe_bcnt32 from mlx5e_skb_from_cqe_mpwrq_linear The packet size in mlx5e_skb_from_cqe_mpwrq_linear can't overflow u16, since the maximum packet size in linear striding RQ is 2^13 bytes. Drop the unneeded u32 variable. Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit 064990d0b65fd99c6fb59006f928a8b631db5816 Author: Maxim Mikityanskiy Date: Thu Jan 27 16:42:18 2022 +0200 net/mlx5e: Drop the len output parameter from mlx5e_xdp_handle The len parameter of mlx5e_xdp_handle is used to output the new packet length after XDP has processed the packet and returned XDP_PASS. However, this value can be calculated on the caller site, as the caller knows if it was an XDP_PASS. This commit drops the len parameter and moves the calculation to the caller, reducing the number of parameters passed to the function and preparing for XDP support in non-linear legacy RQ. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 4 +--- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h | 3 +-- drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c | 11 +++++------ drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 6 ++++-- 4 files changed, 11 insertions(+), 13 deletions(-) commit e26eceb90b01ed941a6d13419a890930adcac494 Author: Tariq Toukan Date: Wed Jan 19 21:28:36 2022 +0200 net/mlx5e: RX, Test the XDP program existence out of the handler Instead of early return inside mlx5e_xdp_handle(), let the caller check if an XDP program is loaded. This allows saving a few unnecessary function calls and calculations in case !prog. Performance test: single core, drop packets in iptables Before: 3,872,504 pps After: 3,975,628 pps (+2.66%) Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 5 +-- drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h | 1 + .../net/ethernet/mellanox/mlx5/core/en/xsk/rx.c | 9 +++- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 49 +++++++++++++--------- 4 files changed, 39 insertions(+), 25 deletions(-) commit 8d35fb57fd907251992f85e97fa25e8db20d4bca Author: Maxim Mikityanskiy Date: Wed Jan 26 17:18:26 2022 +0200 net/mlx5e: Build SKB in place over the first fragment in non-linear legacy RQ As a performance optimization and preparation to enabling XDP multi buffer on non-linear legacy RQ, build the linear part of the SKB over the first fragment, instead of allocating a new buffer and copying the first 256 bytes there. To achieve this, add headroom and tailroom to the first fragment. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed .../net/ethernet/mellanox/mlx5/core/en/params.c | 43 ++++++++++++++----- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 48 +++++++++++----------- 2 files changed, 57 insertions(+), 34 deletions(-) commit c3cce0fff3a3be0372caa4821be58fc7cefaeb3c Author: Maxim Mikityanskiy Date: Wed Jan 26 15:49:23 2022 +0200 net/mlx5e: Add headroom only to the first fragment in legacy RQ Currently, rq->buff.headroom is applied to all fragments in legacy RQ. In the linear mode, there is a non-zero headroom, but there is only one fragment per packet. In the non-linear mode, the headroom is zero. This commit changes the logic to apply the headroom only to the first fragment. The current behavior remains the same for both linear and non-linear modes. However, it allows the next commit to enable headroom for the non-linear mode, which will be applied only to the first fragment. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 7c3b4df594b6c51c1fc95e6fd9f949bdddff34b5 Author: Maxim Mikityanskiy Date: Mon Feb 14 19:59:19 2022 +0200 net/mlx5e: Validate MTU when building non-linear legacy RQ fragments info mlx5e_build_rq_frags_info() assumes that MTU is not bigger than PAGE_SIZE * MLX5E_MAX_RX_FRAGS, which is 16K for 4K pages. Currently, the firmware limits MTU to 10K, so the assumption doesn't lead to a bug. This commits adds an additional driver check for reliability, since the firmware boundary might be changed. The calculation is taken to a separate function with a comment explaining it. It's a preparation for the following patches that introcuce XDP multi buffer support. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed .../net/ethernet/mellanox/mlx5/core/en/params.c | 34 +++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) commit 0d64787e24c6926b60e7d4f07138b9d937925792 Author: Mario Limonciello Date: Thu Mar 17 09:14:45 2022 -0500 platform/x86: amd-pmc: Drop CPU QoS workaround A workaround was previously introduced as part of commit 646f429ec2de ("platform/x86: amd-pmc: Set QOS during suspend on CZN w/ timer wakeup") to prevent CPUs from going into the deepest state during the execution of the `noirq` stage of `amd_pmc`. As `amd_pmc` has been pushed to the last step for suspend on AMD platforms, this workaround is no longer necessary. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220317141445.6498-4-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/amd-pmc.c | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) commit 23f5f7007ab3eafdb764e25527d8267783deb358 Author: Mario Limonciello Date: Thu Mar 17 09:14:44 2022 -0500 platform/x86: amd-pmc: Output error codes in messages The return type for the s2idle callbacks is 'void', so any errors that occur will no longer be displayed. Output these error codes in the messages in case of any failures. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220317141445.6498-3-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/amd-pmc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit b1f66033cd4e9ce8cbe2c74c98d4e04c0b2d7b40 Author: Mario Limonciello Date: Thu Mar 17 09:14:43 2022 -0500 platform/x86: amd-pmc: Move to later in the suspend process The `OS_HINT` message is supposed to indicate that everything else that is supposed to go into the deepest state has done so. This assumption is invalid as: 1) The CPUs will still go in and out of the deepest state 2) Other devices may still run their `noirq` suspend routines 3) The LPS0 ACPI device will still run To more closely mirror how this works on other operating systems, move the `amd-pmc` suspend to the very last thing before the s2idle loop via an lps0 callback. Fixes: 8d89835b0467 ("PM: suspend: Do not pause cpuidle in the suspend-to-idle path") Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220317141445.6498-2-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/amd-pmc.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) commit 20e1d6402a71dba7ad2b81f332a3c14c7d3b939b Author: Mario Limonciello Date: Thu Mar 17 09:14:42 2022 -0500 ACPI / x86: Add support for LPS0 callback handler Currenty the latest thing run during a suspend to idle attempt is the LPS0 `prepare_late` callback and the earliest thing is the `resume_early` callback. There is a desire for the `amd-pmc` driver to suspend later in the suspend process (ideally the very last thing), so create a callback that it or any other driver can hook into to do this. Signed-off-by: Mario Limonciello Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20220317141445.6498-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/acpi/x86/s2idle.c | 40 ++++++++++++++++++++++++++++++++++++++++ include/linux/acpi.h | 10 +++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) commit 6060a75e77fb05c9d54ed41cccc496dd98054b57 Author: Tom Rix Date: Sat Mar 12 06:53:27 2022 -0800 platform/x86: thinkpad_acpi: consistently check fan_get_status return. Clang static analysis returns this false positive thinkpad_acpi.c:8926:19: warning: The left operand of '!=' is a garbage value (status != 0) ? "enabled" : "disabled", status); ~~~~~~ ^ The return of fan_get_status* is checked inconsistenly. Sometime ret < 0 is an error, sometimes !ret. Both fan_get_status() and fan_get_status_safe() return 0 on success and return negative otherwise. Change the checks for error, ret < 0, into checks for not success, !ret. Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220312145327.1398510-1-trix@redhat.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/thinkpad_acpi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 2957308343fa7c621df9f342fab88cb970b8d5f3 Author: Chengming Zhou Date: Sat Mar 12 23:22:20 2022 +0800 livepatch: Don't block removal of patches that are safe to unload module_put() is not called for a patch with "forced" flag. It should block the removal of the livepatch module when the code might still be in use after forced transition. klp_force_transition() currently sets "forced" flag for all patches on the list. In fact, any patch can be safely unloaded when it passed through the consistency model in KLP_UNPATCHED transition. In other words, the "forced" flag must be set only for livepatches that are being removed. In particular, set the "forced" flag: + only for klp_transition_patch when the transition to KLP_UNPATCHED state was forced. + all replaced patches when the transition to KLP_PATCHED state was forced and the patch was replacing the existing patches. Signed-off-by: Chengming Zhou Acked-by: Joe Lawrence Reviewed-by: Petr Mladek Tested-by: Petr Mladek [mbenes@suse.cz: wording improvements] Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220312152220.88127-1-zhouchengming@bytedance.com kernel/livepatch/transition.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 638cec39339db40df9fc2ece0411a64856669b93 Author: Shengjiu Wang Date: Wed Mar 16 13:28:58 2022 +0800 ASoC: fsl_spdif: Add new registers included on i.MX8ULP There are some new registers added on i.MX8ULP, they are the SPDIF transmit Professional C channel registers, 192bit SPDIF receive C channel registers, and 192bit SPDIF transmit C channel registers. There are two output lines, SPDIF_OUT1 and SPDIF_OUT2, the original REG_SPDIF_STCSCH and REG_SPDIF_STCSCL are used for SPDIF_OUT1, the new REG_SPDIF_STCSPH and REG_SPDIF_STCSPL are used for SPDIF_OUT2, the 192bit SPDIF C channel registers are used for both. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1647408538-2982-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown sound/soc/fsl/fsl_spdif.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++- sound/soc/fsl/fsl_spdif.h | 14 +++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) commit ebc4cb43ea5ada3db46c80156fca58a54b9bbca8 Author: Biju Das Date: Wed Mar 16 17:53:17 2022 +0000 spi: Fix erroneous sgs value with min_t() While computing sgs in spi_map_buf(), the data type used in min_t() for max_seg_size is 'unsigned int' where as that of ctlr->max_dma_len is 'size_t'. min_t(unsigned int,x,y) gives wrong results if one of x/y is 'size_t' Consider the below examples on a 64-bit machine (ie size_t is 64-bits, and unsigned int is 32-bit). case 1) min_t(unsigned int, 5, 0x100000001); case 2) min_t(size_t, 5, 0x100000001); Case 1 returns '1', where as case 2 returns '5'. As you can see the result from case 1 is wrong. This patch fixes the above issue by using the data type of the parameters that are used in min_t with maximum data length. Fixes: commit 1a4e53d2fc4f68aa ("spi: Fix invalid sgs value") Reported-by: Linus Torvalds Suggested-by: Geert Uytterhoeven Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220316175317.465-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown drivers/spi/spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 2d2c73318bd51e430da6818c0d12973081aba8d2 Merge: c9839acfcbe2 1a4e53d2fc4f Author: Mark Brown Date: Thu Mar 17 17:59:22 2022 +0000 spi: Get sgs size fix into branch Dependency for patch to be applied. commit b26f965f7c83464f60d5af411ef9a03079e41800 Author: Yihao Han Date: Thu Mar 17 02:38:41 2022 -0700 ASoC: SOF: topology: Use kmemdup() to replace kzalloc + memcpy fix memdup.cocci warning: sound/soc/sof/topology.c:876:19-26: WARNING opportunity for kmemdup Generated by: scripts/coccinelle/api/memdup.cocci Signed-off-by: Yihao Han Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220317093841.3414-1-hanyihao@vivo.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit d98af5f4552058a5c22030641ef79cee92c61f54 Author: Daeho Jeong Date: Tue Mar 15 21:14:14 2022 -0700 f2fs: introduce gc_urgent_mid mode We need a mid level of gc urgent mode to do GC forcibly in a period of given gc_urgent_sleep_time, but not like using greedy GC approach and switching to SSR mode such as gc urgent high mode. This can be used for more aggressive periodic storage clean up. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Documentation/ABI/testing/sysfs-fs-f2fs | 17 +++++++++++------ fs/f2fs/debug.c | 4 +++- fs/f2fs/f2fs.h | 4 ++++ fs/f2fs/gc.c | 3 +++ fs/f2fs/sysfs.c | 7 +++++++ 5 files changed, 28 insertions(+), 7 deletions(-) commit d284af43f703760e261b1601378a0c13a19d5f1f Author: Chao Yu Date: Wed Mar 16 18:20:00 2022 +0800 f2fs: compress: fix to print raw data size in error path of lz4 decompression In lz4_decompress_pages(), if size of decompressed data is not equal to expected one, we should print the size rather than size of target buffer for decompressed data, fix it. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/compress.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 646f64b576f7a80af0dd555e25c79ee8af058681 Author: Wang Xiaojun Date: Mon Mar 14 15:15:15 2022 +0800 f2fs: remove redundant parameter judgment iput() has already judged the incoming parameter, so there is no need to repeat the judgment here. Signed-off-by: Wang Xiaojun Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/namei.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 98237fcda4a24e67b0a4498c17d5aa4ad4537bc7 Author: Jaegeuk Kim Date: Mon Mar 7 17:27:46 2022 -0800 f2fs: use spin_lock to avoid hang [14696.634553] task:cat state:D stack: 0 pid:1613738 ppid:1613735 flags:0x00000004 [14696.638285] Call Trace: [14696.639038] [14696.640032] __schedule+0x302/0x930 [14696.640969] schedule+0x58/0xd0 [14696.641799] schedule_preempt_disabled+0x18/0x30 [14696.642890] __mutex_lock.constprop.0+0x2fb/0x4f0 [14696.644035] ? mod_objcg_state+0x10c/0x310 [14696.645040] ? obj_cgroup_charge+0xe1/0x170 [14696.646067] __mutex_lock_slowpath+0x13/0x20 [14696.647126] mutex_lock+0x34/0x40 [14696.648070] stat_show+0x25/0x17c0 [f2fs] [14696.649218] seq_read_iter+0x120/0x4b0 [14696.650289] ? aa_file_perm+0x12a/0x500 [14696.651357] ? lru_cache_add+0x1c/0x20 [14696.652470] seq_read+0xfd/0x140 [14696.653445] full_proxy_read+0x5c/0x80 [14696.654535] vfs_read+0xa0/0x1a0 [14696.655497] ksys_read+0x67/0xe0 [14696.656502] __x64_sys_read+0x1a/0x20 [14696.657580] do_syscall_64+0x3b/0xc0 [14696.658671] entry_SYSCALL_64_after_hwframe+0x44/0xae [14696.660068] RIP: 0033:0x7efe39df1cb2 [14696.661133] RSP: 002b:00007ffc8badd948 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 [14696.662958] RAX: ffffffffffffffda RBX: 0000000000020000 RCX: 00007efe39df1cb2 [14696.664757] RDX: 0000000000020000 RSI: 00007efe399df000 RDI: 0000000000000003 [14696.666542] RBP: 00007efe399df000 R08: 00007efe399de010 R09: 00007efe399de010 [14696.668363] R10: 0000000000000022 R11: 0000000000000246 R12: 0000000000000000 [14696.670155] R13: 0000000000000003 R14: 0000000000020000 R15: 0000000000020000 [14696.671965] [14696.672826] task:umount state:D stack: 0 pid:1614985 ppid:1614984 flags:0x00004000 [14696.674930] Call Trace: [14696.675903] [14696.676780] __schedule+0x302/0x930 [14696.677927] schedule+0x58/0xd0 [14696.679019] schedule_preempt_disabled+0x18/0x30 [14696.680412] __mutex_lock.constprop.0+0x2fb/0x4f0 [14696.681783] ? destroy_inode+0x65/0x80 [14696.683006] __mutex_lock_slowpath+0x13/0x20 [14696.684305] mutex_lock+0x34/0x40 [14696.685442] f2fs_destroy_stats+0x1e/0x60 [f2fs] [14696.686803] f2fs_put_super+0x158/0x390 [f2fs] [14696.688238] generic_shutdown_super+0x7a/0x120 [14696.689621] kill_block_super+0x27/0x50 [14696.690894] kill_f2fs_super+0x7f/0x100 [f2fs] [14696.692311] deactivate_locked_super+0x35/0xa0 [14696.693698] deactivate_super+0x40/0x50 [14696.694985] cleanup_mnt+0x139/0x190 [14696.696209] __cleanup_mnt+0x12/0x20 [14696.697390] task_work_run+0x64/0xa0 [14696.698587] exit_to_user_mode_prepare+0x1b7/0x1c0 [14696.700053] syscall_exit_to_user_mode+0x27/0x50 [14696.701418] do_syscall_64+0x48/0xc0 [14696.702630] entry_SYSCALL_64_after_hwframe+0x44/0xae Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/debug.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) commit bcfe9b6cbb4438b8c1cc4bd475221652c8f9301b Author: Randy Dunlap Date: Wed Mar 16 12:20:02 2022 -0700 virtio_blk: eliminate anonymous module_init & module_exit Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) ffffffff832fc78c t init ffffffff832fc79e t init ffffffff832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: e467cde23818 ("Block driver using virtio.") Signed-off-by: Randy Dunlap Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Paolo Bonzini Cc: Stefan Hajnoczi Cc: virtualization@lists.linux-foundation.org Cc: Jens Axboe Cc: linux-block@vger.kernel.org Reviewed-by: Stefan Hajnoczi Acked-by: Jason Wang Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220316192010.19001-2-rdunlap@infradead.org Signed-off-by: Jens Axboe drivers/block/virtio_blk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit f621eb13facb7681a79f4fec8ec6553ae160da76 Author: Alex Williamson Date: Tue Mar 15 11:29:57 2022 -0600 vfio-pci: Provide reviewers and acceptance criteria for variant drivers Device specific extensions for devices exposed to userspace through the vfio-pci-core library open both new functionality and new risks. Here we attempt to provided formalized requirements and expectations to ensure that future drivers both collaborate in their interaction with existing host drivers, as well as receive additional reviews from community members with experience in this area. Acked-by: Shameer Kolothum Reviewed-by: Yishai Hadas Acked-by: Kevin Tian Reviewed-by: Cornelia Huck Acked-by: Jason Gunthorpe Link: https://lore.kernel.org/r/164736509088.181560.2887686123582116702.stgit@omen Signed-off-by: Alex Williamson Documentation/driver-api/index.rst | 1 + .../vfio-pci-device-specific-driver-acceptance.rst | 35 ++++++++++++++++++++++ .../maintainer/maintainer-entry-profile.rst | 1 + MAINTAINERS | 10 +++++++ 4 files changed, 47 insertions(+) commit 8b8e7158aa757e47f2984004d0af0689592a494b Author: Lukas Bulwahn Date: Wed Mar 16 13:42:24 2022 +0100 MAINTAINERS: adjust entry for header movement in hisilicon qm driver Commit ff5812e00d5e ("crypto: hisilicon/qm: Move the QM header to include/linux") moves drivers/crypto/hisilicon/qm.h to include/linux/hisi_acc_qm.h, but misses to adjust MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Adjust the file entry in the HISILICON QM AND ZIP Controller DRIVER following this file movement. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220316124224.29091-1-lukas.bulwahn@gmail.com Fixes: ff5812e00d5e ("crypto: hisilicon/qm: Move the QM header to include/linux") Reviewed-by: Shameer Kolothum Signed-off-by: Alex Williamson MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a1108dcd9373a98f7018aa4310076260b8ecfc0b Author: David Anderson Date: Thu Mar 17 19:49:59 2022 +0800 erofs: rename ctime to mtime EROFS images should inherit modification time rather than change time, since users and host tooling have no easy way to control change time. To reflect the new timestamp meaning, i_ctime and i_ctime_nsec are renamed to i_mtime and i_mtime_nsec. Link: https://lore.kernel.org/r/20220311041829.3109511-1-dvander@google.com # v1 Signed-off-by: David Anderson [ Gao Xiang: update document as well. ] Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220317114959.106787-1-hsiangkao@linux.alibaba.com # v2 Signed-off-by: Gao Xiang Documentation/filesystems/erofs.rst | 2 +- fs/erofs/erofs_fs.h | 5 +++-- fs/erofs/inode.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) commit 5d705de0cd3400b2721185430e0dddeff79d7871 Author: Tom Rix Date: Sun Mar 13 08:02:10 2022 -0700 igb: zero hwtstamp by default Clang static analysis reports this representative issue igb_ptp.c:997:3: warning: The left operand of '+' is a garbage value ktime_add_ns(shhwtstamps.hwtstamp, adjust); ^ ~~~~~~~~~~~~~~~~~~~~ shhwtstamps.hwtstamp is set by a call to igb_ptp_systim_to_hwtstamp(). In the switch-statement for the hw type, the hwtstamp is zeroed for matches but not the default case. Move the memset out of switch-statement. This degarbages the default case and reduces the size. Some whitespace cleanup of empty lines Signed-off-by: Tom Rix Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/igb/igb_ptp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 4c905f6740a365464e91467aa50916555b28213d Author: Pablo Neira Ayuso Date: Thu Mar 17 12:04:42 2022 +0100 netfilter: nf_tables: initialize registers in nft_do_chain() Initialize registers to avoid stack leak into userspace. Fixes: 96518518cc41 ("netfilter: add nftables") Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_tables_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ad739d0889a81a4273ab60a6c83cac3e6fad6aad Author: Tom Rix Date: Wed Mar 2 04:57:02 2022 -0800 i40e: little endian only valid checksums The calculation of the checksum can fail. So move converting the checksum to little endian to inside the return status check. Signed-off-by: Tom Rix Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/i40e/i40e_nvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit a93ccb5c386c00727eb67b0793fbbae6403b69a1 Merge: de7ba639e6c5 24e69f6bc3ca Author: Kalle Valo Date: Thu Mar 17 16:29:50 2022 +0200 Merge tag 'mt76-for-kvalo-2022-03-16' of https://github.com/nbd168/wireless mt76 patches for 5.18 - bugfixes - mbssid support for mt7915 - 6 GHz support for mt7915 - mt7921u driver commit de7ba639e6c5a9903062d2f029423d89cea91398 Author: Ping-Ke Shih Date: Thu Mar 17 13:55:43 2022 +0800 rtw89: implement stop and resume channels transmission v1 These function is used to stop transmitting when we are going to switch channels or do some RF calibration. Before these operations, we need to stop channel transmission and backup setting into parameter tx_en. After operations are done, resume transmitting by backup parameter tx_en. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-13-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 20 ++++++ drivers/net/wireless/realtek/rtw89/mac.c | 84 +++++++++++++++++++++-- drivers/net/wireless/realtek/rtw89/mac.h | 3 + drivers/net/wireless/realtek/rtw89/reg.h | 7 ++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 6 +- drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c | 16 ++--- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 2 + 7 files changed, 123 insertions(+), 15 deletions(-) commit d780f926d633b74c54646ff1654efde847ddc5be Author: Ping-Ke Shih Date: Thu Mar 17 13:55:42 2022 +0800 rtw89: extend mac tx_en bits from 16 to 32 In order to support 8852C that uses 32 bits to control TX types. This patch doesn't really use 32 bits tx_en yet, but next patch will use it. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-12-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 2 +- drivers/net/wireless/realtek/rtw89/mac.c | 6 +++--- drivers/net/wireless/realtek/rtw89/mac.h | 4 ++-- drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) commit 8001c741e35195fc75ba5ceac43faac5c977abd1 Author: Ping-Ke Shih Date: Thu Mar 17 13:55:41 2022 +0800 rtw89: change value assignment style of rtw89_mac_cfg_gnt() Use if() style would be clear than "? :", because the else cases are always 0. The read val from rtw89_mac_read_lte() isn't used, so remove this statement. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-11-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/mac.c | 47 +++++++++++++++++--------------- 1 file changed, 25 insertions(+), 22 deletions(-) commit feed654178474574a53867ff1a0de0046de8758d Author: Chia-Yuan Li Date: Thu Mar 17 13:55:40 2022 +0800 rtw89: 8852c: add mac_ctrl_path and mac_cfg_gnt APIs The BT-coexistence uses these function to control antenna and TDMA, so implement the variant type to support all chips. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-10-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/coex.c | 24 ++++----- drivers/net/wireless/realtek/rtw89/core.h | 19 ++++++++ drivers/net/wireless/realtek/rtw89/mac.c | 70 +++++++++++++++++++++++++++ drivers/net/wireless/realtek/rtw89/mac.h | 3 ++ drivers/net/wireless/realtek/rtw89/reg.h | 25 ++++++++++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 2 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 2 + 7 files changed, 133 insertions(+), 12 deletions(-) commit 1abea24af42c35c6eb537e4402836e2cde2a5b13 Author: Guo Zhengkui Date: Wed Mar 16 17:28:57 2022 +0800 selftests: net: fix array_size.cocci warning Fix array_size.cocci warning in tools/testing/selftests/net. Use `ARRAY_SIZE(arr)` instead of forms like `sizeof(arr)/sizeof(arr[0])`. It has been tested with gcc (Debian 8.3.0-6) 8.3.0. Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20220316092858.9398-1-guozhengkui@vivo.com Signed-off-by: Paolo Abeni tools/testing/selftests/net/cmsg_sender.c | 4 +++- tools/testing/selftests/net/psock_fanout.c | 5 +++-- tools/testing/selftests/net/toeplitz.c | 6 ++++-- 3 files changed, 10 insertions(+), 5 deletions(-) commit de78869d1f48a1e59a9a6850b8f85d6eaebdbd06 Author: Chia-Yuan Li Date: Thu Mar 17 13:55:39 2022 +0800 rtw89: disable FW and H2C function if CPU disabled Initialize FW status and disabled H2C function if CPU disabled. Then, it can reset to initial state. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-9-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/mac.c | 4 ++++ 1 file changed, 4 insertions(+) commit e07a99682972a20fca25748e6fdbd3962ed3b7b8 Author: Ping-Ke Shih Date: Thu Mar 17 13:55:38 2022 +0800 rtw89: initialize preload window of D-MAC 8852C add new hardware feature -- preload window, which is used to load more data to D-MAC, so it can possibly yield better performance. This patch is to configure preload and reserved size for next window. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-8-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/mac.c | 43 ++++++++++++++++++++++++++++++++ drivers/net/wireless/realtek/rtw89/reg.h | 24 ++++++++++++++++++ 2 files changed, 67 insertions(+) commit 828a4396e52ab8202936efad69ab924a6da7fa76 Author: Chia-Yuan Li Date: Thu Mar 17 13:55:37 2022 +0800 rtw89: modify MAC enable functions Modify functions that control D-MAC (data MAC) and LDO to support variant chips. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-7-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/mac.c | 29 +++++++++++++++++++++++------ drivers/net/wireless/realtek/rtw89/reg.h | 2 ++ 2 files changed, 25 insertions(+), 6 deletions(-) commit 2a5f2b32639a3e7276a3b5bb5d033806c4888820 Author: Ping-Ke Shih Date: Thu Mar 17 13:55:36 2022 +0800 rtw89: add config_rf_reg_v1 to configure RF parameter tables The format of RF parameter is changed; it doesn't encode delay parameters into table, but the delay coding becomes regular pair of register address and value. To help firmware to recover RF register settings, we need to download these parameters to firmware. For v1 format, only download partial parameters (ignore them with addr < 0x100). Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-6-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 2 ++ drivers/net/wireless/realtek/rtw89/phy.c | 25 +++++++++++++++++++++---- drivers/net/wireless/realtek/rtw89/phy.h | 4 ++++ 3 files changed, 27 insertions(+), 4 deletions(-) commit 84d0e33e51df7922933e48b48f6b1c5b76e5bbfc Author: Chung-Hsuan Hung Date: Thu Mar 17 13:55:35 2022 +0800 rtw89: 8852c: add read/write rf register function Using encoded address which BIT(16) is used to discriminate which region is going to access. Illustrate the calling flow as below rtw89_phy_write_rf_v1() -+-> rtw89_phy_write_rf() // old interface +-> rtw89_phy_write_rf_a() // new interface Signed-off-by: Chung-Hsuan Hung Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-5-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/phy.c | 110 ++++++++++++++++++++++++++ drivers/net/wireless/realtek/rtw89/phy.h | 5 ++ drivers/net/wireless/realtek/rtw89/reg.h | 15 ++++ drivers/net/wireless/realtek/rtw89/rtw8852c.c | 4 + 4 files changed, 134 insertions(+) commit a9ffae8d3f9d263c128807838bd55ff68a83a3f5 Author: Yuan-Han Zhang Date: Thu Mar 17 13:55:34 2022 +0800 rtw89: 8852c: add setting of TB UL TX power offset Configure this TX power to indicate TX power offset that uses to transmit TB (trigger base) uplink frames. Also, shrink the unit of TX power offset changes to suitable type s8. Signed-off-by: Yuan-Han Zhang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-4-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 2 +- drivers/net/wireless/realtek/rtw89/reg.h | 2 ++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 8 +++--- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 36 +++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 5 deletions(-) commit 8379fa611536759e5c75b8447e317db447137d3b Author: Yuan-Han Zhang Date: Thu Mar 17 13:55:33 2022 +0800 rtw89: 8852c: add write/read crystal function in CFO tracking The CFO tracking algorithm is the same, but control methods are different. Set parameters via xtal serial interfaces (SI). Signed-off-by: Yuan-Han Zhang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-3-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/mac.h | 2 ++ drivers/net/wireless/realtek/rtw89/phy.c | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) commit b7379148f5980b24b4dae4ec5067d650b0a9bf81 Author: Yuan-Han Zhang Date: Thu Mar 17 13:55:32 2022 +0800 rtw89: modify dcfo_comp to share with chips The dcfo_comp is digital CFO (central frequency offset) compensation. Since the flow can be shared with all chips, add chip parameters to support variant register address and format. Signed-off-by: Yuan-Han Zhang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220317055543.40514-2-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 2 ++ drivers/net/wireless/realtek/rtw89/phy.c | 10 ++++++---- drivers/net/wireless/realtek/rtw89/reg.h | 2 ++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 6 ++++++ drivers/net/wireless/realtek/rtw89/rtw8852c.c | 6 ++++++ 5 files changed, 22 insertions(+), 4 deletions(-) commit 00f1d133867f3d0c20eafbcb67088f65947bbc27 Author: Colin Ian King Date: Wed Mar 16 23:42:42 2022 +0000 rtw89: Fix spelling mistake "Mis-Match" -> "Mismatch" There are some spelling mistakes in some literal strings. Fix them. Signed-off-by: Colin Ian King Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220316234242.55515-1-colin.i.king@gmail.com drivers/net/wireless/realtek/rtw89/coex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 7f5f00cdf79549940bb603f23b46c0076d187d30 Author: Colin Ian King Date: Wed Mar 16 23:39:38 2022 +0000 brcmfmac: p2p: Fix spelling mistake "Comback" -> "Comeback" There are some spelling mistakes in comments and brcmf_dbg messages. Fix these. Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220316233938.55135-1-colin.i.king@gmail.com drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 066291bec0c55315e568ead501bebdefcb8453d2 Author: Arnd Bergmann Date: Wed Mar 16 19:36:03 2022 +0100 iwlwifi: mei: fix building iwlmei Building iwlmei without CONFIG_CFG80211 causes a link-time warning: ld.lld: error: undefined symbol: ieee80211_hdrlen >>> referenced by net.c >>> net/wireless/intel/iwlwifi/mei/net.o:(iwl_mei_tx_copy_to_csme) in archive drivers/built-in.a Add an explicit dependency to avoid this. In theory it should not be needed here, but it also seems pointless to allow IWLMEI for configurations without CFG80211. Signed-off-by: Arnd Bergmann Acked-by: Emmanuel Grumbach Acked-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220316183617.1470631-1-arnd@kernel.org drivers/net/wireless/intel/iwlwifi/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 3870a44d50feeb5118a2698617d251123d9cde4c Author: Mario Limonciello Date: Wed Mar 16 16:55:48 2022 -0500 cpufreq: powernow-k8: Re-order the init checks The powernow-k8 driver will do checks at startup that the current active driver is acpi-cpufreq and show a warning when they're not expected. Because of this the following warning comes up on systems that support amd-pstate and compiled in both drivers: `WTF driver: amd-pstate` The systems that support powernow-k8 will not support amd-pstate, so re-order the checks to validate the CPU model number first to avoid this warning being displayed on modern SOCs. Signed-off-by: Mario Limonciello Acked-by: Viresh Kumar Reviewed-by: Huang Rui Signed-off-by: Rafael J. Wysocki drivers/cpufreq/powernow-k8.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit c42fa24b44751c62c86e98430ef915c0609a2ab8 Author: Rafael J. Wysocki Date: Wed Mar 16 13:39:03 2022 +0100 ACPI: bus: Avoid using CPPC if not supported by firmware If the platform firmware indicates that it does not support CPPC by clearing the OSC_SB_CPC_SUPPORT and OSC_SB_CPCV2_SUPPORT bits in the platform _OSC capabilities mask, avoid attempting to evaluate _CPC which may fail in that case. Because the OSC_SB_CPC_SUPPORT and OSC_SB_CPCV2_SUPPORT bits are only added to the supported platform capabilities mask on x86, when X86_FEATURE_HWP is supported, allow _CPC to be evaluated regardless in the other cases. Link: https://lore.kernel.org/linux-acpi/CAJZ5v0i=ecAksq0TV+iLVObm-=fUfdqPABzzkgm9K6KxO1ZCcg@mail.gmail.com Signed-off-by: Rafael J. Wysocki Tested-by: Mario Limonciello Acked-by: Huang Rui Reviewed-by: Mika Westerberg drivers/acpi/bus.c | 8 ++++++++ drivers/acpi/cppc_acpi.c | 3 +++ include/linux/acpi.h | 1 + 3 files changed, 12 insertions(+) commit 2ca8e6285250c07a2e5a22ecbfd59b5a4ef73484 Author: Rafael J. Wysocki Date: Wed Mar 16 13:37:44 2022 +0100 Revert "ACPI: Pass the same capabilities to the _OSC regardless of the query flag" Revert commit 159d8c274fd9 ("ACPI: Pass the same capabilities to the _OSC regardless of the query flag") which caused legitimate usage scenarios (when the platform firmware does not want the OS to control certain platform features controlled by the system bus scope _OSC) to break and was misguided by some misleading language in the _OSC definition in the ACPI specification (in particular, Section 6.2.11.1.3 "Sequence of _OSC Calls" that contradicts other perts of the _OSC definition). Link: https://lore.kernel.org/linux-acpi/CAJZ5v0iStA0JmO0H3z+VgQsVuQONVjKPpw0F5HKfiq=Gb6B5yw@mail.gmail.com Reported-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki Tested-by: Mario Limonciello Acked-by: Huang Rui Reviewed-by: Mika Westerberg drivers/acpi/bus.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) commit 03eb65224e5711e7a2f34b500d44866b322a249a Author: Rafael J. Wysocki Date: Tue Mar 15 20:36:42 2022 +0100 cpuidle: intel_idle: Drop redundant backslash at line end Drop a redundant backslash character at the end of a line in the spr_cstates[] definition. Signed-off-by: Rafael J. Wysocki Acked-by: Artem Bityutskiy drivers/idle/intel_idle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a335b1e6bb29300d3bc6749763a4298627e594ba Author: Rafael J. Wysocki Date: Tue Mar 15 20:35:47 2022 +0100 cpuidle: intel_idle: Update intel_idle() kerneldoc comment Commit bf9282dc26e7 ("cpuidle: Make CPUIDLE_FLAG_TLB_FLUSHED generic") moved the leave_mm() call away from intel_idle(), but it didn't update its kerneldoc comment accordingly, so do that now. Fixes: bf9282dc26e7 ("cpuidle: Make CPUIDLE_FLAG_TLB_FLUSHED generic") Signed-off-by: Rafael J. Wysocki drivers/idle/intel_idle.c | 3 --- 1 file changed, 3 deletions(-) commit c844d22fe0c0b37dc809adbdde6ceb6462c43acf Author: Werner Sembach Date: Tue Mar 15 20:02:28 2022 +0100 ACPI: video: Force backlight native for Clevo NL5xRU and NL5xNU Clevo NL5xRU and NL5xNU/TUXEDO Aura 15 Gen1 and Gen2 have both a working native and video interface. However the default detection mechanism first registers the video interface before unregistering it again and switching to the native interface during boot. This results in a dangling SBIOS request for backlight change for some reason, causing the backlight to switch to ~2% once per boot on the first power cord connect or disconnect event. Setting the native interface explicitly circumvents this buggy behaviour by avoiding the unregistering process. Signed-off-by: Werner Sembach Cc: All applicable Signed-off-by: Rafael J. Wysocki drivers/acpi/video_detect.c | 75 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) commit 6e1acfa387b9ff82cfc7db8cc3b6959221a95851 Author: Pablo Neira Ayuso Date: Thu Mar 17 11:59:26 2022 +0100 netfilter: nf_tables: validate registers coming from userspace. Bail out in case userspace uses unsupported registers. Fixes: 49499c3e6e18 ("netfilter: nf_tables: switch registers to 32 bit addressing") Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_tables_api.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) commit 58e06d05d43a9e37e121edabaada00a9d844444c Author: Dan Carpenter Date: Wed Mar 16 11:37:44 2022 +0300 net: stmmac: clean up impossible condition This code works but it has a static checker warning: drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1687 init_dma_rx_desc_rings() warn: always true condition '(queue >= 0) => (0-u32max >= 0)' Obviously, it makes no sense to check if an unsigned int is >= 0. What prevents this code from being a forever loop is that later there is a separate check for if (queue == 0). The "queue" variable is less than MTL_MAX_RX_QUEUES (8) so it can easily fit in an int type. Any larger value for "queue" would lead to an array overflow when we assign "rx_q = &priv->rx_queue[queue]". Fixes: de0b90e52a11 ("net: stmmac: rearrange RX and TX desc init into per-queue basis") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220316083744.GB30941@kili Signed-off-by: Paolo Abeni drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 435fe1c0c1f74b682dba85641406abf4337aade6 Author: Eyal Birger Date: Wed Mar 16 08:15:57 2022 +0200 net: geneve: support IPv4/IPv6 as inner protocol This patch adds support for encapsulating IPv4/IPv6 within GENEVE. In order to use this, a new IFLA_GENEVE_INNER_PROTO_INHERIT flag needs to be provided at device creation. This property cannot be changed for the time being. In case IP traffic is received on a non-tun device the drop count is increased. Signed-off-by: Eyal Birger Link: https://lore.kernel.org/r/20220316061557.431872-1-eyal.birger@gmail.com Signed-off-by: Paolo Abeni drivers/net/geneve.c | 82 ++++++++++++++++++++++++++++++++++---------- include/uapi/linux/if_link.h | 1 + 2 files changed, 64 insertions(+), 19 deletions(-) commit dc3d879c6ffa25e90875237265898e49b2cabb7e Author: Biju Das Date: Tue Mar 15 15:32:58 2022 +0000 dt-bindings: mmc: renesas,sdhi: Document RZ/G2UL SoC Document RZ/G2UL SDHI bindings. RZ/G2UL SDHI is almost identical to one found on the R-Car Gen3. No driver changes are required as generic compatible string "renesas,rcar-gen3-sdhi" will be used as a fallback. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Acked-by: Wolfram Sang Link: https://lore.kernel.org/r/20220315153258.21097-1-biju.das.jz@bp.renesas.com Signed-off-by: Ulf Hansson Documentation/devicetree/bindings/mmc/renesas,sdhi.yaml | 2 ++ 1 file changed, 2 insertions(+) commit e85d29ba4b24f68e7a78cb85c55e754362eeb2de Author: Max Filippov Date: Thu Mar 17 02:49:41 2022 -0700 xtensa: fix DTC warning unit_address_format DTC issues the following warnings when building xtfpga device trees: /soc/flash@00000000/partition@0x0: unit name should not have leading "0x" /soc/flash@00000000/partition@0x6000000: unit name should not have leading "0x" /soc/flash@00000000/partition@0x6800000: unit name should not have leading "0x" /soc/flash@00000000/partition@0x7fe0000: unit name should not have leading "0x" Drop leading 0x from flash partition unit names. Signed-off-by: Max Filippov arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi | 8 ++++---- arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi | 8 ++++---- arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) commit 82192c49f343a80b790783086de3c42e1f2bbd45 Merge: 05fc65f3f5e4 2d2a514c1d61 Author: Paolo Abeni Date: Thu Mar 17 10:49:30 2022 +0100 Merge branch 'net-mvneta-armada-98dx2530-soc' Chris Packham says: ==================== net: mvneta: Armada 98DX2530 SoC This is split off from [1] to let it go in via net-next rather than waiting for the rest of the series to land. [1] - https://lore.kernel.org/lkml/20220314213143.2404162-1-chris.packham@alliedtelesis.co.nz/ ==================== Link: https://lore.kernel.org/r/20220315215207.2746793-1-chris.packham@alliedtelesis.co.nz Signed-off-by: Paolo Abeni commit 2d2a514c1d61d8cbe00f22f27ff51623d3be89e6 Author: Chris Packham Date: Wed Mar 16 10:52:07 2022 +1300 net: mvneta: Add support for 98DX2530 Ethernet port The 98DX2530 SoC is similar to the Armada 3700 except it needs a different MBUS window configuration. Add a new compatible string to identify this device and the required MBUS window configuration. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Signed-off-by: Paolo Abeni drivers/net/ethernet/marvell/mvneta.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 270a95966881f25c17590e9702860fd1101cfb66 Author: Chris Packham Date: Wed Mar 16 10:52:06 2022 +1300 dt-bindings: net: mvneta: Add marvell,armada-ac5-neta The out of band port on the 98DX2530 SoC is similar to the armada-3700 except it requires a slightly different MBUS window configuration. Add a new compatible string so this difference can be accounted for. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Signed-off-by: Paolo Abeni Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt | 1 + 1 file changed, 1 insertion(+) commit 05fc65f3f5e45e8194e16b8e43e92133ada06e26 Author: Jonathan Lemon Date: Tue Mar 15 12:46:26 2022 -0700 ptp: ocp: Fix PTP_PF_* verification requests Update and check functionality for pin configuration requests: PTP_PF_NONE: requests "IN: None", disabling the pin. # testptp -d /dev/ptp3 -L3,0 -i1 set pin function okay # cat sma4 IN: None PTP_PF_EXTTS: should configure external timestamps, but since the timecard can steer inputs to multiple inputs as well as timestamps, allow the request, but don't change configurations. # testptp -d /dev/ptp3 -L3,1 -i1 set pin function okay (no functional or configuration change here yet) PTP_PF_PEROUT: Channel 0 is the PHC, at 1PPS. Channels 1-4 are the programmable frequency generators. # fails because period is not 1PPS. # testptp -d /dev/ptp3 -L3,2 -i0 -p 500000000 PTP_PEROUT_REQUEST: Invalid argument # testptp -d /dev/ptp3 -L3,2 -i0 -p 1000000000 periodic output request okay # cat sma4 OUT: PHC # testptp -d /dev/ptp3 -L3,2 -i1 -p 500000000 -w 200000000 periodic output request okay # cat sma4 OUT: GEN1 # cat gen1/signal 500000000 40 0 1 2022-03-10T23:55:26 TAI # cat gen1/running 1 # testptp -d /dev/ptp3 -L3,2 -i1 -p 0 periodic output request okay # cat gen1/running 0 Signed-off-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220315194626.1895-1-jonathan.lemon@gmail.com Signed-off-by: Paolo Abeni drivers/ptp/ptp_ocp.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) commit 45514f78c65cc9a09437f20e180625f94f769863 Author: Richard Zhu Date: Thu Feb 24 11:06:53 2022 +0800 PCI: imx6: Assert i.MX8MM CLKREQ# even if no device present The CLKREQ# signal is an open drain, active low signal that is driven low by the remote Endpoint device. But it might not be driven low if no Endpoint device is connected. On i.MX8MM PCIe, phy_init() may fail and system boot may hang if no Endpoint is connected to assert CLKREQ#. Handle this as on i.MX8MQ, where we explicitly assert CLKREQ# so the PHY can be initialized. Link: https://lore.kernel.org/r/1645672013-8949-1-git-send-email-hongxing.zhu@nxp.com Fixes: 178e244cb6e2 ("PCI: imx: Add the imx8mm pcie support") Signed-off-by: Richard Zhu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Lucas Stach drivers/pci/controller/dwc/pci-imx6.c | 4 ---- 1 file changed, 4 deletions(-) commit deaf7a2c2e4b5072a743633bf37c45f34426a093 Author: Richard Zhu Date: Thu Mar 3 14:34:35 2022 +0800 PCI: imx6: Invoke the PHY exit function after PHY power off To balance phy->init_count, invoke the phy_exit() after phy_power_off(). Link: https://lore.kernel.org/r/1646289275-17813-1-git-send-email-hongxing.zhu@nxp.com Fixes: 178e244cb6e2 ("PCI: imx: Add the imx8mm pcie support") Signed-off-by: Richard Zhu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Lucas Stach drivers/pci/controller/dwc/pci-imx6.c | 1 + 1 file changed, 1 insertion(+) commit 2f618d5ef5dd05e2380ee627814de90d5a33c3f2 Author: Arnd Bergmann Date: Wed Mar 9 14:20:20 2022 +0100 ARM: remove support for NOMMU ARMv4/v5 It is possible to build MMU-less kernels for Cortex-M base microcrontrollers as well as a couple of older platforms that have not been converted to CONFIG_ARCH_MULTIPLATFORM, specifically ep93xx, footbridge, dove, sa1100 and s3c24xx. It seems unlikely that anybody has tested those configurations in recent years, as even building them is frequently broken. A patch I submitted caused another build time regression in this configuration. I sent a patch for that, but it seems better to also remove the option entirely, leaving ARMv7-M as the only supported Arm NOMMU target for simplicity. A couple of platforms have dependencies on CONFIG_MMU, those can all be removed now. Notably, mach-integrator tries to support MMU-less CPU cores, but those have not actually been selectable for a long time. This addresses several build failures in randconfig builds that have accumulated over the years. Cc: Vladimir Murzin Cc: Russell King Acked-by: Geert Uytterhoeven Reviewed-by: Linus Walleij Reviewed by: Ard Biesheuvel Signed-off-by: Arnd Bergmann arch/arm/Kconfig | 34 +++++++++------------- arch/arm/mach-bcm/Kconfig | 1 - arch/arm/mach-footbridge/include/mach/hardware.h | 20 +++++-------- arch/arm/mach-footbridge/include/mach/io.h | 20 ------------- arch/arm/mach-integrator/Kconfig | 37 +----------------------- arch/arm/mach-integrator/hardware.h | 5 ---- arch/arm/mach-nspire/Kconfig | 1 - arch/arm/mach-orion5x/Kconfig | 2 +- arch/arm/mach-shmobile/Kconfig | 2 +- arch/arm/mach-ux500/Kconfig | 2 +- 10 files changed, 24 insertions(+), 100 deletions(-) commit 717f1019c0fc664143a4b62bb42d5707ffb8b810 Merge: a860352e9dd0 725726fd1fb7 Author: Jakub Kicinski Date: Wed Mar 16 19:59:43 2022 -0700 Merge branch 'flow_offload-add-tc-vlan-push_eth-and-pop_eth-actions' Roi Dayan says: ==================== flow_offload: add tc vlan push_eth and pop_eth actions Offloading vlan push_eth and pop_eth actions is needed in order to correctly offload MPLSoUDP encap and decap flows, this series extends the flow offload API to support these actions and updates mlx5 to parse them. ==================== Link: https://lore.kernel.org/r/20220315110211.1581468-1-roid@nvidia.com Signed-off-by: Jakub Kicinski commit 725726fd1fb716f81eaffcac95381d0230967fa1 Author: Maor Dickman Date: Tue Mar 15 13:02:11 2022 +0200 net/mlx5e: MPLSoUDP encap, support action vlan pop_eth explicitly Currently the MPLSoUDP encap offload does the L2 pop implicitly while adding such action explicitly (vlan eth_push) will cause the rule to not be offloaded. Solve it by adding offload support for vlan eth_push in case of MPLSoUDP decap case. Flow example: filter root protocol ip pref 1 flower chain 0 filter root protocol ip pref 1 flower chain 0 handle 0x1 eth_type ipv4 dst_ip 2.2.2.22 src_ip 2.2.2.21 in_hw in_hw_count 1 action order 1: vlan pop_eth pipe index 1 ref 1 bind 1 used_hw_stats delayed action order 2: mpls push protocol mpls_uc label 555 tc 3 ttl 255 pipe index 1 ref 1 bind 1 used_hw_stats delayed action order 3: tunnel_key set src_ip 8.8.8.21 dst_ip 8.8.8.22 dst_port 6635 csum tos 0x4 ttl 6 pipe index 1 ref 1 bind 1 used_hw_stats delayed action order 4: mirred (Egress Redirect to device bareudp0) stolen index 1 ref 1 bind 1 used_hw_stats delayed Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Jakub Kicinski drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.h | 1 + drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c | 5 +++++ drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/vlan.c | 3 +++ 4 files changed, 10 insertions(+) commit 697319b2954faae7816497ef15d731666acdc4e7 Author: Maor Dickman Date: Tue Mar 15 13:02:10 2022 +0200 net/mlx5e: MPLSoUDP decap, use vlan push_eth instead of pedit Currently action pedit of source and destination MACs is used to fill the MACs in L2 push step in MPLSoUDP decap offload, this isn't aligned to tc SW which use vlan eth_push action to do this. To fix that, offload support for vlan veth_push action is added together with mpls pop action, and deprecate the use of pedit of MACs. Flow example: filter protocol mpls_uc pref 1 flower chain 0 filter protocol mpls_uc pref 1 flower chain 0 handle 0x1 eth_type 8847 mpls_label 555 enc_dst_port 6635 in_hw in_hw_count 1 action order 1: tunnel_key unset pipe index 2 ref 1 bind 1 used_hw_stats delayed action order 2: mpls pop protocol ip pipe index 2 ref 1 bind 1 used_hw_stats delayed action order 3: vlan push_eth dst_mac de:a2:ec:d6:69:c8 src_mac de:a2:ec:d6:69:c8 pipe index 2 ref 1 bind 1 used_hw_stats delayed action order 4: mirred (Egress Redirect to device enp8s0f0_0) stolen index 2 ref 1 bind 1 used_hw_stats delayed Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Jakub Kicinski .../ethernet/mellanox/mlx5/core/en/tc/act/act.c | 6 +++ .../ethernet/mellanox/mlx5/core/en/tc/act/act.h | 1 + .../ethernet/mellanox/mlx5/core/en/tc/act/mirred.c | 5 ++ .../ethernet/mellanox/mlx5/core/en/tc/act/mpls.c | 7 +-- .../ethernet/mellanox/mlx5/core/en/tc/act/pedit.c | 59 +++------------------- .../ethernet/mellanox/mlx5/core/en/tc/act/pedit.h | 3 +- .../ethernet/mellanox/mlx5/core/en/tc/act/vlan.c | 16 ++++-- .../mellanox/mlx5/core/en/tc/act/vlan_mangle.c | 4 +- .../net/ethernet/mellanox/mlx5/core/en/tc_priv.h | 1 - .../ethernet/mellanox/mlx5/core/en/tc_tun_encap.c | 10 ++-- drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 1 + 11 files changed, 43 insertions(+), 70 deletions(-) commit ab95465cde2337108252cdf01f064abdc1a67f6c Author: Maor Dickman Date: Tue Mar 15 13:02:09 2022 +0200 net/sched: add vlan push_eth and pop_eth action to the hardware IR Add vlan push_eth and pop_eth action to the hardware intermediate representation model which would subsequently allow it to be used by drivers for offload. Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Jakub Kicinski include/net/flow_offload.h | 6 ++++++ include/net/tc_act/tc_vlan.h | 10 ++++++++++ net/sched/act_vlan.c | 13 +++++++++++++ 3 files changed, 29 insertions(+) commit a860352e9dd02552e04a0503d0982cf9a4d3a0f4 Author: Tobias Waldekranz Date: Wed Mar 16 00:30:33 2022 +0100 net: dsa: Never offload FDB entries on standalone ports If a port joins a bridge that it can't offload, it will fallback to standalone mode and software bridging. In this case, we never want to offload any FDB entries to hardware either. Previously, for host addresses, we would eventually end up in dsa_port_bridge_host_fdb_add, which would unconditionally dereference dp->bridge and cause a segfault. Fixes: c26933639b54 ("net: dsa: request drivers to perform FDB isolation") Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220315233033.1468071-1-tobias@waldekranz.com Signed-off-by: Jakub Kicinski net/dsa/slave.c | 3 +++ 1 file changed, 3 insertions(+) commit 4de7c8bd6a380d69848ec7991cc85eeed652daac Author: Yang Li Date: Wed Mar 16 07:56:03 2022 +0800 phy: Remove duplicated include in phy-fsl-lynx-28g.c Fix following includecheck warning: ./drivers/phy/freescale/phy-fsl-lynx-28g.c: linux/workqueue.h is included more than once. Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220315235603.59481-1-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski drivers/phy/freescale/phy-fsl-lynx-28g.c | 1 - 1 file changed, 1 deletion(-) commit 571703ff387cf5d2efbeda2674644345fcb3b016 Author: Minghao Chi Date: Wed Mar 16 01:24:44 2022 +0000 net: mv643xx_eth: undo some opreations in mv643xx_eth_probe Cannot directly return platform_get_irq return irq, there are operations that need to be undone. Fixes: bf2b83425b59 ("net: mv643xx_eth: use platform_get_irq() instead of platform_get_resource()") Signed-off-by: Minghao Chi Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220316012444.2126070-1-chi.minghao@zte.com.cn Signed-off-by: Jakub Kicinski drivers/net/ethernet/marvell/mv643xx_eth.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit f403443015c6520d146813ec48cbfce0c902ccc0 Author: Colin Ian King Date: Tue Mar 15 22:29:14 2022 +0000 net: hns3: Fix spelling mistake "does't" -> "doesn't" There is a spelling mistake in a dev_warn message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220315222914.2960786-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2fc559c8cba028aaa80f73796a8ce5325418fb3e Author: Colin Ian King Date: Tue Mar 15 22:26:15 2022 +0000 gve: Fix spelling mistake "droping" -> "dropping" There is a spelling mistake in a netdev_warn warning. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220315222615.2960504-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/google/gve/gve_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9aa8dfde4869ccdec0a7290b686dbc10e079e163 Author: Pavel Begunkov Date: Thu Mar 17 02:03:42 2022 +0000 io_uring: fold evfd signalling under a slower path Add ->has_evfd flag, which is true IFF there is an eventfd attached, and use it to hide io_eventfd_signal() into __io_commit_cqring_flush() and combine fast checks in a single if. Also, gcc 11.2 wasn't inlining io_cqring_ev_posted() without this change, so helps with that as well. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f6168471997decded475a063f92915787975a30b.1647481208.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 60 +++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 26 deletions(-) commit 9333f6b4628c8037a89ed23e1188d4b7dc5d74e4 Author: Pavel Begunkov Date: Thu Mar 17 02:03:41 2022 +0000 io_uring: thin down io_commit_cqring() io_commit_cqring() is currently always under spinlock section, so it's always better to keep it as slim as possible. Move __io_commit_cqring_flush() out of it into ev_posted*(). If fast checks do fail and this post-processing is required, we'll reacquire ->completion_lock, which is fine as we don't care about performance of draining and offset timeouts. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ec4e81fd720d3bc7bca8cb9152e080dad1a052f1.1647481208.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) commit 66fc25ca6b7ec4124606e0d59c71c6bcf14e05bb Author: Pavel Begunkov Date: Thu Mar 17 02:03:40 2022 +0000 io_uring: shuffle io_eventfd_signal() bits around A preparation patch, which moves a fast ->io_ev_fd check out of io_eventfd_signal() into ev_posted*(). Compilers are smart enough for it to not change anything, but will need it later. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ec4091ac76d43912b73917e8db651c2dac4b7b01.1647481208.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) commit 0f84747177b962c32243a57cb454193bdba4fe8d Author: Pavel Begunkov Date: Thu Mar 17 02:03:39 2022 +0000 io_uring: remove extra barrier for non-sqpoll iopoll smp_mb() in io_cqring_ev_posted_iopoll() is only there because of waitqueue_active(). However, non-SQPOLL IOPOLL ring doesn't wake the CQ and so the barrier there is useless. Kill it, it's usually pretty expensive. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d72e8ef6f7a3f6a72e18fad8409f7d47afc8da7d.1647481208.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit b91ef1872869d99cd42e908eb9754b81115c2c05 Author: Pavel Begunkov Date: Wed Mar 16 20:24:47 2022 -0600 io_uring: fix provided buffer return on failure for kiocb_done() Use io_req_complete_failed() in kiocb_done(). This cleans up the code, but also ensures that a provided buffers is correctly freed on failure. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/a4880106fcf199d5810707fe2d17126fcdf18bc4.1647481208.git.asml.silence@gmail.com [axboe: split from previous patch] Signed-off-by: Jens Axboe fs/io_uring.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) commit 3b2b78a8eb7cc38d207c5ee516769bc3f44d19ea Author: Pavel Begunkov Date: Thu Mar 17 02:03:38 2022 +0000 io_uring: extend provided buf return to fails It's never a good idea to put provided buffers without notifying the userspace, it'll lead to userspace leaks, so add io_put_kbuf() in io_req_complete_failed(). The fail helper is called by all sorts of requests, but it's still safe to do as io_put_kbuf() will return 0 in for all requests that don't support and so don't expect provided buffers. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/a4880106fcf199d5810707fe2d17126fcdf18bc4.1647481208.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit af1147b236da553544bed1ed8b683510e1278308 Author: wujunwen Date: Tue Mar 15 12:28:57 2022 +0000 net: ksz884x: optimize netdev_open flow and remove static variable remove the static next_jiffies variable, and reinitialize next_jiffies to simplify netdev_open Signed-off-by: wujunwen Link: https://lore.kernel.org/r/20220315122857.78601-1-wudaemon@163.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/micrel/ksz884x.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit a8df216630fedadc4e8cc086f0e2e612f9c3d1f4 Author: Meng Tang Date: Tue Mar 15 15:48:51 2022 +0800 hamradio: Fix wrong assignment of 'bbc->cfg.loopback' In file hamradio/baycom_epp.c, the baycom_setmode interface, there is a problem with improper use of strstr. Suppose that when modestr="noloopback", both conditions which are 'strstr(modestr,"noloopback")' and 'strstr(modestr,"loopback")' will be true(not NULL), this lead the bc->cfg.loopback variable will be first assigned to 0, and then reassigned to 1. This will cause 'bc->cfg.loopback = 0' will never take effect. That obviously violates the logic of the code, so adjust the order of their execution to solve the problem. Signed-off-by: Meng Tang Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/20220315074851.6456-1-tangmeng@uniontech.com Signed-off-by: Jakub Kicinski drivers/net/hamradio/baycom_epp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e077ed58c243afc197bc2a2ba0e1ff61135e4ec2 Author: Hangbin Liu Date: Tue Mar 15 14:26:18 2022 +0800 bareudp: use ipv6_mod_enabled to check if IPv6 enabled bareudp_create_sock() use AF_INET6 by default if IPv6 CONFIG enabled. But if user start kernel with ipv6.disable=1, the bareudp sock will created failed, which cause the interface open failed even with ethertype ip. e.g. # ip link add bareudp1 type bareudp dstport 2 ethertype ip # ip link set bareudp1 up RTNETLINK answers: Address family not supported by protocol Fix it by using ipv6_mod_enabled() to check if IPv6 enabled. There is no need to check IS_ENABLED(CONFIG_IPV6) as ipv6_mod_enabled() will return false when CONFIG_IPV6 no enabled in include/linux/ipv6.h. Reported-by: Jianlin Shi Fixes: 571912c69f0e ("net: UDP tunnel encapsulation module for tunnelling different protocols like MPLS, IP, NSH etc.") Signed-off-by: Hangbin Liu Link: https://lore.kernel.org/r/20220315062618.156230-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski drivers/net/bareudp.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) commit 6695490dc85781fe98b782f36f27c13710dbc921 Author: Pavel Begunkov Date: Thu Mar 17 02:03:37 2022 +0000 io_uring: refactor timeout cancellation cqe posting io_fill_cqe*() is not always the best way to post CQEs just because there is enough of infrastructure on top. Replace a raw call to a variant of it inside of io_timeout_cancel(), which also saves us some bloating and might help with batching later. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/46113ec4345764b4aef3b384ce38cceabaeedcbb.1647481208.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit ae4da18941c1c13a9bd6f1d39888ca9a4ff3db91 Author: Pavel Begunkov Date: Thu Mar 17 02:03:36 2022 +0000 io_uring: normilise naming for fill_cqe* Restore consistency in __io_fill_cqe* like helpers, always honouring "io_" prefix and adding "req" when we're passing in a request. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/bd016ff5c1a4f74687828069d2619d8a65e0c6d7.1647481208.git.asml.silence@gmail.com Signed-off-by: Jens Axboe fs/io_uring.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit a0bfd73deba1bb3c51e2f208ec03465422af667c Merge: b1351527f1ee c34983c94166 Author: Jakub Kicinski Date: Wed Mar 16 18:56:26 2022 -0700 Merge tag 'linux-can-next-for-5.18-20220316' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-03-16 the first 3 patches are by Oliver Hartkopp target the CAN ISOTP protocol and fix a problem found by syzbot in isotp_bind(), return -EADDRNOTAVAIL in unbound sockets in isotp_recvmsg() and add support for MSG_TRUNC to isotp_recvmsg(). Amit Kumar Mahapatra converts the xilinx,can device tree bindings to yaml. The last patch is by Julia Lawall and fixes typos in the ucan driver. * tag 'linux-can-next-for-5.18-20220316' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: can: ucan: fix typos in comments dt-bindings: can: xilinx_can: Convert Xilinx CAN binding to YAML can: isotp: support MSG_TRUNC flag when reading from socket can: isotp: return -EADDRNOTAVAIL when reading from unbound socket can: isotp: sanitize CAN ID checks in isotp_bind() ==================== Link: https://lore.kernel.org/r/20220316204710.716341-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 156f721704b5c9e8fae02270f606f09d710ff27e Author: AngeloGioacchino Del Regno Date: Tue Feb 22 12:11:44 2022 +0100 pinctrl: mediatek: common-v1: Commonize spec_ies_smt_set callback All of the MediaTek pinctrl drivers registering with pinctrl-mtk-common that are offering a .spec_ies_smt_set() callback are declaring their own function which is doing exactly the same on all drivers: calling mtk_pconf_spec_set_ies_smt_range() with their struct and a simple check. Commonize this callback by adding the ies and smt structure pointers to struct mtk_pinctrl_devdata and changing the callback signature to take it. Removing the callback and checking for the existance of the spec_smt and/or spec_ies data would allow us to staticize the function mtk_pconf_spec_set_ies_smt_range(), but this solution was avoided as to keep flexibility, as some SoCs may need to perform a very different operation compared to what this commonized function is doing. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220222111144.20796-6-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-mt2701.c | 18 +++++------------ drivers/pinctrl/mediatek/pinctrl-mt2712.c | 19 +++++------------- drivers/pinctrl/mediatek/pinctrl-mt8127.c | 19 +++++------------- drivers/pinctrl/mediatek/pinctrl-mt8167.c | 18 +++++------------ drivers/pinctrl/mediatek/pinctrl-mt8173.c | 18 +++++------------ drivers/pinctrl/mediatek/pinctrl-mt8365.c | 18 +++++------------ drivers/pinctrl/mediatek/pinctrl-mt8516.c | 18 +++++------------ drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 29 +++++++++++++++++++++------ drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 17 ++++++++++++---- 9 files changed, 71 insertions(+), 103 deletions(-) commit c19763c3de3718b8d8472e180421aa9d4a86770f Author: AngeloGioacchino Del Regno Date: Tue Feb 22 12:11:43 2022 +0100 pinctrl: mediatek: common-v1: Commonize spec_pupd callback Reduce code size and duplication by using a common spec_pupd callback, which is possible to use on all of the pinctrl drivers that are using the v1 pinctrl-mtk-common code, with the exception of mt8135, which has a different handling compared to the others. Since the callback function signature was changed, this had to be propagated to pinctrl-mt8135's spec_pull_set(). Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220222111144.20796-5-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-mt2701.c | 11 +++-------- drivers/pinctrl/mediatek/pinctrl-mt2712.c | 14 +++----------- drivers/pinctrl/mediatek/pinctrl-mt8127.c | 11 +++-------- drivers/pinctrl/mediatek/pinctrl-mt8135.c | 6 ++++-- drivers/pinctrl/mediatek/pinctrl-mt8167.c | 11 +++-------- drivers/pinctrl/mediatek/pinctrl-mt8173.c | 11 +++-------- drivers/pinctrl/mediatek/pinctrl-mt8365.c | 11 +++-------- drivers/pinctrl/mediatek/pinctrl-mt8516.c | 11 +++-------- drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 21 ++++++++++++--------- drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 14 +++++++++----- 10 files changed, 46 insertions(+), 75 deletions(-) commit c8c206cdc193d1c20f5c309a89b00b30010caad4 Author: AngeloGioacchino Del Regno Date: Tue Feb 22 12:11:42 2022 +0100 pinctrl: mediatek: common-v1: Use common probe function Most of the mediatek pinctrl drivers are calling mtk_pctrl_init() and passing only a pointer to struct mtk_pinctrl_devdata, as the regmap handle it passed from device-tree, with the exception of mt6397. For all of the drivers that don't require passing a struct regmap pointer from a parent device, simplify the probe mechanism by assigning the required structure as match data and use mtk_pctrl_common_probe() as their probe function. While at it, also collapse the of_device_id entries to a single line, as they all fit in max 83 columns, which is acceptable. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220222111144.20796-4-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-mt2701.c | 11 +++-------- drivers/pinctrl/mediatek/pinctrl-mt2712.c | 11 ++--------- drivers/pinctrl/mediatek/pinctrl-mt8127.c | 9 ++------- drivers/pinctrl/mediatek/pinctrl-mt8135.c | 11 ++--------- drivers/pinctrl/mediatek/pinctrl-mt8167.c | 11 ++--------- drivers/pinctrl/mediatek/pinctrl-mt8365.c | 11 ++--------- drivers/pinctrl/mediatek/pinctrl-mt8516.c | 11 ++--------- 7 files changed, 15 insertions(+), 60 deletions(-) commit e091feda1e3cd2925a2819f2dc2d5487ced2b010 Author: AngeloGioacchino Del Regno Date: Tue Feb 22 12:11:41 2022 +0100 pinctrl: mediatek: common-v1: Add common probe function As a preparation to cleanup the probe mechanism of mediatek pinctrl drivers that are using the v1 controller, add a common probe function to this driver. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220222111144.20796-3-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 11 +++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 2 ++ 2 files changed, 13 insertions(+) commit 78df7bba4ab88dd6f663335858b92f9cfa2cb850 Author: AngeloGioacchino Del Regno Date: Tue Feb 22 12:11:40 2022 +0100 pinctrl: mediatek: paris: Unify probe function by using OF match data All of the SoCs using Paris pinctrl are defining a custom probe function that is simply calling mtk_paris_pinctrl_probe() passing a pointer to the SoC specific mtk_pin_soc structure and nothing else. Simplify the probe mechanism across all pinctrl drivers that are using pinctrl-paris by passing the specific mtk_pin_soc as match data and using function mtk_paris_pinctrl_probe as a common probe function for all of them. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220222111144.20796-2-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-mt6765.c | 9 ++------- drivers/pinctrl/mediatek/pinctrl-mt6779.c | 9 ++------- drivers/pinctrl/mediatek/pinctrl-mt6797.c | 9 ++------- drivers/pinctrl/mediatek/pinctrl-mt8183.c | 9 ++------- drivers/pinctrl/mediatek/pinctrl-mt8192.c | 9 ++------- drivers/pinctrl/mediatek/pinctrl-mt8195.c | 9 ++------- drivers/pinctrl/mediatek/pinctrl-paris.c | 9 ++++++--- drivers/pinctrl/mediatek/pinctrl-paris.h | 3 +-- 8 files changed, 19 insertions(+), 47 deletions(-) commit 91eac1c69c202d9dad8bf717ae5b92db70bfe5cf Author: Jens Axboe Date: Wed Mar 16 16:59:10 2022 -0600 io_uring: cache poll/double-poll state with a request flag With commit "io_uring: cache req->apoll->events in req->cflags" applied, we now have just io_poll_remove_entries() dipping into req->apoll when it isn't strictly necessary. Mark poll and double-poll with a flag, so we know if we need to look at apoll->double_poll. This avoids pulling in those cachelines if we don't need them. The common case is that the poll wake handler already removed these entries while hot off the completion path. Signed-off-by: Jens Axboe fs/io_uring.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) commit 81459350d581e958ee9c6e76031f77333881c23c Author: Jens Axboe Date: Wed Mar 16 16:55:05 2022 -0600 io_uring: cache req->apoll->events in req->cflags When we arm poll on behalf of a different type of request, like a network receive, then we allocate req->apoll as our poll entry. Running network workloads shows io_poll_check_events() as the most expensive part of io_uring, and it's all due to having to pull in req->apoll instead of just the request which we have hot already. Cache poll->events in req->cflags, which isn't used until the request completes anyway. This isn't strictly needed for regular poll, where req->poll.events is used and thus already hot, but for the sake of unification we do it all around. This saves 3-4% of overhead in certain request workloads. Signed-off-by: Jens Axboe fs/io_uring.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) commit ad13baf4569152b00de11949b8c93aaa83c1243f Author: Hou Tao Date: Wed Mar 9 20:33:21 2022 +0800 selftests/bpf: Test subprog jit when toggle bpf_jit_harden repeatedly When bpf_jit_harden is toggled between 0 and 2, subprog jit may fail due to inconsistent twice read values of bpf_jit_harden during jit. So add a test to ensure the problem is fixed. Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220309123321.2400262-5-houtao1@huawei.com tools/testing/selftests/bpf/prog_tests/subprogs.c | 77 ++++++++++++++++++++--- 1 file changed, 68 insertions(+), 9 deletions(-) commit d2a3b7c5becc3992f8e7d2b9bf5eacceeedb9a48 Author: Hou Tao Date: Wed Mar 9 20:33:20 2022 +0800 bpf: Fix net.core.bpf_jit_harden race It is the bpf_jit_harden counterpart to commit 60b58afc96c9 ("bpf: fix net.core.bpf_jit_enable race"). bpf_jit_harden will be tested twice for each subprog if there are subprogs in bpf program and constant blinding may increase the length of program, so when running "./test_progs -t subprogs" and toggling bpf_jit_harden between 0 and 2, jit_subprogs may fail because constant blinding increases the length of subprog instructions during extra passs. So cache the value of bpf_jit_blinding_enabled() during program allocation, and use the cached value during constant blinding, subprog JITing and args tracking of tail call. Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220309123321.2400262-4-houtao1@huawei.com include/linux/filter.h | 1 + kernel/bpf/core.c | 3 ++- kernel/bpf/verifier.c | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) commit 73e14451f39e54f83ea3badb6d6b8a423f901845 Author: Hou Tao Date: Wed Mar 9 20:33:18 2022 +0800 bpf, x86: Fall back to interpreter mode when extra pass fails Extra pass for subprog jit may fail (e.g. due to bpf_jit_harden race), but bpf_func is not cleared for the subprog and jit_subprogs will succeed. The running of the bpf program may lead to oops because the memory for the jited subprog image has already been freed. So fall back to interpreter mode by clearing bpf_func/jited/jited_len when extra pass fails. Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220309123321.2400262-2-houtao1@huawei.com arch/x86/net/bpf_jit_comp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit aaccdf9c93a00cc5eec6f9d97046b44643c60800 Merge: 6585abea98ae 82cb2b30773e Author: Alexei Starovoitov Date: Wed Mar 16 15:07:49 2022 -0700 Merge branch 'Remove libcap dependency from bpf selftests' Martin KaFai Lau says: ==================== After upgrading to the newer libcap (>= 2.60), the libcap commit aca076443591 ("Make cap_t operations thread safe.") added a "__u8 mutex;" to the "struct _cap_struct". It caused a few byte shift that breaks the assumption made in the "struct libcap" definition in test_verifier.c. This set is to remove the libcap dependency from the bpf selftests. v2: - Define CAP_PERFMON and CAP_BPF when the older does not have them. (Andrii) ==================== Signed-off-by: Alexei Starovoitov commit 82cb2b30773e3ccbbd2ed4427d52a91862d4db6d Author: Martin KaFai Lau Date: Wed Mar 16 10:38:35 2022 -0700 bpf: selftests: Remove libcap usage from test_progs This patch removes the libcap usage from test_progs. bind_perm.c is the only user. cap_*_effective() helpers added in the earlier patch are directly used instead. No other selftest binary is using libcap, so '-lcap' is also removed from the Makefile. Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Reviewed-by: Stanislav Fomichev Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220316173835.2039334-1-kafai@fb.com tools/testing/selftests/bpf/Makefile | 5 ++- tools/testing/selftests/bpf/prog_tests/bind_perm.c | 44 ++++------------------ 2 files changed, 11 insertions(+), 38 deletions(-) commit b1c2768a82b9cd149f54e335de38ea1212f47b07 Author: Martin KaFai Lau Date: Wed Mar 16 10:38:29 2022 -0700 bpf: selftests: Remove libcap usage from test_verifier This patch removes the libcap usage from test_verifier. The cap_*_effective() helpers added in the earlier patch are used instead. Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220316173829.2038682-1-kafai@fb.com tools/testing/selftests/bpf/Makefile | 3 +- tools/testing/selftests/bpf/test_verifier.c | 88 ++++++++--------------------- 2 files changed, 27 insertions(+), 64 deletions(-) commit 663af70aabb7c9b6bd5e1c1cdeb44e7025a4f855 Author: Martin KaFai Lau Date: Wed Mar 16 10:38:23 2022 -0700 bpf: selftests: Add helpers to directly use the capget and capset syscall After upgrading to the newer libcap (>= 2.60), the libcap commit aca076443591 ("Make cap_t operations thread safe.") added a "__u8 mutex;" to the "struct _cap_struct". It caused a few byte shift that breaks the assumption made in the "struct libcap" definition in test_verifier.c. The bpf selftest usage only needs to enable and disable the effective caps of the running task. It is easier to directly syscall the capget and capset instead. It can also remove the libcap library dependency. The cap_helpers.{c,h} is added. One __u64 is used for all CAP_* bits instead of two __u32. Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220316173823.2036955-1-kafai@fb.com tools/testing/selftests/bpf/cap_helpers.c | 67 +++++++++++++++++++++++++++++++ tools/testing/selftests/bpf/cap_helpers.h | 19 +++++++++ 2 files changed, 86 insertions(+) commit 75c05fabb873367d9e64f063dda8a310c4c58826 Author: Mike Rapoport Date: Thu Mar 10 10:27:36 2022 +0200 docs/kernel-parameters: update description of mem= The existing description of mem= does not cover all the cases and differences between how architectures treat it. Extend the description to match the code. Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/20220310082736.1346366-1-rppt@kernel.org Signed-off-by: Jonathan Corbet Documentation/admin-guide/kernel-parameters.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) commit 9cdd3128874f5fe759e2c4e1360ab7fb96a8d1df Author: Baokun Li Date: Fri Jan 14 18:28:54 2022 +0800 jffs2: fix memory leak in jffs2_scan_medium If an error is returned in jffs2_scan_eraseblock() and some memory has been added to the jffs2_summary *s, we can observe the following kmemleak report: -------------------------------------------- unreferenced object 0xffff88812b889c40 (size 64): comm "mount", pid 692, jiffies 4294838325 (age 34.288s) hex dump (first 32 bytes): 40 48 b5 14 81 88 ff ff 01 e0 31 00 00 00 50 00 @H........1...P. 00 00 01 00 00 00 01 00 00 00 02 00 00 00 09 08 ................ backtrace: [] __kmalloc+0x613/0x910 [] jffs2_sum_add_dirent_mem+0x5c/0xa0 [] jffs2_scan_medium.cold+0x36e5/0x4794 [] jffs2_do_mount_fs.cold+0xa7/0x2267 [] jffs2_do_fill_super+0x383/0xc30 [] jffs2_fill_super+0x2ea/0x4c0 [] mtd_get_sb+0x254/0x400 [] mtd_get_sb_by_nr+0x4f/0xd0 [] get_tree_mtd+0x498/0x840 [] jffs2_get_tree+0x25/0x30 [] vfs_get_tree+0x8d/0x2e0 [] path_mount+0x50f/0x1e50 [] do_mount+0x107/0x130 [] __se_sys_mount+0x1c5/0x2f0 [] __x64_sys_mount+0xc7/0x160 [] do_syscall_64+0x45/0x70 unreferenced object 0xffff888114b54840 (size 32): comm "mount", pid 692, jiffies 4294838325 (age 34.288s) hex dump (first 32 bytes): c0 75 b5 14 81 88 ff ff 02 e0 02 00 00 00 02 00 .u.............. 00 00 84 00 00 00 44 00 00 00 6b 6b 6b 6b 6b a5 ......D...kkkkk. backtrace: [] kmem_cache_alloc_trace+0x584/0x880 [] jffs2_sum_add_inode_mem+0x54/0x90 [] jffs2_scan_medium.cold+0x4481/0x4794 [...] unreferenced object 0xffff888114b57280 (size 32): comm "mount", pid 692, jiffies 4294838393 (age 34.357s) hex dump (first 32 bytes): 10 d5 6c 11 81 88 ff ff 08 e0 05 00 00 00 01 00 ..l............. 00 00 38 02 00 00 28 00 00 00 6b 6b 6b 6b 6b a5 ..8...(...kkkkk. backtrace: [] kmem_cache_alloc_trace+0x584/0x880 [] jffs2_sum_add_xattr_mem+0x54/0x90 [] jffs2_scan_medium.cold+0x298c/0x4794 [...] unreferenced object 0xffff8881116cd510 (size 16): comm "mount", pid 692, jiffies 4294838395 (age 34.355s) hex dump (first 16 bytes): 00 00 00 00 00 00 00 00 09 e0 60 02 00 00 6b a5 ..........`...k. backtrace: [] kmem_cache_alloc_trace+0x584/0x880 [] jffs2_sum_add_xref_mem+0x54/0x90 [] jffs2_scan_medium.cold+0x3a20/0x4794 [...] -------------------------------------------- Therefore, we should call jffs2_sum_reset_collected(s) on exit to release the memory added in s. In addition, a new tag "out_buf" is added to prevent the NULL pointer reference caused by s being NULL. (thanks to Zhang Yi for this analysis) Fixes: e631ddba5887 ("[JFFS2] Add erase block summary support (mount time improvement)") Cc: stable@vger.kernel.org Co-developed-with: Zhihao Cheng Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger fs/jffs2/scan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit d051cef784de4d54835f6b6836d98a8f6935772c Author: Baokun Li Date: Fri Jan 14 18:28:53 2022 +0800 jffs2: fix memory leak in jffs2_do_mount_fs If jffs2_build_filesystem() in jffs2_do_mount_fs() returns an error, we can observe the following kmemleak report: -------------------------------------------- unreferenced object 0xffff88811b25a640 (size 64): comm "mount", pid 691, jiffies 4294957728 (age 71.952s) 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: [] kmem_cache_alloc_trace+0x584/0x880 [] jffs2_sum_init+0x86/0x130 [] jffs2_do_mount_fs+0x798/0xac0 [] jffs2_do_fill_super+0x383/0xc30 [] jffs2_fill_super+0x2ea/0x4c0 [...] unreferenced object 0xffff88812c760000 (size 65536): comm "mount", pid 691, jiffies 4294957728 (age 71.952s) hex dump (first 32 bytes): bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................ backtrace: [] __kmalloc+0x6b9/0x910 [] jffs2_sum_init+0xd7/0x130 [] jffs2_do_mount_fs+0x798/0xac0 [] jffs2_do_fill_super+0x383/0xc30 [] jffs2_fill_super+0x2ea/0x4c0 [...] -------------------------------------------- This is because the resources allocated in jffs2_sum_init() are not released. Call jffs2_sum_exit() to release these resources to solve the problem. Fixes: e631ddba5887 ("[JFFS2] Add erase block summary support (mount time improvement)") Cc: stable@vger.kernel.org Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger fs/jffs2/build.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 4c7c44ee1650677fbe89d86edbad9497b7679b5c Author: Baokun Li Date: Tue Dec 28 20:54:30 2021 +0800 jffs2: fix use-after-free in jffs2_clear_xattr_subsystem When we mount a jffs2 image, assume that the first few blocks of the image are normal and contain at least one xattr-related inode, but the next block is abnormal. As a result, an error is returned in jffs2_scan_eraseblock(). jffs2_clear_xattr_subsystem() is then called in jffs2_build_filesystem() and then again in jffs2_do_fill_super(). Finally we can observe the following report: ================================================================== BUG: KASAN: use-after-free in jffs2_clear_xattr_subsystem+0x95/0x6ac Read of size 8 at addr ffff8881243384e0 by task mount/719 Call Trace: dump_stack+0x115/0x16b jffs2_clear_xattr_subsystem+0x95/0x6ac jffs2_do_fill_super+0x84f/0xc30 jffs2_fill_super+0x2ea/0x4c0 mtd_get_sb+0x254/0x400 mtd_get_sb_by_nr+0x4f/0xd0 get_tree_mtd+0x498/0x840 jffs2_get_tree+0x25/0x30 vfs_get_tree+0x8d/0x2e0 path_mount+0x50f/0x1e50 do_mount+0x107/0x130 __se_sys_mount+0x1c5/0x2f0 __x64_sys_mount+0xc7/0x160 do_syscall_64+0x45/0x70 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Allocated by task 719: kasan_save_stack+0x23/0x60 __kasan_kmalloc.constprop.0+0x10b/0x120 kasan_slab_alloc+0x12/0x20 kmem_cache_alloc+0x1c0/0x870 jffs2_alloc_xattr_ref+0x2f/0xa0 jffs2_scan_medium.cold+0x3713/0x4794 jffs2_do_mount_fs.cold+0xa7/0x2253 jffs2_do_fill_super+0x383/0xc30 jffs2_fill_super+0x2ea/0x4c0 [...] Freed by task 719: kmem_cache_free+0xcc/0x7b0 jffs2_free_xattr_ref+0x78/0x98 jffs2_clear_xattr_subsystem+0xa1/0x6ac jffs2_do_mount_fs.cold+0x5e6/0x2253 jffs2_do_fill_super+0x383/0xc30 jffs2_fill_super+0x2ea/0x4c0 [...] The buggy address belongs to the object at ffff8881243384b8 which belongs to the cache jffs2_xattr_ref of size 48 The buggy address is located 40 bytes inside of 48-byte region [ffff8881243384b8, ffff8881243384e8) [...] ================================================================== The triggering of the BUG is shown in the following stack: ----------------------------------------------------------- jffs2_fill_super jffs2_do_fill_super jffs2_do_mount_fs jffs2_build_filesystem jffs2_scan_medium jffs2_scan_eraseblock <--- ERROR jffs2_clear_xattr_subsystem <--- free jffs2_clear_xattr_subsystem <--- free again ----------------------------------------------------------- An error is returned in jffs2_do_mount_fs(). If the error is returned by jffs2_sum_init(), the jffs2_clear_xattr_subsystem() does not need to be executed. If the error is returned by jffs2_build_filesystem(), the jffs2_clear_xattr_subsystem() also does not need to be executed again. So move jffs2_clear_xattr_subsystem() from 'out_inohash' to 'out_root' to fix this UAF problem. Fixes: aa98d7cf59b5 ("[JFFS2][XATTR] XATTR support on JFFS2 (version. 5)") Cc: stable@vger.kernel.org Reported-by: Hulk Robot Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger fs/jffs2/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0a575497691486a75bdc3ae551094432b0761a84 Author: Helge Deller Date: Sat Mar 12 21:03:33 2022 +0100 parisc: Avoid calling SMP cache flush functions on cache-less machines At least the qemu virtual machine does not provide D- and I-caches, so skip triggering SMP irqs to flush caches on such machines. Further optimize the caching code by using static branches and making some functions static. Signed-off-by: Helge Deller arch/parisc/include/asm/cacheflush.h | 15 ++++------- arch/parisc/kernel/alternative.c | 10 ++++++++ arch/parisc/kernel/cache.c | 49 ++++++++++++++++++------------------ 3 files changed, 40 insertions(+), 34 deletions(-) commit c01c2e435db8b62bd67a50e9622d59ca7c7953b7 Author: Tang Yizhou Date: Sat Mar 12 15:26:42 2022 +0800 docs/zh_CN: Add sched-nice-design Chinese translation Translate scheduler/sched-nice-design.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20220312072642.23118-1-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet .../translations/zh_CN/scheduler/index.rst | 2 +- .../zh_CN/scheduler/sched-nice-design.rst | 99 ++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) commit b57b84968865780262f191cc95d688d7f82e681c Author: Tang Yizhou Date: Sat Mar 12 15:07:51 2022 +0800 docs: scheduler: Convert schedutil.txt to ReST All other scheduler documents have been converted to *.rst. Let's do the same for schedutil.txt. Also fixed some typos. Signed-off-by: Tang Yizhou Link: https://lore.kernel.org/r/20220312070751.16844-1-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet Documentation/scheduler/index.rst | 1 + .../scheduler/{schedutil.txt => schedutil.rst} | 30 ++++++++++++---------- 2 files changed, 18 insertions(+), 13 deletions(-) commit 163b438b510cf749cdd5e57fc5b40bf72fa09edb Author: hongnanli Date: Fri Feb 11 11:19:28 2022 +0800 fs/jffs2: fix comments mentioning i_mutex inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix comments still mentioning i_mutex. Signed-off-by: hongnanli Signed-off-by: Richard Weinberger fs/jffs2/jffs2_fs_i.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c34983c94166689358372d4af8d5def57752860c Author: Julia Lawall Date: Mon Mar 14 12:53:51 2022 +0100 can: ucan: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Link: https://lore.kernel.org/all/20220314115354.144023-28-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Acked-by: Marc Kleine-Budde Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/ucan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 7843d3c8e5e6887e79dd11c7b5311d9fec66cb76 Author: Amit Kumar Mahapatra Date: Wed Mar 16 22:41:05 2022 +0530 dt-bindings: can: xilinx_can: Convert Xilinx CAN binding to YAML Convert Xilinx CAN binding documentation to YAML. Link: https://lore.kernel.org/all/20220316171105.17654-1-amit.kumar-mahapatra@xilinx.com Signed-off-by: Amit Kumar Mahapatra Reviewed-by: Krzysztof Kozlowski Signed-off-by: Marc Kleine-Budde .../devicetree/bindings/net/can/xilinx,can.yaml | 161 +++++++++++++++++++++ .../devicetree/bindings/net/can/xilinx_can.txt | 61 -------- 2 files changed, 161 insertions(+), 61 deletions(-) commit 42bf50a1795a1854d48717b7361dbdbce496b16b Author: Oliver Hartkopp Date: Wed Mar 16 17:42:58 2022 +0100 can: isotp: support MSG_TRUNC flag when reading from socket When providing the MSG_TRUNC flag via recvmsg() syscall the return value provides the real length of the packet or datagram, even when it was longer than the passed buffer. Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1065932671 Link: https://lore.kernel.org/all/20220316164258.54155-3-socketcan@hartkopp.net Suggested-by: Derek Will Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde net/can/isotp.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) commit 30ffd5332e06316bd69a654c06aa033872979b7c Author: Oliver Hartkopp Date: Wed Mar 16 17:42:57 2022 +0100 can: isotp: return -EADDRNOTAVAIL when reading from unbound socket When reading from an unbound can-isotp socket the syscall blocked indefinitely. As unbound sockets (without given CAN address information) do not make sense anyway we directly return -EADDRNOTAVAIL on read() analogue to the known behavior from sendmsg(). Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://github.com/linux-can/can-utils/issues/349 Link: https://lore.kernel.org/all/20220316164258.54155-2-socketcan@hartkopp.net Suggested-by: Derek Will Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde net/can/isotp.c | 4 ++++ 1 file changed, 4 insertions(+) commit 3ea566422cbde9610c2734980d1286ab681bb40e Author: Oliver Hartkopp Date: Wed Mar 16 17:42:56 2022 +0100 can: isotp: sanitize CAN ID checks in isotp_bind() Syzbot created an environment that lead to a state machine status that can not be reached with a compliant CAN ID address configuration. The provided address information consisted of CAN ID 0x6000001 and 0xC28001 which both boil down to 11 bit CAN IDs 0x001 in sending and receiving. Sanitize the SFF/EFF CAN ID values before performing the address checks. Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://lore.kernel.org/all/20220316164258.54155-1-socketcan@hartkopp.net Reported-by: syzbot+2339c27f5c66c652843e@syzkaller.appspotmail.com Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde net/can/isotp.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) commit 753132f0394b7e3cebe805a6c626a02e75766f7f Merge: 835ca59799f5 61ad28ff6cf3 Author: Mark Brown Date: Wed Mar 16 20:34:23 2022 +0000 Introduce IPC abstraction for SOF topology parsing Merge series from Ranjani Sridharan : This patchset makes the topology parsing layer in the SOF driver IPC-agnostic in preparation for supporting the new IPC version introduced in the SOF firmware. These patches purely contain abstraction changes for the current IPC version (IPC3) supported and do not introduce any functional changes. commit 24e69f6bc3ca4a1696158b68a6fbf14252a8bd28 Author: Deren Wu Date: Wed Mar 16 17:51:52 2022 +0800 mt76: fix monitor rx FCS error in DFS channel When setup monitor mode in DFS channel, mt76 send CH_SWITCH_DFS to fw for channel config. This would cause rx performance bad while monitoring frames. Settings CH_SWITCH_NORMAL in monitor mode would get the same performance as normal channels. Reviewed-by: Shayne Chen Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 3 ++- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 3 ++- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) commit 1f12fa34e5dc57433e63e7137d11afa0df4c5b8f Author: Sean Wang Date: Wed Mar 16 03:25:03 2022 +0800 mt76: mt7921: don't enable beacon filter when IEEE80211_CONF_CHANGE_MONITOR is set IEEE80211_CONF_CHANGE_MONITOR would be set every time even when vif runs as sta mode. If vif runs as sta mode, the beacon filter would be falsely enabled earlier than the associated state. That is not the behavior the firmware expects and also breaks the original logic of sta mode. Thus, we only limit the operation to set the beacon filter only for monitor mode when IEEE80211_CONF_CHANGE_MONITOR is set. Fixes: 4ad65a54617c ("mt76: mt7921: toggle runtime-pm adding a monitor vif") Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit 32bfd774626d8e1051fe78ae37f0906421a8bd84 Author: Deren Wu Date: Wed Mar 16 00:24:34 2022 +0800 mt76: fix wrong HE data rate in sniffer tool Due to the missing IEEE80211_RADIOTAP_HE_DATA1_BW_RU_ALLOC_KNOWN in status report, the HE rate in wirehsark/tcpdump always shows wrong value. Applications will refer to IEEE80211_RADIOTAP_HE_DATA5_DATA_BW_RU_ALLOC when the flag is set and shows the correct data rate. Reviewed-by: Ryder Lee Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 6 ++++-- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) commit 6b7f9aff7c673989c6adf601c7e3f3684d5acd44 Author: Lorenzo Bianconi Date: Tue Mar 15 13:19:12 2022 +0100 mt76: mt7915: introduce 802.11ax multi-bss support Introduce mbss mcu APIs to enable 802.11ax multi-bss AP support for mt7915 devices Tested-by: Money Wang Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Co-developed-by: Money Wang Signed-off-by: Money Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau .../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 19 ++++++-- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 + drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 54 +++++++++++++++++++++- 3 files changed, 70 insertions(+), 5 deletions(-) commit b1351527f1eeb9624c301ecb7d8adbc4f543e045 Merge: 49045b9c810c 706217c1ceb5 Author: Jakub Kicinski Date: Wed Mar 16 12:56:49 2022 -0700 Merge branch 'devlink-expose-instance-locking-and-simplify-port-splitting' Jakub Kicinski says: ==================== devlink: expose instance locking and simplify port splitting This series puts the devlink ports fully under the devlink instance lock's protection. As discussed in the past it implements my preferred solution of exposing the instance lock to the drivers. This way drivers which want to support port splitting can lock the devlink instance themselves on the probe path, and we can take that lock in the core on the split/unsplit paths. nfp and mlxsw are converted, with slightly deeper changes done in nfp since I'm more familiar with that driver. Now that the devlink port is protected we can pass a pointer to the drivers, instead of passing a port index and forcing the drivers to do their own lookups. Both nfp and mlxsw can container_of() to their own structures. ==================== Link: https://lore.kernel.org/r/20220315060009.1028519-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 706217c1ceb516c96283a1557a31fe003d0c8052 Author: Jakub Kicinski Date: Mon Mar 14 23:00:09 2022 -0700 devlink: pass devlink_port to port_split / port_unsplit callbacks Now that devlink ports are protected by the instance lock it seems natural to pass devlink_port as an argument to the port_split / port_unsplit callbacks. This should save the drivers from doing a lookup. In theory drivers may have supported unsplitting ports which were not registered prior to this change. Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: Jakub Kicinski drivers/net/ethernet/mellanox/mlxsw/core.c | 32 +++++++--------- drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 15 ++++---- drivers/net/ethernet/netronome/nfp/nfp_port.c | 18 --------- drivers/net/ethernet/netronome/nfp/nfp_port.h | 2 - include/net/devlink.h | 4 +- net/core/devlink.c | 47 ++++++------------------ 6 files changed, 35 insertions(+), 83 deletions(-) commit 49e83bbe8cc32e197fccf4f617b3fa2fedc27a23 Author: Jakub Kicinski Date: Mon Mar 14 23:00:08 2022 -0700 devlink: hold the instance lock in port_split / port_unsplit callbacks Let the core take the devlink instance lock around port splitting and remove the now redundant locking in the drivers. Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: Jakub Kicinski drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 7 ------ drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 32 ++++++------------------ net/core/devlink.c | 2 -- 3 files changed, 8 insertions(+), 33 deletions(-) commit 5e8930aa86a561998a37aa512d790ad2982122bc Author: Jakub Kicinski Date: Mon Mar 14 23:00:07 2022 -0700 eth: mlxsw: switch to explicit locking for port registration Explicitly lock the devlink instance and use devl_ API. This will be used by the subsequent patch to invoke .port_split / .port_unsplit callbacks with devlink instance lock held. Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Signed-off-by: Jakub Kicinski drivers/net/ethernet/mellanox/mlxsw/core.c | 4 ++-- drivers/net/ethernet/mellanox/mlxsw/minimal.c | 6 ++++++ drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) commit 162cca42920c2597298fcdf85538b40356c92151 Author: Jakub Kicinski Date: Mon Mar 14 23:00:06 2022 -0700 eth: nfp: replace driver's "pf" lock with devlink instance lock The whole reason for existence of the pf mutex is that we could not lock the devlink instance around port splitting. There are more types of reconfig which can make ports appear or disappear. Now that the devlink instance lock is exposed to drivers and "locked" helpers exist we can switch to using the devlink lock directly. Next patches will move the locking inside .port_(un)split to the core. Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_app.h | 11 ++++---- drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 16 +++++------ drivers/net/ethernet/netronome/nfp/nfp_main.c | 19 +++++++------ drivers/net/ethernet/netronome/nfp/nfp_main.h | 6 ++-- drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 34 +++++++++++++---------- drivers/net/ethernet/netronome/nfp/nfp_port.c | 3 +- 6 files changed, 48 insertions(+), 41 deletions(-) commit 8a38f2cc968aebe40cfa287b53b1b52ef7acd4dc Author: Jakub Kicinski Date: Mon Mar 14 23:00:05 2022 -0700 eth: nfp: wrap locking assertions in helpers We can replace the PF lock with devlink instance lock in subsequent changes. To make the patches easier to comprehend and limit line lengths - factor out the existing locking assertions. No functional changes. Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/flower/main.c | 4 ++-- drivers/net/ethernet/netronome/nfp/nfp_app.c | 2 +- drivers/net/ethernet/netronome/nfp/nfp_app.h | 9 +++++++++ drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 4 ++-- 4 files changed, 14 insertions(+), 5 deletions(-) commit 2cb7b4890d6e7f20560dc251e7f8d3cc68b0d554 Author: Jakub Kicinski Date: Mon Mar 14 23:00:04 2022 -0700 devlink: expose instance locking and add locked port registering It should be familiar and beneficial to expose devlink instance lock to the drivers. This way drivers can block devlink from calling them during critical sections without breakneck locking. Add port helpers, port splitting callbacks will be the first target. Use 'devl_' prefix for "explicitly locked" API. Initial RFC used '__devlink' but that's too much typing. devl_lock_is_held() is not defined without lockdep, which is the same behavior as lockdep_is_held() itself. Reviewed-by: Leon Romanovsky Signed-off-by: Jakub Kicinski Documentation/networking/devlink/index.rst | 16 +++++ include/net/devlink.h | 11 ++++ net/core/devlink.c | 95 ++++++++++++++++++++++-------- 3 files changed, 98 insertions(+), 24 deletions(-) commit 160d0603a14458d38135aeeba2a1e57bb636e48f Author: Martin Jücker Date: Wed Mar 16 16:43:09 2022 +0100 ARM: defconfig: add SMB347 charger driver for p4note The Summit SMB347 charger is part of the P4Note family of devices (e.g. Samsung Galaxy Note 10.1 (GT-N8010/N8013), enable the driver in exynos and multi_v7 defconfigs. Signed-off-by: Martin Jücker Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/4f1f6a4f8200855d07f3faed80ec5cc320e40941.1643919230.git.martin.juecker@gmail.com Link: https://lore.kernel.org/r/20220316154309.436028-3-krzysztof.kozlowski@canonical.com' Signed-off-by: Arnd Bergmann arch/arm/configs/exynos_defconfig | 1 + arch/arm/configs/multi_v7_defconfig | 1 + 2 files changed, 2 insertions(+) commit bfb60ede2c3e5ce6281ab3fb3861c333fe131897 Author: Alim Akhtar Date: Wed Mar 16 16:43:08 2022 +0100 arm64: dts: fsd: Add the MCT support Add node relevant to support MCT, which is used as one of the system timer on this SoC. Signed-off-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220223171858.11384-1-alim.akhtar@samsung.com Link: https://lore.kernel.org/r/20220316154309.436028-2-krzysztof.kozlowski@canonical.com' Signed-off-by: Arnd Bergmann arch/arm64/boot/dts/tesla/fsd.dtsi | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) commit 521d61fc760aebdbf8938347a40c9538c0a70034 Author: Jens Axboe Date: Wed Mar 16 12:53:23 2022 -0600 io_uring: move req->poll_refs into previous struct hole This serves two purposes: - We now have the last cacheline mostly unused for generic workloads, instead of having to pull in the poll refs explicitly for workloads that rely on poll arming. - It shrinks the io_kiocb from 232 to 224 bytes. Signed-off-by: Jens Axboe fs/io_uring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit c7ff29763989bd09c433f73fae3c1e1c15d9cda4 Author: Srinivas Pandruvada Date: Mon Mar 14 15:09:37 2022 -0700 thermal: int340x: Update OS policy capability handshake Update the firmware with OS supported policies mask, so that firmware can relinquish its internal controls. Without this update several Tiger Lake laptops gets performance limited with in few seconds of executing in turbo region. The existing way of enumerating firmware policies via IDSP method and selecting policy by directly writing those policy UUIDS via _OSC method is not supported in newer generation of hardware. There is a new UUID "B23BA85D-C8B7-3542-88DE-8DE2FFCFD698" is defined for updating policy capabilities. As part of ACPI _OSC method: Arg0 - UUID: B23BA85D-C8B7-3542-88DE-8DE2FFCFD698 Arg1 - Rev ID: 1 Arg2 - Count: 2 Arg3 - Capability buffers: Array of Arg2 DWORDS DWORD1: As defined in the ACPI 5.0 Specification - Bit 0: Query Flag - Bits 1-3: Always 0 - Bits 4-31: Reserved DWORD2 and beyond: - Bit0: set to 1 to indicate Intel(R) Dynamic Tuning is active, 0 to indicate it is disabled and legacy thermal mechanism should be enabled. - Bit1: set to 1 to indicate Intel(R) Dynamic Tuning is controlling active cooling, 0 to indicate bios shall enable legacy thermal zone with active trip point. - Bit2: set to 1 to indicate Intel(R) Dynamic Tuning is controlling passive cooling, 0 to indicate bios shall enable legacy thermal zone with passive trip point. - Bit3: set to 1 to indicate Intel(R) Dynamic Tuning is handling critical trip point, 0 to indicate bios shall enable legacy thermal zone with critical trip point. - Bits 4:31: Reserved From sysfs interface, there is an existing interface to update policy UUID using attribute "current_uuid". User space can write the same UUID for ACTIVE, PASSIVE and CRITICAL policy. Driver converts these UUIDs to DWORD2 Bit 1 to Bit 3. When any of the policy is activated by user space it is assumed that dynamic tuning is active. For example $cd /sys/bus/platform/devices/INTC1040:00/uuids To support active policy $echo "3A95C389-E4B8-4629-A526-C52C88626BAE" > current_uuid To support passive policy $echo "42A441D6-AE6A-462b-A84B-4A8CE79027D3" > current_uuid To support critical policy $echo "97C68AE7-15FA-499c-B8C9-5DA81D606E0A" > current_uuid To check all the supported policies $cat current_uuid 3A95C389-E4B8-4629-A526-C52C88626BAE 42A441D6-AE6A-462b-A84B-4A8CE79027D3 97C68AE7-15FA-499c-B8C9-5DA81D606E0A To match the bit format for DWORD2, rearranged enum int3400_thermal_uuid and int3400_thermal_uuids[] by swapping current INT3400_THERMAL_ACTIVE and INT3400_THERMAL_PASSIVE_1. If the policies are enumerated via IDSP method then legacy method is used, if not the new method is used to update policy support. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki .../intel/int340x_thermal/int3400_thermal.c | 146 ++++++++++++++------- 1 file changed, 97 insertions(+), 49 deletions(-) commit 668f69a5f863b877bc3ae129efe9a80b6f055141 Author: Srinivas Pandruvada Date: Mon Mar 14 15:08:55 2022 -0700 thermal: int340x: Increase bitmap size The number of policies are 10, so can't be supported by the bitmap size of u8. Even though there are no platfoms with these many policies, but for correctness increase to u32. Signed-off-by: Srinivas Pandruvada Fixes: 16fc8eca1975 ("thermal/int340x_thermal: Add additional UUIDs") Cc: 5.1+ # 5.1+ Signed-off-by: Rafael J. Wysocki drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 16c02447f3e1d7f86829ef66ce294aac38bd6b4c Author: Srinivas Pandruvada Date: Fri Mar 11 14:14:13 2022 -0800 Documentation: thermal: DPTF Documentation Document Intel Dynamic Platform and Thermal Framework (DPTF) ABI. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki Documentation/driver-api/thermal/index.rst | 1 + Documentation/driver-api/thermal/intel_dptf.rst | 272 ++++++++++++++++++++++++ 2 files changed, 273 insertions(+) commit f6c46b1d62f8ffbf2cf6eb43ab0d277bd3f7e948 Author: David Woodhouse Date: Fri Mar 11 19:20:17 2022 +0000 PM: hibernate: Honour ACPI hardware signature by default for virtual guests The ACPI specification says that OSPM should refuse to restore from hibernate if the hardware signature changes, and should boot from scratch. However, real BIOSes often vary the hardware signature in cases where we *do* want to resume from hibernate, so Linux doesn't follow the spec by default. However, in a virtual environment there's no reason for the VMM to vary the hardware signature *unless* it wants to trigger a clean reboot as defined by the ACPI spec. So enable the check by default if a hypervisor is detected. Signed-off-by: David Woodhouse Signed-off-by: Rafael J. Wysocki arch/x86/kernel/acpi/sleep.c | 23 +++++++++++++++++++++-- drivers/acpi/sleep.c | 11 +++-------- include/linux/acpi.h | 2 +- 3 files changed, 25 insertions(+), 11 deletions(-) commit 3d13058ed2a6d0ddb55a45a979acc49a845be874 Author: Srinivas Pandruvada Date: Thu Mar 10 14:42:23 2022 -0800 cpufreq: intel_pstate: Use firmware default EPP For some specific platforms (E.g. AlderLake) the balance performance EPP is updated from the hard coded value in the driver. This acts as the default and balance_performance EPP. The purpose of this EPP update is to reach maximum 1 core turbo frequency (when possible) out of the box. Although we can achieve the objective by using hard coded value in the driver, there can be other EPP which can be better in terms of power. But that will be very subjective based on platform and use cases. This is not practical to have a per platform specific default hard coded in the driver. If a platform wants to specify default EPP, it can be set in the firmware. If this EPP is not the chipset default of 0x80 (balance_perf_epp unless driver changed it) and more performance oriented but not 0, the driver can use this as the default and balanced_perf EPP. In this case no driver update is required every time there is some new platform and default EPP. If the firmware didn't update the EPP from the chipset default then the hard coded value is used as per existing implementation. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki drivers/cpufreq/intel_pstate.c | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) commit 4c1202189e351bc99856805ee9c82ffca6594ba0 Author: Jacob Keller Date: Tue Mar 1 15:02:28 2022 -0800 ice: add trace events for tx timestamps We've previously run into many issues related to the latency of a Tx timestamp completion with the ice hardware. It can be difficult to determine the root cause of a slow Tx timestamp. To aid in this, introduce new trace events which capture timing data about when the driver reaches certain points while processing a transmit timestamp * ice_tx_tstamp_request: Trace when the stack initiates a new timestamp request. * ice_tx_tstamp_fw_req: Trace when the driver begins a read of the timestamp register in the work thread. * ice_tx_tstamp_fw_done: Trace when the driver finishes reading a timestamp register in the work thread. * ice_tx_tstamp_complete: Trace when the driver submits the skb back to the stack with a completed Tx timestamp. These trace events can be enabled using the standard trace event subsystem exposed by the ice driver. If they are disabled, they become no-ops with no run time cost. The following is a simple GNU AWK script which can highlight one potential way to use the trace events to capture latency data from the trace buffer about how long the driver takes to process a timestamp: ----- BEGIN { PREC=256 } # Detect requests /tx_tstamp_request/ { time=strtonum($4) skb=$7 # Store the time of request for this skb requests[skb] = time printf("skb %s: idx %d at %.6f\n", skb, idx, time) } # Detect completions /tx_tstamp_complete/ { time=strtonum($4) skb=$7 idx=$9 if (skb in requests) { latency = (time - requests[skb]) * 1000 printf("skb %s: %.3f to complete\n", skb, latency) if (latency > 4) { printf(">>> HIGH LATENCY <<<\n") } printf("\n") } else { printf("!!! skb %s (idx %d) at %.6f\n", skb, idx, time) } } ----- Signed-off-by: Jacob Keller Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_ptp.c | 8 ++++++++ drivers/net/ethernet/intel/ice/ice_trace.h | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) commit 2b1d0a242a0038f65e10d77261b7cbcb6bb5b18a Author: Yang Yingliang Date: Sat Mar 5 17:04:30 2022 +0800 ice: fix return value check in ice_gnss.c kthread_create_worker() and tty_alloc_driver() return ERR_PTR() and never return NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 43113ff73453 ("ice: add TTY for GNSS module for E810T device") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_gnss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3a3bae50af5d73fab5da20484029de77ca67bb2e Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:15 2022 +0000 fs: Remove aops ->set_page_dirty With all implementations converted to ->dirty_folio, we can stop calling this fallback method and remove it entirely. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/ecryptfs/mmap.c | 2 +- include/linux/fs.h | 3 +-- mm/page-writeback.c | 11 +++-------- mm/page_io.c | 4 +--- 4 files changed, 6 insertions(+), 14 deletions(-) commit 51cdea7ac94d8e4da13cd9880d2c331cd78222bb Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:14 2022 +0000 fb_defio: Use noop_dirty_folio() Remove the custom implementation of set_page_dirty. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs drivers/video/fbdev/core/fb_defio.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) commit 46de8b979492e1377947700ecb1e3169088668b2 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:13 2022 +0000 fs: Convert __set_page_dirty_no_writeback to noop_dirty_folio This is a mechanical change. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs drivers/dax/device.c | 2 +- fs/aio.c | 2 +- fs/ext2/inode.c | 2 +- fs/ext4/inode.c | 2 +- fs/fuse/dax.c | 2 +- fs/hugetlbfs/inode.c | 2 +- fs/libfs.c | 4 ++-- fs/xfs/xfs_aops.c | 2 +- include/linux/pagemap.h | 2 +- mm/page-writeback.c | 10 +++++----- mm/page_io.c | 2 +- mm/secretmem.c | 2 +- mm/shmem.c | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) commit e621900ad28b748e058b81d6078a5d5eb37b3973 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:12 2022 +0000 fs: Convert __set_page_dirty_buffers to block_dirty_folio Convert all callers; mostly this is just changing the aops to point at it, but a few implementations need a little more work. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs block/fops.c | 2 +- fs/adfs/inode.c | 2 +- fs/affs/file.c | 4 ++-- fs/bfs/file.c | 2 +- fs/buffer.c | 33 +++++++++++++++------------------ fs/ecryptfs/mmap.c | 2 +- fs/exfat/inode.c | 2 +- fs/ext2/inode.c | 8 ++++---- fs/ext4/inode.c | 12 ++++++------ fs/fat/inode.c | 2 +- fs/gfs2/aops.c | 16 +++++----------- fs/gfs2/meta_io.c | 4 ++-- fs/hfs/inode.c | 4 ++-- fs/hfsplus/inode.c | 4 ++-- fs/hpfs/file.c | 2 +- fs/jfs/inode.c | 2 +- fs/minix/inode.c | 2 +- fs/mpage.c | 2 +- fs/nilfs2/mdt.c | 4 ++-- fs/ntfs/aops.c | 12 ++++++------ fs/ntfs3/inode.c | 2 +- fs/ocfs2/aops.c | 2 +- fs/omfs/file.c | 2 +- fs/reiserfs/inode.c | 14 +++++++------- fs/sysv/itree.c | 2 +- fs/udf/file.c | 2 +- fs/udf/inode.c | 2 +- fs/ufs/inode.c | 2 +- include/linux/buffer_head.h | 2 +- mm/filemap.c | 4 ++-- mm/page-writeback.c | 2 +- mm/rmap.c | 4 ++-- 32 files changed, 76 insertions(+), 85 deletions(-) commit af7afdc7bbbe60cb6ce51a86b022d647e1a72717 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:11 2022 +0000 nilfs: Convert nilfs_set_page_dirty() to nilfs_dirty_folio() The comment about the page always being locked is wrong, so copy the locking protection from __set_page_dirty_buffers(). That means moving the call to nilfs_set_file_dirty() down the function so as to not acquire a new dependency between the mapping->private_lock and the ns_inode_lock. That might be a harmless dependency to add, but it's not necessary. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/nilfs2/inode.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) commit 2bcd5b9f357d5359cff2ad6d1e68e0a606d02870 Author: Wojciech Drewek Date: Mon Mar 14 17:43:14 2022 +0100 ice: Fix inconsistent indenting in ice_switch Fix the following warning as reported by smatch: smatch warnings: drivers/net/ethernet/intel/ice/ice_switch.c:5568 ice_find_dummy_packet() warn: inconsistent indenting Fixes: 9a225f81f540 ("ice: Support GTP-U and GTP-C offload in switchdev") Reported-by: kernel test robot Signed-off-by: Wojciech Drewek Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1c71e03afe4b457a15e50de40006b927dfc00755 Author: Lorenzo Bianconi Date: Mon Mar 14 17:29:13 2022 +0100 mt76: mt7921: move mt7921_init_hw in a dedicated work Firmware initialization can take a while. Move mt7921_init_hw routine in a dedicated work in order to not slow down bootstrap process. Tested-by: Deren Wu Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/init.c | 62 +++++++++++++++------- drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 2 + drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 1 + drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 1 + drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 1 + 5 files changed, 48 insertions(+), 19 deletions(-) commit 0d2afe09fad5f8c59e21630f10b66b08cf5c529a Author: Lorenzo Bianconi Date: Mon Mar 14 16:10:31 2022 +0100 mt76: mt7921: add mt7921u driver Introduce support for MT7921U 802.11ax 2x2:2SS wireless devices. Tested-by: Sean Wang Tested-by: Deren Wu Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/Kconfig | 11 + drivers/net/wireless/mediatek/mt76/mt7921/Makefile | 2 + drivers/net/wireless/mediatek/mt76/mt7921/init.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 1 + drivers/net/wireless/mediatek/mt76/mt7921/main.c | 3 +- drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 12 + drivers/net/wireless/mediatek/mt76/mt7921/regs.h | 50 +++- drivers/net/wireless/mediatek/mt76/mt7921/usb.c | 305 +++++++++++++++++++++ .../net/wireless/mediatek/mt76/mt7921/usb_mac.c | 252 +++++++++++++++++ 9 files changed, 635 insertions(+), 3 deletions(-) commit 8b7a56d5c0c90032e579595a9d31d22217e62b87 Author: Lorenzo Bianconi Date: Mon Mar 14 16:10:30 2022 +0100 mt76: mt7921: move mt7921_usb_sdio_tx_status_data in mac common code. This is a preliminary patch to add mt7921u driver support. Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 12 ++++++++++++ drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 2 +- drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c | 11 ----------- 4 files changed, 14 insertions(+), 13 deletions(-) commit 9da47b504c5b294b3d3df3665a05a80caf54c192 Author: Lorenzo Bianconi Date: Mon Mar 14 16:10:29 2022 +0100 mt76: mt7921: move mt7921_usb_sdio_tx_complete_skb in common mac code. This is a preliminary patch to add mt7921u driver support. Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 21 +++++++++++++++++++++ drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 3 ++- drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 2 +- .../net/wireless/mediatek/mt76/mt7921/sdio_mac.c | 19 ------------------- 4 files changed, 24 insertions(+), 21 deletions(-) commit 5b834b0d4d6b8179e8859b6161c6ab4a8076e882 Author: Lorenzo Bianconi Date: Mon Mar 14 16:10:28 2022 +0100 mt76: mt7921: move mt7921_usb_sdio_tx_prepare_skb in common mac code This is a preliminary patch to add mt7921u driver support. Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 58 ++++++++++++++++++++++ drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 9 ++-- drivers/net/wireless/mediatek/mt76/mt7921/sdio.c | 2 +- .../net/wireless/mediatek/mt76/mt7921/sdio_mac.c | 53 -------------------- 4 files changed, 64 insertions(+), 58 deletions(-) commit b72fd217934d70c30a4793256aa92b0127962d70 Author: Lorenzo Bianconi Date: Mon Mar 14 16:10:27 2022 +0100 mt76: mt7921: update mt7921_skb_add_usb_sdio_hdr to support usb This is a preliminary patch to add mt7921u driver support. Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 10 ++++++---- drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7921/sdio_mcu.c | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) commit eafe031fd6646072021da8860366c4bf567927a4 Author: Lorenzo Bianconi Date: Mon Mar 14 16:10:26 2022 +0100 mt76: mt7921: disable runtime pm for usb Runtime-pm is not currently supported by usb driver Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c | 6 ++++++ drivers/net/wireless/mediatek/mt76/mt7921/init.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) commit 6cb596ba84e307930836e9533a48792095f0dd42 Author: Lorenzo Bianconi Date: Mon Mar 14 16:10:25 2022 +0100 mt76: usb: introduce __mt76u_init utility routine Introduce __mt76u_init unitility routine and move mt7615 usb bus ops into mt7615 module in order to allow specifying driver specific parameter. This is a preliminary patch to add usb support to mt7921 driver. Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt76.h | 12 ++- drivers/net/wireless/mediatek/mt76/mt7615/usb.c | 68 +++++++++++++- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76x2/usb.c | 2 +- drivers/net/wireless/mediatek/mt76/usb.c | 112 +++++++----------------- 5 files changed, 110 insertions(+), 86 deletions(-) commit e0daf14d9f4e5fe445700fed287a16318f89d56e Author: Lorenzo Bianconi Date: Mon Mar 14 16:10:24 2022 +0100 mt76: usb: add req_type to ___mt76u_wr signature This is a preliminary patch to add usb support to mt7921 driver. Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/usb.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit 84bba93ac46ee8d5d6eca57769f8dfbfa8bea1f0 Author: Lorenzo Bianconi Date: Mon Mar 14 16:10:23 2022 +0100 mt76: usb: add req_type to ___mt76u_rr signature This is a preliminary patch to add usb support to mt7921 driver. Tested-by: Sean Wang Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/usb.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit 51f9325c7b43c604cec8885c8e0d0352b811f1a6 Author: Julia Lawall Date: Mon Mar 14 12:53:34 2022 +0100 mt76: mt7915: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 381d9de774d4fb6262eaf489e0f193001e6e5299 Author: Peter Chiu Date: Fri Mar 11 22:44:27 2022 +0800 mt76: mt7915: fix phy cap in mt7915_set_stream_he_txbf_caps() This patch fixes performance issue of beamforming tx on bandwidth 160MHz. Fixes: 99ad32a4ca3a ("mt76: mt7915: add support for MT7986") Signed-off-by: Peter Chiu Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/init.c | 25 +++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) commit bd1407ed22ed56d054dc51b53a39d272ae259e4d Author: Shayne Chen Date: Fri Mar 11 22:44:26 2022 +0800 mt76: mt7915: fix beamforming mib stats Some of beamforming mib counters are moved to different offsets or registers in newer chipsets. Fixes: 99ad32a4ca3a ("mt76: mt7915: add support for MT7986") Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 73 +++++++++++++++--------- drivers/net/wireless/mediatek/mt76/mt7915/mmio.c | 2 + drivers/net/wireless/mediatek/mt76/mt7915/regs.h | 28 ++++++--- 3 files changed, 69 insertions(+), 34 deletions(-) commit 70493b8692495adc5735f498db4f7fe71be24b3c Author: Shayne Chen Date: Fri Mar 11 22:44:25 2022 +0800 mt76: mt7915: set band1 TGID field in tx descriptor Set proper group index of tx descriptor for band1. Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 6450b1335f5101f0700fdc67593d355588ebc312 Author: Deren Wu Date: Fri Mar 11 00:42:36 2022 +0800 mt76: fix invalid rssi report Drop invalid rssi value to calculate a reasonable report Fixes: 4550fb9e9810 ("mt76: improve signal strength reporting") Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mac80211.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit f1fe8eefd2dd383beaf1748d8246a421c43865c5 Author: Ryder Lee Date: Wed Mar 9 14:29:24 2022 +0800 mt76: use le32/16_get_bits() whenever possible Switch to use le32/16_get_bits() to simplfy codes and specify the size explicitly to avoid potential issues. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7603/dma.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 9 ++---- drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 20 ++++++------- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 35 ++++++++-------------- drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 31 ++++++++----------- .../net/wireless/mediatek/mt76/mt7921/pci_mac.c | 13 ++++---- .../net/wireless/mediatek/mt76/mt7921/sdio_mac.c | 2 +- drivers/net/wireless/mediatek/mt76/sdio_txrx.c | 2 +- 8 files changed, 46 insertions(+), 68 deletions(-) commit c00e13726b6c728370686b6d6e0e71b0a9f37f03 Author: Colin Ian King Date: Mon Mar 7 22:24:29 2022 +0000 mt76: connac: make read-only array ba_range static const Don't populate the read-only array ba_range 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: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 01318bc00d16947715e8f65a629806e5953a36ff Author: Dan Carpenter Date: Mon Mar 7 17:13:49 2022 +0300 mt76: mt7915: check for devm_pinctrl_get() failure If devm_pinctrl_get() fails then it leads to an error pointer dereference. Add a check to prevent that. Fixes: 99ad32a4ca3a ("mt76: mt7915: add support for MT7986") Signed-off-by: Dan Carpenter Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/soc.c | 2 ++ 1 file changed, 2 insertions(+) commit 9a657684158f44d04845c770c1cfa57989fc2400 Author: Lorenzo Bianconi Date: Mon Mar 7 12:35:21 2022 +0100 mt76: mt7921: get rid of mt7921_wait_for_mcu_init declaration mt7921_wait_for_mcu_init is no longer used. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 1 - 1 file changed, 1 deletion(-) commit ae146683001a5b5e3f4cd8c86ae27f9e4a7bb917 Author: Shayne Chen Date: Mon Mar 7 15:10:28 2022 +0800 mt76: mt7915: add txpower init for 6GHz Add support to init txpower values of 6GHz band. Signed-off-by: Shayne Chen Signed-off-by: MeiChia Chiu Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 15 +++++++++++---- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h | 13 ++++++++++++- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 ++ 3 files changed, 25 insertions(+), 5 deletions(-) commit 1c2d366ecb4108adcf28d36aa6266eaf5b310955 Author: Shayne Chen Date: Mon Mar 7 15:10:27 2022 +0800 mt76: mt7915: fix eeprom fields of txpower init values A-die 7976 has different offset and uses different channel group definition on txpower init values. Fixes: 99ad32a4ca3a ("mt76: mt7915: add support for MT7986") Signed-off-by: Shayne Chen Signed-off-by: MeiChia Chiu Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 52 +++++++++++----------- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h | 14 +++++- 2 files changed, 40 insertions(+), 26 deletions(-) commit b4d093e321bd158af2a94d84e5d5b99023100d92 Author: MeiChia Chiu Date: Mon Mar 7 15:10:26 2022 +0800 mt76: mt7915: add 6 GHz support Basic 6 GHz support is added to mt76. Modification includes: 1. Add 6 GHz E2P definition 2. Register 6 GHz HE cap 3. Refactor existing code of adding a STA This adds support for Wi-Fi 6E on MT7986/MT7916. Detailed link: https://www.mediatek.com/products/mediatek-filogic-830 Detailed link: https://www.mediatek.com/products/products/broadband-wifi/mediatek-filogic-630 Reviewed-by: Ryder Lee Signed-off-by: Shayne Chen Signed-off-by: Peter Chiu Signed-off-by: Money Wang Signed-off-by: MeiChia Chiu Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 21 +++++++++++++--- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h | 7 ++++++ drivers/net/wireless/mediatek/mt76/mt7915/init.c | 28 ++++++++++++++++++++-- drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 12 ++++++---- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 28 ++++++++++++++++++---- drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h | 2 +- .../net/wireless/mediatek/mt76/mt7915/testmode.c | 4 ++++ 7 files changed, 88 insertions(+), 14 deletions(-) commit 37b5e57b0c76e26e4bec0dd4f8b40cfb29c36838 Author: MeiChia Chiu Date: Mon Mar 7 15:10:25 2022 +0800 mt76: connac: add 6 GHz support for wtbl and starec configuration Since there are no HT & VHT IEs being sent in 6ghz, some capabilities judgement and parsing for wtbl & starec configuration should be modified to reflect such changes. Reviewed-by: Ryder Lee Signed-off-by: Money Wang Signed-off-by: MeiChia Chiu Signed-off-by: Felix Fietkau .../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) commit 3f71ff0868e616b11a24cd0428f3d1df5d0acffc Author: Ryder Lee Date: Sat Mar 5 07:42:24 2022 +0800 mt76: mt7915: allow beaconing on all chains This improves rate reach performance on units with polarized antennas. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 1 + 1 file changed, 1 insertion(+) commit 123bc712b1de0805f9d683687e17b1ec2aba0b68 Author: Deren Wu Date: Fri Mar 4 22:54:05 2022 +0800 mt76: fix monitor mode crash with sdio driver mt7921s driver may receive frames with fragment buffers. If there is a CTS packet received in monitor mode, the payload is 10 bytes only and need 6 bytes header padding after RXD buffer. However, only RXD in the first linear buffer, if we pull buffer size RXD-size+6 bytes with skb_pull(), that would trigger "BUG_ON(skb->len < skb->data_len)" in __skb_pull(). To avoid the nonlinear buffer issue, enlarge the RXD size from 128 to 256 to make sure all MCU operation in linear buffer. [ 52.007562] kernel BUG at include/linux/skbuff.h:2313! [ 52.007578] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 52.007987] pc : skb_pull+0x48/0x4c [ 52.008015] lr : mt7921_queue_rx_skb+0x494/0x890 [mt7921_common] [ 52.008361] Call trace: [ 52.008377] skb_pull+0x48/0x4c [ 52.008400] mt76s_net_worker+0x134/0x1b0 [mt76_sdio 35339a92c6eb7d4bbcc806a1d22f56365565135c] [ 52.008431] __mt76_worker_fn+0xe8/0x170 [mt76 ef716597d11a77150bc07e3fdd68eeb0f9b56917] [ 52.008449] kthread+0x148/0x3ac [ 52.008466] ret_from_fork+0x10/0x30 Signed-off-by: Lorenzo Bianconi Signed-off-by: Sean Wang Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt76.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 849ee6ac9dd3efd0a57cbc98b9a9d6ae87374aff Author: Lorenzo Bianconi Date: Thu Mar 3 09:46:41 2022 +0100 mt76: mt7921: fix mt7921_queues_acq implementation Fix mt7921_queues_acq implementation according to the vendor sdk. Fixes: 474a9f21e2e20 ("mt76: mt7921: add debugfs support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c | 13 ++++++------- drivers/net/wireless/mediatek/mt76/mt7921/regs.h | 11 +++++------ 2 files changed, 11 insertions(+), 13 deletions(-) commit e907341dab1bf4eb3c6cbdf79d125b2eee51058c Author: Lorenzo Bianconi Date: Wed Mar 2 16:46:06 2022 +0100 mt76: mt7921: fix xmit-queue dump for usb and sdio Use proper xmit queue handler to dump queue stats. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 11a72265928f679c3ffabd15c97b3ef8e910e205 Author: Lorenzo Bianconi Date: Wed Mar 2 16:32:57 2022 +0100 mt76: mt7921: make mt7921_init_tx_queues static mt7921 is only used in mt7921_dma_init routine. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/dma.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) commit 499da7200f35a3bf531640c8b27af5aff840f0e0 Author: MeiChia Chiu Date: Wed Mar 2 14:14:06 2022 +0800 mt76: split single ldpc cap bit into bits The original single LDPC cap bit cannot be used to differentiate LDPC cap in each PHY mode. This modification split the single bit into 3 bits, ht_ldpc, vht_ldpc, and he_ldpc. Reviewed-by: Ryder Lee Suggested-by: Money Wang Signed-off-by: MeiChia Chiu Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 9 +++++---- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 20 ++++++++++++-------- drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h | 4 +++- 5 files changed, 22 insertions(+), 15 deletions(-) commit 233e39d1ed2c1ad26a24447cb60745ce586e7753 Author: Evelyn Tsai Date: Tue Mar 1 13:29:10 2022 +0800 mt76: mt7915: fix DFS no radar detection event Driver needs to carry region definition when radar detection starts. Need to remap nl80211 DFS regions to chip region definition. Signed-off-by: Evelyn Tsai Signed-off-by: Rubio Lu Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) commit 07241519b35794a66fcc429042240424ddf35f3d Author: Sean Wang Date: Tue Mar 1 09:17:52 2022 +0800 mt76: mt7921: use mt76_hw instead of open coding it use mt76_hw instead of open coding it Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7921/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cbaa0a404f8dd528a668450753c789cb9e178c13 Author: Sean Wang Date: Tue Mar 1 09:17:51 2022 +0800 mt76: mt7921: fix up the monitor mode Properly set up the monitor mode the firmware can support to fix up RTS/CTS and beacon frames cannot be captured and forwarded to the host. Tested-by: Deren Wu Tested-by: Sven Eckelmann Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau .../net/wireless/mediatek/mt76/mt76_connac_mcu.h | 1 + drivers/net/wireless/mediatek/mt76/mt7921/main.c | 24 +++++++++-------- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 30 ++++++++++++++++++++++ drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h | 2 ++ 4 files changed, 47 insertions(+), 10 deletions(-) commit 4dd4ad44b7da1008616c79dd2c925be71021c315 Author: Lorenzo Bianconi Date: Mon Feb 28 20:43:23 2022 +0100 mt76: mt7663u: introduce mt7663u_mcu_power_on routine Introduce mt7663u_mcu_power_on utility routine since the code is shared between mt7663u_mcu_init() and mt7663u_probe(). Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h | 1 + drivers/net/wireless/mediatek/mt76/mt7615/usb.c | 22 ++++----------- .../net/wireless/mediatek/mt76/mt7615/usb_mcu.c | 31 +++++++++++++++------- 3 files changed, 27 insertions(+), 27 deletions(-) commit e809904f9bd2db92c1c7e403aa77ab49b8a9b266 Author: Lorenzo Bianconi Date: Mon Feb 28 20:39:28 2022 +0100 mt76: mt7615: honor ret from mt7615_mcu_restart in mt7663u_mcu_init Check return value of mt7615_mcu_restart routine in mt7663u_mcu_init(). Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau drivers/net/wireless/mediatek/mt76/mt7615/usb_mcu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit c9839acfcbe20ce43d363c2a9d0772472d9921c0 Author: Minghao Chi Date: Tue Mar 15 02:31:38 2022 +0000 spi: tegra20: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220315023138.2118293-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown drivers/spi/spi-tegra20-slink.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit 835ca59799f5c60b4b54bdc7aa785c99552f63e4 Author: Minghao Chi Date: Tue Mar 15 02:32:26 2022 +0000 ASoC: ak4642: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20220315023226.2118354-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown sound/soc/codecs/ak4613.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) commit 1c19601ddceda1517511e4bad3d24619e765c78c Author: Srinivasa Rao Mandadapu Date: Tue Mar 15 20:15:31 2022 +0530 ASoC: codecs: Fix misplaced lpass_macro_pds_exit call Update power domains exit function calling from runtime resume to remove function which was wrongly placed and causing crash in device suspend and resume. Fixes: 9e3d83c52844 ("ASoC: codecs: Add power domains support in digital macro codecs") Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/1647355531-4150-1-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Mark Brown sound/soc/codecs/lpass-tx-macro.c | 4 ++-- sound/soc/codecs/lpass-va-macro.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) commit 455c5653f50e10b4f460ef24e99f0044fbe3401c Author: Takashi Iwai Date: Tue Mar 15 17:41:58 2022 +0100 ASoC: sti: Fix deadlock via snd_pcm_stop_xrun() call This is essentially a revert of the commit dc865fb9e7c2 ("ASoC: sti: Use snd_pcm_stop_xrun() helper"), which converted the manual snd_pcm_stop() calls with snd_pcm_stop_xrun(). The commit above introduced a deadlock as snd_pcm_stop_xrun() itself takes the PCM stream lock while the caller already holds it. Since the conversion was done only for consistency reason and the open-call with snd_pcm_stop() to the XRUN state is a correct usage, let's revert the commit back as the fix. Fixes: dc865fb9e7c2 ("ASoC: sti: Use snd_pcm_stop_xrun() helper") Reported-by: Daniel Palmer Cc: Arnaud POULIQUEN Cc: Link: https://lore.kernel.org/r/20220315091319.3351522-1-daniel@0x0f.com Signed-off-by: Takashi Iwai Reviewed-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20220315164158.19804-1-tiwai@suse.de Signed-off-by: Mark Brown sound/soc/sti/uniperif_player.c | 6 +++--- sound/soc/sti/uniperif_reader.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) commit 54e1bf9f6177a3ffbd920474f4481a25361163aa Author: Meng Tang Date: Wed Mar 16 17:13:03 2022 +0800 ASoC: amd: Fix reference to PCM buffer address PCM buffers might be allocated dynamically when the buffer preallocation failed or a larger buffer is requested, and it's not guaranteed that substream->dma_buffer points to the actually used buffer. The driver needs to refer to substream->runtime->dma_addr instead for the buffer address. Fixes: cab396d8b22c1 ("ASoC: amd: add ACP5x pcm dma driver ops") Signed-off-by: Meng Tang Link: https://lore.kernel.org/r/20220316091303.9745-1-tangmeng@uniontech.com Signed-off-by: Mark Brown sound/soc/amd/vangogh/acp5x-pcm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9531a631379169d57756b2411178c6238655df88 Author: Miaoqian Lin Date: Wed Mar 16 08:36:31 2022 +0000 ASoC: codecs: wcd934x: Add missing of_node_put() in wcd934x_codec_parse_data The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This is similar to commit 64b92de9603f ("ASoC: wcd9335: fix a leaked reference by adding missing of_node_put") Fixes: a61f3b4f476e ("ASoC: wcd934x: add support to wcd9340/wcd9341 codec") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220316083631.14103-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/wcd934x.c | 1 + 1 file changed, 1 insertion(+) commit c4b7174fe5bb875a09a78674a14a1589d1a672f3 Author: Miaoqian Lin Date: Wed Mar 16 08:46:15 2022 +0000 ASoC: mediatek: mt8195: Fix error handling in mt8195_mt6359_rt1019_rt5682_dev_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This function only calls of_node_put() in the regular path. And it will cause refcount leak in error path. Fixes: 082482a50227 ("ASoC: mediatek: mt8195: release device_node after snd_soc_register_card") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220316084623.24238-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit abed17fdf92e4b3bfe336f7872270e0924cc4463 Author: Shuming Fan Date: Tue Mar 15 17:37:40 2022 +0800 ASoC: rt1308-sdw: get calibration params after power on It will be safe when getting the calibration params after power-on. All powers are ready to read the calibration params from EFUSE. Signed-off-by: Shuming Fan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220315093740.12008-1-shumingf@realtek.com Signed-off-by: Mark Brown sound/soc/codecs/rt1308-sdw.c | 73 ++++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 33 deletions(-) commit 9ebd62d60edcd4d9c75485e5ccd0b79581ad3c49 Author: Miaoqian Lin Date: Wed Mar 16 04:19:24 2022 +0000 ASoC: msm8916-wcd-analog: Fix error handling in pm8916_wcd_analog_spmi_probe In the error handling path, the clk_prepare_enable() function call should be balanced by a corresponding 'clk_disable_unprepare()' call , as already done in the remove function. Fixes: de66b3455023 ("ASoC: codecs: msm8916-wcd-analog: add MBHC support") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220316041924.17560-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/msm8916-wcd-analog.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) commit e8ca4cee43fa9d841d25c2b98c9c3a3390593094 Author: Colin Ian King Date: Tue Mar 15 23:08:16 2022 +0000 ASoC: ti: Fix spelling mistake "cant" -> "can't" There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King Acked-by: Jarkko Nikula Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220315230816.2964577-1-colin.i.king@gmail.com Signed-off-by: Mark Brown sound/soc/ti/omap-dmic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 28a265a1ee11febeec5ea73a804f30dcec3181ca Author: Miaoqian Lin Date: Wed Mar 16 01:40:57 2022 +0000 ASoC: mediatek: Fix error handling in mt8183_da7219_max98357_dev_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This function only calls of_node_put() in the regular path. And it will cause refcount leak in error paths. Fix this by calling of_node_put() in error handling too. Signed-off-by: Miaoqian Lin Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220316014059.19292-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) commit 740dc3e846537c3743da98bf106f376023fd085c Author: Miaoqian Lin Date: Wed Mar 16 11:15:30 2022 +0000 ASoC: atmel: Fix error handling in sam9x5_wm8731_driver_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This function only calls of_node_put() in the regular path. And it will cause refcount leak in error path. Fixes: fdbcb3cba54b ("ASoC: atmel: machine driver for at91sam9x5-wm8731 boards") Signed-off-by: Miaoqian Lin Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220316111530.4551-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/atmel/sam9x5_wm8731.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) commit cc5d8ac95663a5813c696008bc524b794d471215 Author: zhangqilong Date: Tue Mar 15 10:54:15 2022 +0800 ASoC: rockchip: Fix PM usage reference of rockchip_i2s_tdm_resume pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Fixes:081068fd64140 ("ASoC: rockchip: add support for i2s-tdm controller") Signed-off-by: Zhang Qilong Link: https://lore.kernel.org/r/20220315025415.2593762-1-zhangqilong3@huawei.com Signed-off-by: Mark Brown sound/soc/rockchip/rockchip_i2s_tdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d39664cb758e9e329ac3ba05bd4f813f928f63c2 Author: Xiaoke Wang Date: Mon Mar 14 18:36:45 2022 +0800 ASoC: samsung: i2s: check the return value of kstrdup() kstrdup() is a memory allocation function which can return NULL when some internal memory errors happen. It is better to check the return value of it to catch the error in time. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_EC21778DC383823CBC4069EA9F0B84943905@qq.com Signed-off-by: Mark Brown sound/soc/samsung/i2s.c | 4 ++++ 1 file changed, 4 insertions(+) commit 61ad28ff6cf349c3e25f6c4a56ce4d140c003d19 Author: Ranjani Sridharan Date: Mon Mar 14 13:05:20 2022 -0700 ASoC: SOF: topology: remove snd_sof_complete_pipeline() Add a new topology IPC op, pipeline_complete in struct ipc_tplg_ops and set the op for IPC3. Replace the calls to snd_sof_complete_pipeline() with the calls to the topology IPC pipeline_complete op. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-20-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 23 +++++++++++++++++++++++ sound/soc/sof/sof-audio.c | 18 ++++++++++++------ sound/soc/sof/sof-audio.h | 4 ++-- sound/soc/sof/topology.c | 23 ----------------------- 4 files changed, 37 insertions(+), 31 deletions(-) commit 8ef1439c51048b9359a8d1be2360dd4cd9848a77 Author: Ranjani Sridharan Date: Mon Mar 14 13:05:19 2022 -0700 ASoC: SOF: topology: Make widget binding IPC agnostic Make widget binding in the topology parser IPC agnostic by introducing a new op, bind_event, in struct ipc_tplg_widget_ops. Also set the op for all widget types in the IPC3 topology ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-19-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 192 ++++++++++++++++++++++++++++++++++++- sound/soc/sof/topology.c | 217 +++--------------------------------------- 2 files changed, 202 insertions(+), 207 deletions(-) commit b5cee8feb1d482a9d07b677f4f2f9565bacda53e Author: Ranjani Sridharan Date: Mon Mar 14 13:05:18 2022 -0700 ASoC: SOF: topology: Make control parsing IPC agnostic Make the control parser in topology IPC agnostic by introducing 2 new topology IPC ops, control_setup and control_free. These ops handle setting up/freeing the control data in the IPC format based on the IPC version. Along with this, modify the struct snd_sof_control to remove the IPC-specific field, control_data and replace it with the void pointer to ipc_control_data. Also, add a few new fields to store all the information parsed from topology. Finally, define and set the control setup/free ops for IPC3. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-18-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/control.c | 26 +++---- sound/soc/sof/ipc.c | 2 +- sound/soc/sof/ipc3-topology.c | 151 ++++++++++++++++++++++++++++++++++- sound/soc/sof/sof-audio.h | 20 ++++- sound/soc/sof/topology.c | 177 +++++++++++++----------------------------- 5 files changed, 235 insertions(+), 141 deletions(-) commit 909dadf21aae8f7e604973218907ed39e10499e6 Author: Ranjani Sridharan Date: Mon Mar 14 13:05:17 2022 -0700 ASoC: SOF: topology: Make DAI widget parsing IPC agnostic Define the list of tokens pertaining to the dai_in/out widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the DAI component based on the topology widget_setup op in ipc3_tplg_ops. DAI link parsing is also made IPC agnostic by parsing the list of tokens associated with all DAI types. The config will be applied to the respective DAI widgets during topology complete. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-17-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 745 +++++++++++++++++++++++++- sound/soc/sof/topology.c | 1157 ++++++----------------------------------- 2 files changed, 915 insertions(+), 987 deletions(-) commit 85ec8560893cb9aae2728dd12f59537b6247d91f Author: Ranjani Sridharan Date: Mon Mar 14 13:05:16 2022 -0700 ASoC: SOF: topology: Make route setup IPC agnostic Define and set the route_setup op for IPC3 topology ops and use it for setting up routes. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 26 +++++++++++++++++++++++ sound/soc/sof/sof-audio.c | 48 +++++++++++++------------------------------ 2 files changed, 40 insertions(+), 34 deletions(-) commit f2cf24a1afa836be44dd2abdf7896b236df8d9a2 Author: Ranjani Sridharan Date: Mon Mar 14 13:05:15 2022 -0700 ASoC: SOF: topology: Make effect widget parsing IPC agnostic Define the list of tokens pertaining to effect type widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the process component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-15-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 248 +++++++++++++++++++++++++++++++++++++ sound/soc/sof/topology.c | 277 ++---------------------------------------- 2 files changed, 257 insertions(+), 268 deletions(-) commit 111d66f62e9bf49ff33631c4e81efdcc4a54b88f Author: Ranjani Sridharan Date: Mon Mar 14 13:05:14 2022 -0700 ASoC: SOF: topology: Make siggen widget parsing IPC agnostic Define the list of tokens pertaining to the siggen widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the tone component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-14-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 36 ++++++++++++++++++++++++++ sound/soc/sof/topology.c | 60 +------------------------------------------ 2 files changed, 37 insertions(+), 59 deletions(-) commit cb7ed49acf585d45c1140660d076b389de7d468e Author: Ranjani Sridharan Date: Mon Mar 14 13:05:13 2022 -0700 ASoC: SOF: topology: Make asrc widget parsing IPC agnostic Define the list of tokens pertaining to the asrc widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the asrc component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-13-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 65 ++++++++++++++++++++++++++++++++++++++ sound/soc/sof/topology.c | 72 +------------------------------------------ 2 files changed, 66 insertions(+), 71 deletions(-) commit 8d8b1293473022953ed316c3e0c723ff5a1505ac Author: Ranjani Sridharan Date: Mon Mar 14 13:05:12 2022 -0700 ASoC: SOF: topology: Make src widget parsing IPC agnostic Define the list of tokens pertaining to the src widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the src component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 59 +++++++++++++++++++++++++++++++++++++++ sound/soc/sof/topology.c | 64 +------------------------------------------ 2 files changed, 60 insertions(+), 63 deletions(-) commit 683b54ef603825328859d867aabf9a6d973238a2 Author: Ranjani Sridharan Date: Mon Mar 14 13:05:11 2022 -0700 ASoC: SOF: topology: Make mux/demux widget parsing IPC agnostic Define the list of tokens pertaining to the mux/demux widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the mux/demux component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 40 +++++++++++++++++++++++++++++++++++++++ sound/soc/sof/topology.c | 44 ++----------------------------------------- 2 files changed, 42 insertions(+), 42 deletions(-) commit 30f4168024e91e85aff9edcef561715ed271b34c Author: Ranjani Sridharan Date: Mon Mar 14 13:05:10 2022 -0700 ASoC: SOF: topology: Make mixer widget parsing IPC agnostic Define the list of tokens pertaining to the mixer widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the mixer component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 43 +++++++++++++++++++++++++++++++++++++++++++ sound/soc/sof/topology.c | 43 +------------------------------------------ 2 files changed, 44 insertions(+), 42 deletions(-) commit 8a2e4a734f5ecbc48a3227c8ad68c12a71272c79 Author: Ranjani Sridharan Date: Mon Mar 14 13:05:09 2022 -0700 ASoC: SOF: topology: Make pga widget parsing IPC agnostic Define the list of tokens pertaining to the pga type widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the pga component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 78 +++++++++++++++++++++++++++++++++++++ sound/soc/sof/topology.c | 91 ++++--------------------------------------- 2 files changed, 86 insertions(+), 83 deletions(-) commit 6bd0be1c29dc0c9b69636f11f80071d46e1e2285 Author: Ranjani Sridharan Date: Mon Mar 14 13:05:08 2022 -0700 ASoC: SOF: topology: Make buffer widget parsing IPC agnostic Define the list of tokens pertaining to the buffer widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the buffer component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 50 +++++++++++++++++++++++++++++++++++++++++ sound/soc/sof/topology.c | 52 ------------------------------------------- 2 files changed, 50 insertions(+), 52 deletions(-) commit 2141b55d9174c7aa5b32da95a2caa807a018968a Author: Ranjani Sridharan Date: Mon Mar 14 13:05:07 2022 -0700 ASoC: SOF: topology: Make scheduler widget parsing IPC agnostic Define the list of tokens pertaining to the scheduler widgets, parse and save them as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the pipeline component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc3-topology.c | 98 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/sof/topology.c | 99 ------------------------------------------- 2 files changed, 98 insertions(+), 99 deletions(-) commit 7006d20e5e9d25c079a82e2bc0ea7e292fdea6e6 Author: Ranjani Sridharan Date: Mon Mar 14 13:05:06 2022 -0700 ASoC: SOF: Introduce IPC3 ops Add the IPC ops including the topology-related IPC ops for the current version (IPC3, named after the current SOF firmware ABI major version 3.0) of IPC supported by the SOF firmware and set it as default. The topology IPC ops and the widget ops within the topology IPC ops are both mandatory. With the introduction of IPC3 ops, we define the list of tokens pertaining to the AIF_IN/AIF_OUT widgets. Then these tokens are parsed during topology parsing and saved as part of the swidget tuples array. Once topology parsing is complete, these tokens will be applied to create the IPC structure for the host component based on the topology widget_setup op in ipc3_tplg_ops. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/Makefile | 3 +- sound/soc/sof/ipc.c | 12 ++ sound/soc/sof/ipc3-topology.c | 173 ++++++++++++++++++++++++++++ sound/soc/sof/sof-priv.h | 2 + sound/soc/sof/topology.c | 258 ++++++++++++++++++++++++++++++++++-------- 5 files changed, 397 insertions(+), 51 deletions(-) commit d87524bf9aab511906e7e9bab90198510c28149f Author: Ranjani Sridharan Date: Mon Mar 14 13:05:05 2022 -0700 ASoC: SOF: topology: Add helper function for processing tuple arrays Add a helper function for processing tuple arrays and populating the IPC structure objects based on the token ID passed. Introduce a new enum representing token ID for the tokens currently used in the topology parse and a new struct sof_token_info to store the information about a token set. Finally, expose the struct snd_sof_topology token as it will be used by IPC-specific code. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.h | 54 +++++++++++++++++++++++ sound/soc/sof/topology.c | 106 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 148 insertions(+), 12 deletions(-) commit 226abb759063ca53a32c1570d058db03b7850fdf Author: Ranjani Sridharan Date: Mon Mar 14 13:05:04 2022 -0700 ASoC: SOF: IPC: Introduce IPC ops In preparation for supporting a new IPC version that will be introduced in the SOF firmware, add a new set of ops that will be version specific. For now, the IPC ops contain only the topology-related ops for setting up widgets and pipeline connections. It will be expanded later to also abstract the IPC-specific items in the component driver and DAI driver. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.h | 36 ++++++++++++++++++++++++++++++++++++ sound/soc/sof/sof-priv.h | 13 +++++++++++++ 2 files changed, 49 insertions(+) commit 0af0f4633adfa211807262af4d446b09698df6c8 Author: Ranjani Sridharan Date: Mon Mar 14 13:05:02 2022 -0700 ASoC: SOF: Introduce struct snd_sof_dai_link Introduce a new struct for DAI links to save the DAI link information parsed from topology. Also add a list of dai_links to struct snd_sof_dev that will be populated during topology parsing. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220314200520.1233427-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/core.c | 1 + sound/soc/sof/sof-audio.h | 21 ++++++++++++++++++++- sound/soc/sof/sof-priv.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) commit 500edd0956487281a6fa0e1e34e931817e85d8b6 Author: Gao Xiang Date: Wed Mar 16 09:22:46 2022 +0800 erofs: use meta buffers for inode lookup This converts the remaining inode lookup part by using metabuf in a straight-forward way. Except that it doesn't use kmap_atomic() anymore since we now have to maintain two metabufs together. After this patch, all uncompressed paths are handled with metabuf instead of page structure. Link: https://lore.kernel.org/r/20220316012246.95131-2-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang fs/erofs/namei.c | 54 ++++++++++++++++++++++++------------------------------ 1 file changed, 24 insertions(+), 30 deletions(-) commit fe5de5859d44eafd5828ec4910cd52cdad8ada1f Author: Gao Xiang Date: Wed Mar 16 09:22:45 2022 +0800 erofs: use meta buffers for reading directories Previously, directory inodes are directly handled with page cache interfaces. In order to support sub-page directory blocks and folios, let's convert them into the latest metabuf infrastructure as well and this patch addresses the readdir case first. Link: https://lore.kernel.org/r/20220316012246.95131-1-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang fs/erofs/data.c | 12 +++++++++--- fs/erofs/dir.c | 21 ++++++--------------- fs/erofs/internal.h | 2 ++ 3 files changed, 17 insertions(+), 18 deletions(-) commit a942da24abc5839c11a8fc2a4b7cb268ea94ba54 Author: Dongliang Mu Date: Tue Mar 15 21:28:14 2022 +0800 fs: erofs: add sanity check for kobject in erofs_unregister_sysfs Syzkaller hit 'WARNING: kobject bug in erofs_unregister_sysfs'. This bug is triggered by injecting fault in kobject_init_and_add of erofs_unregister_sysfs. Fix this by adding sanity check for kobject in erofs_unregister_sysfs Note that I've tested the patch and the crash does not occur any more. Link: https://lore.kernel.org/r/20220315132814.12332-1-dzm91@hust.edu.cn Signed-off-by: Dongliang Mu Fixes: 168e9a76200c ("erofs: add sysfs interface") Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Gao Xiang fs/erofs/sysfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 9f2731d6338a072b60ab1d9340847bde3306614b Author: Gao Xiang Date: Fri Mar 11 02:27:43 2022 +0800 erofs: refine managed inode stuffs Set up the correct gfp mask and use it instead of hard coding. Also add comments about .invalidatepage() to show more details. Link: https://lore.kernel.org/r/20220310182743.102365-2-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang fs/erofs/super.c | 8 ++++++-- fs/erofs/zdata.c | 7 +++---- 2 files changed, 9 insertions(+), 6 deletions(-) commit ab474fccd04509db89fde8d3b28c39aa9a47db64 Author: Gao Xiang Date: Fri Mar 11 02:27:42 2022 +0800 erofs: clean up z_erofs_extent_lookback Avoid the unnecessary tail recursion since it can be converted into a loop directly in order to prevent potential stack overflow. It's a pretty straightforward conversion. Link: https://lore.kernel.org/r/20220310182743.102365-1-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang fs/erofs/zmap.c | 67 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 34 deletions(-) commit d179c1f1c3703d1a6f7a6f2ad08383220673240c Author: Ping-Ke Shih Date: Fri Mar 11 10:00:07 2022 +0800 rtw89: fix uninitialized variable of rtw89_append_probe_req_ie() smatch reports that: fw.c:1997 rtw89_append_probe_req_ie() error: uninitialized symbol 'ret'. This can be a issue only if no band is supported by the chip, but it is impossible. So, it is still safe without this patch. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220311020007.20414-1-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ce8d78616a6b637d1b763eb18e32045687a84305 Author: Christoph Hellwig Date: Tue Mar 15 13:27:07 2022 +0100 nvme: warn about shared namespaces without CONFIG_NVME_MULTIPATH Start warning about exposing a namespace as multiple block devices, and set a fixed deprecation release. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch drivers/block/loop.c | 1 + drivers/nvme/host/core.c | 8 ++++++++ 2 files changed, 9 insertions(+) commit 02f393381d14df948918f5021486e1197c05a21f Author: Wojciech Drewek Date: Mon Mar 14 17:41:37 2022 +0100 gtp: Fix inconsistent indenting Fix the following warning as reported by smatch: New smatch warnings: drivers/net/gtp.c:1796 gtp_genl_send_echo_req() warn: inconsistent indenting Fixes: d33bd757d362 ("gtp: Implement GTP echo request") Reported-by: kernel test robot Signed-off-by: Wojciech Drewek Signed-off-by: Tony Nguyen drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5df2dc0087e91510f205c4d859c10c10202abe4c Author: Lukas Bulwahn Date: Tue Mar 8 09:55:03 2022 +0100 MAINTAINERS: fix ath11k DT bindings location Commit dae0978d4174 ("dt: bindings: net: add qcom,ath11k.yaml") obviously adds qcom,ath11k.yaml, but the file entry in MAINTAINERS, added with commit fcda1cb81663 ("MAINTAINERS: add DT bindings files for ath10k and ath11k") then refers to qcom,ath11k.txt. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in QUALCOMM ATHEROS ATH11K WIRELESS DRIVER, and put it in alphabetic order while at it. Fixes: fcda1cb81663 ("MAINTAINERS: add DT bindings files for ath10k and ath11k") Signed-off-by: Lukas Bulwahn Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220308085503.537-1-lukas.bulwahn@gmail.com MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bfbd78cfdd62af223ccd28acd8a2c8749731274f Author: Julia Lawall Date: Mon Mar 14 12:53:44 2022 +0100 airo: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314115354.144023-21-Julia.Lawall@inria.fr drivers/net/wireless/cisco/airo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 31f8bef8acaba892539a478ddee74ef1e3c8495c Author: Julia Lawall Date: Mon Mar 14 12:53:43 2022 +0100 rtlwifi: rtl8821ae: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220314115354.144023-20-Julia.Lawall@inria.fr drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit ceb7482f2d39d7711edcca4598b0c58b71430a0b Author: Jonathan Teh Date: Sun Mar 13 20:10:55 2022 +0000 rtlwifi: rtl8192cu: Add On Networks N150 This is an RTL8188CUS device, identifies as model N150MA-199WWS. Signed-off-by: Jonathan Teh Acked-by: Larry Finger Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/DBAPR04MB7366E8014ECA839E1F5CCE29920E9@DBAPR04MB7366.eurprd04.prod.outlook.com drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c | 1 + 1 file changed, 1 insertion(+) commit 3c0e3ca6028bcb31f76ac16417de6406c17b93f0 Author: Julia Lawall Date: Sat Mar 12 11:27:04 2022 +0100 zd1201: use kzalloc Use kzalloc instead of kmalloc + memset. The semantic patch that makes this change is: (https://coccinelle.gitlabpages.inria.fr/website/) // @@ expression res, size, flag; @@ - res = kmalloc(size, flag); + res = kzalloc(size, flag); ... - memset(res, 0, size); // Signed-off-by: Julia Lawall Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220312102705.71413-6-Julia.Lawall@inria.fr drivers/net/wireless/zydas/zd1201.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit e7d1fc0b5ff24c0adc215b913e1cefa949a83e93 Author: Colin Ian King Date: Fri Mar 11 22:56:10 2022 +0000 mwifiex: make read-only array wmm_oui static const Don't populate the read-only array wmm_oui 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: Kalle Valo Link: https://lore.kernel.org/r/20220311225610.10895-1-colin.i.king@gmail.com drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7a6ee0bbab2551d7189ce0f5e625fef4d612ebea Author: Arınç ÜNAL Date: Tue Mar 15 19:01:50 2022 +0300 mips: dts: ralink: add MT7621 SoC The MT7621 system-on-a-chip includes an 880 MHz MIPS1004Kc dual-core CPU, a 5-port 10/100/1000 switch/PHY and one RGMII. Add the devicetrees for GB-PC1 and GB-PC2 devices which use MT7621 SoC. Acked-by: Sergio Paracuellos Acked-by: Thomas Bogendoerfer Signed-off-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20220315160149.3617-1-arinc.unal@arinc9.com Signed-off-by: Greg Kroah-Hartman MAINTAINERS | 7 +++++++ arch/mips/boot/dts/ralink/Makefile | 4 ++++ .../mips/boot/dts/ralink/mt7621-gnubee-gb-pc1.dts | 0 .../mips/boot/dts/ralink/mt7621-gnubee-gb-pc2.dts | 0 .../mt7621-dts => arch/mips/boot/dts/ralink}/mt7621.dtsi | 0 arch/mips/ralink/Kconfig | 5 +++++ drivers/staging/Kconfig | 2 -- drivers/staging/Makefile | 1 - drivers/staging/mt7621-dts/Kconfig | 11 ----------- drivers/staging/mt7621-dts/Makefile | 5 ----- drivers/staging/mt7621-dts/TODO | 5 ----- 11 files changed, 16 insertions(+), 24 deletions(-) commit 5aaec657369cb94e6d94ad1c66a264070e78e2b2 Author: Martin Kaiser Date: Tue Mar 15 21:50:40 2022 +0100 staging: r8188eu: remove some unused local ieee80211 macros Remove some macros from wifi.h which are not used by this driver. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220315205041.2714168-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/wifi.h | 27 --------------------------- 1 file changed, 27 deletions(-) commit 3524c88e334b7d215a1c4ddf44c986f12ed55e45 Author: Martin Kaiser Date: Tue Mar 15 21:50:39 2022 +0100 staging: r8188eu: make rtl8188e_process_phy_info static rtl8188e_process_phy_info is used only in rtl8188e_rxdesc.c. Make the function static and remove its prototype from rtl8188e_recv.h. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220315205041.2714168-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 2 +- drivers/staging/r8188eu/include/rtl8188e_recv.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) commit e85176ffa54a02707036319e87d59d64fb332f82 Author: Martin Kaiser Date: Tue Mar 15 21:50:38 2022 +0100 staging: r8188eu: remove unused function prototype Remove the prototype for rtl8188eu_recv_hdl. This function does not exist in the r8188eu driver. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220315205041.2714168-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/rtl8188e_recv.h | 1 - 1 file changed, 1 deletion(-) commit 432c80a379b31bdb31e6fabed5db37be4eccebd3 Author: Martin Kaiser Date: Tue Mar 15 21:50:37 2022 +0100 staging: r8188eu: remove three unused receive defines Remove three unused defines from rtl8188e_recv.h. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220315205041.2714168-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/rtl8188e_recv.h | 4 ---- 1 file changed, 4 deletions(-) commit a39a6b330be423897cc1a69c57ee45d5fd3f6aa8 Author: Martin Kaiser Date: Tue Mar 15 21:50:36 2022 +0100 staging: r8188eu: remove unnecessary initializations Do not initialise bPacketMatchBSSID, bPacketToSelf and bPacketBeacon to false at the start of update_recvframe_phyinfo_88e. All of them are set to their actual values before they're used. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220315205041.2714168-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 4 ---- 1 file changed, 4 deletions(-) commit 02d838dec8a0401bebe266f3e7af11b73c4f5b10 Author: Colin Ian King Date: Tue Mar 15 22:40:37 2022 +0000 staging: rtl8192e: Fix spelling mistake "RESQUEST" -> "REQUEST" There is a spelling mistake in a netdev_dbg message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220315224037.2962063-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/rtl8192e/rtllib_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ca7918f21466545250033b5bd077c2fbab0247a3 Author: Lukas Bulwahn Date: Wed Mar 16 13:48:02 2022 +0100 MAINTAINERS: remove the obsolete file entry for staging in ANDROID DRIVERS Commit 721412ed3d81 ("staging: remove ashmem") removes the last android driver from staging, but misses to adjust MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Remove the obsolete file entry in ANDROID DRIVERS. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20220316124802.372-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman MAINTAINERS | 1 - 1 file changed, 1 deletion(-) commit 3197706abd053275d2a561cfb7dc8f6cfaf7d02c Author: Bob Pearson Date: Thu Mar 3 18:08:05 2022 -0600 RDMA/rxe: Use standard names for ref counting Rename rxe_add_ref() to rxe_get() and rxe_drop_ref() to rxe_put(). Significantly improves readability for new readers. Link: https://lore.kernel.org/r/20220304000808.225811-10-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_av.c | 4 ++-- drivers/infiniband/sw/rxe/rxe_comp.c | 8 ++++---- drivers/infiniband/sw/rxe/rxe_mcast.c | 4 ++-- drivers/infiniband/sw/rxe/rxe_mr.c | 14 ++++++------- drivers/infiniband/sw/rxe/rxe_mw.c | 30 +++++++++++++-------------- drivers/infiniband/sw/rxe/rxe_net.c | 6 +++--- drivers/infiniband/sw/rxe/rxe_pool.h | 8 +++----- drivers/infiniband/sw/rxe/rxe_qp.c | 28 +++++++++++++------------- drivers/infiniband/sw/rxe/rxe_recv.c | 8 ++++---- drivers/infiniband/sw/rxe/rxe_req.c | 10 ++++----- drivers/infiniband/sw/rxe/rxe_resp.c | 32 ++++++++++++++--------------- drivers/infiniband/sw/rxe/rxe_verbs.c | 38 +++++++++++++++++------------------ 12 files changed, 94 insertions(+), 96 deletions(-) commit 3225717f6dfa29a6f03629b7a7f8492e1521d06d Author: Bob Pearson Date: Thu Mar 3 18:08:04 2022 -0600 RDMA/rxe: Replace red-black trees by xarrays Currently the rxe driver uses red-black trees to add indices to the rxe object pools. Linux xarrays provide a better way to implement the same functionality for indices. This patch replaces red-black trees by xarrays for pool objects. Since xarrays already have a spinlock use that in place of the pool rwlock. Make sure that all changes in the xarray(index) and kref(ref counnt) occur atomically. Link: https://lore.kernel.org/r/20220304000808.225811-9-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe.c | 80 ++---------- drivers/infiniband/sw/rxe/rxe_mr.c | 1 - drivers/infiniband/sw/rxe/rxe_mw.c | 8 -- drivers/infiniband/sw/rxe/rxe_pool.c | 221 ++++++++++------------------------ drivers/infiniband/sw/rxe/rxe_pool.h | 43 ++----- drivers/infiniband/sw/rxe/rxe_verbs.c | 12 -- 6 files changed, 85 insertions(+), 280 deletions(-) commit 49045b9c810cd9b4ac5f8f235ad8ef17553a00fa Merge: 79b0410841d4 ee410d510032 Author: David S. Miller Date: Wed Mar 16 12:49:23 2022 +0000 Merge branch 'mediatek-next' Biao Huang says: ==================== MediaTek Ethernet Patches on MT8195 Changes in v13: 1. add reviewed-by in "net: dt-bindings: dwmac: add support for mt8195" as Rob's comments. 2. drop num_clks defined in mediatek_dwmac_plat_data struct in "stmmac: dwmac-mediatek: Reuse more common features" as Angelo's comments. Changes in v12: 1. add a new patch "stmmac: dwmac-mediatek: re-arrange clock setting" to this series, to simplify clock handling in driver, which benefits to binding file mediatek-dwmac.yaml. 2. modify dt-binding description in patch "net: dt-bindings: dwmac: add support for mt8195" as Rob's comments in v10 series, put mac_cg to the end of clock list. 3. there are small changes in patch "stmmac: dwmac-mediatek: add support for mt8195", @AngeloGioacchino, please review it kindly. Changes in v11: 1. add reivewed-by in "net: dt-bindings: dwmac: Convert mediatek-dwmac to DT schema" as Rob's comments. 2. fall back "net: dt-bindings: dwmac: add support for mt8195" to v8 version as mentioned in previous reply(https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20211216055328.15953-7-biao.huang@mediatek.com/): 2.1 there is already a special clock named "rmii_internal", which need to be put to the end of the clock list(driver special handling), so we can't simply put new "mac_cg" for mt8195 to the end of the clock list. 2.2 we prefer the if-then schema, which will make mt8195 clock list clearer with some duplicated information. 2.3 we expect the future IC will follow mt2712 or mt8195, so we only need add new IC name to compatible list for future IC, and will not make the clock list binding files worse. Changes in v10: 1. add detailed description in "arm64: dts: mt2712: update ethernet device node" to make the modifications clearer as Matthias's comments. 2. modify dt-binding description as Rob's comments, and "make dtbs_check" runs pass locally with "arm64: dts: mt2712: update ethernet device node" in this series. Changes in v9: 1. remove oneOf for 1 entry as Rob's comments. 2. add new clocks to the end of existing clocks to simplify the binding as Rob's comments. Changes in v8: 1. add acked-by in "stmmac: dwmac-mediatek: add platform level clocks management" patch Changes in v7: 1. fix uninitialized warning as Jakub's comments. Changes in v6: 1. update commit message as Jakub's comments. 2. split mt8195 eth dts patch("arm64: dts: mt8195: add ethernet device node") from this series, since mt8195 dtsi/dts basic patches is still under reviewing. https://patchwork.kernel.org/project/linux-mediatek/list/?series=579071 we'll resend mt8195 eth dts patch once all the dependent patches are accepted. Changes in v5: 1. remove useless inclusion in dwmac-mediatek.c as Angelo's comments. 2. add acked-by in "net-next: stmmac: dwmac-mediatek: add support for mt8195" patch Changes in v4: 1. add changes in commit message in "net-next: dt-bindings: dwmac: Convert mediatek-dwmac to DT schema" patch. 2. remove ethernet-controller.yaml since snps,dwmac.yaml already include it. Changes in v3: 1. Add prefix "net-next" to support new IC as Denis's suggestion. 2. Split dt-bindings to two patches, one for conversion, and the other for new IC. 3. add a new patch to update device node in mt2712-evb.dts to accommodate to changes in driver. 4. remove unnecessary wrapper as Angelo's suggestion. 5. Add acked-by in "net-next: stmmac: dwmac-mediatek: Reuse more common features" patch. Changes in v2: 1. fix errors/warnings in mediatek-dwmac.yaml with upgraded dtschema tools Changes in v1: This series include 5 patches: 1. add platform level clocks management for dwmac-mediatek 2. resue more common features defined in stmmac_platform.c 3. add ethernet entry for mt8195 ==================== Signed-off-by: David S. Miller commit ee410d510032d3b059bc4b135cd56620b1db689a Author: Biao Huang Date: Mon Mar 14 15:57:13 2022 +0800 net: dt-bindings: dwmac: add support for mt8195 Add binding document for the ethernet on mt8195. Signed-off-by: Biao Huang Reviewed-by: Rob Herring Signed-off-by: David S. Miller .../devicetree/bindings/net/mediatek-dwmac.yaml | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) commit f2d356a6ab71a402ee730b4bf83b452a203fe192 Author: Biao Huang Date: Mon Mar 14 15:57:12 2022 +0800 stmmac: dwmac-mediatek: add support for mt8195 Add Ethernet support for MediaTek SoCs from the mt8195 family. Signed-off-by: Biao Huang Acked-by: AngeloGioacchino Del Regno Signed-off-by: David S. Miller .../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 278 ++++++++++++++++++++- 1 file changed, 268 insertions(+), 10 deletions(-) commit 150b6adda6b18e80c0d76ddd35577ad8ac3a3801 Author: Biao Huang Date: Mon Mar 14 15:57:11 2022 +0800 net: dt-bindings: dwmac: Convert mediatek-dwmac to DT schema Convert mediatek-dwmac to DT schema, and delete old mediatek-dwmac.txt. And there are some changes in .yaml than .txt, others almost keep the same: 1. compatible "const: snps,dwmac-4.20". 2. delete "snps,reset-active-low;" in example, since driver remove this property long ago. 3. add "snps,reset-delay-us = <0 10000 10000>" in example. 4. the example is for rgmii interface, keep related properties only. Signed-off-by: Biao Huang Reviewed-by: Rob Herring Signed-off-by: David S. Miller .../devicetree/bindings/net/mediatek-dwmac.txt | 91 ------------ .../devicetree/bindings/net/mediatek-dwmac.yaml | 155 +++++++++++++++++++++ 2 files changed, 155 insertions(+), 91 deletions(-) commit 79e1177809f2a18518e2013de4abe989ff3c1aa8 Author: Biao Huang Date: Mon Mar 14 15:57:10 2022 +0800 arm64: dts: mt2712: update ethernet device node Since there are some changes in ethernet driver: update ethernet device node in dts to accommodate to it. 1. stmmac_probe_config_dt() in stmmac_platform.c will initialize specified parameters according to compatible string "snps,dwmac-4.20a", then, dwmac-mediatek.c can skip the initialization if add compatible string "snps,dwmac-4.20a" in eth device node. 2. commit 882007ed7832 ("net-next: dt-binding: dwmac-mediatek: add more description for RMII") added rmii internal support, we should add corresponding clocks/clocks-names in eth device node. 3. add "snps,reset-delays-us = <0 10000 10000>;" to ensure reset delay can meet PHY requirement. Signed-off-by: Biao Huang Signed-off-by: David S. Miller arch/arm64/boot/dts/mediatek/mt2712-evb.dts | 1 + arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) commit 4fe3075fa699e681eb4c0d1d4f25577a35a4fd39 Author: Biao Huang Date: Mon Mar 14 15:57:09 2022 +0800 stmmac: dwmac-mediatek: re-arrange clock setting The rmii_internal clock is needed only when PHY interface is RMII, and reference clock is from MAC. Re-arrange the clock setting as following: 1. the optional "rmii_internal" is controlled by devm_clk_get(), 2. other clocks still be configured by devm_clk_bulk_get(). Signed-off-by: Biao Huang Signed-off-by: David S. Miller .../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 71 +++++++++++++++------- 1 file changed, 48 insertions(+), 23 deletions(-) commit a71e67b21081b1e0c2221c68c4edd49f37c2c313 Author: Biao Huang Date: Mon Mar 14 15:57:08 2022 +0800 stmmac: dwmac-mediatek: Reuse more common features This patch makes dwmac-mediatek reuse more features supported by stmmac_platform.c. Signed-off-by: Biao Huang Acked-by: AngeloGioacchino Del Regno Signed-off-by: David S. Miller .../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 32 ++++++++++------------ 1 file changed, 15 insertions(+), 17 deletions(-) commit 3186bdad97d5f4f4e3b333bb50f9c4b8f51acca6 Author: Biao Huang Date: Mon Mar 14 15:57:07 2022 +0800 stmmac: dwmac-mediatek: add platform level clocks management This patch implements clks_config callback for dwmac-mediatek platform, which could support platform level clocks management. Signed-off-by: Biao Huang Acked-by: AngeloGioacchino Del Regno Signed-off-by: David S. Miller .../net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) commit 8ef22dc4a7cbef5870e612edfbf9cd058ddaaa50 Author: Colin Ian King Date: Tue Mar 15 22:15:39 2022 +0000 block/bfq-iosched: Fix spelling mistake "tenative" -> "tentative" There is a spelling mistake in a bfq_log_bfqq message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220315221539.2959167-1-colin.i.king@gmail.com Signed-off-by: Jens Axboe block/bfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 052ebf1fbb1cab86b145a68d80219c8c57321cbd Author: Dylan Yudaken Date: Wed Mar 16 02:52:04 2022 -0700 io_uring: make tracing format consistent Make the tracing formatting for user_data and flags consistent. Having consistent formatting allows one for example to grep for a specific user_data/flags and be able to trace a single sqe through easily. Change user_data to 0x%llx and flags to 0x%x everywhere. The '0x' is useful to disambiguate for example "user_data 100". Additionally remove the '=' for flags in io_uring_req_failed, again for consistency. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220316095204.2191498-1-dylany@fb.com Signed-off-by: Jens Axboe include/trace/events/io_uring.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) commit 0492d857636e1c52cd71594a723c4b26a7b31978 Author: Pablo Neira Ayuso Date: Wed Mar 16 11:19:43 2022 +0100 netfilter: flowtable: Fix QinQ and pppoe support for inet table nf_flow_offload_inet_hook() does not check for 802.1q and PPPoE. Fetch inner ethertype from these encapsulation protocols. Fixes: 72efd585f714 ("netfilter: flowtable: add pppoe support") Fixes: 4cd91f7c290f ("netfilter: flowtable: add vlan support") Signed-off-by: Pablo Neira Ayuso include/net/netfilter/nf_flow_table.h | 18 ++++++++++++++++++ net/netfilter/nf_flow_table_inet.c | 17 +++++++++++++++++ net/netfilter/nf_flow_table_ip.c | 18 ------------------ 3 files changed, 35 insertions(+), 18 deletions(-) commit 79b0410841d4407a361d4d6a602267dba5a3eba9 Merge: 9f01cfbf2922 5a57ee83d961 Author: David S. Miller Date: Wed Mar 16 10:17:22 2022 +0000 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-03-15 Jacob Keller says: The ice_sriov.c file now houses almost all of the virtualization code in the ice driver. This includes both Single Root specific implementation as well as generic functionality such as the virtchnl interface. We are planning to implement support for Scalable IOV in the ice driver in the future. This implementation will want to use the generic functionality in ice_sriov.c Rather than dump the Scalable IOV code into ice_sriov.c, we will want to implement it in a separate file, ice_siov.c To help with this, refactor the code in ice_sriov.c and split the generic functionality out into separate files. Reorganize code to make the non-implementation specific bits into new files with the following general guidelines: * ice_vf_lib.[ch] Basic VF structures and accessors. This is where scheme-independent code will reside. * ice_virtchnl.[ch] Virtchnl message handling. This is where the bulk of the logic for processing messages from VFs using the virtchnl messaging scheme will reside. This is separated from ice_vf_lib.c because it is somewhat distinct and stand alone. * ice_sriov.[ch] Single Root IOV implementation, including initialization and the routines for interacting with SR-IOV based netdev operations. * (future) ice_siov.[ch] Scalable IOV implementation. The end goal is to make it easier to re-use the generic parts of the virtualization logic while keeping separate the concerns of the Single Root implementation. In addition to the pure code moves, this series has a reset refactor which clean up the functionality to make it easier to reuse the reset code. A new ops table is introduced to make the VF reset logic more generic. The Single Root specific details are implemented in ice_sriov.c. A future series implementing Scalable IOV support will use this ops table to allow re-use of the reset logic which is now in ice_vf_lib.c ==================== Signed-off-by: David S. Miller commit d4c9df20a37d128f6acb3c6286db7e694554a51b Author: Jiri Kosina Date: Mon Mar 14 09:25:18 2022 +0100 x86/nmi: Remove the 'strange power saving mode' hint from unknown NMI handler The Do you have a strange power saving mode enabled? hint when unknown NMI happens dates back to i386 stone age, and isn't currently really helpful. Unknown NMIs are coming for many different reasons (broken firmware, faulty hardware, ...) and rarely have anything to do with 'strange power saving mode' (whatever that even is). Just remove it as it's largerly misleading. Signed-off-by: Jiri Kosina Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/nycvar.YFH.7.76.2203140924120.24795@cbobk.fhfr.pm arch/x86/kernel/nmi.c | 1 - 1 file changed, 1 deletion(-) commit f406f2d03e07afc199dd8cf501f361dde6be8a69 Author: Max Filippov Date: Wed Mar 16 02:04:17 2022 -0700 xtensa: fix stop_machine_cpuslocked call in patch_text patch_text must invoke patch_text_stop_machine on all online CPUs, but it calls stop_machine_cpuslocked with NULL cpumask. As a result only one CPU runs patch_text_stop_machine potentially leaving stale icache entries on other CPUs. Fix that by calling stop_machine_cpuslocked with cpu_online_mask as the last argument. Cc: stable@vger.kernel.org Fixes: 64711f9a47d4 ("xtensa: implement jump_label support") Signed-off-by: Max Filippov arch/xtensa/kernel/jump_label.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e1bca853dddcb57cbf084acbf35e3654cef6fc75 Author: Rabara Niravkumar L Date: Sat Mar 5 09:41:18 2022 +0800 EDAC/altera: Add SDRAM ECC check for U-Boot A bug in legacy U-Boot causes a crash during SDRAM boot if ECC is not enabled in the bitstream but enabled in the Linux config. Memory mapped read of the ECC Enabled bit was only enabled if U-Boot determined ECC was enabled in the bitstream. The Linux driver checks the ECC enable bit using a memory map read. In the ECC disabled bitstream case, U-Boot didn't enable ECC register memory map reads and since they are not allowed this results in a crash. Always read the ECC Enable register through a SMC call which is always allowed and it works with legacy and current U-Boot. [ bp: Massage commit message. ] Signed-off-by: Rabara Niravkumar L Signed-off-by: Borislav Petkov Acked-by: Dinh Nguyen Link: https://lore.kernel.org/r/20220305014118.4794-1-niravkumar.l.rabara@intel.com drivers/edac/altera_edac.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) commit e559398f47e090394bbbd9006349c858e1ba80da Author: Christoph Hellwig Date: Tue Mar 15 15:53:59 2022 +0100 nvme: remove nvme_alloc_request and nvme_alloc_request_qid Just open code the allocation + initialization in the callers. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni drivers/nvme/host/core.c | 46 ++++++++++-------------------------------- drivers/nvme/host/ioctl.c | 3 ++- drivers/nvme/host/nvme.h | 8 ++++++-- drivers/nvme/host/pci.c | 17 +++++++++------- drivers/nvme/target/passthru.c | 3 ++- 5 files changed, 31 insertions(+), 46 deletions(-) commit b739e137052069c996ab8b3bc9c25be501ecc63b Author: Christoph Hellwig Date: Tue Mar 15 12:58:06 2022 +0100 nvme: cleanup how disk->disk_name is assigned They way how assigning the disk name and commenting on why it is done is split over core.c and multipath.c seems to be rather confusing. Now that ns_head->disk always exists we can do all the work in core.c and have a single big comment explaining the issues. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni drivers/nvme/host/core.c | 22 ++++++++++++++++++---- drivers/nvme/host/multipath.c | 24 +----------------------- drivers/nvme/host/nvme.h | 8 ++------ 3 files changed, 21 insertions(+), 33 deletions(-) commit aff477cb8f94613f501d386d10f20019e294bc35 Author: Juergen Gross Date: Fri Mar 11 11:35:09 2022 +0100 xen/usb: harden xen_hcd against malicious backends Make sure a malicious backend can't cause any harm other than wrong I/O data. Missing are verification of the request id in a response, sanitizing the reported actual I/O length, and protection against interrupt storms from the backend. Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20220311103509.12908-1-jgross@suse.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xen-hcd.c | 57 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 14 deletions(-) commit 7f220d4a38e095ef4ee851ef4ff90f92ed9b778b Merge: e4cf6580ac74 09688c0166e7 Author: Greg Kroah-Hartman Date: Wed Mar 16 09:04:22 2022 +0100 Merge tag 'v5.17-rc8' into usb-next We need the Xen USB fixes as other patches depend on those changes. Signed-off-by: Greg Kroah-Hartman commit 278da06c03655c2bb9bc36ebdf45b90a079b3bfd Author: José Roberto de Souza Date: Fri Mar 11 10:51:49 2022 -0800 drm/i915/display: Do not re-enable PSR after it was marked as not reliable If a error happens and sink_not_reliable is set, PSR should be disabled for good but that is not happening. It would be disabled by the function handling the PSR error but then on the next fastset it would be enabled again in _intel_psr_post_plane_update(). It would only be disabled for good in the next modeset where has_psr will be set false. v2: - release psr lock before continue Fixes: 9ce5884e5139 ("drm/i915/display: Only keep PSR enabled if there is active planes") Reported-by: Khaled Almahallawy Reported-by: Charlton Lin Cc: Jouni Högander Signed-off-by: José Roberto de Souza Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20220311185149.110527-2-jose.souza@intel.com (cherry picked from commit 15f26bdc81f7f03561aaea5a10d87bd6638e1459) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/display/intel_psr.c | 4 ++++ 1 file changed, 4 insertions(+) commit 3a84fd1ed53582b31e843a152ee3219e9e4ccb8c Author: José Roberto de Souza Date: Fri Mar 11 10:51:48 2022 -0800 drm/i915/display: Fix HPD short pulse handling for eDP Commit 13ea6db2cf24 ("drm/i915/edp: Ignore short pulse when panel powered off") completely broke short pulse handling for eDP as it is usually generated by sink when it is displaying image and there is some error or status that source needs to handle. When power panel is enabled, this state is enough to power aux transactions and VDD override is disabled, so intel_pps_have_power() is always returning false causing short pulses to be ignored. So here better naming this function that intends to check if aux lines are powered to avoid the endless cycle mentioned in the commit being fixed and fixing the check for what it is intended. v2: - renamed to intel_pps_have_panel_power_or_vdd() - fixed indentation Fixes: 13ea6db2cf24 ("drm/i915/edp: Ignore short pulse when panel powered off") Cc: Anshuman Gupta Cc: Jani Nikula Cc: Uma Shankar Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220311185149.110527-1-jose.souza@intel.com (cherry picked from commit 8f0c1c0949b609acfad62b8d5f742a3b5e7b05ab) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/i915/display/intel_pps.c | 6 +++--- drivers/gpu/drm/i915/display/intel_pps.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) commit 35de589cb8793573ed56a915af9cb4b5f15ad7d7 Author: Nicholas Piggin Date: Tue Jan 25 00:39:30 2022 +1000 powerpc/time: improve decrementer clockevent processing The stop/shutdown op should not use decrementer_set_next_event because that sets decrementers_next_tb to now + decrementer_max, which means a decrementer interrupt that occurs after that time will call the clockevent event handler unexpectedly. Set next_tb to ~0 here to prevent any clock event call. Init all clockevents to stopped. Then the decrementer clockevent device always has event_handler set and applicable because we know the clock event device was not stopped. So make this call unconditional to show that it is always called. next_tb need not be set to ~0 before the event handler is called because it will stop the clockevent device if there is no other timer. Finally, the timer broadcast interrupt should not modify next_tb because it is not involved with the local decrementer clockevent on this CPU. This doesn't fix a known bug, just tidies the code. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220124143930.3923442-3-npiggin@gmail.com arch/powerpc/kernel/time.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit cf74ff52e352112be78c4c4c3637a37ec36a6608 Author: Nicholas Piggin Date: Tue Jan 25 00:39:29 2022 +1000 powerpc/time: Fix KVM host re-arming a timer beyond decrementer range If the next host timer is beyond decrementer range, timer_rearm_host_dec will leave decrementer not programmed. This will not cause a problem for the host it will just set the decrementer correctly when the decrementer interrupt hits, it seems safer not to leave the next host decrementer interrupt timing able to be influenced by a guest. This code is only used in the P9 KVM paths so it's unlikely to be hit practically unless large decrementer is force disabled in the host. Fixes: 25aa145856cd ("powerpc/time: add API for KVM to re-arm the host timer/decrementer") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220124143930.3923442-2-npiggin@gmail.com arch/powerpc/kernel/time.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 9f01cfbf2922432668c2fd4dfc0413342aaff48b Author: Casper Andersson Date: Mon Mar 14 17:09:18 2022 +0100 net: sparx5: Use Switchdev fdb events for managing fdb entries Changes the handling of fdb entries to use Switchdev events, instead of the previous "sync_bridge" and "sync_port" which only run when adding or removing VLANs on the bridge. Signed-off-by: Casper Andersson Link: https://lore.kernel.org/r/20220314160918.4rfrrfgmbsf2pxl3@wse-c0155 Signed-off-by: Jakub Kicinski .../ethernet/microchip/sparx5/sparx5_mactable.c | 11 +-- .../net/ethernet/microchip/sparx5/sparx5_main.h | 3 +- .../ethernet/microchip/sparx5/sparx5_switchdev.c | 91 ++++++---------------- 3 files changed, 33 insertions(+), 72 deletions(-) commit 40867d74c374b235e14d839f3a77f26684feefe5 Author: David Ahern Date: Mon Mar 14 14:45:51 2022 -0600 net: Add l3mdev index to flow struct and avoid oif reset for port devices The fundamental premise of VRF and l3mdev core code is binding a socket to a device (l3mdev or netdev with an L3 domain) to indicate L3 scope. Legacy code resets flowi_oif to the l3mdev losing any original port device binding. Ben (among others) has demonstrated use cases where the original port device binding is important and needs to be retained. This patch handles that by adding a new entry to the common flow struct that can indicate the l3mdev index for later rule and table matching avoiding the need to reset flowi_oif. In addition to allowing more use cases that require port device binds, this patch brings a few datapath simplications: 1. l3mdev_fib_rule_match is only called when walking fib rules and always after l3mdev_update_flow. That allows an optimization to bail early for non-VRF type uses cases when flowi_l3mdev is not set. Also, only that index needs to be checked for the FIB table id. 2. l3mdev_update_flow can be called with flowi_oif set to a l3mdev (e.g., VRF) device. By resetting flowi_oif only for this case the FLOWI_FLAG_SKIP_NH_OIF flag is not longer needed and can be removed, removing several checks in the datapath. The flowi_iif path can be simplified to only be called if the it is not loopback (loopback can not be assigned to an L3 domain) and the l3mdev index is not already set. 3. Avoid another device lookup in the output path when the fib lookup returns a reject failure. Note: 2 functional tests for local traffic with reject fib rules are updated to reflect the new direct failure at FIB lookup time for ping rather than the failure on packet path. The current code fails like this: HINT: Fails since address on vrf device is out of device scope COMMAND: ip netns exec ns-A ping -c1 -w1 -I eth1 172.16.3.1 ping: Warning: source address might be selected on device other than: eth1 PING 172.16.3.1 (172.16.3.1) from 172.16.3.1 eth1: 56(84) bytes of data. --- 172.16.3.1 ping statistics --- 1 packets transmitted, 0 received, 100% packet loss, time 0ms where the test now directly fails: HINT: Fails since address on vrf device is out of device scope COMMAND: ip netns exec ns-A ping -c1 -w1 -I eth1 172.16.3.1 ping: connect: No route to host Signed-off-by: David Ahern Tested-by: Ben Greear Link: https://lore.kernel.org/r/20220314204551.16369-1-dsahern@kernel.org Signed-off-by: Jakub Kicinski drivers/net/vrf.c | 7 +++-- include/net/flow.h | 6 ++++- net/ipv4/fib_frontend.c | 7 +++-- net/ipv4/fib_semantics.c | 2 +- net/ipv4/fib_trie.c | 7 ++--- net/ipv4/route.c | 4 +-- net/ipv4/xfrm4_policy.c | 4 +-- net/ipv6/ip6_output.c | 3 +-- net/ipv6/route.c | 12 --------- net/ipv6/xfrm6_policy.c | 3 +-- net/l3mdev/l3mdev.c | 43 ++++++++++++------------------- tools/testing/selftests/net/fcnal-test.sh | 2 +- 12 files changed, 37 insertions(+), 63 deletions(-) commit d467e980d0239fd95cc93b0995199973624a4825 Author: Gao Xiang Date: Fri Mar 11 01:34:48 2022 +0800 erofs: silence warnings related to impossible m_plen Dan reported two smatch warnings [1], .. warn: should '1 << lclusterbits' be a 64 bit type? .. warn: should 'm->compressedlcs << lclusterbits' be a 64 bit type? In practice, m_plen cannot be more than 1MiB due to on-disk constraint for the compression mode, so we're always safe here. In order to make static analyzers happy and not report again, let's silence them instead. [1] https://lore.kernel.org/r/202203091002.lJVzsX6e-lkp@intel.com Reported-by: kernel test robot Reported-by: Dan Carpenter Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220310173448.19962-1-hsiangkao@linux.alibaba.com Signed-off-by: Gao Xiang fs/erofs/zmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit faac509507e2341093c32b6607a82430bccfb78f Author: lihongnan Date: Tue Mar 8 11:41:39 2022 +0800 Documentation/filesystem/dax: update DAX description on erofs Add missing erofs fsdax description since fsdax has been supported on erofs from Linux 5.15. Link: https://lore.kernel.org/r/20220308034139.93748-1-hongnan.li@linux.alibaba.com Reviewed-by: Gao Xiang Acked-by: Chao Yu Signed-off-by: lihongnan Signed-off-by: Gao Xiang Documentation/filesystems/dax.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 6f39d1e1ca46782bf11b8de016e904793d46aed0 Author: Gao Xiang Date: Wed Mar 2 03:49:51 2022 +0800 erofs: clean up preload_compressed_pages() Rename preload_compressed_pages() as z_erofs_bind_cache() since we're trying to prepare for adapting folios. Also, add a comment for the gfp setting. No logic changes. Link: https://lore.kernel.org/r/20220301194951.106227-2-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang fs/erofs/zdata.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit 5c6dcc57e2e50553405f2cf8b949f99b8820a685 Author: Gao Xiang Date: Wed Mar 2 03:49:50 2022 +0800 erofs: get rid of `struct z_erofs_collector' Avoid `struct z_erofs_collector' since there is another context structure called "struct z_erofs_decompress_frontend". No logic changes. Link: https://lore.kernel.org/r/20220301194951.106227-1-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang fs/erofs/zdata.c | 163 ++++++++++++++++++++++++++----------------------------- 1 file changed, 77 insertions(+), 86 deletions(-) commit 309b517276f21dc7e6315c6637792f8bbfdf7ec4 Author: jianchunfu Date: Mon Mar 14 15:05:14 2022 +0800 arch:x86:xen: Remove unnecessary assignment in xen_apic_read() In the function xen_apic_read(), the initialized value of 'ret' is unused because it will be assigned by the function HYPERVISOR_platform_op(), thus remove it. Signed-off-by: jianchunfu Link: https://lore.kernel.org/r/20220314070514.2602-1-jianchunfu@cmss.chinamobile.com Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky arch/x86/xen/apic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ed6e0401e68bdfe08de9b44968fb235ff10ccee1 Author: Jeffle Xu Date: Wed Feb 9 14:00:52 2022 +0800 erofs: use meta buffers for erofs_read_superblock() The only change is that, meta buffers read cache page without __GFP_FS flag, which shall not matter. Link: https://lore.kernel.org/r/20220209060108.43051-7-jefflexu@linux.alibaba.com Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Gao Xiang fs/erofs/super.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) commit c94b731da21f10086a9e52d63c21c730e3f6c939 Author: Juergen Gross Date: Fri Mar 11 11:34:29 2022 +0100 xen/grant-table: remove readonly parameter from functions The gnttab_end_foreign_access() family of functions is taking a "readonly" parameter, which isn't used. Remove it from the function parameters. Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20220311103429.12845-3-jgross@suse.com Reviewed-by: Jan Beulich Acked-by: Christian Schoenebeck Signed-off-by: Boris Ostrovsky drivers/block/xen-blkfront.c | 8 +++--- drivers/char/tpm/xen-tpmfront.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_evtchnl.c | 2 +- drivers/input/misc/xen-kbdfront.c | 4 +-- drivers/net/xen-netfront.c | 13 +++++----- drivers/pci/xen-pcifront.c | 2 +- drivers/scsi/xen-scsifront.c | 4 +-- drivers/usb/host/xen-hcd.c | 4 +-- drivers/xen/gntalloc.c | 2 +- drivers/xen/gntdev-dmabuf.c | 2 +- drivers/xen/grant-table.c | 38 ++++++++++++----------------- drivers/xen/pvcalls-front.c | 6 ++--- drivers/xen/xen-front-pgdir-shbuf.c | 3 +-- include/xen/grant_table.h | 5 ++-- net/9p/trans_xen.c | 8 +++--- sound/xen/xen_snd_front_evtchnl.c | 2 +- 16 files changed, 48 insertions(+), 57 deletions(-) commit b0f212633b31ddca99c76aa38f812fe492e8410a Author: Juergen Gross Date: Fri Mar 11 11:34:28 2022 +0100 xen/grant-table: remove gnttab_*transfer*() functions All grant table operations related to the "transfer" functionality are unused currently. There have been users in the old days of the "Xen-o-Linux" kernel, but those didn't make it upstream. So remove the "transfer" related functions. Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20220311103429.12845-2-jgross@suse.com Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky drivers/xen/grant-table.c | 113 +--------------------------------------------- include/xen/grant_table.h | 8 ---- 2 files changed, 2 insertions(+), 119 deletions(-) commit 9d71165d3934e607070c4e48458c0cf161b1baea Author: Nicholas Piggin Date: Fri Mar 11 12:47:33 2022 +1000 powerpc/tm: Fix more userspace r13 corruption Commit cf13435b730a ("powerpc/tm: Fix userspace r13 corruption") fixes a problem in treclaim where a SLB miss can occur on the thread_struct->ckpt_regs while SCRATCH0 is live with the saved user r13 value, clobbering it with the kernel r13 and ultimately resulting in kernel r13 being stored in ckpt_regs. There is an equivalent problem in trechkpt where the user r13 value is loaded into r13 from chkpt_regs to be recheckpointed, but a SLB miss could occur on ckpt_regs accesses after that, which will result in r13 being clobbered with a kernel value and that will get recheckpointed and then restored to user registers. The same memory page is accessed right before this critical window where a SLB miss could cause corruption, so hitting the bug requires the SLB entry be removed within a small window of instructions, which is possible if a SLB related MCE hits there. PAPR also permits the hypervisor to discard this SLB entry (because slb_shadow->persistent is only set to SLB_NUM_BOLTED) although it's not known whether any implementations would do this (KVM does not). So this is an extremely unlikely bug, only found by inspection. Fix this by also storing user r13 in a temporary location on the kernel stack and don't change the r13 register from kernel r13 until the RI=0 critical section that does not fault. The SCRATCH0 change is not strictly part of the fix, it's only used in the RI=0 section so it does not have the same problem as the previous SCRATCH0 bug. Fixes: 98ae22e15b43 ("powerpc: Add helper functions for transactional memory context switching") Cc: stable@vger.kernel.org # v3.9+ Signed-off-by: Nicholas Piggin Acked-by: Michael Neuling Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220311024733.48926-1-npiggin@gmail.com arch/powerpc/kernel/tm.S | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) commit d64e3eab75a8e1e900c0fda2410a2df8893d8f85 Author: Randy Dunlap Date: Sat Mar 12 22:59:36 2022 -0800 powerpc/xive: fix return value of __setup handler __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything to obsolete_checksetup() -- only non-zero (usually 1) or zero. So return 1 from xive_off() and xive_store_eoi_cmdline(). Fixes: 243e25112d06 ("powerpc/xive: Native exploitation of the XIVE interrupt controller") Fixes: c21ee04f11ae ("powerpc/xive: Add a kernel parameter for StoreEOI") [lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru] Reported-by: Igor Zhbanov : Signed-off-by: Randy Dunlap Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220313065936.4363-1-rdunlap@infradead.org arch/powerpc/sysdev/xive/common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 26c1bc67aa2fff563223f02612191405a7fa7cb7 Author: Marek Vasut Date: Sat Feb 26 05:07:21 2022 +0100 dt-bindings: clk: rs9: Add Renesas 9-series I2C PCIe clock generator Add binding for Renesas 9-series PCIe clock generators. This binding is designed to support 9FGV/9DBV/9DMV/9FGL/9DML/9QXL/9SQ series I2C PCIe clock generators, currently the only tested and supported chip is 9FGV0241. Signed-off-by: Marek Vasut Cc: Michael Turquette Cc: Rob Herring Cc: Stephen Boyd Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20220226040723.143705-1-marex@denx.de Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd .../devicetree/bindings/clock/renesas,9series.yaml | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) commit df34dc9e03bfb9181f6f5405f4dd319340b5b46c Author: Bob Pearson Date: Thu Mar 3 18:08:03 2022 -0600 RDMA/rxe: Shorten pool names in rxe_pool.c Replace pool names like "rxe-xx" with "xx". Just reduces clutter. Link: https://lore.kernel.org/r/20220304000808.225811-8-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_pool.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 3ccffe8abf2febab4642033d4675a20bbade151b Author: Bob Pearson Date: Thu Mar 3 18:08:02 2022 -0600 RDMA/rxe: Move max_elem into rxe_type_info Move the maximum number of elements from a parameter in rxe_pool_init to a member of the rxe_type_info array. Link: https://lore.kernel.org/r/20220304000808.225811-7-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe.c | 24 ++++++++---------------- drivers/infiniband/sw/rxe/rxe_pool.c | 14 +++++++++++--- drivers/infiniband/sw/rxe/rxe_pool.h | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) commit b4a47f6836b9c8fa60ccd8ff64f3c5f5b7d35afa Author: Bob Pearson Date: Thu Mar 3 18:08:01 2022 -0600 RDMA/rxe: Replace obj by elem in declaration Fix a harmless typo replacing obj by elem in the cleanup fields. This has no effect but is confusing. Link: https://lore.kernel.org/r/20220304000808.225811-6-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_pool.c | 2 +- drivers/infiniband/sw/rxe/rxe_pool.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 3c3e4d582bdc461081abea9de54eb4112a9a6283 Author: Bob Pearson Date: Thu Mar 3 18:08:00 2022 -0600 RDMA/rxe: Delete _locked() APIs for pool objects Since caller managed locks for indexed objects are no longer used these APIs are deleted. Link: https://lore.kernel.org/r/20220304000808.225811-5-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_pool.c | 67 +++++------------------------------- drivers/infiniband/sw/rxe/rxe_pool.h | 24 +++---------- 2 files changed, 12 insertions(+), 79 deletions(-) commit c9f4c695835c9c2085065a3adc1b57d2005b508b Author: Bob Pearson Date: Thu Mar 3 18:07:59 2022 -0600 RDMA/rxe: Reverse the sense of RXE_POOL_NO_ALLOC There is only one remaining object type that allocates its own memory, that is mr. So the sense of RXE_POOL_NO_ALLOC is changed to RXE_POOL_ALLOC. Add checks to rxe_alloc() and rxe_add_to_pool() to make sure the correct call is used for the setting of this flag. Link: https://lore.kernel.org/r/20220304000808.225811-4-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_pool.c | 21 ++++++++++++--------- drivers/infiniband/sw/rxe/rxe_pool.h | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) commit 8a1a0be894da0d06bfbb496cc2dc3057fa83e103 Author: Bob Pearson Date: Thu Mar 3 18:07:58 2022 -0600 RDMA/rxe: Replace mr by rkey in responder resources Currently rxe saves a copy of MR in responder resources for RDMA reads. Since the responder resources are never freed just over written if more are needed this MR may not have a reference freed until the QP is destroyed. This patch uses the rkey instead of the MR and on subsequent packets of a multipacket read reply message it looks up the MR from the rkey for each packet. This makes it possible for a user to deregister an MR or unbind a MW on the fly and get correct behaviour. Link: https://lore.kernel.org/r/20220304000808.225811-3-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_qp.c | 10 +-- drivers/infiniband/sw/rxe/rxe_resp.c | 123 +++++++++++++++++++++++----------- drivers/infiniband/sw/rxe/rxe_verbs.h | 1 - 3 files changed, 87 insertions(+), 47 deletions(-) commit 63221acb0c63141cc7650f8eefb148337061e6db Author: Bob Pearson Date: Thu Mar 3 18:07:57 2022 -0600 RDMA/rxe: Fix ref error in rxe_av.c The commit referenced below can take a reference to the AH which is never dropped. This only happens in the UD request path. This patch optionally passes that AH back to the caller so that it can hold the reference while the AV is being accessed and then drop it. Code to do this is added to rxe_req.c. The AV is also passed to rxe_prepare in rxe_net.c as an optimization. Fixes: e2fe06c90806 ("RDMA/rxe: Lookup kernel AH from ah index in UD WQEs") Link: https://lore.kernel.org/r/20220304000808.225811-2-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_av.c | 19 +++++++++++-- drivers/infiniband/sw/rxe/rxe_loc.h | 5 ++-- drivers/infiniband/sw/rxe/rxe_net.c | 17 +++++------ drivers/infiniband/sw/rxe/rxe_req.c | 55 +++++++++++++++++++++--------------- drivers/infiniband/sw/rxe/rxe_resp.c | 2 +- 5 files changed, 63 insertions(+), 35 deletions(-) commit 61e02cdb6ac68a84f1bb95026632d63677f26202 Author: Lukas Bulwahn Date: Mon Mar 14 16:46:05 2022 +0100 aio: drop needless assignment in aio_read() Commit 84c4e1f89fef ("aio: simplify - and fix - fget/fput for io_submit()") refactored aio_read() and some error cases into early return, which made some intermediate assignment of the return variable needless. Drop this needless assignment in aio_read(). No functional change. No change in resulting object code. Signed-off-by: Lukas Bulwahn Signed-off-by: Al Viro fs/aio.c | 1 - 1 file changed, 1 deletion(-) commit fd6ca3f5b80f6dda381fe84211be3b491f28bf0f Author: Minghao Chi Date: Tue Mar 15 02:34:12 2022 +0000 hwmon: (scpi-hwmon): Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Jean Delvare Link: https://lore.kernel.org/r/20220315023412.2118415-1-chi.minghao@zte.com.cn Signed-off-by: Guenter Roeck drivers/hwmon/scpi-hwmon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 70f92521584f1d1e8268311ee84413307b0fdea8 Author: Yixing Liu Date: Thu Mar 10 12:28:35 2022 +0800 RDMA/hns: Use the reserved loopback QPs to free MR before destroying MPT Before destroying MPT, the reserved loopback QPs send loopback IOs (one write operation per SL). Completing these loopback IOs represents that there isn't any outstanding request in MPT, then it's safe to destroy MPT. Link: https://lore.kernel.org/r/20220310042835.38634-1-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_device.h | 2 + drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 311 +++++++++++++++++++++++++++- drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 20 ++ drivers/infiniband/hw/hns/hns_roce_mr.c | 6 +- 4 files changed, 335 insertions(+), 4 deletions(-) commit e257039f0fc7da36ac3a522ef9a5cb4ae7852e67 Author: Al Viro Date: Mon Feb 28 23:04:20 2022 -0500 mount_setattr(): clean the control flow and calling conventions separate the "cleanup" and "apply" codepaths (they have almost no overlap), fold the "cleanup" into "prepare" (which eliminates the need of ->revert) and make loops more idiomatic. Signed-off-by: Al Viro fs/namespace.c | 82 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 40 insertions(+), 42 deletions(-) commit 5e916932df639bc2eeecc96c3a1f2cce496f1a93 Author: Zong Li Date: Fri Mar 4 18:03:21 2022 +0800 clk: sifive: Move all stuff into SoCs header files from C files Improve PRCI driver to reduce the complexity, we remove the SoCs C files by putting all stuff in each SoCs header files, and include these SoCs-specific header files in core of PRCI. It can also avoid the W=1 kernel build warnings about variable defined but not used [-Wunused-const-variable=], like commit 487dc7bb6a0c ("clk: sifive: fu540-prci: Declare static const variable 'prci_clk_fu540' where it's used") does. Signed-off-by: Zong Li Suggested-by: Lee Jones Reviewed-by: Lee Jones Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/a3c7ec5c46c1d8be455d1c347db4855bb56cec53.1646388139.git.zong.li@sifive.com Signed-off-by: Stephen Boyd drivers/clk/sifive/Makefile | 2 +- drivers/clk/sifive/fu540-prci.c | 88 -------------------------- drivers/clk/sifive/fu540-prci.h | 91 +++++++++++++++++++++++++-- drivers/clk/sifive/fu740-prci.c | 133 --------------------------------------- drivers/clk/sifive/fu740-prci.h | 130 ++++++++++++++++++++++++++++++++++++-- drivers/clk/sifive/sifive-prci.c | 5 -- 6 files changed, 214 insertions(+), 235 deletions(-) commit 24a4a29f755e457d5485c5d9a1006be560ae48ce Author: Zong Li Date: Fri Mar 4 18:03:20 2022 +0800 clk: sifive: Add SoCs prefix in each SoCs-dependent data This patch is prerequisite for moving SoCs C files into SoCs header files. Currently, fu540-prci.c and fu740-prci.c use same names for several macro definitions and variables, it would cause redefinition error when we trying to include all stuff in sifive-prci.c. In this patch, we also remove the temporary macro definitions which are added by previous patch. Signed-off-by: Zong Li Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/7728ef662c59449ce954b1b62c6ad5241e07adfb.1646388139.git.zong.li@sifive.com Signed-off-by: Stephen Boyd drivers/clk/sifive/fu540-prci.c | 29 +++++++++------------ drivers/clk/sifive/fu740-prci.c | 56 +++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 50 deletions(-) commit 990d627f80c3f7b23ca4059ef765617225bccb26 Author: Zong Li Date: Fri Mar 4 18:03:19 2022 +0800 riscv: dts: Change the macro name of prci in each device node We currently change the macro name for fu540 and fu740 by adding the prefix respectively, these marcos are referenced by some device nodes, they should be modified as well. Signed-off-by: Zong Li Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/db92d209fa700f7da8bc8028083476fcc138d80e.1646388139.git.zong.li@sifive.com Signed-off-by: Stephen Boyd arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 22 +++++++++++----------- arch/riscv/boot/dts/sifive/fu740-c000.dtsi | 26 +++++++++++++------------- 2 files changed, 24 insertions(+), 24 deletions(-) commit 0493692b40d02a74dfb6823754f31951ace2000b Author: Zong Li Date: Fri Mar 4 18:03:18 2022 +0800 dt-bindings: change the macro name of prci in header files and example We currently change the macro name for fu540 and fu740 by adding the prefix respectively, the dt-bindings should be modified as well. Signed-off-by: Zong Li Acked-by: Rob Herring Acked-by: Palmer Dabbelt Link: https://lore.kernel.org/r/f9284873c2993a9952d9fe4f8dd5e89f20daab75.1646388139.git.zong.li@sifive.com Signed-off-by: Stephen Boyd .../devicetree/bindings/gpio/sifive,gpio.yaml | 2 +- .../devicetree/bindings/pci/sifive,fu740-pcie.yaml | 2 +- .../devicetree/bindings/serial/sifive-serial.yaml | 2 +- include/dt-bindings/clock/sifive-fu540-prci.h | 8 ++++---- include/dt-bindings/clock/sifive-fu740-prci.h | 18 +++++++++--------- 5 files changed, 16 insertions(+), 16 deletions(-) commit e83da8e2a1c323021ecb57f9a738f08fdd7879f1 Author: Zong Li Date: Fri Mar 4 18:03:17 2022 +0800 clk: sifive: duplicate the macro definitions for the time being This is a temporary patch in whole patch set. We are going to change the macro name in dt-binding, in order to avoid breaking the driver build and git bisect, add these macro definitions for the time being, and we will remove them later. Signed-off-by: Zong Li Link: https://lore.kernel.org/r/8cfd57f01cfb59adb716eb13ca0c8250c246dcb2.1646388139.git.zong.li@sifive.com Signed-off-by: Stephen Boyd drivers/clk/sifive/fu540-prci.c | 6 +++++- drivers/clk/sifive/fu740-prci.c | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) commit 6585abea98ae5f750358a6427f2ddf7715393f69 Author: Daniel Xu Date: Sun Mar 13 16:19:46 2022 -0700 bpftool: man: Add missing top level docs The top-level (bpftool.8) man page was missing docs for a few subcommands and their respective sub-sub-commands. This commit brings the top level man page up to date. Note that I've kept the ordering of the subcommands the same as in `bpftool help`. Signed-off-by: Daniel Xu Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/3049ef5dc509c0d1832f0a8b2dba2ccaad0af688.1647213551.git.dxu@dxuuu.xyz tools/bpf/bpftool/Documentation/bpftool.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) commit bb7f4b8c1e5c184d8a39c25ce40a73ef6ecba365 Author: Julia Lawall Date: Mon Mar 14 12:53:39 2022 +0100 clk: qcom: sm6125-gcc: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220314115354.144023-16-Julia.Lawall@inria.fr Signed-off-by: Stephen Boyd drivers/clk/qcom/gcc-sm6125.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6a6c2389ddf74c2b204a6900745d7a77abfc22f3 Author: Julia Lawall Date: Mon Mar 14 12:53:38 2022 +0100 clk: ti: clkctrl: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220314115354.144023-15-Julia.Lawall@inria.fr Signed-off-by: Stephen Boyd drivers/clk/ti/clkctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cbdaf71f7e65a45d6e96378ee7bfe3da39c30908 Author: Dmitrii Dolgov <9erthalion6@gmail.com> Date: Wed Mar 9 17:31:12 2022 +0100 bpftool: Add bpf_cookie to link output Commit 82e6b1eee6a8 ("bpf: Allow to specify user-provided bpf_cookie for BPF perf links") introduced the concept of user specified bpf_cookie, which could be accessed by BPF programs using bpf_get_attach_cookie(). For troubleshooting purposes it is convenient to expose bpf_cookie via bpftool as well, so there is no need to meddle with the target BPF program itself. Implemented using the pid iterator BPF program to actually fetch bpf_cookies, which allows constraining code changes only to bpftool. $ bpftool link 1: type 7 prog 5 bpf_cookie 123 pids bootstrap(81) Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com> Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220309163112.24141-1-9erthalion6@gmail.com tools/bpf/bpftool/main.h | 2 ++ tools/bpf/bpftool/pids.c | 8 ++++++++ tools/bpf/bpftool/skeleton/pid_iter.bpf.c | 22 ++++++++++++++++++++++ tools/bpf/bpftool/skeleton/pid_iter.h | 2 ++ 4 files changed, 34 insertions(+) commit 919adbfec29d5b89b3e45620653cbeeb0d42e6fd Author: Theodore Ts'o Date: Sat Mar 12 21:39:35 2022 -0500 ext4: fix kernel doc warnings Signed-off-by: Theodore Ts'o fs/ext4/balloc.c | 1 + fs/ext4/ioctl.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) commit 163f11b8b3489fbf04be8d8d0e029f1dcd6546d1 Author: Ritesh Harjani Date: Sat Mar 12 11:09:55 2022 +0530 ext4: fix remaining two trace events to use same printk convention All ext4 & jbd2 trace events starts with "dev Major:Minor". While we are still improving/adding the ftrace events for FC, let's fix last two remaining trace events to follow the same convention. Signed-off-by: Ritesh Harjani Reviewed-by: Harshad Shirwadkar Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/8f33b163f0f29df2491c03b79f8ac96890ea5184.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o include/trace/events/ext4.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5641ace54471cb5c393e71f33232088602455c6b Author: Ritesh Harjani Date: Sat Mar 12 11:09:54 2022 +0530 ext4: add commit tid info in ext4_fc_commit_start/stop trace events This adds commit_tid info in ext4_fc_commit_start/stop which is helpful in debugging fast_commit issues. For e.g. issues where due to jbd2 journal full commit, FC miss to commit updates to a file. Also improves TP_prink format string i.e. all ext4 and jbd2 trace events starts with "dev MAjOR,MINOR". Let's follow the same convention while we are still at it. Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/ebcd6b9ab5b718db30f90854497886801ce38c63.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/fast_commit.c | 4 ++-- include/trace/events/ext4.h | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) commit d9bf099cb980d63cd9a45a135259a6cabcb814a5 Author: Ritesh Harjani Date: Sat Mar 12 11:09:53 2022 +0530 ext4: add commit_tid info in jbd debug log This adds commit_tid argument in ext4_fc_update_stats() so that we can add this information too in jbd_debug logs. This is also required in a later patch to pass the commit_tid info in ext4_fc_commit_start/stop() trace events. Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/dabda3f2919a60e01887e798bf5915216b451733.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/fast_commit.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) commit 1d2e2440c5191da82b1191298909283a58f0ece8 Author: Ritesh Harjani Date: Sat Mar 12 11:09:52 2022 +0530 ext4: add transaction tid info in fc_track events This patch adds the transaction & inode tid info in trace events for callers of ext4_fc_track_template(). This is helpful in debugging race conditions where an inode could belong to two different transaction tids. It also fixes the checkpatch warnings which says use tabs instead of spaces. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/c203c09dc11bb372803c430f621f25a4b8c2c8b4.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/fast_commit.c | 10 ++-- include/trace/events/ext4.h | 113 ++++++++++++++++++++++++++------------------ 2 files changed, 73 insertions(+), 50 deletions(-) commit 08f4c42abad1b93914a93f9042e2443593bd3137 Author: Ritesh Harjani Date: Sat Mar 12 11:09:51 2022 +0530 ext4: add new trace event in ext4_fc_cleanup This adds a new trace event in ext4_fc_cleanup() which is helpful in debugging some fast_commit issues. Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/794cdb1d5d3622f3f80d30c222ff6652ea68c375.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/fast_commit.c | 1 + include/trace/events/ext4.h | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) commit 7a74e1e49622698fbf106fdc98da55f9e6634c14 Author: Abel Vesa Date: Tue Mar 15 10:24:46 2022 +0200 clk: imx: Select MXC_CLK for i.MX93 clock driver Most of the i.MX clock generic API is built by selecting MXC_CLK. Without it, the i.MX93 clock driver will fail to build: aarch64-linux-gnu-ld: drivers/clk/imx/clk-imx93.o: in function `imx93_clocks_probe': clk-imx93.c:(.text+0xa8): undefined reference to `imx_obtain_fixed_clk_hw' So fix this by selecting MXC_CLK for the CLK_IMX93. Fixes: 24defbe194b6 ("clk: imx: add i.MX93 clk") Signed-off-by: Abel Vesa Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220315082446.3120850-1-abel.vesa@nxp.com Reviewed-by: Peng Fan Signed-off-by: Stephen Boyd drivers/clk/imx/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 78be0471da4e9fff874307d73d68f0173fa6a154 Author: Ritesh Harjani Date: Sat Mar 12 11:09:50 2022 +0530 ext4: return early for non-eligible fast_commit track events Currently ext4_fc_track_template() checks, whether the trace event path belongs to replay or does sb has ineligible set, if yes it simply returns. This patch pulls those checks before calling ext4_fc_track_template() in the callers of ext4_fc_track_template(). [ Add checks to ext4_rename() which calls the __ext4_fc_track_*() functions directly. -- TYT ] Signed-off-by: Ritesh Harjani Link: https://lore.kernel.org/r/3cd025d9c490218a92e6d8fb30b6123e693373e3.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/fast_commit.c | 59 ++++++++++++++++++++++++++++++++++++++++++--------- fs/ext4/namei.c | 15 +++++++++---- 2 files changed, 60 insertions(+), 14 deletions(-) commit cf5019816d87cdef7f81beea0c008bacae1c0aaa Merge: 3b53f5535d30 763c8bed8c05 Author: Paolo Bonzini Date: Tue Mar 15 17:20:25 2022 -0400 Merge tag 'kvm-riscv-5.18-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv changes for 5.18 - Prevent KVM_COMPAT from being selected - Refine __kvm_riscv_switch_to() implementation - RISC-V SBI v0.3 support commit 3b53f5535d30ed8667f84042bff35163d0fa5483 Merge: 4a204f789587 3bcc372c9865 Author: Paolo Bonzini Date: Tue Mar 15 17:19:02 2022 -0400 Merge tag 'kvm-s390-next-5.18-2' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Fix, test and feature for 5.18 part 2 - memop selftest - fix SCK locking - adapter interruptions virtualization for secure guests commit 579cdf58b7e50fa0650324667d240ecf45c7d12f Author: Tony Lindgren Date: Thu Feb 3 10:56:18 2022 +0200 clk: ti: Drop legacy compatibility clocks for dra7 We no longer have users for the compatibility clocks and we can drop them. These are old duplicate clocks for what we using. Depends-on: 31aa7056bbec ("ARM: dts: Don't use legacy clock defines for dra7 clkctrl") Depends-on: 9206a3af4fc0 ("clk: ti: Move dra7 clock devices out of the legacy section") Cc: devicetree@vger.kernel.org Cc: Rob Herring Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220203085618.16043-4-tony@atomide.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd drivers/clk/ti/Makefile | 3 +- drivers/clk/ti/clk-7xx-compat.c | 820 --------------------------------------- drivers/clk/ti/clk-7xx.c | 5 +- drivers/clk/ti/clkctrl.c | 9 +- include/dt-bindings/clock/dra7.h | 168 -------- 5 files changed, 5 insertions(+), 1000 deletions(-) commit e65eb2efc6175392f0e97f515e6e5b179e181cd8 Author: Tony Lindgren Date: Thu Feb 3 10:56:17 2022 +0200 clk: ti: Drop legacy compatibility clocks for am4 We no longer have users for the compatibility clocks and we can drop them. These are old duplicate clocks for what we using. Cc: devicetree@vger.kernel.org Cc: Rob Herring Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220203085618.16043-3-tony@atomide.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd drivers/clk/ti/Makefile | 3 +- drivers/clk/ti/clk-43xx-compat.c | 225 --------------------------------------- drivers/clk/ti/clk-43xx.c | 5 +- drivers/clk/ti/clkctrl.c | 16 +-- drivers/clk/ti/clock.h | 3 - include/dt-bindings/clock/am4.h | 98 ----------------- 6 files changed, 6 insertions(+), 344 deletions(-) commit 8850c3eae2c7a68ed901432a456ea70bbfef65a4 Author: Tony Lindgren Date: Thu Feb 3 10:56:16 2022 +0200 clk: ti: Drop legacy compatibility clocks for am3 We no longer have users for the compatibility clocks and we can drop them. These are old duplicate clocks for what we using. Cc: devicetree@vger.kernel.org Cc: Rob Herring Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220203085618.16043-2-tony@atomide.com Acked-by: Rob Herring Signed-off-by: Stephen Boyd drivers/clk/ti/Makefile | 3 +- drivers/clk/ti/clk-33xx-compat.c | 218 --------------------------------------- drivers/clk/ti/clk-33xx.c | 5 +- drivers/clk/ti/clkctrl.c | 8 +- include/dt-bindings/clock/am3.h | 93 ----------------- 5 files changed, 4 insertions(+), 323 deletions(-) commit 99105cc81885e1278c927cdff15a3fdef5c29289 Merge: ed06099c5d0b 754e0b0e3560 Author: Stephen Boyd Date: Tue Mar 15 14:06:06 2022 -0700 Merge tag 'v5.17-rc4' into clk-ti We want to get commit 31aa7056bbec ("ARM: dts: Don't use legacy clock defines for dra7 clkctrl") so merge in the nearest rc. commit 79d45f57a19537a1ec6ebf836944e968b154f86e Author: Lukas Bulwahn Date: Mon Mar 14 16:03:21 2022 +0100 sr: simplify the local variable initialization in sr_block_open() Commit 01d0c698536f ("sr: implement ->free_disk to simplify refcounting") refactored sr_block_open(), initialized one variable with a duplicate assignment (probably an unintended copy & paste duplication) and turned one error case into an early return, which makes the initialization of the return variable needless. So, simplify the local variable initialization in sr_block_open() to make the code a bit more clear. No functional change. No change in resulting object code. Signed-off-by: Lukas Bulwahn Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220314150321.17720-1-lukas.bulwahn@gmail.com Signed-off-by: Jens Axboe drivers/scsi/sr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5a57ee83d9612342552f63b7a7f4f4bd2e885832 Author: Jacob Keller Date: Tue Feb 22 16:27:12 2022 -0800 ice: remove PF pointer from ice_check_vf_init The ice_check_vf_init function takes both a PF and a VF pointer. Every caller looks up the PF pointer from the VF structure. Some callers only use of the PF pointer is call this function. Move the lookup inside ice_check_vf_init and drop the unnecessary argument. Cleanup the callers to drop the now unnecessary local variables. In particular, replace the local PF pointer with a HW structure pointer in ice_vc_get_vf_res_msg which simplifies a few accesses to the HW structure in that function. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_vf_lib.c | 16 +++++++--------- drivers/net/ethernet/intel/ice/ice_vf_lib_private.h | 2 +- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 12 ++++++------ 3 files changed, 14 insertions(+), 16 deletions(-) commit bf93bf791cec8aee0c3b9811097813726c1c01be Author: Jacob Keller Date: Tue Feb 22 16:27:11 2022 -0800 ice: introduce ice_virtchnl.c and ice_virtchnl.h Just as we moved the generic virtualization library logic into ice_vf_lib.c, move the virtchnl message handling into ice_virtchnl.c Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/Makefile | 1 + drivers/net/ethernet/intel/ice/ice_sriov.c | 3851 +------------------------ drivers/net/ethernet/intel/ice/ice_sriov.h | 55 +- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 3785 ++++++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_virtchnl.h | 82 + 5 files changed, 3909 insertions(+), 3865 deletions(-) commit 8cf52bec5ca0231133fdc3c6ee2f8d8ec4da9517 Author: Jacob Keller Date: Tue Feb 22 16:27:10 2022 -0800 ice: cleanup long lines in ice_sriov.c Before we move the virtchnl message handling from ice_sriov.c into ice_virtchnl.c, cleanup some long line warnings to avoid checkpatch.pl complaints. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 39 +++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 12 deletions(-) commit f5f085c01d26d487673f508bce5bf8b7394ad059 Author: Jacob Keller Date: Tue Feb 22 16:27:09 2022 -0800 ice: introduce ICE_VF_RESET_LOCK flag The ice_reset_vf function performs actions which must be taken only while holding the VF configuration lock. Some flows already acquired the lock, while other flows must acquire it just for the reset function. Add the ICE_VF_RESET_LOCK flag to the function so that it can handle taking and releasing the lock instead at the appropriate scope. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_main.c | 4 +--- drivers/net/ethernet/intel/ice/ice_sriov.c | 12 +++--------- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 18 ++++++++++++++---- drivers/net/ethernet/intel/ice/ice_vf_lib.h | 1 + 4 files changed, 19 insertions(+), 16 deletions(-) commit 9dbb33da123650dacb6e63889c7decf38e76149a Author: Jacob Keller Date: Tue Feb 22 16:27:08 2022 -0800 ice: introduce ICE_VF_RESET_NOTIFY flag In some cases of resetting a VF, the PF would like to first notify the VF that a reset is impending. This is currently done via ice_vc_notify_vf_reset. A wrapper to ice_reset_vf, ice_vf_reset_vf, is used to call this function first before calling ice_reset_vf. In fact, every single call to ice_vc_notify_vf_reset occurs just prior to a call to ice_vc_reset_vf. Now that ice_reset_vf has flags, replace this separate call with an ICE_VF_RESET_NOTIFY flag. This removes an unnecessary exported function of ice_vc_notify_vf_reset, and also makes there be a single function to reset VFs (ice_reset_vf). Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 44 ++++------------------------- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 28 ++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_vf_lib.h | 1 + 3 files changed, 34 insertions(+), 39 deletions(-) commit 7eb517e434c653a4afa16ec3d0a750c2f46b3560 Author: Jacob Keller Date: Tue Feb 22 16:27:07 2022 -0800 ice: convert ice_reset_vf to take flags The ice_reset_vf function takes a boolean parameter which indicates whether or not the reset is due to a VFLR event. This is somewhat confusing to read because readers must interpret what "true" and "false" mean when seeing a line of code like "ice_reset_vf(vf, false)". We will want to add another toggle to the ice_reset_vf in a following change. To avoid proliferating many arguments, convert this function to take flags instead. ICE_VF_RESET_VFLR will indicate if this is a VFLR reset. A value of 0 indicates no flags. One could argue that "ice_reset_vf(vf, 0)" is no more readable than "ice_reset_vf(vf, false)".. However, this type of flags interface is somewhat common and using 0 to mean "no flags" makes sense in this context. We could bother to add a define for "ICE_VF_RESET_PLAIN" or something similar, but this can be confusing since its not an actual bit flag. This paves the way to add another flag to the function in a following change. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_main.c | 2 +- drivers/net/ethernet/intel/ice/ice_sriov.c | 6 +++--- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 9 ++++++--- drivers/net/ethernet/intel/ice/ice_vf_lib.h | 9 +++++++-- 4 files changed, 17 insertions(+), 9 deletions(-) commit 4fe193cc9dd09565b61de2bf3dd62924443929dd Author: Jacob Keller Date: Tue Feb 22 16:27:06 2022 -0800 ice: convert ice_reset_vf to standard error codes The ice_reset_vf function returns a boolean value indicating whether or not the VF reset. This is a bit confusing since it means that callers need to know how to interpret the return value when needing to indicate an error. Refactor the function and call sites to report a regular error code. We still report success (i.e. return 0) in cases where the reset is in progress or is disabled. Existing callers don't care because they do not check the return value. We keep the error code anyways instead of a void return because we expect future code which may care about or at least report the error value. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_vf_lib.c | 15 ++++++++------- drivers/net/ethernet/intel/ice/ice_vf_lib.h | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) commit fe99d1c06c16b8a97d844a3554f67f601abeb738 Author: Jacob Keller Date: Tue Feb 22 16:27:05 2022 -0800 ice: make ice_reset_all_vfs void The ice_reset_all_vfs function returns true if any VFs were reset, and false otherwise. However, no callers check the return value. Drop this return value and make the function void since the callers do not care about this. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_vf_lib.c | 8 +++----- drivers/net/ethernet/intel/ice/ice_vf_lib.h | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) commit dac57288751c1377ac0370ceb406a1e97a7d4a54 Author: Jacob Keller Date: Tue Feb 22 16:27:04 2022 -0800 ice: drop is_vflr parameter from ice_reset_all_vfs The ice_reset_all_vfs function takes a parameter to handle whether its operating after a VFLR event or not. This is not necessary as every caller always passes true. Simplify the interface by removing the parameter. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_main.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 5 ++--- drivers/net/ethernet/intel/ice/ice_vf_lib.h | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) commit 16686d7fbbe4442c32c30c19c98b5ca311d7fb36 Author: Jacob Keller Date: Tue Feb 22 16:27:03 2022 -0800 ice: move reset functionality into ice_vf_lib.c Now that the reset functions do not rely on Single Root specific behavior, move the ice_reset_vf, ice_reset_all_vfs, and ice_vf_rebuild_host_cfg functions and their dependent helper functions out of ice_sriov.c and into ice_vf_lib.c Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 475 --------------------- drivers/net/ethernet/intel/ice/ice_sriov.h | 15 - drivers/net/ethernet/intel/ice/ice_vf_lib.c | 475 +++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_vf_lib.h | 12 + .../net/ethernet/intel/ice/ice_vf_lib_private.h | 1 + 5 files changed, 488 insertions(+), 490 deletions(-) commit 5de95744ff6a0ef3939636ef7e26b34d466bc86d Author: Jacob Keller Date: Tue Feb 22 16:27:02 2022 -0800 ice: fix a long line warning in ice_reset_vf We're about to move ice_reset_vf out of ice_sriov.c and into ice_vf_lib.c One of the dev_err statements has a checkpatch.pl violation due to putting the vf->vf_id on the same line as the dev_err. Fix this style issue first before moving the code. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 9c6f787897f6863b16659fb8807ff5965eb894f2 Author: Jacob Keller Date: Tue Feb 22 16:27:01 2022 -0800 ice: introduce VF operations structure for reset flows The ice driver currently supports virtualization using Single Root IOV, with code in the ice_sriov.c file. In the future, we plan to also implement support for Scalable IOV, which uses slightly different hardware implementations for some functionality. To eventually allow this, we introduce a new ice_vf_ops structure which will contain the basic operations that are different between the two IOV implementations. This primarily includes logic for how to handle the VF reset registers, as well as what to do before and after rebuilding the VF's VSI. Implement these ops structures and call the ops table instead of directly calling the SR-IOV specific function. This will allow us to easily add the Scalable IOV implementation in the future. Additionally, it helps separate the generalized VF logic from SR-IOV specifics. This change allows us to move the reset logic out of ice_sriov.c and into ice_vf_lib.c without placing any Single Root specific details into the generic file. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 318 ++++++++++++++++------------ drivers/net/ethernet/intel/ice/ice_vf_lib.c | 4 +- drivers/net/ethernet/intel/ice/ice_vf_lib.h | 13 ++ 3 files changed, 196 insertions(+), 139 deletions(-) commit f5840e0da6397586f3dbfaf15227588d1218dfe3 Author: Jacob Keller Date: Tue Feb 22 16:27:00 2022 -0800 ice: fix incorrect dev_dbg print mistaking 'i' for vf->vf_id If we fail to clear the malicious VF indication after a VF reset, the dev_dbg message which is printed uses the local variable 'i' when it meant to use vf->vf_id. Fix this. Fixes: 0891c89674e8 ("ice: warn about potentially malicious VFs") Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 109aba47ca9b9d6206a187a4b2ab4d2616c683d2 Author: Jacob Keller Date: Tue Feb 22 16:26:59 2022 -0800 ice: introduce ice_vf_lib.c, ice_vf_lib.h, and ice_vf_lib_private.h Introduce the ice_vf_lib.c file along with the ice_vf_lib.h and ice_vf_lib_private.h header files. These files will house the generic VF structures and access functions. Move struct ice_vf and its dependent definitions into this new header file. The ice_vf_lib.c is compiled conditionally on CONFIG_PCI_IOV. Some of its functionality is required by all driver files. However, some of its functionality will only be required by other files also conditionally compiled based on CONFIG_PCI_IOV. Declaring these functions used only in CONFIG_PCI_IOV files in ice_vf_lib.h is verbose. This is because we must provide a fallback implementation for each function in this header since it is included in files which may not be compiled with CONFIG_PCI_IOV. Instead, introduce a new ice_vf_lib_private.h header which verifies that CONFIG_PCI_IOV is enabled. This header is intended to be directly included in .c files which are CONFIG_PCI_IOV only. Add a #error indication that will complain if the file ever gets included by another C file on a kernel with CONFIG_PCI_IOV disabled. Add a comment indicating the nature of the file and why it is useful. This makes it so that we can easily define functions exposed from ice_vf_lib.c into other virtualization files without needing to add fallback implementations for every single function. This begins the path to separate out generic code which will be reused by other virtualization implementations from ice_sriov.h and ice_sriov.c Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/Makefile | 3 +- drivers/net/ethernet/intel/ice/ice_sriov.c | 509 +------------------- drivers/net/ethernet/intel/ice/ice_sriov.h | 203 +------- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 519 +++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_vf_lib.h | 259 ++++++++++ .../net/ethernet/intel/ice/ice_vf_lib_private.h | 39 ++ drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 1 + drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.h | 1 + 8 files changed, 823 insertions(+), 711 deletions(-) commit 234af44f336fa729bd88d6afef6ee60a155c4c43 Merge: e783362eb54c 6e87c8f07407 Author: Stephen Boyd Date: Tue Mar 15 13:15:40 2022 -0700 Merge tag 'qcom-clk-for-5.18' 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 support for A7 PLL on SDX65, GPU clock controller for SM6350, display clock controller for SM6125, SM6350 and QCS2290 and multimedia clock controller for MSM8226. The RPMCC drivers get support for SC8280XP and MSM8992, MSM8994 and MSM8998 gains some missing clocks. A new gcc DeviceTree binding is introduced, to allow platform-specific GCC bindings to inherit common properties. The SDM845 camera clock controller binding is converted to YAML. SDM845 camera clock controller, SDM660 GPU clock controller, IPQ8074 global clock controller, IPQ806x global clock controller, SC7180 camera and video clock controllers, MSM8996 globacl clock controller are converted to parent_data and/or parent_hws and cleanups related to this. Test clocks are removed from the SC7180, SDM845 camera clock controller drivers and SDM660 GPU clock controller driver. IPQ806x gains clocks and resets for CryptoEngine and additional frequencies for SDCC and NSS cores. Floor ops are introduced for RCG clocks and used for IPQ8074 SDCC clocks. SM8150 gains EMAC, PCIe and UFS GDSCs. The RCG2 logic for calculating D value is updated to support pixel clock frequencies on newer platforms. * tag 'qcom-clk-for-5.18' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (59 commits) clk: qcom: Add display clock controller driver for SM6125 dt-bindings: clock: add QCOM SM6125 display clock bindings clk: qcom: Fix sorting of SDX_GCC_65 in Makefile and Kconfig clk: qcom: gcc: Add emac GDSC support for SM8150 clk: qcom: gcc: sm8150: Fix some identation issues clk: qcom: gcc: Add UFS_CARD and UFS_PHY GDSCs for SM8150 clk: qcom: gcc: Add PCIe0 and PCIe1 GDSC for SM8150 clk: qcom: clk-rcg2: Update the frac table for pixel clock clk: qcom: clk-rcg2: Update logic to calculate D value for RCG clk: qcom: smd: Add missing MSM8998 RPM clocks clk: qcom: smd: Add missing RPM clocks for msm8992/4 dt-bindings: clock: qcom: rpmcc: Add RPM Modem SubSystem (MSS) clocks clk: qcom: gcc-ipq806x: add CryptoEngine resets dt-bindings: reset: add ipq8064 ce5 resets clk: qcom: gcc-ipq806x: add CryptoEngine clocks dt-bindings: clock: add ipq8064 ce5 clk define clk: qcom: gcc-ipq806x: add additional freq for sdc table clk: qcom: clk-rcg: add clk_rcg_floor_ops ops clk: qcom: gcc-ipq806x: add unusued flag for critical clock clk: qcom: gcc-ipq806x: add additional freq nss cores ... commit 51cad2872435f79c63b81503d8d1c9f143172489 Author: Mustafa Ismail Date: Mon Feb 28 12:36:50 2022 -0600 RDMA/irdma: Add support for address handle re-use Address handles (AH) are a limited HW resource and some user applications may create large numbers of identical AH's. Avoid running out of AH's by reusing existing identical ones. Link: https://lore.kernel.org/r/20220228183650.290-1-shiraz.saleem@intel.com Signed-off-by: Mustafa Ismail Signed-off-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/irdma/main.c | 2 +- drivers/infiniband/hw/irdma/main.h | 2 + drivers/infiniband/hw/irdma/verbs.c | 217 ++++++++++++++++++++++++++---------- drivers/infiniband/hw/irdma/verbs.h | 3 + 4 files changed, 164 insertions(+), 60 deletions(-) commit c84d86a0295c24487db5b7db1a61d9c0eddfbb66 Merge: abe2fec8ee66 1261691dda6b Author: Jakub Kicinski Date: Tue Mar 15 12:11:02 2022 -0700 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-03-14 Jacob Keller says: The ice_virtchnl_pf.c file has become a single place for a lot of virtualization functionality. This includes most of the virtchnl message handling, integration with kernel hooks like the .ndo operations, reset logic, and more. We are planning in the future to implement and support Scalable IOV in the ice driver. To do this, much (but not all) of the code in ice_virtchnl_pf.c will want to be reused. Rather than dump all of the Scalable IOV implementation into ice_virtchnl_pf.c it makes sense to house it in a separate file. But that still leaves all of the Single Root IOV code littered among more generic logic. The long term goal is to re-organize the code such that generic re-usable code is split into separate files. The ice_sriov.c file would end up containing all of the Single Root IOV implementation specific details, while ice_vf_lib.[ch] and ice_virtchnl.[ch] contain the generic pieces. As a first step, notice that ice_sriov.c currently does not contain much of the SR-IOV implementation. This is housed primarily in ice_virtchnl_pf.c The code in ice_sriov.c is really generic and relates to the VF mailbox, including mailbox overflow detection. Rename ice_sriov.c to ice_vf_mbx.c, and then rename ice_virtchnl_pf.c to ice_sriov.c A later series will finish the refactor by splitting ice_sriov.c into multiple files, moving the generic code into ice_vf_lib.c and ice_virtchnl.c To prepare for that series, perform some basic cleanup and other refactors that we've accumulated during this development cycle. This series builds on top of the recent hash table refactor work. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: use ice_is_vf_trusted helper function ice: log an error message when eswitch fails to configure ice: cleanup error logging for ice_ena_vfs ice: move ice_set_vf_port_vlan near other .ndo ops ice: refactor spoofchk control code in ice_sriov.c ice: rename ICE_MAX_VF_COUNT to avoid confusion ice: remove unused definitions from ice_sriov.h ice: convert vf->vc_ops to a const pointer ice: remove circular header dependencies on ice.h ice: rename ice_virtchnl_pf.c to ice_sriov.c ice: rename ice_sriov.c to ice_vf_mbx.c ==================== Link: https://lore.kernel.org/r/20220315011155.2166817-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 426c89aa203bcec9d9cf6eea36735eafa1b1f099 Author: Ville Syrjälä Date: Fri Feb 18 12:03:45 2022 +0200 drm/amdgpu: Use drm_mode_copy() struct drm_display_mode embeds a list head, so overwriting the full struct with another one will corrupt the list (if the destination mode is on a list). Use drm_mode_copy() instead which explicitly preserves the list head of the destination mode. Even if we know the destination mode is not on any list using drm_mode_copy() seems decent as it sets a good example. Bad examples of not using it might eventually get copied into code where preserving the list head actually matters. Obviously one case not covered here is when the mode itself is embedded in a larger structure and the whole structure is copied. But if we are careful when copying into modes embedded in structures I think we can be a little more reassured that bogus list heads haven't been propagated in. @is_mode_copy@ @@ drm_mode_copy(...) { ... } @depends on !is_mode_copy@ struct drm_display_mode *mode; expression E, S; @@ ( - *mode = E + drm_mode_copy(mode, &E) | - memcpy(mode, E, S) + drm_mode_copy(mode, E) ) @depends on !is_mode_copy@ struct drm_display_mode mode; expression E; @@ ( - mode = E + drm_mode_copy(&mode, &E) | - memcpy(&mode, E, S) + drm_mode_copy(&mode, E) ) @@ struct drm_display_mode *mode; @@ - &*mode + mode Cc: Alex Deucher Cc: Harry Wentland Cc: Leo Li Cc: Rodrigo Siqueira Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Harry Wentland Signed-off-by: Ville Syrjälä Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 4 ++-- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) commit 606d5877592b0a6f945a68399c870ba9d2a9ff7f Author: Ville Syrjälä Date: Fri Feb 18 12:03:46 2022 +0200 drm/radeon: Use drm_mode_copy() struct drm_display_mode embeds a list head, so overwriting the full struct with another one will corrupt the list (if the destination mode is on a list). Use drm_mode_copy() instead which explicitly preserves the list head of the destination mode. Even if we know the destination mode is not on any list using drm_mode_copy() seems decent as it sets a good example. Bad examples of not using it might eventually get copied into code where preserving the list head actually matters. Obviously one case not covered here is when the mode itself is embedded in a larger structure and the whole structure is copied. But if we are careful when copying into modes embedded in structures I think we can be a little more reassured that bogus list heads haven't been propagated in. @is_mode_copy@ @@ drm_mode_copy(...) { ... } @depends on !is_mode_copy@ struct drm_display_mode *mode; expression E, S; @@ ( - *mode = E + drm_mode_copy(mode, &E) | - memcpy(mode, E, S) + drm_mode_copy(mode, E) ) @depends on !is_mode_copy@ struct drm_display_mode mode; expression E; @@ ( - mode = E + drm_mode_copy(&mode, &E) | - memcpy(&mode, E, S) + drm_mode_copy(&mode, E) ) @@ struct drm_display_mode *mode; @@ - &*mode + mode Cc: Alex Deucher Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Ville Syrjälä Signed-off-by: Alex Deucher drivers/gpu/drm/radeon/radeon_connectors.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 07d01469325c87aef4ab02ad4ec31d73321665ee Author: Paul Menzel Date: Tue Mar 15 10:29:36 2022 +0100 drm/amdgpu: Use ternary operator in `vcn_v1_0_start()` Remove the boilerplate of declaring a variable and using an if else statement by using the ternary operator. Reviewed-by: James Zhu Signed-off-by: Paul Menzel Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) commit 1cbd78879b5f889355b2a6343ea5db7e633438b0 Author: Ville Syrjälä Date: Fri Feb 18 12:03:43 2022 +0200 drm/amdgpu: Remove pointless on stack mode copies These on stack copies of the modes appear to be pointless. Just look at the originals directly. Cc: Harry Wentland Cc: Leo Li Cc: Rodrigo Siqueira Cc: Alex Deucher Cc: amd-gfx@lists.freedesktop.org Cc: Nikola Cornij Cc: Aurabindo Pillai Reviewed-by: Harry Wentland Signed-off-by: Ville Syrjälä Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) commit 508a47d434bffde45ca3cdb8ece186f28f9d84bf Author: Dan Carpenter Date: Mon Mar 14 17:04:05 2022 +0300 drm/amd/pm: fix indenting in __smu_cmn_reg_print_error() Smatch complains that the dev_err_ratelimited() is indented one tab more than the surrounding lines. drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:174 __smu_cmn_reg_print_error() warn: inconsistent indenting It looks like it's not a bug, just that the indenting needs to be cleaned up. Reviewed-by: Luben Tuikov Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 28b7382621f0a83f1db795f36ee0fee6f66c10e9 Author: Julia Lawall Date: Mon Mar 14 12:53:47 2022 +0100 drm/amdgpu/dc: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/bios/command_table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 58398727e6f4955f2781e93517b8f0a3e8f22e75 Author: Julia Lawall Date: Mon Mar 14 12:53:53 2022 +0100 drm/amdgpu: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit bd4b9bb77956639e6d9618ed306cb2264c69ba49 Author: Julia Lawall Date: Mon Mar 14 12:53:25 2022 +0100 drm/amd/pm: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Alex Deucher drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit faad5ccac1eaae584f9ac2ea66278bd137edcbe3 Author: Yongqiang Sun Date: Tue Mar 15 09:43:41 2022 -0400 drm/amdgpu: Add stolen reserved memory for MI25 SRIOV. MI25 SRIOV guest driver loading failed due to allocated memory overlaps with firmware reserved area. Allocate stolen reserved memory for MI25 SRIOV specifically to avoid the memory overlap. Reviewed-by: Alex Deucher Signed-off-by: Yongqiang Sun Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 3f543552846b9ae47c8442af1c506207bdcc00d2 Author: Yongqiang Sun Date: Mon Mar 14 14:17:08 2022 -0400 drm/amdgpu: Merge get_reserved_allocation to get_vbios_allocations. Some ASICs need reserved memory for firmware or other components, which is not allowed to be used by driver. amdgpu_gmc_get_reserved_allocation is to handle additional areas. To avoid any missing calling, merged amdgpu_gmc_get_reserved_allocation to amdgpu_gmc_get_vbios_allocations. Acked-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Yongqiang Sun Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 32 +++++++++++++------------------- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 - drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 1 - 3 files changed, 13 insertions(+), 21 deletions(-) commit 9527b9caf82b040e794fba2667f6d8a85a793bb7 Author: Philip Yang Date: Fri Mar 11 15:22:15 2022 -0500 drm/amdkfd: evict svm bo worker handle error Migrate vram to ram may fail to find the vma if process is exiting and vma is removed, evict svm bo worker sets prange->svm_bo to NULL and warn svm_bo ref count != 1 only if migrating vram to ram successfully. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 29 +++++++++++++++++++++++------ drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 21 +++++++++++++-------- 2 files changed, 36 insertions(+), 14 deletions(-) commit 4e2f50e2306fdd0e5fc7db3d9a452ba1327b787e Author: Tianci Yin Date: Tue Mar 15 09:58:09 2022 +0800 drm/amdgpu/vcn: fix vcn ring test failure in igt reload test [why] On Renoir, vcn ring test failed on the second time insmod in the reload test. After investigation, it proves that vcn only can disable dpg under dpg unpause mode (dpg unpause mode is default for dec only, dpg pause mode is for dec/enc). [how] unpause dpg in dpg stopping procedure. Reviewed-by: James Zhu Signed-off-by: Tianci Yin Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 ++ 1 file changed, 2 insertions(+) commit abe2fec8ee66017aa32abc47c52266da6fbe1d9a Merge: 72f56fdb97b2 334ff12284fc Author: Jakub Kicinski Date: Tue Mar 15 11:52:25 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next Pablo Neira Ayuso says: ==================== Netfilter updates for net-next 1) Revert CHECKSUM_UNNECESSARY for UDP packet from conntrack. 2) Reject unsupported families when creating tables, from Phil Sutter. 3) GRE support for the flowtable, from Toshiaki Makita. 4) Add GRE offload support for act_ct, also from Toshiaki. 5) Update mlx5 driver to support for GRE flowtable offload, from Toshiaki Makita. 6) Oneliner to clean up incorrect indentation in nf_conntrack_bridge, from Jiapeng Chong. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf-next: netfilter: bridge: clean up some inconsistent indenting net/mlx5: Support GRE conntrack offload act_ct: Support GRE offload netfilter: flowtable: Support GRE netfilter: nf_tables: Reject tables of unsupported family Revert "netfilter: conntrack: mark UDP zero checksum as CHECKSUM_UNNECESSARY" ==================== Link: https://lore.kernel.org/r/20220315091513.66544-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 72f56fdb97b26bc9a1ce297a636b91c19593eb19 Author: Vladimir Oltean Date: Tue Mar 15 15:12:15 2022 +0200 net: mscc: ocelot: fix build error due to missing IEEE_8021QAZ_MAX_TCS IEEE_8021QAZ_MAX_TCS is defined in include/uapi/linux/dcbnl.h, which is included by net/dcbnl.h. Then, linux/netdevice.h conditionally includes net/dcbnl.h if CONFIG_DCB is enabled. Therefore, when CONFIG_DCB is disabled, this indirect dependency is broken. There isn't a good reason to include net/dcbnl.h headers into the ocelot switch library which exports low-level hardware API, so replace IEEE_8021QAZ_MAX_TCS with OCELOT_NUM_TC which has the same value. Fixes: 978777d0fb06 ("net: dsa: felix: configure default-prio and dscp priorities") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220315131215.273450-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/mscc/ocelot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 8c0f11ff3895ec96c9523ac607dd51f812ab69a8 Author: Lang Yu Date: Tue Mar 15 13:17:55 2022 +0800 drm/amdgpu: only allow secure submission on rings which support that Only GFX ring, SDMA ring and VCN decode ring support secure submission at the moment. Suggested-by: Christian König Signed-off-by: Lang Yu Reviewed-by: Christian König Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 1 + drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 1 + drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 1 + drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 1 + drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 1 + drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 ++ drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 ++ 13 files changed, 19 insertions(+), 2 deletions(-) commit 8476269f758221863c01a0a6cccb0d75ec5d60c3 Author: yipechai Date: Fri Mar 11 16:54:20 2022 +0800 drm/amdgpu: fixed the warnings reported by kernel test robot The reported warnings are as follows: 1.warning:no-previous-prototype-for-amdgpu_hdp_ras_fini. 2.warning:no-previous-prototype-for-amdgpu_mmhub_ras_fini. Amdgpu_hdp_ras_fini and amdgpu_mmhub_ras_fini are unused in the code, they are the only functions in amdgpu_hdp.c and amdgpu_mmhub.c. After removing these two functions, both amdgpu_hdp.c and amdgpu_mmhub.c are empty, so these two files can be deleted to fix the warning. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/Makefile | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c | 30 ------------------------------ drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 30 ------------------------------ 3 files changed, 2 insertions(+), 62 deletions(-) commit fdf0ece6309d90dc0f9388001239cb2d12671af3 Author: Aric Cyr Date: Thu Mar 10 17:20:45 2022 -0500 drm/amd/display: 3.2.177 This version brings along following fixes: - Added I2C escape to support query exist - Functionality to get pipe from stream context - debugfs entry fixes - Block zstate when more than one plane enabled - Update to engine ddc - Reading lante status during LT fixes - Null point filters - [FW Promotion] Release 0.0.108.0 Acked-by: Agustin Gutierrez Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cfe7c679412f14811cb3c4119c8025cb97564c48 Author: Anthony Koo Date: Thu Mar 10 17:20:44 2022 -0500 drm/amd/display: [FW Promotion] Release 0.0.108.0 Reviewed-by: Aric Cyr Acked-by: Agustin Gutierrez Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a91b402d50072e4801b231925f33574f90e562ce Author: Charlene Liu Date: Thu Mar 10 17:20:43 2022 -0500 drm/amd/display: Add save/restore PANEL_PWRSEQ_REF_DIV2 [why] DCN31 has this in zstate save/restore sequence. need for non_zstate supported ASIC [how] add this PANEL_PWRSEQ_REF_DIV2 to existing panel_cntl_hw_init structure. Reviewed-by: Nicholas Kazlauskas Acked-by: Agustin Gutierrez Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher .../drm/amd/display/dc/dcn31/dcn31_panel_cntl.c | 5 +- drivers/gpu/drm/amd/display/dc/inc/hw/panel_cntl.h | 1 + drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 88 +++++++++++++++++++++- 3 files changed, 91 insertions(+), 3 deletions(-) commit dd15640bcee5a5fa74fc52557dd6220f48b01116 Author: Becle Lee Date: Thu Mar 10 17:20:42 2022 -0500 drm/amd/display: Wait for hubp read line for Pollock [Why] Underflow occurred while hubp ret pipe read is idle and the second pipe is powered up and added. Flickering and underflow are only observed on Pollock. [How] Check the hubp ret pipe read prior to unlock pipes. Reviewed-by: Hersen Wu Reviewed-by: Aric Cyr Acked-by: Agustin Gutierrez Signed-off-by: Becle Lee Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 15 +++++++++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 4 ++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 15 +++++++++++++++ drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 10 ++++++++++ drivers/gpu/drm/amd/display/dc/inc/hw/hubp.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h | 1 + 6 files changed, 46 insertions(+) commit 2716bc822e2325efed0731d6a6a7dff755dc34d7 Author: Jing Zhou Date: Thu Mar 10 17:20:41 2022 -0500 drm/amd/display: Add null pointer filter [Why & How] Add null pointer filter for logical integrity. Reviewed-by: Charlene Liu Acked-by: Agustin Gutierrez Signed-off-by: Jing Zhou Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 3a0625813bacf12bf188f8242b42b508af28baa0 Author: Wayne Lin Date: Thu Mar 10 17:20:40 2022 -0500 drm/amd/display: Retry when fail reading lane status during LT [Why] In dp_get_lane_status_and_lane_adjust(), we call core_link_read_dpcd() to get lane status but we ignore the return value of the function. If there is problem with AUX and we eventually can only get partial data from monitor, we might misuse the data to jude the link training result. Which could have us trapped in the dc_link_dp_perform_link_training() since we thought that we can still give a try on another link setting. [How] In dp_get_lane_status_and_lane_adjust(), take return value of core_link_read_dpcd() into account. If we fail to read all requested data, we treat lanes status as previous one and repeat LT steps again. Reviewed-by: Wenjing Liu Acked-by: Agustin Gutierrez Signed-off-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 30 +++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) commit 906fbba2c9d48678fd182d0de4dd193d9dd0cc9c Author: Dale Zhao Date: Thu Mar 10 17:20:39 2022 -0500 drm/amd/display: Add new enum for EDID status [Why] We must support a new type of partial edid return in the future [How] Add interface and case hander for partial edid Reviewed-by: Charlene Liu Acked-by: Agustin Gutierrez Signed-off-by: Dale Zhao Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +++ drivers/gpu/drm/amd/display/dc/dc_types.h | 1 + 2 files changed, 4 insertions(+) commit c791d75a64f5c628a9c9a7d9b9ec01ef0357e6a3 Author: Eric Yang Date: Thu Mar 10 17:20:38 2022 -0500 drm/amd/display: Block zstate when more than one plane enabled [Why] Currently Z10 save/restore only covers 1 plane case. If we enter Z10 with 2 planes enabled, 1 of the 2 planes will not be restored. causing black screen. [How] Disable Zstate when more than 1 plane is enabled. Right now Z9 enable but Z10 disable is not a supported config, so we disable both. Reviewed-by: Nicholas Kazlauskas Reviewed-by: Nevenko Stupar Acked-by: Agustin Gutierrez Signed-off-by: Eric Yang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) commit d853419f5fcce39553ce0f6837fa122f113b15b6 Author: Jing Zhou Date: Thu Mar 10 17:20:37 2022 -0500 drm/amd/display: Update engine ddc [Why] Crash caused by a ddc update failure [How] Update engine ddc before release engine. Reviewed-by: Wyatt Wood Reviewed-by: Aric Cyr Acked-by: Agustin Gutierrez Signed-off-by: Jing Zhou Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 1 + 1 file changed, 1 insertion(+) commit a18112ae72d693bd4eb79f2ec09b536eeacb902b Author: Wayne Lin Date: Thu Mar 10 17:20:36 2022 -0500 drm/amd/display: Fix a few parts in debugfs entry [Why & How] 1. To leverage and simplify the igt tool. Change the value of retrain when calling preferred training settings. Now, writing value to link settings triggers link training immediately. 2. Add dc lock when triggering link training in edp_ilr_write() Reviewed-by: Rodrigo Siqueira Acked-by: Agustin Gutierrez Signed-off-by: Wayne Lin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit 10499e4055949e4682d2e7c428365175e99e0800 Author: Leo (Hanghong) Ma Date: Thu Mar 10 17:20:35 2022 -0500 drm/amd/display: Add function to get the pipe from the stream context [Why] We need a helper function in dc to grab the pipe from the stream context. [How] Add it. Reviewed-by: Martin Leung Acked-by: Agustin Gutierrez Signed-off-by: Leo (Hanghong) Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 14 ++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 ++ 2 files changed, 16 insertions(+) commit a0248d543bbf2a977e7e6d9966ce8d96f6e5c358 Author: JinZe.Xu Date: Thu Mar 10 17:20:34 2022 -0500 drm/amd/display: Add I2C escape to support query device exist. [How] 1. Search OEM I2C info from BIOS and compare with input parameter. 2. If BIOS doesn't record it, just try to read one byte. Reviewed-by: Aric Cyr Acked-by: Agustin Gutierrez Signed-off-by: JinZe.Xu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc.c | 13 +++++++++++++ drivers/gpu/drm/amd/display/dc/dc_link.h | 5 +++++ drivers/gpu/drm/amd/display/dc/dce/dce_i2c.c | 26 ++++++++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dce/dce_i2c.h | 6 ++++++ 4 files changed, 50 insertions(+) commit 436afdfa35dc8aaf43959593f6c433d0ad29abc3 Author: Philip Yang Date: Tue Mar 15 14:38:51 2022 -0400 drm/amdgpu: Move reset domain init before calling RREG32 amdgpu_detect_virtualization reads register, amdgpu_device_rreg access adev->reset_domain->sem if kernel defined CONFIG_LOCKDEP, below is the random boot hang backtrace on Vega10. It may get random NULL pointer access backtrace if amdgpu_sriov_runtime is true too. Move amdgpu_reset_create_reset_domain before calling to RREG32. BUG: kernel NULL pointer dereference, address: #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP NOPTI Workqueue: events work_for_cpu_fn RIP: 0010:down_read_trylock+0x13/0xf0 Call Trace: amdgpu_device_skip_hw_access+0x38/0x80 [amdgpu] amdgpu_device_rreg+0x1b/0x170 [amdgpu] amdgpu_detect_virtualization+0x73/0x100 [amdgpu] amdgpu_device_init.cold.60+0xbe/0x16b1 [amdgpu] ? pci_bus_read_config_word+0x43/0x70 amdgpu_driver_load_kms+0x15/0x120 [amdgpu] amdgpu_pci_probe+0x1a1/0x3a0 [amdgpu] Fixes: d0fb18b535679a ("drm/amdgpu: Move reset sem into reset_domain") Signed-off-by: Philip Yang Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit 75016ca3acd0de79868ef5b0694195fe05288ade Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:40 2022 +0100 rtla: Tools main loop cleanup I probably started using "do {} while();", but changed all but osnoise_top to "while(){};" leaving the ; behind. Cleanup the main loop code, making all tools use "while() {}" Changcheng Deng reported this problem, as reported by coccicheck: Fix the following coccicheck review: ./tools/tracing/rtla/src/timerlat_hist.c: 800: 2-3: Unneeded semicolon ./tools/tracing/rtla/src/osnoise_hist.c: 776: 2-3: Unneeded semicolon ./tools/tracing/rtla/src/timerlat_top.c: 596: 2-3: Unneeded semicolon Link: https://lkml.kernel.org/r/3c1642110aa87c396f5da4a037dabc72dbb9c601.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Reported-by: Changcheng Deng Reported-by: Zeal Robot Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) tools/tracing/rtla/src/osnoise_hist.c | 2 +- tools/tracing/rtla/src/osnoise_top.c | 4 ++-- tools/tracing/rtla/src/timerlat_hist.c | 2 +- tools/tracing/rtla/src/timerlat_top.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) commit 7d0dc9576dc3817c483b408715e506c3e9f37bed Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:39 2022 +0100 rtla/timerlat: Add --dma-latency option Add the --dma-latency to set /dev/cpu_dma_latency to the specified value, this aims to avoid having exit from idle states latencies that could be influencing the analysis. Link: https://lkml.kernel.org/r/72ddb0d913459f13217086dadafad88a7c46dd28.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) .../tools/rtla/common_timerlat_options.rst | 5 ++++ tools/tracing/rtla/src/timerlat_hist.c | 28 ++++++++++++++++-- tools/tracing/rtla/src/timerlat_top.c | 28 ++++++++++++++++-- tools/tracing/rtla/src/utils.c | 33 ++++++++++++++++++++++ tools/tracing/rtla/src/utils.h | 1 + 5 files changed, 91 insertions(+), 4 deletions(-) commit 7d38c35167c58153e8b5bea839616d00e90564b9 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:38 2022 +0100 rtla/osnoise: Fix osnoise hist stop tracing message rtla osnoise hist is printing the following message when hitting stop tracing: printf("rtla timelat hit stop tracing\n"); which is obviosly wrong. s/timerlat/osnoise/ fixing the printf. Link: https://lkml.kernel.org/r/2b8f090556fe37b81d183b74ce271421f131c77b.1646247211.git.bristot@kernel.org Fixes: 829a6c0b5698 ("rtla/osnoise: Add the hist mode") Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) tools/tracing/rtla/src/osnoise_hist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 28d2160cb1a18cca87a51345e7df47499447f5a4 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:37 2022 +0100 rtla: Check for trace off also in the trace instance With the addition of --trigger option, it is also possible to stop the trace from the -t tracing instance using the traceoff trigger. Make rtla tools to check if the trace is stopped also in the trace instance, stopping the execution of the tool. Link: https://lkml.kernel.org/r/59fc7c6f23dddd5c8b7ef1782cf3da51ea2ce0f5.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) tools/tracing/rtla/src/osnoise_hist.c | 4 ++-- tools/tracing/rtla/src/osnoise_top.c | 4 ++-- tools/tracing/rtla/src/timerlat_hist.c | 4 ++-- tools/tracing/rtla/src/timerlat_top.c | 4 ++-- tools/tracing/rtla/src/trace.c | 19 +++++++++++++++++++ tools/tracing/rtla/src/trace.h | 1 + 6 files changed, 28 insertions(+), 8 deletions(-) commit 761916fd02c2525139aca957b8a53fda1d8b3616 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:36 2022 +0100 rtla/trace: Save event histogram output to a file The hist: trigger generates a histogram in the file sys/event/hist. If the hist: trigger is used, automatically save the histogram output of the event sys:event in the sys_event_hist.txt file. Link: https://lkml.kernel.org/r/b5c906af31d4e022ffe87fb0848fac5c089087c8.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) Documentation/tools/rtla/common_options.rst | 10 +++++- tools/tracing/rtla/src/trace.c | 53 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) commit 44f3a37d1d3eb10770c7fec4eb89495d37957a26 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:35 2022 +0100 rtla: Add --filter support Add --filter option. This option enables a trace event filtering of the previous -e sys:event argument. This option is available for all current tools. Link: https://lkml.kernel.org/r/509d70b6348d3e5bcbf1f07ab725ce08d063149a.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) Documentation/tools/rtla/common_options.rst | 4 ++++ tools/tracing/rtla/src/osnoise_hist.c | 20 +++++++++++++++++--- tools/tracing/rtla/src/osnoise_top.c | 18 ++++++++++++++++-- tools/tracing/rtla/src/timerlat_hist.c | 20 +++++++++++++++++--- tools/tracing/rtla/src/timerlat_top.c | 18 ++++++++++++++++-- 5 files changed, 70 insertions(+), 10 deletions(-) commit 5487b6ce267bbafd399f3642062d974832d3eddc Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:34 2022 +0100 rtla/trace: Add trace event filter helpers Add a set of helper functions to allow rtla tools to filter events in the trace instance. Link: https://lkml.kernel.org/r/12623b1684684549d53b90f4bf66fae44584fd14.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) tools/tracing/rtla/src/trace.c | 83 ++++++++++++++++++++++++++++++++++++++++++ tools/tracing/rtla/src/trace.h | 3 ++ 2 files changed, 86 insertions(+) commit 1a754893653f73724d007c2cf95cf6c47d5114c4 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:33 2022 +0100 rtla: Add --trigger support Add --trigger option. This option enables a trace event trigger to the previous -e sys:event argument, allowing some advanced tracing options. For instance, in a system with CPUs 2:23 isolated, it is possible to get a stack trace of thread wakeup targeting those CPUs while running osnoise with the following command line: # osnoise top -c 2-23 -a 50 -e sched:sched_wakeup --trigger="stacktrace if target_cpu >= 2" This option is available for all current tools. Link: https://lkml.kernel.org/r/07d2983d5f71261d4da89dbaf02efcad100ab8ee.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) Documentation/tools/rtla/common_options.rst | 3 +++ tools/tracing/rtla/src/osnoise_hist.c | 19 ++++++++++++++++--- tools/tracing/rtla/src/osnoise_top.c | 17 +++++++++++++++-- tools/tracing/rtla/src/timerlat_hist.c | 19 ++++++++++++++++--- tools/tracing/rtla/src/timerlat_top.c | 17 +++++++++++++++-- 5 files changed, 65 insertions(+), 10 deletions(-) commit 336c92b26cf9aee6c5d5907ef49b90d2665e9d70 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:32 2022 +0100 rtla/trace: Add trace event trigger helpers Add a set of helper functions to allow rtla tools to trigger event actions in the trace instance. Link: https://lkml.kernel.org/r/e0d31abe879a78a5600b64f904d0dfa8f76e4fbb.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) tools/tracing/rtla/src/trace.c | 88 +++++++++++++++++++++++++++++++++++++++++- tools/tracing/rtla/src/trace.h | 4 ++ 2 files changed, 91 insertions(+), 1 deletion(-) commit 51d64c3a181938da8fb56404524e15776e9c6bf8 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:31 2022 +0100 rtla: Add -e/--event support Add -e/--event option. This option enables an event in the trace (-t) session. The argument can be a specific event, e.g., -e sched:sched_switch, or all events of a system group, e.g., -e sched. Multiple -e are allowed. It is only active when -t or -a are set. This option is available for all current tools. Link: https://lkml.kernel.org/r/6a3b753be9b1e811953995f7f21a86918ad13390.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) Documentation/tools/rtla/common_options.rst | 4 ++++ tools/tracing/rtla/src/osnoise_hist.c | 31 ++++++++++++++++++++++++--- tools/tracing/rtla/src/osnoise_top.c | 29 +++++++++++++++++++++++-- tools/tracing/rtla/src/timerlat_hist.c | 33 +++++++++++++++++++++++++---- tools/tracing/rtla/src/timerlat_top.c | 28 ++++++++++++++++++++++-- 5 files changed, 114 insertions(+), 11 deletions(-) commit b5aa0be25c27a7f21d9a28f0e0057915552d3c1b Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:30 2022 +0100 rtla/trace: Add trace events helpers Add a set of helper functions to allow the rtla tools to enable additional tracepoints in the trace instance. Link: https://lkml.kernel.org/r/932398b36c1bbaa22c7810d7a40ca9b8c5595b94.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) tools/tracing/rtla/src/trace.c | 104 +++++++++++++++++++++++++++++++++++++++++ tools/tracing/rtla/src/trace.h | 15 ++++++ 2 files changed, 119 insertions(+) commit 173a3b014827955cefdf972ae673d94b60e31cf8 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:29 2022 +0100 rtla/timerlat: Add the automatic trace option Add the -a/--auto option. This option sets some commonly used options while debugging the system. It aims to help users produce reports in the field, reducing the number of arguments passed to the tool in the first approach to a problem. It is equivalent to setting osnoise/stop_tracing_total_us and print_stack with the argument, and saving the trace to timerlat_trace.txt file if the trace is stopped automatically. Link: https://lkml.kernel.org/r/92438f7ef132c731f538cebdf77850300afe04a5.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) .../tools/rtla/common_timerlat_options.rst | 7 +++++++ tools/tracing/rtla/src/timerlat_hist.c | 24 ++++++++++++++++++---- tools/tracing/rtla/src/timerlat_top.c | 22 +++++++++++++++++--- 3 files changed, 46 insertions(+), 7 deletions(-) commit 2b622edd5eb5a12c1203fdb353c2ce0681672571 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:28 2022 +0100 rtla/osnoise: Add the automatic trace option Add the -a/--auto option. This option sets some commonly used options while debugging the system. It aims to help users produce reports in the field, reducing the number of arguments passed to the tool in the first approach to a problem. It is equivalent to setting osnoise/stop_tracing_us with the argument, setting tracing_thresh to 1 us, and saving the trace to osnoise_trace.txt file if the trace is stopped automatically. Link: https://lkml.kernel.org/r/ef04c961b227eb93a83cd0b54bfca45e1a381b77.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) Documentation/tools/rtla/common_osnoise_options.rst | 5 +++++ tools/tracing/rtla/src/osnoise_hist.c | 19 ++++++++++++++++--- tools/tracing/rtla/src/osnoise_top.c | 19 ++++++++++++++++--- 3 files changed, 37 insertions(+), 6 deletions(-) commit d635316ae92291083ae7a36014e29ed7b306cb04 Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:27 2022 +0100 rtla/osnoise: Add an option to set the threshold Add the -T/--threshold option to set the minimum threshold to be considered a noise to osnoise top and hist commands. Also update the man pages. Link: https://lkml.kernel.org/r/031861200ffdb24a1df4aa72c458706889a20d5d.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) .../tools/rtla/common_osnoise_options.rst | 5 +++++ tools/tracing/rtla/src/osnoise_hist.c | 22 ++++++++++++++++++---- tools/tracing/rtla/src/osnoise_top.c | 20 +++++++++++++++++--- 3 files changed, 40 insertions(+), 7 deletions(-) commit 61c57d578bd7ca2aff3652ed62d95e3f8fc6d16e Author: Daniel Bristot de Oliveira Date: Wed Mar 2 20:01:26 2022 +0100 rtla/osnoise: Add support to adjust the tracing_thresh osnoise uses the tracing_thresh parameter to define the delta between two reads of the time to be considered a noise. Add support to get and set the tracing_thresh from osnoise tools. Link: https://lkml.kernel.org/r/715ad2a53fd40e41bab8c3f1214c1a94e12fb595.1646247211.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: Clark Williams Cc: Juri Lelli Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) tools/tracing/rtla/src/osnoise.c | 83 ++++++++++++++++++++++++++++++++++++++++ tools/tracing/rtla/src/osnoise.h | 8 ++++ 2 files changed, 91 insertions(+) commit 72a98763b473890e6605604bfcaf71fc212b4720 Author: Tianci.Yin Date: Thu Mar 10 21:12:49 2022 +0800 drm/amd: fix gfx hang on renoir in IGT reload test [why] CP hangs in igt reloading test on renoir, more precisely, hangs on the second time insmod. [how] mode2 reset can make it recover, and mode2 reset only effects gfx core, dcn and the screen will not be impacted. Acked-by: Alex Deucher Signed-off-by: Tianci.Yin Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/soc15.c | 4 ++++ 1 file changed, 4 insertions(+) commit 85ac2021fe3ace59cc0afd6edf005abad35625b0 Author: Alex Deucher Date: Tue Jan 25 15:04:54 2022 -0500 drm/amdgpu: only check for _PR3 on dGPUs We don't support runtime pm on APUs. They support more dynamic power savings using clock and powergating. Reviewed-by: Mario Limonciello Tested-by: Mario Limonciello Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit a29d44aea1aef0bc58d4951f2ddbe5b22d9a2e94 Author: Stanley.Yang Date: Thu Mar 10 21:55:09 2022 +0800 drm/amd/pm: use pm mutex to protect ecc info table Signed-off-by: Stanley.Yang Reviewed-by: Evan Quan Signed-off-by: Alex Deucher drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit a03b288650abf2a92d5ecdaa737e3d04a2a77984 Author: Hawking Zhang Date: Thu Mar 10 15:53:04 2022 +0800 drm/amdgpu: drop xmgi23 error query/reset support xgmi_ras is only initialized when host to GPU interface is PCIE. in such case, xgmi23 is disabled and protected by security firmware. Host access will results to security violation Signed-off-by: Hawking Zhang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 22 ---------------------- 1 file changed, 22 deletions(-) commit 6f172ae59a7577dbb73e2a8da18697ba8dc56341 Author: Jonathan Kim Date: Wed Mar 9 16:55:57 2022 -0500 drm/amdgpu: fix aldebaran xgmi topology for vf VFs must also distinguish whether or not the TA supports full duplex or half duplex link records in order to report the correct xGMI topology. Signed-off-by: Jonathan Kim Reviewed-by: Shaoyun Liu Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 0fe382fb82dc6cc6eaba6534d038dc381e2b17b9 Author: Alex Deucher Date: Wed Mar 9 13:55:50 2022 -0500 drm/amdgpu/display: enable scatter/gather display for DCN 3.1.6 Enable scatter/gather display for DCN 3.1.6. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+) commit e7031d8258f1b4d6d50e5e5b5d92ba16f66eb8b4 Author: Nicholas Kazlauskas Date: Fri Dec 17 09:55:54 2021 -0500 drm/amd/display: Add pstate verification and recovery for DCN31 [Why] To debug when p-state is being blocked and avoid PMFW hangs when it does occur. [How] Re-use the DCN10 hardware sequencer by adding a new interface for verifying p-state high on the hubbub. The interface is mostly the same as the DCN10 interface, but the bit definitions have changed for the debug bus. Signed-off-by: Nicholas Kazlauskas Reviewed-by: Eric Yang Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 1 + .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 10 ++-- .../gpu/drm/amd/display/dc/dcn30/dcn30_hubbub.c | 1 + .../gpu/drm/amd/display/dc/dcn301/dcn301_hubbub.c | 1 + .../gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.c | 60 ++++++++++++++++++++++ .../gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h | 2 + 7 files changed, 73 insertions(+), 4 deletions(-) commit 089331d47325d3f55016ed3d1f79ffd2754fb19e Author: Beau Belgrave Date: Tue Mar 8 14:28:07 2022 -0800 user_events: Add trace event call as root for low permission cases Tracefs by default is locked down heavily. System operators can open up some files, such as user_events to a broader set of users. These users do not have access within tracefs beyond just the user_event files. Due to this restriction the trace_add_event_call/remove calls will silently fail since the caller does not have permissions to create directories. To fix this trace_add_event_call/remove calls will be issued with override creds of the global root UID. Creds are reverted immediately afterward. Link: https://lkml.kernel.org/r/20220308222807.2040-1-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events_user.c | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) commit 65722ff6181aa52c3d5b0929004af22a3a63e148 Author: David Yat Sin Date: Tue Mar 8 14:00:50 2022 -0500 drm/amdkfd: CRIU export dmabuf handles for GTT BOs Export dmabuf handles for GTT BOs so that their contents can be accessed using SDMA during checkpoint/restore. v2: Squash in fix from David to set dmabuf handle to invalid for BOs that cannot be accessed using SDMA during checkpoint/restore. Signed-off-by: David Yat Sin Reviewed-by : Rajneesh Bhardwaj Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 18 ++++++++++++++---- include/uapi/linux/kfd_ioctl.h | 5 ++++- 2 files changed, 18 insertions(+), 5 deletions(-) commit b38c074b2b07349097d824e3c6c49b5ac8d98910 Author: David Yat Sin Date: Tue Mar 8 09:35:41 2022 -0500 drm/amdkfd: CRIU Refactor restore BO function Refactor CRIU restore BO to reduce identation. Signed-off-by: David Yat Sin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 271 +++++++++++++++---------------- 1 file changed, 129 insertions(+), 142 deletions(-) commit 67a359d85ec2679cc8e11b16844df960e3b27c24 Author: David Yat Sin Date: Tue Mar 8 09:08:18 2022 -0500 drm/amdkfd: CRIU remove sync and TLB flush on restore When the process is getting restored, the queues are not mapped yet, so there is no VMID assigned for this process and no TLBs to flush. Signed-off-by: David Yat Sin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) commit 2e9fda82c98b1e417b90ff5a2f8b8b96cac06fc5 Author: Tianci.Yin Date: Tue Mar 8 13:45:45 2022 +0800 drm/amd/display: fix dp kvm can't light up [why] The DP KVM failed to light up, since the lttpr_mode is not reset to default value when failed to read LTTPR capabilities, and the variable max_link_rate retains a initial value zero, this cause variable link_rate be assigned to an error value zero, consquently pixel_clock get wrong value zero, and kvm can't light up. [how] Reset lttpr_mode to default value when failed to read LTTPR capabilities, so that the link_rate fallbacks to the minimum rate that supported by link encoder and sink. Reviewed-by: Harry Wentland Signed-off-by: Tianci.Yin Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 1 + 1 file changed, 1 insertion(+) commit 8718ca1dbf497c302df989afaeb82f05f5a3d961 Author: Lijo Lazar Date: Fri Feb 25 09:43:49 2022 +0530 drm/amd/pm: Send message when resp status is 0xFC When PMFW is really busy, it will respond with 0xFC. However, it doesn't change the response register state when it becomes free. Driver should retry and proceed to send message if the response status is 0xFC. Signed-off-by: Lijo Lazar Reviewed-by: Evan Quan Signed-off-by: Alex Deucher drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 2 -- 1 file changed, 2 deletions(-) commit 69691c823531c36c7283ecaa040e99e9c12ece07 Author: Stanley.Yang Date: Thu Mar 3 17:56:33 2022 +0800 drm/amdgpu: message smu to update bad channel info It should notice SMU to update bad channel info when detected uncorrectable error in UMC block Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 7 +++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 25 +++++++++++++++++++++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 5 +++++ 5 files changed, 42 insertions(+), 2 deletions(-) commit d510eccfa51e09f5e65621a2e8d41f58a8dbd3ba Author: Stanley.Yang Date: Thu Mar 3 17:51:24 2022 +0800 drm/amd/pm: add send bad channel info function support message SMU update bad channel info to update HBM bad channel info in OOB table Signed-off-by: Stanley.Yang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/pm/amdgpu_dpm.c | 12 ++++++ drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h | 1 + drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 10 +++++ drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 7 ++++ .../drm/amd/pm/swsmu/inc/pmfw_if/aldebaran_ppsmc.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 +- drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 43 ++++++++++++++++++++++ 7 files changed, 77 insertions(+), 2 deletions(-) commit 6e6faf7a8364c77f4021f44043a5a5cee91f7025 Author: Melissa Wen Date: Mon Feb 28 20:10:47 2022 -0100 drm/amd/display: move FPU code from dcn10 to dml/dcn10 folder FPU operations in dcn10 was already moved to dml folder via calcs code. However, dcn1_0_ip and dcn_1_0_soc with FPU componentd remains on dcn10. Following previous changes to isolate FPU, this patch creates dcn10_fpu files to isolate FPU-specific code and moves those structs to it. Signed-off-by: Melissa Wen Acked-by: Alan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 62 ----------- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.h | 4 + drivers/gpu/drm/amd/display/dc/dml/Makefile | 2 + .../gpu/drm/amd/display/dc/dml/dcn10/dcn10_fpu.c | 123 +++++++++++++++++++++ .../gpu/drm/amd/display/dc/dml/dcn10/dcn10_fpu.h | 30 +++++ 5 files changed, 159 insertions(+), 62 deletions(-) commit 22f87d99832650d9389b0b3d08f3c970afc53f10 Author: Melissa Wen Date: Mon Feb 28 20:10:46 2022 -0100 drm/amd/display: move FPU operations from dcn21 to dml/dcn20 folder dml/dcn20_fpu file centralizes all DCN2x functions that require FPU access. Therefore, this patch moves FPU-related code from dcn21 to dcn20_fpu. These include: - dcn21_populate_dml_pipes_from_context() - dcn21_validate_bandwidth_fp() and related: - dcn21_calculate_wm(), - patch_bounding_box(), - calculate_wm_set_for_vlevel() - renaming update_bw_bounding_box() to dcn21_update_bw_bounding_box(), move to dcn20_fpu with related static function construct_low_pstate_lvl() Also, make dcn21_fast_validate_bw() public in dcn21_resource as it is called by dcn21_validate_bandwidth_fp() now in dcn20_fpu. Reuse dcn20_fpu_adjust_dppclk() in dcn21_fast_validate_bw() as it isolates the same FPU operation. Include dchubbub.h as it is required in dcn21_populate_dml_pipes_from_context() Signed-off-by: Melissa Wen Acked-by: Alan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn21/Makefile | 25 - .../gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 570 +-------------------- .../gpu/drm/amd/display/dc/dcn21/dcn21_resource.h | 11 + .../gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 538 ++++++++++++++++++- .../gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.h | 9 + 5 files changed, 571 insertions(+), 582 deletions(-) commit cf689e869cf0339c387397c7a6805e387594656d Author: Melissa Wen Date: Wed Feb 23 23:27:25 2022 +0000 drm/amd/display: move FPU-related code from dcn20 to dml folder Move parts of dcn20 code that uses FPU to dml folder. It aims to isolate FPU operations as described by series: drm/amd/display: Introduce FPU directory inside DC https://patchwork.freedesktop.org/series/93042/ This patch moves the following functions from dcn20_resource to dml/dcn20_fpu and calls of public functions in dcn20_resource are wrapped by DC_FP_START/END(): - void dcn20_populate_dml_writeback_from_context - static bool is_dtbclk_required() - static enum dcn_zstate_support_state() - void dcn20_calculate_dlg_params() - static void swizzle_to_dml_params() - int dcn20_populate_dml_pipes_from_context() - void dcn20_calculate_wm() - void dcn20_cap_soc_clocks() - void dcn20_update_bounding_box() - void dcn20_patch_bounding_box() - bool dcn20_validate_bandwidth_fp() This movement also affects dcn21/30/31, as dcn20_calculate_dlg_params() is used by them. For this reason, I included dcn20_fpu headers in dcn20_resource headers to make dcn20_calculate_dlg_params() visible to dcn21/30/31. Three new functions are created to isolate well-delimited FPU operations: - void dcn20_fpu_set_wb_arb_params(): set cli_watermark, pstate_watermark and time_per_pixel from wb_arb_params (struct mcif_arb_params), since those uses FPU operations on double types: WritebackUrgentWatermark, WritebackDRAMClockChangeWatermark, '16.0'. - void dcn20_fpu_set_wm_ranges(): set min_fill_clk_mhz and max_fill_clk_mhz involves FPU calcs on dram_speed_mts (double type); - void dcn20_fpu_adjust_dppclk(): adjust operation on RequiredDPPCLK that is a double. Signed-off-by: Melissa Wen Acked-by: Alan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn20/Makefile | 25 - .../gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 1369 +------------------ .../gpu/drm/amd/display/dc/dcn20/dcn20_resource.h | 31 +- .../gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 8 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 7 + .../gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 4 + .../drm/amd/display/dc/dcn315/dcn315_resource.c | 2 + .../drm/amd/display/dc/dcn316/dcn316_resource.c | 2 + .../gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 1386 ++++++++++++++++++++ .../gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.h | 42 + 10 files changed, 1476 insertions(+), 1400 deletions(-) commit 44ca49f046f89a97ad319372b4fdbde67da1b6b3 Author: Leo Li Date: Thu Feb 24 16:30:41 2022 -0500 drm/amd/display: Fix compile error from TO_CLK_MGR_INTERNAL [Why] On LNX, TO_CLK_MGR_INTERNAL() only works to get clk_mgr_internal from a given clk_mgr. In clk_mgr_dcn316 struct, the clk_mgr_internal is already a memeber by the alias 'base' [How] Use &clk_mgr->base instead. Reviewed-by: Harry Wentland Acked-by: Alan Liu Signed-off-by: Leo Li Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher .../amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 5 ++++- .../drm/amd/display/dc/clk_mgr/dcn316/dcn316_smu.c | 26 ++++++++++++++++++++++ .../drm/amd/display/dc/clk_mgr/dcn316/dcn316_smu.h | 2 ++ 3 files changed, 32 insertions(+), 1 deletion(-) commit 32685b32d825ca08c5dec826477332df886c4743 Author: Nicholas Kazlauskas Date: Mon Feb 28 10:48:56 2022 -0500 drm/amd/display: Fix double free during GPU reset on DC streams [Why] The issue only occurs during the GPU reset code path. We first backup the current state prior to commiting 0 streams internally from DM to DC. This state backup contains valid link encoder assignments. DC will clear the link encoder assignments as part of current state (but not the backup, since it was a copied before the commit) and free the extra stream reference it held. DC requires that the link encoder assignments remain cleared/invalid prior to commiting. Since the backup still has valid assignments we call the interface post reset to clear them. This routine also releases the extra reference that the link encoder interface held - resulting in a double free (and eventually a NULL pointer dereference). [How] We'll have to do a full DC commit anyway after GPU reset because the stream count previously went to 0. We don't need to retain the assignment that we had backed up, so just copy off of the now clean current state assignment after the reset has occcurred with the new link_enc_cfg_copy() interface. Fixes: 6d63fcc2a334 ("drm/amd/display: Reset link encoder assignments for GPU reset") Reviewed-by: Jimmy Kizito Acked-by: Alan Liu Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++++--- drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 7 +++++++ drivers/gpu/drm/amd/display/dc/inc/link_enc_cfg.h | 5 +++++ 3 files changed, 18 insertions(+), 3 deletions(-) commit 84ce38c7bf7a19fb1f9cc61181e830b7e04dd51d Author: Chris Park Date: Mon Feb 28 10:23:00 2022 -0500 drm/amd/display: Add NULL check [Why] Virtualization enters blue screen of death (BSoD) due to NULL res_pool object when accessing DSC encoder capability. [How] Add NULL check to avoid blue screen of death. Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: Chris Park Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++ 1 file changed, 3 insertions(+) commit 9c1e260e97606330518a78422ae28d9d56ac87d6 Author: Aric Cyr Date: Mon Feb 28 10:00:09 2022 -0500 drm/amd/display: 3.2.176 drm/amd/display: 3.2.176 This version brings along following fixes: - move FPU operations from dcn21 to dml/dcn20 folder - move FPU-related code from dcn20 to dml folder - Fix compile error from TO_CLK_MGR_INTERNAL - Fix double free during GPU reset on DC streams - Add NULL check - [FW Promotion] Release 0.0.107.0 - enable dcn315/316 s0i2 support - handle DP2.0 RX with UHBR20 but not UHBR13.5 support - disable HPD SW timer for passive dongle type 1 only - add gamut coefficient set A and B - merge two duplicated clock_source_create - Add link dp trace support - move FPU associated DCN303 code to DML folder - Release AUX engine after failed acquire - Add minimal pipe split transition state - Clean up fixed VS PHY test w/a function - fix the clock source contruct for dcn315 - cleaning up smu_if to add future flexibility - fix deep color ratio - add debug option to bypass ssinfo from bios for dcn315 Acked-by: Alan Liu Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6e899860f557fc60135506242cc3fb705e64b718 Author: Anthony Koo Date: Sat Feb 26 21:25:22 2022 -0500 drm/amd/display: [FW Promotion] Release 0.0.107.0 Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e7145aaedd55b19ae4e8bd25cbd4ef8f415b6b89 Author: Charlene Liu Date: Fri Feb 25 20:50:14 2022 -0500 drm/amd/display: enable dcn315/316 s0i2 support [why] enable the support in driver, let the control by CMOS Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 2 +- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) commit 4185f99094d50a2f402153ff8922bc694f5f6d96 Author: Wenjing Liu Date: Tue Feb 15 18:34:08 2022 -0500 drm/amd/display: handle DP2.0 RX with UHBR20 but not UHBR13.5 support [why] DP2.0 defines DP2.0 RX capability using bit maps. This means there is a corner case the DP2.0 RX can declare UHBR20 capability but not UHBR13.5 support. In this case we should skip UHBR13.5 selection and continue to our next option in decide liink settings. Reviewed-by: George Shen Acked-by: Alan Liu Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 49 ++++++++++++++++++------ 1 file changed, 37 insertions(+), 12 deletions(-) commit 4a897de1d607c15ebb9aa11a424ec3f3243304a3 Author: Sung Joon Kim Date: Thu Feb 24 14:58:52 2022 -0500 drm/amd/display: disable HPD SW timer for passive dongle type 1 only [why] Need to provide this workaround only for type 1 passive dongle [how] Detect if dongle is type 1 or 2. And use it to determine if w/a is needed. Reviewed-by: Charlene Liu Acked-by: Alan Liu Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link.c | 1 + drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 ++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/include/ddc_service_types.h | 1 + 4 files changed, 5 insertions(+) commit 76a52f36b636cdff6b5b18f13daf05005e4b0b57 Author: Jingwen Zhu Date: Fri Feb 25 16:55:59 2022 +0800 drm/amd/display: add gamut coefficient set A and B [Why] Screen shake on DCN3 night light SDR BR3. [How] Change the logic to use double buffer reisgter on gamut settings. Reviewed-by: Krunoslav Kovac Acked-by: Alan Liu Signed-off-by: Jingwen Zhu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dpp_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 305f098020920f9ea6ff9162ee46392f4d67e67f Author: Charlene Liu Date: Thu Feb 24 12:57:23 2022 -0500 drm/amd/display: merge two duplicated clock_source_create [why] dcn31x could use dcn31 sepcific which contains deep_color_ratio for dmub Reviewed-by: Nevenko Stupar Reviewed-by: Hansen Dsouza Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher .../gpu/drm/amd/display/dc/dce/dce_clock_source.c | 127 ++++++++++++--------- .../drm/amd/display/dc/dcn315/dcn315_resource.c | 33 +----- .../drm/amd/display/dc/dcn316/dcn316_resource.c | 33 +----- 3 files changed, 82 insertions(+), 111 deletions(-) commit 5fed53c7983654b1658c49a030ac86bba7965fde Author: Leo (Hanghong) Ma Date: Fri Feb 11 09:44:05 2022 -0500 drm/amd/display: Add link dp trace support [Why] It is nice to have link training and link loss status logging in our trace, and this patch add the all necessary accessors in dc side. [How] 1. Define dp_trace struct and create new file link_dp_trace.c and link_dp_trace.h; 2. Add dp link training status update in dc_link_dp.c; Reviewed-by: Wenjing Liu Acked-by: Alan Liu Signed-off-by: Leo (Hanghong) Ma Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link.c | 5 + drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 24 +++- drivers/gpu/drm/amd/display/dc/dc_link.h | 36 +++++ drivers/gpu/drm/amd/display/dc/link/Makefile | 2 +- .../gpu/drm/amd/display/dc/link/link_dp_trace.c | 146 +++++++++++++++++++++ .../gpu/drm/amd/display/dc/link/link_dp_trace.h | 57 ++++++++ 6 files changed, 268 insertions(+), 2 deletions(-) commit 53923e62afad6f52b2b931a74d2ee10274051b28 Author: Jasdeep Dhillon Date: Thu Feb 24 10:56:07 2022 -0500 drm/amd/display: move FPU associated DCN303 code to DML folder [Why & How] As part of the FPU isolation work documented in https://patchwork.freedesktop.org/series/93042/, isolate code that uses FPU in DCN303 to DML, where all FPU code should locate. Co-authored-by: Jasdeep Dhillon Reviewed-by: Rodrigo Siqueira Acked-by: Alan Liu Signed-off-by: Jasdeep Dhillon Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn303/Makefile | 26 -- .../drm/amd/display/dc/dcn303/dcn303_resource.c | 327 +------------------ .../drm/amd/display/dc/dcn303/dcn303_resource.h | 3 + drivers/gpu/drm/amd/display/dc/dml/Makefile | 2 + .../gpu/drm/amd/display/dc/dml/dcn303/dcn303_fpu.c | 362 +++++++++++++++++++++ .../gpu/drm/amd/display/dc/dml/dcn303/dcn303_fpu.h | 32 ++ 6 files changed, 409 insertions(+), 343 deletions(-) commit d8ff38d8fcd0a7bb66d17ec689135239aca78532 Author: Wyatt Wood Date: Wed Feb 23 11:22:30 2022 -0500 drm/amd/display: Release AUX engine after failed acquire [Why] There is a sequence in which aux arbitration doesn't work correctly. Driver is left with aux access after it times out waiting for access. In future dmub fw is never granted aux access and is stuck in a while loop. [How] Cancel aux request from driver after timing out. Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: Wyatt Wood Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3741584519dcb780c38df502dd5e4cf7cea4d9f2 Author: Dillon Varone Date: Thu Feb 17 15:33:03 2022 -0500 drm/amd/display: Add minimal pipe split transition state [WHY?] When adding/removng a plane to some configurations, unsupported pipe programming can occur when moving to a new plane. [HOW?] Add a safe transistion state before programming new configuration. Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit dbede77ce38df760bcdcbc53287e8673fa65982a Author: George Shen Date: Sun Feb 20 15:57:00 2022 -0500 drm/amd/display: Clean up fixed VS PHY test w/a function [Why] Unify naming for fixed VS workarounds. [How] Rename function to match naming convention. Refactor code to remove unused function. Reviewed-by: Wenjing Liu Acked-by: Alan Liu Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 55 +++--------------------- 1 file changed, 5 insertions(+), 50 deletions(-) commit 4189f2938d49d4d6b2e2191c86000c2e04ca7305 Author: Charlene Liu Date: Wed Feb 23 00:11:33 2022 -0500 drm/amd/display: fix the clock source contruct for dcn315 [why] Driver sends invalid deep color ratio to DMUB. Update it to the right one by using another clock source construct. Reviewed-by: Hansen Dsouza Acked-by: Alan Liu Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4984e3aae6fa4f42fc24f2745b74509bf2cb0b03 Author: Leung, Martin Date: Sun Feb 20 21:44:26 2022 -0500 drm/amd/display: cleaning up smu_if to add future flexibility why and how: need to hook in new smu interfaces cleaning up code that used old variables Reviewed-by: Nevenko Stupar Acked-by: Alan Liu Signed-off-by: Leung, Martin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher .../amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 13 +--- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 9 +-- .../dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.h | 67 ++------------------ .../dc/clk_mgr/dcn30/dcn30_smu11_driver_if.h | 74 ++++++++++++++++++++++ .../amd/display/include/grph_object_ctrl_defs.h | 22 ------- 5 files changed, 86 insertions(+), 99 deletions(-) commit df5a07c45c68fd85cd4d1a4ad7892d3a717a4ccf Author: Hansen Dsouza Date: Fri Feb 18 19:53:50 2022 -0500 drm/amd/display: fix deep color ratio Fix enum mapping for deep color ratio Reviewed-by: Charlene Liu Acked-by: Alan Liu Signed-off-by: Hansen Dsouza Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher .../gpu/drm/amd/display/dc/dce/dce_clock_source.c | 100 +++++++++++++++++++++ .../gpu/drm/amd/display/dc/dce/dce_clock_source.h | 9 ++ .../gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 2 +- .../drm/amd/display/dc/dcn316/dcn316_resource.c | 2 +- 4 files changed, 111 insertions(+), 2 deletions(-) commit 3b8b44a431b76be2645806cfa0494399c3dbbd85 Author: Charlene Liu Date: Fri Feb 11 20:55:25 2022 -0500 drm/amd/display: add debug option to bypass ssinfo from bios for dcn315 [Why & How] Add debug option to bypass ssinfo from BIOS for dcn315. Reviewed-by: Park, Chris Acked-by: Qingqing Zhuo Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher .../amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 5 ++++- .../drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.c | 24 ++++++++++++++++++++++ .../drm/amd/display/dc/clk_mgr/dcn315/dcn315_smu.h | 2 ++ drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c | 2 ++ 4 files changed, 32 insertions(+), 1 deletion(-) commit 7c916f95f58df401fef4f8c7549aa80a5739b0dd Author: Yifan Zhang Date: Mon Mar 7 13:54:21 2022 +0800 drm/amdgpu: change registers in error checking for smu 13.0.5 smu 13.0.5 use new registers for smu msg and param. Signed-off-by: Yifan Zhang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit bb7c3e9ce2d43a37b699ca379876089e03a756e3 Author: Lijo Lazar Date: Thu Mar 3 09:13:22 2022 +0530 drm/amdgpu: Disable baco dummy mode On aldebaran, BACO dummy mode may be enabled during reset. Disable it during resume. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit 8126b1c73108bc691f5643df19071a59a69d0bc6 Author: Jann Horn Date: Mon Mar 14 19:59:53 2022 +0100 pstore: Don't use semaphores in always-atomic-context code pstore_dump() is *always* invoked in atomic context (nowadays in an RCU read-side critical section, before that under a spinlock). It doesn't make sense to try to use semaphores here. This is mostly a revert of commit ea84b580b955 ("pstore: Convert buf_lock to semaphore"), except that two parts aren't restored back exactly as they were: - keep the lock initialization in pstore_register - in efi_pstore_write(), always set the "block" flag to false - omit "is_locked", that was unnecessary since commit 959217c84c27 ("pstore: Actually give up during locking failure") - fix the bailout message The actual problem that the buggy commit was trying to address may have been that the use of preemptible() in efi_pstore_write() was wrong - it only looks at preempt_count() and the state of IRQs, but __rcu_read_lock() doesn't touch either of those under CONFIG_PREEMPT_RCU. (Sidenote: CONFIG_PREEMPT_RCU means that the scheduler can preempt tasks in RCU read-side critical sections, but you're not allowed to actively block/reschedule.) Lockdep probably never caught the problem because it's very rare that you actually hit the contended case, so lockdep always just sees the down_trylock(), not the down_interruptible(), and so it can't tell that there's a problem. Fixes: ea84b580b955 ("pstore: Convert buf_lock to semaphore") Cc: stable@vger.kernel.org Acked-by: Sebastian Andrzej Siewior Signed-off-by: Jann Horn Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220314185953.2068993-1-jannh@google.com drivers/firmware/efi/efi-pstore.c | 2 +- fs/pstore/platform.c | 38 ++++++++++++++++++-------------------- include/linux/pstore.h | 6 +++--- 3 files changed, 22 insertions(+), 24 deletions(-) commit 66daf3e6b9936328cb28eaaa29dddfe96343cc85 Author: Lukas Bulwahn Date: Tue Mar 15 07:15:20 2022 +0100 scsi: scsi_ioctl: Drop needless assignment in sg_io() Commit ce70fd9a551a ("scsi: core: Remove the cmd field from struct scsi_request") refactored sg_io(), so that it does not allocate directly and hence does not return -ENOMEM in its error case. That makes a remaining assignment of -ENOMEM to the return variable needless. Drop this needless assignment in sg_io(). No functional change. No change in resulting object code. Link: https://lore.kernel.org/r/20220315061520.30745-1-lukas.bulwahn@gmail.com Reviewed-by: Christoph Hellwig Signed-off-by: Lukas Bulwahn Signed-off-by: Martin K. Petersen drivers/scsi/scsi_ioctl.c | 1 - 1 file changed, 1 deletion(-) commit dc155e1acb18fe549bf4efc91ecca2a80deea5f2 Author: Lukas Bulwahn Date: Tue Mar 15 06:53:25 2022 +0100 scsi: bsg: Drop needless assignment in scsi_bsg_sg_io_fn() Commit ce70fd9a551a ("scsi: core: Remove the cmd field from struct scsi_request") refactored scsi_bsg_sg_io_fn() so that it does not allocate directly and hence does not return -ENOMEM in its error case. That makes a remaining assignment of -ENOMEM to the return variable needless. Drop this needless assignment in scsi_bsg_sg_io_fn(). No functional change. No change in resulting object code. Link: https://lore.kernel.org/r/20220315055325.14974-1-lukas.bulwahn@gmail.com Reviewed-by: Christoph Hellwig Signed-off-by: Lukas Bulwahn Signed-off-by: Martin K. Petersen drivers/scsi/scsi_bsg.c | 1 - 1 file changed, 1 deletion(-) commit f45775bf562a5523602541482106b2e9871955cf Author: James Smart Date: Thu Feb 24 18:23:08 2022 -0800 scsi: lpfc: Copyright updates for 14.2.0.0 patches Update copyrights to 2022 for files modified in the 14.2.0.0 patch set. Link: https://lore.kernel.org/r/20220225022308.16486-18-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc.h | 2 +- drivers/scsi/lpfc/lpfc_bsg.c | 2 +- drivers/scsi/lpfc/lpfc_crtn.h | 2 +- drivers/scsi/lpfc/lpfc_ct.c | 2 +- drivers/scsi/lpfc/lpfc_els.c | 2 +- drivers/scsi/lpfc/lpfc_hbadisc.c | 2 +- drivers/scsi/lpfc/lpfc_hw.h | 2 +- drivers/scsi/lpfc/lpfc_hw4.h | 2 +- drivers/scsi/lpfc/lpfc_init.c | 2 +- drivers/scsi/lpfc/lpfc_nportdisc.c | 2 +- drivers/scsi/lpfc/lpfc_nvme.c | 2 +- drivers/scsi/lpfc/lpfc_nvme.h | 2 +- drivers/scsi/lpfc/lpfc_nvmet.c | 2 +- drivers/scsi/lpfc/lpfc_scsi.c | 2 +- drivers/scsi/lpfc/lpfc_sli.c | 2 +- drivers/scsi/lpfc/lpfc_sli.h | 2 +- drivers/scsi/lpfc/lpfc_sli4.h | 2 +- drivers/scsi/lpfc/lpfc_version.h | 4 ++-- 18 files changed, 19 insertions(+), 19 deletions(-) commit 64de6108f41003fbb15fc687b584939edd278f41 Author: James Smart Date: Thu Feb 24 18:23:07 2022 -0800 scsi: lpfc: Update lpfc version to 14.2.0.0 Update lpfc version to 14.2.0.0 Link: https://lore.kernel.org/r/20220225022308.16486-17-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0e082d926f59dbad311e4cc15317631b935a2efe Author: James Smart Date: Thu Feb 24 18:23:06 2022 -0800 scsi: lpfc: SLI path split: Refactor BSG paths This patch refactors the BSG paths to use SLI-4 as the primary interface. - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-16-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_bsg.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) commit 31a59f75702fe9a9d3772ece821a0d07a0805572 Author: James Smart Date: Thu Feb 24 18:23:05 2022 -0800 scsi: lpfc: SLI path split: Refactor Abort paths This patch refactors the Abort paths to use SLI-4 as the primary interface. - Introduce generic lpfc_sli_prep_abort_xri jump table routine - Consolidate lpfc_sli4_issue_abort_iotag and lpfc_sli_issue_abort_iotag into a single generic lpfc_sli_issue_abort_iotag routine - Consolidate lpfc_sli4_abort_fcp_cmpl and lpfc_sli_abort_fcp_cmpl into a single generic lpfc_sli_abort_fcp_cmpl routine - Remove unused routine lpfc_get_iocb_from_iocbq - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-15-jsmart2021@gmail.com Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc.h | 14 +- drivers/scsi/lpfc/lpfc_crtn.h | 3 + drivers/scsi/lpfc/lpfc_nvme.c | 5 +- drivers/scsi/lpfc/lpfc_scsi.c | 12 +- drivers/scsi/lpfc/lpfc_sli.c | 382 +++++++++++++++++++++++------------------- drivers/scsi/lpfc/lpfc_sli.h | 4 +- 6 files changed, 236 insertions(+), 184 deletions(-) commit 3512ac0942938d6977e7999ee69765d948d2faf1 Author: James Smart Date: Thu Feb 24 18:23:04 2022 -0800 scsi: lpfc: SLI path split: Refactor SCSI paths This patch refactors the SCSI paths to use SLI-4 as the primary interface. - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc.h | 4 + drivers/scsi/lpfc/lpfc_scsi.c | 374 +++++++++++++++++++----------------------- drivers/scsi/lpfc/lpfc_sli.c | 6 +- 3 files changed, 174 insertions(+), 210 deletions(-) commit 61910d6a524308357c17f7e41acff83ec9510cee Author: James Smart Date: Thu Feb 24 18:23:03 2022 -0800 scsi: lpfc: SLI path split: Refactor CT paths This patch refactors the CT paths to use SLI-4 as the primary interface. - Introduce generic lpfc_sli_prep_gen_req jump table routine - Introduce generic lpfc_sli_prep_xmit_seq64 jump table routine - Rename lpfcdiag_loop_post_rxbufs to lpfcdiag_sli3_loop_post_rxbufs to indicate that it is an SLI3 only path - Create new prep_wqe routine for unsolicited ELS rsp WQEs. - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc.h | 16 ++ drivers/scsi/lpfc/lpfc_bsg.c | 266 ++++++++++++---------------- drivers/scsi/lpfc/lpfc_crtn.h | 8 + drivers/scsi/lpfc/lpfc_ct.c | 333 +++++++++++++++++------------------- drivers/scsi/lpfc/lpfc_sli.c | 390 +++++++++++++++++++++++++++++++++++------- drivers/scsi/lpfc/lpfc_sli.h | 1 + 6 files changed, 616 insertions(+), 398 deletions(-) commit 2d1928c57df623db4babcb2e1a2b332b82fad4df Author: James Smart Date: Thu Feb 24 18:23:02 2022 -0800 scsi: lpfc: SLI path split: Refactor misc ELS paths This patch refactors the remaining ELS paths to use SLI-4 as the primary interface. Paths include RRQ, RSCN, unsolicited ELS RQST and RSP paths, ELS timeouts, etc.: - Remove unused routines lpfc_sli4_bpl2sgl and lpfc_sli4_iocb2wqe - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc_els.c | 224 ++++++---- drivers/scsi/lpfc/lpfc_hbadisc.c | 44 +- drivers/scsi/lpfc/lpfc_nportdisc.c | 38 +- drivers/scsi/lpfc/lpfc_sli.c | 809 +++---------------------------------- 4 files changed, 241 insertions(+), 874 deletions(-) commit 351849800157f3ae9ba3b6d32ac2350c409b3c27 Author: James Smart Date: Thu Feb 24 18:23:01 2022 -0800 scsi: lpfc: SLI path split: Refactor VMID paths This patch refactors the VMID paths to use SLI-4 as the primary interface: - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc_ct.c | 2 +- drivers/scsi/lpfc/lpfc_els.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) commit 9d41f08aa2eba4048357f7bd5efc11e97c213708 Author: James Smart Date: Thu Feb 24 18:23:00 2022 -0800 scsi: lpfc: SLI path split: Refactor FDISC paths This patch refactors the FDISC paths to use SLI-4 as the primary interface: - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc_els.c | 47 +++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 18 deletions(-) commit e0367dfe90d6d5b2143311b0027c9c5d8878a30c Author: James Smart Date: Thu Feb 24 18:22:59 2022 -0800 scsi: lpfc: SLI path split: Refactor LS_RJT paths This patch refactors the LS_RJT paths to use SLI-4 as the primary interface: - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc_els.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) commit 3f607dcb43f1cbc0536a5096e058dd2050ab3de8 Author: James Smart Date: Thu Feb 24 18:22:58 2022 -0800 scsi: lpfc: SLI path split: Refactor LS_ACC paths This patch refactors the LS_ACC paths to use SLI-4 as the primary interface: - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc_els.c | 244 +++++++++++++++++++++++++++++++------------ 1 file changed, 177 insertions(+), 67 deletions(-) commit 3bea83b68d54478e541caea3c21033c03c1d9920 Author: James Smart Date: Thu Feb 24 18:22:57 2022 -0800 scsi: lpfc: SLI path split: Refactor the RSCN/SCR/RDF/EDC/FARPR paths This patch refactors the SLI3/SLI4 RSCN/SCR/RDF/EDC/FARPR paths to use SLI-4 as the primary interface: - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc_els.c | 115 ++++++++++++++++++++++++++++++------------- 1 file changed, 81 insertions(+), 34 deletions(-) commit cad93a0890319500ce069b8e8e279353e0ea2f9a Author: James Smart Date: Thu Feb 24 18:22:56 2022 -0800 scsi: lpfc: SLI path split: Refactor PLOGI/PRLI/ADISC/LOGO paths This patch refactors the PLOGI/PRLI/ADISC/LOGO paths to use SLI-4 as the primary interface: - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc.h | 9 ++ drivers/scsi/lpfc/lpfc_els.c | 278 ++++++++++++++++++++++++++----------- drivers/scsi/lpfc/lpfc_nportdisc.c | 60 ++++---- 3 files changed, 242 insertions(+), 105 deletions(-) commit 6831ce129f1948f50f2d2a57995d2ebd7a6fa0b4 Author: James Smart Date: Thu Feb 24 18:22:55 2022 -0800 scsi: lpfc: SLI path split: Refactor base ELS paths and the FLOGI path The patch refactors the general ELS handling paths to migrate to SLI-4 structures or common element abstractions. The fabric login paths are revised as part of this patch: - New generic lpfc_sli_prep_els_req_rsp jump table routine - Introduce ls_rjt_error_be and ulp_bde64_le unions to correct legacy endianness assignments - Conversion away from using SLI-3 iocb structures to set/access fields in common routines. Use the new generic get/set routines that were added. This move changes code from indirect structure references to using local variables with the generic routines. - Refactor routines when setting non-generic fields, to have both SLI3 and SLI4 specific sections. This replaces the set-as-SLI3 then translate to SLI4 behavior of the past. - Clean up poor indentation on some of the ELS paths Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc.h | 17 +- drivers/scsi/lpfc/lpfc_crtn.h | 5 + drivers/scsi/lpfc/lpfc_ct.c | 4 +- drivers/scsi/lpfc/lpfc_els.c | 440 ++++++++++++++++++++++-------------------- drivers/scsi/lpfc/lpfc_hw.h | 14 +- drivers/scsi/lpfc/lpfc_hw4.h | 29 +++ drivers/scsi/lpfc/lpfc_sli.c | 184 +++++++++++++++--- 7 files changed, 453 insertions(+), 240 deletions(-) commit 561341425bcc70e97edf978b3041eec5cf23acef Author: James Smart Date: Thu Feb 24 18:22:54 2022 -0800 scsi: lpfc: SLI path split: Introduce lpfc_prep_wqe Introduce lpfc_prep_wqe routine. The lpfc_prep_wqe() routine is used with lpfc_sli_issue_iocb() and lpfc_sli_issue_iocb_wait(). The routine performs additional SLI-4 wqe field setting that the generic routines did not perform as they kept their actions compatible with both SLI3 and SLI4. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc_bsg.c | 1 + drivers/scsi/lpfc/lpfc_crtn.h | 1 + drivers/scsi/lpfc/lpfc_ct.c | 1 + drivers/scsi/lpfc/lpfc_els.c | 2 + drivers/scsi/lpfc/lpfc_sli.c | 197 +++++++++++++++++++++++++++++++++++++++++- 5 files changed, 200 insertions(+), 2 deletions(-) commit 1b64aa9eae28ac598a03ed3d62a63ac5e5b295fc Author: James Smart Date: Thu Feb 24 18:22:53 2022 -0800 scsi: lpfc: SLI path split: Refactor fast and slow paths to native SLI4 Convert the SLI4 fast and slow paths to use native SLI4 wqe constructs instead of iocb SLI3-isms. Includes the following: - Create simple get_xxx and set_xxx routines to wrapper access to common elements in both SLI3 and SLI4 commands - allowing calling routines to avoid sli-rev-specific structures to access the elements. - using the wqe in the job structure as the primary element - use defines from SLI-4, not SLI-3 - Removal of iocb to wqe conversion from fast and slow path - Add below routines to handle fast path lpfc_prep_embed_io - prepares the wqe for fast path lpfc_wqe_bpl2sgl - manages bpl to sgl conversion lpfc_sli_wqe2iocb - converts a WQE to IOCB for SLI-3 path - Add lpfc_sli3_iocb2wcqecmpl in completion path to convert an SLI-3 iocb completion to wcqe completion - Refactor some of the code that works on both revs for clarity Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc.h | 36 +++ drivers/scsi/lpfc/lpfc_crtn.h | 1 + drivers/scsi/lpfc/lpfc_hw4.h | 7 + drivers/scsi/lpfc/lpfc_sli.c | 513 +++++++++++++++++------------------------- drivers/scsi/lpfc/lpfc_sli.h | 2 + 5 files changed, 257 insertions(+), 302 deletions(-) commit a680a9298e7b4ff344aca3456177356b276e5038 Author: James Smart Date: Thu Feb 24 18:22:52 2022 -0800 scsi: lpfc: SLI path split: Refactor lpfc_iocbq Currently, SLI3 and SLI4 data paths use the same lpfc_iocbq structure. This is a "common" structure but many of the components refer to sli-rev specific entities which can lead the developer astray as to what they actually mean, should be set to, or when they should be used. This first patch prepares the lpfc_iocbq structure so that elements common to both SLI3 and SLI4 data paths are more appropriately named, making it clear they apply generically. Fieldnames based on 'iocb' (sli3) or 'wqe' (sli4) which are actually generic to the paths are renamed to 'cmd': - iocb_flag is renamed to cmd_flag - lpfc_vmid_iocb_tag is renamed to lpfc_vmid_tag - fabric_iocb_cmpl is renamed to fabric_cmd_cmpl - wait_iocb_cmpl is renamed to wait_cmd_cmpl - iocb_cmpl and wqe_cmpl are combined and renamed to cmd_cmpl - rsvd2 member is renamed to num_bdes due to pre-existing usage The structure name itself will retain the iocb reference as changing to a more relevant "job" or "cmd" title induces many hundreds of line changes for only a name change. lpfc_post_buffer is also renamed to lpfc_sli3_post_buffer to indicate use in the SLI3 path only. Link: https://lore.kernel.org/r/20220225022308.16486-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 drivers/scsi/lpfc/lpfc_bsg.c | 50 +++--- drivers/scsi/lpfc/lpfc_crtn.h | 2 +- drivers/scsi/lpfc/lpfc_ct.c | 8 +- drivers/scsi/lpfc/lpfc_els.c | 139 ++++++++------- drivers/scsi/lpfc/lpfc_init.c | 11 +- drivers/scsi/lpfc/lpfc_nportdisc.c | 4 +- drivers/scsi/lpfc/lpfc_nvme.c | 34 ++-- drivers/scsi/lpfc/lpfc_nvme.h | 6 +- drivers/scsi/lpfc/lpfc_nvmet.c | 83 ++++----- drivers/scsi/lpfc/lpfc_scsi.c | 75 ++++---- drivers/scsi/lpfc/lpfc_sli.c | 340 ++++++++++++++++++------------------- drivers/scsi/lpfc/lpfc_sli.h | 24 ++- 12 files changed, 385 insertions(+), 391 deletions(-) commit e4cf6580ac740f766dae26203bd6311d353dcd42 Author: Thinh Nguyen Date: Wed Mar 9 12:54:02 2022 -0800 usb: dwc3: gadget: Wait for ep0 xfers to complete during dequeue If a Setup packet is received but yet to DMA out, the controller will not process the End Transfer command of any endpoint. Polling of its DEPCMD.CmdAct may block setting up TRB for Setup packet, causing a command timeout. This may occur if the driver doesn’t service the completion interrupt of the control status stage yet due to system latency, then it won’t prepare TRB and start the transfer for the next Setup Stage. To the host side, the control transfer had completed, and the host can send a new Setup packet at this point. In the meanwhile, if the driver receives an async call to dequeue a request (triggering End Transfer) to any endpoint, then the driver will service that End transfer first, blocking the control status stage completion handler. Since no TRB is available for the Setup stage, the Setup packet can’t be DMA’ed out and the End Transfer gets hung. The driver must not block setting up of the Setup stage. So track and only issue the End Transfer command only when there’s Setup TRB prepared so that the controller can DMA out the Setup packet. Delay the End transfer command if there's no Setup TRB available. This is applicable to all DWC_usb3x IPs. Co-developed-by: Wesley Cheng Signed-off-by: Thinh Nguyen Signed-off-by: Wesley Cheng Link: https://lore.kernel.org/r/20220309205402.4467-1-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/core.h | 1 + drivers/usb/dwc3/ep0.c | 14 ++++++++++++++ drivers/usb/dwc3/gadget.c | 20 +++++++++++++++----- drivers/usb/dwc3/gadget.h | 1 + 4 files changed, 31 insertions(+), 5 deletions(-) commit e192cc7b52399d1b073f88cd3ba128b74d3a57f1 Author: Michael Grzeschik Date: Sun Mar 6 22:12:51 2022 +0100 usb: dwc3: gadget: move cmd_endtransfer to extra function This patch adds the extra function __dwc3_stop_active_transfer to consolidate the same codepath. Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220306211251.2281335-3-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/gadget.c | 69 +++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 32 deletions(-) commit 26d27a1080a7d0e8f0c1a56dc50aae336f9525d1 Author: Michael Grzeschik Date: Sun Mar 6 22:12:50 2022 +0100 usb: dwc3: gadget: ep_queue simplify isoc start condition To improve reading the code this patch moves the cases to start_isoc or return the function under one common condition check. Reviewed-by: Thinh Nguyen Signed-off-by: Michael Grzeschik Link: https://lore.kernel.org/r/20220306211251.2281335-2-m.grzeschik@pengutronix.de Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/gadget.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit 4406f46c9bcd9c40cd0e01fcb97b53b29d63651c Author: Shameer Kolothum Date: Tue Mar 8 18:49:02 2022 +0000 hisi_acc_vfio_pci: Use its own PCI reset_done error handler Register private handler for pci_error_handlers.reset_done and update state accordingly. Reviewed-by: Jason Gunthorpe Reviewed-by: Longfang Liu Signed-off-by: Shameer Kolothum Link: https://lore.kernel.org/r/20220308184902.2242-10-shameerali.kolothum.thodi@huawei.com Signed-off-by: Alex Williamson drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 57 ++++++++++++++++++++++++-- drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.h | 4 +- 2 files changed, 57 insertions(+), 4 deletions(-) commit b0eed085903e7758532696d64397901a75bba8ba Author: Longfang Liu Date: Tue Mar 8 18:49:01 2022 +0000 hisi_acc_vfio_pci: Add support for VFIO live migration VMs assigned with HiSilicon ACC VF devices can now perform live migration if the VF devices are bind to the hisi_acc_vfio_pci driver. Just like ACC PF/VF drivers this VFIO driver also make use of the HiSilicon QM interface. QM stands for Queue Management which is a generic IP used by ACC devices. It provides a generic PCIe interface for the CPU and the ACC devices to share a group of queues. QM integrated into an accelerator provides queue management service. Queues can be assigned to PF and VFs, and queues can be controlled by unified mailboxes and doorbells. The QM driver (drivers/crypto/hisilicon/qm.c) provides generic interfaces to ACC drivers to manage the QM. Signed-off-by: Longfang Liu Reviewed-by: Jason Gunthorpe Signed-off-by: Shameer Kolothum Link: https://lore.kernel.org/r/20220308184902.2242-9-shameerali.kolothum.thodi@huawei.com Reviewed-by: Kevin Tian Signed-off-by: Alex Williamson drivers/vfio/pci/hisilicon/Kconfig | 5 + drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 1085 +++++++++++++++++++++++- drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.h | 114 +++ 3 files changed, 1186 insertions(+), 18 deletions(-) commit cee03ca3cb44c867b45f9d32601c1d532f66fe7a Author: Juergen Gross Date: Fri Mar 11 11:35:00 2022 +0100 xen/usb: don't use arbitrary_virt_to_machine() arbitrary_virt_to_machine() is meant to be used in PV guests only. Replace its usage with virt_to_gfn(). Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20220311103500.12885-1-jgross@suse.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xen-hcd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 1e459b25081d4f939b8a1fb4c71dab0cec8f974a Author: Longfang Liu Date: Tue Mar 8 18:49:00 2022 +0000 crypto: hisilicon/qm: Set the VF QM state register We use VF QM state register to record the status of the QM configuration state. This will be used in the ACC migration driver to determine whether we can safely save and restore the QM data. Signed-off-by: Longfang Liu Acked-by: Zhou Wang Signed-off-by: Shameer Kolothum Link: https://lore.kernel.org/r/20220308184902.2242-8-shameerali.kolothum.thodi@huawei.com Signed-off-by: Alex Williamson drivers/crypto/hisilicon/qm.c | 8 ++++++++ include/linux/hisi_acc_qm.h | 6 ++++++ 2 files changed, 14 insertions(+) commit 442fbc099b839551f8576723da22c1269cc695ce Author: Shameer Kolothum Date: Tue Mar 8 18:48:59 2022 +0000 hisi_acc_vfio_pci: Add helper to retrieve the struct pci_driver struct pci_driver pointer is an input into the pci_iov_get_pf_drvdata(). Introduce helpers to retrieve the ACC PF dev struct pci_driver pointers as we use this in ACC vfio migration driver. Acked-by: Zhou Wang Acked-by: Kai Ye Acked-by: Longfang Liu Signed-off-by: Shameer Kolothum Link: https://lore.kernel.org/r/20220308184902.2242-7-shameerali.kolothum.thodi@huawei.com Signed-off-by: Alex Williamson drivers/crypto/hisilicon/hpre/hpre_main.c | 6 ++++++ drivers/crypto/hisilicon/sec2/sec_main.c | 6 ++++++ drivers/crypto/hisilicon/zip/zip_main.c | 6 ++++++ include/linux/hisi_acc_qm.h | 5 +++++ 4 files changed, 23 insertions(+) commit 6abdce51af1a21b11d325756e654c50a1fa53afe Author: Shameer Kolothum Date: Tue Mar 8 18:48:58 2022 +0000 hisi_acc_vfio_pci: Restrict access to VF dev BAR2 migration region HiSilicon ACC VF device BAR2 region consists of both functional register space and migration control register space. Unnecessarily exposing the migration BAR region to the Guest has the potential to prevent/corrupt the Guest migration. Hence, introduce a separate struct vfio_device_ops for migration support which will override the ioctl/read/write/mmap methods to hide the migration region and limit the Guest access only to the functional register space. This will be used in subsequent patches when we add migration support to the driver. Please note that it is OK to export the entire VF BAR if migration is not supported or required as this cannot affect the PF configurations. Reviewed-by: Longfang Liu Signed-off-by: Shameer Kolothum Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220308184902.2242-6-shameerali.kolothum.thodi@huawei.com Signed-off-by: Alex Williamson drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 126 +++++++++++++++++++++++++ 1 file changed, 126 insertions(+) commit ee3a5b2359e0e5bf6198ffb3b330a12deacebf0f Author: Shameer Kolothum Date: Tue Mar 8 18:48:57 2022 +0000 hisi_acc_vfio_pci: add new vfio_pci driver for HiSilicon ACC devices Add a vendor-specific vfio_pci driver for HiSilicon ACC devices. This will be extended in subsequent patches to add support for VFIO live migration feature. Signed-off-by: Shameer Kolothum Reviewed-by: Kevin Tian Link: https://lore.kernel.org/r/20220308184902.2242-5-shameerali.kolothum.thodi@huawei.com Signed-off-by: Alex Williamson MAINTAINERS | 7 ++ drivers/vfio/pci/Kconfig | 2 + drivers/vfio/pci/Makefile | 2 + drivers/vfio/pci/hisilicon/Kconfig | 10 +++ drivers/vfio/pci/hisilicon/Makefile | 4 + drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 100 +++++++++++++++++++++++++ 6 files changed, 125 insertions(+) commit fae74feacd2dfb6172c4862fc760f969a991c06f Author: Shameer Kolothum Date: Tue Mar 8 18:48:56 2022 +0000 hisi_acc_qm: Move VF PCI device IDs to common header Move the PCI Device IDs of HiSilicon ACC VF devices to a common header and also use a uniform naming convention. This will be useful when we introduce the vfio PCI HiSilicon ACC live migration driver in subsequent patches. Cc: Bjorn Helgaas Acked-by: Zhou Wang Acked-by: Longfang Liu Acked-by: Kai Ye Signed-off-by: Shameer Kolothum Acked-by: Bjorn Helgaas # pci_ids.h Link: https://lore.kernel.org/r/20220308184902.2242-4-shameerali.kolothum.thodi@huawei.com Signed-off-by: Alex Williamson drivers/crypto/hisilicon/hpre/hpre_main.c | 13 ++++++------- drivers/crypto/hisilicon/sec2/sec_main.c | 15 +++++++-------- drivers/crypto/hisilicon/zip/zip_main.c | 11 +++++------ include/linux/pci_ids.h | 3 +++ 4 files changed, 21 insertions(+), 21 deletions(-) commit b4b084d7133284e29777ca445e001186259602d4 Author: Longfang Liu Date: Tue Mar 8 18:48:55 2022 +0000 crypto: hisilicon/qm: Move few definitions to common header Move Doorbell and Mailbox definitions to common header file. Also export QM mailbox functions. This will be useful when we introduce VFIO PCI HiSilicon ACC live migration driver. Signed-off-by: Longfang Liu Acked-by: Zhou Wang Signed-off-by: Shameer Kolothum Link: https://lore.kernel.org/r/20220308184902.2242-3-shameerali.kolothum.thodi@huawei.com Signed-off-by: Alex Williamson drivers/crypto/hisilicon/qm.c | 58 ++++++++++++++----------------------------- include/linux/hisi_acc_qm.h | 38 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 40 deletions(-) commit ff5812e00d5e7bdeae68784d99686eff67896931 Author: Shameer Kolothum Date: Tue Mar 8 18:48:54 2022 +0000 crypto: hisilicon/qm: Move the QM header to include/linux Since we are going to introduce VFIO PCI HiSilicon ACC driver for live migration in subsequent patches, move the ACC QM header file to a common include dir. Acked-by: Zhou Wang Acked-by: Longfang Liu Acked-by: Kai Ye Signed-off-by: Shameer Kolothum Link: https://lore.kernel.org/r/20220308184902.2242-2-shameerali.kolothum.thodi@huawei.com Signed-off-by: Alex Williamson drivers/crypto/hisilicon/hpre/hpre.h | 2 +- drivers/crypto/hisilicon/qm.c | 2 +- drivers/crypto/hisilicon/sec2/sec.h | 2 +- drivers/crypto/hisilicon/sgl.c | 2 +- drivers/crypto/hisilicon/zip/zip.h | 2 +- drivers/crypto/hisilicon/qm.h => include/linux/hisi_acc_qm.h | 0 6 files changed, 5 insertions(+), 5 deletions(-) commit 61ef1709ee603b1d4677682c643986e817d5c6a4 Author: Vincent Mailhol Date: Sun Mar 6 16:55:16 2022 +0900 usb: isp1760: remove redundant max_packet() macro The function usb_endpoint_maxp() (called by usb_maxpacket()) already does the sanitazation of the USB endpoint max packet size. The call to max_packet() does the same thing and is thus removed. The macro max_packet() not being used anymore also gets removed. Reviewed-by: Rui Miguel Silva Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220306075524.706660-3-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman drivers/usb/isp1760/isp1760-hcd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 7f1697b1a5e8f210b4fb76cb9c3c26ac3aa2caf4 Author: Vincent Mailhol Date: Sun Mar 6 16:55:15 2022 +0900 usb: oxu210hp-hcd: remove redundant call to max_packet() macro The function usb_endpoint_maxp() (called by usb_maxpacket()) already does the sanitazation of the USB endpoint max packet size. The call to max_packet() does the same thing and is thus removed. However, the macro max_packet() is kept because it is used elsewhere in the file. Signed-off-by: Vincent Mailhol Link: https://lore.kernel.org/r/20220306075524.706660-2-mailhol.vincent@wanadoo.fr Signed-off-by: Greg Kroah-Hartman drivers/usb/host/oxu210hp-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d790a9db918f7c2356ea2f775cd868551218fc07 Author: Alexander Stein Date: Wed Mar 9 10:38:42 2022 +0100 usb: common: usb-conn-gpio: Make VBUS supply completely optional It makes sense that if the USB connector is a child of an USB port providing VBUS supply, there is no need to do it again. But this does not handle the case where VBUS is controlled by PWR from USB host controller, without any regulator at all. Support this by making VBUS pure optional. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220309093842.113260-1-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman drivers/usb/common/usb-conn-gpio.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) commit b07cabb8361dc692522538205552b1b9dab134be Author: Dan Carpenter Date: Fri Mar 4 10:35:04 2022 +0300 USB: storage: ums-realtek: fix error code in rts51x_read_mem() The rts51x_read_mem() function should return negative error codes. Currently if the kmalloc() fails it returns USB_STOR_TRANSPORT_ERROR (3) which is treated as success by the callers. Fixes: 065e60964e29 ("ums_realtek: do not use stack memory for DMA") Acked-by: Alan Stern Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220304073504.GA26464@kili Signed-off-by: Greg Kroah-Hartman drivers/usb/storage/realtek_cr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 298ac860af9a0b604bcf06749a6acbd07548db99 Author: Peter Zijlstra Date: Fri Mar 4 16:19:56 2022 +0100 usb: early: xhci-dbc: Fix xdbc number parsing kstrtoul() assumes the string contains the number only and is \0 terminated, this is not the case, as such things like: earlyprintk=xdbc1,keep go completely sideways. Use simple_strtoul() instead. Acked-by: Mathias Nyman Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220304152136.035911620@infradead.org Signed-off-by: Greg Kroah-Hartman drivers/usb/early/xhci-dbc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit b0ae33a2d2fb6c55117b377ec4ae3f2c84eab6a2 Author: Peter Zijlstra Date: Fri Mar 4 16:19:55 2022 +0100 usb: early: xhci-dbc: Remove duplicate keep parsing The generic earlyprintk= parsing already parses the optional ",keep", no need to duplicate that in the xdbc driver. Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220304152135.975568860@infradead.org Signed-off-by: Greg Kroah-Hartman arch/x86/kernel/early_printk.c | 2 +- drivers/usb/early/xhci-dbc.c | 5 ++--- include/linux/usb/xhci-dbgp.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) commit 69f8aeab437c6bae1394673154917e0a218edb44 Author: Peter Zijlstra Date: Fri Mar 4 16:19:54 2022 +0100 x86/tsc: Be consistent about use_tsc_delay() Currently loops_per_jiffy is set in tsc_early_init(), but then don't switch to delay_tsc, with the result that delay_loop is used with loops_per_jiffy set for delay_tsc. Then in (late) tsc_init() lpj_fine is set (which is mostly unused) and after which use_tsc_delay() is finally called. Move both loops_per_jiffy and use_tsc_delay() into tsc_enable_sched_clock() which is called the moment tsc_khz is determined, be it early or late. Keeping the lot consistent. Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220304152135.914397165@infradead.org Signed-off-by: Greg Kroah-Hartman arch/x86/kernel/tsc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 977b94814006dd78a7853de696be8c5ef3f0e71b Author: Jakob Koschel Date: Tue Mar 8 18:18:18 2022 +0100 usb: gadget: udc: s3c2410: remove usage of list iterator past the loop body To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-27-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/s3c2410_udc.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit 7975f080d3557725160a878b1a64339043ba3d91 Author: Jakob Koschel Date: Tue Mar 8 18:18:17 2022 +0100 usb: gadget: dummy_hcd: remove usage of list iterator past the loop body To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-26-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/dummy_hcd.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit 2eb27f79eacdb28de141010e8d92bb72c10b1215 Author: Jakob Koschel Date: Tue Mar 8 18:18:16 2022 +0100 usb: gadget: udc: core: remove usage of list iterator past the loop body To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-25-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/core.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) commit d6f4663664cbd55650cc4d727114d83cacc985a6 Author: Jakob Koschel Date: Tue Mar 8 18:18:15 2022 +0100 usb: gadget: composite: remove usage of list iterator past the loop body To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-24-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/composite.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) commit ac5534188dc477685dd0f49965d858cb73ad2ec1 Author: Jakob Koschel Date: Tue Mar 8 18:18:14 2022 +0100 usb: gadget: pxa27x_udc: replace usage of rc to check if a list element was found To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-23-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/pxa27x_udc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) commit eb6dc99ea2364a149ad61dd04637ea3b20434304 Author: Jakob Koschel Date: Tue Mar 8 18:18:13 2022 +0100 usb: gadget: composite: remove check of list iterator against head past the loop body When list_for_each_entry() completes the iteration over the whole list without breaking the loop, the iterator value will be a bogus pointer computed based on the head element. While it is safe to use the pointer to determine if it was computed based on the head element, either with list_entry_is_head() or &pos->member == head, using the iterator variable after the loop should be avoided. In preparation to limiting the scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-22-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/composite.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 418947745c8e0e3835bd64a4123837d05ef808cd Author: Jakob Koschel Date: Tue Mar 8 18:18:12 2022 +0100 usb: gadget: tegra-xudc: remove using list iterator after loop body as a ptr If the list does not contain the expected element, the value of list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to list_for_each_entry() loop. In preparation to limiting scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Determining if an element was found is then simply checking if the pointer is != NULL instead of using the potentially bogus pointer. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-21-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/tegra-xudc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit b832eb1d578b8352cf8ea84d5dbd55e9089bc1b9 Author: Jakob Koschel Date: Tue Mar 8 18:18:11 2022 +0100 usb: gadget: udc: max3420_udc: remove using list iterator after loop body as a ptr If the list does not contain the expected element, the value of list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to list_for_each_entry() loop. In preparation to limiting scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Determining if an element was found is then simply checking if the pointer is != NULL instead of using the potentially bogus pointer. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-20-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/max3420_udc.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) commit eb6db9ccf6fb35f44f905d40ffbd667ddcc0e1cc Author: Jakob Koschel Date: Tue Mar 8 18:18:10 2022 +0100 usb: gadget: legacy: remove using list iterator after loop body as a ptr If the list does not contain the expected element, the value of list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to list_for_each_entry() loop. In preparation to limiting scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Determining if an element was found is then simply checking if the pointer is != NULL instead of using the potentially bogus pointer. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-19-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/legacy/hid.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) commit 36f4c25ce32ed8a2e6304ebee6246b7f0b3b9a6f Author: Jakob Koschel Date: Tue Mar 8 18:18:09 2022 +0100 usb: gadget: configfs: remove using list iterator after loop body as a ptr If the list does not contain the expected element, the value of list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to list_for_each_entry() loop. In preparation to limiting scope of a list iterator to the list traversal loop, use a dedicated pointer to point to the found element [1]. Determining if an element was found is then simply checking if the pointer is != NULL instead of using the potentially bogus pointer. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-18-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/configfs.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) commit 6163d4991172b8fff453d2260185d8af971b415e Author: Jakob Koschel Date: Tue Mar 8 18:18:08 2022 +0100 usb: gadget: aspeed: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-17-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/aspeed-vhub/epn.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit d0eeb4e3e48d3cc1d0ba316c53fd95d624303300 Author: Jakob Koschel Date: Tue Mar 8 18:18:07 2022 +0100 usb: gadget: udc-xilinx: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-16-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/udc-xilinx.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit b6c44bee2a1c2d05023c9faab609290614159005 Author: Jakob Koschel Date: Tue Mar 8 18:18:06 2022 +0100 usb: gadget: s3c-hsudc: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Reviewed-by: Krzysztof Kozlowski Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-15-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/s3c-hsudc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit d5d0b2805777fc5e007edb4a32349c912d886f94 Author: Jakob Koschel Date: Tue Mar 8 18:18:05 2022 +0100 usb: gadget: omap_udc: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-14-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/omap_udc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit b6f8cc55133a60a8de0cf30f8d581ca3adc810b3 Author: Jakob Koschel Date: Tue Mar 8 18:18:04 2022 +0100 usb: gadget: udc: net2280: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-13-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/net2280.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit e6169a870f5b0a656b368bf8901f1144b0fb6e22 Author: Jakob Koschel Date: Tue Mar 8 18:18:03 2022 +0100 usb: gadget: net2272: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-12-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/net2272.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) commit ac7a5d0535d20e399385500ea3272599407d903a Author: Jakob Koschel Date: Tue Mar 8 18:18:02 2022 +0100 usb: gadget: udc: mv_udc_core: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-11-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/mv_udc_core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 299dd6eb763127ee52d9c77c451451d5908ce464 Author: Jakob Koschel Date: Tue Mar 8 18:18:01 2022 +0100 usb: gadget: mv_u3d: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-10-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/mv_u3d_core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 4a2a73bf335b8856fbd3813e871ea5e791e222fd Author: Jakob Koschel Date: Tue Mar 8 18:18:00 2022 +0100 usb: gadget: lpc32xx_udc: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-9-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/lpc32xx_udc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 72149b816b85ee0b0e9e8211ea520e807a9ef0b2 Author: Jakob Koschel Date: Tue Mar 8 18:17:59 2022 +0100 usb: gadget: udc: gr_udc: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-8-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/gr_udc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 7336cccf04f9f88b7eb3ae9003ba169b473aeaad Author: Jakob Koschel Date: Tue Mar 8 18:17:58 2022 +0100 usb: gadget: goku_udc: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-7-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/goku_udc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 2390ea9c07167e538ce161f57f62b7d8231f6d73 Author: Jakob Koschel Date: Tue Mar 8 18:17:57 2022 +0100 usb: gadget: udc: at91: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-6-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/at91_udc.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) commit 07437ac54d25372cbcfc99879fd062485b2b0f06 Author: Jakob Koschel Date: Tue Mar 8 18:17:56 2022 +0100 usb: gadget: udc: pxa25x: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-5-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/pxa25x_udc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit 109122f36f34bc692ccf08b7dace705b0ad96542 Author: Jakob Koschel Date: Tue Mar 8 18:17:55 2022 +0100 usb: gadget: udc: atmel: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-4-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/atmel_usba_udc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit b6af554427adf9b5960295305d698442680f7caa Author: Jakob Koschel Date: Tue Mar 8 18:17:54 2022 +0100 usb: gadget: bdc: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-3-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/bdc/bdc_ep.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) commit 838884110f0d69136248d290a51c3b1d4882e092 Author: Jakob Koschel Date: Tue Mar 8 18:17:53 2022 +0100 usb: gadget: fsl: remove usage of list iterator past the loop body If the list representing the request queue does not contain the expected request, the value of the list_for_each_entry() iterator will not point to a valid structure. To avoid type confusion in such case, the list iterator scope will be limited to the list_for_each_entry() loop. In preparation to limiting scope of the list iterator to the list traversal loop, use a dedicated pointer to point to the found request object [1]. Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220308171818.384491-2-jakobkoschel@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/fsl_qe_udc.c | 13 ++++++++----- drivers/usb/gadget/udc/fsl_udc_core.c | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) commit 236541ace29edbc88ae4e81f3e4524f8e1d3fdf4 Author: Martin Povišer Date: Sat Mar 12 14:57:22 2022 +0100 clk: clk-apple-nco: Allow and fix module building Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220312135722.20770-1-povik+lin@cutebit.org Signed-off-by: Stephen Boyd drivers/clk/Kconfig | 2 +- drivers/clk/clk-apple-nco.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 4d9237e32c5db4f07f749a7ff1dd9b366bf3600e Author: Jens Axboe Date: Tue Mar 15 10:54:08 2022 -0600 io_uring: recycle apoll_poll entries Particularly for networked workloads, io_uring intensively uses its poll based backend to get a notification when data/space is available. Profiling workloads, we see 3-4% of alloc+free that is directly attributed to just the apoll allocation and free (and the rest being skb alloc+free). For the fast path, we have ctx->uring_lock held already for both issue and the inline completions, and we can utilize that to avoid any extra locking needed to have a basic recycling cache for the apoll entries on both the alloc and free side. Double poll still requires an allocation. But those are rare and not a fast path item. With the simple cache in place, we see a 3-4% reduction in overhead for the workload. Signed-off-by: Jens Axboe fs/io_uring.c | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) commit 686016f732420f88dd2e1d67cf4bb5dffdb93c82 Author: Srivatsa S. Bhat (VMware) Date: Thu Feb 24 14:24:49 2022 -0800 MAINTAINERS: Mark VMware mailing list entries as email aliases VMware mailing lists in the MAINTAINERS file are private lists meant for VMware-internal review/notification for patches to the respective subsystems. Anyone can post to these addresses, but there is no public read access like open mailing lists, which makes them more like email aliases instead (to reach out to reviewers). So update all the VMware mailing list references in the MAINTAINERS file to mark them as such, using "R: email-alias@vmware.com". Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Borislav Petkov Acked-by: Juergen Gross Acked-by: Joe Perches Acked-by: Zack Rusin Link: https://lore.kernel.org/r/164574148378.654750.15832494349474144706.stgit@csail.mit.edu MAINTAINERS | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) commit d69079d04f9319bfd4e90b788f19927142c55901 Author: Srivatsa S. Bhat (VMware) Date: Thu Feb 24 14:24:36 2022 -0800 MAINTAINERS: Add Zack as maintainer of vmmouse driver Zack Rusin will be taking over the maintainership of the VMware vmmouse driver. Update the MAINTAINERS file to reflect this change. Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Borislav Petkov Acked-by: Zack Rusin Link: https://lore.kernel.org/r/164574146977.654750.10918397477833459687.stgit@csail.mit.edu MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit 01683580c65ffe0ce72d52cfb5225b80b477c598 Author: Srivatsa S. Bhat (VMware) Date: Thu Feb 24 14:24:22 2022 -0800 MAINTAINERS: Update maintainers for paravirt ops and VMware hypervisor interface Deep has decided to transfer the joint-maintainership of paravirt ops to Srivatsa, and the maintainership of the VMware hypervisor interface to Srivatsa and Alexey. Update the MAINTAINERS file to reflect this change, and also add Alexey as a reviewer for paravirt ops. Signed-off-by: Srivatsa S. Bhat (VMware) Signed-off-by: Borislav Petkov Acked-by: Alexey Makhalov Acked-by: Deep Shah Acked-by: Juergen Gross Link: https://lore.kernel.org/r/164574143710.654750.17342470717937593195.stgit@csail.mit.edu MAINTAINERS | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 23a9dbbe0faf124fc4c139615633b9d12a3a89ef Author: Dan Carpenter Date: Tue Mar 15 18:34:06 2022 +0300 NFSD: prevent integer overflow on 32 bit systems On a 32 bit system, the "len * sizeof(*p)" operation can have an integer overflow. Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter Signed-off-by: Chuck Lever include/linux/sunrpc/xdr.h | 2 ++ 1 file changed, 2 insertions(+) commit f98d6dd1e79d4b04c2e13e91a9348473cfa805a6 Author: Guo Zhengkui Date: Tue Mar 15 21:01:26 2022 +0800 selftests/bpf: Clean up array_size.cocci warnings Clean up the array_size.cocci warnings under tools/testing/selftests/bpf/: Use `ARRAY_SIZE(arr)` instead of forms like `sizeof(arr)/sizeof(arr[0])`. tools/testing/selftests/bpf/test_cgroup_storage.c uses ARRAY_SIZE() defined in tools/include/linux/kernel.h (sys/sysinfo.h -> linux/kernel.h), while others use ARRAY_SIZE() in bpf_util.h. Signed-off-by: Guo Zhengkui Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220315130143.2403-1-guozhengkui@vivo.com tools/testing/selftests/bpf/prog_tests/cgroup_attach_autodetach.c | 2 +- tools/testing/selftests/bpf/prog_tests/cgroup_attach_multi.c | 2 +- tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c | 2 +- tools/testing/selftests/bpf/prog_tests/global_data.c | 6 +++--- tools/testing/selftests/bpf/prog_tests/obj_name.c | 2 +- tools/testing/selftests/bpf/test_cgroup_storage.c | 2 +- tools/testing/selftests/bpf/test_lru_map.c | 4 ++-- tools/testing/selftests/bpf/test_sock_addr.c | 6 +++--- tools/testing/selftests/bpf/test_sockmap.c | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) commit 8fa42d78f6354bb96ad3a079dcbef528ca9fa9e0 Author: Niklas Söderlund Date: Tue Mar 15 11:29:48 2022 +0100 samples/bpf, xdpsock: Fix race when running for fix duration of time When running xdpsock for a fix duration of time before terminating using --duration=, there is a race condition that may cause xdpsock to terminate immediately. When running for a fixed duration of time the check to determine when to terminate execution is in is_benchmark_done() and is being executed in the context of the poller thread, if (opt_duration > 0) { unsigned long dt = (get_nsecs() - start_time); if (dt >= opt_duration) benchmark_done = true; } However start_time is only set after the poller thread have been created. This leaves a small window when the poller thread is starting and calls is_benchmark_done() for the first time that start_time is not yet set. In that case start_time have its initial value of 0 and the duration check fails as it do not correlate correctly for the applications start time and immediately sets benchmark_done which in turn terminates the xdpsock application. Fix this by setting start_time before creating the poller thread. Fixes: d3f11b018f6c ("samples/bpf: xdpsock: Add duration option to specify how long to run") Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220315102948.466436-1-niklas.soderlund@corigine.com samples/bpf/xdpsock_user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 2486ab434b2c2a14e9237296db00b1e1b7ae3273 Author: Wang Yufen Date: Fri Mar 4 16:11:45 2022 +0800 bpf, sockmap: Fix double uncharge the mem of sk_msg If tcp_bpf_sendmsg is running during a tear down operation, psock may be freed. tcp_bpf_sendmsg() tcp_bpf_send_verdict() sk_msg_return() tcp_bpf_sendmsg_redir() unlikely(!psock)) sk_msg_free() The mem of msg has been uncharged in tcp_bpf_send_verdict() by sk_msg_return(), and would be uncharged by sk_msg_free() again. When psock is null, we can simply returning an error code, this would then trigger the sk_msg_free_nocharge in the error path of __SK_REDIRECT and would have the side effect of throwing an error up to user space. This would be a slight change in behavior from user side but would look the same as an error if the redirect on the socket threw an error. This issue can cause the following info: WARNING: CPU: 0 PID: 2136 at net/ipv4/af_inet.c:155 inet_sock_destruct+0x13c/0x260 Call Trace: __sk_destruct+0x24/0x1f0 sk_psock_destroy+0x19b/0x1c0 process_one_work+0x1b3/0x3c0 worker_thread+0x30/0x350 ? process_one_work+0x3c0/0x3c0 kthread+0xe6/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Wang Yufen Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220304081145.2037182-5-wangyufen@huawei.com net/ipv4/tcp_bpf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit 84472b436e760ba439e1969a9e3c5ae7c86de39d Author: Wang Yufen Date: Fri Mar 4 16:11:44 2022 +0800 bpf, sockmap: Fix more uncharged while msg has more_data In tcp_bpf_send_verdict(), if msg has more data after tcp_bpf_sendmsg_redir(): tcp_bpf_send_verdict() tosend = msg->sg.size //msg->sg.size = 22220 case __SK_REDIRECT: sk_msg_return() //uncharged msg->sg.size(22220) sk->sk_forward_alloc tcp_bpf_sendmsg_redir() //after tcp_bpf_sendmsg_redir, msg->sg.size=11000 goto more_data; tosend = msg->sg.size //msg->sg.size = 11000 case __SK_REDIRECT: sk_msg_return() //uncharged msg->sg.size(11000) to sk->sk_forward_alloc The msg->sg.size(11000) has been uncharged twice, to fix we can charge the remaining msg->sg.size before goto more data. This issue can cause the following info: WARNING: CPU: 0 PID: 9860 at net/core/stream.c:208 sk_stream_kill_queues+0xd4/0x1a0 Call Trace: inet_csk_destroy_sock+0x55/0x110 __tcp_close+0x279/0x470 tcp_close+0x1f/0x60 inet_release+0x3f/0x80 __sock_release+0x3d/0xb0 sock_close+0x11/0x20 __fput+0x92/0x250 task_work_run+0x6a/0xa0 do_exit+0x33b/0xb60 do_group_exit+0x2f/0xa0 get_signal+0xb6/0x950 arch_do_signal_or_restart+0xac/0x2a0 ? vfs_write+0x237/0x290 exit_to_user_mode_prepare+0xa9/0x200 syscall_exit_to_user_mode+0x12/0x30 do_syscall_64+0x46/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae WARNING: CPU: 0 PID: 2136 at net/ipv4/af_inet.c:155 inet_sock_destruct+0x13c/0x260 Call Trace: __sk_destruct+0x24/0x1f0 sk_psock_destroy+0x19b/0x1c0 process_one_work+0x1b3/0x3c0 worker_thread+0x30/0x350 ? process_one_work+0x3c0/0x3c0 kthread+0xe6/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Wang Yufen Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220304081145.2037182-4-wangyufen@huawei.com net/ipv4/tcp_bpf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 9c34e38c4a870eb30b13f42f5b44f42e9d19ccb8 Author: Wang Yufen Date: Fri Mar 4 16:11:43 2022 +0800 bpf, sockmap: Fix memleak in tcp_bpf_sendmsg while sk msg is full If tcp_bpf_sendmsg() is running while sk msg is full. When sk_msg_alloc() returns -ENOMEM error, tcp_bpf_sendmsg() goes to wait_for_memory. If partial memory has been alloced by sk_msg_alloc(), that is, msg_tx->sg.size is greater than osize after sk_msg_alloc(), memleak occurs. To fix we use sk_msg_trim() to release the allocated memory, then goto wait for memory. Other call paths of sk_msg_alloc() have the similar issue, such as tls_sw_sendmsg(), so handle sk_msg_trim logic inside sk_msg_alloc(), as Cong Wang suggested. This issue can cause the following info: WARNING: CPU: 3 PID: 7950 at net/core/stream.c:208 sk_stream_kill_queues+0xd4/0x1a0 Call Trace: inet_csk_destroy_sock+0x55/0x110 __tcp_close+0x279/0x470 tcp_close+0x1f/0x60 inet_release+0x3f/0x80 __sock_release+0x3d/0xb0 sock_close+0x11/0x20 __fput+0x92/0x250 task_work_run+0x6a/0xa0 do_exit+0x33b/0xb60 do_group_exit+0x2f/0xa0 get_signal+0xb6/0x950 arch_do_signal_or_restart+0xac/0x2a0 exit_to_user_mode_prepare+0xa9/0x200 syscall_exit_to_user_mode+0x12/0x30 do_syscall_64+0x46/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae WARNING: CPU: 3 PID: 2094 at net/ipv4/af_inet.c:155 inet_sock_destruct+0x13c/0x260 Call Trace: __sk_destruct+0x24/0x1f0 sk_psock_destroy+0x19b/0x1c0 process_one_work+0x1b3/0x3c0 kthread+0xe6/0x110 ret_from_fork+0x22/0x30 Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: Wang Yufen Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220304081145.2037182-3-wangyufen@huawei.com net/core/skmsg.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) commit 938d3480b92fa5e454b7734294f12a7b75126f09 Author: Wang Yufen Date: Fri Mar 4 16:11:42 2022 +0800 bpf, sockmap: Fix memleak in sk_psock_queue_msg If tcp_bpf_sendmsg is running during a tear down operation we may enqueue data on the ingress msg queue while tear down is trying to free it. sk1 (redirect sk2) sk2 ------------------- --------------- tcp_bpf_sendmsg() tcp_bpf_send_verdict() tcp_bpf_sendmsg_redir() bpf_tcp_ingress() sock_map_close() lock_sock() lock_sock() ... blocking sk_psock_stop sk_psock_clear_state(psock, SK_PSOCK_TX_ENABLED); release_sock(sk); lock_sock() sk_mem_charge() get_page() sk_psock_queue_msg() sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED); drop_sk_msg() release_sock() While drop_sk_msg(), the msg has charged memory form sk by sk_mem_charge and has sg pages need to put. To fix we use sk_msg_free() and then kfee() msg. This issue can cause the following info: WARNING: CPU: 0 PID: 9202 at net/core/stream.c:205 sk_stream_kill_queues+0xc8/0xe0 Call Trace: inet_csk_destroy_sock+0x55/0x110 tcp_rcv_state_process+0xe5f/0xe90 ? sk_filter_trim_cap+0x10d/0x230 ? tcp_v4_do_rcv+0x161/0x250 tcp_v4_do_rcv+0x161/0x250 tcp_v4_rcv+0xc3a/0xce0 ip_protocol_deliver_rcu+0x3d/0x230 ip_local_deliver_finish+0x54/0x60 ip_local_deliver+0xfd/0x110 ? ip_protocol_deliver_rcu+0x230/0x230 ip_rcv+0xd6/0x100 ? ip_local_deliver+0x110/0x110 __netif_receive_skb_one_core+0x85/0xa0 process_backlog+0xa4/0x160 __napi_poll+0x29/0x1b0 net_rx_action+0x287/0x300 __do_softirq+0xff/0x2fc do_softirq+0x79/0x90 WARNING: CPU: 0 PID: 531 at net/ipv4/af_inet.c:154 inet_sock_destruct+0x175/0x1b0 Call Trace: __sk_destruct+0x24/0x1f0 sk_psock_destroy+0x19b/0x1c0 process_one_work+0x1b3/0x3c0 ? process_one_work+0x3c0/0x3c0 worker_thread+0x30/0x350 ? process_one_work+0x3c0/0x3c0 kthread+0xe6/0x110 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x22/0x30 Fixes: 9635720b7c88 ("bpf, sockmap: Fix memleak on ingress msg enqueue") Signed-off-by: Wang Yufen Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/20220304081145.2037182-2-wangyufen@huawei.com include/linux/skmsg.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) commit c24f657791fd2df9d7a5491ac43b63658ea7187d Author: Dan Carpenter Date: Mon Mar 14 17:03:27 2022 +0300 net: sparx5: fix a couple warning messages The WARN_ON() macro takes a condition, not a warning message. Fixes: 0933bd04047c ("net: sparx5: Add support for ptp clocks") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220314140327.GB30883@kili Signed-off-by: Paolo Abeni drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ecb0a2f1e9e263645c9344e898423937ea842551 Author: Shruthi Sanil Date: Tue Mar 8 22:38:48 2022 +0530 usb: dwc3: pci: Add support for Intel Alder Lake Add the PCI device ID and update the dwc3_pci_id_table for Intel Alder Lake SoC. The DWC3 controllor in the CPU block handles the USB3 traffic and the device ID is common across the Alder Lake platforms. Reviewed-by: Heikki Krogerus Signed-off-by: Shruthi Sanil Link: https://lore.kernel.org/r/20220308170848.30722-1-shruthi.sanil@intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/dwc3-pci.c | 4 ++++ 1 file changed, 4 insertions(+) commit ac01df343e5a6c6bcead2ed421af1fde30f73e7e Author: H. Nikolaus Schaller Date: Tue Mar 8 14:03:37 2022 +0100 usb: dwc3: omap: fix "unbalanced disables for smps10_out1" on omap5evm Usually, the vbus_regulator (smps10 on omap5evm) boots up disabled. Hence calling regulator_disable() indirectly through dwc3_omap_set_mailbox() during probe leads to: [ 10.332764] WARNING: CPU: 0 PID: 1628 at drivers/regulator/core.c:2853 _regulator_disable+0x40/0x164 [ 10.351919] unbalanced disables for smps10_out1 [ 10.361298] Modules linked in: dwc3_omap(+) clk_twl6040 at24 gpio_twl6040 palmas_gpadc palmas_pwrbutton industrialio snd_soc_omap_mcbsp(+) snd_soc_ti_sdma display_connector ti_tpd12s015 drm leds_gpio drm_panel_orientation_quirks ip_tables x_tables ipv6 autofs4 [ 10.387818] CPU: 0 PID: 1628 Comm: systemd-udevd Not tainted 5.17.0-rc1-letux-lpae+ #8139 [ 10.405129] Hardware name: Generic OMAP5 (Flattened Device Tree) [ 10.411455] unwind_backtrace from show_stack+0x10/0x14 [ 10.416970] show_stack from dump_stack_lvl+0x40/0x4c [ 10.422313] dump_stack_lvl from __warn+0xb8/0x170 [ 10.427377] __warn from warn_slowpath_fmt+0x70/0x9c [ 10.432595] warn_slowpath_fmt from _regulator_disable+0x40/0x164 [ 10.439037] _regulator_disable from regulator_disable+0x30/0x64 [ 10.445382] regulator_disable from dwc3_omap_set_mailbox+0x8c/0xf0 [dwc3_omap] [ 10.453116] dwc3_omap_set_mailbox [dwc3_omap] from dwc3_omap_probe+0x2b8/0x394 [dwc3_omap] [ 10.467021] dwc3_omap_probe [dwc3_omap] from platform_probe+0x58/0xa8 [ 10.481762] platform_probe from really_probe+0x168/0x2fc [ 10.481782] really_probe from __driver_probe_device+0xc4/0xd8 [ 10.481782] __driver_probe_device from driver_probe_device+0x24/0xa4 [ 10.503762] driver_probe_device from __driver_attach+0xc4/0xd8 [ 10.510018] __driver_attach from bus_for_each_dev+0x64/0xa0 [ 10.516001] bus_for_each_dev from bus_add_driver+0x148/0x1a4 [ 10.524880] bus_add_driver from driver_register+0xb4/0xf8 [ 10.530678] driver_register from do_one_initcall+0x90/0x1c4 [ 10.536661] do_one_initcall from do_init_module+0x4c/0x200 [ 10.536683] do_init_module from load_module+0x13dc/0x1910 [ 10.551159] load_module from sys_finit_module+0xc8/0xd8 [ 10.561319] sys_finit_module from __sys_trace_return+0x0/0x18 [ 10.561336] Exception stack(0xc344bfa8 to 0xc344bff0) [ 10.561341] bfa0: b6fb5778 b6fab8d8 00000007 b6ecfbb8 00000000 b6ed0398 [ 10.561341] bfc0: b6fb5778 b6fab8d8 855c0500 0000017b 00020000 b6f9a3cc 00000000 b6fb5778 [ 10.595500] bfe0: bede18f8 bede18e8 b6ec9aeb b6dda1c2 [ 10.601345] ---[ end trace 0000000000000000 ]--- Fix this unnecessary warning by checking if the regulator is enabled. Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/af3b750dc2265d875deaabcf5f80098c9645da45.1646744616.git.hns@goldelico.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/dwc3-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit aa6812be1feb75139b9bc263915b3f1ceeb4e154 Author: Thinh Nguyen Date: Mon Mar 7 18:59:56 2022 -0800 usb: dwc3: gadget: Give some time to schedule isoc Currently the driver will schedule isoc transfers immediately on the next interval, which is quite aggressive when the interval is 125us. There's report that some platforms may need more time to process the transfer, otherwise the controller may miss the first interval. Let's keep it simple and give the controller at least 500us to schedule the isoc transfer. Link: https://lore.kernel.org/linux-usb/20220302143539.GI11577@pengutronix.de/ Tested-by: Michael Grzeschik Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/deb8146b8e1f7f8495ef2d5647017270934cb2d8.1646708142.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/gadget.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 62b20e6e0dde8d5633e3d94b028f86fb24b31d22 Author: Bin Yang Date: Mon Feb 28 08:56:56 2022 -0500 usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode In the 3.0 device core, if the core is programmed to operate in 2.0 only, then setting the GUCTL1.DEV_FORCE_20_CLK_FOR_30_CLK makes the internal 2.0(utmi/ulpi) clock to be routed as the 3.0 (pipe) clock. Enabling this feature allows the pipe3 clock to be not-running when forcibly operating in 2.0 device mode. Tested-by: Michael Riesch Signed-off-by: Bin Yang Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220228135700.1089526-6-pgwipeout@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/core.c | 5 +++++ drivers/usb/dwc3/core.h | 1 + 2 files changed, 6 insertions(+) commit 62a13a9c0046b2224af6aa6e39c54f89a06245d4 Author: Michael Riesch Date: Mon Feb 28 08:56:54 2022 -0500 dt-bindings: usb: add rk3568 compatible to rockchip, dwc3 Add the compatible for the Rockchip RK3568 variant. Tested-by: Michael Riesch Signed-off-by: Michael Riesch Link: https://lore.kernel.org/r/20220228135700.1089526-4-pgwipeout@gmail.com Signed-off-by: Greg Kroah-Hartman Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml | 2 ++ 1 file changed, 2 insertions(+) commit 290918c72a2973ffc876d8efb4da304bf7aaea8f Author: Alexander Stein Date: Fri Feb 18 16:27:07 2022 +0100 arm64: dts: imx8mp: Add memory for USB3 glue layer to usb3 nodes The USB3 glue layer has 2 areas in the register set, see RM Rev.1 section 11.2.5.2.1 GLUE_usb3 memory map: * USB3 control/status * PHY control/status Provide the memory area to the usb3 nodes for accessing the features in the USB3 control area. Reviewed-by: Li Jun Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220218152707.2198357-5-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman arch/arm64/boot/dts/freescale/imx8mp.dtsi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 9d52107185b646d449b682e10e95e6b3037b79cf Author: Alexander Stein Date: Fri Feb 18 16:27:06 2022 +0100 usb: dwc3: imx8mp: Add support for setting SOC specific flags The i.MX8MP glue layer has support for the following flags: * over-current polarity * PWR pad polarity * controlling PPC flag in HCCPARAMS register * permanent port attach for usb2 & usb3 port Allow setting these flags by supporting specific flags in the glue node. In order to get this to work an additional IORESOURCE_MEM and clock is necessary. For backward compatibility this is purely optional. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220218152707.2198357-4-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/dwc3-imx8mp.c | 63 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) commit d600d31e37dc50c4a99f3e73f8b467ea33f1475f Author: Alexander Stein Date: Fri Feb 18 16:27:05 2022 +0100 dt-bindings: usb: dwc3-imx8mp: Add imx8mp specific flags This adds bindings for features in the USB glue block. They allow setting polarity of PWR and OC as well as disabling port power control. Also permanently attached can be annotated as well. Additional IO address and clock are needed. Reviewed-by: Rob Herring Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220218152707.2198357-3-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman .../devicetree/bindings/usb/fsl,imx8mp-dwc3.yaml | 31 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) commit 81915384b5d127c67bfb4d19a62ec193e12eaaef Author: Alexander Stein Date: Fri Feb 18 16:27:04 2022 +0100 usb: dwc3: imx8mp: rename iomem base pointer Until now the iomem used is not USB glue as the name suggests, but HSIO BLK_CTL. Rename the struct member accordingly. This is a preparing patch for when USB glue is actually used. Reviewed-by: Li Jun Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220218152707.2198357-2-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/dwc3-imx8mp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit bced4afc536dcfc98e4dd32dcaecdb17be03315d Author: Souradeep Chowdhury Date: Fri Feb 25 18:33:01 2022 +0530 Revert "arm64: dts: qcom: sc7280: Add EUD dt node and dwc3 connector" This reverts commit a0c68e493007a8c72b6b00f6ac95590a86edc937. Revert all the changes to add the Embedded USB Debugger(EUD) Node in the device tree, the connector node and also changes to usb2 Node associated with this.The changes need to be reverted as DT changes for QCOM should go through the QCOM tree and not the USB tree. Signed-off-by: Souradeep Chowdhury Link: https://lore.kernel.org/r/8c863e7e76003511dff36383b518ab66d2dd6552.1645793187.git.quic_schowdhu@quicinc.com Signed-off-by: Greg Kroah-Hartman arch/arm64/boot/dts/qcom/sc7280.dtsi | 36 ------------------------------------ 1 file changed, 36 deletions(-) commit 45a7dbf484aa13e2ac7ce909096e2fddae2b13f0 Author: Souradeep Chowdhury Date: Fri Feb 25 18:33:00 2022 +0530 Revert "arm64: dts: qcom: sc7280: Set the default dr_mode for usb2" This reverts commit c18553956f34819e224a79c9890eba2ba0604e15. Revert the change to set dr_mode for usb2 in case of Embedded USB Debugger(EUD). This change needs to be reverted as the DT changes for QCOM should go through the QCOM tree and not the USB tree. Signed-off-by: Souradeep Chowdhury Link: https://lore.kernel.org/r/87008876afb33d8e1b7fd78d2fd5b6d9ec343d7d.1645793187.git.quic_schowdhu@quicinc.com Signed-off-by: Greg Kroah-Hartman arch/arm64/boot/dts/qcom/sc7280-idp.dts | 4 ---- 1 file changed, 4 deletions(-) commit 850ebb27aed8eb2e68522791ed2fa23cecb07ff5 Author: Heiner Kallweit Date: Sun Mar 6 21:59:45 2022 +0100 usb: dwc3-meson-g12a: constify drvdata structs Constify the drvdata structs. This also matches the definition of member drvdata in dwc3_meson_g12a. Reviewed-by: Neil Armstrong Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/a3c178c9-7c33-d7b8-9f6e-734dc28728ab@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/dwc3/dwc3-meson-g12a.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 0d48aee69c71f073571dbbf6da119cc12fea70df Author: Wei Ming Chen Date: Fri Mar 11 16:29:45 2022 +0800 usb: raw-gadget: return -EINVAL if no proper ep address available If we try to use raw_ioctl_ep_enable() for ep5in on a hardware that only support from ep1-ep4 for both in and out direction, it will return -EBUSY originally. I think it will be more intuitive if we return -EINVAL, because -EBUSY sounds like ep5in is not available now, but might be available in the future. Reviewed-by: Andrey Konovalov Signed-off-by: Wei Ming Chen Link: https://lore.kernel.org/r/20220311082944.4881-1-jj251510319013@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/legacy/raw_gadget.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) commit 801109b1a37ad99784e6370cc7e462596f505ea3 Author: Krzysztof Kozlowski Date: Mon Mar 14 19:18:30 2022 +0100 dt-bindings: usb: hcd: correct usb-device path The usb-device.yaml reference is absolute so it should use /schemas part in path. Fixes: 23bf6fc7046c ("dt-bindings: usb: convert usb-device.txt to YAML schema") Cc: Reported-by: Rob Herring Acked-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220314181830.245853-1-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman Documentation/devicetree/bindings/usb/usb-hcd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit beb8518e26625a0ab06782519b1d0da429542b22 Author: Julia Lawall Date: Sat Mar 12 11:27:05 2022 +0100 usb: raw-gadget: use kzalloc Use kzalloc instead of kmalloc + memset. The semantic patch that makes this change is: (https://coccinelle.gitlabpages.inria.fr/website/) // @@ expression res, size, flag; @@ - res = kmalloc(size, flag); + res = kzalloc(size, flag); ... - memset(res, 0, size); // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220312102705.71413-7-Julia.Lawall@inria.fr Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/legacy/raw_gadget.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 32d8bb3ed80b6b8eda50d75ae2475e2e9b6113d2 Author: Julia Lawall Date: Mon Mar 14 12:53:35 2022 +0100 usb: gadget: udc: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220314115354.144023-12-Julia.Lawall@inria.fr Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/snps_udc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1868755c9078cda1a3a4abd866edd42f9a46b1ed Author: Vihas Makwana Date: Thu Mar 10 02:20:47 2022 +0530 staging: r8188eu: proper error handling in rtw_init_drv_sw The code inside rtw_init_drv_sw() calls various init functions to populate the padapter structure and checks for their return values respectively. But if one of the functions in middle fails then it simply returns _FAIL instead of proper logging and calling freeing counterparts of previous init functions. This leads to various memory leaks and can be found in /sys/kernel/debug/kmemleak if kernel is compiled with DEBUG_KMEMLEAK=y. Fix this and keep the success and error separate. Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver") Reviewed-by: Dan Carpenter Reviewed-by: Pavel Skripkin Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220309205047.45981-3-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/os_dep/os_intfs.c | 60 ++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 13 deletions(-) commit 57a42b4d73f9d6f6fbe8b11f22453e1bc3183648 Author: Vihas Makwana Date: Thu Mar 10 02:20:46 2022 +0530 staging: r8188eu: call _cancel_timer_ex from _rtw_free_recv_priv The _rtw_init_recv_priv() initializes precvpriv->signal_stat_timer and sets it's timeout interval to 1000 ms. But _rtw_free_recv_priv() doesn't cancel the timer and we need to explicitly call _cancel_timer_ex() after we call _rtw_free_recv_priv() to cancel the timer. Call _cancel_timer_ex() from inside _rtw_free_recv_priv() as every init function needs a matching free function. Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220309205047.45981-2-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 1 + 1 file changed, 1 insertion(+) commit cff7326792f78815c20f33e509959682157a609a Author: Philipp Hortmann Date: Mon Mar 14 20:31:11 2022 +0100 staging: vt6656: Removed unused variable vt3342_vnt_threshold Missing part of staging: vt6656: Remove unused rf_type in baseband.c Reported-by: kernel test robot Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/6e1ef287e66039f9013435f8fa1266de7387df2e.1647284830.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6656/baseband.c | 24 ------------------------ 1 file changed, 24 deletions(-) commit 203b43db788b25c256fa55410deecd2ebfe0a8c2 Author: Philipp Hortmann Date: Mon Mar 14 20:31:05 2022 +0100 staging: vt6656: Removed unused variable bb_vga_0 Missing part of staging: vt6656: Remove unused rf_type in card.c Reported-by: kernel test robot Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/09f65cf4839b089ad38f28ff691d5146e6095e58.1647284830.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6656/card.c | 2 -- 1 file changed, 2 deletions(-) commit 583024cf22396491d54104144ee45859265d1d55 Merge: 231fdac3e58f ed2ae69c4053 Author: Paolo Abeni Date: Tue Mar 15 14:43:51 2022 +0100 Merge branch 'netdevsim-support-for-l3-hw-stats' Petr Machata says: ==================== netdevsim: Support for L3 HW stats "L3 stats" is a suite of interface statistics aimed at reflecting traffic taking place in a HW device, on an object corresponding to some software netdevice. Support for this stats suite has been added recently, in commit ca0a53dcec94 ("Merge branch 'net-hw-counters-for-soft-devices'"). In this patch set: - Patch #1 adds support for L3 stats to netdevsim. Real devices can have various conditions for when an L3 counter is available. To simulate this, netdevsim maintains a list of devices suitable for HW stats collection. Only when l3_stats is enabled on both a netdevice itself, and in netdevsim, will netdevsim contribute values to L3 stats. This enablement and disablement is done via debugfs: # echo $ifindex > /sys/kernel/debug/netdevsim/$DEV/hwstats/l3/enable_ifindex # echo $ifindex > /sys/kernel/debug/netdevsim/$DEV/hwstats/l3/disable_ifindex Besides this, there is a third toggle to mark a device for future failure: # echo $ifindex > /sys/kernel/debug/netdevsim/$DEV/hwstats/l3/fail_next_enable - This allows HW-independent testing of stats reporting and in-kernel APIs, as well as a test for enablement rollback, which is difficult to do otherwise. This netdevsim-specific selftest is added in patch #2. - Patch #3 adds another driver-specific selftest, namely a test aimed at checking mlxsw-induced stats monitoring events. ==================== Link: https://lore.kernel.org/r/cover.1647265833.git.petrm@nvidia.com Signed-off-by: Paolo Abeni commit 62cb1cfed62bd50b638b016a6396624de2a43159 Merge: 7e963fb2a33c 2002c13243d5 Author: Mark Brown Date: Tue Mar 15 13:38:55 2022 +0000 fix typos in comments Merge series from Julia Lawall : Various spelling mistakes in comments. Detected with the help of Coccinelle. --- drivers/base/devres.c | 4 ++-- drivers/clk/qcom/gcc-sm6125.c | 2 +- drivers/clk/ti/clkctrl.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 ++-- drivers/gpu/drm/amd/display/dc/bios/command_table.c | 6 +++--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 2 +- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++-- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/infiniband/hw/qib/qib_iba7220.c | 4 ++-- drivers/leds/leds-pca963x.c | 2 +- drivers/media/i2c/ov5695.c | 2 +- drivers/mfd/rohm-bd9576.c | 2 +- drivers/mtd/ubi/block.c | 2 +- drivers/net/can/usb/ucan.c | 4 ++-- drivers/net/ethernet/packetengines/yellowfin.c | 2 +- drivers/net/wireless/ath/ath6kl/htc_mbox.c | 2 +- drivers/net/wireless/cisco/airo.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +- drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c | 6 +++--- drivers/platform/x86/uv_sysfs.c | 2 +- drivers/s390/crypto/pkey_api.c | 2 +- drivers/scsi/aic7xxx/aicasm/aicasm.c | 2 +- drivers/scsi/elx/libefc_sli/sli4.c | 2 +- drivers/scsi/lpfc/lpfc_mbox.c | 2 +- drivers/scsi/qla2xxx/qla_gs.c | 2 +- drivers/spi/spi-sun4i.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +- drivers/usb/gadget/udc/snps_udc_core.c | 2 +- fs/kernfs/file.c | 2 +- kernel/events/core.c | 2 +- 30 files changed, 39 insertions(+), 39 deletions(-) commit 184416d4b98509fb4c3d8fc3d6dc1437896cc159 Author: Dan Carpenter Date: Tue Mar 15 13:30:09 2022 +0300 NFSD: prevent underflow in nfssvc_decode_writeargs() Smatch complains: fs/nfsd/nfsxdr.c:341 nfssvc_decode_writeargs() warn: no lower bound on 'args->len' Change the type to unsigned to prevent this issue. Cc: stable@vger.kernel.org Signed-off-by: Dan Carpenter Signed-off-by: Chuck Lever fs/nfsd/nfsproc.c | 2 +- fs/nfsd/xdr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 721412ed3d819e767cac2b06646bf03aa158aaec Author: Christoph Hellwig Date: Tue Mar 15 13:34:57 2022 +0100 staging: remove ashmem The mainline replacement for ashmem is memfd, so remove the legacy code from drivers/staging/ Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220315123457.2354812-1-hch@lst.de Signed-off-by: Greg Kroah-Hartman drivers/staging/Kconfig | 2 - drivers/staging/Makefile | 1 - drivers/staging/android/Kconfig | 19 - drivers/staging/android/Makefile | 4 - drivers/staging/android/TODO | 8 - drivers/staging/android/ashmem.c | 970 ---------------------------------- drivers/staging/android/ashmem.h | 24 - drivers/staging/android/uapi/ashmem.h | 43 -- 8 files changed, 1071 deletions(-) commit ed2ae69c40537ac3250a318f344722fef0c4f67c Author: Petr Machata Date: Mon Mar 14 15:01:17 2022 +0100 selftests: mlxsw: hw_stats_l3: Add a new test Add a test that verifies that UAPI notifications are emitted, as mlxsw installs and deinstalls HW counters for the L3 offload xstats. Signed-off-by: Petr Machata Signed-off-by: Paolo Abeni .../selftests/drivers/net/mlxsw/hw_stats_l3.sh | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) commit 9b18942e9993aef24bdeb294adf1d48c305188bd Author: Petr Machata Date: Mon Mar 14 15:01:16 2022 +0100 selftests: netdevsim: hw_stats_l3: Add a new test Add a test that verifies basic UAPI contracts, netdevsim operation, rollbacks after partial enablement in core, and UAPI notifications. Signed-off-by: Petr Machata Signed-off-by: Paolo Abeni .../selftests/drivers/net/netdevsim/hw_stats_l3.sh | 421 +++++++++++++++++++++ tools/testing/selftests/net/forwarding/lib.sh | 60 +++ 2 files changed, 481 insertions(+) commit 1a6d7ae7d63c4572676f4cc94aa35a73dc14a757 Author: Petr Machata Date: Mon Mar 14 15:01:15 2022 +0100 netdevsim: Introduce support for L3 offload xstats Add support for testing of HW stats support that was added recently, namely the L3 stats support. L3 stats are provided for devices for which the L3 stats have been turned on, and that were enabled for netdevsim through a debugfs toggle: # echo $ifindex > /sys/kernel/debug/netdevsim/$DEV/hwstats/l3/enable_ifindex For fully enabled netdevices, netdevsim counts 10pps of ingress traffic and 20pps of egress traffic. Similarly, L3 stats can be disabled for a given device, and netdevsim ceases pretending there is any HW traffic going on: # echo $ifindex > /sys/kernel/debug/netdevsim/$DEV/hwstats/l3/disable_ifindex Besides this, there is a third toggle to mark a device for future failure: # echo $ifindex > /sys/kernel/debug/netdevsim/$DEV/hwstats/l3/fail_next_enable A future request to enable L3 stats on such netdevice will be bounced by netdevsim: # ip -j l sh dev d | jq '.[].ifindex' 66 # echo 66 > /sys/kernel/debug/netdevsim/netdevsim10/hwstats/l3/enable_ifindex # echo 66 > /sys/kernel/debug/netdevsim/netdevsim10/hwstats/l3/fail_next_enable # ip stats set dev d l3_stats on Error: netdevsim: Stats enablement set to fail. Signed-off-by: Petr Machata Reviewed-by: Ido Schimmel Acked-by: Jakub Kicinski Signed-off-by: Paolo Abeni drivers/net/netdevsim/Makefile | 2 +- drivers/net/netdevsim/dev.c | 17 +- drivers/net/netdevsim/hwstats.c | 486 ++++++++++++++++++++++++++++++++++++++ drivers/net/netdevsim/netdevsim.h | 23 ++ 4 files changed, 525 insertions(+), 3 deletions(-) commit 7e63df00cf5e609ebbee5ffbc3df1900d8a4443c Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:10 2022 +0000 mm: Convert swap_set_page_dirty() to swap_dirty_folio() Straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs include/linux/swap.h | 2 +- mm/page_io.c | 18 ++++++++++-------- mm/swap_state.c | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) commit 1f1d14dbc39a3e99b64322097893d7d147c0f466 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:09 2022 +0000 ubifs: Convert ubifs_set_page_dirty to ubifs_dirty_folio Removes a call to __set_page_dirty_nobuffers(). Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/ubifs/file.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit cbc975b182a073d3bc72b487e47e741a05c19493 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:08 2022 +0000 f2fs: Convert f2fs_set_node_page_dirty to f2fs_dirty_node_folio Removes a call to __set_page_dirty_nobuffers(). Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/f2fs/node.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) commit 4f5e34f713185cb562a796567556bff7d9c7418d Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:07 2022 +0000 f2fs: Convert f2fs_set_data_page_dirty to f2fs_dirty_data_folio Removes several calls to __set_page_dirty_nobuffers(). Also turn the PageSwapCache() case into a BUG() as there's no way for a swapcache page to make it to a filesystem that doesn't use SWP_FS_OPS. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/f2fs/checkpoint.c | 4 ++-- fs/f2fs/data.c | 34 +++++++++++++++++----------------- fs/f2fs/f2fs.h | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) commit 1d9ac659ff782bea6107a8feecf62eb626864021 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:06 2022 +0000 f2fs: Convert f2fs_set_meta_page_dirty to f2fs_dirty_meta_folio Removes a call to __set_page_dirty_nobuffers(). Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/f2fs/checkpoint.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) commit d7c994b34c80b661da647833e7e13d7ed04894f0 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:05 2022 +0000 afs: Convert afs_dir_set_page_dirty() to afs_dir_dirty_folio() This is a trivial change. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/afs/dir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit ebf55c886eb7fc3c54d02ba1046f0ee38b81fc10 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:04 2022 +0000 btrfs: Convert extent_range_redirty_for_io() to use folios This removes a call to __set_page_dirty_nobuffers(). Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/btrfs/extent_io.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit 187c82cb03808ede4ee6f36aabbeb74213cd4928 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:03 2022 +0000 fs: Convert trivial uses of __set_page_dirty_nobuffers to filemap_dirty_folio These filesystems use __set_page_dirty_nobuffers() either directly or with a very thin wrapper; convert them en masse. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/btrfs/inode.c | 7 +------ fs/ext4/inode.c | 21 +++++++++++---------- fs/fuse/file.c | 2 +- fs/gfs2/aops.c | 2 +- fs/hostfs/hostfs_kern.c | 3 ++- fs/jfs/jfs_metapage.c | 2 +- fs/nfs/file.c | 2 +- fs/ntfs/aops.c | 4 +--- fs/orangefs/inode.c | 2 +- fs/vboxsf/file.c | 2 +- fs/xfs/xfs_aops.c | 2 +- fs/zonefs/super.c | 2 +- 12 files changed, 23 insertions(+), 28 deletions(-) commit 0079c3b17631c206eed77a8a17c513cc162b9f8d Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:02 2022 +0000 btrfs: Convert from set_page_dirty to dirty_folio Optimise the non-DEBUG case to just call filemap_dirty_folio directly. The DEBUG case doesn't actually compile, but convert it to dirty_folio anyway. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/btrfs/disk-io.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) commit 8fb72b4a76933ae6f86725cc8e4a8190ba84d755 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:01 2022 +0000 fscache: Convert fscache_set_page_dirty() to fscache_dirty_folio() Convert all users of fscache_set_page_dirty to use fscache_dirty_folio. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs Documentation/filesystems/caching/netfs-api.rst | 7 ++++--- fs/9p/vfs_addr.c | 10 ++++----- fs/afs/file.c | 2 +- fs/afs/internal.h | 4 ++-- fs/afs/write.c | 5 +++-- fs/ceph/addr.c | 27 ++++++++++++------------ fs/ceph/cache.h | 13 ++++++------ fs/cifs/file.c | 11 +++++----- fs/fscache/io.c | 28 +++++++++++++------------ include/linux/fscache.h | 8 ++++--- 10 files changed, 61 insertions(+), 54 deletions(-) commit 6f31a5a261dbbe7bf7f585dfe81f8acd4b25ec3b Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:22:00 2022 +0000 fs: Add aops->dirty_folio This replaces ->set_page_dirty(). It returns a bool instead of an int and takes the address_space as a parameter instead of expecting the implementations to retrieve the address_space from the page. This is particularly important for filesystems which use FS_OPS for swap. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs Documentation/filesystems/locking.rst | 15 ++++++++------- Documentation/filesystems/vfs.rst | 16 ++++++++-------- include/linux/fs.h | 1 + mm/page-writeback.c | 17 ++++++++++------- mm/page_io.c | 5 ++++- 5 files changed, 31 insertions(+), 23 deletions(-) commit 072acba6d08730beba5bad293c7ce6d0c4b0624c Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:59 2022 +0000 fs: Remove aops->launder_page With all users converted to ->launder_folio, remove ->launder_page. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs include/linux/fs.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit eabf038f4e366c2172c1322d5e36bb477a763adc Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:58 2022 +0000 orangefs: Convert launder_page to launder_folio OrangeFS launders its pages from a number of locations, so add a small amount of folio usage to its callers where it makes sense. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/orangefs/inode.c | 69 ++++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 33 deletions(-) commit 15a30ab2b35b02a9f2cf7f78f5b5709b484c9a18 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:57 2022 +0000 nfs: Convert from launder_page to launder_folio We don't need to use page_file_mapping() here because launder_folio is never called for swap cache pages. We also don't need to cast an loff_t in order to print it. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/nfs/file.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit 2bf06b8e64280251775011f63d44e7bfc48dbdfd Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:56 2022 +0000 fuse: Convert from launder_page to launder_folio Straightforward conversion although the helper functions still assume a single page. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/fuse/dir.c | 2 +- fs/fuse/file.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) commit ff2b48b96599b46edbcef1281502ef46edcb24c4 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:55 2022 +0000 cifs: Convert from launder_page to launder_folio Straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/cifs/file.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit a42442dd73694114705a5e1a429d38457774d904 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:54 2022 +0000 afs: Convert from launder_page to launder_folio Straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/afs/file.c | 2 +- fs/afs/internal.h | 2 +- fs/afs/write.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) commit 76dba927201dc07de5e679eb17bcad6d42430452 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:53 2022 +0000 9p: Convert from launder_page to launder_folio Trivial conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/9p/vfs_addr.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) commit affa80e8c6a1df473694c2087259901872309cc4 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:52 2022 +0000 fs: Add aops->launder_folio Since the only difference between ->launder_page and ->launder_folio is the type of the pointer, these can safely use a union without affecting bisectability. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs Documentation/filesystems/locking.rst | 10 +++++----- Documentation/filesystems/vfs.rst | 8 ++++---- include/linux/fs.h | 5 ++++- mm/truncate.c | 8 ++++---- 4 files changed, 17 insertions(+), 14 deletions(-) commit f50015a596fa106bf642bd85fbf6e6b52cc913d0 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:51 2022 +0000 fs: Remove aops->invalidatepage With all users migrated to ->invalidate_folio, remove the old operation. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs Documentation/filesystems/locking.rst | 2 -- Documentation/filesystems/vfs.rst | 1 - include/linux/fs.h | 1 - mm/truncate.c | 14 +++----------- 4 files changed, 3 insertions(+), 15 deletions(-) commit 58a2fdb61bbb2e7ad100fa9a14fefcbb1365e687 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:50 2022 +0000 ubifs: Convert from invalidatepage to invalidate_folio This is a straightfoward conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/ubifs/file.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit d97dfc94842838c2abfaf6d2ee54d1de7e50bec3 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:49 2022 +0000 reiserfs: Convert from invalidatepage to invalidate_folio This is a straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/reiserfs/inode.c | 26 +++++++++++++------------- fs/reiserfs/journal.c | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) commit 2a40be81250c22ec9c2e8ea9c848071044b919de Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:48 2022 +0000 orangefs: Convert from invalidatepage to invalidate_folio This is a straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/orangefs/inode.c | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) commit 6d740c76ea86053208b20c41fb5ec1de07acb996 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:47 2022 +0000 nfs: Convert from invalidatepage to invalidate_folio Print the folio index instead of the pointer, since this is more useful. We also don't need to use page_file_mapping() as we do not invalidate swapcache pages. Since this is the only caller of nfs_wb_page_cancel(), convert it to nfs_wb_folio_cancel(). Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/nfs/file.c | 16 ++++++++-------- fs/nfs/write.c | 8 ++++---- include/linux/nfs_fs.h | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) commit c5b56b50d7293668b83b2a3419786fb01fd0b581 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:46 2022 +0000 jfs: Convert from invalidatepage to invalidate_folio This is a straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/jfs/jfs_metapage.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 5f4b297684a7890d2c38db0eface0616f3b47611 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:45 2022 +0000 gfs2: Convert invalidatepage to invalidate_folio This is a straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Bob Peterson Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/gfs2/aops.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) commit 915039967342758ea1c26d99dd5ca2bef51ee382 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:44 2022 +0000 f2fs: Convert invalidatepage to invalidate_folio This is a minimal change which just accepts the new arguments and passes the single struct page to the functions which do the work. There is very little progress here toards making f2fs support large folios. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/f2fs/checkpoint.c | 2 +- fs/f2fs/compress.c | 2 +- fs/f2fs/data.c | 22 ++++++++++------------ fs/f2fs/f2fs.h | 3 +-- fs/f2fs/node.c | 2 +- 5 files changed, 14 insertions(+), 17 deletions(-) commit ccd16945dba091fdf1036d7711b9f6cbd287ae28 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:43 2022 +0000 ext4: Convert invalidatepage to invalidate_folio Extensive changes, but fairly mechanical. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/ext4/inode.c | 56 ++++++++++++++++++++++----------------------- fs/jbd2/journal.c | 2 +- fs/jbd2/transaction.c | 31 ++++++++++++------------- include/linux/jbd2.h | 4 ++-- include/linux/pagemap.h | 18 +++++++++++++++ include/trace/events/ext4.h | 30 ++++++++++++------------ 6 files changed, 78 insertions(+), 63 deletions(-) commit 39653e69092f5f1e3297bdf8b8f3c451112d2a4f Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:42 2022 +0000 erofs: Convert from invalidatepage to invalidate_folio A straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/erofs/super.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) commit 0eaf605247bb8031324900ef085669566c109a24 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:41 2022 +0000 cifs: Convert from invalidatepage to invalidate_folio A straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/cifs/file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 9872f4de1442ce080073e978c818d7fbca47ecaa Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:40 2022 +0000 ceph: Convert from invalidatepage to invalidate_folio Mostly a straightforward conversion. Delete the pointer from the debugging output as this has no value. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/ceph/addr.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) commit 895586eb689819c83a83271fdebccfd00a5a7616 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:39 2022 +0000 btrfs: Convert from invalidatepage to invalidate_folio A lot of the underlying infrastructure in btrfs needs to be switched over to folios, but this at least documents that invalidatepage can't be passed a tail page. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/btrfs/ctree.h | 3 ++ fs/btrfs/disk-io.c | 22 +++++++------- fs/btrfs/extent-io-tree.h | 4 +-- fs/btrfs/extent_io.c | 16 +++++----- fs/btrfs/inode.c | 77 ++++++++++++++++++++++++----------------------- 5 files changed, 63 insertions(+), 59 deletions(-) commit fcf227daed82a2f015ac29654d1ab9d09794c003 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:38 2022 +0000 afs: Convert invalidatepage to invalidate_folio We know the page is in the page cache, not the swap cache. If we ever support folios larger than 2GB, afs_invalidate_dirty() will need to be fixed, but that's a larger project. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/afs/file.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) commit f6bc6fb88c1611dffcaf75e936250a8a9d60affd Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:37 2022 +0000 afs: Convert directory aops to invalidate_folio Use folio->index instead of folio_index() because there's no way we're writing a page from the swapcache to a directory. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/afs/dir.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit 040cdd4bf90eb6ee870fcfc4fb16d0bf625cfee8 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:36 2022 +0000 9p: Convert to invalidate_folio This is a trivial conversion. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/9p/vfs_addr.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) commit 5660a8630dab61a28e07ec00c42bf605b182d725 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:35 2022 +0000 fs: Remove noop_invalidatepage() We used to have to use noop_invalidatepage() to prevent block_invalidatepage() from being called, but that behaviour is now gone. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs drivers/dax/device.c | 1 - fs/ext2/inode.c | 1 - fs/ext4/inode.c | 1 - fs/fuse/dax.c | 1 - fs/libfs.c | 11 ----------- fs/xfs/xfs_aops.c | 1 - include/linux/fs.h | 2 -- 7 files changed, 18 deletions(-) commit 7ba13abbd31ee9265e88d7dc029c0f786e665192 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:34 2022 +0000 fs: Turn block_invalidatepage into block_invalidate_folio Remove special-casing of a NULL invalidatepage, since there is no more block_invalidatepage. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs block/fops.c | 1 + fs/adfs/inode.c | 1 + fs/affs/file.c | 2 ++ fs/bfs/file.c | 1 + fs/buffer.c | 37 ++++++++++++++++++------------------- fs/ecryptfs/mmap.c | 1 + fs/exfat/inode.c | 1 + fs/ext2/inode.c | 2 ++ fs/ext4/inode.c | 32 ++++++++++++++++---------------- fs/fat/inode.c | 1 + fs/gfs2/meta_io.c | 2 ++ fs/hfs/inode.c | 2 ++ fs/hfsplus/inode.c | 2 ++ fs/hpfs/file.c | 1 + fs/jfs/inode.c | 1 + fs/minix/inode.c | 1 + fs/nilfs2/inode.c | 2 +- fs/nilfs2/mdt.c | 1 + fs/ntfs/aops.c | 5 +++-- fs/ocfs2/aops.c | 2 +- fs/omfs/file.c | 1 + fs/sysv/itree.c | 1 + fs/udf/file.c | 1 + fs/udf/inode.c | 1 + fs/ufs/inode.c | 1 + include/linux/buffer_head.h | 3 +-- mm/truncate.c | 4 ---- 27 files changed, 65 insertions(+), 45 deletions(-) commit d82354f6b05fc3b35029b3f75ddbf41b82af3bc8 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:33 2022 +0000 iomap: Remove iomap_invalidatepage() Use iomap_invalidate_folio() in all the iomap-based filesystems and rename the iomap_invalidatepage tracepoint. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/gfs2/aops.c | 2 +- fs/iomap/buffered-io.c | 9 +-------- fs/iomap/trace.h | 2 +- fs/xfs/xfs_aops.c | 2 +- fs/zonefs/super.c | 2 +- include/linux/iomap.h | 2 -- 6 files changed, 5 insertions(+), 14 deletions(-) commit 128d1f8241d62ab014eef6dd4ef9bb977dbeadb2 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:32 2022 +0000 fs: Add invalidate_folio() aops method This is used in preference to invalidatepage, if defined. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs Documentation/filesystems/locking.rst | 13 +++++++------ Documentation/filesystems/vfs.rst | 11 ++++++----- include/linux/fs.h | 1 + mm/truncate.c | 8 +++++++- 4 files changed, 21 insertions(+), 12 deletions(-) commit 020df9baeac50ed911501e1950de9ddab58652b6 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:31 2022 +0000 ext4: Use folio_invalidate() Instead of calling ->invalidatepage directly, use folio_invalidate(). Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/ext4/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit a628304ebe6ab029f27d8f5c667f2a5492c0dac2 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:30 2022 +0000 ceph: Use folio_invalidate() Instead of calling ->invalidatepage directly, use folio_invalidate(). Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/ceph/addr.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) commit 8e1dec8eb8b051a5a51c0dff33e5661050c9b6c6 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:29 2022 +0000 btrfs: Use folio_invalidate() Instead of calling ->invalidatepage directly, use folio_invalidate(). Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/btrfs/extent_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 5ad6b2bdaaea712486145fa5a78ec24d25289071 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:28 2022 +0000 fs: Turn do_invalidatepage() into folio_invalidate() Take a folio instead of a page, fix the types of the offset & length, and export it to filesystems. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs include/linux/mm.h | 3 --- include/linux/pagemap.h | 1 + mm/readahead.c | 2 +- mm/truncate.c | 20 ++++++++++---------- 4 files changed, 12 insertions(+), 14 deletions(-) commit 7e963fb2a33ce488e65258ab5be38a4855923033 Author: Leilk Liu Date: Tue Mar 15 11:24:08 2022 +0800 spi: mediatek: add ipm design support for MT7986 this patch add the support of ipm design. Signed-off-by: Leilk Liu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220315032411.2826-4-leilk.liu@mediatek.com Signed-off-by: Mark Brown drivers/spi/spi-mt65xx.c | 102 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 87 insertions(+), 15 deletions(-) commit da40a352db2bae470a3eea038cc53454c24e67f3 Author: Leilk Liu Date: Tue Mar 15 11:24:07 2022 +0800 spi: Add compatible for MT7986 This patch adds dt-binding documentation for MT7986. Signed-off-by: Leilk Liu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220315032411.2826-3-leilk.liu@mediatek.com Signed-off-by: Mark Brown Documentation/devicetree/bindings/spi/mediatek,spi-mt65xx.yaml | 4 ++++ 1 file changed, 4 insertions(+) commit 2002c13243d595e211c0dad6b8e2e87f906f474b Author: Julia Lawall Date: Mon Mar 14 12:53:45 2022 +0100 spi: sun4i: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Acked-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220314115354.144023-22-Julia.Lawall@inria.fr Signed-off-by: Mark Brown drivers/spi/spi-sun4i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 03b1be379dcee2e9c866c2a455a1a4a9581b3efd Author: Leilk Liu Date: Tue Mar 15 11:24:06 2022 +0800 spi: mediatek: support tick_delay without enhance_timing this patch support tick_delay bit[31:30] without enhance_timing feature. Fixes: f84d866ab43f("spi: mediatek: add tick_delay support") Signed-off-by: Leilk Liu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220315032411.2826-2-leilk.liu@mediatek.com Signed-off-by: Mark Brown drivers/spi/spi-mt65xx.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit 8a317e00798ac0893042e63807429ffddce52a34 Author: Haowen Bai Date: Tue Mar 15 11:33:10 2022 +0800 regulator: vctrl: Use min() instead of doing it manually Fix following coccicheck warning: drivers/regulator/vctrl-regulator.c:188:15-17: WARNING opportunity for max() Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1647315190-16139-1-git-send-email-baihaowen@meizu.com Signed-off-by: Mark Brown drivers/regulator/vctrl-regulator.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit a8ae15ead9c9d10671c3f76cb0749dec6e571ce7 Author: Alviro Iskandar Setiawan Date: Tue Mar 15 00:18:48 2022 +0000 ASoC: atmel: mchp-pdmc: Fix `-Wpointer-bool-conversion` warning In function mchp_pdmc_af_put(), Intel's kernel test robot reports the following warning: sound/soc/atmel/mchp-pdmc.c:186:34: warning: address of array \ 'uvalue->value.integer.value' will always evaluate to 'true' \ [-Wpointer-bool-conversion] This is because we are using `uvalue->value.integer.value` which its type is `long value[128];` for conditional expression and that array will always decay to a non-NULL pointer. Using a non-NULL pointer for conditional expression will always evaluate to true. Fix this by changing it to `uvalue->value.integer.value[0]` as that's what the mchp_pdmc_af_get() function sets. Reported-by: kernel test robot Reviewed-by: Codrin Ciubotariu Reviewed-by: Nathan Chancellor Signed-off-by: Alviro Iskandar Setiawan Link: https://lore.kernel.org/r/20220315001848.3763534-1-alviro.iskandar@gnuweeb.org Signed-off-by: Mark Brown sound/soc/atmel/mchp-pdmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9cea0d46f52f31c077a83a9b9e4e3887adfbecbe Merge: 8c490b42fe91 08f253ec3767 Author: Ingo Molnar Date: Tue Mar 15 12:52:51 2022 +0100 Merge branch 'x86/cpu' into x86/core, to resolve conflicts Conflicts: arch/x86/include/asm/cpufeatures.h Signed-off-by: Ingo Molnar commit 8c490b42fe91c10d5756efe56014240c669e7720 Merge: aaeed6ecc125 83aa52ffed5d Author: Ingo Molnar Date: Tue Mar 15 12:50:49 2022 +0100 Merge branch 'x86/pasid' into x86/core, to resolve conflicts Conflicts: tools/objtool/arch/x86/decode.c Signed-off-by: Ingo Molnar commit 231fdac3e58f4e52e387930c73bf535439607563 Author: Anders Roxell Date: Mon Mar 14 12:02:54 2022 +0100 net: phy: Kconfig: micrel_phy: fix dependency issue When building driver CONFIG_MICREL_PHY the follow error shows up: aarch64-linux-gnu-ld: drivers/net/phy/micrel.o: in function `lan8814_ts_info': micrel.c:(.text+0x1764): undefined reference to `ptp_clock_index' micrel.c:(.text+0x1764): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ptp_clock_index' aarch64-linux-gnu-ld: drivers/net/phy/micrel.o: in function `lan8814_probe': micrel.c:(.text+0x4720): undefined reference to `ptp_clock_register' micrel.c:(.text+0x4720): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ptp_clock_register' Rework Kconfig for MICREL_PHY to depend on 'PTP_1588_CLOCK_OPTIONAL'. Arnd describes in a good way why its needed to add this depends in patch e5f31552674e ("ethernet: fix PTP_1588_CLOCK dependencies"). Reported-by: kernel test robot Fixes: ece19502834d ("net: phy: micrel: 1588 support for LAN8814 phy") Signed-off-by: Anders Roxell Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220314110254.12498-1-anders.roxell@linaro.org Signed-off-by: Paolo Abeni drivers/net/phy/Kconfig | 1 + 1 file changed, 1 insertion(+) commit dde78aa520155316f31fca1b0f4dfcb779151799 Author: Lorenzo Bianconi Date: Thu Feb 24 12:55:00 2022 +0100 mac80211: update bssid_indicator in ieee80211_assign_beacon Update bssid_indicator in ieee80211_bss_conf according to the number of bssid in the set. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/f92317e002fca9933f05a445fcefb4f53291d601.1645702516.git.lorenzo@kernel.org Signed-off-by: Johannes Berg net/mac80211/cfg.c | 3 +++ 1 file changed, 3 insertions(+) commit c9eb90a56842a95351ee2d03933b1d8e36addc38 Author: John Crispin Date: Thu Feb 24 12:54:59 2022 +0100 mac80211: MBSSID channel switch Trigger ieee80211_csa_finish() on the non-transmitting interfaces when channel switch concludes on the transmitting interface. Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit Signed-off-by: John Crispin Link: https://lore.kernel.org/r/6fde4d7f9fa387494f46a7aa4a584478dcda06f1.1645702516.git.lorenzo@kernel.org Signed-off-by: Johannes Berg net/mac80211/cfg.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) commit 00eec9fe4f3b9588b4bfa8ef9dd0aae96407d5d7 Author: Michael Walle Date: Sat Mar 12 21:50:14 2022 +0100 net: sfp: add 2500base-X quirk for Lantech SFP module The Lantech 8330-262D-E module is 2500base-X capable, but it reports the nominal bitrate as 2500MBd instead of 3125MBd. Add a quirk for the module. The following in an EEPROM dump of such a SFP with the serial number redacted: 00: 03 04 07 00 00 00 01 20 40 0c 05 01 19 00 00 00 ???...? @????... 10: 1e 0f 00 00 4c 61 6e 74 65 63 68 20 20 20 20 20 ??..Lantech 20: 20 20 20 20 00 00 00 00 38 33 33 30 2d 32 36 32 ....8330-262 30: 44 2d 45 20 20 20 20 20 56 31 2e 30 03 52 00 cb D-E V1.0?R.? 40: 00 1a 00 00 46 43 XX XX XX XX XX XX XX XX XX XX .?..FCXXXXXXXXXX 50: 20 20 20 20 32 32 30 32 31 34 20 20 68 b0 01 98 220214 h??? 60: 45 58 54 52 45 4d 45 4c 59 20 43 4f 4d 50 41 54 EXTREMELY COMPAT 70: 49 42 4c 45 20 20 20 20 20 20 20 20 20 20 20 20 IBLE Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220312205014.4154907-1-michael@walle.cc Signed-off-by: Paolo Abeni drivers/net/phy/sfp-bus.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 2b3171c6fe0af24b5506e061525e08917a2f744a Author: Lorenzo Bianconi Date: Thu Feb 24 12:54:58 2022 +0100 mac80211: MBSSID beacon handling in AP mode Add new fields in struct beacon_data to store all MBSSID elements. Generate a beacon template which includes all MBSSID elements. Move CSA offset to reflect the MBSSID element length. Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit Co-developed-by: John Crispin Signed-off-by: John Crispin Signed-off-by: Lorenzo Bianconi Tested-by: Money Wang Link: https://lore.kernel.org/r/5322db3c303f431adaf191ab31c45e151dde5465.1645702516.git.lorenzo@kernel.org [small cleanups] Signed-off-by: Johannes Berg include/net/mac80211.h | 2 + net/mac80211/cfg.c | 99 ++++++++++++++++++++++++++++++++++++++++------ net/mac80211/ieee80211_i.h | 15 +++++++ net/mac80211/tx.c | 24 ++++++++++- 4 files changed, 126 insertions(+), 14 deletions(-) commit 3fa5a0f5b0d69e31c6476cd81afeca3cc25a4927 Author: Johannes Berg Date: Sat Mar 12 22:19:58 2022 +0100 mac80211: always have ieee80211_sta_restart() When CONFIG_PM isn't defined we don't have the function ieee80211_sta_restart() compiled in, but we always need it now for firmware restart. Move it out of the ifdef. Fixes: 7d352ccf1e99 ("mac80211: Add support to trigger sta disconnect on hardware restart") Link: https://lore.kernel.org/r/20220312221957.1fa96c72db51.I8ecaa5f9402fede0272161e0531ab930b97fba3e@changeid Signed-off-by: Johannes Berg net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 286e937efbc7177c114e80aae9b402131e3886c1 Author: Enver Balalic Date: Mon Mar 14 13:14:53 2022 +0100 platform/x86: hp-wmi: support omen thermal profile policy v1 As it turns out, these laptops have 2 thermal profile versions. A previous patch added support for v0, this patch adds support for v1 thermal policies that are in use on some devices. We obtain the thermal policy version by querying the get system design data WMI call and looking at the fourth byte it returns, except if the system board DMI Board ID is in a specific array that the windows command center app overrides to thermal policy v0 for some reason. Signed-off-by: Enver Balalic Link: https://lore.kernel.org/r/20220314121453.kjszdciymtg6ctbq@omen Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/hp-wmi.c | 81 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 67 insertions(+), 14 deletions(-) commit 4b4967cbd2685f313411e6facf915fb2ae01d796 Author: Jorge Lopez Date: Thu Mar 10 15:08:53 2022 -0600 platform/x86: hp-wmi: Changing bios_args.data to be dynamically allocated The purpose of this patch is to remove 128 bytes buffer limitation imposed in bios_args structure. A limiting factor discovered during this investigation was the struct bios_args.data size restriction. The data member size limits all possible WMI commands to those requiring buffer size of 128 bytes or less. Several WMI commands and queries require a buffer size larger than 128 bytes hence limiting current and feature supported by the driver. It is for this reason, struct bios_args.data changed and is dynamically allocated. hp_wmi_perform_query function changed to handle the memory allocation and release of any required buffer size. All changes were validated on a HP ZBook Workstation notebook, HP EliteBook x360, and HP EliteBook 850 G8. Additional validation was included in the test process to ensure no other commands were incorrectly handled. Signed-off-by: Jorge Lopez Link: https://lore.kernel.org/r/20220310210853.28367-5-jorge.lopez2@hp.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/hp-wmi.c | 54 ++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 21 deletions(-) commit da7837339641601f202f27515771dc0646083938 Author: Christoph Hellwig Date: Tue Mar 15 08:13:04 2022 +0100 nvmet: move the call to nvmet_ns_changed out of nvmet_ns_revalidate nvmet_ns_changed states via lockdep that the ns->subsys->lock must be held. The only caller of nvmet_ns_changed which does not acquire that lock is nvmet_ns_revalidate. nvmet_ns_revalidate has 3 callers, of which 2 do not acquire that lock: nvmet_execute_identify_cns_cs_ns and nvmet_execute_identify_ns. The other caller nvmet_ns_revalidate_size_store does acquire the lock. Move the call to nvmet_ns_changed from nvmet_ns_revalidate to the callers so that they can perform the correct locking as needed. This issue was found using a static type-based analyser and manually verified. Reported-by: Niels Dossche Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni drivers/nvme/target/admin-cmd.c | 6 +++++- drivers/nvme/target/configfs.c | 3 ++- drivers/nvme/target/core.c | 5 ++--- drivers/nvme/target/nvmet.h | 2 +- drivers/nvme/target/zns.c | 6 +++++- 5 files changed, 15 insertions(+), 7 deletions(-) commit a7b2553b5ece1aba4b5994eef150d0a1269b5805 Author: Ingo Molnar Date: Tue Mar 15 10:33:53 2022 +0100 sched/headers: Only include when CONFIG_GENERIC_ENTRY=y This header is not (yet) standalone. Signed-off-by: Ingo Molnar kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit aaeed6ecc1253ce1463fa1aca0b70a4ccbc9fa75 Author: Nathan Chancellor Date: Mon Mar 14 12:48:42 2022 -0700 x86/Kconfig: Do not allow CONFIG_X86_X32_ABI=y with llvm-objcopy There are two outstanding issues with CONFIG_X86_X32_ABI and llvm-objcopy, with similar root causes: 1. llvm-objcopy does not properly convert .note.gnu.property when going from x86_64 to x86_x32, resulting in a corrupted section when linking: https://github.com/ClangBuiltLinux/linux/issues/1141 2. llvm-objcopy produces corrupted compressed debug sections when going from x86_64 to x86_x32, also resulting in an error when linking: https://github.com/ClangBuiltLinux/linux/issues/514 After commit 41c5ef31ad71 ("x86/ibt: Base IBT bits"), the .note.gnu.property section is always generated when CONFIG_X86_KERNEL_IBT is enabled, which causes the first issue to become visible with an allmodconfig build: ld.lld: error: arch/x86/entry/vdso/vclock_gettime-x32.o:(.note.gnu.property+0x1c): program property is too short To avoid this error, do not allow CONFIG_X86_X32_ABI to be selected when using llvm-objcopy. If the two issues ever get fixed in llvm-objcopy, this can be turned into a feature check. Signed-off-by: Nathan Chancellor Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220314194842.3452-3-nathan@kernel.org arch/x86/Kconfig | 5 +++++ 1 file changed, 5 insertions(+) commit 83a44a4f47ad20997aebb311fc678a13cde391d7 Author: Masahiro Yamada Date: Mon Mar 14 12:48:41 2022 -0700 x86: Remove toolchain check for X32 ABI capability Commit 0bf6276392e9 ("x32: Warn and disable rather than error if binutils too old") added a small test in arch/x86/Makefile because binutils 2.22 or newer is needed to properly support elf32-x86-64. This check is no longer necessary, as the minimum supported version of binutils is 2.23, which is enforced at configuration time with scripts/min-tool-version.sh. Remove this check and replace all uses of CONFIG_X86_X32 with CONFIG_X86_X32_ABI, as two symbols are no longer necessary. [nathan: Rebase, fix up a few places where CONFIG_X86_X32 was still used, and simplify commit message to satisfy -tip requirements] Signed-off-by: Masahiro Yamada Signed-off-by: Nathan Chancellor Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220314194842.3452-2-nathan@kernel.org arch/x86/Kconfig | 8 ++------ arch/x86/Makefile | 16 ---------------- arch/x86/entry/syscalls/Makefile | 2 +- arch/x86/include/asm/syscall_wrapper.h | 6 +++--- arch/x86/include/asm/vdso.h | 2 +- arch/x86/kernel/process_64.c | 2 +- fs/fuse/ioctl.c | 2 +- fs/xfs/xfs_ioctl32.c | 2 +- sound/core/control_compat.c | 16 ++++++++-------- sound/core/pcm_compat.c | 20 ++++++++++---------- 10 files changed, 28 insertions(+), 48 deletions(-) commit ed53a0d971926e484d86cce617ec02a7ee85c3fe Author: Peter Zijlstra Date: Tue Mar 8 16:30:56 2022 +0100 x86/alternative: Use .ibt_endbr_seal to seal indirect calls Objtool's --ibt option generates .ibt_endbr_seal which lists superfluous ENDBR instructions. That is those instructions for which the function is never indirectly called. Overwrite these ENDBR instructions with a NOP4 such that these function can never be indirect called, reducing the number of viable ENDBR targets in the kernel. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.822545231@infradead.org arch/um/kernel/um_arch.c | 4 ++++ arch/x86/Kconfig | 9 +++++++- arch/x86/include/asm/alternative.h | 1 + arch/x86/include/asm/ibt.h | 12 ++++++++++ arch/x86/kernel/alternative.c | 39 +++++++++++++++++++++++++++++++ arch/x86/kernel/module.c | 8 ++++++- scripts/Makefile.build | 47 ++++++++++++++++++++++++++++++-------- scripts/link-vmlinux.sh | 10 ++++++-- 8 files changed, 117 insertions(+), 13 deletions(-) commit 89bc853eae4ad125030ef99f207ba76c2f00a26e Author: Peter Zijlstra Date: Tue Mar 8 16:30:55 2022 +0100 objtool: Find unused ENDBR instructions Find all ENDBR instructions which are never referenced and stick them in a section such that the kernel can poison them, sealing the functions from ever being an indirect call target. This removes about 1-in-4 ENDBR instructions. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.763643193@infradead.org arch/x86/kernel/vmlinux.lds.S | 9 +++++ tools/objtool/check.c | 69 ++++++++++++++++++++++++++++++++- tools/objtool/include/objtool/objtool.h | 1 + tools/objtool/objtool.c | 1 + 4 files changed, 78 insertions(+), 2 deletions(-) commit 08f87a93c8ec709698edba66a5167077181fc978 Author: Peter Zijlstra Date: Tue Mar 8 16:30:54 2022 +0100 objtool: Validate IBT assumptions Intel IBT requires that every indirect JMP/CALL targets an ENDBR instructions, failing this #CP happens and we die. Similarly, all exception entries should be ENDBR. Find all code relocations and ensure they're either an ENDBR instruction or ANNOTATE_NOENDBR. For the exceptions look for UNWIND_HINT_IRET_REGS at sym+0 not being ENDBR. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.705110141@infradead.org tools/objtool/builtin-check.c | 4 +- tools/objtool/check.c | 210 +++++++++++++++++++++++++++++++- tools/objtool/include/objtool/builtin.h | 3 +- tools/objtool/include/objtool/objtool.h | 3 + 4 files changed, 215 insertions(+), 5 deletions(-) commit 7d209d13e7c3a3d60dc262f11a8ae4e6b4454d30 Author: Peter Zijlstra Date: Tue Mar 8 16:30:53 2022 +0100 objtool: Add IBT/ENDBR decoding Intel IBT requires the target of any indirect CALL or JMP instruction to be the ENDBR instruction; optionally it allows those two instructions to have a NOTRACK prefix in order to avoid this requirement. The kernel will not enable the use of NOTRACK, as such any occurence of it in compiler generated code should be flagged. Teach objtool to Decode ENDBR instructions and WARN about NOTRACK prefixes. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.645963517@infradead.org tools/objtool/arch/x86/decode.c | 34 +++++++++++++++++++++++++++++----- tools/objtool/include/objtool/arch.h | 1 + 2 files changed, 30 insertions(+), 5 deletions(-) commit 96db4a988d653a7f18b518c25367f7bf238f4667 Author: Peter Zijlstra Date: Tue Mar 8 16:30:52 2022 +0100 objtool: Read the NOENDBR annotation Read the new NOENDBR annotation. While there, attempt to not bloat struct instruction. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.586815435@infradead.org tools/objtool/check.c | 27 +++++++++++++++++++++++++++ tools/objtool/include/objtool/check.h | 13 ++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) commit 3515899bef545fc5b5f6b865e080bfe4c9a92a41 Author: Peter Zijlstra Date: Mon Mar 14 18:07:30 2022 +0100 x86: Annotate idtentry_df() Without CONFIG_X86_ESPFIX64 exc_double_fault() is noreturn and objtool is clever enough to figure that out. vmlinux.o: warning: objtool: asm_exc_double_fault()+0x22: unreachable instruction 0000000000001260 : 1260: f3 0f 1e fa endbr64 1264: 90 nop 1265: 90 nop 1266: 90 nop 1267: e8 84 03 00 00 call 15f0 126c: 48 89 e7 mov %rsp,%rdi 126f: 48 8b 74 24 78 mov 0x78(%rsp),%rsi 1274: 48 c7 44 24 78 ff ff ff ff movq $0xffffffffffffffff,0x78(%rsp) 127d: e8 00 00 00 00 call 1282 127e: R_X86_64_PLT32 exc_double_fault-0x4 1282: e9 09 04 00 00 jmp 1690 Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/Yi9gOW9f1GGwwUD6@hirez.programming.kicks-ass.net arch/x86/entry/entry_64.S | 3 +++ 1 file changed, 3 insertions(+) commit dca5da2abe406168b85f97e22109710ebe0bda08 Author: Peter Zijlstra Date: Mon Mar 14 18:05:52 2022 +0100 x86,objtool: Move the ASM_REACHABLE annotation to objtool.h Because we need a variant for .S files too. Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/Yi9gOW9f1GGwwUD6@hirez.programming.kicks-ass.net arch/x86/include/asm/bug.h | 1 + arch/x86/include/asm/irq_stack.h | 1 + include/linux/compiler.h | 7 ------- include/linux/objtool.h | 16 ++++++++++++++++ tools/include/linux/objtool.h | 16 ++++++++++++++++ 5 files changed, 34 insertions(+), 7 deletions(-) commit be0075951fde739f14ee2b659e2fd6e2499c46c0 Author: Peter Zijlstra Date: Tue Mar 8 16:30:50 2022 +0100 x86: Annotate call_on_stack() vmlinux.o: warning: objtool: page_fault_oops()+0x13c: unreachable instruction 0000 000000000005b460 : ... 0128 5b588: 49 89 23 mov %rsp,(%r11) 012b 5b58b: 4c 89 dc mov %r11,%rsp 012e 5b58e: 4c 89 f2 mov %r14,%rdx 0131 5b591: 48 89 ee mov %rbp,%rsi 0134 5b594: 4c 89 e7 mov %r12,%rdi 0137 5b597: e8 00 00 00 00 call 5b59c 5b598: R_X86_64_PLT32 handle_stack_overflow-0x4 013c 5b59c: 5c pop %rsp vmlinux.o: warning: objtool: sysvec_reboot()+0x6d: unreachable instruction 0000 00000000000033f0 : ... 005d 344d: 4c 89 dc mov %r11,%rsp 0060 3450: e8 00 00 00 00 call 3455 3451: R_X86_64_PLT32 irq_enter_rcu-0x4 0065 3455: 48 89 ef mov %rbp,%rdi 0068 3458: e8 00 00 00 00 call 345d 3459: R_X86_64_PC32 .text+0x47d0c 006d 345d: e8 00 00 00 00 call 3462 345e: R_X86_64_PLT32 irq_exit_rcu-0x4 0072 3462: 5c pop %rsp Both cases are due to a call_on_stack() calling a __noreturn function. Since that's an inline asm, GCC can't do anything about the instructions after the CALL. Therefore put in an explicit ASM_REACHABLE annotation to make sure objtool and gcc are consistently confused about control flow. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.468805622@infradead.org arch/x86/include/asm/irq_stack.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 0e5b613b4d4be3345dda349fb90dd73d2103302f Author: Peter Zijlstra Date: Tue Mar 8 16:30:49 2022 +0100 objtool: Rework ASM_REACHABLE Currently ASM_REACHABLE only works for UD2 instructions; reorder things to also allow over-riding dead_end_function(). To that end: - Mark INSN_BUG instructions in decode_instructions(), this saves having to iterate all instructions yet again. - Have add_call_destinations() set insn->dead_end for dead_end_function() calls. - Move add_dead_ends() *after* add_call_destinations() such that ASM_REACHABLE can clear the ->dead_end mark. - have validate_branch() only check ->dead_end. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.410010807@infradead.org tools/objtool/check.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) commit 105cd68596392cfe15056a891b0723609dcad247 Author: Peter Zijlstra Date: Mon Mar 14 17:58:35 2022 +0100 x86: Mark __invalid_creds() __noreturn vmlinux.o: warning: objtool: ksys_unshare()+0x36c: unreachable instruction 0000 0000000000067040 : ... 0364 673a4: 4c 89 ef mov %r13,%rdi 0367 673a7: e8 00 00 00 00 call 673ac 673a8: R_X86_64_PLT32 __invalid_creds-0x4 036c 673ac: e9 28 ff ff ff jmp 672d9 0371 673b1: 41 bc f4 ff ff ff mov $0xfffffff4,%r12d 0377 673b7: e9 80 fd ff ff jmp 6713c Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/Yi9gOW9f1GGwwUD6@hirez.programming.kicks-ass.net include/linux/cred.h | 2 +- kernel/cred.c | 2 +- tools/objtool/check.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) commit eae654f1c21216daa9fbb92591c0d9f5ae46cfc5 Author: Peter Zijlstra Date: Tue Mar 8 16:30:48 2022 +0100 exit: Mark do_group_exit() __noreturn vmlinux.o: warning: objtool: get_signal()+0x108: unreachable instruction 0000 000000000007f930 : ... 0103 7fa33: e8 00 00 00 00 call 7fa38 7fa34: R_X86_64_PLT32 do_group_exit-0x4 0108 7fa38: 41 8b 45 74 mov 0x74(%r13),%eax Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.351270711@infradead.org include/linux/sched/task.h | 2 +- kernel/exit.c | 2 +- tools/objtool/check.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) commit f9cdf7ca57cada055f61ef6d0eb4db21c3f200db Author: Peter Zijlstra Date: Tue Mar 8 16:30:47 2022 +0100 x86: Mark stop_this_cpu() __noreturn vmlinux.o: warning: objtool: smp_stop_nmi_callback()+0x2b: unreachable instruction 0000 0000000000047cf0 : ... 0026 47d16: e8 00 00 00 00 call 47d1b 47d17: R_X86_64_PLT32 stop_this_cpu-0x4 002b 47d1b: b8 01 00 00 00 mov $0x1,%eax Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.290905453@infradead.org arch/x86/include/asm/processor.h | 2 +- arch/x86/kernel/process.c | 2 +- tools/objtool/check.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) commit 4adb23686795e9c88e3217b5d7b4524c0da9d04f Author: Peter Zijlstra Date: Tue Mar 8 16:30:46 2022 +0100 objtool: Ignore extra-symbol code There's a fun implementation detail on linking STB_WEAK symbols. When the linker combines two translation units, where one contains a weak function and the other an override for it. It simply strips the STB_WEAK symbol from the symbol table, but doesn't actually remove the code. The result is that when objtool is ran in a whole-archive kind of way, it will encounter *heaps* of unused (and unreferenced) code. All rudiments of weak functions. Additionally, when a weak implementation is split into a .cold subfunction that .cold symbol is left in place, even though completely unused. Teach objtool to ignore such rudiments by searching for symbol holes; that is, code ranges that fall outside the given symbol bounds. Specifically, ignore a sequence of unreachable instruction iff they occupy a single hole, additionally ignore any .cold subfunctions referenced. Both ld.bfd and ld.lld behave like this. LTO builds otoh can (and do) properly DCE weak functions. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.232019347@infradead.org tools/objtool/check.c | 43 ++++++++++++++++++++++++++ tools/objtool/elf.c | 60 +++++++++++++++++++++++++++++++++++++ tools/objtool/include/objtool/elf.h | 1 + 3 files changed, 104 insertions(+) commit 53f7109ef957315ab53205ba3a3f4f48874c0428 Author: Peter Zijlstra Date: Tue Mar 8 16:30:45 2022 +0100 objtool: Rename --duplicate to --lto In order to prepare for LTO like objtool runs for modules, rename the duplicate argument to lto. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.172584233@infradead.org scripts/link-vmlinux.sh | 2 +- tools/objtool/builtin-check.c | 4 ++-- tools/objtool/check.c | 7 ++++++- tools/objtool/include/objtool/builtin.h | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) commit cb9010f87dcbcdbb51cc96b922c6260848cecbd1 Author: Peter Zijlstra Date: Tue Mar 8 16:30:44 2022 +0100 x86/ibt: Ensure module init/exit points have references Since the references to the module init/exit points only have external references, a module LTO run will consider them 'unused' and seal them, leading to an immediate fail on module load. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.113767246@infradead.org include/linux/cfi.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) commit 2b6ff7dea670a4623fae1d2349806fc7f8e305d1 Author: Peter Zijlstra Date: Tue Mar 8 16:30:43 2022 +0100 x86/ibt: Dont generate ENDBR in .discard.text Having ENDBR in discarded sections can easily lead to relocations into discarded sections which the linkers aren't really fond of. Objtool also shouldn't generate them, but why tempt fate. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154319.054842742@infradead.org arch/x86/include/asm/setup.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e8d61bdf0fdfaeaf35fb5a63d6e67e60038b88e0 Author: Peter Zijlstra Date: Tue Mar 8 16:30:42 2022 +0100 x86/ibt,sev: Annotations No IBT on AMD so far.. probably correct, who knows. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.995109889@infradead.org arch/x86/entry/entry_64.S | 1 + arch/x86/entry/entry_64_compat.S | 1 + arch/x86/kernel/head_64.S | 2 ++ 3 files changed, 4 insertions(+) commit 3215de84c06d747bb748b98945add83e3ec8a6e2 Author: Peter Zijlstra Date: Tue Mar 8 16:30:41 2022 +0100 x86/ibt,ftrace: Annotate ftrace code patching These are code patching sites, not indirect targets. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.936599479@infradead.org arch/x86/kernel/ftrace_64.S | 7 +++++++ 1 file changed, 7 insertions(+) commit 3e3f069504344c241f89737e4af014f83fca0b27 Author: Peter Zijlstra Date: Tue Mar 8 16:30:40 2022 +0100 x86/ibt: Annotate text references Annotate away some of the generic code references. This is things where we take the address of a symbol for exception handling or return addresses (eg. context switch). Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.877758523@infradead.org arch/x86/entry/entry_64.S | 6 ++++++ arch/x86/entry/entry_64_compat.S | 1 + arch/x86/kernel/alternative.c | 10 ++++++++-- arch/x86/kernel/head_64.S | 4 ++++ arch/x86/kernel/kprobes/core.c | 1 + arch/x86/kernel/relocate_kernel_64.S | 2 ++ arch/x86/lib/error-inject.c | 2 ++ arch/x86/lib/retpoline.S | 1 + 8 files changed, 25 insertions(+), 2 deletions(-) commit fe379fa4d199abc52d5b4a256e52cf94eff685cf Author: Peter Zijlstra Date: Tue Mar 8 16:30:38 2022 +0100 x86/ibt: Disable IBT around firmware Assume firmware isn't IBT clean and disable it across calls. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.759989383@infradead.org arch/x86/include/asm/efi.h | 9 +++++++-- arch/x86/include/asm/ibt.h | 6 ++++++ arch/x86/kernel/apm_32.c | 7 +++++++ arch/x86/kernel/cpu/common.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) commit 99c95c5d4f1027130d555fdb27b576520894827d Author: Peter Zijlstra Date: Tue Mar 8 16:30:37 2022 +0100 x86/alternative: Simplify int3_selftest_ip Similar to ibt_selftest_ip, apply the same pattern. Suggested-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.700456643@infradead.org arch/x86/kernel/alternative.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) commit af22700390c2f1d92dadd3eedf2738525a3a2f3a Author: Peter Zijlstra Date: Tue Mar 8 16:30:36 2022 +0100 x86/ibt,kexec: Disable CET on kexec Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.641454603@infradead.org arch/x86/include/asm/cpu.h | 3 +++ arch/x86/kernel/cpu/common.c | 6 ++++++ arch/x86/kernel/machine_kexec_64.c | 4 +++- arch/x86/kernel/relocate_kernel_64.S | 8 ++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) commit 991625f3dd2cbc4b787deb0213e2bcf8fa264b21 Author: Peter Zijlstra Date: Tue Mar 8 16:30:35 2022 +0100 x86/ibt: Add IBT feature, MSR and #CP handling The bits required to make the hardware go.. Of note is that, provided the syscall entry points are covered with ENDBR, #CP doesn't need to be an IST because we'll never hit the syscall gap. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.582331711@infradead.org arch/x86/include/asm/cpu.h | 1 + arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/idtentry.h | 5 ++ arch/x86/include/asm/msr-index.h | 20 +++++++- arch/x86/include/asm/traps.h | 2 + arch/x86/include/uapi/asm/processor-flags.h | 2 + arch/x86/kernel/cpu/common.c | 25 +++++++++- arch/x86/kernel/idt.c | 4 ++ arch/x86/kernel/traps.c | 75 +++++++++++++++++++++++++++++ 9 files changed, 133 insertions(+), 2 deletions(-) commit 0aec21cfb51bc1856206f312d8c13bf1f368d78e Author: Peter Zijlstra Date: Tue Mar 8 16:30:34 2022 +0100 x86/ibt,ftrace: Add ENDBR to samples/ftrace Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.523421433@infradead.org samples/ftrace/ftrace-direct-modify.c | 5 +++++ samples/ftrace/ftrace-direct-multi-modify.c | 10 +++++++--- samples/ftrace/ftrace-direct-multi.c | 5 ++++- samples/ftrace/ftrace-direct-too.c | 3 +++ samples/ftrace/ftrace-direct.c | 3 +++ 5 files changed, 22 insertions(+), 4 deletions(-) commit 58912710558889629daae3e0824daacab663bd4a Author: Peter Zijlstra Date: Tue Mar 8 16:30:33 2022 +0100 x86/ibt,bpf: Add ENDBR instructions to prologue and trampoline With IBT enabled builds we need ENDBR instructions at indirect jump target sites, since we start execution of the JIT'ed code through an indirect jump, the very first instruction needs to be ENDBR. Similarly, since eBPF tail-calls use indirect branches, their landing site needs to be an ENDBR too. The trampolines need similar adjustment. Signed-off-by: Peter Zijlstra (Intel) Fixed-by: Kumar Kartikeya Dwivedi Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.464998838@infradead.org arch/x86/net/bpf_jit_comp.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) commit cc66bb91457827f62e2b6cb2518666820f0a6c48 Author: Peter Zijlstra Date: Tue Mar 8 16:30:32 2022 +0100 x86/ibt,kprobes: Cure sym+0 equals fentry woes In order to allow kprobes to skip the ENDBR instructions at sym+0 for X86_KERNEL_IBT builds, change _kprobe_addr() to take an architecture callback to inspect the function at hand and modify the offset if needed. This streamlines the existing interface to cover more cases and require less hooks. Once PowerPC gets fully converted there will only be the one arch hook. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Masami Hiramatsu Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.405947704@infradead.org arch/powerpc/kernel/kprobes.c | 34 +++++++++++++--------- arch/x86/kernel/kprobes/core.c | 17 +++++++++++ include/linux/kprobes.h | 3 +- kernel/kprobes.c | 66 +++++++++++++++++++++++++++++++++--------- 4 files changed, 92 insertions(+), 28 deletions(-) commit e52fc2cf3f662828cc0d51c4b73bed73ad275fce Author: Peter Zijlstra Date: Tue Mar 8 16:30:31 2022 +0100 x86/ibt,ftrace: Make function-graph play nice Return trampoline must not use indirect branch to return; while this preserves the RSB, it is fundamentally incompatible with IBT. Instead use a retpoline like ROP gadget that defeats IBT while not unbalancing the RSB. And since ftrace_stub is no longer a plain RET, don't use it to copy from. Since RET is a trivial instruction, poke it directly. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.347296408@infradead.org arch/x86/kernel/ftrace.c | 9 ++------- arch/x86/kernel/ftrace_64.S | 21 +++++++++++++++++---- 2 files changed, 19 insertions(+), 11 deletions(-) commit d15cb3dab1e4f00e29599a4f5e1f6678a530d270 Author: Peter Zijlstra Date: Tue Mar 8 16:30:30 2022 +0100 x86/livepatch: Validate __fentry__ location Currently livepatch assumes __fentry__ lives at func+0, which is most likely untrue with IBT on. Instead make it use ftrace_location() by default which both validates and finds the actual ip if there is any in the same symbol. Suggested-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.285971256@infradead.org arch/powerpc/include/asm/livepatch.h | 10 ---------- kernel/livepatch/patch.c | 19 ++----------------- 2 files changed, 2 insertions(+), 27 deletions(-) commit aebfd12521d9c7d0b502cf6d06314cfbcdccfe3b Author: Peter Zijlstra Date: Tue Mar 8 16:30:29 2022 +0100 x86/ibt,ftrace: Search for __fentry__ location Currently a lot of ftrace code assumes __fentry__ is at sym+0. However with Intel IBT enabled the first instruction of a function will most likely be ENDBR. Change ftrace_location() to not only return the __fentry__ location when called for the __fentry__ location, but also when called for the sym+0 location. Then audit/update all callsites of this function to consistently use these new semantics. Suggested-by: Steven Rostedt Signed-off-by: Peter Zijlstra (Intel) Acked-by: Masami Hiramatsu Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.227581603@infradead.org arch/x86/kernel/kprobes/core.c | 11 ++-------- kernel/bpf/trampoline.c | 20 ++++-------------- kernel/kprobes.c | 8 ++----- kernel/trace/ftrace.c | 48 +++++++++++++++++++++++++++++++++++------- 4 files changed, 48 insertions(+), 39 deletions(-) commit 6649fa876da4c505548b8e8945a6fc48e62e427c Author: Peter Zijlstra Date: Tue Mar 8 16:30:28 2022 +0100 x86/ibt,kvm: Add ENDBR to fastops Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.168850084@infradead.org arch/x86/kvm/emulate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 214b9a83b617367d53680812ad09687542370b8e Author: Peter Zijlstra Date: Tue Mar 8 16:30:27 2022 +0100 x86/ibt,crypto: Add ENDBR for the jump-table entries The code does: ## branch into array mov jump_table(,%rax,8), %bufp JMP_NOSPEC bufp resulting in needing to mark the jump-table entries with ENDBR. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.110500806@infradead.org arch/x86/crypto/crc32c-pcl-intel-asm_64.S | 3 +++ 1 file changed, 3 insertions(+) commit c3b037917c6a4cbb09ab2d6ccf19f02335ad1847 Author: Peter Zijlstra Date: Tue Mar 8 16:30:26 2022 +0100 x86/ibt,paravirt: Sprinkle ENDBR Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154318.051635891@infradead.org arch/x86/include/asm/paravirt.h | 1 + arch/x86/include/asm/qspinlock_paravirt.h | 3 +++ arch/x86/kernel/kvm.c | 3 ++- arch/x86/kernel/paravirt.c | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) commit c4691712b546b93707a408368e3c57ae870a2dc4 Author: Peter Zijlstra Date: Tue Mar 8 16:30:25 2022 +0100 x86/linkage: Add ENDBR to SYM_FUNC_START*() Ensure the ASM functions have ENDBR on for IBT builds, this follows the ARM64 example. Unlike ARM64, we'll likely end up overwriting them with poison. Suggested-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.992708941@infradead.org arch/x86/include/asm/linkage.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) commit 8f93402b92d443573d310250efa0b7f352fec992 Author: Peter Zijlstra Date: Tue Mar 8 16:30:24 2022 +0100 x86/ibt,entry: Sprinkle ENDBR dust Kernel entry points should be having ENDBR on for IBT configs. The SYSCALL entry points are found through taking their respective address in order to program them in the MSRs, while the exception entry points are found through UNWIND_HINT_IRET_REGS. The rule is that any UNWIND_HINT_IRET_REGS at sym+0 should have an ENDBR, see the later objtool ibt validation patch. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.933157479@infradead.org arch/x86/entry/entry_64.S | 7 +++++++ arch/x86/entry/entry_64_compat.S | 3 +++ arch/x86/include/asm/idtentry.h | 20 +++++++++++--------- arch/x86/include/asm/segment.h | 3 ++- arch/x86/kernel/head_64.S | 4 +++- arch/x86/kernel/idt.c | 5 +++-- 6 files changed, 29 insertions(+), 13 deletions(-) commit 5b2fc51576eff811a614e33cbbd0c3cb05022892 Author: Peter Zijlstra Date: Tue Mar 8 16:30:23 2022 +0100 x86/ibt,xen: Sprinkle the ENDBR Even though Xen currently doesn't advertise IBT, prepare for when it will eventually do so and sprinkle the ENDBR dust accordingly. Even though most of the entry points are IRET like, the CPL0 Hypervisor can set WAIT-FOR-ENDBR and demand ENDBR at these sites. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.873919996@infradead.org arch/x86/entry/entry_64.S | 1 + arch/x86/include/asm/segment.h | 2 +- arch/x86/kernel/head_64.S | 1 + arch/x86/xen/enlighten_pv.c | 3 +++ arch/x86/xen/xen-asm.S | 9 +++++++++ arch/x86/xen/xen-head.S | 9 +++++++-- 6 files changed, 22 insertions(+), 3 deletions(-) commit 8b87d8cec1b31ea710568ae49ba5f5146318da0d Author: Peter Zijlstra Date: Tue Mar 8 16:30:22 2022 +0100 x86/entry,xen: Early rewrite of restore_regs_and_return_to_kernel() By doing an early rewrite of 'jmp native_iret` in restore_regs_and_return_to_kernel() we can get rid of the last INTERRUPT_RETURN user and paravirt_iret. Suggested-by: Andrew Cooper Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.815039833@infradead.org arch/x86/entry/entry_64.S | 11 ++++++++--- arch/x86/include/asm/irqflags.h | 5 ----- arch/x86/include/asm/paravirt_types.h | 1 - arch/x86/kernel/head_64.S | 3 ++- arch/x86/kernel/paravirt.c | 4 ---- arch/x86/xen/enlighten_pv.c | 7 ++++++- arch/x86/xen/xen-asm.S | 1 + 7 files changed, 17 insertions(+), 15 deletions(-) commit 6cf3e4c0d29102c74aca1ce0c1710be9d02e440e Author: Peter Zijlstra Date: Tue Mar 8 16:30:21 2022 +0100 x86/entry: Cleanup PARAVIRT Since commit 5c8f6a2e316e ("x86/xen: Add xenpv_restore_regs_and_return_to_usermode()") Xen will no longer reach this code and we can do away with the paravirt SWAPGS/INTERRUPT_RETURN. Suggested-by: Andrew Cooper Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.756014488@infradead.org arch/x86/entry/entry_64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ba27d1a80871eb8dbeddf34ec7d396c149cbb8d7 Author: Peter Zijlstra Date: Tue Mar 8 16:30:20 2022 +0100 x86/ibt,paravirt: Use text_gen_insn() for paravirt_patch() Less duplication is more better. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.697253958@infradead.org arch/x86/include/asm/text-patching.h | 20 ++++++++++++++------ arch/x86/kernel/paravirt.c | 23 +++-------------------- 2 files changed, 17 insertions(+), 26 deletions(-) commit bbf92368b0b1fe472d489e62d3340d7897e9c697 Author: Peter Zijlstra Date: Tue Mar 8 16:30:19 2022 +0100 x86/text-patching: Make text_gen_insn() play nice with ANNOTATE_NOENDBR Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.638561109@infradead.org arch/x86/include/asm/text-patching.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit c8c301abeae58ec756b8fcb2178a632bd3c9e284 Author: Peter Zijlstra Date: Tue Mar 8 16:30:18 2022 +0100 x86/ibt: Add ANNOTATE_NOENDBR In order to have objtool warn about code references to !ENDBR instruction, we need an annotation to allow this for non-control-flow instances -- consider text range checks, text patching, or return trampolines etc. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.578968224@infradead.org include/linux/objtool.h | 16 ++++++++++++++++ tools/include/linux/objtool.h | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) commit 156ff4a544ae13c5fd6759a09ecb069f7059c1a1 Author: Peter Zijlstra Date: Tue Mar 8 16:30:17 2022 +0100 x86/ibt: Base IBT bits Add Kconfig, Makefile and basic instruction support for x86 IBT. (Ab)use __DISABLE_EXPORTS to disable IBT since it's already employed to mark compressed and purgatory. Additionally mark realmode with it as well to avoid inserting ENDBR instructions there. While ENDBR is technically a NOP, inserting them was causing some grief due to code growth. There's also a problem with using __noendbr in code compiled without -fcf-protection=branch. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.519875203@infradead.org arch/x86/Kconfig | 20 +++++++++++ arch/x86/Makefile | 16 +++++++-- arch/x86/include/asm/ibt.h | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 2 deletions(-) commit 5cff2086b01526b8c7deacc86473ffbab0cddfa9 Author: Peter Zijlstra Date: Tue Mar 8 16:30:16 2022 +0100 objtool: Have WARN_FUNC fall back to sym+off Currently WARN_FUNC() either prints func+off and failing that prints sec+off, add an intermediate sym+off. This is useful when playing around with entry code. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.461283840@infradead.org tools/objtool/include/objtool/warn.h | 2 ++ 1 file changed, 2 insertions(+) commit 537da1ed54658e916141e50923a7f5b20c728856 Author: Peter Zijlstra Date: Tue Mar 8 16:30:15 2022 +0100 objtool,efi: Update __efi64_thunk annotation The current annotation relies on not running objtool on the file; this won't work when running objtool on vmlinux.o. Instead explicitly mark __efi64_thunk() to be ignored. This preserves the status quo, which is somewhat unfortunate. Luckily this code is hardly ever used. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.402118218@infradead.org arch/x86/platform/efi/Makefile | 1 - arch/x86/platform/efi/efi_thunk_64.S | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) commit 1ffbe4e935f9b7308615c75be990aec07464d1e7 Author: Peter Zijlstra Date: Tue Mar 8 16:30:14 2022 +0100 objtool: Default ignore INT3 for unreachable Ignore all INT3 instructions for unreachable code warnings, similar to NOP. This allows using INT3 for various paddings instead of NOPs. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.343312938@infradead.org tools/objtool/check.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) commit f2d3a250897133cc36c13a641bd6a9b4dd5ad234 Author: Peter Zijlstra Date: Tue Mar 8 16:30:13 2022 +0100 objtool: Add --dry-run Add a --dry-run argument to skip writing the modifications. This is convenient for debugging. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kees Cook Reviewed-by: Miroslav Benes Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.282720146@infradead.org tools/objtool/builtin-check.c | 3 ++- tools/objtool/elf.c | 3 +++ tools/objtool/include/objtool/builtin.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) commit b44544fe0298ee2224960a31f795e317029e2a60 Author: Peter Zijlstra Date: Tue Mar 8 16:30:12 2022 +0100 static_call: Avoid building empty .static_call_sites Without CONFIG_HAVE_STATIC_CALL_INLINE there's no point in creating the .static_call_sites section and it's related symbols. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220308154317.223798256@infradead.org include/asm-generic/vmlinux.lds.h | 4 ++++ 1 file changed, 4 insertions(+) commit 599d66b8473b4dbf3808104db8cd7538a26e3068 Merge: 227a06553fe6 4013e26670c5 Author: Peter Zijlstra Date: Tue Mar 15 10:32:31 2022 +0100 Merge branch 'arm64/for-next/linkage' Enjoy the cleanups and avoid conflicts vs linkage Signed-off-by: Peter Zijlstra commit 227a06553fe6c785f23d76eece3bb10e2db5059c Author: Fenghua Yu Date: Mon Feb 7 15:02:53 2022 -0800 tools/objtool: Check for use of the ENQCMD instruction in the kernel The ENQCMD instruction implicitly accesses the PASID_MSR to fill in the pasid field of the descriptor being submitted to an accelerator. But there is no precise (and stable across kernel changes) point at which the PASID_MSR is updated from the value for one task to the next. Kernel code that uses accelerators must always use the ENQCMDS instruction which does not access the PASID_MSR. Check for use of the ENQCMD instruction in the kernel and warn on its usage. Signed-off-by: Fenghua Yu Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Acked-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220207230254.3342514-11-fenghua.yu@intel.com Signed-off-by: Peter Zijlstra tools/objtool/arch/x86/decode.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) commit 11b51bff0a2e347ec14d27a76c6430cb98f0207a Author: Wolfram Sang Date: Fri Mar 11 15:05:42 2022 +0100 mmc: tmio: remove outdated members from host struct The wrappers are gone for two years now but they have still pointers reserved in the tmio_mmc_host struct. Remove them. Reported-by: Yoshihiro Shimoda Fixes: f22084b662e5 ("mmc: tmio: remove superfluous callback wrappers") Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220311140542.5407-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson drivers/mmc/host/tmio_mmc.h | 4 ---- 1 file changed, 4 deletions(-) commit 33106d78b4c0981ec3f21674d6736852785b5ddf Author: Alexandre Bailon Date: Fri Mar 11 11:33:20 2022 +0100 mmc: mtk-sd: Silence delay phase calculation debug log The driver prints the following log everytime data is written to RPMB: mtk-msdc 11230000.mmc: phase: [map:ffffffff] [maxlen:32] [final:10] dev_info is used to print that log but it seems that log is only useful for debbuging. Use dev_dbg instead of dev_info. Signed-off-by: Alexandre Bailon Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220311103320.3072171-1-abailon@baylibre.com Signed-off-by: Ulf Hansson drivers/mmc/host/mtk-sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 09e7af76db02c74f2a339b3cb2d95460fa2ddbe4 Author: Jiasheng Jiang Date: Tue Mar 8 15:14:15 2022 +0800 mmc: davinci_mmc: Handle error for clk_enable As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes: bbce5802afc5 ("davinci: mmc: updates to suspend/resume implementation") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220308071415.1093393-1-jiasheng@iscas.ac.cn Signed-off-by: Ulf Hansson drivers/mmc/host/davinci_mmc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit ccdbf33c2349a0a867f46dde5f94b0715f6fa341 Merge: ccacfe56d7ec 09688c0166e7 Author: Ingo Molnar Date: Tue Mar 15 10:28:12 2022 +0100 Merge tag 'v5.17-rc8' into sched/core, to pick up fixes Signed-off-by: Ingo Molnar commit d607667bb8fa2811679ed2c8a5b09d0d4da8c5b9 Author: Ben Chuang Date: Mon Mar 7 17:00:09 2022 +0800 mmc: sdhci-pci-gli: Add runtime PM for GL9763E Add runtime PM for GL9763E and disable PLL in runtime suspend. So power gated of upstream port can be enabled. GL9763E has an auxiliary power so it keep states in runtime suspend. In runtime resume, PLL is enabled and waits for it to stabilize. Signed-off-by: Ben Chuang Tested-by: Kevin Chang Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20220307090009.1386876-1-benchuanggli@gmail.com Signed-off-by: Ulf Hansson drivers/mmc/host/sdhci-pci-gli.c | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) commit 23e1b8c15b3ab402bc422338073afc7cf2351788 Author: Ulf Hansson Date: Thu Mar 3 17:51:51 2022 +0100 mmc: core: Drop HS400 caps unless 8-bit bus is supported too When mmc_select_hs400es() tries to switch to the HS400 ES mode, it may bail out early if the host doesn't support an 8-bit buswidth, as it's required for the HS400 mode. To improve the situation, let's instead drop the HS400 bits from the capability field if the 8-bit bus isn't supported. In this way, we allow the mmc initialization to continue by trying a lower speed mode. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20220303165151.129806-1-ulf.hansson@linaro.org drivers/mmc/core/host.c | 13 +++++++++++-- drivers/mmc/core/mmc.c | 5 ----- 2 files changed, 11 insertions(+), 7 deletions(-) commit d6c9219ca1139b74541b2a98cee47a3426d754a9 Author: Ulf Hansson Date: Thu Mar 3 17:51:42 2022 +0100 mmc: host: Return an error when ->enable_sdio_irq() ops is missing Even if the current WARN() notifies the user that something is severely wrong, we can still end up in a PANIC() when trying to invoke the missing ->enable_sdio_irq() ops. Therefore, let's also return an error code and prevent the host from being added. While at it, move the code into a separate function to prepare for subsequent changes and for further host caps validations. Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20220303165142.129745-1-ulf.hansson@linaro.org drivers/mmc/core/host.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) commit 3b6c472822f8bdeaa3cea8290f5b4a210dca5585 Author: Ulf Hansson Date: Thu Mar 3 17:45:22 2022 +0100 mmc: core: Improve fallback to speed modes if eMMC HS200 fails In the error path of mmc_select_hs200() we are trying our best to restore the card/host into a valid state. This makes sense, especially if we encounter a simple switch error (-EBADMSG). However, rather than then continue with using the legacy speed mode, let's try the other better speed modes first. Additionally, let's update the card->mmc_avail_type to avoid us from trying a broken HS200 mode again. In an Amlogic S905W based TV box where the switch to HS200 mode fails for the eMMC, this allows us to use the eMMC in DDR mode in favor of the legacy mode, which greatly improves the performance. Suggested-by: Heiner Kallweit Signed-off-by: Ulf Hansson Tested-by: Heiner Kallweit Link: https://lore.kernel.org/r/20220303164522.129583-1-ulf.hansson@linaro.org drivers/mmc/core/mmc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) commit ccacfe56d7ecdd2922256b87e9ea46f13bb03b55 Merge: f2aa197e4794 4ff8f2ca6ccd Author: Ingo Molnar Date: Tue Mar 15 09:02:10 2022 +0100 Merge branch 'sched/fast-headers' into sched/core Merge the scheduler build speedup of the fast-headers tree. Cumulative scheduler (kernel/sched/) build time speedup on a Linux distribution's config, which enables all scheduler features, compared to the vanilla kernel: _____________________________________________________________________________ | | Vanilla kernel (v5.13-rc7): |_____________________________________________________________________________ | | Performance counter stats for 'make -j96 kernel/sched/' (3 runs): | | 126,975,564,374 instructions # 1.45 insn per cycle ( +- 0.00% ) | 87,637,847,671 cycles # 3.959 GHz ( +- 0.30% ) | 22,136.96 msec cpu-clock # 7.499 CPUs utilized ( +- 0.29% ) | | 2.9520 +- 0.0169 seconds time elapsed ( +- 0.57% ) |_____________________________________________________________________________ | | Patched kernel: |_____________________________________________________________________________ | | Performance counter stats for 'make -j96 kernel/sched/' (3 runs): | | 50,420,496,914 instructions # 1.47 insn per cycle ( +- 0.00% ) | 34,234,322,038 cycles # 3.946 GHz ( +- 0.31% ) | 8,675.81 msec cpu-clock # 3.053 CPUs utilized ( +- 0.45% ) | | 2.8420 +- 0.0181 seconds time elapsed ( +- 0.64% ) |_____________________________________________________________________________ Summary: - CPU time used to build the scheduler dropped by -60.9%, a reduction from 22.1 clock-seconds to 8.7 clock-seconds. - Wall-clock time to build the scheduler dropped by -3.9%, a reduction from 2.95 seconds to 2.84 seconds. Signed-off-by: Ingo Molnar commit b811169f86d2679753fc9787f25773d01a7f4044 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:36:46 2022 +0100 media: platform: s3c-camif: move config to its own file In order to better organize the platform/Kconfig, place s3c-camif-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 16 +--------------- drivers/media/platform/s3c-camif/Kconfig | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) commit 55f13f5c7c06159e4e8cd6375f8e7e61d24a91ab Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:36:04 2022 +0100 media: platform: rga: move config to its own file In order to better organize the platform/Kconfig, place rga-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 16 +--------------- drivers/media/platform/rockchip/rga/Kconfig | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) commit 563faef6bf2291e2e688a89252dab967c670990b Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:35:22 2022 +0100 media: platform: venus: move config to its own file In order to better organize the platform/Kconfig, place venus-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 16 +--------------- drivers/media/platform/qcom/venus/Kconfig | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) commit c849c4cd1fa7159967af1e4a56bbde0487dcf622 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:34:07 2022 +0100 media: platform: camss: move config to its own file In order to better organize the platform/Kconfig, place camss-specific config stuff on a separate Kconfig file. Reviewed-by: Robert Foss Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 11 +---------- drivers/media/platform/qcom/camss/Kconfig | 9 +++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) commit aff225bdf92eb77dfeb91b88eea987a467664709 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:32:30 2022 +0100 media: platform: omap3isp: move config to its own file In order to better organize the platform/Kconfig, place omap3isp-specific config stuff on a separate Kconfig file. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 22 +--------------------- drivers/media/platform/omap3isp/Kconfig | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 21 deletions(-) commit 2bfb94aa5db208187c466371c91137c9e74fb6c2 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:31:51 2022 +0100 media: platform: mtk-vpu: move config to its own file In order to better organize the platform/Kconfig, place mtk-vpu-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 15 +-------------- drivers/media/platform/mtk-vpu/Kconfig | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) commit 7e0a11a258a90d7ee76a39613efa71477ba59d97 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:31:11 2022 +0100 media: platform: mtk-vcodec: move config to its own file In order to better organize the platform/Kconfig, place mtk-vcodec-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 37 +------------------------------ drivers/media/platform/mtk-vcodec/Kconfig | 36 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 36 deletions(-) commit 7c52a3c81f9397d79e7f1ab3981781e75726dfcb Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:29:59 2022 +0100 media: platform: mtk-mdp: move config to its own file In order to better organize the platform/Kconfig, place mtk-mdp-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 18 +----------------- drivers/media/platform/mtk-mdp/Kconfig | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-) commit 26cb720c7e082bd153778f77d23e380accab0d06 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:29:12 2022 +0100 media: platform: mtk-jpeg: move config to its own file In order to better organize the platform/Kconfig, place mtk-jpeg-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 17 +---------------- drivers/media/platform/mtk-jpeg/Kconfig | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 16 deletions(-) commit a93ae887bc91929586680c60444f59ea435f7144 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:28:13 2022 +0100 media: platform: ge2d: move config to its own file In order to better organize the platform/Kconfig, place ge2d-specific config stuff on a separate Kconfig file. Acked-by: Neil Armstrong Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 15 +-------------- drivers/media/platform/meson/ge2d/Kconfig | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) commit dc2646417d54f002fb127067b5848dbef975e8ff Author: Julia Lawall Date: Sun Mar 13 15:18:47 2022 +0100 scsi: lpfc: Use kcalloc() Use kcalloc() instead of kmalloc() + memset(). Link: https://lore.kernel.org/r/20220313141847.109804-1-Julia.Lawall@inria.fr Suggested-by: Joe Perches Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_debugfs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) commit 9d05790f518744e0341e2d6c988b9db9143ce535 Author: Julia Lawall Date: Mon Mar 14 12:53:49 2022 +0100 scsi: aic7xxx: Fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220314115354.144023-26-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen drivers/scsi/aic7xxx/aicasm/aicasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5419e0f1562258b48560aee023ad2e41c0949df0 Author: Julia Lawall Date: Mon Mar 14 12:53:48 2022 +0100 scsi: qla2xxx: Fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220314115354.144023-25-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_gs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8037185d1ad8dcfa2fa4fef3dbc26507f4c37b12 Author: Julia Lawall Date: Mon Mar 14 12:53:41 2022 +0100 scsi: elx: libefc_sli: Fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220314115354.144023-18-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen drivers/scsi/elx/libefc_sli/sli4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9a866e6aaf4e5a1cfd7b2058d35f1b107a318827 Author: Julia Lawall Date: Mon Mar 14 12:53:26 2022 +0100 scsi: lpfc: Fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220314115354.144023-3-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_mbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 811655d005b24068c580bc8183f2c7f5cbd64149 Author: Nilesh Javali Date: Thu Mar 10 01:26:04 2022 -0800 scsi: qla2xxx: Update version to 10.02.07.400-k Link: https://lore.kernel.org/r/20220310092604.22950-14-njavali@marvell.com Reviewed-by: Himanshu Madhani Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3648bcf1c1374e9f42d241d83e2e50c0ef07a852 Author: Shreyas Deodhar Date: Thu Mar 10 01:26:03 2022 -0800 scsi: qla2xxx: Increase max limit of ql2xnvme_queues Increase max limit of ql2xnvme_queues to (max_qpair - 1). Link: https://lore.kernel.org/r/20220310092604.22950-13-njavali@marvell.com Fixes: 65120de26a54 ("scsi: qla2xxx: Add ql2xnvme_queues module param to configure number of NVMe queues") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Shreyas Deodhar Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_nvme.c | 15 ++++++++++----- drivers/scsi/qla2xxx/qla_nvme.h | 1 - drivers/scsi/qla2xxx/qla_os.c | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) commit a7e05f7a1bcbe4ee055479242de46c5c16ab03b1 Author: Manish Rangankar Date: Thu Mar 10 01:26:02 2022 -0800 scsi: qla2xxx: Use correct feature type field during RFF_ID processing During SNS Register FC-4 Features (RFF_ID) the initiator driver was sending incorrect type field for NVMe supported device. Use correct feature type field. Link: https://lore.kernel.org/r/20220310092604.22950-12-njavali@marvell.com Fixes: e374f9f59281 ("scsi: qla2xxx: Migrate switch registration commands away from mailbox interface") 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 drivers/scsi/qla2xxx/qla_gs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit f3502e2e98a92981601edc3dadf4b0f43c79836b Author: Quinn Tran Date: Thu Mar 10 01:26:01 2022 -0800 scsi: qla2xxx: Fix stuck session of PRLI reject Remove stale recovery code that prevents normal path recovery. Link: https://lore.kernel.org/r/20220310092604.22950-11-njavali@marvell.com Fixes: 1cbc0efcd9be ("scsi: qla2xxx: Fix retry for PRLI RJT with reason of BUSY") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_init.c | 7 ------- 1 file changed, 7 deletions(-) commit d2646eed7b19a206912f49101178cbbaa507256c Author: Quinn Tran Date: Thu Mar 10 01:26:00 2022 -0800 scsi: qla2xxx: Reduce false trigger to login While a session is in the middle of a relogin, a late RSCN can be delivered from switch. RSCN trigger fabric scan where the scan logic can trigger another session login while a login is in progress. Reduce the extra trigger to prevent multiple logins to the same session. Link: https://lore.kernel.org/r/20220310092604.22950-10-njavali@marvell.com Fixes: bee8b84686c4 ("scsi: qla2xxx: Reduce redundant ADISC command for RSCNs") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 713b415726f100f6644971e75ebfe1edbef1a390 Author: Quinn Tran Date: Thu Mar 10 01:25:59 2022 -0800 scsi: qla2xxx: Fix laggy FC remote port session recovery For session recovery, driver relies on the dpc thread to initiate certain operations. The dpc thread runs exclusively without the Mailbox interface being occupied. A recent code change for heartbeat check via mailbox cmd 0 is preventing the dpc thread from carrying out its operation. This patch allows the higher priority error recovery to run first before running the lower priority heartbeat check. Link: https://lore.kernel.org/r/20220310092604.22950-9-njavali@marvell.com Fixes: d94d8158e184 ("scsi: qla2xxx: Add heartbeat check") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_os.c | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) commit c02aada06d19a215c8291bd968a99a270e96f734 Author: Quinn Tran Date: Thu Mar 10 01:25:58 2022 -0800 scsi: qla2xxx: Fix hang due to session stuck User experienced device lost. The log shows Get port data base command was queued up, failed, and requeued again. Every time it is requeued, it set the FCF_ASYNC_ACTIVE. This prevents any recovery code from occurring because driver thinks a recovery is in progress for this session. In essence, this session is hung. The reason it gets into this place is the session deletion got in front of this call due to link perturbation. Break the requeue cycle and exit. The session deletion code will trigger a session relogin. Link: https://lore.kernel.org/r/20220310092604.22950-8-njavali@marvell.com Fixes: 726b85487067 ("qla2xxx: Add framework for async fabric discovery") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_def.h | 4 ++++ drivers/scsi/qla2xxx/qla_init.c | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) commit c13ce47c64ea8f14e77eecb40d1e7c2ac667f898 Author: Quinn Tran Date: Thu Mar 10 01:25:57 2022 -0800 scsi: qla2xxx: Fix N2N inconsistent PLOGI For N2N topology, ELS Passthrough is used to send PLOGI. On failure of ELS pass through PLOGI, driver flipped over to using LLIOCB PLOGI for N2N. This is not consistent. Delete the session to restart the connection where ELS pass through PLOGI would be used consistently. Link: https://lore.kernel.org/r/20220310092604.22950-7-njavali@marvell.com Fixes: c76ae845ea83 ("scsi: qla2xxx: Add error handling for PLOGI ELS passthrough") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_iocb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 0972252450f90db56dd5415a20e2aec21a08d036 Author: Arun Easi Date: Thu Mar 10 01:25:56 2022 -0800 scsi: qla2xxx: Fix crash during module load unload test During purex packet handling the driver was incorrectly freeing a pre-allocated structure. Fix this by skipping that entry. System crashed with the following stack during a module unload test. Call Trace: sbitmap_init_node+0x7f/0x1e0 sbitmap_queue_init_node+0x24/0x150 blk_mq_init_bitmaps+0x3d/0xa0 blk_mq_init_tags+0x68/0x90 blk_mq_alloc_map_and_rqs+0x44/0x120 blk_mq_alloc_set_map_and_rqs+0x63/0x150 blk_mq_alloc_tag_set+0x11b/0x230 scsi_add_host_with_dma.cold+0x3f/0x245 qla2x00_probe_one+0xd5a/0x1b80 [qla2xxx] Call Trace with slub_debug and debug kernel: kasan_report_invalid_free+0x50/0x80 __kasan_slab_free+0x137/0x150 slab_free_freelist_hook+0xc6/0x190 kfree+0xe8/0x2e0 qla2x00_free_device+0x3bb/0x5d0 [qla2xxx] qla2x00_remove_one+0x668/0xcf0 [qla2xxx] Link: https://lore.kernel.org/r/20220310092604.22950-6-njavali@marvell.com Fixes: 62e9dd177732 ("scsi: qla2xxx: Change in PUREX to handle FPIN ELS requests") Cc: stable@vger.kernel.org Reported-by: Marco Patalano Tested-by: Marco Patalano Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_os.c | 2 ++ 1 file changed, 2 insertions(+) commit c85ab7d9e27a80e48d5b7d7fb2fe2b0fdb2de523 Author: Arun Easi Date: Thu Mar 10 01:25:55 2022 -0800 scsi: qla2xxx: Fix missed DMA unmap for NVMe ls requests At NVMe ELS request time, request structure is DMA mapped and never unmapped. Fix this by calling the unmap on ELS completion. Link: https://lore.kernel.org/r/20220310092604.22950-5-njavali@marvell.com Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration") 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 drivers/scsi/qla2xxx/qla_nvme.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) commit db212f2eb3fb7f546366777e93c8f54614d39269 Author: Arun Easi Date: Thu Mar 10 01:25:54 2022 -0800 scsi: qla2xxx: Fix loss of NVMe namespaces after driver reload test Driver registration of localport can race when it happens at the remote port discovery time. Fix this by calling the registration under a mutex. Link: https://lore.kernel.org/r/20220310092604.22950-4-njavali@marvell.com Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration") Cc: stable@vger.kernel.org Reported-by: Marco Patalano Tested-by: Marco Patalano Reviewed-by: Himanshu Madhani Signed-off-by: Arun Easi Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_nvme.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) commit 6a45c8e137d4e2c72eecf1ac7cf64f2fdfcead99 Author: Quinn Tran Date: Thu Mar 10 01:25:53 2022 -0800 scsi: qla2xxx: Fix disk failure to rediscover User experienced some of the LUN failed to get rediscovered after long cable pull test. The issue is triggered by a race condition between driver setting session online state vs starting the LUN scan process at the same time. Current code set the online state after notifying the session is available. In this case, trigger to start the LUN scan process happened before driver could set the session in online state. LUN scan ends up with failure due to the session online check was failing. Set the online state before reporting of the availability of the session. Link: https://lore.kernel.org/r/20220310092604.22950-3-njavali@marvell.com Fixes: aecf043443d3 ("scsi: qla2xxx: Fix Remote port registration") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_init.c | 5 +++-- drivers/scsi/qla2xxx/qla_nvme.c | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) commit 58ca5999e0367d131de82a75257fbfd5aed0195d Author: Quinn Tran Date: Thu Mar 10 01:25:52 2022 -0800 scsi: qla2xxx: Fix incorrect reporting of task management failure User experienced no task management error while target device is responding with error. The RSP_CODE field in the status IOCB is in little endian. Driver assumes it's big endian and it picked up erroneous data. Convert the data back to big endian as is on the wire. Link: https://lore.kernel.org/r/20220310092604.22950-2-njavali@marvell.com Fixes: faef62d13463 ("[SCSI] qla2xxx: Fix Task Management command asynchronous handling") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Quinn Tran Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen drivers/scsi/qla2xxx/qla_isr.c | 1 + 1 file changed, 1 insertion(+) commit 8709c323091be019f76a49cf783052a5636aca85 Author: Wenchao Hao Date: Wed Mar 9 20:57:59 2022 -0500 scsi: libiscsi: Teardown iscsi_cls_conn gracefully Commit 1b8d0300a3e9 ("scsi: libiscsi: Fix UAF in iscsi_conn_get_param()/iscsi_conn_teardown()") fixed an UAF in iscsi_conn_get_param() and introduced 2 tmp_xxx varibles. We can gracefully fix this UAF with the help of device_del(). Calling iscsi_remove_conn() at the beginning of iscsi_conn_teardown would make userspace unable to see iscsi_cls_conn. This way we we can free memory safely. Remove iscsi_destroy_conn() since it is no longer used. Link: https://lore.kernel.org/r/20220310015759.3296841-4-haowenchao@huawei.com Reviewed-by: Mike Christie Signed-off-by: Wenchao Hao Signed-off-by: Wu Bo Signed-off-by: Martin K. Petersen drivers/scsi/libiscsi.c | 10 +++++----- drivers/scsi/scsi_transport_iscsi.c | 27 +++++---------------------- include/scsi/scsi_transport_iscsi.h | 1 - 3 files changed, 10 insertions(+), 28 deletions(-) commit 7dae459f5e56a89ab01413ae055595c982713349 Author: Wenchao Hao Date: Wed Mar 9 20:57:58 2022 -0500 scsi: libiscsi: Add iscsi_cls_conn to sysfs after initialization iscsi_create_conn() exposed iscsi_cls_conn to sysfs prior to initialization of iscsi_conn's dd_data. When userspace tried to access an attribute such as the connect address, a NULL pointer dereference was observed. Do not add iscsi_cls_conn to sysfs until it has been initialized. Remove iscsi_create_conn() since it is no longer used. Link: https://lore.kernel.org/r/20220310015759.3296841-3-haowenchao@huawei.com Reviewed-by: Mike Christie Signed-off-by: Wenchao Hao Signed-off-by: Wu Bo Signed-off-by: Martin K. Petersen drivers/scsi/libiscsi.c | 13 ++++++- drivers/scsi/scsi_transport_iscsi.c | 76 ------------------------------------- include/scsi/scsi_transport_iscsi.h | 2 - 3 files changed, 11 insertions(+), 80 deletions(-) commit ad515cada7dac3cdf5e1ad77a0ed696f5f34e0ab Author: Wenchao Hao Date: Wed Mar 9 20:57:57 2022 -0500 scsi: iscsi: Add helper functions to manage iscsi_cls_conn - iscsi_alloc_conn(): Allocate and initialize iscsi_cls_conn - iscsi_add_conn(): Expose iscsi_cls_conn to userspace via sysfs - iscsi_remove_conn(): Remove iscsi_cls_conn from sysfs Link: https://lore.kernel.org/r/20220310015759.3296841-2-haowenchao@huawei.com Reviewed-by: Mike Christie Signed-off-by: Wenchao Hao Signed-off-by: Wu Bo Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 97 +++++++++++++++++++++++++++++++++++++ include/scsi/scsi_transport_iscsi.h | 4 ++ 2 files changed, 101 insertions(+) commit 8a3e634dc5a37aaa6d4876614716e84fb26dbbc0 Author: Zhengqiao Xia Date: Mon Mar 14 21:09:55 2022 -0700 HID: google: modify HID device groups of eel If HID_GROUP of eel is set to HID_GROUP_GENERIC, Whiskers Tablet Mode Switch of eel hammer will not be detected by system because the hid-vivaldi driver probes the device. When it is set to HID_GROUP_VIVALDI, system will detect Whiskers Tablet Mode Switch successfully and also support the vivaldi keyboard layout. Tested-by: "Sean O'Brien" Acked-by: Jiri Kosina Signed-off-by: Zhengqiao Xia [swboyd@chromium.org: Expand on commit text] Signed-off-by: Stephen Boyd Tested-by: Stephen Boyd # coachz, wormdingler Link: https://lore.kernel.org/r/20220228075446.466016-6-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov drivers/hid/hid-google-hammer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a9d672998a33e4bccdf62f6c2f8a47d51893b83f Author: Stephen Boyd Date: Mon Mar 14 21:08:44 2022 -0700 HID: google: Add support for vivaldi to hid-hammer Add support to the hammer driver to parse vivaldi keyboard layouts and expose them to userspace. This allows hammer devices to use vivaldi function row keys while also supporting the other features this driver supports, like the CBAS (chrome base attached switch) and a keyboard backlight. Signed-off-by: Stephen Boyd Tested-by: Stephen Boyd # coachz, wormdingler Link: https://lore.kernel.org/r/20220228075446.466016-5-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov drivers/hid/Kconfig | 2 ++ drivers/hid/hid-google-hammer.c | 11 +++++++++++ 2 files changed, 13 insertions(+) commit 33bbe04a15f292998298cdb5751788c15acd60df Author: Stephen Boyd Date: Mon Mar 14 21:04:39 2022 -0700 HID: google: extract Vivaldi hid feature mapping for use in hid-hammer We need to support parsing the HID device in both the Vivaldi and the Hammer drivers so that we can properly expose the function row physmap to userspace when a hammer device uses a vivaldi keyboard layout for the function row keys. Extract the feature mapping logic from the vivaldi driver into an hid specific vivaldi library so we can use it from both HID drivers. To allow more code sharing we mandate that vivaldi data must be placed at the very beginning of the driver data attached to the HID device instance. Signed-off-by: Stephen Boyd Tested-by: Stephen Boyd # coachz, wormdingler Link: https://lore.kernel.org/r/20220228075446.466016-4-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov drivers/hid/Kconfig | 8 +++ drivers/hid/Makefile | 1 + drivers/hid/hid-vivaldi-common.c | 140 +++++++++++++++++++++++++++++++++++++++ drivers/hid/hid-vivaldi-common.h | 16 +++++ drivers/hid/hid-vivaldi.c | 106 +---------------------------- 5 files changed, 167 insertions(+), 104 deletions(-) commit 45ceaf14d53a123e5955477da501bc6f26b99039 Author: Stephen Boyd Date: Mon Mar 14 19:45:37 2022 -0700 Input: extract ChromeOS vivaldi physmap show function Let's introduce a common library file for the physmap show function duplicated between three different keyboard drivers. This largely copies the code from cros_ec_keyb.c which has the most recent version of the show function, while using the vivaldi_data struct from the hid-vivaldi driver. This saves a small amount of space in an allyesconfig build. $ ./scripts/bloat-o-meter vmlinux.before vmlinux.after add/remove: 3/0 grow/shrink: 2/3 up/down: 412/-720 (-308) Function old new delta vivaldi_function_row_physmap_show - 292 +292 _sub_I_65535_1 1057564 1057616 +52 _sub_D_65535_0 1057564 1057616 +52 e843419@49f2_00062737_9b04 - 8 +8 e843419@20f6_0002a34d_35bc - 8 +8 atkbd_parse_fwnode_data 480 472 -8 atkbd_do_show_function_row_physmap 316 76 -240 function_row_physmap_show 620 148 -472 Total: Before=285581925, After=285581617, chg -0.00% Signed-off-by: Stephen Boyd Tested-by: Stephen Boyd # coachz, wormdingler Link: https://lore.kernel.org/r/20220228075446.466016-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov drivers/hid/Kconfig | 1 + drivers/hid/hid-vivaldi.c | 27 ++++++---------------- drivers/input/Kconfig | 7 ++++++ drivers/input/Makefile | 1 + drivers/input/keyboard/Kconfig | 2 ++ drivers/input/keyboard/atkbd.c | 27 +++++++--------------- drivers/input/keyboard/cros_ec_keyb.c | 43 +++++++++++++---------------------- drivers/input/vivaldi-fmap.c | 39 +++++++++++++++++++++++++++++++ include/linux/input/vivaldi-fmap.h | 27 ++++++++++++++++++++++ 9 files changed, 108 insertions(+), 66 deletions(-) commit d950db3f80a801797ec09cf6a410b19621a6e243 Author: Dmitry Torokhov Date: Mon Mar 14 19:30:13 2022 -0700 HID: google: switch to devm when registering keyboard backlight LED We can use devm to register keyboard backlight LED on hammer devices, this will allow us to use HID's driver data for something else later. Link: https://lore.kernel.org/r/20220228075446.466016-2-dmitry.torokhov@gmail.com Tested-by: Stephen Boyd # coachz, wormdingler Signed-off-by: Dmitry Torokhov drivers/hid/hid-google-hammer.c | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) commit e1b353e7a31dcaf47c234812c46a2db9cd5be584 Author: Yang Li Date: Tue Mar 1 16:04:48 2022 +0800 scsi: core: Remove unreachable code warning The smatch tool reported the following warning: drivers/scsi/scsi_error.c:1988 scsi_decide_disposition() warn: ignoring unreachable code. Remove the "default:return FAILED;" instead of "return FAILED;" reported by smatch, because compilers can provide more useful diagnostics about switch/case statements that do not have a default statement, especially if the "switch" applies to a value with enumeration type. Link: https://lore.kernel.org/r/20220301080448.112813-1-yang.lee@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Martin K. Petersen drivers/scsi/scsi_error.c | 2 -- 1 file changed, 2 deletions(-) commit 7db304bd2a4fbf98ed763cd7f599598f5d0e2477 Author: Yang Li Date: Fri Feb 25 09:16:05 2022 +0800 scsi: megasas: Clean up some inconsistent indenting Eliminate the following smatch warning: drivers/scsi/megaraid/megaraid_sas_fusion.c:5104 megasas_reset_fusion() warn: inconsistent indenting Link: https://lore.kernel.org/r/20220225011605.130927-1-yang.lee@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Martin K. Petersen drivers/scsi/megaraid/megaraid_sas_fusion.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f089ce7bb5eedec0481cb2b0df174cdd3021f233 Author: Jiapeng Chong Date: Wed Mar 9 08:50:31 2022 +0800 scsi: aacraid: Clean up some inconsistent indenting Eliminate the following smatch warning: drivers/scsi/aacraid/linit.c:867 aac_eh_tmf_hard_reset_fib() warn: inconsistent indenting. Link: https://lore.kernel.org/r/20220309005031.126504-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Martin K. Petersen drivers/scsi/aacraid/linit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d72d827f2f2636d8d72f0f3ebe5b661c9a24d343 Author: Mingzhe Zou Date: Tue Mar 1 15:55:00 2022 +0800 scsi: target: Add iscsi/cpus_allowed_list in configfs The RX/TX threads for iSCSI connection can be scheduled to any online CPUs, and will not be rescheduled. When binding other heavy load threads along with iSCSI connection RX/TX thread to the same CPU, the iSCSI performance will be worse. Add iscsi/cpus_allowed_list in configfs. The available CPU set of iSCSI connection RX/TX threads is allowed_cpus & online_cpus. If it is modified, all RX/TX threads will be rescheduled. Link: https://lore.kernel.org/r/20220301075500.14266-1-mingzhe.zou@easystack.cn Reviewed-by: Mike Christie Signed-off-by: Mingzhe Zou Signed-off-by: Martin K. Petersen drivers/target/iscsi/iscsi_target.c | 77 ++++++++++++++++++++++++++-- drivers/target/iscsi/iscsi_target_configfs.c | 32 ++++++++++++ drivers/target/iscsi/iscsi_target_login.c | 8 +++ include/target/iscsi/iscsi_target_core.h | 31 +++-------- 4 files changed, 120 insertions(+), 28 deletions(-) commit 095478a6e5bf590f2bbf341569eb25173c9c5f32 Author: John Garry Date: Fri Mar 11 20:23:52 2022 +0800 scsi: hisi_sas: Use libsas internal abort support Use the common libsas internal abort functionality. In addition, this driver has special handling for internal abort timeouts - specifically whether to reset the controller in that instance, so extend the API for that. Timeout is now increased to 20 * Hz from 6 * Hz. We also retry for failure now, but this should not make a difference. Link: https://lore.kernel.org/r/1647001432-239276-5-git-send-email-john.garry@huawei.com Tested-by: Damien Le Moal Acked-by: Jack Wang Signed-off-by: John Garry Signed-off-by: Martin K. Petersen drivers/scsi/hisi_sas/hisi_sas.h | 8 +- drivers/scsi/hisi_sas/hisi_sas_main.c | 453 +++++++++++---------------------- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 11 +- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 18 +- drivers/scsi/libsas/sas_scsi_host.c | 13 +- include/scsi/libsas.h | 2 + 6 files changed, 183 insertions(+), 322 deletions(-) commit 2cbbf489778eb9dde51392ec5f74ae2868e4b857 Author: John Garry Date: Fri Mar 11 20:23:51 2022 +0800 scsi: pm8001: Use libsas internal abort support New special handling is added for SAS_PROTOCOL_INTERNAL_ABORT proto so that we may use the common queue command API. Link: https://lore.kernel.org/r/1647001432-239276-4-git-send-email-john.garry@huawei.com Tested-by: Damien Le Moal Acked-by: Jack Wang Signed-off-by: John Garry Signed-off-by: Martin K. Petersen drivers/scsi/pm8001/pm8001_hwi.c | 27 +++--- drivers/scsi/pm8001/pm8001_hwi.h | 5 -- drivers/scsi/pm8001/pm8001_sas.c | 178 ++++++++++++--------------------------- drivers/scsi/pm8001/pm8001_sas.h | 6 +- drivers/scsi/pm8001/pm80xx_hwi.h | 5 -- 5 files changed, 74 insertions(+), 147 deletions(-) commit 6a91c3e31578979a93b500efc76af4d3499f75ad Author: John Garry Date: Fri Mar 11 20:23:50 2022 +0800 scsi: libsas: Add sas_execute_internal_abort_dev() Add support for a "device" variant of internal abort, which will abort all pending I/Os for a specific device. Link: https://lore.kernel.org/r/1647001432-239276-3-git-send-email-john.garry@huawei.com Tested-by: Damien Le Moal Acked-by: Jack Wang Signed-off-by: John Garry Signed-off-by: Martin K. Petersen drivers/scsi/libsas/sas_scsi_host.c | 8 ++++++++ include/scsi/libsas.h | 8 ++++++++ 2 files changed, 16 insertions(+) commit 5c9bf3635b66add7d829b4d8d538ae0d770d9d89 Author: John Garry Date: Fri Mar 11 20:23:49 2022 +0800 scsi: libsas: Add sas_execute_internal_abort_single() The internal abort feature is common to hisi_sas and pm8001 HBAs, and the driver support is similar also, so add a common handler. Two modes of operation will be supported: - single: Abort a single tagged command - device: Abort all commands associated with a specific domain device A new protocol is added, SAS_PROTOCOL_INTERNAL_ABORT, so the common queue command API may be re-used. Only add "single" support as a first step. Link: https://lore.kernel.org/r/1647001432-239276-2-git-send-email-john.garry@huawei.com Tested-by: Damien Le Moal Acked-by: Jack Wang Signed-off-by: John Garry Signed-off-by: Martin K. Petersen drivers/scsi/libsas/sas_scsi_host.c | 74 +++++++++++++++++++++++++++++++++++++ include/scsi/libsas.h | 14 +++++++ include/scsi/sas.h | 2 + 3 files changed, 90 insertions(+) commit 2ea3a393bfae2e50003ecc14b757736eeba7ea6a Author: James Smart Date: Thu Mar 10 07:48:45 2022 -0800 scsi: lpfc: Remove failing soft_wwn support The soft_wwpn/soft_wwn functionality, which allows the driver to modify service parameters in an attempt to override the adapter-assigned WWN, was originally attempted to be removed roughly 6 yrs ago as new fabric features were being introduced that clashed with the implementation. In the end, the feature was left in with the user being responsible if things went south. We've reached a point where soft_wwn is no longer functional and is failing in almost all production use cases. Use of Fabric features such as Fabric Assigned WWPN and Automatic DPORT is now prevalent and the features require coordination between the adapter and driver that can't be solved by the simplistic update of the service parameters. As it is no longer functional, the feature is to be removed. There are still ways to override the adapter-assigned WWN but they require the admin to invoke bios/efi level menus. Link: https://lore.kernel.org/r/20220310154845.11125-1-jsmart2021@gmail.com Reviewed-by: Himanshu Madhani Co-developed-by: Dick Kennedy Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc.h | 3 - drivers/scsi/lpfc/lpfc_attr.c | 228 ------------------------------------------ drivers/scsi/lpfc/lpfc_init.c | 12 +-- 3 files changed, 1 insertion(+), 242 deletions(-) commit ce8356335027d3929fbfae4127451adaf36e1cd4 Merge: 5fb3fb8aa22f 09688c0166e7 Author: Dmitry Torokhov Date: Mon Mar 14 19:14:29 2022 -0700 Merge tag 'v5.17-rc8' into next Sync up with mainline to again get the latest changes in HID subsystem. commit 89388f8730699c259f8090ec435fb43569efe4ac Author: Miaoqian Lin Date: Mon Mar 7 12:02:34 2022 +0000 pinctrl/rockchip: Add missing of_node_put() in rockchip_pinctrl_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: 1e747e59cc4d ("pinctrl: rockchip: base regmap supplied by a syscon") Fixes: 14dee8677e19 ("pinctrl: rockchip: let pmu registers be supplied by a syscon") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220307120234.28657-1-linmq006@gmail.com Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-rockchip.c | 2 ++ 1 file changed, 2 insertions(+) commit c09ac191b1f97cfa06f394dbfd7a5db07986cefc Author: Miaoqian Lin Date: Mon Mar 7 11:51:16 2022 +0000 pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe This node pointer is returned by of_parse_phandle() with refcount incremented in this function. Calling of_node_put() to avoid the refcount leak. Fixes: 32e67eee670e ("pinctrl: nomadik: Allow prcm_base to be extracted from Device Tree") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220307115116.25316-1-linmq006@gmail.com Signed-off-by: Linus Walleij drivers/pinctrl/nomadik/pinctrl-nomadik.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit de845036f997119bcacbdb7b4ccf3b6cf960745b Author: Meng Tang Date: Thu Mar 3 16:02:06 2022 +0800 pinctrl: berlin: fix error return code of berlin_pinctrl_build_state() When krealloc() fails and pctrl->functions is NULL, no error return code of berlin_pinctrl_build_state() is assigned. To fix this bug, ret is assigned with -ENOMEM when pctrl->functions is NULL. Signed-off-by: Meng Tang Link: https://lore.kernel.org/r/20220303080206.16463-1-tangmeng@uniontech.com Signed-off-by: Linus Walleij drivers/pinctrl/berlin/berlin.c | 2 ++ 1 file changed, 2 insertions(+) commit 5fb3fb8aa22ff6e6da4018fd3ab3e30e2fdc5e53 Author: Lv Ruyi (CGEL ZTE) Date: Mon Mar 14 18:12:21 2022 -0700 Input: mt6779-keypad - fix signedness bug The irq variable is defined as unsigned int. If the platform_get_irq() returns a negative value, data type cast may result in error. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi (CGEL ZTE) Reviewed-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220308025054.2077162-1-lv.ruyi@zte.com.cn Signed-off-by: Dmitry Torokhov drivers/input/keyboard/mt6779-keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6b2b04590b51aa4cf395fcd185ce439cab5961dc Author: Tejun Heo Date: Mon Mar 14 14:30:11 2022 -1000 block: don't merge across cgroup boundaries if blkcg is enabled blk-iocost and iolatency are cgroup aware rq-qos policies but they didn't disable merges across different cgroups. This obviously can lead to accounting and control errors but more importantly to priority inversions - e.g. an IO which belongs to a higher priority cgroup or IO class may end up getting throttled incorrectly because it gets merged to an IO issued from a low priority cgroup. Fix it by adding blk_cgroup_mergeable() which is called from merge paths and rejects cross-cgroup and cross-issue_as_root merges. Signed-off-by: Tejun Heo Fixes: d70675121546 ("block: introduce blk-iolatency io controller") Cc: stable@vger.kernel.org # v4.19+ Cc: Josef Bacik Link: https://lore.kernel.org/r/Yi/eE/6zFNyWJ+qd@slm.duckdns.org Signed-off-by: Jens Axboe block/blk-cgroup.h | 17 +++++++++++++++++ block/blk-merge.c | 11 +++++++++++ 2 files changed, 28 insertions(+) commit c0e4c71a9e7ceea8f14e0b875fcc23266caf05e6 Author: Bjorn Andersson Date: Tue Mar 8 14:11:32 2022 -0800 pinctrl: qcom: Introduce sc8280xp TLMM driver The SC8280XP comes, like all other Qualcomm platforms, with a TLMM block, so add a driver for it. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220308221132.1423218-2-bjorn.andersson@linaro.org Signed-off-by: Linus Walleij drivers/pinctrl/qcom/Kconfig | 9 + drivers/pinctrl/qcom/Makefile | 1 + drivers/pinctrl/qcom/pinctrl-sc8280xp.c | 1953 +++++++++++++++++++++++++++++++ 3 files changed, 1963 insertions(+) commit d4d2f9668ffd1ca10d68b84c116acbbbc6ef55bc Author: Bjorn Andersson Date: Tue Mar 8 14:11:31 2022 -0800 dt-bindings: pinctrl: qcom: Add sc8280xp TLMM binding The Qualcomm SC8280XP platform contains a single block of registers for the TLMM block. This provides pinconf and pinmux for 228 GPIOs, 2 UFS_RESET pins and one SDC interface. Signed-off-by: Bjorn Andersson Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308221132.1423218-1-bjorn.andersson@linaro.org Signed-off-by: Linus Walleij .../bindings/pinctrl/qcom,sc8280xp-pinctrl.yaml | 151 +++++++++++++++++++++ 1 file changed, 151 insertions(+) commit 1f3c85c22db4aecee4080d42fccc336a1bbc5da7 Author: Michael Walle Date: Sat Feb 26 21:45:07 2022 +0100 pinctrl: microchip-sgpio: wait until output is actually set Right now, when a gpio value is set, the actual hardware pin gets set asynchronously. When linux write the output register, it takes some time until it is actually propagated to the output shift registers. If that output port is connected to an I2C mux for example, the linux driver assumes the I2C bus is already switched although it is not. Fortunately, there is a single shot mode with a feedback: you can trigger the single shot and the hardware will clear that bit once it has finished the clocking and strobed the load signal of the shift registers. This can take a considerable amount of time though. Measuremens have shown that it takes up to a whole burst cycle gap which is about 50ms on the largest setting. Therefore, we have to mark the output bank as sleepable. To avoid unnecessary waiting, just trigger the single shot if the value was actually changed. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220226204507.2511633-6-michael@walle.cc Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-microchip-sgpio.c | 69 ++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) commit 2560c681999c9d33eb32b208de6a607622867c95 Author: Michael Walle Date: Sat Feb 26 21:45:06 2022 +0100 pinctrl: microchip-sgpio: return error in spgio_output_set() Make sgpio_output_set() return an error value. Don't just ignore the return value of any regmap access but propagate it to our callers. Even if the accesses never fail, this is a preparation patch to add single shot mode where we need to poll a bit and thus we might get -ETIMEDOUT. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220226204507.2511633-5-michael@walle.cc Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-microchip-sgpio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 0e68328edb3227cd00681671843c3d4113083456 Author: Michael Walle Date: Sat Feb 26 21:45:05 2022 +0100 pinctrl: microchip-sgpio: use regmap_update_bits() Convert sgpio_clrsetbits() to use regmap_update_bits() and drop the spinlocks because regmap already takes care of the locking. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220226204507.2511633-4-michael@walle.cc Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-microchip-sgpio.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) commit cd8c48b4efcfb2e71ef8a5d2208a0db5002b78bf Author: Michael Walle Date: Sat Feb 26 21:45:04 2022 +0100 pinctrl: microchip-sgpio: don't do RMW for interrupt ack register The interrupt ack register has the usual "write one to clear" semantics. No read-modify-write is required here. This is also a preparation patch to change the sgpio_clrsetbits() to use regmap_update_bits() which don't write the value if it is not changed. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220226204507.2511633-3-michael@walle.cc Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-microchip-sgpio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) commit 7996c5f5ec7a20b3f6b8fae93fcf3cb8f1c01743 Author: Michael Walle Date: Sat Feb 26 21:45:03 2022 +0100 pinctrl: microchip-sgpio: lock RMW access Protect any RMW access to the registers by a spinlock. Fixes: 7e5ea974e61c ("pinctrl: pinctrl-microchip-sgpio: Add pinctrl driver for Microsemi Serial GPIO") Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220226204507.2511633-2-michael@walle.cc Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-microchip-sgpio.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit d1f2c82f3b1f428bdc0933dde52fb93ae796d4ee Author: Horatiu Vultur Date: Fri Mar 4 15:44:32 2022 +0100 pinctrl: ocelot: Fix interrupt parsing In the blamed commit, it removes the duplicate of_node assignment in the driver. But the driver uses this before calling into of_gpio_dev_init to determine if it needs to assign an IRQ chip to the GPIO. The fixes consists in using the platform_get_irq_optional Fixes: 8a8d6bbe1d3bc7 ("pinctrl: Get rid of duplicate of_node assignment in the drivers") Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220304144432.3397621-3-horatiu.vultur@microchip.com Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-ocelot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f5141ae4ab7825cc2dd0a5e9c1a4a183c97621a6 Author: Alexander Stein Date: Thu Feb 24 10:42:43 2022 +0100 pinctrl: imx: Reduce printk message level for empty nodes iomuxc_snvs from imx6ull supports 2 boot mode and 10 tamper pins. Probably most users won't use them, causing this error message during boot: no groups defined in /soc/bus@2200000/iomuxc-snvs@2290000 This is actually not an error in this case, so reduce the level accordingly. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220224094243.1376965-1-alexander.stein@ew.tq-group.com Signed-off-by: Linus Walleij drivers/pinctrl/freescale/pinctrl-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d5140268a38d5eedd4f92ffe9a5abef9317c576c Author: Srinivas Neeli Date: Thu Feb 24 10:06:05 2022 +0530 pinctrl: zynq: use module_platform_driver to simplify the code module_platform_driver() makes the code simpler by eliminating boilerplate code. Signed-off-by: Srinivas Neeli Link: https://lore.kernel.org/r/20220224043605.26157-1-srinivas.neeli@xilinx.com Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-zynq.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit bd5a3a16dc98ec53a58008355671a38507894ba6 Author: Tom Rix Date: Sun Feb 20 08:23:55 2022 -0800 pinctrl: qcom: cleanup comments Add leading space to spdx tag Replacements voilates to violates sepearte to separate Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220220162355.3594831-1-trix@redhat.com Signed-off-by: Linus Walleij drivers/pinctrl/qcom/pinctrl-sc8180x.c | 4 ++-- drivers/pinctrl/qcom/pinctrl-sm6125.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) commit 69c3d58dc187061a041ae76190ad604dc27c13a3 Author: Tinghan Shen Date: Wed Feb 16 19:31:30 2022 +0800 dt-bindings: pinctrl: mt8195: Add mediatek,drive-strength-adv property Extend driving support for I2C pins on SoC mt8195. This property is already documented in mediatek,mt8183-pinctrl.yaml. Signed-off-by: Tinghan Shen Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220216113131.13145-3-tinghan.shen@mediatek.com Signed-off-by: Linus Walleij .../bindings/pinctrl/pinctrl-mt8195.yaml | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) commit 0dd1628aaef70331fbe605d401085070ebe075cc Author: AngeloGioacchino Del Regno Date: Tue Mar 8 18:09:56 2022 +0800 pinctrl: mediatek: pinctrl-mtk-common: Simplify with dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220308100956.2750295-12-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) commit dc75d1ed7ffbf28c1654076319403bd7716184b6 Author: AngeloGioacchino Del Regno Date: Tue Mar 8 18:09:55 2022 +0800 pinctrl: mediatek: pinctrl-paris: Simplify with dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220308100956.2750295-11-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-paris.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) commit 9c59fda330c061546495444810a4945deb20c21d Author: AngeloGioacchino Del Regno Date: Tue Mar 8 18:09:54 2022 +0800 pinctrl: mediatek: pinctrl-moore: Simplify with dev_err_probe() Use the dev_err_probe() helper to simplify error handling during probe. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai Signed-off-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220308100956.2750295-10-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-moore.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) commit e5fabbe43f3f58c40c081dbe982431a088a68d9d Author: Chen-Yu Tsai Date: Tue Mar 8 18:09:53 2022 +0800 pinctrl: mediatek: paris: Support generic PIN_CONFIG_DRIVE_STRENGTH_UA Some of the MediaTek chips that utilize the Paris pinctrl driver library support a lower drive strength (<= 1mA) than the standard drive strength settings (2~16 mA) on certain pins. This was previously supported by the custom MTK_PIN_CONFIG_DRV_ADV parameter along with the "mediatek,drive-strength-adv" device tree property. The drive strength values for this hardware are 125, 250, 500, and 1000 mA, and can be readily described by the existing "drive-strength-microamp" property, which then gets parsed by the generic pinconf library into the parameter PIN_CONFIG_DRIVE_STRENGTH_UA. Add support for PIN_CONFIG_DRIVE_STRENGTH_UA while keeping the old custom parameter around for backward compatibility. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308100956.2750295-9-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-paris.c | 99 ++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) commit 9b780fa1ff14663c2e0f07ad098b96b8337f27a4 Author: Chen-Yu Tsai Date: Tue Mar 8 18:09:52 2022 +0800 pinctrl: mediatek: paris: Rework mtk_pinconf_{get,set} switch/case logic The current code deals with optional features by testing for the function pointers and returning -ENOTSUPP if it is not valid. This is done for multiple pin config settings and results in the code that handles the supporting cases to get indented by one level. This is aggrevated by the fact that some features require another level of conditionals. Instead of assigning the same error code in all unsupported optional feature cases, simply have that error code as the default, and break out of the switch/case block whenever a feature is unsupported, or an error is returned. This reduces indentation by one level for the useful code. Also replace the goto statements with break statements. The result is the same, as the gotos simply exit the switch/case block, which can also be achieved with a break statement. With the latter the intent is clear and easier to understand. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308100956.2750295-8-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-paris.c | 144 +++++++++++++------------------ 1 file changed, 61 insertions(+), 83 deletions(-) commit 1763933d377ecb05454f8d20e3c8922480db2ac0 Author: Chen-Yu Tsai Date: Tue Mar 8 18:09:51 2022 +0800 pinctrl: mediatek: paris: Skip custom extra pin config dump for virtual GPIOs Virtual GPIOs do not have any hardware state associated with them. Any attempt to read back hardware state for these pins result in error codes. Skip dumping extra pin config information for these virtual GPIOs. Fixes: 184d8e13f9b1 ("pinctrl: mediatek: Add support for pin configuration dump via debugfs.") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308100956.2750295-7-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-paris.c | 3 +++ 1 file changed, 3 insertions(+) commit fcde2a3fc86c5974b34ba5cfb1b532fc00fefb8d Author: Chen-Yu Tsai Date: Tue Mar 8 18:09:50 2022 +0800 pinctrl: mediatek: paris: Drop extra newline in mtk_pctrl_show_one_pin() The caller of mtk_pctrl_show_one_pin() is responsible for printing the full line. mtk_pctrl_show_one_pin(), called through mtk_pctrl_dbg_show(), should only produce a string containing the extra information the driver wants included. Drop the extra newlines. Also unbreak the line that is only slightly over 80 characters to make it easier on the eye, and get rid of the braces now that each block in the conditionals is just one line. Fixes: 184d8e13f9b1 ("pinctrl: mediatek: Add support for pin configuration dump via debugfs.") Fixes: fb34a9ae383a ("pinctrl: mediatek: support rsel feature") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308100956.2750295-6-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-paris.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) commit 54fe55fb384ade630ef20b9a8b8f3b2a89ad97f2 Author: Chen-Yu Tsai Date: Tue Mar 8 18:09:49 2022 +0800 pinctrl: mediatek: paris: Fix pingroup pin config state readback mtk_pconf_group_get(), used to read back pingroup pin config state, simply returns a set of configs saved from a previous invocation of mtk_pconf_group_set(). This is an unfiltered, unvalidated set passed in from the pinconf core, which does not match the current hardware state. Since the driver library is designed to have one pin per group, pass through mtk_pconf_group_get() to mtk_pinconf_get(), to read back the current pin config state of the only pin in the group. Also drop the assignment of pin config state to the group. Fixes: 805250982bb5 ("pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308100956.2750295-5-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-paris.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 19bce7ce0a593c7024030a0cda9e23facea3c93d Author: Chen-Yu Tsai Date: Tue Mar 8 18:09:48 2022 +0800 pinctrl: mediatek: paris: Fix "argument" argument type for mtk_pinconf_get() For mtk_pinconf_get(), the "argument" argument is typically returned by pinconf_to_config_argument(), which holds the value for a given pinconf parameter. It certainly should not have the type of "enum pin_config_param", which describes the type of the pinconf parameter itself. Change the type to u32, which matches the return type of pinconf_to_config_argument(). Fixes: 805250982bb5 ("pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308100956.2750295-4-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-paris.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 3e8c6bc608480010f360c4a59578d7841726137d Author: Chen-Yu Tsai Date: Tue Mar 8 18:09:47 2022 +0800 pinctrl: mediatek: paris: Fix PIN_CONFIG_BIAS_* readback When reading back pin bias settings, if the pin is not in the corresponding bias state, the function should return -EINVAL. Fix this in the mediatek-paris pinctrl library so that the read back state is not littered with bogus a "input bias disabled" combined with "pull up" or "pull down" states. Fixes: 805250982bb5 ("pinctrl: mediatek: add pinctrl-paris that implements the vendor dt-bindings") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308100956.2750295-3-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-paris.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) commit 188e5834b930acd03ad3cf7c5e7aa24db9665a29 Author: Chen-Yu Tsai Date: Tue Mar 8 18:09:46 2022 +0800 pinctrl: pinconf-generic: Print arguments for bias-pull-* The bias-pull-* properties, or PIN_CONFIG_BIAS_PULL_* pin config parameters, accept optional arguments in ohms denoting the strength of the pin bias. Print these values out in debugfs as well. Fixes: eec450713e5c ("pinctrl: pinconf-generic: Add flag to print arguments") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308100956.2750295-2-wenst@chromium.org Signed-off-by: Linus Walleij drivers/pinctrl/pinconf-generic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 1261691dda6b7c229a01cbcb5ea9070d62435722 Author: Jacob Keller Date: Tue Feb 22 16:26:58 2022 -0800 ice: use ice_is_vf_trusted helper function The ice_vc_cfg_promiscuous_mode_msg function directly checks ICE_VIRTCHNL_VF_CAP_PRIVILEGE, instead of using the existing helper function ice_is_vf_trusted. Switch this to use the helper function so that all trusted checks are consistent. This aids in any potential future refactor by ensuring consistent code. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit 2b36944810b2270e4af8524ab14d42250a902510 Author: Jacob Keller Date: Tue Feb 22 16:26:57 2022 -0800 ice: log an error message when eswitch fails to configure When ice_eswitch_configure fails, print an error message to make it more obvious why VF initialization did not succeed. Signed-off-by: Jacob Keller Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 94ab2488d467e69d1216bad97a5839afb3b805c3 Author: Jacob Keller Date: Tue Feb 22 16:26:56 2022 -0800 ice: cleanup error logging for ice_ena_vfs The ice_ena_vfs function and some of its sub-functions like ice_set_per_vf_res use a "if () { ; }" flow. This flow discards specialized errors reported by the called function. This style is generally not preferred as it makes tracing error sources more difficult. It also means we cannot log the actual error received properly. Refactor several calls in the ice_ena_vfs function that do this to catch the error in the 'ret' variable. Report this in the messages, and then return the more precise error value. Doing this reveals that ice_set_per_vf_res returns -EINVAL or -EIO in places where -ENOSPC makes more sense. Fix these calls up to return the more appropriate value. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 32 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 13 deletions(-) commit 346f7aa3c7733d5dcbfd31d439822a22fcfedac9 Author: Jacob Keller Date: Tue Feb 22 16:26:55 2022 -0800 ice: move ice_set_vf_port_vlan near other .ndo ops The ice_set_vf_port_vlan function is located in ice_sriov.c very far away from the other .ndo operations that it is similar to. Move this so that its located near the other .ndo operation definitions. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 192 ++++++++++++++--------------- 1 file changed, 96 insertions(+), 96 deletions(-) commit a8ea6d86bd9831bf77577900d5e324070f23387e Author: Jacob Keller Date: Tue Feb 22 16:26:54 2022 -0800 ice: refactor spoofchk control code in ice_sriov.c The API to control the VSI spoof checking for a VF VSI has three functions: enable, disable, and set. The set function takes the VSI and the VF and decides whether to call enable or disable based on the vf->spoofchk field. In some flows, vf->spoofchk is not yet set, such as the function used to control the setting for a VF. (vf->spoofchk is only updated after a success). Simplify this API by refactoring ice_vf_set_spoofchk_cfg to be "ice_vsi_apply_spoofchk" which takes the boolean and allows all callers to avoid having to determine whether to call enable or disable themselves. This matches the expected callers better, and will prevent the need to export more than one function when this code must be called from another file. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) commit dc36796eadcae0e239fc4f42cafd12f46290fbdd Author: Jacob Keller Date: Tue Feb 22 16:26:53 2022 -0800 ice: rename ICE_MAX_VF_COUNT to avoid confusion The ICE_MAX_VF_COUNT field is defined in ice_sriov.h. This count is true for SR-IOV but will not be true for all VF implementations, such as when the ice driver supports Scalable IOV. Rename this definition to clearly indicate ICE_MAX_SRIOV_VFS. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_main.c | 2 +- drivers/net/ethernet/intel/ice/ice_sriov.c | 8 ++++---- drivers/net/ethernet/intel/ice/ice_sriov.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) commit 00a57e2959bd74e87a0e21dce746762d2f9c1987 Author: Jacob Keller Date: Tue Feb 22 16:26:52 2022 -0800 ice: remove unused definitions from ice_sriov.h A few more macros exist in ice_sriov.h which are not used anywhere. These can be safely removed. Note that ICE_VIRTCHNL_VF_CAP_L2 capability is set but never checked anywhere in the driver. Thus it is also safe to remove. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_sriov.c | 1 - drivers/net/ethernet/intel/ice/ice_sriov.h | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) commit a7e117109a25b381eacf3206178ed9f661a20e83 Author: Jacob Keller Date: Tue Feb 22 16:26:51 2022 -0800 ice: convert vf->vc_ops to a const pointer The vc_ops structure is used to allow different handlers for virtchnl commands when the driver is in representor mode. The current implementation uses a copy of the ops table in each VF, and modifies this copy dynamically. The usual practice in kernel code is to store the ops table in a constant structure and point to different versions. This has a number of advantages: 1. Reduced memory usage. Each VF merely points to the correct table, so they're able to re-use the same constant lookup table in memory. 2. Consistency. It becomes more difficult to accidentally update or edit only one op call. Instead, the code switches to the correct able by a single pointer write. In general this is atomic, either the pointer is updated or its not. 3. Code Layout. The VF structure can store a pointer to the table without needing to have the full structure definition defined prior to the VF structure definition. This will aid in future refactoring of code by allowing the VF pointer to be kept in ice_vf_lib.h while the virtchnl ops table can be maintained in ice_virtchnl.h There is one major downside in the case of the vc_ops structure. Most of the operations in the table are the same between the two current implementations. This can appear to lead to duplication since each implementation must now fill in the complete table. It could make spotting the differences in the representor mode more challenging. Unfortunately, methods to make this less error prone either add complexity overhead (macros using CPP token concatenation) or don't work on all compilers we support (constant initializer from another constant structure). The cost of maintaining two structures does not out weigh the benefits of the constant table model. While we're making these changes, go ahead and rename the structure and implementations with "virtchnl" instead of "vc_vf_". This will more closely align with the planned file renaming, and avoid similar names when we later introduce a "vf ops" table for separating Scalable IOV and Single Root IOV implementations. Leave the accessor/assignment functions in order to avoid issues with compiling with options disabled. The interface makes it easier to handle when CONFIG_PCI_IOV is disabled in the kernel. Signed-off-by: Jacob Keller Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_repr.c | 4 +- drivers/net/ethernet/intel/ice/ice_sriov.c | 61 +++++++++++++++++++++++------- drivers/net/ethernet/intel/ice/ice_sriov.h | 13 +++---- 3 files changed, 55 insertions(+), 23 deletions(-) commit 649c87c6ff52efccf7832a690c0959e012ecce73 Author: Jacob Keller Date: Tue Feb 22 16:26:50 2022 -0800 ice: remove circular header dependencies on ice.h Several headers in the ice driver include ice.h even though they are themselves included by that header. The most notable of these is ice_common.h, but several other headers also do this. Such a recursive inclusion is problematic as it forces headers to be included in a strict order, otherwise compilation errors can result. The circular inclusions do not trigger an endless loop due to standard header inclusion guards, however other errors can occur. For example, ice_flow.h defines ice_rss_hash_cfg, which is used by ice_sriov.h as part of the definition of ice_vf_hash_ip_ctx. ice_flow.h includes ice_acl.h, which includes ice_common.h, and which finally includes ice.h. Since ice.h itself includes ice_sriov.h, this creates a circular dependency. The definition in ice_sriov.h requires things from ice_flow.h, but ice_flow.h itself will lead to trying to load ice_sriov.h as part of its process for expanding ice.h. The current code avoids this issue by having an implicit dependency without the include of ice_flow.h. If we were to fix that so that ice_sriov.h explicitly depends on ice_flow.h the following pattern would occur: ice_flow.h -> ice_acl.h -> ice_common.h -> ice.h -> ice_sriov.h At this point, during the expansion of, the header guard for ice_flow.h is already set, so when ice_sriov.h attempts to load the ice_flow.h header it is skipped. Then, we go on to begin including the rest of ice_sriov.h, including structure definitions which depend on ice_rss_hash_cfg. This produces a compiler warning because ice_rss_hash_cfg hasn't yet been included. Remember, we're just at the start of ice_flow.h! If the order of headers is incorrect (ice_flow.h is not implicitly loaded first in all files which include ice_sriov.h) then we get the same failure. Removing this recursive inclusion requires fixing a few cases where some headers depended on the header inclusions from ice.h. In addition, a few other changes are also required. Most notably, ice_hw_to_dev is implemented as a macro in ice_osdep.h, which is the likely reason that ice_common.h includes ice.h at all. This macro implementation requires the full definition of ice_pf in order to properly compile. Fix this by moving it to a function declared in ice_main.c, so that we do not require all files to depend on the layout of the ice_pf structure. Note that this change only fixes circular dependencies, but it does not fully resolve all implicit dependencies where one header may depend on the inclusion of another. I tried to fix as many of the implicit dependencies as I noticed, but fixing them all requires a somewhat tedious analysis of each header and attempting to compile it separately. Signed-off-by: Jacob Keller Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice.h | 3 --- drivers/net/ethernet/intel/ice/ice_arfs.h | 3 +++ drivers/net/ethernet/intel/ice/ice_common.h | 4 ++-- drivers/net/ethernet/intel/ice/ice_dcb.h | 1 + drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 1 + drivers/net/ethernet/intel/ice/ice_flow.c | 1 + drivers/net/ethernet/intel/ice/ice_flow.h | 2 ++ drivers/net/ethernet/intel/ice/ice_idc_int.h | 1 - drivers/net/ethernet/intel/ice/ice_main.c | 15 +++++++++++++++ drivers/net/ethernet/intel/ice/ice_osdep.h | 11 +++++++++-- drivers/net/ethernet/intel/ice/ice_repr.h | 1 - drivers/net/ethernet/intel/ice/ice_sriov.h | 1 - drivers/net/ethernet/intel/ice/ice_type.h | 1 + drivers/net/ethernet/intel/ice/ice_xsk.h | 1 - 14 files changed, 35 insertions(+), 11 deletions(-) commit 0deb0bf70c3f15e61d3b14febcde8b8b19ca71d1 Author: Jacob Keller Date: Tue Feb 22 16:26:49 2022 -0800 ice: rename ice_virtchnl_pf.c to ice_sriov.c The ice_virtchnl_pf.c and ice_virtchnl_pf.h files are where most of the code for implementing Single Root IOV virtualization resides. This code includes support for bringing up and tearing down VFs, hooks into the kernel SR-IOV netdev operations, and for handling virtchnl messages from VFs. In the future, we plan to support Scalable IOV in addition to Single Root IOV as an alternative virtualization scheme. This implementation will re-use some but not all of the code in ice_virtchnl_pf.c To prepare for this future, we want to refactor and split up the code in ice_virtchnl_pf.c into the following scheme: * ice_vf_lib.[ch] Basic VF structures and accessors. This is where scheme-independent code will reside. * ice_virtchnl.[ch] Virtchnl message handling. This is where the bulk of the logic for processing messages from VFs using the virtchnl messaging scheme will reside. This is separated from ice_vf_lib.c because it is distinct and has a bulk of the processing code. * ice_sriov.[ch] Single Root IOV implementation, including initialization and the routines for interacting with SR-IOV based netdev operations. * (future) ice_siov.[ch] Scalable IOV implementation. As a first step, lets assume that all of the code in ice_virtchnl_pf.[ch] is for Single Root IOV. Rename this file to ice_sriov.c and its header to ice_sriov.h Future changes will further split out the code in these files following the plan outlined here. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/Makefile | 2 +- drivers/net/ethernet/intel/ice/ice.h | 2 +- drivers/net/ethernet/intel/ice/ice_base.c | 2 +- drivers/net/ethernet/intel/ice/ice_repr.c | 2 +- drivers/net/ethernet/intel/ice/{ice_virtchnl_pf.c => ice_sriov.c} | 0 drivers/net/ethernet/intel/ice/{ice_virtchnl_pf.h => ice_sriov.h} | 6 +++--- drivers/net/ethernet/intel/ice/ice_vf_vsi_vlan_ops.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) commit d775155a8661957676bb0a7b363bf1f0da4d8b20 Author: Jacob Keller Date: Tue Feb 22 16:26:48 2022 -0800 ice: rename ice_sriov.c to ice_vf_mbx.c The ice_sriov.c file primarily contains code which handles the logic for mailbox overflow detection and some other utility functions related to the virtualization mailbox. The bulk of the SR-IOV implementation is actually found in ice_virtchnl_pf.c, and this file isn't strictly SR-IOV specific. In the future, the ice driver will support an additional virtualization scheme known as Scalable IOV, and the code in this file will be used for this alternative implementation. Rename this file (and its associated header) to ice_vf_mbx.c, so that we can later re-use the ice_sriov.c file as the SR-IOV specific file. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/Makefile | 2 +- drivers/net/ethernet/intel/ice/ice.h | 2 +- drivers/net/ethernet/intel/ice/{ice_sriov.c => ice_vf_mbx.c} | 2 +- drivers/net/ethernet/intel/ice/{ice_sriov.h => ice_vf_mbx.h} | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) commit dab4df9ca919f59e5b9dd84385eaf34d4f20dbb0 Author: Miaoqian Lin Date: Tue Mar 8 07:11:54 2022 +0000 pinctrl: mediatek: Fix missing of_node_put() in mtk_pctrl_init The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: a6df410d420a ("pinctrl: mediatek: Add Pinctrl/GPIO driver for mt8135.") Signed-off-by: Miaoqian Lin Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308071155.21114-1-linmq006@gmail.com Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 ++ 1 file changed, 2 insertions(+) commit a1d1e0e3d80a870cc37a6c064994b89e963d2b58 Author: Jonathan Neuschäfer Date: Sat Jan 29 12:52:24 2022 +0100 pinctrl: nuvoton: Add driver for WPCM450 This driver is based on the one for NPCM7xx, because the WPCM450 is a predecessor of those SoCs. Notable differences: - On WPCM450, the GPIO registers are not organized in multiple banks, but rather placed continually into the same register block. This affects how register offsets are computed. - Pinmux nodes can explicitly select GPIO mode, whereas in the npcm7xx driver, this happens automatically when a GPIO is requested. Some functionality implemented in the hardware was (for now) left unused in the driver, specifically blinking and pull-up/down. Signed-off-by: Jonathan Neuschäfer Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220129115228.2257310-6-j.neuschaefer@gmx.net Signed-off-by: Linus Walleij MAINTAINERS | 1 + drivers/pinctrl/Makefile | 2 +- drivers/pinctrl/nuvoton/Kconfig | 18 + drivers/pinctrl/nuvoton/Makefile | 1 + drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 1150 +++++++++++++++++++++++++++++ 5 files changed, 1171 insertions(+), 1 deletion(-) commit 1a1e33b3b57d3051cbbaa1efc885c611c0e68ea9 Author: Jonathan Neuschäfer Date: Sat Jan 29 12:52:23 2022 +0100 dt-bindings: pinctrl: Add Nuvoton WPCM450 This binding is heavily based on the one for NPCM7xx, because the hardware is similar. There are some notable differences, however: - The addresses of GPIO banks are not physical addresses but simple indices (0 to 7), because the GPIO registers are not laid out in convenient blocks. - Pinmux settings can explicitly specify that the GPIO mode is used. Certain pins support blink patterns in hardware. This is currently not modelled in the DT binding. Signed-off-by: Jonathan Neuschäfer Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220129115228.2257310-5-j.neuschaefer@gmx.net Signed-off-by: Linus Walleij .../bindings/pinctrl/nuvoton,wpcm450-pinctrl.yaml | 160 +++++++++++++++++++++ 1 file changed, 160 insertions(+) commit 359afd90fef3ec9285432f50720c813987df4a89 Author: Michael Walle Date: Wed Feb 16 13:27:27 2022 +0100 pinctrl: ocelot: fix duplicate debugfs entry This driver can have up to two regmaps. If the second one is registered its debugfs entry will have the same name as the first one and the following error will be printed: [ 2.242568] debugfs: Directory 'e2004064.pinctrl' with parent 'regmap' already present! Give the second regmap a name to avoid this. Fixes: 076d9e71bcf8 ("pinctrl: ocelot: convert pinctrl to regmap") Signed-off-by: Michael Walle Reviewed-by: Colin Foster Link: https://lore.kernel.org/r/20220216122727.1005041-1-michael@walle.cc Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-ocelot.c | 1 + 1 file changed, 1 insertion(+) commit 94ef32970d4076b3179b801c251bf99446b62da5 Author: Michael Walle Date: Wed Feb 16 09:20:20 2022 +0100 pinctrl: ocelot: fix confops resource index Prior to commit ad96111e658a ("pinctrl: ocelot: combine get resource and ioremap into single call") the resource index was 1, now it is 0. But 0 is the base region for the pinctrl block. Fix it. I noticed this because there was an error that the memory region was ioremapped twice. Fixes: ad96111e658a ("pinctrl: ocelot: combine get resource and ioremap into single call") Signed-off-by: Michael Walle Reviewed-by: Colin Foster Link: https://lore.kernel.org/r/20220216082020.981797-1-michael@walle.cc Signed-off-by: Linus Walleij drivers/pinctrl/pinctrl-ocelot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1b945334a93fffd5a27c4a11798a53dcb7730d7f Author: Jacky Bai Date: Mon Feb 28 09:01:03 2022 +0800 pinctrl: imx93: Add pinctrl driver support Add i.MX93 pinctrl driver Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220228010103.2725893-2-peng.fan@oss.nxp.com Signed-off-by: Linus Walleij drivers/pinctrl/freescale/Kconfig | 7 + drivers/pinctrl/freescale/Makefile | 1 + drivers/pinctrl/freescale/pinctrl-imx93.c | 272 ++++++++++++++++++++++++++++++ 3 files changed, 280 insertions(+) commit 4ad8b50da86341aab5bb13f278fb6fd3f627fed9 Author: Peng Fan Date: Mon Feb 28 09:01:02 2022 +0800 dt-bindings: pinctrl: imx93: Add pinctrl binding Add pinctrl binding doc for i.MX93 Signed-off-by: Peng Fan Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220228010103.2725893-1-peng.fan@oss.nxp.com Signed-off-by: Linus Walleij .../bindings/pinctrl/fsl,imx93-pinctrl.yaml | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) commit 7966c5051fc7d52425155ab30ad568d9d97f3b02 Author: Guodong Liu Date: Wed Feb 16 11:21:24 2022 +0800 pinctrl: canonical rsel resistance selection property Change "mediatek,rsel_resistance_in_si_unit" to "mediatek,rsel-resistance-in-si-unit" Fixes: fb34a9ae383a ("pinctrl: mediatek: support rsel feature") Signed-off-by: Guodong Liu Link: https://lore.kernel.org/r/20220216032124.28067-4-guodong.liu@mediatek.com Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/pinctrl-paris.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8b483bda1e4660411b24736e5fd6ddab472611bc Author: Guodong Liu Date: Wed Feb 16 11:21:23 2022 +0800 pinctrl: add pinctrl driver on mt8186 This commit includes pinctrl driver for mt8186. Signed-off-by: Guodong Liu Link: https://lore.kernel.org/r/20220216032124.28067-3-guodong.liu@mediatek.com Signed-off-by: Linus Walleij drivers/pinctrl/mediatek/Kconfig | 7 + drivers/pinctrl/mediatek/Makefile | 1 + drivers/pinctrl/mediatek/pinctrl-mt8186.c | 1271 ++++++++++++++ drivers/pinctrl/mediatek/pinctrl-mtk-mt8186.h | 2186 +++++++++++++++++++++++++ 4 files changed, 3465 insertions(+) commit 338e953f1bd1a0ef4c86b5ab44735e1f6519d721 Author: Guodong Liu Date: Wed Feb 16 11:21:22 2022 +0800 dt-bindings: pinctrl: mt8186: add pinctrl file and binding document 1. This patch adds pinctrl file for mt8186. 2. This patch adds mt8186 compatible node in binding document. Signed-off-by: Guodong Liu Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220216032124.28067-2-guodong.liu@mediatek.com Signed-off-by: Linus Walleij .../bindings/pinctrl/pinctrl-mt8186.yaml | 297 +++++ include/dt-bindings/pinctrl/mt8186-pinfunc.h | 1174 ++++++++++++++++++++ 2 files changed, 1471 insertions(+) commit 2c25e45267d0c7517578b7203a55fba2b6f6564a Author: Julia Lawall Date: Mon Mar 14 12:53:46 2022 +0100 RDMA/qib: Fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Link: https://lore.kernel.org/r/20220314115354.144023-23-Julia.Lawall@inria.fr Signed-off-by: Julia Lawall Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/qib/qib_iba7220.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 087f9c3f2309ed183f7e4b85ae57121d8663224d Author: Yongzhi Liu Date: Fri Mar 11 09:06:01 2022 -0800 RDMA/mlx5: Fix memory leak in error flow for subscribe event routine In case the second xa_insert() fails, the obj_event is not released. Fix the error unwind flow to free that memory to avoid a memory leak. Fixes: 759738537142 ("IB/mlx5: Enable subscription for device events over DEVX") Link: https://lore.kernel.org/r/1647018361-18266-1-git-send-email-lyz_cs@pku.edu.cn Signed-off-by: Yongzhi Liu Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/mlx5/devx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 7922d3de4d270a9aedb71212fc0d5ae697ced516 Author: Leon Romanovsky Date: Wed Mar 9 20:42:13 2022 +0200 Revert "RDMA/core: Fix ib_qp_usecnt_dec() called when error" This reverts commit 7c4a539ec38f4ce400a0f3fcb5ff6c940fcd67bb. which causes to the following error in mlx4. Destroy of kernel CQ shouldn't fail WARNING: CPU: 4 PID: 18064 at include/rdma/ib_verbs.h:3936 mlx4_ib_dealloc_xrcd+0x12e/0x1b0 [mlx4_ib] Modules linked in: bonding ib_ipoib ip_gre ipip tunnel4 geneve rdma_ucm nf_tables ib_umad mlx4_en mlx4_ib ib_uverbs mlx4_core ip6_gre gre ip6_tunnel tunnel6 iptable_raw openvswitch nsh rpcrdma ib_iser libiscsi scsi_transport_iscsi rdma_cm iw_cm ib_cm ib_core xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter overlay fuse [last unloaded: mlx4_core] CPU: 4 PID: 18064 Comm: ibv_xsrq_pingpo Not tainted 5.17.0-rc7_master_62c6ecb #1 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 RIP: 0010:mlx4_ib_dealloc_xrcd+0x12e/0x1b0 [mlx4_ib] Code: 1e 93 08 00 40 80 fd 01 0f 87 fa f1 04 00 83 e5 01 0f 85 2b ff ff ff 48 c7 c7 20 4f b6 a0 c6 05 fd 92 08 00 01 e8 47 c9 82 e2 <0f> 0b e9 11 ff ff ff 0f b6 2d eb 92 08 00 40 80 fd 01 0f 87 b1 f1 RSP: 0018:ffff8881a4957750 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff8881ac4b6800 RCX: 0000000000000000 RDX: 0000000000000027 RSI: 0000000000000004 RDI: ffffed103492aedc RBP: 0000000000000000 R08: 0000000000000001 R09: ffff8884d2e378eb R10: ffffed109a5c6f1d R11: 0000000000000001 R12: ffff888132620000 R13: ffff8881a4957a90 R14: ffff8881aa2d4000 R15: ffff8881a4957ad0 FS: 00007f0401747740(0000) GS:ffff8884d2e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055f8ae036118 CR3: 000000012fe94005 CR4: 0000000000370ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ib_dealloc_xrcd_user+0xce/0x120 [ib_core] ib_uverbs_dealloc_xrcd+0xad/0x210 [ib_uverbs] uverbs_free_xrcd+0xe8/0x190 [ib_uverbs] destroy_hw_idr_uobject+0x7a/0x130 [ib_uverbs] uverbs_destroy_uobject+0x164/0x730 [ib_uverbs] uobj_destroy+0x72/0xf0 [ib_uverbs] ib_uverbs_cmd_verbs+0x19fb/0x3110 [ib_uverbs] ib_uverbs_ioctl+0x169/0x260 [ib_uverbs] __x64_sys_ioctl+0x856/0x1550 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: 7c4a539ec38f ("RDMA/core: Fix ib_qp_usecnt_dec() called when error") Link: https://lore.kernel.org/r/74c11029adaf449b3b9228a77cc82f39e9e892c8.1646851220.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/core/uverbs_cmd.c | 1 + drivers/infiniband/core/uverbs_std_types_qp.c | 1 + drivers/infiniband/core/verbs.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) commit aaaf62e066231f68f937990bc99f728576a2eab5 Author: Chengguang Xu Date: Mon Mar 7 22:50:47 2022 +0800 RDMA/rxe: Remove useless argument for update_state() The argument 'payload' is not used in update_state(), so just remove it. Link: https://lore.kernel.org/r/20220307145047.3235675-2-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Reviewed-by: Leon Romanovsky Acked-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_req.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 7e8e611d6a0ff228577b1167335ffefb0f44d5d8 Author: Chengguang Xu Date: Mon Mar 7 22:50:46 2022 +0800 RDMA/rxe: Change variable and function argument to proper type The type of wqe length is u32 so in order to avoid overflow and shadow casting change variable and relevant function argument to proper type. Link: https://lore.kernel.org/r/20220307145047.3235675-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/sw/rxe/rxe_req.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 6f6dbb819dfc1a35bcb8b709b5c83a3ea8beff75 Author: Dan Carpenter Date: Mon Mar 7 15:59:28 2022 +0300 RDMA/irdma: Prevent some integer underflows My static checker complains that: drivers/infiniband/hw/irdma/ctrl.c:3605 irdma_sc_ceq_init() warn: can subtract underflow 'info->dev->hmc_fpm_misc.max_ceqs'? It appears that "info->dev->hmc_fpm_misc.max_ceqs" comes from the firmware in irdma_sc_parse_fpm_query_buf() so, yes, there is a chance that it could be zero. Even if we trust the firmware, it's easy enough to change the condition just as a hardenning measure. Fixes: 3f49d6842569 ("RDMA/irdma: Implement HW Admin Queue OPs") Link: https://lore.kernel.org/r/20220307125928.GE16710@kili Signed-off-by: Dan Carpenter Acked-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/irdma/ctrl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit bdd6a89de44b9e07d0b106076260d2367fe0e49a Author: Niklas Söderlund Date: Sat Mar 12 10:58:23 2022 +0100 nfp: flower: avoid newline at the end of message in NL_SET_ERR_MSG_MOD Fix the following coccicheck warning: drivers/net/ethernet/netronome/nfp/flower/action.c:959:7-69: WARNING avoid newline at end of message in NL_SET_ERR_MSG_MOD Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220312095823.2425775-1-niklas.soderlund@corigine.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/flower/action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 65eab2bc7dab326ee892ec5a4c749470b368b51a Merge: f693dac4794f 09688c0166e7 Author: Arnaldo Carvalho de Melo Date: Mon Mar 14 19:15:16 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes that went thru perf/urgent. Signed-off-by: Arnaldo Carvalho de Melo commit 8772cc499bff844cf00d1b0b4428633d77c60a0d Author: Saeed Mahameed Date: Fri Mar 11 16:53:53 2022 -0800 net/mlx5e: Fix use-after-free in mlx5e_stats_grp_sw_update_stats We need to sync page pool stats only for active channels. Reading ethtool stats on a down netdev or a netdev with modified number of channels will result in a user-after-free, trying to access page pools that are freed already. BUG: KASAN: use-after-free in mlx5e_stats_grp_sw_update_stats+0x465/0xf80 Read of size 8 at addr ffff888004835e40 by task ethtool/720 Fixes: cc10e84b2ec3 ("mlx5: add support for page_pool_get_stats") Signed-off-by: Saeed Mahameed Reported-by: Jakub Kicinski Acked-by: Joe Damato Link: https://lore.kernel.org/r/20220312005353.786255-1-saeed@kernel.org Signed-off-by: Jakub Kicinski drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit aa1b46dcdc7baaf5fec0be25782ef24b26aa209e Author: Tejun Heo Date: Sun Mar 13 21:15:02 2022 -1000 block: fix rq-qos breakage from skipping rq_qos_done_bio() a647a524a467 ("block: don't call rq_qos_ops->done_bio if the bio isn't tracked") made bio_endio() skip rq_qos_done_bio() if BIO_TRACKED is not set. While this fixed a potential oops, it also broke blk-iocost by skipping the done_bio callback for merged bios. Before, whether a bio goes through rq_qos_throttle() or rq_qos_merge(), rq_qos_done_bio() would be called on the bio on completion with BIO_TRACKED distinguishing the former from the latter. rq_qos_done_bio() is not called for bios which wenth through rq_qos_merge(). This royally confuses blk-iocost as the merged bios never finish and are considered perpetually in-flight. One reliably reproducible failure mode is an intermediate cgroup geting stuck active preventing its children from being activated due to the leaf-only rule, leading to loss of control. The following is from resctl-bench protection scenario which emulates isolating a web server like workload from a memory bomb run on an iocost configuration which should yield a reasonable level of protection. # cat /sys/block/nvme2n1/device/model Samsung SSD 970 PRO 512GB # cat /sys/fs/cgroup/io.cost.model 259:0 ctrl=user model=linear rbps=834913556 rseqiops=93622 rrandiops=102913 wbps=618985353 wseqiops=72325 wrandiops=71025 # cat /sys/fs/cgroup/io.cost.qos 259:0 enable=1 ctrl=user rpct=95.00 rlat=18776 wpct=95.00 wlat=8897 min=60.00 max=100.00 # resctl-bench -m 29.6G -r out.json run protection::scenario=mem-hog,loops=1 ... Memory Hog Summary ================== IO Latency: R p50=242u:336u/2.5m p90=794u:1.4m/7.5m p99=2.7m:8.0m/62.5m max=8.0m:36.4m/350m W p50=221u:323u/1.5m p90=709u:1.2m/5.5m p99=1.5m:2.5m/9.5m max=6.9m:35.9m/350m Isolation and Request Latency Impact Distributions: min p01 p05 p10 p25 p50 p75 p90 p95 p99 max mean stdev isol% 15.90 15.90 15.90 40.05 57.24 59.07 60.01 74.63 74.63 90.35 90.35 58.12 15.82 lat-imp% 0 0 0 0 0 4.55 14.68 15.54 233.5 548.1 548.1 53.88 143.6 Result: isol=58.12:15.82% lat_imp=53.88%:143.6 work_csv=100.0% missing=3.96% The isolation result of 58.12% is close to what this device would show without any IO control. Fix it by introducing a new flag BIO_QOS_MERGED to mark merged bios and calling rq_qos_done_bio() on them too. For consistency and clarity, rename BIO_TRACKED to BIO_QOS_THROTTLED. The flag checks are moved into rq_qos_done_bio() so that it's next to the code paths that set the flags. With the patch applied, the above same benchmark shows: # resctl-bench -m 29.6G -r out.json run protection::scenario=mem-hog,loops=1 ... Memory Hog Summary ================== IO Latency: R p50=123u:84.4u/985u p90=322u:256u/2.5m p99=1.6m:1.4m/9.5m max=11.1m:36.0m/350m W p50=429u:274u/995u p90=1.7m:1.3m/4.5m p99=3.4m:2.7m/11.5m max=7.9m:5.9m/26.5m Isolation and Request Latency Impact Distributions: min p01 p05 p10 p25 p50 p75 p90 p95 p99 max mean stdev isol% 84.91 84.91 89.51 90.73 92.31 94.49 96.36 98.04 98.71 100.0 100.0 94.42 2.81 lat-imp% 0 0 0 0 0 2.81 5.73 11.11 13.92 17.53 22.61 4.10 4.68 Result: isol=94.42:2.81% lat_imp=4.10%:4.68 work_csv=58.34% missing=0% Signed-off-by: Tejun Heo Fixes: a647a524a467 ("block: don't call rq_qos_ops->done_bio if the bio isn't tracked") Cc: stable@vger.kernel.org # v5.15+ Cc: Ming Lei Cc: Yu Kuai Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/Yi7rdrzQEHjJLGKB@slm.duckdns.org Signed-off-by: Jens Axboe block/bio.c | 3 +-- block/blk-iolatency.c | 2 +- block/blk-rq-qos.h | 20 +++++++++++--------- include/linux/blk_types.h | 3 ++- 4 files changed, 15 insertions(+), 13 deletions(-) commit 3c2dfb735b4a9239e2b8170e88aaddbf987d9798 Author: Julia Lawall Date: Sat Mar 12 11:27:01 2022 +0100 net/mlx4_en: use kzalloc Use kzalloc instead of kmalloc + memset. The semantic patch that makes this change is: (https://coccinelle.gitlabpages.inria.fr/website/) // @@ expression res, size, flag; @@ - res = kmalloc(size, flag); + res = kzalloc(size, flag); ... - memset(res, 0, size); // Signed-off-by: Julia Lawall Reviewed-by: Tariq Toukan Link: https://lore.kernel.org/r/20220312102705.71413-3-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski drivers/net/ethernet/mellanox/mlx4/en_rx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 2e7e80f7e7e9dbbb3c2a85ee923ca32826052816 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:27 2022 +0000 fs: Convert is_partially_uptodate to folios Since the uptodate property is maintained on a per-folio basis, the is_partially_uptodate method should also take a folio. Fix the types at the same time so it's clear that it returns true/false and takes the count in bytes, not blocks. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs Documentation/filesystems/locking.rst | 2 +- Documentation/filesystems/vfs.rst | 10 +++++----- fs/buffer.c | 26 ++++++++++++------------- fs/iomap/buffered-io.c | 36 ++++++++++++++++------------------- include/linux/buffer_head.h | 3 +-- include/linux/fs.h | 4 ++-- include/linux/iomap.h | 3 +-- mm/filemap.c | 4 ++-- 8 files changed, 40 insertions(+), 48 deletions(-) commit cd1067beeebfe23fc8cab071790fefb273962d51 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:26 2022 +0000 buffer: Add folio_buffers() While there is no intent to use large folios in filesystems using buffer heads, converting the filesystems to use single-page folios is still worth doing to remove legacy infrastructure and hidden calls to compound_head(). These helper functions are needed for that conversion to take place. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs include/linux/buffer_head.h | 1 + 1 file changed, 1 insertion(+) commit 4495a96c4cd4a3c9c0649e2a19e0e9bde8243a6e Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:24 2022 +0000 fs/remap_range: Pass the file pointer to read_mapping_folio() We have the struct file in generic_remap_file_range_prep() already; we just need to pass it around instead of the inode. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/remap_range.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit c14c6843aeb8cdc8f6b0e49411d230e6f6dfda62 Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:23 2022 +0000 fs: read_mapping_page() should take a struct file argument While read_cache_page() takes a void *, because you can pass a pointer to anything as the first argument of filler_t, if we are calling read_mapping_page(), it will be passed as the first argument of ->readpage, so we know this must be a struct file pointer, and we should let the compiler enforce that for us. Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs include/linux/pagemap.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 1241ebeca3f94b417751cb3ff62454cefdac75bc Author: Matthew Wilcox (Oracle) Date: Wed Feb 9 20:21:22 2022 +0000 iomap: Fix iomap_invalidatepage tracepoint This tracepoint is defined to take an offset in the file, not an offset in the folio. Fixes: 1ac994525b9d ("iomap: Remove pgoff from tracepoints") Signed-off-by: Matthew Wilcox (Oracle) Tested-by: Damien Le Moal Acked-by: Damien Le Moal Tested-by: Mike Marshall # orangefs Tested-by: David Howells # afs fs/iomap/buffered-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 641d804157294d9b19bdfe6a2cdbd5d25939a048 Merge: 8d93b7a242b2 52c9f93a9c48 Author: Will Deacon Date: Mon Mar 14 19:05:13 2022 +0000 Merge branch 'for-next/spectre-bhb' into for-next/core Merge in the latest Spectre mess to fix up conflicts with what was already queued for 5.18 when the embargo finally lifted. * for-next/spectre-bhb: (21 commits) arm64: Do not include __READ_ONCE() block in assembly files arm64: proton-pack: Include unprivileged eBPF status in Spectre v2 mitigation reporting arm64: Use the clearbhb instruction in mitigations KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated arm64: Mitigate spectre style branch history side channels arm64: proton-pack: Report Spectre-BHB vulnerabilities as part of Spectre-v2 arm64: Add percpu vectors for EL1 arm64: entry: Add macro for reading symbol addresses from the trampoline arm64: entry: Add vectors that have the bhb mitigation sequences arm64: entry: Add non-kpti __bp_harden_el1_vectors for mitigations arm64: entry: Allow the trampoline text to occupy multiple pages arm64: entry: Make the kpti trampoline's kpti sequence optional arm64: entry: Move trampoline macros out of ifdef'd section arm64: entry: Don't assume tramp_vectors is the start of the vectors arm64: entry: Allow tramp_alias to access symbols after the 4K boundary arm64: entry: Move the trampoline data page before the text page arm64: entry: Free up another register on kpti's tramp_exit path arm64: entry: Make the trampoline cleanup optional KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A arm64: spectre: Rename spectre_v4_patch_fw_mitigation_conduit ... commit 8d93b7a242b2adf36949c10b8eb9cc084a74b59a Merge: 515e5da7b6b5 f2c281204b47 Author: Will Deacon Date: Mon Mar 14 19:04:22 2022 +0000 Merge branch 'for-next/fpsimd' into for-next/core * for-next/fpsimd: arm64: cpufeature: Warn if we attempt to read a zero width field arm64: cpufeature: Add missing .field_width for GIC system registers arm64: signal: nofpsimd: Do not allocate fp/simd context when not available arm64: cpufeature: Always specify and use a field width for capabilities arm64: Always use individual bits in CPACR floating point enables arm64: Define CPACR_EL1_FPEN similarly to other floating point controls commit 515e5da7b6b52c5d6c7a54fe34165b86361041b5 Merge: 92051a107ae7 e33c89256e66 Author: Will Deacon Date: Mon Mar 14 19:02:52 2022 +0000 Merge branch 'for-next/strings' into for-next/core * for-next/strings: Revert "arm64: Mitigate MTE issues with str{n}cmp()" arm64: lib: Import latest version of Arm Optimized Routines' strncmp arm64: lib: Import latest version of Arm Optimized Routines' strcmp commit 92051a107ae795f73ee303453780fd28ff41fa7c Merge: b5ef94fb565f 35bde68bba54 Author: Will Deacon Date: Mon Mar 14 19:01:52 2022 +0000 Merge branch 'for-next/rng' into for-next/core * for-next/rng: arm64: random: implement arch_get_random_int/_long based on RNDR commit b5ef94fb565fa4a6d0b3c4bdb7bbf1f51243fb8d Merge: 292ca2d8eedf 6676a42f1e4f Author: Will Deacon Date: Mon Mar 14 19:01:37 2022 +0000 Merge branch 'for-next/perf' into for-next/core * for-next/perf: (25 commits) perf/marvell: Fix !CONFIG_OF build for CN10K DDR PMU driver drivers/perf: Add Apple icestorm/firestorm CPU PMU driver drivers/perf: arm_pmu: Handle 47 bit counters arm64: perf: Consistently make all event numbers as 16-bits arm64: perf: Expose some Armv9 common events under sysfs perf/marvell: cn10k DDR perf event core ownership perf/marvell: cn10k DDR perfmon event overflow handling perf/marvell: CN10k DDR performance monitor support dt-bindings: perf: marvell: cn10k ddr performance monitor perf/arm-cmn: Update watchpoint format perf/arm-cmn: Hide XP PUB events for CMN-600 perf: replace bitmap_weight with bitmap_empty where appropriate perf: Replace acpi_bus_get_device() perf/marvell_cn10k: Fix unused variable warning when W=1 and CONFIG_OF=n perf/arm-cmn: Make arm_cmn_debugfs static perf: MARVELL_CN10K_TAD_PMU should depend on ARCH_THUNDER perf/arm-ccn: Use platform_get_irq() to get the interrupt irqchip/apple-aic: Move PMU-specific registers to their own include file arm64: dts: apple: Add t8303 PMU nodes arm64: dts: apple: Add t8103 PMU interrupt affinities ... commit 292ca2d8eedfe6580b2b5ce6a8a08b07c8562992 Merge: bf587af2abd8 def8c222f054 Author: Will Deacon Date: Mon Mar 14 19:01:32 2022 +0000 Merge branch 'for-next/pauth' into for-next/core * for-next/pauth: arm64: Add support of PAuth QARMA3 architected algorithm arm64: cpufeature: Mark existing PAuth architected algorithm as QARMA5 arm64: cpufeature: Account min_field_value when cheking secondaries for PAuth commit bf587af2abd8c4ff630f260040f7d2722e37e054 Merge: 20fd2ed10f01 9986c7650eb3 Author: Will Deacon Date: Mon Mar 14 19:01:23 2022 +0000 Merge branch 'for-next/mte' into for-next/core * for-next/mte: docs: sysfs-devices-system-cpu: document "asymm" value for mte_tcf_preferred arm64/mte: Remove asymmetric mode from the prctl() interface kasan: fix a missing header include of static_keys.h arm64/mte: Add userspace interface for enabling asymmetric mode arm64/mte: Add hwcap for asymmetric mode arm64/mte: Add a little bit of documentation for mte_update_sctlr_user() arm64/mte: Document ABI for asymmetric mode arm64: mte: avoid clearing PSTATE.TCO on entry unless necessary kasan: split kasan_*enabled() functions into a separate header commit 20fd2ed10f01a0b2d57b46e19151833edfcb65e2 Merge: b3ea0eafa982 3c3dd2c81a10 Author: Will Deacon Date: Mon Mar 14 19:01:18 2022 +0000 Merge branch 'for-next/mm' into for-next/core * for-next/mm: Documentation: vmcoreinfo: Fix htmldocs warning arm64/mm: Drop use_1G_block() arm64: avoid flushing icache multiple times on contiguous HugeTLB arm64: crash_core: Export MODULES, VMALLOC, and VMEMMAP ranges arm64/hugetlb: Define __hugetlb_valid_size() arm64/mm: avoid fixmap race condition when create pud mapping arm64/mm: Consolidate TCR_EL1 fields commit b3ea0eafa982b3906720e5ff3769dc10f9bfc6ad Merge: 563c46359530 770093459b9b Author: Will Deacon Date: Mon Mar 14 19:01:12 2022 +0000 Merge branch 'for-next/misc' into for-next/core * for-next/misc: arm64: mm: Drop 'const' from conditional arm64_dma_phys_limit definition arm64: clean up tools Makefile arm64: drop unused includes of arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones arm64: prevent instrumentation of bp hardening callbacks arm64: cpufeature: Remove cpu_has_fwb() check arm64: atomics: remove redundant static branch arm64: entry: Save some nops when CONFIG_ARM64_PSEUDO_NMI is not set commit 563c463595307a3dd1ae80c462af69d94b1e80bf Merge: 839d0758927f 4013e26670c5 Author: Will Deacon Date: Mon Mar 14 19:01:05 2022 +0000 Merge branch 'for-next/linkage' into for-next/core * for-next/linkage: arm64: module: remove (NOLOAD) from linker script linkage: remove SYM_FUNC_{START,END}_ALIAS() x86: clean up symbol aliasing arm64: clean up symbol aliasing linkage: add SYM_FUNC_ALIAS{,_LOCAL,_WEAK}() commit 839d0758927fb62958b79dffd385a7dc0ac522bc Merge: b7323ae6913d e2dc49ef6c6b Author: Will Deacon Date: Mon Mar 14 19:00:58 2022 +0000 Merge branch 'for-next/kselftest' into for-next/core * for-next/kselftest: kselftest/arm64: Log the PIDs of the parent and child in sve-ptrace kselftest/arm64: signal: Allow tests to be incompatible with features kselftest/arm64: mte: user_mem: test a wider range of values kselftest/arm64: mte: user_mem: add more test types kselftest/arm64: mte: user_mem: add test type enum kselftest/arm64: mte: user_mem: check different offsets and sizes kselftest/arm64: mte: user_mem: rework error handling kselftest/arm64: mte: user_mem: introduce tag_offset and tag_len kselftest/arm64: Remove local definitions of MTE prctls kselftest/arm64: Remove local ARRAY_SIZE() definitions commit b7323ae6913d1780e75868e9ea14ae8b3949ef1b Merge: cd92fdfcfa39 fa1114d9eba5 Author: Will Deacon Date: Mon Mar 14 19:00:49 2022 +0000 Merge branch 'for-next/insn' into for-next/core * for-next/insn: arm64: insn: add encoders for atomic operations arm64: move AARCH64_BREAK_FAULT into insn-def.h arm64: insn: Generate 64 bit mask immediates correctly commit cd92fdfcfa390ee5dac16f4b533b0c0adc6aff03 Merge: b523d6b80fbc f90205b95368 Author: Will Deacon Date: Mon Mar 14 19:00:44 2022 +0000 Merge branch 'for-next/errata' into for-next/core * for-next/errata: arm64: Add cavium_erratum_23154_cpus missing sentinel irqchip/gic-v3: Workaround Marvell erratum 38545 when reading IAR commit b523d6b80fbcf45f64f5010424a273c32df79e7a Merge: 0d3d031595cb 4c022f57ad95 Author: Will Deacon Date: Mon Mar 14 19:00:37 2022 +0000 Merge branch 'for-next/docs' into for-next/core * for-next/docs: arm64/mte: Clarify mode reported by PR_GET_TAGGED_ADDR_CTRL arm64: booting.rst: Clarify on requiring non-secure EL2 commit 0d3d031595cbac3d57a68e600a7facab1ecbdece Merge: dfd42facf1e4 3a4f7ef4bed5 Author: Will Deacon Date: Mon Mar 14 18:58:46 2022 +0000 Merge branch 'for-next/coredump' into for-next/core * for-next/coredump: arm64: Change elfcore for_each_mte_vma() to use VMA iterator arm64: mte: Document the core dump file format arm64: mte: Dump the MTE tags in the core file arm64: mte: Define the number of bytes for storing the tags in a page elf: Introduce the ARM MTE ELF segment type elfcore: Replace CONFIG_{IA64, UML} checks with a new option commit 411472ae5bb4ffe1404dc5f1505f07e0f04770a8 Merge: f0fae8a0edd4 09688c0166e7 Author: Ingo Molnar Date: Mon Mar 14 18:52:36 2022 +0100 Merge tag 'v5.17-rc8' into irq/core, to fix conflicts Conflicts: drivers/pinctrl/pinctrl-starfive.c Signed-off-by: Ingo Molnar commit 78b33c600486e97c9b61c25a37b283c211be8560 Author: Philipp Hortmann Date: Thu Mar 10 19:54:49 2022 +0100 staging: vt6656: Remove unused rf_type in card.c Remove rf_type that supports 5GHz band. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e768dbb116e79349aa083747729213d2d1ca7af9.1646935331.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6656/card.c | 16 ---------------- 1 file changed, 16 deletions(-) commit 8b0f74a8cfe57af5bb9d70fa53a1d1b98c9ee1af Author: Philipp Hortmann Date: Thu Mar 10 19:54:36 2022 +0100 staging: vt6656: Remove unused rf_type in rf.c; unused variables Remove rf_type that supports 5GHz band. Follow up of previous patch. Remove unused tables. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/25e03c91ad7da064b69f3ac7eec265af70829aec.1646935331.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6656/rf.c | 348 -------------------------------------------- 1 file changed, 348 deletions(-) commit ee9a0fc17f0c5662307ac614fa33b38522747bad Author: Philipp Hortmann Date: Thu Mar 10 19:54:29 2022 +0100 staging: vt6656: Remove unused rf_type in rf.c; top level Remove rf_type that supports 5GHz band. To keep a better overview this is only the first part of the patch. Compiler Warings about unused variables will be removed with the following patch. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/e111923dffc4781cf9d4e7966c9f365beb93c5ee.1646935331.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6656/rf.c | 65 ++------------------------------------------- 1 file changed, 2 insertions(+), 63 deletions(-) commit 10c8968968454a97f11bc70498f9cf89ecf4f697 Author: Philipp Hortmann Date: Thu Mar 10 19:54:17 2022 +0100 staging: vt6656: Remove unused rf_type in baseband.c Remove rf_type that supports 5GHz band. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/77dcff8602084484532fcbd734aafd138087c5ee.1646935331.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6656/baseband.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) commit c93338804239bed55fd1e73a3b2f65566bfa0c88 Author: Philipp Hortmann Date: Thu Mar 10 19:54:07 2022 +0100 staging: vt6656: Remove unused rf_type in channel.c Remove rf_type that supports 5GHz band. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/99af8605af8d348c6b60553c54149ad55da0e3b6.1646935331.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6656/channel.c | 96 +++------------------------------------- 1 file changed, 6 insertions(+), 90 deletions(-) commit 6413489354f1c67f56f64625d648b9adf4463795 Author: Haowen Bai Date: Fri Mar 11 15:17:32 2022 +0800 staging: rtl8723bs: Use min() instead of doing it manually Fix following coccicheck warning: drivers/staging/rtl8723bs/core/rtw_xmit.c:452:25-26: WARNING opportunity for min() Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1646983052-16390-1-git-send-email-baihaowen@meizu.com Signed-off-by: Greg Kroah-Hartman drivers/staging/rtl8723bs/core/rtw_xmit.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 65c873c37ec36bbecd1b7da753061d214f23474b Author: Philipp Hortmann Date: Sat Mar 5 22:32:20 2022 +0100 staging: vt6655: Remove unused byRFType in card.c Remove byRFType that support 5GHz band. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/5554b243ae285e3274d9968575aadd1a79806b01.1646512837.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6655/card.c | 56 +------------------------------------------ 1 file changed, 1 insertion(+), 55 deletions(-) commit dd2837bdea0e92b3f0019d5db20bf753efc6d1d7 Author: Philipp Hortmann Date: Sat Mar 5 22:32:14 2022 +0100 staging: vt6655: Remove unused byRFType in rf.c Remove byRFType that support 5GHz band. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/640bdbc0ff135c6a63d6764fd81a8bb24d5053dd.1646512837.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6655/rf.c | 404 +------------------------------------------- 1 file changed, 1 insertion(+), 403 deletions(-) commit b7711a87061245fb8d8cc7947c43fadcbe932dc0 Author: Philipp Hortmann Date: Sat Mar 5 22:32:08 2022 +0100 staging: vt6655: Remove unused byRFType in baseband.c Remove byRFType that support 5GHz band. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/198341a249ea67acbf1be00b6465aa6a4eaef6e1.1646512837.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6655/baseband.c | 80 --------------------------------------- 1 file changed, 80 deletions(-) commit 1ffba357301321b33c71e260d1549e98dae1c391 Author: Philipp Hortmann Date: Sat Mar 5 22:32:03 2022 +0100 staging: vt6655: Remove unused byRFType in channel.c Remove byRFType that support 5GHz band. Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/3724590188e72e8f531fe03c2821c5d3d08e2e29.1646512837.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6655/channel.c | 85 +--------------------------------------- 1 file changed, 1 insertion(+), 84 deletions(-) commit d7e2d1e88823c93f98ce241050a9cfc9b591d33a Author: Paulo Miguel Almeida Date: Tue Mar 8 21:19:50 2022 +1300 staging: pi433: formatting improvement for multi-line bitwise statement Move bitwise & operator to the end of previous line for better readability Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/YicRpmT2xMupVp4h@mail.google.com Signed-off-by: Greg Kroah-Hartman drivers/staging/pi433/pi433_if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 378c64302afe543ba6cedcbc696c08395e75aba4 Author: Paulo Miguel Almeida Date: Tue Mar 8 21:09:42 2022 +1300 staging: pi433: remove hardcoded mask value for easier readability replace hardcoded value with the bitwise complement of the mask used to extract value sent to rf69 chip. Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/YicPRrH3HmpiTCxe@mail.google.com Signed-off-by: Greg Kroah-Hartman drivers/staging/pi433/rf69.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cb9d439002263efbc99814cc8439fe65d805cfb2 Author: Martin Kaiser Date: Sat Mar 5 15:41:17 2022 +0100 staging: r8188eu: remove comments in update_recvframe_attrib_88e Remove a couple of comments in update_recvframe_attrib_88e that provide no useful information. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220305144117.1380534-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 48 ++++++++++++--------------- 1 file changed, 22 insertions(+), 26 deletions(-) commit 49571c57e21fbd0915bd50992c7dac3295f13d95 Author: Martin Kaiser Date: Sat Mar 5 15:41:16 2022 +0100 staging: r8188eu: remove unnecessary casts Remove unnecessary casts in update_recvframe_attrib_88e. The final bitwise-and limits the results to u8 or u16, respectively. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220305144117.1380534-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) commit 05a0a115aa04d6402a69964b23a989314cc53204 Author: Martin Kaiser Date: Sat Mar 5 15:41:15 2022 +0100 staging: r8188eu: don't initialize drvinfo_sz to 0 In update_recvframe_attrib_88e, there's an initial memset which sets all of pattrib to 0. There's no need to set pattrib->drvinfo_sz = 0 again later. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220305144117.1380534-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 2 -- 1 file changed, 2 deletions(-) commit 618a9b2719c383ec63782388f0fd04f72562d0ac Author: Martin Kaiser Date: Sat Mar 5 15:41:14 2022 +0100 staging: r8188eu: summarize declaration and assignment Summarize the declaration of pattrib and the assignment in the following line. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220305144117.1380534-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 23a11ec550db4ad65dd42d68e8bf014e7df65b5f Author: Martin Kaiser Date: Sat Mar 5 15:41:13 2022 +0100 staging: r8188eu: remove tmp variable in update_recvframe_attrib_88e Remove an unnecessary temporary variable in update_recvframe_attrib_88e. We can use the prxstat pointer directly to parse the input data. There's no need to store a local copy in "report". Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220305144117.1380534-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 52 ++++++++++++--------------- 1 file changed, 22 insertions(+), 30 deletions(-) commit 44aa511a6c383af3c9c858c38e078335d49d34f1 Author: Abdun Nihaal Date: Thu Mar 3 21:21:11 2022 +0530 staging: r8188eu: remove unused fields in struct recv_buf The fields alloc_sz, irp_pending and pallocated_buf in struct recv_buf are set but not used. And the field dma_transfer_addr is not used. Remove them. Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/d731acb15f82c597de53ecce8fdf1bb82dc4c386.1646321515.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 1 - drivers/staging/r8188eu/include/rtw_recv.h | 4 ---- drivers/staging/r8188eu/os_dep/recv_linux.c | 2 -- 3 files changed, 7 deletions(-) commit 4e342a3c786ed37db1083b0c4ac9c9685e722cea Author: Abdun Nihaal Date: Thu Mar 3 21:21:10 2022 +0530 staging: r8188eu: remove unneeded field pbuf The field pbuf in struct recv_buf can be removed as it can be replaced with pskb->data. Remove pbuf field. Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/080a9269b9381089e4dc9117f35d0a2d1d0c0259.1646321515.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/usb_ops_linux.c | 6 +----- drivers/staging/r8188eu/include/rtw_recv.h | 1 - drivers/staging/r8188eu/os_dep/recv_linux.c | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) commit e3ffbcac9d8daa94cbcee79043d4839540ab2070 Author: Abdun Nihaal Date: Thu Mar 3 21:21:09 2022 +0530 staging: r8188eu: remove unused field pdata The field pdata in struct recv_buf is set but not used. Remove it. Also remove rtl8188eu_init_recvbuf function as it does nothing now. Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/7fe9ed2c6eade65c118511228283ef9d92ea4b43.1646321515.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 7 ------- drivers/staging/r8188eu/hal/usb_ops_linux.c | 4 ---- drivers/staging/r8188eu/include/rtl8188e_recv.h | 1 - drivers/staging/r8188eu/include/rtw_recv.h | 1 - drivers/staging/r8188eu/os_dep/recv_linux.c | 1 - 5 files changed, 14 deletions(-) commit cd71106689061428647b29e16c02329883e38056 Author: Abdun Nihaal Date: Thu Mar 3 21:21:08 2022 +0530 staging: r8188eu: remove unused field pend The field pend in struct recv_buf is set but not used. Remove it. Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/2ccf7067c411716a05bb6fa0acc04d5a612b5f12.1646321515.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 1 - drivers/staging/r8188eu/hal/usb_ops_linux.c | 2 -- drivers/staging/r8188eu/include/rtw_recv.h | 1 - drivers/staging/r8188eu/os_dep/recv_linux.c | 1 - 4 files changed, 5 deletions(-) commit fffb719a6340ea78651fe48faaa80b97e0fc3d25 Author: Abdun Nihaal Date: Thu Mar 3 21:21:07 2022 +0530 staging: r8188eu: remove unused field ptail The field ptail in struct recv_buf is set but not used. Remove it. Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/9574ad2dfba0cc444ce1dea1268661ed32b84799.1646321515.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 1 - drivers/staging/r8188eu/hal/usb_ops_linux.c | 2 -- drivers/staging/r8188eu/include/rtw_recv.h | 1 - drivers/staging/r8188eu/os_dep/recv_linux.c | 1 - 4 files changed, 5 deletions(-) commit b711ae9a5573b1364f1f9c772904a948afd736c3 Author: Abdun Nihaal Date: Thu Mar 3 21:21:06 2022 +0530 staging: r8188eu: remove unused field phead The field phead in struct recv_buf is set but not used. Remove it. Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/7ff76536af7478a00b300af9a6cb666e53d22aac.1646321515.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 1 - drivers/staging/r8188eu/hal/usb_ops_linux.c | 2 -- drivers/staging/r8188eu/include/rtw_recv.h | 1 - drivers/staging/r8188eu/os_dep/recv_linux.c | 1 - 4 files changed, 5 deletions(-) commit e9ef65f994d477fc993ca28020e98c0fddda9480 Author: Abdun Nihaal Date: Thu Mar 3 21:21:05 2022 +0530 staging: r8188eu: remove unused fields in struct recv_buf The fields len, ref_cnt and transfer_len in struct recv_buf are set but not used. Remove them. Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/fe5565c02a01babf64469333dae73cbdd841d393.1646321515.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 7 ------- drivers/staging/r8188eu/hal/usb_ops_linux.c | 1 - drivers/staging/r8188eu/include/rtw_recv.h | 3 --- drivers/staging/r8188eu/os_dep/recv_linux.c | 2 -- 4 files changed, 13 deletions(-) commit 3770d651ce3c503a2eda932ad2794c884f4f6701 Author: Abdun Nihaal Date: Thu Mar 3 21:21:04 2022 +0530 staging: r8188eu: remove unused field recvbuf_lock The spinlock field recvbuf_lock in struct recv_buf is initialized but not used. Remove it. Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/24597a0cc19fa59139bf0a77ccd11a8229d7201f.1646321515.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 1 - drivers/staging/r8188eu/include/rtw_recv.h | 1 - 2 files changed, 2 deletions(-) commit b8cb97338d772135f2c5cb96880b8fa02c912c3c Author: Abdun Nihaal Date: Thu Mar 3 21:21:03 2022 +0530 staging: r8188eu: remove unused field list The field list in struct recv_buf is initialized but not used. Remove it. Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/558177d9165792a99f6efb439f6f537e13da705b.1646321515.git.abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188eu_recv.c | 1 - drivers/staging/r8188eu/include/rtw_recv.h | 1 - 2 files changed, 2 deletions(-) commit daed08de44e83c7a0f850f28de3b87984eecca32 Author: Vihas Makwana Date: Thu Mar 3 02:17:37 2022 +0530 staging: r8188eu: mark rtw_endofpktfile as bool Mark rtw_endofpktfile as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-17-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/xmit_osdep.h | 2 +- drivers/staging/r8188eu/os_dep/xmit_linux.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 5a61d6b4f4a98875c87cc98d10c5923bf09cf272 Author: Vihas Makwana Date: Thu Mar 3 02:17:36 2022 +0530 staging: r8188eu: mark IsFrameTypeCtrl as bool Mark IsFrameTypeCtrl as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-16-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/wifi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a47807b864b0ea36696c1d60f477e4c4a36b6f0a Author: Vihas Makwana Date: Thu Mar 3 02:17:35 2022 +0530 staging: r8188eu: mark IS_MCAST as bool Mark IS_MCAST as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-15-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/wifi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b459e83949a51a45c7783b3774ebec6453cdfc45 Author: Vihas Makwana Date: Thu Mar 3 02:17:34 2022 +0530 staging: r8188eu: mark check_fwstate as bool Mark check_fwstate as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-14-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/rtw_mlme.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 34e21a9157e137779b70b454ae0ff219d550a27a Author: Vihas Makwana Date: Thu Mar 3 02:17:33 2022 +0530 staging: r8188eu: mark rtl8188eu_xmitframe_complete as bool Mark rtl8188eu_xmitframe_complete as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-13-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 2 +- drivers/staging/r8188eu/include/rtl8188e_xmit.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit ad5213882e1f15a70ca47f137ef845ab9df9b7ea Author: Vihas Makwana Date: Thu Mar 3 02:17:32 2022 +0530 staging: r8188eu: mark is_ap_in_tkip as bool Mark is_ap_in_tkip as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-12-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 7167068ac69cafe13f4b022203d80c85e1f77868 Author: Vihas Makwana Date: Thu Mar 3 02:17:31 2022 +0530 staging: r8188eu: mark is_basicrate as bool Mark is_basicrate as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-11-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_wlan_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2a603c8fac9d0a3d1d18e5e4eca157c2474b55b4 Author: Vihas Makwana Date: Thu Mar 3 02:17:30 2022 +0530 staging: r8188eu: mark cckratesonly_included as bool Mark cckratesonly_included as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-10-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit fb706ede588a33942c7e489a8eb0b925bcf54f8c Author: Vihas Makwana Date: Thu Mar 3 02:17:29 2022 +0530 staging: r8188eu: mark cckrates_included as bool Mark cckrates_included as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-9-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/r8188eu/include/rtw_mlme_ext.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 10b4f58f2ef209093a0a6a09d20a6f7fa05c9a74 Author: Vihas Makwana Date: Thu Mar 3 02:17:28 2022 +0530 staging: r8188eu: mark recv_indicatepkts_in_order as bool Mark recv_indicatepkts_in_order as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-8-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e21762181fb5d33ae95ee1bd58d4ca41a65129de Author: Vihas Makwana Date: Thu Mar 3 02:17:27 2022 +0530 staging: r8188eu: mark enqueue_reorder_recvframe as bool Mark enqueue_reorder_recvframe as bool as it returns true/false. Also, make it static as it's only used in rtw_recv. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-7-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 77a5ea010be8ed2a48a951a31b16407262b455cb Author: Vihas Makwana Date: Thu Mar 3 02:17:26 2022 +0530 staging: r8188eu: mark check_indicate_seq as bool Mark check_indicate_seq as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-6-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 97115f5f0f96f4e5d5779acb5b1d76d1895f8134 Author: Vihas Makwana Date: Thu Mar 3 02:17:25 2022 +0530 staging: r8188eu: mark PS_RDY_CHECK as bool Mark PS_RDY_CHECK as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-5-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f85021269ab41f6752ca295ab7f58a803b77b9bc Author: Vihas Makwana Date: Thu Mar 3 02:17:24 2022 +0530 staging: r8188eu: mark rtw_is_desired_network as bool Mark rtw_is_desired_network as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-4-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f11a0a1d028d49195165eed976454b888d466ae0 Author: Vihas Makwana Date: Thu Mar 3 02:17:23 2022 +0530 staging: r8188eu: mark rtw_is_cckratesonly_included as bool Mark rtw_is_cckratesonly_included as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-3-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_ieee80211.c | 2 +- drivers/staging/r8188eu/include/ieee80211.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 765b9808cd21708dd99fae31ccfb9045aba84b23 Author: Vihas Makwana Date: Thu Mar 3 02:17:22 2022 +0530 staging: r8188eu: mark rtw_is_cckrates_included as bool Mark rtw_is_cckrates_included as bool as it returns true/false. Reviewed-by: Dan Carpenter Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220302204737.49056-2-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_ieee80211.c | 2 +- drivers/staging/r8188eu/include/ieee80211.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 4a51c297f8ffd1621828b856ab89f01d1a2eec81 Author: Colin Ian King Date: Mon Mar 7 14:36:25 2022 +0000 staging: vt6655: remove redundant assignment of pointer tx_key Pointer tx_key is being assigned a value that is never read, it is being re-assigned a new value later. The assignment is redundant and can be removed. Cleans up clan scan build warning: drivers/staging/vt6655/rxtx.c:1311:3: warning: Value stored to 'tx_key' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220307143625.136189-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vt6655/rxtx.c | 2 -- 1 file changed, 2 deletions(-) commit 8d6319cdafadd9f68542cc21972c8c0c5d787ac5 Author: Colin Ian King Date: Mon Mar 7 14:46:03 2022 +0000 staging: gdm724x: remove redundant assignment of pointer w Pointer w is being assigned a value that is never read, it is being re-assigned a new value later. The assignment is redundant and can be removed. Cleans up clan scan build warning: drivers/staging/gdm724x/gdm_lte.c:198:2: warning: Value stored to 'w' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220307144603.136846-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/gdm724x/gdm_lte.c | 1 - 1 file changed, 1 deletion(-) commit 744e6c8ada5d612353a42ce8cd8323dd2364a70d Author: Darrick J. Wong Date: Wed Mar 9 10:16:12 2022 -0800 xfs: constify xfs_name_dotdot The symbol xfs_name_dotdot is a global variable that the xfs codebase uses here and there to look up directory dotdot entries. Currently it's a non-const variable, which means that it's a mutable global variable. So far nobody's abused this to cause problems, but let's use the compiler to enforce that. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner fs/xfs/libxfs/xfs_dir2.c | 6 +++++- fs/xfs/libxfs/xfs_dir2.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) commit 996b2329b20a89963fa577d495cf057dd7bf129c Author: Darrick J. Wong Date: Wed Mar 9 10:16:09 2022 -0800 xfs: constify the name argument to various directory functions Various directory functions do not modify their @name parameter, so mark it const to make that clear. This will enable us to mark the global xfs_name_dotdot variable as const to prevent mischief. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner fs/xfs/libxfs/xfs_dir2.c | 30 +++++++++++++++--------------- fs/xfs/libxfs/xfs_dir2.h | 6 +++--- fs/xfs/libxfs/xfs_dir2_priv.h | 5 +++-- fs/xfs/xfs_inode.c | 6 +++--- fs/xfs/xfs_inode.h | 2 +- fs/xfs/xfs_trace.h | 4 ++-- 6 files changed, 27 insertions(+), 26 deletions(-) commit 41667260bc84db4dfe566e3f6ab6da5293d60d8d Author: Darrick J. Wong Date: Wed Mar 9 10:10:50 2022 -0800 xfs: reserve quota for target dir expansion when renaming files XFS does not reserve quota for directory expansion when renaming children into a directory. This means that we don't reject the expansion with EDQUOT when we're at or near a hard limit, which means that unprivileged userspace can use rename() to exceed quota. Rename operations don't always expand the target directory, and we allow a rename to proceed with no space reservation if we don't need to add a block to the target directory to handle the addition. Moreover, the unlink operation on the source directory generally does not expand the directory (you'd have to free a block and then cause a btree split) and it's probably of little consequence to leave the corner case that renaming a file out of a directory can increase its size. As with link and unlink, there is a further bug in that we do not trigger the blockgc workers to try to clear space when we're out of quota. Because rename is its own special tricky animal, we'll patch xfs_rename directly to reserve quota to the rename transaction. We'll leave cleaning up the rest of xfs_rename for the metadata directory tree patchset. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner fs/xfs/xfs_inode.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) commit 871b9316e7a778ff97bdc34fdb2f2977f616651d Author: Darrick J. Wong Date: Fri Feb 25 16:18:41 2022 -0800 xfs: reserve quota for dir expansion when linking/unlinking files XFS does not reserve quota for directory expansion when linking or unlinking children from a directory. This means that we don't reject the expansion with EDQUOT when we're at or near a hard limit, which means that unprivileged userspace can use link()/unlink() to exceed quota. The fix for this is nuanced -- link operations don't always expand the directory, and we allow a link to proceed with no space reservation if we don't need to add a block to the directory to handle the addition. Unlink operations generally do not expand the directory (you'd have to free a block and then cause a btree split) and we can defer the directory block freeing if there is no space reservation. Moreover, there is a further bug in that we do not trigger the blockgc workers to try to clear space when we're out of quota. To fix both cases, create a new xfs_trans_alloc_dir function that allocates the transaction, locks and joins the inodes, and reserves quota for the directory. If there isn't sufficient space or quota, we'll switch the caller to reservationless mode. This should prevent quota usage overruns with the least restriction in functionality. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner fs/xfs/xfs_inode.c | 46 +++++++++++------------------ fs/xfs/xfs_trans.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_trans.h | 3 ++ 3 files changed, 106 insertions(+), 29 deletions(-) commit dd3b015dd806627c6bcacc24b03f1ca23ca085ff Author: Darrick J. Wong Date: Tue Mar 8 10:51:16 2022 -0800 xfs: refactor user/group quota chown in xfs_setattr_nonsize Combine if tests to reduce the indentation levels of the quota chown calls in xfs_setattr_nonsize. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner fs/xfs/xfs_iops.c | 60 +++++++++++++++++++------------------------------------ 1 file changed, 20 insertions(+), 40 deletions(-) commit e014f37db1a2d109afa750042ac4d69cf3e3d88e Author: Darrick J. Wong Date: Tue Mar 8 10:51:16 2022 -0800 xfs: use setattr_copy to set vfs inode attributes Filipe Manana pointed out that XFS' behavior w.r.t. setuid/setgid revocation isn't consistent with btrfs[1] or ext4. Those two filesystems use the VFS function setattr_copy to convey certain attributes from struct iattr into the VFS inode structure. Andrey Zhadchenko reported[2] that XFS uses the wrong user namespace to decide if it should clear setgid and setuid on a file attribute update. This is a second symptom of the problem that Filipe noticed. XFS, on the other hand, open-codes setattr_copy in xfs_setattr_mode, xfs_setattr_nonsize, and xfs_setattr_time. Regrettably, setattr_copy is /not/ a simple copy function; it contains additional logic to clear the setgid bit when setting the mode, and XFS' version no longer matches. The VFS implements its own setuid/setgid stripping logic, which establishes consistent behavior. It's a tad unfortunate that it's scattered across notify_change, should_remove_suid, and setattr_copy but XFS should really follow the Linux VFS. Adapt XFS to use the VFS functions and get rid of the old functions. [1] https://lore.kernel.org/fstests/CAL3q7H47iNQ=Wmk83WcGB-KBJVOEtR9+qGczzCeXJ9Y2KCV25Q@mail.gmail.com/ [2] https://lore.kernel.org/linux-xfs/20220221182218.748084-1-andrey.zhadchenko@virtuozzo.com/ Fixes: 7fa294c8991c ("userns: Allow chown and setgid preservation") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Christian Brauner fs/xfs/xfs_iops.c | 56 +++---------------------------------------------------- fs/xfs/xfs_pnfs.c | 3 ++- 2 files changed, 5 insertions(+), 54 deletions(-) commit fc93db153b0187a9047f00bfd5cce75108530593 Author: Eric Dumazet Date: Sat Mar 12 13:45:05 2022 -0800 net: disable preemption in dev_core_stats_XXX_inc() helpers syzbot was kind enough to remind us that dev->{tx_dropped|rx_dropped} could be increased in process context. BUG: using smp_processor_id() in preemptible [00000000] code: syz-executor413/3593 caller is netdev_core_stats_alloc+0x98/0x110 net/core/dev.c:10298 CPU: 1 PID: 3593 Comm: syz-executor413 Not tainted 5.17.0-rc7-syzkaller-02426-g97aeb877de7f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_preemption_disabled+0x16b/0x170 lib/smp_processor_id.c:49 netdev_core_stats_alloc+0x98/0x110 net/core/dev.c:10298 dev_core_stats include/linux/netdevice.h:3855 [inline] dev_core_stats_rx_dropped_inc include/linux/netdevice.h:3866 [inline] tun_get_user+0x3455/0x3ab0 drivers/net/tun.c:1800 tun_chr_write_iter+0xe1/0x200 drivers/net/tun.c:2015 call_write_iter include/linux/fs.h:2074 [inline] new_sync_write+0x431/0x660 fs/read_write.c:503 vfs_write+0x7cd/0xae0 fs/read_write.c:590 ksys_write+0x12d/0x250 fs/read_write.c:643 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+0x44/0xae RIP: 0033:0x7f2cf4f887e3 Code: 5d 41 5c 41 5d 41 5e e9 9b fd ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 48 89 54 24 18 RSP: 002b:00007ffd50dd5fd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007ffd50dd6000 RCX: 00007f2cf4f887e3 RDX: 000000000000002a RSI: 0000000000000000 RDI: 00000000000000c8 RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd50dd5ff0 R14: 00007ffd50dd5fe8 R15: 00007ffd50dd5fe4 Fixes: 625788b58445 ("net: add per-cpu storage and net->core_stats") Signed-off-by: Eric Dumazet Cc: jeffreyji Cc: Brian Vazquez Acked-by: Paolo Abeni Link: https://lore.kernel.org/r/20220312214505.3294762-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski include/linux/netdevice.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit ebc0b8b5374ebd4979c85905dfd6c682020f048c Author: Julia Lawall Date: Mon Mar 14 12:53:36 2022 +0100 drivers: net: packetengines: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220314115354.144023-13-Julia.Lawall@inria.fr Signed-off-by: Jakub Kicinski drivers/net/ethernet/packetengines/yellowfin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e6194c8d065389b9393290ecb682118fd982fa33 Author: Andy Chi Date: Mon Mar 14 22:21:19 2022 +0800 ALSA: hda/realtek: fix right sounds and mute/micmute LEDs for HP machines * The HP ProBook 440/450 and EliteBook 640/650 are using ALC236 codec which used 0x02 to control mute LED and 0x01 to control micmute LED. Therefore, add a quirk to make it works. Signed-off-by: Andy Chi Link: https://lore.kernel.org/r/20220314142122.71602-1-andy.chi@canonical.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 4 ++++ 1 file changed, 4 insertions(+) commit c22fca40522e2be8af168f3087d87d85e404ea72 Author: Linus Walleij Date: Tue Mar 8 16:44:25 2022 +0100 power: ab8500_chargalg: Use CLOCK_MONOTONIC The HRTimer in the AB8500 charging code is using CLOCK_REALTIME to set an alarm some hours forward in time +/- 5 min for a safety timer. I have observed that this will sometimes fire sporadically early when charging a battery with the result that charging stops. As CLOCK_REALTIME can be subject to adjustments of time from sources such as NTP, this cannot be trusted and will likely for example fire events if the clock is set forward some hours by say NTP. Use CLOCK_MONOTONIC as indicated in other instances and the problem goes away. Also initialize the timer to REL mode as this is what will be used later. Fixes: 257107ae6b9b ("ab8500-chargalg: Use hrtimer") Cc: Lee Jones Suggested-by: Matti Vaittinen Signed-off-by: Linus Walleij Reviewed-by: Matti Vaittinen Signed-off-by: Sebastian Reichel drivers/power/supply/ab8500_chargalg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 8f877b7eab9d60a9deef6beae95656b77d55ab75 Author: Miquel Raynal Date: Mon Mar 14 16:23:36 2022 +0100 mtd: nand: ecc: mxic: Fix compile test issue Avoid random build errors with architectures which do not select HAS_IOMEM by depending on it in Kconfig. This fixes the following warning: /home/mraynal/0day/gcc-11.2.0-nolibc/s390-linux/bin/s390-linux-ld: drivers/mtd/nand/ecc-mxic.o: in function `mxic_ecc_probe': ecc-mxic.c:(.text+0x2244): undefined reference to `devm_platform_ioremap_resource' Reported-by: kernel test robot Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220314152336.75447-1-miquel.raynal@bootlin.com drivers/mtd/nand/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 5a368fb65ad9aaf68f2bbe02d42969741317d44c Author: Colin Ian King Date: Mon Mar 7 23:09:40 2022 +0000 mtd: nand: mxic-ecc: make two read-only arrays static const Don't populate the read-only arrays possible_strength and spare_size on the stack but instead make them static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220307230940.169235-1-colin.i.king@gmail.com drivers/mtd/nand/ecc-mxic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5fc69b6e51ae2da28081c201f595898c5c1f40cc Author: Geert Uytterhoeven Date: Mon Mar 7 13:27:02 2022 +0100 mtd: hyperbus: HBMC_AM654 should depend on ARCH_K3 The AM65x HyperBus controller is only present on Texas Instruments AM65x SoCs. Hence add a dependency on ARCH_K3, to prevent asking the user about this driver when configuring a kernel without support for the Texas Instruments Inc. K3 multicore SoC architecture. Signed-off-by: Geert Uytterhoeven Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/9fd6b975adba710158f28aa603cf87a6d189a418.1646655894.git.geert+renesas@glider.be drivers/mtd/hyperbus/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ec090a0392ff634e9304c19a8578d476a9e0c830 Author: Tudor Ambarus Date: Fri Feb 25 16:46:56 2022 +0200 mtd: core: Remove partid and partname debugfs files partid and partname debugfs files were used just by SPI NOR, but they were replaced by sysfs entries. Since these debugfs files are no longer used in mtd, remove dead code. The directory is kept as it is used by nandsim, mtdswap and docg3. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220225144656.634682-1-tudor.ambarus@microchip.com drivers/mtd/mtdcore.c | 35 +---------------------------------- include/linux/mtd/mtd.h | 3 --- 2 files changed, 1 insertion(+), 37 deletions(-) commit d9a16830e10eafde6f0bce91047bb869c44425ab Author: Rafał Miłecki Date: Wed Feb 16 11:41:35 2022 +0100 dt-bindings: mtd: partitions: convert BCM47xx to the json-schema This helps validating DTS files. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220216104135.31307-1-zajec5@gmail.com .../partitions/brcm,bcm947xx-cfe-partitions.txt | 42 ------------------- .../partitions/brcm,bcm947xx-cfe-partitions.yaml | 48 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 42 deletions(-) commit ceef4cf97bec31403a73bd2facff8651a2ae4369 Author: Amit Kumar Mahapatra Date: Tue Feb 8 16:09:05 2022 +0530 mtd: tests: Fix eraseblock read speed miscalculation for lower partition sizes While calculating speed during mtd_speedtest, the time interval (i.e., start - finish) is rounded off to the nearest milliseconds by ignoring the fractional part. This leads to miscalculation of speed. The miscalculation is more visible while running speed test on small partition sizes(i.e., when partition size is equal to eraseblock size or twice the eraseblock size) at higher spi frequencies. For e.g., while calculating eraseblock read speed for a mtd partition with size equal to the eraseblock size(i.e., 64KiB) the eraseblock read time interval comes out to be 966490 nanosecond. This is then converted to millisecond(i.e., 0.966 msec.). The integer part (i.e., 0 msec) of the value is considered and the fractional part (i.e., 0.966) is ignored,for calculating the eraseblock read speed. So the reported eraseblock read speed is 0 KiB/s, which is incorrect. There are two approaches to fix this issue. First approach will be to keep the time interval in millisecond. and round up the integer value, with this approach the 0.966msec time interval in the above example will be rounded up to 1msec and this value is used for calculating the speed. Downside of this approach is that the reported speed is still not accurate. Second approach will be to convert the time interval to microseconds instead of milliseconds, with this approach the 966490 nanosecond time interval in the above example will be converted t0 966.490usec and this value is used for calculating the speed. As compared to the current implementation and the suggested First approach, this approach will report a more accurate speed. Downside of this approach is that, in future if the mtd size is too large then the u64 variable, that holds the number of bytes, might overflow. In this patch we have gone with the second approach as this reports a more accurate speed. With this approach the eraseblock read speed in the above example comes out to be 132505 KiB/s when the spi clock is configured at 150Mhz. Signed-off-by: Amit Kumar Mahapatra Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220208103905.13354-1-amit.kumar-mahapatra@xilinx.com drivers/mtd/tests/speedtest.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit fecbd4a317c95d73c849648c406bcf1b6a0ec1cf Author: Xin Xiong Date: Fri Mar 4 16:53:32 2022 +0800 mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init The reference counting issue happens in several error handling paths on a refcounted object "nc->dmac". In these paths, the function simply returns the error code, forgetting to balance the reference count of "nc->dmac", increased earlier by dma_request_channel(), which may cause refcount leaks. Fix it by decrementing the refcount of specific object in those error paths. Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") Co-developed-by: Xiyu Yang Signed-off-by: Xiyu Yang Co-developed-by: Xin Tan Signed-off-by: Xin Tan Signed-off-by: Xin Xiong Reviewed-by: Claudiu Beznea Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220304085330.3610-1-xiongx18@fudan.edu.cn drivers/mtd/nand/raw/atmel/nand-controller.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) commit fba6eb4fc4e6819d9684d378ace339c4212d5ce1 Author: Yihao Han Date: Thu Mar 3 04:34:27 2022 -0800 mtd: rawnand: rockchip: fix platform_get_irq.cocci warning Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Signed-off-by: Yihao Han Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220303123431.3170-1-hanyihao@vivo.com drivers/mtd/nand/raw/rockchip-nand-controller.c | 1 - 1 file changed, 1 deletion(-) commit be9d73e64957bbd31ee9a0d11adc0f720974c558 Author: Jorge Lopez Date: Thu Mar 10 15:08:52 2022 -0600 platform/x86: hp-wmi: Fix 0x05 error code reported by several WMI calls Several WMI queries leverage hp_wmi_read_int function to read their data. hp_wmi_read_int function was corrected in a previous patch. Now, this function invokes hp_wmi_perform_query with input parameter of size zero and the output buffer of size 4. WMI commands calling hp_wmi_perform_query with input buffer size value of zero are listed below. HPWMI_DISPLAY_QUERY HPWMI_HDDTEMP_QUERY HPWMI_ALS_QUERY HPWMI_HARDWARE_QUERY HPWMI_WIRELESS_QUERY HPWMI_BIOS_QUERY HPWMI_FEATURE_QUERY HPWMI_HOTKEY_QUERY HPWMI_FEATURE2_QUERY HPWMI_WIRELESS2_QUERY HPWMI_POSTCODEERROR_QUERY HPWMI_THERMAL_PROFILE_QUERY HPWMI_FAN_SPEED_MAX_GET_QUERY Invoking those WMI commands with an input buffer size greater than zero will cause error 0x05 to be returned. All WMI commands executed by the driver were reviewed and changes were made to ensure the expected input and output buffer size match the WMI specification. Changes were validated on a HP ZBook Workstation notebook, HP EliteBook x360, and HP EliteBook 850 G8. Additional validation was included in the test process to ensure no other commands were incorrectly handled. Signed-off-by: Jorge Lopez Link: https://lore.kernel.org/r/20220310210853.28367-4-jorge.lopez2@hp.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/hp-wmi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) commit 520ee4ea1cc60251a6e3c911cf0336278aa52634 Author: Jorge Lopez Date: Thu Mar 10 15:08:51 2022 -0600 platform/x86: hp-wmi: Fix SW_TABLET_MODE detection method The purpose of this patch is to introduce a fix and removal of the current hack when determining tablet mode status. Determining the tablet mode status requires reading Byte 0 bit 2 as reported by HPWMI_HARDWARE_QUERY. The investigation identified the failure was rooted in two areas: HPWMI_HARDWARE_QUERY failure (0x05) and reading Byte 0, bit 2 only to determine the table mode status. HPWMI_HARDWARE_QUERY WMI failure also rendered the dock state value invalid. The latest changes use SMBIOS Type 3 (chassis type) and WMI Command 0x40 (device_mode_status) information to determine if the device is in tablet mode or not. hp_wmi_hw_state function was split into two functions; hp_wmi_get_dock_state and hp_wmi_get_tablet_mode. The new functions separate how dock_state and tablet_mode is handled in a cleaner manner. All changes were validated on a HP ZBook Workstation notebook, HP EliteBook x360, and HP EliteBook 850 G8. Signed-off-by: Jorge Lopez Link: https://lore.kernel.org/r/20220310210853.28367-3-jorge.lopez2@hp.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/hp-wmi.c | 71 +++++++++++++++++++++++++++++++------------ 1 file changed, 52 insertions(+), 19 deletions(-) commit 12b19f14a21a2ee6348825d95b642ef2cd16794f Author: Jorge Lopez Date: Thu Mar 10 15:08:50 2022 -0600 platform/x86: hp-wmi: Fix hp_wmi_read_int() reporting error (0x05) The purpose of this patch is to introduce a fix to hp_wmi_read_int() and eliminate failure error (0x05). Several WMI queries leverage hp_wmi_read_int() to read their data and were failing with error 0x05. HPWMI_DISPLAY_QUERY HPWMI_HDDTEMP_QUERY HPWMI_ALS_QUERY HPWMI_HARDWARE_QUERY HPWMI_WIRELESS_QUERY HPWMI_POSTCODEERROR_QUERY The failure occurs because hp_wmi_read_int() calls hp_wmi_perform_query() with input parameter of size greater than zero. Invoking those WMI commands with an input buffer size greater than zero causes the command to be rejected and error 0x05 be returned. All changes were validated on a HP ZBook Workstation notebook, HP EliteBook x360, and HP EliteBook 850 G8. Signed-off-by: Jorge Lopez Link: https://lore.kernel.org/r/20220310210853.28367-2-jorge.lopez2@hp.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/hp-wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3bcc372c9865bec3ab9bfcf30b2426cf68bc18af Author: Janis Schoetterl-Glausch Date: Tue Mar 8 13:58:41 2022 +0100 KVM: s390: selftests: Add error memop tests Test that errors occur if key protection disallows access, including tests for storage and fetch protection override. Perform tests for both logical vcpu and absolute vm ioctls. Also extend the existing tests to the vm ioctl. Signed-off-by: Janis Schoetterl-Glausch Link: https://lore.kernel.org/r/20220308125841.3271721-6-scgl@linux.ibm.com Signed-off-by: Christian Borntraeger tools/testing/selftests/kvm/s390x/memop.c | 137 +++++++++++++++++++++++++++--- 1 file changed, 124 insertions(+), 13 deletions(-) commit 1bb873495a9ebbc8f6dd54a110b2c639e225c782 Author: Janis Schoetterl-Glausch Date: Tue Mar 8 13:58:40 2022 +0100 KVM: s390: selftests: Add more copy memop tests Do not just test the actual copy, but also that success is indicated when using the check only flag. Add copy test with storage key checking enabled, including tests for storage and fetch protection override. These test cover both logical vcpu ioctls as well as absolute vm ioctls. Signed-off-by: Janis Schoetterl-Glausch Link: https://lore.kernel.org/r/20220308125841.3271721-5-scgl@linux.ibm.com Signed-off-by: Christian Borntraeger tools/testing/selftests/kvm/s390x/memop.c | 243 ++++++++++++++++++++++++++++-- 1 file changed, 230 insertions(+), 13 deletions(-) commit c4816a1b7fed3c000b37ad6516f65aad8bc5fba6 Author: Janis Schoetterl-Glausch Date: Tue Mar 8 13:58:39 2022 +0100 KVM: s390: selftests: Add named stages for memop test The stages synchronize guest and host execution. This helps the reader and constraits the execution of the test -- if the observed staging differs from the expected the test fails. Signed-off-by: Janis Schoetterl-Glausch Link: https://lore.kernel.org/r/20220308125841.3271721-4-scgl@linux.ibm.com Signed-off-by: Christian Borntraeger tools/testing/selftests/kvm/s390x/memop.c | 44 +++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 11 deletions(-) commit 4eb562ab99c427bcfb94d39bf54a44919ccbb64c Author: Janis Schoetterl-Glausch Date: Tue Mar 8 13:58:38 2022 +0100 KVM: s390: selftests: Add macro as abstraction for MEM_OP In order to achieve good test coverage we need to be able to invoke the MEM_OP ioctl with all possible parametrizations. However, for a given test, we want to be concise and not specify a long list of default values for parameters not relevant for the test, so the readers attention is not needlessly diverted. Add a macro that enables this and convert the existing test to use it. The macro emulates named arguments and hides some of the ioctl's redundancy, e.g. sets the key flag if an access key is specified. Signed-off-by: Janis Schoetterl-Glausch Link: https://lore.kernel.org/r/20220308125841.3271721-3-scgl@linux.ibm.com Signed-off-by: Christian Borntraeger tools/testing/selftests/kvm/s390x/memop.c | 272 ++++++++++++++++++++++-------- 1 file changed, 197 insertions(+), 75 deletions(-) commit 70e2f9f0390570077a3904f39c994b348ca6778d Author: Janis Schoetterl-Glausch Date: Tue Mar 8 13:58:37 2022 +0100 KVM: s390: selftests: Split memop tests Split success case/copy test from error test, making them independent. This means they do not share state and are easier to understand. Also, new test can be added in the same manner without affecting the old ones. In order to make that simpler, introduce functionality for the setup of commonly used variables. Signed-off-by: Janis Schoetterl-Glausch Link: https://lore.kernel.org/r/20220308125841.3271721-2-scgl@linux.ibm.com Signed-off-by: Christian Borntraeger tools/testing/selftests/kvm/s390x/memop.c | 137 ++++++++++++++++++------------ 1 file changed, 82 insertions(+), 55 deletions(-) commit c0573ba5c5a2244dc02060b1f374d4593c1d20b7 Author: Claudio Imbrenda Date: Tue Mar 1 15:33:40 2022 +0100 KVM: s390x: fix SCK locking When handling the SCK instruction, the kvm lock is taken, even though the vcpu lock is already being held. The normal locking order is kvm lock first and then vcpu lock. This is can (and in some circumstances does) lead to deadlocks. The function kvm_s390_set_tod_clock is called both by the SCK handler and by some IOCTLs to set the clock. The IOCTLs will not hold the vcpu lock, so they can safely take the kvm lock. The SCK handler holds the vcpu lock, but will also somehow need to acquire the kvm lock without relinquishing the vcpu lock. The solution is to factor out the code to set the clock, and provide two wrappers. One is called like the original function and does the locking, the other is called kvm_s390_try_set_tod_clock and uses trylock to try to acquire the kvm lock. This new wrapper is then used in the SCK handler. If locking fails, -EAGAIN is returned, which is eventually propagated to userspace, thus also freeing the vcpu lock and allowing for forward progress. This is not the most efficient or elegant way to solve this issue, but the SCK instruction is deprecated and its performance is not critical. The goal of this patch is just to provide a simple but correct way to fix the bug. Fixes: 6a3f95a6b04c ("KVM: s390: Intercept SCK instruction") Signed-off-by: Claudio Imbrenda Reviewed-by: Christian Borntraeger Reviewed-by: Janis Schoetterl-Glausch Link: https://lore.kernel.org/r/20220301143340.111129-1-imbrenda@linux.ibm.com Cc: stable@vger.kernel.org Signed-off-by: Christian Borntraeger arch/s390/kvm/kvm-s390.c | 19 ++++++++++++++++--- arch/s390/kvm/kvm-s390.h | 4 ++-- arch/s390/kvm/priv.c | 15 ++++++++++++++- 3 files changed, 32 insertions(+), 6 deletions(-) commit 56955aae9fc2c59fa3c9b32f1f147cdbe05e5ac4 Author: Gaston Gonzalez Date: Wed Mar 2 18:36:36 2022 -0300 staging: vchiq_arm: make vchiq_platform_get_arm_state() static Fix "no previous prototype" W=1 warning by making the function vchiq_platform_get_arm_state() static. While at it, realign the function declaration in one line and reposition the asterisk symbol to fulfill the 'foo *bar' syntax. Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/216ad30d674b80e0051ecc233ac26ddb1d3e0e75.1646255044.git.gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit dcd520af4eacae8c9d2db1f50e7adc0ca050fc1a Author: Arınç ÜNAL Date: Sat Mar 12 12:18:32 2022 +0300 staging: mt7621-dts: fix cpuintc and fixedregulator dtc warnings, fix xhci Fix the cpuintc and fixedregulator dtc warnings: Warning (unit_address_vs_reg): /cpuintc@0: node has a unit name, but no reg property Warning (unit_address_vs_reg): /fixedregulator@0: node has a unit name, but no reg property Warning (unit_address_vs_reg): /fixedregulator@1: node has a unit name, but no reg property Warning (unique_unit_address): /cpuintc@0: duplicate unit-address (also used in node /fixedregulator@0) Remove the unnecessary status = "okay" property from the xhci node. Reviewed-by: Sergio Paracuellos Signed-off-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20220312091832.6269-1-arinc.unal@arinc9.com Signed-off-by: Greg Kroah-Hartman drivers/staging/mt7621-dts/mt7621.dtsi | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 5bc148649cf358d0cccf525452a4efbd4bc89a0f Author: Arınç ÜNAL Date: Fri Mar 11 12:03:20 2022 +0300 staging: mt7621-dts: fix GB-PC2 devicetree Fix the GB-PC2 devicetree. Refer to the schematics of the device for more information. GB-PC2 devicetree fixes: - Include mt7621.dtsi instead of gbpc1.dts. Add the missing definitions. - Remove gpio-leds node as the system LED is not wired to anywhere on the board and the power LED is directly wired to GND. - Remove uart3 pin group from gpio-pinmux node as it's not used as GPIO. - Use reg 7 for the external phy to be on par with Documentation/devicetree/bindings/net/dsa/mt7530.txt. - Use the status value "okay". Link: https://github.com/ngiger/GnuBee_Docs/blob/master/GB-PCx/Documents/GB-PC2_V1.1_schematic.pdf Reviewed-by: Sergio Paracuellos Signed-off-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20220311090320.3068-2-arinc.unal@arinc9.com Signed-off-by: Greg Kroah-Hartman drivers/staging/mt7621-dts/gbpc2.dts | 110 ++++++++++++++++++++++++++++++++--- 1 file changed, 102 insertions(+), 8 deletions(-) commit 6256e18686158fa49e019297f990f1c1817aabf1 Author: Arınç ÜNAL Date: Fri Mar 11 12:03:19 2022 +0300 staging: mt7621-dts: fix LEDs and pinctrl on GB-PC1 devicetree Fix LED and pinctrl definitions on the GB-PC1 devicetree. Refer to the schematics of the device for more information. LED fixes: - Change GPIO6 LED label from system to power as GPIO6 is connected to PLED. - Add default-on default-trigger to power LED. - Change GPIO8 LED label from status to system as GPIO8 is connected to SYS_LED. - Add disk-activity default-trigger to system LED. - Switch to the color:function naming scheme. - Remove lan1 and lan2 LEDs as they don't exist. Pinctrl fixes: - Claim state_default node under pinctrl node. - Change pinctrl0 node name to state-default. - Change gpio node name to gpio-pinmux to respect Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml. - Sort pin groups alphabetically. Misc fixes: - Fix formatting. - Use the status value "okay". - Define hexadecimal addresses in lower case. - Make hexadecimal addresses for memory easier to read. Link: https://github.com/ngiger/GnuBee_Docs/blob/master/GB-PCx/Documents/GB-PC1_V1.0_Schematic.pdf Tested-by: Sergio Paracuellos Signed-off-by: Arınç ÜNAL Link: https://lore.kernel.org/r/20220311090320.3068-1-arinc.unal@arinc9.com Signed-off-by: Greg Kroah-Hartman drivers/staging/mt7621-dts/gbpc1.dts | 40 ++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 22 deletions(-) commit 46eb3ad789a43c3d4ffbd5ac97337d9b913bafe2 Author: Julia Lawall Date: Mon Mar 14 12:53:31 2022 +0100 staging: rtl8723bs: fix typos in comments Various spelling mistakes in comments. Detected with the help of Coccinelle. Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220314115354.144023-8-Julia.Lawall@inria.fr Signed-off-by: Greg Kroah-Hartman drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 588d08201c2d91c0b7408eb1deb73f6c8fce9ea3 Author: Tiezhu Yang Date: Thu Mar 10 14:50:12 2022 +0800 MIPS: Fix wrong comments in asm/prom.h In arch/mips/include/asm/prom.h, it should use "!CONFIG_USE_OF" after #else and #endif. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer arch/mips/include/asm/prom.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit cd04d58e829dd074b0af1c1556c5130227f9f23a Author: Tiezhu Yang Date: Thu Mar 10 14:50:11 2022 +0800 MIPS: Remove redundant definitions of device_tree_init() There exists many same definitions of device_tree_init() for various platforms, add a weak function in arch/mips/kernel/prom.c to clean up the related code. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer arch/mips/ath79/setup.c | 5 ----- arch/mips/kernel/prom.c | 5 +++++ arch/mips/lantiq/prom.c | 5 ----- arch/mips/loongson64/setup.c | 5 ----- arch/mips/mti-malta/Makefile | 1 - arch/mips/mti-malta/malta-dt.c | 15 --------------- arch/mips/pic32/pic32mzda/init.c | 5 ----- arch/mips/ralink/of.c | 5 ----- 8 files changed, 5 insertions(+), 41 deletions(-) commit 89fa1268932420c64155bb4de9a9252a8c9e475d Author: Tiezhu Yang Date: Thu Mar 10 14:50:10 2022 +0800 MIPS: Remove redundant check in device_tree_init() In device_tree_init(), unflatten_and_copy_device_tree() checks initial_boot_params, so remove the redundant check. drivers/of/fdt.c void __init unflatten_and_copy_device_tree(void) { int size; void *dt; if (!initial_boot_params) { pr_warn("No valid device tree found, continuing without\n"); return; } ... } Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer arch/mips/loongson64/setup.c | 3 --- arch/mips/pic32/pic32mzda/init.c | 3 --- 2 files changed, 6 deletions(-) commit 4cc893176cf6ba0b0f53287d3c306862e058225a Merge: b25c7dc13fb8 09688c0166e7 Author: Greg Kroah-Hartman Date: Mon Mar 14 15:06:38 2022 +0100 Merge 5.17-rc8 into staging-next We need the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 2bc5bab9a763d520937e4f3fe8df51c6a1eceb97 Author: Yaliang Wang Date: Thu Mar 10 19:31:16 2022 +0800 MIPS: pgalloc: fix memory leak caused by pgd_free() pgd page is freed by generic implementation pgd_free() since commit f9cb654cb550 ("asm-generic: pgalloc: provide generic pgd_free()"), however, there are scenarios that the system uses more than one page as the pgd table, in such cases the generic implementation pgd_free() won't be applicable anymore. For example, when PAGE_SIZE_4KB is enabled and MIPS_VA_BITS_48 is not enabled in a 64bit system, the macro "PGD_ORDER" will be set as "1", which will cause allocating two pages as the pgd table. Well, at the same time, the generic implementation pgd_free() just free one pgd page, which will result in the memory leak. The memory leak can be easily detected by executing shell command: "while true; do ls > /dev/null; grep MemFree /proc/meminfo; done" Fixes: f9cb654cb550 ("asm-generic: pgalloc: provide generic pgd_free()") Signed-off-by: Yaliang Wang Signed-off-by: Thomas Bogendoerfer arch/mips/include/asm/pgalloc.h | 6 ++++++ 1 file changed, 6 insertions(+) commit 8755d57ba1ff910666572fab9e32890e8cc6ed3b Author: Randy Dunlap Date: Fri Mar 11 20:20:26 2022 -0800 MIPS: RB532: fix return value of __setup handler __setup() handlers should return 1 to obsolete_checksetup() in init/main.c to indicate that the boot option has been handled. A return of 0 causes the boot option/value to be listed as an Unknown kernel parameter and added to init's (limited) argument or environment strings. Also, error return codes don't mean anything to obsolete_checksetup() -- only non-zero (usually 1) or zero. So return 1 from setup_kmac(). Fixes: 9e21c7e40b7e ("MIPS: RB532: Replace parse_mac_addr() with mac_pton().") Fixes: 73b4390fb234 ("[MIPS] Routerboard 532: Support for base system") Signed-off-by: Randy Dunlap From: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Phil Sutter Cc: Florian Fainelli Cc: Ralf Baechle Cc: Daniel Walter Signed-off-by: Thomas Bogendoerfer arch/mips/rb532/devices.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit b847bd64ea9f484510e27065cb2bccc58d9b829b Author: Kees Cook Date: Wed Mar 9 14:09:39 2022 -0800 MIPS: Only use current_stack_pointer on GCC Unfortunately, Clang did not have support for "sp" as a global register definition, and was crashing after the addition of current_stack_pointer. This has been fixed in Clang 14, but earlier Clang versions need to avoid this code, so add a versioned test and revert back to the open-coded asm instances. Fixes Clang build error: fatal error: error in backend: Invalid register name global variable Fixes: 200ed341b864 ("mips: Implement "current_stack_pointer"") Reported-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/lkml/YikTQRql+il3HbrK@dev-arch.thelio-3990X Cc: Thomas Bogendoerfer Cc: Marc Zyngier Cc: Guenter Roeck Cc: Yanteng Si Cc: linux-mips@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Nick Desaulniers Signed-off-by: Thomas Bogendoerfer arch/mips/Kconfig | 2 +- arch/mips/include/asm/thread_info.h | 2 ++ arch/mips/kernel/irq.c | 3 ++- arch/mips/lib/uncached.c | 4 +++- 4 files changed, 8 insertions(+), 3 deletions(-) commit 4d409ca3e5107a1b300d0f36550d61c5da4fd8a7 Author: Kees Cook Date: Wed Mar 9 10:50:32 2022 -0800 MIPS: boot/compressed: Use array reference for image bounds As done with other image addresses in other architectures, use an explicit flexible array instead of "address of char", which can trip bounds checking done by the compiler. Found when building with -Warray-bounds: In file included from ./include/linux/byteorder/little_endian.h:5, from ./arch/mips/include/uapi/asm/byteorder.h:15, from ./arch/mips/include/asm/bitops.h:21, from ./include/linux/bitops.h:33, from ./include/linux/kernel.h:22, from arch/mips/boot/compressed/decompress.c:13: arch/mips/boot/compressed/decompress.c: In function 'decompress_kernel': ./include/asm-generic/unaligned.h:14:8: warning: array subscript -1 is outside array bounds of 'unsigned char[1]' [-Warray-bounds] 14 | __pptr->x; \ | ~~~~~~^~~ ./include/uapi/linux/byteorder/little_endian.h:35:51: note: in definition of macro '__le32_to_cpu' 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ ./include/asm-generic/unaligned.h:32:21: note: in expansion of macro '__get_unaligned_t' 32 | return le32_to_cpu(__get_unaligned_t(__le32, p)); | ^~~~~~~~~~~~~~~~~ arch/mips/boot/compressed/decompress.c:29:37: note: while referencing '__image_end' 29 | extern unsigned char __image_begin, __image_end; | ^~~~~~~~~~~ Cc: Thomas Bogendoerfer Cc: Randy Dunlap Cc: linux-mips@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Thomas Bogendoerfer arch/mips/boot/compressed/decompress.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 4528668ca331f7ce5999b7746657b46db5b3b785 Author: Miaoqian Lin Date: Wed Mar 9 09:17:10 2022 +0000 mips: cdmm: Fix refcount leak in mips_cdmm_phys_base The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Fixes: 2121aa3e2312 ("mips: cdmm: Add mti,mips-cdmm dtb node support") Signed-off-by: Miaoqian Lin Acked-by: Serge Semin Signed-off-by: Thomas Bogendoerfer drivers/bus/mips_cdmm.c | 1 + 1 file changed, 1 insertion(+) commit d3e29967079c522ce1c5cab0e9fab2c280b977eb Author: Nikolay Borisov Date: Mon Mar 7 15:30:02 2022 +0200 btrfs: zoned: put block group after final usage It's counter-intuitive (and wrong) to put the block group _before_ the final usage in submit_eb_page. Fix it by re-ordering the call to btrfs_put_block_group after its final reference. Also fix a minor typo in 'implies' Fixes: be1a1d7a5d24 ("btrfs: zoned: finish fully written block group") CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Johannes Thumshirn Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/extent_io.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 79c9234ba596e903907de20573fd4bcc85315b06 Author: Dongliang Mu Date: Thu Mar 3 22:40:27 2022 +0800 btrfs: don't access possibly stale fs_info data in device_list_add Syzbot reported a possible use-after-free in printing information in device_list_add. Very similar with the bug fixed by commit 0697d9a61099 ("btrfs: don't access possibly stale fs_info data for printing duplicate device"), but this time the use occurs in btrfs_info_in_rcu. Call Trace: kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 btrfs_printk+0x395/0x425 fs/btrfs/super.c:244 device_list_add.cold+0xd7/0x2ed fs/btrfs/volumes.c:957 btrfs_scan_one_device+0x4c7/0x5c0 fs/btrfs/volumes.c:1387 btrfs_control_ioctl+0x12a/0x2d0 fs/btrfs/super.c:2409 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 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+0x44/0xae Fix this by modifying device->fs_info to NULL too. Reported-and-tested-by: syzbot+82650a4e0ed38f218363@syzkaller.appspotmail.com CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Dongliang Mu Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/volumes.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit bf7bd725b022cca0195aa81a378a82b1e731a4a3 Author: Niels Dossche Date: Thu Mar 3 01:38:39 2022 +0100 btrfs: add lockdep_assert_held to need_preemptive_reclaim In a previous patch ("btrfs: extend locking to all space_info members accesses") the locking for the space_info members was extended in btrfs_preempt_reclaim_metadata_space because not all the member accesses that needed locks were actually locked (bytes_pinned et al). It was then suggested to also add a call to lockdep_assert_held to need_preemptive_reclaim. This function also works with space_info members. As of now, it has only two call sites which both hold the lock. Suggested-by: Johannes Thumshirn Reviewed-by: Johannes Thumshirn Signed-off-by: Niels Dossche Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/space-info.c | 2 ++ 1 file changed, 2 insertions(+) commit 3777369ff1518b579560611a0d0c33f930154f64 Author: Qu Wenruo Date: Wed Mar 2 09:10:21 2022 +0800 btrfs: verify the tranisd of the to-be-written dirty extent buffer [BUG] There is a bug report that a bitflip in the transid part of an extent buffer makes btrfs to reject certain tree blocks: BTRFS error (device dm-0): parent transid verify failed on 1382301696 wanted 262166 found 22 [CAUSE] Note the failed transid check, hex(262166) = 0x40016, while hex(22) = 0x16. It's an obvious bitflip. Furthermore, the reporter also confirmed the bitflip is from the hardware, so it's a real hardware caused bitflip, and such problem can not be detected by the existing tree-checker framework. As tree-checker can only verify the content inside one tree block, while generation of a tree block can only be verified against its parent. So such problem remain undetected. [FIX] Although tree-checker can not verify it at write-time, we still have a quick (but not the most accurate) way to catch such obvious corruption. Function csum_one_extent_buffer() is called before we submit metadata write. Thus it means, all the extent buffer passed in should be dirty tree blocks, and should be newer than last committed transaction. Using that we can catch the above bitflip. Although it's not a perfect solution, as if the corrupted generation is higher than the correct value, we have no way to catch it at all. Reported-by: Christoph Anton Mitterer Link: https://lore.kernel.org/linux-btrfs/2dfcbc130c55cc6fd067b93752e90bd2b079baca.camel@scientia.org/ CC: stable@vger.kernel.org # 5.15+ Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/disk-io.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) commit 9a4ffa1bd629c7c55a1238c65e58fe0ce9c12d08 Author: Qu Wenruo Date: Tue Feb 22 15:41:20 2022 +0800 btrfs: unify the error handling of btrfs_read_buffer() There is one oddball error handling of btrfs_read_buffer(): ret = btrfs_read_buffer(tmp, gen, parent_level - 1, &first_key); if (!ret) { *eb_ret = tmp; return 0; } free_extent_buffer(tmp); btrfs_release_path(p); return -EIO; While all other call sites check the error first. Unify the behavior. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/ctree.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 4eb150d6122bf51744d07c569ea811e8ce4bdd6d Author: Qu Wenruo Date: Tue Feb 22 15:41:19 2022 +0800 btrfs: unify the error handling pattern for read_tree_block() We had an error handling pattern for read_tree_block() like this: eb = read_tree_block(); if (IS_ERR(eb)) { /* * Handling error here * Normally ended up with return or goto out. */ } else if (!extent_buffer_uptodate(eb)) { /* * Different error handling here * Normally also ended up with return or goto out; */ } This is fine, but if we want to add extra check for each read_tree_block(), the existing if-else-if is not that expandable and will take reader some seconds to figure out there is no extra branch. Here we change it to a more common way, without the extra else: eb = read_tree_block(); if (IS_ERR(eb)) { /* * Handling error here */ return eb or goto out; } if (!extent_buffer_uptodate(eb)) { /* * Different error handling here */ return eb or goto out; } This also removes some oddball call sites which uses some creative way to check error. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/backref.c | 7 +++++-- fs/btrfs/ctree.c | 30 ++++++++++++++++-------------- fs/btrfs/disk-io.c | 16 +++++++++------- fs/btrfs/print-tree.c | 4 ++-- fs/btrfs/relocation.c | 4 ++-- 5 files changed, 34 insertions(+), 27 deletions(-) commit 8f8aa4c7a9bde010211484a9c0475846acfc399f Author: Josef Bacik Date: Wed Feb 23 14:06:46 2022 -0500 btrfs: factor out do_free_extent_accounting helper __btrfs_free_extent() does all of the hard work of updating the extent ref items, and then at the end if we dropped the extent completely it does the cleanup accounting work. We're going to only want to do that work for metadata with extent tree v2, so extract this bit into its own helper. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/extent-tree.c | 52 +++++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 22 deletions(-) commit 5b2a54bb7c47c10ab6d96311d46a76b4a84f0b6f Author: Josef Bacik Date: Wed Feb 23 14:06:45 2022 -0500 btrfs: remove last_ref from the extent freeing code This is a remnant of the work I did for qgroups a long time ago to only run for a block when we had dropped the last ref. We haven't done that for years, but the code remains. Drop this remnant. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/extent-tree.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) commit 3466670558d70b30238bbef5fa0267bc6301b8db Author: Josef Bacik Date: Wed Feb 23 14:06:44 2022 -0500 btrfs: add a alloc_reserved_extent helper We duplicate this logic for both data and metadata, at this point we've already done our type specific extent root operations, this is just doing the accounting and removing the space from the free space tree. Extract this common logic out into a helper. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/extent-tree.c | 56 ++++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 32 deletions(-) commit b3c958a3694eb8280de9ee3b241ced03bce5ad5f Author: Josef Bacik Date: Wed Feb 23 14:06:43 2022 -0500 btrfs: remove BUG_ON(ret) in alloc_reserved_tree_block Switch this to an ASSERT() and return the error in the normal case. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/extent-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 313ab75399d0c7d0ebc718c545572c1b4d8d22ef Author: Filipe Manana Date: Mon Feb 28 16:29:29 2022 +0000 btrfs: add and use helper for unlinking inode during log replay During log replay there is this pattern of running delayed items after every inode unlink. To avoid repeating this several times, move the logic into an helper function and use it instead of calling btrfs_unlink_inode() followed by btrfs_run_delayed_items(). Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 77 ++++++++++++++++++++--------------------------------- 1 file changed, 29 insertions(+), 48 deletions(-) commit 06bae876634ebf837ba70ea3de532b288326103d Author: Niels Dossche Date: Fri Feb 25 22:20:28 2022 +0100 btrfs: extend locking to all space_info members accesses bytes_pinned is always accessed under space_info->lock, except in btrfs_preempt_reclaim_metadata_space, however the other members are accessed under that lock. The reserved member of the rsv's are also partially accessed under a lock and partially not. Move all these accesses into the same lock to ensure consistency. This could potentially race and lead to a flush instead of a commit but it's not a big problem as it's only for preemptive flush. CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Johannes Thumshirn Reviewed-by: Josef Bacik Signed-off-by: Niels Dossche Signed-off-by: Niels Dossche Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/space-info.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit ca5e4ea0beaec8bc674121838bf8614c089effb9 Author: Naohiro Aota Date: Fri Feb 18 13:14:19 2022 +0900 btrfs: zoned: mark relocation as writing There is a hung_task issue with running generic/068 on an SMR device. The hang occurs while a process is trying to thaw the filesystem. The process is trying to take sb->s_umount to thaw the FS. The lock is held by fsstress, which calls btrfs_sync_fs() and is waiting for an ordered extent to finish. However, as the FS is frozen, the ordered extents never finish. Having an ordered extent while the FS is frozen is the root cause of the hang. The ordered extent is initiated from btrfs_relocate_chunk() which is called from btrfs_reclaim_bgs_work(). This commit adds sb_*_write() around btrfs_relocate_chunk() call site. For the usual "btrfs balance" command, we already call it with mnt_want_file() in btrfs_ioctl_balance(). Fixes: 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones") CC: stable@vger.kernel.org # 5.13+ Link: https://github.com/naota/linux/issues/56 Reviewed-by: Johannes Thumshirn Signed-off-by: Naohiro Aota Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/block-group.c | 8 +++++++- fs/btrfs/volumes.c | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) commit 9f5710bbfd3031dd7ce244fa26fba896d35f5342 Author: Josef Bacik Date: Fri Feb 18 09:38:14 2022 -0500 fs: allow cross-vfsmount reflink/dedupe Currently we disallow reflink and dedupe if the two files aren't on the same vfsmount. However we really only need to disallow it if they're not on the same super block. It is very common for btrfs to have a main subvolume that is mounted and then different subvolumes mounted at different locations. It's allowed to reflink between these volumes, but the vfsmount check disallows this. Instead fix dedupe to check for the same superblock, and simply remove the vfsmount check for reflink as it already does the superblock check. Reviewed-by: Darrick J. Wong Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/ioctl.c | 4 ---- fs/remap_range.c | 7 +------ 2 files changed, 1 insertion(+), 10 deletions(-) commit ae460f058e9ff31946cc393bf897fc44483f0876 Author: Josef Bacik Date: Fri Feb 18 09:38:13 2022 -0500 btrfs: remove the cross file system checks from remap The sb check is already done in do_clone_file_range, and the mnt check (which will hopefully go away in a subsequent patch) is done in ioctl_file_clone(). Remove the check in our code and put an ASSERT() to make sure it doesn't change underneath us. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/reflink.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 7eefae6bb1ddeba1df02acd5c6bb6b7c8e0f34d1 Author: Josef Bacik Date: Fri Feb 18 14:56:12 2022 -0500 btrfs: pass btrfs_fs_info to btrfs_recover_relocation We don't need a root here, we just need the btrfs_fs_info, we can just get the specific roots we need from fs_info. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 2 +- fs/btrfs/relocation.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) commit 33c44184991ec38e637cc4021e3b5e7d2288cea5 Author: Josef Bacik Date: Fri Feb 18 14:56:11 2022 -0500 btrfs: pass btrfs_fs_info for deleting snapshots and cleaner We're passing a root around here, but we only really need the fs_info, so fix up btrfs_clean_one_deleted_snapshot() to take an fs_info instead, and then fix up all the callers appropriately. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/disk-io.c | 7 +++---- fs/btrfs/transaction.c | 4 ++-- fs/btrfs/transaction.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) commit c067da87815657779115b8eae01c514458e4dfd2 Author: Sweet Tea Dorminy Date: Wed Feb 23 14:38:06 2022 -0500 btrfs: add filesystems state details to error messages When a filesystem goes read-only due to an error, multiple errors tend to be reported, some of which are knock-on failures. Logging fs_states, in btrfs_handle_fs_error() and btrfs_printk() helps distinguish the first error from subsequent messages which may only exist due to an error state. Under the new format, most initial errors will look like: `BTRFS: error (device loop0) in ...` while subsequent errors will begin with: `error (device loop0: state E) in ...` An initial transaction abort error will look like `error (device loop0: state A) in ...` and subsequent messages will contain `(device loop0: state EA) in ...` In addition to the error states we can also print other states that are temporary, like remounting, device replace, or indicate a global state that may affect functionality. Now implemented: E - filesystem error detected A - transaction aborted L - log tree errors M - remounting in progress R - device replace in progress C - data checksums not verified (mounted with ignoredatacsums) Signed-off-by: Sweet Tea Dorminy Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/ctree.h | 2 ++ fs/btrfs/super.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 62 insertions(+), 8 deletions(-) commit b2d9f2dc019fb739b8c0765ddcc184c31f7ae54b Author: Filipe Manana Date: Thu Feb 17 12:12:08 2022 +0000 btrfs: deal with unexpected extent type during reflinking Smatch complains about a possible dereference of a pointer that was not initialized: CC [M] fs/btrfs/reflink.o CHECK fs/btrfs/reflink.c fs/btrfs/reflink.c:533 btrfs_clone() error: potentially dereferencing uninitialized 'trans'. This is because we are not dealing with the case where the type of a file extent has an unexpected value (not regular, not prealloc and not inline), in which case the transaction handle pointer is not initialized. Such unexpected type should be impossible, except in case of some memory corruption caused either by bad hardware or some software bug causing something like a buffer overrun. So ASSERT that if the extent type is neither regular nor prealloc, then it must be inline. Bail out with -EUCLEAN and a warning in case it is not. This silences smatch. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/reflink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 1f4613cdbe7739ce291554b316bff8e551383389 Author: Filipe Manana Date: Thu Feb 17 12:12:07 2022 +0000 btrfs: fix unexpected error path when reflinking an inline extent When reflinking an inline extent, we assert that its file offset is 0 and that its uncompressed length is not greater than the sector size. We then return an error if one of those conditions is not satisfied. However we use a return statement, which results in returning from btrfs_clone() without freeing the path and buffer that were allocated before, as well as not clearing the flag BTRFS_INODE_NO_DELALLOC_FLUSH for the destination inode. Fix that by jumping to the 'out' label instead, and also add a WARN_ON() for each condition so that in case assertions are disabled, we get to known which of the unexpected conditions triggered the error. Fixes: a61e1e0df9f321 ("Btrfs: simplify inline extent handling when doing reflinks") Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/reflink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 23e3337faf73e5bb2610697977e175313d48acb0 Author: Filipe Manana Date: Thu Feb 17 12:12:06 2022 +0000 btrfs: reset last_reflink_trans after fsyncing inode When an inode has a last_reflink_trans matching the current transaction, we have to take special care when logging its checksums in order to avoid getting checksum items with overlapping ranges in a log tree, which could result in missing checksums after log replay (more on that in the changelogs of commit 40e046acbd2f36 ("Btrfs: fix missing data checksums after replaying a log tree") and commit e289f03ea79bbc ("btrfs: fix corrupt log due to concurrent fsync of inodes with shared extents")). We also need to make sure a full fsync will copy all old file extent items it finds in modified leaves, because they might have been copied from some other inode. However once we fsync an inode, we don't need to keep paying the price of that extra special care in future fsyncs done in the same transaction, unless the inode is used for another reflink operation or the full sync flag is set on it (truncate, failure to allocate extent maps for holes, and other exceptional and infrequent cases). So after we fsync an inode reset its last_unlink_trans to zero. In case another reflink happens, we continue to update the last_reflink_trans of the inode, just as before. Also set last_reflink_trans to the generation of the last transaction that modified the inode whenever we need to set the full sync flag on the inode, just like when we need to load an inode from disk after eviction. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/btrfs_inode.h | 30 ++++++++++++++++++++++++++++++ fs/btrfs/file.c | 7 +++---- fs/btrfs/inode.c | 12 +++++------- fs/btrfs/reflink.c | 5 ++--- fs/btrfs/tree-log.c | 8 ++++++++ 5 files changed, 48 insertions(+), 14 deletions(-) commit 96acb3753e0740e0a3148640927dcf3249f09f5d Author: Filipe Manana Date: Thu Feb 17 12:12:05 2022 +0000 btrfs: voluntarily relinquish cpu when doing a full fsync Doing a full fsync may require processing many leaves of metadata, which can take some time and result in a task monopolizing a cpu for too long. So add a cond_resched() after processing a leaf when doing a full fsync, while not holding any locks on any tree (a subvolume or a log tree). Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 5b7ce5e287f030d1d3c799abea769b1a308067ba Author: Filipe Manana Date: Thu Feb 17 12:12:04 2022 +0000 btrfs: hold on to less memory when logging checksums during full fsync When doing a full fsync, at copy_items(), we iterate over all extents and then collect their checksums into a list. After copying all the extents to the log tree, we then log all the previously collected checksums. Before the previous patch in the series (subject "btrfs: stop copying old file extents when doing a full fsync"), we had to do it this way, because while we were iterating over the items in the leaf of the subvolume tree, we were holding a write lock on a leaf of the log tree, so logging the checksums for an extent right after we collected them could result in a deadlock, in case the checksum items ended up in the same leaf. However after the previous patch in the series we now do a first iteration over all the items in the leaf of the subvolume tree before locking a path in the log tree, so we can now log the checksums right after we have obtained them. This avoids holding in memory all checksums for all extents in the leaf while copying items from the source leaf to the log tree. The amount of memory used to hold all checksums of the extents in a leaf can be significant. For example if a leaf has 200 file extent items referring to 1M extents, using the default crc32c checksums, would result in using over 200K of memory (not accounting for the extra overhead of struct btrfs_ordered_sum), with smaller or less extents it would be less, but it could be much more with more extents per leaf and/or much larger extents. So change copy_items() to log the checksums for an extent after looking them up, and then free their memory, as they are no longer necessary. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) commit 7f30c07288bb9e20463182d0db56416025f85e08 Author: Filipe Manana Date: Thu Feb 17 12:12:03 2022 +0000 btrfs: stop copying old file extents when doing a full fsync When logging an inode in full sync mode, we go over every leaf that was modified in the current transaction and has items associated to our inode, and then copy all those items into the log tree. This includes copying file extent items that were created and added to the inode in past transactions, which is useless and only makes use more leaf space in the log tree. It's common to have a file with many file extent items spanning many leaves where only a few file extent items are new and need to be logged, and in such case we log all the file extent items we find in the modified leaves. So change the full sync behaviour to skip over file extent items that are not needed. Those are the ones that match the following criteria: 1) Have a generation older than the current transaction and the inode was not a target of a reflink operation, as that can copy file extent items from a past generation from some other inode into our inode, so we have to log them; 2) Start at an offset within i_size - we must log anything at or beyond i_size, otherwise we would lose prealloc extents after log replay. The following script exercises a scenario where this happens, and it's somehow close enough to what happened often on a SQL Server workload which I had to debug sometime ago to fix an issue where a pattern of writes to prealloc extents and fsync resulted in fsync failing with -EIO (that was commit ea7036de0d36c4 ("btrfs: fix fsync failure and transaction abort after writes to prealloc extents")). In that particular case, we had large files that had random writes and were often truncated, which made the next fsync be a full sync. $ cat test.sh #!/bin/bash DEV=/dev/sdi MNT=/mnt/sdi MKFS_OPTIONS="-O no-holes -R free-space-tree" MOUNT_OPTIONS="-o ssd" FILE_SIZE=$((1 * 1024 * 1024 * 1024)) # 1G # FILE_SIZE=$((2 * 1024 * 1024 * 1024)) # 2G # FILE_SIZE=$((512 * 1024 * 1024)) # 512M mkfs.btrfs -f $MKFS_OPTIONS $DEV mount $MOUNT_OPTIONS $DEV $MNT # Create a file with many extents. Use direct IO to make it faster # to create the file - using buffered IO we would have to fsync # after each write (terribly slow). echo "Creating file with $((FILE_SIZE / 4096)) extents of 4K each..." xfs_io -f -d -c "pwrite -b 4K 0 $FILE_SIZE" $MNT/foobar # Commit the transaction, so every extent after this is from an # old generation. sync # Now rewrite only a few extents, which are all far spread apart from # each other (e.g. 1G / 32M = 32 extents). # After this only a few extents have a new generation, while all other # ones have an old generation. echo "Rewriting $((FILE_SIZE / (32 * 1024 * 1024))) extents..." for ((i = 0; i < $FILE_SIZE; i += $((32 * 1024 * 1024)))); do xfs_io -c "pwrite $i 4K" $MNT/foobar >/dev/null done # Fsync, the inode logged in full sync mode since it was never fsynced # before. echo "Fsyncing file..." xfs_io -c "fsync" $MNT/foobar umount $MNT And the following bpftrace program was running when executing the test script: $ cat bpf-script.sh #!/usr/bin/bpftrace k:btrfs_log_inode { @start_log_inode[tid] = nsecs; } kr:btrfs_log_inode /@start_log_inode[tid]/ { @log_inode_dur[tid] = (nsecs - @start_log_inode[tid]) / 1000; delete(@start_log_inode[tid]); } k:btrfs_sync_log { @start_sync_log[tid] = nsecs; } kr:btrfs_sync_log /@start_sync_log[tid]/ { $sync_log_dur = (nsecs - @start_sync_log[tid]) / 1000; printf("btrfs_log_inode() took %llu us\n", @log_inode_dur[tid]); printf("btrfs_sync_log() took %llu us\n", $sync_log_dur); delete(@start_sync_log[tid]); delete(@log_inode_dur[tid]); exit(); } With 512M test file, before this patch: btrfs_log_inode() took 15218 us btrfs_sync_log() took 1328 us Log tree has 17 leaves and 1 node, its total size is 294912 bytes. With 512M test file, after this patch: btrfs_log_inode() took 14760 us btrfs_sync_log() took 588 us Log tree has a single leaf, its total size is 16K. With 1G test file, before this patch: btrfs_log_inode() took 27301 us btrfs_sync_log() took 1767 us Log tree has 33 leaves and 1 node, its total size is 557056 bytes. With 1G test file, after this patch: btrfs_log_inode() took 26166 us btrfs_sync_log() took 593 us Log tree has a single leaf, its total size is 16K With 2G test file, before this patch: btrfs_log_inode() took 50892 us btrfs_sync_log() took 3127 us Log tree has 65 leaves and 1 node, its total size is 1081344 bytes. With 2G test file, after this patch: btrfs_log_inode() took 50126 us btrfs_sync_log() took 586 us Log tree has a single leaf, its total size is 16K. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/reflink.c | 23 +++--- fs/btrfs/tree-log.c | 198 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 148 insertions(+), 73 deletions(-) commit 8cbc3001a3264d998d6b6db3e23f935c158abd4d Author: Josef Bacik Date: Fri Feb 18 10:03:29 2022 -0500 btrfs: do not clean up repair bio if submit fails The submit helper will always run bio_endio() on the bio if it fails to submit, so cleaning up the bio just leads to a variety of use-after-free and NULL pointer dereference bugs because we race with the endio function that is cleaning up the bio. Instead just return BLK_STS_OK as the repair function has to continue to process the rest of the pages, and the endio for the repair bio will do the appropriate cleanup for the page that it was given. Reviewed-by: Boris Burkov Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/extent_io.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) commit 510671d2d83668b76c08baec5faa2319ceaffd62 Author: Josef Bacik Date: Fri Feb 18 10:03:28 2022 -0500 btrfs: do not try to repair bio that has no mirror set If we fail to submit a bio for whatever reason, we may not have setup a mirror_num for that bio. This means we shouldn't try to do the repair workflow, if we do we'll hit an BUG_ON(!failrec->this_mirror) in clean_io_failure. Instead simply skip the repair workflow if we have no mirror set, and add an assert to btrfs_check_repairable() to make it easier to catch what is happening in the future. Reviewed-by: Boris Burkov Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/extent_io.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit f9f15de85d74e7eef021af059ca53a15f041cdd8 Author: Josef Bacik Date: Fri Feb 18 10:03:27 2022 -0500 btrfs: do not double complete bio on errors during compressed reads I hit some weird panics while fixing up the error handling from btrfs_lookup_bio_sums(). Turns out the compression path will complete the bio we use if we set up any of the compression bios and then return an error, and then btrfs_submit_data_bio() will also call bio_endio() on the bio. Fix this by making btrfs_submit_compressed_read() responsible for calling bio_endio() on the bio if there are any errors. Currently it was only doing it if we created the compression bios, otherwise it was depending on btrfs_submit_data_bio() to do the right thing. This creates the above problem, so fix up btrfs_submit_compressed_read() to always call bio_endio() in case of an error, and then simply return from btrfs_submit_data_bio() if we had to call btrfs_submit_compressed_read(). Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/compression.c | 20 ++++++++++++++------ fs/btrfs/inode.c | 8 +++++++- 2 files changed, 21 insertions(+), 7 deletions(-) commit 606f82e797e26013c80d25790639587a5d4dfbb7 Author: Josef Bacik Date: Fri Feb 18 10:03:26 2022 -0500 btrfs: track compressed bio errors as blk_status_t Right now we just have a binary "errors" flag, so any error we get on the compressed bio's gets translated to EIO. This isn't necessarily a bad thing, but if we get an ENOMEM it may be nice to know that's what happened instead of an EIO. Track our errors as a blk_status_t, and do the appropriate setting of the errors accordingly. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/compression.c | 24 +++++++++++++----------- fs/btrfs/compression.h | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) commit e14bfdb5a1f5fbb0a45f64a763c8da00637072d1 Author: Josef Bacik Date: Fri Feb 18 10:03:25 2022 -0500 btrfs: remove the bio argument from finish_compressed_bio_read This bio is usually one of the compressed bio's, and we don't actually need it in this function, so remove the argument and stop passing it around. Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/compression.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit b0bbc8a3d49371a13ef9a5ff54fe2edfb4fb02d7 Author: Josef Bacik Date: Fri Feb 18 10:03:24 2022 -0500 btrfs: check correct bio in finish_compressed_bio_read Commit c09abff87f90 ("btrfs: cloned bios must not be iterated by bio_for_each_segment_all") added ASSERT()'s to make sure we weren't calling bio_for_each_segment_all() on a RAID5/6 bio. However it was checking the bio that the compression code passed in, not the cb->orig_bio that we actually iterate over, so adjust this ASSERT() to check the correct bio. Reviewed-by: Boris Burkov Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/compression.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1784b7d502a94b561eae58249adde5f72c26eb3c Author: Josef Bacik Date: Fri Feb 18 10:03:23 2022 -0500 btrfs: handle csum lookup errors properly on reads Currently any error we get while trying to lookup csums during reads shows up as a missing csum, and then on the read completion side we print an error saying there was a csum mismatch and we increase the device corruption count. However we could have gotten an EIO from the lookup. We could also be inside of a memory constrained container and gotten a ENOMEM while trying to do the read. In either case we don't want to make this look like a file system corruption problem, we want to make it look like the actual error it is. Capture any negative value, convert it to the appropriate blk_status_t, free the csum array if we have one and bail. Note: a possible improvement would be to make the relocation code look up the owning inode and see if it's marked as NODATASUM and set EXTENT_NODATASUM there, that way if there's corruption and there isn't a checksum when we want it we can fail here rather than later. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/file-item.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) commit 03ddb19d2ea745228879b9334f3b550c88acb10a Author: Josef Bacik Date: Fri Feb 18 10:03:22 2022 -0500 btrfs: make search_csum_tree return 0 if we get -EFBIG We can either fail to find a csum entry at all and return -ENOENT, or we can find a range that is close, but return -EFBIG. In essence these both mean the same thing when we are doing a lookup for a csum in an existing range, we didn't find a csum. We want to treat both of these errors the same way, complain loudly that there wasn't a csum. This currently happens anyway because we do count = search_csum_tree(); if (count <= 0) { // reloc and error handling } However it forces us to incorrectly treat EIO or ENOMEM errors as on disk corruption. Fix this by returning 0 if we get either -ENOENT or -EFBIG from btrfs_lookup_csum() so we can do proper error handling. Reviewed-by: Boris Burkov Reviewed-by: Johannes Thumshirn Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/file-item.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7c0c7269f7b508ba6e4b063a9314d6bd1fb6db22 Author: Omar Sandoval Date: Tue Aug 13 16:00:02 2019 -0700 btrfs: add BTRFS_IOC_ENCODED_WRITE The implementation resembles direct I/O: we have to flush any ordered extents, invalidate the page cache, and do the io tree/delalloc/extent map/ordered extent dance. From there, we can reuse the compression code with a minor modification to distinguish the write from writeback. This also creates inline extents when possible. Signed-off-by: Omar Sandoval Signed-off-by: David Sterba fs/btrfs/compression.c | 7 +- fs/btrfs/compression.h | 6 +- fs/btrfs/ctree.h | 4 + fs/btrfs/file.c | 64 ++++++++++--- fs/btrfs/inode.c | 249 +++++++++++++++++++++++++++++++++++++++++++++++- fs/btrfs/ioctl.c | 106 +++++++++++++++++++++ fs/btrfs/ordered-data.c | 12 ++- fs/btrfs/ordered-data.h | 5 +- 8 files changed, 433 insertions(+), 20 deletions(-) commit 1881fba89bd5dcd364d2e1bf561912a90a11c21a Author: Omar Sandoval Date: Wed Oct 9 17:59:07 2019 -0700 btrfs: add BTRFS_IOC_ENCODED_READ ioctl There are 4 main cases: 1. Inline extents: we copy the data straight out of the extent buffer. 2. Hole/preallocated extents: we fill in zeroes. 3. Regular, uncompressed extents: we read the sectors we need directly from disk. 4. Regular, compressed extents: we read the entire compressed extent from disk and indicate what subset of the decompressed extent is in the file. This initial implementation simplifies a few things that can be improved in the future: - Cases 1, 3, and 4 allocate temporary memory to read into before copying out to userspace. - We don't do read repair, because it turns out that read repair is currently broken for compressed data. - We hold the inode lock during the operation. Note that we don't need to hold the mmap lock. We may race with btrfs_page_mkwrite() and read the old data from before the page was dirtied: btrfs_page_mkwrite btrfs_encoded_read --------------------------------------------------- (enter) (enter) btrfs_wait_ordered_range lock_extent_bits btrfs_page_set_dirty unlock_extent_cached (exit) lock_extent_bits read extent (dirty page hasn't been flushed, so this is the old data) unlock_extent_cached (exit) we read the old data from before the page was dirtied. But, that's true even if we were to hold the mmap lock: btrfs_page_mkwrite btrfs_encoded_read ------------------------------------------------------------------- (enter) (enter) btrfs_inode_lock(BTRFS_ILOCK_MMAP) down_read(i_mmap_lock) (blocked) btrfs_wait_ordered_range lock_extent_bits read extent (page hasn't been dirtied, so this is the old data) unlock_extent_cached btrfs_inode_unlock(BTRFS_ILOCK_MMAP) down_read(i_mmap_lock) returns lock_extent_bits btrfs_page_set_dirty unlock_extent_cached In other words, this is inherently racy, so it's fine that we return the old data in this tiny window. Signed-off-by: Omar Sandoval Signed-off-by: David Sterba fs/btrfs/ctree.h | 4 + fs/btrfs/inode.c | 498 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ fs/btrfs/ioctl.c | 106 ++++++++++++ 3 files changed, 608 insertions(+) commit dcb77a9ae87dc1ae2c54ea2e629da357e694b664 Author: Omar Sandoval Date: Mon Aug 16 15:58:29 2021 -0700 btrfs: add definitions and documentation for encoded I/O ioctls In order to allow sending and receiving compressed data without decompressing it, we need an interface to write pre-compressed data directly to the filesystem and the matching interface to read compressed data without decompressing it. This adds the definitions for ioctls to do that and detailed explanations of how to use them. Reviewed-by: Nikolay Borisov Signed-off-by: Omar Sandoval Signed-off-by: David Sterba include/uapi/linux/btrfs.h | 132 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) commit d9496e8aba491e6c4c1c1c3549a93839ffd9b5a4 Author: Omar Sandoval Date: Thu Nov 7 15:19:16 2019 -0800 btrfs: optionally extend i_size in cow_file_range_inline() Currently, an inline extent is always created after i_size is extended from btrfs_dirty_pages(). However, for encoded writes, we only want to update i_size after we successfully created the inline extent. Add an update_i_size parameter to cow_file_range_inline() and insert_inline_extent() and pass in the size of the extent rather than determining it from i_size. Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval Reviewed-by: David Sterba [ reformat comment ] Signed-off-by: David Sterba fs/btrfs/inode.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) commit 8dd9872d2e261196069ab03d5dc5e6ec9bc93f4b Author: Omar Sandoval Date: Tue Nov 16 14:03:45 2021 -0800 btrfs: clean up cow_file_range_inline() The start parameter to cow_file_range_inline() (and insert_inline_extent()) is always 0, so get rid of it and simplify the logic in those two functions. Pass btrfs_inode to insert_inline_extent() and remove the redundant root parameter. Also document the requirements for creating an inline extent. No functional change. Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/inode.c | 87 ++++++++++++++++++++++++-------------------------------- 1 file changed, 37 insertions(+), 50 deletions(-) commit 28c9b1e75aa1794897a9cb709f20f27f4aadebac Author: Omar Sandoval Date: Mon Nov 18 22:45:55 2019 -0800 btrfs: support different disk extent size for delalloc Currently, we always reserve the same extent size in the file and extent size on disk for delalloc because the former is the worst case for the latter. For BTRFS_IOC_ENCODED_WRITE writes, we know the exact size of the extent on disk, which may be less than or greater than (for bookends) the size in the file. Add a disk_num_bytes parameter to btrfs_delalloc_reserve_metadata() so that we can reserve the correct amount of csum bytes. No functional change. Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/ctree.h | 3 ++- fs/btrfs/delalloc-space.c | 18 ++++++++++-------- fs/btrfs/file.c | 3 ++- fs/btrfs/inode.c | 4 ++-- fs/btrfs/relocation.c | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) commit cb36a9bb17c4abf720123dacd449408588247005 Author: Omar Sandoval Date: Wed Nov 6 12:11:56 2019 -0800 btrfs: add ram_bytes and offset to btrfs_ordered_extent Currently, we only create ordered extents when ram_bytes == num_bytes and offset == 0. However, BTRFS_IOC_ENCODED_WRITE writes may create extents which only refer to a subset of the full unencoded extent, so we need to plumb these fields through the ordered extent infrastructure and pass them down to insert_reserved_file_extent(). Since we're changing the btrfs_add_ordered_extent* signature, let's get rid of the trivial wrappers and add a kernel-doc. Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/inode.c | 58 +++++++++++++---------- fs/btrfs/ordered-data.c | 120 ++++++++++++++---------------------------------- fs/btrfs/ordered-data.h | 22 +++++---- 3 files changed, 83 insertions(+), 117 deletions(-) commit e331f6b19f8adde2307588bb325ae5de78617c20 Author: Omar Sandoval Date: Wed Nov 6 15:38:43 2019 -0800 btrfs: don't advance offset for compressed bios in btrfs_csum_one_bio() btrfs_csum_one_bio() loops over each filesystem block in the bio while keeping a cursor of its current logical position in the file in order to look up the ordered extent to add the checksums to. However, this doesn't make much sense for compressed extents, as a sector on disk does not correspond to a sector of decompressed file data. It happens to work because: 1) the compressed bio always covers one ordered extent 2) the size of the bio is always less than the size of the ordered extent However, the second point will not always be true for encoded writes. Let's add a boolean parameter to btrfs_csum_one_bio() to indicate that it can assume that the bio only covers one ordered extent. Since we're already changing the signature, let's get rid of the contig parameter and make it implied by the offset parameter, similar to the change we recently made to btrfs_lookup_bio_sums(). Additionally, let's rename nr_sectors to blockcount to make it clear that it's the number of filesystem blocks, not the number of 512-byte sectors. Reviewed-by: Josef Bacik Reviewed-by: Nikolay Borisov Signed-off-by: Omar Sandoval Signed-off-by: David Sterba fs/btrfs/compression.c | 2 +- fs/btrfs/ctree.h | 2 +- fs/btrfs/file-item.c | 37 +++++++++++++++++-------------------- fs/btrfs/inode.c | 8 ++++---- 4 files changed, 23 insertions(+), 26 deletions(-) commit f6f7a25a650818c61defa97d60a79b216618315f Author: Omar Sandoval Date: Thu Aug 12 15:34:57 2021 -0700 fs: export variant of generic_write_checks without iov_iter Encoded I/O in Btrfs needs to check a write with a given logical size without an iov_iter that matches that size (because the iov_iter we have is for the compressed data). So, factor out the parts of generic_write_check() that don't need an iov_iter into a new generic_write_checks_count() function and export that. Reviewed-by: Nikolay Borisov Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba fs/read_write.c | 33 ++++++++++++++++++++------------- include/linux/fs.h | 1 + 2 files changed, 21 insertions(+), 13 deletions(-) commit 871129332d74c9e94bd110932ac4445833995639 Author: Omar Sandoval Date: Wed Sep 4 12:13:25 2019 -0700 fs: export rw_verify_area() I'm adding btrfs ioctls to read and write compressed data, and rather than duplicating the checks in rw_verify_area(), let's just export it. Reviewed-by: Josef Bacik Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba fs/internal.h | 5 ----- fs/read_write.c | 1 + include/linux/fs.h | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) commit 457b0a3d6e266f40a367205e224b971e4da7f5f8 Author: Sidong Yang Date: Fri Feb 11 13:48:29 2022 +0000 btrfs: qgroup: remove outdated TODO comments These comments are old, outdated and not very specific. It seems that it doesn't help to inspire anybody to work on that. So we remove them. Reviewed-by: Qu Wenruo Signed-off-by: Sidong Yang Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/qgroup.c | 12 ------------ 1 file changed, 12 deletions(-) commit a8f6f619e44402f7005da79470835b98dc88450f Author: Sidong Yang Date: Sun Feb 6 12:52:48 2022 +0000 btrfs: qgroup: remove duplicated check in adding qgroup relations Removes duplicated check when adding qgroup relations. btrfs_add_qgroup_relations function adds relations by calling add_relation_rb(). add_relation_rb() checks that member/parentid exists in current qgroup_tree. But it already checked before calling the function. It seems that we don't need to double check. Add new function __add_relation_rb() that adds relations with qgroup structures and makes old function use the new one. And it makes btrfs_add_qgroup_relation() function work without double checks by calling the new function. Signed-off-by: Sidong Yang Reviewed-by: David Sterba [ add comments ] Signed-off-by: David Sterba fs/btrfs/qgroup.c | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) commit dc4a4bdb3f22f9a97a59cdf3c6a1257435ff3700 Author: Dāvis Mosāns Date: Wed Feb 2 23:44:54 2022 +0200 btrfs: add lzo workspace buffer length constants It makes it more readable for length checking and is be used repeatedly. Signed-off-by: Dāvis Mosāns Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/lzo.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 40e7efe057ae7446915dc9d95bbfe4c6c7329d89 Author: Qu Wenruo Date: Tue Feb 8 13:31:19 2022 +0800 btrfs: populate extent_map::generation when reading from disk When btrfs_get_extent() tries to get some file extent from disk, it never populates extent_map::generation, leaving the value to be 0. On the other hand, for extent map generated by IO, it will get its generation properly set at finish_ordered_io() finish_ordered_io() |- unpin_extent_cache(gen = trans->transid) |- em->generation = gen; [CAUSE] Since extent_map::generation is mostly used by fsync code, and for fsync they only care about modified extents, which all have their em::generation > 0. Thus it's fine to not populate em read from disk for fsync. [CORNER CASE] However autodefrag also relies on em::generation to determine if one extent needs to be defragged. This unpopulated extent_map::generation can prevent the following autodefrag case from working: mkfs.btrfs -f $dev mount $dev $mnt -o autodefrag # initial write to queue the inode for autodefrag xfs_io -f -c "pwrite 0 4k" $mnt/file sync # Real fragmented write xfs_io -f -s -c "pwrite -b 4096 0 32k" $mnt/file sync echo "=== before autodefrag ===" xfs_io -c "fiemap -v" $mnt/file # Drop cache to force em to be read from disk echo 3 > /proc/sys/vm/drop_caches mount -o remount,commit=1 $mnt sleep 3 sync echo "=== After autodefrag ===" xfs_io -c "fiemap -v" $mnt/file umount $mnt The result looks like this: === before autodefrag === /mnt/btrfs/file: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..15]: 26672..26687 16 0x0 1: [16..31]: 26656..26671 16 0x0 2: [32..47]: 26640..26655 16 0x0 3: [48..63]: 26624..26639 16 0x1 === After autodefrag === /mnt/btrfs/file: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..15]: 26672..26687 16 0x0 1: [16..31]: 26656..26671 16 0x0 2: [32..47]: 26640..26655 16 0x0 3: [48..63]: 26624..26639 16 0x1 This fragmented 32K will not be defragged by autodefrag. [FIX] To make things less weird, just populate extent_map::generation when reading file extents from disk. This would make above fragmented extents to be properly defragged: == before autodefrag === /mnt/btrfs/file: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..15]: 26672..26687 16 0x0 1: [16..31]: 26656..26671 16 0x0 2: [32..47]: 26640..26655 16 0x0 3: [48..63]: 26624..26639 16 0x1 === After autodefrag === /mnt/btrfs/file: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..63]: 26688..26751 64 0x1 Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba fs/btrfs/file-item.c | 1 + 1 file changed, 1 insertion(+) commit 6d3b050efa079f5bc4d5e2a8f37f0dc0345a2096 Author: Filipe Manana Date: Thu Feb 3 15:36:45 2022 +0000 btrfs: assert we have a write lock when removing and replacing extent maps Removing or replacing an extent map requires holding a write lock on the extent map's tree. We currently do that everywhere, except in one of the self tests, where it's harmless since there's no concurrency. In order to catch possible races in the future, assert that we are holding a write lock on the extent map tree before removing or replacing an extent map in the tree, and update the self test to obtain a write lock before removing extent maps. Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/extent_map.c | 4 ++++ fs/btrfs/tests/extent-map-tests.c | 2 ++ 2 files changed, 6 insertions(+) commit ad3fc7946b1829213bbdbb2b9ad0d124b31ae4a7 Author: Filipe Manana Date: Thu Feb 3 15:36:44 2022 +0000 btrfs: remove no longer used counter when reading data page After commit 92082d40976ed0 ("btrfs: integrate page status update for data read path into begin/end_page_read"), the 'nr' counter at btrfs_do_readpage() is no longer used, we increment it but we never read from it. So just remove it. Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/extent_io.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit bbf0ea7ea3855b35a2ab0b8d0000ce06cc58e4bf Author: Filipe Manana Date: Thu Feb 3 15:36:43 2022 +0000 btrfs: fix lost error return value when reading a data page At btrfs_do_readpage(), if we get an error when trying to lookup for an extent map, we end up marking the page with the error bit, clearing the uptodate bit on it, and doing everything else that should be done. However we return success (0) to the caller, when we should return the error encoded in the extent map pointer. So fix that by returning the error encoded in the pointer. Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/extent_io.c | 1 + fs/btrfs/inode.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) commit c03475506e3e7fed2c428a953f1fcc01c04aabd5 Author: Filipe Manana Date: Thu Feb 3 15:36:42 2022 +0000 btrfs: stop checking for NULL return from btrfs_get_extent() At extent_io.c, in the read page and write page code paths, we are testing if the return value from btrfs_get_extent() can be NULL. However that is not possible, as btrfs_get_extent() always returns either an error pointer or a (non-NULL) pointer to an extent map structure. Everywhere else outside extent_io.c we never check for NULL, we always treat any returned value as a non-NULL pointer if it does not encode an error. So check only for the IS_ERR() case at extent_io.c. Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/extent_io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit e1f53ed874e2f242e7009c3123f9776c5aec61c3 Author: Filipe Manana Date: Thu Feb 3 14:55:50 2022 +0000 btrfs: prepare extents to be logged before locking a log tree path When we want to log an extent, in the fast fsync path, we obtain a path to the leaf that will hold the file extent item either through a deletion search, via btrfs_drop_extents(), or through an insertion search using btrfs_insert_empty_item(). After that we fill the file extent item's fields one by one directly on the leaf. Instead of doing that, we could prepare the file extent item before obtaining a btree path, and then copy the prepared extent item with a single operation once we get the path. This helps avoid some contention on the log tree, since we are holding write locks for longer than necessary, especially in the case where the path is obtained via btrfs_drop_extents() through a deletion search, which always keeps a write lock on the nodes at levels 1 and 2 (besides the leaf). This change does that, we prepare the file extent item that is going to be inserted before acquiring a path, and then copy it into a leaf using a single copy operation once we get a path. This change if part of a patchset that is comprised of the following patches: 1/6 btrfs: remove unnecessary leaf free space checks when pushing items 2/6 btrfs: avoid unnecessary COW of leaves when deleting items from a leaf 3/6 btrfs: avoid unnecessary computation when deleting items from a leaf 4/6 btrfs: remove constraint on number of visited leaves when replacing extents 5/6 btrfs: remove useless path release in the fast fsync path 6/6 btrfs: prepare extents to be logged before locking a log tree path The following test was run to measure the impact of the whole patchset: $ cat test.sh #!/bin/bash DEV=/dev/sdi MNT=/mnt/sdi MOUNT_OPTIONS="-o ssd" MKFS_OPTIONS="-R free-space-tree -O no-holes" NUM_JOBS=8 FILE_SIZE=128M RUN_TIME=200 cat < /tmp/fio-job.ini [writers] rw=randwrite fsync=1 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=sync filesize=$FILE_SIZE runtime=$RUN_TIME time_based directory=$MNT numjobs=$NUM_JOBS 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 The test ran inside a VM (8 cores, 32G of RAM) with the target disk mapping to a raw NVMe device, and using a non-debug kernel config (Debian's default config). Before the patchset: WRITE: bw=116MiB/s (122MB/s), 116MiB/s-116MiB/s (122MB/s-122MB/s), io=22.7GiB (24.4GB), run=200013-200013msec After the patchset: WRITE: bw=125MiB/s (131MB/s), 125MiB/s-125MiB/s (131MB/s-131MB/s), io=24.3GiB (26.1GB), run=200007-200007msec A 7.8% gain on throughput and +7.0% more IO done in the same period of time (200 seconds). Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 64 ++++++++++++++++++++++------------------------------- 1 file changed, 27 insertions(+), 37 deletions(-) commit d84575317078239ad2835bc42fb4d2d96ab51646 Author: Filipe Manana Date: Thu Feb 3 14:55:49 2022 +0000 btrfs: remove useless path release in the fast fsync path There's no point in calling btrfs_release_path() after finishing the loop that logs the modified extents, since log_one_extent() returns with the path released. In case the list of extents is empty, the path is already released, so there's no need for that case as well. So just remove that unnecessary btrfs_release_path() call. This change if part of a patchset that is comprised of the following patches: 1/6 btrfs: remove unnecessary leaf free space checks when pushing items 2/6 btrfs: avoid unnecessary COW of leaves when deleting items from a leaf 3/6 btrfs: avoid unnecessary computation when deleting items from a leaf 4/6 btrfs: remove constraint on number of visited leaves when replacing extents 5/6 btrfs: remove useless path release in the fast fsync path 6/6 btrfs: prepare extents to be logged before locking a log tree path The last patch in the series has some performance test result in its changelog. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 1 - 1 file changed, 1 deletion(-) commit 7ecb4c31e773ed6950c6eafcb28146908abab630 Author: Filipe Manana Date: Thu Feb 3 14:55:48 2022 +0000 btrfs: remove constraint on number of visited leaves when replacing extents At btrfs_drop_extents(), we try to replace a range of file extent items with a new file extent in a single btree search, to avoid the need to do a search for deletion, followed by a path release and followed by yet another search for insertion. When I originally added that optimization, in commit 1acae57b161ef1 ("Btrfs: faster file extent item replace operations"), I left a constraint to do the fast replace only if we visited a single leaf. That was because in the most common case we find all file extent items that need to be deleted (or trimmed) in a single leaf, however it can work for other common cases like when we need to delete a few file extent items located at the end of a leaf and a few more located at the beginning of the next leaf. The key for the new file extent item is greater than the key of any deleted or trimmed file extent item from previous leaves, so we are fine to use the last leaf that we found as long as we are holding a write lock on it - even if the new key ends up at slot 0, as if that's the case, the btree search has obtained a write lock on any upper nodes that need to have a key pointer updated. So removed the constraint that limits the optimization to the case where we visited only a single leaf. This change if part of a patchset that is comprised of the following patches: 1/6 btrfs: remove unnecessary leaf free space checks when pushing items 2/6 btrfs: avoid unnecessary COW of leaves when deleting items from a leaf 3/6 btrfs: avoid unnecessary computation when deleting items from a leaf 4/6 btrfs: remove constraint on number of visited leaves when replacing extents 5/6 btrfs: remove useless path release in the fast fsync path 6/6 btrfs: prepare extents to be logged before locking a log tree path The last patch in the series has some performance test result in its changelog. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/file.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 0cae23b66a5f42b8071f42757f13d87c90d3600b Author: Filipe Manana Date: Thu Feb 3 14:55:47 2022 +0000 btrfs: avoid unnecessary computation when deleting items from a leaf When deleting items from a leaf, we always compute the sum of the data sizes of the items that are going to be deleted. However we only use that sum when the last item to delete is behind the last item in the leaf. This unnecessarily wastes CPU time when we are deleting either the whole leaf or from some slot > 0 up to the last item in the leaf, and both of these cases are common (e.g. truncation operation, either as a result of truncate(2) or when logging inodes, deleting checksums after removing a large enough extent, etc). So compute only the sum of the data sizes if the last item to be deleted does not match the last item in the leaf. This change if part of a patchset that is comprised of the following patches: 1/6 btrfs: remove unnecessary leaf free space checks when pushing items 2/6 btrfs: avoid unnecessary COW of leaves when deleting items from a leaf 3/6 btrfs: avoid unnecessary computation when deleting items from a leaf 4/6 btrfs: remove constraint on number of visited leaves when replacing extents 5/6 btrfs: remove useless path release in the fast fsync path 6/6 btrfs: prepare extents to be logged before locking a log tree path The last patch in the series has some performance test result in its changelog. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/ctree.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) commit 7c4063d19efcdf1973bcf06f15493da4a18d5524 Author: Filipe Manana Date: Thu Feb 3 14:55:46 2022 +0000 btrfs: avoid unnecessary COW of leaves when deleting items from a leaf When we delete items from a leaf, if we end up with more than two thirds of unused leaf space, we try to delete the leaf by moving all its items into its left and right neighbour leaves. Sometimes that is not possible because there is not enough free space in the left and right leaves, and in that case we end up not deleting our leaf. The way we are doing this is not ideal and can be improved in the following ways: 1) When we call push_leaf_left(), we pass a value of 1 byte to the data size parameter of push_leaf_left(). This is not realistic value because no item can have a size less than 25 bytes, which is the size of struct btrfs_item. This means that means that if the left leaf has not enough free space to push any item, we end up COWing it even if we end up not changing its content at all. COWing that leaf means allocating a new metadata extent, marking it dirty and doing more IO when committing a transaction or when syncing a log tree. For a log tree case, it's particularly more important to avoid the useless COW operation, as more IO can imply a higher latency for an fsync operation. So instead of passing 1 as the minimum data size for push_leaf_left(), pass the size of the first item in our leaf, as we don't want to COW the left leaf if we can't at least push the first item of our leaf; 2) When we call push_leaf_right(), we also pass a value of 1 byte as the data size parameter of push_leaf_right(). Like the previous case, it will also result in COWing the right leaf even if we are not able to move any items into it, since there can't be any item with a size smaller than 25 bytes (the size of struct btrfs_item). So instead of passing 1 as the minimum data size to push_leaf_right(), pass a size that corresponds to the sum of the size of all the remaining items in our leaf. We are not interested in moving less than that, because if we do, we are not able to delete our leaf and we have COWed the right leaf for nothing. Plus, moving only some of the items of our leaf, it means an even less balanced tree. Just like the previous case, we want to avoid the useless COW of the right leaf, this way we don't have to spend time allocating one new metadata extent, and doing more IO when committing a transaction or syncing a log tree. For the log tree case it's specially more important because more IO can result in a higher latency for a fsync operation. So adjust the minimum data size passed to push_leaf_left() and push_leaf_right() as mentioned above. This change if part of a patchset that is comprised of the following patches: 1/6 btrfs: remove unnecessary leaf free space checks when pushing items 2/6 btrfs: avoid unnecessary COW of leaves when deleting items from a leaf 3/6 btrfs: avoid unnecessary computation when deleting items from a leaf 4/6 btrfs: remove constraint on number of visited leaves when replacing extents 5/6 btrfs: remove useless path release in the fast fsync path 6/6 btrfs: prepare extents to be logged before locking a log tree path Not being able to delete a leaf that became less than 1/3 full after deleting items from it is actually common. For example, for the fio test mentioned in the changelog of patch 6/6, we are only able to delete a leaf at btrfs_del_items() about 5.3% of the time, due to its left and right neighbour leaves not having enough free space to push all the remaining items into them. The last patch in the series has some performance test result in its changelog. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/ctree.c | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) commit b4e098a97f17de10e6773191669bc27870050941 Author: Filipe Manana Date: Thu Feb 3 14:55:45 2022 +0000 btrfs: remove unnecessary leaf free space checks when pushing items When trying to push items from a leaf into its left and right neighbours, we lock the left or right leaf, check if it has the required minimum free space, COW the leaf and then check again if it has the minimum required free space. This second check is pointless: 1) Most and foremost because it's not needed. We have a write lock on the leaf and on its parent node, so no one can come in and change either the pre-COW or post-COW version of the leaf for the whole duration of the push_leaf_left() and push_leaf_right() calls; 2) The call to btrfs_leaf_free_space() is not trivial, it has a fair amount of arithmetic operations and access to fields in the leaf's header and items, so it's not very cheap. So remove the duplicated free space checks. This change if part of a patchset that is comprised of the following patches: 1/6 btrfs: remove unnecessary leaf free space checks when pushing items 2/6 btrfs: avoid unnecessary COW of leaves when deleting items from a leaf 3/6 btrfs: avoid unnecessary computation when deleting items from a leaf 4/6 btrfs: remove constraint on number of visited leaves when replacing extents 5/6 btrfs: remove useless path release in the fast fsync path 6/6 btrfs: prepare extents to be logged before locking a log tree path The last patch in the series has some performance test result in its changelog. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/ctree.c | 12 ------------ 1 file changed, 12 deletions(-) commit 6b5b7a41d0704f2e3e864b0e4a2539beecefade6 Author: Johannes Thumshirn Date: Fri Feb 4 04:06:27 2022 -0800 btrfs: stop checking for NULL return from btrfs_get_extent_fiemap() In get_extent_skip_holes() we're checking the return of btrfs_get_extent_fiemap() for an error pointer or NULL, but btrfs_get_extent_fiemap() will never return NULL, only error pointers or a valid extent_map. The other caller of btrfs_get_extent_fiemap(), find_desired_extent(), correctly only checks for error-pointers. Reviewed-by: Filipe Manana Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/extent_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f716fa4798df82f858afb9876f6d2e9f37a0d5c7 Author: Pankaj Raghav Date: Fri Feb 4 13:00:22 2022 +0100 btrfs: zoned: remove redundant assignment in btrfs_check_zoned_mode Remove the redundant assignment to zone_info variable in btrfs_check_zoned_mode function. Reviewed-by: Johannes Thumshirn Signed-off-by: Pankaj Raghav Signed-off-by: David Sterba fs/btrfs/zoned.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit a55e65b80e318e8917faa781df9955549c6cdaff Author: David Sterba Date: Tue Feb 1 15:42:07 2022 +0100 btrfs: replace BUILD_BUG_ON by static_assert The static_assert introduced in 6bab69c65013 ("build_bug.h: add wrapper for _Static_assert") has been supported by compilers for a long time (gcc 4.6, clang 3.0) and can be used in header files. We don't need to put BUILD_BUG_ON to random functions but rather keep it next to the definition. The exception here is the UAPI header btrfs_tree.h that could be potentially included by userspace code and the static assert is not defined (nor used in any other header). Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba fs/btrfs/compression.h | 2 ++ fs/btrfs/ctree.h | 16 ++++++++-------- fs/btrfs/inode.c | 23 +++++++++-------------- fs/btrfs/ioctl.c | 5 +---- fs/btrfs/sysfs.c | 10 +++++----- 5 files changed, 25 insertions(+), 31 deletions(-) commit 265f7237dd258e1d4d0b3f84ffea92d7d1c08861 Author: Johannes Thumshirn Date: Wed Jan 26 05:46:23 2022 -0800 btrfs: zoned: allow DUP on meta-data block groups Allow creating or reading block-groups on a zoned device with DUP as a meta-data profile. This works because we're using the zoned_meta_io_lock and REQ_OP_WRITE operations for meta-data on zoned btrfs, so all writes to meta-data zones are aligned to the zone's write-pointer. Upon loading of the block-group, it is ensured both zones do have the same zone capacity and write-pointer offsets, so no extra machinery is needed to keep the write-pointers in sync for the meta-data zones. If this prerequisite is not met, loading of the block-group is refused. Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba fs/btrfs/zoned.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) commit dbfcc18f27218841ea326bd4072f18f3a165abc3 Author: Johannes Thumshirn Date: Wed Jan 26 05:46:22 2022 -0800 btrfs: zoned: prepare for allowing DUP on zoned Allow for a block-group to be placed on more than one physical zone. This is a preparation for allowing DUP profiles for meta-data on a zoned file-system. Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba fs/btrfs/zoned.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) commit 4dcbb8ab31c1292aea6a3f240e19523f633320c2 Author: Johannes Thumshirn Date: Wed Jan 26 05:46:21 2022 -0800 btrfs: zoned: make zone finishing multi stripe capable Currently finishing of a zone only works if the block group isn't spanning more than one zone. This limitation is purely artificial and can be easily expanded to block groups being places across multiple zones. This is a preparation for allowing DUP and later more complex block-group profiles on zoned btrfs. Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba fs/btrfs/zoned.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) commit f9a912a3c45f6c319c2bc11b5410ed1c0392eadd Author: Johannes Thumshirn Date: Wed Jan 26 05:46:20 2022 -0800 btrfs: zoned: make zone activation multi stripe capable Currently activation of a zone only works if the block group isn't spanning more than one zone. This limitation is purely artificial and can be easily expanded to block groups being places across multiple zones. This is a preparation for allowing DUP and later more complex block-group profiles on zoned btrfs. Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba fs/btrfs/zoned.c | 57 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 26 deletions(-) commit f7238e5094048f20ab6f92d7c2f5ec50fc247f26 Author: Josef Bacik Date: Wed Dec 15 15:40:08 2021 -0500 btrfs: add support for multiple global roots With extent tree v2 you will be able to create multiple csum, extent, and free space trees. They will be used based on the block group, which will now use the block_group_item->chunk_objectid to point to the set of global roots that it will use. When allocating new block groups we'll simply mod the gigabyte offset of the block group against the number of global roots we have and that will be the block groups global id. >From there we can take the bytenr that we're modifying in the respective tree, look up the block group and get that block groups corresponding global root id. From there we can get to the appropriate global root for that bytenr. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/block-group.c | 28 ++++++++++++++++++++++++-- fs/btrfs/block-group.h | 1 + fs/btrfs/ctree.h | 2 ++ fs/btrfs/disk-io.c | 50 +++++++++++++++++++++++++++++++++++++--------- fs/btrfs/free-space-tree.c | 2 ++ fs/btrfs/transaction.c | 15 ++++++++++++++ fs/btrfs/tree-checker.c | 21 +++++++++++++++++-- 7 files changed, 106 insertions(+), 13 deletions(-) commit 9c54e80ddc6bd89596a4046d451908700476fd14 Author: Josef Bacik Date: Wed Dec 15 15:40:07 2021 -0500 btrfs: add code to support the block group root This code adds the on disk structures for the block group root, which will hold the block group items for extent tree v2. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/ctree.h | 27 ++++++++++++++++++++++- fs/btrfs/disk-io.c | 49 +++++++++++++++++++++++++++++++++++------ fs/btrfs/disk-io.h | 2 ++ fs/btrfs/print-tree.c | 1 + include/trace/events/btrfs.h | 1 + include/uapi/linux/btrfs_tree.h | 3 +++ 6 files changed, 75 insertions(+), 8 deletions(-) commit bd676446c138882003e4d470a518c219f3184354 Author: Josef Bacik Date: Wed Dec 15 15:40:06 2021 -0500 btrfs: abstract out loading the tree root We're going to be adding more roots that need to be loaded from the super block, so abstract out the code to read the tree_root from the super block, and use this helper for the chunk root as well. This will make it simpler to load the new trees in the future. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/disk-io.c | 81 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 35 deletions(-) commit c2fa821cc9f9415f6c7fc2da920e833a78040ea7 Author: Josef Bacik Date: Wed Dec 15 15:40:05 2021 -0500 btrfs: tree-checker: don't fail on empty extent roots for extent tree v2 For extent tree v2 we can definitely have empty extent roots, so skip this particular check if we have that set. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/tree-checker.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit 63cd070decb15f540b15f2bc35ecad42dd9cf598 Author: Josef Bacik Date: Wed Dec 15 15:40:04 2021 -0500 btrfs: disable space cache related mount options for extent tree v2 We cannot fall back on the slow caching for extent tree v2, which means we can't just arbitrarily clear the free space trees at mount time. Furthermore we can't do v1 space cache with extent tree v2. Simply ignore these mount options for extent tree v2 as they aren't relevant. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/super.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) commit 813febdbe6c9f691d7a1a1c8f6a31bd6461a1ae0 Author: Josef Bacik Date: Wed Dec 15 15:40:03 2021 -0500 btrfs: disable snapshot creation/deletion for extent tree v2 When we stop tracking metadata blocks all of snapshotting will break, so disable it until I add the snapshot root and drop tree support. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/inode.c | 11 +++++++++-- fs/btrfs/ioctl.c | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) commit da32c6d5708b6858d8d2557b0034de1bfa51ee3c Author: Josef Bacik Date: Wed Dec 15 15:40:02 2021 -0500 btrfs: disable scrub for extent-tree-v2 Scrub depends on extent references for every block, and with extent tree v2 we won't have that, so disable scrub until we can add back the proper code to handle extent-tree-v2. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/ioctl.c | 5 +++++ 1 file changed, 5 insertions(+) commit ef3eccc19aa896fc6aea26b4b065dcccec1b6460 Author: Josef Bacik Date: Wed Dec 15 15:40:01 2021 -0500 btrfs: disable qgroups in extent tree v2 Backref lookups are going to be drastically different with extent tree v2, disable qgroups until we do the work to add this support for extent tree v2. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/qgroup.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 914a519b19e84dd5e4c3bf5a24cd892f64f0bdef Author: Josef Bacik Date: Wed Dec 15 15:40:00 2021 -0500 btrfs: disable device manipulation ioctl's EXTENT_TREE_V2 Device add, remove, and replace all require balance, which doesn't work right now on extent tree v2, so disable these for now. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/ioctl.c | 10 ++++++++++ fs/btrfs/volumes.c | 5 +++++ 2 files changed, 15 insertions(+) commit 4b3492539907ef53acb06bf0db02dbaaed2bf097 Author: Josef Bacik Date: Wed Dec 15 15:39:59 2021 -0500 btrfs: disable balance for extent tree v2 for now With global root id's it makes it problematic to do backref lookups for balance. This isn't hard to deal with, but future changes are going to make it impossible to lookup backrefs on any COWonly roots, so go ahead and disable balance for now on extent tree v2 until we can add balance support back in future patches. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/volumes.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 2c7d2a230237e7c43fa067d695937b7e484bb92a Author: Josef Bacik Date: Wed Dec 15 15:39:58 2021 -0500 btrfs: add definition for EXTENT_TREE_V2 This adds the initial definition of the EXTENT_TREE_V2 incompat feature flag. This also hides the support behind CONFIG_BTRFS_DEBUG. THIS IS A IN DEVELOPMENT FORMAT CHANGE, DO NOT USE UNLESS YOU ARE A DEVELOPER OR A TESTER. The format is in flux and will be added in stages, any fs will need to be re-made between updates to the format. Signed-off-by: Josef Bacik Signed-off-by: David Sterba fs/btrfs/ctree.h | 21 +++++++++++++++++++++ fs/btrfs/sysfs.c | 5 ++++- include/uapi/linux/btrfs.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) commit 65faced5b9ef67baaab681ffc4df870d51990357 Author: Filipe Manana Date: Thu Jan 20 11:00:11 2022 +0000 btrfs: use single variable to track return value at btrfs_log_inode() At btrfs_log_inode(), we have two variables to track errors and the return value of the function, named 'ret' and 'err'. In some places we use 'ret' and if gets a non-zero value we assign its value to 'err' and then jump to the 'out' label, while in other places we use 'err' directly without 'ret' as an intermediary. This is inconsistent, error prone and not necessary. So change that to use only the 'ret' variable, making this consistent with most functions in btrfs. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/tree-log.c | 52 ++++++++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 30 deletions(-) commit 0f8ce49821de3e99251d1a6849bfe5f2be1ecbea Author: Filipe Manana Date: Thu Jan 20 11:00:10 2022 +0000 btrfs: avoid inode logging during rename and link when possible During a rename or link operation, we need to determine if an inode was previously logged or not, and if it was, do some update to the logged inode. We used to rely exclusively on the logged_trans field of struct btrfs_inode to determine that, but that was not reliable because the value of that field is not persisted in the inode item, so it's lost when an inode is evicted and loaded back again. That led to several issues in the past, such as not persisting deletions (such as the case fixed by commit 803f0f64d17769 ("Btrfs: fix fsync not persisting dentry deletions due to inode evictions")), or resulting in losing a file after an inode eviction followed by a rename (commit ecc64fab7d49c6 ("btrfs: fix lost inode on log replay after mix of fsync, rename and inode eviction")), besides other issues. So the inode_logged() helper was introduced and used to determine if an inode was possibly logged before in the current transaction, with the caveat that it could return false positives, in the sense that even if an inode was not logged before in the current transaction, it could still return true, but never to return false in case the inode was logged. >From a functional point of view that is fine, but from a performance perspective it can introduce significant latencies to rename and link operations, as they will end up doing inode logging even when it is not necessary. Recently on a 5.15 kernel, an openSUSE Tumbleweed user reported package installations and upgrades, with the zypper tool, were often taking a long time to complete. With strace it could be observed that zypper was spending about 99% of its time on rename operations, and then with further analysis we checked that directory logging was happening too frequently. Taking into account that installation/upgrade of some of the packages needed a few thousand file renames, the slowdown was very noticeable for the user. The issue was caused indirectly due to an excessive number of inode evictions on a 5.15 kernel, about 100x more compared to a 5.13, 5.14 or a 5.16-rc8 kernel. While triggering the inode evictions if something outside btrfs' control, btrfs could still behave better by eliminating the false positives from the inode_logged() helper. So change inode_logged() to actually eliminate such false positives caused by inode eviction and when an inode was never logged since the filesystem was mounted, as both cases relate to when the logged_trans field of struct btrfs_inode has a value of zero. When it can not determine if the inode was logged based only on the logged_trans value, lookup for the existence of the inode item in the log tree - if it's there then we known the inode was logged, if it's not there then it can not have been logged in the current transaction. Once we determine if the inode was logged, update the logged_trans value to avoid future calls to have to search in the log tree again. Alternatively, we could start storing logged_trans in the on disk inode item structure (struct btrfs_inode_item) in the unused space it still has, but that would be a bit odd because: 1) We only care about logged_trans since the filesystem was mounted, we don't care about its value from a previous mount. Having it persisted in the inode item structure would not make the best use of the precious unused space; 2) In order to get logged_trans persisted before inode eviction, we would have to update the delayed inode when we finish logging the inode and update its logged_trans in struct btrfs_inode, which makes it a bit cumbersome since we need to check if the delayed inode exists, if not create it and populate it and deal with any errors (-ENOMEM mostly). This change is part of a patchset comprised of the following patches: 1/5 btrfs: add helper to delete a dir entry from a log tree 2/5 btrfs: pass the dentry to btrfs_log_new_name() instead of the inode 3/5 btrfs: avoid logging all directory changes during renames 4/5 btrfs: stop doing unnecessary log updates during a rename 5/5 btrfs: avoid inode logging during rename and link when possible The following test script mimics part of what the zypper tool does during package installations/upgrades. It does not triggers inode evictions, but it's similar because it triggers false positives from the inode_logged() helper, because the inodes have a logged_trans of 0, there's a log tree due to a fsync of an unrelated file and the directory inode has its last_trans field set to the current transaction: $ cat test.sh #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 NUM_FILES=10000 mkfs.btrfs -f $DEV mount $DEV $MNT mkdir $MNT/testdir for ((i = 1; i <= $NUM_FILES; i++)); do echo -n > $MNT/testdir/file_$i done sync # Now do some change to an unrelated file and fsync it. # This is just to create a log tree to make sure that inode_logged() # does not return false when called against "testdir". xfs_io -f -c "pwrite 0 4K" -c "fsync" $MNT/foo # Do some change to testdir. This is to make sure inode_logged() # will return true when called against "testdir", because its # logged_trans is 0, it was changed in the current transaction # and there's a log tree. echo -n > $MNT/testdir/file_$((NUM_FILES + 1)) echo "Renaming $NUM_FILES files..." start=$(date +%s%N) for ((i = 1; i <= $NUM_FILES; i++)); do mv $MNT/testdir/file_$i $MNT/testdir/file_$i-RPMDELETE done end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "Renames took $dur milliseconds" umount $MNT Testing this change on a box using a non-debug kernel (Debian's default kernel config) gave the following results: NUM_FILES=10000, before patchset: 27837 ms NUM_FILES=10000, after patches 1/5 to 4/5 applied: 9236 ms (-66.8%) NUM_FILES=10000, after whole patchset applied: 8902 ms (-68.0%) NUM_FILES=5000, before patchset: 9127 ms NUM_FILES=5000, after patches 1/5 to 4/5 applied: 4640 ms (-49.2%) NUM_FILES=5000, after whole patchset applied: 4441 ms (-51.3%) NUM_FILES=2000, before patchset: 2528 ms NUM_FILES=2000, after patches 1/5 to 4/5 applied: 1983 ms (-21.6%) NUM_FILES=2000, after whole patchset applied: 1747 ms (-30.9%) NUM_FILES=1000, before patchset: 1085 ms NUM_FILES=1000, after patches 1/5 to 4/5 applied: 893 ms (-17.7%) NUM_FILES=1000, after whole patchset applied: 867 ms (-20.1%) Running dbench on the same physical machine with the following script: $ cat run-dbench.sh #!/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 mkfs.btrfs -f $MKFS_OPTIONS $DEV mount $MOUNT_OPTIONS $DEV $MNT dbench -D $MNT -t 120 $NUM_JOBS umount $MNT Before patchset: Operation Count AvgLat MaxLat ---------------------------------------- NTCreateX 3761352 0.032 143.843 Close 2762770 0.002 2.273 Rename 159304 0.291 67.037 Unlink 759784 0.207 143.998 Deltree 72 4.028 15.977 Mkdir 36 0.003 0.006 Qpathinfo 3409780 0.013 9.678 Qfileinfo 596772 0.001 0.878 Qfsinfo 625189 0.003 1.245 Sfileinfo 306443 0.006 1.840 Find 1318106 0.063 19.798 WriteX 1871137 0.021 8.532 ReadX 5897325 0.003 3.567 LockX 12252 0.003 0.258 UnlockX 12252 0.002 0.100 Flush 263666 3.327 155.632 Throughput 980.047 MB/sec 12 clients 12 procs max_latency=155.636 ms After whole patchset applied: Operation Count AvgLat MaxLat ---------------------------------------- NTCreateX 4195584 0.033 107.742 Close 3081932 0.002 1.935 Rename 177641 0.218 14.905 Unlink 847333 0.166 107.822 Deltree 118 5.315 15.247 Mkdir 59 0.004 0.048 Qpathinfo 3802612 0.014 10.302 Qfileinfo 666748 0.001 1.034 Qfsinfo 697329 0.003 0.944 Sfileinfo 341712 0.006 2.099 Find 1470365 0.065 9.359 WriteX 2093921 0.021 8.087 ReadX 6576234 0.003 3.407 LockX 13660 0.003 0.308 UnlockX 13660 0.002 0.114 Flush 294090 2.906 115.539 Throughput 1093.11 MB/sec 12 clients 12 procs max_latency=115.544 ms +11.5% throughput -25.8% max latency rename max latency -77.8% Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1193549 Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 245 ++++++++++++++++++++++++++++++++++++++-------------- fs/btrfs/tree-log.h | 3 + 2 files changed, 183 insertions(+), 65 deletions(-) commit 259c4b96d78dda8477a3ac21d6b3cf0eb9f75c8b Author: Filipe Manana Date: Thu Jan 20 11:00:09 2022 +0000 btrfs: stop doing unnecessary log updates during a rename During a rename, we call __btrfs_unlink_inode(), which will call btrfs_del_inode_ref_in_log() and btrfs_del_dir_entries_in_log(), in order to remove an inode reference and a directory entry from the log. These are necessary when __btrfs_unlink_inode() is called from the unlink path, but not necessary when it's called from a rename context, because: 1) For the btrfs_del_inode_ref_in_log() call, it's pointless to delete the inode reference related to the old name, because later in the rename path we call btrfs_log_new_name(), which will drop all inode references from the log and copy all inode references from the subvolume tree to the log tree. So we are doing one unnecessary btree operation which adds additional latency and lock contention in case there are other tasks accessing the log tree; 2) For the btrfs_del_dir_entries_in_log() call, we are now doing the equivalent at btrfs_log_new_name() since the previous patch in the series, that has the subject "btrfs: avoid logging all directory changes during renames". In fact, having __btrfs_unlink_inode() call this function not only adds additional latency and lock contention due to the extra btree operation, but also can make btrfs_log_new_name() unnecessarily log a range item to track the deletion of the old name, since it has no way to known that the directory entry related to the old name was previously logged and already deleted by __btrfs_unlink_inode() through its call to btrfs_del_dir_entries_in_log(). So skip those calls at __btrfs_unlink_inode() when we are doing a rename. Skipping them also allows us now to reduce the duration of time we are pinning a log transaction during renames, which is always beneficial as it's not delaying so much other tasks trying to sync the log tree, in particular we end up not holding the log transaction pinned while adding the new name (adding inode ref, directory entry, etc). This change is part of a patchset comprised of the following patches: 1/5 btrfs: add helper to delete a dir entry from a log tree 2/5 btrfs: pass the dentry to btrfs_log_new_name() instead of the inode 3/5 btrfs: avoid logging all directory changes during renames 4/5 btrfs: stop doing unnecessary log updates during a rename 5/5 btrfs: avoid inode logging during rename and link when possible Just like the previous patch in the series, "btrfs: avoid logging all directory changes during renames", the following script mimics part of what a package installation/upgrade with zypper does, which is basically renaming a lot of files, in some directory under /usr, to a name with a suffix of "-RPMDELETE": $ cat test.sh #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 NUM_FILES=10000 mkfs.btrfs -f $DEV mount $DEV $MNT mkdir $MNT/testdir for ((i = 1; i <= $NUM_FILES; i++)); do echo -n > $MNT/testdir/file_$i done sync # Do some change to testdir and fsync it. echo -n > $MNT/testdir/file_$((NUM_FILES + 1)) xfs_io -c "fsync" $MNT/testdir echo "Renaming $NUM_FILES files..." start=$(date +%s%N) for ((i = 1; i <= $NUM_FILES; i++)); do mv $MNT/testdir/file_$i $MNT/testdir/file_$i-RPMDELETE done end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "Renames took $dur milliseconds" umount $MNT Testing this change on box a using a non-debug kernel (Debian's default kernel config) gave the following results: NUM_FILES=10000, before patchset: 27399 ms NUM_FILES=10000, after patches 1/5 to 3/5 applied: 9093 ms (-66.8%) NUM_FILES=10000, after patches 1/5 to 4/5 applied: 9016 ms (-67.1%) NUM_FILES=5000, before patchset: 9241 ms NUM_FILES=5000, after patches 1/5 to 3/5 applied: 4642 ms (-49.8%) NUM_FILES=5000, after patches 1/5 to 4/5 applied: 4553 ms (-50.7%) NUM_FILES=2000, before patchset: 2550 ms NUM_FILES=2000, after patches 1/5 to 3/5 applied: 1788 ms (-29.9%) NUM_FILES=2000, after patches 1/5 to 4/5 applied: 1767 ms (-30.7%) NUM_FILES=1000, before patchset: 1088 ms NUM_FILES=1000, after patches 1/5 to 3/5 applied: 905 ms (-16.9%) NUM_FILES=1000, after patches 1/5 to 4/5 applied: 883 ms (-18.8%) The next patch in the series (5/5), also contains dbench results after applying to whole patchset. Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1193549 Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/inode.c | 140 ++++++++++++---------------------------------------- fs/btrfs/tree-log.c | 34 ++++++++++--- 2 files changed, 59 insertions(+), 115 deletions(-) commit 88d2beec7e53fc500a5ac99beb254e6079d03543 Author: Filipe Manana Date: Thu Jan 20 11:00:08 2022 +0000 btrfs: avoid logging all directory changes during renames When doing a rename of a file, if the file or its old parent directory were logged before, we log the new name of the file and then make sure we log the old parent directory, to ensure that after a log replay the old name of the file is deleted and the new name added. The logging of the old parent directory can take some time, because it will scan all leaves modified in the current transaction, check which directory entries were already logged, copy the ones that were not logged before, etc. In this rename context all we need to do is make sure that the old name of the file is deleted on log replay, so instead of triggering a directory log operation, we can just delete the old directory entry from the log if it's there, or in case it isn't there, just log a range item to signal log replay that the old name must be deleted. So change btrfs_log_new_name() to do that. This scenario is actually not uncommon to trigger, and recently on a 5.15 kernel, an openSUSE Tumbleweed user reported package installations and upgrades, with the zypper tool, were often taking a long time to complete, much more than usual. With strace it could be observed that zypper was spending over 99% of its time on rename operations, and then with further analysis we checked that directory logging was happening too frequently and causing high latencies for the rename operations. Taking into account that installation/upgrade of some of these packages needed about a few thousand file renames, the slowdown was very noticeable for the user. The issue was caused indirectly due to an excessive number of inode evictions on a 5.15 kernel, about 100x more compared to a 5.13, 5.14 or a 5.16-rc8 kernel. After an inode eviction we can't tell for sure, in an efficient way, if an inode was previously logged in the current transaction, so we are pessimistic and assume it was, because in case it was we need to update the logged inode. More details on that in one of the patches in the same series (subject "btrfs: avoid inode logging during rename and link when possible"). Either way, in case the parent directory was logged before, we currently do more work then necessary during a rename, and this change minimizes that amount of work. The following script mimics part of what a package installation/upgrade with zypper does, which is basically renaming a lot of files, in some directory under /usr, to a name with a suffix of "-RPMDELETE": $ cat test.sh #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 NUM_FILES=10000 mkfs.btrfs -f $DEV mount $DEV $MNT mkdir $MNT/testdir for ((i = 1; i <= $NUM_FILES; i++)); do echo -n > $MNT/testdir/file_$i done sync # Do some change to testdir and fsync it. echo -n > $MNT/testdir/file_$((NUM_FILES + 1)) xfs_io -c "fsync" $MNT/testdir echo "Renaming $NUM_FILES files..." start=$(date +%s%N) for ((i = 1; i <= $NUM_FILES; i++)); do mv $MNT/testdir/file_$i $MNT/testdir/file_$i-RPMDELETE done end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "Renames took $dur milliseconds" umount $MNT Testing this change on box using a non-debug kernel (Debian's default kernel config) gave the following results: NUM_FILES=10000, before this patch: 27399 ms NUM_FILES=10000, after this patch: 9093 ms (-66.8%) NUM_FILES=5000, before this patch: 9241 ms NUM_FILES=5000, after this patch: 4642 ms (-49.8%) NUM_FILES=2000, before this patch: 2550 ms NUM_FILES=2000, after this patch: 1788 ms (-29.9%) NUM_FILES=1000, before this patch: 1088 ms NUM_FILES=1000, after this patch: 905 ms (-16.9%) Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1193549 Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/inode.c | 33 +++++++++++++++++++------- fs/btrfs/tree-log.c | 67 ++++++++++++++++++++++++++++++++++++++++++----------- fs/btrfs/tree-log.h | 2 +- 3 files changed, 78 insertions(+), 24 deletions(-) commit d5f5bd546552a94eefd68c42f40f778c40a89d2c Author: Filipe Manana Date: Thu Jan 20 11:00:07 2022 +0000 btrfs: pass the dentry to btrfs_log_new_name() instead of the inode In the next patch in the series, there will be the need to access the old name, and its length, of an inode when logging the inode during a rename. So instead of passing the inode to btrfs_log_new_name() pass the dentry, because from the dentry we can get the inode, the name and its length. This will avoid passing 3 new parameters to btrfs_log_new_name() in the next patch - the name, its length and an index number. This way we end up passing only 1 new parameter, the index number. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/inode.c | 8 ++++---- fs/btrfs/tree-log.c | 19 +++++++++++++++---- fs/btrfs/tree-log.h | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) commit 839061fe88beacb911bbb9412d18db3e61160e4f Author: Filipe Manana Date: Thu Jan 20 11:00:06 2022 +0000 btrfs: add helper to delete a dir entry from a log tree Move the code that finds and deletes a logged dir entry out of btrfs_del_dir_entries_in_log() into a helper function. This new helper function will be used by another patch in the same series, and serves to avoid having duplicated logic. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/tree-log.c | 70 +++++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 31 deletions(-) commit 0292ecf19b353e255be93afa133955c3cd78f784 Author: Minghao Chi Date: Tue Jan 11 01:57:16 2022 +0000 btrfs: send: remove redundant ret variable in fs_path_copy Return value from fs_path_add_path() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Reviewed-by: Nikolay Borisov Signed-off-by: Minghao Chi Signed-off-by: CGEL ZTE Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/send.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) commit db5df254120004471e1c957957ab2f1e612dcbd6 Author: Nikolay Borisov Date: Thu Jan 13 17:16:18 2022 +0200 btrfs: move QUOTA_ENABLED check to rescan_should_stop from btrfs_qgroup_rescan_worker Instead of having 2 places that short circuit the qgroup leaf scan have everything in the qgroup_rescan_leaf function. In addition to that, also ensure that the inconsistent qgroup flag is set when rescan_should_stop returns true. This both retains the old behavior when -EINTR was set in the body of the loop and at the same time also extends this behavior when scanning is interrupted due to remount or unmount operations. Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba fs/btrfs/qgroup.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit 5c07c53f2d273bda075cacf3d5e41a59cf634462 Author: Jiapeng Chong Date: Fri Jan 21 19:42:24 2022 +0800 btrfs: scrub: remove redundant initialization of increment increment is being initialized to map->stripe_len but this is never read as increment is overwritten later on. Remove the redundant initialization. Cleans up the following clang-analyzer warning: fs/btrfs/scrub.c:3193:6: warning: Value stored to 'increment' during its initialization is never read [clang-analyzer-deadcode.DeadStores]. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/scrub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c4bf190999953c26070a59172ed01b995521c5ed Author: Jiapeng Chong Date: Fri Jan 21 19:43:51 2022 +0800 btrfs: zoned: remove redundant initialization of to_add to_add is being initialized to len but this is never read as to_add is overwritten later on. Remove the redundant initialization. Cleans up the following clang-analyzer warning: fs/btrfs/extent-tree.c:2769:8: warning: Value stored to 'to_add' during its initialization is never read [clang-analyzer-deadcode.DeadStores]. Reported-by: Abaci Robot Reviewed-by: Nikolay Borisov Signed-off-by: Jiapeng Chong Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/extent-tree.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit 823f8e5c1f06a050af61137f171d1f1966b0982c Author: Anand Jain Date: Thu Jan 13 12:44:10 2022 +0800 btrfs: cleanup temporary variables when finding rotational device status The pointer to struct request_queue is used only to get device type rotating or the non-rotating. So use it directly. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/volumes.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) commit 330a5bf4551784f2f0baef27f2c78550e40fc8a0 Author: Anand Jain Date: Wed Jan 12 13:06:02 2022 +0800 btrfs: use dev_t to match device in device_matched Commit "btrfs: add device major-minor info in the struct btrfs_device" saved the device major-minor number in the struct btrfs_device upon discovering it. So no need to lookup_bdev() again just match, which means device_matched() can go away. Signed-off-by: Anand Jain Signed-off-by: David Sterba fs/btrfs/volumes.c | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) commit 4889bc05a96e039b055bbd11438c40bf956f057b Author: Anand Jain Date: Wed Jan 12 13:06:01 2022 +0800 btrfs: add device major-minor info in the struct btrfs_device Internally it is common to use the major-minor number to identify a device and, at a few locations in btrfs, we use the major-minor number to match the device. So when we identify a new btrfs device through device add or device replace or device-scan/ready save the device's major-minor (dev_t) in the struct btrfs_device so that we don't have to call lookup_bdev() again. Signed-off-by: Anand Jain Signed-off-by: David Sterba fs/btrfs/dev-replace.c | 3 +++ fs/btrfs/volumes.c | 40 +++++++++++++++------------------------- fs/btrfs/volumes.h | 5 +++++ 3 files changed, 23 insertions(+), 25 deletions(-) commit 16cab91a0c8fea50a03ef9c49ca829e6c0c4cf66 Author: Anand Jain Date: Wed Jan 12 13:06:00 2022 +0800 btrfs: match stale devices by dev_t After the commit "btrfs: harden identification of the stale device", we don't have to match the device path anymore. Instead, we match the dev_t. So pass in the dev_t instead of the device path, in the call chain btrfs_forget_devices()->btrfs_free_stale_devices(). Signed-off-by: Anand Jain Signed-off-by: David Sterba fs/btrfs/super.c | 8 +++++++- fs/btrfs/volumes.c | 56 ++++++++++++++++++++++++++++++------------------------ fs/btrfs/volumes.h | 2 +- 3 files changed, 39 insertions(+), 27 deletions(-) commit 770c79fb65506fc7c16459855c3839429f46cb32 Author: Anand Jain Date: Wed Jan 12 13:05:59 2022 +0800 btrfs: harden identification of a stale device Identifying and removing the stale device from the fs_uuids list is done by btrfs_free_stale_devices(). btrfs_free_stale_devices() in turn depends on device_path_matched() to check if the device appears in more than one btrfs_device structure. The matching of the device happens by its path, the device path. However, when device mapper is in use, the dm device paths are nothing but a link to the actual block device, which leads to the device_path_matched() failing to match. Fix this by matching the dev_t as provided by lookup_bdev() instead of plain string compare of the device paths. Reported-by: Josef Bacik Signed-off-by: Anand Jain Signed-off-by: David Sterba fs/btrfs/volumes.c | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) commit bef16b52987b3cd18222109e2490b2f48018cd95 Author: Anand Jain Date: Mon Jan 17 23:50:39 2022 +0800 btrfs: simplify fs_devices member access in btrfs_init_dev_replace_tgtdev In btrfs_init_dev_replace_tgtdev() we dereference fs_info to get fs_devices many times, instead save a point to the fs_devices. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/dev-replace.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) commit 9ad1230533efb6d9f5865a351eca8f0617cf5b74 Author: Sahil Kang Date: Sat Jan 15 18:48:47 2022 -0800 btrfs: reuse existing inode from btrfs_ioctl btrfs_ioctl extracts inode from file so we can pass that into the callbacks. Signed-off-by: Sahil Kang Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/ioctl.c | 41 ++++++++++++++++------------------------- fs/btrfs/send.c | 4 ++-- fs/btrfs/send.h | 2 +- 3 files changed, 19 insertions(+), 28 deletions(-) commit ff37c89f94be14b0e22a532d1e6d57187bfd5bb8 Author: Nikolay Borisov Date: Tue Jan 11 18:00:26 2022 +0200 btrfs: move missing device handling in a dedicate function This simplifies the code flow in read_one_chunk and makes error handling when handling missing devices a bit simpler by reducing it to a single check if something went wrong. No functional changes. Reviewed-by: Su Yue Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/volumes.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) commit de6bc7f59896e888d388a2b469807a4d4b4ab55e Author: Filipe Manana Date: Wed Dec 15 12:20:01 2021 +0000 btrfs: stop trying to log subdirectories created in past transactions When logging a directory we are trying to log subdirectories that were changed in the current transaction and created in a past transaction. This type of behaviour was introduced by commit 2f2ff0ee5e4303 ("Btrfs: fix metadata inconsistencies after directory fsync"), to fix some metadata inconsistencies that in the meanwhile no longer need this behaviour due to numerous other changes that happened throughout the years. This behaviour, besides not needed anymore, it's also undesirable because: 1) It's not reliable because it's only triggered for the directories of dentries (dir items) that happen to be present on a leaf that was changed in the current transaction. If a dentry that points to a directory resides on a leaf that was not changed in the current transaction, then it's not logged, as at log_dir_items() and log_new_dir_dentries() we use btrfs_search_forward(); 2) It's not required by posix or any standard, it's undefined territory. The only way to guarantee a subdirectory is logged, it to explicitly fsync it; Making the behaviour guaranteed would require scanning all directory items, check which point to a directory, and then fsync each subdirectory which was modified in the current transaction. This could be very expensive for large directories with many subdirectories and/or large subdirectories. So remove that obsolete logic. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 732d591a5d6c12478a14083011f59dce6a1e48d4 Author: Filipe Manana Date: Wed Dec 15 12:20:00 2021 +0000 btrfs: stop copying old dir items when logging a directory When logging a directory, we go over every leaf of the subvolume tree that was changed in the current transaction and copy all its dir index keys to the log tree. That includes copying dir index keys created in past transactions. This is done mostly for simplicity, as after logging the keys we log an item that specifies the start and end ranges of the keys we logged. That item is then used during log replay to figure out which keys need to be deleted - every key in that range that we find in the subvolume tree and is not in the log tree, needs to be deleted. Now that we log only dir index keys, and not dir item keys anymore, when we remove dentries from a directory (due to unlink and rename operations), we can get entire leaves that we changed only for deleting old dir index keys, or that have few dir index keys that are new - this is due to the fact that the offset for new index keys comes from a monotonically increasing counter. We can avoid logging dir index keys from past transactions, and in order to track the deletions, only log range items (BTRFS_DIR_LOG_INDEX_KEY key type) when we find gaps between consecutive index keys. This massively reduces the amount of logged metadata when we have deleted directory entries, even if it's a small percentage of the total number of entries. The reduction comes from both less items that are logged and instead of logging many dir index items (struct btrfs_dir_item), which have a size of 30 bytes plus a file name, we typically log just a few range items (struct btrfs_dir_log_item), which take only 8 bytes each. Even if no entries were deleted from a directory and only new entries were added, we typically still get a reduction on the amount of logged metadata, because it's very likely the first leaf that got the new dir index entries also has several old dir index entries. So change the logging logic to not log dir index keys created in past transactions and log a range item for every gap it finds between each pair of consecutive index keys, to ensure deletions are tracked and replayed on log replay. This patch is part of a patchset comprised of the following patches: 1/4 btrfs: don't log unnecessary boundary keys when logging directory 2/4 btrfs: put initial index value of a directory in a constant 3/4 btrfs: stop copying old dir items when logging a directory 4/4 btrfs: stop trying to log subdirectories created in past transactions The following test was run on a branch without this patchset and on a branch with the first three patches applied: $ cat test.sh #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 NUM_FILES=1000000 NUM_FILE_DELETES=10000 MKFS_OPTIONS="-O no-holes -R free-space-tree" MOUNT_OPTIONS="-o ssd" mkfs.btrfs -f $MKFS_OPTIONS $DEV mount $MOUNT_OPTIONS $DEV $MNT mkdir $MNT/testdir for ((i = 1; i <= $NUM_FILES; i++)); do echo -n > $MNT/testdir/file_$i done sync del_inc=$(( $NUM_FILES / $NUM_FILE_DELETES )) for ((i = 1; i <= $NUM_FILES; i += $del_inc)); do rm -f $MNT/testdir/file_$i done start=$(date +%s%N) xfs_io -c "fsync" $MNT/testdir end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "dir fsync took $dur ms after deleting $NUM_FILE_DELETES files" echo umount $MNT The test was run on a non-debug kernel (Debian's default kernel config), and the results were the following for various values of NUM_FILES and NUM_FILE_DELETES: ** before, NUM_FILES = 1 000 000, NUM_FILE_DELETES = 10 000 ** dir fsync took 585 ms after deleting 10000 files ** after, NUM_FILES = 1 000 000, NUM_FILE_DELETES = 10 000 ** dir fsync took 34 ms after deleting 10000 files (-94.2%) ** before, NUM_FILES = 100 000, NUM_FILE_DELETES = 1 000 ** dir fsync took 50 ms after deleting 1000 files ** after, NUM_FILES = 100 000, NUM_FILE_DELETES = 1 000 ** dir fsync took 7 ms after deleting 1000 files (-86.0%) ** before, NUM_FILES = 10 000, NUM_FILE_DELETES = 100 ** dir fsync took 9 ms after deleting 100 files ** after, NUM_FILES = 10 000, NUM_FILE_DELETES = 100 ** dir fsync took 5 ms after deleting 100 files (-44.4%) Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 83 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 30 deletions(-) commit 528ee697126fddaff448897c2d649bd756153c79 Author: Filipe Manana Date: Wed Dec 15 12:19:59 2021 +0000 btrfs: put initial index value of a directory in a constant At btrfs_set_inode_index_count() we refer twice to the number 2 as the initial index value for a directory (when it's empty), with a proper comment explaining the reason for that value. In the next patch I'll have to use that magic value in the directory logging code, so put the value in a #define at btrfs_inode.h, to avoid hardcoding the magic value again at tree-log.c. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/btrfs_inode.h | 12 ++++++++++-- fs/btrfs/inode.c | 10 ++-------- 2 files changed, 12 insertions(+), 10 deletions(-) commit a450a4af74331706b51650a0d826720a4da27428 Author: Filipe Manana Date: Wed Dec 15 12:19:58 2021 +0000 btrfs: don't log unnecessary boundary keys when logging directory Before we start to log dir index keys from a leaf, we check if there is a previous index key, which normally is at the end of a leaf that was not changed in the current transaction. Then we log that key and set the start of logged range (item of type BTRFS_DIR_LOG_INDEX_KEY) to the offset of that key. This is to ensure that if there were deleted index keys between that key and the first key we are going to log, those deletions are replayed in case we need to replay to the log after a power failure. However we really don't need to log that previous key, we can just set the start of the logged range to that key's offset plus 1. This achieves the same and avoids logging one dir index key. The same logic is performed when we finish logging the index keys of a leaf and we find that the next leaf has index keys and was not changed in the current transaction. We are logging the first key of that next leaf and use its offset as the end of range we log. This is just to ensure that if there were deleted index keys between the last index key we logged and the first key of that next leaf, those index keys are deleted if we end up replaying the log. However that is not necessary, we can avoid logging that first index key of the next leaf and instead set the end of the logged range to match the offset of that index key minus 1. So avoid logging those index keys at the boundaries and adjust the start and end offsets of the logged ranges as described above. This patch is part of a patchset comprised of the following patches: 1/4 btrfs: don't log unnecessary boundary keys when logging directory 2/4 btrfs: put initial index value of a directory in a constant 3/4 btrfs: stop copying old dir items when logging a directory 4/4 btrfs: stop trying to log subdirectories created in past transactions Performance test results are listed in the changelog of patch 3/4. Signed-off-by: Filipe Manana Signed-off-by: David Sterba fs/btrfs/tree-log.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) commit dc408ccdf01d3d37ce65aca5dfea0be71d0cc6ec Author: Sahil Kang Date: Wed Jan 5 00:30:06 2022 -0800 btrfs: reuse existing pointers from btrfs_ioctl btrfs_ioctl already contains pointers to the inode and btrfs_root structs, so we can pass them into the subfunctions instead of the toplevel struct file. Signed-off-by: Sahil Kang Signed-off-by: David Sterba fs/btrfs/ioctl.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) commit c816d705b9dbc5ca870bb23e49aa9715da8384b9 Author: Filipe Manana Date: Tue Jan 4 12:53:41 2022 +0000 btrfs: remove write and wait of struct walk_control The ->write and ->wait fields of struct walk_control, used for log trees, are not used since 2008, more specifically since commit d0c803c4049c5c ("Btrfs: Record dirty pages tree-log pages in an extent_io tree") and since commit d0c803c4049c5c ("Btrfs: Record dirty pages tree-log pages in an extent_io tree"). So just remove them, along with the function btrfs_write_tree_block(), which is also not used anymore after removing the ->write member. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba fs/btrfs/tree-log.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) commit 5e7350e8a618ebfea0713b30986976fcbb90b8bb Merge: 92ebb2361e1b 3cbe93a1f540 Author: David S. Miller Date: Mon Mar 14 10:41:51 2022 +0000 Merge branch 'dpaa2-mac-protocol-change' Ioana Ciornei says: ==================== dpaa2-mac: add support for changing the protocol at runtime This patch set adds support for changing the Ethernet protocol at runtime on Layerscape SoCs which have the Lynx 28G SerDes block. The first two patches add a new generic PHY driver for the Lynx 28G and the bindings file associated. The driver reads the PLL configuration at probe time (the frequency provided to the lanes) and determines what protocols can be supported. Based on this the driver can deny or approve a request from the dpaa2-mac to setup a new protocol. The next 2 patches add some MC APIs for inquiring what is the running version of firmware and setting up a new protocol on the MAC. Moving along, we extract the code for setting up the supported interfaces on a MAC on a different function since in the next patches will update the logic. In the next patch, the dpaa2-mac is updated so that it retrieves the SerDes PHY based on the OF node and in case of a major reconfig, call the PHY driver to set up the new protocol on the associated lane and the MC firmware to reconfigure the MAC side of things. Finally, the LX2160A dtsi is annotated with the SerDes PHY nodes for the 1st SerDes block. Beside this, the LX2160A Clearfog dtsi is annotated with the 'phys' property for the exposed SFP cages. Changes in v2: - 1/8: add MODULE_LICENSE Changes in v3: - 2/8: fix 'make dt_binding_check' errors - 7/8: reverse order of dpaa2_mac_start() and phylink_start() - 7/8: treat all RGMII variants in dpmac_eth_if_mode - 7/8: remove the .mac_prepare callback - 7/8: ignore PHY_INTERFACE_MODE_NA in validate Changes in v4: - 1/8: remove the DT nodes parsing - 1/8: add an xlate function - 2/8: remove the children phy nodes for each lane - 7/8: rework the of_phy_get if statement - 8/8: remove the DT nodes for each lane and the lane id in the phys phandle Changes in v5: - 2/8: use phy as the name of the DT node in the example ==================== Signed-off-by: David S. Miller commit 3cbe93a1f540dbc997fc24a38796266e2b473e06 Author: Ioana Ciornei Date: Fri Mar 11 23:22:28 2022 +0200 arch: arm64: dts: lx2160a: describe the SerDes block #1 Describe the SerDes block #1 using the generic phys infrastructure. This way, the ethernet nodes can each reference their serdes lanes individually using the 'phys' dts property. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-itx.dtsi | 4 ++++ arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 6 ++++++ 2 files changed, 10 insertions(+) commit f978fe85b8d1d5b879a4ddda7e4baddbe60e4ee8 Author: Ioana Ciornei Date: Fri Mar 11 23:22:27 2022 +0200 dpaa2-mac: configure the SerDes phy on a protocol change This patch integrates the dpaa2-eth driver with the generic PHY infrastructure in order to search, find and reconfigure the SerDes lanes in case of a protocol change. On the .mac_config() callback, the phy_set_mode_ext() API is called so that the Lynx 28G SerDes PHY driver can change the lane's configuration. In the same phylink callback the MC firmware is called so that it reconfigures the MAC side to run using the new protocol. The consumer drivers - dpaa2-eth and dpaa2-switch - are updated to call the dpaa2_mac_start/stop functions newly added which will power_on/power_off the associated SerDes lane. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 5 +- drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 86 ++++++++++++++++++++++ drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.h | 6 ++ .../net/ethernet/freescale/dpaa2/dpaa2-switch.c | 5 +- 4 files changed, 100 insertions(+), 2 deletions(-) commit aa95c37112414c4c7ea8332357cb7182fc45c84a Author: Ioana Ciornei Date: Fri Mar 11 23:22:26 2022 +0200 dpaa2-mac: move setting up supported_interfaces into a function The logic to setup the supported interfaces will get annotated based on what the configuration of the SerDes PLLs supports. Move the current setup into a separate function just to try to keep it clean. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 43 +++++++++++++----------- 1 file changed, 24 insertions(+), 19 deletions(-) commit dff953813e7d1a7baf86413887e4181fc35b78a1 Author: Ioana Ciornei Date: Fri Mar 11 23:22:25 2022 +0200 dpaa2-mac: retrieve API version and detect features Retrieve the API version running on the firmware and based on it detect which features are available for usage. The first one to be listed is the capability to change the MAC protocol at runtime. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 30 ++++++++++++++++++++++++ drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.h | 2 ++ 2 files changed, 32 insertions(+) commit 332b9ea59e56f6fbf670c4534f116b8f77e7eba4 Author: Ioana Ciornei Date: Fri Mar 11 23:22:24 2022 +0200 dpaa2-mac: add the MC API for reconfiguring the protocol The MC firmware gained recently a new command which can reconfigure the running protocol on the underlying MAC. Add this new command which will be used in the next patches in order to do a major reconfig on the interface. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h | 5 +++++ drivers/net/ethernet/freescale/dpaa2/dpmac.c | 23 +++++++++++++++++++++++ drivers/net/ethernet/freescale/dpaa2/dpmac.h | 3 +++ 3 files changed, 31 insertions(+) commit 38d28b02a08e006f2153dc8414775f811b02fa7a Author: Ioana Ciornei Date: Fri Mar 11 23:22:23 2022 +0200 dpaa2-mac: add the MC API for retrieving the version The dpmac_get_api_version command will be used in the next patches to determine if the current firmware is capable or not to change the Ethernet protocol running on the MAC. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller drivers/net/ethernet/freescale/dpaa2/dpmac-cmd.h | 7 ++++++ drivers/net/ethernet/freescale/dpaa2/dpmac.c | 31 ++++++++++++++++++++++++ drivers/net/ethernet/freescale/dpaa2/dpmac.h | 2 ++ 3 files changed, 40 insertions(+) commit c553f22e0531f41bbf6fd0a06e98110c71f66bdf Author: Ioana Ciornei Date: Fri Mar 11 23:22:22 2022 +0200 dt-bindings: phy: add bindings for Lynx 28G PHY Add device tree binding for the Lynx 28G SerDes PHY driver used on Layerscape based SoCs. Signed-off-by: Ioana Ciornei Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller .../devicetree/bindings/phy/fsl,lynx-28g.yaml | 40 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 41 insertions(+) commit 8f73b37cf3fbda67ea1e579c3b5785da4e7aa2e3 Author: Ioana Ciornei Date: Fri Mar 11 23:22:21 2022 +0200 phy: add support for the Layerscape SerDes 28G This patch adds a new generic PHY driver to support the Lynx 28G SerDes block found on some of the Layerscape SoCs such as LX2160A. At the moment, only the following Ethernet protocols are supported: SGMII/1000Base-X and 10GBaseR. SerDes lanes which are not running an Ethernet protocol or a currently supported Ethenet protocol will be left as it was configured through the RCW (Reset Configuration Word) at boot time. At probe time, the platform driver will read the current configuration of both PLLs found on a SerDes block and will determine what protocols are supported using that PLL. For example, if a PLL is configured to generate a clock net (frate) of 5GHz the only protocols sustained by that PLL are SGMII/1000Base-X (using a quarter of the full clock rate) and QSGMII using the full clock net frequency on the lane. On the .set_mode() callback, the PHY driver will first check if the requested operating mode (protocol) is even supported by the current PLL configuration and will error out if not. Then, the lane is reconfigured to run on the requested protocol. Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller MAINTAINERS | 6 + drivers/phy/freescale/Kconfig | 10 + drivers/phy/freescale/Makefile | 1 + drivers/phy/freescale/phy-fsl-lynx-28g.c | 624 +++++++++++++++++++++++++++++++ 4 files changed, 641 insertions(+) commit 92ebb2361e1b32d4b5975f017289473ed84ab86d Merge: 102e4a8e12fd 978777d0fb06 Author: David S. Miller Date: Mon Mar 14 10:36:15 2022 +0000 Merge branch 'dsa-felix-qos' Vladimir Oltean says: ==================== Basic QoS classification on Felix DSA switch using dcbnl Basic QoS classification for Ocelot switches means port-based default priority, DSCP-based and VLAN PCP based. This is opposed to advanced QoS classification which is done through the VCAP IS1 TCAM based engine. The patch set is a logical continuation of this RFC which attempted to describe the default-prio as a matchall entry placed at the end of a series of offloaded tc filters: https://patchwork.kernel.org/project/netdevbpf/cover/20210113154139.1803705-1-olteanv@gmail.com/ I have tried my best to satisfy the feedback that we should cater for pre-configured QoS profiles. Ironically, the only pre-configured QoS profile that the Felix switch driver has is for VLAN PCP (1:1 mapping with QoS class), yet IEEE 802.1Q or dcbnl offer no mechanism for reporting or changing that. Testing was done with the iproute2 dcb app. The qos_class of packets was dumped from net/dsa/tag_ocelot.c. (1) $ dcb app show dev swp3 default-prio 0 (2) $ dcb app replace dev swp3 default-prio 3 (3) $ dcb app replace dev swp3 dscp-prio CS3:5 (4) $ dcb app replace dev swp3 dscp-prio CS2:2 (5) $ dcb app show dev swp3 default-prio 3 dscp-prio CS2:2 CS3:5 Traffic sent with "ping -Q 64 ", which means CS2. These packets match qos_class 0 after command (1), qos_class 3 after command (2), qos_class 3 after command (3), and qos_class 2 after command (2). ==================== Signed-off-by: David S. Miller commit 978777d0fb06663523281aa50a5040c3aa31fbe7 Author: Vladimir Oltean Date: Fri Mar 11 23:15:20 2022 +0200 net: dsa: felix: configure default-prio and dscp priorities Follow the established programming model for this driver and provide shims in the felix DSA driver which call the implementations from the ocelot switch lib. The ocelot switchdev driver wasn't integrated with dcbnl due to lack of hardware availability. The switch doesn't have any fancy QoS classification enabled by default. The provided getters will create a default-prio app table entry of 0, and no dscp entry. However, the getters have been made to actually retrieve the hardware configuration rather than static values, to be future proof in case DSA will need this information from more call paths. For default-prio, there is a single field per port, in ANA_PORT_QOS_CFG, called QOS_DEFAULT_VAL. DSCP classification is enabled per-port, again via ANA_PORT_QOS_CFG (field QOS_DSCP_ENA), and individual DSCP values are configured as trusted or not through register ANA_DSCP_CFG (replicated 64 times). An untrusted DSCP value falls back to other QoS classification methods. If trusted, the selected ANA_DSCP_CFG register also holds the QoS class in the QOS_DSCP_VAL field. The hardware also supports DSCP remapping (DSCP value X is translated to DSCP value Y before the QoS class is determined based on the app table entry for Y) and DSCP packet rewriting. The dcbnl framework, for being so flexible in other useless areas, doesn't appear to support this. So this functionality has been left out. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 43 ++++++++++++++ drivers/net/ethernet/mscc/ocelot.c | 116 +++++++++++++++++++++++++++++++++++++ include/soc/mscc/ocelot.h | 5 ++ 3 files changed, 164 insertions(+) commit 47d75f7822064d024ec9207c0fc1777f983783b7 Author: Vladimir Oltean Date: Fri Mar 11 23:15:19 2022 +0200 net: dsa: report and change port dscp priority using dcbnl Similar to the port-based default priority, IEEE 802.1Q-2018 allows the Application Priority Table to define QoS classes (0 to 7) per IP DSCP value (0 to 63). In the absence of an app table entry for a packet with DSCP value X, QoS classification for that packet falls back to other methods (VLAN PCP or port-based default). The presence of an app table for DSCP value X with priority Y makes the hardware classify the packet to QoS class Y. As opposed to the default-prio where DSA exposes only a "set" in dsa_switch_ops (because the port-based default is the fallback, it always exists, either implicitly or explicitly), for DSCP priorities we expose an "add" and a "del". The addition of a DSCP entry means trusting that DSCP priority, the deletion means ignoring it. Drivers that already trust (at least some) DSCP values can describe their configuration in dsa_switch_ops :: port_get_dscp_prio(), which is called for each DSCP value from 0 to 63. Again, there can be more than one dcbnl app table entry for the same DSCP value, DSA chooses the one with the largest configured priority. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller include/net/dsa.h | 5 ++++ net/dsa/slave.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) commit d538eca85c2aa6ecb5036e6ff47efc93d9f294da Author: Vladimir Oltean Date: Fri Mar 11 23:15:18 2022 +0200 net: dsa: report and change port default priority using dcbnl The port-based default QoS class is assigned to packets that lack a VLAN PCP (or the port is configured to not trust the VLAN PCP), an IP DSCP (or the port is configured to not trust IP DSCP), and packets on which no tc-skbedit action has matched. Similar to other drivers, this can be exposed to user space using the DCB Application Priority Table. IEEE 802.1Q-2018 specifies in Table D-8 - Sel field values that when the Selector is 1, the Protocol ID value of 0 denotes the "Default application priority. For use when application priority is not otherwise specified." The way in which the dcbnl integration in DSA has been designed has to do with its requirements. Andrew Lunn explains that SOHO switches are expected to come with some sort of pre-configured QoS profile, and that it is desirable for this to come pre-loaded into the DSA slave interfaces' DCB application priority table. In the dcbnl design, this is possible because calls to dcb_ieee_setapp() can be initiated by anyone including being self-initiated by this device driver. However, what makes this challenging to implement in DSA is that the DSA core manages the net_devices (effectively hiding them from drivers), while drivers manage the hardware. The DSA core has no knowledge of what individual drivers' QoS policies are. DSA could export to drivers a wrapper over dcb_ieee_setapp() and these could call that function to pre-populate the app priority table, however drivers don't have a good moment in time to do this. The dsa_switch_ops :: setup() method gets called before the net_devices are created (dsa_slave_create), and so is dsa_switch_ops :: port_setup(). What remains is dsa_switch_ops :: port_enable(), but this gets called upon each ndo_open. If we add app table entries on every open, we'd need to remove them on close, to avoid duplicate entry errors. But if we delete app priority entries on close, what we delete may not be the initial, driver pre-populated entries, but rather user-added entries. So it is clear that letting drivers choose the timing of the dcb_ieee_setapp() call is inappropriate. The alternative which was chosen is to introduce hardware-specific ops in dsa_switch_ops, and effectively hide dcbnl details from drivers as well. For pre-populating the application table, dsa_slave_dcbnl_init() will call ds->ops->port_get_default_prio() which is supposed to read from hardware. If the operation succeeds, DSA creates a default-prio app table entry. The method is called as soon as the slave_dev is registered, but before we release the rtnl_mutex. This is done such that user space sees the app table entries as soon as it sees the interface being registered. The fact that we populate slave_dev->dcbnl_ops with a non-NULL pointer changes behavior in dcb_doit() from net/dcb/dcbnl.c, which used to return -EOPNOTSUPP for any dcbnl operation where netdev->dcbnl_ops is NULL. Because there are still dcbnl-unaware DSA drivers even if they have dcbnl_ops populated, the way to restore the behavior is to make all dcbnl_ops return -EOPNOTSUPP on absence of the hardware-specific dsa_switch_ops method. The dcbnl framework absurdly allows there to be more than one app table entry for the same selector and protocol (in other words, more than one port-based default priority). In the iproute2 dcb program, there is a "replace" syntactical sugar command which performs an "add" and a "del" to hide this away. But we choose the largest configured priority when we call ds->ops->port_set_default_prio(), using __fls(). When there is no default-prio app table entry left, the port-default priority is restored to 0. Link: https://patchwork.kernel.org/project/netdevbpf/patch/20210113154139.1803705-2-olteanv@gmail.com/ Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller include/net/dsa.h | 7 +++ net/dsa/slave.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) commit 6e36203bc14ce1470ad289ef050eb0fe542ee8b7 Author: Marek Vasut Date: Sat Mar 12 22:23:49 2022 +0100 PCI: rcar: Use PCI_SET_ERROR_RESPONSE after read which triggered an exception In case the controller is transitioning to L1 in rcar_pcie_config_access(), any read/write access to PCIECDR triggers asynchronous external abort. This is because the transition to L1 link state must be manually finished by the driver. The PCIe IP can transition back from L1 state to L0 on its own. The current asynchronous external abort hook implementation restarts the instruction which finally triggered the fault, which can be a different instruction than the read/write instruction which started the faulting access. Usually the instruction which finally triggers the fault is one which has some data dependency on the result of the read/write. In case of read, the read value after fixup is undefined, while a read value of faulting read should be PCI_ERROR_RESPONSE. It is possible to enforce the fault using 'isb' instruction placed right after the read/write instruction which started the faulting access. Add custom register accessors which perform the read/write followed immediately by 'isb'. This way, the fault always happens on the 'isb' and in case of read, which is located one instruction before the 'isb', it is now possible to fix up the return value of the read in the asynchronous external abort hook and make that read return PCI_ERROR_RESPONSE. Link: https://lore.kernel.org/r/20220312212349.781799-2-marek.vasut@gmail.com Tested-by: Geert Uytterhoeven Signed-off-by: Marek Vasut Signed-off-by: Lorenzo Pieralisi Reviewed-by: Arnd Bergmann Reviewed-by: Geert Uytterhoeven Cc: Arnd Bergmann Cc: Bjorn Helgaas Cc: Geert Uytterhoeven Cc: Krzysztof Wilczyński Cc: Lorenzo Pieralisi Cc: Wolfram Sang Cc: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org drivers/pci/controller/pcie-rcar-host.c | 56 ++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) commit 84b576146294c2be702cfcd174eaa74167e276f9 Author: Marek Vasut Date: Sat Mar 12 22:23:48 2022 +0100 PCI: rcar: Finish transition to L1 state in rcar_pcie_config_access() In case the controller is transitioning to L1 in rcar_pcie_config_access(), any read/write access to PCIECDR triggers asynchronous external abort. This is because the transition to L1 link state must be manually finished by the driver. The PCIe IP can transition back from L1 state to L0 on its own. Avoid triggering the abort in rcar_pcie_config_access() by checking whether the controller is in the transition state, and if so, finish the transition right away. This prevents a lot of unnecessary exceptions, although not all of them. Link: https://lore.kernel.org/r/20220312212349.781799-1-marek.vasut@gmail.com Tested-by: Geert Uytterhoeven Signed-off-by: Marek Vasut Signed-off-by: Lorenzo Pieralisi Reviewed-by: Geert Uytterhoeven Cc: Arnd Bergmann Cc: Bjorn Helgaas Cc: Geert Uytterhoeven Cc: Krzysztof Wilczyński Cc: Lorenzo Pieralisi Cc: Wolfram Sang Cc: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org drivers/pci/controller/pcie-rcar-host.c | 76 +++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 31 deletions(-) commit 102e4a8e12fda992803adec51be65e8d1089d4db Author: Victor Nogueira Date: Fri Mar 11 12:29:42 2022 -0300 selftests: tc-testing: Increase timeout in tdc config file Some tests, such as Test d052: Add 1M filters with the same action, may not work with a small timeout value. Increase timeout to 24 seconds. Signed-off-by: Victor Nogueira Acked-by: Davide Caratti Signed-off-by: David S. Miller tools/testing/selftests/tc-testing/tdc_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fbd9a2ceba5c74bbfa19cf257ae4b4b2c820860d Author: Sebastian Andrzej Siewior Date: Fri Mar 11 16:03:42 2022 +0100 net: Add lockdep asserts to ____napi_schedule(). ____napi_schedule() needs to be invoked with disabled interrupts due to __raise_softirq_irqoff (in order not to corrupt the per-CPU list). ____napi_schedule() needs also to be invoked from an interrupt context so that the raised-softirq is processed while the interrupt context is left. Add lockdep asserts for both conditions. While this is the second time the irq/softirq check is needed, provide a generic lockdep_assert_softirq_will_run() which is used by both caller. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller include/linux/lockdep.h | 7 +++++++ net/core/dev.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) commit d96657dc9238f8e9bda47b377e17e7c6f90935af Merge: de29aff976d3 1f4a5983d623 Author: David S. Miller Date: Mon Mar 14 10:06:54 2022 +0000 Merge branch 'macvlan-uaf' Ziyang Xuan says: ==================== net: macvlan: fix potential UAF problem for lowerdev Add the reference operation to lowerdev of macvlan to avoid the potential UAF problem under the following known scenario: Someone module puts the NETDEV_UNREGISTER event handler to a work, and lowerdev is accessed in the work handler. But when the work is excuted, lowerdev has been destroyed because upper macvlan did not get reference to lowerdev correctly. In addition, add net device refcount tracker to macvlan. ==================== Signed-off-by: David S. Miller commit 1f4a5983d623d6dbda4cc7587a2d9d798e0d4035 Author: Ziyang Xuan Date: Fri Mar 11 17:04:03 2022 +0800 net: macvlan: add net device refcount tracker Add net device refcount tracker to macvlan. Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller drivers/net/macvlan.c | 4 ++-- include/linux/if_macvlan.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) commit 291ac68478d95cb2b897915da3dc13c6e86d2218 Author: Ziyang Xuan Date: Fri Mar 11 17:03:26 2022 +0800 net: macvlan: fix potential UAF problem for lowerdev Add the reference operation to lowerdev of macvlan to avoid the potential UAF problem under the following known scenario: Someone module puts the NETDEV_UNREGISTER event handler to a work, and lowerdev is accessed in the work handler. But when the work is excuted, lowerdev has been destroyed because upper macvlan did not get reference to lowerdev correctly. That likes as the scenario occurred by commit 563bcbae3ba2 ("net: vlan: fix a UAF in vlan_dev_real_dev()"). Signed-off-by: Ziyang Xuan Signed-off-by: David S. Miller drivers/net/macvlan.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit f97ec5d75e9261a5da78dc28a8955b7cc0c4468b Author: Gwendal Grignou Date: Tue Feb 8 21:09:47 2022 -0800 HID: intel-ish-hid: Use dma_alloc_coherent for firmware update Allocating memory with kmalloc and GPF_DMA32 is not allowed, the allocator will ignore the attribute. Instead, use dma_alloc_coherent() API as we allocate a small amount of memory to transfer firmware fragment to the ISH. On Arcada chromebook, after the patch the warning: "Unexpected gfp: 0x4 (GFP_DMA32). Fixing up to gfp: 0xcc0 (GFP_KERNEL). Fix your code!" is gone. The ISH firmware is loaded properly and we can interact with the ISH: > ectool --name cros_ish version ... Build info: arcada_ish_v2.0.3661+3c1a1c1ae0 2022-02-08 05:37:47 @localhost Tool version: v2.0.12300-900b03ec7f 2022-02-08 10:01:48 @localhost Fixes: commit 91b228107da3 ("HID: intel-ish-hid: ISH firmware loader client driver") Signed-off-by: Gwendal Grignou Acked-by: Srinivas Pandruvada Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) commit f0fae8a0edd445d042ee94153f127e8939fcf3d3 Merge: ff8dcfebe08d de26a7424331 Author: Thomas Gleixner Date: Mon Mar 14 10:23:22 2022 +0100 Merge tag 'irqchip-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates from Marc Zyngier: - Add support for the STM32MP13 variant - Move parent device away from struct irq_chip - Remove all instances of non-const strings assigned to struct irq_chip::name, enabling a nice cleanup for VIC and GIC) - Simplify the Qualcomm PDC driver - A bunch of SiFive PLIC cleanups - Add support for a new variant of the Meson GPIO block - Add support for the irqchip side of the Apple M1 PMU - Add support for the Apple M1 Pro/Max AICv2 irqchip - Add support for the Qualcomm MPM wakeup gadget - Move the Xilinx driver over to the generic irqdomain handling - Tiny speedup for IPIs on GICv3 systems - The usual odd cleanups Link: https://lore.kernel.org/all/20220313105142.704579-1-maz@kernel.org commit b166e52541f2357ce126a92ce1d9a580fdca719d Merge: 1f1893d78180 4467b8bad240 Author: Thomas Gleixner Date: Mon Mar 14 10:18:17 2022 +0100 Merge tag 'timers-v5.18-rc1' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull clocksource/events updates from Daniel Lezcano: - Fix return error code check for the timer-of layer when getting the base address (Guillaume Ranquet) - Remove MMIO dependency, add notrace annotation for sched_clock and increase the timer resolution for the Microchip PIT64b (Claudiu Beznea) - Convert DT bindings to yaml for the Tegra timer (David Heidelberg) - Fix compilation error on architecture other than ARM for the i.MX TPM (Nathan Chancellor) - Add support for the event stream scaling for 1GHz counter on the arch ARM timer (Marc Zyngier) - Support a higher number of interrupts by the Exynos MCT timer driver (Alim Akhtar) - Detect and prevent memory corruption when the specified number of interrupts in the DTS is greater than the array size in the code for the Exynos MCT timer (Krzysztof Kozlowski) - Fix regression from a previous errata fix on the TI DM timer (Drew Fustini) - Several fixes and code improvements for the i.MX TPM driver (Peng Fan) Link: https://lore.kernel.org/all/a8cd9be9-7d70-80df-2b74-1a8226a215e1@linaro.org commit 1f1893d78180c0c8bd4f53405420aa31eabfb263 Merge: 58dedf0a4782 f96272a90d9e Author: Thomas Gleixner Date: Mon Mar 14 10:10:15 2022 +0100 Merge branch 'timers/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into timers/core Pull tick/NOHZ updates from Frederic Weisbecker: - A fix for rare jiffies update stalls that were reported by Paul McKenney - Tick side cleanups after RCU_FAST_NO_HZ removal - Handle softirqs on idle more gracefully Link: https://lore.kernel.org/all/20220307233034.34550-1-frederic@kernel.org commit ebad2e8db54142208556d97e757dbcbd2db63152 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:26:30 2022 +0100 media: platform: exynos-gsc: move config to its own file In order to better organize the platform/Kconfig, place exynos-gsc-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 11 +---------- drivers/media/platform/exynos-gsc/Kconfig | 10 ++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) commit d205d312b1bb86956776cd77fc4e7d6fa626f371 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:25:33 2022 +0100 media: platform: coda: move config to its own file In order to better organize the platform/Kconfig, place coda-specific config stuff on a separate Kconfig file. Reviewed-by: Philipp Zabel Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 18 +----------------- drivers/media/platform/coda/Kconfig | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-) commit 52b3a219dd4ab46b2b8ba7af5648f6e1e026f876 Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:24:34 2022 +0100 media: platform: amphion: move config to its own file In order to better organize the platform/Kconfig, place amphion-specific config stuff on a separate Kconfig file. Reviewed-by: Shijie Qin Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 21 +-------------------- drivers/media/platform/amphion/Kconfig | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 20 deletions(-) commit 5a20fabf71d7aa1fe2a72b5f69671ce99f003c0f Author: Mauro Carvalho Chehab Date: Fri Mar 11 12:22:38 2022 +0100 media: platform: allegro-dvt: move config to its own file In order to better organize the platform/Kconfig, place allegro-dvt-specific config stuff on a separate Kconfig file. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 17 +---------------- drivers/media/platform/allegro-dvt/Kconfig | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 16 deletions(-) commit ee4a77a32b39064fdab0aa2b36bbd35ebf57e077 Author: Mauro Carvalho Chehab Date: Thu Mar 10 16:33:16 2022 +0100 media: platform: place Renesas drivers on a separate dir In order to cleanup the main platform media directory, move Renesas driver to its own directory. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 18 ++-- drivers/media/platform/Kconfig | 113 +------------------ drivers/media/platform/Makefile | 10 +- drivers/media/platform/renesas/Kconfig | 119 +++++++++++++++++++++ drivers/media/platform/renesas/Makefile | 15 +++ drivers/media/platform/{ => renesas}/rcar-fcp.c | 0 drivers/media/platform/{ => renesas}/rcar-isp.c | 0 .../media/platform/{ => renesas}/rcar-vin/Kconfig | 0 .../media/platform/{ => renesas}/rcar-vin/Makefile | 0 .../platform/{ => renesas}/rcar-vin/rcar-core.c | 0 .../platform/{ => renesas}/rcar-vin/rcar-csi2.c | 0 .../platform/{ => renesas}/rcar-vin/rcar-dma.c | 0 .../platform/{ => renesas}/rcar-vin/rcar-v4l2.c | 0 .../platform/{ => renesas}/rcar-vin/rcar-vin.h | 0 drivers/media/platform/{ => renesas}/rcar_drif.c | 0 drivers/media/platform/{ => renesas}/rcar_fdp1.c | 0 drivers/media/platform/{ => renesas}/rcar_jpu.c | 0 drivers/media/platform/{ => renesas}/renesas-ceu.c | 0 drivers/media/platform/{ => renesas}/sh_vou.c | 0 drivers/media/platform/{ => renesas}/vsp1/Makefile | 0 drivers/media/platform/{ => renesas}/vsp1/vsp1.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_brx.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_brx.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_clu.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_clu.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_dl.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_dl.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_drm.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_drm.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_drv.c | 0 .../platform/{ => renesas}/vsp1/vsp1_entity.c | 0 .../platform/{ => renesas}/vsp1/vsp1_entity.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_hgo.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_hgo.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_hgt.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_hgt.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_histo.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_histo.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_hsit.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_hsit.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_lif.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_lif.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_lut.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_lut.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_pipe.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_pipe.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_regs.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_rpf.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_rwpf.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_rwpf.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_sru.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_sru.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_uds.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_uds.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_uif.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_uif.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_video.c | 0 .../media/platform/{ => renesas}/vsp1/vsp1_video.h | 0 .../media/platform/{ => renesas}/vsp1/vsp1_wpf.c | 0 59 files changed, 146 insertions(+), 129 deletions(-) commit 81acf39488cfe99319b0a25f2b9a0e2e3bb40b6d Author: Mauro Carvalho Chehab Date: Fri Mar 11 10:06:44 2022 +0100 media: platform: place Via drivers on a separate dir In order to cleanup the main platform media directory, move Via driver to its own directory. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 11 +---------- drivers/media/platform/Makefile | 2 +- drivers/media/platform/via/Kconfig | 11 +++++++++++ drivers/media/platform/via/Makefile | 2 ++ drivers/media/platform/{ => via}/via-camera.c | 0 drivers/media/platform/{ => via}/via-camera.h | 0 6 files changed, 15 insertions(+), 11 deletions(-) commit 95495f2aa9d8df1a7697bab24118544d3568f41d Author: Mauro Carvalho Chehab Date: Fri Mar 11 09:56:53 2022 +0100 media: platform: place Intel drivers on a separate dir In order to cleanup the main platform media directory, move Intel driver to its own directory. Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 11 +---------- drivers/media/platform/Makefile | 2 +- drivers/media/platform/intel/Kconfig | 11 +++++++++++ drivers/media/platform/intel/Makefile | 2 ++ drivers/media/platform/{ => intel}/pxa_camera.c | 0 5 files changed, 15 insertions(+), 11 deletions(-) commit 46fb99951fe2c71adfd7f4ea4439af5ed5ebb7f7 Author: Mauro Carvalho Chehab Date: Thu Mar 10 16:40:21 2022 +0100 media: platform: place NXP drivers on a separate dir In order to cleanup the main platform media directory, move NXP drivers to their own directory. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 40 +------------ drivers/media/platform/Makefile | 6 +- drivers/media/platform/imx/Kconfig | 25 -------- drivers/media/platform/imx/Makefile | 1 - drivers/media/platform/nxp/Kconfig | 66 ++++++++++++++++++++++ drivers/media/platform/nxp/Makefile | 8 +++ drivers/media/platform/{ => nxp}/fsl-viu.c | 0 drivers/media/platform/{ => nxp}/imx-jpeg/Kconfig | 0 drivers/media/platform/{ => nxp}/imx-jpeg/Makefile | 0 .../platform/{ => nxp}/imx-jpeg/mxc-jpeg-hw.c | 0 .../platform/{ => nxp}/imx-jpeg/mxc-jpeg-hw.h | 0 .../media/platform/{ => nxp}/imx-jpeg/mxc-jpeg.c | 0 .../media/platform/{ => nxp}/imx-jpeg/mxc-jpeg.h | 0 .../media/platform/{imx => nxp}/imx-mipi-csis.c | 0 drivers/media/platform/{ => nxp}/imx-pxp.c | 0 drivers/media/platform/{ => nxp}/imx-pxp.h | 0 drivers/media/platform/{ => nxp}/mx2_emmaprp.c | 0 18 files changed, 78 insertions(+), 70 deletions(-) commit 69c5ee8aae03bb9f9a8a825175a1cd0644eaf20c Author: Mauro Carvalho Chehab Date: Fri Mar 11 10:01:12 2022 +0100 media: platform: place Aspeed driver on a separate dir In order to cleanup the main platform media directory, move Aspeed driver to its own directory. Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 10 +--------- drivers/media/platform/Makefile | 2 +- drivers/media/platform/aspeed/Kconfig | 10 ++++++++++ drivers/media/platform/aspeed/Makefile | 2 ++ drivers/media/platform/{ => aspeed}/aspeed-video.c | 0 6 files changed, 15 insertions(+), 11 deletions(-) commit 256bf685691d86462a62e1d7041385baf0dfe595 Author: Mauro Carvalho Chehab Date: Fri Mar 11 11:21:45 2022 +0100 media: platform: move platform menu dependencies to drivers Right now, platform dependencies are organized by the type of the platform driver. Yet, things tend to become very messy with time. The better seems to organize the drivers per manufacturer, as other Kernel subsystems are doing. As a preparation for such purpose, get rid of menuconfigs, moving the per-menu dependencies to be at the driver-specifig config entires. This shoud give flexibility to reorganize the platform drivers per manufacturer and re-sort them. This patch removes all "if..endif" options from the platform Kconfig, converting them into depends on. Acked-by: Jernej Skrabec Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Kconfig | 119 +++++++++++++++---------- drivers/media/platform/am437x/Kconfig | 1 + drivers/media/platform/atmel/Kconfig | 4 + drivers/media/platform/cadence/Kconfig | 1 + drivers/media/platform/davinci/Kconfig | 6 ++ drivers/media/platform/exynos4-is/Kconfig | 1 + drivers/media/platform/imx-jpeg/Kconfig | 1 + drivers/media/platform/imx/Kconfig | 1 + drivers/media/platform/marvell-ccic/Kconfig | 2 + drivers/media/platform/omap/Kconfig | 1 + drivers/media/platform/rcar-vin/Kconfig | 2 + drivers/media/platform/sti/c8sectpfe/Kconfig | 1 + drivers/media/platform/sunxi/sun4i-csi/Kconfig | 1 + drivers/media/platform/sunxi/sun6i-csi/Kconfig | 1 + drivers/media/platform/xilinx/Kconfig | 1 + 15 files changed, 98 insertions(+), 45 deletions(-) commit f7fb2414db9e054f8e8709184dadbda7bc040da5 Author: Mauro Carvalho Chehab Date: Thu Mar 10 15:48:58 2022 +0100 media: platform: Makefile: reorganize its contents There are lots of inconsistencies here: some directories are included as-is, and others included using one (or more) symbols that are inside it. Also, its entries are not sorted. That makes it harder to maintain. Reorganize it by placing everything on alphabetic order and providing some hints about how patches for such file is expected. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/Makefile | 132 +++++++++++++++------------------------- 1 file changed, 50 insertions(+), 82 deletions(-) commit 5c89357a7a0f17c6198bb28614913fb1eb284615 Author: Mauro Carvalho Chehab Date: Wed Mar 9 14:17:02 2022 +0100 media: Makefiles: sort entries where it fits Alphabetically sort entries at the Makefiles per group, in ASCII order, e. g., using the output of: $ LC_ALL=C sort Makefile |grep obj-y ... $ LC_ALL=C sort Makefile |grep obj.*CONFIG ... Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab drivers/media/common/Makefile | 7 +- drivers/media/common/videobuf2/Makefile | 8 +- drivers/media/dvb-frontends/Makefile | 193 ++++++++++++++++---------------- drivers/media/i2c/Makefile | 184 +++++++++++++++--------------- drivers/media/pci/Makefile | 22 ++-- drivers/media/radio/Makefile | 43 +++---- drivers/media/rc/Makefile | 47 ++++---- drivers/media/rc/keymaps/Makefile | 34 +++--- drivers/media/spi/Makefile | 7 +- drivers/media/test-drivers/Makefile | 10 +- drivers/media/tuners/Makefile | 66 +++++------ drivers/media/usb/Makefile | 32 ++++-- drivers/media/v4l2-core/Makefile | 34 +++--- 13 files changed, 366 insertions(+), 321 deletions(-) commit 910f42bfe96783fc633196bd975731a420c7a066 Author: Rob Herring Date: Fri Mar 11 17:48:01 2022 -0600 ASoC: dt-bindings: Fix patternProperties with fixed strings The simple-audio-card and renesas,rsnd bindings used 'patternProperties' with fixed strings to work-around a dtschema meta-schema limitation. This is now fixed and the schemas can be fixed to use 'properties' instead. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220311234802.417610-1-robh@kernel.org Signed-off-by: Mark Brown .../devicetree/bindings/sound/renesas,rsnd.yaml | 16 ++++----- .../devicetree/bindings/sound/simple-card.yaml | 42 +++++++++++----------- 2 files changed, 28 insertions(+), 30 deletions(-) commit ccb4214f7f2a8b75acf493f31128e464ee1a3536 Author: Jiasheng Jiang Date: Thu Mar 10 11:00:41 2022 +0800 ASoC: soc-compress: Change the check for codec_dai It should be better to reverse the check on codec_dai and returned early in order to be easier to understand. Fixes: de2c6f98817f ("ASoC: soc-compress: prevent the potentially use of null pointer") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Jiasheng Jiang Reviewed-by: Charles Keepax Link: https://lore.kernel.org/r/20220310030041.1556323-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown sound/soc/soc-compress.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) commit 3886a86e7e6cc6ce2ce93c440fecd8f42aed0ce7 Author: Mastan Katragadda Date: Thu Mar 3 11:34:28 2022 +0530 drm/i915/gem: add missing boundary check in vm_access A missing bounds check in vm_access() can lead to an out-of-bounds read or write in the adjacent memory area, since the len attribute is not validated before the memcpy later in the function, potentially hitting: [ 183.637831] BUG: unable to handle page fault for address: ffffc90000c86000 [ 183.637934] #PF: supervisor read access in kernel mode [ 183.637997] #PF: error_code(0x0000) - not-present page [ 183.638059] PGD 100000067 P4D 100000067 PUD 100258067 PMD 106341067 PTE 0 [ 183.638144] Oops: 0000 [#2] PREEMPT SMP NOPTI [ 183.638201] CPU: 3 PID: 1790 Comm: poc Tainted: G D 5.17.0-rc6-ci-drm-11296+ #1 [ 183.638298] Hardware name: Intel Corporation CoffeeLake Client Platform/CoffeeLake H DDR4 RVP, BIOS CNLSFWR1.R00.X208.B00.1905301319 05/30/2019 [ 183.638430] RIP: 0010:memcpy_erms+0x6/0x10 [ 183.640213] RSP: 0018:ffffc90001763d48 EFLAGS: 00010246 [ 183.641117] RAX: ffff888109c14000 RBX: ffff888111bece40 RCX: 0000000000000ffc [ 183.642029] RDX: 0000000000001000 RSI: ffffc90000c86000 RDI: ffff888109c14004 [ 183.642946] RBP: 0000000000000ffc R08: 800000000000016b R09: 0000000000000000 [ 183.643848] R10: ffffc90000c85000 R11: 0000000000000048 R12: 0000000000001000 [ 183.644742] R13: ffff888111bed190 R14: ffff888109c14000 R15: 0000000000001000 [ 183.645653] FS: 00007fe5ef807540(0000) GS:ffff88845b380000(0000) knlGS:0000000000000000 [ 183.646570] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 183.647481] CR2: ffffc90000c86000 CR3: 000000010ff02006 CR4: 00000000003706e0 [ 183.648384] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 183.649271] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 183.650142] Call Trace: [ 183.650988] [ 183.651793] vm_access+0x1f0/0x2a0 [i915] [ 183.652726] __access_remote_vm+0x224/0x380 [ 183.653561] mem_rw.isra.0+0xf9/0x190 [ 183.654402] vfs_read+0x9d/0x1b0 [ 183.655238] ksys_read+0x63/0xe0 [ 183.656065] do_syscall_64+0x38/0xc0 [ 183.656882] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 183.657663] RIP: 0033:0x7fe5ef725142 [ 183.659351] RSP: 002b:00007ffe1e81c7e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 [ 183.660227] RAX: ffffffffffffffda RBX: 0000557055dfb780 RCX: 00007fe5ef725142 [ 183.661104] RDX: 0000000000001000 RSI: 00007ffe1e81d880 RDI: 0000000000000005 [ 183.661972] RBP: 00007ffe1e81e890 R08: 0000000000000030 R09: 0000000000000046 [ 183.662832] R10: 0000557055dfc2e0 R11: 0000000000000246 R12: 0000557055dfb1c0 [ 183.663691] R13: 00007ffe1e81e980 R14: 0000000000000000 R15: 0000000000000000 Changes since v1: - Updated if condition with range_overflows_t [Chris Wilson] Fixes: 9f909e215fea ("drm/i915: Implement vm_ops->access for gdb access into mmaps") Signed-off-by: Mastan Katragadda Suggested-by: Adam Zabrocki Reported-by: Jackson Cody Cc: Chris Wilson Cc: Jon Bloomfield Cc: Sudeep Dutt Cc: # v5.8+ Reviewed-by: Matthew Auld [mauld: tidy up the commit message and add Cc: stable] Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220303060428.1668844-1-mastanx.katragadda@intel.com (cherry picked from commit 661412e301e2ca86799aa4f400d1cf0bd38c57c6) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/gem/i915_gem_mman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f92ca72b0263d601807bbd23ed25cbe6f4da89f4 Author: Bang Li Date: Fri Mar 11 23:12:40 2022 +0800 fsnotify: remove redundant parameter judgment iput() has already judged the incoming parameter, so there is no need to repeat the judgment here. Link: https://lore.kernel.org/r/20220311151240.62045-1-libang.linuxer@gmail.com Signed-off-by: Bang Li Signed-off-by: Jan Kara fs/notify/fsnotify.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 98152eb70fffad910ee7c511b110afe98f162fc5 Author: Chaitanya Kulkarni Date: Tue Mar 8 14:56:58 2022 -0800 nvmet: use snprintf() with PAGE_SIZE in configfs Instead of using sprintf, use snprintf with buffer size limited to PAGE_SIZE just like what we have for the rest of the file. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig drivers/nvme/target/configfs.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit 73d77c53ff342bfa23daedf4475cdd06618e447b Author: Chaitanya Kulkarni Date: Tue Mar 8 14:56:57 2022 -0800 nvmet: don't fold lines Don't fold line that can fit into 80 char limit. No functional change in this patch. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig drivers/nvme/target/configfs.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) commit a8adf0cddc230be98da0e68bea846e28686dcb60 Author: Chaitanya Kulkarni Date: Tue Mar 8 21:59:27 2022 -0800 nvmet-rdma: fix kernel-doc warning for nvmet_rdma_device_removal This fixes following kernel-doc warning:- drivers/nvme/target/rdma.c:1722: warning: expecting prototype for nvme_rdma_device_removal(). Prototype was for nvmet_rdma_device_removal() instead Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig drivers/nvme/target/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0acb8231ebae5175260a7da853f525f2730cc095 Author: Chaitanya Kulkarni Date: Tue Mar 8 21:59:26 2022 -0800 nvmet-fc: fix kernel-doc warning for nvmet_fc_unregister_targetport This fixes following kernel-doc warning:- drivers/nvme/target/fc.c:1619: warning: expecting prototype for nvme_fc_unregister_targetport(). Prototype was for nvmet_fc_unregister_targetport() instead Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig drivers/nvme/target/fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b2fb99e42598ba5d1ac045fb39a2b38fd80dd8d2 Author: Chaitanya Kulkarni Date: Tue Mar 8 21:59:25 2022 -0800 nvmet-fc: fix kernel-doc warning for nvmet_fc_register_targetport This fixes following kernel-doc warning :- drivers/nvme/target/fc.c:1365: warning: expecting prototype for nvme_fc_register_targetport(). Prototype was for nvmet_fc_register_targetport() instead Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig drivers/nvme/target/fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 841aee4d75f18fdfb53935080b03de0c65e9b92c Author: Chris Leech Date: Tue Feb 15 18:22:49 2022 -0800 nvme-tcp: lockdep: annotate in-kernel sockets Put NVMe/TCP sockets in their own class to avoid some lockdep warnings. Sockets created by nvme-tcp are not exposed to user-space, and will not trigger certain code paths that the general socket API exposes. Lockdep complains about a circular dependency between the socket and filesystem locks, because setsockopt can trigger a page fault with a socket lock held, but nvme-tcp sends requests on the socket while file system locks are held. ====================================================== WARNING: possible circular locking dependency detected 5.15.0-rc3 #1 Not tainted ------------------------------------------------------ fio/1496 is trying to acquire lock: (sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sendpage+0x23/0x80 but task is already holding lock: (&xfs_dir_ilock_class/5){+.+.}-{3:3}, at: xfs_ilock+0xcf/0x290 [xfs] which lock already depends on the new lock. other info that might help us debug this: chain exists of: sk_lock-AF_INET --> sb_internal --> &xfs_dir_ilock_class/5 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&xfs_dir_ilock_class/5); lock(sb_internal); lock(&xfs_dir_ilock_class/5); lock(sk_lock-AF_INET); *** DEADLOCK *** 6 locks held by fio/1496: #0: (sb_writers#13){.+.+}-{0:0}, at: path_openat+0x9fc/0xa20 #1: (&inode->i_sb->s_type->i_mutex_dir_key){++++}-{3:3}, at: path_openat+0x296/0xa20 #2: (sb_internal){.+.+}-{0:0}, at: xfs_trans_alloc_icreate+0x41/0xd0 [xfs] #3: (&xfs_dir_ilock_class/5){+.+.}-{3:3}, at: xfs_ilock+0xcf/0x290 [xfs] #4: (hctx->srcu){....}-{0:0}, at: hctx_lock+0x51/0xd0 #5: (&queue->send_mutex){+.+.}-{3:3}, at: nvme_tcp_queue_rq+0x33e/0x380 [nvme_tcp] This annotation lets lockdep analyze nvme-tcp controlled sockets independently of what the user-space sockets API does. Link: https://lore.kernel.org/linux-nvme/CAHj4cs9MDYLJ+q+2_GXUK9HxFizv2pxUryUR0toX974M040z7g@mail.gmail.com/ Signed-off-by: Chris Leech Signed-off-by: Christoph Hellwig drivers/nvme/host/tcp.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) commit a387935c241d2517c22546f1206a77a856a40541 Author: Chaitanya Kulkarni Date: Tue Feb 22 19:36:57 2022 -0800 nvme-tcp: don't fold the line The call to nvme_tcp_alloc_queue() fits perfectly in one line without exceeding 80 char limit for the line. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig drivers/nvme/host/tcp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 462b8b2d84975758e5b74fe832bfe8145eef403f Author: Chaitanya Kulkarni Date: Tue Feb 22 19:36:56 2022 -0800 nvme-tcp: don't initialize ret variable No point in initializing ret variable to 0 in nvme_tcp_start_io_queue() since it gets overwritten by a call to nvme_tcp_start_queue(). Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8f31dded50d927974a5a696196052ed53f1baf66 Author: Guoqing Jiang Date: Wed Mar 9 14:02:28 2022 +0800 nvme-multipath: call bio_io_error in nvme_ns_head_submit_bio Use bio_io_error() here since bio_io_error does the same thing. Signed-off-by: Guoqing Jiang Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig drivers/nvme/host/multipath.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 5e6a7d1eb834be23243c48a964ced67ab0b6e9ce Author: Hannes Reinecke Date: Wed Mar 9 14:29:00 2022 +0100 nvme-multipath: use vmalloc for ANA log buffer The ANA log buffer can get really large, as it depends on the controller configuration. So to avoid an out-of-memory issue during scanning use kvmalloc() instead of the kmalloc(). Signed-off-by: Hannes Reinecke Tested-by: Daniel Wagner Signed-off-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig drivers/nvme/host/multipath.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit c14231cc04337c2c2a937db084af342ce704dbde Author: Jonathan Teh Date: Sun Mar 13 19:56:17 2022 +0000 ALSA: cmipci: Restore aux vol on suspend/resume Save and restore CM_REG_AUX_VOL instead of register 0x24 twice on suspend/resume. Tested on CMI8738LX. Fixes: cb60e5f5b2b1 ("[ALSA] cmipci - Add PM support") Signed-off-by: Jonathan Teh Cc: Link: https://lore.kernel.org/r/DBAPR04MB7366CB3EA9C8521C35C56E8B920E9@DBAPR04MB7366.eurprd04.prod.outlook.com Signed-off-by: Takashi Iwai sound/pci/cmipci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit b7557267c233b55d8e8d7ba4c68cf944fe2ec02c Author: Jason Zheng Date: Sun Mar 13 04:22:16 2022 -0500 ALSA: hda/realtek: Add quirk for ASUS GA402 ASUS GA402 requires a workaround to manage the routing of its 4 speakers like the other ASUS models. Add a corresponding quirk entry to fix it. Signed-off-by: Jason Zheng Cc: Link: https://lore.kernel.org/r/20220313092216.29858-1-jasonzheng2004@gmail.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) commit b62c563f1cb9c216cecadb15ae32d6e571e2bc8a Author: Julia Lawall Date: Sun Mar 13 09:56:35 2022 +0100 ALSA: seq: oss: fix typo Fix typo in "announcement". Reported-by: Joe Perches Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220313085635.102123-1-Julia.Lawall@inria.fr Signed-off-by: Takashi Iwai sound/core/seq/oss/seq_oss_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f9da322e864e5cd3dc217480e73f78f47cf40c5b Author: Tom Rix Date: Sat Mar 5 12:46:57 2022 -0800 cgroup: cleanup comments for spdx, add a space before // replacements judgement to judgment transofrmed to transformed partitition to partition histrical to historical migratecd to migrated Signed-off-by: Tom Rix Signed-off-by: Tejun Heo kernel/cgroup/cpuset.c | 10 +++++----- kernel/cgroup/freezer.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) commit 0e03b8fd29363f2df44e2a7a176d486de550757a Author: Herbert Xu Date: Wed Mar 9 15:20:01 2022 +1200 crypto: xilinx - Turn SHA into a tristate and allow COMPILE_TEST This patch turns the new SHA driver into a tristate and also allows compile testing. Signed-off-by: Herbert Xu drivers/crypto/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a5997f1ae84af1f6e57bb19787ab1c658db0ef37 Author: Longfang Liu Date: Wed Mar 9 10:52:44 2022 +0800 MAINTAINERS: update HPRE/SEC2/TRNG driver maintainers list Zaibo moved projects and is not looking into crypto stuff. I am responsible for checking the patches of these modules. so the maintainers list needs to be updated. I take care of HPRE, Qian Weili take care of TRNG, Ye Kai and me take care of SEC2. Signed-off-by: Longfang Liu Signed-off-by: Kai Ye Signed-off-by: Weili Qian Signed-off-by: Zaibo Xu Signed-off-by: Herbert Xu MAINTAINERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit c6ded03bcac9dde5bc7b4a1121efa050a28118b0 Author: Jiapeng Chong Date: Tue Mar 8 15:55:37 2022 +0800 crypto: dh - Remove the unused function dh_safe_prime_dh_alg() Fix the following W=1 kernel warnings: crypto/dh.c:311:31: warning: unused function 'dh_safe_prime_dh_alg' [-Wunused-function] Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Herbert Xu crypto/dh.c | 6 ------ 1 file changed, 6 deletions(-) commit 7f0f1f3ef62ed7a40e30aff28115bd94c4211d1d Author: Miaoqian Lin Date: Mon Mar 7 11:07:24 2022 +0000 hwrng: nomadik - Change clk_disable to clk_disable_unprepare The corresponding API for clk_prepare_enable is clk_disable_unprepare, other than clk_disable_unprepare. Fix this by changing clk_disable to clk_disable_unprepare. Fixes: beca35d05cc2 ("hwrng: nomadik - use clk_prepare_enable()") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Herbert Xu drivers/char/hw_random/nomadik-rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 693486d5f8951780a9bb31f7fe935171a80010e4 Author: NeilBrown Date: Mon Mar 7 10:41:45 2022 +1100 SUNRPC: change locking for xs_swap_enable/disable It is not in general safe to wait for XPRT_LOCKED to clear. A wakeup is only sent when - connection completes - sock close completes so during normal operations, this can wait indefinitely. The event we need to protect against is ->inet being set to NULL, and that happens under the recv_mutex lock. So drop the handlign of XPRT_LOCKED and use recv_mutex instead. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust net/sunrpc/xprtsock.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) commit c265de257f558a05c1859ee9e3fed04883b9ec0e Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 NFS: swap-out must always use STABLE writes. The commit handling code is not safe against memory-pressure deadlocks when writing to swap. In particular, nfs_commitdata_alloc() blocks indefinitely waiting for memory, and this can consume all available workqueue threads. swap-out most likely uses STABLE writes anyway as COND_STABLE indicates that a stable write should be used if the write fits in a single request, and it normally does. However if we ever swap with a small wsize, or gather unusually large numbers of pages for a single write, this might change. For safety, make it explicit in the code that direct writes used for swap must always use FLUSH_STABLE. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust fs/nfs/direct.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 64158668ac8b31626a8ce48db4cad08496eb8340 Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 NFS: swap IO handling is slightly different for O_DIRECT IO 1/ Taking the i_rwsem for swap IO triggers lockdep warnings regarding possible deadlocks with "fs_reclaim". These deadlocks could, I believe, eventuate if a buffered read on the swapfile was attempted. We don't need coherence with the page cache for a swap file, and buffered writes are forbidden anyway. There is no other need for i_rwsem during direct IO. So never take it for swap_rw() 2/ generic_write_checks() explicitly forbids writes to swap, and performs checks that are not needed for swap. So bypass it for swap_rw(). Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust fs/nfs/direct.c | 42 ++++++++++++++++++++++++++++-------------- fs/nfs/file.c | 4 ++-- include/linux/nfs_fs.h | 8 ++++---- 3 files changed, 34 insertions(+), 20 deletions(-) commit 4dc73c679114a2f408567e2e44770ed934190db2 Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 NFSv4: keep state manager thread active if swap is enabled If we are swapping over NFSv4, we may not be able to allocate memory to start the state-manager thread at the time when we need it. So keep it always running when swap is enabled, and just signal it to start. This requires updating and testing the cl_swapper count on the root rpc_clnt after following all ->cl_parent links. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust fs/nfs/file.c | 15 ++++++++++++--- fs/nfs/nfs4_fs.h | 1 + fs/nfs/nfs4proc.c | 20 ++++++++++++++++++++ fs/nfs/nfs4state.c | 40 +++++++++++++++++++++++++++++++++------- include/linux/nfs_xdr.h | 2 ++ net/sunrpc/clnt.c | 2 ++ 6 files changed, 70 insertions(+), 10 deletions(-) commit 8db55a032ac7ac1ed7b98d6b1dc980e6378c652f Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 SUNRPC: improve 'swap' handling: scheduling and PF_MEMALLOC rpc tasks can be marked as RPC_TASK_SWAPPER. This causes GFP_MEMALLOC to be used for some allocations. This is needed in some cases, but not in all where it is currently provided, and in some where it isn't provided. Currently *all* tasks associated with a rpc_client on which swap is enabled get the flag and hence some GFP_MEMALLOC support. GFP_MEMALLOC is provided for ->buf_alloc() but only swap-writes need it. However xdr_alloc_bvec does not get GFP_MEMALLOC - though it often does need it. xdr_alloc_bvec is called while the XPRT_LOCK is held. If this blocks, then it blocks all other queued tasks. So this allocation needs GFP_MEMALLOC for *all* requests, not just writes, when the xprt is used for any swap writes. Similarly, if the transport is not connected, that will block all requests including swap writes, so memory allocations should get GFP_MEMALLOC if swap writes are possible. So with this patch: 1/ we ONLY set RPC_TASK_SWAPPER for swap writes. 2/ __rpc_execute() sets PF_MEMALLOC while handling any task with RPC_TASK_SWAPPER set, or when handling any task that holds the XPRT_LOCKED lock on an xprt used for swap. This removes the need for the RPC_IS_SWAPPER() test in ->buf_alloc handlers. 3/ xprt_prepare_transmit() sets PF_MEMALLOC after locking any task to a swapper xprt. __rpc_execute() will clear it. 3/ PF_MEMALLOC is set for all the connect workers. Reviewed-by: Chuck Lever (for xprtrdma parts) Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust fs/nfs/write.c | 2 ++ net/sunrpc/clnt.c | 2 -- net/sunrpc/sched.c | 20 +++++++++++++++++--- net/sunrpc/xprt.c | 3 +++ net/sunrpc/xprtrdma/transport.c | 6 ++++-- net/sunrpc/xprtsock.c | 8 ++++++++ 6 files changed, 34 insertions(+), 7 deletions(-) commit 89c2be8a951654758dffeaaa6272328d9c8f29be Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 NFS: discard NFS_RPC_SWAPFLAGS and RPC_TASK_ROOTCREDS NFS_RPC_SWAPFLAGS is only used for READ requests. It sets RPC_TASK_SWAPPER which gives some memory-allocation priority to requests. This is not needed for swap READ - though it is for writes where it is set via a different mechanism. RPC_TASK_ROOTCREDS causes the 'machine' credential to be used. This is not needed as the root credential is saved when the swap file is opened, and this is used for all IO. So NFS_RPC_SWAPFLAGS isn't needed, and as it is the only user of RPC_TASK_ROOTCREDS, that isn't needed either. Remove both. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust fs/nfs/read.c | 4 ---- include/linux/nfs_fs.h | 5 ----- include/linux/sunrpc/sched.h | 1 - include/trace/events/sunrpc.h | 1 - net/sunrpc/auth.c | 2 +- 5 files changed, 1 insertion(+), 12 deletions(-) commit a80a8461868905823609be97f91776a26befe839 Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 SUNRPC: remove scheduling boost for "SWAPPER" tasks. Currently, tasks marked as "swapper" tasks get put to the front of non-priority rpc_queues, and are sorted earlier than non-swapper tasks on the transport's ->xmit_queue. This is pointless as currently *all* tasks for a mount that has swap enabled on *any* file are marked as "swapper" tasks. So the net result is that the non-priority rpc_queues are reverse-ordered (LIFO). This scheduling boost is not necessary to avoid deadlocks, and hurts fairness, so remove it. If there were a need to expedite some requests, the tk_priority mechanism is a more appropriate tool. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust net/sunrpc/sched.c | 7 ------- net/sunrpc/xprt.c | 11 ----------- 2 files changed, 18 deletions(-) commit a721035477fb5fb8abc738fbe410b07c12af3dc5 Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 SUNRPC/xprt: async tasks mustn't block waiting for memory When memory is short, new worker threads cannot be created and we depend on the minimum one rpciod thread to be able to handle everything. So it must not block waiting for memory. xprt_dynamic_alloc_slot can block indefinitely. This can tie up all workqueue threads and NFS can deadlock. So when called from a workqueue, set __GFP_NORETRY. The rdma alloc_slot already does not block. However it sets the error to -EAGAIN suggesting this will trigger a sleep. It does not. As we can see in call_reserveresult(), only -ENOMEM causes a sleep. -EAGAIN causes immediate retry. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust net/sunrpc/xprt.c | 5 ++++- net/sunrpc/xprtrdma/transport.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) commit a41b05edfedb939440e83666f23de3ef9af33acf Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 SUNRPC/auth: async tasks mustn't block waiting for memory When memory is short, new worker threads cannot be created and we depend on the minimum one rpciod thread to be able to handle everything. So it must not block waiting for memory. mempools are particularly a problem as memory can only be released back to the mempool by an async rpc task running. If all available workqueue threads are waiting on the mempool, no thread is available to return anything. lookup_cred() can block on a mempool or kmalloc - and this can cause deadlocks. So add a new RPCAUTH_LOOKUP flag for async lookups and don't block on memory. If the -ENOMEM gets back to call_refreshresult(), wait a short while and try again. HZ>>4 is chosen as it is used elsewhere for -ENOMEM retries. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust include/linux/sunrpc/auth.h | 1 + net/sunrpc/auth.c | 6 +++++- net/sunrpc/auth_gss/auth_gss.c | 6 +++++- net/sunrpc/auth_unix.c | 10 ++++++++-- net/sunrpc/clnt.c | 3 +++ 5 files changed, 22 insertions(+), 4 deletions(-) commit c487216bec83b0c5a8803e5c61433d33ad7b104d Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 SUNRPC/call_alloc: async tasks mustn't block waiting for memory When memory is short, new worker threads cannot be created and we depend on the minimum one rpciod thread to be able to handle everything. So it must not block waiting for memory. mempools are particularly a problem as memory can only be released back to the mempool by an async rpc task running. If all available workqueue threads are waiting on the mempool, no thread is available to return anything. rpc_malloc() can block, and this might cause deadlocks. So check RPC_IS_ASYNC(), rather than RPC_IS_SWAPPER() to determine if blocking is acceptable. Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust net/sunrpc/sched.c | 4 +++- net/sunrpc/xprtrdma/transport.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) commit 944d95f766c6fe97fa358c661281a741758cee7e Author: NeilBrown Date: Mon Mar 7 10:41:44 2022 +1100 NFS: remove IS_SWAPFILE hack This code is pointless as IS_SWAPFILE is always defined. So remove it. Suggested-by: Mark Hemment Reviewed-by: Christoph Hellwig Signed-off-by: NeilBrown Signed-off-by: Trond Myklebust fs/nfs/file.c | 5 ----- 1 file changed, 5 deletions(-) commit b5fdf66f6eb2560784c6f60131dc567de06267dc Author: Dave Wysochanski Date: Tue Mar 1 14:37:27 2022 -0500 NFS: Remove remaining dfprintks related to fscache and remove NFSDBG_FSCACHE The fscache cookie APIs including fscache_acquire_cookie() and fscache_relinquish_cookie() now have very good tracing. Thus, there is no real need for dfprintks in the NFS fscache interface. The NFS fscache interface has removed all dfprintks so remove the NFSDBG_FSCACHE defines. Signed-off-by: Dave Wysochanski Signed-off-by: Trond Myklebust fs/nfs/fscache.c | 10 ---------- include/uapi/linux/nfs_fs.h | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) commit e3f0a7fe698ff0d3ef428f72ba253fd1f377c193 Author: Dave Wysochanski Date: Tue Mar 1 14:37:26 2022 -0500 NFS: Replace dfprintks with tracepoints in fscache read and write page functions Most of fscache and other NFS IO paths are now using tracepoints. Remove the dfprintks in the NFS fscache read/write page functions and replace with tracepoints at the begin and end of the functions. Signed-off-by: Dave Wysochanski Signed-off-by: Trond Myklebust fs/nfs/fscache.c | 29 +++++++----------- fs/nfs/nfstrace.h | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 18 deletions(-) commit fc1c5abfca7e1059df46623e64aecf840cdbb9dc Author: Dave Wysochanski Date: Tue Mar 1 14:37:25 2022 -0500 NFS: Rename fscache read and write pages functions Rename NFS fscache functions in a more consistent fashion to better reflect when we read from and write to fscache. Signed-off-by: Dave Wysochanski Signed-off-by: Trond Myklebust fs/nfs/fscache.c | 6 +++--- fs/nfs/fscache.h | 27 ++++++++++----------------- fs/nfs/read.c | 4 ++-- 3 files changed, 15 insertions(+), 22 deletions(-) commit 45f3a70ba68e1fc7fe0edde731b08d85435da30d Author: Dave Wysochanski Date: Tue Mar 1 14:37:24 2022 -0500 NFS: Cleanup usage of nfs_inode in fscache interface A number of places in the fscache interface used nfs_inode when inode could be used, simplifying the code. Signed-off-by: Dave Wysochanski Signed-off-by: Trond Myklebust fs/nfs/fscache.c | 10 ++++------ fs/nfs/fscache.h | 18 +++++++++--------- 2 files changed, 13 insertions(+), 15 deletions(-) commit b4be2c598b767eb72507e4dc56d75c3fe2231cee Author: Olga Kornievskaia Date: Tue Feb 15 13:26:41 2022 -0500 NFSv4.1 restrict GETATTR fs_location query to the main transport In the presence of trunking transports, it's helpful to make sure that during the migration event, the GETATTR for fs_location attribute happens on the main transport. Signed-off-by: Olga Kornievskaia Signed-off-by: Trond Myklebust fs/nfs/nfs4proc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) commit cb8fac6d2727f79f211e745b16c9abbf4d8be652 Author: Alexey Khoroshilov Date: Tue Feb 15 13:17:04 2022 +0300 NFS: remove unneeded check in decode_devicenotify_args() [You don't often get email from khoroshilov@ispras.ru. Learn why this is important at http://aka.ms/LearnAboutSenderIdentification.] Overflow check in not needed anymore after we switch to kmalloc_array(). Signed-off-by: Alexey Khoroshilov Fixes: a4f743a6bb20 ("NFSv4.1: Convert open-coded array allocation calls to kmalloc_array()") Signed-off-by: Trond Myklebust fs/nfs/callback_xdr.c | 4 ---- 1 file changed, 4 deletions(-) commit 8109517b394e6deab5fd21cc5460e82ffed229c6 Author: Arnaud Pouliquen Date: Mon Jan 24 11:25:24 2022 +0100 rpmsg: ctrl: Introduce new RPMSG_CREATE/RELEASE_DEV_IOCTL controls Allow the user space application to create and release an rpmsg device by adding RPMSG_CREATE_DEV_IOCTL and RPMSG_RELEASE_DEV_IOCTL ioctrls to the /dev/rpmsg_ctrl interface The RPMSG_CREATE_DEV_IOCTL Ioctl can be used to instantiate a local rpmsg device. Depending on the back-end implementation, the associated rpmsg driver is probed and a NS announcement can be sent to the remote processor. The RPMSG_RELEASE_DEV_IOCTL allows the user application to release a rpmsg device created either by the remote processor or with the RPMSG_CREATE_DEV_IOCTL call. Depending on the back-end implementation, the associated rpmsg driver is removed and a NS destroy rpmsg can be sent to the remote processor. Suggested-by: Mathieu Poirier Signed-off-by: Arnaud Pouliquen Reviewed-by: Mathieu Poirier Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220124102524.295783-12-arnaud.pouliquen@foss.st.com drivers/rpmsg/rpmsg_ctrl.c | 36 ++++++++++++++++++++++++++++++++---- include/uapi/linux/rpmsg.h | 10 ++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) commit bc69d10665690492421d926b1cd9a7a36bffd691 Author: Arnaud Pouliquen Date: Mon Jan 24 11:25:23 2022 +0100 rpmsg: char: Introduce the "rpmsg-raw" channel For the rpmsg virtio backend, the current implementation of the rpmsg char only allows to instantiate static(i.e. prefixed source and destination addresses) end points, and only on the Linux user space initiative. This patch defines the "rpmsg-raw" channel and registers it to the rpmsg bus. This registration allows: - To create the channel at the initiative of the remote processor relying on the name service announcement mechanism. In other words the /dev/rpmsgX interface is instantiate by the remote processor. - To use the channel object instead of the endpoint, thus preventing the user space from having the knowledge of the remote processor's endpoint addresses. - To rely on udev to be inform when a /dev/rpmsgX is created on remote processor request, indicating that the remote processor is ready to communicate. Signed-off-by: Arnaud Pouliquen Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220124102524.295783-11-arnaud.pouliquen@foss.st.com drivers/rpmsg/rpmsg_char.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) commit bea9b79c2d10fecf7bfa26e212ecefe61d232e39 Author: Arnaud Pouliquen Date: Mon Jan 24 11:25:22 2022 +0100 rpmsg: char: Add possibility to use default endpoint of the rpmsg device Current implementation create/destroy a new endpoint on each rpmsg_eptdev_open/rpmsg_eptdev_release calls. For a rpmsg device created by the NS announcement a default endpoint is created. In this case we have to reuse the default rpmsg device endpoint associated to the channel instead of creating a new one. This patch prepares the introduction of a rpmsg channel device for the char device. The rpmsg channel device will require a default endpoint to communicate to the remote processor. Add the default_ept field in rpmsg_eptdev structure.This pointer determines the behavior on rpmsg_eptdev_open and rpmsg_eptdev_release call. - If default_ept == NULL: Use the legacy behavior by creating a new endpoint each time rpmsg_eptdev_open is called and release it when rpmsg_eptdev_release is called on /dev/rpmsgX device open/close. - If default_ept is set: use the rpmsg device default endpoint for the communication. Add protection in rpmsg_eptdev_ioctl to prevent to destroy a default endpoint. Signed-off-by: Arnaud Pouliquen Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220124102524.295783-10-arnaud.pouliquen@foss.st.com drivers/rpmsg/rpmsg_char.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) commit cc9da7de4a7c188fbcc4536a460cb73193a68b46 Author: Arnaud Pouliquen Date: Mon Jan 24 11:25:21 2022 +0100 rpmsg: char: Refactor rpmsg_chrdev_eptdev_create function Introduce the rpmsg_chrdev_eptdev_alloc and rpmsg_chrdev_eptdev_add internal function to split the allocation part from the device add. This patch prepares the introduction of a rpmsg channel device for the char device. An default endpoint will be created, referenced in the rpmsg_eptdev structure before adding the devices. Signed-off-by: Arnaud Pouliquen Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220124102524.295783-9-arnaud.pouliquen@foss.st.com drivers/rpmsg/rpmsg_char.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) commit 472f84eef700ea3014b10a95bc136784b5391fac Author: Arnaud Pouliquen Date: Mon Jan 24 11:25:20 2022 +0100 rpmsg: Update rpmsg_chrdev_register_device function The rpmsg_chrdev driver has been replaced by the rpmsg_ctrl driver for the /dev/rpmsg_ctrlX devices management. The reference for the driver override is now the rpmsg_ctrl. Update the rpmsg_chrdev_register_device function to reflect the update, and rename the function to use the rpmsg_ctrldev prefix. The platform drivers are updated accordingly. Signed-off-by: Arnaud Pouliquen Reviewed-by: Mathieu Poirier Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220124102524.295783-8-arnaud.pouliquen@foss.st.com drivers/rpmsg/qcom_glink_native.c | 2 +- drivers/rpmsg/qcom_smd.c | 2 +- drivers/rpmsg/rpmsg_ctrl.c | 2 +- drivers/rpmsg/rpmsg_internal.h | 8 ++++---- drivers/rpmsg/virtio_rpmsg_bus.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) commit 617d32938d1be0d67bad73a914635bf787c319c1 Author: Arnaud Pouliquen Date: Mon Jan 24 11:25:16 2022 +0100 rpmsg: Move the rpmsg control device from rpmsg_char to rpmsg_ctrl Create the rpmsg_ctrl.c module and move the code related to the rpmsg_ctrldev device in this new module. Add the dependency between rpmsg_char and rpmsg_ctrl in the kconfig file: 1) RPMSG_CTRL can set as module or built-in if RPMSG=y || RPMSG_CHAR=y || RPMSG_CHAR=n 2) RPMSG_CTRL can not be set as built-in if RPMSG=m || RPMSG_CHAR=m Note that RPMGH_CHAR and RPMSG_CTRL can be activated separately. Therefore, the RPMSG_CTRL configuration must be set for backwards compatibility. Signed-off-by: Arnaud Pouliquen Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220124102524.295783-4-arnaud.pouliquen@foss.st.com drivers/rpmsg/Kconfig | 8 ++ drivers/rpmsg/Makefile | 1 + drivers/rpmsg/rpmsg_char.c | 160 +-------------------------------- drivers/rpmsg/rpmsg_ctrl.c | 215 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 226 insertions(+), 158 deletions(-) commit 608edd96049b142de7944413cd7c24cb3f203d37 Author: Arnaud Pouliquen Date: Mon Jan 24 11:25:15 2022 +0100 rpmsg: Create the rpmsg class in core instead of in rpmsg char Migrate the creation of the rpmsg class from the rpmsg_char to the core that the class is usable by the rpmsg_char and the future rpmsg_ctrl module. Suggested-by: Bjorn Andersson Signed-off-by: Arnaud Pouliquen Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220124102524.295783-3-arnaud.pouliquen@foss.st.com drivers/rpmsg/rpmsg_char.c | 11 +---------- drivers/rpmsg/rpmsg_core.c | 15 +++++++++++++-- drivers/rpmsg/rpmsg_internal.h | 2 ++ 3 files changed, 16 insertions(+), 12 deletions(-) commit 69265bc12b6567c6aa9550a198b791e876fbfd2c Author: Arnaud Pouliquen Date: Mon Jan 24 11:25:14 2022 +0100 rpmsg: char: Export eptdev create and destroy functions To prepare the split of the code related to the control (ctrldev) and the endpoint (eptdev) devices in 2 separate files: - Rename and export the functions in rpmsg_char.h. - Suppress the dependency with the rpmsg_ctrldev struct in the rpmsg_eptdev_create function. Suggested-by: Mathieu Poirier Signed-off-by: Arnaud Pouliquen Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220124102524.295783-2-arnaud.pouliquen@foss.st.com drivers/rpmsg/rpmsg_char.c | 18 +++++++++++------- drivers/rpmsg/rpmsg_char.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 7 deletions(-) commit cbf58250b33e26d7e8e84919ee71eb1129f91f12 Author: Tim Blechmann Date: Sun Mar 13 10:45:41 2022 +0800 rpmsg: char: treat rpmsg_trysend() ENOMEM as EAGAIN rpmsg_trysend() returns -ENOMEM when no rpmsg buffer can be allocated. this causes write to fail with this error as opposed to -EAGAIN. this is what user space applications (and libraries like boost.asio) would expect when using normal character devices. Signed-off-by: Tim Blechmann Cc: Arnaud Pouliquen Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220313024541.1579848-2-tim@klingt.org drivers/rpmsg/rpmsg_char.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit de29aff976d3216e7f3ab41fcd7af46fa8f7eab7 Merge: 97aeb877de7f aa66ae9b241e Author: David S. Miller Date: Sun Mar 13 10:25:12 2022 +0000 Merge tag 'linux-can-next-for-5.18-20220313' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next linux-can-next-for-5.18-20220313 Marc Kleine-Budde says: ==================== pull-request: can-next 2022-03-13 this is a pull request of 13 patches for net-next/master. The 1st patch is by me and fixes the freeing of a skb in the vxcan driver (initially added in this net-next window). The remaining 12 patches are also by me and target the mcp251xfd driver. The first patch fixes a printf modifier (initially added in this net-next window). The remaining patches add ethtool based ring and RX/TX IRQ coalescing support to the driver. ==================== Signed-off-by: David S. Miller commit aa66ae9b241eadd5d31077f869f298444c98a85f Author: Marc Kleine-Budde Date: Mon Oct 25 11:49:24 2021 +0200 can: mcp251xfd: ring: increase number of RX-FIFOs to 3 and increase max TX-FIFO depth to 16 This patch increases the number of RX-FIFOs to 3 and the max TX-FIFO depth to 16. This leads to the following default ring configuration. CAN-2.0 mode: | FIFO setup: TEF: 0x400: 8*12 bytes = 96 bytes | FIFO setup: RX-0: FIFO 1/0x460: 32*20 bytes = 640 bytes | FIFO setup: RX-1: FIFO 2/0x6e0: 32*20 bytes = 640 bytes | FIFO setup: RX-2: FIFO 3/0x960: 16*20 bytes = 320 bytes | FIFO setup: TX: FIFO 4/0xaa0: 8*16 bytes = 128 bytes | FIFO setup: free: 224 bytes CAN-FD mode: | FIFO setup: TEF: 0x400: 4*12 bytes = 48 bytes | FIFO setup: RX-0: FIFO 1/0x430: 16*76 bytes = 1216 bytes | FIFO setup: RX-1: FIFO 2/0x8f0: 4*76 bytes = 304 bytes | FIFO setup: TX: FIFO 3/0xa20: 4*72 bytes = 288 bytes | FIFO setup: free: 192 bytes With the previously added ethtool ring configuration support the RAM on the chip can now be runtime configured between RX and TX buffers. Link: https://lore.kernel.org/20220313083640.501791-13-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 656fc12ddaf8fbd126c2a56d50a9e226379cb2b0 Author: Marc Kleine-Budde Date: Mon Nov 15 12:21:11 2021 +0100 can: mcp251xfd: add TX IRQ coalescing ethtool support This patch adds support ethtool based configuration for the TX IRQ coalescing added in the previous patch. Link: https://lore.kernel.org/20220313083640.501791-12-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-ethtool.c | 23 ++++++++++++++++++++--- drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 1 + drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) commit 169d00a25658bccee7e155daa624aa74940eab7f Author: Marc Kleine-Budde Date: Mon Nov 15 12:21:11 2021 +0100 can: mcp251xfd: add TX IRQ coalescing support This patch adds TX IRQ coalescing support to the driver. The implemented algorithm is similar to the RX IRQ coalescing support added in the previous patch. Link: https://lore.kernel.org/20220313083640.501791-11-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 68 ++++++++++++++++++++++++-- drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c | 6 +++ drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 8 +++ 3 files changed, 77 insertions(+), 5 deletions(-) commit 846990e0ed828925dccae68e3482f468d1a46b49 Author: Marc Kleine-Budde Date: Tue Feb 16 11:46:16 2021 +0100 can: mcp251xfd: add RX IRQ coalescing ethtool support This patch adds support ethtool based configuration for the RX IRQ coalescing added in the previous patch. Link: https://lore.kernel.org/20220313083640.501791-10-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-ethtool.c | 55 +++++++++++++++++++++++ drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 1 + drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 1 + 3 files changed, 57 insertions(+) commit 60a848c50d2d8923d56e1ac6071c07c82fda3fb1 Author: Marc Kleine-Budde Date: Tue Feb 16 11:46:16 2021 +0100 can: mcp251xfd: add RX IRQ coalescing support This patch adds RX IRQ coalescing support to the driver. The mcp251xfd chip doesn't support proper hardware based coalescing, so this patch tries to implemented it in software. The RX-FIFO offers a "FIFO not empty" interrupt, which is used if no coalescing is active. With activated RX IRQ coalescing the "FIFO not empty" interrupt is disabled in the RX IRQ handler and the "FIFO half full" or "FIFO full interrupt" (depending on RX max coalesced frames IRQ) is used instead. To avoid RX CAN frame starvation a hrtimer is setup with RX coalesce usecs IRQ,on timer expiration the "FIFO not empty" is enabled again. Support for ethtool configuration is added in the next patch. Link: https://lore.kernel.org/20220313083640.501791-9-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 5 ++ drivers/net/can/spi/mcp251xfd/mcp251xfd-ethtool.c | 3 + drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 103 ++++++++++++++++++++-- drivers/net/can/spi/mcp251xfd/mcp251xfd-rx.c | 12 ++- drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 10 +++ 5 files changed, 123 insertions(+), 10 deletions(-) commit 9263c2e92be95a7bba009d760420170f808c2243 Author: Marc Kleine-Budde Date: Mon Oct 25 11:34:32 2021 +0200 can: mcp251xfd: ring: add support for runtime configurable RX/TX ring parameters This patch adds runtime configurable RX and TX ring parameters via ethtool to the driver. Link: https://lore.kernel.org/20220313083640.501791-8-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-ethtool.c | 37 +++++++++++++- drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 59 +++++++++++++++++------ drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 9 ++++ 3 files changed, 88 insertions(+), 17 deletions(-) commit c9e6b80dfd48d1229348ac278da2a5cb79024b32 Author: Marc Kleine-Budde Date: Mon Oct 25 11:34:32 2021 +0200 can: mcp251xfd: update macros describing ring, FIFO and RAM layout So far the configuration of the hardware FIFOs is hard coded and depend only on the selected CAN mode (CAN-2.0 or CAN-FD). This patch updates the macros describing the ring, FIFO and RAM layout to prepare for the next patches that add support for runtime configurable ring parameters via ethtool. Link: https://lore.kernel.org/20220313083640.501791-7-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 4 +-- drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 38 ++++++++++++-------------- 2 files changed, 19 insertions(+), 23 deletions(-) commit 0a1f2e6502a1ea55db78ae1baaba4b6f0c0c3b53 Author: Marc Kleine-Budde Date: Mon Oct 25 11:34:32 2021 +0200 can: mcp251xfd: ring: prepare support for runtime configurable RX/TX ring parameters This patch prepares the driver for runtime configurable RX and TX ring parameters. The actual runtime config support will be added in the next patch. Link: https://lore.kernel.org/20220313083640.501791-6-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 26 +++++++++++--------------- drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 2 ++ 2 files changed, 13 insertions(+), 15 deletions(-) commit d86ba8db6af3af567cd9a20e194e5ebd8f21987e Author: Marc Kleine-Budde Date: Mon Oct 25 11:34:32 2021 +0200 can: mcp251xfd: ethtool: add support This patch adds basic ethtool support (to query the current and maximum ring parameters) to the driver. Link: https://lore.kernel.org/20220313083640.501791-5-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/Makefile | 1 + drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 ++ drivers/net/can/spi/mcp251xfd/mcp251xfd-ethtool.c | 35 +++++++++++++++++++++++ drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 4 +++ drivers/net/can/spi/mcp251xfd/mcp251xfd.h | 2 ++ 5 files changed, 44 insertions(+) commit b8123d94f58cdd1f3d476f60156fc356194bec55 Author: Marc Kleine-Budde Date: Tue Feb 16 11:46:16 2021 +0100 can: mcp251xfd: ram: coalescing support This patch adds support for coalescing to the RAM layout calculation. Link: https://lore.kernel.org/20220313083640.501791-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-ram.c | 70 ++++++++++++++++++++++++--- drivers/net/can/spi/mcp251xfd/mcp251xfd-ram.h | 5 ++ 2 files changed, 68 insertions(+), 7 deletions(-) commit a1439a5add6266ae1c02d2ef60c188ae16f4384a Author: Marc Kleine-Budde Date: Fri Oct 22 19:11:57 2021 +0200 can: mcp251xfd: ram: add helper function for runtime ring size calculation This patch adds a helper function to calculate the ring configuration of the controller based on various constraints, like available RAM, size of RX and TX objects, CAN-mode, number of FIFOs and FIFO depth. Link: https://lore.kernel.org/20220313083640.501791-3-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/Makefile | 1 + drivers/net/can/spi/mcp251xfd/mcp251xfd-ram.c | 97 +++++++++++++++++++++++++++ drivers/net/can/spi/mcp251xfd/mcp251xfd-ram.h | 57 ++++++++++++++++ 3 files changed, 155 insertions(+) commit c47675b11ba12a2369bbc562f9acb5e84a37951e Author: Marc Kleine-Budde Date: Sun Mar 6 14:54:07 2022 +0100 can: mcp251xfd: mcp251xfd_ring_init(): use %d to print free RAM In case of an erroneous ring configuration more RAM than available might be used. Change the printf modifier to a signed int to properly print this erroneous value. Fixes: 83daa863f16b ("can: mcp251xfd: ring: update FIFO setup debug info") Link: https://lore.kernel.org/20220313083640.501791-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fc7dcd05f4c2660cf665bb1c2b9cd82e8d9d8bd8 Author: Marc Kleine-Budde Date: Fri Mar 11 12:27:43 2022 +0100 can: vxcan: vxcan_xmit(): use kfree_skb() instead of kfree() to free skb This patch fixes the freeing of the "oskb", by using kfree_skb() instead of kfree(). Fixes: 1574481bb3de ("vxcan: remove sk reference in peer skb") Link: https://lore.kernel.org/all/20220311123741.382618-1-mkl@pengutronix.de Cc: Oliver Hartkopp Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Marc Kleine-Budde drivers/net/can/vxcan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1e24078113ae69c741cb1b03375a9f1490db7308 Author: Arnd Bergmann Date: Tue Mar 8 22:56:15 2022 +0100 Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS As we change the C language standard for the kernel from gnu89 to gnu11, it makes sense to also update the version for user space compilation. Some users have older native compilers than what they use for kernel builds, so I considered using gnu99 as the default version for wider compatibility with gcc-4.6 and earlier. However, testing with older compilers showed that we already require HOSTCC version 5.1 as well because a lot of host tools include linux/compiler.h that uses __has_attribute(): CC tools/objtool/exec-cmd.o In file included from tools/include/linux/compiler_types.h:36:0, from tools/include/linux/compiler.h:5, from exec-cmd.c:2: tools/include/linux/compiler-gcc.h:19:5: error: "__has_attribute" is not defined [-Werror=undef] Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Tested-by: Sedat Dilek Signed-off-by: Masahiro Yamada Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e8c07082a810fbb9db303a2b66b66b8d7e588b53 Author: Arnd Bergmann Date: Tue Mar 8 22:56:14 2022 +0100 Kbuild: move to -std=gnu11 During a patch discussion, Linus brought up the option of changing the C standard version from gnu89 to gnu99, which allows using variable declaration inside of a for() loop. While the C99, C11 and later standards introduce many other features, most of these are already available in gnu89 as GNU extensions as well. An earlier attempt to do this when gcc-5 started defaulting to -std=gnu11 failed because at the time that caused warnings about designated initializers with older compilers. Now that gcc-5.1 is the minimum compiler version used for building kernels, that is no longer a concern. Similarly, the behavior of 'inline' functions changes between gnu89 using gnu_inline behavior and gnu11 using standard c99+ behavior, but this was taken care of by defining 'inline' to include __attribute__((gnu_inline)) in order to allow building with clang a while ago. Nathan Chancellor reported a new -Wdeclaration-after-statement warning that appears in a system header on arm, this still needs a workaround. The differences between gnu99, gnu11, gnu1x and gnu17 are fairly minimal and mainly impact warnings at the -Wpedantic level that the kernel never enables. Between these, gnu11 is the newest version that is supported by all supported compiler versions, though it is only the default on gcc-5, while all other supported versions of gcc or clang default to gnu1x/gnu17. Link: https://lore.kernel.org/lkml/CAHk-=wiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdKpcovt8fYbVFW3TA@mail.gmail.com/ Link: https://github.com/ClangBuiltLinux/linux/issues/1603 Suggested-by: Linus Torvalds Acked-by: Marco Elver Acked-by: Jani Nikula Acked-by: David Sterba Tested-by: Sedat Dilek Reviewed-by: Alex Shi Reviewed-by: Nick Desaulniers Reviewed-by: Miguel Ojeda Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Signed-off-by: Masahiro Yamada Documentation/process/programming-language.rst | 6 +++--- Documentation/translations/it_IT/process/programming-language.rst | 4 ++-- Documentation/translations/zh_CN/process/programming-language.rst | 3 +-- Documentation/translations/zh_TW/process/programming-language.rst | 3 +-- Makefile | 4 ++-- arch/arm64/kernel/vdso32/Makefile | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-) commit 4d94f910e79a349b00a4f8aab6f3ae87129d8c5a Author: Mark Rutland Date: Tue Mar 8 22:56:13 2022 +0100 Kbuild: use -Wdeclaration-after-statement The kernel is moving from using `-std=gnu89` to `-std=gnu11`, permitting the use of additional C11 features such as for-loop initial declarations. One contentious aspect of C99 is that it permits mixed declarations and code, and for now at least, it seems preferable to enforce that declarations must come first. These warnings were already enabled in the kernel itself, but not for KBUILD_USERCFLAGS or the compat VDSO on arch/arm64, which uses a separate set of CFLAGS. This patch fixes an existing violation in modpost.c, which is not reported because of the missing flag in KBUILD_USERCFLAGS: | scripts/mod/modpost.c: In function ‘match’: | scripts/mod/modpost.c:837:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | 837 | const char *endp = p + strlen(p) - 1; | | ^~~~~ Signed-off-by: Mark Rutland [arnd: don't add a duplicate flag to the default set, update changelog] Signed-off-by: Arnd Bergmann Reviewed-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Tested-by: Sedat Dilek # LLVM/Clang v13.0.0 (x86-64) Signed-off-by: Masahiro Yamada Makefile | 3 ++- arch/arm64/kernel/vdso32/Makefile | 1 + scripts/mod/modpost.c | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) commit 1344794a59db2bd44b4919d2d75300fd3b1c2cd7 Author: Arnd Bergmann Date: Tue Mar 8 22:56:12 2022 +0100 Kbuild: add -Wno-shift-negative-value where -Wextra is used As a preparation for moving to -std=gnu11, turn off the -Wshift-negative-value option. This warning is enabled by gcc when building with -Wextra for c99 or higher, but not for c89. Since the kernel already relies on well-defined overflow behavior, the warning is not helpful and can simply be disabled in all locations that use -Wextra. Signed-off-by: Arnd Bergmann Acked-by: Jani Nikula Reviewed-by: Nathan Chancellor Tested-by: Sedat Dilek # LLVM/Clang v13.0.0 (x86-64) Signed-off-by: Masahiro Yamada drivers/gpu/drm/i915/Makefile | 1 + drivers/staging/greybus/tools/Makefile | 3 ++- fs/btrfs/Makefile | 1 + scripts/Makefile.extrawarn | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) commit 3baa40d4fd7ff6553325715b8a64cc8b43fd02ef Author: Julia Lawall Date: Sat Mar 12 11:27:02 2022 +0100 ALSA: seq: oss: use kzalloc Use kzalloc instead of kmalloc + memset. The semantic patch that makes this change is: (https://coccinelle.gitlabpages.inria.fr/website/) // @@ expression res, size, flag; @@ - res = kmalloc(size, flag); + res = kzalloc(size, flag); ... - memset(res, 0, size); // Signed-off-by: Julia Lawall Link: https://lore.kernel.org/r/20220312102705.71413-4-Julia.Lawall@inria.fr Signed-off-by: Takashi Iwai sound/core/seq/oss/seq_oss_init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 3e504d2026eb6c8762cd6040ae57db166516824a Author: Jason A. Donenfeld Date: Tue Mar 8 10:12:16 2022 -0700 random: check for signal and try earlier when generating entropy Rather than waiting a full second in an interruptable waiter before trying to generate entropy, try to generate entropy first and wait second. While waiting one second might give an extra second for getting entropy from elsewhere, we're already pretty late in the init process here, and whatever else is generating entropy will still continue to contribute. This has implications on signal handling: we call try_to_generate_entropy() from wait_for_random_bytes(), and wait_for_random_bytes() always uses wait_event_interruptible_timeout() when waiting, since it's called by userspace code in restartable contexts, where signals can pend. Since try_to_generate_entropy() now runs first, if a signal is pending, it's necessary for try_to_generate_entropy() to check for signals, since it won't hit the wait until after try_to_generate_entropy() has returned. And even before this change, when entering a busy loop in try_to_generate_entropy(), we should have been checking to see if any signals are pending, so that a process doesn't get stuck in that loop longer than expected. Cc: Theodore Ts'o Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 7a7ff644aeaf071d433caffb3b8ea57354b55bd3 Author: Jason A. Donenfeld Date: Tue Mar 8 23:32:34 2022 -0700 random: reseed more often immediately after booting In order to chip away at the "premature first" problem, we augment our existing entropy accounting with more frequent reseedings at boot. The idea is that at boot, we're getting entropy from various places, and we're not very sure which of early boot entropy is good and which isn't. Even when we're crediting the entropy, we're still not totally certain that it's any good. Since boot is the one time (aside from a compromise) that we have zero entropy, it's important that we shepherd entropy into the crng fairly often. At the same time, we don't want a "premature next" problem, whereby an attacker can brute force individual bits of added entropy. In lieu of going full-on Fortuna (for now), we can pick a simpler strategy of just reseeding more often during the first 5 minutes after boot. This is still bounded by the 256-bit entropy credit requirement, so we'll skip a reseeding if we haven't reached that, but in case entropy /is/ coming in, this ensures that it makes its way into the crng rather rapidly during these early stages. Ordinarily we reseed if the previous reseeding is 300 seconds old. This commit changes things so that for the first 600 seconds of boot time, we reseed if the previous reseeding is uptime / 2 seconds old. That means that we'll reseed at the very least double the uptime of the previous reseeding. Cc: Theodore Ts'o Reviewed-by: Eric Biggers Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) commit 7f142440847480838e0c4b3092f24455cec111a7 Author: Ritesh Harjani Date: Sat Mar 12 11:09:49 2022 +0530 ext4: do not call FC trace event in ext4_fc_commit() if FS does not support FC This just puts trace_ext4_fc_commit_start(sb) & ktime_get() for measuring FC commit time, after the check of whether sb supports JOURNAL_FAST_COMMIT or not. Signed-off-by: Ritesh Harjani Reviewed-by: Harshad Shirwadkar Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/d53cf3e535924ec0a1eb41a560e96561b0727e7a.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/fast_commit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 8cb5a30372ef5cf2b1d258fce1711d80f834740a Author: Ritesh Harjani Date: Sat Mar 12 11:09:48 2022 +0530 ext4: convert ext4_fc_track_dentry type events to use event class One should use DECLARE_EVENT_CLASS for similar event types instead of defining TRACE_EVENT for each event type. This is helpful in reducing the text section footprint for e.g. [1] [1]: https://lwn.net/Articles/381064/ Signed-off-by: Ritesh Harjani Reviewed-by: Harshad Shirwadkar Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/a019cb46219ef4b30e4d98d7ced7d8819a2fc61d.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o include/trace/events/ext4.h | 56 +++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 25 deletions(-) commit 7af1974af0a9ba8a8ed2e3e947d87dd4d9a78d27 Author: Ritesh Harjani Date: Sat Mar 12 11:09:47 2022 +0530 ext4: fix ext4_fc_stats trace point ftrace's __print_symbolic() requires that any enum values used in the symbol to string translation table be wrapped in a TRACE_DEFINE_ENUM so that the enum value can be decoded from the ftrace ring buffer by user space tooling. This patch also fixes few other problems found in this trace point. e.g. dereferencing structures in TP_printk which should not be done at any cost. Also to avoid checkpatch warnings, this patch removes those whitespaces/tab stops issues. Cc: stable@kernel.org Fixes: aa75f4d3daae ("ext4: main fast-commit commit path") Reported-by: Steven Rostedt Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Reviewed-by: Steven Rostedt (Google) Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/b4b9691414c35c62e570b723e661c80674169f9a.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o include/trace/events/ext4.h | 78 ++++++++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 29 deletions(-) commit c864ccd182d6ff2730a0f5b636c6b7c48f6f4f7f Author: Ritesh Harjani Date: Sat Mar 12 11:09:46 2022 +0530 ext4: remove unused enum EXT4_FC_COMMIT_FAILED Below commit removed all references of EXT4_FC_COMMIT_FAILED. commit 0915e464cb274 ("ext4: simplify updating of fast commit stats") Just remove it since it is not used anymore. Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/c941357e476be07a1138c7319ca5faab7fb80fc6.1647057583.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/fast_commit.h | 1 - 1 file changed, 1 deletion(-) commit 2bb8dd401a4f96973d6a9de4218d7f01fbd497ee Author: Jan Kara Date: Thu Mar 10 11:18:32 2022 +0100 ext4: warn when dirtying page w/o buffers in data=journal mode Recently I've got a report of BUG_ON trigerring during transaction commit in ext4_journalled_writepage_callback() because we've spotted a dirty page without buffers. Add WARN_ON_ONCE to ext4_journalled_set_page_dirty() to catch the problematic condition earlier where we have better chance of understanding which code path is creating dirty data without preparing the page properly. Also update the comment with current information when we are at it. Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220310101832.5645-1-jack@suse.cz Signed-off-by: Theodore Ts'o fs/ext4/inode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 688b0d8536e0e937f608a93cb6909e14389a0c45 Author: lianzhi chang Date: Thu Mar 10 09:44:15 2022 +0800 doc: fixed a typo in ext4 documentation The unit of file system size should be TiB, not PiB Signed-off-by: lianzhi chang Link: https://lore.kernel.org/r/20220310014415.29937-1-changlianzhi@uniontech.com Signed-off-by: Theodore Ts'o Documentation/filesystems/ext4/blocks.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 077d0c2c78df6f7260cdd015a991327efa44d8ad Author: Ojaswin Mujoo Date: Tue Mar 8 15:22:01 2022 +0530 ext4: make mb_optimize_scan performance mount option work with extents Currently mb_optimize_scan scan feature which improves filesystem performance heavily (when FS is fragmented), seems to be not working with files with extents (ext4 by default has files with extents). This patch fixes that and makes mb_optimize_scan feature work for files with extents. Below are some performance numbers obtained when allocating a 10M and 100M file with and w/o this patch on a filesytem with no 1M contiguous block. =============== Workload: dd if=/dev/urandom of=test conv=fsync bs=1M count=10/100 Time taken ===================================================== no. Size without-patch with-patch Diff(%) 1 10M 0m8.401s 0m5.623s 33.06% 2 100M 1m40.465s 1m14.737s 25.6% ============= w/o patch: mballoc: reqs: 17056 success: 11407 groups_scanned: 13643 cr0_stats: hits: 37 groups_considered: 9472 useless_loops: 36 bad_suggestions: 0 cr1_stats: hits: 11418 groups_considered: 908560 useless_loops: 1894 bad_suggestions: 0 cr2_stats: hits: 1873 groups_considered: 6913 useless_loops: 21 cr3_stats: hits: 21 groups_considered: 5040 useless_loops: 21 extents_scanned: 417364 goal_hits: 3707 2^n_hits: 37 breaks: 1873 lost: 0 buddies_generated: 239/240 buddies_time_used: 651080 preallocated: 705 discarded: 478 with patch: mballoc: reqs: 12768 success: 11305 groups_scanned: 12768 cr0_stats: hits: 1 groups_considered: 18 useless_loops: 0 bad_suggestions: 0 cr1_stats: hits: 5829 groups_considered: 50626 useless_loops: 0 bad_suggestions: 0 cr2_stats: hits: 6938 groups_considered: 580363 useless_loops: 0 cr3_stats: hits: 0 groups_considered: 0 useless_loops: 0 extents_scanned: 309059 goal_hits: 0 2^n_hits: 1 breaks: 1463 lost: 0 buddies_generated: 239/240 buddies_time_used: 791392 preallocated: 673 discarded: 446 Fixes: 196e402 (ext4: improve cr 0 / cr 1 group scanning) Cc: stable@kernel.org Reported-by: Geetika Moolchandani Reported-by: Nageswara R Sastry Suggested-by: Ritesh Harjani Signed-off-by: Ojaswin Mujoo Link: https://lore.kernel.org/r/fc9a48f7f8dcfc83891a8b21f6dd8cdf056ed810.1646732698.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/mballoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 27b38686a3bb601db48901dbc4e2fc5d77ffa2c1 Author: Ojaswin Mujoo Date: Tue Mar 8 15:22:00 2022 +0530 ext4: make mb_optimize_scan option work with set/unset mount cmd After moving to the new mount API, mb_optimize_scan mount option handling was not working as expected due to the parsed value always being overwritten by default. Refactor and fix this to the expected behavior described below: * mb_optimize_scan=1 - On * mb_optimize_scan=0 - Off * mb_optimize_scan not passed - On if no. of BGs > threshold else off * Remounts retain previous value unless we explicitly pass the option with a new value Fixes: cebe85d570cf ("ext4: switch to the new mount api") Cc: stable@kernel.org Reported-by: Ritesh Harjani Signed-off-by: Ojaswin Mujoo Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/c98970fe99f26718586d02e942f293300fb48ef3.1646732698.git.ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/super.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) commit 1b0d0f7c12d57763fe27200d0569c863f11d2b8a Author: Rex-BC Chen Date: Wed Feb 23 11:01:37 2022 +0800 dt-bindings: mailbox: add definition for mt8186 Add definition of compatible and dt-binding header for mt8186. Signed-off-by: Rex-BC Chen Signed-off-by: Jassi Brar Documentation/devicetree/bindings/mailbox/mtk-gce.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit df227dc8a68d81b7fe3416eca16d1f21d0b537f0 Author: Dave Gerlach Date: Wed Feb 9 22:16:31 2022 -0600 mailbox: ti-msgmgr: Operate mailbox in polled mode during system suspend During the system suspend path we must set all queues to operate in polled mode as it is possible for any protocol built using this mailbox, such as TISCI, to require communication during the no irq phase of suspend, and we cannot rely on interrupts there. Polled mode is implemented by allowing the mailbox user to define an RX channel as part of the message that is sent which is what gets polled for a response. If polled mode is enabled, this will immediately be polled for a response at the end of the mailbox send_data op before returning success for the data send or timing out if no response is received. Finally, to ensure polled mode is always enabled during system suspend, iterate through all queues to set RX queues to polled mode during system suspend and disable polled mode for all in the resume handler. Signed-off-by: Dave Gerlach Signed-off-by: Jassi Brar drivers/mailbox/ti-msgmgr.c | 93 +++++++++++++++++++++++++++++++++++++++- include/linux/soc/ti/ti-msgmgr.h | 8 +++- 2 files changed, 98 insertions(+), 3 deletions(-) commit cb62b8f7346338eeefa6d46160200879dc345246 Author: Dave Gerlach Date: Wed Feb 9 22:16:30 2022 -0600 mailbox: ti-msgmgr: Refactor message read during interrupt handler Refactor the portion of code that actually reads received messages from a queue into its own function, ti_msgmgr_queue_rx_data, that is called by the interrupt handler instead of reading directly from the handler. Signed-off-by: Dave Gerlach Signed-off-by: Jassi Brar drivers/mailbox/ti-msgmgr.c | 88 +++++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 39 deletions(-) commit 0184cc2026a0176dc24b63f62ca290bf155420b9 Author: Peng Fan Date: Wed Mar 9 18:03:45 2022 +0800 mailbox: imx: support i.MX93 S401 MU Add i.MX93 S401 MU cfg Signed-off-by: Peng Fan Signed-off-by: Jassi Brar drivers/mailbox/imx-mailbox.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit a5cb407a7af4d825bbf8c299db155dc58848ecc5 Author: Peng Fan Date: Wed Mar 9 18:03:44 2022 +0800 mailbox: imx: support dual interrupts i.MX93 S401 MU support two interrupts: tx empty and rx full. - Introduce a new flag IMX_MU_V2_IRQ for the dual interrupt case - Update Copyright Signed-off-by: Peng Fan Signed-off-by: Jassi Brar drivers/mailbox/imx-mailbox.c | 45 ++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) commit cfd162f604bfccfe0b0953fbf0adfcb80ed75cce Author: Peng Fan Date: Wed Mar 9 18:03:43 2022 +0800 mailbox: imx: extend irq to an array To i.MX93 S401 MU, there are two interrupts: rx full and tx empty. So extend irq to an array to prepare i.MX93 S401 MU support. Signed-off-by: Peng Fan Signed-off-by: Jassi Brar drivers/mailbox/imx-mailbox.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit 241aba6c1ebd2c326a371b8af84b1f096efd0506 Author: Peng Fan Date: Wed Mar 9 18:03:42 2022 +0800 dt-bindings: mailbox: imx-mu: add i.MX93 S4 MU support Similar to i.MX8ULP S4 MU, i.MX93 MU is dedicated for communication between Sentinel and Cortex-A cores from hardware design, it could not be reused for other purpose. However i.MX93 S4 MU use separate tx/rx interrupt, so update interrupts and add interrupt-names property. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Peng Fan Signed-off-by: Jassi Brar .../devicetree/bindings/mailbox/fsl,mu.yaml | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) commit 6149a543adc7d7113dd47fc05eda973eefee5bf4 Author: Peng Fan Date: Wed Mar 9 18:03:41 2022 +0800 dt-bindings: mailbox: imx-mu: add i.MX93 MU Add bindings for i.MX93 MU which derived from i.MX8ULP Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Peng Fan Signed-off-by: Jassi Brar Documentation/devicetree/bindings/mailbox/fsl,mu.yaml | 3 +++ 1 file changed, 3 insertions(+) commit 11dac1d3fa422abc841dcd4f5222a79398b3cf98 Author: Franck LENORMAND Date: Mon Feb 7 09:52:11 2022 +0800 mailbox: imx: add i.MX8 SECO MU support i.MX8/8X SECO firmware IPC is an implementation of passing messages. But current imx-mailbox driver only support one word message, i.MX8/8X linux side firmware has to request four TX, four RX and a TXDB to support IPC to SECO firmware. This is low efficent and more interrupts triggered compared with one TX and one RX. To make SECO MU work, - parse the size of msg. - Only enable TR0/RR0 interrupt for transmit/receive message. - For TX/RX, only support one TX channel and one RX channel - For RX, support receive msg of any size, limited by hardcoded value of 30. Signed-off-by: Franck LENORMAND Signed-off-by: Peng Fan Signed-off-by: Jassi Brar drivers/mailbox/imx-mailbox.c | 213 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 212 insertions(+), 1 deletion(-) commit 315d2e5624183248514294899a26cb0fb3c20a46 Author: Peng Fan Date: Mon Feb 7 09:52:10 2022 +0800 mailbox: imx: introduce rxdb callback Add a rxdb callback to prepare for i.MX8 SECO MU rxdb which has a different logic. Signed-off-by: Peng Fan Signed-off-by: Jassi Brar drivers/mailbox/imx-mailbox.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) commit 960dcc1574c7432ad4ff42e8b153f098bdfd5c8d Author: Peng Fan Date: Mon Feb 7 09:52:09 2022 +0800 dt-bindings: mailbox: imx-mu: add i.MX8 SECO MU support Similar to i.MX8QM/QXP SCU, i.MX8 SECO MU is dedicated for communication between SECO and Cortex-A cores from hardware design, it could not be reused for other purpose. To use SECO MU more effectivly, add "fsl,imx8-mu-seco" compatile to support fast IPC. Acked-by: Rob Herring Signed-off-by: Peng Fan Signed-off-by: Jassi Brar Documentation/devicetree/bindings/mailbox/fsl,mu.yaml | 1 + 1 file changed, 1 insertion(+) commit 81a9d3b9301c9bb835d8ef595b2456084573db1b Author: Ranjani Vaidyanathan Date: Mon Feb 7 09:52:08 2022 +0800 mailbox: imx: enlarge timeout while reading/writing messages to SCFW Mailbox driver needs to wait and read all the words in response to a SCFW API call, else the protocol gets messed up and results in kernel hang. When the responses are longer than 3 words its possible that SCFW will take some time to fill up the rest of the words in the MU, a timeout of 100us is arbritrary and too short. While waiting for Linux to consume the first 3 words of the response SCFW can be busy doing other stuff and hence Linux needs to wait for the rest of the words. Similar restriction applies when writing messages that are longer than 3 words. This patch increases the timeout to 5secs while waiting for response or writing long messages to SCFW. Signed-off-by: Ranjani Vaidyanathan Signed-off-by: Peng Fan Signed-off-by: Jassi Brar drivers/mailbox/imx-mailbox.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 8219efd08a0aa1d7944bdb66d84ba57549258968 Author: Robin Gong Date: Mon Feb 7 09:52:07 2022 +0800 mailbox: imx: fix crash in resume on i.mx8ulp check 'priv->clk' before 'imx_mu_read()' otherwise crash happens on i.mx8ulp, since clock not enabled. Fixes: 4f0b776ef5831 ("mailbox: imx-mailbox: support i.MX8ULP MU") Reviewed-by: Jacky Bai Signed-off-by: Robin Gong Signed-off-by: Peng Fan Signed-off-by: Jassi Brar drivers/mailbox/imx-mailbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 892cb524ae8a27bf5e42f711318371acd9a9f74a Author: Robin Gong Date: Mon Feb 7 09:52:06 2022 +0800 mailbox: imx: fix wakeup failure from freeze mode Since IRQF_NO_SUSPEND used for imx mailbox driver, that means this irq can't be used for wakeup source so that can't wakeup from freeze mode. Add pm_system_wakeup() to wakeup from freeze mode. Fixes: b7b2796b9b31e("mailbox: imx: ONLY IPC MU needs IRQF_NO_SUSPEND flag") Reviewed-by: Jacky Bai Reviewed-by: Peng Fan Signed-off-by: Robin Gong Signed-off-by: Peng Fan Signed-off-by: Jassi Brar drivers/mailbox/imx-mailbox.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit af2dfa96c52d042df5deb29fb6e32d3ff4d76a61 Author: Allen-KH Cheng Date: Fri Feb 25 21:24:27 2022 +0800 mailbox: mediatek: add support for adsp mailbox controller This patch is to for MediaTek ADSP IPC mailbox controller driver It is used to send short messages between processors with adsp Signed-off-by: Allen-KH Cheng Reviewed-by: Tzung-Bi Shih Reviewed-by: YC Hung Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Jassi Brar drivers/mailbox/Kconfig | 9 ++ drivers/mailbox/Makefile | 2 + drivers/mailbox/mtk-adsp-mailbox.c | 176 +++++++++++++++++++++++++++++++++++++ 3 files changed, 187 insertions(+) commit afa092e1e8824363d3174fef329c034445c111d5 Author: Allen-KH Cheng Date: Fri Feb 25 21:24:26 2022 +0800 dt-bindings: mailbox: mtk,adsp-mbox: add mtk adsp-mbox document This patch adds document for mediatek adsp mbox Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Signed-off-by: Jassi Brar .../devicetree/bindings/mailbox/mtk,adsp-mbox.yaml | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) commit 5c0fab31caddac96be18877d10e0b9b24ff8fb32 Author: Adam Skladowski Date: Mon Mar 7 20:17:23 2022 +0100 mailbox: qcom-apcs-ipc: Add compatible for MSM8976 SoC MSM8976 APCS block is similar to one found in MSM8994. Signed-off-by: Adam Skladowski Signed-off-by: Jassi Brar drivers/mailbox/qcom-apcs-ipc-mailbox.c | 1 + 1 file changed, 1 insertion(+) commit bcc8d70f912df5b3ad315155bcc0208b699d24d2 Author: Adam Skladowski Date: Mon Mar 7 20:17:22 2022 +0100 dt-bindings: mailbox: Add compatible for the MSM8976 Add the mailbox compatible for the MSM8976 SoC. Signed-off-by: Adam Skladowski Acked-by: Krzysztof Kozlowski Signed-off-by: Jassi Brar Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml | 1 + 1 file changed, 1 insertion(+) commit 60de2d2dc284e0dd1c2c897d08625bde24ef3454 Author: Pekka Pessi Date: Wed Mar 2 16:04:24 2022 +0100 mailbox: tegra-hsp: Flush whole channel The txdone can re-fill the mailbox. Keep polling the mailbox during the flush until all the messages have been delivered. This fixes an issue with the Tegra Combined UART (TCU) where output can get truncated under high traffic load. Signed-off-by: Pekka Pessi Tested-by: Jon Hunter Fixes: 91b1b1c3da8a ("mailbox: tegra-hsp: Add support for shared mailboxes") Cc: stable@vger.kernel.org Signed-off-by: Thierry Reding Reviewed-by: Jon Hunter Signed-off-by: Jassi Brar drivers/mailbox/tegra-hsp.c | 5 +++++ 1 file changed, 5 insertions(+) commit a96cfe2d427064325ecbf56df8816c6b871ec285 Author: Jason A. Donenfeld Date: Tue Mar 8 11:20:17 2022 -0700 random: make consistent usage of crng_ready() Rather than sometimes checking `crng_init < 2`, we should always use the crng_ready() macro, so that should we change anything later, it's consistent. Additionally, that macro already has a likely() around it, which means we don't need to open code our own likely() and unlikely() annotations. Cc: Theodore Ts'o Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) commit f5eab0e2db4f881fb2b62b3fdad5b9be673dd7ae Author: Jason A. Donenfeld Date: Fri Feb 11 14:58:44 2022 +0100 random: use SipHash as interrupt entropy accumulator The current fast_mix() function is a piece of classic mailing list crypto, where it just sort of sprung up by an anonymous author without a lot of real analysis of what precisely it was accomplishing. As an ARX permutation alone, there are some easily searchable differential trails in it, and as a means of preventing malicious interrupts, it completely fails, since it xors new data into the entire state every time. It can't really be analyzed as a random permutation, because it clearly isn't, and it can't be analyzed as an interesting linear algebraic structure either, because it's also not that. There really is very little one can say about it in terms of entropy accumulation. It might diffuse bits, some of the time, maybe, we hope, I guess. But for the most part, it fails to accomplish anything concrete. As a reminder, the simple goal of add_interrupt_randomness() is to simply accumulate entropy until ~64 interrupts have elapsed, and then dump it into the main input pool, which uses a cryptographic hash. It would be nice to have something cryptographically strong in the interrupt handler itself, in case a malicious interrupt compromises a per-cpu fast pool within the 64 interrupts / 1 second window, and then inside of that same window somehow can control its return address and cycle counter, even if that's a bit far fetched. However, with a very CPU-limited budget, actually doing that remains an active research project (and perhaps there'll be something useful for Linux to come out of it). And while the abundance of caution would be nice, this isn't *currently* the security model, and we don't yet have a fast enough solution to make it our security model. Plus there's not exactly a pressing need to do that. (And for the avoidance of doubt, the actual cluster of 64 accumulated interrupts still gets dumped into our cryptographically secure input pool.) So, for now we are going to stick with the existing interrupt security model, which assumes that each cluster of 64 interrupt data samples is mostly non-malicious and not colluding with an infoleaker. With this as our goal, we have a few more choices, simply aiming to accumulate entropy, while discarding the least amount of it. We know from that random oracles, instantiated as computational hash functions, make good entropy accumulators and extractors, which is the justification for using BLAKE2s in the main input pool. As mentioned, we don't have that luxury here, but we also don't have the same security model requirements, because we're assuming that there aren't malicious inputs. A pseudorandom function instance can approximately behave like a random oracle, provided that the key is uniformly random. But since we're not concerned with malicious inputs, we can pick a fixed key, which is not secret, knowing that "nature" won't interact with a sufficiently chosen fixed key by accident. So we pick a PRF with a fixed initial key, and accumulate into it continuously, dumping the result every 64 interrupts into our cryptographically secure input pool. For this, we make use of SipHash-1-x on 64-bit and HalfSipHash-1-x on 32-bit, which are already in use in the kernel's hsiphash family of functions and achieve the same performance as the function they replace. It would be nice to do two rounds, but we don't exactly have the CPU budget handy for that, and one round alone is already sufficient. As mentioned, we start with a fixed initial key (zeros is fine), and allow SipHash's symmetry breaking constants to turn that into a useful starting point. Also, since we're dumping the result (or half of it on 64-bit so as to tax our hash function the same amount on all platforms) into the cryptographically secure input pool, there's no point in finalizing SipHash's output, since it'll wind up being finalized by something much stronger. This means that all we need to do is use the ordinary round function word-by-word, as normal SipHash does. Simplified, the flow is as follows: Initialize: siphash_state_t state; siphash_init(&state, key={0, 0, 0, 0}); Update (accumulate) on interrupt: siphash_update(&state, interrupt_data_and_timing); Dump into input pool after 64 interrupts: blake2s_update(&input_pool, &state, sizeof(state) / 2); The result of all of this is that the security model is unchanged from before -- we assume non-malicious inputs -- yet we now implement that model with a stronger argument. I would like to emphasize, again, that the purpose of this commit is to improve the existing design, by making it analyzable, without changing any fundamental assumptions. There may well be value down the road in changing up the existing design, using something cryptographically strong, or simply using a ring buffer of samples rather than having a fast_mix() at all, or changing which and how much data we collect each interrupt so that we can use something linear, or a variety of other ideas. This commit does not invalidate the potential for those in the future. For example, in the future, if we're able to characterize the data we're collecting on each interrupt, we may be able to inch toward information theoretic accumulators. shows that `s = ror32(s, 7) ^ x` and `s = ror64(s, 19) ^ x` make very good accumulators for 2-monotone distributions, which would apply to timestamp counters, like random_get_entropy() or jiffies, but would not apply to our current combination of the two values, or to the various function addresses and register values we mix in. Alternatively, shows that max-period linear functions with no non-trivial invariant subspace make good extractors, used in the form `s = f(s) ^ x`. However, this only works if the input data is both identical and independent, and obviously a collection of address values and counters fails; so it goes with theoretical papers. Future directions here may involve trying to characterize more precisely what we actually need to collect in the interrupt handler, and building something specific around that. However, as mentioned, the morass of data we're gathering at the interrupt handler presently defies characterization, and so we use SipHash for now, which works well and performs well. Cc: Theodore Ts'o Cc: Greg Kroah-Hartman Reviewed-by: Jean-Philippe Aumasson Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 94 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 39 deletions(-) commit 2d6919c3205b141ba85fb733b2a67937ff85dc7f Author: Jason A. Donenfeld Date: Tue Mar 1 23:26:55 2022 +0100 wireguard: device: clear keys on VM fork When a virtual machine forks, it's important that WireGuard clear existing sessions so that different plaintexts are not transmitted using the same key+nonce, which can result in catastrophic cryptographic failure. To accomplish this, we simply hook into the newly added vmfork notifier. As a bonus, it turns out that, like the vmfork registration function, the PM registration function is stubbed out when CONFIG_PM_SLEEP is not set, so we can actually just remove the maze of ifdefs, which makes it really quite clean to support both notifiers at once. Cc: Dominik Brodowski Cc: Greg Kroah-Hartman Cc: Theodore Ts'o Acked-by: Jakub Kicinski Signed-off-by: Jason A. Donenfeld drivers/net/wireguard/device.c | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) commit f3c2682bad7bc6033c837e9c66e5af881fe8d465 Author: Jason A. Donenfeld Date: Tue Mar 1 20:22:39 2022 +0100 random: provide notifier for VM fork Drivers such as WireGuard need to learn when VMs fork in order to clear sessions. This commit provides a simple notifier_block for that, with a register and unregister function. When no VM fork detection is compiled in, this turns into a no-op, similar to how the power notifier works. Cc: Dominik Brodowski Cc: Theodore Ts'o Reviewed-by: Greg Kroah-Hartman Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 15 +++++++++++++++ include/linux/random.h | 5 +++++ 2 files changed, 20 insertions(+) commit 5acd35487dc911541672b3ffc322851769c32a56 Author: Jason A. Donenfeld Date: Tue Mar 1 20:03:49 2022 +0100 random: replace custom notifier chain with standard one We previously rolled our own randomness readiness notifier, which only has two users in the whole kernel. Replace this with a more standard atomic notifier block that serves the same purpose with less code. Also unexport the symbols, because no modules use it, only unconditional builtins. The only drawback is that it's possible for a notification handler returning the "stop" code to prevent further processing, but given that there are only two users, and that we're unexporting this anyway, that doesn't seem like a significant drawback for the simplification we receive here. Cc: Greg Kroah-Hartman Cc: Theodore Ts'o Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 67 ++++++++++++++------------------------------------ include/linux/random.h | 10 +++----- lib/random32.c | 12 +++++---- lib/vsprintf.c | 10 +++++--- 4 files changed, 35 insertions(+), 64 deletions(-) commit a4107d34f960df99ca07fa8eb022425a804f59f3 Author: Jason A. Donenfeld Date: Tue Mar 1 15:14:04 2022 +0100 random: do not export add_vmfork_randomness() unless needed Since add_vmfork_randomness() is only called from vmgenid.o, we can guard it in CONFIG_VMGENID, similarly to how we do with add_disk_randomness() and CONFIG_BLOCK. If we ever have multiple things calling into add_vmfork_randomness(), we can add another shared Kconfig symbol for that, but for now, this is good enough. Even though add_vmfork_randomess() is a pretty small function, removing it means that there are only calls to crng_reseed(false) and none to crng_reseed(true), which means the compiler can constant propagate the false, removing branches from crng_reseed() and its descendants. Additionally, we don't even need the symbol to be exported if CONFIG_VMGENID is not a module, so conditionalize that too. Cc: Dominik Brodowski Cc: Theodore Ts'o Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 4 ++++ include/linux/random.h | 2 ++ 2 files changed, 6 insertions(+) commit af6b54e2b5baa54c844573b6d49cc91157bcdd7e Author: Jason A. Donenfeld Date: Wed Feb 23 13:46:24 2022 +0100 virt: vmgenid: notify RNG of VM fork and supply generation ID VM Generation ID is a feature from Microsoft, described at , and supported by Hyper-V and QEMU. Its usage is described in Microsoft's RNG whitepaper, , as: If the OS is running in a VM, there is a problem that most hypervisors can snapshot the state of the machine and later rewind the VM state to the saved state. This results in the machine running a second time with the exact same RNG state, which leads to serious security problems. To reduce the window of vulnerability, Windows 10 on a Hyper-V VM will detect when the VM state is reset, retrieve a unique (not random) value from the hypervisor, and reseed the root RNG with that unique value. This does not eliminate the vulnerability, but it greatly reduces the time during which the RNG system will produce the same outputs as it did during a previous instantiation of the same VM state. Linux has the same issue, and given that vmgenid is supported already by multiple hypervisors, we can implement more or less the same solution. So this commit wires up the vmgenid ACPI notification to the RNG's newly added add_vmfork_randomness() function. It can be used from qemu via the `-device vmgenid,guid=auto` parameter. After setting that, use `savevm` in the monitor to save the VM state, then quit QEMU, start it again, and use `loadvm`. That will trigger this driver's notify function, which hands the new UUID to the RNG. This is described in . And there are hooks for this in libvirt as well, described in . Note, however, that the treatment of this as a UUID is considered to be an accidental QEMU nuance, per , so this driver simply treats these bytes as an opaque 128-bit binary blob, as per the spec. This doesn't really make a difference anyway, considering that's how it ends up when handed to the RNG in the end. Cc: Alexander Graf Cc: Adrian Catangiu Cc: Daniel P. Berrangé Cc: Dominik Brodowski Cc: Wei Yongjun Tested-by: Souradeep Chakrabarti # With Hyper-V's virtual hardware Reviewed-by: Ard Biesheuvel Reviewed-by: Greg Kroah-Hartman Reviewed-by: Laszlo Ersek Signed-off-by: Jason A. Donenfeld MAINTAINERS | 1 + drivers/virt/Kconfig | 11 ++++++ drivers/virt/Makefile | 1 + drivers/virt/vmgenid.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) commit d273845ecb0e0626842782a4497f0c5876139ec3 Author: Alexander Graf Date: Fri Feb 25 16:55:52 2022 +0100 ACPI: allow longer device IDs We create a list of ACPI "PNP" IDs which contains _HID, _CID, and CLS entries of the respective devices. However, when making structs for matching, we squeeze those IDs into acpi_device_id, which only has 9 bytes space to store the identifier. The subsystem actually captures the full length of the IDs, and the modalias has the full length, but this struct we use for matching is limited. It originally had 16 bytes, but was changed to only have 9 in 6543becf26ff ("mod/file2alias: make modalias generation safe for cross compiling"), presumably on the theory that it would match the ACPI spec so it didn't matter. Unfortunately, while most people adhere to the ACPI specs, Microsoft decided that its VM Generation Counter device [1] should only be identifiable by _CID with a value of "VM_Gen_Counter", which is longer than 9 characters. To allow device drivers to match identifiers that exceed the 9 byte limit, this simply ups the length to 16, just like it was before the aforementioned commit. Empirical testing indicates that this doesn't actually increase vmlinux size on 64-bit, because the ulong in the same struct caused there to be 7 bytes of padding anyway, and when doing a s/M/Y/g i386_defconfig build, the bzImage only increased by 0.0055%, so negligible. This patch is a prerequisite to add support for VMGenID in Linux, the subsequent patch in this series. It has been confirmed to also work on the udev/modalias side in userspace. [1] https://download.microsoft.com/download/3/1/C/31CFC307-98CA-4CA5-914C-D9772691E214/VirtualMachineGenerationID.docx Signed-off-by: Alexander Graf Co-developed-by: Jason A. Donenfeld [Jason: reworked commit message a bit, went with len=16 approach.] Cc: Mika Westerberg Cc: Andy Shevchenko Cc: Len Brown Cc: Greg Kroah-Hartman Reviewed-by: Ard Biesheuvel Acked-by: Hans de Goede Acked-by: Rafael J. Wysocki Signed-off-by: Jason A. Donenfeld include/linux/mod_devicetable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ae099e8e98fb01395228628be5a4661e3bd86fe4 Author: Jason A. Donenfeld Date: Wed Feb 23 13:43:44 2022 +0100 random: add mechanism for VM forks to reinitialize crng When a VM forks, we must immediately mix in additional information to the stream of random output so that two forks or a rollback don't produce the same stream of random numbers, which could have catastrophic cryptographic consequences. This commit adds a simple API, add_vmfork_ randomness(), for that, by force reseeding the crng. This has the added benefit of also draining the entropy pool and setting its timer back, so that any old entropy that was there prior -- which could have already been used by a different fork, or generally gone stale -- does not contribute to the accounting of the next 256 bits. Cc: Dominik Brodowski Cc: Theodore Ts'o Cc: Jann Horn Cc: Eric Biggers Reviewed-by: Ard Biesheuvel Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 50 +++++++++++++++++++++++++++++++++++--------------- include/linux/random.h | 1 + 2 files changed, 36 insertions(+), 15 deletions(-) commit 77553cf8f44863b31da242cf24671d76ddb61597 Author: Jason A. Donenfeld Date: Mon Feb 28 14:00:52 2022 +0100 random: don't let 644 read-only sysctls be written to We leave around these old sysctls for compatibility, and we keep them "writable" for compatibility, but even after writing, we should keep reporting the same value. This is consistent with how userspaces tend to use sysctl_random_write_wakeup_bits, writing to it, and then later reading from it and using the value. Cc: Theodore Ts'o Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit d0efdf35a6a71d307a250199af6fce122a7c7e11 Author: Jason A. Donenfeld Date: Mon Feb 28 13:57:57 2022 +0100 random: give sysctl_random_min_urandom_seed a more sensible value This isn't used by anything or anywhere, but we can't delete it due to compatibility. So at least give it the correct value of what it's supposed to be instead of a garbage one. Cc: Theodore Ts'o Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld drivers/char/random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 6f98a4bfee72c22f50aedb39fb761567969865fe Author: Jason A. Donenfeld Date: Mon Feb 7 17:19:24 2022 +0100 random: block in /dev/urandom This topic has come up countless times, and usually doesn't go anywhere. This time I thought I'd bring it up with a slightly narrower focus, updated for some developments over the last three years: we finally can make /dev/urandom always secure, in light of the fact that our RNG is now always seeded. Ever since Linus' 50ee7529ec45 ("random: try to actively add entropy rather than passively wait for it"), the RNG does a haveged-style jitter dance around the scheduler, in order to produce entropy (and credit it) for the case when we're stuck in wait_for_random_bytes(). How ever you feel about the Linus Jitter Dance is beside the point: it's been there for three years and usually gets the RNG initialized in a second or so. As a matter of fact, this is what happens currently when people use getrandom(). It's already there and working, and most people have been using it for years without realizing. So, given that the kernel has grown this mechanism for seeding itself from nothing, and that this procedure happens pretty fast, maybe there's no point any longer in having /dev/urandom give insecure bytes. In the past we didn't want the boot process to deadlock, which was understandable. But now, in the worst case, a second goes by, and the problem is resolved. It seems like maybe we're finally at a point when we can get rid of the infamous "urandom read hole". The one slight drawback is that the Linus Jitter Dance relies on random_ get_entropy() being implemented. The first lines of try_to_generate_ entropy() are: stack.now = random_get_entropy(); if (stack.now == random_get_entropy()) return; On most platforms, random_get_entropy() is simply aliased to get_cycles(). The number of machines without a cycle counter or some other implementation of random_get_entropy() in 2022, which can also run a mainline kernel, and at the same time have a both broken and out of date userspace that relies on /dev/urandom never blocking at boot is thought to be exceedingly low. And to be clear: those museum pieces without cycle counters will continue to run Linux just fine, and even /dev/urandom will be operable just like before; the RNG just needs to be seeded first through the usual means, which should already be the case now. On systems that really do want unseeded randomness, we already offer getrandom(GRND_INSECURE), which is in use by, e.g., systemd for seeding their hash tables at boot. Nothing in this commit would affect GRND_INSECURE, and it remains the means of getting those types of random numbers. This patch goes a long way toward eliminating a long overdue userspace crypto footgun. After several decades of endless user confusion, we will finally be able to say, "use any single one of our random interfaces and you'll be fine. They're all the same. It doesn't matter." And that, I think, is really something. Finally all of those blog posts and disagreeing forums and contradictory articles will all become correct about whatever they happened to recommend, and along with it, a whole class of vulnerabilities eliminated. With very minimal downside, we're finally in a position where we can make this change. Cc: Dinh Nguyen Cc: Nick Hu Cc: Max Filippov Cc: Palmer Dabbelt Cc: David S. Miller Cc: Yoshinori Sato Cc: Michal Simek Cc: Borislav Petkov Cc: Guo Ren Cc: Geert Uytterhoeven Cc: Joshua Kinard Cc: David Laight Cc: Dominik Brodowski Cc: Eric Biggers Cc: Ard Biesheuvel Cc: Arnd Bergmann Cc: Thomas Gleixner Cc: Andy Lutomirski Cc: Kees Cook Cc: Lennart Poettering Cc: Konstantin Ryabitsev Cc: Linus Torvalds Cc: Greg Kroah-Hartman Cc: Theodore Ts'o Signed-off-by: Jason A. Donenfeld drivers/char/mem.c | 2 +- drivers/char/random.c | 72 ++++++++++++-------------------------------------- include/linux/random.h | 2 +- 3 files changed, 19 insertions(+), 57 deletions(-) commit db8cd5efeebc4904df1653926102413d088a5c7e Author: Ira Weiny Date: Fri Mar 4 12:46:55 2022 -0800 dax: Fix missing kdoc for dax_device struct dax_device has a member named ops which was undocumented. Add the kdoc. Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20220304204655.3489216-1-ira.weiny@intel.com Signed-off-by: Dan Williams drivers/dax/super.c | 1 + 1 file changed, 1 insertion(+) commit 271e4323d9e93340fe37c15288056bae9e5bb1a0 Author: Mauro Carvalho Chehab Date: Wed Mar 9 14:25:35 2022 +0100 media: Makefiles: remove extra spaces It is hard to keep all those options aligned as newer config changes get added, and we really don't want to have patches adding new options also touching already existing entries. So, drop the extra spaces. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab drivers/media/Makefile | 4 +- drivers/media/cec/platform/Makefile | 16 +++---- drivers/media/firewire/Makefile | 2 +- drivers/media/i2c/Makefile | 92 ++++++++++++++++++------------------- drivers/media/test-drivers/Makefile | 10 ++-- drivers/media/usb/Makefile | 14 +++--- drivers/media/usb/gspca/Makefile | 88 +++++++++++++++++------------------ 7 files changed, 113 insertions(+), 113 deletions(-) commit d76231e460fbaba7115212bf55f1eab35aba6223 Author: Mauro Carvalho Chehab Date: Wed Mar 9 14:59:01 2022 +0100 media: xc2028: rename the driver from tuner-xc2028 This is the only tuner driver that has "tuner-" on its name. Rename it, in order to match all the other tuner drivers. Signed-off-by: Mauro Carvalho Chehab Documentation/admin-guide/media/i2c-cardlist.rst | 2 +- MAINTAINERS | 2 +- drivers/media/pci/cx18/cx18-driver.c | 2 +- drivers/media/pci/cx18/cx18-dvb.c | 2 +- drivers/media/pci/cx18/cx18-gpio.c | 2 +- drivers/media/pci/cx23885/cx23885-cards.c | 2 +- drivers/media/pci/cx23885/cx23885-dvb.c | 2 +- drivers/media/pci/cx23885/cx23885-video.c | 2 +- drivers/media/pci/cx88/cx88.h | 2 +- drivers/media/pci/ivtv/ivtv-driver.c | 2 +- drivers/media/pci/ivtv/ivtv-gpio.c | 2 +- drivers/media/pci/saa7134/saa7134-cards.c | 2 +- drivers/media/pci/saa7134/saa7134-dvb.c | 2 +- drivers/media/tuners/Makefile | 2 +- drivers/media/tuners/tuner-types.c | 2 +- drivers/media/tuners/{tuner-xc2028-types.h => xc2028-types.h} | 6 +++--- drivers/media/tuners/{tuner-xc2028.c => xc2028.c} | 6 +++--- drivers/media/tuners/{tuner-xc2028.h => xc2028.h} | 2 +- drivers/media/tuners/xc4000.c | 2 +- drivers/media/usb/dvb-usb/cxusb.c | 2 +- drivers/media/usb/dvb-usb/dib0700_devices.c | 2 +- drivers/media/usb/em28xx/em28xx-i2c.c | 2 +- drivers/media/usb/em28xx/em28xx.h | 2 +- drivers/media/usb/tm6000/tm6000-cards.c | 2 +- drivers/media/usb/tm6000/tm6000-dvb.c | 2 +- drivers/media/usb/tm6000/tm6000-i2c.c | 2 +- drivers/media/v4l2-core/tuner-core.c | 2 +- 27 files changed, 31 insertions(+), 31 deletions(-) commit db64e7e74bd2abeae58ff65bdf41305f04a60fa1 Author: AngeloGioacchino Del Regno Date: Fri Jan 14 14:32:59 2022 +0100 rpmsg: qcom_smd: Fix redundant channel->registered assignment In qcom_channel_state_worker(), we are setting channel->registered to true when registering a channel, but this is getting repeated both before and after re-locking the channels_lock spinlock, which is obviously a typo. Remove the assignment done out of the spinlock to fix this redundancy. Fixes: 53e2822e56c7 ("rpmsg: Introduce Qualcomm SMD backend") Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220114133259.247726-1-angelogioacchino.delregno@collabora.com drivers/rpmsg/qcom_smd.c | 2 -- 1 file changed, 2 deletions(-) commit f693dac4794fae99c04f75a3a1a5c4018bb33144 Author: James Clark Date: Fri Mar 4 09:09:56 2022 +0000 perf tools: Set build-id using build-id header on new mmap records MMAP records that occur after the build-id header is parsed do not have their build-id set even if the filename matches an entry from the header. Set the build-id on these dsos as long as the MMAP record doesn't have its own build-id set. This fixes an issue with off target analysis where the local version of a dso is loaded rather than one from ~/.debug via a build-id. Reported-by: Denis Nikitin Signed-off-by: James Clark Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220304090956.2048712-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/dso.h | 1 + tools/perf/util/header.c | 1 + tools/perf/util/map.c | 20 +++++++++++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) commit 7177a4792660c605906582ef0bb8f6bb7ff971a1 Author: Rasmus Villemoes Date: Fri Oct 15 10:31:44 2021 +0200 tools compiler.h: Remove duplicate #ifndef noinline block The same three lines also appear a bit earlier in the same file. Reviewed-by: Miguel Ojeda Signed-off-by: Rasmus Villemoes Cc: Ard Biesheuvel Link: https://lore.kernel.org/r/20211015083144.2767725-1-linux@rasmusvillemoes.dk Signed-off-by: Arnaldo Carvalho de Melo tools/include/linux/compiler.h | 4 ---- 1 file changed, 4 deletions(-) commit f3b6a41eb2bbdf545a42e54d637c34f4b1fdf5b9 Author: Jens Axboe Date: Sat Mar 12 06:50:13 2022 -0700 io_uring: remove duplicated member check for io_msg_ring_prep() Julia and the kernel test robot report that the prep handling for this command inadvertently checks one field twice: fs/io_uring.c:4338:42-56: duplicated argument to && or || Get rid of it. Reported-by: kernel test robot Reported-by: Julia Lawall Fixes: 4f57f06ce218 ("io_uring: add support for IORING_OP_MSG_RING command") Signed-off-by: Jens Axboe fs/io_uring.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit f2aa197e4794bf4c2c0c9570684f86e6fa103e8b Author: Chengming Zhou Date: Sat Mar 5 11:41:03 2022 +0800 cgroup: Fix suspicious rcu_dereference_check() usage warning task_css_set_check() will use rcu_dereference_check() to check for rcu_read_lock_held() on the read-side, which is not true after commit dc6e0818bc9a ("sched/cpuacct: Optimize away RCU read lock"). This commit drop explicit rcu_read_lock(), change to RCU-sched read-side critical section. So fix the RCU warning by adding check for rcu_read_lock_sched_held(). Fixes: dc6e0818bc9a ("sched/cpuacct: Optimize away RCU read lock") Reported-by: Linux Kernel Functional Testing Reported-by: syzbot+16e3f2c77e7c5a0113f9@syzkaller.appspotmail.com Signed-off-by: Chengming Zhou Signed-off-by: Peter Zijlstra (Intel) Acked-by: Tejun Heo Tested-by: Zhouyi Zhou Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20220305034103.57123-1-zhouchengming@bytedance.com include/linux/cgroup.h | 1 + 1 file changed, 1 insertion(+) commit 97aeb877de7f14f819fc2cf8388d7a2d8090489d Merge: 4d17d43de9d1 9a225f81f540 Author: David S. Miller Date: Sat Mar 12 11:54:29 2022 +0000 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== ice: GTP support in switchdev Marcin Szycik says: Add support for adding GTP-C and GTP-U filters in switchdev mode. To create a filter for GTP, create a GTP-type netdev with ip tool, enable hardware offload, add qdisc and add a filter in tc: ip link add $GTP0 type gtp role hsize ethtool -K $PF0 hw-tc-offload on tc qdisc add dev $GTP0 ingress tc filter add dev $GTP0 ingress prio 1 flower enc_key_id 1337 \ action mirred egress redirect dev $VF1_PR By default, a filter for GTP-U will be added. To add a filter for GTP-C, specify enc_dst_port = 2123, e.g.: tc filter add dev $GTP0 ingress prio 1 flower enc_key_id 1337 \ enc_dst_port 2123 action mirred egress redirect dev $VF1_PR Note: outer IPv6 offload is not supported yet. Note: GTP-U with no payload offload is not supported yet. ICE COMMS package is required to create a filter as it contains GTP profiles. Changes in iproute2 [1] are required to be able to add GTP netdev and use GTP-specific options (QFI and PDU type). [1] https://lore.kernel.org/netdev/20220211182902.11542-1-wojciech.drewek@intel.com/T --- v2: Add more CC v3: Fix mail thread, sorry for spam v4: Add GTP echo response in gtp module v5: Change patch order v6: Add GTP echo request in gtp module v7: Fix kernel-docs in ice v8: Remove handling of GTP Echo Response v9: Add sending of multicast message on GTP Echo Response, fix GTP-C dummy packet selection v10: Rebase, fixed most 80 char line limits v11: Rebase, collect Harald's Reviewed-by on patch 3 ==================== Signed-off-by: David S. Miller commit 4d17d43de9d186150b3289ce99d7a79fcff202f9 Author: Oleksij Rempel Date: Fri Mar 11 09:50:14 2022 +0100 net: usb: asix: suspend embedded PHY if external is used In case external PHY is used, we need to take care of embedded PHY. Since there are no methods to disable this PHY from the MAC side and keeping RMII reference clock, we need to suspend it. This patch will reduce electrical noise (PHY is continuing to send FLPs) and power consumption by 0,22W. Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller drivers/net/usb/asix.h | 3 +++ drivers/net/usb/asix_devices.c | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) commit d5f3c81c569f50b534400d3e9b84d05e65d4f229 Author: Oleksij Rempel Date: Fri Mar 11 09:50:13 2022 +0100 net: usb: asix: make use of mdiobus_get_phy and phy_connect_direct In most cases we use own mdio bus, there is no need to create and store string for the PHY address. Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller drivers/net/usb/asix.h | 1 - drivers/net/usb/asix_devices.c | 19 ++++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) commit 5436fb3fd4c1f31f2cc4dadf69259e633351c1ff Author: Oleksij Rempel Date: Fri Mar 11 09:50:12 2022 +0100 net: usb: asix: store chipid to avoid reading it on reset We already read chipid on probe. There is no need to read it on reset. Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller drivers/net/usb/asix.h | 1 + drivers/net/usb/asix_devices.c | 19 +++++++------------ 2 files changed, 8 insertions(+), 12 deletions(-) commit d57da85dc4e3b7ad6e627c90f73aca51a45826d2 Author: Oleksij Rempel Date: Fri Mar 11 09:50:11 2022 +0100 net: usb: asix: unify ax88772_resume code The only difference is the reset code, so remove not needed duplicates. Signed-off-by: Oleksij Rempel Signed-off-by: David S. Miller drivers/net/usb/asix.h | 1 + drivers/net/usb/asix_devices.c | 32 ++++++++------------------------ 2 files changed, 9 insertions(+), 24 deletions(-) commit 234a0f202a09a6144fd3c17ac6d018bdab9780bb Author: Arnd Bergmann Date: Wed Mar 9 15:40:47 2022 +0100 ARM: fix building NOMMU ARMv4/v5 kernels The removal of the old-style irq entry broke obscure NOMMU configurations on machines that have an MMU: ld.lld: error: undefined symbol: generic_handle_arch_irq referenced by kernel/entry-armv.o:(__irq_svc) in archive arch/arm/built-in.a A follow-up patch to convert nvic to the generic_handle_arch_irq() could have fixed this by removing the Kconfig conditional, but did it differently. Change the Kconfig logic so ARM machines now unconditionally enable the feature. I have also submitted a patch to remove support for the configurations that broke, but fixing the regression first is a trivial and correct change. Reported-by: kernel test robot Fixes: 54f481a2308e ("ARM: remove old-style irq entry") Fixes: 52d240871760 ("irqchip: nvic: Use GENERIC_IRQ_MULTI_HANDLER") Signed-off-by: Arnd Bergmann Signed-off-by: Russell King (Oracle) arch/arm/Kconfig | 2 +- drivers/irqchip/Kconfig | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) commit 0f306cca42fe879694fb5e2382748c43dc9e0196 Author: Lars-Peter Clausen Date: Fri Mar 11 21:14:00 2022 +0100 ALSA: usb-audio: Add mute TLV for playback volumes on RODE NT-USB For the RODE NT-USB the lowest Playback mixer volume setting mutes the audio output. But it is not reported as such causing e.g. PulseAudio to accidentally mute the device when selecting a low volume. Fix this by applying the existing quirk for this kind of issue when the device is detected. Signed-off-by: Lars-Peter Clausen Cc: Link: https://lore.kernel.org/r/20220311201400.235892-1-lars@metafoo.de Signed-off-by: Takashi Iwai sound/usb/mixer_quirks.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 625788b5844511cf4c30cffa7fa0bc3a69cebc82 Author: Eric Dumazet Date: Thu Mar 10 21:14:20 2022 -0800 net: add per-cpu storage and net->core_stats Before adding yet another possibly contended atomic_long_t, it is time to add per-cpu storage for existing ones: dev->tx_dropped, dev->rx_dropped, and dev->rx_nohandler Because many devices do not have to increment such counters, allocate the per-cpu storage on demand, so that dev_get_stats() does not have to spend considerable time folding zero counters. Note that some drivers have abused these counters which were supposed to be only used by core networking stack. v4: should use per_cpu_ptr() in dev_get_stats() (Jakub) v3: added a READ_ONCE() in netdev_core_stats_alloc() (Paolo) v2: add a missing include (reported by kernel test robot ) Change in netdev_core_stats_alloc() (Jakub) Signed-off-by: Eric Dumazet Cc: jeffreyji Reviewed-by: Brian Vazquez Reviewed-by: Jakub Kicinski Acked-by: Paolo Abeni Link: https://lore.kernel.org/r/20220311051420.2608812-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski drivers/net/bonding/bond_main.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 +- drivers/net/ethernet/hisilicon/hns/hns_ethtool.c | 4 +- .../net/ethernet/qualcomm/rmnet/rmnet_handlers.c | 2 +- drivers/net/ipvlan/ipvlan_core.c | 2 +- drivers/net/macvlan.c | 2 +- drivers/net/net_failover.c | 2 +- drivers/net/tun.c | 16 +++---- drivers/net/vxlan/vxlan_core.c | 2 +- include/linux/netdevice.h | 46 +++++++++++++++---- include/net/bonding.h | 2 +- net/core/dev.c | 51 ++++++++++++++++++---- net/core/gro_cells.c | 2 +- net/hsr/hsr_device.c | 2 +- net/xfrm/xfrm_device.c | 2 +- 15 files changed, 101 insertions(+), 40 deletions(-) commit a8c063372bff46ed8f94c87cfac45a3ce016a380 Merge: d59c85ddacb3 d3826a95222c Author: Jakub Kicinski Date: Fri Mar 11 23:10:23 2022 -0800 Merge branch 'nfp-preliminary-support-for-nfp-3800' Simon Horman says: ==================== nfp: preliminary support for NFP-3800 This series is the first step to add support to the NFP driver for the new NFP-3800 device. In this first series the goal is to clean up small issues found while adding support for the new device, prepare an abstraction of the differences between the already supported devices and the new Kestrel device and add the new PCI ID. * Patch 1/11 and 2/11 starts by removing some dead code and incorrect assumptions found while working Kestrel support. Patch 3/11, 4/11 and 5/11 cleans up and prepares for adding the new PCI ID for Kestrel. * Patches 6/11, 7/11, 8/11, 9/11, 10/11 adds, plumb and populates a device information structure to abstract the differences between the existed supported devices (NFP-4000, NFP-5000 and NFP-6000) and the new device (NFP3800). * Finally patch 11/11 adds the new PCI ID for Kestrel. More work is needed to drive the new NFP-3800 device after this first batch of patches the foundation is prepared for the follow up work. Thanks to the work of all those who contributed to this work. ==================== Link: https://lore.kernel.org/r/20220311104306.28357-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit d3826a95222c44a527f76b011bb5af8c924632e9 Author: Dirk van der Merwe Date: Fri Mar 11 11:43:06 2022 +0100 nfp: add support for NFP3800/NFP3803 PCIe devices Enable binding the nfp driver to NFP3800 and NFP3803 devices. The PCIE_SRAM offset is different for the NFP3800 device, which also only supports a single explicit group. Changes to Dirk's work: * 48-bit dma addressing is not ready yet. Keep 40-bit dma addressing for NFP3800. Signed-off-by: Dirk van der Merwe Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_main.c | 4 ++++ drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c | 4 ++++ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpp.h | 4 ---- drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c | 19 +++++++++++++++++++ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h | 2 ++ include/linux/pci_ids.h | 2 ++ 6 files changed, 31 insertions(+), 4 deletions(-) commit 7f3aa620f86a75c137c9eccde14eb091a00dfa9d Author: Jakub Kicinski Date: Fri Mar 11 11:43:05 2022 +0100 nfp: take chip version into account for ring sizes NFP3800 has slightly different queue controller range bounds. Use the static chip data instead of defines. This commit still assumes unchanged descriptor format. Later datapath changes will allow adjusting for descriptor accounting. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_net.h | 5 ----- drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c | 14 +++++++++----- drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c | 5 +++++ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h | 2 ++ 4 files changed, 16 insertions(+), 10 deletions(-) commit e900db704c8512bce5641639e6b069ebaccf9c90 Author: Jakub Kicinski Date: Fri Mar 11 11:43:04 2022 +0100 nfp: parametrize QCP offset/size using dev_info The queue controller (QCP) is accessed based on a device specific offset. The NFP3800 device also supports more queues. Furthermore, the NFP3800 VFs also access the QCP differently to how the NFP6000 VFs accesses it, though still indirectly. Fortunately, we can remove the offset all together for both VF types. This is safe for NFP6000 VFs since the offset was effectively a wrap around and only used for convenience to have it set the same as the NFP6000 PF. Use nfp_dev_info to store queue controller parameters. Signed-off-by: Dirk van der Merwe Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_net.h | 6 ++---- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 7 +++++++ drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 5 +++-- drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c | 6 +++--- drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c | 10 ++++++++++ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h | 7 +++++++ 6 files changed, 32 insertions(+), 9 deletions(-) commit 9ba1dc994ff56f273fa9697878c6d47ad945aa44 Author: Jakub Kicinski Date: Fri Mar 11 11:43:03 2022 +0100 nfp: use dev_info for the DMA mask In preparation for new chips instead of defines use dev_info constants to store DMA mask length. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_main.c | 3 +-- drivers/net/ethernet/netronome/nfp/nfp_net.h | 3 --- drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c | 3 +-- drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c | 3 +++ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h | 1 + 5 files changed, 6 insertions(+), 7 deletions(-) commit f524b335c08cf25c1a037d477e3239f894bc52b5 Author: Jakub Kicinski Date: Fri Mar 11 11:43:02 2022 +0100 nfp: use dev_info for PCIe config space BAR offsets NFP3800 uses a different PCIe configuration to CPP expansion BAR offsets. We don't need to differentiate between the NFP4000, NFP5000 and NFP6000 since they all use the same offsets. Signed-off-by: Dirk van der Merwe Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski .../net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c | 18 ++++++------------ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c | 2 ++ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h | 4 ++++ 3 files changed, 12 insertions(+), 12 deletions(-) commit 9423d24b7b84b013518ccdf760c97a8ed3b6c885 Author: Jakub Kicinski Date: Fri Mar 11 11:43:01 2022 +0100 nfp: introduce dev_info static chip data In preparation for supporting new chip add a driver data structure which will hold per-chip-version information such as register offsets. Plumb it through to the relevant functions (nfpcore and nfp_net). For now only a very simple member holding chip names is added, following commits will add more. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/Makefile | 1 + drivers/net/ethernet/netronome/nfp/nfp_main.c | 13 +++++++++---- drivers/net/ethernet/netronome/nfp/nfp_main.h | 2 ++ drivers/net/ethernet/netronome/nfp/nfp_net.h | 6 +++++- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 5 ++++- drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 3 ++- drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c | 9 +++++++-- .../net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.c | 11 ++++++++--- .../net/ethernet/netronome/nfp/nfpcore/nfp6000_pcie.h | 3 ++- drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.c | 10 ++++++++++ drivers/net/ethernet/netronome/nfp/nfpcore/nfp_dev.h | 18 ++++++++++++++++++ 11 files changed, 68 insertions(+), 13 deletions(-) commit 7ab7985df25785c22fb2c17054e5e42ff1cda60d Author: Jakub Kicinski Date: Fri Mar 11 11:43:00 2022 +0100 nfp: sort the device ID tables Make sure the device ID tables are in ascending order. Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5d1359ed5d693a5e4ca76e68c895579ee7b0dc23 Author: Dirk van der Merwe Date: Fri Mar 11 11:42:59 2022 +0100 nfp: use PluDevice register for model for non-NFP6000 chips The model number for NFP3800 and newer devices can be completely derived from PluDevice register without subtracting 0x10. Signed-off-by: Dirk van der Merwe Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfpcore/nfp_cpplib.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 113e96241631278268e3cbb7ced0ee3f7d9b32a1 Author: Dirk van der Merwe Date: Fri Mar 11 11:42:58 2022 +0100 nfp: use PCI_DEVICE_ID_NETRONOME_NFP6000_VF for VFs instead The PCI_DEVICE_ID_NETRONOME_NFP6000_VF is available for use and should be used instead of the PCI_DEVICE_NFP6000VF. Meanwhile, PCI_DEVICE_NFP6000VF PCI ID is removed for not being used. Signed-off-by: Dirk van der Merwe Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_netvf_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit f6df1aa628f577ef03a917b3682bd20bcb939f05 Author: Christo du Toit Date: Fri Mar 11 11:42:57 2022 +0100 nfp: remove pessimistic NFP_QCP_MAX_ADD limits Multiple writes cause intermediate pointer values that do not end on complete TX descriptors. The QCP peripheral on the NFP provides a number of access modes. In some access modes, the maximum amount to add must be restricted to a 6bit value. The particular access mode used by _nfp_qcp_ptr_add() has no such restrictions, so the "< NFP_QCP_MAX_ADD" test is unnecessary. Note that trying to add more that the configured ring size in a single add will cause a QCP overflow, caught and handled by the QCP peripheral. Signed-off-by: Christo du Toit Signed-off-by: Jakub Kicinski Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_net.h | 32 ++-------------------------- 1 file changed, 2 insertions(+), 30 deletions(-) commit 940ea0eae31b67d8da19e3e944f4f99cb3fb514c Author: Jakub Kicinski Date: Fri Mar 11 11:42:56 2022 +0100 nfp: remove define for an unused control bit NFP driver ABI contains a bit for ring prioritization which was never implemented in the initially envisioned form. Remove it, and open up the possibility of reclaiming for other uses. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: Fei Qin Signed-off-by: Simon Horman Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h | 1 - 1 file changed, 1 deletion(-) commit d59c85ddacb350ad33b4326a1f4bf50c4c56a500 Author: Yang Li Date: Fri Mar 11 08:17:56 2022 +0800 ethernet: 8390: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq() already prints an error. Eliminate the follow coccicheck warning: ./drivers/net/ethernet/8390/mcf8390.c:414:2-9: line 414 is redundant because platform_get_irq() already prints an error Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220311001756.12234-1-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/8390/mcf8390.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 2387834dd228c9efa60dbe118e0eff051033176b Author: Jakub Kicinski Date: Thu Mar 10 14:39:52 2022 -0800 net: remove exports for netdev_name_node_alt_create() and destroy netdev_name_node_alt_create() and netdev_name_node_alt_destroy() are only called by rtnetlink, so no need for exports. Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220310223952.558779-1-kuba@kernel.org Signed-off-by: Jakub Kicinski net/core/dev.c | 2 -- 1 file changed, 2 deletions(-) commit 8cf5ab362dce8acff7d2d28a967cdb2d8e9f7b13 Author: Saurabh Sengar Date: Thu Mar 10 09:32:14 2022 -0800 net: netvsc: remove break after return In function netvsc_process_raw_pkt for VM_PKT_DATA_USING_XFER_PAGES case there is already a 'return' statement which results 'break' as dead code Signed-off-by: Saurabh Sengar Reviewed-by: Haiyang Zhang Link: https://lore.kernel.org/r/1646933534-29493-1-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Jakub Kicinski drivers/net/hyperv/netvsc.c | 1 - 1 file changed, 1 deletion(-) commit 515bb3071e16a7f14a68795af23287ab7367b588 Author: Christoph Hellwig Date: Thu Mar 10 15:32:29 2022 +0100 tcp: unexport tcp_ca_get_key_by_name and tcp_ca_get_name_by_key Both functions are only used by core networking code. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220310143229.895319-1-hch@lst.de Signed-off-by: Jakub Kicinski net/ipv4/tcp_cong.c | 2 -- 1 file changed, 2 deletions(-) commit cb631a6398192f79f33a2480517c272120985020 Author: Alex Elder Date: Fri Mar 11 10:24:23 2022 -0600 net: ipa: use struct_size() for the interconnect array In review for commit 8ee7ec4890e2b ("net: ipa: embed interconnect array in the power structure"), Jakub Kicinski suggested that a follow-up patch use struct_size() when computing the size of the IPA power structure, which ends with a flexible array member. Do that. Suggested-by: Jakub Kicinski Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20220311162423.872645-1-elder@linaro.org Signed-off-by: Jakub Kicinski drivers/net/ipa/ipa_power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit d447eaf746be91c094ed31478310619c07b717e2 Author: Martin Povišer Date: Tue Feb 8 19:34:11 2022 +0100 MAINTAINERS: Add clk-apple-nco under ARM/APPLE MACHINE Acked-by: Sven Peter Acked-by: Hector Martin Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220208183411.61090-4-povik+lin@cutebit.org Signed-off-by: Stephen Boyd MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) commit 6641057d5dba87338780cf3e0d0ae8389ef1125c Author: Martin Povišer Date: Tue Feb 8 19:34:10 2022 +0100 clk: clk-apple-nco: Add driver for Apple NCO Add a common clock driver for NCO blocks found on Apple SoCs where they are typically the generators of audio clocks. Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220208183411.61090-3-povik+lin@cutebit.org Signed-off-by: Stephen Boyd drivers/clk/Kconfig | 9 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-apple-nco.c | 334 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 344 insertions(+) commit 00d5d031d3283e2b01d1f3a48fd3ca4c927107c5 Author: Martin Povišer Date: Tue Feb 8 19:34:09 2022 +0100 dt-bindings: clock: Add Apple NCO The NCO block found on Apple SoCs is a programmable clock generator performing fractional division of a high frequency input clock. Reviewed-by: Mark Kettenis Reviewed-by: Rob Herring Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220208183411.61090-2-povik+lin@cutebit.org Signed-off-by: Stephen Boyd .../devicetree/bindings/clock/apple,nco.yaml | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) commit 593adaa6459903728cb59392239f2c615b8dadbb Author: Frank Wunderlich Date: Fri Mar 11 22:03:56 2022 +0100 dt-bindings: ata: ahci-platform: Add rk3568-dwc-ahci compatible Add SoC specific compatible for rk3568 ahci controller Signed-off-by: Frank Wunderlich Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220311210357.222830-6-linux@fw-web.de Documentation/devicetree/bindings/ata/ahci-platform.yaml | 4 ++++ 1 file changed, 4 insertions(+) commit 3f5a539b35e45c53d6f0629b0e7312f10ad34052 Author: Frank Wunderlich Date: Fri Mar 11 22:03:55 2022 +0100 dt-bindings: ata: ahci-platform: Add power-domains property Some SoC using power-domains property so add it here Signed-off-by: Frank Wunderlich Reviewed-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220311210357.222830-5-linux@fw-web.de Documentation/devicetree/bindings/ata/ahci-platform.yaml | 3 +++ 1 file changed, 3 insertions(+) commit 7f4f25a6887c7d1381756deba882f6f6106433f6 Author: Frank Wunderlich Date: Fri Mar 11 22:03:52 2022 +0100 dt-bindings: ata: ahci-platform: Convert DT bindings to yaml Create a yaml file for dtbs_check from the old txt binding. Signed-off-by: Frank Wunderlich Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220311210357.222830-2-linux@fw-web.de .../devicetree/bindings/ata/ahci-platform.txt | 79 --------- .../devicetree/bindings/ata/ahci-platform.yaml | 182 +++++++++++++++++++++ 2 files changed, 182 insertions(+), 79 deletions(-) commit 635e5e73370e7a5974c09b86cccd96e562bfeee8 Author: Daire McNamara Date: Tue Feb 22 12:11:44 2022 +0000 clk: microchip: Add driver for Microchip PolarFire SoC Add support for clock configuration on Microchip PolarFire SoC Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven Co-developed-by: Padmarao Begari Signed-off-by: Padmarao Begari Signed-off-by: Daire McNamara Co-developed-by: Conor Dooley Signed-off-by: Conor Dooley Link: https://lore.kernel.org/r/20220222121143.3316880-2-conor.dooley@microchip.com Signed-off-by: Stephen Boyd drivers/clk/Kconfig | 4 +- drivers/clk/Makefile | 2 +- drivers/clk/microchip/Kconfig | 10 + drivers/clk/microchip/Makefile | 1 + drivers/clk/microchip/clk-mpfs.c | 381 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 394 insertions(+), 4 deletions(-) commit ca85a66710a8a1f6b0719397225c3e9ee0abb692 Author: Kunihiko Hayashi Date: Wed Mar 9 15:55:18 2022 +0900 clk: uniphier: Fix fixed-rate initialization Fixed-rate clocks in UniPhier don't have any parent clocks, however, initial data "init.flags" isn't initialized, so it might be determined that there is a parent clock for fixed-rate clock. This sets init.flags to zero as initialization. Cc: Fixes: 734d82f4a678 ("clk: uniphier: add core support code for UniPhier clock driver") Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1646808918-30899-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Stephen Boyd drivers/clk/uniphier/clk-uniphier-fixed-rate.c | 1 + 1 file changed, 1 insertion(+) commit 7cd5c56054f8340218b65bd6e4cc04614a4ab89c Author: Geert Uytterhoeven Date: Thu Feb 24 16:29:17 2022 +0100 clk: COMMON_CLK_LAN966X should depend on SOC_LAN966 The LAN966x Generic Clock Controller is only present on Microchip LAN966x SoCs. Hence add a dependency on SOC_LAN966, to prevent asking the user about this driver when configuring a kernel without LAN966x SoC support. Fixes: 54104ee023333e3b ("clk: lan966x: Add lan966x SoC clock driver") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/eb102eae05e5667b9bd342a0c387f7f262d24bda.1645716471.git.geert+renesas@glider.be Reviewed-by: Horatiu Vultur Signed-off-by: Stephen Boyd drivers/clk/Kconfig | 1 + 1 file changed, 1 insertion(+) commit cde8e3ae3d374bf7826d87bcb6b28fb334dcaf82 Author: Minghao Chi (CGEL ZTE) Date: Thu Mar 3 01:48:56 2022 +0000 clk: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Link: https://lore.kernel.org/r/20220303014856.2059307-1-chi.minghao@zte.com.cn Acked-by: Neil Armstrong Signed-off-by: Stephen Boyd drivers/clk/clk-oxnas.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) commit 09e3b18ca5def4680b65d60159e595dbbcf7743f Author: Maxime Ripard Date: Tue Feb 22 15:07:32 2022 +0100 clk: bcm2835: Remove unused variable Since commit 8ca011ef4af4 ("clk: bcm-2835: Remove rounding up the dividers"), the rem variable is still set but no longer used. Remove it. Fixes: 8ca011ef4af4 ("clk: bcm-2835: Remove rounding up the dividers") Reported-by: kernel test robot Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220222140732.253819-1-maxime@cerno.tech Reviewed-by: Florian Fainelli Signed-off-by: Stephen Boyd drivers/clk/bcm/clk-bcm2835.c | 2 -- 1 file changed, 2 deletions(-) commit 6d6ef58c2470da85a99119f74d34216c8074b9f0 Author: Miaoqian Lin Date: Wed Jan 12 10:45:01 2022 +0000 clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the error handling path. Fixes: 2db04f16b589 ("clk: tegra: Add EMC clock driver") Signed-off-by: Miaoqian Lin Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20220112104501.30655-1-linmq006@gmail.com Signed-off-by: Stephen Boyd drivers/clk/tegra/clk-tegra124-emc.c | 1 + 1 file changed, 1 insertion(+) commit e9d6cea2af1cf8d84287ff2287b6cd776f7475d2 Author: Maxime Ripard Date: Fri Feb 25 15:35:32 2022 +0100 clk: bcm: rpi: Run some clocks at the minimum rate allowed The core clock and M2MC clocks are shared between some devices (Unicam controllers and the HVS, and the HDMI controllers, respectively) that will have various, varying, requirements depending on their current work load. Since those loads can require a fairly high clock rate in extreme conditions (up to ~600MHz), we can end up running those clocks at their maximum frequency even though we no longer require such a high rate. Fortunately, those devices don't require an exact rate but a minimum rate, and all the drivers are using clk_set_min_rate. Thus, we can just rely on the fact that the clk_request minimum (which is the aggregated minimum of all the clock users) is what we want at all times. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-11-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/bcm/clk-raspberrypi.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) commit 542acfec4e313c001f9b82332f4fa2848ec7bf58 Author: Maxime Ripard Date: Fri Feb 25 15:35:31 2022 +0100 clk: bcm: rpi: Set a default minimum rate The M2MC clock provides the state machine clock for both HDMI controllers. However, if no HDMI monitor is plugged in at boot, its clock rate will be left at 0 by the firmware and will make any register access end up in a CPU stall, even though the clock was enabled. We had some code in the HDMI controller to deal with this before, but it makes more sense to have it in the clock driver. Move it there. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-10-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/bcm/clk-raspberrypi.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) commit 12c90f3f27bb3ad0dd3fad1550fec87091aa3329 Author: Maxime Ripard Date: Fri Feb 25 15:35:30 2022 +0100 clk: bcm: rpi: Add variant structure We only export a bunch of firmware clocks, and some of them require special treatment. This has been do so far using some tests on the clock id in various places, but this is fairly hard to extend and doesn't scale very well. Since we'll need some more cases in the next patches, let's switch to a variant structure that defines the behaviour we need to have for a given clock. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-9-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/bcm/clk-raspberrypi.c | 64 ++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 17 deletions(-) commit c97448437847bd76116b3a077e44808e946bb1ae Author: Maxime Ripard Date: Fri Feb 25 15:35:29 2022 +0100 clk: Add clk_drop_range In order to reset the range on a clock, we need to call clk_set_rate_range with a minimum of 0 and a maximum of ULONG_MAX. Since it's fairly inconvenient, let's introduce a clk_drop_range() function that will do just this. Suggested-by: Stephen Boyd Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-8-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/clk_test.c | 4 ++-- include/linux/clk.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) commit c80ac50cbb378a4029129a596251747386e3c8e9 Author: Maxime Ripard Date: Fri Feb 25 15:35:28 2022 +0100 clk: Always set the rate on clk_set_range_rate When we change a clock minimum or maximum using clk_set_rate_range(), clk_set_min_rate() or clk_set_max_rate(), the current code will only trigger a new rate change if the rate is outside of the new boundaries. However, a clock driver might want to always keep the clock rate to one of its boundary, for example the minimum to keep the power consumption as low as possible. Since they don't always get called though, clock providers don't have the opportunity to implement this behaviour. Let's trigger a clk_set_rate() on the previous requested rate every time clk_set_rate_range() is called. That way, providers that care about the new boundaries have a chance to adjust the rate, while providers that don't care about those new boundaries will return the same rate than before, which will be ignored by clk_set_rate() and won't result in a new rate change. Suggested-by: Stephen Boyd Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-7-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/clk.c | 45 +++++++++++++++++++++-------------------- drivers/clk/clk_test.c | 54 ++++++++++++++++++++++---------------------------- 2 files changed, 47 insertions(+), 52 deletions(-) commit a9b269310ad9abb2f206fe814fd3afcadddce3aa Author: Maxime Ripard Date: Fri Feb 25 15:35:27 2022 +0100 clk: Use clamp instead of open-coding our own The code in clk_set_rate_range() will, if the current rate is outside of the new range, force it to the minimum or maximum. Since it's running under the condition that the rate is either lower than the minimum, or higher than the maximum, this is equivalent to using clamp, while being less readable. Let's switch to using clamp instead. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-6-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/clk.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) commit 948fb0969eae856f9b65d8c9b98042afed08454f Author: Maxime Ripard Date: Fri Feb 25 15:35:26 2022 +0100 clk: Always clamp the rounded rate The current core while setting the min and max rate properly in the clk_request structure will not make sure that the requested rate is within these boundaries, leaving it to each and every driver to make sure it is. It's not clear if this was on purpose or not, but this introduces some inconsistencies within the API. For example, a user setting a range and then calling clk_round_rate() with a value outside of that range will get the same value back (ignoring any driver adjustements), effectively ignoring the range that was just set. Another one, arguably worse, is that it also makes clk_round_rate() and clk_set_rate() behave differently if there's a range and the rate being used for both is outside that range. As we have seen, the rate will be returned unchanged by clk_round_rate(), but clk_set_rate() will error out returning -EINVAL. Let's make sure the framework will always clamp the rate to the current range found on the clock, which will fix both these inconsistencies. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-5-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/clk.c | 2 ++ drivers/clk/clk_test.c | 50 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 34 insertions(+), 18 deletions(-) commit 10c46f2ea914202482d19cf80dcc9c321c9ff59b Author: Maxime Ripard Date: Fri Feb 25 15:35:25 2022 +0100 clk: Enforce that disjoints limits are invalid If we were to have two users of the same clock, doing something like: clk_set_rate_range(user1, 1000, 2000); clk_set_rate_range(user2, 3000, 4000); The second call would fail with -EINVAL, preventing from getting in a situation where we end up with impossible limits. However, this is never explicitly checked against and enforced, and works by relying on an undocumented behaviour of clk_set_rate(). Indeed, on the first clk_set_rate_range will make sure the current clock rate is within the new range, so it will be between 1000 and 2000Hz. On the second clk_set_rate_range(), it will consider (rightfully), that our current clock is outside of the 3000-4000Hz range, and will call clk_core_set_rate_nolock() to set it to 3000Hz. clk_core_set_rate_nolock() will then call clk_calc_new_rates() that will eventually check that our rate 3000Hz rate is outside the min 3000Hz max 2000Hz range, will bail out, the error will propagate and we'll eventually return -EINVAL. This solely relies on the fact that clk_calc_new_rates(), and in particular clk_core_determine_round_nolock(), won't modify the new rate allowing the error to be reported. That assumption won't be true for all drivers, and most importantly we'll break that assumption in a later patch. It can also be argued that we shouldn't even reach the point where we're calling clk_core_set_rate_nolock(). Let's make an explicit check for disjoints range before we're doing anything. Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-4-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/clk.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) commit 723d0530d9d778cdceab4ebd0d0efc2d3a021c3c Author: Maxime Ripard Date: Fri Feb 25 15:35:24 2022 +0100 clk: Introduce Kunit Tests for the framework Let's test various parts of the rate-related clock API with the kunit testing framework. Cc: kunit-dev@googlegroups.com Tested-by: Daniel Latypov Suggested-by: Stephen Boyd Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-3-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/.kunitconfig | 1 + drivers/clk/Kconfig | 7 + drivers/clk/Makefile | 1 + drivers/clk/clk_test.c | 787 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 796 insertions(+) commit 0c1b56df451716ba207bbf59f303473643eee4fd Author: Maxime Ripard Date: Fri Feb 25 15:35:23 2022 +0100 clk: Fix clk_hw_get_clk() when dev is NULL Any registered clk_core structure can have a NULL pointer in its dev field. While never actually documented, this is evidenced by the wide usage of clk_register and clk_hw_register with a NULL device pointer, and the fact that the core of_clk_hw_register() function also passes a NULL device pointer. A call to clk_hw_get_clk() on a clk_hw struct whose clk_core is in that case will result in a NULL pointer derefence when it calls dev_name() on that NULL device pointer. Add a test for this case and use NULL as the dev_id if the device pointer is NULL. Fixes: 30d6f8c15d2c ("clk: add api to get clk consumer from clk_hw") Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20220225143534.405820-2-maxime@cerno.tech Signed-off-by: Stephen Boyd drivers/clk/clk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 7c55e8efd290438e9bd95f6c3e14d3fa4f71b323 Author: Tom Rix Date: Tue Feb 22 11:51:53 2022 -0800 clk: cleanup comments For spdx Space instead of tab before spdx tag Removed repeated works the, to, two Replacements much much to a much 'to to' to 'to do' aready to already Comunications to Communications freqency to frequency Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220222195153.3817625-1-trix@redhat.com Signed-off-by: Stephen Boyd drivers/clk/at91/sckc.c | 2 +- drivers/clk/axis/clk-artpec6.c | 2 +- drivers/clk/bcm/clk-iproc.h | 2 +- drivers/clk/bcm/clk-kona-setup.c | 2 +- drivers/clk/clk-fractional-divider.c | 2 +- drivers/clk/clk-si5341.c | 2 +- drivers/clk/meson/meson8b.c | 2 +- drivers/clk/mmp/pwr-island.c | 2 +- drivers/clk/socfpga/clk-gate-s10.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) commit 59983c74fc42eb2448df693113bf725abbda05f9 Author: Stephan Gerhold Date: Mon Feb 28 23:53:59 2022 +0100 remoteproc: qcom_q6v5_mss: Create platform device for BAM-DMUX The modem remoteproc on older Qualcomm SoCs (e.g. MSM8916 and MSM8974) implements the BAM-DMUX protocol to allow access to the network data channels of the modem. The hardware/firmware resources required to implement the BAM-DMUX driver are described in an extra node in the device tree (with the compatible "qcom,bam-dmux"). This node logically belongs below the modem remoteproc, so that both control interfaces (rpmsg_wwan_ctrl) and network interfaces (bam_dmux) have a common parent. Unlike other child devices of the modem remoteproc, the bam-dmux device currently does not follow the state of the remoteproc (i.e. it is not added/removed when the remoteproc is started/stopped). However, this is an implementation detail of the bam_dmux driver in Linux that might change in the future. To be flexible for future changes, create a standard platform device specifically only for "qcom,bam-dmux", rather than populating all child nodes. This is also more consistent with the way the other child nodes are handled in the driver. Note: of_platform_device_create() and of_node_put() have NULL-checks internally, so there is no need to check if the "qcom,bam-dmux" node actually exists in the device tree. Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220228225400.146555-2-stephan@gerhold.net drivers/remoteproc/qcom_q6v5_mss.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 6f3cf24864ac113b053e485d7a7b000ee3786d1d Author: Tom Rix Date: Thu Feb 17 09:34:53 2022 -0800 clk: socfpga: cleanup spdx tags Replace tabs with spaces in SPDX tag Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220217173453.3262672-1-trix@redhat.com Acked-by: Dinh Nguyen Signed-off-by: Stephen Boyd drivers/clk/socfpga/clk-periph-s10.c | 2 +- drivers/clk/socfpga/clk-pll-s10.c | 2 +- drivers/clk/socfpga/clk-s10.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit 1fdfd517ce79740016f8ea4afc3fdc8e13f2653c Author: Jonathan Neuschäfer Date: Fri Feb 18 01:09:21 2022 +0100 clk: actions: Make sentinel elements more obvious The sentinel elements of various tables in drivers/clk/actions can be a bit hard to recognize. Make them easier to see by changing the style from { 0, 0 } to { /* sentinel */ }. Signed-off-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20220218000922.134857-6-j.neuschaefer@gmx.net Signed-off-by: Stephen Boyd drivers/clk/actions/owl-s500.c | 16 ++++++++-------- drivers/clk/actions/owl-s700.c | 18 ++++++++++-------- drivers/clk/actions/owl-s900.c | 26 +++++++++++++------------- 3 files changed, 31 insertions(+), 29 deletions(-) commit 8bed4ed5aa3431085d9d27afc35d684856460eda Author: Jonathan Neuschäfer Date: Fri Feb 18 01:09:20 2022 +0100 clk: clps711x: Terminate clk_div_table with sentinel element In order that the end of a clk_div_table can be detected, it must be terminated with a sentinel element (.div = 0). Fixes: 631c53478973d ("clk: Add CLPS711X clk driver") Signed-off-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20220218000922.134857-5-j.neuschaefer@gmx.net Signed-off-by: Stephen Boyd drivers/clk/clk-clps711x.c | 2 ++ 1 file changed, 2 insertions(+) commit 113b261bdf2b4fd34e7769a147a7acd0a4d9137f Author: Jonathan Neuschäfer Date: Fri Feb 18 01:09:19 2022 +0100 clk: hisilicon: Terminate clk_div_table with sentinel element In order that the end of a clk_div_table can be detected, it must be terminated with a sentinel element (.div = 0). Fixes: 6c81966107dc0 ("clk: hisilicon: Add clock driver for hi3559A SoC") Signed-off-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20220218000922.134857-4-j.neuschaefer@gmx.net Signed-off-by: Stephen Boyd drivers/clk/hisilicon/clk-hi3559a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3eb00f89162e80083dfcaa842468b510462cfeaa Author: Jonathan Neuschäfer Date: Fri Feb 18 01:09:18 2022 +0100 clk: loongson1: Terminate clk_div_table with sentinel element In order that the end of a clk_div_table can be detected, it must be terminated with a sentinel element (.div = 0). Fixes: b4626a7f4892 ("CLK: Add Loongson1C clock support") Signed-off-by: Jonathan Neuschäfer Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20220218000922.134857-3-j.neuschaefer@gmx.net Signed-off-by: Stephen Boyd drivers/clk/loongson1/clk-loongson1c.c | 1 + 1 file changed, 1 insertion(+) commit d8a441e53e2434b1401e52dfd66b05263e442edc Author: Jonathan Neuschäfer Date: Fri Feb 18 01:09:17 2022 +0100 clk: actions: Terminate clk_div_table with sentinel element In order that the end of a clk_div_table can be detected, it must be terminated with a sentinel element (.div = 0). In owl-s900.s, the { 0, 8 } element was probably meant to be just that, so this patch changes { 0, 8 } to { 0, 0 }. Fixes: d47317ca4ade1 ("clk: actions: Add S700 SoC clock support") Fixes: d85d20053e195 ("clk: actions: Add S900 SoC clock support") Signed-off-by: Jonathan Neuschäfer Reviewed-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220218000922.134857-2-j.neuschaefer@gmx.net Signed-off-by: Stephen Boyd drivers/clk/actions/owl-s700.c | 1 + drivers/clk/actions/owl-s900.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) commit bc47ee4844d6b7d7351536cd99d35848c4449689 Author: Steven Rostedt (Google) Date: Fri Mar 11 18:59:57 2022 -0500 tracing/user_events: Use alloc_pages instead of kzalloc() for register pages kzalloc virtual addresses do not work with SetPageReserved, use the actual page virtual addresses instead via alloc_pages. The issue is reported when booting with user_events and DEBUG_VM_PGFLAGS=y. Also make the number of events based on the ORDER. Link: https://lore.kernel.org/all/CADYN=9+xY5Vku3Ws5E9S60SM5dCFfeGeRBkmDFbcxX0ZMoFing@mail.gmail.com/ Link: https://lore.kernel.org/all/20220311223028.1865-1-beaub@linux.microsoft.com/ Cc: Beau Belgrave Reported-by: Anders Roxell Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events_user.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) commit 3b6c6c039707f6bb7c64af2aa82a437fabb93aee Author: Dan Williams Date: Wed Mar 9 19:49:48 2022 -0800 nvdimm/region: Delete nd_blk_region infrastructure Now that the nd_namespace_blk infrastructure is removed, delete all the region machinery to coordinate provisioning aliased capacity between PMEM and BLK. Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/164688418803.2879318.1302315202397235855.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams drivers/acpi/nfit/core.c | 11 +- drivers/nvdimm/bus.c | 2 - drivers/nvdimm/dimm_devs.c | 204 +++---------------------------------- drivers/nvdimm/label.c | 6 +- drivers/nvdimm/label.h | 2 +- drivers/nvdimm/namespace_devs.c | 127 +++-------------------- drivers/nvdimm/nd-core.h | 24 +---- drivers/nvdimm/nd.h | 12 --- drivers/nvdimm/region.c | 31 ++---- drivers/nvdimm/region_devs.c | 158 ++++------------------------ include/linux/libnvdimm.h | 24 ----- include/uapi/linux/ndctl.h | 2 - tools/testing/nvdimm/test/ndtest.c | 67 +----------- 13 files changed, 66 insertions(+), 604 deletions(-) commit a4b96046a8823a796b28e713ecc8ec535f5e4607 Author: Dan Williams Date: Wed Mar 9 19:49:42 2022 -0800 ACPI: NFIT: Remove block aperture support Delete the code to parse interleave-descriptor-tables and coordinate I/O through a BLK aperture. Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/164688418240.2879318.400185926874596938.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams drivers/acpi/nfit/core.c | 376 --------------------------------------- drivers/acpi/nfit/nfit.h | 6 - tools/testing/nvdimm/test/nfit.c | 23 --- 3 files changed, 405 deletions(-) commit 84bd3690bf54a2f2f3b8449afa022aac1957ba17 Author: Dan Williams Date: Wed Mar 9 19:49:37 2022 -0800 nvdimm/namespace: Delete nd_namespace_blk Now that none of the configuration paths consider BLK namespaces, delete the BLK namespace data and supporting code. Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/164688417727.2879318.11691110761800109662.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams drivers/nvdimm/label.c | 340 ---------------------------------------- drivers/nvdimm/label.h | 3 - drivers/nvdimm/namespace_devs.c | 227 ++------------------------- drivers/nvdimm/nd-core.h | 3 - drivers/nvdimm/nd.h | 1 - include/linux/nd.h | 26 --- 6 files changed, 13 insertions(+), 587 deletions(-) commit fadc38a6672a72bfb2937e85bc5a967f7ab581f8 Author: Dan Williams Date: Wed Mar 9 19:49:32 2022 -0800 nvdimm/namespace: Delete blk namespace consideration in shared paths Given is_namespace_blk() is never true outside of the NVDIMM unit tests delete the support from namespace device management. Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/164688417214.2879318.4698377272678028573.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams drivers/nvdimm/namespace_devs.c | 152 +++------------------------------------- 1 file changed, 9 insertions(+), 143 deletions(-) commit f8669f1d6a86a6b17104ceca9340ded280307ac1 Author: Dan Williams Date: Wed Mar 9 19:49:26 2022 -0800 nvdimm/blk: Delete the block-aperture window driver Block Aperture Window support was an attempt to layer an error model over PMEM for platforms that did not support machine-check-recovery. However, it was abandoned before it ever shipped, and only ever existed in the ACPI specification. Meanwhile Linux has carried a large pile of dead code for non-shipping infrastructure. For years it has been off to the side out of the way, but now CXL and recent directions with DAX support have the potential to collide with this code. In preparation for adding discontiguous namespace support, a pre-requisite for the nvdimm subsystem to replace device-mapper for striping + concatenation use cases, delete BLK aperture support. On the obscure chance that some hardware vendor shipped support for this mode, note that the driver will still keep BLK space reserved in the label area. So an end user in this case would still have the opportunity to report the regression to get BLK-mode support restored without risking the data they have on that device. Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/164688416668.2879318.16903178375774275120.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Documentation/driver-api/nvdimm/nvdimm.rst | 406 +++++++---------------------- drivers/nvdimm/Kconfig | 25 +- drivers/nvdimm/Makefile | 3 - drivers/nvdimm/blk.c | 335 ------------------------ tools/testing/nvdimm/Kbuild | 4 - tools/testing/nvdimm/config_check.c | 1 - 6 files changed, 92 insertions(+), 682 deletions(-) commit d9d290d7e659e9db3e4518040cc18b97f5535f4a Author: Dan Williams Date: Wed Mar 9 19:49:21 2022 -0800 nvdimm/region: Fix default alignment for small regions In preparation for removing BLK aperture support the NVDIMM unit tests discovered that the default alignment can be set higher than the capacity of the region. Fall back to PAGE_SIZE in that case. Given this has not been seen in the wild, elide notifying -stable. Fixes: 2522afb86a8c ("libnvdimm/region: Introduce an 'align' attribute") Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/164688416128.2879318.17890707310125575258.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams drivers/nvdimm/region_devs.c | 3 +++ 1 file changed, 3 insertions(+) commit d3b351f65bf42ccda1f686de3ccb21ea1a0c4f5a Author: Yonghong Song Date: Thu Mar 10 16:37:21 2022 -0800 selftests/bpf: Fix a clang compilation error for send_signal.c Building selftests/bpf with latest clang compiler (clang15 built from source), I hit the following compilation error: /.../prog_tests/send_signal.c:43:16: error: variable 'j' set but not used [-Werror,-Wunused-but-set-variable] volatile int j = 0; ^ 1 error generated. The problem also exists with clang13 and clang14. clang12 is okay. In send_signal.c, we have the following code ... volatile int j = 0; [...] for (int i = 0; i < 100000000 && !sigusr1_received; i++) j /= i + 1; ... to burn CPU cycles so bpf_send_signal() helper can be tested in NMI mode. Slightly changing 'j /= i + 1' to 'j /= i + j + 1' or 'j++' can fix the problem. Further investigation indicated this should be a clang bug ([1]). The upstream fix will be proposed later. But it is a good idea to workaround the issue to unblock people who build kernel/selftests with clang. [1] https://discourse.llvm.org/t/strange-clang-unused-but-set-variable-error-with-volatile-variables/60841 Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220311003721.2177170-1-yhs@fb.com tools/testing/selftests/bpf/prog_tests/send_signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ff1368763bb488783820c6ba68d73c03c562a9b7 Author: Randy Dunlap Date: Sun Jan 30 16:36:37 2022 -0800 Docs: ktap: add code-block type Fix multiple "code-block::" warnings by adding "none" as the type of code-block. Mends these warnings: Documentation/dev-tools/ktap.rst:71: WARNING: Error in "code-block" directive: 1 argument(s) required, 0 supplied. Documentation/dev-tools/ktap.rst:120: WARNING: Error in "code-block" directive: 1 argument(s) required, 0 supplied. Documentation/dev-tools/ktap.rst:126: WARNING: Error in "code-block" directive: 1 argument(s) required, 0 supplied. Documentation/dev-tools/ktap.rst:132: WARNING: Error in "code-block" directive: 1 argument(s) required, 0 supplied. Documentation/dev-tools/ktap.rst:139: WARNING: Error in "code-block" directive: 1 argument(s) required, 0 supplied. Documentation/dev-tools/ktap.rst:145: WARNING: Error in "code-block" directive: 1 argument(s) required, 0 supplied. Documentation/dev-tools/ktap.rst:195: WARNING: Error in "code-block" directive: 1 argument(s) required, 0 supplied. Documentation/dev-tools/ktap.rst:208: WARNING: Error in "code-block" directive: 1 argument(s) required, 0 supplied. Documentation/dev-tools/ktap.rst:238: WARNING: Error in "code-block" directive: 1 argument(s) required, 0 supplied. Fixes: a32fa6b2e8b4 ("Documentation: dev-tools: Add KTAP specification") Signed-off-by: Randy Dunlap Cc: Rae Moar Cc: David Gow Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Reviewed-by: Frank Rowand Reviewed-by: David Gow Link: https://lore.kernel.org/r/20220131003637.14274-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet Documentation/dev-tools/ktap.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit 33f588f8be651b968d058b67ea5e509ed9dd4e55 Author: Wan Jiabing Date: Fri Mar 4 18:03:15 2022 +0800 docs: serial: fix a reference file name in driver.rst Fix the following 'make refcheckdocs' warning: Warning: Documentation/driver-api/serial/driver.rst references a file that doesn't exist: Documentation/driver-api/serial/tty.rst Signed-off-by: Wan Jiabing Reviewed-by: Jiri Slaby Link: https://lore.kernel.org/r/20220304100315.6732-1-wanjiabing@vivo.com Signed-off-by: Jonathan Corbet Documentation/driver-api/serial/driver.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c09df4bd3a915079eec5e77160366225a28699a2 Author: Toke Høiland-Jørgensen Date: Thu Mar 10 23:56:21 2022 +0100 selftests/bpf: Add a test for maximum packet size in xdp_do_redirect This adds an extra test to the xdp_do_redirect selftest for XDP live packet mode, which verifies that the maximum permissible packet size is accepted without any errors, and that a too big packet is correctly rejected. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220310225621.53374-2-toke@redhat.com .../selftests/bpf/prog_tests/xdp_do_redirect.c | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) commit b6f1f780b3932ae497ed85e79bc8a1e513883624 Author: Toke Høiland-Jørgensen Date: Thu Mar 10 23:56:20 2022 +0100 bpf, test_run: Fix packet size check for live packet mode The live packet mode uses some extra space at the start of each page to cache data structures so they don't have to be rebuilt at every repetition. This space wasn't correctly accounted for in the size checking of the arguments supplied to userspace. In addition, the definition of the frame size should include the size of the skb_shared_info (as there is other logic that subtracts the size of this). Together, these mistakes resulted in userspace being able to trip the XDP_WARN() in xdp_update_frame_from_buff(), which syzbot discovered in short order. Fix this by changing the frame size define and adding the extra headroom to the bpf_prog_test_run_xdp() function. Also drop the max_len parameter to the page_pool init, since this is related to DMA which is not used for the page pool instance in PROG_TEST_RUN. Fixes: b530e9e1063e ("bpf: Add "live packet" mode for XDP in BPF_PROG_RUN") Reported-by: syzbot+0e91362d99386dc5de99@syzkaller.appspotmail.com Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220310225621.53374-1-toke@redhat.com net/bpf/test_run.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 0b3660695e80d53d1bab5b458f3a897a2c427a59 Merge: 59d5923536ac 7d352ccf1e99 Author: Jakub Kicinski Date: Fri Mar 11 13:00:16 2022 -0800 Merge tag 'wireless-next-2022-03-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next Johannes Berg says: ==================== brcmfmac * add BCM43454/6 support rtw89 * add support for 160 MHz channels and 6 GHz band * hardware scan support iwlwifi * support UHB TAS enablement via BIOS * remove a bunch of W=1 warnings * add support for channel switch offload * support 32 Rx AMPDU sessions in newer devices * add support for a couple of new devices * add support for band disablement via BIOS mt76 * mt7915 thermal management improvements * SAR support for more mt76 drivers * mt7986 wmac support on mt7915 ath11k * debugfs interface to configure firmware debug log level * debugfs interface to test Target Wake Time (TWT) * provide 802.11ax High Efficiency (HE) data via radiotap ath9k * use hw_random API instead of directly dumping into random.c wcn36xx * fix wcn3660 to work on 5 GHz band ath6kl * add device ID for WLU5150-D81 cfg80211/mac80211 * initial EHT (from 802.11be) support (EHT rates, 320 MHz, larger block-ack) * support disconnect on HW restart * tag 'wireless-next-2022-03-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (247 commits) mac80211: Add support to trigger sta disconnect on hardware restart mac80211: fix potential double free on mesh join mac80211: correct legacy rates check in ieee80211_calc_rx_airtime nl80211: fix typo of NL80211_IF_TYPE_OCB in documentation mac80211: Use GFP_KERNEL instead of GFP_ATOMIC when possible mac80211: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE rtw89: 8852c: process logic efuse map rtw89: 8852c: process efuse of phycap rtw89: support DAV efuse reading operation rtw89: 8852c: add chip::dle_mem rtw89: add page_regs to handle v1 chips rtw89: add chip_info::{h2c,c2h}_reg to support more chips rtw89: add hci_func_en_addr to support variant generation rtw89: add power_{on/off}_func rtw89: read chip version depends on chip ID rtw89: pci: use a struct to describe all registers address related to DMA channel rtw89: pci: add V1 of PCI channel address rtw89: pci: add struct rtw89_pci_info rtw89: 8852c: add 8852c empty files MAINTAINERS: add devicetree bindings entry for mt76 ... ==================== Link: https://lore.kernel.org/r/20220311124029.213470-1-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 9a41358972eb35e6e45327035a67adfa4a223ed2 Author: Gustavo A. R. Silva Date: Tue Jan 25 16:57:23 2022 -0600 hwspinlock: sprd: Use struct_size() helper in devm_kzalloc() Make use of the struct_size() helper instead of an open-coded version, in order to avoid any potential type mistakes or integer overflows that, in the worst scenario, could lead to heap overflows. Also, address the following sparse warnings: drivers/hwspinlock/sprd_hwspinlock.c:96:36: warning: using sizeof on a flexible structure Link: https://github.com/KSPP/linux/issues/174 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Baolin Wang Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220125225723.GA78256@embeddedor drivers/hwspinlock/sprd_hwspinlock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 3e5f1ff7e4f297b928fb579fa1e8ec65a400162e Author: Gustavo A. R. Silva Date: Mon Jan 24 20:13:53 2022 -0600 hwspinlock: stm32: Use struct_size() helper in devm_kzalloc() Make use of the struct_size() helper instead of an open-coded version, in order to avoid any potential type mistakes or integer overflows that, in the worst scenario, could lead to heap overflows. Also, address the following sparse warnings: drivers/hwspinlock/stm32_hwspinlock.c:84:32: warning: using sizeof on a flexible structure Link: https://github.com/KSPP/linux/issues/174 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Baolin Wang Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220125021353.GA29777@embeddedor drivers/hwspinlock/stm32_hwspinlock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 8b6d8d00a46a12a4baa08d547d4231e50a558254 Author: Xiang wangx Date: Mon Dec 6 00:27:52 2021 +0800 i2c: cros-ec-tunnel: Fix syntax errors in comments Delete the redundant word 'to' Signed-off-by: Xiang wangx [wsa: fixed prefix in subject] Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-cros-ec-tunnel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 246313e31316804c87887d3f33f8dc8ab6893560 Author: Lukas Bulwahn Date: Tue Mar 8 08:54:14 2022 +0100 MAINTAINERS: adjust XLP9XX I2C DRIVER after removing the devicetree binding Commit 0e5f897708e8 ("dt-bindings: Remove Netlogic bindings") removes the devicetree binding i2c-xlp9xx.txt, but misses to adjust the reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Remove the file reference to i2c-xlp9xx.txt in XLP9XX I2C DRIVER. As commit ef99066c7ded ("i2c: Remove Netlogic XLP variant") explains, the i2c-xlp9xx driver is still used by the Cavium ThunderX2 platform. So, keep the XLP9XX I2C DRIVER section in MAINTAINERS with its reference to drivers/i2c/busses/i2c-xlp9xx.c. Signed-off-by: Lukas Bulwahn Signed-off-by: Wolfram Sang MAINTAINERS | 1 - 1 file changed, 1 deletion(-) commit d0583229bcf5090495d0621892d5da93d9fb6e3c Author: Nathan Chancellor Date: Thu Mar 3 12:17:13 2022 -0700 i2c: designware: Mark dw_i2c_plat_{suspend,resume}() as __maybe_unused When CONFIG_PM is set but CONFIG_PM_SLEEP is not, two compiler warnings appear: drivers/i2c/busses/i2c-designware-platdrv.c:444:12: error: unused function 'dw_i2c_plat_suspend' [-Werror,-Wunused-function] static int dw_i2c_plat_suspend(struct device *dev) ^ drivers/i2c/busses/i2c-designware-platdrv.c:465:12: error: unused function 'dw_i2c_plat_resume' [-Werror,-Wunused-function] static int dw_i2c_plat_resume(struct device *dev) ^ 2 errors generated. These functions are only used in SET_LATE_SYSTEM_SLEEP_PM_OPS(), which is defined as empty when CONFIG_PM_SLEEP is not defined. Mark the functions as __maybe_unused to make it clear that these functions might be unused in this configuration. Fixes: c57813b8b288 ("i2c: designware: Lock the adapter while setting the suspended flag") Signed-off-by: Nathan Chancellor Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Acked-by: Jarkko Nikula Acked-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-designware-platdrv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1bff55b57ea16bac882715017fc9b8f9e16894e2 Author: Kewei Xu Date: Mon Mar 7 11:36:49 2022 +0800 i2c: mediatek: Add i2c compatible for Mediatek MT8168 Add i2c compatible for MT8168. Compare to MT2712 i2c controller, MT8168 need to synchronize signal with dma. Signed-off-by: Kewei Xu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Qii Wang Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-mt65xx.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit 09055eb060a434bdafa3904cfc92d393b9438a64 Author: Kewei Xu Date: Mon Mar 7 11:36:48 2022 +0800 dt-bindings: i2c: update bindings for MT8168 SoC Add a DT binding documentation for the MT8168 soc. Signed-off-by: Kewei Xu Reviewed-by: AngeloGioacchino Del Regno Acked-by: Krzysztof Kozlowski Reviewed-by: Qii Wang Signed-off-by: Wolfram Sang Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt | 1 + 1 file changed, 1 insertion(+) commit 0016a32f7591aec5413cf1f52b9ce522f1cae44f Author: AngeloGioacchino Del Regno Date: Thu Mar 3 10:15:47 2022 +0100 i2c: mt65xx: Simplify with clk-bulk Since depending on the SoC or specific bus functionality some clocks may be optional, we cannot get the benefit of using devm_clk_bulk_get() but, by migrating to clk-bulk, we are able to remove the custom functions mtk_i2c_clock_enable() and mtk_i2c_clock_disable(), increasing common APIs usage, hence (lightly) decreasing kernel footprint. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Qii Wang Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-mt65xx.c | 124 +++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 73 deletions(-) commit 89ee9301ac16d848d8dccf378d6ab3266fa80f62 Author: Vincent Whitchurch Date: Thu Mar 10 13:42:30 2022 +0100 docs: UML: Mention telnetd for port channel It is not obvious from the documentation that using the "port" channel for the console requires telnetd to be installed (see port_connection() in arch/um/drivers/port_user.c). Mention this, and the fact that UML will not boot until a client connects. Signed-off-by: Vincent Whitchurch Acked-by: Anton Ivanov Link: https://lore.kernel.org/r/20220310124230.3069354-1-vincent.whitchurch@axis.com Signed-off-by: Jonathan Corbet Documentation/virt/uml/user_mode_linux_howto_v2.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit ffce1439fe31590fdbacf17b638f2d62efebf02d Author: Yanteng Si Date: Thu Mar 10 23:20:52 2022 +0800 docs/zh_CN: add damon reclaim translation Translate .../admin-guide/mm/damon/reclaim.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/0a436fa78814bb0a7b9c2f3049e544b1e1802560.1646899089.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../zh_CN/admin-guide/mm/damon/index.rst | 4 +- .../zh_CN/admin-guide/mm/damon/reclaim.rst | 232 +++++++++++++++++++++ 2 files changed, 234 insertions(+), 2 deletions(-) commit 93b51a1019471839fbd528e39550cccbe000070b Author: Yanteng Si Date: Thu Mar 10 23:20:51 2022 +0800 docs/zh_CN: add damon usage translation Translate .../admin-guide/mm/damon/usage.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/431f1c2a158c61a6556f58048cb54961ab7a8790.1646899089.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../zh_CN/admin-guide/mm/damon/index.rst | 2 +- .../zh_CN/admin-guide/mm/damon/usage.rst | 286 +++++++++++++++++++++ 2 files changed, 287 insertions(+), 1 deletion(-) commit 94b140b085972eccd557f8cf5e4944e5c1486418 Author: Yanteng Si Date: Thu Mar 10 23:20:50 2022 +0800 docs/zh_CN: add admin-guide damon start translation Translate Documentation/admin-guide/mm/damon/start.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/e6e328be018cbf5f9105adfdad56c951acbb8c8f.1646899089.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../zh_CN/admin-guide/mm/damon/index.rst | 4 +- .../zh_CN/admin-guide/mm/damon/start.rst | 132 +++++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) commit 496cc140279b4517a23f4534e468ec9c66283f4b Author: Yanteng Si Date: Thu Mar 10 23:20:49 2022 +0800 docs/zh_CN: add admin-guide damon index translation Translate .../admin-guide/mm/damon/index.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/0251f09dc926972068329b87b0563dd432849497.1646899089.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../zh_CN/admin-guide/mm/damon/index.rst | 26 ++++++++++++++++++++++ .../translations/zh_CN/admin-guide/mm/index.rst | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) commit bad0eb76dccade4f5a601944986b3e647b7cd443 Author: Yanteng Si Date: Thu Mar 10 23:20:48 2022 +0800 docs/zh_CN: Refactoring the admin-guide directory index The Todolist in the html document looks a mess, now give it a nice looking format. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/d410408ec13d6e9cff97da50a13d793a428e05cf.1646899089.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../translations/zh_CN/admin-guide/index.rst | 122 ++++++++++----------- 1 file changed, 61 insertions(+), 61 deletions(-) commit 358b586fb3bc308a23b284ab087de145b5344ccc Author: Rakesh Pillai Date: Tue Feb 1 16:22:04 2022 +0530 remoteproc: qcom: q6v5_wpss: Add support for sc7280 WPSS Add support for PIL loading of WPSS processor for SC7280 - WPSS boot will be requested by the wifi driver and hence disable auto-boot for WPSS. - Add a separate shutdown sequence handler for WPSS. - Add multiple power-domain voting support - Parse firmware-name from dtsi entry Reviewed-by: Stephen Boyd Signed-off-by: Rakesh Pillai Signed-off-by: Manikanta Pubbisetty Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1643712724-12436-4-git-send-email-quic_mpubbise@quicinc.com drivers/remoteproc/qcom_q6v5_adsp.c | 227 +++++++++++++++++++++++++++++++++--- 1 file changed, 211 insertions(+), 16 deletions(-) commit 2630504894e8de12295dd4dc6062fd432765dcc5 Author: Rakesh Pillai Date: Tue Feb 1 16:22:03 2022 +0530 dt-bindings: remoteproc: qcom: Add SC7280 WPSS support Add WPSS PIL loading support for SC7280 SoCs. Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Rakesh Pillai Signed-off-by: Manikanta Pubbisetty Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1643712724-12436-3-git-send-email-quic_mpubbise@quicinc.com .../bindings/remoteproc/qcom,sc7280-wpss-pil.yaml | 219 +++++++++++++++++++++ 1 file changed, 219 insertions(+) commit 841fdd0ac005036972c06ebe2e456a20eea8b9da Author: Rakesh Pillai Date: Tue Feb 1 16:22:02 2022 +0530 dt-bindings: remoteproc: qcom: adsp: Convert binding to YAML Convert Qualcomm ADSP/CDSP Remoteproc devicetree binding to YAML. Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Rakesh Pillai Signed-off-by: Manikanta Pubbisetty Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1643712724-12436-2-git-send-email-quic_mpubbise@quicinc.com .../bindings/remoteproc/qcom,hexagon-v56.txt | 140 ------------------ .../bindings/remoteproc/qcom,qcs404-cdsp-pil.yaml | 161 +++++++++++++++++++++ .../bindings/remoteproc/qcom,sdm845-adsp-pil.yaml | 160 ++++++++++++++++++++ 3 files changed, 321 insertions(+), 140 deletions(-) commit 72e1bfd1b8e9d7648ffea85eeefbc1d784182acb Author: xu xin Date: Thu Mar 10 23:10:13 2022 +0800 zh_CN: Add translation for admin-guide/mm/index.rst Translate Documentation/admin-guide/mm/index.rst into Chinese. Update Documentation/admin-guide/index.rst. Reviewed-by: Yang Yang Reviewed-by: Alex Shi Reviewed-by: Yanteng Si Signed-off-by: xu xin Signed-off-by: Yanteng Si Link: https://lore.kernel.org/r/2d695dac05efc012b99fbc7525be65a421c7de03.1646899056.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../translations/zh_CN/admin-guide/index.rst | 2 +- .../translations/zh_CN/admin-guide/mm/index.rst | 49 ++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) commit f0abc76d7b8c2e1229bb5fee6f6bfffc01033b18 Author: xu xin Date: Thu Mar 10 23:10:12 2022 +0800 zh_CN: Add translations for admin-guide/mm/ksm.rst Translate Documentation/admin-guide/mm/ksm.rst into Chinese. Reviewed-by: Yang Yang Reviewed-by: Alex Shi Reviewed-by: Yanteng Si Signed-off-by: xu xin Signed-off-by: Yanteng Si Link: https://lore.kernel.org/r/f987a3a2cbffaad64f6e2377a5e393d9afbb099c.1646899056.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../translations/zh_CN/admin-guide/mm/ksm.rst | 148 +++++++++++++++++++++ 1 file changed, 148 insertions(+) commit 6f22931bbf7546d7a4bac35830b2918b4642b0e3 Author: xu xin Date: Thu Mar 10 23:10:11 2022 +0800 Add Chinese translation for vm/ksm.rst Translate Documentation/vm/ksm.rst into Chinese. Update Documentation/translations/zh_CN/vm/index.rst. Reviewed-by: Yang Yang Reviewed-by: Alex Shi Reviewed-by: Yanteng Si Signed-off-by: xu xin Signed-off-by: Yanteng Si Link: https://lore.kernel.org/r/ceb82d6458cd79bc3b7060199db0c3518adc3b8b.1646899056.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet Documentation/translations/zh_CN/vm/index.rst | 1 + Documentation/translations/zh_CN/vm/ksm.rst | 70 +++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) commit 52c74d17d89c6e69f9b774cdd477517e62383f55 Author: Jean Delvare Date: Thu Mar 3 17:42:56 2022 +0100 i2c: i801: Drop two outdated comments * Timeouts are reported even in interrupt mode since commit b3b8df97723d ("i2c: i801: Use wait_event_timeout to wait for interrupts") so drop the comment which claims this only happens in polled mode. * xact does not include the PEC bit, as the driver does not support software PEC. Signed-off-by: Jean Delvare Reviewed-by: Jarkko Nikula Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-i801.c | 5 ----- 1 file changed, 5 deletions(-) commit b8431920391d36c273f63a29eab0dfc7e884dd17 Author: Suman Anna Date: Sun Feb 13 14:12:46 2022 -0600 remoteproc: k3-dsp: Add support for IPC-only mode for all K3 DSPs Add support to the K3 DSP remoteproc driver to configure all the C66x and C71x cores on J721E SoCs to be either in IPC-only mode or the traditional remoteproc mode. The IPC-only mode expects that the remote processors are already booted by the bootloader, and only perform the minimum steps required to initialize and deinitialize the virtio IPC transports. The remoteproc mode allows the kernel remoteproc driver to do the regular load and boot and other device management operations for a DSP. The IPC-only mode for a DSP is detected and configured at driver probe time by querying the System Firmware for the DSP power and reset state and/or status and making sure that the DSP is indeed started by the bootloaders, otherwise the device is configured for remoteproc mode. Support for IPC-only mode is achieved through .attach(), .detach() and .get_loaded_rsc_table() callback ops and zeroing out the regular rproc ops .prepare(), .unprepare(), .start() and .stop(). The resource table follows a design-by-contract approach and is expected to be at the base of the DDR firmware region reserved for each remoteproc, it is mostly expected to contain only the virtio device and trace resource entries. NOTE: The driver cannot configure a DSP core for remoteproc mode by any means without rebooting the kernel if that DSP core has been started by a bootloader. This is the current desired behavior and can be enhanced in the future if the feature is needed. Signed-off-by: Suman Anna Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220213201246.25952-6-s-anna@ti.com drivers/remoteproc/ti_k3_dsp_remoteproc.c | 141 ++++++++++++++++++++++++++---- 1 file changed, 124 insertions(+), 17 deletions(-) commit 2eab5efeb4d644d9c94e29c3cbb35a47f715bffd Author: Suman Anna Date: Sun Feb 13 14:12:45 2022 -0600 remoteproc: k3-dsp: Refactor mbox request code in start Refactor out the mailbox request and associated ping logic code from k3_dsp_rproc_start() function into its own separate function so that it can be re-used in the soon to be added .attach() ops callback. Signed-off-by: Suman Anna Reviewed-by: Mathieu Poirier Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220213201246.25952-5-s-anna@ti.com drivers/remoteproc/ti_k3_dsp_remoteproc.c | 67 ++++++++++++++++++------------- 1 file changed, 40 insertions(+), 27 deletions(-) commit 1168af40b1ad8cb2e78f4a70869fa4a076320e4f Author: Suman Anna Date: Sun Feb 13 14:12:44 2022 -0600 remoteproc: k3-r5: Add support for IPC-only mode for all R5Fs Add support to the K3 R5F remoteproc driver to configure all the R5F cores to be either in IPC-only mode or the traditional remoteproc mode. The IPC-only mode expects that the remote processors are already booted by the bootloader, and only performs the minimum steps required to initialize and deinitialize the virtio IPC transports. The remoteproc mode allows the kernel remoteproc driver to do the regular load and boot and other device management operations for a R5F core. The IPC-only mode for a R5F core is detected and configured at driver probe time by querying the System Firmware for the R5F power and reset state and/or status and making sure that the R5F core is indeed started by the bootloaders, otherwise the device is configured for remoteproc mode. Support for IPC-only mode is achieved through .attach(), .detach() and .get_loaded_rsc_table() callback ops and zeroing out the regular rproc ops .prepare(), .unprepare(), .start() and .stop(). The resource table follows a design-by-contract approach and is expected to be at the base of the DDR firmware region reserved for each remoteproc, it is mostly expected to contain only the virtio device and trace resource entries. NOTE: The driver cannot configure a R5F core for remoteproc mode by any means without rebooting the kernel if that R5F core has been started by a bootloader. This is the current desired behavior and can be enhanced in the future if the feature is needed. Signed-off-by: Suman Anna Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220213201246.25952-4-s-anna@ti.com drivers/remoteproc/ti_k3_r5_remoteproc.c | 219 ++++++++++++++++++++++++++++++- 1 file changed, 215 insertions(+), 4 deletions(-) commit e3865c85385aa0c882702039a66f8e1c973bd55c Author: Suman Anna Date: Sun Feb 13 14:12:43 2022 -0600 remoteproc: k3-r5: Refactor mbox request code in start Refactor out the mailbox request and associated ping logic code from k3_r5_rproc_start() function into its own separate function so that it can be re-used in the soon to be added .attach() ops callback. Signed-off-by: Suman Anna Reviewed-by: Mathieu Poirier Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220213201246.25952-3-s-anna@ti.com drivers/remoteproc/ti_k3_r5_remoteproc.c | 68 +++++++++++++++++++------------- 1 file changed, 41 insertions(+), 27 deletions(-) commit c13b780c4597e1e6cee3154053a196aa329b1367 Author: Suman Anna Date: Sun Feb 13 14:12:42 2022 -0600 remoteproc: Change rproc_shutdown() to return a status The rproc_shutdown() function is currently not returning any error code, and any failures within rproc_stop() are not passed back to the users. Change the signature to return a success value back to the callers. The remoteproc sysfs and cdev interfaces are also updated to return back this status to userspace. Signed-off-by: Suman Anna Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220213201246.25952-2-s-anna@ti.com Documentation/staging/remoteproc.rst | 3 ++- drivers/remoteproc/remoteproc_cdev.c | 2 +- drivers/remoteproc/remoteproc_core.c | 9 ++++++--- drivers/remoteproc/remoteproc_sysfs.c | 2 +- include/linux/remoteproc.h | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) commit 18fc82d6e899be54fcf43b28e588e28f09c8810f Author: Minghao Chi (CGEL ZTE) Date: Wed Feb 16 03:07:20 2022 +0000 rpmsg: use struct_size over open coded arithmetic Replace zero-length array with flexible-array member and make use of the struct_size() helper in kzalloc(). For example: struct glink_defer_cmd { struct list_head node; struct glink_msg msg; u8 data[]; }; Make use of the struct_size() helper instead of an open-coded version in order to avoid any potential type mistakes. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220216030720.1839503-1-chi.minghao@zte.com.cn drivers/rpmsg/qcom_glink_native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a8f8cc6b39b7ee0dbaccbebd1268c9d3458ebf13 Author: Luca Weiss Date: Sun Feb 20 21:18:58 2022 +0100 rpmsg: smd: allow opening rpm_requests even if already opened On msm8953 the channel seems to be already opened when booting Linux but we still need to open it for communication with regulators etc. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220220201909.445468-6-luca@z3ntu.xyz drivers/rpmsg/qcom_smd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 8d9be5c6bdcda9e29597d3fbb24d1f6699da4616 Author: Bjorn Andersson Date: Thu Feb 24 19:32:24 2022 -0800 remoteproc: qcom: q6v5: Add interconnect path proxy vote Many remoteproc instances requires that Linux casts a proxy vote for an interconnect path during boot, until they can do it themselves. Add support for voting for a single path. As this is a shared problem between both PAS and MSS drivers, the path is acquired and votes casted from the common helper code. Signed-off-by: Bjorn Andersson Reviewed-by: Georgi Djakov Link: https://lore.kernel.org/r/20220225033224.2238425-1-bjorn.andersson@linaro.org drivers/remoteproc/qcom_q6v5.c | 21 ++++++++++++++++++++- drivers/remoteproc/qcom_q6v5.h | 3 +++ 2 files changed, 23 insertions(+), 1 deletion(-) commit 80d691854ffbf99c8a88584703e0141b31e63205 Author: Allen-KH Cheng Date: Fri Feb 25 21:27:47 2022 +0800 remoteproc: mediatek: Support mt8186 scp Add SCP support for mt8186 Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220225132747.31808-3-allen-kh.cheng@mediatek.com drivers/remoteproc/mtk_common.h | 3 +++ drivers/remoteproc/mtk_scp.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) commit 22335385157d6eedb659a4cd0c801d62bfe0881d Author: Allen-KH Cheng Date: Fri Feb 25 21:27:46 2022 +0800 dt-bindings: remoteproc: mediatek: Add binding for mt8186 scp Add mt8186 compatible to binding document. Signed-off-by: Allen-KH Cheng Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220225132747.31808-2-allen-kh.cheng@mediatek.com Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml | 1 + 1 file changed, 1 insertion(+) commit 8fc262265918d2a1817103b454d32979f1d7f35c Merge: c0fc71e2d7d2 00f192536337 Author: Mark Brown Date: Fri Mar 11 20:21:12 2022 +0000 Make the SOF pcm_hw_params DSP op IPC agnostic Merge series from Ranjani Sridharan : In preparation for supporting the newly introduced IPC version in the SOF firmware, this patchset adds the changes required to make the pcm_hw_params DSP op IPC agnostic. commit c0fc71e2d7d21ed8b2ee763d894517e4fec6ffc5 Merge: ee60f738e3bc d7be9e33c4ad Author: Mark Brown Date: Fri Mar 11 20:21:11 2022 +0000 ASoC: SOF/Intel: small fixes and updates for 5.18 Merge series from Pierre-Louis Bossart : One important fix from Kai to restore DM1 L1 functionality, one important update from Peter to use DMA trace buffers as capture-only and sync them and a couple of minor updates for Intel/SOF platforms. commit ee60f738e3bcb75549a094ccb6396ae8ad6b9101 Merge: c1156cce4719 ee7f79a81a27 Author: Mark Brown Date: Fri Mar 11 20:21:10 2022 +0000 ASoC: mediatek: Add mt8195 reset control support Merge series from Trevor Wu : Add reset controller support for MT8195. commit c1156cce4719ab2633575dd4822606f959142ef7 Merge: 375a347da488 092cf7b26a48 Author: Mark Brown Date: Fri Mar 11 20:21:08 2022 +0000 ASoC: Intel: AVS - Audio DSP for cAVS Merge series from Cezary Rojewski : A continuation of cleanup work of Intel SST solutions found in sound/soc/intel/. With two major chapters released last year catpt [1] and removal of haswell solution [2], time has come for Skylake-driver. Througout 2019, 2020 and 2021 Skylake-driver has had many fixes applied and even attempts of refactors as seen in fundamental overhaul [3], IPC flow adjustments [4] and LARGE_CONFIG overhaul [5] series. Unfortunately, story repeats itself - problems are found within the core of a driver. Painting it with different colors does not change the fact that is it still a house of cards. As changes needed to address those issues would make Skylake solution incompatible with its previous revisions, a decision has been made to provide a new solution instead. In time it would deprecate and replace Skylake-driver. That solution has been called AVS - from AudioDSP architecture name: Audio-Voice-Speech. It is meant to provide support for the exact same range of platforms as its predecessor: SKL, KBL, AML and APL. Note: this series is dependent upon HDA-series [6] which exposes several codec-organization functions allowing for reduced code size on avs-driver side. Note: this series does not add fully functional driver as its size would get out of control. Here, focus is put on adding IPC protocol and code loading code. commit 07a5dcc4bed9d7cae54adf5aa10ff9f037a3204b Author: Miaoqian Lin Date: Tue Mar 8 06:45:21 2022 +0000 remoteproc: qcom_q6v5_mss: Fix some leaks in q6v5_alloc_memory_region The device_node pointer is returned by of_parse_phandle() or of_get_child_by_name() with refcount incremented. We should use of_node_put() on it when done. This function only call of_node_put(node) when of_address_to_resource succeeds, missing error cases. Fixes: 278d744c46fd ("remoteproc: qcom: Fix potential device node leaks") Fixes: 051fb70fd4ea ("remoteproc: qcom: Driver for the self-authenticating Hexagon v5") Signed-off-by: Miaoqian Lin Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220308064522.13804-1-linmq006@gmail.com drivers/remoteproc/qcom_q6v5_mss.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 8f90161a66bc3d6b9fe8dde4d9028d20eae1b62a Author: Miaoqian Lin Date: Tue Mar 8 06:31:02 2022 +0000 remoteproc: qcom_wcnss: Add missing of_node_put() in wcnss_alloc_memory_region The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: aed361adca9f ("remoteproc: qcom: Introduce WCNSS peripheral image loader") Signed-off-by: Miaoqian Lin Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220308063102.10049-1-linmq006@gmail.com drivers/remoteproc/qcom_wcnss.c | 1 + 1 file changed, 1 insertion(+) commit 505b5b1616e200042999de715dbe7c1e2735cd65 Author: Miaoqian Lin Date: Tue Mar 8 03:12:19 2022 +0000 remoteproc: qcom: Fix missing of_node_put in adsp_alloc_memory_region The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver") Signed-off-by: Miaoqian Lin Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220308031219.4718-1-linmq006@gmail.com drivers/remoteproc/qcom_q6v5_adsp.c | 1 + 1 file changed, 1 insertion(+) commit de26a7424331493311c08625a700cf45d1eaf151 Merge: 89ea5be11a5f a6199bb514d8 Author: Marc Zyngier Date: Fri Mar 11 19:22:24 2022 +0000 Merge branch irq/qcom-mpm into irq/irqchip-next * irq/qcom-mpm: : . : Add support for Qualcomm's MPM wakeup controller, courtesy : of Shawn Guo. : . irqchip: Add Qualcomm MPM controller driver dt-bindings: interrupt-controller: Add Qualcomm MPM support Signed-off-by: Marc Zyngier commit a6199bb514d8a63f61c2a22c1f912376e14d0fb2 Author: Shawn Guo Date: Tue Mar 8 16:05:34 2022 +0800 irqchip: Add Qualcomm MPM controller driver Qualcomm SoCs based on the RPM architecture have a MSM Power Manager (MPM) in always-on domain. In addition to managing resources during sleep, the hardware also has an interrupt controller that monitors the interrupts when the system is asleep, wakes up the APSS when one of these interrupts occur and replays it to GIC after it becomes operational. It adds an irqchip driver for this interrupt controller, and here are some notes about it. - For given SoC, a fixed number of MPM pins are supported, e.g. 96 pins on QCM2290. Each of these MPM pins can be either a MPM_GIC pin or a MPM_GPIO pin. The mapping between MPM_GIC pin and GIC interrupt is defined by SoC, as well as the mapping between MPM_GPIO pin and GPIO number. The former mapping is retrieved from device tree, while the latter is defined in TLMM pinctrl driver. - The power domain (PD) .power_off hook is used to notify RPM that APSS is about to power collapse. This requires MPM PD be the parent PD of CPU cluster. - When SoC gets awake from sleep mode, the driver will receive an interrupt from RPM, so that it can replay interrupt for particular polarity. Signed-off-by: Shawn Guo Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220308080534.3384532-3-shawn.guo@linaro.org drivers/irqchip/Kconfig | 8 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-qcom-mpm.c | 461 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 470 insertions(+) commit 54fc9851c0e0bec8012deaa87fe540d6e1739ac2 Author: Shawn Guo Date: Tue Mar 8 16:05:33 2022 +0800 dt-bindings: interrupt-controller: Add Qualcomm MPM support It adds DT binding support for Qualcomm MPM interrupt controller. Reviewed-by: Rob Herring Signed-off-by: Shawn Guo Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220308080534.3384532-2-shawn.guo@linaro.org .../bindings/interrupt-controller/qcom,mpm.yaml | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) commit a58e9d0984e8dad53f17ec73ae3c1cc7f8d88151 Author: John David Anglin Date: Fri Mar 11 18:59:12 2022 +0000 parisc: Increase parisc_cache_flush_threshold setting In testing the "Fix non-access data TLB cache flush faults" change, I noticed a significant improvement in glibc build and check times. This led me to investigate the parisc_cache_flush_threshold setting. It determines when we switch from line flushing to whole cache flushing. It turned out that the parisc_cache_flush_threshold setting on mako and mako2 machines (PA8800 and PA8900 processors) was way too small. Adjusting this setting provided almost a factor two improvement in the glibc build and check time. Signed-off-by: John David Anglin Signed-off-by: Helge Deller arch/parisc/kernel/cache.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) commit e9567332a4a0bf3533b4126e50992d5a569ea675 Author: Mike Snitzer Date: Fri Mar 11 14:16:47 2022 -0500 dm: update email address in MAINTAINERS Update my email address to kernel.org to allow distinction between my "upstream" and "Red" Hats. Signed-off-by: Mike Snitzer Signed-off-by: Mike Snitzer MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e5e9e7f222e5b3da5bc441d315d1ce7b000ed1be Author: Helge Deller Date: Thu Feb 24 20:15:34 2022 +0100 parisc/unaligned: Enhance user-space visible output Userspace is up to now limited to 32-bit, so it's sufficient to print only 32-bit values when showing pointer addresses. Signed-off-by: Helge Deller arch/parisc/kernel/unaligned.c | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) commit 3029ce31af158631feffdab067e99bb22b7369c4 Author: Helge Deller Date: Wed Feb 23 17:45:10 2022 +0100 parisc/unaligned: Rewrite 32-bit inline assembly of emulate_sth() Convert to use real temp variables instead of clobbering processor registers. Signed-off-by: Helge Deller arch/parisc/kernel/unaligned.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) commit 427c1073a2a14fe38ef0fc98d3635be51d7f7818 Author: Helge Deller Date: Wed Feb 23 17:43:36 2022 +0100 parisc/unaligned: Rewrite 32-bit inline assembly of emulate_ldd() Convert to use real temp variables instead of clobbering processor registers. Signed-off-by: Helge Deller arch/parisc/kernel/unaligned.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) commit e8aa7b17fe41c4485da4c96184a375e5b40129c8 Author: Helge Deller Date: Wed Feb 23 17:42:19 2022 +0100 parisc/unaligned: Rewrite inline assembly of emulate_ldw() Convert to use real temp variables instead of clobbering processor registers. Signed-off-by: Helge Deller arch/parisc/kernel/unaligned.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) commit f85b2af1f046e4a91e94eba54f425683183cdc62 Author: Helge Deller Date: Wed Feb 23 17:39:15 2022 +0100 parisc/unaligned: Rewrite inline assembly of emulate_ldh() Convert to use real temp variables instead of clobbering processor registers. Signed-off-by: Helge Deller arch/parisc/kernel/unaligned.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit d1434e03b2913c28d85e429eea20c53993fbe1af Author: Helge Deller Date: Sat Feb 19 00:53:05 2022 +0100 parisc/unaligned: Use EFAULT fixup handler in unaligned handlers Convert the inline assembly code to use the automatic EFAULT exception handler. With that the fixup code can be dropped. The other change is to allow double-word only when a 64-bit kernel is used instead of depending on CONFIG_PA20. Signed-off-by: Helge Deller arch/parisc/kernel/unaligned.c | 160 ++++++++++++++--------------------------- 1 file changed, 55 insertions(+), 105 deletions(-) commit 8278cc16266326f23c05f94d748569faa81319bb Author: Helge Deller Date: Thu Feb 17 13:12:39 2022 +0100 parisc: Reduce code size by optimizing get_current() function calls The get_current() code uses the mfctl() macro to get the pointer to the current task struct from %cr30. The problem with the mfctl() macro is, that it is marked volatile which is basically correct, because mfctl() is used to get e.g. the current internal timer or interrupt flags as well. But specifically the task struct pointer (%cr30) doesn't change over time when the kernel executes code for a task. So, by dropping the volatile when retrieving %cr30 the compiler is now able to get this value only once and optimize the generated code a lot. A bloat-o-meter comparism shows that this patch saves ~5kB kernel code on a 32-bit kernel and ~6kB kernel code on a 64-bit kernel. Signed-off-by: Helge Deller arch/parisc/include/asm/current.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 360bd6c658076f9264760364fe95e6e78cbd188a Author: Helge Deller Date: Thu Feb 17 15:26:27 2022 +0100 parisc: Use constants to encode the space registers like SR_KERNEL Use the provided space register constants instead of hardcoded values. Signed-off-by: Helge Deller arch/parisc/include/asm/cache.h | 11 ++++------- arch/parisc/include/asm/mmu_context.h | 2 +- arch/parisc/include/asm/pgtable.h | 6 +++--- arch/parisc/include/asm/special_insns.h | 4 ++-- arch/parisc/kernel/cache.c | 8 ++++---- arch/parisc/kernel/pci-dma.c | 4 ++-- arch/parisc/lib/memcpy.c | 16 ++++++++-------- 7 files changed, 24 insertions(+), 27 deletions(-) commit 5613a930857ecfdb5f670992d55d2e7373d21d1b Author: Helge Deller Date: Wed Feb 16 23:11:20 2022 +0100 parisc: Use SR_USER and SR_KERNEL in get_user() and put_user() Instead of hardcoding the space registers as strings, use the SR_USER and SR_KERNEL constants to form the space register in the access functions. Signed-off-by: Helge Deller arch/parisc/include/asm/uaccess.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) commit 46b4016f7d3b1c16c5eefcdf16dd32e84f4dbb60 Author: Helge Deller Date: Thu Feb 17 21:29:22 2022 +0100 parisc: Add defines for various space register Provide defines for space registers (SR_KERNEL, SR_USER, ...) which should be used instead of hardcoding the values. Signed-off-by: Helge Deller arch/parisc/include/asm/assembly.h | 6 ++++++ 1 file changed, 6 insertions(+) commit b9f50eea4f277943842e82bc4d73f912a2f165c6 Author: Helge Deller Date: Tue Feb 15 20:56:27 2022 +0100 parisc: Always use the self-extracting kernel feature This patch drops the CONFIG_PARISC_SELF_EXTRACT option. The palo boot loader is able to decompress a kernel which was compressed with gzip. That possibility was useful when the Linux kernel self-extracting feature wasn't implemented yet. Beside the fact that the self-extracting feature offers much better compression rates, we do support self-extracting kernels already since kernel v4.14, so now it's really time to get rid of that old option and always use the self-extractor. Signed-off-by: Helge Deller arch/parisc/Kconfig | 12 ------------ arch/parisc/Makefile | 9 --------- 2 files changed, 21 deletions(-) commit 9c379c65241707e44072139d782bc2dfec9b4ab3 Author: Helge Deller Date: Thu Jan 13 16:35:53 2022 +0100 video/fbdev/stifb: Implement the stifb_fillrect() function The stifb driver (for Artist/HCRX graphics on PA-RISC) was missing the fillrect function. Tested on a 715/64 PA-RISC machine and in qemu. Signed-off-by: Helge Deller drivers/video/fbdev/stifb.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) commit df24e1783e6e0eb3dc0e3ba5a8df3bb0cc537408 Author: Helge Deller Date: Wed Dec 8 11:06:52 2021 +0100 parisc: Add vDSO support Add minimal vDSO support, which provides the signal trampoline helpers, but none of the userspace syscall helpers like time wrappers. The big benefit of this vDSO implementation is, that we now don't need an executeable stack any longer. PA-RISC is one of the last architectures where an executeable stack was needed in oder to implement the signal trampolines by putting assembly instructions on the stack which then gets executed. Instead the kernel will provide the relevant code in the vDSO page and only put the pointers to the signal information on the stack. By dropping the need for executable stacks we avoid running into issues with applications which want non executable stacks for security reasons. Additionally, alternative stacks on memory areas without exec permissions are supported too. This code is based on an initial implementation by Randolph Chung from 2006: https://lore.kernel.org/linux-parisc/4544A34A.6080700@tausq.org/ I did the porting and lifted the code to current code base. Dave fixed the unwind code so that gdb and glibc are able to backtrace through the code. An additional patch to gdb will be pushed upstream by Dave. Signed-off-by: Helge Deller Signed-off-by: Dave Anglin Cc: Randolph Chung Signed-off-by: Helge Deller arch/parisc/Kconfig | 1 + arch/parisc/Makefile | 30 ++++ arch/parisc/include/asm/elf.h | 15 ++ arch/parisc/include/asm/mmu.h | 6 +- arch/parisc/include/asm/mmu_context.h | 16 +- arch/parisc/include/asm/pgtable.h | 7 +- arch/parisc/include/asm/processor.h | 2 +- arch/parisc/include/asm/rt_sigframe.h | 10 +- arch/parisc/include/asm/tlbflush.h | 2 +- arch/parisc/include/asm/unistd.h | 4 - arch/parisc/include/asm/vdso.h | 24 +++ arch/parisc/include/uapi/asm/auxvec.h | 8 + arch/parisc/kernel/Makefile | 5 + arch/parisc/kernel/asm-offsets.c | 9 ++ arch/parisc/kernel/cache.c | 6 +- arch/parisc/kernel/signal.c | 225 ++++++++++++-------------- arch/parisc/kernel/signal32.h | 19 +-- arch/parisc/kernel/vdso.c | 122 ++++++++++++++ arch/parisc/kernel/vdso32/Makefile | 53 ++++++ arch/parisc/kernel/vdso32/gen_vdso_offsets.sh | 15 ++ arch/parisc/kernel/vdso32/note.S | 26 +++ arch/parisc/kernel/vdso32/restart_syscall.S | 32 ++++ arch/parisc/kernel/vdso32/sigtramp.S | 195 ++++++++++++++++++++++ arch/parisc/kernel/vdso32/vdso32.lds.S | 111 +++++++++++++ arch/parisc/kernel/vdso32/vdso32_wrapper.S | 14 ++ arch/parisc/kernel/vdso64/Makefile | 48 ++++++ arch/parisc/kernel/vdso64/gen_vdso_offsets.sh | 15 ++ arch/parisc/kernel/vdso64/note.S | 2 + arch/parisc/kernel/vdso64/restart_syscall.S | 3 + arch/parisc/kernel/vdso64/sigtramp.S | 166 +++++++++++++++++++ arch/parisc/kernel/vdso64/vdso64.lds.S | 109 +++++++++++++ arch/parisc/kernel/vdso64/vdso64_wrapper.S | 14 ++ 32 files changed, 1149 insertions(+), 165 deletions(-) commit 14615ecccb8b0022589b7a7841cdfdf96319724b Author: John David Anglin Date: Wed Mar 9 21:23:39 2022 +0000 parisc: Simplify fast path for non-access data TLB faults With the latest cache fix for non-access faults and the support for non-access faults (code 17) in handle_interruption, we can remove the fast path emulation for fdc, fic, pdc, lpa, probe and probei instructions. Signed-off-by: John David Anglin Signed-off-by: Helge Deller arch/parisc/kernel/entry.S | 72 ++++------------------------------------------ 1 file changed, 5 insertions(+), 67 deletions(-) commit e00b0a2ab8ec019c344e53bfc76e31c18bb587b7 Author: John David Anglin Date: Wed Mar 9 21:14:36 2022 +0000 parisc: Fix handling off probe non-access faults Currently, the parisc kernel does not fully support non-access TLB fault handling for probe instructions. In the fast path, we set the target register to zero if it is not a shadowed register. The slow path is not implemented, so we call do_page_fault. The architecture indicates that non-access faults should not cause a page fault from disk. This change adds to code to provide non-access fault support for probe instructions. It also modifies the handling of faults on userspace so that if the address lies in a valid VMA and the access type matches that for the VMA, the probe target register is set to one. Otherwise, the target register is set to zero. This was done to make probe instructions more useful for userspace. Probe instructions are not very useful if they set the target register to zero whenever a page is not present in memory. Nominally, the purpose of the probe instruction is determine whether read or write access to a given address is allowed. This fixes a problem in function pointer comparison noticed in the glibc testsuite (stdio-common/tst-vfprintf-user-type). The same problem is likely in glibc (_dl_lookup_address). V2 adds flush and lpa instruction support to handle_nadtlb_fault. Signed-off-by: John David Anglin Signed-off-by: Helge Deller arch/parisc/include/asm/traps.h | 1 + arch/parisc/kernel/traps.c | 2 + arch/parisc/mm/fault.c | 89 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) commit f839e5f1cef36ce268950c387129b1bfefdaebc9 Author: John David Anglin Date: Fri Mar 11 17:22:54 2022 +0000 parisc: Fix non-access data TLB cache flush faults When a page is not present, we get non-access data TLB faults from the fdc and fic instructions in flush_user_dcache_range_asm and flush_user_icache_range_asm. When these occur, the cache line is not invalidated and potentially we get memory corruption. The problem was hidden by the nullification of the flush instructions. These faults also affect performance. With pa8800/pa8900 processors, there will be 32 faults per 4 KB page since the cache line is 128 bytes. There will be more faults with earlier processors. The problem is fixed by using flush_cache_pages(). It does the flush using a tmp alias mapping. The flush_cache_pages() call in flush_cache_range() flushed too large a range. V2: Remove unnecessary preempt_disable() and preempt_enable() calls. Signed-off-by: John David Anglin Signed-off-by: Helge Deller arch/parisc/kernel/cache.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) commit 26fed4ac4eab09c27fbae1859696cc38f0536407 Author: Jens Axboe Date: Fri Mar 11 10:24:17 2022 -0700 block: flush plug based on hardware and software queue order We used to sort the plug list if we had multiple queues before dispatching requests to the IO scheduler. This usually isn't needed, but for certain workloads that interleave requests to disks, it's a less efficient to process the plug list one-by-one if everything is interleaved. Don't sort the list, but skip through it and flush out entries that have the same target at the same time. Fixes: df87eb0fce8f ("block: get rid of plug list sorting") Reported-and-tested-by: Song Liu Reviewed-by: Song Liu Signed-off-by: Jens Axboe block/blk-mq.c | 59 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 31 deletions(-) commit 5b2050718d095cd3242d1f42aaaea3a2fec8e6f0 Author: Jens Axboe Date: Fri Mar 11 10:21:43 2022 -0700 block: ensure plug merging checks the correct queue at least once Song reports that a RAID rebuild workload runs much slower recently, and it is seeing a lot less merging than it did previously. The reason is that a previous commit reduced the amount of work we do for plug merging. RAID rebuild interleaves requests between disks, so a last-entry check in plug merging always misses a merge opportunity since we always find a different disk than what we are looking for. Modify the logic such that it's still a one-hit cache, but ensure that we check enough to find the right target before giving up. Fixes: d38a9c04c0d5 ("block: only check previous entry for plug merge attempt") Reported-and-tested-by: Song Liu Reviewed-by: Song Liu Signed-off-by: Jens Axboe block/blk-merge.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) commit b65700d046a60d0a29f6289e13c62d0c93689f11 Author: Suman Anna Date: Tue Mar 8 18:25:15 2022 +0100 remoteproc: move rproc_da_to_va declaration to remoteproc.h The rproc_da_to_va() API is an exported function, so move its declaration from the remoteproc local remoteproc_internal.h to the public remoteproc.h file. This will allow drivers outside of the remoteproc folder to be able to use this API. Signed-off-by: Suman Anna Signed-off-by: Dave Gerlach [adjusted line numbers to apply] Signed-off-by: Drew Fustini Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220308172515.29556-1-dfustini@baylibre.com drivers/remoteproc/remoteproc_internal.h | 1 - include/linux/remoteproc.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) commit 9d85fb73a31bb67e5b738e8732eaaebdadf665fe Author: Konrad Dybcio Date: Thu Dec 30 03:32:53 2021 +0100 rpmsg: qcom_smd: Promote to arch_initcall qcom_smd's only child, smd-rpm uses arch_initcall and both have to be up before almost anything else to ensure the MSM SoCs will work fine and nothing will have to resort to probe defering, as this is the main pillar of all things DVFS on these machines. Promote it to arch_initcall to avoid such issues. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211230023253.1123142-1-konrad.dybcio@somainline.org drivers/rpmsg/qcom_smd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 571c3496e3c20444d5a2a5d4c00e608f26339505 Author: Sinthu Raja Date: Mon Sep 20 18:01:52 2021 +0530 dt-bindings: hwlock: omap: Remove redundant binding example The example includes a board-specific compatible property, this is wrong as the example should be board agnostic and should represent the particular binding. Also, the file includes two similar examples but with a different compatible. So, drop the entire second example Suggested-by: Bjorn Andersson Signed-off-by: Sinthu Raja Reviewed-by: Rob Herring Acked-by: Suman Anna Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210920123152.32751-1-sinthu.raja@ti.com .../bindings/hwlock/ti,omap-hwspinlock.yaml | 33 +--------------------- 1 file changed, 1 insertion(+), 32 deletions(-) commit ef8795f3f1cef2b2d2cd5dfab3758a7601898bc9 Author: Rob Herring Date: Thu Mar 10 10:05:13 2022 -0600 dt-bindings: kbuild: Use DTB files for validation Switch the DT validation to use DTB files directly instead of a DTS to YAML conversion. The original motivation for supporting validation on DTB files was to enable running validation on a running system (e.g. 'dt-validate /sys/firmware/fdt') or other cases where the original source DTS is not available. The YAML format was not without issues. Using DTBs with the schema type information solves some of those problems. The YAML format relies on the DTS source level information including bracketing of properties, size directives, and phandle tags all of which are lost in a DTB file. While standardizing the bracketing is a good thing, it does cause a lot of extra warnings and churn to fix them. Another issue has been signed types are not validated correctly as sign information is not propagated to YAML. Using the schema type information allows for proper handling of signed types. YAML also can't represent the full range of 64-bit integers as numbers are stored as floats by most/all parsers. The DTB validation works by decoding property values using the type information in the schemas themselves. The main corner case this does not work for is matrix types where neither dimension is fixed. For now, checking the dimensions in these cases are skipped. Signed-off-by: Rob Herring Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220310160513.1708182-3-robh@kernel.org Documentation/devicetree/bindings/Makefile | 7 +++---- Documentation/devicetree/bindings/writing-schema.rst | 17 +++++------------ scripts/Makefile.lib | 20 +++++++------------- scripts/dtc/Makefile | 13 ------------- scripts/dtc/update-dtc-source.sh | 2 +- 5 files changed, 16 insertions(+), 43 deletions(-) commit 380af29b8d7670c445965bd573ab219aff0c4c11 Author: Steven Rostedt (Google) Date: Thu Mar 10 21:37:09 2022 -0500 tracing: Add snapshot at end of kernel boot up Add ftrace_boot_snapshot kernel parameter that will take a snapshot at the end of boot up just before switching over to user space (it happens during the kernel freeing of init memory). This is useful when there's interesting data that can be collected from kernel start up, but gets overridden by user space start up code. With this option, the ring buffer content from the boot up traces gets saved in the snapshot at the end of boot up. This trace can be read from: /sys/kernel/tracing/snapshot Signed-off-by: Steven Rostedt (Google) Documentation/admin-guide/kernel-parameters.txt | 8 ++++++++ include/linux/ftrace.h | 11 ++++++++++- kernel/trace/ftrace.c | 2 ++ kernel/trace/trace.c | 18 ++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) commit b3bc8547d3be60898818885f5bf22d0a62e2eb48 Author: Steven Rostedt (Google) Date: Thu Mar 10 23:27:38 2022 -0500 tracing: Have TRACE_DEFINE_ENUM affect trace event types as well The macro TRACE_DEFINE_ENUM is used to convert enums in the kernel to their actual value when they are exported to user space via the trace event format file. Currently only the enums in the "print fmt" (TP_printk in the TRACE_EVENT macro) have the enums converted. But the enums can be used to denote array size: field:unsigned int fc_ineligible_rc[EXT4_FC_REASON_MAX]; offset:12; size:36; signed:0; The EXT4_FC_REASON_MAX has no meaning to userspace but it needs to know that information to know how to parse the array. Have the array indexes also be parsed as well. Link: https://lore.kernel.org/all/cover.1646922487.git.riteshh@linux.ibm.com/ Reported-by: Ritesh Harjani Tested-by: Ritesh Harjani Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) commit 9f438d4d7fa2f59570cd58bca24ac82e7172d63b Author: Tom Zanussi Date: Thu Mar 10 11:17:07 2022 -0600 tracing: Fix strncpy warning in trace_events_synth.c 0-day reported the strncpy error below: ../kernel/trace/trace_events_synth.c: In function 'last_cmd_set': ../kernel/trace/trace_events_synth.c:65:9: warning: 'strncpy' specified bound depends on the length o\ f the source argument [-Wstringop-truncation] 65 | strncpy(last_cmd, str, strlen(str) + 1); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../kernel/trace/trace_events_synth.c:65:32: note: length computed here 65 | strncpy(last_cmd, str, strlen(str) + 1); | ^~~~~~~~~~~ There's no reason to use strncpy here, in fact there's no reason to do anything but a simple kstrdup() (note we don't even need to check for failure since last_cmod is expected to be either the last cmd string or NULL, and the containing function is a void return). Link: https://lkml.kernel.org/r/77deca8cbfd226981b3f1eab203967381e9b5bd9.camel@kernel.org Fixes: 27c888da9867 ("tracing: Remove size restriction on synthetic event cmd error logging") Reported-by: kernel test robot Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events_synth.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 7e348b325bc40eb52aead4d57a1f90d33ea834fc Author: Beau Belgrave Date: Wed Mar 9 16:11:41 2022 -0800 user_events: Prevent dyn_event delete racing with ioctl add/delete Find user_events always while under the event_mutex and before leaving the lock, add a ref count to the user_event. This ensures that all paths under the event_mutex that check the ref counts will be synchronized. The ioctl add/delete paths are protected by the reg_mutex. However, dyn_event is only protected by the event_mutex. The dyn_event delete path cannot acquire reg_mutex, since that could cause a deadlock between the ioctl delete case acquiring event_mutex after acquiring the reg_mutex. Link: https://lkml.kernel.org/r/20220310001141.1660-1-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events_user.c | 46 ++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) commit 3a73333fb370f7b65de9d94c53df503642bda789 Author: Steven Rostedt (Google) Date: Thu Mar 3 17:05:34 2022 -0500 tracing: Add TRACE_CUSTOM_EVENT() macro To make it really easy to add custom events from modules, add a TRACE_CUSTOM_EVENT() macro that acts just like the TRACE_EVENT() macro, but creates a custom event to an already existing tracepoint. The trace_custom_sched.[ch] has been updated to use this new macro to show how simple it is. Link: https://lkml.kernel.org/r/20220303220625.738622494@goodmis.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Masami Hiramatsu Cc: Tom Zanussi Signed-off-by: Steven Rostedt (Google) include/linux/trace_events.h | 24 ++- include/trace/define_custom_trace.h | 77 +++++++++ include/trace/trace_custom_events.h | 221 +++++++++++++++++++++++++ samples/trace_events/Makefile | 2 +- samples/trace_events/trace_custom_sched.c | 259 +++--------------------------- samples/trace_events/trace_custom_sched.h | 95 +++++++++++ 6 files changed, 441 insertions(+), 237 deletions(-) commit af6b9668e85ffd1502aada8036ccbf4dbd481708 Author: Steven Rostedt (Google) Date: Thu Mar 3 17:05:33 2022 -0500 tracing: Move the defines to create TRACE_EVENTS into their own files In an effort to add custom event macros that can be used to create your own custom events based on existing tracepoints, move the defines of the special macros used in TRACE_EVENT() into their own files such that they can be reused for TRACE_CUSTOM_EVENT(). Link: https://lkml.kernel.org/r/20220303220625.553406495@goodmis.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Masami Hiramatsu Cc: Tom Zanussi Signed-off-by: Steven Rostedt (Google) include/trace/stages/init.h | 37 +++ include/trace/stages/stage1_defines.h | 45 +++ include/trace/stages/stage2_defines.h | 48 ++++ include/trace/stages/stage3_defines.h | 129 +++++++++ include/trace/stages/stage4_defines.h | 57 ++++ include/trace/stages/stage5_defines.h | 83 ++++++ include/trace/stages/stage6_defines.h | 86 ++++++ include/trace/stages/stage7_defines.h | 34 +++ include/trace/trace_events.h | 499 +--------------------------------- 9 files changed, 527 insertions(+), 491 deletions(-) commit 953c2f052112a857c00058a641dc0c58ec7551d4 Author: Steven Rostedt (Google) Date: Thu Mar 3 17:05:32 2022 -0500 tracing: Add sample code for custom trace events Add sample code to show how to create custom trace events in the tracefs directory that can be enabled and modified like any event in tracefs (including triggers, histograms, synthetic events and event probes). The example is creating a custom sched_switch and a sched_waking to limit what is recorded: If the custom sched switch only records the prev_prio, next_prio and next_pid, it can bring the size from 64 bytes per event, down to just 16 bytes! If sched_waking only records the prio and pid of the woken event, it will bring the size down from 36 bytes to 12 bytes per event. This will allow for a much smaller footprint into the ring buffer and keep more events from dropping. Link: https://lkml.kernel.org/r/20220303220625.369226746@goodmis.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Peter Zijlstra Cc: Masami Hiramatsu Cc: Tom Zanussi Suggested-by: Joel Fernandes Signed-off-by: Steven Rostedt (Google) samples/Kconfig | 8 +- samples/Makefile | 1 + samples/trace_events/Makefile | 2 + samples/trace_events/trace_custom_sched.c | 271 ++++++++++++++++++++++++++++++ 4 files changed, 281 insertions(+), 1 deletion(-) commit 9a225f81f540f65225e4b820e303d40d9e747e78 Author: Marcin Szycik Date: Fri Mar 4 17:40:48 2022 +0100 ice: Support GTP-U and GTP-C offload in switchdev Add support for creating filters for GTP-U and GTP-C in switchdev mode. Add support for parsing GTP-specific options (QFI and PDU type) and TEID. By default, a filter for GTP-U will be added. To add a filter for GTP-C, specify enc_dst_port = 2123, e.g.: tc filter add dev $GTP0 ingress prio 1 flower enc_key_id 1337 \ enc_dst_port 2123 action mirred egress redirect dev $VF1_PR Note: GTP-U with outer IPv6 offload is not supported yet. Note: GTP-U with no payload offload is not supported yet. Signed-off-by: Marcin Szycik Reviewed-by: Michal Swiatkowski Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice.h | 1 + drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 31 +- drivers/net/ethernet/intel/ice/ice_flex_type.h | 6 +- drivers/net/ethernet/intel/ice/ice_protocol_type.h | 19 + drivers/net/ethernet/intel/ice/ice_switch.c | 615 ++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_switch.h | 9 + drivers/net/ethernet/intel/ice/ice_tc_lib.c | 105 +++- drivers/net/ethernet/intel/ice/ice_tc_lib.h | 3 + 8 files changed, 765 insertions(+), 24 deletions(-) commit e5dd661b8bb3751bfe65f4da45b4dec2bfe6d3b8 Author: Michal Swiatkowski Date: Fri Mar 4 17:40:47 2022 +0100 ice: Fix FV offset searching Checking only protocol ids while searching for correct FVs can lead to a situation, when incorrect FV will be added to the list. Incorrect means that FV has correct protocol id but incorrect offset. Call ice_get_sw_fv_list with ice_prot_lkup_ext struct which contains all protocol ids with offsets. With this modification allocating and collecting protocol ids list is not longer needed. Signed-off-by: Michal Swiatkowski Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 22 ++++++--------- drivers/net/ethernet/intel/ice/ice_flex_pipe.h | 2 +- drivers/net/ethernet/intel/ice/ice_switch.c | 39 ++------------------------ 3 files changed, 12 insertions(+), 51 deletions(-) commit 81dd9849fa4911f76a14f354a048865894b9751e Author: Wojciech Drewek Date: Fri Mar 4 17:40:46 2022 +0100 gtp: Add support for checking GTP device type Add a function that checks if a net device type is GTP. Signed-off-by: Wojciech Drewek Reviewed-by: Harald Welte Signed-off-by: Tony Nguyen include/net/gtp.h | 6 ++++++ 1 file changed, 6 insertions(+) commit e3acda7ade0a36c5cbebc2b54d30b7f08a4ba29b Author: Wojciech Drewek Date: Fri Mar 4 17:40:45 2022 +0100 net/sched: Allow flower to match on GTP options Options are as follows: PDU_TYPE:QFI and they refernce to the fields from the PDU Session Protocol. PDU Session data is conveyed in GTP-U Extension Header. GTP-U Extension Header is described in 3GPP TS 29.281. PDU Session Protocol is described in 3GPP TS 38.415. PDU_TYPE - indicates the type of the PDU Session Information (4 bits) QFI - QoS Flow Identifier (6 bits) # ip link add gtp_dev type gtp role sgsn # tc qdisc add dev gtp_dev ingress # tc filter add dev gtp_dev protocol ip parent ffff: \ flower \ enc_key_id 11 \ gtp_opts 1:8/ff:ff \ action mirred egress redirect dev eth0 Signed-off-by: Wojciech Drewek Signed-off-by: Tony Nguyen include/net/gtp.h | 5 ++ include/uapi/linux/if_tunnel.h | 4 +- include/uapi/linux/pkt_cls.h | 15 ++++++ net/sched/cls_flower.c | 116 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 139 insertions(+), 1 deletion(-) commit d33bd757d362699cfce3c68b53cd12b947d196f4 Author: Wojciech Drewek Date: Fri Mar 4 17:40:44 2022 +0100 gtp: Implement GTP echo request Adding GTP device through ip link creates the situation where GTP instance is not able to send GTP echo requests. Echo requests are used to check if GTP peer is still alive. With this patch, gtp_genl_ops are extended by new cmd (GTP_CMD_ECHOREQ) which allows to send echo request in the given version of GTP protocol (v0 or v1), from the given ms address to he given peer. TID is not inclued because in all path management messages it should be equal to 0. When GTP echo response is detected, multicast message is send to everyone in the gtp_genl_family. Message contains GTP version, ms address and peer address. Suggested-by: Harald Welte Signed-off-by: Wojciech Drewek Reviewed-by: Harald Welte Signed-off-by: Tony Nguyen drivers/net/gtp.c | 305 +++++++++++++++++++++++++++++++++++++++++------ include/uapi/linux/gtp.h | 1 + 2 files changed, 269 insertions(+), 37 deletions(-) commit 9af41cc33471ea1efa6f77e188f055cc77d0a5c5 Author: Wojciech Drewek Date: Fri Mar 4 17:40:43 2022 +0100 gtp: Implement GTP echo response Adding GTP device through ip link creates the situation where there is no userspace daemon which would handle GTP messages (Echo Request for example). GTP-U instance which would not respond to echo requests would violate GTP specification. When GTP packet arrives with GTP_ECHO_REQ message type, GTP_ECHO_RSP is send to the sender. GTP_ECHO_RSP message should contain information element with GTPIE_RECOVERY tag and restart counter value. For GTPv1 restart counter is not used and should be equal to 0, for GTPv0 restart counter contains information provided from userspace(IFLA_GTP_RESTART_COUNT). Signed-off-by: Wojciech Drewek Suggested-by: Harald Welte Reviewed-by: Harald Welte Tested-by: Harald Welte Signed-off-by: Tony Nguyen drivers/net/gtp.c | 213 +++++++++++++++++++++++++++++++++++++++---- include/net/gtp.h | 31 +++++++ include/uapi/linux/if_link.h | 1 + 3 files changed, 229 insertions(+), 16 deletions(-) commit b20dc3c684580ddc07eb48ee3c3dc7597cd5eebf Author: Wojciech Drewek Date: Fri Mar 4 17:40:42 2022 +0100 gtp: Allow to create GTP device without FDs Currently, when the user wants to create GTP device, he has to provide file handles to the sockets created in userspace (IFLA_GTP_FD0, IFLA_GTP_FD1). This behaviour is not ideal, considering the option of adding support for GTP device creation through ip link. Ip link application is not a good place to create such sockets. This patch allows to create GTP device without providing IFLA_GTP_FD0 and IFLA_GTP_FD1 arguments. If the user sets IFLA_GTP_CREATE_SOCKETS attribute, then GTP module takes care of creating UDP sockets by itself. Sockets are created with the commonly known UDP ports used for GTP protocol (GTP0_PORT and GTP1U_PORT). In this case we don't have to provide encap_destroy because no extra deinitialization is needed, everything is covered by udp_tunnel_sock_release. Note: GTP instance created with only this change applied, does not handle GTP Echo Requests. This is implemented in the following patch. Signed-off-by: Wojciech Drewek Signed-off-by: Tony Nguyen drivers/net/gtp.c | 101 +++++++++++++++++++++++++++++++++++-------- include/uapi/linux/if_link.h | 1 + 2 files changed, 85 insertions(+), 17 deletions(-) commit 092cf7b26a48a542d9aabfc0f517fa263102a4c1 Author: Cezary Rojewski Date: Fri Mar 11 16:35:44 2022 +0100 ASoC: Intel: avs: Code loading over HDA Compared to SKL and KBL, more recent cAVS platforms are meant to re-use one of HDAudio streams during boot procedure causing CLDMA to become obsolete. Once transferred, given stream is returned to pool available for audio streaming. Module loading handler is stub as library and module code became inseparable in later firmware generations. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-18-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/Kconfig | 1 + sound/soc/intel/avs/avs.h | 5 + sound/soc/intel/avs/loader.c | 214 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 220 insertions(+) commit 65794fe1a5f6f5fb10fa7b71a762158332144855 Author: Cezary Rojewski Date: Fri Mar 11 16:35:43 2022 +0100 ASoC: Intel: avs: Code loading over CLDMA With CLDMA transfer implemented, make use of it to shape firmware, library and module loading routines for SKL and KBL platforms. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-17-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/avs.h | 7 ++ sound/soc/intel/avs/loader.c | 159 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+) commit 45864e49a05aa446b9d99c464c1a9f46956ed32c Author: Cezary Rojewski Date: Fri Mar 11 16:35:42 2022 +0100 ASoC: Intel: avs: Implement CLDMA transfer SKL and KBL rely on a dedicated HDAudio DMA stream for code loading and authentication. The implementation of this specific mechanism for SKL-based platforms re-uses HDAudio DMA (streaming) functions found in HDA library to avoid duplication of functionality. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-16-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/Makefile | 1 + sound/soc/intel/avs/cldma.c | 316 ++++++++++++++++++++++++++++++++++++++++ sound/soc/intel/avs/cldma.h | 29 ++++ sound/soc/intel/avs/registers.h | 2 + 4 files changed, 348 insertions(+) commit b27f452317236b0cbaa94c4498f8241e2ad871b1 Author: Cezary Rojewski Date: Fri Mar 11 16:35:41 2022 +0100 ASoC: Intel: avs: General code loading flow Code loading is a complex procedure and requires combined effort of DMA and IPCs. With IPCs already in place, lay out ground for specific DMA transfer operations. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-15-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/Makefile | 2 +- sound/soc/intel/avs/avs.h | 17 +++ sound/soc/intel/avs/core.c | 61 +++++++++++ sound/soc/intel/avs/dsp.c | 26 +++++ sound/soc/intel/avs/loader.c | 235 ++++++++++++++++++++++++++++++++++++++++ sound/soc/intel/avs/registers.h | 6 + 6 files changed, 346 insertions(+), 1 deletion(-) commit 215e67b2d2de1d8d34a53c440b9a19a732ee6fb0 Author: Cezary Rojewski Date: Fri Mar 11 16:35:40 2022 +0100 ASoC: Intel: avs: Dynamic firmware resources management Wrap elementary DSP-core operations and resource control into more complex handlers. This is done to reduce the number of invocations of wrapped operations throughout the driver as order of operations matters - most flows involve register manipulation and IPCs combined. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-14-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/avs.h | 10 +++ sound/soc/intel/avs/dsp.c | 169 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+) commit 580a5912d1fe774f9902b614fa33e1add92ca749 Author: Cezary Rojewski Date: Fri Mar 11 16:35:39 2022 +0100 ASoC: Intel: avs: Declare module configuration types Declare structures and constants for all modules being part of basefw binary. These are used in streaming operations to communicate the needs of software to firmware side. While adding module types, append handler for SET_SINK_FORMAT runtime for COPIER module which allows for configuration of output pin other than the default one (0). Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-13-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/messages.c | 17 +++ sound/soc/intel/avs/messages.h | 252 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+) commit c1a427e8da9332a5832fd4a5429adede34bfa85f Author: Cezary Rojewski Date: Fri Mar 11 16:35:38 2022 +0100 ASoC: Intel: avs: Firmware resources management utilities With basefw runtime parameter handlers added, implement utility functions to ease pipelines and modules allocation. IDA is enlisted to help with that. As firmware is modular and multiple binaries can be loaded on-demand depending on the streaming scenario, custom firmware caching mechanism is added. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-12-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/Makefile | 2 +- sound/soc/intel/avs/avs.h | 37 ++++++ sound/soc/intel/avs/utils.c | 301 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 339 insertions(+), 1 deletion(-) commit 3322e1688953966da15fcd0ae3183a351e241ea3 Author: Cezary Rojewski Date: Fri Mar 11 16:35:37 2022 +0100 ASoC: Intel: avs: Add basefw runtime-parameter requests Each module may expose a range of runtime parameters. For basefw, implement handlers for: FIRMWARE_CONFIG, HARDWARE_CONFIG and MODULES_INFO. These are used by driver to dynamically allocate resources in respect to platform details, reducing number of hardcodes and code duplications that would otherwise be needed to be defined within the driver code. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-11-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/messages.c | 214 +++++++++++++++++++++++++++++++++++++++++ sound/soc/intel/avs/messages.h | 179 ++++++++++++++++++++++++++++++++++ 2 files changed, 393 insertions(+) commit 25f414fcdb875e4203ff43f42898367c32df4827 Author: Cezary Rojewski Date: Fri Mar 11 16:35:36 2022 +0100 ASoC: Intel: avs: Add ROM requests ROM requests are messages initiated by Host to alter firmware early boot process. They specify whether the next boot should be a fresh start or if IMR can be used to speed things up. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-10-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/messages.c | 18 ++++++++++++++++++ sound/soc/intel/avs/messages.h | 14 ++++++++++++++ 2 files changed, 32 insertions(+) commit 469e87ca9a2029c325362496c7b589683a382505 Author: Cezary Rojewski Date: Fri Mar 11 16:35:35 2022 +0100 ASoC: Intel: avs: Add power management requests Audio DSP supports low power states i.e.: transitions between D0 and D3 and D0-substates in form of D0i0 and D0i3. That process is a combination of core and IPC operations. Here, Dx and D0ix IPC handlers are added. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-9-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/messages.c | 44 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/intel/avs/messages.h | 15 ++++++++++++++ 2 files changed, 59 insertions(+) commit f14a1c5a9f830025dc8638303ddefd5f731ae4bc Author: Cezary Rojewski Date: Fri Mar 11 16:35:34 2022 +0100 ASoC: Intel: avs: Add module management requests Firmware modules implement processing algorithms. Their lifecycle, similarly to pipelines is being controlled by IPCs: initialization, deletion and (un)binding. Modules can be configured at runtime - runtime parameters. This is done with help of LARGE_CONFIG IPCs: getter and setter. Due to firmware limitations, LARGE_CONFIG_GET handler implementation does not support retrieving payload with size larger than IPC inbox window size. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-8-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/ipc.c | 8 +- sound/soc/intel/avs/messages.c | 261 +++++++++++++++++++++++++++++++++++++++++ sound/soc/intel/avs/messages.h | 52 ++++++++ 3 files changed, 320 insertions(+), 1 deletion(-) commit b956b27b477ae63e92240f813c1027de601df11f Author: Cezary Rojewski Date: Fri Mar 11 16:35:33 2022 +0100 ASoC: Intel: avs: Add pipeline management requests Pipeline represents a scheduling entity. Their existence as well as their state machine is controlled through CREATE_PIPELINE, DELETE_PIPELINE and SET_PIPELINE_STATE IPCs. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-7-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/messages.c | 76 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/intel/avs/messages.h | 48 ++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) commit cb1eb6b5be42799d23f81ffde84ee3537365b0ed Author: Cezary Rojewski Date: Fri Mar 11 16:35:32 2022 +0100 ASoC: Intel: avs: Add code loading requests Before firmware and its modules can be used, they have to be loaded. Code loading process is complex and is a combination of DMA and IPC operations. Here, IPC part is being added and accounts for CLDMA and HDA mechanisms both. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-6-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/Makefile | 2 +- sound/soc/intel/avs/messages.c | 65 ++++++++++++++++++++++++++++++++++++++++++ sound/soc/intel/avs/messages.h | 22 ++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) commit 2879516fcd6d7ec5972762dbd94859d9221e70d8 Author: Cezary Rojewski Date: Fri Mar 11 16:35:31 2022 +0100 ASoC: Intel: avs: Inter process communication Implement the IPC between Intel audio firmware and kernel driver. The IPC allows transmission of requests, handling of responses as well as unsolicited (i.e. firmware-generated) notifications. A subscription mechanism is added to enable different parts of the driver to register for specific notifications. The part of the DSP boot process that involves sending ROM message requires an extra step - must be followed by unstall operation of MAIN_CORE. All other types of messages do not require such specific handling, so separate set of functions is provided for sending these. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-5-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/avs/Makefile | 2 +- sound/soc/intel/avs/avs.h | 100 +++++++++++ sound/soc/intel/avs/ipc.c | 376 ++++++++++++++++++++++++++++++++++++++++ sound/soc/intel/avs/messages.h | 170 ++++++++++++++++++ sound/soc/intel/avs/registers.h | 45 +++++ 5 files changed, 692 insertions(+), 1 deletion(-) commit 9fe51c559a862d6c884f6784de26c8f9463187b1 Author: Cezary Rojewski Date: Fri Mar 11 16:35:30 2022 +0100 ASoC: Intel: Introduce AVS driver Declare base structures and core DSP operations for the avs solution. The base structures describe PCI HDAudio bus device and platform-type differentiations. First set of operations added controls the lifecycle of any Audio DSP core: (un)powering, (un)resetting and (un)stalling. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown sound/soc/intel/Kconfig | 11 +++++ sound/soc/intel/Makefile | 1 + sound/soc/intel/avs/Makefile | 5 ++ sound/soc/intel/avs/avs.h | 71 ++++++++++++++++++++++++++ sound/soc/intel/avs/dsp.c | 107 ++++++++++++++++++++++++++++++++++++++++ sound/soc/intel/avs/registers.h | 22 +++++++++ 6 files changed, 217 insertions(+) commit da0398099a83483014adc509a2845c88ccf672af Author: Cezary Rojewski Date: Fri Mar 11 16:35:29 2022 +0100 ASoC: Export DAI register and widget ctor and dctor functions To allow for more flexibility i.e. populating component DAIs dynamically during its initialization, without being limited to topology loading procedure, expose snd_soc_register(), snd_soc_dapm_new_dai_widgets() and snd_soc_dapm_free_widget() functions. Allows users to first check available resources e.g. number of PCMs supported by HDAudio codec before allocating the number of DAPM widgets needed. This prevents superfluous objects from being created or allows driver to adjust to situation when resources are limited. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220311153544.136854-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown include/sound/soc-dapm.h | 1 + sound/soc/soc-core.c | 1 + sound/soc/soc-dapm.c | 15 +++++++++++++++ 3 files changed, 17 insertions(+) commit c19bd02e9029f0f75b58f4b8662527da74be8985 Author: Cezary Rojewski Date: Fri Mar 11 16:35:28 2022 +0100 ALSA: hda: Add helper macros for DSP capable devices HDAudio drivers make heavy use of I/O operations. Declare a range of update, read and write helpers similar to those available for HDAudio legacy driver. These macros are used by AVS driver to improve code readability. Signed-off-by: Cezary Rojewski Acked-by: Takashi Iwai Link: https://lore.kernel.org/r/20220311153544.136854-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown include/sound/hdaudio.h | 3 +++ include/sound/hdaudio_ext.h | 50 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) commit 882bd07f564f97fca6e42ce6ce627ce24ce1ef5a Author: huangwenhui Date: Fri Mar 11 17:38:36 2022 +0800 ALSA: hda/realtek - Fix headset mic problem for a HP machine with alc671 On a HP 288 Pro G8, the front mic could not be detected.In order to get it working, the pin configuration needs to be set correctly, and the ALC671_FIXUP_HP_HEADSET_MIC2 fixup needs to be applied. Signed-off-by: huangwenhui Cc: Link: https://lore.kernel.org/r/20220311093836.20754-1-huangwenhuia@uniontech.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) commit d6cd2f85931f87dbd07c664c9c6e806db1dd7c75 Merge: 9edcfaa349af 52c85167e413 Author: Greg Kroah-Hartman Date: Fri Mar 11 16:40:10 2022 +0100 Merge tag 'icc-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next Georgi writes: interconnect changes for 5.18 These are the interconnect changes for the 5.18-rc1 merge window consisting of minor framework and driver updates. Core changes: - Added stubs for the bulk API to expand compile testing coverage. Driver changes: - imx: Implemented get_bw() function to get initial avg/peak bandwidth. - msm8939: Fix ioremap collision for snoc-mm. Signed-off-by: Georgi Djakov * tag 'icc-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: Add stubs for the bulk API interconnect: qcom: msm8939: Remove snoc_mm specific regmap dt-bindings: interconnect: Convert snoc-mm to a sub-node of snoc interconnect: imx: Add imx_icc_get_bw function to set initial avg and peak commit e23b2f54db1dcdde8302e4ada41805c8297fac27 Author: Jesse Taube Date: Mon Mar 7 14:34:14 2022 +0000 dt-bindings: mmc: sunxi: add Allwinner F1c100s compatible The Allwinner F1C100 series contains two MMC controller blocks. From comparing the data sheets, they seem to be compatible with the one used in the Allwinner A20: the register layout is the same, and they use the same separate sample and output clocks design. The only difference is the missing reset line in the A20 version, but both the binding and the Linux driver make this optional, so it's still a fit. Add the new SoC specific name and require it to be paired with the A20 fallback name, as this is all the driver needs to care about. Signed-off-by: Jesse Taube Signed-off-by: Andre Przywara Acked-by: Rob Herring Acked-by: Samuel Holland Link: https://lore.kernel.org/r/20220307143421.1106209-8-andre.przywara@arm.com Signed-off-by: Ulf Hansson Documentation/devicetree/bindings/mmc/allwinner,sun4i-a10-mmc.yaml | 3 +++ 1 file changed, 3 insertions(+) commit ba900534f807f0b327c92d5141c85d2313e2d55c Author: Jaegeuk Kim Date: Fri Mar 4 09:40:05 2022 -0800 f2fs: don't get FREEZE lock in f2fs_evict_inode in frozen fs Let's purge inode cache in order to avoid the below deadlock. [freeze test] shrinkder freeze_super - pwercpu_down_write(SB_FREEZE_FS) - super_cache_scan - down_read(&sb->s_umount) - prune_icache_sb - dispose_list - evict - f2fs_evict_inode thaw_super - down_write(&sb->s_umount); - __percpu_down_read(SB_FREEZE_FS) Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Documentation/ABI/testing/sysfs-fs-f2fs | 1 + fs/f2fs/debug.c | 1 + fs/f2fs/f2fs.h | 1 + fs/f2fs/inode.c | 6 ++++-- fs/f2fs/super.c | 4 ++++ 5 files changed, 11 insertions(+), 2 deletions(-) commit 7d2c8a13c925403b5d4e3d121c00e2b25c0cd715 Merge: 6edc3f89fad2 144c4a77a3e1 Author: Greg Kroah-Hartman Date: Fri Mar 11 16:31:12 2022 +0100 Merge tag 'thunderbolt-for-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: thunderbolt: Changes for v5.18 merge window This includes following Thunderbolt/USB4 changes for the v5.18 merge window: * Improvements for Intel Alpine and Titan Ridge support * Replace acpi_bus_get_device() with acpi_fetch_acpi_dev() * Improvements around DROM handling on AMD hardware * A couple of cleanups. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Rename EEPROM handling bits to match USB4 spec thunderbolt: Clarify register definitions for `tb_cap_plug_events` thunderbolt: Do not make DROM read success compulsory thunderbolt: Do not resume routers if UID is not set thunderbolt: Retry DROM reads for more failure scenarios thunderbolt: Replace acpi_bus_get_device() thunderbolt: Add internal xHCI connect flows for Thunderbolt 3 devices thunderbolt: Add missing device ID to tb_switch_is_alpine_ridge() thunderbolt: Disable LTTPR on Intel Titan Ridge thunderbolt: Remove useless DMA-32 fallback configuration commit 2783a7f56f9980f61ca809b826bcd14dc77eb7b9 Author: Rob Herring Date: Thu Mar 10 10:05:12 2022 -0600 dt-bindings: kbuild: Pass DT_SCHEMA_FILES to dt-validate In preparation for supporting validation of DTB files, the full processed schema will always be needed in order to extract type information from it. Therefore, the processed schema containing only what DT_SCHEMA_FILES specifies won't work. Instead, dt-validate has gained an option, -l or --limit, to specify which schema(s) to use for validation. As the command line option is new, we the minimum dtschema version must be updated. Cc: Masahiro Yamada Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220310160513.1708182-2-robh@kernel.org Documentation/devicetree/bindings/Makefile | 28 +++------------------------- scripts/Makefile.lib | 5 ++--- 2 files changed, 5 insertions(+), 28 deletions(-) commit 9d6647762b9c6b555bc83d97d7c93be6057a990f Author: Dai Ngo Date: Sat Feb 12 10:12:52 2022 -0800 fs/lock: documentation cleanup. Replace inode->i_lock with flc_lock. Update lock usage of lock_manager_operations' functions to reflect the changes in commit 6109c85037e5 ("locks: add a dedicated spinlock to protect i_flctx lists"). Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever Reviewed-by: Jeff Layton Documentation/filesystems/locking.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 50719bf3442dd6cd05159e9c98d020b3919ce978 Author: Chuck Lever Date: Mon Feb 14 15:30:13 2022 -0500 NFSD: Fix nfsd_breaker_owns_lease() return values These have been incorrect since the function was introduced. A proper kerneldoc comment is added since this function, though static, is part of an external interface. Reported-by: Dai Ngo Signed-off-by: Chuck Lever fs/nfsd/nfs4state.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit 35aff0678f99b0623bb72d50112de9e163a19559 Author: Chuck Lever Date: Wed Feb 16 11:26:06 2022 -0500 NFSD: Clean up _lm_ operation names The common practice is to name function instances the same as the method names, but with a uniquifying prefix. Commit aef9583b234a ("NFSD: Get reference of lockowner when coping file_lock") missed this -- the new function names should both have been of the form "nfsd4_lm_*". Before more lock manager operations are added in NFSD, rename these two functions for consistency. Signed-off-by: Chuck Lever fs/nfsd/nfs4state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit f3e4080edd2754abbdc3daf9881b1f6e168c6669 Author: Chuck Lever Date: Mon Feb 14 11:12:09 2022 -0500 arch: Remove references to CONFIG_NFSD_V3 in the default configs CONFIG_NFSD_V3 has been removed. NFSD support for NFSv3 can no longer be disabled. Signed-off-by: Chuck Lever arch/alpha/configs/defconfig | 1 - arch/arm/configs/davinci_all_defconfig | 1 - arch/arm/configs/ezx_defconfig | 1 - arch/arm/configs/imote2_defconfig | 1 - arch/arm/configs/integrator_defconfig | 1 - arch/arm/configs/iop32x_defconfig | 1 - arch/arm/configs/keystone_defconfig | 1 - arch/arm/configs/lart_defconfig | 1 - arch/arm/configs/netwinder_defconfig | 1 - arch/arm/configs/versatile_defconfig | 1 - arch/arm/configs/viper_defconfig | 1 - arch/arm/configs/zeus_defconfig | 1 - arch/ia64/configs/zx1_defconfig | 1 - arch/m68k/configs/amiga_defconfig | 1 - arch/m68k/configs/apollo_defconfig | 1 - arch/m68k/configs/atari_defconfig | 1 - arch/m68k/configs/bvme6000_defconfig | 1 - arch/m68k/configs/hp300_defconfig | 1 - arch/m68k/configs/mac_defconfig | 1 - arch/m68k/configs/multi_defconfig | 1 - arch/m68k/configs/mvme147_defconfig | 1 - arch/m68k/configs/mvme16x_defconfig | 1 - arch/m68k/configs/q40_defconfig | 1 - arch/m68k/configs/sun3_defconfig | 1 - arch/m68k/configs/sun3x_defconfig | 1 - arch/mips/configs/cobalt_defconfig | 1 - arch/mips/configs/decstation_64_defconfig | 1 - arch/mips/configs/decstation_defconfig | 1 - arch/mips/configs/decstation_r4k_defconfig | 1 - arch/mips/configs/ip22_defconfig | 1 - arch/mips/configs/ip32_defconfig | 1 - arch/mips/configs/jazz_defconfig | 1 - arch/mips/configs/malta_defconfig | 1 - arch/mips/configs/malta_kvm_defconfig | 1 - arch/mips/configs/maltaup_xpa_defconfig | 1 - arch/mips/configs/rm200_defconfig | 1 - arch/mips/configs/tb0219_defconfig | 1 - arch/mips/configs/tb0226_defconfig | 1 - arch/mips/configs/tb0287_defconfig | 1 - arch/mips/configs/workpad_defconfig | 1 - arch/parisc/configs/generic-32bit_defconfig | 1 - arch/powerpc/configs/linkstation_defconfig | 1 - arch/powerpc/configs/mvme5100_defconfig | 1 - arch/sh/configs/ap325rxa_defconfig | 1 - arch/sh/configs/ecovec24_defconfig | 1 - arch/sh/configs/landisk_defconfig | 1 - arch/sh/configs/sdk7780_defconfig | 1 - arch/sh/configs/se7724_defconfig | 1 - arch/sh/configs/sh03_defconfig | 1 - arch/sh/configs/sh7785lcr_32bit_defconfig | 1 - arch/sh/configs/titan_defconfig | 1 - 51 files changed, 51 deletions(-) commit 5f9a62ff7d2808c7b56c0ec90f3b7eae5872afe6 Author: Chuck Lever Date: Sun Feb 6 12:25:47 2022 -0500 NFSD: Remove CONFIG_NFSD_V3 Eventually support for NFSv2 in the Linux NFS server is to be deprecated and then removed. However, NFSv2 is the "always supported" version that is available as soon as CONFIG_NFSD is set. Before NFSv2 support can be removed, we need to choose a different "always supported" version. This patch removes CONFIG_NFSD_V3 so that NFSv3 is always supported, as NFSv2 is today. When NFSv2 support is removed, NFSv3 will become the only "always supported" NFS version. The defconfigs still need to be updated to remove CONFIG_NFSD_V3=y. Signed-off-by: Chuck Lever fs/Kconfig | 2 +- fs/nfsd/Kconfig | 12 +----------- fs/nfsd/Makefile | 3 +-- fs/nfsd/nfsfh.c | 4 ---- fs/nfsd/nfsfh.h | 20 -------------------- fs/nfsd/nfssvc.c | 2 -- fs/nfsd/vfs.c | 9 --------- fs/nfsd/vfs.h | 2 -- 8 files changed, 3 insertions(+), 51 deletions(-) commit 37de81210f74c909e3d42c90fea3497a00ac618b Author: Rob Herring Date: Wed Mar 9 20:12:24 2022 -0600 dt-bindings: Add QEMU virt machine compatible The top level QEMU virt machine compatible, linux,dummy-virt, has been in use for a long time, but never documented. Add a schema for it. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220310021224.599398-1-robh@kernel.org .../devicetree/bindings/arm/linux,dummy-virt.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) commit 1d9a770bc8f080267bba6b2169c87efb61f245c1 Author: Rob Herring Date: Wed Mar 9 19:35:52 2022 -0600 dt-bindings: arm: Convert QEMU fw-cfg to DT schema Convert the QEMU fw-cfg binding to DT schema format. As this binding is also used on Risc-V now, drop any architecture references and move to a common location. The fw-cfg interface has also gained some DMA support which is coherent, so add the missing 'dma-coherent'. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Acked-by: Laszlo Ersek Link: https://lore.kernel.org/r/20220310013552.549590-1-robh@kernel.org Documentation/devicetree/bindings/arm/fw-cfg.txt | 38 --------------- .../bindings/firmware/qemu,fw-cfg-mmio.yaml | 54 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 38 deletions(-) commit a0a7e453b502cbbf7ff372f907a4e27a2ebf5445 Author: Frederic Weisbecker Date: Thu Feb 17 12:12:40 2022 +0100 sched/preempt: Tell about PREEMPT_DYNAMIC on kernel headers Displaying "PREEMPT" on kernel headers when CONFIG_PREEMPT_DYNAMIC=y can be misleading for anybody involved in remote debugging because it is then not guaranteed that there is an actual preemption behaviour. It depends on default Kconfig or boot defined choices. Therefore, tell about PREEMPT_DYNAMIC on static kernel headers and leave the search for the actual preemption behaviour to browsing dmesg. Reviewed-by: Valentin Schneider Signed-off-by: Frederic Weisbecker Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220217111240.GA742892@lothringen init/Makefile | 3 ++- scripts/mkcompile_h | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) commit 1889421a891ff439b25495011b8b75f81660abca Author: Kuldeep Singh Date: Wed Mar 9 22:48:47 2022 +0530 spi: Update clock-names property for arm pl022 PL022 has two input clocks named sspclk and apb_pclk. Current schema refers to two notations of sspclk which are indeed same and thus one can be dropped. Update clock-names property to reflect the same. Signed-off-by: Kuldeep Singh Link: https://lore.kernel.org/r/20220309171847.5345-1-singh.kuldeep87k@gmail.com Signed-off-by: Mark Brown Documentation/devicetree/bindings/spi/spi-pl022.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 375a347da4889f64d86e1ab7f4e6702b6e9bf299 Author: Miaoqian Lin Date: Mon Mar 7 08:45:22 2022 +0000 ASoC: msm8916-wcd-digital: Fix missing clk_disable_unprepare() in msm8916_wcd_digital_probe Fix the missing clk_disable_unprepare() before return from msm8916_wcd_digital_probe in the error handling case. Fixes: 150db8c5afa1 ("ASoC: codecs: Add msm8916-wcd digital codec") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220307084523.28687-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/msm8916-wcd-digital.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 5bbe2918acccfa60de1c1a2139de9cc5441d5796 Author: Sameer Pujar Date: Thu Mar 10 16:46:39 2022 +0530 ASoC: simple-card-utils: Don't reset clock of active DAI Playback or capture errors are seen when clock is reset during an active stage of DAI. Presently this scenario happens when DAI has both playback and capture sessions running and one of these finishes first which will be followed by clock rate reset. The remaining active session will be affected in such case. Address this problem by allowing clock rate reset to happen only when the DAI is no more active. Signed-off-by: Sameer Pujar Reviewed-by: Kuninori Morimoto Link: https://lore.kernel.org/r/1646910999-2501-1-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown sound/soc/generic/simple-card-utils.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit 886e09c77d2b48559d26928a5705a20ef3ac117d Author: Claudiu Beznea Date: Fri Mar 11 13:28:18 2022 +0200 ASoC: mchp-spdifrx: fix typo Fix typo in log describing failure of devm_snd_dmaengine_pcm_register(). Signed-off-by: Claudiu Beznea Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220311112818.1482372-1-claudiu.beznea@microchip.com Signed-off-by: Mark Brown sound/soc/atmel/mchp-spdifrx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ee7f79a81a27c47088fe0af95788621644826d91 Author: Trevor Wu Date: Tue Mar 8 15:24:32 2022 +0800 dt-bindings: mediatek: mt8195: add reset property Add required properties "resets" and "reset_names", which are used to specify audiosys hw reset for mt8195 afe driver. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20220308072435.22460-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown Documentation/devicetree/bindings/sound/mt8195-afe-pcm.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) commit f67084148dac015d059c64f25e57abd0ab18946c Author: Trevor Wu Date: Tue Mar 8 15:24:31 2022 +0800 ASoC: mediatek: mt8195: add reset controller Audio hardware is possibly used in the firmware stage, so resetting audio hardware before regcache records default register values is required. Signed-off-by: Trevor Wu Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220308072435.22460-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit 00f19253633710877880ad062d6cee3c13deb9a5 Author: Peter Ujfalusi Date: Wed Mar 9 20:27:20 2022 -0800 ASoC: SOF: Remove ipc_pcm_params() ops All users have been converted to use the IPC agnostic set_stream_data_offsett() Remove all code related to the old API. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ops.h | 13 ------------- sound/soc/sof/pcm.c | 7 ------- sound/soc/sof/sof-priv.h | 8 -------- sound/soc/sof/stream-ipc.c | 8 -------- 4 files changed, 36 deletions(-) commit f0383aded3c6e61e044b90662bf99b3d850c5d90 Author: Peter Ujfalusi Date: Wed Mar 9 20:27:19 2022 -0800 ASoC: SOF: imx: Convert to use the generic set_stream_data_offset ops Switch from the IPC dependent ipc_pcm_params() ops to the IPC neutral set_stream_data_offset(). Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/imx/imx8.c | 4 ++-- sound/soc/sof/imx/imx8m.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) commit cf73363e4a55579e3131f5de38c3b7b70bb4d639 Author: Peter Ujfalusi Date: Wed Mar 9 20:27:18 2022 -0800 ASoC: SOF: Intel: Convert to use the generic set_stream_data_offset ops Switch from the IPC dependent ipc_pcm_params() ops to the IPC neutral set_stream_data_offset(). Remove the no longer used hda_ipc_pcm_params() function as well. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/intel/apl.c | 2 +- sound/soc/sof/intel/bdw.c | 2 +- sound/soc/sof/intel/byt.c | 4 ++-- sound/soc/sof/intel/cnl.c | 2 +- sound/soc/sof/intel/hda-ipc.c | 7 ------- sound/soc/sof/intel/hda.h | 3 --- sound/soc/sof/intel/icl.c | 2 +- sound/soc/sof/intel/pci-tng.c | 2 +- sound/soc/sof/intel/tgl.c | 2 +- 9 files changed, 8 insertions(+), 18 deletions(-) commit 29e3aa0bb934e44c6ec0127cbe96983dc9b82b0e Author: Peter Ujfalusi Date: Wed Mar 9 20:27:17 2022 -0800 ASoC: SOF: Intel: hda-ipc: Add hda_set_stream_data_offset() Add implementation for the generic set_stream_data_offset() callback to be used by HDA platforms. Convert the hda_ipc_pcm_params() to a wrapper for the new function. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/intel/hda-ipc.c | 15 ++++++++++----- sound/soc/sof/intel/hda.h | 3 +++ 2 files changed, 13 insertions(+), 5 deletions(-) commit 9a0a809a5aaeb09458c5f0d26fac63c213b0adb6 Author: Peter Ujfalusi Date: Wed Mar 9 20:27:16 2022 -0800 ASoC: SOF: stream-ipc: Add sof_set_stream_data_offset() Add implementation for the generic set_stream_data_offset() callback in core to be used by platforms. Convert the sof_ipc_pcm_params() to a wrapper for the new function. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-priv.h | 3 +++ sound/soc/sof/stream-ipc.c | 15 +++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) commit a6db22a68b0b2183184659d27c0a74df96f0d6d0 Author: Peter Ujfalusi Date: Wed Mar 9 20:27:15 2022 -0800 ASoC: SOF: Mark snd_sof_dsp_ops.ipc_pcm_params() callback optional AMD is only implementing an empty function to pass the required test and it is going to be deprecated in favor of the IPC agnostic set_stream_data_offset() callback. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/core.c | 3 +-- sound/soc/sof/ops.h | 5 ++++- sound/soc/sof/sof-priv.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) commit 757ce8103c9e5b83cf18a669fe38484b0be3cfaf Author: Peter Ujfalusi Date: Wed Mar 9 20:27:14 2022 -0800 ASoC: SOF: Introduce optional callback to configure stream data offset Each running audio stream's data have distinct start offset within the stream mailbox area from/to where the host can read/write. Instead of using the struct sof_ipc_pcm_params_reply to configure this offset, add an optional callback which is IPC agnostic. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ops.h | 13 +++++++++++++ sound/soc/sof/pcm.c | 8 ++++++++ sound/soc/sof/sof-priv.h | 5 +++++ 3 files changed, 26 insertions(+) commit d1b1146fc708eff661c2becb9bf78374adde6db7 Author: Peter Ujfalusi Date: Wed Mar 9 20:27:13 2022 -0800 ASoC: SOF: pcm: Remove sof_pcm_dsp_params() wrapper Call directly for snd_sof_ipc_pcm_params() from sof_pcm_hw_params() and remove the wrapper for it. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/pcm.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) commit 31f60a0c943d6a7e84b06686b1ed86ddadf484fa Author: Peter Ujfalusi Date: Wed Mar 9 20:27:12 2022 -0800 ASoC: SOF: Make pcm_hw_params snd_sof_dsp_ops callback IPC neutral Do not send IPC structure directly via pcm_hw_params to make it IPC agnostic. A new struct is created to retrieve the needed platform parameters and if there is a need it can be extended with new options. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/amd/acp-pcm.c | 8 +++++--- sound/soc/sof/amd/acp.h | 3 ++- sound/soc/sof/intel/hda-pcm.c | 18 ++++-------------- sound/soc/sof/intel/hda.h | 2 +- sound/soc/sof/ops.h | 6 +++--- sound/soc/sof/pcm.c | 21 ++++++++++++++++++++- sound/soc/sof/sof-priv.h | 17 ++++++++++++++++- 7 files changed, 51 insertions(+), 24 deletions(-) commit d7bc6ddef016d851cb0ff97ae16ac98d5f3c85ee Author: Peter Ujfalusi Date: Wed Mar 9 20:27:11 2022 -0800 ASoC: SOF: sof-priv: Remove stale snd_sof_ipc_stream_pcm_params() declaration The implementation for snd_sof_ipc_stream_pcm_params() does not exist, remove it from the header file. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220310042720.976809-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-priv.h | 2 -- 1 file changed, 2 deletions(-) commit d7be9e33c4ad71c299fd58c5d46d4407c0b42d86 Author: Muralidhar Reddy Date: Thu Mar 10 11:16:51 2022 -0600 ASoC: Intel: soc-acpi: Add entry for rt711-sdca-sdw in ADL match table RT711 sdca sdw is added with SDW0 link for ADL-PS platform. Reviewed-by: Bard Liao Signed-off-by: Muralidhar Reddy Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220310171651.249385-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/common/soc-acpi-intel-adl-match.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit 24320c55566138426ee0f9ec866dd3d656071799 Author: Brent Lu Date: Thu Mar 10 11:16:50 2022 -0600 ASoC: SOF: Intel: add topology overwrite for Taniks Taniks has four max98357a on SSP2 with Demux and EQ in topology to implement a 2-way speaker system. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220310171651.249385-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-pci-dev.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit d8b502a7c353a63269d5ac3cfa7e5a04308df6a1 Author: Peter Ujfalusi Date: Thu Mar 10 11:16:49 2022 -0600 ASoC: SOF: trace: Use proper DMA direction for the trace data buffer Buffers allocated with snd_dma_alloc_pages() will have DMA direction DMA_BIDIRECTIONAL. The trace data memory is only used for one DMA direction: DMA_FROM_DEVICE, DMA only writes there, never reads. We also need to do a sync before accessing (reading with CPU) from the trace data buffer to copy it to user space. Note: snd_dma_buffer_sync() is also used for normal playback and capture streams to make sure that the data is available for the DMA or CPU. Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220310171651.249385-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/trace.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit 7e4bfcf10a03981cb3056d723bb2f92eead5c0bb Author: Weiguo Li Date: Thu Mar 10 11:16:48 2022 -0600 ASoC: SOF: compress: fix null check after dereference "cstream" is dereferenced but null checked later. Swap their positions to avoid potential null dereference. Reviewed-by: Ranjani Sridharan Reviewed-by: Daniel Baluta Reviewed-by: Péter Ujfalusi Signed-off-by: Weiguo Li Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220310171651.249385-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/compress.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit a174e72e2355b9025205b4b6727bf43047eac6c6 Author: Kai Vehmanen Date: Thu Mar 10 11:16:47 2022 -0600 ASoC: SOF: Intel: enable DMI L1 for playback streams Add back logic to mark all playback streams as L1 compatible. Fixes: 246dd4287dfb ("ASoC: SOF: Intel: make DMI L1 selection more robust") Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Kai Vehmanen Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220310171651.249385-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/intel/hda-pcm.c | 1 + 1 file changed, 1 insertion(+) commit 763c8bed8c05ffcce8cba882e69cd6b03df07019 Author: Anup Patel Date: Mon Jan 31 12:31:36 2022 +0530 RISC-V: KVM: Implement SBI HSM suspend call The SBI v0.3 specification extends SBI HSM extension by adding SBI HSM suspend call and related HART states. This patch extends the KVM RISC-V HSM implementation to provide KVM guest a minimal SBI HSM suspend call which is equivalent to a WFI instruction. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel arch/riscv/kvm/vcpu_sbi_hsm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit c9d3b5bd2693a17f078b1d8bdca440db5baa458c Author: Anup Patel Date: Mon Jan 31 11:59:44 2022 +0530 RISC-V: KVM: Add common kvm_riscv_vcpu_wfi() function The wait for interrupt (WFI) instruction emulation can share the VCPU halt logic with SBI HSM suspend emulation so this patch adds a common kvm_riscv_vcpu_wfi() function for this purpose. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel arch/riscv/include/asm/kvm_host.h | 1 + arch/riscv/kvm/vcpu_exit.c | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) commit c38ff47bf094dc776ad4b586e47c4a7077a94f28 Author: Anup Patel Date: Mon Feb 15 10:43:39 2021 +0530 RISC-V: Add SBI HSM suspend related defines We add defines related to SBI HSM suspend call and also update HSM states naming as-per the latest SBI specification. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel arch/riscv/include/asm/sbi.h | 27 ++++++++++++++++++++++----- arch/riscv/kernel/cpu_ops_sbi.c | 2 +- arch/riscv/kvm/vcpu_sbi_hsm.c | 4 ++-- 3 files changed, 25 insertions(+), 8 deletions(-) commit be78aa8a38c8dc5c9676612c36329441132bccab Author: Anup Patel Date: Mon Jan 31 10:53:13 2022 +0530 RISC-V: KVM: Implement SBI v0.3 SRST extension The SBI v0.3 specification defines SRST (System Reset) extension which provides a standard poweroff and reboot interface. This patch implements SRST extension for the KVM Guest. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel arch/riscv/kvm/vcpu_sbi.c | 2 ++ arch/riscv/kvm/vcpu_sbi_replace.c | 44 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) commit 4b11d86571c44738f5ef12fcfac2ee36f998cf23 Author: Anup Patel Date: Mon Jan 31 10:29:31 2022 +0530 RISC-V: KVM: Add common kvm_riscv_vcpu_sbi_system_reset() function We rename kvm_sbi_system_shutdown() to kvm_riscv_vcpu_sbi_system_reset() and move it to vcpu_sbi.c so that it can be shared by SBI v0.1 shutdown and SBI v0.3 SRST extension. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel arch/riscv/include/asm/kvm_vcpu_sbi.h | 3 +++ arch/riscv/kvm/vcpu_sbi.c | 17 +++++++++++++++++ arch/riscv/kvm/vcpu_sbi_v01.c | 18 ++---------------- 3 files changed, 22 insertions(+), 16 deletions(-) commit a03faf01a5e32012172a41f5f9d5f02d1cc93ccf Author: Anup Patel Date: Mon Jan 31 10:11:43 2022 +0530 RISC-V: KVM: Upgrade SBI spec version to v0.3 We upgrade SBI spec version implemented by KVM RISC-V to v0.3 so that Guest kernel can probe and use SBI extensions added by the SBI v0.3 specification. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel arch/riscv/include/asm/kvm_vcpu_sbi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 823f53a30eb004d30762f56acfc973ecba1662fd Author: Vincent Chen Date: Wed Feb 23 09:13:31 2022 +0800 RISC-V: KVM: Refine __kvm_riscv_switch_to() implementation Kernel uses __kvm_riscv_switch_to() and __kvm_switch_return() to switch the context of host kernel and guest kernel. Several CSRs belonging to the context will be read and written during the context switch. To ensure atomic read-modify-write control of CSR and ordering of CSR accesses, some hardware blocks flush the pipeline when writing a CSR. In this circumstance, grouping CSR executions together as much as possible can reduce the performance impact of the pipeline. Therefore, this commit reorders the CSR instructions to enhance the context switch performance.. Signed-off-by: Vincent Chen Suggested-by: Hsinyi Lee Suggested-by: Fu-Ching Yang Signed-off-by: Anup Patel arch/riscv/kvm/vcpu_switch.S | 60 +++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 26 deletions(-) commit afec0c65d09d8fd6bba3e936e95fe6a60b78e001 Author: Guo Ren Date: Tue Feb 1 23:05:45 2022 +0800 KVM: compat: riscv: Prevent KVM_COMPAT from being selected Current riscv doesn't support the 32bit KVM API. Let's make it clear by not selecting KVM_COMPAT. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Cc: Arnd Bergmann Cc: Anup Patel Reviewed-by: Anup Patel Signed-off-by: Anup Patel virt/kvm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8eb3e1b923fdb74995294c78ef6bba3d11dc6434 Author: Yang Li Date: Tue Jan 11 09:04:54 2022 +0800 RISC-V: KVM: remove unneeded semicolon Eliminate the following coccicheck warning: ./arch/riscv/kvm/vcpu_sbi_v01.c:117:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Anup Patel arch/riscv/kvm/vcpu_sbi_v01.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f6b8e3526feb025d0259c18d6dc6b8c2e2cfedf0 Author: Ard Biesheuvel Date: Fri Mar 11 08:45:29 2022 +0100 ARM: unwind: only permit stack switch when unwinding call_with_stack() Commit b6506981f880 ("ARM: unwind: support unwinding across multiple stacks") updated the logic in the ARM unwinder to widen the bounds within which SP is assumed to be valid, in order to allow the unwind to traverse from the IRQ stack to the task stack. This is necessary, as otherwise, unwinds started from the IRQ stack would terminate in the IRQ exception handler, making stacktraces substantially less useful. This turns out to be a mistake, as it breaks asynchronous unwinding across exceptions, when the exception is taken before the stack frame is consistent with the unwind info. For instance, in the following backtrace: ... generic_handle_arch_irq from call_with_stack+0x18/0x20 call_with_stack from __irq_svc+0x80/0x98 Exception stack(0xc7093e20 to 0xc7093e68) 3e20: b6a94a88 c7093ea0 00000008 00000000 c7093ea0 b7e127d0 00000051 c9220000 3e40: b6a94a88 b6a94a88 00000004 0002b000 0036b570 c7093e70 c040ca2c c0994a90 3e60: 20070013 ffffffff __irq_svc from __copy_to_user_std+0x20/0x378 ... we need to apply the following unwind directives: 0xc099720c <__copy_to_user_std+0x1c>: @0xc295d1d4 Compact model index: 1 0x9b vsp = r11 0xb1 0x0d pop {r0, r2, r3} 0x84 0x81 pop {r4, r11, r14} 0xb0 finish which tell us to switch to the frame pointer register R11 and proceed with the unwind from that. However, having been interrupted 0x20 bytes into the function: c09971f0 <__copy_to_user_std>: c09971f0: e59f3350 ldr r3, [pc, #848] c09971f4: e243c001 sub ip, r3, #1 c09971f8: e05cc000 subs ip, ip, r0 c09971fc: 228cc001 addcs ip, ip, #1 c0997200: 205cc002 subscs ip, ip, r2 c0997204: 33a00000 movcc r0, #0 c0997208: e320f014 csdb c099720c: e3a03000 mov r3, #0 c0997210: e92d481d push {r0, r2, r3, r4, fp, lr} c0997214: e1a0b00d mov fp, sp c0997218: e2522004 subs r2, r2, #4 the value for R11 recovered from the previous frame (__irq_svc) will be a snapshot of its value before the exception was taken (0x0002b000), which occurred at address __copy_to_user_std+0x20 (0xc0997210), when R11 had not been assigned its value yet. This means we can never assume that the SP values recovered from the stack or from the frame pointer are ever safe to use, given the need to do asynchronous unwinding, and the only robust approach is to revert to the previous approach, which is to derive bounds for SP based on the initial value, and never update them. We can make an exception, though: now that the IRQ stack switch is guaranteed to occur in call_with_stack(), we can implement a special case for this function, and use a different set of bounds based on the knowledge that it will always unwind from R11 rather than SP. As call_with_stack() is a hand-rolled assembly routine, this is guaranteed to remain that way. So let's do a partial revert of b6506981f880, and drop all manipulations for sp_low and sp_high based on the information collected during the unwind itself. To support call_with_stack(), set sp_low and sp_high explicitly to values derived from R11 when we unwind that function. The only downside is that, while unwinding an overflow of the vmap'ed stack will work fine as before, we will no longer be able to produce a backtrace that unwinds the overflow stack itself across the exception that was raised due to the faulting access to the guard region. However, this only affects exceptions caused by problems in the stack overflow handling code itself, in which case the remaining backtrace is not that relevant. Fixes: b6506981f880 ("ARM: unwind: support unwinding across multiple stacks") Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) arch/arm/kernel/unwind.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) commit bee4e1fdc31223f8e0569370635ced223a1dd2ce Author: Ard Biesheuvel Date: Thu Mar 10 18:05:28 2022 +0100 ARM: Revert "unwind: dump exception stack from calling frame" After simplifying the stack switch code in the IRQ exception handler by deferring the actual stack switch to call_with_stack(), we no longer need to special case the way we dump the exception stack, since it will always be at the top of whichever stack was active when the exception was taken. So revert this special handling for the ARM unwinder. This reverts commit 4ab6827081c63b83011a18d8e27f621ed34b1194. Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) arch/arm/include/asm/stacktrace.h | 10 ---------- arch/arm/kernel/traps.c | 3 +-- arch/arm/kernel/unwind.c | 9 +-------- 3 files changed, 2 insertions(+), 20 deletions(-) commit 7a8ca84a258a79e564b77b1bbb139f3f561d149b Author: Ard Biesheuvel Date: Thu Mar 10 17:24:45 2022 +0100 ARM: entry: fix unwinder problems caused by IRQ stacks The IRQ stacks series made some changes to the unwinder, to permit unwinding across different stacks. This is needed because otherwise, the call stack would terminate at the point where the stack switch between the task stack and the IRQ stack occurs, which would defeat any diagnostics that rely on timer interrupts, such as RCU stall detection. Unfortunately, getting the unwind annotations correct turns out to be difficult, given that this now involves a frame pointer which needs to point into the right location in the task stack when unwinding from the IRQ stack. Getting this wrong for an exception handling routine results in the stack pointer to be unwound from the wrong location, causing any subsequent unwind attempts to cause all kinds of issues, as reported by Naresh here [0]. So let's simplify this, by deferring the stack switch to call_with_stack(), which already has the correct unwind annotations, and removing all the complicated handling of the stack frame from the IRQ exception entrypoint itself. [0] https://lore.kernel.org/all/CA+G9fYtpy8VgK+ag6OsA9TDrwi5YGU4hu7GM8xwpO7v6LrCD4Q@mail.gmail.com/ Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) arch/arm/kernel/entry-armv.S | 57 +++++++++++--------------------------------- 1 file changed, 14 insertions(+), 43 deletions(-) commit 85d9abcd7331566781b93ff46e4bccd4806ef2b2 Author: Juergen Gross Date: Fri Mar 11 11:35:27 2022 +0100 xen/blkfront: speed up purge_persistent_grants() purge_persistent_grants() is scanning the grants list for persistent grants being no longer in use by the backend. When having found such a grant, it will be set to "invalid" and pushed to the tail of the list. Instead of pushing it directly to the end of the list, add it first to a temporary list, avoiding to scan those entries again in the main list traversal. After having finished the scan, append the temporary list to the grant list. Suggested-by: Jan Beulich Signed-off-by: Juergen Gross Reviewed-by: Roger Pau Monné Reviewed-by: Jan Beulich Link: https://lore.kernel.org/r/20220311103527.12931-1-jgross@suse.com Signed-off-by: Jens Axboe drivers/block/xen-blkfront.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 59d5923536ac8640f4ff20d011a4851a3c143764 Merge: fb9eb027fbc9 ff1d56cb2653 Author: David S. Miller Date: Fri Mar 11 11:54:45 2022 +0000 Merge branch 'ptp-ocp-new-firmware-support' Jonathan Lemon says: ==================== ptp: ocp: support for new firmware This series contains support for new firmware features for the timecard. v1 -> v2: roundup() is not 32-bit safe, use DIV_ROUND_UP_ULL ==================== Signed-off-by: David S. Miller commit ff1d56cb2653e673859bc6233b71762de13c067a Author: Jonathan Lemon Date: Thu Mar 10 12:19:12 2022 -0800 docs: ABI: Document new timecard sysfs nodes. Add sysfs nodes for the frequency generator and signal counters. Update SMA selector lists for these, and also add the new 'None', 'VCC' 'GND' selectors. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller Documentation/ABI/testing/sysfs-timecard | 94 +++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) commit 0fa3ff7eb02ad9012f8f8c5477b185878e0a82af Author: Jonathan Lemon Date: Thu Mar 10 12:19:11 2022 -0800 ptp: ocp: Add 2 more timestampers The timecard now has 4 general purpose timestampers. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 5 deletions(-) commit 2407f5d620172fb0f0321e5ebbbf4de99401a0bc Author: Jonathan Lemon Date: Thu Mar 10 12:19:10 2022 -0800 ptp: ocp: Add 4 frequency counters Input signals can be steered to any of the frequency counters. The counter measures the frequency over a number of seconds: echo 0 > freq1/seconds = turns off measurement echo 1 > freq1/seconds = sets period & turns on measurment. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 165 insertions(+), 7 deletions(-) commit 1aa66a3a135a25bd8ce25165b4e550159a3dc849 Author: Jonathan Lemon Date: Thu Mar 10 12:19:09 2022 -0800 ptp: ocp: Program the signal generators via PTP_CLK_REQ_PEROUT The signal generators can be programmed either via the sysfs file or through a PTP_CLK_REQ_PEROUT ioctl request. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 103 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 94 insertions(+), 9 deletions(-) commit b325af3cfab970efa59b69cbcd9890be54713cef Author: Jonathan Lemon Date: Thu Mar 10 12:19:08 2022 -0800 ptp: ocp: Add signal generators and update sysfs nodes Newer firmware provides 4 programmable signal generators, add support for those here. The signal generators provide the ability to set the period, duty cycle, phase offset, and polarity, with new values defaulting to prior values. The period and phase offset are specified in nanoseconds. E.g: period [duty [phase [polarity]]] echo 500000000 > signal # 1/2 second period echo 1000000 40 100 > signal # 1ms period, 40% on, offset 100ns echo 0 > signal # turn off generator Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 486 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 476 insertions(+), 10 deletions(-) commit c205d53c4923e4b32b4a2a2773618f08e176a250 Author: Jonathan Lemon Date: Thu Mar 10 12:19:07 2022 -0800 ptp: ocp: Add firmware capability bits for feature gating Add the ability to group sysfs nodes behind a firmware feature check. This way non-present sysfs attributes are omitted on older firmware, which does not have newer features. This will be used in the upcoming patches which adds more features to the timecard. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) commit cd09193ffbf86026c490798a6db0f67a53bec333 Author: Jonathan Lemon Date: Thu Mar 10 12:19:06 2022 -0800 ptp: ocp: Add GND and VCC output selectors These will provide constant outputs. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 2 ++ 1 file changed, 2 insertions(+) commit be69087ce675ad23d83c20b050ec908243c25195 Author: Jonathan Lemon Date: Thu Mar 10 12:19:05 2022 -0800 ptp: ocp: Rename output selector 'GNSS' to 'GNSS1' As there are may be 2 GNSS outputs, rename the first one for clarity. This also works around a parsing issue when specifying selectors. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit b2c4f0ac53f34e621f8605ec543b0e0d4649823f Author: Jonathan Lemon Date: Thu Mar 10 12:19:04 2022 -0800 ptp: ocp: Add ability to disable input selectors. This adds support for the "IN: None" selector, which disables the input on a sma pin. This should be compatible with old firmware (the firmware will ignore it if not supported). Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) commit a509a7c61e3b7a16054dafdc5ae804e9a859a0a9 Author: Jonathan Lemon Date: Thu Mar 10 12:19:03 2022 -0800 ptp: ocp: Add support for selectable SMA directions. Assuming the firmware allows it, the direction of each SMA connector is no longer fixed. Handle remapping directions for each pin. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 328 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 211 insertions(+), 117 deletions(-) commit 6edc3f89fad2178891b5b27a5900b8b6b1c82776 Merge: 98d107b84614 4ac56b1f1ef8 Author: Greg Kroah-Hartman Date: Fri Mar 11 12:43:06 2022 +0100 Merge tag 'usb-serial-5.18-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for 5.18-rc1 Here are the USB-serial updates for 5.18-rc1, including: - a new "simple driver" for some Nokia phones - a fix for pl2303 GS type detection - another pl2303 device id Included is also a clean up. All have been in linux-next with no reported issues. * tag 'usb-serial-5.18-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: usb_wwan: remove redundant assignment to variable i USB: serial: pl2303: fix GS type detection USB: serial: pl2303: add IBM device IDs USB: serial: simple: add Nokia phone driver commit fb9eb027fbc90e21cbda18379d85f8603e1f28b9 Author: Horatiu Vultur Date: Thu Mar 10 09:40:05 2022 +0100 net: lan966x: Improve the CPU TX bitrate. When doing manual injection of the frame, it is required to check if the TX FIFO is ready to accept the next word of the frame. For this we are using 'readx_poll_timeout_atomic', the only problem is that before it actually checks the status, is determining the time when to finish polling the status. Which seems to be an expensive operation. Therefore check the status of the TX FIFO before calling 'readx_poll_timeout_atomic'. Doing this will improve the TX bitrate by ~70%. Because 99% the FIFO is ready by that time. The measurements were done using iperf3. Before: [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.03 sec 55.2 MBytes 46.2 Mbits/sec 0 sender [ 5] 0.00-10.04 sec 53.8 MBytes 45.0 Mbits/sec receiver After: [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.10 sec 95.0 MBytes 78.9 Mbits/sec 0 sender [ 5] 0.00-10.11 sec 95.0 MBytes 78.8 Mbits/sec receiver Signed-off-by: Horatiu Vultur Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 3 +++ 1 file changed, 3 insertions(+) commit 89ff05d5953bfd838c5ab27d38154f0f119c97fd Author: Yihao Han Date: Thu Mar 10 00:12:19 2022 -0800 net: ethernet: ezchip: fix platform_get_irq.cocci warning Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Signed-off-by: Yihao Han Signed-off-by: David S. Miller drivers/net/ethernet/ezchip/nps_enet.c | 1 - 1 file changed, 1 deletion(-) commit f65e58440d4fca277233ebef78f402a0dbd02da5 Author: Kurt Kanzenbach Date: Thu Mar 10 08:35:05 2022 +0100 flow_dissector: Add support for HSRv0 Commit bf08824a0f47 ("flow_dissector: Add support for HSR") added support for HSR within the flow dissector. However, it only works for HSR in version 1. Version 0 uses a different Ether Type. Add support for it. Reported-by: Anthony Harivel Signed-off-by: Kurt Kanzenbach Signed-off-by: David S. Miller net/core/flow_dissector.c | 1 + 1 file changed, 1 insertion(+) commit bf2b83425b599d897e64a2509388f16da2ce6fd4 Author: Minghao Chi Date: Thu Mar 10 06:20:35 2022 +0000 net: mv643xx_eth: use platform_get_irq() instead of platform_get_resource() It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting. platform_get_irq() instead is a recommended way for getting IRQ even if it was not retrieved earlier. It also makes code simpler because we're getting "int" value right away and no conversion from resource to int is required. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: David S. Miller drivers/net/ethernet/marvell/mv643xx_eth.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 7cd08f108d950726c9e3a5061d69a20c7a37e3c4 Author: Lad Prabhakar Date: Thu Mar 10 01:26:06 2022 +0000 net: ethernet: ti: davinci_emac: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq() for DT users only. While at it propagate error code in emac_dev_stop() in case platform_get_irq_optional() fails. Signed-off-by: Lad Prabhakar Signed-off-by: David S. Miller drivers/net/ethernet/ti/davinci_emac.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) commit e8609e69470f369509b44d5f2619f94541fe9df6 Author: Siddharth Vadapalli Date: Wed Mar 9 13:29:44 2022 +0530 net: ethernet: ti: am65-cpsw: Convert to PHYLINK Convert am65-cpsw driver and am65-cpsw ethtool to use Phylink APIs as described at Documentation/networking/sfp-phylink.rst. All calls to Phy APIs are replaced with their equivalent Phylink APIs. No functional change intended. Use Phylink instead of conventional Phylib, in preparation to add support for SGMII/QSGMII modes. Signed-off-by: Siddharth Vadapalli Signed-off-by: David S. Miller drivers/net/ethernet/ti/am65-cpsw-ethtool.c | 56 ++----- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 228 ++++++++++++++-------------- drivers/net/ethernet/ti/am65-cpsw-nuss.h | 5 +- 3 files changed, 129 insertions(+), 160 deletions(-) commit 7d352ccf1e9935b5222ca84e8baeb07a0c8f94b9 Author: Youghandhar Chintala Date: Tue Mar 8 17:23:24 2022 +0530 mac80211: Add support to trigger sta disconnect on hardware restart Currently in case of target hardware restart, we just reconfig and re-enable the security keys and enable the network queues to start data traffic back from where it was interrupted. Many ath10k wifi chipsets have sequence numbers for the data packets assigned by firmware and the mac sequence number will restart from zero after target hardware restart leading to mismatch in the sequence number expected by the remote peer vs the sequence number of the frame sent by the target firmware. This mismatch in sequence number will cause out-of-order packets on the remote peer and all the frames sent by the device are dropped until we reach the sequence number which was sent before we restarted the target hardware In order to fix this, we trigger a sta disconnect, in case of target hw restart. After this there will be a fresh connection and thereby avoiding the dropping of frames by remote peer. The right fix would be to pull the entire data path into the host which is not feasible or would need lots of complex changes and will still be inefficient. Tested on ath10k using WCN3990, QCA6174 Signed-off-by: Youghandhar Chintala Link: https://lore.kernel.org/r/20220308115325.5246-2-youghand@codeaurora.org Signed-off-by: Johannes Berg include/net/mac80211.h | 10 ++++++++++ net/mac80211/ieee80211_i.h | 3 +++ net/mac80211/mlme.c | 12 ++++++++++++ net/mac80211/util.c | 33 ++++++++++++++++++++++++++++++--- 4 files changed, 55 insertions(+), 3 deletions(-) commit 3af722cb735d212554027ec81e2aa2e6bf1ee34d Author: Christophe Leroy Date: Tue Mar 8 17:12:10 2022 +0100 powerpc/net: Implement powerpc specific csum_shift() to remove branch Today's implementation of csum_shift() leads to branching based on parity of 'offset' 000002f8 : 2f8: 70 a5 00 01 andi. r5,r5,1 2fc: 41 a2 00 08 beq 304 300: 54 84 c0 3e rotlwi r4,r4,24 304: 7c 63 20 14 addc r3,r3,r4 308: 7c 63 01 94 addze r3,r3 30c: 4e 80 00 20 blr Use first bit of 'offset' directly as input of the rotation instead of branching. 000002f8 : 2f8: 54 a5 1f 38 rlwinm r5,r5,3,28,28 2fc: 20 a5 00 20 subfic r5,r5,32 300: 5c 84 28 3e rotlw r4,r4,r5 304: 7c 63 20 14 addc r3,r3,r4 308: 7c 63 01 94 addze r3,r3 30c: 4e 80 00 20 blr And change to left shift instead of right shift to skip one more instruction. This has no impact on the final sum. 000002f8 : 2f8: 54 a5 1f 38 rlwinm r5,r5,3,28,28 2fc: 5c 84 28 3e rotlw r4,r4,r5 300: 7c 63 20 14 addc r3,r3,r4 304: 7c 63 01 94 addze r3,r3 308: 4e 80 00 20 blr Seems like only powerpc benefits from a branchless implementation. Other main architectures like ARM or X86 get better code with the generic implementation and its branch. Signed-off-by: Christophe Leroy Signed-off-by: David S. Miller arch/powerpc/include/asm/checksum.h | 7 +++++++ include/net/checksum.h | 2 ++ 2 files changed, 9 insertions(+) commit c46c2c9b43f4f08f20dc06417fbf7091e4ca6d34 Author: Russell King (Oracle) Date: Wed Mar 9 12:06:02 2022 +0000 ARM: unwind: set frame.pc correctly for current-thread unwinding When e.g. a WARN_ON() is encountered, we attempt to unwind the current thread. To do this, we set frame.pc to unwind_backtrace, which means it points at the beginning of the function. However, the rest of the state is initialised from within the function, which means the function prologue has already been run. This can be confusing, and with a recent patch from Ard, can result in the unwinder misbehaving if we want to be strict about the PC value. If we correctly initialise the state so it is self-consistent (in other words, set frame.pc to the location we are initialising it) then we eliminate this confusion, and avoid possible future issues. Reviewed-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) arch/arm/kernel/return_address.c | 3 ++- arch/arm/kernel/stacktrace.c | 3 ++- arch/arm/kernel/unwind.c | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) commit 8ef1dc4d204a5329eeeaf6edd9b62f6f2a64ebef Merge: 63f13b2e8796 970adfb76095 Author: David S. Miller Date: Fri Mar 11 10:53:32 2022 +0000 Merge tag 'mlx5-updates-2022-03-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2022-03-10 1) Leon removes useless includes from both mlx5 and mlx4 2) Tariq adds node awareness to some object allocations 3) Gal Cleanups and improvements to EEPROM query 4) Paul adds Software steering to Connection Tracking, to speed up CT Rules insertion. Paul Blakey Says: ================= To improve insertion rate, this series allows for using software steering API directly instead of going through the fs_core layer. This can be done for CT because it doesn't need fs_core layer extra facilities, such as autogroups, FTE IDs and modifications (which require a copy of the flow key/mask). Skipping fs_core layer also allows to create the software steering objects (dr_* objects) ahead of time and re-use them for multiple rules, whereas software steering under fs_core creates them on the fly and discards them. This in turn increased insertion rate. The series first introduces a lightweight CT flow steering provider with the first implementations using fs_core layer, and moves CT to use it. The next patches implement a provider using software steering directly, bypassing fs_core, and uses it if software steering is available. ================= ==================== Signed-off-by: David S. Miller commit 4a2d4496e15ea5bb5c8e83b94ca8ca7fb045e7d3 Author: Linus Lüssing Date: Thu Mar 10 19:35:13 2022 +0100 mac80211: fix potential double free on mesh join While commit 6a01afcf8468 ("mac80211: mesh: Free ie data when leaving mesh") fixed a memory leak on mesh leave / teardown it introduced a potential memory corruption caused by a double free when rejoining the mesh: ieee80211_leave_mesh() -> kfree(sdata->u.mesh.ie); ... ieee80211_join_mesh() -> copy_mesh_setup() -> old_ie = ifmsh->ie; -> kfree(old_ie); This double free / kernel panics can be reproduced by using wpa_supplicant with an encrypted mesh (if set up without encryption via "iw" then ifmsh->ie is always NULL, which avoids this issue). And then calling: $ iw dev mesh0 mesh leave $ iw dev mesh0 mesh join my-mesh Note that typically these commands are not used / working when using wpa_supplicant. And it seems that wpa_supplicant or wpa_cli are going through a NETDEV_DOWN/NETDEV_UP cycle between a mesh leave and mesh join where the NETDEV_UP resets the mesh.ie to NULL via a memcpy of default_mesh_setup in cfg80211_netdev_notifier_call, which then avoids the memory corruption, too. The issue was first observed in an application which was not using wpa_supplicant but "Senf" instead, which implements its own calls to nl80211. Fixing the issue by removing the kfree()'ing of the mesh IE in the mesh join function and leaving it solely up to the mesh leave to free the mesh IE. Cc: stable@vger.kernel.org Fixes: 6a01afcf8468 ("mac80211: mesh: Free ie data when leaving mesh") Reported-by: Matthias Kretschmer Signed-off-by: Linus Lüssing Tested-by: Mathias Kretschmer Link: https://lore.kernel.org/r/20220310183513.28589-1-linus.luessing@c0d3.blue Signed-off-by: Johannes Berg net/mac80211/cfg.c | 3 --- 1 file changed, 3 deletions(-) commit 022143d0c52b6e63d49ffc3542dc9d3ae15a5178 Author: MeiChia Chiu Date: Tue Mar 8 10:16:45 2022 +0800 mac80211: correct legacy rates check in ieee80211_calc_rx_airtime There are no legacy rates on 60GHz or sub-1GHz band, so modify the check. Signed-off-by: Ryder Lee Signed-off-by: MeiChia Chiu Link: https://lore.kernel.org/r/20220308021645.16272-1-MeiChia.Chiu@mediatek.com [Ghz -> GHz] Signed-off-by: Johannes Berg net/mac80211/airtime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 2916b7a9c7c25ecf9be2f37e567a277e861f8e3f Author: Veerendranath Jakkam Date: Tue Feb 22 20:36:39 2022 +0530 nl80211: fix typo of NL80211_IF_TYPE_OCB in documentation It should be NL80211_IFTYPE_OCB instead. Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/1645542399-4680-1-git-send-email-quic_vjakkam@quicinc.com Signed-off-by: Johannes Berg include/uapi/linux/nl80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 60df54f8e6bb2c375a9d21f16c9d3983206709e7 Author: Christophe JAILLET Date: Sun Feb 20 09:23:15 2022 +0100 mac80211: Use GFP_KERNEL instead of GFP_ATOMIC when possible Previous memory allocations in this function already use GFP_KERNEL, so use __dev_alloc_skb() and an explicit GFP_KERNEL instead of an implicit GFP_ATOMIC. This gives more opportunities of successful allocation. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/194a0e2ff00c3fae88cc9fba47431747360c8242.1645345378.git.christophe.jaillet@wanadoo.fr Signed-off-by: Johannes Berg net/mac80211/mesh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3856f1b31f6c83b5a7c51b9334be29d1924216eb Author: Yihao Han Date: Thu Feb 17 23:02:28 2022 -0800 mac80211: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE Fix the following coccicheck warning: ./drivers/net/wireless/mac80211_hwsim.c:1040:0-23: WARNING: hwsim_fops_rx_rssi should be defined with DEFINE_DEBUGFS_ATTRIBUTE Signed-off-by: Yihao Han Link: https://lore.kernel.org/r/20220218070228.6210-1-hanyihao@vivo.com [fix indentation] Signed-off-by: Johannes Berg drivers/net/wireless/mac80211_hwsim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit b95044b38425f563404234d96bbb20cc6360c7e1 Author: Jie Hai Date: Wed Feb 16 15:21:01 2022 +0800 dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma Remove the loaded hisi_dma driver and reload it, the driver fails to work properly. The following error is reported in the kernel log: [ 1475.597609] hisi_dma 0000:7b:00.0: Failed to allocate MSI vectors! [ 1475.604915] hisi_dma: probe of 0000:7b:00.0 failed with error -28 As noted in "The MSI Driver Guide HOWTO"[1], the number of MSI interrupt must be a power of two. The Kunpeng DMA driver allocates 30 MSI interrupts. As a result, no space left on device is reported when the driver is reloaded and allocates interrupt vectors from the interrupt domain. This patch changes the number of interrupt vectors allocated by hisi_dma driver to 32 to avoid this problem. [1] https://www.kernel.org/doc/html/latest/PCI/msi-howto.html Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine support") Signed-off-by: Jie Hai Acked-by: Zhou Wang Link: https://lore.kernel.org/r/20220216072101.34473-1-haijie1@huawei.com Signed-off-by: Vinod Koul drivers/dma/hisi_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e7c7a0161bdbf0e0977f388352f059974afb643d Author: Tom Rix Date: Tue Mar 8 18:00:56 2022 -0800 dmaengine: dw-axi-dmac: cleanup comments For spdx, /* */ for *.h, remove extra space Replacements configurarion to configuration inerrupts to interrupts chanels to channels Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220309020056.1026106-1-trix@redhat.com Signed-off-by: Vinod Koul drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 8 ++++---- drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) commit a0754cf3b3bfb0cb6ae30bd59e2dd0095fdbda72 Author: Geert Uytterhoeven Date: Thu Mar 3 13:47:15 2022 +0100 dmaengine: fsl-dpaa2-qdma: Drop comma after SoC match table sentinel It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Add a comment to clarify the purpose of the empty element. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/0b8ad4dcc185aa7a17655983e0eb5690d8fed460.1646311558.git.geert+renesas@glider.be Signed-off-by: Vinod Koul drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9c391cebedf59a13d2fb3176bc010edbffb317af Author: AngeloGioacchino Del Regno Date: Thu Feb 17 10:52:42 2022 +0100 dt-bindings: dma: Convert mtk-uart-apdma to DT schema Convert the MediaTek UART APDMA Controller binding to DT schema. Signed-off-by: AngeloGioacchino Del Regno Acked-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220217095242.13761-1-angelogioacchino.delregno@collabora.com Signed-off-by: Vinod Koul .../devicetree/bindings/dma/mediatek,uart-dma.yaml | 122 +++++++++++++++++++++ .../devicetree/bindings/dma/mtk-uart-apdma.txt | 56 ---------- 2 files changed, 122 insertions(+), 56 deletions(-) commit 417c7d0dba8b69a42cec800244eb5ac87129353d Author: Cai Huoqing Date: Wed Feb 9 11:22:19 2022 +0800 dmaengine: ppc4xx: Make use of the helper macro LIST_HEAD() Replace "struct list_head head = LIST_HEAD_INIT(head)" with "LIST_HEAD(head)" to simplify the code. Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20220209032221.37211-1-cai.huoqing@linux.dev Signed-off-by: Vinod Koul drivers/dma/ppc4xx/adma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 286f950545e0d9c8aa802cbfc9676860bbc49179 Author: Anshuman Khandual Date: Wed Feb 16 15:21:58 2022 +0530 coresight: Drop unused 'none' enum value for each component CORESIGHT_DEV_TYPE_NONE/CORESIGHT_DEV_SUBTYPE_XXXX_NONE values are not used any where. Actual enumeration can start from 0. Just drop these unused enum values. Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Mike Leach Cc: Leo Yan Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1645005118-10561-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose drivers/hwtracing/coresight/coresight-core.c | 3 --- include/linux/coresight.h | 5 ----- 2 files changed, 8 deletions(-) commit ec70b05d5da9ac753868e55607298b0699a7ad27 Author: Leo Yan Date: Fri Feb 4 23:24:03 2022 +0800 coresight: etm3x: Don't trace PID for non-root PID namespace ETMv3 driver enables PID tracing by directly using perf config from userspace, this means the tracer will capture PID packets from root namespace but the profiling session runs in non-root PID namespace. Finally, the recorded packets can mislead perf reporting with the mismatched PID values. This patch changes to only enable PID tracing for root PID namespace. Note, the hardware supports VMID tracing from ETMv3.5, but the driver never enables VMID trace, this patch doesn't handle VMID trace (bit 30 in ETMCR register) particularly. Signed-off-by: Leo Yan Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20220204152403.71775-5-leo.yan@linaro.org drivers/hwtracing/coresight/coresight-etm3x-core.c | 4 ++++ 1 file changed, 4 insertions(+) commit aab473867fed4a0b29f9456286d8f680be0ab314 Author: Leo Yan Date: Fri Feb 4 23:24:02 2022 +0800 coresight: etm4x: Don't trace PID for non-root PID namespace When runs in perf mode, the driver always enables the PID tracing. This can lead confusion when the profiling session runs in non-root PID namespace, whereas it records the PIDs from the root PID namespace. To avoid confusion for PID tracing, when runs in perf mode, this patch changes to only enable PID tracing for root PID namespace. As result, after apply this patch, the perf tool reports PID as '-1' for all samples: # unshare --fork --pid perf record -e cs_etm// -m 64K,64K -a \ -o perf_test.data -- uname # perf report -i perf_test.data --itrace=Zi1000i --stdio # Total Lost Samples: 0 # # Samples: 94 of event 'instructions' # Event count (approx.): 94000 # # Overhead Command Shared Object Symbol # ........ ....... ................. .............................. # 68.09% :-1 [kernel.kallsyms] [k] __sched_text_end 3.19% :-1 [kernel.kallsyms] [k] hrtimer_interrupt 2.13% :-1 [kernel.kallsyms] [k] __bitmap_and 2.13% :-1 [kernel.kallsyms] [k] trace_vbprintk 1.06% :-1 [kernel.kallsyms] [k] __fget_files 1.06% :-1 [kernel.kallsyms] [k] __schedule 1.06% :-1 [kernel.kallsyms] [k] __softirqentry_text_start 1.06% :-1 [kernel.kallsyms] [k] __update_load_avg_cfs_rq 1.06% :-1 [kernel.kallsyms] [k] __update_load_avg_se 1.06% :-1 [kernel.kallsyms] [k] arch_counter_get_cntpct 1.06% :-1 [kernel.kallsyms] [k] check_and_switch_context 1.06% :-1 [kernel.kallsyms] [k] format_decode 1.06% :-1 [kernel.kallsyms] [k] handle_percpu_devid_irq 1.06% :-1 [kernel.kallsyms] [k] irq_enter_rcu 1.06% :-1 [kernel.kallsyms] [k] irqtime_account_irq 1.06% :-1 [kernel.kallsyms] [k] ktime_get 1.06% :-1 [kernel.kallsyms] [k] ktime_get_coarse_real_ts64 1.06% :-1 [kernel.kallsyms] [k] memmove 1.06% :-1 [kernel.kallsyms] [k] perf_ioctl 1.06% :-1 [kernel.kallsyms] [k] perf_output_begin 1.06% :-1 [kernel.kallsyms] [k] perf_output_copy 1.06% :-1 [kernel.kallsyms] [k] profile_tick 1.06% :-1 [kernel.kallsyms] [k] sched_clock 1.06% :-1 [kernel.kallsyms] [k] timerqueue_add 1.06% :-1 [kernel.kallsyms] [k] trace_save_cmdline 1.06% :-1 [kernel.kallsyms] [k] update_load_avg 1.06% :-1 [kernel.kallsyms] [k] vbin_printf Signed-off-by: Leo Yan Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20220204152403.71775-4-leo.yan@linaro.org drivers/hwtracing/coresight/coresight-etm4x-core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 1314dd1971309a84b594cfb6269260e9e9c2c31a Author: Leo Yan Date: Fri Feb 4 23:24:01 2022 +0800 coresight: etm4x: Don't use virtual contextID for non-root PID namespace As commented in the function ctxid_pid_store(), it can cause the PID values mismatching between context ID tracing and PID allocated in a non-root namespace. For this reason, when a process runs in non-root PID namespace, the driver doesn't allow PID tracing and returns failure when access contextID related sysfs nodes. VMID works for virtual contextID when the kernel runs in EL2 mode with VHE; on the other hand, the driver doesn't prevent users from accessing it when programs run in the non-root namespace. Thus this can lead to same issues with contextID described above. This patch imposes the checking on VMID related sysfs knobs and returns failure if current process runs in non-root PID namespace. Signed-off-by: Leo Yan Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20220204152403.71775-3-leo.yan@linaro.org .../hwtracing/coresight/coresight-etm4x-sysfs.c | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) commit bf0ef4f12c6303879c04e05ce43ea37ac56ebfa6 Author: Leo Yan Date: Fri Feb 4 23:24:00 2022 +0800 coresight: etm4x: Add lock for reading virtual context ID comparator Updates to the values and the index are protected via the spinlock. Ensure we use the same lock to read the value safely. Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose Signed-off-by: Suzuki K Poulose Link: https://lore.kernel.org/r/20220204152403.71775-2-leo.yan@linaro.org drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 2 ++ 1 file changed, 2 insertions(+) commit ef1dacf4b3e23dae57d741bb592a3393428c5a7d Author: Sudeep Holla Date: Thu Feb 3 19:01:59 2022 +0000 coresight: trbe: Move check for kernel page table isolation from EL0 to probe Currently with the check present in the module initialisation, it shouts on all the systems irrespective of presence of coresight trace buffer extensions. Similar to Arm SPE perf driver, move the check for kernel page table isolation from EL0 to the device probe stage instead of the module initialisation so that it complains only on the systems that support TRBE. Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Mike Leach Cc: Leo Yan Cc: Anshuman Khandual Cc: coresight@lists.linaro.org Signed-off-by: Sudeep Holla Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20220203190159.3145272-1-sudeep.holla@arm.com Signed-off-by: Suzuki K Poulose drivers/hwtracing/coresight/coresight-trbe.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit d05bbad0130ff86b802e5cd6acbb6cac23b841b8 Author: James Clark Date: Thu Feb 3 11:53:35 2022 +0000 coresight: no-op refactor to make INSTP0 check more idiomatic The spec says this: P0 tracing support field. The permitted values are: 0b00 Tracing of load and store instructions as P0 elements is not supported. 0b11 Tracing of load and store instructions as P0 elements is supported, so TRCCONFIGR.INSTP0 is supported. All other values are reserved. The value we are looking for is 0b11 so simplify this. The double read and && was a bit obfuscated. Suggested-by: Suzuki Poulose Signed-off-by: James Clark Link: https://lore.kernel.org/r/20220203115336.119735-2-james.clark@arm.com Signed-off-by: Suzuki K Poulose drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 27caf7e473ef4b9d94a4a7d00e27ce6b24ad1b28 Author: Rafael J. Wysocki Date: Tue Feb 1 18:58:09 2022 +0100 hwtracing: coresight: Replace acpi_bus_get_device() Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/5790600.lOV4Wx5bFT@kreacher Signed-off-by: Suzuki K Poulose drivers/hwtracing/coresight/coresight-platform.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit cfa5dbcdd7aece76f3415284569f2f384aff0253 Author: Miaoqian Lin Date: Mon Jan 24 12:41:21 2022 +0000 coresight: syscfg: Fix memleak on registration failure in cscfg_create_device device_register() calls device_initialize(), according to doc of device_initialize: Use put_device() to give up your reference instead of freeing * @dev directly once you have called this function. To prevent potential memleak, use put_device() for error handling. Signed-off-by: Miaoqian Lin Fixes: 85e2414c518a ("coresight: syscfg: Initial coresight system configuration") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220124124121.8888-1-linmq006@gmail.com Signed-off-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose drivers/hwtracing/coresight/coresight-syscfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ea75a342aed5ed72c87f38fbe0df2f5df7eae374 Author: James Clark Date: Thu Jan 20 11:30:47 2022 +0000 coresight: Fix TRCCONFIGR.QE sysfs interface It's impossible to program a valid value for TRCCONFIGR.QE when TRCIDR0.QSUPP==0b10. In that case the following is true: Q element support is implemented, and only supports Q elements without instruction counts. TRCCONFIGR.QE can only take the values 0b00 or 0b11. Currently the low bit of QSUPP is checked to see if the low bit of QE can be written to, but as you can see when QSUPP==0b10 the low bit is cleared making it impossible to ever write the only valid value of 0b11 to QE. 0b10 would be written instead, which is a reserved QE value even for all values of QSUPP. The fix is to allow writing the low bit of QE for any non zero value of QSUPP. This change also ensures that the low bit is always set, even when the user attempts to only set the high bit. Signed-off-by: James Clark Reviewed-by: Mike Leach Fixes: d8c66962084f ("coresight-etm4x: Controls pertaining to the reset, mode, pe and events") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220120113047.2839622-2-james.clark@arm.com Signed-off-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 3a828845ae35626c2c8de4c46f5c602c25bd122d Author: Anshuman Khandual Date: Tue Jan 25 19:50:37 2022 +0530 coresight: trbe: Work around the trace data corruption TRBE implementations affected by Arm erratum #1902691 might corrupt trace data or deadlock, when it's being written into the memory. Workaround this problem in the driver, by preventing TRBE initialization on affected cpus. The firmware must have disabled the access to TRBE for the kernel on such implementations. This will cover the kernel for any firmware that doesn't do this already. This just updates the TRBE driver as required. Cc: Catalin Marinas Cc: Will Deacon Cc: Mathieu Poirier Cc: Suzuki Poulose Cc: coresight@lists.linaro.org Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1643120437-14352-8-git-send-email-anshuman.khandual@arm.com Signed-off-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose arch/arm64/Kconfig | 2 +- drivers/hwtracing/coresight/coresight-trbe.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) commit f209e9fe5bd7614b30b050f2095e80b77b99c333 Author: Anshuman Khandual Date: Tue Jan 25 19:50:36 2022 +0530 coresight: trbe: Work around the invalid prohibited states TRBE implementations affected by Arm erratum #2038923 might get TRBE into an inconsistent view on whether trace is prohibited within the CPU. As a result, the trace buffer or trace buffer state might be corrupted. This happens after TRBE buffer has been enabled by setting TRBLIMITR_EL1.E, followed by just a single context synchronization event before execution changes from a context, in which trace is prohibited to one where it isn't, or vice versa. In these mentioned conditions, the view of whether trace is prohibited is inconsistent between parts of the CPU, and the trace buffer or the trace buffer state might be corrupted. Work around this problem in the TRBE driver by preventing an inconsistent view of whether the trace is prohibited or not based on TRBLIMITR_EL1.E by immediately following a change to TRBLIMITR_EL1.E with at least one ISB instruction before an ERET, or two ISB instructions if no ERET is to take place. This just updates the TRBE driver as required. Cc: Catalin Marinas Cc: Will Deacon Cc: Mathieu Poirier Cc: Suzuki Poulose Cc: coresight@lists.linaro.org Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1643120437-14352-7-git-send-email-anshuman.khandual@arm.com Signed-off-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose arch/arm64/Kconfig | 2 +- drivers/hwtracing/coresight/coresight-trbe.c | 48 +++++++++++++++++++++------- 2 files changed, 37 insertions(+), 13 deletions(-) commit ac0ba2100298a3e85d9a92924a959b80612144e6 Author: Anshuman Khandual Date: Tue Jan 25 19:50:35 2022 +0530 coresight: trbe: Work around the ignored system register writes TRBE implementations affected by Arm erratum #2064142 might fail to write into certain system registers after the TRBE has been disabled. Under some conditions after TRBE has been disabled, writes into certain TRBE registers TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1 and TRBTRG_EL1 will be ignored and not be effected. Work around this problem in the TRBE driver by executing TSB CSYNC and DSB just after the trace collection has stopped and before performing a system register write to one of the affected registers. This just updates the TRBE driver as required. Cc: Catalin Marinas Cc: Will Deacon Cc: Mathieu Poirier Cc: Suzuki Poulose Cc: coresight@lists.linaro.org Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Suzuki K Poulose Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1643120437-14352-6-git-send-email-anshuman.khandual@arm.com Signed-off-by: Mathieu Poirier Signed-off-by: Suzuki K Poulose arch/arm64/Kconfig | 2 +- drivers/hwtracing/coresight/coresight-trbe.c | 54 +++++++++++++++++++--------- drivers/hwtracing/coresight/coresight-trbe.h | 8 ----- 3 files changed, 39 insertions(+), 25 deletions(-) commit 2ef363660d7276318de5f6699bdcaf4e4979c792 Merge: 634f0f26cb9b ef82c9be844f Author: Arnd Bergmann Date: Fri Mar 11 11:02:37 2022 +0100 Merge tag 'socfpga_dts_update_for_v5.18_part2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/dt SoCFPGA dts updates for v5.18, part 2 - More dt-bindings cleanup, this time, USB DWC2 properties - Add SDR EDAC dts entry for the N5X platform * tag 'socfpga_dts_update_for_v5.18_part2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: arm64: dts: n5x: add sdr edac support arm64: dts: agilex/stratix10: add clock-names to USB DWC2 node dt-bindings: usb: dwc2: add disable-over-current dt-bindings: usb: dwc2: add iommus dt-bindings: usb: dwc2: fix compatible of Intel Agilex Link: https://lore.kernel.org/r/20220310195740.151250-1-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit 47c561af900ab593b911ff1caf642a5bc64893d4 Merge: 42cc353b54fd a461cac0c4b4 Author: Arnd Bergmann Date: Fri Mar 11 11:01:10 2022 +0100 Merge tag 'arm64_defconfig_for_v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/defconfig ARM64 defconfig for v5.18 - Enable the Altera FPGA Manager CVP driver * tag 'arm64_defconfig_for_v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: arm64: defconfig: enable the CVP driver Link: https://lore.kernel.org/r/20220310195740.151250-2-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit 82017457957a550d7d00dde419435dd74a890887 Author: Glenn Washburn Date: Thu Mar 3 01:53:33 2022 -0600 um: run_helper: Write error message to kernel log on exec failure on host The best place to log errors from the host side is in the kernel log within the UML guest. Letting the user now that exec() failed and why is very helpful when the user is trying to determine why some aspect of UML is not working. For instance, when telneting into the UML instance, if the connection is established and then immediately dropped, this may be due to exec() failing because in.telnetd is not found. Signed-off-by: Glenn Washburn Signed-off-by: Richard Weinberger arch/um/os-Linux/helper.c | 5 +++++ 1 file changed, 5 insertions(+) commit 3cb5a7f167c620a8b0e38b0446df2e024d2243dc Author: Glenn Washburn Date: Thu Mar 3 01:53:32 2022 -0600 um: port_user: Improve error handling when port-helper is not found Check if port-helper exists and is executable. If not, write an error message to the kernel log with information to help the user diagnose the issue and exit with an error. If UML_PORT_HELPER was not set, write a message suggesting that the user set it. This makes it easier to understand why telneting to the UML instance is failing and what can be done to fix it. Signed-off-by: Glenn Washburn Signed-off-by: Richard Weinberger arch/um/drivers/port_user.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit db8109a8bb4a4b31e7f630d7667749d62ee4a087 Author: Glenn Washburn Date: Thu Mar 3 01:53:31 2022 -0600 um: port_user: Allow setting path to port-helper using UML_PORT_HELPER envvar This is useful when the uml-utilities user-space package has not been installed by the administrator and an unprivileged user wants to be able to telnet into a UML instance. The user can install the port-helper binary to a writable path and set UML_PORT_HELPER. Fallback to using hardcoded path to port-helper if environment variable is not set. Signed-off-by: Glenn Washburn Signed-off-by: Richard Weinberger arch/um/drivers/port_user.c | 4 ++++ 1 file changed, 4 insertions(+) commit 6e8f4b70127fa852020718e636b3ea53f6e17d88 Author: Glenn Washburn Date: Thu Mar 3 01:53:30 2022 -0600 um: port_user: Search for in.telnetd in PATH This allows in.telnetd to be run from non-standard installation locations and is especially useful when running a UML instance as an unprivileged user on a system where the administrator has not installed the in.telnetd binary. Signed-off-by: Glenn Washburn Signed-off-by: Richard Weinberger arch/um/drivers/port_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b6f2f0352c0302076dcd0e0297592ea7d37f2242 Author: Christophe JAILLET Date: Sat Jan 15 08:24:20 2022 +0100 dmaengine: idxd: 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://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t Signed-off-by: Christophe JAILLET Acked-by: Dave Jiang Link: https://lore.kernel.org/r/009c80294dba72858cd8a6ed2ed81041df1b1e82.1642231430.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul drivers/dma/idxd/init.c | 2 -- 1 file changed, 2 deletions(-) commit 8f7cc6373bbbc770e949df6dd6127e52340aafa1 Author: Christophe JAILLET Date: Sat Jan 15 08:35:20 2022 +0100 dmaengine: qcom_hidma: 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://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/4deb32b0c7838da66608022c584326eb01d0da03.1642232106.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul drivers/dma/qcom/hidma.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 6580c5c18fb3df2b11c5e0452372f815deeff895 Author: David Gow Date: Thu Mar 3 17:06:42 2022 +0800 um: clang: Strip out -mno-global-merge from USER_CFLAGS The things built with USER_CFLAGS don't seem to recognise it as a compiler option, and print a warning: clang: warning: argument unused during compilation: '-mno-global-merge' [-Wunused-command-line-argument] Fixes: 744814d2fa ("um: Allow builds with Clang") Signed-off-by: David Gow Reviewed-by: Nathan Chancellor Signed-off-by: Richard Weinberger arch/um/Makefile | 4 ++++ 1 file changed, 4 insertions(+) commit 4ef5a0b2e1b806203831b0a7a044539f6627116a Author: Vincent Whitchurch Date: Thu Mar 10 13:42:30 2022 +0100 docs: UML: Mention telnetd for port channel It is not obvious from the documentation that using the "port" channel for the console requires telnetd to be installed (see port_connection() in arch/um/drivers/port_user.c). Mention this, and the fact that UML will not boot until a client connects. Signed-off-by: Vincent Whitchurch Acked-by: Anton Ivanov Signed-off-by: Richard Weinberger Documentation/virt/uml/user_mode_linux_howto_v2.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 0e6d630cef8b72de6f4573c894b479bdf091c1e5 Author: David Gow Date: Thu Feb 24 16:12:33 2022 +0800 um: Remove unused timeval_to_ns() function The timeval_to_ns() function doesn't appear to be used anywhere, as far as I (or git grep) can tell, and clang throws up a warning about it: ../arch/um/os-Linux/time.c:21:25: warning: unused function 'timeval_to_ns' [-Wunused-function] static inline long long timeval_to_ns(const struct timeval *tv) ^ 1 warning generated. Signed-off-by: David Gow Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger arch/um/os-Linux/time.c | 6 ------ 1 file changed, 6 deletions(-) commit 1a3a6a2a035bb6c3a7ef4c788d8fd69a7b2d6284 Author: Anton Ivanov Date: Tue Feb 22 12:44:10 2022 +0000 um: Fix uml_mconsole stop/go Moving to an EPOLL based IRQ controller broke uml_mconsole stop/go commands. This fixes it and restores stop/go functionality. Fixes: ff6a17989c08 ("Epoll based IRQ controller") Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger arch/um/drivers/mconsole_kern.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit f4f03f299a56ce4d73c5431e0327b3b6cb55ebb9 Author: David Gow Date: Thu Feb 10 11:43:53 2022 +0800 um: Cleanup syscall_handler_t definition/cast, fix warning The syscall_handler_t type for x86_64 was defined as 'long (*)(void)', but always cast to 'long (*)(long, long, long, long, long, long)' before use. This now triggers a warning (see below). Define syscall_handler_t as the latter instead, and remove the cast. This simplifies the code, and fixes the warning. Warning: In file included from ../arch/um/include/asm/processor-generic.h:13 from ../arch/x86/um/asm/processor.h:41 from ../include/linux/rcupdate.h:30 from ../include/linux/rculist.h:11 from ../include/linux/pid.h:5 from ../include/linux/sched.h:14 from ../include/linux/ptrace.h:6 from ../arch/um/kernel/skas/syscall.c:7: ../arch/um/kernel/skas/syscall.c: In function ‘handle_syscall’: ../arch/x86/um/shared/sysdep/syscalls_64.h:18:11: warning: cast between incompatible function types from ‘long int (*)(void)’ to ‘long int (*)(long int, long int, long int, long int, long int, long int)’ [ -Wcast-function-type] 18 | (((long (*)(long, long, long, long, long, long)) \ | ^ ../arch/x86/um/asm/ptrace.h:36:62: note: in definition of macro ‘PT_REGS_SET_SYSCALL_RETURN’ 36 | #define PT_REGS_SET_SYSCALL_RETURN(r, res) (PT_REGS_AX(r) = (res)) | ^~~ ../arch/um/kernel/skas/syscall.c:46:33: note: in expansion of macro ‘EXECUTE_SYSCALL’ 46 | EXECUTE_SYSCALL(syscall, regs)); | ^~~~~~~~~~~~~~~ Signed-off-by: David Gow Signed-off-by: Richard Weinberger arch/x86/um/shared/sysdep/syscalls_64.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit b5fa1d09f10f2b30603bf2578ef781d2a507be17 Author: Johannes Berg Date: Mon Jan 31 15:35:27 2022 +0100 uml: net: vector: fix const issue Since the constification of MAC addresses, the argument to uml_vector_default_bpf() must be const. Signed-off-by: Johannes Berg Acked-By: anton ivanov Signed-off-by: Richard Weinberger arch/um/drivers/vector_user.c | 2 +- arch/um/drivers/vector_user.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit d2a0a616ab2246aab9527eeacf86a033679c8b22 Author: Frédéric Danis Date: Tue Jan 25 18:14:05 2022 +0100 um: Fix WRITE_ZEROES in the UBD Driver Call to fallocate with FALLOC_FL_PUNCH_HOLE on a device backed by a sparse file can end up by missing data, zeroes data range, if the underlying file is used with a tool like bmaptool which will referenced only used spaces. Signed-off-by: Frédéric Danis Acked-by: Anton Ivanov Signed-off-by: Richard Weinberger arch/um/drivers/ubd_kern.c | 8 +++++++- arch/um/include/shared/os.h | 1 + arch/um/os-Linux/file.c | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) commit b35507a4cfb26b7fcc0c97de6367828d5902bbba Author: Anton Ivanov Date: Fri Jan 21 11:11:49 2022 +0000 um: Migrate vector drivers to NAPI Migrate UML vector drivers from a bespoke scheduling mechanism to NAPI. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger arch/um/drivers/vector_kern.c | 105 ++++++++++++++++++++---------------------- arch/um/drivers/vector_kern.h | 3 +- 2 files changed, 51 insertions(+), 57 deletions(-) commit 39508aab4a66473b4ba7cce0dbe919f2fec7450a Author: Vincent Whitchurch Date: Wed Jan 19 10:29:34 2022 +0100 um: Fix order of dtb unflatten/early init Scan the tree for reserved memory before unflattening it. As Rob Herring said: | These should be reversed. early_init_fdt_scan_reserved_mem() works on | the flat tree. Reserved memory needs to be reserved before | unflatten_device_tree() starts allocating memory. Though I imagine that | doesn't really matter for UML. Suggested-by: Rob Herring Link: https://lore.kernel.org/lkml/YeF%2FVbxo6fAt0WLp@robh.at.kernel.org/ Signed-off-by: Vincent Whitchurch Signed-off-by: Richard Weinberger arch/um/kernel/dtb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e3a33af812c611d99756e2ec61e9d7068d466bdf Author: Benjamin Beichler Date: Tue Jan 11 20:05:06 2022 +0000 um: fix and optimize xor select template for CONFIG64 and timetravel mode Due to dropped inclusion of asm-generic/xor.h, xor_block_8regs symbol is missing with CONFIG64 and break compilation, as the asm/xor_64.h also did not include it. The patch recreate the logic from arch/x86, which check whether AVX is available and add fallbacks for 32bit and 64bit config of um. A very minor additional "fix" is, the return of the macro parameter instead of NULL, as this is the original intent of the macro, but this does not change the actual behavior. Fixes: c0ecca6604b8 ("um: enable the use of optimized xor routines in UML") Signed-off-by: Benjamin Beichler Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger arch/um/include/asm/xor.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 6427c165275fe11634862149002c7867f25d02f6 Author: Anton Ivanov Date: Tue Jan 4 10:44:57 2022 +0000 um: Document dtb command line option Add documentation for the dtb command line option and the ability to load/parse device trees. Signed-off-by: Anton Ivanov Reviewed-by: Vincent Whitchurch Signed-off-by: Richard Weinberger Documentation/virt/uml/user_mode_linux_howto_v2.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) commit 2a6852cb8ff0c8c1363cac648d68489343813212 Author: Johannes Berg Date: Mon Jan 3 16:40:15 2022 +0100 lib/logic_iomem: correct fallback config references Due to some renaming, we ended up with the "indirect iomem" naming in Kconfig, following INDIRECT_PIO. However, clearly I missed following through on that in the ifdefs, but so far INDIRECT_IOMEM_FALLBACK isn't used by any architecture. Reported-by: Lukas Bulwahn Fixes: ca2e334232b6 ("lib: add iomem emulation (logic_iomem)") Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger lib/logic_iomem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 3bdd271bc8bef3e2b9ed72da529a6d0d9d0852b5 Author: Yang Li Date: Fri Dec 24 10:42:23 2021 +0800 um: Remove duplicated include in syscalls_64.c Fix following includecheck warning: ./arch/x86/um/syscalls_64.c: registers.h is included more than once. Reported-by: Abaci Robot Fixes: dbba7f704aa0 ("um: stop polluting the namespace with registers.h contents") Signed-off-by: Yang Li Signed-off-by: Richard Weinberger arch/x86/um/syscalls_64.c | 1 - 1 file changed, 1 deletion(-) commit 0d7e879d8fb96bbbe9f1295bab31662062cade9e Author: Richard Weinberger Date: Tue Jan 11 08:53:11 2022 +0100 MAINTAINERS: Update UserModeLinux entry Add Johannes and form a maintainer group with on a common git repository. While we are here, remove inactive developers. Jeff, thanks for your great work! Signed-off-by: Richard Weinberger MAINTAINERS | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 89ea5be11a5f386a821c15542f6c1531d0f064b9 Merge: c425060a406c 768d4435de2a Author: Marc Zyngier Date: Fri Mar 11 09:10:12 2022 +0000 Merge branch irq/aic-v2 into irq/irqchip-next * irq/aic-v2: : . : Add support for the interrupt controller found is the latest : incarnation of Apple M1 systems, courtesy of Hector Martin. : . irqchip/apple-aic: Add support for AICv2 irqchip/apple-aic: Support multiple dies irqchip/apple-aic: Dynamically compute register offsets irqchip/apple-aic: Switch to irq_domain_create_tree and sparse hwirqs irqchip/apple-aic: Add Fast IPI support dt-bindings: interrupt-controller: apple,aic2: New binding for AICv2 PCI: apple: Change MSI handling to handle 4-cell AIC fwspec form Signed-off-by: Marc Zyngier commit 768d4435de2a042f35069c68587d8e6702102248 Author: Hector Martin Date: Thu Mar 10 04:21:23 2022 +0900 irqchip/apple-aic: Add support for AICv2 Introduce support for the new AICv2 hardware block in t6000/t6001 SoCs. It seems these blocks are missing the information required to compute the event register offset in the capability registers, so we specify that in the DT as a second reg entry. Signed-off-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220309192123.152028-8-marcan@marcan.st drivers/irqchip/irq-apple-aic.c | 181 ++++++++++++++++++++++++++++++++-------- 1 file changed, 148 insertions(+), 33 deletions(-) commit a801f0ee563b8180caf186493806a145a75b4a3c Author: Hector Martin Date: Thu Mar 10 04:21:22 2022 +0900 irqchip/apple-aic: Support multiple dies Multi-die support in AICv2 uses several sets of IRQ registers. Introduce a die count and compute the register group offset based on the die ID field of the hwirq number, as reported by the hardware. Signed-off-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220309192123.152028-7-marcan@marcan.st drivers/irqchip/irq-apple-aic.c | 77 +++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 23 deletions(-) commit dc97fd6fec009957e81026055fc99a03877ff3b8 Author: Hector Martin Date: Thu Mar 10 04:21:21 2022 +0900 irqchip/apple-aic: Dynamically compute register offsets This allows us to support AIC variants with different numbers of IRQs based on capability registers. Signed-off-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220309192123.152028-6-marcan@marcan.st drivers/irqchip/irq-apple-aic.c | 72 +++++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 17 deletions(-) commit 7c841f5f6fa3f991cb76b96cd2378337a74011b3 Author: Hector Martin Date: Thu Mar 10 04:21:20 2022 +0900 irqchip/apple-aic: Switch to irq_domain_create_tree and sparse hwirqs This allows us to directly use the hardware event number as the hwirq number. Since IRQ events have bit 16 set (type=1), FIQs now move to starting at hwirq number 0. This will become more important once multi-die support is introduced in a later commit. Signed-off-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220309192123.152028-5-marcan@marcan.st drivers/irqchip/irq-apple-aic.c | 71 ++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 32 deletions(-) commit 2cf68211664acd2e4bdd1fb66697137b30901981 Author: Hector Martin Date: Thu Mar 10 04:21:19 2022 +0900 irqchip/apple-aic: Add Fast IPI support The newer AICv2 present in t600x SoCs does not have legacy IPI support at all. Since t8103 also supports Fast IPIs, implement support for this first. The legacy IPI code is left as a fallback, so it can be potentially used by older SoCs in the future. The vIPI code is shared; only the IPI firing/acking bits change for Fast IPIs. Signed-off-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220309192123.152028-4-marcan@marcan.st drivers/irqchip/irq-apple-aic.c | 122 +++++++++++++++++++++++++++++++++++----- 1 file changed, 109 insertions(+), 13 deletions(-) commit ab1fd5abb75001d37e1fef5f310951b56f41ad58 Author: Hector Martin Date: Thu Mar 10 04:21:18 2022 +0900 dt-bindings: interrupt-controller: apple,aic2: New binding for AICv2 This new incompatible revision of the AIC peripheral introduces multi-die support. This binding is based on apple,aic, but changes interrupt-cells to add a new die argument. Also adds a second reg entry to specify the offset of the event register. Inexplicably, the capability registers allow us to compute other register offsets, but not this one. This allows us to keep forward-compatibility with future SoCs that will likely implement different die counts, thus shifting the event register. Apple also specify the offset explicitly in their device tree... Reviewed-by: Rob Herring Signed-off-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220309192123.152028-3-marcan@marcan.st .../bindings/interrupt-controller/apple,aic2.yaml | 98 ++++++++++++++++++++++ MAINTAINERS | 2 +- 2 files changed, 99 insertions(+), 1 deletion(-) commit 970adfb76095fa719778d70a6b86030d2feb88dd Author: Gal Pressman Date: Wed Jan 26 16:28:23 2022 +0200 net/mlx5e: Remove overzealous validations in netlink EEPROM query Unlike the legacy EEPROM callbacks, when using the netlink EEPROM query (get_module_eeprom_by_page) the driver should not try to validate the query parameters, but just perform the read requested by the userspace. Recent discussion in the mailing list: https://lore.kernel.org/netdev/20220120093051.70845141@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net/ Signed-off-by: Gal Pressman Reviewed-by: Ido Schimmel Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/port.c | 23 ----------------------- 1 file changed, 23 deletions(-) commit fcb610a86c53dfcfbb2aa62e704481112752f367 Author: Gal Pressman Date: Mon Jan 17 15:53:06 2022 +0200 net/mlx5: Parse module mapping using mlx5_ifc The assumption that the first byte in the module mapping dword is the module number shouldn't be hard-coded in the driver, but come from mlx5_ifc structs. While at it, fix the incorrect width for the 'rx_lane' and 'tx_lane' fields. Signed-off-by: Gal Pressman Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/port.c | 6 +++--- include/linux/mlx5/mlx5_ifc.h | 8 ++++---- include/linux/mlx5/port.h | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) commit 271907ee2f29cd1078fd219f0778fd824fb1971c Author: Gal Pressman Date: Mon Jan 17 15:14:44 2022 +0200 net/mlx5: Query the maximum MCIA register read size from firmware The MCIA register supports either 12 or 32 dwords, use the correct value by querying the capability from the MCAM register. Signed-off-by: Gal Pressman Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/port.c | 8 +++++++- include/linux/mlx5/mlx5_ifc.h | 4 +++- include/linux/mlx5/port.h | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) commit fbf6836db42d013056e0a423599d8afeb5b838ac Author: Paul Blakey Date: Sun Sep 5 10:47:56 2021 +0300 net/mlx5: CT: Create smfs dr matchers dynamically SMFS dr matchers are processed sequentially in hardware according to their priorities, and not skipped if empty. Currently, smfs ct fs creates four predefined dr matchers per ct table (ct/ct nat) with hardcoded priority. Compared to dmfs ct fs using autogroups, this might cause additional hops in fastpath for traffic patterns that match later priorties, even if previous priorites are empty, e.g user only using ipv6 UDP traffic will have additional 3 hops. Create the matchers dynamically, using the highest priority available, on first rule usage, and remove them on last usage. Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c | 182 +++++++++++---------- 1 file changed, 94 insertions(+), 88 deletions(-) commit 3ee61ebb0df1ec5cf9b60a12c1d7249230a73f9c Author: Paul Blakey Date: Wed Sep 29 13:56:56 2021 +0300 net/mlx5: CT: Add software steering ct flow steering provider fs_core layer adds extra book keeping that is either unneeded for CT, or unused by the underlying software steering, such as allocating FTEs and FTE ids, saving the match key and mask, and autogroups management. On top of that, direct steering has a translation layer (fs_dr) from PRM commands to direct steering objects, for example, creating temporary dr_action objects. This has a performance impact when dealing with CT high insertion rate. To use direct steering (smfs) directly for ct, add a tc ct fs smfs implementation. Instead of dmfs autogroups, smfs ct fs uses one of 4 predefined dr matchers in CT and CT-NAT tables, for each combination of tuple ethertype (ipv4/ipv6), and tuple ip_proto (udp/tcp) that is currently used by nf flow table flow offload. At rule insertions, validate the flow rule fits one of the predfined matcher, and insert to it. To fill the dr_actions of the rule efficiently, create the fwd to post_ct tbl dr_action at fs init, the count dr_action at counter creation, and re-use the already pre-allocated modify header dr_action. Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/Makefile | 6 +- .../net/ethernet/mellanox/mlx5/core/en/tc/ct_fs.h | 27 +- .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c | 17 +- .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c | 366 +++++++++++++++++++++ drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 24 +- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h | 2 + 6 files changed, 435 insertions(+), 7 deletions(-) commit c6fef514adaa0d681f486ebbdec4c299db7101d6 Author: Paul Blakey Date: Thu Sep 30 12:06:35 2021 +0300 net/mlx5: Add smfs lib to export direct steering API to CT Add a thin layer that exports selected direct steering (dr) API which will be used by a ct fs implementation in a following patch. Signed-off-by: Paul Blakey Reviewed-by: Mark Bloch Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/Makefile | 2 +- drivers/net/ethernet/mellanox/mlx5/core/lib/smfs.c | 68 ++++++++++++++++++++++ drivers/net/ethernet/mellanox/mlx5/core/lib/smfs.h | 36 ++++++++++++ 3 files changed, 105 insertions(+), 1 deletion(-) commit 34ea969d164503b683d6b918b13b78a8e267c2cf Author: Paul Blakey Date: Tue Jul 13 11:19:24 2021 +0300 net/mlx5: DR, Add helper to get backing dr table from a mlx5 flow table If sw steering was used to create the table, dr steeering fs creates a backing dr table for the mlx5 flow table. Add helper to return this table so it can be used to create matchers and add rules on it directly instead of passing via eswitch_offloads/fs_core insertion. Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c | 5 +++++ drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h | 3 +++ 2 files changed, 8 insertions(+) commit 7690900052303e758b797db1ff8013fe425d1806 Author: Paul Blakey Date: Tue Nov 23 14:41:18 2021 +0200 net/mlx5: CT: Introduce a platform for multiple flow steering providers Currently, fs_core layer provides flow steering services to the driver including: autogroups, allocating FTEs (flow table entries) and FTE ids, and support of fte action modification. If then software steering is configured, rule insertion will go through a translation layer from firmware buffers to software steering objects (see fs_dr.c). The connection tracking table is a system table that is not directly controlled by the user and is a very high scale table. These fs_core services introduces an overhead that may be optimized by using software steering API directly. Introduce ct flow steering interface to allow multiple flow steering providers. Use the new interface to implement the current dmfs (device managed flow steering) provider which uses fs_core insertion. Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/Makefile | 2 +- .../net/ethernet/mellanox/mlx5/core/en/tc/ct_fs.h | 24 ++++++++ .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_dmfs.c | 64 ++++++++++++++++++++++ drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 33 ++++++++++- 4 files changed, 119 insertions(+), 4 deletions(-) commit a3540effb766b868af429ae6f4909457b4d4f5ea Author: Tariq Toukan Date: Wed Dec 30 11:45:34 2020 +0200 net/mlx5: Node-aware allocation for the doorbell pgdir The function is node-aware and gets the node as an argument. Use a node-aware allocation for the doorbell pgdir structure. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit b5e4c3079490638dafa59413a51f9aef3df120d9 Author: Tariq Toukan Date: Wed Dec 30 11:42:46 2020 +0200 net/mlx5: Node-aware allocation for UAR Prefer the aware allocation, use the device NUMA node. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/uar.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 7f880719b953eba8c13b4e2ebe8c1f9d5fd44848 Author: Tariq Toukan Date: Wed Dec 30 11:55:30 2020 +0200 net/mlx5: Node-aware allocation for the EQs Prefer the aware allocation, use the device NUMA node. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/eq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit e894246df5136f670f3568b7856daeec6c4f9456 Author: Tariq Toukan Date: Wed Dec 30 11:53:14 2020 +0200 net/mlx5: Node-aware allocation for the EQ table Prefer the aware allocation, use the device NUMA node. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/eq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 196df17ac53a715e55d99fda6025c2db22504bb2 Author: Tariq Toukan Date: Wed Dec 30 11:59:55 2020 +0200 net/mlx5: Node-aware allocation for the IRQ table Prefer the aware allocation, use the device NUMA node. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 71ab580705c1c49a3e939997d19d1e439cecdb80 Author: Leon Romanovsky Date: Tue Jan 11 10:37:52 2022 +0200 net/mlx5: Delete useless module.h include There is no need in include of module.h in the following files. Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/cq.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/eq.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/fw.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/health.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/mcg.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/mr.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/pd.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/rl.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/uar.c | 1 - 18 files changed, 18 deletions(-) commit 042637019ea3661bfb82aed6860f73bdbcb6d263 Author: Leon Romanovsky Date: Mon Jan 10 14:34:19 2022 +0200 net/mlx4: Delete useless moduleparam include Remove inclusion of not used moduleparam.h. Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx4/en_tx.c | 1 - 1 file changed, 1 deletion(-) commit e445c8b2aa2df0e49f6037886c32d54a5e3960b1 Author: Colin Ian King Date: Tue Mar 8 20:23:28 2022 +0000 video: fbdev: kyro: make read-only array ODValues static const Don't populate the read-only array ODValues 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: Helge Deller drivers/video/fbdev/kyro/STG4000InitDevice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5b34b0c2248968ec83ebd78669dc0b9085d13f75 Author: Haowen Bai Date: Fri Mar 11 10:56:48 2022 +0800 video: fbdev: offb: fix warning comparing pointer to 0 Fix the following coccicheck warning: drivers/video/fbdev/offb.c:415:13-14: WARNING comparing pointer to 0 Signed-off-by: Haowen Bai Signed-off-by: Helge Deller drivers/video/fbdev/offb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 386fe06c39e843ba1a3274d3cc72fc87835b6cc9 Author: Lad Prabhakar Date: Mon Feb 21 22:43:21 2022 +0000 dmaengine: sh: Kconfig: Add ARCH_R9A07G054 dependency for RZ_DMAC config option RZ/V2L DMA block is identical to one found on RZ/G2L SoC. This patch adds ARCH_R9A07G054 dependency for RZ_DMAC config option so that the driver can be enabled on RZ/V2L SoC. While at it, also update config help text. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220221224321.11939-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Vinod Koul drivers/dma/sh/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 5ac6bfb587772ade1ab474223ed44b359da1c20f Author: Vignesh Raghavendra Date: Sat Feb 19 14:02:20 2022 +0530 dmaengine: ti: k3-psil: Add AM62x PSIL and PDMA data Add PSIL EP data and PDMA data for AM62x. [p.yadav@ti.com: Add CSIRX data] Signed-off-by: Pratyush Yadav Signed-off-by: Vignesh Raghavendra Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220219083220.489420-3-vigneshr@ti.com Signed-off-by: Vinod Koul drivers/dma/ti/Makefile | 3 +- drivers/dma/ti/k3-psil-am62.c | 186 ++++++++++++++++++++++++++++++++++++++++++ drivers/dma/ti/k3-psil-priv.h | 1 + drivers/dma/ti/k3-psil.c | 1 + 4 files changed, 190 insertions(+), 1 deletion(-) commit 03cbdf8b1252140520c9f9ead374b0c2e480fb90 Author: Vignesh Raghavendra Date: Sat Feb 19 14:02:19 2022 +0530 dmaengine: ti: k3-udma: Add AM62x DMSS support Attribute AM64x soc data to AM62x as well as the DMSS IP is similar b/w these two SoCs Signed-off-by: Vignesh Raghavendra Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220219083220.489420-2-vigneshr@ti.com Signed-off-by: Vinod Koul drivers/dma/ti/k3-udma.c | 1 + 1 file changed, 1 insertion(+) commit 2ed4ba9486cbd379099b95aa79f49490af3139d3 Author: Tom Rix Date: Thu Feb 17 10:25:46 2022 -0800 dmaengine: ti: cleanup comments Remove the second 'the' Replacements completetion to completion seens to seen pendling to pending atleast to at least tranfer to transfer multibple to a multiple transfering to transferring Signed-off-by: Tom Rix Acked-by: Peter Ujfalusi Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20220217182546.3266909-1-trix@redhat.com Signed-off-by: Vinod Koul drivers/dma/ti/cppi41.c | 6 +++--- drivers/dma/ti/edma.c | 10 +++++----- drivers/dma/ti/omap-dma.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) commit fb7a444a5f9056bd138ed6b0cef013eb7826728c Author: Yang Li Date: Thu Feb 17 09:16:04 2022 +0800 dmaengine: imx-sdma: clean up some inconsistent indenting Eliminate the following coccicheck warning: ./drivers/dma/imx-sdma.c:896:3-16: code aligned with following code on line 897 Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220217011604.123106-1-yang.lee@linux.alibaba.com Signed-off-by: Vinod Koul drivers/dma/imx-sdma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 63f13b2e879679014f42b65fb50dabde02c85726 Merge: c17c4059df24 37e0cf33f8a1 Author: Jakub Kicinski Date: Thu Mar 10 21:20:07 2022 -0800 Merge branch 'net-ipa-use-bulk-interconnect-interfaces' Alex Elder says: ==================== net: ipa: use bulk interconnect interfaces The IPA code currently enables and disables interconnects by setting the bandwidth of each to a non-zero value, or to zero. The interconnect API now supports enable/disable functions, so we can use those instead. In addition, the interconnect API provides bulk interfaces that allow all interconnects to be operated on at once. This series converts the IPA driver to use the bulk enable and disable interfaces. In the process it uses some existing data structures rather than defining new ones. ==================== Link: https://lore.kernel.org/r/20220309192037.667879-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 37e0cf33f8a1ecf5ca58e884b9bceadad58500a7 Author: Alex Elder Date: Wed Mar 9 13:20:37 2022 -0600 net: ipa: use IPA power device pointer The ipa_power structure contains a copy of the IPA device pointer, so there's no need to pass it to ipa_interconnect_init(). We can also use that pointer for an error message in ipa_power_enable(). Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski drivers/net/ipa/ipa_power.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 8ee7ec4890e2b165f5bb457381c8a8bef0143fc5 Author: Alex Elder Date: Wed Mar 9 13:20:36 2022 -0600 net: ipa: embed interconnect array in the power structure Rather than allocating the interconnect array dynamically, represent the interconnects with a variable-length array at the end of the ipa_power structure. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski drivers/net/ipa/ipa_power.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) commit 63ac8cce506360191975e66d26b32e5e56c83db4 Author: Alex Elder Date: Wed Mar 9 13:20:35 2022 -0600 net: ipa: use bulk interconnect initialization The previous patch used bulk interconnect operations to initialize IPA interconnects one at a time. This rearranges things to use the bulk interfaces as intended--on all interconnects together. As a result ipa_interconnect_init_one() and ipa_interconnect_exit_one() are no longer needed. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski drivers/net/ipa/ipa_power.c | 66 ++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 43 deletions(-) commit ba22a9778dd826b944654bb22e58e149941c4211 Author: Alex Elder Date: Wed Mar 9 13:20:34 2022 -0600 net: ipa: use bulk operations to set up interconnects Use of_icc_bulk_get() and icc_bulk_put(), icc_bulk_set_bw(), and icc_bulk_enable() and icc_bulk_disable() to initialize individual IPA interconnects. Those functions already log messages in the event of error so we don't need to. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski drivers/net/ipa/ipa_power.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) commit 90078e63e601f6281200726f1fbf5e00b9211669 Author: Alex Elder Date: Wed Mar 9 13:20:33 2022 -0600 net: ipa: use interconnect bulk enable/disable operations The power interconnect array is now an array of icc_bulk_data structures, which is what the interconnect bulk enable and disable functions require. Get rid of ipa_interconnect_enable() and ipa_interconnect_disable(), and just call icc_bulk_enable() and icc_bulk_disable() instead. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski drivers/net/ipa/ipa_power.c | 76 ++++++++------------------------------------- 1 file changed, 13 insertions(+), 63 deletions(-) commit 9dd50068916cf1a3a0218545ddee36db2b7619bf Author: Alex Elder Date: Wed Mar 9 13:20:32 2022 -0600 net: ipa: use icc_enable() and icc_disable() The interconnect framework now provides the ability to enable and disable interconnects without having to change their recorded "enabled" bandwidth value. Use this mechanism, rather than setting the bandwidth values to zero and non-zero respectively to disable and enable the IPA interconnects. Disable each interconnect before setting its "enabled" average and peak bandwidth values. Thereafter, enable and disable interconnects when required rather than setting their bandwidths. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski drivers/net/ipa/ipa_power.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) commit c7be12fa2fcc903f9d356eff0d4335359a95df7a Author: Alex Elder Date: Wed Mar 9 13:20:31 2022 -0600 net: ipa: kill struct ipa_interconnect The ipa_interconnect structure contains an icc_path pointer, plus an average and peak bandwidth value. Other than the interconnect name, this matches the icc_bulk_data structure exactly. Use the icc_bulk_data structure in place of the ipa_interconnect structure, and add an initialization of its name field. Then get rid of the now unnecessary ipa_interconnect structure definition. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski drivers/net/ipa/ipa_power.c | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) commit c17c4059df2471183a0e0d567677cbd7f0e0a980 Author: Jonathan Lemon Date: Wed Mar 9 14:34:27 2022 -0800 ptp: ocp: add UPF_NO_THRE_TEST flag for serial ports The serial port driver attempts to test for correct THRE behavior on startup. However, it does this by disabling interrupts, and then intentionally trying to trigger an interrupt in order to see if the IIR bit is set in the UART. However, in this FPGA design, the UART interrupt is generated through the MSI vector, so when interrupts are re-enabled after the test, the DMAR-IR reports an unhandled IRTE entry, since no irq handler is installed at this point - it is installed after the test. This only happens on the /second/ open of the UART, since on the first open, the x86_vector has installed and activated by the driver probe, and is correctly handled. When the serial port is closed for the first time, this vector is deactivated and removed, leading to this error. Signed-off-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220309223427.34745-1-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski drivers/ptp/ptp_ocp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 87ed3de674c69f4d998a6e0e1eb04e008ca93f84 Author: Yinjun Zhang Date: Wed Mar 9 14:55:33 2022 +0100 nfp: xsk: fix a warning when allocating rx rings Previous commits introduced AF_XDP zero-copy support, in which we need register different mem model for xdp_rxq when AF_XDP zero-copy is enabled or not. And this should be done after xdp_rxq info is registered, which is not needed for ctrl port, otherwise there complaints warnings: "Missing register, driver bug". Fix this by not registering mem model for ctrl port, just like we don't register xdp_rxq info for ctrl port. Fixes: 6402528b7a0b ("nfp: xsk: add AF_XDP zero-copy Rx and Tx support") Signed-off-by: Yinjun Zhang Reviewed-by: Niklas Söderlund Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220309135533.10162-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 4c7d2e179576e821b461bb4a58d0a834916601fa Merge: 462248536174 02ddec1986ff Author: Jakub Kicinski Date: Thu Mar 10 20:20:12 2022 -0800 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-03-09 This series contains updates to ice driver only. Martyna implements switchdev filtering on inner EtherType field for tunnels. Marcin adds reporting of slowpath statistics for port representors. Jonathan Toppins changes a non-fatal link error message from warning to debug. Maciej removes unnecessary checks in ice_clean_tx_irq(). Amritha adds support for ADQ to match outer destination MAC for tunnels. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: Add support for outer dest MAC for ADQ tunnels ice: avoid XDP checks in ice_clean_tx_irq() ice: change "can't set link" message to dbg level ice: Add slow path offload stats on port representor in switchdev ice: Add support for inner etype in switchdev ==================== Link: https://lore.kernel.org/r/20220309190315.1380414-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 462248536174d95c69e5013f95cf4243cee686e6 Merge: 1926407a4ab0 155fb43b70b5 Author: Jakub Kicinski Date: Thu Mar 10 20:15:29 2022 -0800 Merge branch 'net-control-the-length-of-the-altname-list' Jakub Kicinski says: ==================== net: control the length of the altname list Count the memory used for altnames and don't let user overflow the property nlattr. This was reported by George: https://lore.kernel.org/all/3e564baf-a1dd-122e-2882-ff143f7eb578@gmail.com/ ==================== Link: https://lore.kernel.org/r/20220309182914.423834-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 155fb43b70b5fce341347a77d1af2765d1e8fbb8 Author: Jakub Kicinski Date: Wed Mar 9 10:29:14 2022 -0800 net: limit altnames to 64k total Property list (altname is a link "property") is wrapped in a nlattr. nlattrs length is 16bit so practically speaking the list of properties can't be longer than that, otherwise user space would have to interpret broken netlink messages. Prevent the problem from occurring by checking the length of the property list before adding new entries. Reported-by: George Shuklin Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski net/core/rtnetlink.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit 5d26cff5bdbebdf98ba48217c078ff102536f134 Author: Jakub Kicinski Date: Wed Mar 9 10:29:13 2022 -0800 net: account alternate interface name memory George reports that altnames can eat up kernel memory. We should charge that memory appropriately. Reported-by: George Shuklin Signed-off-by: Jakub Kicinski net/core/rtnetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1926407a4ab0e59d5a27bed7b82029b356d80fa0 Author: Ilya Maximets Date: Wed Mar 9 23:20:33 2022 +0100 net: openvswitch: fix uAPI incompatibility with existing user space Few years ago OVS user space made a strange choice in the commit [1] to define types only valid for the user space inside the copy of a kernel uAPI header. '#ifndef __KERNEL__' and another attribute was added later. This leads to the inevitable clash between user space and kernel types when the kernel uAPI is extended. The issue was unveiled with the addition of a new type for IPv6 extension header in kernel uAPI. When kernel provides the OVS_KEY_ATTR_IPV6_EXTHDRS attribute to the older user space application, application tries to parse it as OVS_KEY_ATTR_PACKET_TYPE and discards the whole netlink message as malformed. Since OVS_KEY_ATTR_IPV6_EXTHDRS is supplied along with every IPv6 packet that goes to the user space, IPv6 support is fully broken. Fixing that by bringing these user space attributes to the kernel uAPI to avoid the clash. Strictly speaking this is not the problem of the kernel uAPI, but changing it is the only way to avoid breakage of the older user space applications at this point. These 2 types are explicitly rejected now since they should not be passed to the kernel. Additionally, OVS_KEY_ATTR_TUNNEL_INFO moved out from the '#ifdef __KERNEL__' as there is no good reason to hide it from the userspace. And it's also explicitly rejected now, because it's for in-kernel use only. Comments with warnings were added to avoid the problem coming back. (1 << type) converted to (1ULL << type) to avoid integer overflow on OVS_KEY_ATTR_IPV6_EXTHDRS, since it equals 32 now. [1] beb75a40fdc2 ("userspace: Switching of L3 packets in L2 pipeline") Fixes: 28a3f0601727 ("net: openvswitch: IPv6: Add IPv6 extension header support") Link: https://lore.kernel.org/netdev/3adf00c7-fe65-3ef4-b6d7-6d8a0cad8a5f@nvidia.com Link: https://github.com/openvswitch/ovs/commit/beb75a40fdc295bfd6521b0068b4cd12f6de507c Reported-by: Roi Dayan Signed-off-by: Ilya Maximets Acked-by: Nicolas Dichtel Acked-by: Aaron Conole Link: https://lore.kernel.org/r/20220309222033.3018976-1-i.maximets@ovn.org Signed-off-by: Jakub Kicinski include/uapi/linux/openvswitch.h | 18 ++++++++++++++---- net/openvswitch/flow_netlink.c | 13 ++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) commit c40bb4fedcd6b8b6a714da5dd466eb88ed2652d1 Author: Aleksander Jan Bajkowski Date: Wed Mar 9 00:04:57 2022 +0100 net: dsa: lantiq_gswip: enable jumbo frames on GSWIP This enables non-standard MTUs on a per-port basis, with the overall frame size set based on the CPU port. When the MTU is not changed, this should have no effect. Long packets crash the switch with MTUs of greater than 2526, so the maximum is limited for now. Medium packets are sometimes dropped (e.g. TCP over 2477, UDP over 2516-2519, ICMP over 2526), Hence an MTU value of 2400 seems safe. Signed-off-by: Thomas Nixon Signed-off-by: Aleksander Jan Bajkowski Link: https://lore.kernel.org/r/20220308230457.1599237-1-olek2@wp.pl Signed-off-by: Jakub Kicinski drivers/net/dsa/lantiq_gswip.c | 53 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) commit 8bed3d02a663aadcf21d841397acb7a46c2e554b Merge: 1e8a3f0d2a1e 0691a4b55c89 Author: Jakub Kicinski Date: Thu Mar 10 20:09:26 2022 -0800 Merge tag 'linux-can-next-for-5.18-20220310' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-03-10 The first 3 patches are by Oliver Hartkopp, target the CAN ISOTP protocol and update the CAN frame sending behavior, and increases the max PDU size to 64 kByte. The next 2 patches are also by Oliver Hartkopp and update the virtual VXCAN driver so that CAN frames send into the peer name space show up as RX'ed CAN frames. Vincent Mailhol contributes a patch for the etas_es58x driver to fix a false positive dereference uninitialized variable warning. 2 patches by Ulrich Hecht add r8a779a0 SoC support to the rcar_canfd driver. The remaining 21 patches target the gs_usb driver and are by Peter Fink, Ben Evans, Eric Evenchick and me. This series cleans up the gs-usb driver, documents some bits of the USB ABI used by the widely used open source firmware candleLight, adds support for up to 3 CAN interfaces per USB device, adds CAN-FD support, adds quirks for some hardware and software workarounds and finally adds support for 2 new devices. * tag 'linux-can-next-for-5.18-20220310' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: (29 commits) can: gs_usb: add VID/PID for ABE CAN Debugger devices can: gs_usb: add VID/PID for CES CANext FD devices can: gs_usb: add extended bt_const feature can: gs_usb: activate quirks for CANtact Pro unconditionally can: gs_usb: add quirk for CANtact Pro overlapping GS_USB_BREQ value can: gs_usb: add usb quirk for NXP LPC546xx controllers can: gs_usb: add CAN-FD support can: gs_usb: use union and FLEX_ARRAY for data in struct gs_host_frame can: gs_usb: support up to 3 channels per device can: gs_usb: gs_usb_probe(): introduce udev and make use of it can: gs_usb: document the PAD_PKTS_TO_MAX_PKT_SIZE feature can: gs_usb: document the USER_ID feature can: gs_usb: update GS_CAN_FEATURE_IDENTIFY documentation can: gs_usb: add HW timestamp mode bit can: gs_usb: gs_make_candev(): call SET_NETDEV_DEV() after handling all bt_const->feature can: gs_usb: rewrap usb_control_msg() and usb_fill_bulk_urb() can: gs_usb: rewrap error messages can: gs_usb: GS_CAN_FLAG_OVERFLOW: make use of BIT() can: gs_usb: sort include files alphabetically can: gs_usb: fix checkpatch warning ... ==================== Link: https://lore.kernel.org/r/20220310142903.341658-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit b7f2b0d3511a6bbf9387f08f370f9125663e18d8 Author: Manivannan Sadhasivam Date: Wed Mar 9 20:45:41 2022 +0530 dt-bindings: cpufreq: cpufreq-qcom-hw: Convert to YAML bindings Convert Qualcomm cpufreq devicetree binding to YAML. Signed-off-by: Manivannan Sadhasivam Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Viresh Kumar .../bindings/cpufreq/cpufreq-qcom-hw.txt | 172 ------------------ .../bindings/cpufreq/cpufreq-qcom-hw.yaml | 201 +++++++++++++++++++++ 2 files changed, 201 insertions(+), 172 deletions(-) commit cac2ed0a1b0653d95e8714667385214b06f67c0f Author: Manivannan Sadhasivam Date: Wed Mar 9 20:45:40 2022 +0530 dt-bindings: dvfs: Use MediaTek CPUFREQ HW as an example Qcom CPUFREQ HW don't have the support for generic performance domains yet. So use MediaTek CPUFREQ HW that has the support available in mainline. This also silences the below dtschema warnings for "cpufreq-qcom-hw.yaml": Documentation/devicetree/bindings/dvfs/performance-domain.example.dt.yaml: performance-controller@12340000: reg: [[305397760, 4096]] is too short From schema: Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml Documentation/devicetree/bindings/dvfs/performance-domain.example.dt.yaml: performance-controller@12340000: 'clocks' is a required property From schema: Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml Documentation/devicetree/bindings/dvfs/performance-domain.example.dt.yaml: performance-controller@12340000: 'clock-names' is a required property From schema: Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml Documentation/devicetree/bindings/dvfs/performance-domain.example.dt.yaml: performance-controller@12340000: '#freq-domain-cells' is a required property From schema: Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml Documentation/devicetree/bindings/dvfs/performance-domain.example.dt.yaml: performance-controller@12340000: '#performance-domain-cells' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/cpufreq/cpufreq-qcom-hw.yaml Cc: Hector Yuan Cc: Sudeep Holla Signed-off-by: Manivannan Sadhasivam Acked-by: Sudeep Holla Reviewed-by: Rob Herring Signed-off-by: Viresh Kumar .../devicetree/bindings/dvfs/performance-domain.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit f6d790e5a7fe42706756c7fa1686d08d230610fc Merge: 955ad0c8ba93 5e7f44b5c2c0 Author: Dave Airlie Date: Fri Mar 11 13:26:56 2022 +1000 Merge tag 'drm-intel-next-fixes-2022-03-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Reduce overzealous alignment constraints for GGTT - Add missing mdev attribute "name" for GVT - Async flip fixes (Ville) - Static checker fix (Ville) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YimvoLOZ8RPKrITv@jlahtine-mobl.ger.corp.intel.com commit 6789ab9668d920d7be636cb994d85be9a816f9d5 Author: Hao Luo Date: Thu Mar 10 13:16:55 2022 -0800 compiler_types: Refactor the use of btf_type_tag attribute. Previous patches have introduced the compiler attribute btf_type_tag for __user and __percpu. The availability of this attribute depends on some CONFIGs and compiler support. This patch refactors the use of btf_type_tag by introducing BTF_TYPE_TAG, which hides all the dependencies. No functional change. Suggested-by: Andrii Nakryiko Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220310211655.3173786-1-haoluo@google.com include/linux/compiler_types.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) commit a77c2cfd4ee4bfb5267653dad3de8ec45a58b0b7 Merge: 357b3cc3c046 7bae42b68d7f Author: Alexei Starovoitov Date: Thu Mar 10 18:58:04 2022 -0800 Merge branch 'bpf-lsm: Extend interoperability with IMA' Roberto Sassu says: ==================== Extend the interoperability with IMA, to give wider flexibility for the implementation of integrity-focused LSMs based on eBPF. Patch 1 fixes some style issues. Patches 2-6 give the ability to eBPF-based LSMs to take advantage of the measurement capability of IMA without needing to setup a policy in IMA (those LSMs might implement the policy capability themselves). Patches 7-9 allow eBPF-based LSMs to evaluate files read by the kernel. Changelog v2: - Add better description to patch 1 (suggested by Shuah) - Recalculate digest if it is not fresh (when IMA_COLLECTED flag not set) - Move declaration of bpf_ima_file_hash() at the end (suggested by Yonghong) - Add tests to check if the digest has been recalculated - Add deny test for bpf_kernel_read_file() - Add description to tests v1: - Modify ima_file_hash() only and allow the usage of the function with the modified behavior by eBPF-based LSMs through the new function bpf_ima_file_hash() (suggested by Mimi) - Make bpf_lsm_kernel_read_file() sleepable so that bpf_ima_inode_hash() and bpf_ima_file_hash() can be called inside the implementation of eBPF-based LSMs for this hook ==================== Signed-off-by: Alexei Starovoitov commit 7bae42b68d7f070a346fde4c7c1ce182f2284933 Author: Roberto Sassu Date: Wed Mar 2 12:14:04 2022 +0100 selftests/bpf: Check that bpf_kernel_read_file() denies reading IMA policy Check that bpf_kernel_read_file() denies the reading of an IMA policy, by ensuring that ima_setup.sh exits with an error. Signed-off-by: Roberto Sassu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220302111404.193900-10-roberto.sassu@huawei.com tools/testing/selftests/bpf/prog_tests/test_ima.c | 17 +++++++++++++++++ tools/testing/selftests/bpf/progs/ima.c | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) commit e6dcf7bbf37c9ae72b0bc3a09d5f91dd1f5c19e1 Author: Roberto Sassu Date: Wed Mar 2 12:14:03 2022 +0100 selftests/bpf: Add test for bpf_lsm_kernel_read_file() Test the ability of bpf_lsm_kernel_read_file() to call the sleepable functions bpf_ima_inode_hash() or bpf_ima_file_hash() to obtain a measurement of a loaded IMA policy. Signed-off-by: Roberto Sassu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220302111404.193900-9-roberto.sassu@huawei.com tools/testing/selftests/bpf/ima_setup.sh | 13 ++++++++++++- tools/testing/selftests/bpf/prog_tests/test_ima.c | 19 +++++++++++++++++++ tools/testing/selftests/bpf/progs/ima.c | 18 ++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) commit df6b3039fa112e17555776213cab7f07c0a8d98d Author: Roberto Sassu Date: Wed Mar 2 12:14:02 2022 +0100 bpf-lsm: Make bpf_lsm_kernel_read_file() as sleepable Make bpf_lsm_kernel_read_file() as sleepable, so that bpf_ima_inode_hash() or bpf_ima_file_hash() can be called inside the implementation of this hook. Signed-off-by: Roberto Sassu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220302111404.193900-8-roberto.sassu@huawei.com kernel/bpf/bpf_lsm.c | 1 + 1 file changed, 1 insertion(+) commit 91e8fa254dbd0890c34286acdc12e96412305840 Author: Roberto Sassu Date: Wed Mar 2 12:14:01 2022 +0100 selftests/bpf: Check if the digest is refreshed after a file write Verify that bpf_ima_inode_hash() returns a non-fresh digest after a file write, and that bpf_ima_file_hash() returns a fresh digest. Verification is done by requesting the digest from the bprm_creds_for_exec hook, called before ima_bprm_check(). Signed-off-by: Roberto Sassu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220302111404.193900-7-roberto.sassu@huawei.com tools/testing/selftests/bpf/ima_setup.sh | 24 +++++++- tools/testing/selftests/bpf/prog_tests/test_ima.c | 72 ++++++++++++++++++++++- tools/testing/selftests/bpf/progs/ima.c | 11 ++++ 3 files changed, 103 insertions(+), 4 deletions(-) commit 27a77d0d460cdeec57fda2bb6c4f8820ab6e8b38 Author: Roberto Sassu Date: Wed Mar 2 12:14:00 2022 +0100 selftests/bpf: Add test for bpf_ima_file_hash() Add new test to ensure that bpf_ima_file_hash() returns the digest of the executed files. Signed-off-by: Roberto Sassu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220302111404.193900-6-roberto.sassu@huawei.com tools/testing/selftests/bpf/prog_tests/test_ima.c | 43 ++++++++++++++++++++--- tools/testing/selftests/bpf/progs/ima.c | 10 ++++-- 2 files changed, 47 insertions(+), 6 deletions(-) commit 2746de3c53d64436a5a565e87d74b65d82ab6ac7 Author: Roberto Sassu Date: Wed Mar 2 12:13:59 2022 +0100 selftests/bpf: Move sample generation code to ima_test_common() Move sample generator code to ima_test_common() so that the new function can be called by multiple LSM hooks. Signed-off-by: Roberto Sassu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220302111404.193900-5-roberto.sassu@huawei.com tools/testing/selftests/bpf/progs/ima.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit 174b16946e39ebd369097e0f773536c91a8c1a4c Author: Roberto Sassu Date: Wed Mar 2 12:13:58 2022 +0100 bpf-lsm: Introduce new helper bpf_ima_file_hash() ima_file_hash() has been modified to calculate the measurement of a file on demand, if it has not been already performed by IMA or the measurement is not fresh. For compatibility reasons, ima_inode_hash() remains unchanged. Keep the same approach in eBPF and introduce the new helper bpf_ima_file_hash() to take advantage of the modified behavior of ima_file_hash(). Signed-off-by: Roberto Sassu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220302111404.193900-4-roberto.sassu@huawei.com include/uapi/linux/bpf.h | 11 +++++++++++ kernel/bpf/bpf_lsm.c | 20 ++++++++++++++++++++ tools/include/uapi/linux/bpf.h | 11 +++++++++++ 3 files changed, 42 insertions(+) commit 280fe8367b0dc45b6ac5e04fad03e16e99540c0c Author: Roberto Sassu Date: Wed Mar 2 12:13:57 2022 +0100 ima: Always return a file measurement in ima_file_hash() __ima_inode_hash() checks if a digest has been already calculated by looking for the integrity_iint_cache structure associated to the passed inode. Users of ima_file_hash() (e.g. eBPF) might be interested in obtaining the information without having to setup an IMA policy so that the digest is always available at the time they call this function. In addition, they likely expect the digest to be fresh, e.g. recalculated by IMA after a file write. Although getting the digest from the bprm_committed_creds hook (as in the eBPF test) ensures that the digest is fresh, as the IMA hook is executed before that hook, this is not always the case (e.g. for the mmap_file hook). Call ima_collect_measurement() in __ima_inode_hash(), if the file descriptor is available (passed by ima_file_hash()) and the digest is not available/not fresh, and store the file measurement in a temporary integrity_iint_cache structure. This change does not cause memory usage increase, due to using the temporary integrity_iint_cache structure, and due to freeing the ima_digest_data structure inside integrity_iint_cache before exiting from __ima_inode_hash(). For compatibility reasons, the behavior of ima_inode_hash() remains unchanged. Signed-off-by: Roberto Sassu Signed-off-by: Alexei Starovoitov Reviewed-by: Mimi Zohar Link: https://lore.kernel.org/bpf/20220302111404.193900-3-roberto.sassu@huawei.com security/integrity/ima/ima_main.c | 46 ++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 13 deletions(-) commit bae60eefb95ca8f2abebaf157d4815ce8fbb0e75 Author: Roberto Sassu Date: Wed Mar 2 12:13:56 2022 +0100 ima: Fix documentation-related warnings in ima_main.c Fix the following warnings in ima_main.c, displayed with W=n make argument: security/integrity/ima/ima_main.c:432: warning: Function parameter or member 'vma' not described in 'ima_file_mprotect' security/integrity/ima/ima_main.c:636: warning: Function parameter or member 'inode' not described in 'ima_post_create_tmpfile' security/integrity/ima/ima_main.c:636: warning: Excess function parameter 'file' description in 'ima_post_create_tmpfile' security/integrity/ima/ima_main.c:843: warning: Function parameter or member 'load_id' not described in 'ima_post_load_data' security/integrity/ima/ima_main.c:843: warning: Excess function parameter 'id' description in 'ima_post_load_data' Also, fix some style issues in the description of ima_post_create_tmpfile() and ima_post_path_mknod(). Signed-off-by: Roberto Sassu Signed-off-by: Alexei Starovoitov Reviewed-by: Shuah Khan Reviewed-by: Mimi Zohar Link: https://lore.kernel.org/bpf/20220302111404.193900-2-roberto.sassu@huawei.com security/integrity/ima/ima_main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit ed06099c5d0b329082cc19c58eace0b20bf7fe70 Author: Tony Lindgren Date: Fri Feb 4 09:14:49 2022 +0200 clk: ti: Update component clocks to use ti_dt_clk_name() Let's update all the TI component clocks to use ti_dt_clk_name() instead of devicetree node name if available. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220204071449.16762-9-tony@atomide.com Signed-off-by: Stephen Boyd drivers/clk/ti/autoidle.c | 2 +- drivers/clk/ti/clk-dra7-atl.c | 6 ++++-- drivers/clk/ti/composite.c | 6 ++++-- drivers/clk/ti/divider.c | 6 ++++-- drivers/clk/ti/fixed-factor.c | 2 +- drivers/clk/ti/gate.c | 4 +++- drivers/clk/ti/interface.c | 4 +++- drivers/clk/ti/mux.c | 4 +++- 8 files changed, 23 insertions(+), 11 deletions(-) commit 9e56a7d4263ca1c51d867e811cf2dd7e61b6469e Author: Tony Lindgren Date: Fri Feb 4 09:14:48 2022 +0200 clk: ti: Update pll and clockdomain clocks to use ti_dt_clk_name() Let's update the TI pll and clockdomain clocks to use ti_dt_clk_name() instead of devicetree node name if available. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220204071449.16762-8-tony@atomide.com Signed-off-by: Stephen Boyd drivers/clk/ti/apll.c | 13 +++++++++---- drivers/clk/ti/clockdomain.c | 2 +- drivers/clk/ti/dpll.c | 8 +++++--- drivers/clk/ti/fapll.c | 11 +++++++---- 4 files changed, 22 insertions(+), 12 deletions(-) commit 2c1593328d7f02fe49de5ad6b42c36296c9d6922 Author: Tony Lindgren Date: Fri Feb 4 09:14:47 2022 +0200 clk: ti: Add ti_dt_clk_name() helper to use clock-output-names Let's create the clock alias based on the clock-output-names property if available. Also the component clock drivers can use ti_dt_clk_name() in the following patches. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220204071449.16762-7-tony@atomide.com Signed-off-by: Stephen Boyd drivers/clk/ti/clk.c | 20 +++++++++++++++++++- drivers/clk/ti/clock.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) commit d02747e9894c66940db6859c273ab3000c730a93 Author: Tony Lindgren Date: Fri Feb 4 09:14:46 2022 +0200 clk: ti: Use clock-output-names for clkctrl Use clock-output-names devicetree property for clkctrl clocks if available. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220204071449.16762-6-tony@atomide.com Signed-off-by: Stephen Boyd drivers/clk/ti/clkctrl.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) commit 51f661ef9a106e908097262ff5034a85ce15b122 Author: Tony Lindgren Date: Fri Feb 4 09:14:45 2022 +0200 clk: ti: Add ti_find_clock_provider() to use clock-output-names Let's add ti_find_clock_provider() so we can use clock-output-names to name the clock provider instead of relying on non-standard devicetree node names. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220204071449.16762-5-tony@atomide.com Signed-off-by: Stephen Boyd drivers/clk/ti/clk.c | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) commit 274d679810dab8a7dd5042826979d6ef014007a5 Author: Tony Lindgren Date: Fri Feb 4 09:14:44 2022 +0200 clk: ti: Optionally parse IO address from parent clock node If no reg property is specified for a TI clock, let's try to use the parent clock node IO address. This way we can avoid duplicate devicetree reg properties that cause warnings for unique_unit_address. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220204071449.16762-4-tony@atomide.com Signed-off-by: Stephen Boyd drivers/clk/ti/clk.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 80864594ff2ad002e2755daf97d46ff0c86faf1f Author: Tony Lindgren Date: Fri Feb 4 09:14:43 2022 +0200 clk: ti: Preserve node in ti_dt_clocks_register() In preparation for making use of the clock-output-names, we want to keep node around in ti_dt_clocks_register(). This change should not needed as a fix currently. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220204071449.16762-3-tony@atomide.com Signed-off-by: Stephen Boyd drivers/clk/ti/clk.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit 78ab3a9a3d57193f7080422aea30bf5905608b7d Author: Tony Lindgren Date: Fri Feb 4 09:14:42 2022 +0200 clk: ti: Constify clkctrl_name We can constify clkctrl_name in preparation for making use of the clock-output-names property. Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220204071449.16762-2-tony@atomide.com Signed-off-by: Stephen Boyd drivers/clk/ti/clkctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3028181ea3b8e2054d62dc013318c44f93333248 Author: Emil Renner Berthing Date: Wed Jan 26 18:39:53 2022 +0100 clk: starfive: Add JH7100 audio clock driver Add a driver for the audio clocks on the Starfive JH7100 RISC-V SoC. Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220126173953.1016706-8-kernel@esmil.dk Signed-off-by: Stephen Boyd MAINTAINERS | 8 +- drivers/clk/starfive/Kconfig | 8 ++ drivers/clk/starfive/Makefile | 1 + drivers/clk/starfive/clk-starfive-jh7100-audio.c | 170 +++++++++++++++++++++++ 4 files changed, 183 insertions(+), 4 deletions(-) commit 8c373f8c793cc1bb8f708433dcb8343ba078bd17 Author: Emil Renner Berthing Date: Wed Jan 26 18:39:52 2022 +0100 clk: starfive: jh7100: Support more clock types Unlike the system clocks there are audio clocks that combine both multiplexer/divider and gate/multiplexer/divider, so add support for that. Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220126173953.1016706-7-kernel@esmil.dk Signed-off-by: Stephen Boyd drivers/clk/starfive/clk-starfive-jh7100.c | 26 ++++++++++++++++++++++++++ drivers/clk/starfive/clk-starfive-jh7100.h | 15 +++++++++++++++ 2 files changed, 41 insertions(+) commit 26ad971faa07951179ae6d39f91b6622da4d020c Author: Emil Renner Berthing Date: Wed Jan 26 18:39:51 2022 +0100 clk: starfive: jh7100: Make hw clock implementation reusable The JH7100 has additional audio and video clocks at different memory ranges, but they use the same register layout. Add a header and export the starfive_jh7100_clk_ops function so the clock implementation can be reused by drivers handling these clocks. Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220126173953.1016706-6-kernel@esmil.dk Signed-off-by: Stephen Boyd drivers/clk/starfive/clk-starfive-jh7100.c | 96 +++-------------------------- drivers/clk/starfive/clk-starfive-jh7100.h | 97 ++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 89 deletions(-) commit c31b32fef8defb3f56ac969696f57acfbd054071 Author: Emil Renner Berthing Date: Wed Jan 26 18:39:50 2022 +0100 dt-bindings: clock: Add starfive,jh7100-audclk bindings Add bindings for the audio clocks on the StarFive JH7100 RISC-V SoC. Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220126173953.1016706-5-kernel@esmil.dk Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd .../bindings/clock/starfive,jh7100-audclk.yaml | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) commit 458dad7cac03add9333be9dac803d63ab9587847 Author: Emil Renner Berthing Date: Wed Jan 26 18:39:49 2022 +0100 dt-bindings: clock: Add JH7100 audio clock definitions Add all clock outputs for the StarFive JH7100 audio clock generator. Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220126173953.1016706-4-kernel@esmil.dk Acked-by: Rob Herring Signed-off-by: Stephen Boyd include/dt-bindings/clock/starfive-jh7100-audio.h | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) commit 73bfc8d745a98744088cb30517399222674455b1 Author: Emil Renner Berthing Date: Wed Jan 26 18:39:48 2022 +0100 clk: starfive: jh7100: Handle audio_div clock properly It turns out the audio_div clock is a fractional divider where the lowest byte of the ctrl register is the integer part of the divider and the 2nd byte is the number of 100th added to the divider. The children of this clock is used by the audio peripherals for their sample rate clock, so round to the closest possible rate rather than always rounding down like regular dividers. Fixes: 4210be668a09 ("clk: starfive: Add JH7100 clock generator driver") Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220126173953.1016706-3-kernel@esmil.dk Signed-off-by: Stephen Boyd drivers/clk/starfive/clk-starfive-jh7100.c | 68 +++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) commit 40dda3532f903107a063cd6ec1f15e10dd0eccc5 Author: Emil Renner Berthing Date: Wed Jan 26 18:39:47 2022 +0100 clk: starfive: jh7100: Don't round divisor up twice The problem is best illustrated by an example. Suppose a consumer wants a 4MHz clock rate from a divider with a 10MHz parent. It would then call clk_round_rate(clk, 4000000) which would call into our determine_rate() callback that correctly rounds up and finds that a divisor of 3 gives the highest possible frequency below the requested 4MHz and returns 10000000 / 3 = 3333333Hz. However the consumer would then call clk_set_rate(clk, 3333333) but since 3333333 doesn't divide 10000000 evenly our set_rate() callback would again round the divisor up and set it to 4 which results in an unnecessarily low rate of 2.5MHz. Fix it by using DIV_ROUND_CLOSEST in the set_rate() callback. Fixes: 4210be668a09 ("clk: starfive: Add JH7100 clock generator driver") Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20220126173953.1016706-2-kernel@esmil.dk Signed-off-by: Stephen Boyd drivers/clk/starfive/clk-starfive-jh7100.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) commit 1e8a3f0d2a1ef544611a7ea4a7c1512c732e0e43 Merge: 3e18bcb778e6 186d32bbf034 Author: Jakub Kicinski Date: Thu Mar 10 17:16:56 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net net/dsa/dsa2.c commit afb3cc1a397d ("net: dsa: unlock the rtnl_mutex when dsa_master_setup() fails") commit e83d56537859 ("net: dsa: replay master state events in dsa_tree_{setup,teardown}_master") https://lore.kernel.org/all/20220307101436.7ae87da0@canb.auug.org.au/ drivers/net/ethernet/intel/ice/ice.h commit 97b0129146b1 ("ice: Fix error with handling of bonding MTU") commit 43113ff73453 ("ice: add TTY for GNSS module for E810T device") https://lore.kernel.org/all/20220310112843.3233bcf1@canb.auug.org.au/ drivers/staging/gdm724x/gdm_lte.c commit fc7f750dc9d1 ("staging: gdm724x: fix use after free in gdm_lte_rx()") commit 4bcc4249b4cf ("staging: Use netif_rx().") https://lore.kernel.org/all/20220308111043.1018a59d@canb.auug.org.au/ Signed-off-by: Jakub Kicinski commit 2a4013c0cc29929d957119972c36b0368a3b4023 Author: Sergiu Moga Date: Thu Mar 10 13:45:53 2022 +0200 dt-bindings: i2c: at91: Add SAMA7G5 compatible strings list Add compatible strings list for SAMA7G5. Signed-off-by: Sergiu Moga Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220310114553.184763-4-sergiu.moga@microchip.com .../devicetree/bindings/i2c/atmel,at91sam-i2c.yaml | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) commit 7ea75dd386be6fc15763c4adba67b35e5f051b70 Author: Sergiu Moga Date: Thu Mar 10 13:45:52 2022 +0200 dt-bindings: i2c: convert i2c-at91 to json-schema Convert I2C binding for Atmel/Microchip SoCs to Device Tree Schema format. Signed-off-by: Sergiu Moga Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220310114553.184763-3-sergiu.moga@microchip.com .../devicetree/bindings/i2c/atmel,at91sam-i2c.yaml | 140 +++++++++++++++++++++ Documentation/devicetree/bindings/i2c/i2c-at91.txt | 82 ------------ 2 files changed, 140 insertions(+), 82 deletions(-) commit 6853fece628c5a968e4c264d26a4f7750de42199 Author: Tom Rix Date: Wed Mar 9 14:23:02 2022 -0800 dt-bindings: clk: cleanup comments For spdx, first line /* */ for *.h, change tab to space Replacements devider to divider Comunications to Communications periphrals to peripherals supportted to supported wich to which Documentatoin to Documentation Signed-off-by: Tom Rix Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220309222302.1114561-1-trix@redhat.com include/dt-bindings/clock/alphascale,asm9260.h | 2 +- include/dt-bindings/clock/axis,artpec6-clkctrl.h | 2 +- include/dt-bindings/clock/boston-clock.h | 3 +-- include/dt-bindings/clock/marvell,mmp2.h | 4 ++-- include/dt-bindings/clock/marvell,pxa168.h | 4 ++-- include/dt-bindings/clock/marvell,pxa910.h | 4 ++-- include/dt-bindings/clock/nuvoton,npcm7xx-clock.h | 2 +- include/dt-bindings/clock/stm32fx-clock.h | 4 ++-- include/dt-bindings/clock/stratix10-clock.h | 2 +- 9 files changed, 13 insertions(+), 14 deletions(-) commit 357b3cc3c0467b2f7cd6c4a87f7a18bfd779ce5b Author: Chris J Arges Date: Wed Mar 9 15:41:58 2022 -0600 bpftool: Ensure bytes_memlock json output is correct If a BPF map is created over 2^32 the memlock value as displayed in JSON format will be incorrect. Use atoll instead of atoi so that the correct number is displayed. ``` $ bpftool map create /sys/fs/bpf/test_bpfmap type hash key 4 \ value 1024 entries 4194304 name test_bpfmap $ bpftool map list 1: hash name test_bpfmap flags 0x0 key 4B value 1024B max_entries 4194304 memlock 4328521728B $ sudo bpftool map list -j | jq .[].bytes_memlock 33554432 ``` Signed-off-by: Chris J Arges Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/b6601087-0b11-33cc-904a-1133d1500a10@cloudflare.com tools/bpf/bpftool/map.c | 2 +- tools/bpf/bpftool/prog.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 67b56134ce03e0defe67a7d01f88119b49dc4392 Merge: a2daeab5cffa 03a6b195e8e8 Author: Jens Axboe Date: Thu Mar 10 16:04:03 2022 -0700 Merge branch 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.18/drivers Pull MD updates from Song: "This set contains raid5 bio handling cleanups for raid5." * 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: raid5: initialize the stripe_head embeeded bios as needed raid5-cache: statically allocate the recovery ra bio raid5-cache: fully initialize flush_bio when needed raid5-ppl: fully initialize the bio in ppl_new_iounit commit 355f841a3f8ca980c9682937a5257d3a1f6fc09d Author: Eric W. Biederman Date: Wed Feb 9 12:47:08 2022 -0600 tracehook: Remove tracehook.h Now that all of the definitions have moved out of tracehook.h into ptrace.h, sched/signal.h, resume_user_mode.h there is nothing left in tracehook.h so remove it. Update the few files that were depending upon tracehook.h to bring in definitions to use the headers they need directly. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-13-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" MAINTAINERS | 1 - arch/s390/include/asm/entry-common.h | 1 - arch/s390/kernel/ptrace.c | 1 - arch/s390/kernel/signal.c | 1 - arch/x86/kernel/ptrace.c | 1 - arch/x86/kernel/signal.c | 1 - fs/coredump.c | 1 - fs/exec.c | 1 - fs/io-wq.c | 2 +- fs/io_uring.c | 1 - fs/proc/array.c | 1 - fs/proc/base.c | 1 - include/linux/tracehook.h | 56 ------------------------------------ kernel/exit.c | 3 +- kernel/livepatch/transition.c | 1 - kernel/seccomp.c | 1 - kernel/signal.c | 2 +- security/apparmor/domain.c | 1 - security/selinux/hooks.c | 1 - 19 files changed, 4 insertions(+), 74 deletions(-) commit 03248addadf1a5ef0a03cbcd5ec905b49adb9658 Author: Eric W. Biederman Date: Wed Feb 9 12:20:45 2022 -0600 resume_user_mode: Move to resume_user_mode.h Move set_notify_resume and tracehook_notify_resume into resume_user_mode.h. While doing that rename tracehook_notify_resume to resume_user_mode_work. Update all of the places that included tracehook.h for these functions to include resume_user_mode.h instead. Update all of the callers of tracehook_notify_resume to call resume_user_mode_work. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-12-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" arch/Kconfig | 2 +- arch/alpha/kernel/signal.c | 4 +-- arch/arc/kernel/signal.c | 4 +-- arch/arm/kernel/signal.c | 4 +-- arch/arm64/kernel/signal.c | 4 +-- arch/csky/kernel/signal.c | 4 +-- arch/h8300/kernel/signal.c | 4 +-- arch/hexagon/kernel/process.c | 4 +-- arch/hexagon/kernel/signal.c | 1 - arch/ia64/kernel/process.c | 4 +-- arch/ia64/kernel/ptrace.c | 2 +- arch/ia64/kernel/signal.c | 1 - arch/m68k/kernel/signal.c | 4 +-- arch/microblaze/kernel/signal.c | 4 +-- arch/mips/kernel/signal.c | 4 +-- arch/nds32/kernel/signal.c | 4 +-- arch/nios2/kernel/signal.c | 4 +-- arch/openrisc/kernel/signal.c | 4 +-- arch/parisc/kernel/signal.c | 4 +-- arch/powerpc/kernel/signal.c | 4 +-- arch/riscv/kernel/signal.c | 4 +-- arch/sh/kernel/signal_32.c | 4 +-- arch/sparc/kernel/signal32.c | 1 - arch/sparc/kernel/signal_32.c | 4 +-- arch/sparc/kernel/signal_64.c | 4 +-- arch/um/kernel/process.c | 4 +-- arch/xtensa/kernel/signal.c | 4 +-- block/blk-cgroup.c | 2 +- include/linux/entry-kvm.h | 2 +- include/linux/resume_user_mode.h | 64 ++++++++++++++++++++++++++++++++++++++++ include/linux/tracehook.h | 51 -------------------------------- kernel/entry/common.c | 4 +-- kernel/entry/kvm.c | 2 +- kernel/task_work.c | 2 +- mm/memcontrol.c | 2 +- 35 files changed, 117 insertions(+), 107 deletions(-) commit d3c51a0c8944e3a5bba458358b4c1f9ae2de0133 Author: Eric W. Biederman Date: Fri Jan 28 14:36:58 2022 -0600 resume_user_mode: Remove #ifdef TIF_NOTIFY_RESUME in set_notify_resume Every architecture defines TIF_NOTIFY_RESUME so remove the unnecessary ifdef. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-11-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" include/linux/tracehook.h | 2 -- 1 file changed, 2 deletions(-) commit 593febb143d17aa2096cd123c9d62b6981eb1d97 Author: Eric W. Biederman Date: Wed Feb 9 11:46:54 2022 -0600 signal: Move set_notify_signal and clear_notify_signal into sched/signal.h The header tracehook.h is no place for code to live. The functions set_notify_signal and clear_notify_signal are not about signals. They are about interruptions that act like signals. The fundamental signal primitives wind up calling set_notify_signal and clear_notify_signal. Which means they need to be maintained with the signal code. Since set_notify_signal and clear_notify_signal must be maintained with the signal subsystem move them into sched/signal.h and claim them as part of the signal subsystem. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-10-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" include/linux/sched/signal.h | 17 +++++++++++++++++ include/linux/tracehook.h | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) commit 7c5d8fa6fbb12a3f0eefe8762bfede508e147cb3 Author: Eric W. Biederman Date: Wed Feb 9 11:18:54 2022 -0600 task_work: Decouple TIF_NOTIFY_SIGNAL and task_work There are a small handful of reasons besides pending signals that the kernel might want to break out of interruptible sleeps. The flag TIF_NOTIFY_SIGNAL and the helpers that set and clear TIF_NOTIFY_SIGNAL provide that the infrastructure for breaking out of interruptible sleeps and entering the return to user space slow path for those cases. Expand tracehook_notify_signal inline in it's callers and remove it, which makes clear that TIF_NOTIFY_SIGNAL and task_work are separate concepts. Update the comment on set_notify_signal to more accurately describe it's purpose. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-9-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" fs/io-wq.c | 4 +++- fs/io_uring.c | 4 +++- include/linux/tracehook.h | 15 ++------------- kernel/entry/kvm.c | 7 +++++-- 4 files changed, 13 insertions(+), 17 deletions(-) commit 8ba62d37949e248c698c26e0d82d72fda5d33ebf Author: Eric W. Biederman Date: Wed Feb 9 09:51:14 2022 -0600 task_work: Call tracehook_notify_signal from get_signal on all architectures Always handle TIF_NOTIFY_SIGNAL in get_signal. With commit 35d0b389f3b2 ("task_work: unconditionally run task_work from get_signal()") always calling task_work_run all of the work of tracehook_notify_signal is already happening except clearing TIF_NOTIFY_SIGNAL. Factor clear_notify_signal out of tracehook_notify_signal and use it in get_signal so that get_signal only needs one call of task_work_run. To keep the semantics in sync update xfer_to_guest_mode_work (which does not call get_signal) to call tracehook_notify_signal if either _TIF_SIGPENDING or _TIF_NOTIFY_SIGNAL. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-8-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" arch/s390/kernel/signal.c | 4 ++-- arch/x86/kernel/signal.c | 4 ++-- include/linux/entry-common.h | 2 +- include/linux/tracehook.h | 9 +++++++-- kernel/entry/common.c | 12 ++---------- kernel/entry/kvm.c | 2 +- kernel/signal.c | 14 +++----------- 7 files changed, 18 insertions(+), 29 deletions(-) commit 8bcd06632b73291e8734f46084ed04f4106b840a Author: Steven Rostedt (Google) Date: Thu Mar 3 17:05:31 2022 -0500 tracing: Allow custom events to be added to the tracefs directory Allow custom events to be added to the events directory in the tracefs file system. For example, a module could be installed that attaches to an event and wants to be enabled and disabled via the tracefs file system. It would use trace_add_event_call() to add the event to the tracefs directory, and trace_remove_event_call() to remove it. Make both those functions EXPORT_SYMBOL_GPL(). Link: https://lkml.kernel.org/r/20220303220625.186988045@goodmis.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Masami Hiramatsu Cc: Tom Zanussi Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events.c | 2 ++ 1 file changed, 2 insertions(+) commit 5677a3d713ad795e3ce32d631941e982777b43db Author: Steven Rostedt (Google) Date: Tue Mar 8 10:39:45 2022 -0500 tracing: Fix last_cmd_set() string management in histogram code Using strnlen(dest, str, n) is confusing, as the size of dest must be strlen(dest) + n + 1. Even more confusing, using sizeof(string constant) gives you strlen(string constant) + 1 and not just strlen(). These two together made using strncat() with a constant string a bit off in the calculations as we have: len = sizeof(HIST_PREFIX) + strlen(str) + 1; kfree(last_cmd); last_cmd = kzalloc(len, GFP_KERNEL); strcpy(last_cmd, HIST_PREFIX); len -= sizeof(HIST_PREFIX) + 1; strncat(last_cmd, str, len); The above works if we s/sizeof/strlen/ with HIST_PREFIX (which is defined as "hist:", but because sizeof(HIST_PREFIX) is equal to strlen(HIST_PREFIX) + 1, we can drop the +1 in the code. But at least comment that we are doing so. Link: https://lore.kernel.org/all/202203082112.Iu7tvFl4-lkp@intel.com/ Fixes: 9f8e5aee93ed2 ("tracing: Fix allocation of last_cmd in last_cmd_set()") Reported-by: kernel test robot Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events_hist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 173c2049d12b441b498d6423276f5dd76b1e637b Author: Beau Belgrave Date: Thu Feb 24 10:16:37 2022 -0800 user_events: Fix potential uninitialized pointer while parsing field Ensure name is initialized by default to NULL to prevent possible edge cases that could lead to it being left uninitialized. Add an explicit check for NULL name to ensure edge boundaries. Link: https://lore.kernel.org/bpf/20220224105334.GA2248@kili/ Link: https://lore.kernel.org/linux-trace-devel/20220224181637.2129-1-beaub@linux.microsoft.com Signed-off-by: Beau Belgrave Reported-by: Dan Carpenter Signed-off-by: Steven Rostedt (Google) kernel/trace/trace_events_user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 3e18bcb778e636045e091ddc09c2b69594bc844c Merge: 2a9eef868a99 6862c787c7e8 Author: Jakub Kicinski Date: Thu Mar 10 14:35:21 2022 -0800 Merge tag 'mlx5-updates-2022-03-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2022-03-09 1) Remove kernel log prints on FW events regarding FW pages management and replace that with debugfs entries to track FW pages management commands failures and general stats, we do that for all FW commands in general since it's the same effort to do so under the already existing debugfs entry for FW commands. 2) Add support for ConnectX-7 Software managed steering, in other words STEv2 which shares a lot in common with STE V1, the difference is in specific offsets in the devices, the logic is almost the same, thus we implement STEv1 and STEv2 in the same file. * tag 'mlx5-updates-2022-03-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5: DR, Add support for ConnectX-7 steering net/mlx5: DR, Refactor ste_ctx handling for STE v0/1 net/mlx5: DR, Rename action modify fields to reflect naming in HW spec net/mlx5: DR, Fix handling of different actions on the same STE in STEv1 net/mlx5: DR, Remove unneeded comments net/mlx5: DR, Add support for matching on Internet Header Length (IHL) net/mlx5: DR, Align mlx5dv_dr API vport action with FW behavior net/mlx5: Add debugfs counters for page commands failures net/mlx5: Add pages debugfs net/mlx5: Move debugfs entries to separate struct net/mlx5: Change release_all_pages cap bit location net/mlx5: Remove redundant error on reclaim pages net/mlx5: Remove redundant error on give pages net/mlx5: Remove redundant notify fail on give pages net/mlx5: Add command failures data to debugfs net/mlx5e: TC, Fix use after free in mlx5e_clone_flow_attr_for_post_act() ==================== Link: https://lore.kernel.org/r/20220309213755.610202-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit b48b563626655fe1d43a79e5ceb9d6367f851edc Author: Clément Léger Date: Fri Mar 4 11:32:25 2022 +0100 dt-bindings: net: mscc,vsc7514-switch: convert txt bindings to yaml Convert existing txt bindings to yaml format. Signed-off-by: Clément Léger Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220304103225.111428-1-clement.leger@bootlin.com .../bindings/net/mscc,vsc7514-switch.yaml | 191 +++++++++++++++++++++ .../devicetree/bindings/net/mscc-ocelot.txt | 83 --------- 2 files changed, 191 insertions(+), 83 deletions(-) commit 9be01ee2289bb3e8c8d17844076705b0b14b7164 Author: Richard Zhu Date: Mon Mar 7 17:07:31 2022 +0800 dt-bindings: imx6q-pcie: Add iMX8MP PCIe compatible string Add i.MX8MP PCIe compatible string. Signed-off-by: Richard Zhu Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/1646644054-24421-5-git-send-email-hongxing.zhu@nxp.com Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 1 + 1 file changed, 1 insertion(+) commit 1b773d0003aa90e60953d263c2ee31e6fb4a8a69 Author: Yuntao Wang Date: Fri Mar 11 00:15:18 2022 +0800 bpf: Use offsetofend() to simplify macro definition Use offsetofend() instead of offsetof() + sizeof() to simplify MIN_BPF_LINEINFO_SIZE macro definition. Signed-off-by: Yuntao Wang Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Acked-by: Joanne Koong Link: https://lore.kernel.org/bpf/20220310161518.534544-1-ytcoode@gmail.com kernel/bpf/verifier.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 58617014405ad5c9f94f464444f4972dabb71ca7 Author: Hengqi Chen Date: Thu Mar 10 23:53:35 2022 +0800 bpf: Fix comment for helper bpf_current_task_under_cgroup() Fix the descriptions of the return values of helper bpf_current_task_under_cgroup(). Fixes: c6b5fb8690fa ("bpf: add documentation for eBPF helpers (42-50)") Signed-off-by: Hengqi Chen Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220310155335.1278783-1-hengqi.chen@gmail.com include/uapi/linux/bpf.h | 4 ++-- tools/include/uapi/linux/bpf.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) commit 60695896e41a6a0c7f8518fd13f8db79f880df0a Merge: 743bec1b78af 3daf0896f3f9 Author: Daniel Borkmann Date: Thu Mar 10 22:57:06 2022 +0100 Merge branch 'bpf-tstamp-follow-ups' Martin KaFai Lau says: ==================== This set is a follow up on the bpf side based on discussion [0]. Patch 1 is to remove some skbuff macros that are used in bpf filter.c. Patch 2 and 3 are to simplify the bpf insn rewrite on __sk_buff->tstamp. Patch 4 is to simplify the bpf uapi by modeling the __sk_buff->tstamp and __sk_buff->tstamp_type (was delivery_time_type) the same as its kernel counter part skb->tstamp and skb->mono_delivery_time. Patch 5 is to adjust the bpf selftests due to changes in patch 4. [0]: https://lore.kernel.org/bpf/419d994e-ff61-7c11-0ec7-11fefcb0186e@iogearbox.net/ ==================== Signed-off-by: Daniel Borkmann commit 3daf0896f3f958b48d7747e96dd57a6b10745b76 Author: Martin KaFai Lau Date: Wed Mar 9 01:05:15 2022 -0800 bpf: selftests: Update tests after s/delivery_time/tstamp/ change in bpf.h The previous patch made the follow changes: - s/delivery_time_type/tstamp_type/ - s/bpf_skb_set_delivery_time/bpf_skb_set_tstamp/ - BPF_SKB_DELIVERY_TIME_* to BPF_SKB_TSTAMP_* This patch is to change the test_tc_dtime.c to reflect the above. Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220309090515.3712742-1-kafai@fb.com tools/testing/selftests/bpf/progs/test_tc_dtime.c | 38 +++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) commit 9bb984f28d5bcb917d35d930fcfb89f90f9449fd Author: Martin KaFai Lau Date: Wed Mar 9 01:05:09 2022 -0800 bpf: Remove BPF_SKB_DELIVERY_TIME_NONE and rename s/delivery_time_/tstamp_/ This patch is to simplify the uapi bpf.h regarding to the tstamp type and use a similar way as the kernel to describe the value stored in __sk_buff->tstamp. My earlier thought was to avoid describing the semantic and clock base for the rcv timestamp until there is more clarity on the use case, so the __sk_buff->delivery_time_type naming instead of __sk_buff->tstamp_type. With some thoughts, it can reuse the UNSPEC naming. This patch first removes BPF_SKB_DELIVERY_TIME_NONE and also rename BPF_SKB_DELIVERY_TIME_UNSPEC to BPF_SKB_TSTAMP_UNSPEC and BPF_SKB_DELIVERY_TIME_MONO to BPF_SKB_TSTAMP_DELIVERY_MONO. The semantic of BPF_SKB_TSTAMP_DELIVERY_MONO is the same: __sk_buff->tstamp has delivery time in mono clock base. BPF_SKB_TSTAMP_UNSPEC means __sk_buff->tstamp has the (rcv) tstamp at ingress and the delivery time at egress. At egress, the clock base could be found from skb->sk->sk_clockid. __sk_buff->tstamp == 0 naturally means NONE, so NONE is not needed. With BPF_SKB_TSTAMP_UNSPEC for the rcv tstamp at ingress, the __sk_buff->delivery_time_type is also renamed to __sk_buff->tstamp_type which was also suggested in the earlier discussion: https://lore.kernel.org/bpf/b181acbe-caf8-502d-4b7b-7d96b9fc5d55@iogearbox.net/ The above will then make __sk_buff->tstamp and __sk_buff->tstamp_type the same as its kernel skb->tstamp and skb->mono_delivery_time counter part. The internal kernel function bpf_skb_convert_dtime_type_read() is then renamed to bpf_skb_convert_tstamp_type_read() and it can be simplified with the BPF_SKB_DELIVERY_TIME_NONE gone. A BPF_ALU32_IMM(BPF_AND) insn is also saved by using BPF_JMP32_IMM(BPF_JSET). The bpf helper bpf_skb_set_delivery_time() is also renamed to bpf_skb_set_tstamp(). The arg name is changed from dtime to tstamp also. It only allows setting tstamp 0 for BPF_SKB_TSTAMP_UNSPEC and it could be relaxed later if there is use case to change mono delivery time to non mono. prog->delivery_time_access is also renamed to prog->tstamp_type_access. Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220309090509.3712315-1-kafai@fb.com include/linux/filter.h | 2 +- include/uapi/linux/bpf.h | 40 ++++++++++--------- net/core/filter.c | 88 ++++++++++++++++-------------------------- tools/include/uapi/linux/bpf.h | 40 ++++++++++--------- 4 files changed, 77 insertions(+), 93 deletions(-) commit 9d90db97e4d4537c82a5ee476b1c13553e487f28 Author: Martin KaFai Lau Date: Wed Mar 9 01:05:02 2022 -0800 bpf: Simplify insn rewrite on BPF_WRITE __sk_buff->tstamp BPF_JMP32_IMM(BPF_JSET) is used to save a BPF_ALU32_IMM(BPF_AND). The skb->tc_at_ingress and skb->mono_delivery_time are at the same offset, so only one BPF_LDX_MEM(BPF_B) is needed. Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220309090502.3711982-1-kafai@fb.com net/core/filter.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) commit 539de9328e3ab444efe51ddc7416ce2a3f0f23b2 Author: Martin KaFai Lau Date: Wed Mar 9 01:04:56 2022 -0800 bpf: Simplify insn rewrite on BPF_READ __sk_buff->tstamp The skb->tc_at_ingress and skb->mono_delivery_time are at the same byte offset. Thus, only one BPF_LDX_MEM(BPF_B) is needed and both bits can be tested together. /* BPF_READ: a = __sk_buff->tstamp */ if (skb->tc_at_ingress && skb->mono_delivery_time) a = 0; else a = skb->tstamp; Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220309090456.3711530-1-kafai@fb.com net/core/filter.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) commit 3b5d4ddf8fe1f60082513f94bae586ac80188a03 Author: Martin KaFai Lau Date: Wed Mar 9 01:04:50 2022 -0800 bpf: net: Remove TC_AT_INGRESS_OFFSET and SKB_MONO_DELIVERY_TIME_OFFSET macro This patch removes the TC_AT_INGRESS_OFFSET and SKB_MONO_DELIVERY_TIME_OFFSET macros. Instead, PKT_VLAN_PRESENT_OFFSET is used because all of them are at the same offset. Comment is added to make it clear that changing the position of tc_at_ingress or mono_delivery_time will require to adjust the defined macros. The earlier discussion can be found here: https://lore.kernel.org/bpf/419d994e-ff61-7c11-0ec7-11fefcb0186e@iogearbox.net/ Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220309090450.3710955-1-kafai@fb.com include/linux/skbuff.h | 10 +++++----- net/core/filter.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) commit 332f2b1e7360dc118d95bc6f15bcb6830b73a8aa Author: Mike Snitzer Date: Thu Mar 10 16:25:28 2022 -0500 dm: return void from __send_empty_flush Signed-off-by: Mike Snitzer drivers/md/dm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit e27363472f9bc96db831ceb2c31cf8b9a7c5b6f3 Author: Mike Snitzer Date: Wed Mar 9 16:07:06 2022 -0500 dm: factor out dm_io_complete Optimizes dm_io_dec_pending() slightly by avoiding local variables. Signed-off-by: Mike Snitzer drivers/md/dm.c | 149 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 77 insertions(+), 72 deletions(-) commit 9edcfaa349afff3e783884779681b957df50a36a Merge: 57b1659faad0 c6455af54899 Author: Greg Kroah-Hartman Date: Thu Mar 10 22:49:15 2022 +0100 Merge tag 'phy-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-misc-next Vinod writes: phy-for-5.18 - New support: - Mediatek tphy support for MT8186 - Qualcomm usb phy support for sc8180x and sc8280xp - Qualcomm ufs phy support for sc8180x and sc8280xp - Qualcomm usb phy support for MSM8953 - Cadence D-Phy Rx support - Sun4i support for USB phy - Rockchip naneng combo phy support for RK3568 - Qualcomm eDP PHY for sc7280 - Updates: - wake on support for Synopsis XHCI controllers - Yamilify Qualcomm USB HS phy binding - Charger detection support for TI tusb1210 * tag 'phy-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (53 commits) phy: qcom-qmp: add sc8280xp UFS PHY dt-bindings: phy: qcom,qmp: add sc8180x and sc8280xp ufs compatibles phy: qcom-snps: Add sc8280xp support dt-bindings: phy: qcom,usb-snps-femto-v2: Add sc8180x and sc8280xp dt-bindings: Revert "dt-bindings: soc: grf: add naneng combo phy register compatible" phy: dt-bindings: Add Cadence D-PHY Rx bindings phy: dt-bindings: cdns,dphy: add power-domains property phy: dt-bindings: Convert Cadence DPHY binding to YAML phy: cadence: Add Cadence D-PHY Rx driver dt-bindings: phy: renesas,usb2-phy: Document RZ/V2L phy bindings Revert "PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware" Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720" Revert "ata: ahci: mvebu: Make SATA PHY optional for Armada 3720" phy: marvell: phy-mvebu-a3700-comphy: Add native kernel implementation phy: marvell: phy-mvebu-a3700-comphy: Remove port from driver configuration phy: phy-brcm-usb: fixup BCM4908 support dt-bindings: phy: mediatek,tphy: Add compatible for MT8192 phy: ti: tusb1210: Add charger detection phy: ti: tusb1210: Add a delay between power-on and restoring the phy-parameters phy: ti: tusb1210: Drop tusb->vendor_specific2 != 0 check from tusb1210_power_on() ... commit 57b1659faad0e25acf2164f59bc78eacbd0e5d69 Merge: 4dee7a7138fa 266fa94673d3 Author: Greg Kroah-Hartman Date: Thu Mar 10 22:48:25 2022 +0100 Merge tag 'soundwire-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next Vinod writes: soundwire updates for 5.17-rc1 - stream handling refactoring and renaming to make it consistent in the core - runtime pm suport for qcom driver - in band wake up interrupt support for qcom driver * tag 'soundwire-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: (27 commits) soundwire: qcom: use __maybe_unused for swrm_runtime_resume() soundwire: qcom: constify static struct qcom_swrm_data global variables soundwire: qcom: add in-band wake up interrupt support dt-bindings: soundwire: qcom: document optional wake irq soundwire: qcom: add runtime pm support soundwire: stream: make enable/disable/deprepare idempotent soundwire: stream: sdw_stream_add_ functions can be called multiple times soundwire: stream: introduce sdw_slave_rt_find() helper soundwire: stream: separate alloc and config within sdw_stream_add_xxx() soundwire: stream: move list addition to sdw_slave_alloc_rt() soundwire: stream: rename and move master/slave_rt_free routines soundwire: stream: group sdw_stream_ functions soundwire: stream: split sdw_alloc_slave_rt() in alloc and config soundwire: stream: move sdw_alloc_slave_rt() before 'master' helpers soundwire: stream: split sdw_alloc_master_rt() in alloc and config soundwire: stream: simplify sdw_alloc_master_rt() soundwire: stream: group sdw_port and sdw_master/slave_port functions soundwire: stream: add 'slave' prefix for port range checks soundwire: stream: split alloc and config in two functions soundwire: stream: split port allocation and configuration loops ... commit 4dee7a7138fae69e613ffc833927f35bcdeb0615 Merge: 0245107a838b 655221c56739 Author: Greg Kroah-Hartman Date: Thu Mar 10 22:39:55 2022 +0100 Merge tag 'misc-habanalabs-next-2022-02-28' 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 v5.18: - Add new feature of recording time-stamp when a completion queue counter reaches a target value as determined by the userspace application. This is used by the graph compiler to accurately measure the time it takes for certain workloads to execute, which helps to fine-tune future compilations. - Add two new attributes to sysfs that expose the VRM and f/w OS version - Add a delay to the reset path that allows the driver to receive and handle additional events from the f/w before doing the reset. This can help when debugging why a reset event was received from the f/w. - Re-factor some of the sysfs code in the driver. Mainly, move functions from hwmgr.c to more relevant files and totally remove hwmgr.c file. - Fix multiple bugs such as races, use-after-free, ignoring error codes, etc. - As usual, multiple minor changes and small fixes. * tag 'misc-habanalabs-next-2022-02-28' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux: (50 commits) habanalabs: remove deprecated firmware states habanalabs: add an option to delay a device reset habanalabs: Add check for pci_enable_device habanalabs: Fix reset upon device release bug habanalabs: make sure device mem alloc is page aligned habanalabs/gaudi: add missing handling of NIC related events habanalabs/gaudi: handle axi errors from NIC engines habanalabs: allow user to set allocation page size habanalabs: use kernel-doc for memory ioctl documentation habanalabs: avoid using an uninitialized variable habanalabs: set max power on device init per ASIC habanalabs: use proper max_power variable for device utilization habanalabs: enable stop-on-error debugfs setting per ASIC habanalabs: change function to static habanalabs: add missing include of vmalloc.h habanalabs: fix use-after-free bug habanalabs: rephrase error messages in PCI initialization habanalabs: fix spelling mistake habanalabs: Timestamps buffers registration habanalabs: fix race when waiting on encaps signal ... commit 0245107a838b826af6a6676ff08030b9574981b2 Merge: 3dd9a926ec23 21f0a239ecab Author: Greg Kroah-Hartman Date: Thu Mar 10 22:38:19 2022 +0100 Merge tag 'fpga-for-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-next Moritz writes: FPGA Manager changes for 5.18-rc1 Christophe's patch is part of a larger effort of removing the use of the deprecated pci-dma-compat API. All patches have been reviewed on the mailing list, and have been in the last few linux-next releases (as part of our for-next branch) without issues. Signed-off-by: Moritz Fischer * tag 'fpga-for-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: fpga: dfl: pci: Remove usage of the deprecated "pci-dma-compat.h" API commit 2a9eef868a997ec575c2e6ae885e91313f635d59 Merge: 3126b731ceb1 d8d083020530 Author: Jakub Kicinski Date: Thu Mar 10 12:30:04 2022 -0800 Merge branch 'mptcp-selftests-refactor-join-tests' Mat Martineau says: ==================== mptcp: selftests: Refactor join tests The mptcp_join.sh selftest is the largest and most complex self test for MPTCP, and it is frequently used by MPTCP developers to reproduce bugs and verify fixes. As it grew in size and execution time, it became more cumbersome to use. These changes do some much-needed cleanup, and add developer-friendly features to make it easier to see failures and run a subset of the tests when verifying fixes. ==================== Link: https://lore.kernel.org/r/20220309191636.258232-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit d8d0830205302545b29c5a0eed5336d64c7b580d Author: Matthieu Baerts Date: Wed Mar 9 11:16:36 2022 -0800 selftests: mptcp: join: make it shellcheck compliant This fixes a few issues reported by ShellCheck: - SC2068: Double quote array expansions to avoid re-splitting elements. - SC2206: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. - SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined. - SC2155: Declare and assign separately to avoid masking return values. - SC2162: read without -r will mangle backslashes. - SC2219: Instead of 'let expr', prefer (( expr )) . - SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?. - SC2236: Use -n instead of ! -z. - SC2004: $/${} is unnecessary on arithmetic variables. - SC2012: Use find instead of ls to better handle non-alphanumeric filenames. - SC2002: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. SC2086 (Double quotes to prevent globbing and word splitting) is ignored because it is controlled for the moment and there are too many to change. While at it, also fixed the alignment in one comment. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 126 +++++++++++++----------- 1 file changed, 66 insertions(+), 60 deletions(-) commit 4bfadd7120a1c5485a9994822242a2a163dc0814 Author: Matthieu Baerts Date: Wed Mar 9 11:16:35 2022 -0800 selftests: mptcp: join: avoid backquotes As explained on ShellCheck's wiki [1], it is recommended to avoid backquotes `...` in favour of parenthesis $(...): > Backtick command substitution `...` is legacy syntax with several > issues. > > - It has a series of undefined behaviors related to quoting in POSIX. > - It imposes a custom escaping mode with surprising results. > - It's exceptionally hard to nest. > > $(...) command substitution has none of these problems, and is > therefore strongly encouraged. [1] https://www.shellcheck.net/wiki/SC2006 Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 66 +++++++++++++------------ 1 file changed, 34 insertions(+), 32 deletions(-) commit 1e777bd818bd6417dbdb97676bd9ca259eada8a4 Author: Matthieu Baerts Date: Wed Mar 9 11:16:34 2022 -0800 selftests: mptcp: join: clarify local/global vars Some vars are redefined in different places. Best to avoid this classical Bash pitfall where variables are accidentally overridden by other functions because the proper scope has not been defined. Most issues are with loops: typically 'i' is used in for-loops but if it is not global, calling a function from a for-loop also doing a for-loop with the same non local 'i' variable causes troubles because the first 'i' will be assigned to another value. To prevent such issues, the iterator variable is now declared as local just before the loop. If it is always done like this, issues are avoided. To distinct between local and non local variables, all non local ones are defined at the beginning of the script. The others are now defined with the "local" keyword. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 135 +++++++++++++++--------- 1 file changed, 83 insertions(+), 52 deletions(-) commit 3469d72f135afa38599e3e0262be10108e1413dd Author: Matthieu Baerts Date: Wed Mar 9 11:16:33 2022 -0800 selftests: mptcp: join: helper to filter TCP This is more readable and reduces duplicated commands. This might also be useful to add v6 support and switch to nftables. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit 39aab88242a8ea63a32d3b199e01292e555e03c7 Author: Matthieu Baerts Date: Wed Mar 9 11:16:32 2022 -0800 selftests: mptcp: join: list failure at the end With ~100 tests, it helps to have this summary at the end not to scroll to find which one has failed. It is especially interseting when looking at the output produced by the CI where the kernel logs from the serial are mixed together. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 85 ++++++++++++++++--------- 1 file changed, 55 insertions(+), 30 deletions(-) commit c7d49c033de057b88398915b0eb2df2484dc8166 Author: Matthieu Baerts Date: Wed Mar 9 11:16:31 2022 -0800 selftests: mptcp: join: alt. to exec specific tests Running a specific test by giving the ID is often what we want: the CI reports an issue with the Nth test, it is reproducible with: ./mptcp_join.sh N But this might not work when there is a need to find which commit has introduced a regression making a test unstable: failing from time to time. Indeed, a specific test is not attached to one ID: the ID is in fact a counter. It means the same test can have a different ID if other tests have been added/removed before this unstable one. Remembering the current test can also help listing failed tests at the end. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 446 ++++++++++++------------ 1 file changed, 232 insertions(+), 214 deletions(-) commit ae7bd9ccecc3495ff5c3692e100bdd9f0164e49d Author: Matthieu Baerts Date: Wed Mar 9 11:16:30 2022 -0800 selftests: mptcp: join: option to execute specific tests Often, it is needed to run one specific test. There are options to run subgroups of tests but when only one fails, no need to run all the subgroup. So far, the solution was to edit the script to comment the tests that are not needed but that's not ideal. Now, it is possible to run one specific test by giving the ID of the tests that are going to be validated, e.g. ./mptcp_join.sh 36 37 This is cleaner and saves time. Technically, the reset* functions now return 0 if the test can be executed. This naturally creates sections per test in the code which is also helpful to understand what a test is exactly doing. Suggested-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 1629 ++++++++++++----------- 1 file changed, 877 insertions(+), 752 deletions(-) commit e59300ce3ff8abee26144fddec11b0492e05154c Author: Matthieu Baerts Date: Wed Mar 9 11:16:29 2022 -0800 selftests: mptcp: join: reset failing links Best to always reset this env var before each test to avoid surprising behaviour depending on the order tests are running. Also clearly set it for the last failing links test is also needed when only this test is executed. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 3afd0280e7d323c2b8df458cefecc9e4b3bec570 Author: Matthieu Baerts Date: Wed Mar 9 11:16:28 2022 -0800 selftests: mptcp: join: define tests groups once When adding a new tests group, it has to be defined in multiple places: - in the all_tests() function - in the 'usage()' function - in the getopts: short option + what to do when the option is used Because it is easy to forget one of them, it is useful to have to define them only once. Note: only using an associative array would simplify the code but the entries are stored in a hashtable and iterating over the different items doesn't give the same order as the one used in the declaration of this array. Because we want to run these tests in the same order as before, a "simple" array is used first. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 141 ++++++++---------------- 1 file changed, 47 insertions(+), 94 deletions(-) commit 3c082695e78b99bba177725bf509ad3230f8287c Author: Geliang Tang Date: Wed Mar 9 11:16:27 2022 -0800 selftests: mptcp: drop msg argument of chk_csum_nr This patch dropped the msg argument of chk_csum_nr, to unify chk_csum_nr with other chk_*_nr functions. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 26 ++++++++++++------------- 1 file changed, 12 insertions(+), 14 deletions(-) commit bcbb7bf6ccde7cb969a5642879832bc84ebf06a3 Author: Jens Axboe Date: Thu Mar 10 12:59:35 2022 -0700 io_uring: allow submissions to continue on error By default, io_uring will stop submitting a batch of requests if we run into an error submitting a request. This isn't strictly necessary, as the error result is passed out-of-band via a CQE anyway. And it can be a bit confusing for some applications. Provide a way to setup a ring that will continue submitting on error, when the error CQE has been posted. There's still one case that will break out of submission. If we fail allocating a request, then we'll still return -ENOMEM. We could in theory post a CQE for that condition too even if we never got a request. Leave that for a potential followup. Reported-by: Dylan Yudaken Signed-off-by: Jens Axboe fs/io_uring.c | 12 +++++++++--- include/uapi/linux/io_uring.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) commit 21d5929ff230635400d138df66b0b8dd38893c25 Author: Richard Zhu Date: Thu Mar 3 15:50:05 2022 +0800 dt-bindings: imx6q-pcie: Add iMX8MM PCIe compatible string Add the i.MX8MM PCIe compatible string. Signed-off-by: Richard Zhu Reviewed-by: Lucas Stach Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/1646293805-18248-1-git-send-email-hongxing.zhu@nxp.com Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml | 1 + 1 file changed, 1 insertion(+) commit 815953dc2011ad7a34de355dfa703dcef1085219 Author: Jisheng Zhang Date: Sun Dec 26 15:40:19 2021 +0800 PCI: dwc: Restore MSI Receiver mask during resume If a host that uses the IP's integrated MSI Receiver lost power during suspend, we call dw_pcie_setup_rc() to reinit the RC. But dw_pcie_setup_rc() always sets pp->irq_mask[ctrl] to ~0, so the mask register is always set as 0xffffffff incorrectly, thus the MSI can't work after resume. Fix this issue by moving pp->irq_mask[ctrl] initialization to dw_pcie_host_init() so we can correctly set the mask reg during both boot and resume. Tested-by: Richard Zhu Link: https://lore.kernel.org/r/20211226074019.2556-1-jszhang@kernel.org Signed-off-by: Jisheng Zhang Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas drivers/pci/controller/dwc/pcie-designware-host.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 7f62d40d9cb50fd146fe8ff071f98fa3c1855083 Author: Eric W. Biederman Date: Wed Feb 9 08:52:41 2022 -0600 task_work: Introduce task_work_pending Wrap the test of task->task_works in a helper function to make it clear what is being tested. All of the other readers of task->task_work use READ_ONCE and this is even necessary on current as other processes can update task->task_work. So for consistency I have added READ_ONCE into task_work_pending. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-7-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" fs/io_uring.c | 6 +++--- include/linux/task_work.h | 5 +++++ include/linux/tracehook.h | 4 ++-- kernel/signal.c | 4 ++-- kernel/task_work.c | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) commit 8ca07e17c9dd4c4afcb4a3f2ea8f0a0d41c0f982 Author: Eric W. Biederman Date: Fri Jan 28 13:55:47 2022 -0600 task_work: Remove unnecessary include from posix_timers.h Break a header file circular dependency by removing the unnecessary include of task_work.h from posix_timers.h. sched.h -> posix-timers.h posix-timers.h -> task_work.h task_work.h -> sched.h Add missing includes of task_work.h to: arch/x86/mm/tlb.c kernel/time/posix-cpu-timers.c Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-6-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" arch/x86/mm/tlb.c | 1 + include/linux/posix-timers.h | 1 - kernel/time/posix-cpu-timers.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) commit c145137dc990fd67b52fbc52faae5ba46f168cca Author: Eric W. Biederman Date: Thu Jan 27 12:04:27 2022 -0600 ptrace: Remove tracehook_signal_handler The two line function tracehook_signal_handler is only called from signal_delivered. Expand it inline in signal_delivered and remove it. Just to make it easier to understand what is going on. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-5-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" arch/Kconfig | 1 - include/linux/tracehook.h | 17 ----------------- kernel/signal.c | 3 ++- 3 files changed, 2 insertions(+), 19 deletions(-) commit 0cfcb2b9ef48bbcaf5d43b9f1893f63a938e8176 Author: Eric W. Biederman Date: Thu Jan 27 12:00:55 2022 -0600 ptrace: Remove arch_syscall_{enter,exit}_tracehook These functions are alwasy one-to-one wrappers around ptrace_report_syscall_entry and ptrace_report_syscall_exit. So directly call the functions they are wrapping instead. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-4-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" include/linux/entry-common.h | 43 ++----------------------------------------- kernel/entry/common.c | 4 ++-- 2 files changed, 4 insertions(+), 43 deletions(-) commit 153474ba1a4aed0a7b797b4c2be8c35c7a4e57bd Author: Eric W. Biederman Date: Thu Jan 27 11:46:37 2022 -0600 ptrace: Create ptrace_report_syscall_{entry,exit} in ptrace.h Rename tracehook_report_syscall_{entry,exit} to ptrace_report_syscall_{entry,exit} and place them in ptrace.h There is no longer any generic tracehook infractructure so make these ptrace specific functions ptrace specific. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-3-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" arch/Kconfig | 2 +- arch/alpha/kernel/ptrace.c | 5 ++-- arch/arc/kernel/ptrace.c | 5 ++-- arch/arm/kernel/ptrace.c | 5 ++-- arch/arm64/kernel/ptrace.c | 7 +++-- arch/csky/kernel/ptrace.c | 5 ++-- arch/h8300/kernel/ptrace.c | 5 ++-- arch/hexagon/kernel/traps.c | 6 ++--- arch/ia64/kernel/ptrace.c | 4 +-- arch/m68k/kernel/ptrace.c | 6 ++--- arch/microblaze/kernel/ptrace.c | 5 ++-- arch/mips/kernel/ptrace.c | 5 ++-- arch/nds32/include/asm/syscall.h | 2 +- arch/nds32/kernel/ptrace.c | 5 ++-- arch/nios2/kernel/ptrace.c | 5 ++-- arch/openrisc/kernel/ptrace.c | 5 ++-- arch/parisc/kernel/ptrace.c | 7 +++-- arch/powerpc/kernel/ptrace/ptrace.c | 8 +++--- arch/riscv/kernel/ptrace.c | 5 ++-- arch/sh/kernel/ptrace_32.c | 5 ++-- arch/sparc/kernel/ptrace_32.c | 5 ++-- arch/sparc/kernel/ptrace_64.c | 5 ++-- arch/um/kernel/ptrace.c | 5 ++-- arch/xtensa/kernel/ptrace.c | 5 ++-- include/asm-generic/syscall.h | 2 +- include/linux/entry-common.h | 6 ++--- include/linux/ptrace.h | 51 +++++++++++++++++++++++++++++++++++++ include/linux/tracehook.h | 51 ------------------------------------- include/uapi/linux/ptrace.h | 2 +- kernel/entry/common.c | 1 + 30 files changed, 109 insertions(+), 126 deletions(-) commit 42da6b7e7db5316dac541baf4ed8168bc3bb3f74 Author: Eric W. Biederman Date: Thu Jan 27 11:27:10 2022 -0600 ptrace/arm: Rename tracehook_report_syscall report_syscall Make the arm and arm64 code more concise and less confusing by renaming the architecture specific tracehook_report_syscall to report_syscall. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-2-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" arch/arm/kernel/ptrace.c | 7 +++---- arch/arm64/kernel/ptrace.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) commit 19397e8b546d20226153dafe5dce34c4393752c4 Author: Eric W. Biederman Date: Thu Jan 27 11:17:32 2022 -0600 ptrace: Move ptrace_report_syscall into ptrace.h Move ptrace_report_syscall from tracehook.h into ptrace.h where it belongs. Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/20220309162454.123006-1-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" include/linux/ptrace.h | 27 +++++++++++++++++++++++++++ include/linux/tracehook.h | 26 -------------------------- 2 files changed, 27 insertions(+), 26 deletions(-) commit 82909316caac1ef3320b94c57bd0915aac90b0bd Author: Ionela Voinescu Date: Thu Mar 10 14:54:51 2022 +0000 arm64, topology: enable use of init_cpu_capacity_cppc() Now that the arch topology driver provides a method of setting CPU capacity values based on information on highest performance from CPPC, use this functionality on arm64 platforms. Signed-off-by: Ionela Voinescu Acked-by: Catalin Marinas Tested-by: Valentin Schneider Tested-by: Yicong Yang Signed-off-by: Rafael J. Wysocki arch/arm64/include/asm/topology.h | 4 ++++ 1 file changed, 4 insertions(+) commit 9924fbb51e0ae30b8d7eec7c1c839d74da9678b3 Author: Ionela Voinescu Date: Thu Mar 10 14:54:50 2022 +0000 arch_topology: obtain cpu capacity using information from CPPC Define topology_init_cpu_capacity_cppc() to use highest performance values from _CPC objects to obtain and set maximum capacity information for each CPU. acpi_cppc_processor_probe() is a good point at which to trigger the initialization of CPU (u-arch) capacity values, as at this point the highest performance values can be obtained from each CPU's _CPC objects. Architectures can therefore use this functionality through arch_init_invariance_cppc(). The performance scale used by CPPC is a unified scale for all CPUs in the system. Therefore, by obtaining the raw highest performance values from the _CPC objects, and normalizing them on the [0, 1024] capacity scale, used by the task scheduler, we obtain the CPU capacity of each CPU. While an ACPI Notify(0x85) could alert about a change in the highest performance value, which should in turn retrigger the CPU capacity computations, this notification is not currently handled by the ACPI processor driver. When supported, a call to arch_init_invariance_cppc() would perform the update. Signed-off-by: Ionela Voinescu Acked-by: Sudeep Holla Tested-by: Valentin Schneider Tested-by: Yicong Yang Signed-off-by: Rafael J. Wysocki drivers/base/arch_topology.c | 45 ++++++++++++++++++++++++++++++++++++++++--- include/linux/arch_topology.h | 4 ++++ 2 files changed, 46 insertions(+), 3 deletions(-) commit 1132e6de11cfc334b44f609792664f1bc3055c52 Author: Ionela Voinescu Date: Thu Mar 10 14:54:49 2022 +0000 x86, ACPI: rename init_freq_invariance_cppc() to arch_init_invariance_cppc() init_freq_invariance_cppc() was called in acpi_cppc_processor_probe(), after CPU performance information and controls were populated from the per-cpu _CPC objects. But these _CPC objects provide information that helps with both CPU (u-arch) and frequency invariance. Therefore, change the function name to a more generic one, while adding the arch_ prefix, as this function is expected to be defined differently by different architectures. Signed-off-by: Ionela Voinescu Acked-by: Rafael J. Wysocki Tested-by: Valentin Schneider Signed-off-by: Rafael J. Wysocki arch/x86/include/asm/topology.h | 2 +- drivers/acpi/cppc_acpi.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) commit a2a591fb76e6f5461dfd04715b69c317e50c43a5 Author: Ilkka Koskinen Date: Tue Mar 8 18:07:50 2022 -0800 ACPI: AGDI: Add driver for Arm Generic Diagnostic Dump and Reset device ACPI for Arm Components 1.1 Platform Design Document v1.1 [0] specifices Arm Generic Diagnostic Device Interface (AGDI). It allows an admin to issue diagnostic dump and reset via an SDEI event or an interrupt. This patch implements SDEI path. [0] https://developer.arm.com/documentation/den0093/latest/ Signed-off-by: Ilkka Koskinen Reviewed-by: Russell King (Oracle) Acked-by: Lorenzo Pieralisi Signed-off-by: Rafael J. Wysocki drivers/acpi/arm64/Kconfig | 10 ++++ drivers/acpi/arm64/Makefile | 1 + drivers/acpi/arm64/agdi.c | 116 ++++++++++++++++++++++++++++++++++++++++++++ drivers/acpi/bus.c | 2 + include/linux/acpi_agdi.h | 13 +++++ 5 files changed, 142 insertions(+) commit e86801b0ff1c5c6d1f78232f7e3b52c0b0631560 Author: Ilkka Koskinen Date: Tue Mar 8 18:07:49 2022 -0800 ACPI: tables: Add AGDI to the list of known table signatures Add AGDI to the list of known ACPI table signatures to allow the kernel to recognize it when upgrading tables via initrd. Signed-off-by: Ilkka Koskinen Reviewed-by: Russell King (Oracle) Signed-off-by: Rafael J. Wysocki drivers/acpi/tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 85750bcd480c74b13661ee2c9db49de500fd2823 Author: Lianjie Zhang Date: Thu Mar 10 22:38:30 2022 +0800 cpufreq: unify show() and store() naming and use __ATTR_XX Usually, sysfs attributes have .show and .store and their naming convention is filename_show() and filename_store(). But in cpufreq the naming convention of these functions is show_filename() and store_filename() which prevents __ATTR_RW() and __ATTR_RO() from being used in there to simplify code. Accordingly, change the naming convention of the sysfs .show and .store methods in cpufreq to follow the one expected by __ATTR_RW() and __ATTR_RO() and use these macros in that code. Signed-off-by: Lianjie Zhang [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki drivers/cpufreq/cpufreq_conservative.c | 10 +++++----- drivers/cpufreq/cpufreq_governor.c | 6 +++--- drivers/cpufreq/cpufreq_governor.h | 12 +++++------- drivers/cpufreq/cpufreq_ondemand.c | 10 +++++----- 4 files changed, 18 insertions(+), 20 deletions(-) commit 69596f555b81942b41b10669e5faefc6ce883abb Author: Mike Snitzer Date: Tue Mar 8 20:01:37 2022 -0500 dm cache: use dm_submit_bio_remap Signed-off-by: Mike Snitzer drivers/md/dm-cache-target.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit b7f8dff09827c96032c34a945ee7757e394b5952 Author: Mike Snitzer Date: Thu Mar 10 11:45:58 2022 -0500 dm: simplify dm_sumbit_bio_remap interface Remove the from_wq argument from dm_sumbit_bio_remap(). Eliminates the need for dm_sumbit_bio_remap() callers to know whether they are calling for a workqueue or from the original dm_submit_bio(). Add map_task to dm_io struct, record the map_task in alloc_io and clear it after all target ->map() calls have completed. Update dm_sumbit_bio_remap to check if 'current' matches io->map_task rather than rely on passed 'from_rq' argument. This change really simplifies the chore of porting each DM target to using dm_sumbit_bio_remap() because there is no longer the risk of programming error by not completely knowing all the different contexts a particular method that calls dm_sumbit_bio_remap() might be used in. Signed-off-by: Mike Snitzer drivers/md/dm-core.h | 1 + drivers/md/dm-crypt.c | 6 +++--- drivers/md/dm-delay.c | 2 +- drivers/md/dm-thin.c | 4 ++-- drivers/md/dm.c | 8 ++++---- include/linux/device-mapper.h | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) commit a92512819b1f2971674675edbf695b717d43629c Author: Mike Snitzer Date: Tue Mar 8 17:18:07 2022 -0500 dm thin: use dm_submit_bio_remap Signed-off-by: Mike Snitzer drivers/md/dm-thin.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 0a8e9599b91db84b25e4f13e89ed9b5cc3c2d15f Author: Mike Snitzer Date: Tue Mar 8 17:15:19 2022 -0500 dm: add WARN_ON_ONCE to dm_submit_bio_remap If a target uses dm_submit_bio_remap() it should set ti->accounts_remapped_io. Also, switch dm_start_io_acct() WARN_ON to WARN_ON_ONCE. Signed-off-by: Mike Snitzer drivers/md/dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 524bb1da785a7ae43dd413cd392b5071c6c367f8 Author: Dmitry Baryshkov Date: Sat Mar 5 14:02:14 2022 +0300 PM: core: keep irq flags in device_pm_check_callbacks() The function device_pm_check_callbacks() can be called under the spin lock (in the reported case it happens from genpd_add_device() -> dev_pm_domain_set(), when the genpd uses spinlocks rather than mutexes. However this function uncoditionally uses spin_lock_irq() / spin_unlock_irq(), thus not preserving the CPU flags. Use the irqsave/irqrestore instead. The backtrace for the reference: [ 2.752010] ------------[ cut here ]------------ [ 2.756769] raw_local_irq_restore() called with IRQs enabled [ 2.762596] WARNING: CPU: 4 PID: 1 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x34/0x50 [ 2.772338] Modules linked in: [ 2.775487] CPU: 4 PID: 1 Comm: swapper/0 Tainted: G S 5.17.0-rc6-00384-ge330d0d82eff-dirty #684 [ 2.781384] Freeing initrd memory: 46024K [ 2.785839] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 2.785841] pc : warn_bogus_irq_restore+0x34/0x50 [ 2.785844] lr : warn_bogus_irq_restore+0x34/0x50 [ 2.785846] sp : ffff80000805b7d0 [ 2.785847] x29: ffff80000805b7d0 x28: 0000000000000000 x27: 0000000000000002 [ 2.785850] x26: ffffd40e80930b18 x25: ffff7ee2329192b8 x24: ffff7edfc9f60800 [ 2.785853] x23: ffffd40e80930b18 x22: ffffd40e80930d30 x21: ffff7edfc0dffa00 [ 2.785856] x20: ffff7edfc09e3768 x19: 0000000000000000 x18: ffffffffffffffff [ 2.845775] x17: 6572206f74206465 x16: 6c696166203a3030 x15: ffff80008805b4f7 [ 2.853108] x14: 0000000000000000 x13: ffffd40e809550b0 x12: 00000000000003d8 [ 2.860441] x11: 0000000000000148 x10: ffffd40e809550b0 x9 : ffffd40e809550b0 [ 2.867774] x8 : 00000000ffffefff x7 : ffffd40e809ad0b0 x6 : ffffd40e809ad0b0 [ 2.875107] x5 : 000000000000bff4 x4 : 0000000000000000 x3 : 0000000000000000 [ 2.882440] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff7edfc03a8000 [ 2.889774] Call trace: [ 2.892290] warn_bogus_irq_restore+0x34/0x50 [ 2.896770] _raw_spin_unlock_irqrestore+0x94/0xa0 [ 2.901690] genpd_unlock_spin+0x20/0x30 [ 2.905724] genpd_add_device+0x100/0x2d0 [ 2.909850] __genpd_dev_pm_attach+0xa8/0x23c [ 2.914329] genpd_dev_pm_attach_by_id+0xc4/0x190 [ 2.919167] genpd_dev_pm_attach_by_name+0x3c/0xd0 [ 2.924086] dev_pm_domain_attach_by_name+0x24/0x30 [ 2.929102] psci_dt_attach_cpu+0x24/0x90 [ 2.933230] psci_cpuidle_probe+0x2d4/0x46c [ 2.937534] platform_probe+0x68/0xe0 [ 2.941304] really_probe.part.0+0x9c/0x2fc [ 2.945605] __driver_probe_device+0x98/0x144 [ 2.950085] driver_probe_device+0x44/0x15c [ 2.954385] __device_attach_driver+0xb8/0x120 [ 2.958950] bus_for_each_drv+0x78/0xd0 [ 2.962896] __device_attach+0xd8/0x180 [ 2.966843] device_initial_probe+0x14/0x20 [ 2.971144] bus_probe_device+0x9c/0xa4 [ 2.975092] device_add+0x380/0x88c [ 2.978679] platform_device_add+0x114/0x234 [ 2.983067] platform_device_register_full+0x100/0x190 [ 2.988344] psci_idle_init+0x6c/0xb0 [ 2.992113] do_one_initcall+0x74/0x3a0 [ 2.996060] kernel_init_freeable+0x2fc/0x384 [ 3.000543] kernel_init+0x28/0x130 [ 3.004132] ret_from_fork+0x10/0x20 [ 3.007817] irq event stamp: 319826 [ 3.011404] hardirqs last enabled at (319825): [] __up_console_sem+0x78/0x84 [ 3.020332] hardirqs last disabled at (319826): [] el1_dbg+0x24/0x8c [ 3.028458] softirqs last enabled at (318312): [] _stext+0x410/0x588 [ 3.036678] softirqs last disabled at (318299): [] __irq_exit_rcu+0x158/0x174 [ 3.045607] ---[ end trace 0000000000000000 ]--- Signed-off-by: Dmitry Baryshkov Signed-off-by: Rafael J. Wysocki drivers/base/power/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 9d1f0ec9f71780e69ceb9d91697600c747d6e02e Author: Michael T. Kloos Date: Mon Mar 7 20:03:21 2022 -0500 riscv: Fixed misaligned memory access. Fixed pointer comparison. Rewrote the RISC-V memmove() assembly implementation. The previous implementation did not check memory alignment and it compared 2 pointers with a signed comparison. The misaligned memory access would cause the kernel to crash on systems that did not emulate it in firmware and did not support it in hardware. Firmware emulation is slow and may not exist. The RISC-V spec does not guarantee that support for misaligned memory accesses will exist. It should not be depended on. This patch now checks for XLEN granularity of co-alignment between the pointers. Failing that, copying is done by loading from the 2 contiguous and naturally aligned XLEN memory locations containing the overlapping XLEN sized data to be copied. The data is shifted into the correct place and binary or'ed together on each iteration. The result is then stored into the corresponding naturally aligned XLEN sized location in the destination. For unaligned data at the terminations of the regions to be copied or for copies less than (2 * XLEN) in size, byte copy is used. This patch also now uses unsigned comparison for the pointers and migrates to the newer assembler annotations from the now deprecated ones. Signed-off-by: Michael T. Kloos Signed-off-by: Palmer Dabbelt arch/riscv/lib/memmove.S | 368 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 310 insertions(+), 58 deletions(-) commit 854abe25ddb0d33532f15cca7eb5240b02f7db6b Author: Mario Limonciello Date: Thu Mar 10 09:09:20 2022 -0600 platform/x86: amd-pmc: Validate entry into the deepest state on resume Currently the only way to discover if a system went into the deepest sleep state is to read from sysfs after you finished suspend. To better illustrate to users that problems have occurred, check as part of resume and display a warning. Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220310150920.560583-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/amd-pmc.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) commit c5179ef1ca0c39dab6955be6b0e3c034cc4164c8 Author: Anup Patel Date: Thu Feb 10 11:19:47 2022 +0530 RISC-V: Enable RISC-V SBI CPU Idle driver for QEMU virt machine We enable RISC-V SBI CPU Idle driver for QEMU virt machine to test SBI HSM Supend on QEMU. Signed-off-by: Anup Patel Signed-off-by: Anup Patel Signed-off-by: Palmer Dabbelt arch/riscv/Kconfig.socs | 3 +++ arch/riscv/configs/defconfig | 1 + arch/riscv/configs/rv32_defconfig | 1 + 3 files changed, 5 insertions(+) commit 1bd524f7e8d8f194cd94bc4535df91391d0f1dc8 Author: Anup Patel Date: Thu Feb 10 11:19:46 2022 +0530 dt-bindings: Add common bindings for ARM and RISC-V idle states The RISC-V CPU idle states will be described in under the /cpus/idle-states DT node in the same way as ARM CPU idle states. This patch adds common bindings documentation for both ARM and RISC-V idle states. Signed-off-by: Anup Patel Signed-off-by: Anup Patel Reviewed-by: Rob Herring Reviewed-by: Guo Ren Signed-off-by: Palmer Dabbelt .../bindings/arm/msm/qcom,idle-state.txt | 2 +- Documentation/devicetree/bindings/arm/psci.yaml | 2 +- .../bindings/{arm => cpu}/idle-states.yaml | 228 +++++++++++++++++++-- Documentation/devicetree/bindings/riscv/cpus.yaml | 6 + 4 files changed, 219 insertions(+), 19 deletions(-) commit 6abf32f1d9c5009dcccded2c1e7ca899a4ab587b Author: Anup Patel Date: Thu Feb 10 11:19:45 2022 +0530 cpuidle: Add RISC-V SBI CPU idle driver The RISC-V SBI HSM extension provides HSM suspend call which can be used by Linux RISC-V to enter platform specific low-power state. This patch adds a CPU idle driver based on RISC-V SBI calls which will populate idle states from device tree and use SBI calls to entry these idle states. Signed-off-by: Anup Patel Signed-off-by: Anup Patel Acked-by: Atish Patra Signed-off-by: Palmer Dabbelt MAINTAINERS | 7 + drivers/cpuidle/Kconfig | 5 + drivers/cpuidle/Kconfig.riscv | 15 + drivers/cpuidle/Makefile | 4 + drivers/cpuidle/cpuidle-riscv-sbi.c | 627 ++++++++++++++++++++++++++++++++++++ 5 files changed, 658 insertions(+) commit 9d976d6721dfb525b81ce981e1363c70c0975aab Author: Anup Patel Date: Thu Feb 10 11:19:44 2022 +0530 cpuidle: Factor-out power domain related code from PSCI domain driver The generic power domain related code in PSCI domain driver is largely independent of PSCI and can be shared with RISC-V SBI domain driver hence we factor-out this code into dt_idle_genpd.c and dt_idle_genpd.h. Signed-off-by: Anup Patel Signed-off-by: Anup Patel Reviewed-by: Ulf Hansson Signed-off-by: Palmer Dabbelt MAINTAINERS | 7 ++ drivers/cpuidle/Kconfig | 4 + drivers/cpuidle/Kconfig.arm | 1 + drivers/cpuidle/Makefile | 1 + drivers/cpuidle/cpuidle-psci-domain.c | 138 +------------------------- drivers/cpuidle/cpuidle-psci.h | 15 ++- drivers/cpuidle/dt_idle_genpd.c | 178 ++++++++++++++++++++++++++++++++++ drivers/cpuidle/dt_idle_genpd.h | 50 ++++++++++ 8 files changed, 259 insertions(+), 135 deletions(-) commit b8200905e48891b4a3134b47f35c730347135eed Author: Anup Patel Date: Thu Feb 10 11:19:43 2022 +0530 RISC-V: Add SBI HSM suspend related defines We add defines related to SBI HSM suspend call and also update HSM states naming as-per latest SBI specification. Signed-off-by: Anup Patel Signed-off-by: Anup Patel Reviewed-by: Guo Ren Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/include/asm/sbi.h | 27 ++++++++++++++++++++++----- arch/riscv/kernel/cpu_ops_sbi.c | 2 +- arch/riscv/kvm/vcpu_sbi_hsm.c | 4 ++-- 3 files changed, 25 insertions(+), 8 deletions(-) commit 63b13e64a829e7b12fba81fccbea0d5448fc0c24 Author: Anup Patel Date: Thu Feb 10 11:19:42 2022 +0530 RISC-V: Add arch functions for non-retentive suspend entry/exit The hart registers and CSRs are not preserved in non-retentative suspend state so we provide arch specific helper functions which will save/restore hart context upon entry/exit to non-retentive suspend state. These helper functions can be used by cpuidle drivers for non-retentive suspend entry/exit. Signed-off-by: Anup Patel Signed-off-by: Anup Patel Reviewed-by: Guo Ren Signed-off-by: Palmer Dabbelt arch/riscv/include/asm/asm.h | 27 +++++++++ arch/riscv/include/asm/suspend.h | 36 +++++++++++ arch/riscv/kernel/Makefile | 2 + arch/riscv/kernel/asm-offsets.c | 3 + arch/riscv/kernel/head.S | 21 ------- arch/riscv/kernel/suspend.c | 87 ++++++++++++++++++++++++++ arch/riscv/kernel/suspend_entry.S | 124 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 279 insertions(+), 21 deletions(-) commit e1de2c93e78740383db1a0ff626d8ca2cdc28aaf Author: Anup Patel Date: Thu Feb 10 11:19:41 2022 +0530 RISC-V: Rename relocate() and make it global The low-level relocate() function enables mmu and relocates execution to link-time addresses. We rename relocate() function to relocate_enable_mmu() function which is more informative. Also, the relocate_enable_mmu() function will be used in the resume path when a CPU wakes-up from a non-retentive suspend so we make it global symbol. Signed-off-by: Anup Patel Signed-off-by: Anup Patel Reviewed-by: Guo Ren Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/kernel/head.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit f6e64b66629e8fff0997825ade06619f09a06583 Author: Anup Patel Date: Thu Feb 10 11:19:40 2022 +0530 RISC-V: Enable CPU_IDLE drivers We force select CPU_PM and provide asm/cpuidle.h so that we can use CPU IDLE drivers for Linux RISC-V kernel. Signed-off-by: Anup Patel Signed-off-by: Anup Patel Reviewed-by: Guo Ren Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt arch/riscv/Kconfig | 7 +++++++ arch/riscv/configs/defconfig | 1 + arch/riscv/configs/rv32_defconfig | 1 + arch/riscv/include/asm/cpuidle.h | 24 ++++++++++++++++++++++++ arch/riscv/kernel/process.c | 3 ++- 5 files changed, 35 insertions(+), 1 deletion(-) commit afcf5441b9ff22ac57244cd45ff102ebc2e32d1a Author: Dan Li Date: Wed Mar 2 23:43:23 2022 -0800 arm64: Add gcc Shadow Call Stack support Shadow call stacks will be available in GCC >= 12, this patch makes the corresponding kernel configuration available when compiling the kernel with the gcc. Note that the implementation in GCC is slightly different from Clang. With SCS enabled, functions will only pop x30 once in the epilogue, like: str x30, [x18], #8 stp x29, x30, [sp, #-16]! ...... - ldp x29, x30, [sp], #16 //clang + ldr x29, [sp], #16 //GCC ldr x30, [x18, #-8]! Link: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ce09ab17ddd21f73ff2caf6eec3b0ee9b0e1a11e Reviewed-by: Nathan Chancellor Reviewed-by: Kees Cook Reviewed-by: Nick Desaulniers Signed-off-by: Dan Li Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220303074323.86282-1-ashimida@linux.alibaba.com arch/Kconfig | 19 ++++++++++--------- arch/arm64/Kconfig | 2 +- include/linux/compiler-gcc.h | 4 ++++ 3 files changed, 15 insertions(+), 10 deletions(-) commit a485e1dacdb09802ad0ba1126bc4d029773ae1b2 Author: Xiongwei Song Date: Thu Mar 10 22:07:01 2022 +0800 mm: slub: Delete useless parameter of alloc_slab_page() The parameter @s is useless for alloc_slab_page(). It was added in 2014 by commit 5dfb41750992 ("sl[au]b: charge slabs to kmemcg explicitly"). The need for it was removed in 2020 by commit 1f3147b49d75 ("mm: slub: call account_slab_page() after slab page initialization"). Let's delete it. [willy@infradead.org: Added detailed history of @s] Signed-off-by: Xiongwei Song Reviewed-by: Matthew Wilcox (Oracle) Acked-by: David Rientjes Reviewed-by: Roman Gushchin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220310140701.87908-3-sxwjean@me.com mm/slub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 382627824afb09cd86192f4b649fca8c5bfe5f40 Author: Xiongwei Song Date: Thu Mar 10 22:07:00 2022 +0800 mm: slab: Delete unused SLAB_DEACTIVATED flag Since commit 9855609bde03 ("mm: memcg/slab: use a single set of kmem_caches for all accounted allocations") deleted all SLAB_DEACTIVATED users, therefore this flag is not needed any more, let's delete it. Signed-off-by: Xiongwei Song Acked-by: David Rientjes Reviewed-by: Roman Gushchin Acked-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220310140701.87908-2-sxwjean@me.com include/linux/slab.h | 3 --- 1 file changed, 3 deletions(-) commit b1c62645758eb438179e3a0769168cb7b0a94d6b Author: Jens Axboe Date: Wed Mar 9 11:27:52 2022 -0700 io_uring: recycle provided buffers if request goes async If we are using provided buffers, it's less than useful to have a buffer selected and pinned if a request needs to go async or arms poll for notification trigger on when we can process it. Recycle the buffer in those events, so we don't pin it for the duration of the request. Signed-off-by: Jens Axboe fs/io_uring.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) commit 2be2eb02e2f5a096c351e5b70c46cfef259dabcd Author: Jens Axboe Date: Thu Mar 10 09:54:25 2022 -0700 io_uring: ensure reads re-import for selected buffers If we drop buffers between scheduling a retry, then we need to re-import when we start the request again. Signed-off-by: Jens Axboe fs/io_uring.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 1922260175604ff052ee220f50d12d484770c1d8 Merge: 3b03fc9ac3ef 83fe43abdacf Author: Kalle Valo Date: Thu Mar 10 18:48:16 2022 +0200 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.18. Major changes: ath6kl * add device ID for WLU5150-D81 commit 3b03fc9ac3ef013c7de80aae7aa44425507f0afc Merge: ea37206459ac 8594ab868799 Author: Kalle Valo Date: Thu Mar 10 18:46:32 2022 +0200 Merge tag 'iwlwifi-next-for-kalle-2022-03-10' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next iwlwifi patches for v5.18 * Mostly debugging infra changes; * Some more work on the Bz family of devices; * Bump the FW API twice; * Some other small fixes, clean-ups and improvements. commit 9af177ee3ef14c17ef10893c257fa4e2008a3d74 Author: Jens Axboe Date: Wed Mar 9 16:46:07 2022 -0700 io_uring: retry early for reads if we can poll Most of the logic in io_read() deals with regular files, and in some ways it would make sense to split the handling into S_IFREG and others. But at least for retry, we don't need to bother setting up a bunch of state just to abort in the loop later. In particular, don't bother forcing setup of async data for a normal non-vectored read when we don't need it. Signed-off-by: Jens Axboe fs/io_uring.c | 3 +++ 1 file changed, 3 insertions(+) commit ea37206459ac020b6d6e400cd77ba4d39767e0dc Author: Ping-Ke Shih Date: Mon Mar 7 14:04:57 2022 +0800 rtw89: 8852c: process logic efuse map Add a struct to access logic efuse map, and fill data according to the map. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-14-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/rtw8852c.c | 67 +++++++++++++++++++++++++++ drivers/net/wireless/realtek/rtw89/rtw8852c.h | 62 +++++++++++++++++++++++++ 2 files changed, 129 insertions(+) commit a82174c6a1755e5a47ff8ae47b3db35c02e72e90 Author: Ping-Ke Shih Date: Mon Mar 7 14:04:56 2022 +0800 rtw89: 8852c: process efuse of phycap Read phycap data programmed in efuse, and store them into array. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-13-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 4 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 159 ++++++++++++++++++++++++++ drivers/net/wireless/realtek/rtw89/rtw8852c.h | 2 + 3 files changed, 165 insertions(+) commit bdfbf06c2c286df9c0b01c2189c328f26bfeb62b Author: Ping-Ke Shih Date: Mon Mar 7 14:04:55 2022 +0800 rtw89: support DAV efuse reading operation DAV is an another efuse region that new chip, like 8852C, has this region. Extend the code to read it, and convert the physical map to logical map followed by original logical map. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-12-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 2 + drivers/net/wireless/realtek/rtw89/efuse.c | 160 ++++++++++++++++++++++++-- drivers/net/wireless/realtek/rtw89/mac.c | 24 ++++ drivers/net/wireless/realtek/rtw89/mac.h | 12 ++ drivers/net/wireless/realtek/rtw89/reg.h | 11 ++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 2 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 6 + 7 files changed, 208 insertions(+), 9 deletions(-) commit 79d099e022ae19313701ec5463c533e7a968e6f6 Author: Ping-Ke Shih Date: Mon Mar 7 14:04:54 2022 +0800 rtw89: 8852c: add chip::dle_mem These tables are used to configure hardware buffer size according to operating mode. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-11-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 1 + drivers/net/wireless/realtek/rtw89/mac.c | 62 +++++++++++++++++++++++++++ drivers/net/wireless/realtek/rtw89/mac.h | 10 +++++ drivers/net/wireless/realtek/rtw89/reg.h | 1 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 12 ++++++ 5 files changed, 86 insertions(+) commit ab8a56716b11850b1cc22fd147ca1b970e99937c Author: Ping-Ke Shih Date: Mon Mar 7 14:04:53 2022 +0800 rtw89: add page_regs to handle v1 chips These registers are used to configure and access page size of HCI. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-10-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 16 +++++++ drivers/net/wireless/realtek/rtw89/mac.c | 60 +++++++++++++++++---------- drivers/net/wireless/realtek/rtw89/reg.h | 39 +++++++++++++++++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 16 +++++++ drivers/net/wireless/realtek/rtw89/rtw8852c.c | 16 +++++++ 5 files changed, 124 insertions(+), 23 deletions(-) commit e8955811c6588925d0eae3f81a9e6427fb37ca16 Author: Ping-Ke Shih Date: Mon Mar 7 14:04:52 2022 +0800 rtw89: add chip_info::{h2c,c2h}_reg to support more chips This is a register-based H2C/C2H interface to exchange data with firmware. Since the register addresses of 8852A and 8852C are different, add fields to chip_info to support this. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-9-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 4 ++++ drivers/net/wireless/realtek/rtw89/fw.c | 20 ++++++++------------ drivers/net/wireless/realtek/rtw89/reg.h | 11 +++++++++++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 15 +++++++++++++++ drivers/net/wireless/realtek/rtw89/rtw8852c.c | 15 +++++++++++++++ 5 files changed, 53 insertions(+), 12 deletions(-) commit 2af64b4af48e0c5adfe25b46d21ee51fb86d33cf Author: Ping-Ke Shih Date: Mon Mar 7 14:04:51 2022 +0800 rtw89: add hci_func_en_addr to support variant generation The HCI_FUNC_EN address of 8852C is different from existing chipset, so add a chip_info::hci_func_en_addr to fill the address individually. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-8-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 2 ++ drivers/net/wireless/realtek/rtw89/mac.c | 4 +++- drivers/net/wireless/realtek/rtw89/reg.h | 2 ++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 1 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) commit 2a7e54db40f0e140796dfb6a8fddeafc99f11644 Author: Ping-Ke Shih Date: Mon Mar 7 14:04:50 2022 +0800 rtw89: add power_{on/off}_func New chipset uses individual power_{on/off} functions to replace old power sequences, because it is hard to represent new complicated flow in a sequence table. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-7-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 2 + drivers/net/wireless/realtek/rtw89/mac.c | 34 ++++- drivers/net/wireless/realtek/rtw89/mac.h | 26 ++++ drivers/net/wireless/realtek/rtw89/reg.h | 57 ++++++++ drivers/net/wireless/realtek/rtw89/rtw8852a.c | 2 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 183 ++++++++++++++++++++++++++ 6 files changed, 301 insertions(+), 3 deletions(-) commit a8bdac12048407d3ff519adf53c619f77147949a Author: Ping-Ke Shih Date: Mon Mar 7 14:04:49 2022 +0800 rtw89: read chip version depends on chip ID Only 8852A may get wrong chip version if power isn't on, so it needs additional actions to correct the version. Later chips don't need those. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-6-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e4133f269eb78211ab1ef7f35018092ac299c1a6 Author: Ping-Ke Shih Date: Mon Mar 7 14:04:48 2022 +0800 rtw89: pci: use a struct to describe all registers address related to DMA channel We have had a struct rtw89_pci_ch_dma_addr to describe register address, so use it as regular. Since the addresses should be changed dynamically according to operating mode, I don't change it to be constant. These changes don't affect the logic, so I put them in this separated patch. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-5-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/pci.c | 35 +++++++++++++------------------- drivers/net/wireless/realtek/rtw89/pci.h | 6 +----- 2 files changed, 15 insertions(+), 26 deletions(-) commit 97d61bf94026e0613fad6c4b96f68a407ce94cf6 Author: Ping-Ke Shih Date: Mon Mar 7 14:04:47 2022 +0800 rtw89: pci: add V1 of PCI channel address 8852CE use V1 address, and flow is totally shared with 8852AE. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-4-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/pci.c | 182 ++++++++++++++----------- drivers/net/wireless/realtek/rtw89/pci.h | 67 +++++++++ drivers/net/wireless/realtek/rtw89/rtw8852ae.c | 1 + drivers/net/wireless/realtek/rtw89/rtw8852ce.c | 1 + 4 files changed, 175 insertions(+), 76 deletions(-) commit 4a9e48accf2d459370abf05cb1a945895b5b9719 Author: Ping-Ke Shih Date: Mon Mar 7 14:04:46 2022 +0800 rtw89: pci: add struct rtw89_pci_info Use this struct to implement chip::ops related to PCI interface. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-3-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.h | 7 +++++++ drivers/net/wireless/realtek/rtw89/pci.c | 1 + drivers/net/wireless/realtek/rtw89/pci.h | 3 +++ drivers/net/wireless/realtek/rtw89/rtw8852ae.c | 6 ++++++ drivers/net/wireless/realtek/rtw89/rtw8852ce.c | 6 ++++++ 5 files changed, 23 insertions(+) commit 0ac80e05ea329acdb3bf2c9cc37b102b58390759 Author: Ping-Ke Shih Date: Mon Mar 7 14:04:45 2022 +0800 rtw89: 8852c: add 8852c empty files Add these files, and then I can add specific chip::ops or chip::info along with the existing chip. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307060457.56789-2-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/rtw8852c.c | 20 ++++++++++++++ drivers/net/wireless/realtek/rtw89/rtw8852c.h | 12 +++++++++ drivers/net/wireless/realtek/rtw89/rtw8852ce.c | 36 ++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) commit 1b6fe6e0dfecf8c82a64fb87148ad9333fa2f62e Author: Stefan Roesch Date: Fri Feb 25 10:53:26 2022 -0800 io-uring: Make statx API stable One of the key architectual tenets is to keep the parameters for io-uring stable. After the call has been submitted, its value can be changed. Unfortunaltely this is not the case for the current statx implementation. IO-Uring change: This changes replaces the const char * filename pointer in the io_statx structure with a struct filename *. In addition it also creates the filename object during the prepare phase. With this change, the opcode also needs to invoke cleanup, so the filename object gets freed after processing the request. fs change: This replaces the const char* __user filename parameter in the two functions do_statx and vfs_statx with a struct filename *. In addition to be able to correctly construct a filename object a new helper function getname_statx_lookup_flags is introduced. The function makes sure that do_statx and vfs_statx is invoked with the correct lookup flags. Signed-off-by: Stefan Roesch Link: https://lore.kernel.org/r/20220225185326.1373304-2-shr@fb.com Signed-off-by: Jens Axboe fs/internal.h | 4 +++- fs/io_uring.c | 22 ++++++++++++++++++++-- fs/stat.c | 49 +++++++++++++++++++++++++++++++++++-------------- 3 files changed, 58 insertions(+), 17 deletions(-) commit f015725fb59bdc13319b0a3ec16d707b024b5603 Author: Lorenzo Bianconi Date: Tue Mar 8 20:16:13 2022 +0100 MAINTAINERS: add devicetree bindings entry for mt76 Specify devicetree bindings entry for mt76 driver. Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/8cbfeceef642ede408b4922c363953cb243cd87f.1646766851.git.lorenzo@kernel.org MAINTAINERS | 1 + 1 file changed, 1 insertion(+) commit 2386f64ceb33f1a27adbee250c9a280ba6b95d01 Author: Colin Ian King Date: Mon Mar 7 22:32:27 2022 +0000 brcmfmac: make the read-only array pktflags static const Don't populate the read-only array pktflags 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: Kalle Valo Link: https://lore.kernel.org/r/20220307223227.165963-1-colin.i.king@gmail.com drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit adc8682ec69012b68d5ab7123e246d2ad9a6f94b Author: Olivier Langlois Date: Tue Mar 8 17:17:26 2022 -0500 io_uring: Add support for napi_busy_poll The sqpoll thread can be used for performing the napi busy poll in a similar way that it does io polling for file systems supporting direct access bypassing the page cache. The other way that io_uring can be used for napi busy poll is by calling io_uring_enter() to get events. If the user specify a timeout value, it is distributed between polling and sleeping by using the systemwide setting /proc/sys/net/core/busy_poll. The changes have been tested with this program: https://github.com/lano1106/io_uring_udp_ping and the result is: Without sqpoll: NAPI busy loop disabled: rtt min/avg/max/mdev = 40.631/42.050/58.667/1.547 us NAPI busy loop enabled: rtt min/avg/max/mdev = 30.619/31.753/61.433/1.456 us With sqpoll: NAPI busy loop disabled: rtt min/avg/max/mdev = 42.087/44.438/59.508/1.533 us NAPI busy loop enabled: rtt min/avg/max/mdev = 35.779/37.347/52.201/0.924 us Co-developed-by: Hao Xu Signed-off-by: Hao Xu Signed-off-by: Olivier Langlois Link: https://lore.kernel.org/r/810bd9408ffc510ff08269e78dca9df4af0b9e4e.1646777484.git.olivier@trillion01.com Signed-off-by: Jens Axboe fs/io_uring.c | 232 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 231 insertions(+), 1 deletion(-) commit 950e79dd73131a263b2dd7fec521ceafd28d2724 Author: Olivier Langlois Date: Tue Mar 8 17:17:21 2022 -0500 io_uring: minor io_cqring_wait() optimization Move up the block manipulating the sig variable to execute code that may encounter an error and exit first before continuing executing the rest of the function and avoid useless computations Signed-off-by: Olivier Langlois Link: https://lore.kernel.org/r/84513f7cc1b1fb31d8f4cb910aee033391d036b4.1646777484.git.olivier@trillion01.com Signed-off-by: Jens Axboe fs/io_uring.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit cb459950edcf66beaa45688ccd65f3298cf807d0 Author: Lu Jicong Date: Sun Mar 6 09:08:46 2022 +0000 rtlwifi: rtl8192ce: remove duplicated function '_rtl92ce_phy_set_rf_sleep' This function exists in phy_common.c as '_rtl92c_phy_set_rf_sleep'. Switch to the one in common file. Signed-off-by: Lu Jicong Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220306090846.28523-1-jiconglu58@gmail.com .../net/wireless/realtek/rtlwifi/rtl8192ce/phy.c | 32 +--------------------- 1 file changed, 1 insertion(+), 31 deletions(-) commit 857f837d856a5d78bb475b50524f03fd6d458960 Author: Colin Ian King Date: Thu Mar 3 08:58:41 2022 +0000 bcma: gpio: remove redundant re-assignment of chip->owner There are two identical assignments of chip->owner to the same value, the second assignment is redundant and can be removed. Cleans up cppcheck warning: drivers/bcma/driver_gpio.c:184:15: style: Variable 'chip->owner' is reassigned a value before the old one has been used. [redundantAssignment] Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220303085841.1124766-1-colin.i.king@gmail.com drivers/bcma/driver_gpio.c | 1 - 1 file changed, 1 deletion(-) commit 8cbc3d51b4ae5a2875422af9a955f29f73b1fe75 Author: Wang Qing Date: Sun Feb 27 19:14:20 2022 -0800 cw1200: use time_is_after_jiffies() instead of open coding it Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1646018060-61275-1-git-send-email-wangqing@vivo.com drivers/net/wireless/st/cw1200/queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 4f57f06ce2186c31c3da52386125dc57b1cd6f96 Author: Jens Axboe Date: Thu Mar 10 06:27:26 2022 -0700 io_uring: add support for IORING_OP_MSG_RING command This adds support for IORING_OP_MSG_RING, which allows an SQE to signal another ring. That allows either waking up someone waiting on the ring, or even passing a 64-bit value via the user_data field in the CQE. sqe->fd must contain the fd of a ring that should receive the CQE. sqe->off will be propagated to the cqe->user_data on the target ring, and sqe->len will be propagated to cqe->res. The results CQE will have IORING_CQE_F_MSG set in its flags, to indicate that this CQE was generated from a messaging request rather than a SQE issued locally on that ring. This effectively allows passing a 64-bit and a 32-bit quantify between the two rings. This request type has the following request specific error cases: - -EBADFD. Set if the sqe->fd doesn't point to a file descriptor that is of the io_uring type. - -EOVERFLOW. Set if we were not able to deliver a request to the target ring. Signed-off-by: Jens Axboe fs/io_uring.c | 55 +++++++++++++++++++++++++++++++++++++++++++ include/uapi/linux/io_uring.h | 3 +++ 2 files changed, 58 insertions(+) commit 56e4e4538ef0c4f80c4b015b82c4778e3ace55cb Author: Double Lo Date: Mon Feb 21 19:59:47 2022 -0600 MAINTAINERS: brcm80211: remove Infineon maintainers These email addresses no longer work, so remove them from MAINTAINERS. Signed-off-by: Double Lo Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220222015947.169224-1-double.lo@infineon.com MAINTAINERS | 3 --- 1 file changed, 3 deletions(-) commit 19e8b701e258701b52b1e6aea99572518d69a2fb Author: Eric W. Biederman Date: Wed Mar 9 14:03:42 2022 -0600 a.out: Stop building a.out/osf1 support on alpha and m68k There has been repeated discussion on removing a.out support, the most recent was[1]. Having read through a bunch of the discussion it looks like no one has see any reason why we need to keep a.out support. The m68k maintainer has even come out in favor of removing a.out support[2]. At a practical level with only two rarely used architectures building a.out support, it gets increasingly hard to test and to care about. Which means the code will almost certainly bit-rot. Let's see if anyone cares about a.out support on the last two architectures that build it, by disabling the build of the support in Kconfig. If anyone cares, this can be easily reverted, and we can then have a discussion about what it is going to take to support a.out binaries in the long term. [1] https://lkml.kernel.org/r/20220113160115.5375-1-bp@alien8.de [2] https://lkml.kernel.org/r/CAMuHMdUbTNNr16YY1TFe=-uRLjg6yGzgw_RqtAFpyhnOMM5Pvw@mail.gmail.com Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: linux-alpha@vger.kernel.org Cc: Geert Uytterhoeven Cc: linux-m68k@lists.linux-m68k.org Signed-off-by: "Eric W. Biederman" Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/87ilsmdhb5.fsf_-_@email.froward.int.ebiederm.org Acked-by: Geert Uytterhoeven Link: https://lore.kernel.org/lkml/CAMuHMdVLyu6LNONJa1QcMGv__bWSCRvVq9haD7=fOm1k5O3Pnw@mail.gmail.com arch/alpha/Kconfig | 1 - arch/m68k/Kconfig | 1 - 2 files changed, 2 deletions(-) commit 83fe43abdacf78e9fbc7cd19e74768a5434edcce Author: Christian Lamparter Date: Wed Mar 2 20:51:38 2022 +0100 carl9170: devres ar->survey_info driver keeps the same survey_info struct for its lifetime around. This is used because while firmware does help by providing accounting information of the current channel, it doesn't keep track on the remaining channels. Signed-off-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/9b9a059b384f49587f4384ba47f01d3fb2115b22.1646250537.git.chunkeey@gmail.com drivers/net/wireless/ath/carl9170/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit a8da65f901fa45745123d665e80d1151d1bc7134 Author: Christian Lamparter Date: Wed Mar 2 20:51:37 2022 +0100 carl9170: replace bitmap_zalloc with devm_bitmap_zalloc the mem_bitmap is kept around for the lifetime of the driver device. This is a perfect candidate for devm. Signed-off-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/0a79221aa5477501c3def032e95ef8018973a514.1646250537.git.chunkeey@gmail.com drivers/net/wireless/ath/carl9170/main.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) commit 87ddb2fc29f10cf689ff0dfb88a19b7d3687006b Author: Christian Lamparter Date: Wed Mar 2 20:51:36 2022 +0100 carl9170: devres-ing input_allocate_device devres will take care of freeing the input_device once it is no longer needed. Signed-off-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/f81a6ff3b02116c6a448c42eecb546ea5d46c108.1646250537.git.chunkeey@gmail.com drivers/net/wireless/ath/carl9170/main.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) commit 23de0fa0d2a05ff71c7bc8df9d12c9f23be83f13 Author: Christian Lamparter Date: Wed Mar 2 20:51:35 2022 +0100 carl9170: devres-ing hwrng_register usage devres will take care of freeing the hwrng once it is no longer needed. Signed-off-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/d1c16490462a9371ab3cc16a018ef5e08382a35e.1646250537.git.chunkeey@gmail.com drivers/net/wireless/ath/carl9170/carl9170.h | 1 - drivers/net/wireless/ath/carl9170/main.c | 29 +++------------------------- 2 files changed, 3 insertions(+), 27 deletions(-) commit b3e664a7f449805aea492713223d7a5578325136 Author: Rob Herring Date: Thu Mar 3 11:45:14 2022 -0600 dt-bindings: kbuild: Print a warning if yamllint is not found Running yamllint is effectively required for binding schemas, so print a warning if not found rather than silently skipping running it. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220303221417.2486268-1-robh@kernel.org Documentation/devicetree/bindings/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e42fe43a216cab59b6cc0cba96ec23db2d81a5d4 Author: Christian Lamparter Date: Wed Mar 2 20:51:34 2022 +0100 carl9170: replace GFP_ATOMIC in ampdu_action, it can sleep Since ~2010, the driver is allowed to sleep in the ampdu_action callback thanks to: commit 85ad181ea788 ("mac80211: allow drivers to sleep in ampdu_action") Signed-off-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/0036538d0933626a1a5eb2c2c3935cf173028926.1646250537.git.chunkeey@gmail.com drivers/net/wireless/ath/carl9170/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9747a78d5f758a5284751a10aee13c30d02bd5f1 Author: Miaoqian Lin Date: Tue Mar 8 07:02:38 2022 +0000 ath10k: Fix error handling in ath10k_setup_msa_resources The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This function only calls of_node_put() in the regular path. And it will cause refcount leak in error path. Fixes: 727fec790ead ("ath10k: Setup the msa resources before qmi init") Signed-off-by: Miaoqian Lin Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220308070238.19295-1-linmq006@gmail.com drivers/net/wireless/ath/ath10k/snoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 57fe207f752a95e1929e242dfdb21c6dac741e0d Author: Lv Ruyi (CGEL ZTE) Date: Tue Mar 1 01:32:46 2022 +0000 ath11k: remove unneeded flush_workqueue All work currently pending will be done first by calling destroy_workqueue, so there is no need to flush it explicitly. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi (CGEL ZTE) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220301013246.2052570-1-lv.ruyi@zte.com.cn drivers/net/wireless/ath/ath11k/core.c | 1 - 1 file changed, 1 deletion(-) commit 0ac121b86321e6a34db41bb4382875cf43a726af Author: André Apitzsch Date: Wed Mar 2 22:14:36 2022 +0100 ath6kl: add device ID for WLU5150-D81 This device with a male Mini-B USB connector is part of Panasonic TVs. Signed-off-by: André Apitzsch Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220302211436.8746-1-git@apitzsch.eu drivers/net/wireless/ath/ath6kl/usb.c | 1 + 1 file changed, 1 insertion(+) commit cf18fce4ed5c87def7d95554bfc864951b793e4c Author: Ben Dooks Date: Mon Feb 21 21:03:46 2022 +0000 PCI: fu740: Drop redundant '-gpios' from DT GPIO lookup The calls to devm_gpiod_get_optional() have the -gpios at the end of the name but the GPIO core code is already adding the suffix during the lookup. This means the PCIe driver is not finding the necessary reset or power lines to allow initialisation of the PCIe. Drop the redundant '-gpios' when we look up GPIOs from the DT. This bug has not been noticed because if U-Boot has setup the GPIO lines for the hardware when it does the PCIe initialisation (either by booting from PCIe or user command to access PCIe) then the PCIe will work in Linux. The U-Boot as supplied by SiFive does not by default initialise any PCIe component. Link: https://lore.kernel.org/r/20220221210347.1335004-1-ben.dooks@codethink.co.uk Signed-off-by: Ben Dooks Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas drivers/pci/controller/dwc/pcie-fu740.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 982e4430beb94e65c482d36a11dbb779f20c38a7 Author: zhanglianjie Date: Sat Mar 5 21:38:23 2022 +0800 drivers/xen: use helper macro __ATTR_RW Use helper macro __ATTR_RW to define HYPERVISOR_ATTR_RW to make code more clear. Minor readability improvement. Remove extra whitespace [boris: added this comment] Signed-off-by: zhanglianjie Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220305133823.158961-1-zhanglianjie@uniontech.com Signed-off-by: Boris Ostrovsky drivers/xen/sys-hypervisor.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit b359b3a0296a8a9c853c7ee98f9728942d7f0f4e Author: Jiapeng Chong Date: Mon Mar 7 14:25:54 2022 +0800 x86/xen: Fix kerneldoc warning Fix the following W=1 kernel warnings: arch/x86/xen/setup.c:725: warning: expecting prototype for machine_specific_memory_setup(). Prototype was for xen_memory_setup() instead. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220307062554.8334-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Boris Ostrovsky arch/x86/xen/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit eed05744322da07dd7e419432dcedf3c2e017179 Author: Dongli Zhang Date: Wed Mar 2 08:40:32 2022 -0800 xen: delay xen_hvm_init_time_ops() if kdump is boot on vcpu>=32 The sched_clock() can be used very early since commit 857baa87b642 ("sched/clock: Enable sched clock early"). In addition, with commit 38669ba205d1 ("x86/xen/time: Output xen sched_clock time from 0"), kdump kernel in Xen HVM guest may panic at very early stage when accessing &__this_cpu_read(xen_vcpu)->time as in below: setup_arch() -> init_hypervisor_platform() -> x86_init.hyper.init_platform = xen_hvm_guest_init() -> xen_hvm_init_time_ops() -> xen_clocksource_read() -> src = &__this_cpu_read(xen_vcpu)->time; This is because Xen HVM supports at most MAX_VIRT_CPUS=32 'vcpu_info' embedded inside 'shared_info' during early stage until xen_vcpu_setup() is used to allocate/relocate 'vcpu_info' for boot cpu at arbitrary address. However, when Xen HVM guest panic on vcpu >= 32, since xen_vcpu_info_reset(0) would set per_cpu(xen_vcpu, cpu) = NULL when vcpu >= 32, xen_clocksource_read() on vcpu >= 32 would panic. This patch calls xen_hvm_init_time_ops() again later in xen_hvm_smp_prepare_boot_cpu() after the 'vcpu_info' for boot vcpu is registered when the boot vcpu is >= 32. This issue can be reproduced on purpose via below command at the guest side when kdump/kexec is enabled: "taskset -c 33 echo c > /proc/sysrq-trigger" The bugfix for PVM is not implemented due to the lack of testing environment. [boris: xen_hvm_init_time_ops() returns on errors instead of jumping to end] Cc: Joe Jin Signed-off-by: Dongli Zhang Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220302164032.14569-3-dongli.zhang@oracle.com Signed-off-by: Boris Ostrovsky arch/x86/xen/smp_hvm.c | 6 ++++++ arch/x86/xen/time.c | 24 +++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) commit b537bf429a682131f94df166e6daf39ec48fac03 Author: Wang Qing Date: Sun Feb 27 19:15:03 2022 -0800 xen: use time_is_before_eq_jiffies() instead of open coding it Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/1646018104-61415-1-git-send-email-wangqing@vivo.com Signed-off-by: Boris Ostrovsky drivers/xen/balloon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 743bec1b78af174f588956ffbdb9bca4348e3eaf Author: Yihao Han Date: Thu Mar 10 01:28:27 2022 -0800 bpf, test_run: Use kvfree() for memory allocated with kvmalloc() It is allocated with kvmalloc(), the corresponding release function should not be kfree(), use kvfree() instead. Generated by: scripts/coccinelle/api/kfree_mismatch.cocci Fixes: b530e9e1063e ("bpf: Add "live packet" mode for XDP in BPF_PROG_RUN") Signed-off-by: Yihao Han Signed-off-by: Daniel Borkmann Cc: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20220310092828.13405-1-hanyihao@vivo.com net/bpf/test_run.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit eecbfd976e8617125c69e4b3efc89fe34eac7bb1 Author: Toke Høiland-Jørgensen Date: Thu Mar 10 12:02:28 2022 +0100 bpf: Initialise retval in bpf_prog_test_run_xdp() The kernel test robot pointed out that the newly added bpf_test_run_xdp_live() runner doesn't set the retval in the caller (by design), which means that the variable can be passed unitialised to bpf_test_finish(). Fix this by initialising the variable properly. Fixes: b530e9e1063e ("bpf: Add "live packet" mode for XDP in BPF_PROG_RUN") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220310110228.161869-1-toke@redhat.com net/bpf/test_run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f655c088e74f4681134f650b5743174586a61016 Author: Niklas Söderlund Date: Thu Mar 10 13:18:46 2022 +0100 bpftool: Restore support for BPF offload-enabled feature probing Commit 1a56c18e6c2e4e74 ("bpftool: Stop supporting BPF offload-enabled feature probing") removed the support to probe for BPF offload features. This is still something that is useful for NFP NIC that can support offloading of BPF programs. The reason for the dropped support was that libbpf starting with v1.0 would drop support for passing the ifindex to the BPF prog/map/helper feature probing APIs. In order to keep this useful feature for NFP restore the functionality by moving it directly into bpftool. The code restored is a simplified version of the code that existed in libbpf which supposed passing the ifindex. The simplification is that it only targets the cases where ifindex is given and call into libbpf for the cases where it's not. Before restoring support for probing offload features: # bpftool feature probe dev ens4np0 Scanning system call availability... bpf() syscall is available Scanning eBPF program types... Scanning eBPF map types... Scanning eBPF helper functions... eBPF helpers supported for program type sched_cls: eBPF helpers supported for program type xdp: Scanning miscellaneous eBPF features... Large program size limit is NOT available Bounded loop support is NOT available ISA extension v2 is NOT available ISA extension v3 is NOT available With support for probing offload features restored: # bpftool feature probe dev ens4np0 Scanning system call availability... bpf() syscall is available Scanning eBPF program types... eBPF program_type sched_cls is available eBPF program_type xdp is available Scanning eBPF map types... eBPF map_type hash is available eBPF map_type array is available Scanning eBPF helper functions... eBPF helpers supported for program type sched_cls: - bpf_map_lookup_elem - bpf_get_prandom_u32 - bpf_perf_event_output eBPF helpers supported for program type xdp: - bpf_map_lookup_elem - bpf_get_prandom_u32 - bpf_perf_event_output - bpf_xdp_adjust_head - bpf_xdp_adjust_tail Scanning miscellaneous eBPF features... Large program size limit is NOT available Bounded loop support is NOT available ISA extension v2 is NOT available ISA extension v3 is NOT available Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20220310121846.921256-1-niklas.soderlund@corigine.com tools/bpf/bpftool/feature.c | 152 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 139 insertions(+), 13 deletions(-) commit c65f677b62d6180cc174e06f953f7fe860adf6d1 Author: Tobias Huschle Date: Thu Feb 24 16:14:21 2022 +0100 s390/test_unwind: add kretprobe tests Add tests to verify that s390 kretprobes maintain a correct stack chain and ensure their proper function. Reviewed-by: Vasily Gorbik Signed-off-by: Tobias Huschle Signed-off-by: Vasily Gorbik arch/s390/lib/test_unwind.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) commit 63bf38ff5bc3d8cee6c6a089657876d0b669cae1 Author: Tobias Huschle Date: Mon Feb 21 12:55:52 2022 +0100 s390/kprobes: Avoid additional kprobe in kretprobe handling So far, s390 registered a krobe on __kretprobe_trampoline which is called everytime a kretprobe fires. This kprobe would then determine the correct return address and adjust the psw accordingly, such that the kretprobe would branch to the appropriate address after completion. Some other archs handle kretprobes without such an additional kprobe. This approach is adopted to s390 with this patch. Furthermore, the __kretprobe_trampoline now uses an assembler function to correctly gather the register and psw content to be passed to the registered kretprobe handler as struct pt_regs. After completion, the register content and the psw are set based on the contents of said pt_regs struct. Note that a change to the psw address in struct pt_regs will not have an impact, as the probe will still return to the original return address of the probed function. The return address is now recovered by using the appropriate function arch_kretprobe_fixup_return. The no longer needed kprobe is removed. Reviewed-by: Vasily Gorbik Signed-off-by: Tobias Huschle Signed-off-by: Vasily Gorbik arch/s390/include/asm/kprobes.h | 1 + arch/s390/kernel/Makefile | 4 +++- arch/s390/kernel/kprobes.c | 38 +++++++++++------------------- arch/s390/kernel/mcount.S | 51 ++++++++++++++++++++++++++++++++++------- 4 files changed, 60 insertions(+), 34 deletions(-) commit 731efc9613ee073c8944d0d56616d421cf906b0b Author: Vasily Gorbik Date: Fri Feb 25 10:39:02 2022 +0100 s390: convert ".insn" encoding to instruction names With z10 as minimum supported machine generation many ".insn" encodings could be now converted to instruction names. There are couple of exceptions - stfle is used from the als code built for z900 and cannot be converted - few ".insn" directives encode unsupported instruction formats The generated code is identical before/after this change. Acked-by: Ilya Leoshkevich Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/crypto/chacha-s390.S | 20 ++++++++++---------- arch/s390/include/asm/cpu_mf.h | 12 ++++++------ arch/s390/include/asm/pgtable.h | 16 ++++++++-------- arch/s390/include/asm/processor.h | 3 +-- arch/s390/include/asm/timex.h | 2 +- arch/s390/include/asm/tlbflush.h | 4 +--- arch/s390/kernel/entry.S | 4 ++-- arch/s390/kernel/ftrace.c | 2 +- arch/s390/lib/uaccess.c | 12 ++++++------ arch/s390/mm/gmap.c | 2 +- 10 files changed, 37 insertions(+), 40 deletions(-) commit 10bc15ba3a853723267016274b58be6c9a6e64da Author: Vasily Gorbik Date: Fri Feb 25 10:38:23 2022 +0100 s390: assume stckf is always present With z10 as minimum supported machine generation the store-clock-fast facility (25) is always present and checked in als code. Drop alternatives and always use stckf. Acked-by: Ilya Leoshkevich Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/kernel/entry.S | 11 +++-------- arch/s390/kernel/vtime.c | 13 ++++++------- 2 files changed, 9 insertions(+), 15 deletions(-) commit bedc96698f482ac5904998b16ba7a800ec71e220 Author: Vasily Gorbik Date: Fri Feb 25 10:18:14 2022 +0100 s390/nospec: move to single register thunks Assembler generated expoline thunks were in a form __s390_indirect_jump_rXuse_rX when exrl instruction has not been available. Now with z10 as minimum supported machine generation there is no need for 2 register thunks, always generate __s390_indirect_jump_rX versions. Acked-by: Heiko Carstens Acked-by: Sumanth Korikkar Acked-by: Ilya Leoshkevich Signed-off-by: Vasily Gorbik arch/s390/include/asm/nospec-insn.h | 56 ++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 32 deletions(-) commit 4efd417f298bc23bc8b6ac5db5ff79af5ec92ac5 Author: Vasily Gorbik Date: Thu Feb 24 22:43:31 2022 +0100 s390: raise minimum supported machine generation to z10 Machine generations up to z9 (released in May 2006) have been officially out of service for several years now (z9 end of service - January 31, 2019). No distributions build kernels supporting those old machine generations anymore, except Debian, which seems to pick the oldest supported generation. The team supporting Debian on s390 has been notified about the change. Raising minimum supported machine generation to z10 helps to reduce maintenance cost and effectively remove code, which is not getting enough testing coverage due to lack of older hardware and distributions support. Besides that this unblocks some optimization opportunities and allows to use wider instruction set in asm files for future features implementation. Due to this change spectre mitigation and usercopy implementations could be drastically simplified and many newer instructions could be converted from ".insn" encoding to instruction names. Acked-by: Ilya Leoshkevich Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/Kconfig | 68 +-------------- arch/s390/Makefile | 6 -- arch/s390/include/asm/bitops.h | 12 --- arch/s390/include/asm/lowcore.h | 8 +- arch/s390/include/asm/nospec-insn.h | 34 -------- arch/s390/include/asm/timex.h | 4 - arch/s390/include/asm/uaccess.h | 18 ---- arch/s390/kernel/asm-offsets.c | 1 - arch/s390/kernel/cache.c | 6 -- arch/s390/kernel/ftrace.c | 17 +--- arch/s390/kernel/ftrace.h | 2 - arch/s390/kernel/mcount.S | 11 --- arch/s390/kernel/module.c | 12 +-- arch/s390/kernel/nospec-branch.c | 6 -- arch/s390/kernel/perf_cpum_cf.c | 11 ++- arch/s390/kernel/processor.c | 22 +---- arch/s390/kernel/setup.c | 1 - arch/s390/kernel/smp.c | 1 - arch/s390/kernel/uprobes.c | 16 +--- arch/s390/lib/uaccess.c | 170 ++---------------------------------- arch/s390/mm/vmem.c | 8 +- arch/s390/net/bpf_jit_comp.c | 31 ++----- arch/s390/tools/gen_facilities.c | 8 -- 23 files changed, 38 insertions(+), 435 deletions(-) commit 432b1cc78e985d3c783f1accb2507fbf5a87583d Author: Janis Schoetterl-Glausch Date: Fri Feb 11 19:22:06 2022 +0100 s390/uaccess: Add copy_from/to_user_key functions Add copy_from/to_user_key functions, which perform storage key checking. These functions can be used by KVM for emulating instructions that need to be key checked. These functions differ from their non _key counterparts in include/linux/uaccess.h only in the additional key argument and must be kept in sync with those. Since the existing uaccess implementation on s390 makes use of move instructions that support having an additional access key supplied, we can implement raw_copy_from/to_user_key by enhancing the existing implementation. Signed-off-by: Janis Schoetterl-Glausch Acked-by: Heiko Carstens Reviewed-by: Christian Borntraeger Acked-by: Janosch Frank Link: https://lore.kernel.org/r/20220211182215.2730017-2-scgl@linux.ibm.com Signed-off-by: Vasily Gorbik arch/s390/include/asm/uaccess.h | 22 +++++++++++ arch/s390/lib/uaccess.c | 81 ++++++++++++++++++++++++++++++++--------- 2 files changed, 85 insertions(+), 18 deletions(-) commit 602bf1687e6f475de2fe29bb1ed81d03bdc06b6d Author: Vasily Gorbik Date: Sun Mar 6 22:30:42 2022 +0100 s390/nospec: align and size extern thunks Kernel has full control over how extern thunks generated by arch/s390/lib/expoline.S look like. Align them to 16 bytes like other symbols. Also set proper symbols size which is important for tooling. Acked-by: Ilya Leoshkevich Acked-by: Sumanth Korikkar Signed-off-by: Vasily Gorbik arch/s390/include/asm/nospec-insn.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) commit 1d2ad084800edad81cdc955304272742b10721c7 Author: Vasily Gorbik Date: Sun Mar 6 20:56:07 2022 +0100 s390/nospec: add an option to use thunk-extern Currently with -mindirect-branch=thunk and -mfunction-return=thunk compiler options expoline thunks are put into individual COMDAT group sections. s390 is the only architecture which has group sections and it has implications for kpatch and objtool tools support. Using -mindirect-branch=thunk-extern and -mfunction-return=thunk-extern is an alternative, which comes with a need to generate all required expoline thunks manually. Unfortunately modules area is too far away from the kernel image, and expolines from the kernel image cannon be used. But since all new distributions (except Debian) build kernels for machine generations newer than z10, where "exrl" instruction is available, that leaves only 16 expolines thunks possible. Provide an option to build the kernel with -mindirect-branch=thunk-extern and -mfunction-return=thunk-extern for z10 or newer. This also requires to postlink expoline thunks into all modules explicitly. Currently modules already contain most expolines anyhow. Unfortunately -mindirect-branch=thunk-extern and -mfunction-return=thunk-extern options support is broken in gcc <= 11.2. Additional compile test is required to verify proper gcc support. Acked-by: Ilya Leoshkevich Co-developed-by: Sumanth Korikkar Signed-off-by: Sumanth Korikkar Signed-off-by: Vasily Gorbik arch/s390/Kconfig | 15 +++++++++++++++ arch/s390/Makefile | 14 +++++++++----- arch/s390/include/asm/nospec-insn.h | 10 ++++++++++ arch/s390/lib/Makefile | 1 + arch/s390/lib/expoline.S | 12 ++++++++++++ arch/s390/tools/gcc-thunk-extern.sh | 24 ++++++++++++++++++++++++ scripts/mod/modpost.c | 5 +++++ 7 files changed, 76 insertions(+), 5 deletions(-) commit eed38cd2f46f6c4f97c730abd8f23a19db0afbc8 Author: Vasily Gorbik Date: Mon Feb 28 13:15:59 2022 +0100 s390/nospec: generate single register thunks if possible Currently assembler generated expoline thunks are always in a form __s390_indirect_jump_rXuse_rX even when exrl instruction is available and no additional register is utilized. Generate __s390_indirect_jump_rX versions using a single register if the kernel is built for z10 or newer machine, which have exrl instruction available. Thunks generated are identical to the ones generated by the compiler. This helps to reduce the number of thunks for newer machines generations. Acked-by: Sumanth Korikkar Acked-by: Ilya Leoshkevich Signed-off-by: Vasily Gorbik arch/s390/include/asm/nospec-insn.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit 6c2797cd51218a451a52edc2ca533f89d1a2af10 Author: Niklas Schnelle Date: Tue Mar 8 10:49:58 2022 +0100 s390/pci: make zpci_set_irq()/zpci_clear_irq() static Commit c1e18c17bda68 ("s390/pci: add zpci_set_irq()/zpci_clear_irq()") made zpci_set_irq()/zpci_clear_irq() non-static in preparation for using them in zpci_hot_reset_device(). The version of zpci_hot_reset_device() that was finally merged however exploits the fact that IRQs and DMA is implicitly disabled by clp_disable_fh() so the call to zpci_clear_irq() was never added. There are no other calls outside pci_irq.c so lets make both functions static. Signed-off-by: Niklas Schnelle Signed-off-by: Vasily Gorbik arch/s390/include/asm/pci.h | 3 --- arch/s390/pci/pci_irq.c | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) commit 327e8ba54a212f707a68670c9372747b7a32bb92 Author: Kai Vehmanen Date: Wed Mar 9 20:24:39 2022 +0200 ALSA: hda/i915 - avoid hung task timeout in i915 wait If kernel is built with hung task detection enabled and CONFIG_DEFAULT_HUNG_TASK_TIMEOUT set to less than 60 seconds, snd_hdac_i915_init() will trigger the hung task timeout in case i915 is not available and taint the kernel. Use wait_for_completion_killable_timeout() for the wait to avoid this problem. Co-developed-by: Ramalingam C Signed-off-by: Ramalingam C Signed-off-by: Kai Vehmanen Acked-by: Tvrtko Ursulin Link: https://lore.kernel.org/r/20220309182439.1053856-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai sound/hda/hdac_i915.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit cc3cec8367cba76a8ae4c271eba8450f3efc1ba3 Author: Jens Axboe Date: Tue Mar 8 17:46:52 2022 -0700 io_uring: speedup provided buffer handling In testing high frequency workloads with provided buffers, we spend a lot of time in allocating and freeing the buffer units themselves. Rather than repeatedly free and alloc them, add a recycling cache instead. There are two caches: - ctx->io_buffers_cache. This is the one we grab from in the submission path, and it's protected by ctx->uring_lock. For inline completions, we can recycle straight back to this cache and not need any extra locking. - ctx->io_buffers_comp. If we're not under uring_lock, then we use this list to recycle buffers. It's protected by the completion_lock. On adding a new buffer, check io_buffers_cache. If it's empty, check if we can splice entries from the io_buffers_comp_cache. This reduces about 5-10% of overhead from provided buffers, bringing it pretty close to the non-provided path. Signed-off-by: Jens Axboe fs/io_uring.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 117 insertions(+), 22 deletions(-) commit e7a6c00dc77aedf27a601738ea509f1caea6d673 Author: Jens Axboe Date: Fri Mar 4 08:22:22 2022 -0700 io_uring: add support for registering ring file descriptors Lots of workloads use multiple threads, in which case the file table is shared between them. This makes getting and putting the ring file descriptor for each io_uring_enter(2) system call more expensive, as it involves an atomic get and put for each call. Similarly to how we allow registering normal file descriptors to avoid this overhead, add support for an io_uring_register(2) API that allows to register the ring fds themselves: 1) IORING_REGISTER_RING_FDS - takes an array of io_uring_rsrc_update structs, and registers them with the task. 2) IORING_UNREGISTER_RING_FDS - takes an array of io_uring_src_update structs, and unregisters them. When a ring fd is registered, it is internally represented by an offset. This offset is returned to the application, and the application then uses this offset and sets IORING_ENTER_REGISTERED_RING for the io_uring_enter(2) system call. This works just like using a registered file descriptor, rather than a real one, in an SQE, where IOSQE_FIXED_FILE gets set to tell io_uring that we're using an internal offset/descriptor rather than a real file descriptor. In initial testing, this provides a nice bump in performance for threaded applications in real world cases where the batch count (eg number of requests submitted per io_uring_enter(2) invocation) is low. In a microbenchmark, submitting NOP requests, we see the following increases in performance: Requests per syscall Baseline Registered Increase ---------------------------------------------------------------- 1 ~7030K ~8080K +15% 2 ~13120K ~14800K +13% 4 ~22740K ~25300K +11% Co-developed-by: Xiaoguang Wang Signed-off-by: Jens Axboe fs/io_uring.c | 182 ++++++++++++++++++++++++++++++++++++++++-- include/linux/io_uring.h | 5 +- include/uapi/linux/io_uring.h | 13 ++- 3 files changed, 190 insertions(+), 10 deletions(-) commit 63c36549737e8132e89ec6563d26523895ae3121 Author: Dylan Yudaken Date: Thu Feb 24 02:51:57 2022 -0800 io_uring: documentation fixup Fix incorrect name reference in comment. ki_filp does not exist in the struct, but file does. Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220224105157.1332353-1-dylany@fb.com Signed-off-by: Jens Axboe fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b4aec40015953b65f2f114641e7fd7714c8df8e6 Author: Dylan Yudaken Date: Tue Feb 22 02:55:03 2022 -0800 io_uring: do not recalculate ppos unnecessarily There is a slight optimisation to be had by calculating the correct pos pointer inside io_kiocb_update_pos and then using that later. It seems code size drops by a bit: 000000000000a1b0 0000000000000400 t io_read 000000000000a5b0 0000000000000319 t io_write vs 000000000000a1b0 00000000000003f6 t io_read 000000000000a5b0 0000000000000310 t io_write Signed-off-by: Dylan Yudaken Reviewed-by: Pavel Begunkov Signed-off-by: Jens Axboe fs/io_uring.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit d34e1e5b396a0dbaa4a29b7138df662cfb9d8e8e Author: Dylan Yudaken Date: Tue Feb 22 02:55:02 2022 -0800 io_uring: update kiocb->ki_pos at execution time Update kiocb->ki_pos at execution time rather than in io_prep_rw(). io_prep_rw() happens before the job is enqueued to a worker and so the offset might be read multiple times before being executed once. Ensures that the file position in a set of _linked_ SQEs will be only obtained after earlier SQEs have completed, and so will include their incremented file position. Signed-off-by: Dylan Yudaken Reviewed-by: Pavel Begunkov Signed-off-by: Jens Axboe fs/io_uring.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) commit af9c45ecebaf1b428306f41421f4bcffe439f735 Author: Dylan Yudaken Date: Tue Feb 22 02:55:01 2022 -0800 io_uring: remove duplicated calls to io_kiocb_ppos io_kiocb_ppos is called in both branches, and it seems that the compiler does not fuse this. Fusing removes a few bytes from loop_rw_iter. Before: $ nm -S fs/io_uring.o | grep loop_rw_iter 0000000000002430 0000000000000124 t loop_rw_iter After: $ nm -S fs/io_uring.o | grep loop_rw_iter 0000000000002430 000000000000010d t loop_rw_iter Signed-off-by: Dylan Yudaken Reviewed-by: Pavel Begunkov Signed-off-by: Jens Axboe fs/io_uring.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit c5020bc8d9295ad4a3e09d858a28b26a25d4afab Author: Olivier Langlois Date: Wed Feb 16 14:53:42 2022 -0500 io_uring: Remove unneeded test in io_run_task_work_sig() Avoid testing TIF_NOTIFY_SIGNAL twice by calling task_sigpending() directly from io_run_task_work_sig() Signed-off-by: Olivier Langlois Link: https://lore.kernel.org/r/bd7c0495f7656e803e5736708591bb665e6eaacd.1645041650.git.olivier@trillion01.com Signed-off-by: Jens Axboe fs/io_uring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 502c87d65564cbfd65b1621309bcd900390eca81 Author: Stefan Roesch Date: Mon Feb 14 10:04:30 2022 -0800 io-uring: Make tracepoints consistent. This makes the io-uring tracepoints consistent. Where it makes sense the tracepoints start with the following four fields: - context (ring) - request - user_data - opcode. Signed-off-by: Stefan Roesch Link: https://lore.kernel.org/r/20220214180430.70572-3-shr@fb.com Signed-off-by: Jens Axboe fs/io_uring.c | 24 +-- include/trace/events/io_uring.h | 318 +++++++++++++++++++--------------------- 2 files changed, 166 insertions(+), 176 deletions(-) commit d5ec1dfaf59bf1632d7f2114d209bf80bfbd907a Author: Stefan Roesch Date: Mon Feb 14 10:04:29 2022 -0800 io-uring: add __fill_cqe function This introduces the __fill_cqe function. This is necessary to correctly issue the io_uring_complete tracepoint. Signed-off-by: Stefan Roesch Link: https://lore.kernel.org/r/20220214180430.70572-2-shr@fb.com Signed-off-by: Jens Axboe fs/io_uring.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) commit 86127bb18aea7e553cfd0842bcd33a6dc80bfbc8 Author: Hao Xu Date: Sun Feb 6 17:52:41 2022 +0800 io-wq: use IO_WQ_ACCT_NR rather than hardcoded number It's better to use the defined enum stuff not the hardcoded number to define array. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20220206095241.121485-4-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe fs/io-wq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e13fb1fe1483f6cd6452f25b866ffadf5ee0eff6 Author: Hao Xu Date: Sun Feb 6 17:52:40 2022 +0800 io-wq: reduce acct->lock crossing functions lock/unlock reduce acct->lock lock and unlock in different functions to make the code clearer. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20220206095241.121485-3-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe fs/io-wq.c | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) commit 42abc95f05bff5180ac40c7ba5726b73c1d5e2f4 Author: Hao Xu Date: Sun Feb 6 17:52:39 2022 +0800 io-wq: decouple work_list protection from the big wqe->lock wqe->lock is abused, it now protects acct->work_list, hash stuff, nr_workers, wqe->free_list and so on. Lets first get the work_list out of the wqe-lock mess by introduce a specific lock for work list. This is the first step to solve the huge contension between work insertion and work consumption. good thing: - split locking for bound and unbound work list - reduce contension between work_list visit and (worker's)free_list. For the hash stuff, since there won't be a work with same file in both bound and unbound work list, thus they won't visit same hash entry. it works well to use the new lock to protect hash stuff. Results: set max_unbound_worker = 4, test with echo-server: nice -n -15 ./io_uring_echo_server -p 8081 -f -n 1000 -l 16 (-n connection, -l workload) before this patch: Samples: 2M of event 'cycles:ppp', Event count (approx.): 1239982111074 Overhead Command Shared Object Symbol 28.59% iou-wrk-10021 [kernel.vmlinux] [k] native_queued_spin_lock_slowpath 8.89% io_uring_echo_s [kernel.vmlinux] [k] native_queued_spin_lock_slowpath 6.20% iou-wrk-10021 [kernel.vmlinux] [k] _raw_spin_lock 2.45% io_uring_echo_s [kernel.vmlinux] [k] io_prep_async_work 2.36% iou-wrk-10021 [kernel.vmlinux] [k] _raw_spin_lock_irqsave 2.29% iou-wrk-10021 [kernel.vmlinux] [k] io_worker_handle_work 1.29% io_uring_echo_s [kernel.vmlinux] [k] io_wqe_enqueue 1.06% iou-wrk-10021 [kernel.vmlinux] [k] io_wqe_worker 1.06% io_uring_echo_s [kernel.vmlinux] [k] _raw_spin_lock 1.03% iou-wrk-10021 [kernel.vmlinux] [k] __schedule 0.99% iou-wrk-10021 [kernel.vmlinux] [k] tcp_sendmsg_locked with this patch: Samples: 1M of event 'cycles:ppp', Event count (approx.): 708446691943 Overhead Command Shared Object Symbol 16.86% iou-wrk-10893 [kernel.vmlinux] [k] native_queued_spin_lock_slowpat 9.10% iou-wrk-10893 [kernel.vmlinux] [k] _raw_spin_lock 4.53% io_uring_echo_s [kernel.vmlinux] [k] native_queued_spin_lock_slowpat 2.87% iou-wrk-10893 [kernel.vmlinux] [k] io_worker_handle_work 2.57% iou-wrk-10893 [kernel.vmlinux] [k] _raw_spin_lock_irqsave 2.56% io_uring_echo_s [kernel.vmlinux] [k] io_prep_async_work 1.82% io_uring_echo_s [kernel.vmlinux] [k] _raw_spin_lock 1.33% iou-wrk-10893 [kernel.vmlinux] [k] io_wqe_worker 1.26% io_uring_echo_s [kernel.vmlinux] [k] try_to_wake_up spin_lock failure from 25.59% + 8.89% = 34.48% to 16.86% + 4.53% = 21.39% TPS is similar, while cpu usage is from almost 400% to 350% Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20220206095241.121485-2-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe fs/io-wq.c | 96 ++++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 52 insertions(+), 44 deletions(-) commit f0a4e62bb5343b3b7163bc851cfb4bebfefcc4e7 Author: Nathan Chancellor Date: Mon Feb 7 09:24:11 2022 -0700 io_uring: Fix use of uninitialized ret in io_eventfd_register() Clang warns: fs/io_uring.c:9396:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized] return ret; ^~~ fs/io_uring.c:9373:13: note: initialize the variable 'ret' to silence this warning int fd, ret; ^ = 0 1 warning generated. Just return 0 directly and reduce the scope of ret to the if statement, as that is the only place that it is used, which is how the function was before the fixes commit. Fixes: 1a75fac9a0f9 ("io_uring: avoid ring quiesce while registering/unregistering eventfd") Link: https://github.com/ClangBuiltLinux/linux/issues/1579 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20220207162410.1013466-1-nathan@kernel.org Signed-off-by: Jens Axboe fs/io_uring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 8bb649ee1da321ec3a1bbec048a425c5ea18ea21 Author: Usama Arif Date: Fri Feb 4 14:51:17 2022 +0000 io_uring: remove ring quiesce for io_uring_register None of the opcodes in io_uring_register use ring quiesce anymore. Hence io_register_op_must_quiesce always returns false and io_ctx_quiesce is never called. Signed-off-by: Usama Arif Link: https://lore.kernel.org/r/20220204145117.1186568-6-usama.arif@bytedance.com Signed-off-by: Jens Axboe fs/io_uring.c | 83 ----------------------------------------------------------- 1 file changed, 83 deletions(-) commit ff16cfcfdaafa3c4287be92c6944fb8ea6dc75d1 Author: Usama Arif Date: Fri Feb 4 14:51:16 2022 +0000 io_uring: avoid ring quiesce while registering restrictions and enabling rings IORING_SETUP_R_DISABLED prevents submitting requests and so there will be no requests until IORING_REGISTER_ENABLE_RINGS is called. And IORING_REGISTER_RESTRICTIONS works only before IORING_REGISTER_ENABLE_RINGS is called. Hence ring quiesce is not needed for these opcodes. Signed-off-by: Usama Arif Link: https://lore.kernel.org/r/20220204145117.1186568-5-usama.arif@bytedance.com Signed-off-by: Jens Axboe fs/io_uring.c | 2 ++ 1 file changed, 2 insertions(+) commit c75312dd592b31427caa88170b61fdc3ae5b2891 Author: Usama Arif Date: Fri Feb 4 14:51:15 2022 +0000 io_uring: avoid ring quiesce while registering async eventfd This is done using the RCU data structure (io_ev_fd). eventfd_async is moved from io_ring_ctx to io_ev_fd which is RCU protected hence avoiding ring quiesce which is much more expensive than an RCU lock. The place where eventfd_async is read is already under rcu_read_lock so there is no extra RCU read-side critical section needed. Signed-off-by: Usama Arif Link: https://lore.kernel.org/r/20220204145117.1186568-4-usama.arif@bytedance.com Signed-off-by: Jens Axboe fs/io_uring.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) commit 77bc59b498174ea4f120d477d2cd0cf90fc58235 Author: Usama Arif Date: Fri Feb 4 14:51:14 2022 +0000 io_uring: avoid ring quiesce while registering/unregistering eventfd This is done by creating a new RCU data structure (io_ev_fd) as part of io_ring_ctx that holds the eventfd_ctx. The function io_eventfd_signal is executed under rcu_read_lock with a single rcu_dereference to io_ev_fd so that if another thread unregisters the eventfd while io_eventfd_signal is still being executed, the eventfd_signal for which io_eventfd_signal was called completes successfully. The process of registering/unregistering eventfd is already done under uring_lock so multiple threads won't enter a race condition while registering/unregistering eventfd. With the above approach ring quiesce can be avoided which is much more expensive then using RCU lock. On the system tested, io_uring_register with IORING_REGISTER_EVENTFD takes less than 1ms with RCU lock, compared to 15ms before with ring quiesce. Signed-off-by: Usama Arif Link: https://lore.kernel.org/r/20220204145117.1186568-3-usama.arif@bytedance.com [axboe: long line fixups] Signed-off-by: Jens Axboe fs/io_uring.c | 89 +++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 68 insertions(+), 21 deletions(-) commit 2757be22c0f4c06d359f802fa1fc57286fa26975 Author: Usama Arif Date: Fri Feb 4 14:51:13 2022 +0000 io_uring: remove trace for eventfd The information on whether eventfd is registered is not very useful and would result in the tracepoint being enclosed in an rcu_readlock in a later patch that tries to avoid ring quiesce for registering eventfd. Suggested-by: Jens Axboe Signed-off-by: Usama Arif Link: https://lore.kernel.org/r/20220204145117.1186568-2-usama.arif@bytedance.com Signed-off-by: Jens Axboe fs/io_uring.c | 3 +-- include/trace/events/io_uring.h | 13 +++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) commit 09354ebe10b7c8447559aa1fda2cb3a5ca6034e1 Merge: 9cb727506704 5e02fb590e83 Author: Takashi Iwai Date: Thu Mar 10 14:31:27 2022 +0100 Merge tag 'asoc-fix-v5.17-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Potential fixes for v5.17 Rather more fixes here than I'm comfortable with, we've had several vendors noticing issues late in the release cycle all of which are valid and reasonable fixes but it adds up to a much larger change set than I'd like. Several of the AMD fixes look like cleanups from the subject lines but are actually fixing user visible problems as well. If you were to merge this for 5.18 rather than 5.17 it wouldn't be the end of the world, stable will probably backport everything anyway. commit 2cfdf0b4441aa918c3b18142740c92407b3c35a2 Author: Yihao Han Date: Thu Mar 10 01:48:06 2022 -0800 spi: rockchip-sfc: fix platform_get_irq.cocci warning Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Signed-off-by: Yihao Han Link: https://lore.kernel.org/r/20220310094806.13734-1-hanyihao@vivo.com Signed-off-by: Mark Brown drivers/spi/spi-rockchip-sfc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 6b6bb5e26222021abe1c5360f43b4c2ff1dd012f Author: Colin Ian King Date: Wed Mar 9 16:41:16 2022 +0000 ASoC: atmel: mchp-pdmc: Fix spelling mistake "microchopnes" -> "microphones" There is a spelling mistake in a dev_info message. Fix it. Signed-off-by: Colin Ian King Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220309164116.178685-1-colin.i.king@gmail.com Signed-off-by: Mark Brown sound/soc/atmel/mchp-pdmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3b891513f95cba3944e72c1139ea706d04f3781b Author: Wang Wensheng Date: Thu Mar 10 09:19:02 2022 +0000 ASoC: imx-es8328: Fix error return code in imx_es8328_probe() Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 7e7292dba215 ("ASoC: fsl: add imx-es8328 machine driver") Signed-off-by: Wang Wensheng Link: https://lore.kernel.org/r/20220310091902.129299-1-wangwensheng4@huawei.com Signed-off-by: Mark Brown sound/soc/fsl/imx-es8328.c | 1 + 1 file changed, 1 insertion(+) commit 2588a01431a85a9bb8b2eac9023181ddd714a695 Author: Jiapeng Chong Date: Thu Mar 10 16:27:56 2022 +0800 ASoC: atmel: mchp-pdmc: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq() already prints an error. Eliminate the follow coccicheck warning: ./sound/soc/atmel/mchp-pdmc.c:991:2-9: line 991 is redundant because platform_get_irq() already prints an error. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220310082756.1183-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown sound/soc/atmel/mchp-pdmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 6ddf611219ba8f7c8fa0d26b39710a641e7d37a5 Author: Shengjiu Wang Date: Thu Mar 10 10:37:43 2022 +0800 ASoC: fsl_spdif: Disable TX clock when stop The TX clock source may be changed in next case, need to disable it when stop, otherwise the TX may not work after changing the clock source, error log is: aplay: pcm_write:2058: write error: Input/output error Fixes: a2388a498ad2 ("ASoC: fsl: Add S/PDIF CPU DAI driver") Signed-off-by: Shengjiu Wang Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/1646879863-27711-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown sound/soc/fsl/fsl_spdif.c | 2 ++ 1 file changed, 2 insertions(+) commit 233d2c4a103ac1ce83025029a83d5840b3d2b046 Merge: efb1a2d3d8f5 f535880b2d32 Author: Mark Brown Date: Thu Mar 10 11:33:40 2022 +0000 Clean ups and preparation for IPC abstraction in the SOF driver Merge series from Ranjani Sridharan : In preparation for adding support for the new IPC version that has been introduced in the SOF firmware, this patch set includes some clean ups and necessary modifications to commonly used functions that will be re-used across different IPC-specific code. commit efb1a2d3d8f5c18ab03e9e4a1b7fc732f25e00d6 Merge: 31ef579d433a fe0596a00608 Author: Mark Brown Date: Thu Mar 10 11:33:39 2022 +0000 ALSA/ASoC/SOF/Intel: improve support for ES8336-based platforms Merge series from Pierre-Louis Bossart : This patchset adds a number of improvements for ES8336-based Intel platforms, which are not well supported at all in Linux. Since Christmas 2021, we've seen dozens of reports of broken audio [1]. The fundamental problem is that those platforms were built for Windows but using an I2S codec - instead of the HDaudio traditional solution. As a result, we are missing all the usual information needed to configure the audio card (which I2S, what configuration, DMICs or not, etc). The situation is similar to Baytrail with all possible permutations enabled. Some of the information can be discovered by checking the contents of the 'NHLT' ACPI table. This helps discover at run-time which SSP to use, and the number of microphones present. This NHLT-based solution helps remove quirks that were added earlier. Unfortunately, there are still a number of platform properties that are not described by ACPI, just as GPIOs used for speakers, jack detection inversion, etc. For some case, quirks are still provided in the machine drivers. Additional work will likely be needed, e.g. to detect which MCLK needs to be used, refine the UCM settings, add the ES8326 codec driver, but this is a first-step towards an 'out of the box' experience on Intel platforms. This patchset touches the sound/hda/intel-nhlt parts but should IMHO be merged in the ASoC tree. I would like to acknowledge the help of Nikolai Kostrigin, Mauro Carvalho Chehab, Huajun Li, David Yang (@yangxiaohua2009) and other GitHub testers. [1] https://github.com/thesofproject/linux/issues?q=is%3Aissue+is%3Aopen+label%3A%22codec+ES8336%22 commit 9986c7650eb3d3e9f00def7bc10e9328a047112e Author: Evgenii Stepanov Date: Wed Mar 9 13:59:43 2022 -0800 docs: sysfs-devices-system-cpu: document "asymm" value for mte_tcf_preferred It was added in commit 766121ba5de3 ("arm64/mte: Add userspace interface for enabling asymmetric mode"). Signed-off-by: Evgenii Stepanov Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220309215943.87831-1-eugenis@google.com Signed-off-by: Will Deacon Documentation/ABI/testing/sysfs-devices-system-cpu | 1 + 1 file changed, 1 insertion(+) commit 58ffc34896db2e5e49e6ae6bf8042f85504d84e8 Author: Karolina Drobnik Date: Mon Feb 28 15:46:51 2022 +0100 memblock tests: Add TODO and README files Add description of the project, its structure and how to run it. List what is left to implement and what the known issues are. Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/d5e39b9f7dcef177ebc14282727447bc21e3b38f.1646055639.git.karolinadrobnik@gmail.com tools/testing/memblock/README | 107 ++++++++++++++++++++++++++++++++++++++++++ tools/testing/memblock/TODO | 28 +++++++++++ 2 files changed, 135 insertions(+) commit 89eb1681b73ff584c5678f7185a2d8e3070e9b78 Author: Hector Martin Date: Thu Mar 10 04:21:17 2022 +0900 PCI: apple: Change MSI handling to handle 4-cell AIC fwspec form AIC2 changes the IRQ fwspec to add a cell. Always use the second-to-last cell for the MSI handling, so it will work for both AIC1 and AIC2 devices. Signed-off-by: Hector Martin Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220309192123.152028-2-marcan@marcan.st drivers/pci/controller/pcie-apple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 87ba5badc541a79bab2fa3243ee0008c0880c64a Author: Kris Bahnsen Date: Thu Mar 10 10:05:39 2022 +0100 gpio: ts4900: Use SPDX header Remove boilerplate, use the SPDX license identifier. Signed-off-by: Kris Bahnsen Signed-off-by: Bartosz Golaszewski drivers/gpio/gpio-ts4900.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) commit c425060a406c941a9e17bfe578f57cc707b46b3c Merge: 92af5d479013 dc29812dbc87 Author: Marc Zyngier Date: Thu Mar 10 08:59:03 2022 +0000 Merge branch irq/aic-pmu into irq/irqchip-next * irq/aic-pmu: : . : Prefix branch for the M1 PMU support, adding the required : irqchip changes. Shared with the arm64 tree. : . irqchip/apple-aic: Fix cpumask allocation for FIQs irqchip/apple-aic: Move PMU-specific registers to their own include file arm64: dts: apple: Add t8303 PMU nodes arm64: dts: apple: Add t8103 PMU interrupt affinities irqchip/apple-aic: Wire PMU interrupts irqchip/apple-aic: Parse FIQ affinities from device-tree dt-bindings: apple,aic: Add affinity description for per-cpu pseudo-interrupts dt-bindings: apple,aic: Add CPU PMU per-cpu pseudo-interrupts dt-bindings: arm-pmu: Document Apple PMU compatible strings Signed-off-by: Marc Zyngier commit dc29812dbc873ae00bf19a4b8661984d7cce7a2e Author: Marc Zyngier Date: Thu Mar 10 08:34:58 2022 +0000 irqchip/apple-aic: Fix cpumask allocation for FIQs An emparassing typo: allocating a pointer instead of the object pointed to. No harm done, as the pointer is large enough for what we are using the object for, but still... Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220310050238.4478-1-guozhengkui@vivo.com drivers/irqchip/irq-apple-aic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0691a4b55c89055c1efb61a7696f4bc6aa5cf630 Author: Ben Evans Date: Fri Dec 3 15:16:26 2021 +1000 can: gs_usb: add VID/PID for ABE CAN Debugger devices Add support for ABE CAN Debugger devices using the gs_usb driver. Link: https://lore.kernel.org/all/20220309124132.291861-22-mkl@pengutronix.de Signed-off-by: Ben Evans Signed-off-by: Peter Fink Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 5 +++++ 1 file changed, 5 insertions(+) commit d03bb08e2be101a50c2bef94a9a2f0dbccfeddd3 Author: Peter Fink Date: Mon Nov 8 11:41:57 2021 +0100 can: gs_usb: add VID/PID for CES CANext FD devices Add support for Christ Electronic Systems GmbH CANext FD devices using the gs_usb driver. Link: https://lore.kernel.org/all/20220309124132.291861-21-mkl@pengutronix.de Signed-off-by: Peter Fink Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 5 +++++ 1 file changed, 5 insertions(+) commit 6679f4c5e5a6a783b004577a987f9815b877abce Author: Peter Fink Date: Mon Nov 8 17:05:44 2021 +0100 can: gs_usb: add extended bt_const feature For example CANext FD needs to distinguish between bittiming constants valid for arbitration phase and data phase to reach maximum performance at higher speeds. Link: https://lore.kernel.org/all/20220309124132.291861-20-mkl@pengutronix.de Signed-off-by: Peter Fink Signed-off-by: Christoph Möhring Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 70 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 2 deletions(-) commit b00ca070e02229801d41d63eeabec3fdb2cea6eb Author: Peter Fink Date: Tue Dec 7 20:18:23 2021 +0100 can: gs_usb: activate quirks for CANtact Pro unconditionally The CANtact Pro from LinkLayer Labs is based on the LPC54616 µC, which is affected by the NXP LPC USB transfer erratum. However, the current firmware (version 2) doesn't set the GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX bit. This patch sets the feature GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX to workaround this issue. For the GS_USB_BREQ_DATA_BITTIMING USB control message the CANtact Pro firmware uses a request value, which is already used by the candleLight firmware for a different purpose (GS_USB_BREQ_GET_USER_ID). This patch set the feature GS_CAN_FEATURE_QUIRK_BREQ_CANTACT_PRO to workaround this issue. Link: https://lore.kernel.org/all/20220309124132.291861-19-mkl@pengutronix.de Cc: Ryan Edwards Signed-off-by: Peter Fink Signed-off-by: Christoph Möhring [mkl: improve check for CANtact Pro and add GS_CAN_FEATURE_QUIRK_BREQ_CANTACT_PRO quirk] Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) commit 32cd9013c2074e4faa9c62fe62296c2017abf1d9 Author: Marc Kleine-Budde Date: Thu Dec 30 20:22:07 2021 +0100 can: gs_usb: add quirk for CANtact Pro overlapping GS_USB_BREQ value For the GS_USB_BREQ_DATA_BITTIMING USB control message the CANtact Pro firmware uses a request value, which is already used by the candleLight firmware for a different purpose (GS_USB_BREQ_GET_USER_ID). This patch adds a quirk to use the CANtact Pro's value for the GS_USB_BREQ_DATA_BITTIMING USB control message instead of the official one. Link: https://lore.kernel.org/all/20220309124132.291861-18-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit eb9fa77a4211cd74d761c46627ac343916fb854e Author: Peter Fink Date: Tue Dec 7 19:43:24 2021 +0100 can: gs_usb: add usb quirk for NXP LPC546xx controllers Introduce a workaround for a NXP chip errata on LPC546xx controllers (Errata sheet LPC546xx / USB.15). According to the document corruption can occur when the following conditions are met: * A TX (IN) transfer happens after a RX (OUT) transfer. * The RX (OUT) transfer length is 4 + N * 16 (N >= 0) bytes. Even though the struct gs_host_frame has a size of 76 bytes for a FD frame, which does not apply to the above rule, corruption could be seen. Adding a dummy byte to break the second condition also on transfer lengths with 4 + N * 8 bytes reliably circumvents USB transfer data corruption. The firmware can now request this quirk by setting GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX. Link: https://lore.kernel.org/all/20220309124132.291861-17-mkl@pengutronix.de Signed-off-by: Peter Fink Signed-off-by: Christoph Möhring Signed-off-by: Alexander Schartner Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) commit 26949ac935e37ad47fbe35cf0ff6e51aeeb15c6f Author: Peter Fink Date: Tue Dec 7 19:35:31 2021 +0100 can: gs_usb: add CAN-FD support CANtact Pro from Linklayer is the first gs_usb compatible device supporting CAN-FD with a different HW and re-written candlelight FW. Support for CAN-FD is indicated by the device setting the GS_CAN_FEATURE_FD flag. CAN-FD support is requested by the driver with the GS_CAN_MODE_FD flag. The CAN-FD specific data bit timing parameters are set with the GS_USB_BREQ_DATA_BITTIMING control message. This patch is based on the Eric Evenchick's gs_usb_fd driver (which itself is a fork of gs_usb). The gs_usb_fd code base was reintegrated into the gs_usb driver, and reworked to not break the existing classical-CAN only hardware. Link: https://lore.kernel.org/all/20220309124132.291861-16-mkl@pengutronix.de Link: https://github.com/linklayer/gs_usb_fd/issues/2 Co-developed-by: Eric Evenchick Signed-off-by: Eric Evenchick Signed-off-by: Peter Fink Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 124 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 108 insertions(+), 16 deletions(-) commit c359931d2545173c4328d828643035259a0ba936 Author: Peter Fink Date: Tue Dec 7 19:22:50 2021 +0100 can: gs_usb: use union and FLEX_ARRAY for data in struct gs_host_frame Modify struct gs_host_frame to make use of a union and DECLARE_FLEX_ARRAY to be able to store different data (lengths), which will be added in later commits. Store the gs_host_frame length in TX direction (host -> device) in struct gs_can::hf_size_tx and RX direction (device -> host) in struct gs_usb::hf_size_rx so it must be calculated only once. Link: https://lore.kernel.org/all/20220309124132.291861-15-mkl@pengutronix.de Signed-off-by: Peter Fink Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) commit e10ab8b394053cedd1329ce1aeb4bb1fda8067f8 Author: Marc Kleine-Budde Date: Fri Feb 4 15:40:31 2022 +0100 can: gs_usb: support up to 3 channels per device Some STM32G3 chips support up to 3 CAN-FD channels, increase number of supported channels in this driver to 3 accordingly. Link: https://lore.kernel.org/all/20220309124132.291861-14-mkl@pengutronix.de Suggested-by: Ryan Edwards Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5374d083117cafe794002386416256a4c5e5d443 Author: Marc Kleine-Budde Date: Sun Nov 7 15:11:55 2021 +0100 can: gs_usb: gs_usb_probe(): introduce udev and make use of it Introduce the variable udev in the gs_usb_probe() function to hold a pointer to the struct usb_device. This avoids recalculating the value several times in this function. Link: https://lore.kernel.org/all/20220309124132.291861-13-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 4643e34eccfc17f97cb18425835c7087afa8d9fb Author: Marc Kleine-Budde Date: Sun Nov 7 14:52:10 2021 +0100 can: gs_usb: document the PAD_PKTS_TO_MAX_PKT_SIZE feature The widely used open source firmware candleLight supports padding the USB packets to max packet size to improve performance on Windows systems. This patch documents the bit. Link: https://lore.kernel.org/all/20220309124132.291861-12-mkl@pengutronix.de Link: https://github.com/candle-usb/candleLight_fw/pull/7 Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 2 ++ 1 file changed, 2 insertions(+) commit e0902cad4b32838e0336b5497a7e9d479ada6b9c Author: Marc Kleine-Budde Date: Sun Nov 7 14:50:11 2021 +0100 can: gs_usb: document the USER_ID feature The widely used open source firmware candleLight has optional support for reading/writing of an user defined value into the device's flash. This is indicated by the GS_CAN_FEATURE_USER_ID feature. The corresponding request are GS_USB_BREQ_GET_USER_ID and GS_USB_BREQ_SET_USER_ID. This patch documents these values. Link: https://lore.kernel.org/all/20220309124132.291861-11-mkl@pengutronix.de Link: https://github.com/candle-usb/candleLight_fw/commit/1453d70dc9a9d98ac254893ba5114b8e826e0e39 Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 4 ++++ 1 file changed, 4 insertions(+) commit 15564f821c0431cb5b5673c148959945113b433b Author: Marc Kleine-Budde Date: Sun Nov 7 14:44:36 2021 +0100 can: gs_usb: update GS_CAN_FEATURE_IDENTIFY documentation In the binary interface a feature bit might have a corresponding mode bit (of the same value). The GS_CAN_FEATURE_IDENTIFY feature doesn't come with a mode. Document this, to avoid gaps when adding more features/modes later. Link: https://lore.kernel.org/all/20220309124132.291861-10-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 1 + 1 file changed, 1 insertion(+) commit d42d211169431212b4051682bbb7b7ffe37fd8c3 Author: Marc Kleine-Budde Date: Sun Nov 7 14:36:51 2021 +0100 can: gs_usb: add HW timestamp mode bit Newer versions of the widely used open source firmware candleLight support hardware timestamps. The support is activated by setting the GS_CAN_MODE_HW_TIMESTAMP in the GS_USB_BREQ_MODE request. Although timestamp support is not yet supported by this driver, add the missing bit for documentation purpose. Link: https://lore.kernel.org/all/20220309124132.291861-9-mkl@pengutronix.de Link: https://github.com/candle-usb/candleLight_fw/commit/44431f4a4354a878fbd15b273bf04fce1dcdff7e Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 1 + 1 file changed, 1 insertion(+) commit e0d25759fa917784da4399e426df4d7b822bbc3f Author: Marc Kleine-Budde Date: Thu Nov 19 13:03:53 2020 +0100 can: gs_usb: gs_make_candev(): call SET_NETDEV_DEV() after handling all bt_const->feature This patch moves the call to SET_NETDEV_DEV() after all handling (including cleanup) of the bt_const->feature is done. This looks more consistent. Link: https://lore.kernel.org/all/20220309124132.291861-8-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c1ee72690cdd593a18817a0be0fd32ae68be7ac9 Author: Marc Kleine-Budde Date: Thu Nov 19 13:21:24 2020 +0100 can: gs_usb: rewrap usb_control_msg() and usb_fill_bulk_urb() This patch rewraps the arguments of usb_control_msg() and usb_fill_bulk_urb() to make full use of the standard line length of 80 characters. Link: https://lore.kernel.org/all/20220309124132.291861-7-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 87 +++++++++++--------------------------------- 1 file changed, 22 insertions(+), 65 deletions(-) commit d0cd2aa83fbc5684b59f01c4a488814fe2b0d26b Author: Marc Kleine-Budde Date: Thu Nov 19 13:23:13 2020 +0100 can: gs_usb: rewrap error messages This patch rewraps the arguments of netdev_err() to make full use of the standard line length of 80 characters. Link: https://lore.kernel.org/all/20220309124132.291861-6-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 4b8f03e33f071220bb67e7e2af4bc2334ed41bf1 Author: Marc Kleine-Budde Date: Thu Nov 19 13:23:35 2020 +0100 can: gs_usb: GS_CAN_FLAG_OVERFLOW: make use of BIT() This patch converts the driver to use BIT() to define flags. Link: https://lore.kernel.org/all/20220309124132.291861-5-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f6bb251096bf1a9519be496ca32184291a9e32aa Author: Marc Kleine-Budde Date: Fri Dec 31 20:12:51 2021 +0100 can: gs_usb: sort include files alphabetically This patch sorts the include files alphabetically. Link: https://lore.kernel.org/all/20220309124132.291861-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b9d9b030d009055e9c521c7add2d359cc03c4092 Author: Marc Kleine-Budde Date: Thu Nov 19 12:51:28 2020 +0100 can: gs_usb: fix checkpatch warning This patch fixes a checkpatch warning by converting a "unsigned" into an "unsigned int". Link: https://lore.kernel.org/all/20220309124132.291861-3-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 4c7044f3efc00103fe74e608c8a2b15d58e0256e Author: Marc Kleine-Budde Date: Thu Nov 19 12:45:08 2020 +0100 can: gs_usb: use consistent one space indention With this patch a consistent one space indention throughout the whole driver is used. Link: https://lore.kernel.org/all/20220309124132.291861-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/gs_usb.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) commit 45721c406dcf50d4a20f95afafe8e1a2a7fa2341 Author: Ulrich Hecht Date: Wed Mar 9 17:26:06 2022 +0100 can: rcar_canfd: Add support for r8a779a0 SoC Adds support for the CANFD IP variant in the V3U SoC. Differences to controllers in other SoCs are limited to an increase in the number of channels from two to eight, an absence of dedicated registers for "classic" CAN mode, and a number of differences in magic numbers (register offsets and layouts). Inspired by BSP patch by Kazuya Mizuguchi. Link: https://lore.kernel.org/all/20220309162609.3726306-2-uli+renesas@fpond.eu Signed-off-by: Ulrich Hecht Reviewed-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde drivers/net/can/rcar/rcar_canfd.c | 353 +++++++++++++++++++++++--------------- 1 file changed, 217 insertions(+), 136 deletions(-) commit d6254d52d70de5301b4fd9acaea5cf1dd8d222b4 Author: Ulrich Hecht Date: Wed Mar 9 17:26:09 2022 +0100 dt-bindings: can: renesas,rcar-canfd: Document r8a779a0 support Document support for rcar_canfd on R8A779A0 (V3U) SoCs. Link: https://lore.kernel.org/all/20220309162609.3726306-5-uli+renesas@fpond.eu Signed-off-by: Ulrich Hecht Reviewed-by: Geert Uytterhoeven Signed-off-by: Marc Kleine-Budde Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml | 2 ++ 1 file changed, 2 insertions(+) commit 634f0f26cb9b0c7910efa8cbc9612b89a3d98001 Merge: fc30ed4edd4d c042639a70ed Author: Arnd Bergmann Date: Thu Mar 10 09:36:40 2022 +0100 Merge tag 'v5.18-rockchip-dts32-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt Some fixes for rk8xx pmics to make them follow the dt-binding better. * tag 'v5.18-rockchip-dts32-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: Update regulator name for PX3 ARM: dts: rockchip: Add #clock-cells value for rk805 Link: https://lore.kernel.org/r/3788968.RB9BLzCXGK@phil Signed-off-by: Arnd Bergmann commit fc30ed4edd4d5966d524b4b426ae57cf1cc60e51 Merge: 7b4fc7c6f9a3 9d25aadd55bb Author: Arnd Bergmann Date: Thu Mar 10 09:32:23 2022 +0100 Merge tag 'v5.18-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt Some corrections for the rk80x pmic nodes, a supply fix for rk3399-firefly and addition of the usb/sata combophys for rk3568. * tag 'v5.18-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: Add #clock-cells value for rk805 arm64: dts: rockchip: Remove vcc13 and vcc14 for rk808 arm64: dts: rockchip: Fix SDIO regulator supply properties on rk3399-firefly arm64: dts: rockchip: add naneng combo phy nodes for rk3568 Link: https://lore.kernel.org/r/13959624.7hp8jFWaoN@phil Signed-off-by: Arnd Bergmann commit 7a8cd7c0ee823a1cc893ab3feaa23e4b602bfb9a Author: Vincent Mailhol Date: Sun Mar 6 19:13:02 2022 +0900 can: etas_es58x: es58x_fd_rx_event_msg(): initialize rx_event_msg before calling es58x_check_msg_len() Function es58x_fd_rx_event() invokes the es58x_check_msg_len() macro: | ret = es58x_check_msg_len(es58x_dev->dev, *rx_event_msg, msg_len); While doing so, it dereferences an uninitialized variable: *rx_event_msg. This is actually harmless because es58x_check_msg_len() only uses preprocessor macros (sizeof() and __stringify()) on *rx_event_msg. c.f. [1]. Nonetheless, this pattern is confusing so the lines are reordered to make sure that rx_event_msg is correctly initialized. This patch also fixes a false positive warning reported by cppcheck: | cppcheck possible warnings: (new ones prefixed by >>, may not be real problems) | | In file included from drivers/net/can/usb/etas_es58x/es58x_fd.c: | >> drivers/net/can/usb/etas_es58x/es58x_fd.c:174:8: warning: Uninitialized variable: rx_event_msg [uninitvar] | ret = es58x_check_msg_len(es58x_dev->dev, *rx_event_msg, msg_len); | ^ [1] https://elixir.bootlin.com/linux/v5.16/source/drivers/net/can/usb/etas_es58x/es58x_core.h#L467 Link: https://lore.kernel.org/all/20220306101302.708783-1-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde drivers/net/can/usb/etas_es58x/es58x_fd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 259bdba27e32368b4404f69d613b1c1014c07cbf Author: Oliver Hartkopp Date: Wed Mar 9 13:04:16 2022 +0100 vxcan: enable local echo for sent CAN frames The vxcan driver provides a pair of virtual CAN interfaces to exchange CAN traffic between different namespaces - analogue to veth. In opposite to the vcan driver the local sent CAN traffic on this interface is not echo'ed back but only sent to the remote peer. This is unusual and can be easily fixed by removing IFF_ECHO from the netdevice flags that are set for vxcan interfaces by default at startup. Without IFF_ECHO set on driver level, the local sent CAN frames are echo'ed in af_can.c in can_send(). This patch makes vxcan interfaces adopt the same local echo behavior and procedures as known from the vcan interfaces. Fixes: a8f820a380a2 ("can: add Virtual CAN Tunnel driver (vxcan)") Link: https://lore.kernel.org/all/20220309120416.83514-5-socketcan@hartkopp.net Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde drivers/net/can/vxcan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1574481bb3de11c9d44f5405c17e948b76794f39 Author: Oliver Hartkopp Date: Wed Mar 9 13:04:15 2022 +0100 vxcan: remove sk reference in peer skb With can_create_echo_skb() the skb which is forwarded to the peer CAN interface shares the sk pointer from the originating socket. This makes the CAN frame show up in the peer namespace as a TX packet. With the use of skb_clone() analogue to the handling in gw.c the peer skb gets a new start in the peer namespace and correctly appears as a RX packet. Link: https://lore.kernel.org/all/20220309120416.83514-4-socketcan@hartkopp.net Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde drivers/net/can/vxcan.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) commit 9c0c191d82a1de964ac953a1df8b5744ec670b07 Author: Oliver Hartkopp Date: Wed Mar 9 13:04:14 2022 +0100 can: isotp: set max PDU size to 64 kByte The reason to extend the max PDU size from 4095 Byte (12 bit length value) to a 32 bit value (up to 4 GByte) was to be able to flash 64 kByte bootloaders with a single ISO-TP PDU. The max PDU size in the Linux kernel implementation was set to 8200 Bytes to be able to test the length information escape sequence. It turns out that the demand for 64 kByte PDUs is real so the value for MAX_MSG_LENGTH is set to 66000 to be able to potentially add some checksums to the 65.536 Byte block. Link: https://github.com/linux-can/can-utils/issues/347#issuecomment-1056142301 Link: https://lore.kernel.org/all/20220309120416.83514-3-socketcan@hartkopp.net Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde net/can/isotp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 530e0d46c61314c59ecfdb8d3bcb87edbc0f85d3 Author: Oliver Hartkopp Date: Wed Mar 9 13:04:13 2022 +0100 can: isotp: set default value for N_As to 50 micro seconds The N_As value describes the time a CAN frame needs on the wire when transmitted by the CAN controller. Even very short CAN FD frames need arround 100 usecs (bitrate 1Mbit/s, data bitrate 8Mbit/s). Having N_As to be zero (the former default) leads to 'no CAN frame separation' when STmin is set to zero by the receiving node. This 'burst mode' should not be enabled by default as it could potentially dump a high number of CAN frames into the netdev queue from the soft hrtimer context. This does not affect the system stability but is just not nice and cooperative. With this N_As/frame_txtime value the 'burst mode' is disabled by default. As user space applications usually do not set the frame_txtime element of struct can_isotp_options the new in-kernel default is very likely overwritten with zero when the sockopt() CAN_ISOTP_OPTS is invoked. To make sure that a N_As value of zero is only set intentional the value '0' is now interpreted as 'do not change the current value'. When a frame_txtime of zero is required for testing purposes this CAN_ISOTP_FRAME_TXTIME_ZERO u32 value has to be set in frame_txtime. Link: https://lore.kernel.org/all/20220309120416.83514-2-socketcan@hartkopp.net Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde include/uapi/linux/can/isotp.h | 28 ++++++++++++++++++++++------ net/can/isotp.c | 12 +++++++++++- 2 files changed, 33 insertions(+), 7 deletions(-) commit 4b7fe92c06901f4563af0e36d25223a5ab343782 Author: Oliver Hartkopp Date: Wed Mar 9 13:04:12 2022 +0100 can: isotp: add local echo tx processing for consecutive frames Instead of dumping the CAN frames into the netdevice queue the process to transmit consecutive frames (CF) now waits for the frame to be transmitted and therefore echo'ed from the CAN interface. Link: https://lore.kernel.org/all/20220309120416.83514-1-socketcan@hartkopp.net Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde net/can/isotp.c | 219 +++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 139 insertions(+), 80 deletions(-) commit 8594ab868799ce78c770498b74fe55ded30def9e Author: Luca Coelho Date: Fri Mar 4 13:21:29 2022 +0200 iwlwifi: bump FW API to 72 for AX devices Start supporting API version 72 for AX devices. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.8de72a8ea67f.I66681363afeb34c619379a5989090264fe6b5f2a@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e8e10a37c51c08b99d272b2e1b3ef70fcd38f9e8 Author: Matt Chen Date: Fri Mar 4 13:21:28 2022 +0200 iwlwifi: acpi: move ppag code from mvm to fw/acpi Move the ppag code to fw/acpi to keep consistency with the other ACPI handling we do. Signed-off-by: Matt Chen Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.7f250088b443.I61e64c2758ad178da729ce00428287cc94430eed@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 203 +++++++++++++++++++++++++++ drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 25 ++++ drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 190 +------------------------ 3 files changed, 234 insertions(+), 184 deletions(-) commit 97374513bbc426cea115882847369efac633ead3 Author: Mordechay Goodstein Date: Fri Mar 4 13:21:27 2022 +0200 iwlwifi: dbg: check trigger data before access Without trigger data set, no point in any collection. so check that we have the info for collecting the data. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.5fb34fb1f0eb.I4d7f2a4d162e80474540c5caf1194ed7d32977bc@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 5 +++++ 1 file changed, 5 insertions(+) commit f0c163382cd2497348c9212f5d3b87754ed33a7b Author: Mordechay Goodstein Date: Fri Mar 4 13:21:26 2022 +0200 iwlwifi: dbg: in sync mode don't call schedule Today in the code we have two options for collecting data sync/schedule, the two options call the same function and can lead to racing in free resources after done. So we call only one of two sync/schedule, and in case of sync only call sync function without also schedule to immediately run as a side job. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.88574097ce1b.I1b42297619d638d677a2300ed9a95105c1262101@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit bb16ffd561b60638108f1cc97b08f18270468678 Author: Johannes Berg Date: Fri Mar 4 13:21:25 2022 +0200 iwlwifi: use 4k queue size for Bz A-step There's a hardware bug in Bz A-step that can be worked around by using 4k queue size, so do that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.10ea0e115d05.Idfb3706133bf3b15f1f68f1145e77e89947449d1@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/queue/tx.c | 4 ++++ 1 file changed, 4 insertions(+) commit 7b9f485091a5755f6e0a7dd3725f3b312768ecd0 Author: Johannes Berg Date: Fri Mar 4 13:21:24 2022 +0200 iwlwifi: pcie: fix SW error MSI-X mapping We need to also update the IVAR location, since we've shifted the bit. Signed-off-by: Johannes Berg Fixes: 571836a02c7b ("iwlwifi: pcie: update sw error interrupt for BZ family") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.bcfb28484e50.I921df6b5134785d7eeb0c934e4a43157c582fa79@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a6d21729ff7a116744daeadd8382c97c9ea85503 Author: Mukesh Sisodiya Date: Fri Mar 4 13:21:23 2022 +0200 iwlwifi: yoyo: dump IMR DRAM only for HW and FW error Support debug collection of the platform IMR memory region only for HW and FW error. This region needs to be collected as the last region. Signed-off-by: Mukesh Sisodiya Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.5b70e5ba9a41.I502f9b6179b97b163992729edd2b3c5c4ca9e311@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit 1c4db7613f35b248ff05b8bfb3a4580a3d11d75c Author: Mukesh Sisodiya Date: Fri Mar 4 13:21:22 2022 +0200 iwlwifi: mvm: add support for IMR based on platform Driver needs to enable IMR which is needed for debug on certain platforms, so add a device config flag to set it. Signed-off-by: Mukesh Sisodiya Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.0b96b2760503.I08bc741c8c497a2edbe4784cdab6abd8d04c62f3@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 15 +++++++++++++++ drivers/net/wireless/intel/iwlwifi/iwl-config.h | 5 ++++- .../net/wireless/intel/iwlwifi/iwl-context-info-gen3.h | 4 +++- drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c | 5 ++++- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 3 ++- 5 files changed, 28 insertions(+), 4 deletions(-) commit 5053a451109e08d62d9086c1427c55c0411c9c3e Author: Mukesh Sisodiya Date: Fri Mar 4 13:21:21 2022 +0200 iwlwifi: yoyo: disable IMR DRAM region if IMR is disabled Disable IMR region if it is enabled in the TLVs, but disabled at runtime by the FW. Signed-off-by: Mukesh Sisodiya Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.2a696656a161.I99705472a8838121ffaca72977015dc2069549b9@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) commit 8b3d2c4882874f32dd1470a92e98417a8d0345cb Author: Johannes Berg Date: Fri Mar 4 13:21:20 2022 +0200 iwlwifi: mvm: remove cipher scheme support There are no shipping firmware versions with this, and there will also not be in the future, so remove the support. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.8b3c8b4adf41.Ib3ddb6b250ea2dd72b4ecc88bdd5cffb86af1dcc@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/fw/file.h | 28 ---------------------- drivers/net/wireless/intel/iwlwifi/fw/img.h | 12 ---------- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 28 ---------------------- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 29 +---------------------- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 - 5 files changed, 1 insertion(+), 97 deletions(-) commit b49c2b252b58e8afa2b0a908d61ef979334d78bd Author: Ayala Barazani Date: Fri Mar 4 13:21:19 2022 +0200 iwlwifi: Configure FW debug preset via module param. The module param "enable_ini" is currently used to be enable/disable ini. Add the option to configure the FW debug preset via this module param, by change it type from boolean to an integer. Signed-off-by: Ayala Barazani Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.4929e4b14956.I1bdffa4c37d4ee349aa0001978b716b96e38b090@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.h | 4 ++- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 41 +++++++++++++++++++--- drivers/net/wireless/intel/iwlwifi/iwl-modparams.h | 5 +-- 3 files changed, 43 insertions(+), 7 deletions(-) commit b0aa02b3de89aaed95b9b17dfb4639e7190deebd Author: Ayala Barazani Date: Fri Mar 4 13:21:18 2022 +0200 iwlwifi: mvm: add a flag to reduce power command. Add a flags bitfield in REDUCED_TX_POWER_CMD, and send it as is to FW. Signed-off-by: Ayala Barazani Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.55c2f014f5ee.Iceb632f620de959800f979e212f0dc20240f9d38@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 8 ++++--- drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 3 +++ drivers/net/wireless/intel/iwlwifi/fw/api/power.h | 27 +++++++++++++++++++++-- drivers/net/wireless/intel/iwlwifi/fw/runtime.h | 3 ++- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 +++++-- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 +++- 6 files changed, 44 insertions(+), 9 deletions(-) commit 8061effc78fae30b0b4d52d18bae8b37a72ebc93 Author: Luca Coelho Date: Fri Mar 4 13:21:17 2022 +0200 iwlwifi: bump FW API to 71 for AX devices Start supporting API version 71 for AX devices. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20220304131517.d0898482506f.I2de2f9140c23f39a837f68199bbaf15a20f26abb@changeid Signed-off-by: Luca Coelho drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8ddde07a3d285a0f3cec14924446608320fdc013 Author: Tian Tao Date: Tue Mar 8 16:59:10 2022 +0800 dma-mapping: benchmark: extract a common header file for map_benchmark definition kernel/dma/map_benchmark.c and selftests/dma/dma_map_benchmark.c have duplicate map_benchmark definitions, which tends to lead to inconsistent changes to map_benchmark on both sides, extract a common header file to avoid this problem. Signed-off-by: Tian Tao Acked-by: Barry Song Reviewed-by: Shuah Khan Signed-off-by: Christoph Hellwig include/linux/map_benchmark.h | 31 +++++++++++++++++++++++++ kernel/dma/map_benchmark.c | 25 +------------------- tools/testing/selftests/dma/dma_map_benchmark.c | 25 +------------------- 3 files changed, 33 insertions(+), 48 deletions(-) commit feeb38685523c50bb08657bb0ff36cfac9f31100 Merge: d56201d9440d 48e8641c2bf0 Author: Palmer Dabbelt Date: Wed Mar 9 22:01:07 2022 -0800 Update the Icicle Kit device tree This series updates the Microchip Icicle Kit device tree by adding a host of peripherals, and some updates to the memory map. In addition, the device tree has been split into a third part, which contains "soft" peripherals that are in the fpga fabric. Several of the entries are for peripherals that have not get had their drivers upstreamed, so in those cases the dt bindings are included where appropriate in order to avoid the many "DT compatible string appears un-documented" errors. * palmer/riscv-microchip: MAINTAINERS: update riscv/microchip entry riscv: dts: microchip: add new peripherals to icicle kit device tree riscv: dts: microchip: update peripherals in icicle kit device tree riscv: dts: microchip: refactor icicle kit device tree riscv: dts: microchip: add fpga fabric section to icicle kit riscv: dts: microchip: use clk defines for icicle kit dt-bindings: pwm: add microchip corepwm binding dt-bindings: gpio: add bindings for microchip mpfs gpio dt-bindings: rtc: add bindings for microchip mpfs rtc dt-bindings: soc/microchip: add info about services to mpfs sysctrl dt-bindings: soc/microchip: update syscontroller compatibles dt-bindings: clk: microchip: Add Microchip PolarFire host binding commit 48e8641c2bf0a5b2a80666b2fe2b50d6b7c42709 Author: Conor Dooley Date: Mon Feb 14 13:58:41 2022 +0000 MAINTAINERS: update riscv/microchip entry Update the RISC-V/Microchip entry by adding the microchip dts directory and myself as maintainer Reviewed-by: Lewis Hanly Signed-off-by: Conor Dooley Acked-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) commit 528a5b1f2556dda1feddf4d6299813981182e6c6 Author: Conor Dooley Date: Mon Feb 14 13:58:40 2022 +0000 riscv: dts: microchip: add new peripherals to icicle kit device tree Add new peripherals to the MPFS, and enable them in the Icicle kit device tree: 2x SPI, QSPI, 3x GPIO, 2x I2C, Real Time Counter, PCIE controller, USB host & system controller. Signed-off-by: Conor Dooley Acked-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt .../dts/microchip/microchip-mpfs-icicle-kit.dts | 53 +++++++ arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 160 +++++++++++++++++++++ 2 files changed, 213 insertions(+) commit 5b28df37d311ef95e6349af97e423842817bf06a Author: Conor Dooley Date: Mon Feb 14 13:58:39 2022 +0000 riscv: dts: microchip: update peripherals in icicle kit device tree Assorted minor changes to the MPFS/Icicle kit device tree: - enable mmuart4 instead of mmuart0 - remove sifive pdma - split memory node to match updated fpga design - move stdout path to serial1 to avoid collision with bootloader running on the e51 Signed-off-by: Conor Dooley Acked-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt .../dts/microchip/microchip-mpfs-icicle-kit.dts | 23 +++++++++++++++------- arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 23 ++++++++++++---------- 2 files changed, 29 insertions(+), 17 deletions(-) commit c5094f371008c5296a91594b6a24d506383afadb Author: Conor Dooley Date: Mon Feb 14 13:58:38 2022 +0000 riscv: dts: microchip: refactor icicle kit device tree Assorted minor changes to the MPFS/Icicle kit device tree: - rename serial to mmuart to match microchip documentation - move phy0 inside mac1 node to match phy configuration - add labels where missing (cpus, cache controller) - add missing address cells & interrupts to MACs Signed-off-by: Conor Dooley Acked-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt .../dts/microchip/microchip-mpfs-icicle-kit.dts | 37 ++++++------ arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 65 +++++++++++----------- 2 files changed, 52 insertions(+), 50 deletions(-) commit 72560c6559b82b2ded469856f7a0bb425fba9b7e Author: Conor Dooley Date: Mon Feb 14 13:58:37 2022 +0000 riscv: dts: microchip: add fpga fabric section to icicle kit Split the device tree for the Microchip MPFS into two sections by adding microchip-mpfs-fabric.dtsi, which contains peripherals contained in the FPGA fabric. Signed-off-by: Conor Dooley Acked-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt .../boot/dts/microchip/microchip-mpfs-fabric.dtsi | 25 ++++++++++++++++++++++ .../dts/microchip/microchip-mpfs-icicle-kit.dts | 8 +++++++ arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 1 + 3 files changed, 34 insertions(+) commit 6546f920868e13ef2fe027e791dcdca49483cb6d Author: Conor Dooley Date: Mon Feb 14 13:58:36 2022 +0000 riscv: dts: microchip: use clk defines for icicle kit Update the Microchip Icicle kit device tree by replacing clock related magic numbers with their defined counterparts. Signed-off-by: Conor Dooley Acked-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt .../dts/microchip/microchip-mpfs-icicle-kit.dts | 2 +- arch/riscv/boot/dts/microchip/microchip-mpfs.dtsi | 25 +++++++++++----------- 2 files changed, 14 insertions(+), 13 deletions(-) commit df77f7735786ece2fcd8875b036a511ffcadfab6 Author: Conor Dooley Date: Mon Feb 14 13:58:35 2022 +0000 dt-bindings: pwm: add microchip corepwm binding Add device tree bindings for the Microchip fpga fabric based "core" PWM controller. Reviewed-by: Rob Herring Signed-off-by: Conor Dooley Acked-by: Palmer Dabbelt Acked-by: Uwe Kleine-K=F6nig Acked-by: Thierry Reding Signed-off-by: Palmer Dabbelt .../devicetree/bindings/pwm/microchip,corepwm.yaml | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) commit 735806d8a68e96fd7cfca8497dc9dd672ce22236 Author: Conor Dooley Date: Mon Feb 14 13:58:34 2022 +0000 dt-bindings: gpio: add bindings for microchip mpfs gpio Add device tree bindings for the gpio controller on the Microchip PolarFire SoC. Reviewed-by: Rob Herring Signed-off-by: Conor Dooley Acked-by: Palmer Dabbelt Acked-by: Bartosz Golaszewski Signed-off-by: Palmer Dabbelt .../bindings/gpio/microchip,mpfs-gpio.yaml | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) commit 4cbcc0d7b397b903b4b2ba749c36b8837d5dc782 Author: Conor Dooley Date: Mon Feb 14 13:58:33 2022 +0000 dt-bindings: rtc: add bindings for microchip mpfs rtc Add device tree bindings for the real time clock on the Microchip PolarFire SoC. Signed-off-by: Daire McNamara Signed-off-by: Conor Dooley Acked-by: Palmer Dabbelt Reviewed-by: Rob Herring Acked-by: Alexandre Belloni Signed-off-by: Palmer Dabbelt .../bindings/rtc/microchip,mfps-rtc.yaml | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) commit b435a1728c9f6811f6f337ebe80e3aca210f1b17 Author: Conor Dooley Date: Mon Feb 14 13:58:32 2022 +0000 dt-bindings: soc/microchip: add info about services to mpfs sysctrl The services actually provided by the system controller are not documented so add some words about what the system controller can actually do. Add a link to the oneline documentation with the specific details of each individual service. Also, drop the unneeded label from the example. Signed-off-by: Conor Dooley Reviewed-by: Rob Herring Signed-off-by: Palmer Dabbelt .../bindings/soc/microchip/microchip,mpfs-sys-controller.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) commit 213556235526abffe4b7fdec2aabf4d751a7c0f9 Author: Conor Dooley Date: Mon Feb 14 13:58:31 2022 +0000 dt-bindings: soc/microchip: update syscontroller compatibles The Polarfire SoC is currently using two different compatible string prefixes. Fix this by changing "polarfire-soc-*" strings to "mpfs-*" in its system controller in order to match the compatible string used in the soc binding and device tree Reviewed-by: Geert Uytterhoeven Signed-off-by: Conor Dooley Acked-by: Rob Herring Acked-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt ...ochip,polarfire-soc-mailbox.yaml => microchip,mpfs-mailbox.yaml} | 6 +++--- ...e-soc-sys-controller.yaml => microchip,mpfs-sys-controller.yaml} | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) commit d143f939a95696d38ff800ada14402fa50ebbd6c Author: Vinod Koul Date: Thu Mar 10 10:13:20 2022 +0530 dmaengine: Revert "dmaengine: shdma: Fix runtime PM imbalance on error" This reverts commit 455896c53d5b ("dmaengine: shdma: Fix runtime PM imbalance on error") as the patch wrongly reduced the count on error and did not bail out. So drop the count by reverting the patch . Signed-off-by: Vinod Koul drivers/dma/sh/shdma-base.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 60c10db9b17330eb43b84a8051a77ab1e6074442 Merge: ea7c8f598c32 455896c53d5b Author: Vinod Koul Date: Thu Mar 10 10:12:25 2022 +0530 Merge tag 'dmaengine-fix-5.17' into next This merges dmaengine/dmaengine-fix-5.17 tag into next as that is already merged mainline and resolves depencency in patches commit 3126b731ceb168b3a780427873c417f2abdd5527 Author: Luiz Angelo Daros de Luca Date: Wed Mar 9 14:56:42 2022 -0300 net: dsa: tag_rtl8_4: fix typo in modalias name DSA_TAG_PROTO_RTL8_4L is not defined. It should be DSA_TAG_PROTO_RTL8_4T. Fixes: cd87fecdedd7 ("net: dsa: tag_rtl8_4: add rtl8_4t trailing variant") Reported-by: Arınç ÜNAL Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220309175641.12943-1-luizluca@gmail.com Signed-off-by: Jakub Kicinski net/dsa/tag_rtl8_4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6c7e7da2e0f2141cdc491cd5b9d0b937c08939c9 Author: Robert Hancock Date: Tue Mar 8 15:10:13 2022 -0600 net: axienet: Use napi_alloc_skb when refilling RX ring Use napi_alloc_skb to allocate memory when refilling the RX ring in axienet_poll for more efficiency. napi_alloc_skb() can reuse softirq-local cache of freed skbs which may still be cache-warm and skipping allocator calls. Signed-off-by: Robert Hancock Link: https://lore.kernel.org/r/20220308211013.1530955-1-robert.hancock@calian.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 65466904b015f6eeb9225b51aeb29b01a1d4b59c Author: Eric Dumazet Date: Tue Mar 8 17:57:57 2022 -0800 tcp: adjust TSO packet sizes based on min_rtt Back when tcp_tso_autosize() and TCP pacing were introduced, our focus was really to reduce burst sizes for long distance flows. The simple heuristic of using sk_pacing_rate/1024 has worked well, but can lead to too small packets for hosts in the same rack/cluster, when thousands of flows compete for the bottleneck. Neal Cardwell had the idea of making the TSO burst size a function of both sk_pacing_rate and tcp_min_rtt() Indeed, for local flows, sending bigger bursts is better to reduce cpu costs, as occasional losses can be repaired quite fast. This patch is based on Neal Cardwell implementation done more than two years ago. bbr is adjusting max_pacing_rate based on measured bandwidth, while cubic would over estimate max_pacing_rate. /proc/sys/net/ipv4/tcp_tso_rtt_log can be used to tune or disable this new feature, in logarithmic steps. Tested: 100Gbit NIC, two hosts in the same rack, 4K MTU. 600 flows rate-limited to 20000000 bytes per second. Before patch: (TSO sizes would be limited to 20000000/1024/4096 -> 4 segments per TSO) ~# echo 0 >/proc/sys/net/ipv4/tcp_tso_rtt_log ~# nstat -n;perf stat ./super_netperf 600 -H otrv6 -l 20 -- -K dctcp -q 20000000;nstat|egrep "TcpInSegs|TcpOutSegs|TcpRetransSegs|Delivered" 96005 Performance counter stats for './super_netperf 600 -H otrv6 -l 20 -- -K dctcp -q 20000000': 65,945.29 msec task-clock # 2.845 CPUs utilized 1,314,632 context-switches # 19935.279 M/sec 5,292 cpu-migrations # 80.249 M/sec 940,641 page-faults # 14264.023 M/sec 201,117,030,926 cycles # 3049769.216 GHz (83.45%) 17,699,435,405 stalled-cycles-frontend # 8.80% frontend cycles idle (83.48%) 136,584,015,071 stalled-cycles-backend # 67.91% backend cycles idle (83.44%) 53,809,530,436 instructions # 0.27 insn per cycle # 2.54 stalled cycles per insn (83.36%) 9,062,315,523 branches # 137422329.563 M/sec (83.22%) 153,008,621 branch-misses # 1.69% of all branches (83.32%) 23.182970846 seconds time elapsed TcpInSegs 15648792 0.0 TcpOutSegs 58659110 0.0 # Average of 3.7 4K segments per TSO packet TcpExtTCPDelivered 58654791 0.0 TcpExtTCPDeliveredCE 19 0.0 After patch: ~# echo 9 >/proc/sys/net/ipv4/tcp_tso_rtt_log ~# nstat -n;perf stat ./super_netperf 600 -H otrv6 -l 20 -- -K dctcp -q 20000000;nstat|egrep "TcpInSegs|TcpOutSegs|TcpRetransSegs|Delivered" 96046 Performance counter stats for './super_netperf 600 -H otrv6 -l 20 -- -K dctcp -q 20000000': 48,982.58 msec task-clock # 2.104 CPUs utilized 186,014 context-switches # 3797.599 M/sec 3,109 cpu-migrations # 63.472 M/sec 941,180 page-faults # 19214.814 M/sec 153,459,763,868 cycles # 3132982.807 GHz (83.56%) 12,069,861,356 stalled-cycles-frontend # 7.87% frontend cycles idle (83.32%) 120,485,917,953 stalled-cycles-backend # 78.51% backend cycles idle (83.24%) 36,803,672,106 instructions # 0.24 insn per cycle # 3.27 stalled cycles per insn (83.18%) 5,947,266,275 branches # 121417383.427 M/sec (83.64%) 87,984,616 branch-misses # 1.48% of all branches (83.43%) 23.281200256 seconds time elapsed TcpInSegs 1434706 0.0 TcpOutSegs 58883378 0.0 # Average of 41 4K segments per TSO packet TcpExtTCPDelivered 58878971 0.0 TcpExtTCPDeliveredCE 9664 0.0 Signed-off-by: Eric Dumazet Reviewed-by: Neal Cardwell Link: https://lore.kernel.org/r/20220309015757.2532973-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski Documentation/networking/ip-sysctl.rst | 23 +++++++++++++++++++++++ include/net/netns/ipv4.h | 3 ++- net/ipv4/sysctl_net_ipv4.c | 7 +++++++ net/ipv4/tcp_ipv4.c | 1 + net/ipv4/tcp_output.c | 33 +++++++++++++++++++++------------ 5 files changed, 54 insertions(+), 13 deletions(-) commit b0de0cf4f57cbac41ef7fa382bcaef83288af1e7 Author: Eric Dumazet Date: Tue Mar 8 21:47:06 2022 -0800 tcp: autocork: take MSG_EOR hint into consideration tcp_should_autocork() is evaluating if it makes senses to not immediately send current skb, hoping that user space will add more payload on it by the time TCP stack reacts to upcoming TX completions. If current skb got MSG_EOR mark, then we know that no further data will be added, it is therefore futile to wait. SOF_TIMESTAMPING_TX_ACK will become a bit more accurate, if prior packets are still in qdisc/device queues. Signed-off-by: Eric Dumazet Cc: Martin KaFai Lau Cc: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Link: https://lore.kernel.org/r/20220309054706.2857266-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski net/ipv4/tcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 30c5601fbf353a40115564e1304a1870978fda29 Author: Michael Sit Wei Hong Date: Wed Mar 9 11:34:15 2022 +0800 stmmac: intel: Add ADL-N PCI ID Add PCI ID for Ethernet TSN Controller on ADL-N. Signed-off-by: Michael Sit Wei Hong Link: https://lore.kernel.org/r/20220309033415.3370250-1-michael.wei.hong.sit@intel.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 2 ++ 1 file changed, 2 insertions(+) commit d9f50991592513cc7633684cbaff65022cfa6816 Author: Dust Li Date: Wed Mar 9 11:30:51 2022 +0800 net/smc: fix -Wmissing-prototypes warning when CONFIG_SYSCTL not set when CONFIG_SYSCTL not set, smc_sysctl_net_init/exit need to be static inline to avoid missing-prototypes if compile with W=1. Since __net_exit has noinline annotation when CONFIG_NET_NS not set, it should not be used with static inline. So remove the __net_init/exit when CONFIG_SYSCTL not set. Fixes: 7de8eb0d9039 ("net/smc: fix compile warning for smc_sysctl") Signed-off-by: Dust Li Link: https://lore.kernel.org/r/20220309033051.41893-1-dust.li@linux.alibaba.com Signed-off-by: Jakub Kicinski net/smc/smc_sysctl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c01e605904f1c8e25cfaecf04edaaa2824674065 Merge: 4a5eaa2fde59 b23f9239195a Author: Jakub Kicinski Date: Wed Mar 9 20:01:20 2022 -0800 Merge branch 'net-fungible-fix-errors-when-config_tls_device-n' Dimitris Michailidis says: ==================== net/fungible: fix errors when CONFIG_TLS_DEVICE=n This pair of patches fix compile errors in funeth when CONFIG_TLS_DEVICE=n. The errors are due to symbols that are not defined in this config but are used in code guarded by "if (IS_ENABLED(CONFIG_TLS_DEVICE) ..." One option is to place this code under preprocessor guards that will keep the compiler from looking at the code. The option adopted here is to define the offending symbols also when CONFIG_TLS_DEVICE=n. The first patch does this for two functions in tls.h. The second does the same for driver symbols and makes tls.h inclusion unconditional. ==================== Link: https://lore.kernel.org/r/20220309034032.405212-1-dmichail@fungible.com Signed-off-by: Jakub Kicinski commit b23f9239195a1af116d6b388cd00c9002f80f80f Author: Dimitris Michailidis Date: Tue Mar 8 19:40:32 2022 -0800 net/fungible: fix errors when CONFIG_TLS_DEVICE=n Include the TLS headers unconditionally and define driver TLS symbols used in code compiled also when CONFIG_TLS_DEVICE=n to fix the following errors: ../drivers/net/ethernet/fungible/funeth/funeth_tx.c: In function ‘write_pkt_desc’: ../drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:13: error: implicit declaration of function ‘tls_driver_ctx’ [-Werror=implicit-function-declaration] 244 | tls_ctx = tls_driver_ctx(skb->sk, TLS_OFFLOAD_CTX_DIR_TX); | ^~~~~~~~~~~~~~ ../drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:37: error: ‘TLS_OFFLOAD_CTX_DIR_TX’ undeclared (first use in this function) 244 | tls_ctx = tls_driver_ctx(skb->sk, TLS_OFFLOAD_CTX_DIR_TX); | ^~~~~~~~~~~~~~~~~~~~~~ ../drivers/net/ethernet/fungible/funeth/funeth_tx.c:244:37: note: each undeclared identifier is reported only once for each function it appears in ../drivers/net/ethernet/fungible/funeth/funeth_tx.c:245:23: error: dereferencing pointer to incomplete type ‘struct fun_ktls_tx_ctx’ 245 | tls->tlsid = tls_ctx->tlsid; | ^~ ../drivers/net/ethernet/fungible/funeth/funeth_tx.c: In function ‘fun_start_xmit’: ../drivers/net/ethernet/fungible/funeth/funeth_tx.c:310:6: error: implicit declaration of function ‘tls_is_sk_tx_device_offloaded’ [-Werror=implicit-function-declaration] 310 | tls_is_sk_tx_device_offloaded(skb->sk)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/net/ethernet/fungible/funeth/funeth_tx.c:311:9: error: implicit declaration of function ‘fun_tls_tx’; did you mean ‘fun_xdp_tx’? [-Werror=implicit-function-declaration] 311 | skb = fun_tls_tx(skb, q, &tls_len); | ^~~~~~~~~~ | fun_xdp_tx ../drivers/net/ethernet/fungible/funeth/funeth_tx.c:311:7: warning: assignment to ‘struct sk_buff *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 311 | skb = fun_tls_tx(skb, q, &tls_len); | ^ Fixes: db37bc177dae ("net/funeth: add the data path") Reported-by: Randy Dunlap Reported-by: kernel test robot Signed-off-by: Dimitris Michailidis Signed-off-by: Jakub Kicinski drivers/net/ethernet/fungible/funeth/funeth_ktls.h | 7 +++---- drivers/net/ethernet/fungible/funeth/funeth_tx.c | 9 +++++---- 2 files changed, 8 insertions(+), 8 deletions(-) commit 77f09e66f613e4801134c64d26a0be593588a42e Author: Dimitris Michailidis Date: Tue Mar 8 19:40:31 2022 -0800 net/tls: Provide {__,}tls_driver_ctx() unconditionally Having the definitions of {__,}tls_driver_ctx() under an #if guard means code referencing them also needs to rely on the preprocessor. The protection doesn't appear needed so make the definitions unconditional. Fixes: db37bc177dae ("net/funeth: add the data path") Reported-by: Randy Dunlap Reported-by: kernel test robot Suggested-by: Jakub Kicinski Signed-off-by: Dimitris Michailidis Signed-off-by: Jakub Kicinski include/net/tls.h | 2 -- 1 file changed, 2 deletions(-) commit 4a5eaa2fde59d08d0ca14f985a61c6c745555bbb Author: Jakub Kicinski Date: Tue Mar 8 09:36:59 2022 -0800 bnxt: revert hastily merged uAPI aberrations This reverts: commit 02acd399533e ("bnxt_en: parse result field when NVRAM package install fails") commit 22f5dba5065d ("bnxt_en: add an nvm test for hw diagnose") commit bafed3f231f7 ("bnxt_en: implement hw health reporter") These patches are still under discussion / I don't think they are right, and since the authors don't reply promptly let me lessen my load of "things I need to resolve before next release" and revert them. Acked-by: Michael Chan Link: https://lore.kernel.org/r/20220308173659.304915-1-kuba@kernel.org Signed-off-by: Jakub Kicinski drivers/net/ethernet/broadcom/bnxt/bnxt.c | 19 --- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 45 ------- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 153 ---------------------- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h | 1 - drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 66 ++-------- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 7 - 6 files changed, 14 insertions(+), 277 deletions(-) commit 1a21277190c70084800002bc42ecb7358c7f0775 Author: Heiner Kallweit Date: Tue Mar 8 19:42:57 2022 +0100 net: stmmac: switch no PTP HW support message to info level If HW doesn't support PTP, then it doesn't support it. This is neither a problem nor can the user do something about it. Therefore change the message level to info. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/ee685745-f1ab-e9bf-f20e-077d55dff441@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 91ec77924714b67a6fbe9f6631dd639012fb76eb Author: Chen Yu Date: Tue Mar 8 09:20:30 2022 -0800 e1000e: Print PHY register address when MDI read/write fails There is occasional suspend error from e1000e which blocks the system from further suspending. And the issue was found on a WhiskeyLake-U platform with I219-V: [ 20.078957] PM: pci_pm_suspend(): e1000e_pm_suspend+0x0/0x780 [e1000e] returns -2 [ 20.078970] PM: dpm_run_callback(): pci_pm_suspend+0x0/0x170 returns -2 [ 20.078974] e1000e 0000:00:1f.6: PM: pci_pm_suspend+0x0/0x170 returned -2 after 371012 usecs [ 20.078978] e1000e 0000:00:1f.6: PM: failed to suspend async: error -2 According to the code flow, this might be caused by broken MDI read/write to PHY registers. However currently the code does not tell us which register is broken. Thus enhance the debug information to print the offender PHY register. So the next the issue is reproduced, this information could be used for narrow down. Acked-by: Paul Menzel Reported-by: Todd Brandt Signed-off-by: Chen Yu Tested-by: Naama Meir Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220308172030.451566-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/intel/e1000e/phy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 013a3e7c79ac51e6cdd84e3580863a562c7597c7 Author: Min Li Date: Tue Mar 8 09:10:51 2022 -0500 ptp: idt82p33: use rsmu driver to access i2c/spi bus rsmu (Renesas Synchronization Management Unit ) driver is located in drivers/mfd and responsible for creating multiple devices including idt82p33 phc, which will then use the exposed regmap and mutex handle to access i2c/spi bus. Signed-off-by: Min Li Acked-by: Richard Cochran Link: https://lore.kernel.org/r/1646748651-16811-1-git-send-email-min.li.xe@renesas.com Signed-off-by: Jakub Kicinski drivers/ptp/ptp_idt82p33.c | 344 ++++++++++----------------------------- drivers/ptp/ptp_idt82p33.h | 151 +++++------------ include/linux/mfd/idt82p33_reg.h | 3 + 3 files changed, 129 insertions(+), 369 deletions(-) commit e18058ea99860321851f7e76b8de4a7a4b06f5ed Author: Oleksij Rempel Date: Tue Mar 8 14:58:57 2022 +0100 net: dsa: microchip: ksz9477: implement MTU configuration This chips supports two ways to configure max MTU size: - by setting SW_LEGAL_PACKET_DISABLE bit: if this bit is 0 allowed packed size will be between 64 and bytes 1518. If this bit is 1, it will accept packets up to 2000 bytes. - by setting SW_JUMBO_PACKET bit. If this bit is set, the chip will ignore SW_LEGAL_PACKET_DISABLE value and use REG_SW_MTU__2 register to configure MTU size. Current driver has disabled SW_JUMBO_PACKET bit and activates SW_LEGAL_PACKET_DISABLE. So the switch will pass all packets up to 2000 without any way to configure it. By providing port_change_mtu we are switch to SW_JUMBO_PACKET way and will be able to configure MTU up to ~9000. Signed-off-by: Oleksij Rempel Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220308135857.1119028-1-o.rempel@pengutronix.de Signed-off-by: Jakub Kicinski drivers/net/dsa/microchip/ksz9477.c | 36 +++++++++++++++++++++++++++++++-- drivers/net/dsa/microchip/ksz9477_reg.h | 3 +++ drivers/net/dsa/microchip/ksz_common.h | 1 + 3 files changed, 38 insertions(+), 2 deletions(-) commit e58bc864630f0eb5e7bff8ac3c2d5816591189de Author: Guo Zhengkui Date: Tue Mar 8 21:43:09 2022 +0800 drivers: vxlan: fix returnvar.cocci warning Fix the following coccicheck warning: drivers/net/vxlan/vxlan_core.c:2995:5-8: Unneeded variable: "ret". Return "0" on line 3004. Fixes: f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device") Signed-off-by: Guo Zhengkui Acked-by: Roopa Prabhu Link: https://lore.kernel.org/r/20220308134321.29862-1-guozhengkui@vivo.com Signed-off-by: Jakub Kicinski drivers/net/vxlan/vxlan_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit d13732cc0cc920ee58d45a38d8472769171aaa1d Author: Jia Yang Date: Wed Mar 9 19:09:35 2022 +0800 f2fs: remove unnecessary read for F2FS_FITS_IN_INODE F2FS_FITS_IN_INODE only cares the type of f2fs inode, so there is no need to read node page of f2fs inode. Signed-off-by: Jia Yang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/file.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) commit d268afa1ff6f582dede1819fbed7ded7442a406c Author: Minghao Chi Date: Wed Mar 9 07:28:34 2022 +0000 ata: pata_pxa: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Sergey Shtylyov Signed-off-by: Damien Le Moal drivers/ata/pata_pxa.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 2bec6d9aa89cbe97deb6fbc64708212b780605a4 Author: Kajol Jain Date: Fri Feb 25 20:00:24 2022 +0530 docs: ABI: sysfs-bus-nvdimm: Document sysfs event format entries for nvdimm pmu Details are added for the event, cpumask and format attributes in the ABI documentation. Acked-by: Peter Zijlstra (Intel) Tested-by: Nageswara R Sastry Signed-off-by: Kajol Jain Reviewed-by: Madhavan Srinivasan Link: https://lore.kernel.org/r/20220225143024.47947-5-kjain@linux.ibm.com Signed-off-by: Dan Williams Documentation/ABI/testing/sysfs-bus-nvdimm | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) commit 4c08d4bbc089a95f3f38389c2b79dbc6ab24f10b Author: Kajol Jain Date: Fri Feb 25 20:00:23 2022 +0530 powerpc/papr_scm: Add perf interface support Performance monitoring support for papr-scm nvdimm devices via perf interface is added which includes addition of pmu functions like add/del/read/event_init for nvdimm_pmu struture. A new parameter 'priv' in added to the pdev_archdata structure to save nvdimm_pmu device pointer, to handle the unregistering of pmu device. papr_scm_pmu_register function populates the nvdimm_pmu structure with name, capabilities, cpumask along with event handling functions. Finally the populated nvdimm_pmu structure is passed to register the pmu device. Event handling functions internally uses hcall to get events and counter data. Result in power9 machine with 2 nvdimm device: Ex: List all event by perf list command:# perf list nmem nmem0/cache_rh_cnt/ [Kernel PMU event] nmem0/cache_wh_cnt/ [Kernel PMU event] nmem0/cri_res_util/ [Kernel PMU event] nmem0/ctl_res_cnt/ [Kernel PMU event] nmem0/ctl_res_tm/ [Kernel PMU event] nmem0/fast_w_cnt/ [Kernel PMU event] nmem0/host_l_cnt/ [Kernel PMU event] nmem0/host_l_dur/ [Kernel PMU event] nmem0/host_s_cnt/ [Kernel PMU event] nmem0/host_s_dur/ [Kernel PMU event] nmem0/med_r_cnt/ [Kernel PMU event] nmem0/med_r_dur/ [Kernel PMU event] nmem0/med_w_cnt/ [Kernel PMU event] nmem0/med_w_dur/ [Kernel PMU event] nmem0/mem_life/ [Kernel PMU event] nmem0/poweron_secs/ [Kernel PMU event] ... nmem1/mem_life/ [Kernel PMU event] nmem1/poweron_secs/ [Kernel PMU event] Acked-by: Peter Zijlstra (Intel) Tested-by: Nageswara R Sastry Signed-off-by: Kajol Jain [Add numa_map_to_online_node function call to get online node id] Reported-by: Nageswara R Sastry Reviewed-by: Madhavan Srinivasan Link: https://lore.kernel.org/r/20220225143024.47947-4-kjain@linux.ibm.com Signed-off-by: Dan Williams arch/powerpc/include/asm/device.h | 5 + arch/powerpc/platforms/pseries/papr_scm.c | 225 ++++++++++++++++++++++++++++++ 2 files changed, 230 insertions(+) commit 0fab1ba6ad6ba1f76380f92ead95c6e861ef8116 Author: Kajol Jain Date: Fri Feb 25 20:00:22 2022 +0530 drivers/nvdimm: Add perf interface to expose nvdimm performance stats A common interface is added to get performance stats reporting support for nvdimm devices. Added interface defines supported event list, config fields for the event attributes and their corresponding bit values which are exported via sysfs. Interface also added support for pmu register/unregister functions, cpu hotplug feature along with macros for handling events addition via sysfs. It adds attribute groups for format, cpumask and events to the pmu structure. User could use the standard perf tool to access perf events exposed via nvdimm pmu. [Declare pmu functions in nd.h file to resolve implicit-function-declaration warning and make hotplug function static as reported by kernel test robot] Acked-by: Peter Zijlstra (Intel) Tested-by: Nageswara R Sastry Signed-off-by: Kajol Jain Link: https://lore.kernel.org/all/202202241242.zqzGkguy-lkp@intel.com/ Reported-by: kernel test robot Reviewed-by: Madhavan Srinivasan Link: https://lore.kernel.org/r/20220225143024.47947-3-kjain@linux.ibm.com Signed-off-by: Dan Williams drivers/nvdimm/Makefile | 1 + drivers/nvdimm/nd_perf.c | 328 +++++++++++++++++++++++++++++++++++++++++++++++ include/linux/nd.h | 24 ++++ 3 files changed, 353 insertions(+) commit 9a61d0838cd0a81529badfba7bfa39e81d5529d3 Author: Kajol Jain Date: Fri Feb 25 20:00:21 2022 +0530 drivers/nvdimm: Add nvdimm pmu structure A structure is added called nvdimm_pmu, for performance stats reporting support of nvdimm devices. It can be used to add device pmu data such as pmu data structure for performance stats, nvdimm device pointer along with cpumask attributes. Acked-by: Peter Zijlstra (Intel) Tested-by: Nageswara R Sastry Signed-off-by: Kajol Jain Reviewed-by: Madhavan Srinivasan Link: https://lore.kernel.org/r/20220225143024.47947-2-kjain@linux.ibm.com Signed-off-by: Dan Williams include/linux/nd.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) commit 89b184f980f012421fb22c939b50b3dfd7fe16b3 Author: Max Filippov Date: Tue Dec 28 01:28:53 2021 -0800 xtensa: make secondary reset vector support conditional Whether xtensa cores start from primary or secondary reset vector is configurable and may be chosen by board designer or controlled at runtime. When secondary reset vector is unused its location in memory may not be writable. Make secondary reset vector support conditional and don't build and load secondary reset vector code when it is disabled. Signed-off-by: Max Filippov arch/xtensa/Kconfig | 9 +++++++++ arch/xtensa/kernel/Makefile | 3 ++- arch/xtensa/kernel/setup.c | 2 +- arch/xtensa/kernel/vmlinux.lds.S | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) commit f321c35feaee8dbde551775210ae3d41534b7a20 Author: Bjorn Helgaas Date: Thu Feb 24 16:47:53 2022 -0600 PCI/VGA: Replace full MIT license text with SPDX identifier Per Documentation/process/license-rules.rst, the SPDX MIT identifier is equivalent to including the entire MIT license text from LICENSES/preferred/MIT. Replace the MIT license text with the equivalent SPDX identifier. Link: https://lore.kernel.org/r/20220224224753.297579-12-helgaas@kernel.org Signed-off-by: Bjorn Helgaas drivers/pci/vgaarb.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) commit d5109fe4d1ecba04d3f6903ab0421188d1420d22 Author: Bjorn Helgaas Date: Thu Feb 24 16:47:52 2022 -0600 PCI/VGA: Use unsigned format string to print lock counts In struct vga_device, io_lock_cnt and mem_lock_cnt are unsigned, but we previously printed them with "%d", the signed decimal format. Print them with the unsigned format "%u" instead. Link: https://lore.kernel.org/r/20220224224753.297579-11-helgaas@kernel.org Signed-off-by: Bjorn Helgaas drivers/pci/vgaarb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4e6c91847a7fa94a6a0caeeb388718b8ae005d56 Author: Huacai Chen Date: Thu Feb 24 16:47:51 2022 -0600 PCI/VGA: Log bridge control messages when adding devices Previously vga_arb_device_init() iterated through all VGA devices and indicated whether legacy VGA routing to each could be controlled by an upstream bridge. But we determine that information in vga_arbiter_add_pci_device(), which we call for every device, so we can log it there without iterating through the VGA devices again. Note that we call vga_arbiter_check_bridge_sharing() before adding the device to vga_list, so we have to handle the very first device separately. Link: https://lore.kernel.org/r/20220224224753.297579-10-helgaas@kernel.org Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas drivers/pci/vgaarb.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) commit dc593fd48abbea1e840c847c464eabc9c6bca180 Author: Bjorn Helgaas Date: Thu Feb 24 16:47:50 2022 -0600 PCI/VGA: Remove empty vga_arb_device_card_gone() vga_arb_device_card_gone() has always been empty. Remove it. Link: https://lore.kernel.org/r/20220224224753.297579-9-helgaas@kernel.org Signed-off-by: Bjorn Helgaas drivers/pci/vgaarb.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) commit 37114e4d1547ed230706d07edaee2d2b4b3215a4 Author: Huacai Chen Date: Thu Feb 24 16:47:49 2022 -0600 PCI/VGA: Move disabled VGA device detection to ADD_DEVICE path a37c0f48950b ("vgaarb: Select a default VGA device even if there's no legacy VGA") extended the vga_arb_device_init() subsys_initcall so that if there are no other eligible devices, it could select a disabled VGA device as the default. Move this detection from vga_arb_select_default_device() to vga_arbiter_add_pci_device() so every device, even those hot-added or enumerated after vga_arb_device_init() is eligible for selection as the default VGA device. [bhelgaas: commit log, restructure] Link: https://lore.kernel.org/r/20211015061512.2941859-5-chenhuacai@loongson.cn Link: https://lore.kernel.org/r/20220224224753.297579-8-helgaas@kernel.org Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas Cc: Daniel Axtens Cc: Zhou Wang drivers/pci/vgaarb.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) commit e96902eb8c69fdcc55fa6beee796c6b34613e0fc Author: Huacai Chen Date: Thu Feb 24 16:47:48 2022 -0600 PCI/VGA: Move non-legacy VGA detection to ADD_DEVICE path a37c0f48950b ("vgaarb: Select a default VGA device even if there's no legacy VGA") extended the vga_arb_device_init() subsys_initcall so it could select a non-legacy VGA device as the default. That failed to consider that PCI devices may be enumerated after vga_arb_device_init(), e.g., hot-added devices or non-ACPI systems that do PCI enumeration in pcibios_init(). Devices found then could never be selected as the default. One system where this is a problem is the MIPS-based Loongson where an ASpeed AST2500 VGA device is behind a bridge that doesn't implement the VGA Enable bit, so legacy resources are not routed to the VGA device. [1] Fix this by moving the non-legacy VGA device selection from vga_arb_select_default_device() to vga_arbiter_add_pci_device(), which is called after every PCI device is enumerated, either by the vga_arb_device_init() subsys_initcall or as an ADD_DEVICE notifier. [1] https://lore.kernel.org/r/20210514080025.1828197-6-chenhuacai@loongson.cn [bhelgaas: commit log, restructure] Link: https://lore.kernel.org/r/20211015061512.2941859-5-chenhuacai@loongson.cn Link: https://lore.kernel.org/r/20211015061512.2941859-7-chenhuacai@loongson.cn Link: https://lore.kernel.org/r/20220224224753.297579-7-helgaas@kernel.org Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas Cc: Daniel Axtens Cc: Zhou Wang drivers/pci/vgaarb.c | 54 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 22 deletions(-) commit f8d81df285a2fa2e739a9e4774e413ac778d282c Author: Huacai Chen Date: Thu Feb 24 16:47:47 2022 -0600 PCI/VGA: Move firmware default device detection to ADD_DEVICE path Previously we selected the firmware default device, i.e., one that owns the boot framebuffer, as the default device in vga_arb_select_default_device(). This was only done in the vga_arb_device_init() subsys_initcall, so devices enumerated later, e.g., by pcibios_init(), were not eligible. Fix this by moving the firmware default device selection from vga_arb_select_default_device() to vga_arbiter_add_pci_device(), which is called after every PCI device is enumerated, either by the vga_arb_device_init() subsys_initcall or as an ADD_DEVICE notifier. Note that if vga_arb_select_default_device() previously found a device owning the boot framebuffer, it unconditionally set it to be the default VGA device, and no subsequent device could replace it. [bhelgaas: commit log, restructure slightly] Link: https://lore.kernel.org/r/20211015061512.2941859-7-chenhuacai@loongson.cn Link: https://lore.kernel.org/r/20220224224753.297579-6-helgaas@kernel.org Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas Cc: Bruno Prémont drivers/pci/vgaarb.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) commit dfe3da812d99b40f99ce018152db4b3a87bd86c4 Author: Huacai Chen Date: Thu Feb 24 16:47:46 2022 -0600 PCI/VGA: Factor out default VGA device selection Default VGA device selection fails when PCI devices are enumerated after the vga_arb_device_init() subsys_initcall. vga_arbiter_add_pci_device() selects the first fully enabled device to which legacy VGA resources are routed as the default VGA device. This is an ADD_DEVICE notifier, so it runs after every PCI device is enumerated. vga_arb_select_default_device() may select framebuffer devices, partially enabled GPUs, or non-legacy devices that don't have legacy VGA resources routed to them as the default VGA device. But this only happens once, from the vga_arb_device_init() subsys_initcall, so it doesn't consider devices enumerated after that: acpi_init acpi_scan_init acpi_pci_root_init # PCI device enumeration (ACPI systems) vga_arb_device_init for_each_pci_device vga_arbiter_add_pci_device # ADD_DEVICE notifier if (VGA-owner) vga_set_default_device <-- set default VGA vga_arb_select_default_device # only called ONCE for_each_vga_device if (framebuffer) vga_set_default_device <-- set default VGA to framebuffer if (!vga_default_device()) if (non-legacy, integrated GPU, etc) vga_set_default_device <-- set default VGA if (!vga_default_device()) vga_set_default_device <-- set default VGA pcibios_init pcibios_scanbus # PCI device enumeration (non-ACPI systems) ... vga_arbiter_add_pci_device # ADD_DEVICE notification if (VGA-owner) vga_set_default_device <-- set default VGA Note that on non-ACPI systems, vga_arb_select_default_device() runs before pcibios_init(), so it sees no VGA devices and can never set a framebuffer device, a non-legacy integrated GPU, etc., as the default device. Factor out the default VGA device selection to vga_is_boot_device(), called from vga_arbiter_add_pci_device(). Then we can migrate the default device selection from vga_arb_select_default_device() to the vga_arbiter_add_pci_device() path. [bhelgaas: commit log, split to separate patch] Link: https://lore.kernel.org/r/20211015061512.2941859-4-chenhuacai@loongson.cn Link: https://lore.kernel.org/r/20220224224753.297579-5-helgaas@kernel.org Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas drivers/pci/vgaarb.c | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) commit 60a9bac8ab48ddbf68dc280cd26879583e9d72ba Author: Bjorn Helgaas Date: Thu Feb 24 16:47:45 2022 -0600 PCI/VGA: Factor out vga_select_framebuffer_device() On x86 and ia64, if a VGA device BARs include a framebuffer reported by platform firmware, we select the device as the default VGA device. Factor this code to a separate function. No functional change intended. Link: https://lore.kernel.org/r/20220224224753.297579-4-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Bruno Prémont drivers/pci/vgaarb.c | 99 ++++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 46 deletions(-) commit c1593ddd894d0518fc96fe7f531f3a5c919b8463 Author: Huacai Chen Date: Thu Feb 24 16:47:44 2022 -0600 PCI/VGA: Move vga_arb_integrated_gpu() earlier in file Move vga_arb_integrated_gpu() earlier in file to prepare for future patch. No functional change intended. [bhelgaas: pull #ifdefs inside function] Link: https://lore.kernel.org/r/20211015061512.2941859-3-chenhuacai@loongson.cn Link: https://lore.kernel.org/r/20220224224753.297579-3-helgaas@kernel.org Signed-off-by: Huacai Chen Signed-off-by: Bjorn Helgaas drivers/pci/vgaarb.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) commit 1d38fe6ee6a874675ca3bba6b48e69a0e6176ffc Author: Bjorn Helgaas Date: Thu Feb 24 16:47:43 2022 -0600 PCI/VGA: Move vgaarb to drivers/pci The VGA arbiter is really PCI-specific and doesn't depend on any GPU things. Move it to the PCI subsystem. Note that misc_init() must be called before vga_arb_device_init(). These are both subsys_initcalls, so this ordering depends on the link order, which is determined by drivers/Makefile: obj-y += pci/ obj-y += char/ <-- misc_init() obj-y += gpu/ <-- vga_arb_device_init() (before this commit) The drivers/pci/ subsys_initcalls are called *before* misc_init(), so convert vga_arb_device_init() to subsys_initcall_sync(), which is called after *all* subsys_initcalls. Link: https://lore.kernel.org/r/20220224224753.297579-2-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Documentation/gpu/vgaarbiter.rst | 2 +- drivers/gpu/vga/Kconfig | 19 ------------------- drivers/gpu/vga/Makefile | 1 - drivers/pci/Kconfig | 19 +++++++++++++++++++ drivers/pci/Makefile | 1 + drivers/{gpu/vga => pci}/vgaarb.c | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) commit fb5abce6b2bb5cb3d628aaa63fa821da8c4600f9 Author: James Bottomley Date: Mon Mar 7 15:58:03 2022 -0500 tpm: use try_get_ops() in tpm-space.c As part of the series conversion to remove nested TPM operations: https://lore.kernel.org/all/20190205224723.19671-1-jarkko.sakkinen@linux.intel.com/ exposure of the chip->tpm_mutex was removed from much of the upper level code. In this conversion, tpm2_del_space() was missed. This didn't matter much because it's usually called closely after a converted operation, so there's only a very tiny race window where the chip can be removed before the space flushing is done which causes a NULL deref on the mutex. However, there are reports of this window being hit in practice, so fix this by converting tpm2_del_space() to use tpm_try_get_ops(), which performs all the teardown checks before acquring the mutex. Cc: stable@vger.kernel.org # 5.4.x Signed-off-by: James Bottomley Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen drivers/char/tpm/tpm2-space.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 590bfb57b2328951d5833979e7ca1d5fde2e609a Author: Eric Biggers Date: Mon Feb 7 21:24:48 2022 -0800 KEYS: asymmetric: properly validate hash_algo and encoding It is insecure to allow arbitrary hash algorithms and signature encodings to be used with arbitrary signature algorithms. Notably, ECDSA, ECRDSA, and SM2 all sign/verify raw hash values and don't disambiguate between different hash algorithms like RSA PKCS#1 v1.5 padding does. Therefore, they need to be restricted to certain sets of hash algorithms (ideally just one, but in practice small sets are used). Additionally, the encoding is an integral part of modern signature algorithms, and is not supposed to vary. Therefore, tighten the checks of hash_algo and encoding done by software_key_determine_akcipher(). Also rearrange the parameters to software_key_determine_akcipher() to put the public_key first, as this is the most important parameter and it often determines everything else. Fixes: 299f561a6693 ("x509: Add support for parsing x509 certs with ECDSA keys") Fixes: 215525639631 ("X.509: support OSCCA SM2-with-SM3 certificate verification") Fixes: 0d7a78643f69 ("crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm") Cc: stable@vger.kernel.org Tested-by: Stefan Berger Tested-by: Tianjia Zhang Signed-off-by: Eric Biggers Reviewed-by: Vitaly Chikunov Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen crypto/asymmetric_keys/public_key.c | 111 ++++++++++++++++++++++++------------ 1 file changed, 76 insertions(+), 35 deletions(-) commit 2abc9c246e0548e52985b10440c9ea3e9f65f793 Author: Eric Biggers Date: Mon Feb 7 21:24:47 2022 -0800 KEYS: asymmetric: enforce that sig algo matches key algo Most callers of public_key_verify_signature(), including most indirect callers via verify_signature() as well as pkcs7_verify_sig_chain(), don't check that public_key_signature::pkey_algo matches public_key::pkey_algo. These should always match. However, a malicious signature could intentionally declare an unintended algorithm. It is essential that such signatures be rejected outright, or that the algorithm of the *key* be used -- not the algorithm of the signature as that would allow attackers to choose the algorithm used. Currently, public_key_verify_signature() correctly uses the key's algorithm when deciding which akcipher to allocate. That's good. However, it uses the signature's algorithm when deciding whether to do the first step of SM2, which is incorrect. Also, v4.19 and older kernels used the signature's algorithm for the entire process. Prevent such errors by making public_key_verify_signature() enforce that the signature's algorithm (if given) matches the key's algorithm. Also remove two checks of this done by callers, which are now redundant. Cc: stable@vger.kernel.org Tested-by: Stefan Berger Tested-by: Tianjia Zhang Signed-off-by: Eric Biggers Reviewed-by: Vitaly Chikunov Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen crypto/asymmetric_keys/pkcs7_verify.c | 6 ------ crypto/asymmetric_keys/public_key.c | 15 +++++++++++++++ crypto/asymmetric_keys/x509_public_key.c | 6 ------ 3 files changed, 15 insertions(+), 12 deletions(-) commit d29360ff239cd83aaf74897e3abfa7cd6dc2b06c Author: Tang Yizhou Date: Wed Mar 9 23:36:59 2022 +0800 docs/zh_CN: Add sched-stats Chinese translation Translate scheduler/sched-stats.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20220309153659.24437-1-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet .../translations/zh_CN/scheduler/index.rst | 3 +- .../translations/zh_CN/scheduler/sched-stats.rst | 156 +++++++++++++++++++++ 2 files changed, 157 insertions(+), 2 deletions(-) commit 09d4466d3f3c72e3c1d1277839e0f98283e31d1e Author: Yanteng Si Date: Mon Mar 7 16:42:22 2022 +0800 docs/zh_CN: add devicetree of_unittest translation Translate .../Devicetree/of_unittest.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/da75225df2ac7bee8de653d95b2a872510b34f7d.1646642188.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../translations/zh_CN/devicetree/index.rst | 3 +- .../translations/zh_CN/devicetree/of_unittest.rst | 189 +++++++++++++++++++++ 2 files changed, 190 insertions(+), 2 deletions(-) commit c56481299df3d57a6f874e8dd35dab5e4cfc20e2 Author: Yanteng Si Date: Mon Mar 7 16:42:21 2022 +0800 docs/zh_CN: add devicetree usage-model translation Translate .../Devicetree/usage-model.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/abc4bfa5a8eb438013913bf8ea5f8a29e5730f33.1646642188.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../translations/zh_CN/devicetree/index.rst | 4 +- .../translations/zh_CN/devicetree/usage-model.rst | 330 +++++++++++++++++++++ 2 files changed, 333 insertions(+), 1 deletion(-) commit a17b0169f29bd25c30750846ac0f1f7b5c13e978 Author: Yanteng Si Date: Mon Mar 7 16:42:20 2022 +0800 docs/zh_CN: add devicetree index translation Translate .../devicetree/index.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/0a01f2eee980da02c0810d3d99b95af9013b646f.1646642188.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet .../translations/zh_CN/devicetree/index.rst | 49 ++++++++++++++++++++++ Documentation/translations/zh_CN/index.rst | 6 ++- 2 files changed, 54 insertions(+), 1 deletion(-) commit fa04150b8ef7f15cb7654c11a24a9a4e0834de33 Author: Bagas Sanjaya Date: Mon Mar 7 13:33:41 2022 +0700 Documentation: describe how to apply incremental stable patches The applying patches document (Documentation/process/applying-patches.rst) mentions incremental stable patches, but there is no example of how to apply them. Describe the process. While at it, remove note about incremental patches and move the external link of 5.x.y incremental patches to "Where can I download patches?" section. Signed-off-by: Bagas Sanjaya Link: https://lore.kernel.org/r/20220307063340.256671-1-bagasdotme@gmail.com Signed-off-by: Jonathan Corbet Documentation/process/applying-patches.rst | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) commit 955ad0c8ba93256c9eeeefde5644b3480c1ddedd Merge: 482d7b582d7f 96a2f0f2c800 Author: Dave Airlie Date: Thu Mar 10 09:28:38 2022 +1000 Merge tag 'amd-drm-next-5.18-2022-03-09' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.18-2022-03-09: amdgpu: - Misc code cleanups - Misc display fixes - PSR display fixes - More RAS cleanup - Hotplug fix - Bump minor version for hotplug tests - SR-IOV fixes - GC 10.3.7 updates - Remove some firmwares which are no longer used - Mode2 reset refactor - Aldebaran fixes - Add VCN fwlog feature for VCN debugging - CS code cleanup - Fix clang warning - Fix CS clean up rebase breakage amdkfd: - SVM fixes - SMI event fixes and cleanups - vmid_pasid mapping fix for gfx10.3 Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220309224439.2178877-1-alexander.deucher@amd.com commit 482d7b582d7f9688a5f64ed2424157a76a17f2a7 Merge: e6700703353f 05afd57f4d34 Author: Dave Airlie Date: Thu Mar 10 08:30:46 2022 +1000 Merge tag 'drm-msm-next-2022-03-08' of https://gitlab.freedesktop.org/drm/msm into drm-next Follow-up pull req for v5.18 to pull in some important fixes. Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvwHFHEd+9df-0aBOCfmw+ULvTS3f18sJuq_cvGKLDSjw@mail.gmail.com commit 78cebdb7c612cc62721812daec55bd7aa73f0956 Author: Yanteng Si Date: Tue Mar 1 12:18:26 2022 +0800 docs/zh_CN: add peci subsystem translation Translate .../peci/peci.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/00577790cb16375e0016513e03d06b671006a3da.1646108017.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet Documentation/translations/zh_CN/peci/index.rst | 4 +- Documentation/translations/zh_CN/peci/peci.rst | 54 +++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) commit 0c21751f0a071a6fc94a48598e6c0752a284550c Author: Yanteng Si Date: Tue Mar 1 12:18:25 2022 +0800 docs/zh_CN: add peci index translation Translate .../pici/index.rst into Chinese Signed-off-by: Yanteng Si Link: https://lore.kernel.org/r/9fdba94417277ae20db7e3b13418584c652be93f.1646108017.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet Documentation/translations/zh_CN/index.rst | 1 + Documentation/translations/zh_CN/peci/index.rst | 26 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) commit 125c0d0bec56069810ab835daa49453890d159c8 Author: Yanteng Si Date: Tue Mar 1 12:18:24 2022 +0800 docs/zh_CN: add riscv vm-layout translation Translate .../riscv/vm-layout.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/b59965f7f88ea22ec824dc2e92561b018fd370d1.1646108017.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet Documentation/translations/zh_CN/riscv/index.rst | 1 + .../translations/zh_CN/riscv/vm-layout.rst | 67 ++++++++++++++++++++++ 2 files changed, 68 insertions(+) commit f09f6f9b69821c9efcf16e6b5b466ce9e263ca51 Author: Kees Cook Date: Fri Mar 4 10:14:18 2022 -0800 Documentation/process: Add Researcher Guidelines As a follow-up to the UMN incident[1], the TAB took the responsibility to document Researcher Guidelines so there would be a common place to point for describing our expectations as a developer community. Document best practices researchers should follow to participate successfully with the Linux developer community. [1] https://lore.kernel.org/lkml/202105051005.49BFABCE@keescook/ Co-developed-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman Co-developed-by: Jonathan Corbet Co-developed-by: Stefano Zacchiroli Signed-off-by: Stefano Zacchiroli Co-developed-by: Steven Rostedt Signed-off-by: Steven Rostedt Acked-by: Steve Rostedt Acked-by: Laura Abbott Reviewed-by: Julia Lawall Reviewed-by: Wenwen Wang Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220304181418.1692016-1-keescook@chromium.org Signed-off-by: Jonathan Corbet Documentation/process/index.rst | 1 + Documentation/process/researcher-guidelines.rst | 143 ++++++++++++++++++++++++ 2 files changed, 144 insertions(+) commit 96a2f0f2c8006d338a9647e068a15c6eb299f864 Author: Lang Yu Date: Mon Mar 7 11:47:45 2022 +0800 drm/amdgpu: fix a wrong ib reference It should be p->job->ibs[j] instead of p->job->ibs[i] here. Fixes: cdc7893fc93f19 ("drm/amdgpu: use job and ib structures directly in CS parsers") Signed-off-by: Lang Yu Reviewed-by: Christian König Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit d55957fb299b74829c438f77fe29896e3aed39fc Author: Yifan Zhang Date: Wed Mar 9 09:59:19 2022 +0800 drm/amdkfd: bail out early if no get_atc_vmid_pasid_mapping_info it makes no sense to continue with an undefined vmid. Fixes: c8b0507f40deea ("drm/amdkfd: judge get_atc_vmid_pasid_mapping_info before call") Signed-off-by: Yifan Zhang Reported-by: Nathan Chancellor Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) commit de55c9a1967c798fba6d8afe19826f8f03049db3 Merge: 3399dd9f372b 55fcacca3646 Author: Alexei Starovoitov Date: Wed Mar 9 14:19:23 2022 -0800 Merge branch 'Add support for transmitting packets using XDP in bpf_prog_run()' Toke Høiland-Jørgensen says: ==================== This series adds support for transmitting packets using XDP in bpf_prog_run(), by enabling a new mode "live packet" mode which will handle the XDP program return codes and redirect the packets to the stack or other devices. The primary use case for this is testing the redirect map types and the ndo_xdp_xmit driver operation without an external traffic generator. But it turns out to also be useful for creating a programmable traffic generator in XDP, as well as injecting frames into the stack. A sample traffic generator, which was included in previous versions of the series, but now moved to xdp-tools, transmits up to 9 Mpps/core on my test machine. To transmit the frames, the new mode instantiates a page_pool structure in bpf_prog_run() and initialises the pages to contain XDP frames with the data passed in by userspace. These frames can then be handled as though they came from the hardware XDP path, and the existing page_pool code takes care of returning and recycling them. The setup is optimised for high performance with a high number of repetitions to support stress testing and the traffic generator use case; see patch 1 for details. v11: - Fix override of return code in xdp_test_run_batch() - Add Martin's ACKs to remaining patches v10: - Only propagate memory allocation errors from xdp_test_run_batch() - Get rid of BPF_F_TEST_XDP_RESERVED; batch_size can be used to probe - Check that batch_size is unset in non-XDP test_run funcs - Lower the number of repetitions in the selftest to 10k - Count number of recycled pages in the selftest - Fix a few other nits from Martin, carry forward ACKs v9: - XDP_DROP packets in the selftest to ensure pages are recycled - Fix a few issues reported by the kernel test robot - Rewrite the documentation of the batch size to make it a bit clearer - Rebase to newest bpf-next v8: - Make the batch size configurable from userspace - Don't interrupt the packet loop on errors in do_redirect (this can be caught from the tracepoint) - Add documentation of the feature - Add reserved flag userspace can use to probe for support (kernel didn't check flags previously) - Rebase to newest bpf-next, disallow live mode for jumbo frames v7: - Extend the local_bh_disable() to cover the full test run loop, to prevent running concurrently with the softirq. Fixes a deadlock with veth xmit. - Reinstate the forwarding sysctl setting in the selftest, and bump up the number of packets being transmitted to trigger the above bug. - Update commit message to make it clear that user space can select the ingress interface. v6: - Fix meta vs data pointer setting and add a selftest for it - Add local_bh_disable() around code passing packets up the stack - Create a new netns for the selftest and use a TC program instead of the forwarding hack to count packets being XDP_PASS'ed from the test prog. - Check for the correct ingress ifindex in the selftest - Rebase and drop patches 1-5 that were already merged v5: - Rebase to current bpf-next v4: - Fix a few code style issues (Alexei) - Also handle the other return codes: XDP_PASS builds skbs and injects them into the stack, and XDP_TX is turned into a redirect out the same interface (Alexei). - Drop the last patch adding an xdp_trafficgen program to samples/bpf; this will live in xdp-tools instead (Alexei). - Add a separate bpf_test_run_xdp_live() function to test_run.c instead of entangling the new mode in the existing bpf_test_run(). v3: - Reorder patches to make sure they all build individually (Patchwork) - Remove a couple of unused variables (Patchwork) - Remove unlikely() annotation in slow path and add back John's ACK that I accidentally dropped for v2 (John) v2: - Split up up __xdp_do_redirect to avoid passing two pointers to it (John) - Always reset context pointers before each test run (John) - Use get_mac_addr() from xdp_sample_user.h instead of rolling our own (Kumar) - Fix wrong offset for metadata pointer ==================== Signed-off-by: Alexei Starovoitov commit 55fcacca36468801e62e1d9cc81e5870eea620ba Author: Toke Høiland-Jørgensen Date: Wed Mar 9 11:53:46 2022 +0100 selftests/bpf: Add selftest for XDP_REDIRECT in BPF_PROG_RUN This adds a selftest for the XDP_REDIRECT facility in BPF_PROG_RUN, that redirects packets into a veth and counts them using an XDP program on the other side of the veth pair and a TC program on the local side of the veth. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220309105346.100053-6-toke@redhat.com .../selftests/bpf/prog_tests/xdp_do_redirect.c | 177 +++++++++++++++++++++ .../selftests/bpf/progs/test_xdp_do_redirect.c | 100 ++++++++++++ 2 files changed, 277 insertions(+) commit a30338840fa5c6e400673b7d8a31323280bfd521 Author: Toke Høiland-Jørgensen Date: Wed Mar 9 11:53:45 2022 +0100 selftests/bpf: Move open_netns() and close_netns() into network_helpers.c These will also be used by the xdp_do_redirect test being added in the next commit. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220309105346.100053-5-toke@redhat.com tools/testing/selftests/bpf/network_helpers.c | 86 +++++++++++++++++++++ tools/testing/selftests/bpf/network_helpers.h | 9 +++ .../testing/selftests/bpf/prog_tests/tc_redirect.c | 89 ---------------------- 3 files changed, 95 insertions(+), 89 deletions(-) commit 24592ad1ab18416a850f03d46d07ae483f808895 Author: Toke Høiland-Jørgensen Date: Wed Mar 9 11:53:44 2022 +0100 libbpf: Support batch_size option to bpf_prog_test_run Add support for setting the new batch_size parameter to BPF_PROG_TEST_RUN to libbpf; just add it as an option and pass it through to the kernel. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220309105346.100053-4-toke@redhat.com tools/lib/bpf/bpf.c | 1 + tools/lib/bpf/bpf.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) commit 1a7551f15097dff30cf0853117b2f8077bb84f0a Author: Toke Høiland-Jørgensen Date: Wed Mar 9 11:53:43 2022 +0100 Documentation/bpf: Add documentation for BPF_PROG_RUN This adds documentation for the BPF_PROG_RUN command; a short overview of the command itself, and a more verbose description of the "live packet" mode for XDP introduced in the previous commit. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220309105346.100053-3-toke@redhat.com Documentation/bpf/bpf_prog_run.rst | 117 +++++++++++++++++++++++++++++++++++++ Documentation/bpf/index.rst | 1 + 2 files changed, 118 insertions(+) commit b530e9e1063ed2b817eae7eec6ed2daa8be11608 Author: Toke Høiland-Jørgensen Date: Wed Mar 9 11:53:42 2022 +0100 bpf: Add "live packet" mode for XDP in BPF_PROG_RUN This adds support for running XDP programs through BPF_PROG_RUN in a mode that enables live packet processing of the resulting frames. Previous uses of BPF_PROG_RUN for XDP returned the XDP program return code and the modified packet data to userspace, which is useful for unit testing of XDP programs. The existing BPF_PROG_RUN for XDP allows userspace to set the ingress ifindex and RXQ number as part of the context object being passed to the kernel. This patch reuses that code, but adds a new mode with different semantics, which can be selected with the new BPF_F_TEST_XDP_LIVE_FRAMES flag. When running BPF_PROG_RUN in this mode, the XDP program return codes will be honoured: returning XDP_PASS will result in the frame being injected into the networking stack as if it came from the selected networking interface, while returning XDP_TX and XDP_REDIRECT will result in the frame being transmitted out that interface. XDP_TX is translated into an XDP_REDIRECT operation to the same interface, since the real XDP_TX action is only possible from within the network drivers themselves, not from the process context where BPF_PROG_RUN is executed. Internally, this new mode of operation creates a page pool instance while setting up the test run, and feeds pages from that into the XDP program. The setup cost of this is amortised over the number of repetitions specified by userspace. To support the performance testing use case, we further optimise the setup step so that all pages in the pool are pre-initialised with the packet data, and pre-computed context and xdp_frame objects stored at the start of each page. This makes it possible to entirely avoid touching the page content on each XDP program invocation, and enables sending up to 9 Mpps/core on my test box. Because the data pages are recycled by the page pool, and the test runner doesn't re-initialise them for each run, subsequent invocations of the XDP program will see the packet data in the state it was after the last time it ran on that particular page. This means that an XDP program that modifies the packet before redirecting it has to be careful about which assumptions it makes about the packet content, but that is only an issue for the most naively written programs. Enabling the new flag is only allowed when not setting ctx_out and data_out in the test specification, since using it means frames will be redirected somewhere else, so they can't be returned. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20220309105346.100053-2-toke@redhat.com include/uapi/linux/bpf.h | 3 + kernel/bpf/Kconfig | 1 + kernel/bpf/syscall.c | 2 +- net/bpf/test_run.c | 334 +++++++++++++++++++++++++++++++++++++++-- tools/include/uapi/linux/bpf.h | 3 + 5 files changed, 328 insertions(+), 15 deletions(-) commit c20e1117d9aa22c558646a1060ddd1dd042fb107 Author: Max Filippov Date: Fri Apr 23 00:34:44 2021 -0700 xtensa: add kernel ABI selection to Kconfig Add choice to use default or call0 ABI for the kernel code. If call0 ABI is chosen add '-mabi=call0' to the flags. The toolchain support for this option is rather new so only enable it when the compiler supports it. Signed-off-by: Max Filippov arch/xtensa/Kconfig | 35 +++++++++++++++++++++++++++++++++++ arch/xtensa/Makefile | 4 ++++ 2 files changed, 39 insertions(+) commit 19c5699f9affbd6824f4db0e19fcdc9d609a5e6b Author: Max Filippov Date: Mon Oct 18 05:38:06 2021 -0700 xtensa: don't link with libgcc libgcc may be absent or may have different ABI than the kernel. Don't link with it. Drop declarations and export for helpers that are not implemented. Use generic versions of DI mode multiplication and comparisons. Drop register window spilling helper as it should never be used by the compiler-generated code. Signed-off-by: Max Filippov arch/xtensa/Kconfig | 3 +++ arch/xtensa/Makefile | 6 +----- arch/xtensa/kernel/xtensa_ksyms.c | 14 -------------- 3 files changed, 4 insertions(+), 19 deletions(-) commit dbf4ed894c0fd85d421f7b3b9758ce95398d2925 Author: Max Filippov Date: Mon Oct 18 04:29:27 2021 -0700 xtensa: add helpers for division, remainder and shifts Don't rely on libgcc presence, build own versions of the helpers with correct ABI. Signed-off-by: Max Filippov arch/xtensa/include/asm/asmmacro.h | 34 ++++++++++ arch/xtensa/lib/Makefile | 2 + arch/xtensa/lib/ashldi3.S | 28 ++++++++ arch/xtensa/lib/ashrdi3.S | 28 ++++++++ arch/xtensa/lib/divsi3.S | 74 +++++++++++++++++++++ arch/xtensa/lib/lshrdi3.S | 28 ++++++++ arch/xtensa/lib/modsi3.S | 87 ++++++++++++++++++++++++ arch/xtensa/lib/mulsi3.S | 133 +++++++++++++++++++++++++++++++++++++ arch/xtensa/lib/udivsi3.S | 68 +++++++++++++++++++ arch/xtensa/lib/umodsi3.S | 57 ++++++++++++++++ 10 files changed, 539 insertions(+) commit 8c9ab55c0fbdc76cb876140c2dad75a610bb23ef Author: Max Filippov Date: Tue Dec 28 01:20:20 2021 -0800 xtensa: add missing XCHAL_HAVE_WINDOWED check Add missing preprocessor conditions to secondary reset vector code. Fixes: 09af39f649da ("xtensa: use register window specific opcodes only when present") Signed-off-by: Max Filippov arch/xtensa/kernel/mxhead.S | 2 ++ 1 file changed, 2 insertions(+) commit 2722ae9c9419e5727d868c7d1efed28e765fcbbc Merge: 9e1a3ce0a952 f833116ad2c3 Author: Kees Cook Date: Wed Mar 9 13:44:46 2022 -0800 Merge branch 'coredump-vma-snapshot-fix-for-v5.18' of https://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace into for-next/execve - Fix missing mmap_lock in file_files_note (Eric W. Biederman) commit 6862c787c7e88df490675ed781dc9052dba88a56 Author: Yevgeny Kliteynik Date: Wed Feb 23 18:40:59 2022 +0200 net/mlx5: DR, Add support for ConnectX-7 steering Add support for a new SW format version that is implemented by ConnectX-7. Except for several differences, the STEv2 is identical to STEv1, so for most callbacks the STEv2 context struct will call STEv1 functions. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/Makefile | 1 + .../mellanox/mlx5/core/steering/dr_domain.c | 2 +- .../mellanox/mlx5/core/steering/dr_matcher.c | 8 +- .../ethernet/mellanox/mlx5/core/steering/dr_ste.c | 2 + .../ethernet/mellanox/mlx5/core/steering/dr_ste.h | 1 + .../mellanox/mlx5/core/steering/dr_ste_v1.c | 202 +++++++++--------- .../mellanox/mlx5/core/steering/dr_ste_v1.h | 94 +++++++++ .../mellanox/mlx5/core/steering/dr_ste_v2.c | 231 +++++++++++++++++++++ .../ethernet/mellanox/mlx5/core/steering/fs_dr.c | 2 +- .../ethernet/mellanox/mlx5/core/steering/mlx5dr.h | 2 +- include/linux/mlx5/mlx5_ifc.h | 1 + 11 files changed, 436 insertions(+), 110 deletions(-) commit 638a07f1090ea79fa6720b4d0265c6f8206f0c1b Author: Yevgeny Kliteynik Date: Wed Feb 23 18:17:39 2022 +0200 net/mlx5: DR, Refactor ste_ctx handling for STE v0/1 As preparation for supporting ConnectX-7, this patches changes handling of ste_ctx handling for existing STE v0 and V1: - each context is now a static struct, and it has a corresponding getter - v0 and v1 were extended to contain the fields that are required for integrating STEv2. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed .../ethernet/mellanox/mlx5/core/steering/dr_ste.c | 21 +++++++++------------ .../ethernet/mellanox/mlx5/core/steering/dr_ste.h | 6 ++++-- .../mellanox/mlx5/core/steering/dr_ste_v0.c | 9 ++++++++- .../mellanox/mlx5/core/steering/dr_ste_v1.c | 20 ++++++++++++++++++-- .../ethernet/mellanox/mlx5/core/steering/dr_types.h | 1 + 5 files changed, 40 insertions(+), 17 deletions(-) commit 75a3926ca6a434651d4086a8a9152c1da7d7852e Author: Yevgeny Kliteynik Date: Wed Feb 23 18:14:26 2022 +0200 net/mlx5: DR, Rename action modify fields to reflect naming in HW spec As preparation for supporting ConnectX-7, rename action modify fields steering registers from arbitrary names to the names that reflect the corresponding naming and location of the steering registers in HW. These registers mapping has changed in ConnectX-7, so the renaming allows to keep track of their mapping better. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed .../mellanox/mlx5/core/steering/dr_ste_v1.c | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) commit bdc3ab5795a6466f3fb2aa54198081e0d9c0b64c Author: Yevgeny Kliteynik Date: Wed Feb 23 18:12:20 2022 +0200 net/mlx5: DR, Fix handling of different actions on the same STE in STEv1 Fix handling of various conditions in set_actions_rx/tx that check whether different actions can be on the same STE. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 11659ef8d28efb7e7b8011815f188de31d6647dd Author: Yevgeny Kliteynik Date: Thu Jan 13 13:10:51 2022 +0200 net/mlx5: DR, Remove unneeded comments Remove two comments that were erroneously left in the code. Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5c422bfad2fbab96381273e50c7084465199501d Author: Yevgeny Kliteynik Date: Thu Feb 24 00:58:58 2022 +0200 net/mlx5: DR, Add support for matching on Internet Header Length (IHL) Add support for matching on new field - Internet Header Length (IHL). Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c | 11 +++++++++-- drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v0.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c | 1 + drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h | 4 +++- include/linux/mlx5/mlx5_ifc.h | 5 ++++- 6 files changed, 19 insertions(+), 4 deletions(-) commit aa818fbf8f36e8c6f3e608ea960567906c2d6112 Author: Shun Hao Date: Mon Jan 17 14:01:12 2022 +0200 net/mlx5: DR, Align mlx5dv_dr API vport action with FW behavior This aligns the behavior with FW when creating an FDB rule with wire vport destination but no source port matching. Until now such rules would fail on internal DR RX rule creation since the source and destination are the wire vport. The new behavior is the same as done on FW steering, if destination is wire, we will create both TX and RX rules, but the RX packet coming from wire will be dropped due to loopback not supported. Signed-off-by: Shun Hao Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) commit 32071187e9fb18da62f5be569bd2ea0d7a981ee8 Author: Moshe Shemesh Date: Thu Jan 27 07:51:14 2022 +0200 net/mlx5: Add debugfs counters for page commands failures Add the following new debugfs counters for debug and verbosity: fw_pages_alloc_failed - number of pages FW requested but driver failed to allocate. give_pages_dropped - number of pages given to FW, but command give pages failed by FW. reclaim_pages_discard - number of pages which were about to reclaim back and FW failed the command. Signed-off-by: Moshe Shemesh Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 4 ++++ drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 14 +++++++++++--- include/linux/mlx5/driver.h | 3 +++ 3 files changed, 18 insertions(+), 3 deletions(-) commit 4e05cbf05c66ca6931ee4f2a5aff0d84f1e65f40 Author: Moshe Shemesh Date: Thu Jan 27 07:03:33 2022 +0200 net/mlx5: Add pages debugfs Add pages debugfs to expose the following counters for debuggability: fw_pages_total - How many pages were given to FW and not returned yet. vfs_pages - For SRIOV, how many pages were given to FW for virtual functions usage. host_pf_pages - For ECPF, how many pages were given to FW for external hosts physical functions usage. Signed-off-by: Moshe Shemesh Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 17 +++++++++++++++++ drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 2 ++ include/linux/mlx5/driver.h | 9 ++++++--- 3 files changed, 25 insertions(+), 3 deletions(-) commit 66771a1c729e816dc84e29ba555013b6e722fb22 Author: Moshe Shemesh Date: Fri Feb 18 09:36:20 2022 +0200 net/mlx5: Move debugfs entries to separate struct Move the debugfs entry pointers under priv to their own struct. Add get function for device debugfs root. Signed-off-by: Moshe Shemesh Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed drivers/infiniband/hw/mlx5/cong.c | 3 +-- drivers/infiniband/hw/mlx5/main.c | 2 +- drivers/infiniband/hw/mlx5/mr.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 30 +++++++++++++--------- drivers/net/ethernet/mellanox/mlx5/core/main.c | 8 +++--- .../ethernet/mellanox/mlx5/core/steering/dr_dbg.c | 2 +- include/linux/mlx5/driver.h | 17 +++++++----- 8 files changed, 37 insertions(+), 29 deletions(-) commit d2cb8dda214fb75f946ba554a1ecd25da7004b2b Author: Moshe Shemesh Date: Wed Jan 26 07:23:53 2022 +0200 net/mlx5: Change release_all_pages cap bit location mlx5 FW has changed release_all_pages cap bit by one bit offset to reflect a fix in the FW flow for release_all_pages. The driver should use the new bit to ensure it calls release_all_pages only if the FW fix is there. Signed-off-by: Moshe Shemesh Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed include/linux/mlx5/mlx5_ifc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 8d564292a16628812ca02b28018836098fbe3d53 Author: Moshe Shemesh Date: Wed Jan 26 06:37:23 2022 +0200 net/mlx5: Remove redundant error on reclaim pages If reclaim pages was triggered by FW event and FW failed the command, the driver should ignore as FW is aware and will handle it. The downstream patch will add a debugfs counter on this flow for debuggability. Signed-off-by: Moshe Shemesh Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit 113fdaaad75a02f6de1c9a788be2ee1c27f2324a Author: Moshe Shemesh Date: Wed Mar 2 23:37:22 2022 +0200 net/mlx5: Remove redundant error on give pages If give pages was triggered by FW event and FW failed the command, the driver should ignore as FW is aware and will handle it. The downstream patch will add a debugfs counter on this flow for debuggability. Signed-off-by: Moshe Shemesh Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 4dac2f10ada00102b44bb0268d4fc164e84ed78f Author: Moshe Shemesh Date: Mon Jan 24 11:43:45 2022 +0200 net/mlx5: Remove redundant notify fail on give pages If give pages command failed by FW, there is no need to notify the FW on the failure. FW is aware and will handle it. Signed-off-by: Moshe Shemesh Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 34f46ae0d4b38e83cfb26fb6f06b5b5efea47fdc Author: Moshe Shemesh Date: Thu Jan 27 15:22:21 2022 +0200 net/mlx5: Add command failures data to debugfs Add new counters to command interface debugfs to count command failures. The following counters added: total_failed - number of times command failed (any kind of failure). failed_mbox_status - number of times command failed on bad status returned by FW. In addition, add data about last command failure to command interface debugfs: last_failed_errno - last command failed returned errno. last_failed_mbox_status - last bad status returned by FW. Signed-off-by: Moshe Shemesh Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 44 ++++++++++++++++++----- drivers/net/ethernet/mellanox/mlx5/core/debugfs.c | 7 ++++ include/linux/mlx5/driver.h | 9 +++++ 3 files changed, 51 insertions(+), 9 deletions(-) commit 371c2b349d927e81710f6ac2826d7fcb0374280f Author: Dan Carpenter Date: Thu Feb 24 17:53:25 2022 +0300 net/mlx5e: TC, Fix use after free in mlx5e_clone_flow_attr_for_post_act() This returns freed memory leading to a use after free. It's supposed to return NULL. Fixes: 8300f225268b ("net/mlx5e: Create new flow attr for multi table actions") Signed-off-by: Dan Carpenter Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e6700703353f47193e670bf497267e70d9a12379 Merge: 6de7e4f02640 2d684f4e155c Author: Dave Airlie Date: Thu Mar 10 05:46:36 2022 +1000 Merge tag 'exynos-drm-next-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next New feature - Add BGR pixel format support for FIMD device. As for this, this patch uses undocumented register, WIN_RGB_ORDER, but it is safe because product kernels have been using same register. Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/20220304085220.324245-1-inki.dae@samsung.com commit 659b66e98bb38dc6300dca3c9ebebeba194b575b Author: Li RongQing Date: Fri Mar 4 15:53:28 2022 +0800 cpuidle: haltpoll: Call cpuidle_poll_state_init() later Call cpuidle_poll_state_init() only if it is needed to avoid doing useless work. Signed-off-by: Li RongQing [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki drivers/cpuidle/cpuidle-haltpoll.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit b020771a66e474cd8450b3c483cec8492702db22 Author: Jinzhou Su Date: Wed Mar 9 09:23:51 2022 +0800 Documentation: amd-pstate: add tracer tool introduction Add amd pstate tracer tool introduction Signed-off-by: Jinzhou Su Reviewed-by: Huang Rui Signed-off-by: Rafael J. Wysocki Documentation/admin-guide/pm/amd-pstate.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) commit 5e32adccea8d803ee07e360daafb5480651ff8e8 Author: Jinzhou Su Date: Wed Mar 9 09:23:50 2022 +0800 tools/power/x86/amd_pstate_tracer: Add tracer tool for AMD P-state Intel P-state tracer is a useful tool to tune and debug Intel P-state driver. AMD P-state tracer import intel pstate tracer. This tool can be used to analyze the performance of AMD P-state tracer. Now CPU frequency, load and desired perf can be traced. Signed-off-by: Jinzhou Su Reviewed-by: Huang Rui Signed-off-by: Rafael J. Wysocki MAINTAINERS | 1 + .../x86/amd_pstate_tracer/amd_pstate_trace.py | 354 +++++++++++++++++++++ 2 files changed, 355 insertions(+) commit ab3ff9f1d7507c23cb4725f7429926a22e3290cb Author: Jinzhou Su Date: Wed Mar 9 09:23:49 2022 +0800 tools/power/x86/intel_pstate_tracer: make tracer as a module Make intel_pstate_tracer as a module. Other trace event can import this module to analyze their trace data. Signed-off-by: Jinzhou Su Acked-by: Doug Smythies Reviewed-by: Huang Rui Signed-off-by: Rafael J. Wysocki .../x86/intel_pstate_tracer/intel_pstate_tracer.py | 260 ++++++++++----------- 1 file changed, 129 insertions(+), 131 deletions(-) commit 23c296fb7eeea99dec035521c07ae54c28b8a267 Author: Jinzhou Su Date: Wed Mar 9 09:23:48 2022 +0800 cpufreq: amd-pstate: Add more tracepoint for AMD P-State module Add frequency, mperf, aperf and tsc in the trace. This can be used to debug and tune the performance of AMD P-state driver. Use the time difference between amd_pstate_update to calculate CPU frequency. There could be sleep in arch_freq_get_on_cpu, so do not use it here. Signed-off-by: Jinzhou Su Co-developed-by: Huang Rui Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki drivers/cpufreq/amd-pstate-trace.h | 22 +++++++++++++- drivers/cpufreq/amd-pstate.c | 59 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 78 insertions(+), 3 deletions(-) commit 9a771038959c04016686c4ffcdacf7cab176f578 Merge: 80a6359f1c9b 73421f2a48e6 Author: Stephen Boyd Date: Wed Mar 9 10:50:09 2022 -0800 Merge tag 'renesas-clk-for-v5.18-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull Renesas clk driver updates from Geert Uytterhoeven: - Add watchdog (WDT), I2C, and pin function controller (PFC) clocks on R-Car S4-8 - A small fix * tag 'renesas-clk-for-v5.18-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: r8a779f0: Add PFC clock clk: renesas: r8a779f0: Add I2C clocks clk: renesas: r8a779f0: Add WDT clock clk: renesas: r8a779f0: Fix RSW2 clock divider commit 328212de9f846ad12b1330cf55bc5e04aac46cd0 Merge: e783362eb54c 10b74af31073 Author: Stephen Boyd Date: Wed Mar 9 10:47:28 2022 -0800 Merge tag 'v5.18-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-rockchip Pull Rockchip clk driver updates from Heiko Stuebner: - Improve the clocks for the rk3568 display outputs (parenting, pll-rates) - Use of_device_get_match_data() instead of open-coding on rk3568 - Reintroduce the expected fractional-divider behaviour that disappeared with the addition of CLK_FRAC_DIVIDER_POWER_OF_TWO_PS * tag 'v5.18-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: clk: rockchip: re-add rational best approximation algorithm to the fractional divider clk/rockchip: Use of_device_get_match_data() clk: rockchip: Add CLK_SET_RATE_PARENT to the HDMI reference clock on rk3568 clk: rockchip: drop CLK_SET_RATE_PARENT from dclk_vop* on rk3568 clk: rockchip: Add more PLL rates for rk3568 commit 3f8dec116210ca649163574ed5f8df1e3b837d07 Author: Darren Hart Date: Tue Mar 8 10:50:48 2022 -0800 ACPI/APEI: Limit printable size of BERT table data Platforms with large BERT table data can trigger soft lockup errors while attempting to print the entire BERT table data to the console at boot: watchdog: BUG: soft lockup - CPU#160 stuck for 23s! [swapper/0:1] Observed on Ampere Altra systems with a single BERT record of ~250KB. The original bert driver appears to have assumed relatively small table data. Since it is impractical to reassemble large table data from interwoven console messages, and the table data is available in /sys/firmware/acpi/tables/data/BERT limit the size for tables printed to the console to 1024 (for no reason other than it seemed like a good place to kick off the discussion, would appreciate feedback from existing users in terms of what size would maintain their current usage model). Alternatively, we could make printing a CONFIG option, use the bert_disable boot arg (or something similar), or use a debug log level. However, all those solutions require extra steps or change the existing behavior for small table data. Limiting the size preserves existing behavior on existing platforms with small table data, and eliminates the soft lockups for platforms with large table data, while still making it available. Signed-off-by: Darren Hart Signed-off-by: Rafael J. Wysocki drivers/acpi/apei/bert.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 3e6054d043c01e0d47a51cddc814f8d3409fc355 Author: Colin Ian King Date: Thu Mar 3 09:05:08 2022 +0000 clk: imx: remove redundant re-assignment of pll->base There are two identical assignments of pll->base to the same value, the second assignment is redundant and can be removed. Cleans up cppcheck warning: drivers/clk/imx/clk-sscg-pll.c:528:12: style: Variable 'pll->base' is reassigned a value before the old one has been used. [redundantAssignment] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220303090508.1125175-1-colin.i.king@gmail.com Signed-off-by: Stephen Boyd drivers/clk/imx/clk-sscg-pll.c | 1 - 1 file changed, 1 deletion(-) commit eba0549bc7d100691c13384b774346b8aa9cf9a9 Author: Darrick J. Wong Date: Fri Feb 25 16:18:30 2022 -0800 xfs: don't generate selinux audit messages for capability testing There are a few places where we test the current process' capability set to decide if we're going to be more or less generous with resource acquisition for a system call. If the process doesn't have the capability, we can continue the call, albeit in a degraded mode. These are /not/ the actual security decisions, so it's not proper to use capable(), which (in certain selinux setups) causes audit messages to get logged. Switch them to has_capability_noaudit. Fixes: 7317a03df703f ("xfs: refactor inode ownership change transaction/inode/quota allocation idiom") Fixes: ea9a46e1c4925 ("xfs: only return detailed fsmap info if the caller has CAP_SYS_ADMIN") Signed-off-by: Darrick J. Wong Cc: Dave Chinner Reviewed-by: Ondrej Mosnacek Acked-by: Serge Hallyn Reviewed-by: Eric Sandeen fs/xfs/xfs_fsmap.c | 4 ++-- fs/xfs/xfs_ioctl.c | 2 +- fs/xfs/xfs_iops.c | 2 +- kernel/capability.c | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) commit 1a39ae415c1be1e46f5b3f97d438c7c4adc22b63 Author: Gao Xiang Date: Fri Feb 25 16:18:30 2022 -0800 xfs: add missing cmap->br_state = XFS_EXT_NORM update COW extents are already converted into written real extents after xfs_reflink_convert_cow_locked(), therefore cmap->br_state should reflect it. Otherwise, there is another necessary unwritten convertion triggered in xfs_dio_write_end_io() for direct I/O cases. Signed-off-by: Gao Xiang Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong fs/xfs/xfs_reflink.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit c62b1f34e93f29e5ee213d7c5797c99bd6439e35 Author: Abel Vesa Date: Wed Feb 16 15:22:14 2022 +0200 MAINTAINERS: clk: imx: add git tree and dt-bindings files The i.MX clocks dt-bindings are going through the same tree as the drivers, so add them to the same entry. Also add the git tree and branch used. Signed-off-by: Abel Vesa Link: https://lore.kernel.org/r/20220216132214.258865-1-abel.vesa@nxp.com Signed-off-by: Stephen Boyd MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) commit 9872e6bc08d6ef6de79717ff6bbff0f297c134ef Merge: 7297a8bcc0ae 9d3e7b7c82fd Author: Marc Zyngier Date: Wed Mar 9 18:19:10 2022 +0000 Merge branch kvm-arm64/psci-1.1 into kvmarm-master/next * kvm-arm64/psci-1.1: : . : Limited PSCI-1.1 support from Will Deacon: : : This small series exposes the PSCI SYSTEM_RESET2 call to guests, which : allows the propagation of a "reset_type" and a "cookie" back to the VMM. : Although Linux guests only ever pass 0 for the type ("SYSTEM_WARM_RESET"), : the vendor-defined range can be used by a bootloader to provide additional : information about the reset, such as an error code. : . KVM: arm64: Really propagate PSCI SYSTEM_RESET2 arguments to userspace Signed-off-by: Marc Zyngier commit 738e7891345fcc86ac06c0bf2aa57063e7085187 Merge: e783362eb54c b09c68dc57c9 Author: Stephen Boyd Date: Wed Mar 9 10:18:28 2022 -0800 Merge tag 'clk-imx-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx Pull i.MX clk driver updates from Abel Vesa: - Add i.MXRT1050 clock driver and bindings - Add i.MX8DXL clock driver and bindings - Add i.MX93 clock driver and bindings - Remove SYS PLL 1/2 clock gates for i.MX8M* - Remove AUDIO MCLK ROOT from i.MX7D - Add fracn gppll clock type used by i.MX93 - Add new composite clock for i.MX93 - Add missing media mipi phy ref clock for i.MX8MP - Fix off by one in imx_lpcg_parse_clks_from_dt - Rework for the pll14xx * tag 'clk-imx-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: (24 commits) clk: imx: pll14xx: Support dynamic rates clk: imx: pll14xx: Add pr_fmt clk: imx: pll14xx: explicitly return lowest rate clk: imx: pll14xx: name variables after usage clk: imx: pll14xx: consolidate rate calculation clk: imx: pll14xx: Use FIELD_GET/FIELD_PREP clk: imx: pll14xx: Drop wrong shifting clk: imx: pll14xx: Use register defines consistently clk: imx8mp: remove SYS PLL 1/2 clock gates clk: imx8mn: remove SYS PLL 1/2 clock gates clk: imx8mm: remove SYS PLL 1/2 clock gates clk: imx: add i.MX93 clk clk: imx: support fracn gppll clk: imx: add i.MX93 composite clk dt-bindings: clock: add i.MX93 clock definition dt-bindings: clock: Add imx93 clock support clk: imx: off by one in imx_lpcg_parse_clks_from_dt() dt-bindings: fsl: scu: add imx8dxl scu clock support clk: imx7d: Remove audio_mclk_root_clk clk: imx8mp: Add missing IMX8MP_CLK_MEDIA_MIPI_PHY1_REF_ROOT clock ... commit 9d3e7b7c82fd9d40240867ef4c45388cd05031f3 Author: Will Deacon Date: Wed Mar 9 18:13:08 2022 +0000 KVM: arm64: Really propagate PSCI SYSTEM_RESET2 arguments to userspace Commit d43583b890e7 ("KVM: arm64: Expose PSCI SYSTEM_RESET2 call to the guest") hooked up the SYSTEM_RESET2 PSCI call for guests but failed to preserve its arguments for userspace, instead overwriting them with zeroes via smccc_set_retval(). As Linux only passes zeroes for these arguments, this appeared to be working for Linux guests. Oh well. Don't call smccc_set_retval() for a SYSTEM_RESET2 heading to userspace and instead set X0 (and only X0) explicitly to PSCI_RET_INTERNAL_FAILURE just in case the vCPU re-enters the guest. Fixes: d43583b890e7 ("KVM: arm64: Expose PSCI SYSTEM_RESET2 call to the guest") Reported-by: Andrew Walbran Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220309181308.982-1-will@kernel.org arch/arm64/kvm/psci.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit cf220ad6749b8305ba11bdf601c55a17ad2a715d Author: Mark Brown Date: Wed Mar 9 13:12:00 2022 +0000 arm64/mte: Remove asymmetric mode from the prctl() interface As pointed out by Evgenii Stepanov one potential issue with the new ABI for enabling asymmetric is that if there are multiple places where MTE is configured in a process, some of which were compiled with the old prctl.h and some of which were compiled with the new prctl.h, there may be problems keeping track of which MTE modes are requested. For example some code may disable only sync and async modes leaving asymmetric mode enabled when it intended to fully disable MTE. In order to avoid such mishaps remove asymmetric mode from the prctl(), instead implicitly allowing it if both sync and async modes are requested. This should not disrupt userspace since a process requesting both may already see a mix of sync and async modes due to differing defaults between CPUs or changes in default while the process is running but it does mean that userspace is unable to explicitly request asymmetric mode without changing the system default for CPUs. Reported-by: Evgenii Stepanov Signed-off-by: Mark Brown Reviewed-by: Catalin Marinas Reviewed-by: Evgenii Stepanov Cc: Peter Collingbourne Cc: Joey Gouly Cc: Branislav Rankov Link: https://lore.kernel.org/r/20220309131200.112637-1-broonie@kernel.org Signed-off-by: Will Deacon Documentation/arm64/memory-tagging-extension.rst | 15 ++++++++------- arch/arm64/kernel/mte.c | 13 ++++++++++--- arch/arm64/kernel/process.c | 2 -- include/uapi/linux/prctl.h | 4 +--- 4 files changed, 19 insertions(+), 15 deletions(-) commit f90205b95368ee2b56fc523abda6c4d514901d9b Author: Marc Zyngier Date: Wed Mar 9 18:06:00 2022 +0000 arm64: Add cavium_erratum_23154_cpus missing sentinel Qian Cai reported that playing with CPU hotplug resulted in a out-of-bound access due to cavium_erratum_23154_cpus missing a sentinel indicating the end of the array. Add it in order to restore peace and harmony in the world of broken HW. Reported-by: Qian Cai Signed-off-by: Marc Zyngier Fixes: 24a147bcef8c ("irqchip/gic-v3: Workaround Marvell erratum 38545 when reading IAR") Link: https://lore.kernel.org/r/YijmkXp1VG7e8lDx@qian Cc: Linu Cherian Cc: Will Deacon Link: https://lore.kernel.org/r/20220309180600.3990874-1-maz@kernel.org Signed-off-by: Will Deacon arch/arm64/kernel/cpu_errata.c | 1 + 1 file changed, 1 insertion(+) commit 34f7497876531e1778f21dd97ebcf8e8f4d9b397 Merge: a5ab04af4943 8e842f02af7e Author: Stephen Boyd Date: Wed Mar 9 10:13:45 2022 -0800 Merge tag 'clk-at91-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-at91 Pull AT91 clk driver changes From Nicolas Ferre: - sama7g5: One low priority fix for GCLK of PDMC - clk-master: cleanup of dead code * tag 'clk-at91-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: clk: at91: clk-master: remove dead code clk: at91: sama7g5: fix parents of PDMCs' GCLK commit 02ddec1986ff0b8de20094aae2fa5b8f8ee7e1a3 Author: Amritha Nambiar Date: Tue Feb 8 17:06:05 2022 -0800 ice: Add support for outer dest MAC for ADQ tunnels TC flower does not support matching on user specified outer MAC address for tunnels. For ADQ tunnels, the driver adds outer destination MAC address as lower netdev's active unicast MAC address to filter out packets with unrelated MAC address being delivered to ADQ VSIs. Example: - create tunnel device ip l add $VXLAN_DEV type vxlan id $VXLAN_VNI dstport $VXLAN_PORT \ dev $PF - add TC filter (in ADQ mode) $tc filter add dev $VXLAN_DEV protocol ip parent ffff: flower \ dst_ip $INNER_DST_IP ip_proto tcp dst_port $INNER_DST_PORT \ enc_key_id $VXLAN_VNI hw_tc $ADQ_TC Note: Filters with wild-card tunnel ID (when user does not specify tunnel key) are also supported. Signed-off-by: Amritha Nambiar Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_tc_lib.c | 32 +++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) commit 457a02f03e9207421931471fe50ed3fba70aa868 Author: Maciej Fijalkowski Date: Thu Feb 3 13:16:51 2022 +0100 ice: avoid XDP checks in ice_clean_tx_irq() Commit 9610bd988df9 ("ice: optimize XDP_TX workloads") introduced Tx IRQ cleaning routine dedicated for XDP rings. Currently it is impossible to call ice_clean_tx_irq() against XDP ring, so it is safe to drop ice_ring_is_xdp() calls in there. Reviewed-by: Alexander Lobakin Signed-off-by: Maciej Fijalkowski Tested-by: Kiran Bhandare (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_txrx.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) commit 31ef579d433a6bcd6b942edea372040298295acf Author: Srinivas Kandagatla Date: Wed Mar 9 14:05:52 2022 +0000 ASoC: qcom: fix Kconfig for SC7280 select would force the symbol to value without checking the dependencies. In this case selecting TX and RX MACROs directly without checking its dependency on COMMON_CLK would break builds on platform which do no set COMMON_CLK. ex: WARNING: unmet direct dependencies detected for SND_SOC_LPASS_RX_MACRO Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && COMMON_CLK [=n] Selected by [m]: - SND_SOC_SC7280 [=m] && SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] && SND_SOC_QCOM [=m] && I2C [=y] && SOUNDWIRE [=m] move select to imply which should enforce symbol to be set to 'n' if any dependencies are not resolved. Fixes: 57350bd41c3a ("ASoC: qcom: SC7280: Add machine driver") Reported-by: Randy Dunlap Reported-by: kernel test robot Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220309140552.8065-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown sound/soc/qcom/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 81acac8c2c88764c773811d1ec858852f81eb88a Author: Peter Ujfalusi Date: Wed Mar 9 13:01:04 2022 +0200 ASoC: SOF: ipc-msg-injector: Use devm_kzalloc() for the rx_buffer The rx_buffer is cleared before sending an IPC to make sure that when the /sys/kernel/debug/sof/ipc_msg_inject file is read we will have correct information in the buffer (no random or stale data). But if the user reads the file before sending any message the buffer might contain garbage which should not be interpreted. To prevent this, clear the rx_buffer on allocation. Fixes: cac0b0887e53 ("ASoC: SOF: Convert the generic IPC message injector into SOF client") Signed-off-by: Peter Ujfalusi Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220309110104.18370-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-client-ipc-msg-injector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5bd998af5b69cf21fd4db5eaf7e9db85a4a35295 Author: Viorel Suman Date: Wed Mar 9 17:18:43 2022 +0800 ASoC: fsl_spdif: keep all TxClk sources by txclk array Use txclk array to keep all TxClk sources instead of keeping clocks per rate - need to do this in order to avoid multiple prepare_enable/disable_unprepare of the same clock during suspend/resume. Signed-off-by: Viorel Suman Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1646817523-26800-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown sound/soc/fsl/fsl_spdif.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) commit 5af07dad696422d48368409461a754990faa713c Author: Jiapeng Chong Date: Wed Mar 9 08:49:28 2022 +0800 ASoC: SOF: amd: Remove unneeded semicolon Fix the following coccicheck warnings: ./sound/soc/sof/amd/acp-ipc.c:74:2-3: Unneeded semicolon. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220309004929.125558-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown sound/soc/sof/amd/acp-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c8ee0c37c045ccc1fbbe074e8af5031b36861cd2 Author: Jiapeng Chong Date: Wed Mar 9 08:49:29 2022 +0800 ASoC: SOF: amd: Remove unneeded semicolon Fix the following coccicheck warnings: ./sound/soc/sof/amd/acp.c:280:3-4: Unneeded semicolon. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220309004929.125558-2-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown sound/soc/sof/amd/acp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9779a8e61a83916ccfe7e6ddabcc7638d4bc2ae1 Author: Pierre-Louis Bossart Date: Tue Mar 8 14:23:18 2022 -0600 ASoC: Intel: boards: fix randconfig issue on x86_64: ERROR: modpost: "sof_dai_get_bclk" [sound/soc/intel/boards/snd-soc-intel-sof-cirrus-common.ko] undefined! ERROR: modpost: "sof_dai_get_mclk" [sound/soc/intel/boards/snd-soc-intel-sof-realtek-common.ko] undefined! This comes from a missing dependency on at least ONE SOF platform being selected. This dependency exists for all other machine drivers, this was missed in the earlier reviews. Fixes: 2fe14ff61bd6 ("ASoC: Intel: sof_ssp_amp: rename driver and support cs35l41 amplifier") Reported-by: Randy Dunlap Signed-off-by: Pierre-Louis Bossart Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220308202318.401358-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/Kconfig | 3 +++ 1 file changed, 3 insertions(+) commit 5b26f2c249b1034ab327dd29e73fec078d0ece18 Author: Yishai Hadas Date: Wed Mar 9 10:02:17 2022 +0200 vfio/mlx5: Fix to not use 0 as NULL pointer Fix sparse warning to not use plain integer (i.e. 0) as NULL pointer. Reported-by: kernel test robot Fixes: 6fadb021266d ("vfio/mlx5: Implement vfio_pci driver for mlx5 devices") Signed-off-by: Yishai Hadas Link: https://lore.kernel.org/r/202203090703.kxvZumJg-lkp@intel.com Link: https://lore.kernel.org/r/20220309080217.94274-1-yishaih@nvidia.com Signed-off-by: Alex Williamson drivers/vfio/pci/mlx5/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit b99fdcdc36369d2a3a26bf44736d420eb629d8b7 Author: Ming Lei Date: Fri Mar 4 21:08:04 2022 -0500 dm: support bio polling Support bio polling (REQ_POLLED) in the following approach: 1) only support io polling on normal READ/WRITE, and other abnormal IOs still fallback to IRQ mode, so the target io (and DM's clone bio) is exactly inside the dm io. 2) hold one refcnt on io->io_count after submitting this dm bio with REQ_POLLED 3) support dm native bio splitting, any dm io instance associated with current bio will be added into one list which head is bio->bi_private which will be recovered before ending this bio 4) implement .poll_bio() callback, call bio_poll() on the single target bio inside the dm io which is retrieved via bio->bi_bio_drv_data; call dm_io_dec_pending() after the target io is done in .poll_bio() 5) enable QUEUE_FLAG_POLL if all underlying queues enable QUEUE_FLAG_POLL, which is based on Jeffle's previous patch. These changes are good for a 30-35% IOPS improvement for polled IO. For detailed test results please see (Jens, thanks for testing!): https://listman.redhat.com/archives/dm-devel/2022-March/049868.html or https://marc.info/?l=linux-block&m=164684246214700&w=2 Tested-by: Jens Axboe Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer drivers/md/dm-core.h | 2 + drivers/md/dm-table.c | 27 ++++++++++ drivers/md/dm.c | 143 ++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 169 insertions(+), 3 deletions(-) commit 69fe0f29892077f14b56e2a479b6bcf533209d53 Author: Ming Lei Date: Fri Mar 4 21:08:03 2022 -0500 block: add ->poll_bio to block_device_operations Prepare for supporting IO polling for bio-based driver. Add ->poll_bio callback so that bio-based driver can provide their own logic for polling bio. Also fix ->submit_bio_bio typo in comment block above __submit_bio_noacct. Reviewed-by: Christoph Hellwig Reviewed-by: Jens Axboe Signed-off-by: Ming Lei Signed-off-by: Mike Snitzer block/blk-core.c | 14 +++++++++----- block/genhd.c | 4 ++++ include/linux/blkdev.h | 2 ++ 3 files changed, 15 insertions(+), 5 deletions(-) commit 10b29dd7eafe1987b44866d3ee1d0d71bf622cb3 Author: Hans de Goede Date: Wed Mar 9 18:05:32 2022 +0100 platform/x86: thinkpad_acpi: Don't use test_bit on an integer test_bit can only be used on longs not on ints, fix this. Reported-by: Stephen Rothwell Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220309170532.343384-2-hdegoede@redhat.com drivers/platform/x86/thinkpad_acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 6229ce9c36384c7adce09f06a3a1897faa5f2c1a Author: Hans de Goede Date: Wed Mar 9 18:05:31 2022 +0100 platform/x86: thinkpad_acpi: Fix compiler warning about uninitialized err variable err is always set because if we get here then dytc_profile_available is always one of DYTC_FUNCMODE_MMC or DYTC_FUNCMODE_PSC, but the compiler cannot now that, so initialize err to 0 to avoid a compiler warning about err being uninitialized. Reported-by: kernel test robot Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220309170532.343384-1-hdegoede@redhat.com drivers/platform/x86/thinkpad_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d4b938abafc83c1e79694c5ff8d749cd23243a2b Author: Mark Pearson Date: Mon Mar 7 13:30:41 2022 -0500 platform/x86: thinkpad_acpi: clean up dytc profile convert Minor update cleaning up the code around convert_profile_to_dytc as identified in the previous commit. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220307183041.4467-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/thinkpad_acpi.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) commit 1e8aa2aa1274953e8e595f0630436744597d0d64 Author: Hans de Goede Date: Tue Mar 8 16:29:42 2022 +0100 platform/x86: x86-android-tablets: Depend on EFI and SPI The recently added support for Lenovo Yoga Tablet 2 tablets uses symbols from EFI and SPI add "depends on EFI && SPI" to the X86_ANDROID_TABLETS Kconfig entry. Reported-by: Randy Dunlap Signed-off-by: Hans de Goede Acked-by: Randy Dunlap Tested-by: Randy Dunlap Link: https://lore.kernel.org/r/20220308152942.262130-1-hdegoede@redhat.com drivers/platform/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 24055bb87977e0c687b54ebf7bac8715f3636bc3 Author: Vladimir Oltean Date: Wed Mar 9 14:20:12 2022 +0200 net: tcp: fix shim definition of tcp_inbound_md5_hash When CONFIG_TCP_MD5SIG isn't enabled, there is a compilation bug due to the fact that the static inline definition of tcp_inbound_md5_hash() has an unexpected semicolon. Remove it. Fixes: 1330b6ef3313 ("skb: make drop reason booleanable") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220309122012.668986-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski include/net/tcp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f833116ad2c3eabf9c739946170e07825cca67ed Author: Eric W. Biederman Date: Wed Mar 9 10:37:07 2022 -0600 coredump: Don't compile flat_core_dump when coredumps are disabled Recently the kernel test robot reported: > In file included from include/linux/kernel.h:29, > from fs/binfmt_flat.c:21: > fs/binfmt_flat.c: In function 'flat_core_dump': > >> fs/binfmt_flat.c:121:50: error: invalid use of undefined type 'struct coredump_params' > 121 | current->comm, current->pid, cprm->siginfo->si_signo); > | ^~ > include/linux/printk.h:418:33: note: in definition of macro 'printk_index_wrap' > 418 | _p_func(_fmt, ##__VA_ARGS__); \ > | ^~~~~~~~~~~ > include/linux/printk.h:499:9: note: in expansion of macro 'printk' > 499 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) > | ^~~~~~ > fs/binfmt_flat.c:120:9: note: in expansion of macro 'pr_warn' > 120 | pr_warn("Process %s:%d received signr %d and should have core dumped\n", > | ^~~~~~~ > At top level: > fs/binfmt_flat.c:118:12: warning: 'flat_core_dump' defined but not used [-Wunused-function] > 118 | static int flat_core_dump(struct coredump_params *cprm) > | ^~~~~~~~~~~~~~ The little dinky do nothing function flat_core_dump has always been compiled unconditionally. With my change to move coredump_params into coredump.h coredump_params reasonably becomes unavailable when coredump support is not compiled in. Fix this old issue by simply not compiling flat_core_dump when coredump support is not supported. Fixes: a99a3e2efaf1 ("coredump: Move definition of struct coredump_params into coredump.h") Reported-by: kernel test robot Signed-off-by: "Eric W. Biederman" fs/binfmt_flat.c | 4 ++++ 1 file changed, 4 insertions(+) commit ad24d9ebc446251c808b11a434099fbb2b555f85 Author: Jonathan Toppins Date: Thu Feb 3 12:45:16 2022 -0500 ice: change "can't set link" message to dbg level In the case where the link is owned by manageability, the firmware is not allowed to set the link state, so an error code is returned. This however is non-fatal and there is nothing the operator can do, so instead of confusing the operator with messages they can do nothing about hide this message behind the debug log level. Signed-off-by: Jonathan Toppins Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit c8ff29b5874204d26eed90984db6789ccde62e3c Author: Marcin Szycik Date: Thu Jan 27 16:04:26 2022 +0100 ice: Add slow path offload stats on port representor in switchdev Implement callbacks to check for stats and fetch port representor stats. Stats are taken from RX/TX ring corresponding to port representor and show the number of bytes/packets that were not offloaded. To see slow path stats run: ifstat -x cpu_hits -a Signed-off-by: Marcin Szycik Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice.h | 3 ++ drivers/net/ethernet/intel/ice/ice_main.c | 6 ++-- drivers/net/ethernet/intel/ice/ice_repr.c | 55 +++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 3 deletions(-) commit 34a897758efed21e8b06c1ee3c550b528e93a375 Author: Martyna Szapar-Mudlaw Date: Sun Jan 16 10:01:43 2022 +0100 ice: Add support for inner etype in switchdev Enable support for adding TC rules that filter on the inner EtherType field of tunneled packet headers. Signed-off-by: Martyna Szapar-Mudlaw Reviewed-by: Alexander Lobakin Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_protocol_type.h | 2 + drivers/net/ethernet/intel/ice/ice_switch.c | 272 ++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_tc_lib.c | 15 +- 3 files changed, 277 insertions(+), 12 deletions(-) commit 44d445c02388c47f8da9fbbeb639f3bbe552356c Author: Colin Ian King Date: Mon Mar 7 19:48:02 2022 +0200 ath9k: make array voice_priority static const Don't populate the read-only array voice_priority on the stack but instead make it static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Reviewed-by: Jeff Johnson Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220222121749.87513-1-colin.i.king@gmail.com drivers/net/wireless/ath/ath9k/mci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0dff6f05a9dccef1675ddae3c1843ef9dee59bac Author: Gustavo A. R. Silva Date: Mon Mar 7 19:48:01 2022 +0200 ath6kl: wmi: Replace one-element array with flexible-array member in struct wmi_aplist_event Replace one-element array with flexible-array member in struct wmi_aplist_event. Also, make use of the struct_size() helper and remove unneeded variable ap_info_entry_size. This issue was found with the help of Coccinelle and audited and fixed, manually. Link: https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Reviewed-by: Jeff Johnson Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1b7889828f23763c034c1558cbab9c8e2066053e.1645736204.git.gustavoars@kernel.org drivers/net/wireless/ath/ath6kl/wmi.c | 5 +---- drivers/net/wireless/ath/ath6kl/wmi.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) commit 5140df50e655a2f441b0add39ccc2d9d1f8d84bd Author: Gustavo A. R. Silva Date: Mon Mar 7 19:48:01 2022 +0200 ath6kl: wmi: Replace one-element array with flexible-array member in struct wmi_disconnect_event Replace one-element array with flexible-array member in struct wmi_disconnect_event. This issue was found with the help of Coccinelle and audited and fixed, manually. Link: https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Reviewed-by: Jeff Johnson Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/e9957dc53ae48c2f39ae57b0157a67d844b5bc20.1645736204.git.gustavoars@kernel.org drivers/net/wireless/ath/ath6kl/wmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit dfb0203939b12c738cb977f669116d948a5c06e2 Author: Gustavo A. R. Silva Date: Mon Mar 7 19:48:01 2022 +0200 ath6kl: wmi: Replace one-element array with flexible-array member in struct wmi_connect_event Replace one-element array with flexible-array member in struct wmi_connect_event. This issue was found with the help of Coccinelle and audited and fixed, manually. Link: https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Reviewed-by: Jeff Johnson Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/290a0cb7bddd813a6a96a59853880e66917aa03d.1645736204.git.gustavoars@kernel.org drivers/net/wireless/ath/ath6kl/wmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3c5e6994eea32909309606e273ba637ec8966ee9 Author: Gustavo A. R. Silva Date: Mon Mar 7 19:48:01 2022 +0200 ath6kl: wmi: Replace one-element array with flexible-array member in struct wmi_channel_list_reply Replace one-element array with flexible-array member in struct wmi_channel_list_reply. This issue was found with the help of Coccinelle and audited and fixed, manually. Link: https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Reviewed-by: Jeff Johnson Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/f3f9728a1dfc3767340f25a963be374e2ef5d8ad.1645736204.git.gustavoars@kernel.org drivers/net/wireless/ath/ath6kl/wmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 56f1257fdcc08778a76f03cbe97d602268fdfc51 Author: Gustavo A. R. Silva Date: Mon Mar 7 19:48:01 2022 +0200 ath6kl: wmi: Replace one-element array with flexible-array member in struct wmi_start_scan_cmd Replace one-element array with flexible-array member in struct wmi_start_scan_cmd. Also, make use of the struct_size() helper. This issue was found with the help of Coccinelle and audited and fixed, manually. Link: https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/8b33c6d86a6bd40b5688cf118b4b35850db8d8c7.1645736204.git.gustavoars@kernel.org drivers/net/wireless/ath/ath6kl/wmi.c | 8 +------- drivers/net/wireless/ath/ath6kl/wmi.h | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) commit 324edddf2505a240a9226735dbbf3d5dc2b4a24d Author: Gustavo A. R. Silva Date: Mon Mar 7 19:48:00 2022 +0200 ath6kl: wmi: Replace one-element array with flexible-array member in struct wmi_begin_scan_cmd Replace one-element array with flexible-array member in struct wmi_begin_scan_cmd. Also, make use of the struct_size() helper. This issue was found with the help of Coccinelle and audited and fixed, manually. Link: https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays Link: https://github.com/KSPP/linux/issues/79 Reviewed-by: Jeff Johnson Signed-off-by: Gustavo A. R. Silva Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1ef801ea24475501fa0f296cb5435a440135206e.1645736204.git.gustavoars@kernel.org drivers/net/wireless/ath/ath6kl/wmi.c | 9 ++------- drivers/net/wireless/ath/ath6kl/wmi.h | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) commit 7f415828f987fca9651694c7589560e55ffdf9a6 Author: Lukas Bulwahn Date: Tue Mar 8 11:30:27 2022 +0100 MAINTAINERS: rectify entry for REALTEK RTL83xx SMI DSA ROUTER CHIPS Commit 429c83c78ab2 ("dt-bindings: net: dsa: realtek: convert to YAML schema, add MDIO") converts realtek-smi.txt to realtek.yaml, but missed to adjust its reference in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a broken reference. Repair this file reference in REALTEK RTL83xx SMI DSA ROUTER CHIPS. Signed-off-by: Lukas Bulwahn Reviewed-by: Vladimir Oltean Reviewed-by: Linus Walleij Reviewed-by: Alvin Šipraga Signed-off-by: David S. Miller MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0dbdf819f4c12337fbe5c8551d97f312a44a7d87 Author: Horatiu Vultur Date: Tue Mar 8 11:29:04 2022 +0100 net: lan966x: Add spinlock for frame transmission from CPU. The registers used to inject a frame to one of the ports is shared between all the net devices. Therefore, there can be race conditions for accessing the registers when two processes send frames at the same time on different ports. To fix this, add a spinlock around the function 'lan966x_port_ifh_xmit()'. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 9 ++++++++- drivers/net/ethernet/microchip/lan966x/lan966x_main.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) commit 2c9ec169f70bb13f71cf91cf018680e6e4fc8ce6 Author: Changcheng Deng Date: Tue Mar 8 09:21:06 2022 +0000 net: ethernet: sun: use min_t() to make code cleaner Use min_t() in order to make code cleaner. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: David S. Miller drivers/net/ethernet/sun/cassini.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6e87c8f074075e10c5352d3256879b4e6dd6cb81 Author: Martin Botka Date: Thu Mar 3 14:18:12 2022 +0100 clk: qcom: Add display clock controller driver for SM6125 Add support for the display clock controller found on SM6125 based devices. This allows display drivers to probe and control their clocks. Signed-off-by: Martin Botka Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220303131812.302302-4-marijn.suijten@somainline.org drivers/clk/qcom/Kconfig | 9 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/dispcc-sm6125.c | 709 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 719 insertions(+) commit 8397c9c0c26b5129acb623044ecc2d8d1b15d420 Author: Martin Botka Date: Thu Mar 3 14:18:11 2022 +0100 dt-bindings: clock: add QCOM SM6125 display clock bindings Add device tree bindings for display clock controller for Qualcomm Technology Inc's SM6125 SoC. Signed-off-by: Martin Botka Signed-off-by: Marijn Suijten Reviewed-by: Krzysztof Kozlowski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220303131812.302302-3-marijn.suijten@somainline.org .../bindings/clock/qcom,dispcc-sm6125.yaml | 87 ++++++++++++++++++++++ include/dt-bindings/clock/qcom,dispcc-sm6125.h | 41 ++++++++++ 2 files changed, 128 insertions(+) commit 620f512528389929d9af795f82c63e52a589b53c Author: Marijn Suijten Date: Thu Mar 3 14:18:10 2022 +0100 clk: qcom: Fix sorting of SDX_GCC_65 in Makefile and Kconfig In order to keep at least the list of `CONFIG_SM_` drivers sorted alphabetically, SDX_GCC_65 should have been moved one line up. This in turn makes it easier and cleaner to add the followup SM_DISPCC_6125 driver in the right place, right before SM_DISPCC_8250. Fixes: d79afa201328 ("clk: qcom: Add SDX65 GCC support") Signed-off-by: Marijn Suijten Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220303131812.302302-2-marijn.suijten@somainline.org drivers/clk/qcom/Kconfig | 14 +++++++------- drivers/clk/qcom/Makefile | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) commit d1a16e345578332c31aa4fb7b76e2e38249861ad Author: Bhupesh Sharma Date: Thu Mar 3 14:18:21 2022 +0530 clk: qcom: gcc: Add emac GDSC support for SM8150 Add the EMAC GDSC defines and driver structures for SM8150. Cc: Stephen Boyd Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220303084824.284946-4-bhupesh.sharma@linaro.org drivers/clk/qcom/gcc-sm8150.c | 10 ++++++++++ include/dt-bindings/clock/qcom,gcc-sm8150.h | 1 + 2 files changed, 11 insertions(+) commit fb0c4f9d72937670f38e7031d9aaf6589a00f454 Author: Bhupesh Sharma Date: Thu Mar 3 14:18:20 2022 +0530 clk: qcom: gcc: sm8150: Fix some identation issues Fix identation issues with usb30 gdsc structs in gcc-sm8150. Cc: Stephen Boyd Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220303084824.284946-3-bhupesh.sharma@linaro.org drivers/clk/qcom/gcc-sm8150.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) commit 2fb605a1a529d366513fd223b4ee7c75db2db7e8 Author: Bhupesh Sharma Date: Thu Mar 3 13:51:39 2022 +0530 clk: qcom: gcc: Add UFS_CARD and UFS_PHY GDSCs for SM8150 Add the UFS_CARD and UFS_PHY GDSC defines & driver structures for SM8150. Cc: Stephen Boyd Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220303082140.240745-2-bhupesh.sharma@linaro.org drivers/clk/qcom/gcc-sm8150.c | 20 ++++++++++++++++++++ include/dt-bindings/clock/qcom,gcc-sm8150.h | 2 ++ 2 files changed, 22 insertions(+) commit 2dc63e768ce2fbf24cb49c858f549596bb30a0a0 Author: Bhupesh Sharma Date: Thu Mar 3 02:00:41 2022 +0530 clk: qcom: gcc: Add PCIe0 and PCIe1 GDSC for SM8150 Add the PCIe0 and PCIe1 GDSC defines & driver structures for SM8150. Cc: Stephen Boyd Cc: Bjorn Andersson Signed-off-by: Bhupesh Sharma Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220302203045.184500-4-bhupesh.sharma@linaro.org drivers/clk/qcom/gcc-sm8150.c | 20 ++++++++++++++++++++ include/dt-bindings/clock/qcom,gcc-sm8150.h | 2 ++ 2 files changed, 22 insertions(+) commit b527358cb4cd58a8279c9062b0786f1fab628fdc Author: Taniya Das Date: Sun Feb 27 23:25:36 2022 +0530 clk: qcom: clk-rcg2: Update the frac table for pixel clock Support the new numerator and denominator for pixel clock on SM8350 and support rgb101010, RGB888 use cases on SM8450. Fixes: 99cbd064b059f ("clk: qcom: Support display RCG clocks") Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220227175536.3131-2-tdas@codeaurora.org drivers/clk/qcom/clk-rcg2.c | 1 + 1 file changed, 1 insertion(+) commit 58922910add18583d5273c2edcdb9fd7bf4eca02 Author: Taniya Das Date: Sun Feb 27 23:25:35 2022 +0530 clk: qcom: clk-rcg2: Update logic to calculate D value for RCG The display pixel clock has a requirement on certain newer platforms to support M/N as (2/3) and the final D value calculated results in underflow errors. As the current implementation does not check for D value is within the accepted range for a given M & N value. Update the logic to calculate the final D value based on the range. Fixes: 99cbd064b059f ("clk: qcom: Support display RCG clocks") Signed-off-by: Taniya Das Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220227175536.3131-1-tdas@codeaurora.org drivers/clk/qcom/clk-rcg2.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) commit 89f0f1a4601562481b57f61988da7fdb62dfce82 Author: Konrad Dybcio Date: Sat Feb 26 22:41:26 2022 +0100 clk: qcom: smd: Add missing MSM8998 RPM clocks Add missing RPM-provided clocks on msm8998 and reorder the definitions where needed. Tested-by: Jami Kettunen Signed-off-by: Konrad Dybcio Tested-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226214126.21209-3-konrad.dybcio@somainline.org drivers/clk/qcom/clk-smd-rpm.c | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) commit f804360bb3a50decbed6e2761247964dca72c080 Author: Konrad Dybcio Date: Sat Feb 26 22:41:25 2022 +0100 clk: qcom: smd: Add missing RPM clocks for msm8992/4 XO and MSS_CFG were omitted when first adding the clocks for these SoCs. Add them, and while at it, move the XO clock to the top of the definition list, as ideally everyone should start using it sooner or later.. Fixes: b4297844995f ("clk: qcom: smd: Add support for MSM8992/4 rpm clocks") Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226214126.21209-2-konrad.dybcio@somainline.org drivers/clk/qcom/clk-smd-rpm.c | 13 +++++++++++-- include/linux/soc/qcom/smd-rpm.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) commit 6bf0f1c235fa9959190be6f6347e10896b197d4f Merge: 5838a14832d4 a7da8a0955cb Author: Rafael J. Wysocki Date: Wed Mar 9 15:19:53 2022 +0100 Merge tag 'thermal-v5.18-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal control changes for 5.18-rc1 from Daniel Lezcano: "- Convert the DT bindings to yaml format for the Exynos platform and fix the MAINTAINERS file regarding this driver (Krzysztof Kozlowski) - Register the thermal zones as HWmon sensors for the QCom's Tsens driver (Dmitry Baryshkov) - Add the sm8150 platform support to LMh (Thara Gopinath) - Add the msm8953 compatible documentation in the bindings (Luca Weiss) - Register the thermal zones as HWmon sensors for the TI thermal platforms (Romain Naour) - Check the command result from the IPC command to the BPMP in the Tegra driver (Mikko Perttunen) - Silent the error for normal configuration where the interrupt is optionnal on the Broadcom thermal driver (Florian Fainelli) - Remove a remaining dead code from the TI thermal driver (Yue Haibing) - Update the email in MAINTAINERS file for the Exynos thermal driver (Krzysztof Kozlowski)" * tag 'thermal-v5.18-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: MAINTAINERS: thermal: samsung: update Krzysztof Kozlowski's email thermal/drivers/ti-soc-thermal: Remove unused function ti_thermal_get_temp() thermal/drivers/brcmstb_thermal: Interrupt is optional thermal: tegra-bpmp: Handle errors in BPMP response drivers/thermal/ti-soc-thermal: Add hwmon support dt-bindings: thermal: tsens: Add msm8953 compatible dt-bindings: thermal: Add sm8150 compatible string for LMh thermal/drivers/qcom/lmh: Add support for sm8150 thermal/drivers/tsens: register thermal zones as hwmon sensors MAINTAINERS: thermal: samsung: Drop obsolete properties dt-bindings: thermal: samsung: Convert to dtschema commit 9d8f6abe980f98ffccad80b11d46df2116d7a5fc Author: Karolina Drobnik Date: Mon Feb 28 15:46:50 2022 +0100 memblock tests: Add memblock_alloc_try_nid tests for bottom up Add checks for memblock_alloc_try_nid for bottom up allocation direction. As the definition of this function is pretty close to the core memblock_alloc_range_nid, the test cases implemented here cover most of the code paths related to the memory allocations. The tested scenarios are: - Region can be allocated within the requested range (both with aligned and misaligned boundaries) - Region can be allocated between two already existing entries - Not enough space between already reserved regions - Memory at the range boundaries is reserved but there is enough space to allocate a new region - The memory range is too narrow but memory can be allocated before the maximum address - Edge cases: + Minimum address is below memblock_start_of_DRAM() + Maximum address is above memblock_end_of_DRAM() Add test case wrappers to test both directions in the same context. Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/1c0ba11b8da5dc8f71ad45175c536fa4be720984.1646055639.git.karolinadrobnik@gmail.com tools/testing/memblock/tests/alloc_nid_api.c | 503 ++++++++++++++++++++++++++- 1 file changed, 499 insertions(+), 4 deletions(-) commit 8f98435d674e5b7ec382914d2755849f5a95754b Author: Karolina Drobnik Date: Mon Feb 28 15:46:49 2022 +0100 memblock tests: Add memblock_alloc_try_nid tests for top down Add tests for memblock_alloc_try_nid for top down allocation direction. As the definition of this function is pretty close to the core memblock_alloc_range_nid, the test cases implemented here cover most of the code paths related to the memory allocations. The tested scenarios are: - Region can be allocated within the requested range (both with aligned and misaligned boundaries) - Region can be allocated between two already existing entries - Not enough space between already reserved regions - Memory range is too narrow but memory can be allocated before the maximum address - Edge cases: + Minimum address is below memblock_start_of_DRAM() + Maximum address is above memblock_end_of_DRAM() Add checks for both allocation directions: - Region starts at the min_addr and ends at max_addr - Maximum address is too close to the beginning of the available memory - Memory at the range boundaries is reserved but there is enough space to allocate a new region Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/d6c282e0f9f62c15bf74c216214604764232d637.1646055639.git.karolinadrobnik@gmail.com tools/testing/memblock/Makefile | 4 +- tools/testing/memblock/main.c | 2 + tools/testing/memblock/tests/alloc_nid_api.c | 679 +++++++++++++++++++++++++++ tools/testing/memblock/tests/alloc_nid_api.h | 9 + 4 files changed, 692 insertions(+), 2 deletions(-) commit 0ac06631a3bcdaed497f7b8abccf405f9eb8e0bd Author: Karolina Drobnik Date: Mon Feb 28 15:46:48 2022 +0100 memblock tests: Add memblock_alloc_from tests for bottom up Add checks for memblock_alloc_from for bottom up allocation direction. The tested scenarios are: - Not enough space to allocate memory at the minimal address - Minimal address parameter is smaller than the start address of the available memory - Minimal address parameter is too close to the end of the available memory Add test case wrappers to test both directions in the same context. Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/506cf5293c8a21c012b7ea87b14af07754d3e656.1646055639.git.karolinadrobnik@gmail.com tools/testing/memblock/tests/alloc_helpers_api.c | 175 ++++++++++++++++++++++- 1 file changed, 171 insertions(+), 4 deletions(-) commit 16567b5f30f6ea13a78a3b553e0c9c0c1ba34e64 Author: Karolina Drobnik Date: Mon Feb 28 15:46:47 2022 +0100 memblock tests: Add memblock_alloc_from tests for top down Add checks for memblock_alloc_from for default allocation direction. The tested scenarios are: - Not enough space to allocate memory at the minimal address - Minimal address parameter is smaller than the start address of the available memory - Minimal address is too close to the available memory Add simple memblock_alloc_from test that can be used to test both allocation directions (minimal address is aligned or misaligned). Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/3dd645f437975fd393010b95b8faa85d2b86490a.1646055639.git.karolinadrobnik@gmail.com tools/testing/memblock/Makefile | 3 +- tools/testing/memblock/main.c | 2 + tools/testing/memblock/tests/alloc_helpers_api.c | 226 +++++++++++++++++++++++ tools/testing/memblock/tests/alloc_helpers_api.h | 9 + 4 files changed, 239 insertions(+), 1 deletion(-) commit 0237ee2388703cf72d1e1f9ea0c73c054582f30d Author: Karolina Drobnik Date: Mon Feb 28 15:46:46 2022 +0100 memblock tests: Add memblock_alloc tests for bottom up Add checks for memblock_alloc for bottom up allocation direction. The tested scenarios are: - Region can be allocated on the first fit (with and without region merging) - Region can be allocated on the second fit (with and without region merging) Add test case wrappers to test both directions in the same context. Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/426674eee20d99dca49caf1ee0142a83dccbc98d.1646055639.git.karolinadrobnik@gmail.com tools/testing/memblock/tests/alloc_api.c | 324 ++++++++++++++++++++++++++++++- 1 file changed, 320 insertions(+), 4 deletions(-) commit 142eac65f3e04577451a40b3cc57e708311eed01 Author: Karolina Drobnik Date: Mon Feb 28 15:46:45 2022 +0100 memblock tests: Add memblock_alloc tests for top down Add checks for memblock_alloc for top down allocation direction. The tested scenarios are: - Region can be allocated on the first fit (with and without region merging) - Region can be allocated on the second fit (with and without region merging) Add checks for both allocation directions: - Region can be allocated between two already existing entries - Limited memory available - All memory is reserved - No available memory registered with memblock Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/26ccf409b8ff0394559d38d792b2afb24b55887c.1646055639.git.karolinadrobnik@gmail.com tools/testing/memblock/Makefile | 2 +- tools/testing/memblock/main.c | 3 + tools/testing/memblock/tests/alloc_api.c | 434 +++++++++++++++++++++++++++++++ tools/testing/memblock/tests/alloc_api.h | 9 + 4 files changed, 447 insertions(+), 1 deletion(-) commit 760423dfad53877b468490758fe7ea968ded9402 Author: ChiYuan Huang Date: Wed Mar 9 16:01:43 2022 +0800 regulator: rt5190a: Add support for Richtek RT5190A PMIC Add support for Richtek RT5190A PMIC. Signed-off-by: ChiYuan Huang Link: https://lore.kernel.org/r/1646812903-32496-3-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown drivers/regulator/Kconfig | 10 + drivers/regulator/Makefile | 1 + drivers/regulator/rt5190a-regulator.c | 513 ++++++++++++++++++++++++++++++++++ 3 files changed, 524 insertions(+) commit b77e70f6b8f2cc62fba847f3008a430a09ef275d Author: ChiYuan Huang Date: Wed Mar 9 16:01:42 2022 +0800 regulator: Add bindings for Richtek RT5190A PMIC Add bindings for Richtek RT5190A PMIC. Signed-off-by: ChiYuan Huang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/1646812903-32496-2-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown .../regulator/richtek,rt5190a-regulator.yaml | 141 +++++++++++++++++++++ .../regulator/richtek,rt5190a-regulator.h | 15 +++ 2 files changed, 156 insertions(+) commit 8b1d3b733f3e6acaab6c6bc9968ee0e058900a7e Author: Shengjiu Wang Date: Wed Mar 9 18:38:13 2022 +0800 ASoC: fsl_rpmsg: Remove SET_SYSTEM_SLEEP_PM_OPS callback For sound need to be continuously output at suspend with rpmsg sound card, so need to keep the clock always on at suspend, then suspend & resume callback is not needed. Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1646822293-26965-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown sound/soc/fsl/fsl_rpmsg.c | 2 -- 1 file changed, 2 deletions(-) commit fe0596a006081bc963874d4f3d38cd0b1b5e46d4 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:10 2022 -0600 ASoC: Intel: bytcht_es8316: move comment to the right place Additional code was added and the comment on the speaker GPIO needs to be moved before we actually try to get the GPIO. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-21-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/bytcht_es8316.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6e13567d2fdf54ce00212cac7ecd5418648da749 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:09 2022 -0600 ASoC: Intel: sof_es8336: add cfg-dmics component for UCM support The presence of DMICs needs to be signaled to UCM, follow the HDaudio example and use the 'cfg-dmics' component string to report the number of dmics present on the platform. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-20-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 70b519e5cade92bddf837bd3941f905b44232b05 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:08 2022 -0600 ASoC: Intel: sof_es8336: extend machine driver to support ES8326 codec The ES8326 requires a different codec driver than ES8316/8336, fixup the codec name and dai name depending on the ACPI _HID exposed in the DSDT. Also add the select in Kconfig Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-19-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/Kconfig | 3 ++- sound/soc/intel/boards/sof_es8336.c | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) commit 8e5db49182415b8bfce3b5843fc87e49c83c02aa Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:07 2022 -0600 ASoC: Intel: sof_es8336: add support for JD inverted quirk The codec driver exposes a set of properties that can be set from the machine driver - as done in bytcht_es8316.c Start by adding the JD_INVERTED quirk. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-18-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 40 ++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) commit d94c11a9b0e8620d7cf0e6d8e60d685cdb24c475 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:06 2022 -0600 ASoC: Intel: sof_es8336: move comment to the right place Additional code was added and the comment on the speaker GPIO needs to be moved before we actually try to get the GPIO. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-17-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9c818d849192491a8799b1cb14ca0f7aead4fb09 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:05 2022 -0600 ASoC: Intel: sof_es8336: log all quirks We only logged the SSP quirk, make sure the GPIO and DMIC quirks are exposed. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-16-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 651c304df7f6e3fbb4779527efa3eb128ef91329 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:04 2022 -0600 ASoC: Intel: sof_es8336: use NHLT information to set dmic and SSP Since we see a proliferation of devices with various configurations, we want to automatically set the DMIC and SSP information. This patch relies on the information extracted from NHLT and partially reverts existing DMI quirks added by commit a164137ce91a ("ASoC: Intel: add machine driver for SOF+ES8336") Note that NHLT can report multiple SSPs, choosing from the ssp_link_mask in an MSB-first manner was found experimentally to work fine. The only thing that cannot be detected is the GPIO type, and users may want to use the quirk override parameter if the 'wrong' solution is provided. Tested-by: Mauro Carvalho Chehab Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 56 +++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 15 deletions(-) commit 1b5283483a782f6560999d8d5965b1874d104812 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:03 2022 -0600 ASoC: Intel: Revert "ASoC: Intel: sof_es8336: add quirk for Huawei D15 2021" This reverts commit ce6a70bfce21bb4edb7c0f29ecfb0522fa34ab71. The next patch will add run-time detection of the required SSP and this hard-coded quirk is not needed. Acked-by: Mauro Carvalho Chehab Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 8 -------- 1 file changed, 8 deletions(-) commit 42302b205f03c74c0226bbc79dca48448dd11d48 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:02 2022 -0600 ASoC: Intel: sof_es8336: get codec device with ACPI instead of bus search We have an existing 'adev' handle from which we can find the codec device, no need for an I2C bus search. This change aligns this driver will all other I2S-based machine drivers. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-13-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5a6cfba5553b4f315b3d12b423e56a7fb9e8e0be Author: Pierre-Louis Bossart Date: Tue Mar 8 13:26:01 2022 -0600 ASoC: Intel: sof_es8336: make gpio optional Do not fail if the GPIO used for speakers is not present, at least the headphone, headset and internal mics should work. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-12-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/sof_es8336.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit b3d6a07236ebf6e0111adb957d69bebccf4f0a19 Author: Nikolai Kostrigin Date: Tue Mar 8 13:26:00 2022 -0600 ASoC: Intel: soc-acpi: add ESSX8336 support on Cannon Lake machines Add the support for all ES83x6 devices Signed-off-by: Nikolai Kostrigin Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/common/soc-acpi-intel-cnl-match.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit cded07a2dccd5493696a3adce175f01e413423c6 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:25:59 2022 -0600 ALSA: intel-dspconfig: add ES8336 support for CNL We're missing this check for the CNL PCI id Reported-by: Nikolai Kostrigin Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Acked-by: Takashi Iwai Link: https://lore.kernel.org/r/20220308192610.392950-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/hda/intel-dsp-config.c | 5 +++++ 1 file changed, 5 insertions(+) commit 1cedb6eabf0f2dd8285d3bb0ce1abd2369529084 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:25:58 2022 -0600 ASoC: Intel: soc-acpi: add more ACPI HIDs for ES83x6 devices We only saw ESSX8336 so far, but now with reports of 'ESSX8326' we need to expand to a full list. Let's reuse the 'snd_soc_acpi_codecs' structure to store the information. Note that ES8326 will need a dedicated codec driver, but the plan is to use the same machine driver for all Everest Audio devices. Reported-by: anthony tonitch Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/common/soc-acpi-intel-bxt-match.c | 7 ++++++- sound/soc/intel/common/soc-acpi-intel-cml-match.c | 7 ++++++- sound/soc/intel/common/soc-acpi-intel-glk-match.c | 7 ++++++- sound/soc/intel/common/soc-acpi-intel-jsl-match.c | 7 ++++++- sound/soc/intel/common/soc-acpi-intel-tgl-match.c | 7 ++++++- 5 files changed, 30 insertions(+), 5 deletions(-) commit de24d97fb845ffd2229811ee256438e42b5a8d12 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:25:57 2022 -0600 ALSA: intel-dsp-config: add more ACPI HIDs for ES83x6 devices We only saw ESSX8336 so far, but now with reports of 'ESSX8326' we need to expand to a full list. Let's reuse the 'snd_soc_acpi_codecs' structure to store the information. Reported-by: anthony tonitch Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Acked-by: Takashi Iwai Link: https://lore.kernel.org/r/20220308192610.392950-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/hda/intel-dsp-config.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) commit 4694b8382d6b79bcf95995757419d279a3ab375b Author: Pierre-Louis Bossart Date: Tue Mar 8 13:25:56 2022 -0600 ASoC: Intel: soc-acpi: quirk topology filename dynamically Different topology filenames may be required depending on which SSP is used, and whether or not digital mics are present. This patch adds a tplg_quirk_mask and in the case of the SOF driver adds the relevant configurations. This is a short-term solution to the ES8336 support issues. In a long-term solution, we would need an interface where the machine driver or platform driver have the ability to alter the topology hard-coded low-level hardware support, e.g. by substituting an interface for another, or disabling an interface that is not supported on a given skew. BugLink: https://github.com/thesofproject/linux/issues/3248 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown include/sound/soc-acpi.h | 20 +++++++++ sound/soc/intel/common/soc-acpi-intel-bxt-match.c | 5 ++- sound/soc/intel/common/soc-acpi-intel-cml-match.c | 5 ++- sound/soc/intel/common/soc-acpi-intel-glk-match.c | 5 ++- sound/soc/intel/common/soc-acpi-intel-jsl-match.c | 5 ++- sound/soc/intel/common/soc-acpi-intel-tgl-match.c | 5 ++- sound/soc/sof/intel/hda.c | 52 +++++++++++++++++++++++ 7 files changed, 92 insertions(+), 5 deletions(-) commit bd015f633b05a3d4f88a3d7099746b2819a523f5 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:25:55 2022 -0600 ASoC: SOF: Intel: hda: report SSP link mask to machine driver For devices designed for Windows, the SSP information should be listed in the NHLT, and when present can be used to set quirks automatically in the machine driver. The NHLT information exposes BT and analog audio connections separately, for now we are only interested in the analog audio parts. The use of dev_info() for the SSP mask is intentional so that we can immediately flag devices with an ES8336 codec. Since NHLT is not used for recent Chromebooks these messages should be rare. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/intel/hda.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) commit 0c470db0399e17310ed2ba54dd1c25cfa16ce0d3 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:25:54 2022 -0600 ALSA: intel-nhlt: add helper to detect SSP link mask The NHLT information can be used to figure out which SSPs are enabled in a platform. The 'SSP' link type is too broad for machine drivers, since it can cover the Bluetooth sideband and the analog audio codec connections, so this helper exposes a parameter to filter with the device type (DEVICE_I2S refers to analog audio codec in NHLT parlance). The helper returns a mask, since more than one SSP may be used for analog audio, e.g. the NHLT spec describes the use of SSP0 for amplifiers and SSP1 for headset codec. Note that if more than one bit is set, it's impossible to determine which SSP is connected to what external component. Additional platform-specific information based on e.g. DMI quirks would still be required in the machine driver to configure the relevant dailinks. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Acked-by: Takashi Iwai Link: https://lore.kernel.org/r/20220308192610.392950-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown include/sound/intel-nhlt.h | 22 +++++++++++++++------- sound/hda/intel-nhlt.c | 22 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) commit 92c1b7c0f780f0084f7b114be316ae4e182676e5 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:25:53 2022 -0600 ASoC: SOF: Intel: hda: retrieve DMIC number for I2S boards We currently extract the DMIC number only for HDaudio or SoundWire platforms. For I2S/TDM platforms, this wasn't necessary until now, but with devices with ES8336 we need to find a solution to detect dmics more reliably than with a DMI quirk. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/intel/hda.c | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) commit 679aa83a0fb70dcbf9e97cbdfd573e6fc8bf9b1a Author: Pierre-Louis Bossart Date: Tue Mar 8 13:25:52 2022 -0600 ASoC: soc-acpi: add information on I2S/TDM link mask The platform driver may have information on which I2S/TDM link(s) to enable in the machine driver. In the case of Intel devices, this may be extracted from NHLT tables in platform firmware. This link information is necessary to make sure machine driver and topology are aligned. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown include/sound/soc-acpi.h | 2 ++ 1 file changed, 2 insertions(+) commit 1174442b82b6cf13328a5f9574fac3655c58ae06 Author: Pierre-Louis Bossart Date: Tue Mar 8 13:25:51 2022 -0600 ASoC: soc-acpi: fix kernel-doc descriptor Add missing dmic_num mention and clarify that 'links' mean 'SoundWire links', not to be used for other links. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220308192610.392950-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown include/sound/soc-acpi.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit f535880b2d32fcb85d99a81483d44c8df23d23cf Author: Rander Wang Date: Tue Mar 8 08:43:44 2022 -0800 ASoC: SOF: move definition of snd_sof_ipc to header file Move definition of struct snd_sof_ipc to the header file so it can be shared with new IPC versions. Signed-off-by: Rander Wang Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220308164344.577647-19-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/ipc.c | 12 ------------ sound/soc/sof/sof-priv.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) commit 839e484f9e173309d599e1281eb7221e07f41814 Author: Ranjani Sridharan Date: Tue Mar 8 08:43:43 2022 -0800 ASoC: SOF: make struct snd_sof_dai IPC agnostic Remove the comp_dai and dai_config members of struct snd_sof_dai and replace it with a void *private field. Introduce a new struct sof_dai_private_data that will contain the pointer to these two fields. The topology parser will populate this structure and save it as part of the "private" member in snd_sof_dai. Change all users of these fields to use the private member instead. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220308164344.577647-18-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown include/sound/sof/dai.h | 5 +++ sound/soc/sof/intel/hda-dai.c | 27 +++++++++++---- sound/soc/sof/intel/hda.c | 39 +++++++++++++++++----- sound/soc/sof/pcm.c | 77 ++++++++++++++++++++++--------------------- sound/soc/sof/sof-audio.c | 30 ++++++++++------- sound/soc/sof/sof-audio.h | 3 +- sound/soc/sof/topology.c | 38 ++++++++++++++------- 7 files changed, 143 insertions(+), 76 deletions(-) commit 5f8333f62fcada65a85aac53c6a39eb6c4f0bb4e Author: Ranjani Sridharan Date: Tue Mar 8 08:43:42 2022 -0800 ASoC: SOF: topology: Rename arguments in sof_parse_tokens() Rename the count and priv_size arguments in sof_parse_tokens() and add comments to clarify the arguments. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220308164344.577647-17-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) commit e0974a382e7c4e0962edebbd8e0d3185c928ea85 Author: Ranjani Sridharan Date: Tue Mar 8 08:43:41 2022 -0800 ASoC: SOF: topology: Rename arguments in sof_parse_token_sets() Rename the priv_size arg to array_size and clarify the arguments in the comments. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220308164344.577647-16-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) commit 38a9a06794fe052dab57177f0320f44124e6cef9 Author: Ranjani Sridharan Date: Tue Mar 8 08:43:40 2022 -0800 ASoC: SOF: topology: Modify signature for token parsing functions Modify the signature for sof_parse_uuid_tokens(), sof_parse_word_tokens() and sof_parse_string_tokens() to reorder the arguments to be more intuitive and rename the count arg to num_tokens. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220308164344.577647-15-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 78 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 26 deletions(-) commit c7b655ade96a282a4304d68dcb120fcb61f19db2 Author: Ranjani Sridharan Date: Tue Mar 8 08:43:39 2022 -0800 ASoC: SOF: Add a tuples array to struct snd_sof_widget Add 2 new fields to snd_sof_widget to store an array of tuples defined by struct snd_sof_tuple and the number of tuples. When the topology gets parsed, the tuples associated with a widget will be stored in this array and will be used to construct the IPC structure depending on the IPC version. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220308164344.577647-14-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit 2b4b383f85baa493039a1fd80ca3f428f9504a54 Author: Ranjani Sridharan Date: Tue Mar 8 08:43:38 2022 -0800 ASoC: SOF: topology: make sof_route_load() IPC agnostic The IPC structure can be set up using the fields in struct snd_sof_route when the pipeline connections are established. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220308164344.577647-13-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.c | 15 ++++++--------- sound/soc/sof/topology.c | 17 ----------------- 2 files changed, 6 insertions(+), 26 deletions(-) commit 7a976552a4f264f777be236c0c83263975512f1a Author: Ranjani Sridharan Date: Tue Mar 8 08:43:37 2022 -0800 ASoC: SOF: make struct snd_sof_widget IPC agnostic Parse the UUID token and save it in the new uuid field in struct snd_sof_widget. struct sof_ipc_comp_ext is no longer needed. So remove it too. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220308164344.577647-12-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown include/sound/sof/topology.h | 8 -------- sound/soc/sof/sof-audio.h | 3 +-- sound/soc/sof/topology.c | 21 ++++++++++----------- 3 files changed, 11 insertions(+), 21 deletions(-) commit 284d950dd6b0ea699608455e443341e82f9719c8 Author: Karolina Drobnik Date: Mon Feb 28 15:46:44 2022 +0100 memblock tests: Add simulation of physical memory Allocation functions that return virtual addresses (with an exception of _raw variant) clear the allocated memory after reserving it. This requires valid memory ranges in memblock.memory. Introduce memory_block variable to store memory that can be registered with memblock data structure. Move assert.h and size.h includes to common.h to share them between the test files. Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/dce115503c74a6936c44694b00014658a1bb6522.1646055639.git.karolinadrobnik@gmail.com tools/testing/memblock/tests/basic_api.c | 1 - tools/testing/memblock/tests/basic_api.h | 1 - tools/testing/memblock/tests/common.c | 19 +++++++++++++++++++ tools/testing/memblock/tests/common.h | 18 ++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) commit 2c3dacba5d46ef0ff83fe6b82570c433910b63ab Author: Karolina Drobnik Date: Mon Feb 28 15:46:43 2022 +0100 memblock tests: Split up reset_memblock function All memblock data structure fields are reset in one function. In some test cases, it's preferred to reset memory region arrays without modifying other values like allocation direction flag. Extract two functions from reset_memblock, so it's possible to reset different parts of memblock: - reset_memblock_regions - reset region arrays and their counters - reset_memblock_attributes - set other fields to their default values Update checks in basic_api.c to use new definitions. Remove reset_memblock call from memblock_initialization_check, so the true initial values are tested. Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/5cc1ba9a0ade922dbf4ba450165b81a9ed17d4a9.1646055639.git.karolinadrobnik@gmail.com tools/testing/memblock/tests/basic_api.c | 48 +++++++++++++++----------------- tools/testing/memblock/tests/common.c | 14 ++++++---- tools/testing/memblock/tests/common.h | 3 +- 3 files changed, 33 insertions(+), 32 deletions(-) commit 6676a42f1e4f1b8ec166b723a3801b7113c25a0e Author: Will Deacon Date: Wed Mar 9 12:31:00 2022 +0000 perf/marvell: Fix !CONFIG_OF build for CN10K DDR PMU driver When compiling the Marvell CN10K DDR PMU driver with CONFIG_OF=n, the build fails: | drivers/perf/marvell_cn10k_ddr_pmu.c:723:35: error: 'cn10k_ddr_pmu_of_match' undeclared here (not in a function); did you mean 'cn10k_ddr_pmu_driver'? Use `of_match_ptr()` to avoid referencing the non-existent match table in this configuration. Link: https://lore.kernel.org/r/202203091424.Vfe8J4W9-lkp@intel.com Reported-by: kernel test robot Signed-off-by: Will Deacon drivers/perf/marvell_cn10k_ddr_pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 770093459b9b333380aa71f2c31c60b14895c1df Author: Will Deacon Date: Wed Mar 9 12:21:37 2022 +0000 arm64: mm: Drop 'const' from conditional arm64_dma_phys_limit definition Commit 031495635b46 ("arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones") introduced different definitions for 'arm64_dma_phys_limit' depending on CONFIG_ZONE_DMA{,32} based on a late suggestion from Pasha. Sadly, this results in a build error when passing W=1: | arch/arm64/mm/init.c:90:19: error: conflicting type qualifiers for 'arm64_dma_phys_limit' Drop the 'const' for now and use '__ro_after_init' consistently. Link: https://lore.kernel.org/r/202203090241.aj7paWeX-lkp@intel.com Link: https://lore.kernel.org/r/CA+CK2bDbbx=8R=UthkMesWOST8eJMtOGJdfMRTFSwVmo0Vn0EA@mail.gmail.com Fixes: 031495635b46 ("arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones") Signed-off-by: Will Deacon arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3c3dd2c81a1036c487353f7b9a485268b2fc1d7f Author: Will Deacon Date: Wed Mar 9 12:16:33 2022 +0000 Documentation: vmcoreinfo: Fix htmldocs warning Since commit 2369f171d5c5 ("arm64: crash_core: Export MODULES, VMALLOC, and VMEMMAP ranges"), Stephen reports a warning when building htmldocs: | Documentation/admin-guide/kdump/vmcoreinfo.rst:498: WARNING: Title underline too short. Extend the underline to squash the warning. Fixes: 2369f171d5c5 ("arm64: crash_core: Export MODULES, VMALLOC, and VMEMMAP ranges") Reported-by: Stephen Rothwell Signed-off-by: Will Deacon Documentation/admin-guide/kdump/vmcoreinfo.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d8fd5a1e78db375f2246d43df7833fec07a221cd Author: Joey Gouly Date: Tue Mar 1 15:45:18 2022 +0000 kasan: fix a missing header include of static_keys.h The kasan-enabled.h header relies on static keys, so make sure to include the header to avoid compilation errors (with JUMP_LABEL=n). It fixes the following: ./include/linux/kasan-enabled.h:9:1: warning: data definition has no type or storage class 9 | DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled); | ^~~~~~~~~~~~~~~~~~~~~~~~ error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int] Fixes: f9b5e46f4097eb29 ("kasan: split kasan_*enabled() functions into a separate header") Cc: Peter Collingbourne Cc: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Acked-by: Andrey Konovalov Signed-off-by: Joey Gouly Link: https://lore.kernel.org/r/20220301154518.19456-1-joey.gouly@arm.com Signed-off-by: Will Deacon include/linux/kasan-enabled.h | 2 ++ 1 file changed, 2 insertions(+) commit 12b604d4ba693a3aa254cf7f9d0b4835770e9e97 Author: Ping-Ke Shih Date: Mon Mar 7 09:27:41 2022 +0800 rtw89: declare HE capabilities in 6G band To work properly in 6G band, declare HE 6G capabilities. Without this fix, it can only TX/RX with OFDM rates. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220307012741.6371-1-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 517eed92bca2f66a894a53a38902bf1a06eefeb0 Author: Johannes Berg Date: Tue Mar 1 08:43:31 2022 +0800 rtw89: fix HE PHY bandwidth capability Bit 2 and 3 are reserved on 5/6 GHz and bit 1 is reserved on 2.4 GHz, so the driver should only set the non-reserved bits according to band. Signed-off-by: Johannes Berg Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220301004331.6621-1-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) commit 7bfd05ff4e805d017940e889b7a91014c7b6f9e6 Author: Chin-Yen Lee Date: Fri Feb 25 11:08:51 2022 +0800 rtw89: add tx_wake notify for low ps mode We found management frames get stuck when wifi chip enters low ps mode. So we add one notify wake function to trigger wifi chip into normal mode before forwarding management frames. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220225030851.13327-3-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.c | 19 +++++++++++++++++ drivers/net/wireless/realtek/rtw89/core.h | 3 +++ drivers/net/wireless/realtek/rtw89/fw.c | 4 ++++ drivers/net/wireless/realtek/rtw89/mac.c | 34 +++++++++++++++++++++++-------- drivers/net/wireless/realtek/rtw89/mac.h | 1 + drivers/net/wireless/realtek/rtw89/reg.h | 1 + 6 files changed, 53 insertions(+), 9 deletions(-) commit 895907779752606f6a4795abfc008509f8e38314 Author: Po Hao Huang Date: Fri Feb 25 11:08:50 2022 +0800 rtw89: 8852a: add ieee80211_ops::hw_scan Declare this function allows us to use customized scanning policy, so each scan takes less time. This is a similar implementation to hw_scan in rtw88, except that we offload more items to firmware and extend the maximum IE length. For backward compatibility, we fallback to sw_scan when firmware does not support this feature. Signed-off-by: Po Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220225030851.13327-2-pkshih@realtek.com drivers/net/wireless/realtek/rtw89/core.c | 74 ++++ drivers/net/wireless/realtek/rtw89/core.h | 21 ++ drivers/net/wireless/realtek/rtw89/debug.h | 1 + drivers/net/wireless/realtek/rtw89/fw.c | 515 ++++++++++++++++++++++++++ drivers/net/wireless/realtek/rtw89/fw.h | 351 ++++++++++++++++++ drivers/net/wireless/realtek/rtw89/mac.c | 52 +++ drivers/net/wireless/realtek/rtw89/mac.h | 1 + drivers/net/wireless/realtek/rtw89/mac80211.c | 67 +++- 8 files changed, 1069 insertions(+), 13 deletions(-) commit ae44d81d502756cb97e7b698207083967d6f20a3 Author: Miaohe Lin Date: Wed Mar 9 17:20:36 2022 +0800 mm/slub: remove forced_order parameter in calculate_sizes Since commit 32a6f409b693 ("mm, slub: remove runtime allocation order changes"), forced_order is always -1. Remove this unneeded parameter to simplify the code. Signed-off-by: Miaohe Lin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220309092036.50844-1-linmiaohe@huawei.com mm/slub.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) commit 40bb09c87f0b00c991f6c2fb367f0a2711760332 Author: Dimitris Michailidis Date: Tue Mar 8 00:12:34 2022 -0800 net/fungible: CONFIG_FUN_CORE needs SBITMAP fun_core.ko uses sbitmaps and needs to select SBITMAP. Fixes below errors: ERROR: modpost: "__sbitmap_queue_get" [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined! ERROR: modpost: "sbitmap_finish_wait" [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined! ERROR: modpost: "sbitmap_queue_clear" [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined! ERROR: modpost: "sbitmap_prepare_to_wait" [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined! ERROR: modpost: "sbitmap_queue_init_node" [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined! ERROR: modpost: "sbitmap_queue_wake_all" [drivers/net/ethernet/fungible/funcore/funcore.ko] undefined! v2: correct "Fixes" SHA Fixes: 749efb1e6d73 ("net/fungible: Kconfig, Makefiles, and MAINTAINERS") Reported-by: Randy Dunlap Signed-off-by: Dimitris Michailidis Acked-by: Randy Dunlap Signed-off-by: David S. Miller drivers/net/ethernet/fungible/Kconfig | 1 + 1 file changed, 1 insertion(+) commit cdba24904e1dd4d5152c80f6f96a0ed187e7f8a4 Author: Dimitris Michailidis Date: Mon Mar 7 20:53:21 2022 -0800 net/fungible: Fix local_memory_node error Stephen Rothwell reported the following failure on powerpc: ERROR: modpost: ".local_memory_node" [drivers/net/ethernet/fungible/funeth/funeth.ko] undefined! AFAICS this is because local_memory_node() is a non-inline non-exported function when CONFIG_HAVE_MEMORYLESS_NODES=y. It is also the wrong API to get a CPU's memory node. Use cpu_to_mem() in the two spots it's used. Fixes: ee6373ddf3a9 ("net/funeth: probing and netdev ops") Fixes: db37bc177dae ("net/funeth: add the data path") Reported-by: Stephen Rothwell Signed-off-by: Dimitris Michailidis Signed-off-by: David S. Miller drivers/net/ethernet/fungible/funeth/funeth_main.c | 2 +- drivers/net/ethernet/fungible/funeth/funeth_txrx.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 6d3a16d09bfac2883b8ea12a83d4420a4062d8c0 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Mon Mar 7 07:40:56 2022 +0000 mm/slub: refactor deactivate_slab() Simplify deactivate_slab() by unlocking n->list_lock and retrying cmpxchg_double() when cmpxchg_double() fails, and perform add_{partial,full} only when it succeed. Releasing and taking n->list_lock again here is not harmful as SLUB avoids deactivating slabs as much as possible. [ vbabka@suse.cz: perform add_{partial,full} when cmpxchg_double() succeed. count deactivating full slabs even if debugging flag is not set. ] Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Reviewed-by: Roman Gushchin Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220307074057.902222-3-42.hyeyoo@gmail.com mm/slub.c | 91 +++++++++++++++++++++++++++------------------------------------ 1 file changed, 39 insertions(+), 52 deletions(-) commit 5182f3c9180397b16d15981b385ecfad9249e527 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Mon Mar 7 07:40:55 2022 +0000 mm/slub: limit number of node partial slabs only in cache creation SLUB sets number of minimum partial slabs for node (min_partial) using set_min_partial(). SLUB holds at least min_partial slabs even if they're empty to avoid excessive use of page allocator. set_min_partial() limits value of min_partial limits value of min_partial MIN_PARTIAL and MAX_PARTIAL. As set_min_partial() can be called by min_partial_store() too, Only limit value of min_partial in kmem_cache_open() so that it can be changed to value that a user wants. [ rientjes@google.com: Fold set_min_partial() into its callers ] Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Reviewed-by: Roman Gushchin Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220307074057.902222-2-42.hyeyoo@gmail.com mm/slub.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) commit 1330b6ef3313fcec577d2b020c290dc8b9f11f1a Author: Jakub Kicinski Date: Mon Mar 7 16:44:21 2022 -0800 skb: make drop reason booleanable We have a number of cases where function returns drop/no drop decision as a boolean. Now that we want to report the reason code as well we have to pass extra output arguments. We can make the reason code evaluate correctly as bool. I believe we're good to reorder the reasons as they are reported to user space as strings. Signed-off-by: Jakub Kicinski Reviewed-by: David Ahern Signed-off-by: David S. Miller include/linux/skbuff.h | 1 + include/net/tcp.h | 21 +++++++++++---------- net/ipv4/tcp.c | 21 +++++++++------------ net/ipv4/tcp_ipv4.c | 12 +++++++----- net/ipv6/tcp_ipv6.c | 11 +++++++---- 5 files changed, 35 insertions(+), 31 deletions(-) commit 92af5d479013494ad15f929ef0b75b705c34fbb4 Merge: 8e6958c80ead d6c47d21a0ef Author: Marc Zyngier Date: Wed Mar 9 11:21:01 2022 +0000 Merge branch irq/meson-gpio into irq/irqchip-next * irq/meson-gpio: : . : Expand meson-gpio support to deal with the new Meson-S4 SoC : . irqchip/meson-gpio: Add support for meson s4 SoCs irqchip/meson-gpio: add select trigger type callback irqchip/meson-gpio: support more than 8 channels gpio irq dt-bindings: interrupt-controller: New binding for Meson-S4 SoCs Signed-off-by: Marc Zyngier commit d6c47d21a0ef9a76c537f8c5258b49d61f2e160f Author: Qianggui Song Date: Fri Feb 25 13:52:06 2022 +0800 irqchip/meson-gpio: Add support for meson s4 SoCs The meson s4 SoCs support 12 gpio irq lines compared with previous serial chips and have something different, details are as below. IRQ Number: - 80:68 13 pins on bank Z - 67:48 20 pins on bank X - 47:36 12 pins on bank H - 35:24 12 pins on bank D - 23:22 2 pins on bank E - 21:14 8 pins on bank C - 13:0 13 pins on bank B Signed-off-by: Qianggui Song [maz: fixed some W=1 build warnings] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220225055207.1048-5-qianggui.song@amlogic.com drivers/irqchip/irq-meson-gpio.c | 65 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) commit 7297a8bcc0aea2e69bc18e2731d6754f34e77aac Merge: 1a48ce92641d 3fbf4207dc68 Author: Marc Zyngier Date: Wed Mar 9 11:16:48 2022 +0000 Merge branch kvm-arm64/misc-5.18 into kvmarm-master/next * kvm-arm64/misc-5.18: : . : Misc fixes for KVM/arm64 5.18: : : - Drop unused kvm parameter to kvm_psci_version() : : - Implement CONFIG_DEBUG_LIST at EL2 : : - Make CONFIG_ARM64_ERRATUM_2077057 default y : : - Only do the interrupt dance if we have exited because of an interrupt : : - Remove traces of 32bit ARM host support from the documentation : . Documentation: KVM: Update documentation to indicate KVM is arm64-only KVM: arm64: Only open the interrupt window on exit due to an interrupt KVM: arm64: Enable Cortex-A510 erratum 2077057 by default Signed-off-by: Marc Zyngier commit 3fbf4207dc6807bf98e3d32558753cfa5eac2fa1 Author: Oliver Upton Date: Tue Mar 8 17:28:57 2022 +0000 Documentation: KVM: Update documentation to indicate KVM is arm64-only KVM support for 32-bit ARM hosts (KVM/arm) has been removed from the kernel since commit 541ad0150ca4 ("arm: Remove 32bit KVM host support"). There still exists some remnants of the old architecture in the KVM documentation. Remove all traces of 32-bit host support from the documentation. Note that AArch32 guests are still supported. Suggested-by: Marc Zyngier Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220308172856.2997250-1-oupton@google.com Documentation/virt/kvm/api.rst | 87 ++++++++++++++++----------------- Documentation/virt/kvm/devices/vcpu.rst | 2 +- 2 files changed, 44 insertions(+), 45 deletions(-) commit 1163319993f0abf8092d5f18fdff98096f7a3a73 Merge: ce7ec1b8ec78 7e580490ac98 Author: David S. Miller Date: Wed Mar 9 11:12:10 2022 +0000 Merge branch 'dsa-next-fixups' Vladimir Oltean says: ==================== Incremental fixups for DSA unicast filtering There are some bugs I've discovered in the recently merged "DSA unicast filtering" series: https://patchwork.kernel.org/project/netdevbpf/cover/20220302191417.1288145-1-vladimir.oltean@nxp.com/ First bug is the dereference of an uninitialized list (dp->fdbs) when the "initial" tag protocol is placed in the device tree for the Felix switch driver. This is a scenario I hadn't tested. It is handled by patches 1-3. Second bug is actually a sum of bugs that canceled each other out during my previous testing. The MAC address change of a DSA slave interface breaks termination for the other slave interfaces. But this actually does not happen if the slave interface whose address is changing is down. And even when up, traffic termination is still not broken because we fail to properly disable host flooding. Patches 4-6 handle this for the Felix driver (the only one benefiting from unicast filtering so far). ==================== Signed-off-by: David S. Miller commit 7e580490ac9819dd55a36be2a9b3380d1391f91b Author: Vladimir Oltean Date: Tue Mar 8 11:15:15 2022 +0200 net: dsa: felix: avoid early deletion of host FDB entries The Felix driver declares FDB isolation but puts all standalone ports in VID 0. This is mostly problem-free as discussed with Alvin here: https://patchwork.kernel.org/project/netdevbpf/cover/20220302191417.1288145-1-vladimir.oltean@nxp.com/#24763870 however there is one catch. DSA still thinks that FDB entries are installed on the CPU port as many times as there are user ports, and this is problematic when multiple user ports share the same MAC address. Consider the default case where all user ports inherit their MAC address from the DSA master, and then the user runs: ip link set swp0 address 00:01:02:03:04:05 The above will make dsa_slave_set_mac_address() call dsa_port_standalone_host_fdb_add() for 00:01:02:03:04:05 in port 0's standalone database, and dsa_port_standalone_host_fdb_del() for the old address of swp0, again in swp0's standalone database. Both the ->port_fdb_add() and ->port_fdb_del() will be propagated down to the felix driver, which will end up deleting the old MAC address from the CPU port. But this is still in use by other user ports, so we end up breaking unicast termination for them. There isn't a problem in the fact that DSA keeps track of host standalone addresses in the individual database of each user port: some drivers like sja1105 need this. There also isn't a problem in the fact that some drivers choose the same VID/FID for all standalone ports. It is just that the deletion of these host addresses must be delayed until they are known to not be in use any longer, and only the driver has this knowledge. Since DSA keeps these addresses in &cpu_dp->fdbs and &cpu_db->mdbs, it is just a matter of walking over those lists and see whether the same MAC address is present on the CPU port in the port db of another user port. I have considered reusing the generic dsa_port_walk_fdbs() and dsa_port_walk_mdbs() schemes for this, but locking makes it difficult. In the ->port_fdb_add() method and co, &dp->addr_lists_lock is held, but dsa_port_walk_fdbs() also acquires that lock. Also, even assuming that we introduce an unlocked variant of the address iterator, we'd still need some relatively complex data structures, and a void *ctx in the dsa_fdb_walk_cb_t which we don't currently pass, such that drivers are able to figure out, after iterating, whether the same MAC address is or isn't present in the port db of another port. All the above, plus the fact that I expect other drivers to follow the same model as felix where all standalone ports use the same FID, made me conclude that a generic method provided by DSA is necessary: dsa_fdb_present_in_other_db() and the mdb equivalent. Felix calls this from the ->port_fdb_del() handler for the CPU port, when the database was classified to either a port db, or a LAG db. For symmetry, we also call this from ->port_fdb_add(), because if the address was installed once, then installing it a second time serves no purpose: it's already in hardware in VID 0 and it affects all standalone ports. This change moves dsa_db_equal() from switch.c to dsa.c, since it now has one more caller. Fixes: 54c319846086 ("net: mscc: ocelot: enforce FDB isolation when VLAN-unaware") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 16 +++++++++++ include/net/dsa.h | 6 +++++ net/dsa/dsa.c | 60 ++++++++++++++++++++++++++++++++++++++++++ net/dsa/dsa_priv.h | 2 ++ net/dsa/switch.c | 18 ------------- 5 files changed, 84 insertions(+), 18 deletions(-) commit f2e2662ccf483392a1f7517258c3aa6539264d44 Author: Vladimir Oltean Date: Tue Mar 8 11:15:14 2022 +0200 net: dsa: felix: actually disable flooding towards NPI port The two blamed commits were written/tested individually but not together. When put together, commit 90897569beb1 ("net: dsa: felix: start off with flooding disabled on the CPU port"), which deletes a reinitialization of PGID_UC/PGID_MC/PGID_BC, is no longer sufficient to ensure that these port masks don't contain the CPU port module. This is because commit b903a6bd2e19 ("net: dsa: felix: migrate flood settings from NPI to tag_8021q CPU port") overwrites the hardware default settings towards the CPU port module with the settings that used to be present on the NPI port treated as a regular port. There, flooding is enabled, so flooding would get enabled on the CPU port module too. Adding conditional logic somewhere within felix_setup_tag_npi() to configure either the default no-flood policy or the flood policy inherited from the tag_8021q CPU port from a previous call to dsa_port_manage_cpu_flood() is getting complicated. So just let the migration logic do its thing during initial setup (which will temporarily turn on flooding), then turn flooding off for the NPI port after felix_set_tag_protocol() finishes. Here we are in felix_setup(), so the DSA slave interfaces are not yet created, and this doesn't affect traffic in any way. Fixes: 90897569beb1 ("net: dsa: felix: start off with flooding disabled on the CPU port") Fixes: b903a6bd2e19 ("net: dsa: felix: migrate flood settings from NPI to tag_8021q CPU port") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit e2d0576f0c009acdba63e1d763276743ff3788cc Author: Vladimir Oltean Date: Tue Mar 8 11:15:13 2022 +0200 net: dsa: be mostly no-op in dsa_slave_set_mac_address when down Since the slave unicast address is synced to hardware and to the DSA master during dsa_slave_open(), this means that a call to dsa_slave_set_mac_address() while the slave interface is down will result to a call to dsa_port_standalone_host_fdb_del() and to dev_uc_del() for the MAC address while there was no previous dsa_port_standalone_host_fdb_add() or dev_uc_add(). This is a partial revert of the blamed commit below, which was too aggressive. Fixes: 35aae5ab9121 ("net: dsa: remove workarounds for changing master promisc/allmulti only while up") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/slave.c | 7 +++++++ 1 file changed, 7 insertions(+) commit c69f40ac60060e09ca8f8c2ac7e6057f8a4c9f28 Author: Vladimir Oltean Date: Tue Mar 8 11:15:12 2022 +0200 net: dsa: felix: drop "bool change" from felix_set_tag_protocol We no longer need the workaround in the felix driver to avoid calling dsa_port_walk_fdbs() when &dp->fdbs is an uninitialized list, because that list is now initialized from all call paths of felix_set_tag_protocol(). Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 65 +++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 39 deletions(-) commit fe95784fb14e4d56072b7be7325ef859efa38135 Author: Vladimir Oltean Date: Tue Mar 8 11:15:11 2022 +0200 net: dsa: move port lists initialization to dsa_port_touch &cpu_db->fdbs and &cpu_db->mdbs may be uninitialized lists during some call paths of felix_set_tag_protocol(). There was an attempt to avoid calling dsa_port_walk_fdbs() during setup by using a "bool change" in the felix driver, but this doesn't work when the tagging protocol is defined in the device tree, and a change is triggered by DSA at pseudo-runtime: dsa_tree_setup_switches -> dsa_switch_setup -> dsa_switch_setup_tag_protocol -> ds->ops->change_tag_protocol dsa_tree_setup_ports -> dsa_port_setup -> &dp->fdbs and &db->mdbs only get initialized here So it seems like the only way to fix this is to move the initialization of these lists earlier. dsa_port_touch() is called from dsa_switch_touch_ports() which is called from dsa_switch_parse_of(), and this runs completely before dsa_tree_setup(). Similarly, dsa_switch_release_ports() runs after dsa_tree_teardown(). Fixes: f9cef64fa23f ("net: dsa: felix: migrate host FDB and MDB entries when changing tag proto") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/dsa2.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) commit 0832cd9f1f023226527e95002d537123061ddac4 Author: Vladimir Oltean Date: Tue Mar 8 11:15:10 2022 +0200 net: dsa: warn if port lists aren't empty in dsa_port_teardown There has been recent work towards matching each switchdev object addition with a corresponding deletion. Therefore, having elements in the fdbs, mdbs, vlans lists at the time of a shared (DSA, CPU) port's teardown is indicative of a bug somewhere else, and not something that is to be expected. We shouldn't try to silently paper over that. Instead, print a warning and a stack trace. This change is a prerequisite for moving the initialization/teardown of these lists. Make it clear that clearing the lists isn't needed. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/dsa2.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) commit ce7ec1b8ec784c7fe0f6180a82725ca577d12aa8 Merge: b57b44f7496a b0ca789ade4e Author: David S. Miller Date: Wed Mar 9 10:57:07 2022 +0000 Merge branch 'ptrp-ocp-next' Jonathan Lemon says: ==================== ptp: ocp: update devlink information Both of these patches update the information displayed via devlink. v1 -> v2: remove board.manufacture information ==================== Signed-off-by: David S. Miller commit b0ca789ade4efc2d019d92ac5fd4f0c1e83f5b92 Author: Jonathan Lemon Date: Mon Mar 7 16:05:35 2022 -0800 ptp: ocp: Update devlink firmware display path. Cache the firmware version when the card is initialized, and use this field to populate the devlink firmware information. The cached firmware version will be used for feature gating in upcoming patches. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 43 +++++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 26 deletions(-) commit 0cfcdd1ebcfe1a9b262f6ad8419580720dc843c4 Author: Jonathan Lemon Date: Mon Mar 7 16:05:34 2022 -0800 ptp: ocp: add nvmem interface for accessing eeprom Add the at24 drivers for the eeprom, and use the accessors via the nvmem API instead of direct i2c accesses. This makes things cleaner. Add an eeprom map table which specifies where the pre-defined information is located. Retrieve the information and and export it via the devlink interface. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 186 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 121 insertions(+), 65 deletions(-) commit d799769188529abc6cbf035a10087a51f7832b6b Author: Alexey Kardashevskiy Date: Wed Mar 9 17:18:22 2022 +1100 powerpc/64: Add UADDR64 relocation support When ld detects unaligned relocations, it emits R_PPC64_UADDR64 relocations instead of R_PPC64_RELATIVE. Currently R_PPC64_UADDR64 are detected by arch/powerpc/tools/relocs_check.sh and expected not to work. Below is a simple chunk to trigger this behaviour (this disables optimization for the demonstration purposes only, this also happens with -O1/-O2 when CONFIG_PRINTK_INDEX=y, for example): \#pragma GCC push_options \#pragma GCC optimize ("O0") struct entry { const char *file; int line; } __attribute__((packed)); static const struct entry e1 = { .file = __FILE__, .line = __LINE__ }; static const struct entry e2 = { .file = __FILE__, .line = __LINE__ }; ... prom_printf("e1=%s %lx %lx\n", e1.file, (unsigned long) e1.file, mfmsr()); prom_printf("e2=%s %lx\n", e2.file, (unsigned long) e2.file); \#pragma GCC pop_options This adds support for UADDR64 for 64bit. This reuses __dynamic_symtab from the 32bit code which supports more relocation types already. Because RELACOUNT includes only R_PPC64_RELATIVE, this replaces it with RELASZ which is the size of all relocation records. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220309061822.168173-1-aik@ozlabs.ru arch/powerpc/kernel/reloc_64.S | 67 ++++++++++++++++++++++++++------------ arch/powerpc/kernel/vmlinux.lds.S | 2 -- arch/powerpc/tools/relocs_check.sh | 7 +--- 3 files changed, 48 insertions(+), 28 deletions(-) commit 3fd46e551f67f4303c3276a0d6cd20baf2d192c4 Author: Hangyu Hua Date: Wed Feb 23 15:02:23 2022 +0800 powerpc: 8xx: fix a return value error in mpc8xx_pic_init mpc8xx_pic_init() should return -ENOMEM instead of 0 when irq_domain_add_linear() return NULL. This cause mpc8xx_pics_init to continue executing even if mpc8xx_pic_host is NULL. Fixes: cc76404feaed ("powerpc/8xx: Fix possible device node reference leak") Signed-off-by: Hangyu Hua Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220223070223.26845-1-hbh25y@gmail.com arch/powerpc/platforms/8xx/pic.c | 1 + 1 file changed, 1 insertion(+) commit b57b44f7496a76cf881acd64defc1aeb39fbdbfe Merge: d82a6c5ef9dc 443ebdd68b44 Author: David S. Miller Date: Wed Mar 9 10:39:29 2022 +0000 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next -queue Tony Nguyen says: ==================== 10GbE Intel Wired LAN Driver Updates 2022-03-08 This series contains updates to ixgbe and ixgbevf drivers. Slawomir adds an implementation for ndo_set_vf_link_state() to allow for disabling of VF link state as well a mailbox implementation so the VF can query the state. Additionally, for 82599, the option to disable a VF after receiving several malicious driver detection (MDD) events are encountered is added. For ixgbevf, the corresponding implementation to query and report a disabled state is added. ==================== Signed-off-by: David S. Miller commit 7cacfa4a7b0dcf8f10dda5327957ee13db1c455f Author: Kai Vehmanen Date: Tue Mar 8 16:13:22 2022 +0200 ALSA: hda: Add AlderLake-PS variant PCI ID Add HD Audio PCI ID for a variant of Intel AlderLake-P. Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20220308141322.880775-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai sound/pci/hda/hda_intel.c | 2 ++ 1 file changed, 2 insertions(+) commit 03a6b195e8e846f7373bcbeb3ea2a756dfb9ae61 Author: Christoph Hellwig Date: Mon Feb 28 13:25:03 2022 +0200 raid5: initialize the stripe_head embeeded bios as needed Use bio_init to initialize the bios when needed to the full state instead of a partial initialization plus later setting of dev and op and bio_reset. Signed-off-by: Christoph Hellwig Signed-off-by: Song Liu drivers/md/raid5.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) commit 89f94b64408b576c88e407d87061bb7b9bc2111d Author: Christoph Hellwig Date: Mon Feb 28 13:25:02 2022 +0200 raid5-cache: statically allocate the recovery ra bio There is no need to preallocate the bio and reset it when use. Just allocate it on-stack and use a bvec places next to the pages used for it. Signed-off-by: Christoph Hellwig Signed-off-by: Song Liu drivers/md/raid5-cache.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) commit 0dd00cba99c352dc9afd62979f350d808c215cb9 Author: Christoph Hellwig Date: Mon Feb 28 13:25:01 2022 +0200 raid5-cache: fully initialize flush_bio when needed Stop using bio_reset and just initialize the bio fully when needed. Signed-off-by: Christoph Hellwig Signed-off-by: Song Liu drivers/md/raid5-cache.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 9f7c3f837a3768ce8d5a5c34070a47608a4a0209 Author: Christoph Hellwig Date: Mon Feb 28 13:25:00 2022 +0200 raid5-ppl: fully initialize the bio in ppl_new_iounit We have all the information to pass the bdev and op directly to bio_init, so do that. Signed-off-by: Christoph Hellwig Signed-off-by: Song Liu drivers/md/raid5-ppl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 5e7f44b5c2c035fe2e5458193c2bbee56db6a090 Author: Matthew Auld Date: Thu Mar 3 10:02:29 2022 +0000 drm/i915/gtt: reduce overzealous alignment constraints for GGTT Currently this will enforce both 2M alignment and padding for any LMEM pages inserted into the GGTT. However, this was only meant to be applied to the compact-pt layout with the ppGTT. For the GGTT we can reduce the alignment and padding to 64K. Bspec: 45015 Fixes: 87bd701ee268 ("drm/i915: enforce min GTT alignment for discrete cards") Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Robert Beckett Cc: Ramalingam C Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220303100229.839282-1-matthew.auld@intel.com (cherry picked from commit c64fa77dd4609cb8cd53fbb73b02434ae8212c7a) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/gt/intel_gtt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit d82a6c5ef9dc0aab296936e1aa4ad28fd5162a55 Author: Colin Ian King Date: Mon Mar 7 22:13:49 2022 +0000 net: prestera: acl: make read-only array client_map static const Don't populate the read-only array client_map 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/20220307221349.164585-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/marvell/prestera/prestera_acl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4587369b6cba3772b6e92ec3d28854ec7d82a95d Author: Jonathan Lemon Date: Mon Mar 7 16:04:58 2022 -0800 ptp: ocp: correct label for error path When devlink_register() was removed from the error path, the corresponding label was not updated. Rename the label for readability puposes, no functional change. Signed-off-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220308000458.2166-1-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski drivers/ptp/ptp_ocp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 869420a8be1982a0be5a934860270058431c9771 Author: Samuel Thibault Date: Mon Mar 7 23:31:26 2022 +0100 SO_ZEROCOPY should return -EOPNOTSUPP rather than -ENOTSUPP ENOTSUPP is documented as "should never be seen by user programs", and thus not exposed in , and thus applications cannot safely check against it (they get "Unknown error 524" as strerror). We should rather return the well-known -EOPNOTSUPP. This is similar to 2230a7ef5198 ("drop_monitor: Use correct error code") and 4a5cdc604b9c ("net/tls: Fix return values to avoid ENOTSUPP"), which did not seem to cause problems. Signed-off-by: Samuel Thibault Acked-by: Willem de Bruijn Link: https://lore.kernel.org/r/20220307223126.djzvg44v2o2jkjsx@begin Signed-off-by: Jakub Kicinski net/core/sock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 964efdab03490d40d8e458b6a1ddf02aae212567 Merge: d307eab593b2 0dc626e5e853 Author: Jakub Kicinski Date: Tue Mar 8 22:06:15 2022 -0800 Merge branch 'mptcp-advertisement-reliability-improvement-and-misc-updates' Mat Martineau says: ==================== mptcp: Advertisement reliability improvement and misc. updates Patch 1 adds a helpful debug tracepoint for outgoing MPTCP packets. Patch 2 is a small "magic number" refactor. Patches 3 & 4 refactor parts of the mptcp_join.sh selftest. No change in test coverage. Patch 5 ensures only advertised address IDs are un-advertised. Patches 6-8 improve handling of an edge case where endpoint IDs need to be created on-the-fly when adding subflows. Includes selftest coverage. Patch 9 adds validation of the fullmesh flag in a MPTCP netlink command, which was overlooked when this flag was introduced for 5.18. ==================== Link: https://lore.kernel.org/r/20220307204439.65164-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 0dc626e5e853a966dfbb6ee6cd607e13a2acd5ae Author: Geliang Tang Date: Mon Mar 7 12:44:39 2022 -0800 mptcp: add fullmesh flag check for adding address The fullmesh flag mustn't be used with the signal flag when adding an address. This patch added the necessary flags check for this case. Fixes: 73c762c1f07d ("mptcp: set fullmesh flag in pm_netlink") Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski net/mptcp/pm_netlink.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 69c6ce7b6ecad8ed6c1b785bfadf50159d9f1023 Author: Paolo Abeni Date: Mon Mar 7 12:44:38 2022 -0800 selftests: mptcp: add implicit endpoint test case Ensure implicit endpoint are created when expected and that the user-space can update them Reviewed-by: Matthieu Baerts Co-developed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 120 +++++++++++++++++++++++- tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 7 ++ 2 files changed, 126 insertions(+), 1 deletion(-) commit 4cf86ae84c718333928fd2d43168a1e359a28329 Author: Paolo Abeni Date: Mon Mar 7 12:44:37 2022 -0800 mptcp: strict local address ID selection The address ID selection for MPJ subflows created in response to incoming ADD_ADDR option is currently unreliable: it happens at MPJ socket creation time, when the local address could be unknown. Additionally, if the no local endpoint is available for the local address, a new dummy endpoint is created, confusing the user-land. This change refactor the code to move the address ID selection inside the rebuild_header() helper, when the local address eventually selected by the route lookup is finally known. If the address used is not mapped by any endpoint - and thus can't be advertised/removed pick the id 0 instead of allocate a new endpoint. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski net/mptcp/pm_netlink.c | 13 ---------- net/mptcp/protocol.c | 3 +++ net/mptcp/protocol.h | 3 ++- net/mptcp/subflow.c | 67 +++++++++++++++++++++++++++++++++++++++++++------- 4 files changed, 63 insertions(+), 23 deletions(-) commit d045b9eb95a9b611c483897a69e7285aefdc66d7 Author: Paolo Abeni Date: Mon Mar 7 12:44:36 2022 -0800 mptcp: introduce implicit endpoints In some edge scenarios, an MPTCP subflows can use a local address mapped by a "implicit" endpoint created by the in-kernel path manager. Such endpoints presence can be confusing, as it's creation is hard to track and will prevent the later endpoint creation from the user-space using the same address. Define a new endpoint flag to mark implicit endpoints and allow the user-space to replace implicit them with user-provided data at endpoint creation time. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski include/uapi/linux/mptcp.h | 1 + net/mptcp/pm_netlink.c | 61 ++++++++++++++++++------- tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 +- 3 files changed, 47 insertions(+), 19 deletions(-) commit 6fa0174a7c8646fce7039b5a176b4f90b0ea513a Author: Paolo Abeni Date: Mon Mar 7 12:44:35 2022 -0800 mptcp: more careful RM_ADDR generation The in-kernel MPTCP path manager, when processing the MPTCP_PM_CMD_FLUSH_ADDR command, generates RM_ADDR events for each known local address. While that is allowed by the RFC, it makes unpredictable the exact number of RM_ADDR generated when both ends flush the PM addresses. This change restricts the RM_ADDR generation to previously explicitly announced addresses, and adjust the expected results in a bunch of related self-tests. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski net/mptcp/pm_netlink.c | 10 +++--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 42 +++++++++++++++++++++---- 2 files changed, 40 insertions(+), 12 deletions(-) commit f98c2bca7b2bd3fd777e05bb9e94c969381b1de8 Author: Mat Martineau Date: Mon Mar 7 12:44:34 2022 -0800 selftests: mptcp: Rename wait function The "selftests: mptcp: improve 'fair usage on close' stability" commit changed that self test to check the TcpAttemptFails MIB instead of looking for TW sockets. The associated bash function wasn't renamed in that commit because of the merge conflicts it would cause, so this commit updates the function name as Paolo originally intended. Cc: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 826d7bdca83328b101853b48ee6b5e9bb6a5f537 Author: Matthieu Baerts Date: Mon Mar 7 12:44:33 2022 -0800 selftests: mptcp: join: allow running -cCi Without this patch, no tests would be ran when launching: mptcp_join.sh -cCi In any order or a combination with 2 of these letters. The recommended way with getopt is first parse all options and then act. This allows to do some actions in priority, e.g. display the help menu and stop. But also some global variables changing the behaviour of this selftests -- like the ones behind -cCi options -- can be set before running the different tests. By doing that, we can also avoid long and unreadable regex. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 67 +++++++++++-------------- 1 file changed, 28 insertions(+), 39 deletions(-) commit ea56dcb43c2054426c5a8d7befa8d993a060b26b Author: Geliang Tang Date: Mon Mar 7 12:44:32 2022 -0800 mptcp: use MPTCP_SUBFLOW_NODATA Set subflow->data_avail with the enum value MPTCP_SUBFLOW_NODATA, instead of using 0 directly. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski net/mptcp/subflow.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 0eb4e7ee1655b7ffd3204a35d77b809d42613cb9 Author: Geliang Tang Date: Mon Mar 7 12:44:31 2022 -0800 mptcp: add tracepoint in mptcp_sendmsg_frag The tracepoint in get_mapping_status() only dumped the incoming mpext fields. This patch added a new tracepoint in mptcp_sendmsg_frag() to dump the outgoing mpext too. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski include/trace/events/mptcp.h | 4 ++++ net/mptcp/protocol.c | 1 + 2 files changed, 5 insertions(+) commit 2bd3b6b75946db2ace06e145d53988e10ed7e99a Author: Peter Wang Date: Mon Mar 7 19:17:52 2022 +0800 scsi: ufs: core: scsi_get_lba() error fix When ufs initializes without scmd->device->sector_size set, scsi_get_lba() will get a wrong shift number and trigger an ubsan error. The shift exponent 4294967286 is too large for the 64-bit type 'sector_t' (aka 'unsigned long long'). Call scsi_get_lba() only when opcode is READ_10/WRITE_10/UNMAP. Link: https://lore.kernel.org/r/20220307111752.10465-1-peter.wang@mediatek.com Reviewed-by: Bart Van Assche Signed-off-by: Peter Wang Signed-off-by: Martin K. Petersen drivers/scsi/ufs/ufshcd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 296559d41e0f8e7c8f198dd3946e288255088cef Author: Randy Dunlap Date: Sun Mar 6 17:32:24 2022 -0800 scsi: ufs: docs: UFS documentation corrections Make a variety of corrections to ufs.rst: - add spaces around parenthetical phrases - correct singular/plural grammar and nouns - correct punctuation - add article adjectives - add hyphens to multi-word adjectives - spell Lun as LUN - spell upiu as UPIU (in text, not code examples) - don't capitalize generic "specification" Link: https://lore.kernel.org/r/20220307013224.5130-1-rdunlap@infradead.org Cc: Alim Akhtar Cc: Avri Altman 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 Documentation/scsi/ufs.rst | 70 +++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 35 deletions(-) commit 208cc9fe6f21112b5cc6cb87065fb8ab66e79316 Author: Sreekanth Reddy Date: Thu Mar 3 19:32:30 2022 +0530 scsi: mpt3sas: Fix incorrect 4GB boundary check The driver must perform its 4GB boundary check using the pool's DMA address instead of using the virtual address. Link: https://lore.kernel.org/r/20220303140230.13098-1-sreekanth.reddy@broadcom.com Fixes: d6adc251dd2f ("scsi: mpt3sas: Force PCIe scatterlist allocations to be within same 4 GB region") Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen drivers/scsi/mpt3sas/mpt3sas_base.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) commit 0c25422d34b4726b2707d5f38560943155a91b80 Author: Sreekanth Reddy Date: Thu Mar 3 19:32:03 2022 +0530 scsi: mpt3sas: Remove scsi_dma_map() error messages When scsi_dma_map() fails by returning a sges_left value less than zero, the amount of logging produced can be extremely high. In a recent end-user environment, 1200 messages per second were being sent to the log buffer. This eventually overwhelmed the system and it stalled. These error messages are not needed. Remove them. Link: https://lore.kernel.org/r/20220303140203.12642-1-sreekanth.reddy@broadcom.com Suggested-by: Christoph Hellwig Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen drivers/scsi/mpt3sas/mpt3sas_base.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) commit 271add11994ba1a334859069367e04d2be2ebdd4 Author: Jianglei Nie Date: Thu Mar 3 09:51:15 2022 +0800 scsi: libfc: Fix use after free in fc_exch_abts_resp() fc_exch_release(ep) will decrease the ep's reference count. When the reference count reaches zero, it is freed. But ep is still used in the following code, which will lead to a use after free. Return after the fc_exch_release() call to avoid use after free. Link: https://lore.kernel.org/r/20220303015115.459778-1-niejianglei2021@163.com Reviewed-by: Hannes Reinecke Signed-off-by: Jianglei Nie Signed-off-by: Martin K. Petersen drivers/scsi/libfc/fc_exch.c | 1 + 1 file changed, 1 insertion(+) commit 3fd07aecb75003fbcb0b7c3124d12f71ffd360d8 Author: Damien Le Moal Date: Tue Mar 1 20:30:09 2022 +0900 scsi: scsi_debug: Fix qc_lock use in sdebug_blk_mq_poll() The use of the 'locked' boolean variable to control locking and unlocking of the qc_lock spinlock of struct sdebug_queue confuses sparse, leading to a warning about an unexpected unlock. Simplify the qc_lock lock/unlock handling code of this function to avoid this warning by removing the 'locked' boolean variable. This change also fixes unlocked access to the in_use_bm bitmap with the find_first_bit() function. Link: https://lore.kernel.org/r/20220301113009.595857-3-damien.lemoal@opensource.wdc.com Fixes: b05d4e481eff ("scsi: scsi_debug: Refine sdebug_blk_mq_poll()") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen drivers/scsi/scsi_debug.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) commit e9c478014b602fda2a99a6370d9eb2e5d7355246 Author: Damien Le Moal Date: Tue Mar 1 20:30:08 2022 +0900 scsi: scsi_debug: Silence unexpected unlock warnings The return statement inside the sdeb_read_lock(), sdeb_read_unlock(), sdeb_write_lock() and sdeb_write_unlock() confuse sparse, leading to many warnings about unexpected unlocks in the resp_xxx() functions. Modify the lock/unlock functions using the __acquire() and __release() inline annotations for the sdebug_no_rwlock == true case to avoid these warnings. Link: https://lore.kernel.org/r/20220301113009.595857-2-damien.lemoal@opensource.wdc.com Acked-by: Douglas Gilbert Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen drivers/scsi/scsi_debug.c | 68 ++++++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 24 deletions(-) commit 9f5196065eeb96fee1a15f2eae31fe1fc7623ade Author: jing yangyang Date: Thu Aug 19 19:49:01 2021 -0700 powerpc/ps3: remove unneeded semicolons Eliminate the following coccicheck warnings: ./arch/powerpc/platforms/ps3/system-bus.c:606:2-3: Unneeded semicolon ./arch/powerpc/platforms/ps3/system-bus.c:765:2-3: Unneeded semicolon Reported-by: Zeal Robot Signed-off-by: jing yangyang Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/01647102607ce9640c9f27786d976109a3c4ea7e.1629197153.git.jing.yangyang@zte.com.cn arch/powerpc/platforms/ps3/system-bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit cd6714f94091308f07a32b79e0a43f983587da3f Author: Tom Rix Date: Sun Mar 6 05:34:20 2022 -0800 crypto: arm64 - cleanup comments For spdx, use // for *.c files Replacements significanty to significantly Signed-off-by: Tom Rix Signed-off-by: Herbert Xu arch/arm64/crypto/sha3-ce-glue.c | 2 +- arch/arm64/crypto/sha512-armv8.pl | 2 +- arch/arm64/crypto/sha512-ce-glue.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit 44dbd0c61bf1480be55dbb0cac793d861d1957b9 Author: Giovanni Cabiddu Date: Fri Mar 4 18:03:56 2022 +0000 crypto: qat - fix initialization of pfvf rts_map_msg structures Initialize fully the structures rts_map_msg containing the ring to service map from the host. This is to fix the following warning when compiling the QAT driver using the clang compiler with CC=clang W=2: drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c:144:51: warning: missing field 'map' initializer [-Wmissing-field-initializers] struct ring_to_svc_map_v1 rts_map_msg = { { 0 }, }; ^ Fixes: e1b176af3d7e ("crypto: qat - exchange ring-to-service mappings over PFVF") Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 54584146cc8cb49ce471011d4afcc03a8a529463 Author: Giovanni Cabiddu Date: Fri Mar 4 18:03:55 2022 +0000 crypto: qat - fix initialization of pfvf cap_msg structures Initialize fully the structures cap_msg containing the device capabilities from the host. This is to fix the following warning when compiling the QAT driver using the clang compiler with CC=clang W=2: drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c:99:44: warning: missing field 'ext_dc_caps' initializer [-Wmissing-field-initializers] struct capabilities_v3 cap_msg = { { 0 }, }; ^ Fixes: 851ed498dba1 ("crypto: qat - exchange device capabilities over PFVF") Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu drivers/crypto/qat/qat_common/adf_pfvf_vf_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c700216c70fca38ae7ceff07ed63d79ae25379c5 Author: Giovanni Cabiddu Date: Fri Mar 4 18:03:54 2022 +0000 crypto: qat - remove unneeded assignment The function adf_gen4_get_vf2pf_sources() computes a mask which is stored in a variable which is returned and not used. Remove superfluous assignment of variable. This is to fix the following warning when compiling the QAT driver with clang scan-build: drivers/crypto/qat/qat_common/adf_gen4_pfvf.c:46:9: warning: Although the value stored to 'sou' is used in the enclosing expression, the value is never actually read from 'sou' [deadcode.DeadStores] return sou &= ~mask; ^ ~~~~~ Fixes: 5901b4af6e07 ("crypto: qat - fix access to PFVF interrupt registers for GEN4") Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu drivers/crypto/qat/qat_common/adf_gen4_pfvf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8893d27ffcaf6ec6267038a177cb87bcde4dd3de Author: Giovanni Cabiddu Date: Fri Mar 4 17:54:47 2022 +0000 crypto: qat - disable registration of algorithms The implementations of aead and skcipher in the QAT driver do not support properly requests with the CRYPTO_TFM_REQ_MAY_BACKLOG flag set. If the HW queue is full, the driver returns -EBUSY but does not enqueue the request. This can result in applications like dm-crypt waiting indefinitely for a completion of a request that was never submitted to the hardware. To avoid this problem, disable the registration of all crypto algorithms in the QAT driver by setting the number of crypto instances to 0 at configuration time. Cc: stable@vger.kernel.org Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu drivers/crypto/qat/qat_4xxx/adf_drv.c | 7 +++++++ drivers/crypto/qat/qat_common/qat_crypto.c | 7 +++++++ 2 files changed, 14 insertions(+) commit fd11727eec0dd95ee1b7d8f9f10ee60678eecc29 Author: Kai Ye Date: Fri Mar 4 17:46:47 2022 +0800 crypto: hisilicon/qm - fix memset during queues clearing Due to that extra page addr is used as a qp error flag when the device resetting. So it not should to clear this qp flag in userspace. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu drivers/crypto/hisilicon/qm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7a70d9a1cf112c0bdb42800d264d48f34089e3e8 Author: Corentin Labbe Date: Fri Mar 4 07:36:48 2022 +0000 crypto: xilinx: prevent probing on non-xilinx hardware The zynqmp-sha driver is always loaded and register its algorithm even on platform which do not have the proper hardware. This lead to a stacktrace due to zynqmp-sha3-384 failing its crypto self tests. So check if hardware is present via the firmware API call get_version. While at it, simplify the platform_driver by using module_platform_driver() Furthermore the driver should depend on ZYNQMP_FIRMWARE since it cannot work without it. Fixes: 7ecc3e34474b ("crypto: xilinx - Add Xilinx SHA3 driver") Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu drivers/crypto/Kconfig | 2 +- drivers/crypto/xilinx/zynqmp-sha.c | 35 ++++++++--------------------------- 2 files changed, 9 insertions(+), 28 deletions(-) commit ee6584bf3c680e20464e20bf28066d1ce685f7d3 Author: Jiapeng Chong Date: Fri Mar 4 13:57:42 2022 +0800 crypto: marvell/octeontx - Use swap() instead of open coding it Clean the following coccicheck warning: ./drivers/crypto/marvell/octeontx/otx_cptvf_algs.c:1645:16-17: WARNING opportunity for swap(). Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Herbert Xu drivers/crypto/marvell/octeontx/otx_cptvf_algs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 3d950c34074ed74d2713c3856ba01264523289e6 Author: Jianglei Nie Date: Thu Mar 3 10:23:37 2022 +0800 crypto: ccree - Fix use after free in cc_cipher_exit() kfree_sensitive(ctx_p->user.key) will free the ctx_p->user.key. But ctx_p->user.key is still used in the next line, which will lead to a use after free. We can call kfree_sensitive() after dev_dbg() to avoid the uaf. Fixes: 63ee04c8b491 ("crypto: ccree - add skcipher support") Signed-off-by: Jianglei Nie Signed-off-by: Herbert Xu drivers/crypto/ccree/cc_cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 54cce8ecb9254f971b40a72911c6da403720a2d2 Author: Dāvis Mosāns Date: Mon Feb 28 05:15:45 2022 +0200 crypto: ccp - ccp_dmaengine_unregister release dma channels ccp_dmaengine_register adds dma_chan->device_node to dma_dev->channels list but ccp_dmaengine_unregister didn't remove them. That can cause crashes in various dmaengine methods that tries to use dma_dev->channels Fixes: 58ea8abf4904 ("crypto: ccp - Register the CCP as a DMA...") Signed-off-by: Dāvis Mosāns Acked-by: John Allen Signed-off-by: Herbert Xu drivers/crypto/ccp/ccp-dmaengine.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit 5ca7546fe317bd181ad55f623f6e522069c2e426 Author: Ming Lei Date: Tue Mar 8 06:52:00 2022 +0100 block: move rq_qos_exit() into disk_release() Keep all teardown of file system I/O related functionality in one place. There can't be file system I/O in disk_release(), so it is safe to move rq_qos_exit() there. Signed-off-by: Ming Lei Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220308055200.735835-15-hch@lst.de Signed-off-by: Jens Axboe block/genhd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 28883074fc104f16ab181207d556ab75df6c6526 Author: Christoph Hellwig Date: Tue Mar 8 06:51:59 2022 +0100 block: do more work in elevator_exit Move the calls to ioc_clear_queue and blk_mq_sched_free_rqs into elevator_exit. Except for one call where we know we can't have io_cq structures yet these always go together, and that extra call in an error path is harmless. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220308055200.735835-14-hch@lst.de Signed-off-by: Jens Axboe block/elevator.c | 6 +++--- block/genhd.c | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) commit 28ce942fa2d5d80af5367ba9d39f2e0b4af37bfd Author: Ming Lei Date: Tue Mar 8 06:51:58 2022 +0100 block: move blk_exit_queue into disk_release There can't be file system I/O in disk_release(), so move the call to blk_exit_queue() there, preparing to have the teardown of file system I/O only functionality in one place, when the gendisk that is needed for it is torn down. We still need to freeze queue here since the request is freed after the bio is completed and passthrough request rely on scheduler tags as well. The disk can be released before or after queue is cleaned up, and we have to free the scheduler request pool before blk_cleanup_queue returns, while the static request pool has to be freed before exiting the I/O scheduler. Signed-off-by: Ming Lei [hch: rebased, updated the commit log] Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20220308055200.735835-13-hch@lst.de Signed-off-by: Jens Axboe block/blk-sysfs.c | 16 ---------------- block/genhd.c | 31 ++++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 17 deletions(-) commit ba3e845665fbbb0252336f27200cd5cf288a3573 Author: Ming Lei Date: Tue Mar 8 06:51:57 2022 +0100 block: move q_usage_counter release into blk_queue_release After blk_cleanup_queue() returns, disk may not be released yet, so probably bio may still be submitted and ->q_usage_counter may be touched, so far this way seems safe, but not good from API's viewpoint. Move the release q_usage_counter into blk_queue_release(). Signed-off-by: Ming Lei Reviewed-by: Bart Van Assche Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220308055200.735835-12-hch@lst.de Signed-off-by: Jens Axboe block/blk-core.c | 2 -- block/blk-sysfs.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) commit de3d347f7b8a1a997fbc9267454ed6065068b969 Author: Ming Lei Date: Tue Mar 8 06:51:56 2022 +0100 block: don't remove hctx debugfs dir from blk_mq_exit_queue The queue's top debugfs dir is removed from blk_release_queue(), so all hctx's debugfs dirs are removed from there. Given blk_mq_exit_queue() is only called from blk_cleanup_queue(), it isn't necessary to remove hctx debugfs from blk_mq_exit_queue(). So remove it from blk_mq_exit_queue(). Signed-off-by: Ming Lei Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220308055200.735835-11-hch@lst.de Signed-off-by: Jens Axboe block/blk-mq.c | 1 - 1 file changed, 1 deletion(-) commit 1059699f87eb0b3aa9d574b91a572d534897134a Author: Ming Lei Date: Tue Mar 8 06:51:55 2022 +0100 block: move blkcg initialization/destroy into disk allocation/release handler blkcg works on FS bio level, so it is reasonable to make both blkcg and gendisk sharing same lifetime. Meantime there won't be any FS IO when releasing disk, so safe to move blkcg initialization/destroy into disk allocation/release handler Long term, we can move blkcg into gendisk completely. Signed-off-by: Ming Lei Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220308055200.735835-10-hch@lst.de [axboe: fixup missing blk-cgroup.h include] Signed-off-by: Jens Axboe block/blk-core.c | 5 ----- block/blk-sysfs.c | 7 ------- block/genhd.c | 9 +++++++++ 3 files changed, 9 insertions(+), 12 deletions(-) commit 01d0c698536fe920733fc6cab7f9740c7acfdece Author: Christoph Hellwig Date: Tue Mar 8 06:51:54 2022 +0100 sr: implement ->free_disk to simplify refcounting Simplify the refcounting and remove the need to clear disk->private_data by implementing the ->free_disk method. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Ming Lei Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220308055200.735835-9-hch@lst.de Signed-off-by: Jens Axboe drivers/scsi/sr.c | 124 ++++++++++++------------------------------------------ drivers/scsi/sr.h | 4 -- 2 files changed, 26 insertions(+), 102 deletions(-) commit 9c63f7f6ff3142edc81776df35d79e088df6ba6c Author: Christoph Hellwig Date: Tue Mar 8 06:51:53 2022 +0100 sd: implement ->free_disk to simplify refcounting Implement the ->free_disk method to to put struct scsi_disk when the last gendisk reference count goes away. This removes the need to clear ->private_data and thus freeze the queue on unbind. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220308055200.735835-8-hch@lst.de Signed-off-by: Jens Axboe drivers/scsi/sd.c | 90 ++++++++++--------------------------------------------- 1 file changed, 16 insertions(+), 74 deletions(-) commit 534cf52aa9c18d87599a8811a39735c1b62742a0 Author: Christoph Hellwig Date: Tue Mar 8 06:51:52 2022 +0100 sd: delay calling free_opal_dev Call free_opal_dev from scsi_disk_release as the opal_dev field is accessed from the ioctl handler, which isn't synchronized vs sd_release and thus can be accessed during or after sd_release was called. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Ming Lei Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220308055200.735835-7-hch@lst.de Signed-off-by: Jens Axboe drivers/scsi/sd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit c76c46fa04c42f7d3a494c526ce5f030da36b553 Author: Christoph Hellwig Date: Tue Mar 8 06:51:51 2022 +0100 sd: call sd_zbc_release_disk before releasing the scsi_device reference sd_zbc_release_disk accesses disk->device, so ensure that actually still has a valid reference. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Ming Lei Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220308055200.735835-6-hch@lst.de Signed-off-by: Jens Axboe drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fad45c3007a18064da759b4dba35eb722bc64e97 Author: Christoph Hellwig Date: Tue Mar 8 06:51:50 2022 +0100 sd: rename the scsi_disk.dev field dev is very hard to grep for. Give the field a more descriptive name and documents its purpose. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Ming Lei Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220308055200.735835-5-hch@lst.de Signed-off-by: Jens Axboe drivers/scsi/sd.c | 22 +++++++++++----------- drivers/scsi/sd.h | 9 +++++++-- 2 files changed, 18 insertions(+), 13 deletions(-) commit e7f76552277ca79d9dfe4c59f7b3620a98467f9c Author: Christoph Hellwig Date: Tue Mar 8 06:51:49 2022 +0100 scsi: don't use disk->private_data to find the scsi_driver Requiring every ULP to have the scsi_drive as first member of the private data is rather fragile and not necessary anyway. Just use the driver hanging off the SCSI device instead. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Ming Lei Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220308055200.735835-4-hch@lst.de Signed-off-by: Jens Axboe drivers/scsi/sd.c | 3 +-- drivers/scsi/sd.h | 3 +-- drivers/scsi/sr.c | 5 ++--- drivers/scsi/sr.h | 1 - drivers/scsi/st.c | 1 - drivers/scsi/st.h | 1 - include/scsi/scsi_cmnd.h | 9 --------- include/scsi/scsi_driver.h | 9 +++++++-- 8 files changed, 11 insertions(+), 21 deletions(-) commit e02657ea7b86d1c41e095f49e4f7c7bb24bbee64 Author: Ming Lei Date: Tue Mar 8 06:51:48 2022 +0100 blk-mq: handle already freed tags gracefully in blk_mq_free_rqs To simplify further changes allow for double calling blk_mq_free_rqs on a queue. Signed-off-by: Ming Lei [hch: split out from a larger patch] Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220308055200.735835-3-hch@lst.de Signed-off-by: Jens Axboe block/blk-mq.c | 3 +++ 1 file changed, 3 insertions(+) commit 41fa722239b46f0c033da94746212344175cdaa0 Author: Christoph Hellwig Date: Tue Mar 8 06:51:47 2022 +0100 blk-mq: do not include passthrough requests in I/O accounting I/O accounting buckets I/O into the read/write/discard categories into which passthrough I/O does not fit at all. It also accounts to the block_device, which may not even exist for passthrough I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220308055200.735835-2-hch@lst.de Signed-off-by: Jens Axboe block/blk-mq.c | 11 ++++++++--- block/blk.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) commit 4e5cc99e1e485954a9c09872e0eeea570fb2b5a5 Author: Ming Lei Date: Tue Mar 8 15:32:19 2022 +0800 blk-mq: manage hctx map via xarray First code becomes more clean by switching to xarray from plain array. Second use-after-free on q->queue_hw_ctx can be fixed because queue_for_each_hw_ctx() may be run when updating nr_hw_queues is in-progress. With this patch, q->hctx_table is defined as xarray, and this structure will share same lifetime with request queue, so queue_for_each_hw_ctx() can use q->hctx_table to lookup hctx reliably. Reported-by: Yu Kuai Signed-off-by: Ming Lei Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220308073219.91173-7-ming.lei@redhat.com [axboe: fix blk_mq_hw_ctx forward declaration] Signed-off-by: Jens Axboe block/blk-mq-debugfs.h | 2 ++ block/blk-mq-tag.c | 2 +- block/blk-mq.c | 62 +++++++++++++++++++------------------------------- block/blk-mq.h | 2 +- include/linux/blk-mq.h | 3 +-- include/linux/blkdev.h | 2 +- 6 files changed, 30 insertions(+), 43 deletions(-) commit 3399dd9f372bf0f4f3fb1fb11eb60ebd7b52d79c Merge: 7fd9fd46a459 ba83af059153 Author: Andrii Nakryiko Date: Tue Mar 8 17:39:29 2022 -0800 Merge branch 'BPF test_progs tests improvement' Mykola Lysenko says: ==================== First patch reduces the sample_freq to 1000 to ensure test will work even when kernel.perf_event_max_sample_rate was reduced to 1000. Patches for send_signal and find_vma tune the test implementation to make sure needed thread is scheduled. Also, both tests will finish as soon as possible after the test condition is met. ==================== Signed-off-by: Andrii Nakryiko commit ba83af059153441d77bc2dbb4cd22421b8a34107 Author: Mykola Lysenko Date: Tue Mar 8 12:04:49 2022 -0800 Improve stability of find_vma BPF test Remove unneeded spleep and increase length of dummy CPU intensive computation to guarantee test process execution. Also, complete aforemention computation as soon as test success criteria is met Signed-off-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220308200449.1757478-4-mykolal@fb.com tools/testing/selftests/bpf/prog_tests/find_vma.c | 28 +++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) commit 1fd49864127cd0d33aea8de4cf0858344c9c7265 Author: Mykola Lysenko Date: Tue Mar 8 12:04:48 2022 -0800 Improve send_signal BPF test stability Substitute sleep with dummy CPU intensive computation. Finish aforemention computation as soon as signal was delivered to the test process. Make the BPF code to only execute when PID global variable is set Signed-off-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220308200449.1757478-3-mykolal@fb.com tools/testing/selftests/bpf/prog_tests/send_signal.c | 17 ++++++++++------- .../testing/selftests/bpf/progs/test_send_signal_kern.c | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) commit d4b540544499d90ac81695e21e354cd5c82fa67e Author: Mykola Lysenko Date: Tue Mar 8 12:04:47 2022 -0800 Improve perf related BPF tests (sample_freq issue) Linux kernel may automatically reduce kernel.perf_event_max_sample_rate value when running tests in parallel on slow systems. Linux kernel checks against this limit when opening perf event with freq=1 parameter set. The lower bound is 1000. This patch reduces sample_freq value to 1000 in all BPF tests that use sample_freq to ensure they always can open perf event. Signed-off-by: Mykola Lysenko Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220308200449.1757478-2-mykolal@fb.com tools/testing/selftests/bpf/prog_tests/bpf_cookie.c | 2 +- tools/testing/selftests/bpf/prog_tests/find_vma.c | 2 +- tools/testing/selftests/bpf/prog_tests/perf_branches.c | 4 ++-- tools/testing/selftests/bpf/prog_tests/perf_link.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) commit 64bf0eef0171912f7c2f3ea30ee6ad7a2ad0a511 Author: Christoph Hellwig Date: Mon Feb 28 14:41:23 2022 +0200 f2fs: pass the bio operation to bio_alloc_bioset Refactor block I/O code so that the bio operation and known flags are set at bio allocation time. Only the later updated flags are updated on the fly. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220228124123.856027-3-hch@lst.de Signed-off-by: Jens Axboe fs/f2fs/data.c | 70 ++++++++++++++++++++++++---------------------------------- 1 file changed, 29 insertions(+), 41 deletions(-) commit 5189810a6687b6f01d35b4a7b407eb1f6edb97e5 Author: Christoph Hellwig Date: Mon Feb 28 14:41:22 2022 +0200 f2fs: don't pass a bio to f2fs_target_device Set the bdev at bio allocation time by changing the f2fs_target_device calling conventions, so that no bio needs to be passed in. Signed-off-by: Christoph Hellwig Reviewed-by: Chao Yu Link: https://lore.kernel.org/r/20220228124123.856027-2-hch@lst.de Signed-off-by: Jens Axboe fs/f2fs/data.c | 25 +++++++++++++------------ fs/f2fs/f2fs.h | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) commit 4f481208749a22d3570073e629dbc27d7d27c8da Author: Ming Lei Date: Tue Mar 8 15:32:18 2022 +0800 blk-mq: prepare for implementing hctx table via xarray It is inevitable to cause use-after-free on q->queue_hw_ctx between queue_for_each_hw_ctx() and blk_mq_update_nr_hw_queues(). And converting to xarray can fix the uaf, meantime code gets cleaner. Prepare for converting q->queue_hctx_ctx into xarray, one thing is that xa_for_each() can only accept 'unsigned long' as index, so changes type of hctx index of queue_for_each_hw_ctx() into 'unsigned long'. Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220308073219.91173-6-ming.lei@redhat.com Signed-off-by: Jens Axboe block/blk-mq-debugfs.c | 6 +++--- block/blk-mq-sched.c | 9 +++++---- block/blk-mq-sysfs.c | 16 ++++++++++------ block/blk-mq-tag.c | 2 +- block/blk-mq.c | 30 ++++++++++++++++-------------- drivers/block/rnbd/rnbd-clt.c | 2 +- 6 files changed, 36 insertions(+), 29 deletions(-) commit de0328d3a253a339be14a80fe2a0256ec26867da Author: Ming Lei Date: Tue Mar 8 15:32:17 2022 +0800 block: mtip32xx: don't touch q->queue_hw_ctx q->queue_hw_ctx is really one blk-mq internal structure for retrieving hctx via its index, not supposed to be used by drivers. Meantime drivers can get the tags structure easily from tagset. Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220308073219.91173-5-ming.lei@redhat.com Signed-off-by: Jens Axboe drivers/block/mtip32xx/mtip32xx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 42ee3061293e206bc0f3a084feea1304c61c137a Author: Ming Lei Date: Tue Mar 8 15:32:16 2022 +0800 blk-mq: reconfigure poll after queue map is changed queue map can be changed when updating nr_hw_queues, so we need to reconfigure queue's poll capability. Add one helper for doing this job. Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220308073219.91173-4-ming.lei@redhat.com Signed-off-by: Jens Axboe block/blk-mq.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) commit 306f13ee16424805d602d427a66ea38078d473b0 Author: Ming Lei Date: Tue Mar 8 15:32:15 2022 +0800 blk-mq: simplify reallocation of hw ctxs a bit blk_mq_alloc_and_init_hctx() has already taken reuse into account, so no need to do it outside, then we can simplify blk_mq_realloc_hw_ctxs(). Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220308073219.91173-3-ming.lei@redhat.com Signed-off-by: Jens Axboe block/blk-mq.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) commit 4d805131abf219e0019715f1cf29763c613aae07 Author: Ming Lei Date: Tue Mar 8 15:32:14 2022 +0800 blk-mq: figure out correct numa node for hw queue The current code always uses default queue map and hw queue index for figuring out the numa node for hw queue, this way isn't correct because blk-mq supports three queue maps, and the correct queue map should be used for the specified hw queue. Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220308073219.91173-2-ming.lei@redhat.com Signed-off-by: Jens Axboe block/blk-mq.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) commit 15729ff8143f8135b03988a100a19e66d7cb7ecd Author: Paolo Valente Date: Thu Nov 25 19:15:10 2021 +0100 Revert "Revert "block, bfq: honor already-setup queue merges"" A crash [1] happened to be triggered in conjunction with commit 2d52c58b9c9b ("block, bfq: honor already-setup queue merges"). The latter was then reverted by commit ebc69e897e17 ("Revert "block, bfq: honor already-setup queue merges""). Yet, the reverted commit was not the one introducing the bug. In fact, it actually triggered a UAF introduced by a different commit, and now fixed by commit d29bd41428cf ("block, bfq: reset last_bfqq_created on group change"). So, there is no point in keeping commit 2d52c58b9c9b ("block, bfq: honor already-setup queue merges") out. This commit restores it. [1] https://bugzilla.kernel.org/show_bug.cgi?id=214503 Reported-by: Holger Hoffstätte Signed-off-by: Paolo Valente Link: https://lore.kernel.org/r/20211125181510.15004-1-paolo.valente@linaro.org Signed-off-by: Jens Axboe block/bfq-iosched.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) commit 7b12e49669c99f63bc12351c57e581f1f14d4adf Author: Christoph Hellwig Date: Tue Mar 8 07:05:29 2022 +0100 fs: remove fs.f_write_hint The value is now completely unused except for reporting it back through the F_GET_FILE_RW_HINT ioctl, so remove the value and the two ioctls for it. Trying to use the F_SET_FILE_RW_HINT and F_GET_FILE_RW_HINT fcntls will now return EINVAL, just like it would on a kernel that never supported this functionality in the first place. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220308060529.736277-3-hch@lst.de Signed-off-by: Jens Axboe fs/fcntl.c | 18 ------------------ fs/open.c | 1 - include/linux/fs.h | 9 --------- 3 files changed, 28 deletions(-) commit 41d36a9f3e5336f5b48c3adba0777b8e217020d7 Author: Christoph Hellwig Date: Tue Mar 8 07:05:28 2022 +0100 fs: remove kiocb.ki_hint This field is entirely unused now except for a tracepoint in f2fs, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20220308060529.736277-2-hch@lst.de Signed-off-by: Jens Axboe fs/aio.c | 1 - fs/cachefiles/io.c | 2 -- fs/f2fs/file.c | 6 ------ fs/io_uring.c | 1 - include/linux/fs.h | 12 ------------ include/trace/events/f2fs.h | 3 +-- 6 files changed, 1 insertion(+), 24 deletions(-) commit a2daeab5cffa4d81a8c9bfedf8e5576cbca00190 Merge: a76370690c3b 7d959f6e978c Author: Jens Axboe Date: Tue Mar 8 16:40:12 2022 -0700 Merge branch 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.18/drivers Pull MD fixes from Song: "Most of these changes are minor fixes and clean-ups." * 'md-next' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: use msleep() in md_notify_reboot() lib/raid6: Include for VPERMXOR lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3 lib/raid6/test: fix multiple definition linking error md: raid1/raid10: drop pending_cnt commit 7d959f6e978cbbca90e26a192cc39480e977182f Author: Eric Dumazet Date: Thu Mar 3 15:19:33 2022 -0800 md: use msleep() in md_notify_reboot() Calling mdelay(1000) from process context, even while a reboot is in progress, does not make sense. Using msleep() allows other threads to make progress. Signed-off-by: Eric Dumazet Cc: linux-raid@vger.kernel.org Signed-off-by: Song Liu drivers/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5b401e4e9ac4c6a62b9f6562d0250c1a56477ff2 Author: Paul Menzel Date: Tue Feb 8 16:21:50 2022 +0100 lib/raid6: Include for VPERMXOR On Ubuntu 21.10 (ppc64le) building raid6test with gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0 fails with the error below. gcc -I.. -I ../../../include -g -O2 \ -I../../../arch/powerpc/include -DCONFIG_ALTIVEC \ -c -o vpermxor1.o vpermxor1.c vpermxor1.c: In function ‘raid6_vpermxor1_gen_syndrome_real’: vpermxor1.c:64:29: error: expected string literal before ‘VPERMXOR’ 64 | asm(VPERMXOR(%0,%1,%2,%3):"=v"(wq0):"v"(gf_high), "v"(gf_low), "v"(wq0)); | ^~~~~~~~ make: *** [Makefile:58: vpermxor1.o] Error 1 So, include the header asm/ppc-opcode.h defining this macro also when not building the Linux kernel but only this too. Cc: Matt Brown Signed-off-by: Paul Menzel Signed-off-by: Song Liu lib/raid6/vpermxor.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 633174a7046ec3b4572bec24ef98e6ee89bce14b Author: Paul Menzel Date: Tue Feb 8 16:21:48 2022 +0100 lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3 Buidling raid6test on Ubuntu 21.10 (ppc64le) with GNU Make 4.3 shows the errors below: $ cd lib/raid6/test/ $ make :1:1: error: stray ‘\’ in program :1:2: error: stray ‘#’ in program :1:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ \ before ‘<’ token [...] The errors come from the HAS_ALTIVEC test, which fails, and the POWER optimized versions are not built. That’s also reason nobody noticed on the other architectures. GNU Make 4.3 does not remove the backslash anymore. From the 4.3 release announcment: > * WARNING: Backward-incompatibility! > Number signs (#) appearing inside a macro reference or function invocation > no longer introduce comments and should not be escaped with backslashes: > thus a call such as: > foo := $(shell echo '#') > is legal. Previously the number sign needed to be escaped, for example: > foo := $(shell echo '\#') > Now this latter will resolve to "\#". If you want to write makefiles > portable to both versions, assign the number sign to a variable: > H := \# > foo := $(shell echo '$H') > This was claimed to be fixed in 3.81, but wasn't, for some reason. > To detect this change search for 'nocomment' in the .FEATURES variable. So, do the same as commit 9564a8cf422d ("Kbuild: fix # escaping in .cmd files for future Make") and commit 929bef467771 ("bpf: Use $(pound) instead of \# in Makefiles") and define and use a $(pound) variable. Reference for the change in make: https://git.savannah.gnu.org/cgit/make.git/commit/?id=c6966b323811c37acedff05b57 Cc: Matt Brown Signed-off-by: Paul Menzel Signed-off-by: Song Liu lib/raid6/test/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit a5359ddd052860bacf957e65fe819c63e974b3a6 Author: Dirk Müller Date: Tue Feb 8 17:50:50 2022 +0100 lib/raid6/test: fix multiple definition linking error GCC 10+ defaults to -fno-common, which enforces proper declaration of external references using "extern". without this change a link would fail with: lib/raid6/test/algos.c:28: multiple definition of `raid6_call'; lib/raid6/test/test.c:22: first defined here the pq.h header that is included already includes an extern declaration so we can just remove the redundant one here. Cc: Signed-off-by: Dirk Müller Reviewed-by: Paul Menzel Signed-off-by: Song Liu lib/raid6/test/test.c | 1 - 1 file changed, 1 deletion(-) commit daae161fd2e568b4f481b177b8be34374df98b68 Author: Mariusz Tkaczyk Date: Mon Jan 17 12:38:47 2022 +0100 md: raid1/raid10: drop pending_cnt Those counters are not necessary after commit 11bb45e8aaf6 ("md: drop queue limitation for RAID1 and RAID10"). Remove them from all code (conf and plug structs). raid1_plug_cb and raid10_plug_cb are identical, so move definition of raid1_plug_cb to common raid1-10 definitions and use it for RAID10 too. Signed-off-by: Mariusz Tkaczyk Signed-off-by: Song Liu drivers/md/raid1-10.c | 5 +++++ drivers/md/raid1.c | 11 ----------- drivers/md/raid1.h | 1 - drivers/md/raid10.c | 17 +++-------------- drivers/md/raid10.h | 1 - 5 files changed, 8 insertions(+), 27 deletions(-) commit 7fd9fd46a459272e641be78c1cc36baab1921fa1 Author: Adrian Ratiu Date: Tue Mar 8 14:14:28 2022 +0200 tools: Fix unavoidable GCC call in Clang builds In ChromeOS and Gentoo we catch any unwanted mixed Clang/LLVM and GCC/binutils usage via toolchain wrappers which fail builds. This has revealed that GCC is called unconditionally in Clang configured builds to populate GCC_TOOLCHAIN_DIR. Allow the user to override CLANG_CROSS_FLAGS to avoid the GCC call - in our case we set the var directly in the ebuild recipe. In theory Clang could be able to autodetect these settings so this logic could be removed entirely, but in practice as the commit cebdb7374577 ("tools: Help cross-building with clang") mentions, this does not always work, so giving distributions more control to specify their flags & sysroot is beneficial. Suggested-by: Manoj Gupta Suggested-by: Nathan Chancellor Signed-off-by: Adrian Ratiu Signed-off-by: Daniel Borkmann Acked-by: Nathan Chancellor Cc: Nick Desaulniers Link: https://lore.kernel.org/lkml/87czjk4osi.fsf@ryzen9.i-did-not-set--mail-host-address--so-tickle-me Link: https://lore.kernel.org/bpf/20220308121428.81735-1-adrian.ratiu@collabora.com tools/scripts/Makefile.include | 4 ++++ 1 file changed, 4 insertions(+) commit 5b2fa289c0d475bcae3a86fa04b81f1f678cc4d2 Author: Konrad Dybcio Date: Sat Feb 26 22:41:24 2022 +0100 dt-bindings: clock: qcom: rpmcc: Add RPM Modem SubSystem (MSS) clocks Add the missing clock definitions. Signed-off-by: Konrad Dybcio Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226214126.21209-1-konrad.dybcio@somainline.org include/dt-bindings/clock/qcom,rpmcc.h | 2 ++ 1 file changed, 2 insertions(+) commit 4f865bdcb44fb18951de94be5c2ec37a891a8d03 Author: Ansuel Smith Date: Sat Feb 26 14:52:34 2022 +0100 clk: qcom: gcc-ipq806x: add CryptoEngine resets Add missing CryptoEngine resets. Signed-off-by: Ansuel Smith Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-15-ansuelsmth@gmail.com drivers/clk/qcom/gcc-ipq806x.c | 5 +++++ 1 file changed, 5 insertions(+) commit 887646c47d5c6fc07d281f6f728270bf04331b69 Author: Ansuel Smith Date: Sat Feb 26 14:52:33 2022 +0100 dt-bindings: reset: add ipq8064 ce5 resets Add ipq8064 ce5 resets needed for CryptoEngine gcc driver. Signed-off-by: Ansuel Smith Reviewed-by: Bjorn Andersson Acked-by: Philipp Zabel Acked-by: Rob Herring Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-14-ansuelsmth@gmail.com include/dt-bindings/reset/qcom,gcc-ipq806x.h | 5 +++++ 1 file changed, 5 insertions(+) commit b293510f3961b90dcab59965f57779be93ceda7c Author: Ansuel Smith Date: Sat Feb 26 14:52:32 2022 +0100 clk: qcom: gcc-ipq806x: add CryptoEngine clocks Add missing CryptoEngine clocks and pll11 required clock. Signed-off-by: Ansuel Smith Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-13-ansuelsmth@gmail.com drivers/clk/qcom/gcc-ipq806x.c | 244 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 244 insertions(+) commit b565d66403e3df303a058c0d8d00d0fc6aeb2ddc Author: Ansuel Smith Date: Sat Feb 26 14:52:31 2022 +0100 dt-bindings: clock: add ipq8064 ce5 clk define Add ipq8064 ce5 clk define needed for CryptoEngine in gcc driver. Define CE5_SRC is not used so it's OK to change and we align it to the QSDK naming. Signed-off-by: Ansuel Smith Acked-by: Rob Herring Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-12-ansuelsmth@gmail.com include/dt-bindings/clock/qcom,gcc-ipq806x.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 7e726f34c782b2ca28a29ca9870e34e4319d65bc Author: Ansuel Smith Date: Sat Feb 26 14:52:30 2022 +0100 clk: qcom: gcc-ipq806x: add additional freq for sdc table Add additional freq supported for the sdc table. The ops are changed to the floor_ops to handle a freq request of 52kHz where we need to provide a freq of 51.2kHz instead for stability reason. Signed-off-by: Ansuel Smith Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-11-ansuelsmth@gmail.com drivers/clk/qcom/gcc-ipq806x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 33958ad3fc02aeb06a4634e59689a9559d968e1f Author: Ansuel Smith Date: Sat Feb 26 14:52:29 2022 +0100 clk: qcom: clk-rcg: add clk_rcg_floor_ops ops Add clk_rcg_floor_ops for clock that can't provide a stable freq and require to use a floor freq to provide the requested frequency. Signed-off-by: Ansuel Smith Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-10-ansuelsmth@gmail.com drivers/clk/qcom/clk-rcg.c | 24 ++++++++++++++++++++++++ drivers/clk/qcom/clk-rcg.h | 1 + 2 files changed, 25 insertions(+) commit 28aa450d38e521de45be951df052d2c49a17fae2 Author: Ansuel Smith Date: Sat Feb 26 14:52:28 2022 +0100 clk: qcom: gcc-ipq806x: add unusued flag for critical clock Some clocks are used by other devices present on the SoC. For example the gsbi4_h_clk is used by RPM and is if disabled cause the RPM to reject any regulator change command. These clock should never be disabled. Signed-off-by: Ansuel Smith Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-9-ansuelsmth@gmail.com drivers/clk/qcom/gcc-ipq806x.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 512ea2edfe15ffa2cd839b3a31d768145f2edc20 Author: Ansuel Smith Date: Sat Feb 26 14:52:27 2022 +0100 clk: qcom: gcc-ipq806x: add additional freq nss cores Ipq8065 SoC (an evolution of ipq8064 SoC) contains nss cores that can be clocked to 800MHz. Add these missing freq to the gcc driver. Set the freq_tbl for the ubi32_cores to the correct values based on the machine compatible. Signed-off-by: Ansuel Smith Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-8-ansuelsmth@gmail.com drivers/clk/qcom/gcc-ipq806x.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) commit a6aedd6532131bc81d47bbf63385dfcf2a0e9faa Author: Ansuel Smith Date: Sat Feb 26 14:52:26 2022 +0100 clk: qcom: gcc-ipq806x: use ARRAY_SIZE for num_parents Use ARRAY_SIZE for num_parents instead of hardcoding the value. Signed-off-by: Ansuel Smith Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-7-ansuelsmth@gmail.com drivers/clk/qcom/gcc-ipq806x.c | 68 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) commit cb02866f9a740fb9fb8ff19698a69290da4057e5 Author: Ansuel Smith Date: Sat Feb 26 14:52:25 2022 +0100 clk: qcom: gcc-ipq806x: convert parent_names to parent_data Convert parent_names to parent_data to modernize the driver. Where possible use parent_hws directly. Signed-off-by: Ansuel Smith Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-6-ansuelsmth@gmail.com drivers/clk/qcom/gcc-ipq806x.c | 286 +++++++++++++++++++++++++---------------- 1 file changed, 173 insertions(+), 113 deletions(-) commit e95e825333eda345d812b461301dad50021d5487 Author: Ansuel Smith Date: Sat Feb 26 14:52:24 2022 +0100 clk: qcom: gcc-ipq806x: fix wrong naming for gcc_pxo_pll8_pll0 Parent gcc_pxo_pll8_pll0 had the parent definition and parent map swapped. Fix this naming error. Signed-off-by: Ansuel Smith Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-5-ansuelsmth@gmail.com drivers/clk/qcom/gcc-ipq806x.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) commit 85e125878b4a238281df840f469d0b66d55a54b0 Author: Ansuel Smith Date: Sat Feb 26 14:52:23 2022 +0100 dt-bindings: clock: document qcom,gcc-ipq8064 binding Document qcom,gcc-ipq8064 binding needed to declare pxo and cxo source clocks. The gcc node is also used by the tsens driver, already documented, to get the calib nvmem cells and the base reg from gcc. Use qcom,gcc.yaml as a template and remove the compatible from generic qcom,gcc-other.yaml Signed-off-by: Ansuel Smith Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-4-ansuelsmth@gmail.com .../bindings/clock/qcom,gcc-ipq8064.yaml | 76 ++++++++++++++++++++++ .../devicetree/bindings/clock/qcom,gcc-other.yaml | 3 - 2 files changed, 76 insertions(+), 3 deletions(-) commit a469bf89a009c610dddf9c4e08fe7c69cabaebaa Author: Ansuel Smith Date: Sat Feb 26 14:52:22 2022 +0100 dt-bindings: clock: simplify qcom,gcc-apq8064 Documentation Simplify qcon,gcc-apq8064 Documentation by using qcom,gcc.yaml as a template and remove the compatible from qcom,gcc.yaml Signed-off-by: Ansuel Smith Reviewed-by: Rob Herring Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-3-ansuelsmth@gmail.com .../bindings/clock/qcom,gcc-apq8064.yaml | 29 ++++++---------------- .../devicetree/bindings/clock/qcom,gcc-other.yaml | 3 --- 2 files changed, 7 insertions(+), 25 deletions(-) commit a03965ed13108b2ad7015030455e150bc5e17fcf Author: Ansuel Smith Date: Sat Feb 26 14:52:21 2022 +0100 dt-bindings: clock: split qcom,gcc.yaml to common and specific schema Split qcom,gcc.yaml to common and specific schema to use it as a template for schema that needs to use the gcc bindings and require to add additional bindings. Signed-off-by: Ansuel Smith Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Tested-by: Jonathan McDowell Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220226135235.10051-2-ansuelsmth@gmail.com .../devicetree/bindings/clock/qcom,gcc-other.yaml | 76 ++++++++++++++++++++++ .../devicetree/bindings/clock/qcom,gcc.yaml | 59 ++--------------- 2 files changed, 80 insertions(+), 55 deletions(-) commit 2081df368ef325bd7f659e395620090ab2d8d1c0 Author: Rohit Agarwal Date: Tue Feb 22 10:26:25 2022 +0530 clk: qcom: Add SDX65 APCS clock controller support Update APCS Kconfig to reflect support for SDX65 APCS clock controller. Signed-off-by: Rohit Agarwal Reviewed-by: Stephen Boyd Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1645505785-2271-6-git-send-email-quic_rohiagar@quicinc.com drivers/clk/qcom/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit af44e3276bf8f79bed480764c6a6296be73e073f Author: Rohit Agarwal Date: Tue Feb 22 10:26:22 2022 +0530 clk: qcom: Add A7 PLL support for SDX65 Update A7 PLL Kconfig to reflect support for SDX65. Signed-off-by: Rohit Agarwal Reviewed-by: Manivannan Sadhasivam Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1645505785-2271-3-git-send-email-quic_rohiagar@quicinc.com drivers/clk/qcom/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 2cabc45237659cb3b0294c8b8ae12f5fd0dad28d Author: Rohit Agarwal Date: Tue Feb 22 10:26:21 2022 +0530 dt-bindings: clock: Add A7 PLL binding for SDX65 Add information for Cortex A7 PLL clock in Qualcomm platform SDX65. Signed-off-by: Rohit Agarwal Reviewed-by: Manivannan Sadhasivam Reviewed-by: Stephen Boyd Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1645505785-2271-2-git-send-email-quic_rohiagar@quicinc.com Documentation/devicetree/bindings/clock/qcom,a7pll.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 013804a727a0482bc6661e15dfababde5f856550 Author: Konrad Dybcio Date: Tue Feb 22 02:15:31 2022 +0100 clk: qcom: Add GPU clock controller driver for SM6350 Add support for the GPU clock controller found on SM6350. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220222011534.3502-4-konrad.dybcio@somainline.org drivers/clk/qcom/Kconfig | 8 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/gpucc-sm6350.c | 521 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 530 insertions(+) commit 7b91b9d8cc6c374cf41f772dd7191ea48011621f Author: Konrad Dybcio Date: Tue Feb 22 02:15:30 2022 +0100 dt-bindings: clock: add SM6350 QCOM Graphics clock bindings Add device tree bindings for graphics clock controller for Qualcomm Technology Inc's SM6350 SoCs. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220222011534.3502-3-konrad.dybcio@somainline.org .../devicetree/bindings/clock/qcom,gpucc.yaml | 2 ++ include/dt-bindings/clock/qcom,gpucc-sm6350.h | 37 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) commit 837519775f1d3945e3d4019641f7120d58325059 Author: Konrad Dybcio Date: Tue Feb 22 02:15:29 2022 +0100 clk: qcom: Add display clock controller driver for SM6350 Add support for the display clock controller found on SM6350. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220222011534.3502-2-konrad.dybcio@somainline.org drivers/clk/qcom/Kconfig | 9 + drivers/clk/qcom/Makefile | 1 + drivers/clk/qcom/dispcc-sm6350.c | 797 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 807 insertions(+) commit 6914b82f37215ef510f9867bec14d5150fd970e5 Author: Konrad Dybcio Date: Tue Feb 22 02:15:28 2022 +0100 dt-bindings: clock: add QCOM SM6350 display clock bindings Add device tree bindings for display clock controller for Qualcomm Technology Inc's SM6350 SoC. Signed-off-by: Konrad Dybcio Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220222011534.3502-1-konrad.dybcio@somainline.org .../bindings/clock/qcom,dispcc-sm6350.yaml | 86 ++++++++++++++++++++++ include/dt-bindings/clock/qcom,dispcc-sm6350.h | 48 ++++++++++++ 2 files changed, 134 insertions(+) commit 05afd57f4d34602a652fdaf58e0a2756b3c20fd4 Author: Rob Clark Date: Tue Mar 8 10:48:44 2022 -0800 drm/msm/gpu: Fix crash on devices without devfreq support (v2) Avoid going down devfreq paths on devices where devfreq is not initialized. v2: Change has_devfreq() logic [Dmitry] Reported-by: Linux Kernel Functional Testing Reported-by: Anders Roxell Signed-off-by: Rob Clark Fixes: 6aa89ae1fb04 ("drm/msm/gpu: Cancel idle/boost work on suspend") Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220308184844.1121029-1-robdclark@gmail.com drivers/gpu/drm/msm/msm_gpu_devfreq.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) commit 6cbf8b38dfe3aabe330f2c356949bc4d6a1f034f Author: Jamie Iles Date: Tue Mar 8 13:42:26 2022 +0000 i3c: fix uninitialized variable use in i2c setup Commit 31b9887c7258 ("i3c: remove i2c board info from i2c_dev_desc") removed the boardinfo from i2c_dev_desc to decouple device enumeration from setup but did not correctly lookup the i2c_dev_desc to store the new device, instead dereferencing an uninitialized variable. Lookup the device that has already been registered by address to store the i2c client device. Fixes: 31b9887c7258 ("i3c: remove i2c board info from i2c_dev_desc") Reported-by: kernel test robot Cc: Alexandre Belloni Signed-off-by: Jamie Iles Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220308134226.1042367-1-quic_jiles@quicinc.com drivers/i3c/master.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit eeda29db98f429a3b6473117e6ce1c213ab614f2 Author: Michael Kelley Date: Tue Mar 8 11:22:44 2022 -0800 x86/hyperv: Output host build info as normal Windows version number Hyper-V provides host version number information that is output in text form by a Linux guest when it boots. For whatever reason, the formatting has historically been non-standard. Change it to output in normal Windows version format for better readability. Similar code for ARM64 guests already outputs in normal Windows version format. Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1646767364-2234-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu arch/x86/kernel/cpu/mshyperv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 18c91bb2d87268d23868bf13508f5bc9cf04e89a Author: Barret Rhoden Date: Thu Jan 6 12:20:41 2022 -0500 prlimit: do not grab the tasklist_lock Unnecessarily grabbing the tasklist_lock can be a scalability bottleneck for workloads that also must grab the tasklist_lock for waiting, killing, and cloning. The tasklist_lock was grabbed to protect tsk->sighand from disappearing (becoming NULL). tsk->signal was already protected by holding a reference to tsk. update_rlimit_cpu() assumed tsk->sighand != NULL. With this commit, it attempts to lock_task_sighand(). However, this means that update_rlimit_cpu() can fail. This only happens when a task is exiting. Note that during exec, sighand may *change*, but it will not be NULL. Prior to this commit, the do_prlimit() ensured that update_rlimit_cpu() would not fail by read locking the tasklist_lock and checking tsk->sighand != NULL. If update_rlimit_cpu() fails, there may be other tasks that are not exiting that share tsk->signal. However, the group_leader is the last task to be released, so if we cannot update_rlimit_cpu(group_leader), then the entire process is exiting. The only other caller of update_rlimit_cpu() is selinux_bprm_committing_creds(). It has tsk == current, so update_rlimit_cpu() cannot fail (current->sighand cannot disappear until current exits). This change resulted in a 14% speedup on a microbenchmark where parents kill and wait on their children, and children getpriority, setpriority, and getrlimit. Signed-off-by: Barret Rhoden Link: https://lkml.kernel.org/r/20220106172041.522167-4-brho@google.com Signed-off-by: Eric W. Biederman include/linux/posix-timers.h | 2 +- kernel/sys.c | 25 ++++++++++++++----------- kernel/time/posix-cpu-timers.c | 12 +++++++++--- 3 files changed, 24 insertions(+), 15 deletions(-) commit c57bef0287dd5deeabaea5727950559fb9037cd9 Author: Barret Rhoden Date: Thu Jan 6 12:20:40 2022 -0500 prlimit: make do_prlimit() static There are no other callers in the kernel. Fixed up a comment format and whitespace issue when moving do_prlimit() higher in sys.c. Signed-off-by: Barret Rhoden Link: https://lkml.kernel.org/r/20220106172041.522167-3-brho@google.com Signed-off-by: Eric W. Biederman include/linux/resource.h | 2 - kernel/sys.c | 116 ++++++++++++++++++++++++----------------------- 2 files changed, 59 insertions(+), 59 deletions(-) commit a7da8a0955cbe81433afecad229d2a2ba60c3f0a Author: Krzysztof Kozlowski Date: Tue Mar 8 07:56:48 2022 +0100 MAINTAINERS: thermal: samsung: update Krzysztof Kozlowski's email Use Krzysztof Kozlowski's @kernel.org account in dt-bindings maintainer entry. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308065648.6443-1-krzysztof.kozlowski@canonical.com Signed-off-by: Daniel Lezcano MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1d6aab36a26ba44b114d7f8a857c430c9e0c32c9 Author: YueHaibing Date: Sat Mar 5 20:50:47 2022 +0800 thermal/drivers/ti-soc-thermal: Remove unused function ti_thermal_get_temp() commit b263b473bf62 ("thermal: ti-soc-thermal: Remove redundant code") left behind this, remove it. Signed-off-by: YueHaibing Reviewed-by: Bryan Brattlof Link: https://lore.kernel.org/r/20220305125047.26948-1-yuehaibing@huawei.com Signed-off-by: Daniel Lezcano drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 8 -------- 1 file changed, 8 deletions(-) commit 7eab0b9d48a825e8e845003f81eeaaf0bcb239fd Author: Florian Fainelli Date: Tue Mar 1 10:14:12 2022 -0800 thermal/drivers/brcmstb_thermal: Interrupt is optional Utilize platform_get_irq_optional() to silence these messages: brcmstb_thermal a581500.thermal: IRQ index 0 not found Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20220301181412.2008044-1-f.fainelli@gmail.com Signed-off-by: Daniel Lezcano drivers/thermal/broadcom/brcmstb_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1a7c9213d5f9bfd5e1bf4f87df1abc166ce48ffc Author: Mikko Perttunen Date: Wed Sep 15 11:55:13 2021 +0300 thermal: tegra-bpmp: Handle errors in BPMP response The return value from tegra_bpmp_transfer indicates the success or failure of the IPC transaction with BPMP. If the transaction succeeded, we also need to check the actual command's result code. Add code to do this. Signed-off-by: Mikko Perttunen Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20210915085517.1669675-1-mperttunen@nvidia.com Signed-off-by: Daniel Lezcano drivers/thermal/tegra/tegra-bpmp-thermal.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) commit 3a9abd6cece8321be821bf84406a94e3c483f31e Author: Romain Naour Date: Fri Feb 18 11:47:25 2022 +0100 drivers/thermal/ti-soc-thermal: Add hwmon support Expose ti-soc-thermal thermal sensors as HWMON devices. # sensors cpu_thermal-virtual-0 Adapter: Virtual device temp1: +54.2 C (crit = +105.0 C) dspeve_thermal-virtual-0 Adapter: Virtual device temp1: +51.4 C (crit = +105.0 C) gpu_thermal-virtual-0 Adapter: Virtual device temp1: +54.2 C (crit = +105.0 C) iva_thermal-virtual-0 Adapter: Virtual device temp1: +54.6 C (crit = +105.0 C) core_thermal-virtual-0 Adapter: Virtual device temp1: +52.6 C (crit = +105.0 C) Similar to imx_sc_thermal d2bc4dd91da6095a769fdc9bc519d3be7ad5f97a. No need to take care of thermal_remove_hwmon_sysfs() since devm_thermal_add_hwmon_sysfs() (a wrapper around devres) is used. See c7fc403e40b0ea18976a59e968c23439a80809e8. Signed-off-by: Romain Naour Link: https://lore.kernel.org/r/20220218104725.2718904-1-romain.naour@smile.fr Signed-off-by: Daniel Lezcano drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 4 ++++ 1 file changed, 4 insertions(+) commit e8ec6bb302074e41268f9764bf6328599682b84f Author: Luca Weiss Date: Sun Feb 20 21:18:55 2022 +0100 dt-bindings: thermal: tsens: Add msm8953 compatible Document the compatible string for tsens found in msm8953. Signed-off-by: Luca Weiss Acked-by: Konrad Dybcio Acked-by: Amit Kucheria Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220220201909.445468-3-luca@z3ntu.xyz Signed-off-by: Daniel Lezcano Documentation/devicetree/bindings/thermal/qcom-tsens.yaml | 1 + 1 file changed, 1 insertion(+) commit 1f43fad1018a47a3c1723608e64fa01c12bafb81 Author: Thara Gopinath Date: Thu Jan 6 12:31:38 2022 -0500 dt-bindings: thermal: Add sm8150 compatible string for LMh Extend the LMh dt binding document to include compatible string supporting sm8150 SoC. Signed-off-by: Thara Gopinath Acked-by: Rob Herring Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220106173138.411097-4-thara.gopinath@linaro.org Signed-off-by: Daniel Lezcano Documentation/devicetree/bindings/thermal/qcom-lmh.yaml | 1 + 1 file changed, 1 insertion(+) commit cf0c54db636c9107b0c1f1b57ab7f18fa2fef478 Author: Thara Gopinath Date: Thu Jan 6 12:31:36 2022 -0500 thermal/drivers/qcom/lmh: Add support for sm8150 Add compatible to support LMh for sm8150 SoC. sm8150 does not require explicit enabling for various LMh subsystems. Add a variable indicating the same as match data which is set for sdm845. Execute the piece of code enabling various LMh subsystems only if enable algorithm match data is present. Signed-off-by: Thara Gopinath Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220106173138.411097-2-thara.gopinath@linaro.org Signed-off-by: Daniel Lezcano drivers/thermal/qcom/lmh.c | 62 ++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 27 deletions(-) commit 8556e19d4939fbdb15aee9391f035453c5b2255a Author: Dmitry Baryshkov Date: Sat Jan 29 21:07:50 2022 +0300 thermal/drivers/tsens: register thermal zones as hwmon sensors Register thermal zones as hwmon sensors to let userspace read CPU temperatures using standard hwmon interface. Acked-by: Amit Kucheria Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220129180750.1882310-1-dmitry.baryshkov@linaro.org Signed-off-by: Daniel Lezcano drivers/thermal/qcom/tsens.c | 5 +++++ 1 file changed, 5 insertions(+) commit 62db1e8e9701a947a00f3d8987ca3298827def56 Author: Krzysztof Kozlowski Date: Sat Jan 22 14:25:54 2022 +0100 MAINTAINERS: thermal: samsung: Drop obsolete properties Update the Samsung Exynos SoC thermal driver entry to match reality and add Krzysztof Kozlowski as co-maintainer (as he maintains entire Samsung SoC). The rationale: 1. Bartlomiej's Samsung email bounces, since he is not working in Samsung for some time. 2. The mentioned Lukasz Majewski's Git tree was not updated since 2015. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220122132554.65192-3-krzysztof.kozlowski@canonical.com Signed-off-by: Daniel Lezcano MAINTAINERS | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 0fb74d0d21aaea1513eb8bfdbbde60113be4fcbc Author: Krzysztof Kozlowski Date: Sat Jan 22 14:25:53 2022 +0100 dt-bindings: thermal: samsung: Convert to dtschema Convert the Samsung Exynos SoC Thermal Management Unit bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220122132554.65192-2-krzysztof.kozlowski@canonical.com Signed-off-by: Daniel Lezcano .../devicetree/bindings/thermal/exynos-thermal.txt | 106 ------------ .../bindings/thermal/samsung,exynos-thermal.yaml | 184 +++++++++++++++++++++ 2 files changed, 184 insertions(+), 106 deletions(-) commit 16d1f0a7938568e32fafaedfeb45dd661e9880ee Author: Oleksii Moisieiev Date: Mon Mar 7 08:17:43 2022 +0000 dt-bindings: Add vendor prefix for Xen hypervisor Xen is an open source type-1 hypervisor. Signed-off-by: Oleksii Moisieiev Reviewed-by: Stefano Stabellini Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/aece6fd976980131120456800de3558e1e2308a0.1646639462.git.oleksii_moisieiev@epam.com Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) commit 87fee8d0911fd8a4e88892aa79c7aeef845d8454 Merge: c8a7fae59417 4ebb15a15799 Author: Mark Brown Date: Tue Mar 8 20:07:09 2022 +0000 spi: Tesla FSD support Merge series from Alim Akhtar: This series adds support for the SPI controller in the Tesla FSD SoC, also pulling in: git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-spi-dt-v5.18 from the MFD tree which has dependencies for the DT bindings. commit 28650a5c3a3471f8211b567bc8fe55aebbd4df66 Merge: 17bf6b7c7835 f6eafa4022dd Author: Rob Herring Date: Tue Mar 8 13:42:06 2022 -0600 Merge branch 'dt/linus' into dt/next Pull in DT binding warning fixes commit 17bf6b7c7835841f77adda76802ac2e6c11ec65e Author: Geert Uytterhoeven Date: Tue Mar 8 18:49:02 2022 +0100 dt-bindings: firmware: arm,scpi: Add missing maxItems to mboxes/shmem "make dt_binding_check": Documentation/devicetree/bindings/firmware/arm,scpi.example.dt.yaml: scpi: shmem: [[2], [1]] is too long Fix this by adding a proper maxItems value to the shmem property, and to the related mboxes property. Fix the grouping of the "mboxes" property in the example. Signed-off-by: Geert Uytterhoeven Acked-by: Sudeep Holla Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/58b7c706f259f88a61bfe82d9106fe0a93a9838d.1646761693.git.geert+renesas@glider.be Documentation/devicetree/bindings/firmware/arm,scpi.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 830751d54b4abb2d4d9e5e8072dffdd8ce195f1f Author: Andy Shevchenko Date: Tue Mar 8 16:05:59 2022 +0200 ACPI: docs: gpio-properties: Unify ASL style for GPIO examples GPIO examples of ASL in the board.rst, enumeration.rst and gpio-properties.rst are not unified. Unify them for better reader experience. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki Documentation/driver-api/gpio/board.rst | 21 ++++++++--------- Documentation/firmware-guide/acpi/enumeration.rst | 22 +++++------------- .../firmware-guide/acpi/gpio-properties.rst | 26 ++++++++++++---------- 3 files changed, 28 insertions(+), 41 deletions(-) commit 390031c942116d4733310f0684beb8db19885fe6 Author: Eric W. Biederman Date: Tue Mar 8 13:04:19 2022 -0600 coredump: Use the vma snapshot in fill_files_note Matthew Wilcox reported that there is a missing mmap_lock in file_files_note that could possibly lead to a user after free. Solve this by using the existing vma snapshot for consistency and to avoid the need to take the mmap_lock anywhere in the coredump code except for dump_vma_snapshot. Update the dump_vma_snapshot to capture vm_pgoff and vm_file that are neeeded by fill_files_note. Add free_vma_snapshot to free the captured values of vm_file. Reported-by: Matthew Wilcox Link: https://lkml.kernel.org/r/20220131153740.2396974-1-willy@infradead.org Cc: stable@vger.kernel.org Fixes: a07279c9a8cd ("binfmt_elf, binfmt_elf_fdpic: use a VMA list snapshot") Fixes: 2aa362c49c31 ("coredump: extend core dump note section to contain file names of mapped files") Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" fs/binfmt_elf.c | 24 ++++++++++++------------ fs/coredump.c | 22 +++++++++++++++++++++- include/linux/coredump.h | 2 ++ 3 files changed, 35 insertions(+), 13 deletions(-) commit 9ec7d3230717b4fe9b6c7afeb4811909c23fa1d7 Author: Eric W. Biederman Date: Mon Jan 31 12:17:38 2022 -0600 coredump/elf: Pass coredump_params into fill_note_info Instead of individually passing cprm->siginfo and cprm->regs into fill_note_info pass all of struct coredump_params. This is preparation to allow fill_files_note to use the existing vma snapshot. Reviewed-by: Jann Horn Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" fs/binfmt_elf.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) commit 49c1866348f364478a0c4d3dd13fd08bb82d3a5b Author: Eric W. Biederman Date: Tue Mar 8 13:01:19 2022 -0600 coredump: Remove the WARN_ON in dump_vma_snapshot The condition is impossible and to the best of my knowledge has never triggered. We are in deep trouble if that conditions happens and we walk past the end of our allocated array. So delete the WARN_ON and the code that makes it look like the kernel can handle the case of walking past the end of it's vma_meta array. Reviewed-by: Jann Horn Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" fs/coredump.c | 6 ------ 1 file changed, 6 deletions(-) commit a759de6991b35ad437adba32b5f0cb2fd9e75929 Author: Youngjin Jang Date: Tue Mar 8 04:07:39 2022 +0900 PM: sleep: Add device name to suspend_report_result() Currently, suspend_report_result() prints only function information. If any driver uses a common PM function, nobody knows who exactly called the failing function. A device pinter is needed to recognize the failing device. For example: PM: dpm_run_callback(): pnp_bus_suspend+0x0/0x10 returns 0 PM: dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns 0 become after the change: serial 00:05: PM: dpm_run_callback(): pnp_bus_suspend+0x0/0x10 returns 0 pci 0000:00:01.3: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x150 returns 0 Signed-off-by: Youngjin Jang [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki drivers/base/power/main.c | 10 +++++----- drivers/pci/pci-driver.c | 14 +++++++------- drivers/pnp/driver.c | 2 +- drivers/usb/core/hcd-pci.c | 4 ++-- include/linux/pm.h | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) commit 95c5436a4883841588dae86fb0b9325f47ba5ad3 Author: Eric W. Biederman Date: Tue Mar 8 12:55:29 2022 -0600 coredump: Snapshot the vmas in do_coredump Move the call of dump_vma_snapshot and kvfree(vma_meta) out of the individual coredump routines into do_coredump itself. This makes the code less error prone and easier to maintain. Make the vma snapshot available to the coredump routines in struct coredump_params. This makes it easier to change and update what is captures in the vma snapshot and will be needed for fixing fill_file_notes. Reviewed-by: Jann Horn Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" fs/binfmt_elf.c | 20 +++++++------------- fs/binfmt_elf_fdpic.c | 18 ++++++------------ fs/coredump.c | 41 +++++++++++++++++++++++------------------ include/linux/coredump.h | 6 +++--- 4 files changed, 39 insertions(+), 46 deletions(-) commit e702196bf85778f2c5527ca47f33ef2e2fca8297 Author: Mark Cilissen Date: Mon Mar 7 04:16:58 2022 +0100 ACPI / x86: Work around broken XSDT on Advantech DAC-BJ01 board On this board the ACPI RSDP structure points to both a RSDT and an XSDT, but the XSDT points to a truncated FADT. This causes all sorts of trouble and usually a complete failure to boot after the following error occurs: ACPI Error: Unsupported address space: 0x20 (*/hwregs-*) ACPI Error: AE_SUPPORT, Unable to initialize fixed events (*/evevent-*) ACPI: Unable to start ACPI Interpreter This leaves the ACPI implementation in such a broken state that subsequent kernel subsystem initialisations go wrong, resulting in among others mismapped PCI memory, SATA and USB enumeration failures, and freezes. As this is an older embedded platform that will likely never see any BIOS updates to address this issue and its default shipping OS only complies to ACPI 1.0, work around this by forcing `acpi=rsdt`. This patch, applied on top of Linux 5.10.102, was confirmed on real hardware to fix the issue. Signed-off-by: Mark Cilissen Cc: All applicable Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki arch/x86/kernel/acpi/boot.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) commit a99a3e2efaf1f4454eb5c9176f47e66de075b134 Author: Eric W. Biederman Date: Mon Jan 31 11:50:46 2022 -0600 coredump: Move definition of struct coredump_params into coredump.h Move the definition of struct coredump_params into coredump.h where it belongs. Remove the slightly errorneous comment explaining why struct coredump_params was declared in binfmts.h. Signed-off-by: "Eric W. Biederman" fs/binfmt_flat.c | 1 + include/linux/binfmts.h | 13 +------------ include/linux/coredump.h | 12 +++++++++++- 3 files changed, 13 insertions(+), 13 deletions(-) commit f3303ff649dbf7dcdc6a6e1a922235b12b3028f4 Author: Randy Dunlap Date: Sat Mar 5 18:46:20 2022 -0800 ACPI: APEI: fix return value of __setup handlers __setup() handlers should return 1 to indicate that the boot option has been handled. Returning 0 causes a boot option to be listed in the Unknown kernel command line parameters and also added to init's arg list (if no '=' sign) or environment list (if of the form 'a=b'). Unknown kernel command line parameters "erst_disable bert_disable hest_disable BOOT_IMAGE=/boot/bzImage-517rc6", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init erst_disable bert_disable hest_disable with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc6 Fixes: a3e2acc5e37b ("ACPI / APEI: Add Boot Error Record Table (BERT) support") Fixes: a08f82d08053 ("ACPI, APEI, Error Record Serialization Table (ERST) support") Fixes: 9dc966641677 ("ACPI, APEI, HEST table parsing") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Reviewed-by: "Huang, Ying" Signed-off-by: Rafael J. Wysocki drivers/acpi/apei/bert.c | 2 +- drivers/acpi/apei/erst.c | 2 +- drivers/acpi/apei/hest.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit eb5616d4adeebf958a42822ee440d79e9f803bf7 Author: Huang Rui Date: Mon Feb 14 18:14:50 2022 +0800 x86/ACPI: CPPC: Move init_freq_invariance_cppc() into x86 CPPC The init_freq_invariance_cppc code actually doesn't need the SMP functionality. So setting the CONFIG_SMP as the check condition for init_freq_invariance_cppc may cause the confusion to misunderstand the CPPC. And the x86 CPPC file is better space to store the CPPC related functions, while the init_freq_invariance_cppc is out of smpboot, that means, the CONFIG_SMP won't be mandatory condition any more. And It's more clear than before. Signed-off-by: Huang Rui [ rjw: Subject adjustment ] Signed-off-by: Rafael J. Wysocki arch/x86/include/asm/topology.h | 4 +--- arch/x86/kernel/acpi/cppc.c | 14 ++++++++++++++ arch/x86/kernel/smpboot.c | 20 -------------------- 3 files changed, 15 insertions(+), 23 deletions(-) commit 666f6ecf35bc3a14ab01fa761a7e17afac04dcd5 Author: Huang Rui Date: Mon Feb 14 18:14:49 2022 +0800 x86: Expose init_freq_invariance() to topology header The function init_freq_invariance will be used on x86 CPPC, so expose it in the topology header. Signed-off-by: Huang Rui [ rjw: Subject adjustment ] Signed-off-by: Rafael J. Wysocki arch/x86/include/asm/topology.h | 4 ++++ arch/x86/kernel/smpboot.c | 8 +------- 2 files changed, 5 insertions(+), 7 deletions(-) commit 82d89369141b8fab56deff540121b8d09d289bfd Author: Huang Rui Date: Mon Feb 14 18:14:48 2022 +0800 x86/ACPI: CPPC: Move AMD maximum frequency ratio setting function into x86 CPPC The AMD maximum frequency ratio setting function depends on CPPC, so the x86 CPPC implementation file is better space for this function. Signed-off-by: Huang Rui [ rjw: Subject adjustment ] Signed-off-by: Rafael J. Wysocki arch/x86/include/asm/topology.h | 9 +++++++++ arch/x86/kernel/acpi/cppc.c | 40 +++++++++++++++++++++++++++++++++++++ arch/x86/kernel/smpboot.c | 44 +---------------------------------------- 3 files changed, 50 insertions(+), 43 deletions(-) commit fd8af343a299df264c41b1219358f502c7b5b18a Author: Huang Rui Date: Mon Feb 14 18:14:47 2022 +0800 x86/ACPI: CPPC: Rename cppc_msr.c to cppc.c Rename the cppc_msr.c to cppc.c in x86 ACPI, that expects to use this file to cover more function implementation for ACPI CPPC beside MSR helpers. Naming as "cppc" is more straightforward as one of the functionalities under ACPI subsystem. Signed-off-by: Huang Rui [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki arch/x86/kernel/acpi/Makefile | 2 +- arch/x86/kernel/acpi/{cppc_msr.c => cppc.c} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 4ac56b1f1ef8139dbfc5dab918aa235e8344ec4e Author: Colin Ian King Date: Mon Mar 7 18:31:00 2022 +0000 USB: serial: usb_wwan: remove redundant assignment to variable i Variable i is being assigned a value that is never read, it is being re-assigned two statements later in a for-loop. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/usb/serial/usb_wwan.c:151:2: warning: Value stored to 'i' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: Johan Hovold drivers/usb/serial/usb_wwan.c | 1 - 1 file changed, 1 deletion(-) commit aaa743d838da81ea173856c70caf96d8cdcbc320 Author: Dan Carpenter Date: Mon Mar 7 16:31:05 2022 +0300 drm/msm/adreno: fix cast in adreno_get_param() These casts need to happen before the shift. The only time it would matter would be if "rev.core" is >= 128. In that case the sign bit would be extended and we do not want that. Fixes: afab9d91d872 ("drm/msm/adreno: Expose speedbin to userspace") Signed-off-by: Dan Carpenter Reviewed-by: Akhil P Oommen Link: https://lore.kernel.org/r/20220307133105.GA17534@kili Signed-off-by: Rob Clark drivers/gpu/drm/msm/adreno/adreno_gpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 4ebb15a15799da4954f1d4926fcd3263ea46e417 Author: Alim Akhtar Date: Tue Mar 8 17:46:40 2022 +0530 spi: s3c64xx: Add spi port configuration for Tesla FSD SoC Add compatible and port configuration for spi controller for Tesla Full Self-Driving SoC. Cc: linux-fsd@tesla.com Signed-off-by: Aswani Reddy Signed-off-by: Alim Akhtar Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20220308121640.27344-2-alim.akhtar@samsung.com Signed-off-by: Mark Brown drivers/spi/spi-s3c64xx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 363d3c51bc5b3243b5b035a1f50d6d994a1b203f Author: Alim Akhtar Date: Tue Mar 8 17:46:39 2022 +0530 spi: dt-bindings: samsung: Add fsd spi compatible Adds spi controller dt-binding compatible information for Tesla Full Self-Driving (FSD) SoC. Cc: linux-fsd@tesla.com Signed-off-by: Adithya K V Signed-off-by: Alim Akhtar Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andi Shyti Link: https://lore.kernel.org/r/20220308121640.27344-1-alim.akhtar@samsung.com Signed-off-by: Mark Brown Documentation/devicetree/bindings/spi/samsung,spi.yaml | 1 + 1 file changed, 1 insertion(+) commit 2594703044ad2ef7ea7d463bf2cf82a13f7fc266 Author: Georgi Vlaev Date: Tue Mar 8 15:44:54 2022 +0200 regulator: Convert TPS62360 binding to json-schema Convert the TPS62360 regulator binding to DT schema format using json-schema. This also removes redundant "ti,enable-force-pwm" property from the example. The property description was removed from the original text binding file by commit 9a00630c3db8 ("regulator: tps62360: support force PWM mode via regulator mode"), but a reference to it remained in the example. Signed-off-by: Georgi Vlaev Reviewed-by: Krzysztof Kozlowski Reviewed-by: Laxman Dewangan Link: https://lore.kernel.org/r/20220308134454.14504-1-g-vlaev@ti.com Signed-off-by: Mark Brown .../devicetree/bindings/regulator/ti,tps62360.yaml | 98 ++++++++++++++++++++++ .../bindings/regulator/tps62360-regulator.txt | 44 ---------- 2 files changed, 98 insertions(+), 44 deletions(-) commit 5d4a2ea96b79e7e11f1551130bb9166258b71243 Author: Nuno Sá Date: Tue Mar 8 14:54:08 2022 +0100 hwmon: (axi-fan-control) Use hwmon_notify_event Instead of directly accessing kobj directly from the driver, use the hwmon notify API. Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220308135408.440744-1-nuno.sa@analog.com Signed-off-by: Guenter Roeck drivers/hwmon/axi-fan-control.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit c8a7fae5941739074d363dbd8b92745d8e7827b1 Merge: 80ab9012bbf1 1b8342cc4a38 Author: Mark Brown Date: Tue Mar 8 17:19:24 2022 +0000 Tegra QUAD SPI combined sequence mode Merge series from Krishna Yarlagadda : Add ACPI support for Tegra210 QUAD SPI driver Support new Tegra194 feature, combined sequence mode. commit 73d9cf7ca1210140b9fb17fd79a0e33d1d5b9af8 Merge: 6b1b0f7d7d65 40bdb2fd6b15 Author: Mark Brown Date: Tue Mar 8 17:19:21 2022 +0000 Clean ups and preparation for IPC abstraction in the SOF driver Merge series from Ranjani Sridharan : In preparation for adding support for the new IPC version that has been introduced in the SOF firmware, this patch set includes some clean ups and necessary modifications to commonly used functions that will be re-used across different IPC-specific code. commit 6b1b0f7d7d65e6a15b5e5e05cd66a924474e3e64 Merge: 6ae0a4d8fec5 50291652af52 Author: Mark Brown Date: Tue Mar 8 17:19:20 2022 +0000 Add driver for SAMA7G5's PDMC Merge series from Codrin Ciubotariu : This patch series adds support for Pulse Density Microphone Controller (PDMC), present on Microchip's SAMA7G5. The PDMC interfaces up to 4 digital microphones having Pulse Density Modulated (PDM) outputs. It generates a single clock line and samples 1 or 2 data lines. The signal path includes an audio grade programmable decimation filter and outputs 24-bit audio words. The source of each channel can be independently defined as PDMC_DS0 or PDMC_DS1, sampled at the rising or falling edge of PDMC_CLK. The patch series starts with a fix on the ASoC DMA engine support. Then continues with the bindings and the driver of PDMC. It is followed by the DT nodes for SAMA7G5 and SAMA7G5-EK. In the end, the drivers for PDMC and PDM microphones are enabled in sama7_defconfig. commit 92abe50490d36ac2ee56f63db24adee219ed63c5 Author: Minghao Chi (CGEL ZTE) Date: Mon Mar 7 03:36:31 2022 +0000 hwmon: (vexpress-hwmon) Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Link: https://lore.kernel.org/r/20220307033631.2075160-1-chi.minghao@zte.com.cn Signed-off-by: Guenter Roeck drivers/hwmon/vexpress-hwmon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit f3e00820f51952bb75c4c2fd722d56e844e17c15 Author: Krzysztof Kozlowski Date: Sun Mar 6 12:11:21 2022 +0100 dt-bindings: ufs: snps,tc-dwc-g210: convert to dtschema Convert the Synopsys Universal Flash Storage (UFS) Controller to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220306111125.116455-9-krzysztof.kozlowski@canonical.com .../devicetree/bindings/ufs/snps,tc-dwc-g210.yaml | 51 ++++++++++++++++++++++ .../devicetree/bindings/ufs/tc-dwc-g210-pltfrm.txt | 26 ----------- 2 files changed, 51 insertions(+), 26 deletions(-) commit 954c6010053ce387d50bed8fcd55cda701728f5e Author: Krzysztof Kozlowski Date: Sun Mar 6 12:11:20 2022 +0100 dt-bindings: ufs: mediatek,ufs: convert to dtschema Convert the Mediatek Universal Flash Storage (UFS) Controller to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220306111125.116455-8-krzysztof.kozlowski@canonical.com .../devicetree/bindings/ufs/mediatek,ufs.yaml | 67 ++++++++++++++++++++++ .../devicetree/bindings/ufs/ufs-mediatek.txt | 45 --------------- 2 files changed, 67 insertions(+), 45 deletions(-) commit 516075a230d4801222cf0d1b8c8534e73c81c16a Author: Krzysztof Kozlowski Date: Sun Mar 6 12:11:19 2022 +0100 dt-bindings: ufs: hisilicon,ufs: convert to dtschema Convert the HiSilicon Universal Flash Storage (UFS) Controller to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220306111125.116455-7-krzysztof.kozlowski@canonical.com .../devicetree/bindings/ufs/hisilicon,ufs.yaml | 90 ++++++++++++++++++++++ Documentation/devicetree/bindings/ufs/ufs-hisi.txt | 42 ---------- 2 files changed, 90 insertions(+), 42 deletions(-) commit 462c5c0aa7989ea33fb4167daad0c0354b066f6b Author: Krzysztof Kozlowski Date: Sun Mar 6 12:11:18 2022 +0100 dt-bindings: ufs: qcom,ufs: convert to dtschema Convert the Qualcomm Universal Flash Storage (UFS) Controller to DT schema format. Except the conversion, add also properties already present in DTS: iommus, interconnects and power-domains. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220306111125.116455-6-krzysztof.kozlowski@canonical.com .../devicetree/bindings/ufs/qcom,ufs.yaml | 242 +++++++++++++++++++++ .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 90 -------- 2 files changed, 242 insertions(+), 90 deletions(-) commit 578f116b7ad62c44306a1cde27cd0bc7873161f2 Author: Krzysztof Kozlowski Date: Sun Mar 6 12:11:17 2022 +0100 dt-bindings: ufs: drop unused/old ufs-qcom PHY bindings The Qualcomm UFS PHY bindings are documented in bindings/phy/qcom,qmp-phy.yaml and the compatibles from separate file bindings/ufs/ufs-qcom.txt are not used at all. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bjorn Andersson Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220306111125.116455-5-krzysztof.kozlowski@canonical.com Documentation/devicetree/bindings/ufs/ufs-qcom.txt | 63 ---------------------- 1 file changed, 63 deletions(-) commit 1581355bd0edca670011ef15364cfa5326da36cd Author: Krzysztof Kozlowski Date: Sun Mar 6 12:11:16 2022 +0100 dt-bindings: ufs: cdns,ufshc: convert to dtschema Convert the Cadence Universal Flash Storage (UFS) Controlle to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220306111125.116455-4-krzysztof.kozlowski@canonical.com .../devicetree/bindings/ufs/cdns,ufshc.txt | 32 ---------- .../devicetree/bindings/ufs/cdns,ufshc.yaml | 68 ++++++++++++++++++++++ .../devicetree/bindings/ufs/ti,j721e-ufs.yaml | 7 +-- 3 files changed, 71 insertions(+), 36 deletions(-) commit cebe22345fb8f92cd1ca4b5aafe63d77722e4a37 Author: Krzysztof Kozlowski Date: Sun Mar 6 12:11:15 2022 +0100 dt-bindings: ufs: samsung,exynos-ufs: use common bindings Use common UFS bindings in Samsung Exynos UFS to cover generic/common properties in DTS. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Alim Akhtar Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220306111125.116455-3-krzysztof.kozlowski@canonical.com .../devicetree/bindings/ufs/samsung,exynos-ufs.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) commit 8544073271d1cb8664d191a8e87dafb7e0407189 Author: Krzysztof Kozlowski Date: Sun Mar 6 12:11:14 2022 +0100 dt-bindings: ufs: add common platform bindings Add bindings for common parts (platform) of Universal Flash Storage (UFS) Host Controllers in dtschema format. Include also the bindings directory in the UFS maintainers entry. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220306111125.116455-2-krzysztof.kozlowski@canonical.com .../devicetree/bindings/ufs/ufs-common.yaml | 82 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 83 insertions(+) commit c76edea0e52d5522835534de90c893ca50b04402 Merge: 608f7cf3f544 f2b03c1056ef Author: Arnd Bergmann Date: Tue Mar 8 17:06:44 2022 +0100 Merge tag 'amlogic-drivers-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/drivers Amlogic Drivers updates for v5.18: - Add support for Amlogic S4 in meson-secure-pwrc power domain driver * tag 'amlogic-drivers-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: soc: s4: Add support for power domains controller dt-bindings: power: add Amlogic s4 power domains bindings Link: https://lore.kernel.org/r/c7471989-d929-c744-c0c3-c8e86eaaa225@baylibre.com Signed-off-by: Arnd Bergmann commit 4a204f7895878363ca8211f50ec610408c8c70aa Author: Suravee Suthikulpanit Date: Thu Feb 10 18:08:51 2022 -0600 KVM: SVM: Allow AVIC support on system w/ physical APIC ID > 255 Expand KVM's mask for the AVIC host physical ID to the full 12 bits defined by the architecture. The number of bits consumed by hardware is model specific, e.g. early CPUs ignored bits 11:8, but there is no way for KVM to enumerate the "true" size. So, KVM must allow using all bits, else it risks rejecting completely legal x2APIC IDs on newer CPUs. This means KVM relies on hardware to not assign x2APIC IDs that exceed the "true" width of the field, but presumably hardware is smart enough to tie the width to the max x2APIC ID. KVM also relies on hardware to support at least 8 bits, as the legacy xAPIC ID is writable by software. But, those assumptions are unavoidable due to the lack of any way to enumerate the "true" width. Cc: stable@vger.kernel.org Cc: Maxim Levitsky Suggested-by: Sean Christopherson Reviewed-by: Sean Christopherson Fixes: 44a95dae1d22 ("KVM: x86: Detect and Initialize AVIC support") Signed-off-by: Suravee Suthikulpanit Message-Id: <20220211000851.185799-1-suravee.suthikulpanit@amd.com> Signed-off-by: Paolo Bonzini arch/x86/include/asm/svm.h | 2 +- arch/x86/kvm/svm/avic.c | 7 +------ arch/x86/kvm/svm/svm.h | 11 +++++++++++ 3 files changed, 13 insertions(+), 7 deletions(-) commit b58c55d522b256fa54c5e9175cf3202bc452b20e Author: Sean Christopherson Date: Sat Feb 26 00:15:46 2022 +0000 KVM: selftests: Add test to populate a VM with the max possible guest mem Add a selftest that enables populating a VM with the maximum amount of guest memory allowed by the underlying architecture. Abuse KVM's memslots by mapping a single host memory region into multiple memslots so that the selftest doesn't require a system with terabytes of RAM. Default to 512gb of guest memory, which isn't all that interesting, but should work on all MMUs and doesn't take an exorbitant amount of memory or time. E.g. testing with ~64tb of guest memory takes the better part of an hour, and requires 200gb of memory for KVM's page tables when using 4kb pages. To inflicit maximum abuse on KVM' MMU, default to 4kb pages (or whatever the not-hugepage size is) in the backing store (memfd). Use memfd for the host backing store to ensure that hugepages are guaranteed when requested, and to give the user explicit control of the size of hugepage being tested. By default, spin up as many vCPUs as there are available to the selftest, and distribute the work of dirtying each 4kb chunk of memory across all vCPUs. Dirtying guest memory forces KVM to populate its page tables, and also forces KVM to write back accessed/dirty information to struct page when the guest memory is freed. On x86, perform two passes with a MMU context reset between each pass to coerce KVM into dropping all references to the MMU root, e.g. to emulate a vCPU dropping the last reference. Perform both passes and all rendezvous on all architectures in the hope that arm64 and s390x can gain similar shenanigans in the future. Measure and report the duration of each operation, which is helpful not only to verify the test is working as intended, but also to easily evaluate the performance differences different page sizes. Provide command line options to limit the amount of guest memory, set the size of each slot (i.e. of the host memory region), set the number of vCPUs, and to enable usage of hugepages. Signed-off-by: Sean Christopherson Message-Id: <20220226001546.360188-29-seanjc@google.com> Signed-off-by: Paolo Bonzini tools/testing/selftests/kvm/.gitignore | 1 + tools/testing/selftests/kvm/Makefile | 1 + .../testing/selftests/kvm/max_guest_memory_test.c | 292 +++++++++++++++++++++ 3 files changed, 294 insertions(+) commit 17ae5ebc46e713e3a16735644a093aa3aff9fe8a Author: Sean Christopherson Date: Sat Feb 26 00:15:45 2022 +0000 KVM: selftests: Define cpu_relax() helpers for s390 and x86 Add cpu_relax() for s390 and x86 for use in arch-agnostic tests. arm64 already defines its own version. Signed-off-by: Sean Christopherson Message-Id: <20220226001546.360188-28-seanjc@google.com> Signed-off-by: Paolo Bonzini tools/testing/selftests/kvm/include/s390x/processor.h | 8 ++++++++ tools/testing/selftests/kvm/include/x86_64/processor.h | 5 +++++ 2 files changed, 13 insertions(+) commit a4187c9bd16341b17d54cb3f87b8164945fa81ce Author: Sean Christopherson Date: Sat Feb 26 00:15:44 2022 +0000 KVM: selftests: Split out helper to allocate guest mem via memfd Extract the code for allocating guest memory via memfd out of vm_userspace_mem_region_add() and into a new helper, kvm_memfd_alloc(). A future selftest to populate a guest with the maximum amount of guest memory will abuse KVM's memslots to alias guest memory regions to a single memfd-backed host region, i.e. needs to back a guest with memfd memory without a 1:1 association between a memslot and a memfd instance. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20220226001546.360188-27-seanjc@google.com> Signed-off-by: Paolo Bonzini .../testing/selftests/kvm/include/kvm_util_base.h | 1 + tools/testing/selftests/kvm/lib/kvm_util.c | 42 ++++++++++++---------- 2 files changed, 25 insertions(+), 18 deletions(-) commit 3d7d6043f3c31bcfbed1f636035a2eab37117971 Author: Sean Christopherson Date: Sat Feb 26 00:15:43 2022 +0000 KVM: selftests: Move raw KVM_SET_USER_MEMORY_REGION helper to utils Move set_memory_region_test's KVM_SET_USER_MEMORY_REGION helper to KVM's utils so that it can be used by other tests. Provide a raw version as well as an assert-success version to reduce the amount of boilerplate code need for basic usage. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20220226001546.360188-26-seanjc@google.com> Signed-off-by: Paolo Bonzini .../testing/selftests/kvm/include/kvm_util_base.h | 4 +++ tools/testing/selftests/kvm/lib/kvm_util.c | 24 +++++++++++++++ .../testing/selftests/kvm/set_memory_region_test.c | 35 +++++----------------- 3 files changed, 36 insertions(+), 27 deletions(-) commit 396fd74d61343aaa4c30a7eb67132b7ef5762744 Author: Sean Christopherson Date: Sat Feb 26 00:15:42 2022 +0000 KVM: x86/mmu: WARN on any attempt to atomically update REMOVED SPTE Disallow calling tdp_mmu_set_spte_atomic() with a REMOVED "old" SPTE. This solves a conundrum introduced by commit 3255530ab191 ("KVM: x86/mmu: Automatically update iter->old_spte if cmpxchg fails"); if the helper doesn't update old_spte in the REMOVED case, then theoretically the caller could get stuck in an infinite loop as it will fail indefinitely on the REMOVED SPTE. E.g. until recently, clear_dirty_gfn_range() didn't check for a present SPTE and would have spun until getting rescheduled. In practice, only the page fault path should "create" a new SPTE, all other paths should only operate on existing, a.k.a. shadow present, SPTEs. Now that the page fault path pre-checks for a REMOVED SPTE in all cases, require all other paths to indirectly pre-check by verifying the target SPTE is a shadow-present SPTE. Note, this does not guarantee the actual SPTE isn't REMOVED, nor is that scenario disallowed. The invariant is only that the caller mustn't invoke tdp_mmu_set_spte_atomic() if the SPTE was REMOVED when last observed by the caller. Cc: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20220226001546.360188-25-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) commit 58298b068137f419de8bc839d54ceacaec788870 Author: Sean Christopherson Date: Sat Feb 26 00:15:41 2022 +0000 KVM: x86/mmu: Check for a REMOVED leaf SPTE before making the SPTE Explicitly check for a REMOVED leaf SPTE prior to attempting to map the final SPTE when handling a TDP MMU fault. Functionally, this is a nop as tdp_mmu_set_spte_atomic() will eventually detect the frozen SPTE. Pre-checking for a REMOVED SPTE is a minor optmization, but the real goal is to allow tdp_mmu_set_spte_atomic() to have an invariant that the "old" SPTE is never a REMOVED SPTE. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-24-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit efd995dae5eba57c5d28d6886a85298b390a4f07 Author: Paolo Bonzini Date: Fri Mar 4 11:43:13 2022 -0500 KVM: x86/mmu: Zap defunct roots via asynchronous worker Zap defunct roots, a.k.a. roots that have been invalidated after their last reference was initially dropped, asynchronously via the existing work queue instead of forcing the work upon the unfortunate task that happened to drop the last reference. If a vCPU task drops the last reference, the vCPU is effectively blocked by the host for the entire duration of the zap. If the root being zapped happens be fully populated with 4kb leaf SPTEs, e.g. due to dirty logging being active, the zap can take several hundred seconds. Unsurprisingly, most guests are unhappy if a vCPU disappears for hundreds of seconds. E.g. running a synthetic selftest that triggers a vCPU root zap with ~64tb of guest memory and 4kb SPTEs blocks the vCPU for 900+ seconds. Offloading the zap to a worker drops the block time to <100ms. There is an important nuance to this change. If the same work item was queued twice before the work function has run, it would only execute once and one reference would be leaked. Therefore, now that queueing and flushing items is not anymore protected by kvm->slots_lock, kvm_tdp_mmu_invalidate_all_roots() has to check root->role.invalid and skip already invalid roots. On the other hand, kvm_mmu_zap_all_fast() must return only after those skipped roots have been zapped as well. These two requirements can be satisfied only if _all_ places that change invalid to true now schedule the worker before releasing the mmu_lock. There are just two, kvm_tdp_mmu_put_root() and kvm_tdp_mmu_invalidate_all_roots(). Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-23-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) commit 1b6043e8e58468a7c3f2a2469b8834efe8bf5b0a Author: Sean Christopherson Date: Sat Feb 26 00:15:39 2022 +0000 KVM: x86/mmu: Zap roots in two passes to avoid inducing RCU stalls When zapping a TDP MMU root, perform the zap in two passes to avoid zapping an entire top-level SPTE while holding RCU, which can induce RCU stalls. In the first pass, zap SPTEs at PG_LEVEL_1G, and then zap top-level entries in the second pass. With 4-level paging, zapping a PGD that is fully populated with 4kb leaf SPTEs take up to ~7 or so seconds (time varies based on kernel config, number of (v)CPUs, etc...). With 5-level paging, that time can balloon well into hundreds of seconds. Before remote TLB flushes were omitted, the problem was even worse as waiting for all active vCPUs to respond to the IPI introduced significant overhead for VMs with large numbers of vCPUs. By zapping 1gb SPTEs (both shadow pages and hugepages) in the first pass, the amount of work that is done without dropping RCU protection is strictly bounded, with the worst case latency for a single operation being less than 100ms. Zapping at 1gb in the first pass is not arbitrary. First and foremost, KVM relies on being able to zap 1gb shadow pages in a single shot when when repacing a shadow page with a hugepage. Zapping a 1gb shadow page that is fully populated with 4kb dirty SPTEs also triggers the worst case latency due writing back the struct page accessed/dirty bits for each 4kb page, i.e. the two-pass approach is guaranteed to work so long as KVM can cleany zap a 1gb shadow page. rcu: INFO: rcu_sched self-detected stall on CPU rcu: 52-....: (20999 ticks this GP) idle=7be/1/0x4000000000000000 softirq=15759/15759 fqs=5058 (t=21016 jiffies g=66453 q=238577) NMI backtrace for cpu 52 Call Trace: ... mark_page_accessed+0x266/0x2f0 kvm_set_pfn_accessed+0x31/0x40 handle_removed_tdp_mmu_page+0x259/0x2e0 __handle_changed_spte+0x223/0x2c0 handle_removed_tdp_mmu_page+0x1c1/0x2e0 __handle_changed_spte+0x223/0x2c0 handle_removed_tdp_mmu_page+0x1c1/0x2e0 __handle_changed_spte+0x223/0x2c0 zap_gfn_range+0x141/0x3b0 kvm_tdp_mmu_zap_invalidated_roots+0xc8/0x130 kvm_mmu_zap_all_fast+0x121/0x190 kvm_mmu_invalidate_zap_pages_in_memslot+0xe/0x10 kvm_page_track_flush_slot+0x5c/0x80 kvm_arch_flush_shadow_memslot+0xe/0x10 kvm_set_memslot+0x172/0x4e0 __kvm_set_memory_region+0x337/0x590 kvm_vm_ioctl+0x49c/0xf80 Reported-by: David Matlack Cc: Ben Gardon Cc: Mingwei Zhang Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-22-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 51 ++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 17 deletions(-) commit 8351779ce65f0d54b7845a732c6141a9fe10dcaa Author: Paolo Bonzini Date: Thu Mar 3 01:50:21 2022 -0500 KVM: x86/mmu: Allow yielding when zapping GFNs for defunct TDP MMU root Allow yielding when zapping SPTEs after the last reference to a valid root is put. Because KVM must drop all SPTEs in response to relevant mmu_notifier events, mark defunct roots invalid and reset their refcount prior to zapping the root. Keeping the refcount elevated while the zap is in-progress ensures the root is reachable via mmu_notifier until the zap completes and the last reference to the invalid, defunct root is put. Allowing kvm_tdp_mmu_put_root() to yield fixes soft lockup issues if the root in being put has a massive paging structure, e.g. zapping a root that is backed entirely by 4kb pages for a guest with 32tb of memory can take hundreds of seconds to complete. watchdog: BUG: soft lockup - CPU#49 stuck for 485s! [max_guest_memor:52368] RIP: 0010:kvm_set_pfn_dirty+0x30/0x50 [kvm] __handle_changed_spte+0x1b2/0x2f0 [kvm] handle_removed_tdp_mmu_page+0x1a7/0x2b8 [kvm] __handle_changed_spte+0x1f4/0x2f0 [kvm] handle_removed_tdp_mmu_page+0x1a7/0x2b8 [kvm] __handle_changed_spte+0x1f4/0x2f0 [kvm] tdp_mmu_zap_root+0x307/0x4d0 [kvm] kvm_tdp_mmu_put_root+0x7c/0xc0 [kvm] kvm_mmu_free_roots+0x22d/0x350 [kvm] kvm_mmu_reset_context+0x20/0x60 [kvm] kvm_arch_vcpu_ioctl_set_sregs+0x5a/0xc0 [kvm] kvm_vcpu_ioctl+0x5bd/0x710 [kvm] __se_sys_ioctl+0x77/0xc0 __x64_sys_ioctl+0x1d/0x20 do_syscall_64+0x44/0xa0 entry_SYSCALL_64_after_hwframe+0x44/0xae KVM currently doesn't put a root from a non-preemptible context, so other than the mmu_notifier wrinkle, yielding when putting a root is safe. Yield-unfriendly iteration uses for_each_tdp_mmu_root(), which doesn't take a reference to each root (it requires mmu_lock be held for the entire duration of the walk). tdp_mmu_next_root() is used only by the yield-friendly iterator. tdp_mmu_zap_root_work() is explicitly yield friendly. kvm_mmu_free_roots() => mmu_free_root_page() is a much bigger fan-out, but is still yield-friendly in all call sites, as all callers can be traced back to some combination of vcpu_run(), kvm_destroy_vm(), and/or kvm_create_vm(). Signed-off-by: Sean Christopherson Message-Id: <20220226001546.360188-21-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 103 +++++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 41 deletions(-) commit 22b94c4b63ebf2cf976d6f4eba230105984a7eb6 Author: Paolo Bonzini Date: Wed Mar 2 12:02:07 2022 -0500 KVM: x86/mmu: Zap invalidated roots via asynchronous worker Use the system worker threads to zap the roots invalidated by the TDP MMU's "fast zap" mechanism, implemented by kvm_tdp_mmu_invalidate_all_roots(). At this point, apart from allowing some parallelism in the zapping of roots, the workqueue is a glorified linked list: work items are added and flushed entirely within a single kvm->slots_lock critical section. However, the workqueue fixes a latent issue where kvm_mmu_zap_all_invalidated_roots() assumes that it owns a reference to all invalid roots; therefore, no one can set the invalid bit outside kvm_mmu_zap_all_fast(). Putting the invalidated roots on a linked list... erm, on a workqueue ensures that tdp_mmu_zap_root_work() only puts back those extra references that kvm_mmu_zap_all_invalidated_roots() had gifted to it. Signed-off-by: Paolo Bonzini arch/x86/include/asm/kvm_host.h | 2 + arch/x86/kvm/mmu/mmu.c | 5 +- arch/x86/kvm/mmu/mmu_internal.h | 8 ++- arch/x86/kvm/mmu/tdp_mmu.c | 148 ++++++++++++++++++---------------------- 4 files changed, 76 insertions(+), 87 deletions(-) commit 64a6497017843fc23d4c18542bdd4cfcca7878c9 Author: Sergiu Moga Date: Fri Mar 4 18:11:59 2022 +0200 dt-bindings: rtc: at91: Add SAMA7G5 compatible strings list Add compatible strings list for SAMA7G5. Signed-off-by: Sergiu Moga Reviewed-by: Krzysztof Kozlowski Reviewed-by: Tudor Ambarus Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220304161159.147784-5-sergiu.moga@microchip.com Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml | 4 ++++ 1 file changed, 4 insertions(+) commit 5b05198b3108d5d287da8c457183855fb91ae4cc Author: Sergiu Moga Date: Fri Mar 4 18:11:58 2022 +0200 dt-bindings: rtc: convert at91sam9 bindings to json-schema Convert RTC binding for Atmel/Microchip SoCs to Device Tree Schema format. Signed-off-by: Sergiu Moga Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220304161159.147784-4-sergiu.moga@microchip.com .../devicetree/bindings/rtc/atmel,at91sam9-rtc.txt | 25 --------- .../bindings/rtc/atmel,at91sam9-rtc.yaml | 65 ++++++++++++++++++++++ 2 files changed, 65 insertions(+), 25 deletions(-) commit 608f7cf3f54415963ef49b70596153d806ebb0de Merge: d3d009847a11 69d6941949ea Author: Arnd Bergmann Date: Tue Mar 8 16:50:17 2022 +0100 Merge tag 'memory-controller-drv-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v5.18, part two 1. TI: Two fixes for TI EMIF driver for quite old error path issues (so for unlikely scenarios). 2. Renesas: Document RZ/V2L SoC in bindings. * tag 'memory-controller-drv-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: dt-bindings: memory: renesas,rpc-if: Document RZ/V2L SoC memory: emif: check the pointer temp in get_device_details() memory: emif: Add check for setup_interrupts Link: https://lore.kernel.org/r/20220307082552.55719-1-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit d3d009847a119db499094aca61bd8a9935bc94ef Merge: a2d266a8f1fc def8abbb1464 Author: Arnd Bergmann Date: Tue Mar 8 16:49:19 2022 +0100 Merge tag 'at91-soc-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/drivers AT91 SoC #2 for 5.18: - SAMA5D29 variant to the SAMA5D2 family in SoC driver. * tag 'at91-soc-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: add support in soc driver for new SAMA5D29 soc: add microchip polarfire soc system controller ARM: at91: Kconfig: select PM_OPP ARM: at91: PM: add cpu idle support for sama7g5 ARM: at91: ddr: fix typo to align with datasheet naming ARM: at91: ddr: align macro definitions ARM: at91: ddr: remove CONFIG_SOC_SAMA7 dependency Link: https://lore.kernel.org/r/20220304144216.23340-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 42cc353b54fd501732cb0003c65819cb82ccc495 Author: Anders Roxell Date: Tue Mar 8 13:19:33 2022 +0100 arm: multi_v5: enable configs for versatile Make it possible to boot a versatile machine in qemu. Boot command: /usr/bin/qemu-system-arm -cpu arm926 -machine versatilepb \ -nographic -nic none -m 256M -monitor none -no-reboot \ -kernel zImage -dtb versatile-pb.dtb \ -append "console=ttyAMA0,115200 rootwait root=/dev/vda" \ -drive armv5_rootfs.ext4,if=none,format=raw,id=hd0 \ -device virtio-blk-pci,drive=hd0 When doing build and boot testing, it makes more sense to enable arch vesatile, serial amba_pl011 and virtio (mmio|blk|pci) to multi_v5_defconfig to make that boot out of the box, with a modern virtio (mmio|blk|pci) driver. Using the above commandline. Another way to build and boot would be to use tuxmake/tuxrun. Tuxmake [1] builds the kernel, and Tuxrun [2] boots the kernel in qemu. Both projects uses podman to do the build/tests inside. This makes both project a good tool to use when finding a regression that you would like someone else to reproduce with the exact same setup. tuxmake --runtime podman --target-arch arm \ --toolchain gcc-11 --kconfig multi_v5_defconfig tuxrun --tuxmake ~/.cache/tuxmake/builds/3072 --device qemu-armv5 [1] https://tuxmake.org/ [2] https://tuxrun.org/ Signed-off-by: Anders Roxell Link: https://lore.kernel.org/r/20220308121933.3967868-1-anders.roxell@linaro.org' Signed-off-by: Arnd Bergmann arch/arm/configs/multi_v5_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) commit fd2307ee94c370be6f1f6e51feab1d0d57f10b46 Merge: b3b44f502450 d20e1df5c38f Author: Arnd Bergmann Date: Tue Mar 8 16:47:00 2022 +0100 Merge tag 'arm-soc/for-5.18/defconfig-arm64' of https://github.com/Broadcom/stblinux into arm/defconfig This pull request contains Broadcom ARM64-based defconfig updates for 5.18, please pull the following: - Florian enables Broadcom STB drivers for NAND, SATA, Ethernet switch, USB PHY and host controllers, watchdog, PWM and Ethernet controller * tag 'arm-soc/for-5.18/defconfig-arm64' of https://github.com/Broadcom/stblinux: arm64: defconfig: Enable additional Broadcom STB drivers Signed-off-by: Arnd Bergmann commit b3b44f502450d64c23f0d011480f62d4fd175cd4 Author: Michael Walle Date: Fri Mar 4 21:21:24 2022 +0100 arm64: defconfig: enable Layerscape SFP driver Enable the driver for the Layerscape SFP (Security Fuse Processor) found on most Layerscape SoCs. For example, a per-device unique serial number is stored in the fuses. Signed-off-by: Michael Walle Signed-off-by: Arnd Bergmann arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) commit 9a5872bab1c728f8e1b63a373aa3d34a0da8382c Merge: c807a335d3b1 5f5399843c0e Author: Arnd Bergmann Date: Tue Mar 8 16:42:53 2022 +0100 Merge tag 'at91-defconfig-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/defconfig AT91: defconfig #2 for 5.18: - Add EIC, remove DMATEST to sama7_defconfig * tag 'at91-defconfig-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: configs: at91: sama7: Unselect CONFIG_DMATEST ARM: configs: at91: add eic Link: https://lore.kernel.org/r/20220304144746.23779-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 443ebdd68b443ea0798c883e8aabf10d75268e92 Author: Slawomir Mrozowicz Date: Tue Mar 1 11:40:10 2022 +0000 ixgbevf: add disable link state Add possibility to disable link state if it is administratively disabled in PF. It is part of the general functionality that allows the PF driver to control the state of the virtual link VF devices. Signed-off-by: Slawomir Mrozowicz Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 2 ++ drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 11 +++++- drivers/net/ethernet/intel/ixgbevf/mbx.h | 2 ++ drivers/net/ethernet/intel/ixgbevf/vf.c | 42 +++++++++++++++++++++++ drivers/net/ethernet/intel/ixgbevf/vf.h | 1 + 5 files changed, 57 insertions(+), 1 deletion(-) commit 008ca35f6e87be1d60b6af3d1ae247c6d5c2531d Author: Slawomir Mrozowicz Date: Tue Mar 1 11:40:09 2022 +0000 ixgbe: add improvement for MDD response functionality The 82599 PF driver disable VF driver after a special MDD event occurs. Adds the option for administrators to control whether VFs are automatically disabled after several MDD events. The automatically disabling is now the default mode for 82599 PF driver, as it is more reliable. This addresses CVE-2021-33061. Signed-off-by: Slawomir Mrozowicz Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ixgbe/ixgbe.h | 4 ++++ drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 21 ++++++++++++++++++ drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 28 +++++++++++++++++++++++- 3 files changed, 52 insertions(+), 1 deletion(-) commit 366fd1000995d4cf64e1a61a0d78a051550b9841 Author: Slawomir Mrozowicz Date: Tue Mar 1 11:40:08 2022 +0000 ixgbe: add the ability for the PF to disable VF link state Add support for ndo_set_vf_link_state the Network Device Option that allows the PF driver to control the virtual link state of the VF devices. Without this change a VF cannot be disabled/enabled by the administrator. In the implementation the auto state takes over PF link state to VF link setting, the enable state is not supported, the disable state shut off the VF link regardless of the PF setting. Signed-off-by: Slawomir Mrozowicz Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ixgbe/ixgbe.h | 2 + drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 11 +- drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h | 2 + drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 207 ++++++++++++++++++++----- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h | 4 +- 5 files changed, 182 insertions(+), 44 deletions(-) commit d713b8d2aa03454e676fbf453b1231c43033c33d Author: Dan Carpenter Date: Mon Mar 7 17:18:32 2022 +0300 platform/x86: amd-pmc: uninitialized variable in amd_pmc_s2d_init() The "size" variable can be uninitialized if amd_pmc_send_cmd() fails. Fixes: 3d7d407dfb05 ("platform/x86: amd-pmc: Add support for AMD Spill to DRAM STB feature") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220307141832.GA19660@kili Signed-off-by: Hans de Goede drivers/platform/x86/amd-pmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit f2a6c7e7474001842a4adaf042d12206c27fc391 Author: Dan Carpenter Date: Fri Mar 4 16:19:25 2022 +0300 platform/x86: intel-uncore-freq: fix uncore_freq_common_init() error codes Currently the uncore_freq_common_init() return one on success and zero on failure. There is only one caller and it has a "forgot to set the error code" bug. Change uncore_freq_common_init() to return negative error codes which makes the code simpler and avoids this kind of bug in the future. Fixes: dbce412a7733 ("platform/x86/intel-uncore-freq: Split common and enumeration part") Signed-off-by: Dan Carpenter Acked-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220304131925.GG28739@kili Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c | 2 +- drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit c91a5b1c221a58d008485cf7d02ccce73108b119 Author: Jia-Ju Bai Date: Wed Mar 2 18:24:21 2022 -0800 platform/x86: huawei-wmi: check the return value of device_create_file() The function device_create_file() in huawei_wmi_battery_add() can fail, so its return value should be checked. Fixes: 355a070b09ab ("platform/x86: huawei-wmi: Add battery charging thresholds") Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Link: https://lore.kernel.org/r/20220303022421.313-1-baijiaju1990@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/huawei-wmi.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit 7b4fc7c6f9a3d89ce6cdb616a0fe9c18f536fcbf Merge: dd5d787f481d 66435063c5f3 Author: Arnd Bergmann Date: Tue Mar 8 16:29:32 2022 +0100 Merge tag 'arm-soc/for-5.18/devicetree-arm64' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom ARM64-based SoCs Device Tree updates for 5.18, please pull the following: - Krzysztof aligns the PL330 DMA controller node name to the schema - Rafal corrects the TWD (Timer/Watchdog) block, adds the watchdog node, I2C controller node and the pinctrl node for the 4908 SoC - Kuldeep fixes the Northstar 2 SPI properties as well as the PL022 SPI controller clock names - Frank fixes the SATA node names to conform to the AHCI controller schema * tag 'arm-soc/for-5.18/devicetree-arm64' of https://github.com/Broadcom/stblinux: arm64: dts: stingray: Fix spi clock name arm64: dts: ns2: Fix spi clock name arm64: dts: broadcom: Fix sata nodename arm64: dts: ns2: Fix spi-cpol and spi-cpha property arm64: dts: broadcom: bcm4908: add I2C block arm64: dts: broadcom: bcm4908: add watchdog block arm64: dts: broadcom: bcm4908: add pinctrl binding arm64: dts: broadcom: bcm4908: use proper TWD binding arm64: dts: broadcom: align pl330 node name with dtschema Link: https://lore.kernel.org/r/20220307194817.3754107-3-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit dd5d787f481d999e0f76a82b112e4605fe214541 Merge: e8f022f9ecb4 c8442f0fb09c Author: Arnd Bergmann Date: Tue Mar 8 16:25:36 2022 +0100 Merge tag 'arm-soc/for-5.18/devicetree' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom ARM-based SoCs Device Tree changes for 5.18, please pull the following: - Arinc defines the switch ports of the RTL8365MB switch on the Asus RT-AC88U - Richard provides cache information for the BCM2835/36/37 and BCM2711 SoCs such that tools like "lscpu -C" can report it when supported - Stefan adds support for the Raspberry Pi Zero 2 W (wireless) - Matthew defines the MAC address NVMEM cells for the Cisco Meraki MX64/MX65 devices, he also fixes the LED for these platforms. - Rafal adds the MAC addres NVMEM cell for the Luxul XWR-3150 * tag 'arm-soc/for-5.18/devicetree' of https://github.com/Broadcom/stblinux: ARM: dts: BCM5301X: Add Ethernet MAC address to Luxul XWR-3150 ARM: dts: NSP: MX6X: correct LED function types ARM: dts: NSP: MX6X: get mac-address from eeprom arm64: dts: broadcom: Add reference to RPi Zero 2 W ARM: dts: Add Raspberry Pi Zero 2 W dt-bindings: arm: bcm2835: Add Raspberry Pi Zero 2 W ARM: dts: bcm2835/6: Add the missing L1/L2 cache information ARM: dts: bcm2711: Add the missing L1/L2 cache information ARM: dts: bcm2837: Add the missing L1/L2 cache information ARM: dts: BCM5301X: define RTL8365MB switch on Asus RT-AC88U Link: https://lore.kernel.org/r/20220307194817.3754107-2-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit e8f022f9ecb4bb77fb9ab7afc7af03093ee83658 Merge: 1a38f961c4f1 ad3c72b0c6b9 Author: Arnd Bergmann Date: Tue Mar 8 16:24:49 2022 +0100 Merge tag 'dt64-cleanup-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Minor cleanup of ARM64 DTS for v5.18 The DT schema expects DMA controller nodes to follow certain node naming and having dma-cells property. Adjust the DTS files to pass DT schema checks. * tag 'dt64-cleanup-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: lg: align pl330 node name with dtschema arm64: dts: lg: add dma-cells to pl330 node arm64: dts: juno: align pl330 node name with dtschema Link: https://lore.kernel.org/r/20220307173614.157884-1-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit 1a38f961c4f1d8c6bebdeea3c629bf0ad08e3130 Merge: 756f4ae14562 92499dec3aa9 Author: Arnd Bergmann Date: Tue Mar 8 16:22:27 2022 +0100 Merge tag 'at91-dt-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/dt AT91 DT #2 for 5.18: - Align one sam9x60ek regulator with reality at vdd_1v15 - Clean sama7g5 i2c nodes - Add EIC and NAND nodes to sama7g5 * tag 'at91-dt-5.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sama7g5: Add NAND support ARM: dts: at91: sama7g5: add eic node ARM: dts: at91: sama7g5: Remove unused properties in i2c nodes ARM: dts: at91: sam9x60ek: modify vdd_1v5 regulator to vdd_1v15 Link: https://lore.kernel.org/r/20220304160036.27392-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 7f434dff76215af00c26ba6449eaa4738fe9e2ab Author: K Prateek Nayak Date: Fri Feb 18 21:57:43 2022 +0530 sched/topology: Remove redundant variable and fix incorrect type in build_sched_domains While investigating the sparse warning reported by the LKP bot [1], observed that we have a redundant variable "top" in the function build_sched_domains that was introduced in the recent commit e496132ebedd ("sched/fair: Adjust the allowed NUMA imbalance when SD_NUMA spans multiple LLCs") The existing variable "sd" suffices which allows us to remove the redundant variable "top" while annotating the other variable "top_p" with the "__rcu" annotation to silence the sparse warning. [1] https://lore.kernel.org/lkml/202202170853.9vofgC3O-lkp@intel.com/ Fixes: e496132ebedd ("sched/fair: Adjust the allowed NUMA imbalance when SD_NUMA spans multiple LLCs") Reported-by: kernel test robot Signed-off-by: K Prateek Nayak Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20220218162743.1134-1-kprateek.nayak@amd.com kernel/sched/topology.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 821aecd09e5ad2f8d4c3d8195333d272b392f7d3 Author: Dietmar Eggemann Date: Wed Mar 2 19:34:33 2022 +0100 sched/deadline,rt: Remove unused parameter from pick_next_[rt|dl]_entity() The `struct rq *rq` parameter isn't used. Remove it. Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20220302183433.333029-7-dietmar.eggemann@arm.com kernel/sched/deadline.c | 5 ++--- kernel/sched/rt.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) commit 71d29747b0e26f36a50e6a65dc0191ca742b9222 Author: Dietmar Eggemann Date: Wed Mar 2 19:34:32 2022 +0100 sched/deadline,rt: Remove unused functions for !CONFIG_SMP The need_pull_[rt|dl]_task() and pull_[rt|dl]_task() functions are not used on a !CONFIG_SMP system. Remove them. Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20220302183433.333029-6-dietmar.eggemann@arm.com kernel/sched/deadline.c | 9 --------- kernel/sched/rt.c | 11 ----------- 2 files changed, 20 deletions(-) commit f4478e7c855d2d6b2fde5126ebcca2cb5b34ee36 Author: Dietmar Eggemann Date: Wed Mar 2 19:34:31 2022 +0100 sched/deadline: Use __node_2_[pdl|dle]() and rb_first_cached() consistently Deploy __node_2_pdl(node), __node_2_dle(node) and rb_first_cached() consistently throughout the sched class source file which makes the code at least easier to read. Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20220302183433.333029-5-dietmar.eggemann@arm.com kernel/sched/deadline.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) commit 772b6539fdda31462cc08368e78df60b31a58bab Author: Dietmar Eggemann Date: Wed Mar 2 19:34:30 2022 +0100 sched/deadline: Merge dl_task_can_attach() and dl_cpu_busy() Both functions are doing almost the same, that is checking if admission control is still respected. With exclusive cpusets, dl_task_can_attach() checks if the destination cpuset (i.e. its root domain) has enough CPU capacity to accommodate the task. dl_cpu_busy() checks if there is enough CPU capacity in the cpuset in case the CPU is hot-plugged out. dl_task_can_attach() is used to check if a task can be admitted while dl_cpu_busy() is used to check if a CPU can be hotplugged out. Make dl_cpu_busy() able to deal with a task and use it instead of dl_task_can_attach() in task_can_attach(). Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20220302183433.333029-4-dietmar.eggemann@arm.com kernel/sched/core.c | 13 +++++++++---- kernel/sched/deadline.c | 52 +++++++++++++------------------------------------ kernel/sched/sched.h | 3 +-- 3 files changed, 24 insertions(+), 44 deletions(-) commit f1304ecbef3c9f4aec119ce2a07335d3a0bc55a6 Author: Dietmar Eggemann Date: Wed Mar 2 19:34:29 2022 +0100 sched/deadline: Move bandwidth mgmt and reclaim functions into sched class source file Move the deadline bandwidth management (admission control) functions __dl_add(), __dl_sub() and __dl_overflow() as well as the bandwidth reclaim function __dl_update() from private task scheduler header file to the deadline sched class source file. The functions are only used internally so they don't have to be exported. Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20220302183433.333029-3-dietmar.eggemann@arm.com kernel/sched/deadline.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ kernel/sched/sched.h | 49 ------------------------------------------------- 2 files changed, 44 insertions(+), 49 deletions(-) commit eb77cf1c151c4a1c2147cbf24d84bcf0ba504e7c Author: Dietmar Eggemann Date: Wed Mar 2 19:34:28 2022 +0100 sched/deadline: Remove unused def_dl_bandwidth Since commit 1724813d9f2c ("sched/deadline: Remove the sysctl_sched_dl knobs") the default deadline bandwidth control structure has no purpose. Remove it. Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20220302183433.333029-2-dietmar.eggemann@arm.com kernel/sched/core.c | 1 - kernel/sched/deadline.c | 7 ------- kernel/sched/sched.h | 1 - 3 files changed, 9 deletions(-) commit 756f4ae145625318d2469f8bb54bdbe5b3d2433a Merge: 7d8e1702b572 3a14f0e61408 Author: Arnd Bergmann Date: Tue Mar 8 16:06:28 2022 +0100 Merge tag 'zynqmp-dt-for-v5.18' of https://github.com/Xilinx/linux-xlnx into arm/dt arm64: dts: ZynqMP DT changes for v5.18 - Dropping #stream-id-cells - Add missing dma-cells and change dma node names * tag 'zynqmp-dt-for-v5.18' of https://github.com/Xilinx/linux-xlnx: arm64: zynqmp: Rename dma to dma-controller arm64: zynqmp: Add missing #dma-cells property arm64: xilinx: dts: drop legacy property #stream-id-cells Link: https://lore.kernel.org/r/19464dc6-eca9-f9a7-8aba-43af094d7c37@xilinx.com Signed-off-by: Arnd Bergmann commit d23a8720327d33616f584d76c80824bfa4699be6 Author: Felix Maurer Date: Thu Mar 3 12:15:26 2022 +0100 selftests/bpf: Make test_lwt_ip_encap more stable and faster In test_lwt_ip_encap, the ingress IPv6 encap test failed from time to time. The failure occured when an IPv4 ping through the IPv6 GRE encapsulation did not receive a reply within the timeout. The IPv4 ping and the IPv6 ping in the test used different timeouts (1 sec for IPv4 and 6 sec for IPv6), probably taking into account that IPv6 might need longer to successfully complete. However, when IPv4 pings (with the short timeout) are encapsulated into the IPv6 tunnel, the delays of IPv6 apply. The actual reason for the long delays with IPv6 was that the IPv6 neighbor discovery sometimes did not complete in time. This was caused by the outgoing interface only having a tentative link local address, i.e., not having completed DAD for that lladdr. The ND was successfully retried after 1 sec but that was too late for the ping timeout. The IPv6 addresses for the test were already added with nodad. However, for the lladdrs, DAD was still performed. We now disable DAD in the test netns completely and just assume that the two lladdrs on each veth pair do not collide. This removes all the delays for IPv6 traffic in the test. Without the delays, we can now also reduce the delay of the IPv6 ping to 1 sec. This makes the whole test complete faster because we don't need to wait for the excessive timeout for each IPv6 ping that is supposed to fail. Fixes: 0fde56e4385b0 ("selftests: bpf: add test_lwt_ip_encap selftest") Signed-off-by: Felix Maurer Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/4987d549d48b4e316cd5b3936de69c8d4bc75a4f.1646305899.git.fmaurer@redhat.com tools/testing/selftests/bpf/test_lwt_ip_encap.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit 4fecb1e93e4914fc0bc1fb467ca79741f9f94abb Author: Hans de Goede Date: Wed Feb 23 14:50:32 2022 +0100 ACPI / x86: Add skip i2c clients quirk for Lenovo Yoga Tablet 1050F/L The Yoga Tablet 1050F/L is a x86 ACPI tablet which ships with Android x86 as factory OS. Its DSDT contains a bunch of I2C devices which are not actually there, causing various resource conflicts (the Android x86 kernel fork ignores I2C devices described in the DSDT). Add a ACPI_QUIRK_SKIP_I2C_CLIENTS for the Nextbook Ares 8 to the acpi_quirk_skip_dmi_ids table to woraround this. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki drivers/acpi/x86/utils.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit f38312c9b569322edf4baae467568206fe46d57b Author: Hans de Goede Date: Wed Feb 23 14:50:31 2022 +0100 ACPI / x86: Add skip i2c clients quirk for Nextbook Ares 8 The Nextbook Ares 8 is a x86 ACPI tablet which ships with Android x86 as factory OS. Its DSDT contains a bunch of I2C devices which are not actually there, causing various resource conflicts (the Android x86 kernel fork ignores I2C devices described in the DSDT). Add a ACPI_QUIRK_SKIP_I2C_CLIENTS for the Nextbook Ares 8 to the acpi_quirk_skip_dmi_ids table to woraround this. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki drivers/acpi/x86/utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 8e842f02af7e2f6225d52d78cd25b465a98d344b Author: Claudiu Beznea Date: Thu Feb 3 13:02:02 2022 +0200 clk: at91: clk-master: remove dead code Commit facb87ad7560 ("clk: at91: sama7g5: remove prescaler part of master clock") removed the master clock's prescaler from clock tree of SAMA7G5 as it has been discovered that there is a hardware bug when trying to change it at run-time (bug is described in description of commit facb87ad7560 ("clk: at91: sama7g5: remove prescaler part of master clock")). This was previously changed at CPUFreq driver request. Thus, with commit facb87ad7560 ("clk: at91: sama7g5: remove prescaler part of master clock") there is no need of code that handles run-time changes of master clock's prescaler, thus remove this code. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220203110202.18329-1-claudiu.beznea@microchip.com drivers/clk/at91/at91rm9200.c | 3 +- drivers/clk/at91/at91sam9260.c | 3 +- drivers/clk/at91/at91sam9g45.c | 3 +- drivers/clk/at91/at91sam9n12.c | 3 +- drivers/clk/at91/at91sam9rl.c | 3 +- drivers/clk/at91/at91sam9x5.c | 3 +- drivers/clk/at91/clk-master.c | 117 +++-------------------------------------- drivers/clk/at91/dt-compat.c | 3 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sam9x60.c | 3 +- drivers/clk/at91/sama5d2.c | 3 +- drivers/clk/at91/sama5d3.c | 3 +- drivers/clk/at91/sama5d4.c | 3 +- 13 files changed, 18 insertions(+), 134 deletions(-) commit 44e9a741cad824f45112b79c21d88c201d5aec13 Author: Shung-Hsi Yu Date: Mon Mar 7 13:29:18 2022 +0800 bpf: Determine buf_info inside check_buffer_access() Instead of determining buf_info string in the caller of check_buffer_access(), we can determine whether the register type is read-only through type_is_rdonly_mem() helper inside check_buffer_access() and construct buf_info, making the code slightly cleaner. Signed-off-by: Shung-Hsi Yu Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/YiWYLnAkEZXBP/gH@syu-laptop kernel/bpf/verifier.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) commit 1a944729d8635fa59638f24e8727d5ccaa0c8c19 Author: Codrin Ciubotariu Date: Fri Mar 4 20:26:16 2022 +0200 clk: at91: sama7g5: fix parents of PDMCs' GCLK Audio PLL can be used as parent by the GCLKs of PDMCs. Fixes: cb783bbbcf54 ("clk: at91: sama7g5: add clock support for sama7g5") Signed-off-by: Codrin Ciubotariu Reviewed-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220304182616.1920392-1-codrin.ciubotariu@microchip.com drivers/clk/at91/sama7g5.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit bb95dfb9e2dfbe6b3f5eb5e8a20e0259dadbe906 Author: Sean Christopherson Date: Sat Feb 26 00:15:37 2022 +0000 KVM: x86/mmu: Defer TLB flush to caller when freeing TDP MMU shadow pages Defer TLB flushes to the caller when freeing TDP MMU shadow pages instead of immediately flushing. Because the shadow pages are freed in an RCU callback, so long as at least one CPU holds RCU, all CPUs are protected. For vCPUs running in the guest, i.e. consuming TLB entries, KVM only needs to ensure the caller services the pending TLB flush before dropping its RCU protections. I.e. use the caller's RCU as a proxy for all vCPUs running in the guest. Deferring the flushes allows batching flushes, e.g. when installing a 1gb hugepage and zapping a pile of SPs. And when zapping an entire root, deferring flushes allows skipping the flush entirely (because flushes are not needed in that case). Avoiding flushes when zapping an entire root is especially important as synchronizing with other CPUs via IPI after zapping every shadow page can cause significant performance issues for large VMs. The issue is exacerbated by KVM zapping entire top-level entries without dropping RCU protection, which can lead to RCU stalls even when zapping roots backing relatively "small" amounts of guest memory, e.g. 2tb. Removing the IPI bottleneck largely mitigates the RCU issues, though it's likely still a problem for 5-level paging. A future patch will further address the problem by zapping roots in multiple passes to avoid holding RCU for an extended duration. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson Message-Id: <20220226001546.360188-20-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 13 +++++++++++++ arch/x86/kvm/mmu/tdp_iter.h | 7 +++---- arch/x86/kvm/mmu/tdp_mmu.c | 20 ++++++++++---------- 3 files changed, 26 insertions(+), 14 deletions(-) commit bd29677952fa96bf1f1fc31203aaad628a32bdb6 Author: Sean Christopherson Date: Sat Feb 26 00:15:36 2022 +0000 KVM: x86/mmu: Do remote TLB flush before dropping RCU in TDP MMU resched When yielding in the TDP MMU iterator, service any pending TLB flush before dropping RCU protections in anticipation of using the caller's RCU "lock" as a proxy for vCPUs in the guest. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-19-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit cf3e26427c08ad9015956293ab389004ac6a338e Author: Sean Christopherson Date: Sat Feb 26 00:15:35 2022 +0000 KVM: x86/mmu: Zap only TDP MMU leafs in kvm_zap_gfn_range() Zap only leaf SPTEs in the TDP MMU's zap_gfn_range(), and rename various functions accordingly. When removing mappings for functional correctness (except for the stupid VFIO GPU passthrough memslots bug), zapping the leaf SPTEs is sufficient as the paging structures themselves do not point at guest memory and do not directly impact the final translation (in the TDP MMU). Note, this aligns the TDP MMU with the legacy/full MMU, which zaps only the rmaps, a.k.a. leaf SPTEs, in kvm_zap_gfn_range() and kvm_unmap_gfn_range(). Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-18-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 4 ++-- arch/x86/kvm/mmu/tdp_mmu.c | 41 +++++++++++------------------------------ arch/x86/kvm/mmu/tdp_mmu.h | 8 +------- 3 files changed, 14 insertions(+), 39 deletions(-) commit acbda82a81c716ff5df4450d997340a4fe5650c4 Author: Sean Christopherson Date: Sat Feb 26 00:15:34 2022 +0000 KVM: x86/mmu: Require mmu_lock be held for write to zap TDP MMU range Now that all callers of zap_gfn_range() hold mmu_lock for write, drop support for zapping with mmu_lock held for read. That all callers hold mmu_lock for write isn't a random coincidence; now that the paths that need to zap _everything_ have their own path, the only callers left are those that need to zap for functional correctness. And when zapping is required for functional correctness, mmu_lock must be held for write, otherwise the caller has no guarantees about the state of the TDP MMU page tables after it has run, e.g. the SPTE(s) it zapped can be immediately replaced by a vCPU faulting in a page. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-17-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) commit e2b5b21d3a815b7d88fc4c90e9ccc42ea9bac4f0 Author: Sean Christopherson Date: Sat Feb 26 00:15:33 2022 +0000 KVM: x86/mmu: Add dedicated helper to zap TDP MMU root shadow page Add a dedicated helper for zapping a TDP MMU root, and use it in the three flows that do "zap_all" and intentionally do not do a TLB flush if SPTEs are zapped (zapping an entire root is safe if and only if it cannot be in use by any vCPU). Because a TLB flush is never required, unconditionally pass "false" to tdp_mmu_iter_cond_resched() when potentially yielding. Opportunistically document why KVM must not yield when zapping roots that are being zapped by kvm_tdp_mmu_put_root(), i.e. roots whose refcount has reached zero, and further harden the flow to detect improper KVM behavior with respect to roots that are supposed to be unreachable. In addition to hardening zapping of roots, isolating zapping of roots will allow future simplification of zap_gfn_range() by having it zap only leaf SPTEs, and by removing its tricky "zap all" heuristic. By having all paths that truly need to free _all_ SPs flow through the dedicated root zapper, the generic zapper can be freed of those concerns. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-16-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 98 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 82 insertions(+), 16 deletions(-) commit 77c8cd6b85af8840878063eb2df39780e808f74b Author: Sean Christopherson Date: Sat Feb 26 00:15:32 2022 +0000 KVM: x86/mmu: Skip remote TLB flush when zapping all of TDP MMU Don't flush the TLBs when zapping all TDP MMU pages, as the only time KVM uses the slow version of "zap everything" is when the VM is being destroyed or the owning mm has exited. In either case, KVM_RUN is unreachable for the VM, i.e. the guest TLB entries cannot be consumed. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-15-seanjc@google.com> Reviewed-by: Mingwei Zhang Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit c10743a1824b9db449eb631745ed6f2d3cdf9762 Author: Sean Christopherson Date: Sat Feb 26 00:15:31 2022 +0000 KVM: x86/mmu: Zap only the target TDP MMU shadow page in NX recovery When recovering a potential hugepage that was shattered for the iTLB multihit workaround, precisely zap only the target page instead of iterating over the TDP MMU to find the SP that was passed in. This will allow future simplification of zap_gfn_range() by having it zap only leaf SPTEs. Signed-off-by: Sean Christopherson Message-Id: <20220226001546.360188-14-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu_internal.h | 7 ++++++- arch/x86/kvm/mmu/tdp_iter.h | 2 -- arch/x86/kvm/mmu/tdp_mmu.c | 36 ++++++++++++++++++++++++++++++++---- arch/x86/kvm/mmu/tdp_mmu.h | 18 +----------------- 4 files changed, 39 insertions(+), 24 deletions(-) commit 626808d137b72ae35878d7b7832cd192bd533fba Author: Sean Christopherson Date: Sat Feb 26 00:15:30 2022 +0000 KVM: x86/mmu: Refactor low-level TDP MMU set SPTE helper to take raw values Refactor __tdp_mmu_set_spte() to work with raw values instead of a tdp_iter objects so that a future patch can modify SPTEs without doing a walk, and without having to synthesize a tdp_iter. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-13-seanjc@google.com> Reviewed-by: Mingwei Zhang Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 51 ++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 20 deletions(-) commit 966da62adaf1792c56fe909fc78f3833208ef5ae Author: Sean Christopherson Date: Sat Feb 26 00:15:29 2022 +0000 KVM: x86/mmu: WARN if old _or_ new SPTE is REMOVED in non-atomic path WARN if the new_spte being set by __tdp_mmu_set_spte() is a REMOVED_SPTE, which is called out by the comment as being disallowed but not actually checked. Keep the WARN on the old_spte as well, because overwriting a REMOVED_SPTE in the non-atomic path is also disallowed (as evidence by lack of splats with the existing WARN). Fixes: 08f07c800e9d ("KVM: x86/mmu: Flush TLBs after zap in TDP MMU PF handler") Cc: Ben Gardon Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-12-seanjc@google.com> Reviewed-by: Mingwei Zhang Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 0e587aa7335588ac5e12ef707f7979ff91b11751 Author: Sean Christopherson Date: Sat Feb 26 00:15:28 2022 +0000 KVM: x86/mmu: Add helpers to read/write TDP MMU SPTEs and document RCU Add helpers to read and write TDP MMU SPTEs instead of open coding rcu_dereference() all over the place, and to provide a convenient location to document why KVM doesn't exempt holding mmu_lock for write from having to hold RCU (and any future changes to the rules). No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-11-seanjc@google.com> Reviewed-by: Mingwei Zhang Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_iter.c | 6 +++--- arch/x86/kvm/mmu/tdp_iter.h | 16 ++++++++++++++++ arch/x86/kvm/mmu/tdp_mmu.c | 6 +++--- 3 files changed, 22 insertions(+), 6 deletions(-) commit a151aceca1e46be1defdaceea7c28108fa0ad022 Author: Sean Christopherson Date: Sat Feb 26 00:15:27 2022 +0000 KVM: x86/mmu: Drop RCU after processing each root in MMU notifier hooks Drop RCU protection after processing each root when handling MMU notifier hooks that aren't the "unmap" path, i.e. aren't zapping. Temporarily drop RCU to let RCU do its thing between roots, and to make it clear that there's no special behavior that relies on holding RCU across all roots. Currently, the RCU protection is completely superficial, it's necessary only to make rcu_dereference() of SPTE pointers happy. A future patch will rely on holding RCU as a proxy for vCPUs in the guest, e.g. to ensure shadow pages aren't freed before all vCPUs do a TLB flush (or rather, acknowledge the need for a flush), but in that case RCU needs to be held until the flush is complete if and only if the flush is needed because a shadow page may have been removed. And except for the "unmap" path, MMU notifier events cannot remove SPs (don't toggle PRESENT bit, and can't change the PFN for a SP). Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-10-seanjc@google.com> Reviewed-by: Mingwei Zhang Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 93fa50f644e0aea735bd21e9f86f95ad6c7cf40e Author: Sean Christopherson Date: Sat Feb 26 00:15:26 2022 +0000 KVM: x86/mmu: Batch TLB flushes from TDP MMU for MMU notifier change_spte Batch TLB flushes (with other MMUs) when handling ->change_spte() notifications in the TDP MMU. The MMU notifier path in question doesn't allow yielding and correcty flushes before dropping mmu_lock. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-9-seanjc@google.com> Reviewed-by: Mingwei Zhang Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit c8e5a0d0e9bcc67b095e44c8f4420d4ed08ff06a Author: Sean Christopherson Date: Sat Feb 26 00:15:25 2022 +0000 KVM: x86/mmu: Check for !leaf=>leaf, not PFN change, in TDP MMU SP removal Look for a !leaf=>leaf conversion instead of a PFN change when checking if a SPTE change removed a TDP MMU shadow page. Convert the PFN check into a WARN, as KVM should never change the PFN of a shadow page (except when its being zapped or replaced). From a purely theoretical perspective, it's not illegal to replace a SP with a hugepage pointing at the same PFN. In practice, it's impossible as that would require mapping guest memory overtop a kernel-allocated SP. Either way, the check is odd. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-8-seanjc@google.com> Reviewed-by: Mingwei Zhang Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 614f6970aa70242a3f8a8051b01244c029f77b2a Author: Paolo Bonzini Date: Wed Mar 2 08:51:05 2022 -0500 KVM: x86/mmu: do not allow readers to acquire references to invalid roots Remove the "shared" argument of for_each_tdp_mmu_root_yield_safe, thus ensuring that readers do not ever acquire a reference to an invalid root. After this patch, all readers except kvm_tdp_mmu_zap_invalidated_roots() treat refcount=0/valid, refcount=0/invalid and refcount=1/invalid in exactly the same way. kvm_tdp_mmu_zap_invalidated_roots() is different but it also does not acquire a reference to the invalid root, and it cannot see refcount=0/invalid because it is guaranteed to run after kvm_tdp_mmu_invalidate_all_roots(). Opportunistically add a lockdep assertion to the yield-safe iterator. Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 7c554d8e51a9cf5c0a142b4af825d96da67c57fa Author: Paolo Bonzini Date: Wed Mar 2 08:44:22 2022 -0500 KVM: x86/mmu: only perform eager page splitting on valid roots Eager page splitting is an optimization; it does not have to be performed on invalid roots. It is also the only case in which a reader might acquire a reference to an invalid root, so after this change we know that readers will skip both dying and invalid roots. Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 226b8c8f85e4246f31947be1c11bf36208fe9052 Author: Sean Christopherson Date: Sat Feb 26 00:15:24 2022 +0000 KVM: x86/mmu: Require mmu_lock be held for write in unyielding root iter Assert that mmu_lock is held for write by users of the yield-unfriendly TDP iterator. The nature of a shared walk means that the caller needs to play nice with other tasks modifying the page tables, which is more or less the same thing as playing nice with yielding. Theoretically, KVM could gain a flow where it could legitimately take mmu_lock for read in a non-preemptible context, but that's highly unlikely and any such case should be viewed with a fair amount of scrutiny. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-7-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) commit 7ae5840e6f3325b52ee46437d46ba0465016584d Author: Sean Christopherson Date: Sat Feb 26 00:15:23 2022 +0000 KVM: x86/mmu: Document that zapping invalidated roots doesn't need to flush Remove the misleading flush "handling" when zapping invalidated TDP MMU roots, and document that flushing is unnecessary for all flavors of MMUs when zapping invalid/obsolete roots/pages. The "handling" in the TDP MMU is dead code, as zap_gfn_range() is called with shared=true, in which case it will never return true due to the flushing being handled by tdp_mmu_zap_spte_atomic(). No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-6-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 10 +++++++--- arch/x86/kvm/mmu/tdp_mmu.c | 15 ++++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) commit db01416b22d98b8c8474a418a97cdacfd947469d Author: Sean Christopherson Date: Sat Feb 26 00:15:22 2022 +0000 KVM: x86/mmu: Formalize TDP MMU's (unintended?) deferred TLB flush logic Explicitly ignore the result of zap_gfn_range() when putting the last reference to a TDP MMU root, and add a pile of comments to formalize the TDP MMU's behavior of deferring TLB flushes to alloc/reuse. Note, this only affects the !shared case, as zap_gfn_range() subtly never returns true for "flush" as the flush is handled by tdp_mmu_zap_spte_atomic(). Putting the root without a flush is ok because even if there are stale references to the root in the TLB, they are unreachable because KVM will not run the guest with the same ASID without first flushing (where ASID in this context refers to both SVM's explicit ASID and Intel's implicit ASID that is constructed from VPID+PCID+EPT4A+etc...). Signed-off-by: Sean Christopherson Message-Id: <20220226001546.360188-5-seanjc@google.com> Reviewed-by: Mingwei Zhang Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 8 ++++++++ arch/x86/kvm/mmu/tdp_mmu.c | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) commit f28e9c7fce14a8c82f9624c9efeccf40b046c522 Author: Sean Christopherson Date: Sat Feb 26 00:15:21 2022 +0000 KVM: x86/mmu: Fix wrong/misleading comments in TDP MMU fast zap Fix misleading and arguably wrong comments in the TDP MMU's fast zap flow. The comments, and the fact that actually zapping invalid roots was added separately, strongly suggests that zapping invalid roots is an optimization and not required for correctness. That is a lie. KVM _must_ zap invalid roots before returning from kvm_mmu_zap_all_fast(), because when it's called from kvm_mmu_invalidate_zap_pages_in_memslot(), KVM is relying on it to fully remove all references to the memslot. Once the memslot is gone, KVM's mmu_notifier hooks will be unable to find the stale references as the hva=>gfn translation is done via the memslots. If KVM doesn't immediately zap SPTEs and userspace unmaps a range after deleting a memslot, KVM will fail to zap in response to the mmu_notifier due to not finding a memslot corresponding to the notifier's range, which leads to a variation of use-after-free. The other misleading comment (and code) explicitly states that roots without a reference should be skipped. While that's technically true, it's also extremely misleading as it should be impossible for KVM to encounter a defunct root on the list while holding mmu_lock for write. Opportunistically add a WARN to enforce that invariant. Fixes: b7cccd397f31 ("KVM: x86/mmu: Fast invalidation for TDP MMU") Fixes: 4c6654bd160d ("KVM: x86/mmu: Tear down roots before kvm_mmu_zap_all_fast returns") Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-4-seanjc@google.com> Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/mmu.c | 8 ++++++++ arch/x86/kvm/mmu/tdp_mmu.c | 46 +++++++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 21 deletions(-) commit 3354ef5a592d219364cf442c2f784ce7ad7629fd Author: Sean Christopherson Date: Sat Feb 26 00:15:20 2022 +0000 KVM: x86/mmu: Check for present SPTE when clearing dirty bit in TDP MMU Explicitly check for present SPTEs when clearing dirty bits in the TDP MMU. This isn't strictly required for correctness, as setting the dirty bit in a defunct SPTE will not change the SPTE from !PRESENT to PRESENT. However, the guarded MMU_WARN_ON() in spte_ad_need_write_protect() would complain if anyone actually turned on KVM's MMU debugging. Fixes: a6a0b05da9f3 ("kvm: x86/mmu: Support dirty logging for the TDP MMU") Cc: Ben Gardon Signed-off-by: Sean Christopherson Reviewed-by: Ben Gardon Message-Id: <20220226001546.360188-3-seanjc@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini arch/x86/kvm/mmu/tdp_mmu.c | 3 +++ 1 file changed, 3 insertions(+) commit 37b2a6510a48ca361ced679f92682b7b7d7d0330 Author: Paolo Bonzini Date: Tue Mar 8 04:49:37 2022 -0500 KVM: use __vcalloc for very large allocations Allocations whose size is related to the memslot size can be arbitrarily large. Do not use kvzalloc/kvcalloc, as those are limited to "not crazy" sizes that fit in 32 bits. Cc: stable@vger.kernel.org Fixes: 7661809d493b ("mm: don't allow oversized kvmalloc() calls") Reviewed-by: David Hildenbrand Signed-off-by: Paolo Bonzini arch/powerpc/kvm/book3s_hv_uvmem.c | 2 +- arch/x86/kvm/mmu/page_track.c | 7 ++++--- arch/x86/kvm/x86.c | 4 ++-- virt/kvm/kvm_main.c | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) commit 3000f2e2fc855664c28d3e6a47e0373737974eb4 Author: Paolo Bonzini Date: Tue Mar 8 05:02:21 2022 -0500 mm: use vmalloc_array and vcalloc for array allocations Instead of using array_size or just a multiply, use a function that takes care of both the multiplication and the overflow checks. Acked-by: Michal Hocko Signed-off-by: Paolo Bonzini mm/percpu-stats.c | 2 +- mm/swap_cgroup.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) commit a8749a35c39903120ec421ef2525acc8e0daa55c Author: Paolo Bonzini Date: Tue Mar 8 04:47:22 2022 -0500 mm: vmalloc: introduce array allocation functions Linux has dozens of occurrences of vmalloc(array_size()) and vzalloc(array_size()). Allow to simplify the code by providing vmalloc_array and vcalloc, as well as the underscored variants that let the caller specify the GFP flags. Acked-by: Michal Hocko Signed-off-by: Paolo Bonzini include/linux/vmalloc.h | 5 +++++ mm/util.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) commit 6ae0a4d8fec551ec581d620f0eb1fe31f755551c Author: Miaoqian Lin Date: Tue Mar 8 02:01:44 2022 +0000 ASoC: mxs: Fix error handling in mxs_sgtl5000_probe This function only calls of_node_put() in the regular path. And it will cause refcount leak in error paths. For example, when codec_np is NULL, saif_np[0] and saif_np[1] are not NULL, it will cause leaks. of_node_put() will check if the node pointer is NULL, so we can call it directly to release the refcount of regular pointers. Fixes: e968194b45c4 ("ASoC: mxs: add device tree support for mxs-sgtl5000") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220308020146.26496-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/mxs/mxs-sgtl5000.c | 3 +++ 1 file changed, 3 insertions(+) commit 50291652af5269813baa6024eb0e81b5f0bbb451 Author: Codrin Ciubotariu Date: Mon Mar 7 14:21:59 2022 +0200 ASoC: atmel: mchp-pdmc: add PDMC driver The Pulse Density Microphone Controller (PDMC) interfaces up to 4 digital microphones having Pulse Density Modulated (PDM) outputs. It generates a single clock line and samples 1 or 2 data lines. The signal path includes an audio grade programmable decimation filter and outputs 24-bit audio words on the APB bus. Signed-off-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220307122202.2251639-4-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown sound/soc/atmel/Kconfig | 16 + sound/soc/atmel/Makefile | 2 + sound/soc/atmel/mchp-pdmc.c | 1084 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1102 insertions(+) commit 015044e9610c8523794ea6cb55d5388bc00ba96a Author: Codrin Ciubotariu Date: Mon Mar 7 14:21:58 2022 +0200 ASoC: dt-bindings: Document Microchip's PDMC Add DT bindings for the new Microchip PDMC embedded in sama7g5 SoCs. Signed-off-by: Codrin Ciubotariu Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220307122202.2251639-3-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown .../devicetree/bindings/sound/microchip,pdmc.yaml | 100 +++++++++++++++++++++ include/dt-bindings/sound/microchip,pdmc.h | 13 +++ 2 files changed, 113 insertions(+) commit 9a1e13440a4f2e7566fd4c5eae6a53e6400e08a4 Author: Codrin Ciubotariu Date: Mon Mar 7 14:21:57 2022 +0200 ASoC: dmaengine: do not use a NULL prepare_slave_config() callback Even if struct snd_dmaengine_pcm_config is used, prepare_slave_config() callback might not be set. Check if this callback is set before using it. Fixes: fa654e085300 ("ASoC: dmaengine-pcm: Provide default config") Signed-off-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220307122202.2251639-2-codrin.ciubotariu@microchip.com Signed-off-by: Mark Brown sound/soc/soc-generic-dmaengine-pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 0162052214c7e850566ecef41003603c26667b5d Merge: f00f3674873b a639027a1be1 Author: Will Deacon Date: Tue Mar 8 13:33:34 2022 +0000 Merge branch 'for-next/perf-m1' into for-next/perf Support for the CPU PMUs on the Apple M1. * for-next/perf-m1: drivers/perf: Add Apple icestorm/firestorm CPU PMU driver drivers/perf: arm_pmu: Handle 47 bit counters irqchip/apple-aic: Move PMU-specific registers to their own include file arm64: dts: apple: Add t8303 PMU nodes arm64: dts: apple: Add t8103 PMU interrupt affinities irqchip/apple-aic: Wire PMU interrupts irqchip/apple-aic: Parse FIQ affinities from device-tree dt-bindings: apple,aic: Add affinity description for per-cpu pseudo-interrupts dt-bindings: apple,aic: Add CPU PMU per-cpu pseudo-interrupts dt-bindings: arm-pmu: Document Apple PMU compatible strings commit a639027a1be1d68437e1c2cac6ed16306c84ab3c Author: Marc Zyngier Date: Tue Feb 8 18:56:04 2022 +0000 drivers/perf: Add Apple icestorm/firestorm CPU PMU driver Add a new, weird and wonderful driver for the equally weird Apple PMU HW. Although the PMU itself is functional, we don't know much about the events yet, so this can be considered as yet another random number generator... Nonetheless, it can reliably count at least cycles and instructions in the usually wonky big-little way. For anything else, it of course supports raw event numbers. Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon arch/arm64/include/asm/apple_m1_pmu.h | 45 +++ drivers/perf/Kconfig | 7 + drivers/perf/Makefile | 1 + drivers/perf/apple_m1_cpu_pmu.c | 584 ++++++++++++++++++++++++++++++++++ 4 files changed, 637 insertions(+) commit 1280f12f56a15abde23503ba876343e5f201c9c2 Author: Marc Zyngier Date: Tue Feb 8 18:56:03 2022 +0000 drivers/perf: arm_pmu: Handle 47 bit counters The current ARM PMU framework can only deal with 32 or 64bit counters. Teach it about a 47bit flavour. Yes, this is odd. Reviewed-by: Hector Martin Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon drivers/perf/arm_pmu.c | 2 ++ include/linux/perf/arm_pmu.h | 2 ++ 2 files changed, 4 insertions(+) commit 47804aab73d85147b9110a8cb025e01f8638e77d Merge: dfd42facf1e4 11db7410cfcb Author: Will Deacon Date: Tue Mar 8 13:32:28 2022 +0000 Merge branch 'irq/aic-pmu' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into for-next/perf-m1 Pull in Apple AIC rework from Marc Zyngier to support PMU interrupts on the M1 platform. * 'irq/aic-pmu' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms: irqchip/apple-aic: Move PMU-specific registers to their own include file arm64: dts: apple: Add t8303 PMU nodes arm64: dts: apple: Add t8103 PMU interrupt affinities irqchip/apple-aic: Wire PMU interrupts irqchip/apple-aic: Parse FIQ affinities from device-tree dt-bindings: apple,aic: Add affinity description for per-cpu pseudo-interrupts dt-bindings: apple,aic: Add CPU PMU per-cpu pseudo-interrupts dt-bindings: arm-pmu: Document Apple PMU compatible strings commit a1b6f487cb47ad99ee14730f03c80d3eb4c71e8a Author: Artem Bityutskiy Date: Tue Mar 8 13:41:01 2022 +0200 turbostat: fix PC6 displaying on some systems 'MSR_PKG_CST_CONFIG_CONTROL' encodes the deepest allowed package C-state limit, and turbostat decodes it. Before this patch: turbostat does not recognize value "3" on Ice Lake Xeon (ICX) and Sapphire Rapids Xeon (SPR), treats it as "unknown", and does not display any package C-states in the results table. After this patch: turbostat recognizes value 3 on ICX and SPR, treats it as "PC6", and correctly displays package C-states in the results table. Signed-off-by: Artem Bityutskiy Signed-off-by: Rafael J. Wysocki tools/power/x86/turbostat/turbostat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d307eab593b283849c13703ca3fd6a5b3908d6f8 Merge: 6c43a920a5cd f1f3a674261e Author: Paolo Abeni Date: Tue Mar 8 13:34:36 2022 +0100 Merge branch 'net-phy-lan87xx-use-genphy_read_master_slave-function' Arun Ramadoss says: ==================== net: phy: lan87xx: use genphy_read_master_slave function LAN87xx T1 Phy has the same register field as gigabit phy for reading the master slave configuration. But the genphy_read_master_slave function has a check of gigabit phy. So refactored the function in such a way, moved the speed check to the genphy_read_status function. Analyzed the nxp-tja11xx function for refactoring, but the register for configuring master/slave is nxp specific which is not extended phy register. And analyzed the reusing genphy_setup_master_slave, but for LAN87xx MASTER_ENABLE is always 1 and Preferred state is always 0. So, I didn't try to change it. ==================== Link: https://lore.kernel.org/r/20220307161515.14970-1-arun.ramadoss@microchip.com Signed-off-by: Paolo Abeni commit f1f3a674261e08f318a4bbe06391874ffdd9383f Author: Arun Ramadoss Date: Mon Mar 7 21:45:15 2022 +0530 net: phy: lan87xx: use genphy_read_master_slave in read_status To read the master slave configuration of the LAN87xx T1 phy, used the generic phy driver genphy_read_master_slave function. Removed the local lan87xx_read_master_slave function. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Signed-off-by: Paolo Abeni drivers/net/phy/microchip_t1.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) commit 64807c2321512f67959e51f09e302c145c336184 Author: Arun Ramadoss Date: Mon Mar 7 21:45:14 2022 +0530 net: phy: exported the genphy_read_master_slave function genphy_read_master_slave function allows to configure the master/slave for gigabit phys only. In order to use this function irrespective of speed, moved the speed check to the genphy_read_status call. Signed-off-by: Arun Ramadoss Reviewed-by: Andrew Lunn Signed-off-by: Paolo Abeni drivers/net/phy/phy_device.c | 19 +++++++++---------- include/linux/phy.h | 1 + 2 files changed, 10 insertions(+), 10 deletions(-) commit a6b44a2518a08348bd0f0401e4d2b99233bbabc2 Author: Miaoqian Lin Date: Mon Mar 7 09:01:30 2022 +0000 ASoC: rk817: Fix missing clk_disable_unprepare() in rk817_platform_probe Fix the missing clk_disable_unprepare() before return from rk817_platform_probe() in the error handling case. Fixes: 0d6a04da9b25 ("ASoC: Add Rockchip rk817 audio CODEC support") Signed-off-by: Miaoqian Lin Tested-by: Chris Morgan Link: https://lore.kernel.org/r/20220307090146.4104-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/codecs/rk817_codec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 80ab9012bbf1011f57c06b3c6e4ac3816c4a86f5 Author: Andy Shevchenko Date: Mon Mar 7 19:37:40 2022 +0200 spi: topcliff-pch: Prevent usage of potentially stale DMA device DMA device is expected to be available while SPI transfer is ongoing. Prevent usage of potentially stale DMA device by keeping reference count till the end of the transfer. Fixes: 4d986ffa036a ("spi: add missing pci_dev_put() before return") Reported-by: Christophe JAILLET Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220307173740.80996-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown drivers/spi/spi-topcliff-pch.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 1b8342cc4a387933780c50f0cf51c94455be7d11 Author: Krishna Yarlagadda Date: Mon Mar 7 22:25:18 2022 +0530 spi: tegra210-quad: combined sequence mode Add combined sequence mode supported by Tegra QSPI controller. For commands which contain cmd, addr, data parts to it, controller can accept all 3 transfers at once and avoid interrupt for each transfer. This would improve read & write performance. Signed-off-by: Krishna Yarlagadda Reported-by: kernel test robot Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/20220307165519.38380-3-kyarlagadda@nvidia.com Signed-off-by: Mark Brown drivers/spi/spi-tegra210-quad.c | 238 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 233 insertions(+), 5 deletions(-) commit 75a1b44a54bd97500e524cf42e8c81cc632672b3 Author: Krishna Yarlagadda Date: Mon Mar 7 22:25:17 2022 +0530 spi: tegra210-quad: add acpi support Add ACPI ID for Tegra QUAD SPI. Switch to common device property calls. Skip clock calls that are not updated in ACPI boot. Runtime PM support is not yet enabled with ACPI boot. Signed-off-by: Krishna Yarlagadda Link: https://lore.kernel.org/r/20220307165519.38380-2-kyarlagadda@nvidia.com Signed-off-by: Mark Brown drivers/spi/spi-tegra210-quad.c | 52 ++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 11 deletions(-) commit e45ac7831ff3e2934d58cce319c17c8ec763c95c Author: Miaoqian Lin Date: Tue Mar 8 01:52:22 2022 +0000 ASoC: mediatek: mt8192-mt6359: Fix error handling in mt8192_mt6359_dev_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This function only calls of_node_put() in the regular path. And it will cause refcount leak in error paths. Fix this by calling of_node_put() in error handling too. Fixes: 4e28491a7a19 ("ASoC: mediatek: mt8192-mt6359: fix device_node leak") Signed-off-by: Miaoqian Lin Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220308015224.23585-1-linmq006@gmail.com Signed-off-by: Mark Brown .../soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit 5575f7f49134c7386a684335c9007737c606d3b5 Author: Miaoqian Lin Date: Tue Mar 8 02:33:23 2022 +0000 ASoC: SOF: Add missing of_node_put() in imx8m_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: afb93d716533 ("ASoC: SOF: imx: Add i.MX8M HW support") Signed-off-by: Miaoqian Lin Reviewed-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220308023325.31702-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/sof/imx/imx8m.c | 1 + 1 file changed, 1 insertion(+) commit f725d20579807a68afbe5dba69e78b8fa05f5ef0 Author: Miaoqian Lin Date: Mon Mar 7 08:35:52 2022 +0000 ASoC: rockchip: i2s: Fix missing clk_disable_unprepare() in rockchip_i2s_probe Fix the missing clk_disable_unprepare() before return from rockchip_i2s_probe() in the error handling case. Fixes: 01605ad12875 ("ASoC: rockchip-i2s: enable "hclk" for rockchip I2S controller") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220307083553.26009-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/rockchip/rockchip_i2s.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) commit 6f6f28bf5d8e070c1e4a10d62d2a1af264683042 Author: YueHaibing Date: Sat Mar 5 20:36:13 2022 +0800 ASoC: amd: acp3x: Fix signedness bug in acp3x In acp3x_audio_probe() platform_get_irq() may return error, but i2s_irq now is unsigned int so the error handling is never triggered. Fixes: 87d71a128771 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt") Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220305123613.6324-1-yuehaibing@huawei.com Signed-off-by: Mark Brown sound/soc/amd/raven/acp3x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 954e615497cc95cd918bdfe6590abdfbaa068842 Author: YueHaibing Date: Sat Mar 5 20:37:05 2022 +0800 ASoC: amd: acp5x-pcm-dma: Fix signedness bug In acp5x_audio_probe() platform_get_irq() may return error, but i2s_irq now is unsigned int so the error handling is never triggered. Fixes: 87d71a128771 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt") Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220305123705.3708-1-yuehaibing@huawei.com Signed-off-by: Mark Brown sound/soc/amd/vangogh/acp5x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5ea14bf62ef4501c13f56fce75f6752cf643748f Author: Jiaxin Yu Date: Mon Mar 7 11:30:56 2022 +0800 ASoC: mediatek: mt8183: support wb bt audio Use "bt-sco-pcm-wb" codec dai driver for wb bt audio. Signed-off-by: Jiaxin Yu Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220307033056.11463-1-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 51996ca26fc7b5dbeea80eddba0e8a4ece6af459 Author: Lianjie Zhang Date: Mon Mar 7 23:19:39 2022 +0800 ASoC: Intel: catpt: use asoc_substream_to_rtd() Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: Lianjie Zhang Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20220307151939.32870-1-zhanglianjie@uniontech.com Signed-off-by: Mark Brown sound/soc/intel/catpt/pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit b0bfaf0544d08d093d6211d7ef8816fb0b5b6c75 Author: Miaoqian Lin Date: Tue Mar 8 01:39:48 2022 +0000 ASoC: atmel: Fix error handling in snd_proto_probe The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. This function only calls of_node_put() in the regular path. And it will cause refcount leak in error paths. Fix this by calling of_node_put() in error handling too. Fixes: a45f8853a5f9 ("ASoC: Add driver for PROTO Audio CODEC (with a WM8731)") Signed-off-by: Miaoqian Lin Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220308013949.20323-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/atmel/mikroe-proto.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) commit 40bdb2fd6b151e34fdf841238627dd0cfa960093 Author: Ranjani Sridharan Date: Mon Mar 7 10:11:03 2022 -0800 ASoC: SOF: change comp_dai to a pointer in struct snd_sof_dai This will avoid having to add the extended data for DAI components during sof_widget_setup() as an extra step. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307181111.49392-11-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/pcm.c | 6 +++--- sound/soc/sof/sof-audio.c | 18 +++--------------- sound/soc/sof/sof-audio.h | 2 +- sound/soc/sof/topology.c | 17 +++++------------ 4 files changed, 12 insertions(+), 31 deletions(-) commit ea7e5ee67fb71d92b0eb0be8467fd34b0e2def6c Author: Ranjani Sridharan Date: Mon Mar 7 10:11:02 2022 -0800 ASoC: SOF: topology: expose some get_token ops These will be used later on by IPC-specific code. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307181111.49392-10-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.h | 5 +++++ sound/soc/sof/topology.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) commit 5ef969e2f8e199d8881ea4cd78cb86df1c67d92b Author: Ranjani Sridharan Date: Mon Mar 7 10:11:01 2022 -0800 ASoC: SOF: topology: Modify the get_token op for string tokens Modify the get_token op for string type tokens to pass the string as the argument instead of a pointer to struct snd_soc_tplg_vendor_string_elem. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307181111.49392-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) commit 6a6b5727f8eedff8932db6056c07a81eeeca9250 Author: Ranjani Sridharan Date: Mon Mar 7 10:11:00 2022 -0800 ASoC: SOF: topology: Drop the size parameter from struct sof_topology_token It is always 0 and never used while parsing. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307181111.49392-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 163 ++++++++++++++++++++++------------------------- 1 file changed, 75 insertions(+), 88 deletions(-) commit 9911ce06db9dd26d62cd131318588dc039696a99 Author: Ranjani Sridharan Date: Mon Mar 7 10:10:59 2022 -0800 ASoC: SOF: topology: remove redundant code in sof_link_afe_load() Looks like a copy-paste error. The CPU DAI is never used. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307181111.49392-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 7 ------- 1 file changed, 7 deletions(-) commit fb763299bd8e075f1e9fb0a1cd296b0400fe8442 Author: Ranjani Sridharan Date: Mon Mar 7 10:10:58 2022 -0800 ASoC: SOF: topology: remove redundant code With the change in the commit: "ASoC: SOF: Intel: hda: assign link DMA channel at run-time", there is no need to find the CPU DAI in sof_link_hda_load(). Fixes: bdf4ad3fd01f ('ASoC: SOF: Intel: hda: assign link DMA channel at run-time') Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307181111.49392-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/topology.c | 8 -------- 1 file changed, 8 deletions(-) commit c99b70a2d21ab744bdee7a2ea7ec8a35caba9725 Author: Pierre-Louis Bossart Date: Mon Mar 7 10:10:57 2022 -0800 ASoC: SOF: sof-audio: removed unused function cppcheck warning: sound/soc/sof/sof-audio.c:884:0: style: The function 'snd_sof_find_spcm_pcm_id' is never used. [unusedFunction] Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20220307181111.49392-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.c | 14 -------------- sound/soc/sof/sof-audio.h | 2 -- 2 files changed, 16 deletions(-) commit 3a790f3a7c283d94325a85ac6ee4d1458e89b645 Author: Ranjani Sridharan Date: Mon Mar 7 10:10:56 2022 -0800 ASoC: SOF: set swidget's core for scheduler widget Set the swidget's core for scheduler type widgets to match that of the pipeline core. This simplifies the flow for core get/put during widget setup/free. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307181111.49392-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.c | 23 +++++------------------ sound/soc/sof/topology.c | 1 + 2 files changed, 6 insertions(+), 18 deletions(-) commit 80df2226268f039326f9daebd25047cf15e22497 Author: Ranjani Sridharan Date: Mon Mar 7 10:10:55 2022 -0800 ASoC: SOF: simplify snd_sof_device_remove() The commit "ASoC: SOF: core: Unregister machine driver before IPC and debugfs" moved the call to unregister the machine driver to be done before freeing the IPC. With this change, we can safely move the call to snd_sof_remove() inside the same if() block just above. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307181111.49392-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/core.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) commit 5187357e45c3b3d4cab3b990a893369eb8ca6f70 Author: Ranjani Sridharan Date: Mon Mar 7 10:10:54 2022 -0800 ASoC: SOF: remove snd_sof_pipeline_find() It is not used. Signed-off-by: Ranjani Sridharan Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220307181111.49392-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/sof-audio.c | 16 ---------------- sound/soc/sof/sof-audio.h | 2 -- 2 files changed, 18 deletions(-) commit d3cff4a95ed78ca192fc4bbb2743d13b7a6cc555 Author: Eric Biggers Date: Fri Jan 28 11:56:55 2022 -0800 KEYS: remove support for asym_tpm keys asym_tpm keys are tied to TPM v1.2, which uses outdated crypto and has been deprecated in favor of TPM v2.0 for over 7 years. A very quick look at this code also immediately found some memory safety bugs (https://lore.kernel.org/r/20220113235440.90439-2-ebiggers@kernel.org). Note that this code is reachable by unprivileged users. According to Jarkko (one of the keyrings subsystem maintainers), this code has no practical use cases, and he isn't willing to maintain it (https://lore.kernel.org/r/YfFZPbKkgYJGWu1Q@iki.fi). Therefore, let's remove it. Note that this feature didn't have any documentation or tests, so we don't need to worry about removing those. Cc: David Howells Cc: Denis Kenzior Cc: James Morris Cc: Jarkko Sakkinen Cc: Marcel Holtmann Signed-off-by: Eric Biggers Reviewed-by: Jarkko Sakkinen Acked-by: Ard Biesheuvel Signed-off-by: Jarkko Sakkinen crypto/asymmetric_keys/Kconfig | 21 - crypto/asymmetric_keys/Makefile | 12 - crypto/asymmetric_keys/asym_tpm.c | 957 ------------------------------------ crypto/asymmetric_keys/tpm.asn1 | 5 - crypto/asymmetric_keys/tpm_parser.c | 102 ---- include/crypto/asym_tpm_subtype.h | 19 - 6 files changed, 1116 deletions(-) commit 7e0438f83dc769465ee663bb5dcf8cc154940712 Author: Lino Sanfilippo Date: Wed Mar 2 10:43:53 2022 +0100 tpm: fix reference counting for struct tpm_chip The following sequence of operations results in a refcount warning: 1. Open device /dev/tpmrm. 2. Remove module tpm_tis_spi. 3. Write a TPM command to the file descriptor opened at step 1. ------------[ cut here ]------------ WARNING: CPU: 3 PID: 1161 at lib/refcount.c:25 kobject_get+0xa0/0xa4 refcount_t: addition on 0; use-after-free. Modules linked in: tpm_tis_spi tpm_tis_core tpm mdio_bcm_unimac brcmfmac sha256_generic libsha256 sha256_arm hci_uart btbcm bluetooth cfg80211 vc4 brcmutil ecdh_generic ecc snd_soc_core crc32_arm_ce libaes raspberrypi_hwmon ac97_bus snd_pcm_dmaengine bcm2711_thermal snd_pcm snd_timer genet snd phy_generic soundcore [last unloaded: spi_bcm2835] CPU: 3 PID: 1161 Comm: hold_open Not tainted 5.10.0ls-main-dirty #2 Hardware name: BCM2711 [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0xc4/0xd8) [] (dump_stack) from [] (__warn+0x104/0x108) [] (__warn) from [] (warn_slowpath_fmt+0x74/0xb8) [] (warn_slowpath_fmt) from [] (kobject_get+0xa0/0xa4) [] (kobject_get) from [] (tpm_try_get_ops+0x14/0x54 [tpm]) [] (tpm_try_get_ops [tpm]) from [] (tpm_common_write+0x38/0x60 [tpm]) [] (tpm_common_write [tpm]) from [] (vfs_write+0xc4/0x3c0) [] (vfs_write) from [] (ksys_write+0x58/0xcc) [] (ksys_write) from [] (ret_fast_syscall+0x0/0x4c) Exception stack(0xc226bfa8 to 0xc226bff0) bfa0: 00000000 000105b4 00000003 beafe664 00000014 00000000 bfc0: 00000000 000105b4 000103f8 00000004 00000000 00000000 b6f9c000 beafe684 bfe0: 0000006c beafe648 0001056c b6eb6944 ---[ end trace d4b8409def9b8b1f ]--- The reason for this warning is the attempt to get the chip->dev reference in tpm_common_write() although the reference counter is already zero. Since commit 8979b02aaf1d ("tpm: Fix reference count to main device") the extra reference used to prevent a premature zero counter is never taken, because the required TPM_CHIP_FLAG_TPM2 flag is never set. Fix this by moving the TPM 2 character device handling from tpm_chip_alloc() to tpm_add_char_device() which is called at a later point in time when the flag has been set in case of TPM2. Commit fdc915f7f719 ("tpm: expose spaces via a device link /dev/tpmrm") already introduced function tpm_devs_release() to release the extra reference but did not implement the required put on chip->devs that results in the call of this function. Fix this by putting chip->devs in tpm_chip_unregister(). Finally move the new implementation for the TPM 2 handling into a new function to avoid multiple checks for the TPM_CHIP_FLAG_TPM2 flag in the good case and error cases. Cc: stable@vger.kernel.org Fixes: fdc915f7f719 ("tpm: expose spaces via a device link /dev/tpmrm") Fixes: 8979b02aaf1d ("tpm: Fix reference count to main device") Co-developed-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe Signed-off-by: Lino Sanfilippo Tested-by: Stefan Berger Reviewed-by: Jason Gunthorpe Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen drivers/char/tpm/tpm-chip.c | 46 ++++++------------------------ drivers/char/tpm/tpm.h | 2 ++ drivers/char/tpm/tpm2-space.c | 65 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 38 deletions(-) commit 3d6ae1a5d0c2019d274284859f556dcb64aa98a7 Author: Eric Snowberg Date: Tue Jan 25 21:58:34 2022 -0500 integrity: Only use machine keyring when uefi_check_trust_mok_keys is true With the introduction of uefi_check_trust_mok_keys, it signifies the end- user wants to trust the machine keyring as trusted keys. If they have chosen to trust the machine keyring, load the qualifying keys into it during boot, then link it to the secondary keyring . If the user has not chosen to trust the machine keyring, it will be empty and not linked to the secondary keyring. Signed-off-by: Eric Snowberg Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen security/integrity/digsig.c | 2 +- security/integrity/integrity.h | 5 +++++ security/integrity/platform_certs/keyring_handler.c | 2 +- security/integrity/platform_certs/machine_keyring.c | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) commit 74f5e30051399d60dbce4296dbfd833212df13f1 Author: Eric Snowberg Date: Tue Jan 25 21:58:33 2022 -0500 integrity: Trust MOK keys if MokListTrustedRT found A new Machine Owner Key (MOK) variable called MokListTrustedRT has been introduced in shim. When this UEFI variable is set, it indicates the end-user has made the decision themselves that they wish to trust MOK keys within the Linux trust boundary. It is not an error if this variable does not exist. If it does not exist, the MOK keys should not be trusted within the kernel. Signed-off-by: Eric Snowberg Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen security/integrity/platform_certs/machine_keyring.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) commit 847c5336d8439a3b8245b31fa127cf98a26afae8 Author: Eric Snowberg Date: Tue Jan 25 21:58:32 2022 -0500 efi/mokvar: move up init order Move up the init order so it can be used by the new machine keyring. Signed-off-by: Eric Snowberg Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen drivers/firmware/efi/mokvar-table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 087aa4ed379054951cb3c8ccaa0c4dbafd903c01 Author: Eric Snowberg Date: Tue Jan 25 21:58:31 2022 -0500 KEYS: Introduce link restriction for machine keys Introduce a new link restriction that includes the trusted builtin, secondary and machine keys. The restriction is based on the key to be added being vouched for by a key in any of these three keyrings. With the introduction of the machine keyring, the end-user may choose to trust Machine Owner Keys (MOK) within the kernel. If they have chosen to trust them, the .machine keyring will contain these keys. If not, the machine keyring will always be empty. Update the restriction check to allow the secondary trusted keyring to also trust machine keys. Allow the .machine keyring to be linked to the secondary_trusted_keys. After the link is created, keys contained in the .machine keyring will automatically be searched when searching secondary_trusted_keys. Suggested-by: Mimi Zohar Signed-off-by: Eric Snowberg Reviewed-by: Jarkko Sakkinen Tested-by: Mimi Zohar Signed-off-by: Jarkko Sakkinen certs/system_keyring.c | 35 ++++++++++++++++++++++++++++++++++- include/keys/system_keyring.h | 6 ++++++ 2 files changed, 40 insertions(+), 1 deletion(-) commit 56edb6c25f11f25df153f4804f2d5bced2b49a9e Author: Eric Snowberg Date: Tue Jan 25 21:58:30 2022 -0500 KEYS: store reference to machine keyring Expose the .machine keyring created in integrity code by adding a reference. Store a reference to the machine keyring in system keyring code. The system keyring code needs this to complete the keyring link to the machine keyring. Signed-off-by: Eric Snowberg Reviewed-by: Jarkko Sakkinen Tested-by: Mimi Zohar Signed-off-by: Jarkko Sakkinen certs/system_keyring.c | 9 +++++++++ include/keys/system_keyring.h | 8 ++++++++ security/integrity/digsig.c | 2 ++ 3 files changed, 19 insertions(+) commit 45fcd5e521cd0903bab05f59ad013c5d150f4e3b Author: Eric Snowberg Date: Tue Jan 25 21:58:29 2022 -0500 integrity: add new keyring handler for mok keys Currently both Secure Boot DB and Machine Owner Keys (MOK) go through the same keyring handler (get_handler_for_db). With the addition of the new machine keyring, the end-user may choose to trust MOK keys. Introduce a new keyring handler specific for MOK keys. If MOK keys are trusted by the end-user, use the new keyring handler instead. Signed-off-by: Eric Snowberg Reviewed-by: Mimi Zohar Reviewed-by: Jarkko Sakkinen Tested-by: Mimi Zohar Signed-off-by: Jarkko Sakkinen security/integrity/platform_certs/keyring_handler.c | 17 ++++++++++++++++- security/integrity/platform_certs/keyring_handler.h | 5 +++++ security/integrity/platform_certs/load_uefi.c | 4 ++-- 3 files changed, 23 insertions(+), 3 deletions(-) commit d19967764ba876f5c82dabaa28f983b21eb642a2 Author: Eric Snowberg Date: Tue Jan 25 21:58:28 2022 -0500 integrity: Introduce a Linux keyring called machine Many UEFI Linux distributions boot using shim. The UEFI shim provides what is called Machine Owner Keys (MOK). Shim uses both the UEFI Secure Boot DB and MOK keys to validate the next step in the boot chain. The MOK facility can be used to import user generated keys. These keys can be used to sign an end-users development kernel build. When Linux boots, both UEFI Secure Boot DB and MOK keys get loaded in the Linux .platform keyring. Define a new Linux keyring called machine. This keyring shall contain just MOK keys and not the remaining keys in the platform keyring. This new machine keyring will be used in follow on patches. Unlike keys in the platform keyring, keys contained in the machine keyring will be trusted within the kernel if the end-user has chosen to do so. Signed-off-by: Eric Snowberg Tested-by: Jarkko Sakkinen Tested-by: Mimi Zohar Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen security/integrity/Kconfig | 13 +++++++ security/integrity/Makefile | 1 + security/integrity/digsig.c | 13 +++++-- security/integrity/integrity.h | 12 ++++++- .../integrity/platform_certs/machine_keyring.c | 42 ++++++++++++++++++++++ 5 files changed, 78 insertions(+), 3 deletions(-) commit e561752c317023c1f68df3950641747475fdcb29 Author: Eric Snowberg Date: Tue Jan 25 21:58:27 2022 -0500 integrity: Fix warning about missing prototypes make W=1 generates the following warning in keyring_handler.c security/integrity/platform_certs/keyring_handler.c:71:30: warning: no previous prototype for get_handler_for_db [-Wmissing-prototypes] __init efi_element_handler_t get_handler_for_db(const efi_guid_t *sig_type) ^~~~~~~~~~~~~~~~~~ security/integrity/platform_certs/keyring_handler.c:82:30: warning: no previous prototype for get_handler_for_dbx [-Wmissing-prototypes] __init efi_element_handler_t get_handler_for_dbx(const efi_guid_t *sig_type) ^~~~~~~~~~~~~~~~~~~ Add the missing prototypes by including keyring_handler.h. Reported-by: kernel test robot Signed-off-by: Eric Snowberg Reviewed-by: Mimi Zohar Reviewed-by: Jarkko Sakkinen Tested-by: Mimi Zohar Signed-off-by: Jarkko Sakkinen security/integrity/platform_certs/keyring_handler.c | 1 + 1 file changed, 1 insertion(+) commit c5d1ed846e15090bc90dfdaafc07eac066e070bb Author: Dave Kleikamp Date: Wed Jan 26 14:32:43 2022 -0600 KEYS: trusted: Avoid calling null function trusted_key_exit If one loads and unloads the trusted module, trusted_key_exit can be NULL. Call it through static_call_cond() to avoid a kernel trap. Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework") Signed-off-by: Dave Kleikamp Cc: Sumit Garg Cc: James Bottomley Cc: Jarkko Sakkinen Cc: Mimi Zohar Cc: David Howells Cc: James Morris Cc: "Serge E. Hallyn" Cc: linux-integrity@vger.kernel.org Cc: keyrings@vger.kernel.org Cc: linux-security-module@vger.kernel.org Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen security/keys/trusted-keys/trusted_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 969a26446bcd142faedfe8c6f41cd7668596c1fa Author: Andreas Rammhold Date: Wed Dec 1 10:59:00 2021 +0100 KEYS: trusted: Fix trusted key backends when building as module Before this commit the kernel could end up with no trusted key sources even though both of the currently supported backends (TPM and TEE) were compiled as modules. This manifested in the trusted key type not being registered at all. When checking if a CONFIG_… preprocessor variable is defined we only test for the builtin (=y) case and not the module (=m) case. By using the IS_REACHABLE() macro we do test for both cases. Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework") Reviewed-by: Jarkko Sakkinen Reviewed-by: Ahmad Fatoum Reviewed-by: Sumit Garg Signed-off-by: Andreas Rammhold Tested-by: Ahmad Fatoum Signed-off-by: Ahmad Fatoum Signed-off-by: Jarkko Sakkinen security/keys/trusted-keys/trusted_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f00f3674873bb4ca4984aa3c440f3b0087a3677e Author: Shaokun Zhang Date: Thu Mar 3 18:07:10 2022 +0800 arm64: perf: Consistently make all event numbers as 16-bits Arm ARM documents PMU event numbers as 16-bits in the table and more 0x4XXX events have been added in the header file, so use 16-bits for all event numbers and make them consistent. No functional change intended. Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Shaokun Zhang Link: https://lore.kernel.org/r/20220303100710.2238-1-zhangshaokun@hisilicon.com Signed-off-by: Will Deacon arch/arm64/include/asm/perf_event.h | 298 ++++++++++++++++++------------------ 1 file changed, 149 insertions(+), 149 deletions(-) commit 83f83cc0c1379413fb1199a78f91ab441a7e76fd Author: Shaokun Zhang Date: Thu Mar 3 16:54:19 2022 +0800 arm64: perf: Expose some Armv9 common events under sysfs Armv9[1] has introduced some common architectural events (0x400C-0x400F) and common microarchitectural events (0x4010-0x401B), which can be detected by PMCEID0_EL0 from bit44 to bit59, so expose these common events under sysfs. [1] https://developer.arm.com/documentation/ddi0608/ba Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Shaokun Zhang Link: https://lore.kernel.org/r/20220303085419.64085-1-zhangshaokun@hisilicon.com Signed-off-by: Will Deacon arch/arm64/include/asm/perf_event.h | 14 ++++++++++++++ arch/arm64/kernel/perf_event.c | 10 ++++++++++ 2 files changed, 24 insertions(+) commit 792993919349fefba20f58ae4843c80e8b01f518 Author: Christophe Leroy Date: Fri Feb 11 15:16:51 2022 +0100 powerpc/64: Force inlining of prevent_user_access() and set_kuap() A ppc64_defconfig build exhibits about 10 copied of prevent_user_access(). It also have one copy of set_kuap(). c000000000017340 <.prevent_user_access.constprop.0>: c00000000001a038: 4b ff d3 09 bl c000000000017340 <.prevent_user_access.constprop.0> c00000000001aabc: 4b ff c8 85 bl c000000000017340 <.prevent_user_access.constprop.0> c00000000001ab38: 4b ff c8 09 bl c000000000017340 <.prevent_user_access.constprop.0> c00000000001ade0: 4b ff c5 61 bl c000000000017340 <.prevent_user_access.constprop.0> c000000000039b90 <.prevent_user_access.constprop.0>: c00000000003ac08: 4b ff ef 89 bl c000000000039b90 <.prevent_user_access.constprop.0> c00000000003b9d0: 4b ff e1 c1 bl c000000000039b90 <.prevent_user_access.constprop.0> c00000000003ba54: 4b ff e1 3d bl c000000000039b90 <.prevent_user_access.constprop.0> c00000000003bbfc: 4b ff df 95 bl c000000000039b90 <.prevent_user_access.constprop.0> c00000000015dde0 <.prevent_user_access.constprop.0>: c0000000001612c0: 4b ff cb 21 bl c00000000015dde0 <.prevent_user_access.constprop.0> c000000000161b54: 4b ff c2 8d bl c00000000015dde0 <.prevent_user_access.constprop.0> c000000000188cf0 <.prevent_user_access.constprop.0>: c00000000018d658: 4b ff b6 99 bl c000000000188cf0 <.prevent_user_access.constprop.0> c00000000030fe20 <.prevent_user_access.constprop.0>: c0000000003123d4: 4b ff da 4d bl c00000000030fe20 <.prevent_user_access.constprop.0> c000000000313970: 4b ff c4 b1 bl c00000000030fe20 <.prevent_user_access.constprop.0> c0000000005e6bd0 <.prevent_user_access.constprop.0>: c0000000005e7d8c: 4b ff ee 45 bl c0000000005e6bd0 <.prevent_user_access.constprop.0> c0000000007bcae0 <.prevent_user_access.constprop.0>: c0000000007bda10: 4b ff f0 d1 bl c0000000007bcae0 <.prevent_user_access.constprop.0> c0000000007bda54: 4b ff f0 8d bl c0000000007bcae0 <.prevent_user_access.constprop.0> c0000000007bdd28: 4b ff ed b9 bl c0000000007bcae0 <.prevent_user_access.constprop.0> c0000000007c0390: 4b ff c7 51 bl c0000000007bcae0 <.prevent_user_access.constprop.0> c00000000094e4f0 <.prevent_user_access.constprop.0>: c000000000950e40: 4b ff d6 b1 bl c00000000094e4f0 <.prevent_user_access.constprop.0> c00000000097d2d0 <.prevent_user_access.constprop.0>: c0000000009813fc: 4b ff be d5 bl c00000000097d2d0 <.prevent_user_access.constprop.0> c000000000acd540 <.prevent_user_access.constprop.0>: c000000000ad1d60: 4b ff b7 e1 bl c000000000acd540 <.prevent_user_access.constprop.0> c000000000e5d680 <.prevent_user_access.constprop.0>: c000000000e64b60: 4b ff 8b 21 bl c000000000e5d680 <.prevent_user_access.constprop.0> c000000000e64b6c: 4b ff 8b 15 bl c000000000e5d680 <.prevent_user_access.constprop.0> c000000000e64c38: 4b ff 8a 49 bl c000000000e5d680 <.prevent_user_access.constprop.0> When building signal_64.c with -Winline the following messages appear: ./arch/powerpc/include/asm/book3s/64/kup.h:331:20: error: inlining failed in call to 'set_kuap': call is unlikely and code size would grow [-Werror=inline] ./arch/powerpc/include/asm/book3s/64/kup.h:401:20: error: inlining failed in call to 'prevent_user_access.constprop': call is unlikely and code size would grow [-Werror=inline] Those functions are used on hot pathes and have been expected to be inlined at all time. Force them inline. This patch reduces the kernel text size by 700 bytes, confirming that not inlining those functions is not worth it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/eff9b2b211957fa2e8707e46f31674097fd563a3.1644588972.git.christophe.leroy@csgroup.eu arch/powerpc/include/asm/book3s/64/kup.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 0b0057cc4193c7cd9c0829a440e4901b29ce4ff8 Author: Christophe Leroy Date: Fri Feb 11 09:51:32 2022 +0100 powerpc/bitops: Force inlining of fls() Building a kernel with CONFIG_CC_OPTIMISE_FOR_SIZE leads to the following functions being copied several times in vmlinux: 31 times __ilog2_u32() 34 times fls() Disassembly follows: c00f476c : c00f476c: 7c 63 00 34 cntlzw r3,r3 c00f4770: 20 63 00 20 subfic r3,r3,32 c00f4774: 4e 80 00 20 blr c00f4778 <__ilog2_u32>: c00f4778: 94 21 ff f0 stwu r1,-16(r1) c00f477c: 7c 08 02 a6 mflr r0 c00f4780: 90 01 00 14 stw r0,20(r1) c00f4784: 4b ff ff e9 bl c00f476c c00f4788: 80 01 00 14 lwz r0,20(r1) c00f478c: 38 63 ff ff addi r3,r3,-1 c00f4790: 7c 08 03 a6 mtlr r0 c00f4794: 38 21 00 10 addi r1,r1,16 c00f4798: 4e 80 00 20 blr When forcing inlining of fls(), we get c0008b80 <__ilog2_u32>: c0008b80: 7c 63 00 34 cntlzw r3,r3 c0008b84: 20 63 00 1f subfic r3,r3,31 c0008b88: 4e 80 00 20 blr vmlinux size gets reduced by 1 kbyte with that change. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/adc9c9d6378f6b5008246ca717993d7870188efb.1644569473.git.christophe.leroy@csgroup.eu arch/powerpc/include/asm/bitops.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e17c6debd4b2d2d474074f83946f8c6522587566 Merge: ffb217a13a2e 4f23f6d45821 a063158b20af ae684caf465b 6efd3b835669 e38432cb4b3a 97f2f2c5317f 9f968fc70d85 Author: Joerg Roedel Date: Tue Mar 8 12:21:31 2022 +0100 Merge branches 'arm/mediatek', 'arm/msm', 'arm/renesas', 'arm/rockchip', 'arm/smmu', 'x86/vt-d' and 'x86/amd' into next commit e38432cb4b3ab38712ae870e618bb7526df1b67d Merge: 754e0b0e3560 97dfad194ca8 Author: Joerg Roedel Date: Tue Mar 8 12:20:28 2022 +0100 Merge tag 'arm-smmu-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into arm/smmu Arm SMMU updates for 5.18 - Fix SMMUv3 soft lockup during continuous stream of events - Fix error path for Qualcomm SMMU probe() - Rework SMMU IRQ setup to prepare the ground for PMU support - Minor cleanups and refactoring commit 9f968fc70d85558b37cd721a4c08143f69ff9990 Author: Suravee Suthikulpanit Date: Tue Mar 1 14:26:26 2022 +0530 iommu/amd: Improve amd_iommu_v2_exit() During module exit, the current logic loops through all possible 16-bit device ID space to search for existing devices and clean up device state structures. This can be simplified by looping through the device state list. Also, refactor various clean up logic into free_device_state() for better reusability. Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20220301085626.87680-6-vasant.hegde@amd.com Signed-off-by: Joerg Roedel drivers/iommu/amd/iommu_v2.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) commit c1d5b57a1ebb97beb34ab8fe6347fb2ba65674b8 Author: Vasant Hegde Date: Tue Mar 1 14:26:25 2022 +0530 iommu/amd: Remove unused struct fault.devid This variable has not been used since it was introduced. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220301085626.87680-5-vasant.hegde@amd.com Signed-off-by: Joerg Roedel drivers/iommu/amd/iommu_v2.c | 1 - 1 file changed, 1 deletion(-) commit 3bf01426a574b1fe0ec21aabb7148aff777e623f Author: Vasant Hegde Date: Tue Mar 1 14:26:24 2022 +0530 iommu/amd: Clean up function declarations Remove unused declarations and add static keyword as needed. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220301085626.87680-4-vasant.hegde@amd.com Signed-off-by: Joerg Roedel drivers/iommu/amd/amd_iommu.h | 4 ---- drivers/iommu/amd/init.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) commit 434d2defa93b59b8e845b49bd6882cefd009f516 Author: Vasant Hegde Date: Tue Mar 1 14:26:23 2022 +0530 iommu/amd: Call memunmap in error path Unmap old_devtb in error path. Signed-off-by: Vasant Hegde Link: https://lore.kernel.org/r/20220301085626.87680-3-vasant.hegde@amd.com Signed-off-by: Joerg Roedel drivers/iommu/amd/init.c | 2 ++ 1 file changed, 2 insertions(+) commit 68fa55f0e05ce371c4b5de7932d9f570d61bf791 Author: Bharat Bhushan Date: Fri Feb 11 10:23:46 2022 +0530 perf/marvell: cn10k DDR perf event core ownership As DDR perf event counters are not per core, so they should be accessed only by one core at a time. Select new core when previously owning core is going offline. Signed-off-by: Bharat Bhushan Reviewed-by: Bhaskara Budiredla Link: https://lore.kernel.org/r/20220211045346.17894-5-bbhushan2@marvell.com Signed-off-by: Will Deacon drivers/perf/Kconfig | 7 +++++ drivers/perf/marvell_cn10k_ddr_pmu.c | 50 ++++++++++++++++++++++++++++++++++-- include/linux/cpuhotplug.h | 1 + 3 files changed, 56 insertions(+), 2 deletions(-) commit 35a43326a9e3c229254fd531dfc711d20897d0fc Author: Bharat Bhushan Date: Fri Feb 11 10:23:45 2022 +0530 perf/marvell: cn10k DDR perfmon event overflow handling CN10k DSS h/w perfmon does not support event overflow interrupt, so periodic timer is being used. Each event counter is 48bit, which in worst case scenario can increment at maximum 5.6 GT/s. At this rate it may take many hours to overflow these counters. Therefore polling period for overflow is set to 100 sec, which can be changed using sysfs parameter. Two fixed event counters starts counting from zero on overflow, so overflow condition is when new count less than previous count. While eight programmable event counters freezes at maximum value. Also individual counter cannot be restarted, so need to restart all eight counters. Signed-off-by: Bharat Bhushan Reviewed-by: Bhaskara Budiredla Link: https://lore.kernel.org/r/20220211045346.17894-4-bbhushan2@marvell.com Signed-off-by: Will Deacon drivers/perf/marvell_cn10k_ddr_pmu.c | 111 +++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) commit 7cf83e222bce0f135f9c2714a49623cbb9fbde29 Author: Bharat Bhushan Date: Fri Feb 11 10:23:44 2022 +0530 perf/marvell: CN10k DDR performance monitor support Marvell CN10k DRAM Subsystem (DSS) supports eight event counters for monitoring performance and software can program each counter to monitor any of the defined performance event. Performance events are for interface between the DDR controller and the PHY, interface between the DDR Controller and the CHI interconnect, or within the DDR Controller. Additionally DSS also supports two fixed performance event counters, one for number of ddr reads and other for ddr writes. This patch add basic support for these performance monitoring events on CN10k. Signed-off-by: Bharat Bhushan Reviewed-by: Bhaskara Budiredla Link: https://lore.kernel.org/r/20220211045346.17894-3-bbhushan2@marvell.com Signed-off-by: Will Deacon drivers/perf/Makefile | 1 + drivers/perf/marvell_cn10k_ddr_pmu.c | 601 +++++++++++++++++++++++++++++++++++ 2 files changed, 602 insertions(+) commit 805bbdf28b271ed82b204cfd58b6eb456462ea49 Author: Bharat Bhushan Date: Fri Feb 11 10:23:43 2022 +0530 dt-bindings: perf: marvell: cn10k ddr performance monitor Add binding documentation for the Marvell CN10k DDR performance monitor unit. Signed-off-by: Bharat Bhushan Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220211045346.17894-2-bbhushan2@marvell.com Signed-off-by: Will Deacon .../bindings/perf/marvell-cn10k-ddr.yaml | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) commit 819a47d24b61b5e2d660d19c8798f0f9b4498b73 Author: Masahiro Yamada Date: Sun Feb 27 17:52:32 2022 +0900 arm64: clean up tools Makefile Remove unused gen-y. Remove redundant $(shell ...) because 'mkdir' is done in cmd_gen_cpucaps. Replace $(filter-out $(PHONY), $^) with the $(real-prereqs) shorthand. The '&&' in cmd_gen_cpucaps should be replaced with ';' because it is run under 'set -e' environment. Signed-off-by: Masahiro Yamada Link: https://lore.kernel.org/r/20220227085232.206529-1-masahiroy@kernel.org Signed-off-by: Will Deacon arch/arm64/tools/Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) commit 6b3a3e12f8e6eea47428bb39aaf58832b50bb379 Author: Rohan McLure Date: Tue Mar 8 10:14:14 2022 +1100 powerpc: declare unmodified attribute_group usages const Inspired by (bd75b4ef4977: Constify static attribute_group structs), accepted by linux-next, reported: https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220210202805.7750-4-rikard.falkeborn@gmail.com/ Nearly all singletons of type struct attribute_group are never modified, and so are candidates for being const. Declare them as const. Signed-off-by: Rohan McLure Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220307231414.86560-1-rmclure@linux.ibm.com arch/powerpc/include/asm/spu.h | 4 ++-- arch/powerpc/perf/generic-compat-pmu.c | 4 ++-- arch/powerpc/perf/hv-24x7.c | 6 +++--- arch/powerpc/perf/hv-gpci.c | 8 ++++---- arch/powerpc/perf/imc-pmu.c | 6 +++--- arch/powerpc/perf/isa207-common.c | 2 +- arch/powerpc/perf/power10-pmu.c | 6 +++--- arch/powerpc/perf/power7-pmu.c | 4 ++-- arch/powerpc/perf/power8-pmu.c | 4 ++-- arch/powerpc/perf/power9-pmu.c | 6 +++--- arch/powerpc/platforms/cell/cbe_thermal.c | 2 +- arch/powerpc/platforms/cell/spu_base.c | 4 ++-- arch/powerpc/platforms/powernv/opal-core.c | 2 +- arch/powerpc/platforms/powernv/opal-dump.c | 2 +- arch/powerpc/platforms/powernv/opal-flash.c | 2 +- arch/powerpc/platforms/pseries/papr_scm.c | 2 +- arch/powerpc/platforms/pseries/power.c | 2 +- 17 files changed, 33 insertions(+), 33 deletions(-) commit 5986f6b6575ac830ede9648cfb64353c58067a9f Author: YueHaibing Date: Tue Mar 8 18:09:28 2022 +0800 powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n arch/powerpc/platforms/cell/spufs/sched.c:1055:12: warning: ‘show_spu_loadavg’ defined but not used [-Wunused-function] static int show_spu_loadavg(struct seq_file *s, void *private) ^~~~~~~~~~~~~~~~ Move it into #ifdef block to fix this, also remove unneeded semicolon. Signed-off-by: YueHaibing Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220308100928.23540-1-yuehaibing@huawei.com arch/powerpc/platforms/cell/spufs/sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit d601fd24e6964967f115f036a840f4f28488f63f Author: Hangyu Hua Date: Wed Mar 2 10:19:59 2022 +0800 powerpc/secvar: fix refcount leak in format_show() Refcount leak will happen when format_show returns failure in multiple cases. Unified management of of_node_put can fix this problem. Signed-off-by: Hangyu Hua Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220302021959.10959-1-hbh25y@gmail.com arch/powerpc/kernel/secvar-sysfs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 1a76e520ee1831a81dabf8a9a58c6453f700026e Author: Michael Ellerman Date: Fri Mar 4 17:12:22 2022 +1100 powerpc/64e: Tie PPC_BOOK3E_64 to PPC_FSL_BOOK3E Since the IBM A2 CPU support was removed, see commit fb5a515704d7 ("powerpc: Remove platforms/wsp and associated pieces"), the only 64-bit Book3E CPUs we support are Freescale (NXP) ones. However our Kconfig still allows configurating a kernel that has 64-bit Book3E support, but no Freescale CPU support enabled. Such a kernel would never boot, it doesn't know about any CPUs. It also causes build errors, as reported by lkp, because PPC_BARRIER_NOSPEC is not enabled in such a configuration: powerpc64-linux-ld: arch/powerpc/net/bpf_jit_comp64.o:(.toc+0x0): undefined reference to `powerpc_security_features' To fix this, force PPC_FSL_BOOK3E to be selected whenever we are building a 64-bit Book3E kernel. Reported-by: kernel test robot Reported-by: Naveen N. Rao Suggested-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220304061222.2478720-1-mpe@ellerman.id.au arch/powerpc/platforms/Kconfig.cputype | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 76222808fc253cb9ea66c3e0e8d1946933f25b70 Author: Christophe Leroy Date: Fri Mar 4 18:04:05 2022 +0100 powerpc: Move C prototypes out of asm-prototypes.h We originally added asm-prototypes.h in commit 42f5b4cacd78 ("powerpc: Introduce asm-prototypes.h"). It's purpose was for prototypes of C functions that are only called from asm, in order to fix sparse warnings about missing prototypes. A few months later Nick added a different use case in commit 4efca4ed05cb ("kbuild: modversions for EXPORT_SYMBOL() for asm") for C prototypes for exported asm functions. This is basically the inverse of our original usage. Since then we've added various prototypes to asm-prototypes.h for both reasons, meaning we now need to unstitch it all. Dispatch prototypes of C functions into relevant headers and keep only the prototypes for functions defined in assembly. For the time being, leave prom_init() there because moving it into asm/prom.h or asm/setup.h conflicts with drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o This will be fixed later by untaggling asm/pci.h and asm/prom.h or by renaming the function in shadowrom.c Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/62d46904eca74042097acf4cb12c175e3067f3d1.1646413435.git.christophe.leroy@csgroup.eu arch/powerpc/include/asm/asm-prototypes.h | 49 ----------------------- arch/powerpc/include/asm/ftrace.h | 3 ++ arch/powerpc/include/asm/hvcall.h | 5 +++ arch/powerpc/include/asm/interrupt.h | 11 +++++ arch/powerpc/include/asm/kexec.h | 2 + arch/powerpc/include/asm/processor.h | 8 ++++ arch/powerpc/include/asm/setup.h | 7 ++++ arch/powerpc/include/asm/smp.h | 3 ++ arch/powerpc/include/asm/syscalls.h | 4 ++ arch/powerpc/kernel/early_32.c | 1 - arch/powerpc/kernel/interrupt.c | 1 - arch/powerpc/kernel/irq.c | 1 - arch/powerpc/kernel/mce.c | 1 - arch/powerpc/kernel/ptrace/ptrace.c | 1 - arch/powerpc/kernel/setup_64.c | 1 - arch/powerpc/kernel/smp.c | 1 - arch/powerpc/kernel/syscalls.c | 1 - arch/powerpc/kernel/tau_6xx.c | 1 - arch/powerpc/kernel/time.c | 1 - arch/powerpc/kernel/trace/ftrace.c | 1 - arch/powerpc/kexec/core_64.c | 1 - arch/powerpc/kvm/book3s_hv_builtin.c | 1 - arch/powerpc/kvm/book3s_hv_rm_xive.c | 1 - arch/powerpc/lib/vmx-helper.c | 1 - arch/powerpc/mm/book3s64/slb.c | 1 - arch/powerpc/mm/fault.c | 1 - arch/powerpc/platforms/powernv/idle.c | 1 - arch/powerpc/platforms/powernv/opal-tracepoints.c | 1 - arch/powerpc/platforms/pseries/lpar.c | 1 - 29 files changed, 43 insertions(+), 69 deletions(-) commit 31fac565773981df43f018b2dbfbc7a3164f4b6c Author: Robin Murphy Date: Thu Feb 24 18:41:22 2022 +0000 perf/arm-cmn: Update watchpoint format From CMN-650 onwards, some of the fields in the watchpoint config registers moved subtly enough to easily overlook. Watchpoint events are still only partially supported on newer IPs - which in itself deserves noting - but were not intended to become any *less* functional than on CMN-600. Fixes: 60d1504070c2 ("perf/arm-cmn: Support new IP features") Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/e1ce4c2f1e4f73ab1c60c3a85e4037cd62dd6352.1645727871.git.robin.murphy@arm.com Signed-off-by: Will Deacon drivers/perf/arm-cmn.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit 205295c7e1abba9c1db1f9fe075f22f71351887f Author: Robin Murphy Date: Thu Feb 24 18:41:21 2022 +0000 perf/arm-cmn: Hide XP PUB events for CMN-600 CMN-600 doesn't have XP events for the PUB channel, but we missed the appropriate check to avoid exposing them. Fixes: 60d1504070c2 ("perf/arm-cmn: Support new IP features") Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/4c108d39a0513def63acccf09ab52b328f242aeb.1645727871.git.robin.murphy@arm.com Signed-off-by: Will Deacon drivers/perf/arm-cmn.c | 3 +++ 1 file changed, 3 insertions(+) commit 023a8830a62846e1cecc8da07e00c801dd0d7598 Author: Christophe JAILLET Date: Sun Feb 13 08:41:39 2022 +0100 backlight: backlight: Slighly simplify devm_of_find_backlight() Use devm_add_action_or_reset() instead of devm_add_action()+hand writing what is done in the release function, should an error occur. This is more straightforward and saves a few lines of code. While at it, remove a useless test in devm_backlight_release(). 'data' is known to be not NULL when this function is called. Signed-off-by: Christophe JAILLET Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/f998a4291d865273afa0d1f85764a9ac7fbc1b64.1644738084.git.christophe.jaillet@wanadoo.fr drivers/video/backlight/backlight.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit 4546281e8ab215b2beaba8e79975c99859a84a56 Merge: 5c8107dc9a9f 43d26c4fc6c4 Author: Joonas Lahtinen Date: Tue Mar 8 12:33:53 2022 +0200 Merge tag 'gvt-next-2022-03-07' of https://github.com/intel/gvt-linux into drm-intel-next-fixes - add the missing attribute "name" in VFIO mdev hierarchy. Signed-off-by: Joonas Lahtinen From: "Wang, Zhi A" Link: https://patchwork.freedesktop.org/patch/msgid/e38f0725-6b22-8e49-b8f6-41986b0ece06@intel.com commit ee94b5a061b121305cae8ff46b7fa8325aa84b12 Author: Sagar Patel Date: Mon Mar 7 17:24:13 2022 -0500 arm64: drop unused includes of Drop several includes of which are not used. git-blame indicates they were used at some point, but they're not needed anymore. Signed-off-by: Sagar Patel Link: https://lore.kernel.org/r/20220307222412.146506-1-sagarmp@cs.unc.edu Signed-off-by: Will Deacon arch/arm64/kernel/signal.c | 1 - arch/arm64/kernel/sys_compat.c | 1 - arch/arm64/kernel/traps.c | 1 - 3 files changed, 3 deletions(-) commit 031495635b4668f94e964e037ca93d0d38bfde58 Author: Vijay Balakrishna Date: Wed Mar 2 09:38:09 2022 -0800 arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones The following patches resulted in deferring crash kernel reservation to mem_init(), mainly aimed at platforms with DMA memory zones (no IOMMU), in particular Raspberry Pi 4. commit 1a8e1cef7603 ("arm64: use both ZONE_DMA and ZONE_DMA32") commit 8424ecdde7df ("arm64: mm: Set ZONE_DMA size based on devicetree's dma-ranges") commit 0a30c53573b0 ("arm64: mm: Move reserve_crashkernel() into mem_init()") commit 2687275a5843 ("arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required") Above changes introduced boot slowdown due to linear map creation for all the memory banks with NO_BLOCK_MAPPINGS, see discussion[1]. The proposed changes restore crash kernel reservation to earlier behavior thus avoids slow boot, particularly for platforms with IOMMU (no DMA memory zones). Tested changes to confirm no ~150ms boot slowdown on our SoC with IOMMU and 8GB memory. Also tested with ZONE_DMA and/or ZONE_DMA32 configs to confirm no regression to deferring scheme of crash kernel memory reservation. In both cases successfully collected kernel crash dump. [1] https://lore.kernel.org/all/9436d033-579b-55fa-9b00-6f4b661c2dd7@linux.microsoft.com/ Signed-off-by: Vijay Balakrishna Cc: stable@vger.kernel.org Reviewed-by: Pasha Tatashin Link: https://lore.kernel.org/r/1646242689-20744-1-git-send-email-vijayb@linux.microsoft.com [will: Add #ifdef CONFIG_KEXEC_CORE guards to fix 'crashk_res' references in allnoconfig build] Signed-off-by: Will Deacon arch/arm64/mm/init.c | 36 ++++++++++++++++++++++++++++++++---- arch/arm64/mm/mmu.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 5 deletions(-) commit 6c43a920a5cd26511059751f594c3ac05f9a6125 Author: Tobias Waldekranz Date: Mon Mar 7 12:05:48 2022 +0100 net: dsa: tag_dsa: Fix tx from VLAN uppers on non-filtering bridges In this situation (VLAN filtering disabled on br0): br0.10 / br0 / \ swp0 swp1 When a frame is transmitted from the VLAN upper, the bridge will send it down to one of the switch ports with forward offloading enabled. This will cause tag_dsa to generate a FORWARD tag. Before this change, that tag would have it's VID set to 10, even though VID 10 is not loaded in the VTU. Before the blamed commit, the frame would trigger a VTU miss and be forwarded according to the PVT configuration. Now that all fabric ports are in 802.1Q secure mode, the frame is dropped instead. Therefore, restrict the condition under which we rewrite an 802.1Q tag to a DSA tag. On standalone port's, reuse is always safe since we will always generate FROM_CPU tags in that case. For bridged ports though, we must ensure that VLAN filtering is enabled, which in turn guarantees that the VID in question is loaded into the VTU. Fixes: d352b20f4174 ("net: dsa: mv88e6xxx: Improve multichip isolation of standalone ports") Signed-off-by: Tobias Waldekranz Tested-by: Andrew Lunn Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220307110548.812455-1-tobias@waldekranz.com Signed-off-by: Paolo Abeni net/dsa/tag_dsa.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit 49be1630558751186ffe612c3e111a8699ce6b53 Author: Johnson Wang Date: Thu Jan 6 14:54:06 2022 +0800 dt-bindings: mfd: Add compatible for the MediaTek MT6366 PMIC This adds compatible for the MediaTek MT6366 PMIC. Signed-off-by: Johnson Wang Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220106065407.16036-4-johnson.wang@mediatek.com Documentation/devicetree/bindings/mfd/mt6397.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 328c621b95cdee01c50ec6d025b871b7c591f424 Author: Horatiu Vultur Date: Mon Mar 7 10:46:32 2022 +0100 net: lan966x: allow offloading timestamp operations to the PHY In case the MAC is using 'netif_rx()' to deliver the skb up the network stack, it needs to check whether 'skb_defer_rx_timestmap()' is necessary or not. In case is needed then don't call 'netif_rx()' Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220307094632.3764266-1-horatiu.vultur@microchip.com Signed-off-by: Paolo Abeni drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit dab18d3be1bf8da00bad9a567cf5b91eb16bcb2c Author: Krzysztof Kozlowski Date: Wed Feb 2 16:13:10 2022 +0100 dt-bindings: mfd: samsung,exynos5433-lpass: Convert to dtschema Convert the Exynos5433 LPASS bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220202151310.285561-4-krzysztof.kozlowski@canonical.com .../bindings/mfd/samsung,exynos5433-lpass.txt | 72 ------------- .../bindings/mfd/samsung,exynos5433-lpass.yaml | 117 +++++++++++++++++++++ 2 files changed, 117 insertions(+), 72 deletions(-) commit 8d73aa0e6b75761f1cd32d58aa115bf5382c567e Author: Krzysztof Kozlowski Date: Wed Feb 2 16:13:09 2022 +0100 mfd: exynos-lpass: Drop unneeded syscon.h include syscon regmap is not used since commit addebf1588ab ("mfd: exynos-lpass: Remove pad retention control"). Fixes: addebf1588ab ("mfd: exynos-lpass: Remove pad retention control") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220202151310.285561-3-krzysztof.kozlowski@canonical.com drivers/mfd/exynos-lpass.c | 1 - 1 file changed, 1 deletion(-) commit 8c70bd5802f4f51979f3b8a887088837edd56341 Author: Jarkko Nikula Date: Fri Feb 11 16:50:55 2022 +0200 mfd: intel-lpss: Add Intel Raptor Lake PCH-S PCI IDs Add Intel Raptor Lake PCH-S LPSS PCI IDs. Signed-off-by: Jarkko Nikula Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220211145055.992179-1-jarkko.nikula@linux.intel.com drivers/mfd/intel-lpss-pci.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit 3d4d1266597c0206f85c42c387eb942716dfad45 Author: Linus Walleij Date: Sat Feb 12 22:47:24 2022 +0100 mfd: ab8500: Drop debugfs module This debugfs isn't used by anyone, if we want to dump the contents of registers we should just convert the driver to regmap instead. I'm also excluding this from the device tree bindings when converting to YAML because it is not a real device, and device trees should only contain real physical devices. Delete it. Signed-off-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220212214724.681530-1-linus.walleij@linaro.org drivers/mfd/Kconfig | 8 - drivers/mfd/Makefile | 1 - drivers/mfd/ab8500-core.c | 20 - drivers/mfd/ab8500-debugfs.c | 2096 ------------------------------------------ 4 files changed, 2125 deletions(-) commit 6ceb5f173ff15136f3d76e8d22aa8c6e784ea126 Author: Julia Lawall Date: Thu Feb 10 21:42:23 2022 +0100 mfd: sta2x11: Use GFP_KERNEL instead of GFP_ATOMIC pci_driver probe functions aren't called with locks held and thus don't need GFP_ATOMIC. Use GFP_KERNEL instead. Problem found with Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220210204223.104181-10-Julia.Lawall@inria.fr drivers/mfd/sta2x11-mfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a002f65ab409608b643c79bf6417bd453b64a55f Author: Linus Walleij Date: Sat Jan 15 01:26:49 2022 +0100 mfd: ab8500: Rewrite bindings in YAML This rewrites the former text based AB8500 bindings in YAML. When the AB8500 bindings were first written (in 2012) we were not strict on some things and node names were definitely not standardized. This patch uses standard node names to most of the subnodes on the AB8500 and is accompanied by another patch fixing all the DTS files to conform to this. The bindings are not as perfect as newly written bindings would be, it is a best effort to deal with the legacy. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220115002649.1526163-1-linus.walleij@linaro.org Documentation/devicetree/bindings/mfd/ab8500.txt | 282 ------------ .../devicetree/bindings/mfd/stericsson,ab8500.yaml | 500 +++++++++++++++++++++ .../bindings/mfd/stericsson,db8500-prcmu.yaml | 1 + 3 files changed, 501 insertions(+), 282 deletions(-) commit c3a0dcd8f5668e45a9e8a91b80f4ab99bbe21e78 Author: Luca Weiss Date: Wed Jan 12 20:40:53 2022 +0100 mfd: qcom-spmi-pmic: Add pm8953 compatible Document the compatible for pm8953 as found in msm8953. Signed-off-by: Luca Weiss Acked-by: Konrad Dybcio Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220112194118.178026-5-luca@z3ntu.xyz Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.txt | 1 + 1 file changed, 1 insertion(+) commit c788f6e6aa112bf516d0f3f85ae6cc4e6c103239 Author: Uwe Kleine-König Date: Mon Feb 14 16:07:10 2022 +0100 mfd: stmfx: Improve error message triggered by regulator fault in .remove() Returning a non-zero value in an i2c remove callback results in the i2c core emitting a very generic error message ("remove failed (-ESOMETHING), will be ignored") and as the message indicates not further error handling is done. Instead emit a more specific error message and then return zero in .remove(). The long-term goal is to make the i2c remove prototype return void, making all implementations return 0 is preparatory work for this change. Signed-off-by: Uwe Kleine-König Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220214150710.312269-1-u.kleine-koenig@pengutronix.de drivers/mfd/stmfx.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) commit 2a6bacf79b3ae3616393e4b9a0fc623e269e506f Author: Luca Weiss Date: Wed Jan 12 20:40:52 2022 +0100 dt-bindings: mfd: qcom,tcsr: Document msm8953 compatible Document the compatible for tcsr found in msm8953. Signed-off-by: Luca Weiss Acked-by: Konrad Dybcio Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220112194118.178026-4-luca@z3ntu.xyz Documentation/devicetree/bindings/mfd/qcom,tcsr.txt | 1 + 1 file changed, 1 insertion(+) commit 56f216d8efbc1212bf5ff8a6ff5e29927965e8db Author: Peter Geis Date: Tue Feb 8 14:40:23 2022 -0500 mfd: rk808: Add reboot support to rk808.c This adds reboot support to the rk808 pmic driver and enables it for the rk809 and rk817 devices. This only enables if the rockchip,system-power-controller flag is set. Signed-off-by: Peter Geis Signed-off-by: Frank Wunderlich Reviewed-by: Dmitry Osipenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220208194023.929720-1-pgwipeout@gmail.com drivers/mfd/rk808.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/mfd/rk808.h | 1 + 2 files changed, 45 insertions(+) commit a96f688b4e4466da39385368f47fc02a0409a367 Author: Lee Jones Date: Thu Feb 10 08:44:44 2022 +0000 hwmon: sy7636a: Fix trivial 'underline too short' warning Documentation/hwmon/sy7636a-hwmon.rst:4: WARNING: Title underline too short. Kernel driver sy7636a-hwmon ========================= Acked-by: Guenter Roeck Signed-off-by: Lee Jones Link: https://lore.kernel.org/all/YgTRu7iLgJMymeT5@google.com/ Documentation/hwmon/sy7636a-hwmon.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 10377bb293358c4fe06204ed596264f69f85102a Author: Charles Keepax Date: Tue Jan 4 16:54:35 2022 +0000 mfd: arizona: Add missing statics to the of_match_tables When the match tables were split for I2C and SPI a static should have been added since the tables are no longer exported. Fixes: 3f65555c417c ("mfd: arizona: Split of_match table into I2C and SPI versions") Reported-by: kernel test robot Signed-off-by: Charles Keepax Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220104165435.26782-1-ckeepax@opensource.cirrus.com drivers/mfd/arizona-i2c.c | 2 +- drivers/mfd/arizona-spi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit b0e846248de5bd57e4b785791f359ecb8f2d7311 Author: Lukas Bulwahn Date: Mon Dec 27 07:48:39 2021 +0100 mfd: db8500-prcmu: Remove dead code for a non-existing config The config DBX500_PRCMU_QOS_POWER was never introduced in the kernel repository. So, the ifdef in ./include/linux/mfd/dbx500-prcmu.h was never effective. Remove these dead function prototypes. Signed-off-by: Lukas Bulwahn Reviewed-by: Linus Walleij Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211227064839.21405-1-lukas.bulwahn@gmail.com include/linux/mfd/dbx500-prcmu.h | 18 ------------------ 1 file changed, 18 deletions(-) commit f49f43371b8a680c5972d052598d7c120f1a05d3 Author: Hans de Goede Date: Sat Dec 25 12:55:08 2021 +0100 mfd: intel_soc_pmic_crc: Set main IRQ domain bus token to DOMAIN_BUS_NEXUS For the CRC PMIC we end up with multiple IRQ domains with the same fwnode. One for the irqchip which demultiplexes the actual PMIC interrupt into interrupts for the various cells (known as the level 1 interrupts); And 2 more for the irqchips which are part of the crystal_cove_gpio and crystal_cove_charger cells. This leads to the following error being printed when CONFIG_GENERIC_IRQ_DEBUGFS is enabled: debugfs: File '\_SB.I2C7.PMIC' in directory 'domains' already present! Set the bus token of the main IRQ domain to DOMAIN_BUS_NEXUS to avoid this error, this also allows irq_find_matching_fwspec() to find the right domain if necessary. Note all 3 domain registering drivers need to set the IRQ domain bus token. This is necessary because the IRQ domain code defaults to creating the debugfs dir with just the fwnode name and then renames it when the bus token is set. So each one starts with the same default name and all 3 must be given a different name to avoid problems when one of the other drivers loads and starts with the same default name. Signed-off-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211225115509.94891-4-hdegoede@redhat.com drivers/mfd/intel_soc_pmic_core.c | 4 ++++ 1 file changed, 4 insertions(+) commit 50904e9bd686a2b1fe4c98273a57ba048bd0f1c4 Author: Hans de Goede Date: Sat Dec 25 12:55:07 2021 +0100 mfd: intel_soc_pmic_crc: Add crystal_cove_charger cell to BYT cells The Crystal Cove PMIC has a pin which can be used to connect the IRQ of an external charger IC. On some boards this is used and we need to have a cell for this, with a driver which creates its own irqchip with a single IRQ for the charger driver to consume. The charger driver cannot directly consume the IRQ from the MFD level irqchip because the PMIC has 2 levels of interrupts and the second level interrupt status register, which is handled by the cell drivers, needs to have the IRQ acked to avoid an IRQ storm. Signed-off-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211225115509.94891-3-hdegoede@redhat.com drivers/mfd/intel_soc_pmic_crc.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 4946d58dbb3b35c239881eaedc236b8214bc254b Author: Hans de Goede Date: Sat Dec 25 12:55:06 2021 +0100 mfd: intel_soc_pmic_crc: Sort cells by IRQ order The cells for the Crystal Cove PMIC are already mostly sorted by function / IRQ order. Move the ADC cell so that they are fully sorted. Also move some of the resource definitions so that their order matches the (new) order of the cells. Signed-off-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211225115509.94891-2-hdegoede@redhat.com drivers/mfd/intel_soc_pmic_crc.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) commit afb67df31a8cf9619f72057fc7d79adfe0d84d8b Merge: de34a4053250 9e444dbf278c b38213c6118b c47383f84909 e477e51a41cb 172e611b54e8 Author: Lee Jones Date: Tue Mar 8 09:42:41 2022 +0000 Merge branches 'ib-mfd-hwmon-regulator-5.18', 'ib-mfd-iio-5.18', 'ib-mfd-led-power-regulator-5.18', 'ib-mfd-mediatek-mt6366-5.18', 'ib-mfd-rtc-watchdog-5.18' and 'ib-mfd-spi-dt-5.18' into ibs-for-mfd-merged commit 1416ea0ddc1463fb8c9cf12b48f3df82a327e356 Author: Heiner Kallweit Date: Sun Mar 6 15:22:34 2022 +0100 net: mdio-mux: add bus name to bus id In case of DT-configured systems it may be hard to identify the PHY interrupt in the /proc/interrupts output. Therefore add the name to the id to make clearer that it's about a device on a muxed mdio bus. In my case: Now: mdio_mux-0.e40908ff:08 Before: 0.e40908ff:08 Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/00b4bb1e-98f9-b4e7-5549-e095a4701f66@gmail.com Signed-off-by: Paolo Abeni drivers/net/mdio/mdio-mux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 604b388419d08032c07aff8946ee19c073b59189 Author: Geoffrey D. Bennett Date: Mon Mar 7 01:51:39 2022 +1030 ALSA: scarlett2: Add support for the internal "standalone" switch The Focusrite Scarlett Gen 2/3 interfaces with internal mixers have a "standalone" mode. When the interface is not connected to a USB host and standalone mode is enabled, the interface will pass audio as previously configured. This patch adds an ALSA control to allow enabling/disabling that mode. Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/cd88871c5e77abd5c23a4758a1f2ec9fd427fd69.1646578164.git.g@b4.vu Signed-off-by: Takashi Iwai sound/usb/mixer_scarlett_gen2.c | 97 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 90 insertions(+), 7 deletions(-) commit 441d1e10476bc9d966baf32745277a6e77c325d5 Author: Geoffrey D. Bennett Date: Mon Mar 7 01:51:04 2022 +1030 ALSA: scarlett2: Split scarlett2_config_items[] into 3 sections scarlett2_config_items[] contains the parameters for the configuration items. The driver previously had two sets of configurations items; one for devices with no mixer, and one for devices with a mixer. This patch splits the latter into two (one set for Gen 2 devices and one set for Gen 3 devices) in preparation for a new item (standalone) which is present in both but with a different offset. Signed-off-by: Geoffrey D. Bennett Link: https://lore.kernel.org/r/20969f9ea500684e978c87067fbdc7e73de1f6ed.1646578164.git.g@b4.vu Signed-off-by: Takashi Iwai sound/usb/mixer_scarlett_gen2.c | 74 ++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 23 deletions(-) commit 243cfa6a6782809975a0002125514a57db7df752 Author: Andy Shevchenko Date: Mon Mar 7 12:54:14 2022 +0200 gpiolib: Use list_first_entry()/list_last_entry() Use list_first_entry()/list_last_entry() instead of open coded variants. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski drivers/gpio/gpiolib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 151c6b49d679872d6fc0b50e0ad96303091694a2 Author: Tudor Ambarus Date: Mon Feb 28 18:33:34 2022 +0200 mtd: spi-nor: Skip erase logic when SPI_NOR_NO_ERASE is set Even if SPI_NOR_NO_ERASE was set, one could still send erase opcodes to the flash. It is not recommended to send unsupported opcodes to flashes. Fix the logic and do not set mtd->_erase when SPI_NOR_NO_ERASE is specified. With this users will not be able to issue erase opcodes to flashes and instead they will recive an -ENOTSUPP error. Fixes: b199489d37b2 ("mtd: spi-nor: add the framework for SPI NOR") Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220228163334.277730-1-tudor.ambarus@microchip.com drivers/mtd/spi-nor/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 2dd634664d4128668c44bc9e497af24157f1eef4 Author: Gustavo A. R. Silva Date: Wed Jan 19 17:38:03 2022 -0600 tpm: xen-tpmfront: Use struct_size() helper Make use of the struct_size() helper instead of an open-coded version, in order to avoid any potential type mistakes or integer overflows that, in the worse scenario, could lead to heap overflows. Also, address the following sparse warning: drivers/char/tpm/xen-tpmfront.c:131:16: warning: using sizeof on a flexible structure Link: https://github.com/KSPP/linux/issues/160 Link: https://github.com/KSPP/linux/issues/174 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen drivers/char/tpm/xen-tpmfront.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 8bdc3e05cc78513b7495366ef9b962a3ea568e8e Author: Eric Biggers Date: Tue Jan 18 16:54:36 2022 -0800 KEYS: x509: remove dead code that set ->unsupported_sig The X.509 parser always sets cert->sig->pkey_algo and cert->sig->hash_algo on success, since x509_note_sig_algo() is a mandatory action in the X.509 ASN.1 grammar, and it returns an error if the signature's algorithm is unknown. Thus, remove the dead code which handled these fields being NULL. Acked-by: Jarkko Sakkinen Signed-off-by: Eric Biggers Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen crypto/asymmetric_keys/x509_public_key.c | 9 --------- 1 file changed, 9 deletions(-) commit 9f8b3f321f39d6ff63fb40673c3be61b73ba0a1d Author: Eric Biggers Date: Tue Jan 18 16:54:35 2022 -0800 KEYS: x509: remove never-set ->unsupported_key flag The X.509 parser always sets cert->pub->pkey_algo on success, since x509_extract_key_data() is a mandatory action in the X.509 ASN.1 grammar, and it returns an error if the algorithm is unknown. Thus, remove the dead code which handled this field being NULL. This results in the ->unsupported_key flag never being set, so remove that too. Signed-off-by: Eric Biggers Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen crypto/asymmetric_keys/pkcs7_verify.c | 7 ++----- crypto/asymmetric_keys/x509_parser.h | 1 - crypto/asymmetric_keys/x509_public_key.c | 9 --------- 3 files changed, 2 insertions(+), 15 deletions(-) commit 7804fe9e8dc70846ff2c683f4781ed75499b12ae Author: Eric Biggers Date: Tue Jan 18 16:54:34 2022 -0800 KEYS: x509: remove unused fields Remove unused fields from struct x509_parse_context. Acked-by: Jarkko Sakkinen Signed-off-by: Eric Biggers Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen crypto/asymmetric_keys/x509_cert_parser.c | 2 -- 1 file changed, 2 deletions(-) commit 8f2a7b518bb878c9a8c4f86432908a53e060da1f Author: Eric Biggers Date: Tue Jan 18 16:54:33 2022 -0800 KEYS: x509: clearly distinguish between key and signature algorithms An X.509 certificate has two, potentially different public key algorithms: the one used by the certificate's key, and the one that was used to sign the certificate. Some of the naming made it unclear which algorithm was meant. Rename things appropriately: - x509_note_pkey_algo() => x509_note_sig_algo() - algo_oid => sig_algo Reviewed-by: Jarkko Sakkinen Signed-off-by: Eric Biggers Signed-off-by: Jarkko Sakkinen crypto/asymmetric_keys/x509.asn1 | 2 +- crypto/asymmetric_keys/x509_cert_parser.c | 32 +++++++++++++++++-------------- 2 files changed, 19 insertions(+), 15 deletions(-) commit c51abd96837f600d8fd940b6ab8e2da578575504 Author: Eric Biggers Date: Thu Jan 13 12:04:54 2022 -0800 KEYS: fix length validation in keyctl_pkey_params_get_2() In many cases, keyctl_pkey_params_get_2() is validating the user buffer lengths against the wrong algorithm properties. Fix it to check against the correct properties. Probably this wasn't noticed before because for all asymmetric keys of the "public_key" subtype, max_data_size == max_sig_size == max_enc_size == max_dec_size. However, this isn't necessarily true for the "asym_tpm" subtype (it should be, but it's not strictly validated). Of course, future key types could have different values as well. Fixes: 00d60fd3b932 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]") Cc: # v4.20+ Signed-off-by: Eric Biggers Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen security/keys/keyctl_pkey.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) commit 8335adb8f9d3ea783422d22883a327427c1dbee8 Author: Tadeusz Struk Date: Sat Jan 15 17:26:27 2022 -0800 selftests: tpm: add async space test with noneexisting handle Add a test for /dev/tpmrm0 in async mode that checks if the code handles invalid handles correctly. Cc: Jarkko Sakkinen Cc: Shuah Khan Cc: Cc: Cc: Tested-by: Jarkko Sakkinen Signed-off-by: Tadeusz Struk Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen tools/testing/selftests/tpm2/tpm2_tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit 2e8e4c8f6673247e22efc7985ce5497accd16f88 Author: Tadeusz Struk Date: Sat Jan 15 17:26:26 2022 -0800 tpm: Fix error handling in async work When an invalid (non existing) handle is used in a TPM command, that uses the resource manager interface (/dev/tpmrm0) the resource manager tries to load it from its internal cache, but fails and the tpm_dev_transmit returns an -EINVAL error to the caller. The existing async handler doesn't handle these error cases currently and the condition in the poll handler never returns mask with EPOLLIN set. The result is that the poll call blocks and the application gets stuck until the user_read_timer wakes it up after 120 sec. Change the tpm_dev_async_work function to handle error conditions returned from tpm_dev_transmit they are also reflected in the poll mask and a correct error code could passed back to the caller. Cc: Jarkko Sakkinen Cc: Jason Gunthorpe Cc: Cc: Cc: Fixes: 9e1b74a63f77 ("tpm: add support for nonblocking operation") Tested-by: Jarkko Sakkinen Signed-off-by: Tadeusz Struk Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen drivers/char/tpm/tpm-dev-common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 0d060f230fa06c32d91e67978a3088be9635848e Author: Stefan Berger Date: Sat Nov 27 23:10:51 2021 -0500 selftests: tpm2: Determine available PCR bank Determine an available PCR bank to be used by a test case by querying the capability TPM2_GET_CAP. The TPM2 returns TPML_PCR_SELECTIONS that contains an array of TPMS_PCR_SELECTIONs indicating available PCR banks and the bitmasks that show which PCRs are enabled in each bank. Collect the data in a dictionary. From the dictionary determine the PCR bank that has the PCRs enabled that the test needs. This avoids test failures with TPM2's that either to not have a SHA-1 bank or whose SHA-1 bank is disabled. Signed-off-by: Stefan Berger Tested-by: Jarkko Sakkinen Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen tools/testing/selftests/tpm2/tpm2.py | 31 ++++++++++++++++++++++++++++++ tools/testing/selftests/tpm2/tpm2_tests.py | 29 ++++++++++++++++++++-------- 2 files changed, 52 insertions(+), 8 deletions(-) commit 31e9dc49c2c03c3f166248f16dbe1248ffb5c6a9 Author: Colin Ian King Date: Mon Mar 7 15:21:49 2022 +0000 udf: remove redundant assignment of variable etype Variable etype is being assigned a value that is never read. The variable and assignment are redundant and can be removed. Cleans up clang scan build warning: fs/udf/super.c:2485:10: warning: Although the value stored to 'etype' is used in the enclosing expression, the value is never actually read from 'etype' [deadcode.DeadStores] Link: https://lore.kernel.org/r/20220307152149.139045-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Jan Kara fs/udf/super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 9cb727506704b5323998047789fc871e64a6aa14 Author: Tim Crawford Date: Mon Mar 7 12:32:29 2022 -0700 ALSA: hda/realtek: Add quirk for Clevo NP50PNJ Fixes headset detection on Clevo NP50PNJ. Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220307193229.5141-1-tcrawford@system76.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) commit 5c8107dc9a9f33a88a380aea79be564597d00663 Author: Ville Syrjälä Date: Mon Feb 14 12:55:31 2022 +0200 drm/i915: Fix the async flip wm0/ddb optimization The current implementation of the async flip wm0/ddb optimization does not work at all. The biggest problem is that we skip the whole intel_pipe_update_{start,end}() dance and thus never actually complete the commit that is trying to do the wm/ddb change. To fix this we need to move the do_async_flip flag to the crtc state since we handle commits per-pipe, not per-plane. Also since all planes can now be included in the first/last "async flip" (which gets converted to a sync flip to do the wm/ddb mangling) we need to be more careful when checking if the plane state is async flip comptatible. Only planes doing the async flip should be checked and other planes are perfectly fine not adhereing to any async flip related limitations. However for subsequent commits which are actually going do the async flip in hardware we want to make sure no other planes are in the state. That should never happen assuming we did our job correctly, so we'll toss in a WARN to make sure we catch any bugs here. Cc: Stanislav Lisovskiy Fixes: c3639f3be480 ("drm/i915: Use wm0 only during async flips for DG2") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220214105532.13049-4-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit 2e08437160d1e8f2cd3f0d56d59e74423602116e) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/display/intel_atomic.c | 1 + drivers/gpu/drm/i915/display/intel_atomic_plane.c | 7 ++-- drivers/gpu/drm/i915/display/intel_crtc.c | 4 +-- drivers/gpu/drm/i915/display/intel_display.c | 38 +++++++++++++--------- drivers/gpu/drm/i915/display/intel_display_types.h | 6 ++-- 5 files changed, 31 insertions(+), 25 deletions(-) commit 176c0b55d9bfe6e2a7c8ccf3edaec7c92d856b2e Author: Ville Syrjälä Date: Mon Feb 14 12:55:30 2022 +0200 drm/i915: Check async flip capability early on Since the async flip state check is done very late and thus it can see potentially all the planes in the state (due to the wm/ddb optimization) we need to move the "can the requested plane do async flips at all?" check much earlier. For this purpose we introduce intel_async_flip_check_uapi() that gets called early during the atomic check. And for good measure we'll throw in a couple of basic checks: - is the crtc active? - was a modeset flagged? - is+was the plane enabled? Though atm all of those should be guaranteed by the fact that the async flip can only be requested through the legacy page flip ioctl. Cc: Stanislav Lisovskiy Fixes: c3639f3be480 ("drm/i915: Use wm0 only during async flips for DG2") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220214105532.13049-3-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit b0b2bed2a1305c8f977c6b7d5fa162773693a212) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/display/intel_display.c | 79 +++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 7 deletions(-) commit 117f5bb31c8cdb1e8f0b443f2a0ac761bf54694c Author: Ville Syrjälä Date: Mon Feb 14 12:55:29 2022 +0200 drm/i915: Don't skip ddb allocation if data_rate==0 data_rate==0 no longer means a plane is disabled, it could also mean we want to use the minimum ddb allocation for it. Hence we can't bail out early during ddb allocation or else we'll simply forget to allocate any ddb for such planes. Cc: Stanislav Lisovskiy Fixes: 6a4d8cc6bbbf ("drm/i915: Don't allocate extra ddb during async flip for DG2") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220214105532.13049-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit 6475e106821babc0dc478a9cb3fc3973739c43fb) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/intel_pm.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) commit 4fe4ed07c815044755075eaad5fe1815436a060f Author: Ville Syrjälä Date: Wed Feb 23 15:13:03 2022 +0200 drm/i915: Avoid negative shift due to bigjoiner_pipes==0 bigjoiner_pipes==0 leads bigjoiner_master_pipe() to do BIT(ffs(0)-1) which is undefined behaviour. The code should actually still work fine since the only place we provoke that is intel_crtc_bigjoiner_slave_pipes() and it'll bitwise AND the result with 0, so doesn't really matter what we get out of bigjoiner_master_pipe(). But best not provoke undefined behaviour anyway. Reported-by: kernel test robot Fixes: a6e7a006f5d5 ("drm/i915: Change bigjoiner state tracking to use the pipe bitmask") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220223131315.18016-2-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare (cherry picked from commit cccc71b552a1040ad3d738d7ec95570801fb0bf6) Signed-off-by: Joonas Lahtinen drivers/gpu/drm/i915/display/intel_display.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit e878ae2d1df5de4ea36e6d96c7d3ebe789aab9a5 Author: KP Singh Date: Mon Mar 7 13:30:48 2022 +0000 bpf/docs: Update list of architectures supported. vmtest.sh also supports s390x now. Signed-off-by: KP Singh Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220307133048.1287644-2-kpsingh@kernel.org tools/testing/selftests/bpf/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5ad0a415da6be8c13ed45c655e5acc9fa93557a9 Author: KP Singh Date: Mon Mar 7 13:30:47 2022 +0000 bpf/docs: Update vmtest docs for static linking Dynamic linking when compiling on the host can cause issues when the libc version does not match the one in the VM image. Update the docs to explain how to do this. Before: ./vmtest.sh -- ./test_progs -t test_ima ./test_progs: /usr/lib/libc.so.6: version `GLIBC_2.33' not found (required by ./test_progs) After: LDLIBS=-static ./vmtest.sh -- ./test_progs -t test_ima test_ima:OK Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED Reported-by: "Geyslan G. Bem" Signed-off-by: KP Singh Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220307133048.1287644-1-kpsingh@kernel.org tools/testing/selftests/bpf/README.rst | 8 ++++++++ 1 file changed, 8 insertions(+) commit 4989135a85334337ac8b7e42e7ee1a569ad5f7f5 Author: Yuntao Wang Date: Sun Mar 6 00:10:13 2022 +0800 bpf: Remove redundant slash The trailing slash of LIBBPF_SRCS is redundant, remove it. Also inline it as its only used in LIBBPF_INCLUDE. Signed-off-by: Yuntao Wang Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220305161013.361646-1-ytcoode@gmail.com kernel/bpf/preload/Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 69adcb988a0675ce001dfc416d56fba2e8a85f48 Author: Zheyu Ma Date: Sun Mar 6 05:56:32 2022 +0000 net: cxgb3: Fix an error code when probing the driver During the process of driver probing, probe function should return < 0 for failure, otherwise kernel will treat value >= 0 as success. Therefore, the driver should set 'err' to -ENODEV when 'adapter->registered_device_map' is NULL. Otherwise kernel will assume that the driver has been successfully probed and will cause unexpected errors. Signed-off-by: Zheyu Ma Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/1646546192-32737-1-git-send-email-zheyuma97@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 1 + 1 file changed, 1 insertion(+) commit 13d04d79701ba240969b296903de14db3734ab25 Author: Maciej Fijalkowski Date: Tue Mar 8 00:13:53 2022 +0100 ice: xsk: fix GCC version checking against pragma unroll presence Pragma unroll was introduced around GCC 8, whereas current xsk code in ice that prepares loop_unrolled_for macro that is based on mentioned pragma, compares GCC version against 4, which is wrong and Stephen found this out by compiling kernel with GCC 5.4 [0]. Fix this mistake and check if GCC version is >= 8. [0]: https://lore.kernel.org/netdev/20220307213659.47658125@canb.auug.org.au/ Fixes: 126cdfe1007a ("ice: xsk: Improve AF_XDP ZC Tx and use batching API") Reported-by: Stephen Rothwell Signed-off-by: Maciej Fijalkowski Link: https://lore.kernel.org/r/20220307231353.56638-1-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/intel/ice/ice_xsk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 04b6de649e124f2ea9693a25a744e646c1203ff9 Author: Guo Zhengkui Date: Sun Mar 6 10:34:26 2022 +0800 libbpf: Fix array_size.cocci warning Fix the following coccicheck warning: tools/lib/bpf/bpf.c:114:31-32: WARNING: Use ARRAY_SIZE tools/lib/bpf/xsk.c:484:34-35: WARNING: Use ARRAY_SIZE tools/lib/bpf/xsk.c:485:35-36: WARNING: Use ARRAY_SIZE It has been tested with gcc (Debian 8.3.0-6) 8.3.0 on x86_64. Signed-off-by: Guo Zhengkui Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220306023426.19324-1-guozhengkui@vivo.com tools/lib/bpf/bpf.c | 3 ++- tools/lib/bpf/xsk.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) commit 03b9c7fa3f15f51bcd07f3828c2a01311e7746c4 Author: Yuntao Wang Date: Fri Mar 4 15:04:08 2022 +0800 bpf: Replace strncpy() with strscpy() Using strncpy() on NUL-terminated strings is considered deprecated[1]. Moreover, if the length of 'task->comm' is less than the destination buffer size, strncpy() will NUL-pad the destination buffer, which is a needless performance penalty. Replacing strncpy() with strscpy() fixes all these issues. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings Signed-off-by: Yuntao Wang Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220304070408.233658-1-ytcoode@gmail.com kernel/bpf/helpers.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) commit 9c6e6a80ee741adf6cb3cfd8eef7d1554f91fceb Author: lic121 Date: Tue Mar 1 13:26:23 2022 +0000 libbpf: Unmap rings when umem deleted xsk_umem__create() does mmap for fill/comp rings, but xsk_umem__delete() doesn't do the unmap. This works fine for regular cases, because xsk_socket__delete() does unmap for the rings. But for the case that xsk_socket__create_shared() fails, umem rings are not unmapped. fill_save/comp_save are checked to determine if rings have already be unmapped by xsk. If fill_save and comp_save are NULL, it means that the rings have already been used by xsk. Then they are supposed to be unmapped by xsk_socket__delete(). Otherwise, xsk_umem__delete() does the unmap. Fixes: 2f6324a3937f ("libbpf: Support shared umems between queues and devices") Signed-off-by: Cheng Li Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220301132623.GA19995@vscode.7~ tools/lib/bpf/xsk.c | 11 +++++++++++ 1 file changed, 11 insertions(+) commit 8daf4e75fc09d6b0ca8fea0988959c99643aa8a8 Author: Dan Carpenter Date: Mon Mar 7 15:57:36 2022 +0300 vxlan_core: delete unnecessary condition The previous check handled the "if (!nh)" condition so we know "nh" is non-NULL here. Delete the check and pull the code in one tab. Signed-off-by: Dan Carpenter Reviewed-by: Nikolay Aleksandrov Reviewed-by: Roopa Prabhu Link: https://lore.kernel.org/r/20220307125735.GC16710@kili Signed-off-by: Jakub Kicinski drivers/net/vxlan/vxlan_core.c | 54 ++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 28 deletions(-) commit f771b55731fc82b1e8e9ef123f6f1b8d8c92bc63 Author: Nicholas Piggin Date: Mon Mar 7 13:26:25 2022 +1100 KVM: PPC: Use KVM_CAP_PPC_AIL_MODE_3 Use KVM_CAP_PPC_AIL_MODE_3 to advertise the capability to set the AIL resource mode to 3 with the H_SET_MODE hypercall. This capability differs between processor types and KVM types (PR, HV, Nested HV), and affects guest-visible behaviour. QEMU will implement a cap-ail-mode-3 to control this behaviour[1], and use the KVM CAP if available to determine KVM support[2]. [1] https://lists.nongnu.org/archive/html/qemu-ppc/2022-02/msg00437.html [2] https://lists.nongnu.org/archive/html/qemu-ppc/2022-02/msg00439.html Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas [mpe: Rebase onto 93b71801a827 from kvm-ppc-cap-210 branch, add EXPORT_SYMBOL] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220222064727.2314380-4-npiggin@gmail.com arch/powerpc/include/asm/setup.h | 2 ++ arch/powerpc/kvm/powerpc.c | 17 +++++++++++++++++ arch/powerpc/platforms/pseries/setup.c | 13 ++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) commit 839d893b4067da14b9c46fda2dfd88b80aeed551 Author: Nicholas Piggin Date: Tue Feb 22 16:47:26 2022 +1000 KVM: PPC: Book3S PR: Disallow AIL != 0 KVM PR does not implement address translation modes on interrupt, so it must not allow H_SET_MODE to succeed. The behaviour change caused by this mode is architected and not advisory (interrupts *must* behave differently). QEMU does not deal with differences in AIL support in the host. The solution to that is a spapr capability and corresponding KVM CAP, but this patch does not break things more than before (the host behaviour already differs, this change just disallows some modes that are not implemented properly). By happy coincidence, this allows PR Linux guests that are using the SCV facility to boot and run, because Linux disables the use of SCV if AIL can not be set to 3. This does not fix the underlying problem of missing SCV support (an OS could implement real-mode SCV vectors and try to enable the facility). The true fix for that is for KVM PR to emulate scv interrupts from the facility unavailable interrupt. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20220222064727.2314380-3-npiggin@gmail.com arch/powerpc/kvm/book3s_pr_papr.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) commit b5149e229218118c9cd44a4d256f970ddcbf745b Author: Nicholas Piggin Date: Tue Feb 22 16:47:25 2022 +1000 KVM: PPC: Book3S PR: Disable SCV when AIL could be disabled PR KVM does not support running with AIL enabled, and SCV does is not supported with AIL disabled. Fix this by ensuring the SCV facility is disabled with FSCR while a CPU could be running with AIL=0. The PowerNV host supports disabling AIL on a per-CPU basis, so SCV just needs to be disabled when a vCPU is being run. The pSeries machine can only switch AIL on a system-wide basis, so it must disable SCV support at boot if the configuration can potentially run a PR KVM guest. Also ensure a the FSCR[SCV] bit can not be enabled when emulating mtFSCR for the guest. SCV is not emulated for the PR guest at the moment, this just fixes the host crashes. Alternatives considered and rejected: - SCV support can not be disabled by PR KVM after boot, because it is advertised to userspace with HWCAP. - AIL can not be disabled on a per-CPU basis. At least when running on pseries it is a per-LPAR setting. - Support for real-mode SCV vectors will not be added because they are at 0x17000 so making such a large fixed head space causes immediate value limits to be exceeded, requiring a lot rework and more code. - Disabling SCV for any PR KVM possible kernel will cause a slowdown when not using PR KVM. - A boot time option to disable SCV to use PR KVM is user-hostile. - System call instruction emulation for SCV facility unavailable instructions is too complex and old emulation code was subtly broken and removed. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20220222064727.2314380-2-npiggin@gmail.com arch/powerpc/kernel/exceptions-64s.S | 4 ++++ arch/powerpc/kernel/setup_64.c | 28 ++++++++++++++++++++++++++++ arch/powerpc/kvm/Kconfig | 9 +++++++++ arch/powerpc/kvm/book3s_pr.c | 26 +++++++++++++++++--------- 4 files changed, 58 insertions(+), 9 deletions(-) commit 04a5b0ee97046293431685404ef7352917f1e243 Merge: c7fa848ff01d 93b71801a827 Author: Michael Ellerman Date: Tue Mar 8 13:11:46 2022 +1100 Merge branch 'kvm-ppc-cap-210' of https://git.kernel.org/pub/scm/virt/kvm/kvm into topic/ppc-kvm Merge this branch from the KVM tree to bring in a new KVM capability KVM_CAP_PPC_AIL_MODE_3. It also brings in some unrelated KVM changes as well as v5.17-rc3. commit 2268169c14e5f00377512932cf2b7bc78e4577ad Author: Vasily Gorbik Date: Thu Feb 24 16:43:23 2022 +0100 s390: remove unused expoline to BC instructions This reverts commit 6deaa3bbca80 ("s390: extend expoline to BC instructions"). Expolines to BC instructions were added to be utilized by commit de5cb6eb514e ("s390: use expoline thunks in the BPF JIT"). But corresponding code has been removed by commit e1cf4befa297 ("bpf, s390x: remove ld_abs/ld_ind"). And compiler does not generate such expolines as well. Compared to regular expolines, expolines to BC instructions contain displacement and all possible variations cannot be generated in advance, making kpatch support more complicated. So, remove those to avoid future usages. Acked-by: Heiko Carstens Acked-by: Sumanth Korikkar Signed-off-by: Vasily Gorbik arch/s390/include/asm/nospec-insn.h | 57 ------------------------------------- arch/s390/kernel/nospec-branch.c | 25 ++++------------ 2 files changed, 5 insertions(+), 77 deletions(-) commit 7d8484c4151d94f3c1d257e65e0c1a2ec3c945e7 Author: Heiko Carstens Date: Sun Mar 6 11:11:05 2022 +0100 s390/irq: use assignment instead of cast Change struct ext_code to contain a union which allows to simply assign the int_code instead of using a cast. In order to keep the patch small the anonymous union is embedded within the existing struct instead of changing the struct ext_code to a union. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/irq.h | 9 +++++++-- arch/s390/kernel/irq.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) commit 998e78004fe4dd9219b039efe763e19d10d9a6f9 Author: Heiko Carstens Date: Sun Mar 6 10:59:05 2022 +0100 s390/traps: get rid of magic cast for per code Add a proper union in lowcore to reflect architecture and get rid of a "magic" cast in order to read the full per code. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/lowcore.h | 9 +++++++-- arch/s390/kernel/traps.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) commit 52b739e2780c7a15e5be06f1691d92ba5f962f79 Author: Heiko Carstens Date: Sun Mar 6 11:15:27 2022 +0100 s390/traps: get rid of magic cast for program interruption code Add a proper union in lowcore to reflect architecture and get rid of a "magic" cast in order to read the full program interruption code. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/lowcore.h | 9 +++++++-- arch/s390/kernel/traps.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) commit 0ecf337fa2e4a6d1f35d7fbb9efb7ca0069a1683 Author: Heiko Carstens Date: Fri Mar 4 15:15:33 2022 +0100 s390/signal: fix typo in comments Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/kernel/compat_signal.c | 2 +- arch/s390/kernel/signal.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 50b7c4688da9c3c9045c4db58e8a4ace58d28603 Author: Heiko Carstens Date: Fri Mar 4 15:14:06 2022 +0100 s390/asm-offsets: remove unused defines Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/kernel/asm-offsets.c | 5 ----- 1 file changed, 5 deletions(-) commit 6b1ca46ab3aacc905eaaae0f52cb3311f76d7bd6 Author: Vasily Gorbik Date: Thu Mar 3 16:38:34 2022 +0100 s390/test_unwind: avoid build warning with W=1 Fix the following build warning with W=1 arch/s390/lib/test_unwind.c:172:21: warning: variable 'fops' set but not used [-Wunused-but-set-variable] struct ftrace_ops *fops; Reported-by: kernel test robot Signed-off-by: Vasily Gorbik arch/s390/lib/test_unwind.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit df5a95f481c4ef62199fb7e25263a035b4a337d2 Author: Heiko Carstens Date: Mon Feb 28 18:36:46 2022 +0100 s390: remove .fixup section The only user is gone. Remove the section. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/kernel/vmlinux.lds.S | 1 - 1 file changed, 1 deletion(-) commit 7fc8c362e782042bf36ceeb9343f8217d3d7dbb9 Author: Heiko Carstens Date: Sun Feb 27 21:32:54 2022 +0100 s390/bpf: encode register within extable entry Instead of decoding the instruction that faulted to get the register which needs to be zeroed, simply encode its number into the extable entries during code generation. This allows to get rid of a bit of code, and is also what other architectures are doing. Acked-by: Alexander Gordeev Reviewed-by: Ilya Leoshkevich Tested-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/net/bpf_jit_comp.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) commit 484a8ed8b7d145ff38889e4598a4804e9d7e8ca6 Author: Heiko Carstens Date: Mon Feb 28 15:02:46 2022 +0100 s390/extable: add dedicated uaccess handler This is more or less a combination of commit 2e77a62cb3a6 ("arm64: extable: add a dedicated uaccess handler") and commit 4b5305decc84 ("x86/extable: Extend extable functionality"). To describe the problem that needs to solved let's cite the full arm64 commit message: ------ For inline assembly, we place exception fixups out-of-line in the `.fixup` section such that these are out of the way of the fast path. This has a few drawbacks: * Since the fixup code is anonymous, backtraces will symbolize fixups as offsets from the nearest prior symbol, currently `__entry_tramp_text_end`. This is confusing, and painful to debug without access to the relevant vmlinux. * Since the exception handler adjusts the PC to execute the fixup, and the fixup uses a direct branch back into the function it fixes, backtraces of fixups miss the original function. This is confusing, and violates requirements for RELIABLE_STACKTRACE (and therefore LIVEPATCH). * Inline assembly and associated fixups are generated from templates, and we have many copies of logically identical fixups which only differ in which specific registers are written to and which address is branched to at the end of the fixup. This is potentially wasteful of I-cache resources, and makes it hard to add additional logic to fixups without significant bloat. This patch address all three concerns for inline uaccess fixups by adding a dedicated exception handler which updates registers in exception context and subsequent returns back into the function which faulted, removing the need for fixups specialized to each faulting instruction. Other than backtracing, there should be no functional change as a result of this patch. ------ Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/asm-extable.h | 27 +++++++++++++++++++++++++++ arch/s390/include/asm/uaccess.h | 24 ++++++------------------ arch/s390/mm/extable.c | 10 ++++++++++ 3 files changed, 43 insertions(+), 18 deletions(-) commit 3d66718cd62d45f3210f047248eab9e76d227e47 Author: Heiko Carstens Date: Mon Feb 28 14:52:42 2022 +0100 s390/extable: convert to relative table with data Follow arm64, riscv, and x86 and change extable layout to common "relative table with data". This allows to get rid of s390 specific code in sorttable.c. The main difference to before is that extable entries do not contain a relative function pointer anymore. Instead data and type fields are added. The type field is used to indicate which exception handler needs to be called, while the data field is currently unused. Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/asm-extable.h | 15 ++++++++----- arch/s390/include/asm/extable.h | 36 +++++++++++++++---------------- arch/s390/mm/extable.c | 21 ++++++++++++------ arch/s390/net/bpf_jit_comp.c | 5 ++--- scripts/sorttable.c | 43 +------------------------------------ 5 files changed, 46 insertions(+), 74 deletions(-) commit 46fee16f571250d6cef74af73ffd47512da981a2 Author: Heiko Carstens Date: Mon Feb 28 14:29:25 2022 +0100 s390/extable: add and use fixup_exception helper function Add and use fixup_exception helper function in order to remove the duplicated exception handler fixup code at several places. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/extable.h | 13 ++----------- arch/s390/kernel/early.c | 6 +----- arch/s390/kernel/kprobes.c | 5 +---- arch/s390/kernel/traps.c | 10 ++-------- arch/s390/mm/extable.c | 15 +++++++++++++++ arch/s390/mm/fault.c | 7 +------ 6 files changed, 22 insertions(+), 34 deletions(-) commit cfa45c5e0d36b87f99e76f1060526eac032dd624 Author: Heiko Carstens Date: Mon Feb 28 13:31:33 2022 +0100 s390/base: pass pt_regs to early program check handler Pass pt_regs to early program check handler like it is done for every other interrupt and exception handler. Also the passed pt_regs can be changed by the called function and the changes register contents and psw contents will be taken into account when returning. In addition the return psw will not be copied to the program check old psw in lowcore, but to the usual return psw location, like it is also done by the regular program check handler. This allows also to get rid of the code that disabled lowcore protection when changing the return address. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/processor.h | 2 +- arch/s390/kernel/base.S | 22 ++++++++++++++++------ arch/s390/kernel/early.c | 14 +++----------- 3 files changed, 20 insertions(+), 18 deletions(-) commit 0741ec112ca67ea95dc8158a7bc7547ae36cbecc Author: Heiko Carstens Date: Mon Feb 28 11:37:52 2022 +0100 s390/extable: move extable related functions to mm/extable.c Just like arm64, riscv, and x86 move extable related functions to mm/extable.c. This is currently only one function, but this will change with subsequent changes. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/mm/Makefile | 2 +- arch/s390/mm/extable.c | 16 ++++++++++++++++ arch/s390/mm/fault.c | 12 ------------ 3 files changed, 17 insertions(+), 13 deletions(-) commit d09a307fde1c943d23ccb9fecc9a0e1a569732ad Author: Heiko Carstens Date: Mon Feb 28 11:22:12 2022 +0100 s390/extable: move EX_TABLE define to asm-extable.h Follow arm64 and riscv and move the EX_TABLE define to asm-extable.h which is a lot less generic than the current linkage.h. Also make sure that all files which contain EX_TABLE usages actually include the new header file. This should make sure that the files always compile and there won't be any random compile breakage due to other header file dependencies. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/hypfs/hypfs_vm.c | 1 + arch/s390/include/asm/ap.h | 1 + arch/s390/include/asm/asm-extable.h | 21 +++++++++++++++++++++ arch/s390/include/asm/cpu_mf.h | 1 + arch/s390/include/asm/diag.h | 1 + arch/s390/include/asm/fpu/api.h | 1 + arch/s390/include/asm/futex.h | 1 + arch/s390/include/asm/linkage.h | 18 ------------------ arch/s390/include/asm/mmu.h | 1 + arch/s390/include/asm/uaccess.h | 1 + arch/s390/kernel/diag.c | 1 + arch/s390/kernel/early.c | 1 + arch/s390/kernel/entry.S | 1 + arch/s390/kernel/entry.h | 1 + arch/s390/kernel/ipl.c | 1 + arch/s390/kernel/sysinfo.c | 1 + arch/s390/kernel/text_amode31.S | 1 + arch/s390/kernel/traps.c | 1 + arch/s390/lib/uaccess.c | 1 + arch/s390/mm/fault.c | 1 + arch/s390/mm/maccess.c | 1 + arch/s390/mm/page-states.c | 1 + arch/s390/net/bpf_jit_comp.c | 1 + arch/s390/pci/pci_clp.c | 1 + arch/s390/pci/pci_insn.c | 1 + arch/s390/pci/pci_mmio.c | 1 + drivers/s390/block/dasd_diag.c | 2 +- drivers/s390/char/diag_ftp.c | 1 + drivers/s390/char/sclp.h | 1 + drivers/s390/cio/ioasm.c | 1 + 30 files changed, 49 insertions(+), 19 deletions(-) commit 1952954569d1907eaf6df4b15bb23969e57b6599 Author: Heiko Carstens Date: Mon Feb 28 10:53:34 2022 +0100 s390/extable: search amode31 extable last It is very unlikely that an exception happens within the amode31 text section, therefore safe a couple of cycles for the common case, and search the amode31 extable last. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/mm/fault.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit a156f09c9063bc6c11502fc49a6d006489f25eb3 Author: Heiko Carstens Date: Mon Feb 28 10:45:43 2022 +0100 s390/extable: sort amode31 extable early The early program check handler is active before the amode31 extable is sorted. Therefore in case a program check happens early within the amode31 code the extable entry might not be found. Fix this by sorting the amode31 extable early. Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/kernel/early.c | 6 ++++++ arch/s390/kernel/traps.c | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) commit 9d792ef17f18734bca823910b89254dec37b50c5 Author: Halil Pasic Date: Tue Dec 14 15:54:16 2021 +0100 s390/airq: use DMA memory for summary indicators Protected virtualization guests have to use shared pages for airq notifier bit vectors and summary bytes or bits, thus these need to be allocated as DMA coherent memory. Commit b50623e5db80 ("s390/airq: use DMA memory for adapter interrupts") took care of the notifier bit vectors, but omitted to take care of the summary bytes/bits. In practice this omission is not a big deal, because the summary ain't necessarily allocated here, but can be supplied by the driver. Currently all the I/O we have for SE guests is virtio-ccw, and virtio-ccw uses a self-allocated array of summary indicators. Let us cover all our bases nevertheless! Signed-off-by: Halil Pasic Reviewed-by: Harald Freudenberger Signed-off-by: Vasily Gorbik drivers/s390/cio/airq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1024063effc3ba86d1fec0f2ee0a9259a1065ed5 Author: Jürgen Christ Date: Mon Jan 10 13:33:30 2022 +0100 s390/zcrypt: Provide target domain for EP11 cprbs to scheduling function The scheduling function will get an extension which will process the target_id value from an EP11 cprb. This patch extracts the value during preparation of the ap message. Signed-off-by: Jürgen Christ Signed-off-by: Harald Freudenberger Signed-off-by: Vasily Gorbik drivers/s390/crypto/zcrypt_api.c | 4 ++-- drivers/s390/crypto/zcrypt_msgtype6.c | 10 +++++++--- drivers/s390/crypto/zcrypt_msgtype6.h | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) commit 252a1ff777639ad13978a614f2cde1f0c43a7c2f Author: Harald Freudenberger Date: Tue Nov 23 16:02:47 2021 +0100 s390/zcrypt: change reply buffer size offering Instead of offering the user space given receive buffer size to the crypto card firmware as limit for the reply message offer the internal per queue reply buffer size. As the queue's reply buffer is always adjusted to the max message size possible for this card this may offer more buffer space. However, now it is important to check the user space reply buffer on pushing back the reply. If the reply does not fit into the user space provided buffer the ioctl will fail with errno EMSGSIZE. Signed-off-by: Harald Freudenberger Reviewed-by: Jürgen Christ Signed-off-by: Vasily Gorbik drivers/s390/crypto/zcrypt_msgtype6.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) commit 383366b58016361cc8a2e4c585b7d581eb76263a Author: Harald Freudenberger Date: Tue Nov 23 15:16:06 2021 +0100 s390/zcrypt: Support CPRB minor version T7 There is a new CPRB minor version T7 to be supported with this patch. Together with this the functions which extract the CPRB data from userspace and prepare the AP message do now check the CPRB minor version and provide some info in the flag field of the ap message struct for further processing. The 3 functions doing this job have been renamed to prep_cca_ap_msg, prep_ep11_ap_msg and prep_rng_ap_msg to reflect their job better (old was get..fc). This patch also introduces two new flags to be used internal with the flag field of the struct ap_message: AP_MSG_FLAG_USAGE is set when prep_cca_ap_msg or prep_ep11_ap_msg come to the conclusion that this is a ordinary crypto load CPRB (which means T2 for CCA CPRBs and no admin bit for EP11 CPRBs). AP_MSG_FLAG_ADMIN is set when prep_cca_ap_msg or prep_ep11_ap_msg think, this is an administrative (control) crypto load CPRB (which means T3, T5, T6 or T7 for CCA CPRBs and admin bit set for EP11 CPRBs). Signed-off-by: Harald Freudenberger Reviewed-by: Jürgen Christ Signed-off-by: Vasily Gorbik drivers/s390/crypto/ap_bus.h | 4 ++- drivers/s390/crypto/zcrypt_api.c | 6 ++-- drivers/s390/crypto/zcrypt_msgtype50.c | 4 +-- drivers/s390/crypto/zcrypt_msgtype50.h | 4 +-- drivers/s390/crypto/zcrypt_msgtype6.c | 56 +++++++++++++++++++++++++--------- drivers/s390/crypto/zcrypt_msgtype6.h | 13 +++++--- 6 files changed, 60 insertions(+), 27 deletions(-) commit a7e701dba1234adbfbacad5ce19656c5606728da Author: Harald Freudenberger Date: Wed Nov 17 15:38:39 2021 +0100 s390/zcrypt: handle checkstopped cards with new state A crypto card may be in checkstopped state. With this patch this is handled as a new state in the ap card and ap queue structs. There is also a new card sysfs attribute /sys/devices/ap/cardxx/chkstop and a new queue sysfs attribute /sys/devices/ap/cardxx/xx.yyyy/chkstop displaying the checkstop state of the card or queue. Please note that the queue's checkstop state is only a copy of the card's checkstop state but makes maintenance much easier. The checkstop state expressed here is the result of an RC 0x04 (CHECKSTOP) during an AP command, mostly the PQAP(TAPQ) command which is 'testing' the queue. Signed-off-by: Harald Freudenberger Reviewed-by: Jürgen Christ Signed-off-by: Vasily Gorbik drivers/s390/crypto/ap_bus.c | 78 ++++++++++++++++++++++++++++++++-------- drivers/s390/crypto/ap_bus.h | 2 ++ drivers/s390/crypto/ap_card.c | 11 ++++++ drivers/s390/crypto/ap_queue.c | 18 +++++++++- drivers/s390/crypto/zcrypt_api.c | 26 +++++++------- 5 files changed, 105 insertions(+), 30 deletions(-) commit 985214af939b9935dac94aa6fb56c85039fb77e8 Author: Harald Freudenberger Date: Tue Nov 16 14:54:19 2021 +0100 s390/zcrypt: CEX8S exploitation support This patch adds CEX8 exploitation support for the AP bus code, the zcrypt device driver zoo and the vfio device driver. Signed-off-by: Harald Freudenberger Reviewed-by: Jürgen Christ Signed-off-by: Vasily Gorbik arch/s390/include/uapi/asm/zcrypt.h | 2 +- drivers/s390/crypto/ap_bus.c | 12 +++---- drivers/s390/crypto/ap_bus.h | 1 + drivers/s390/crypto/vfio_ap_drv.c | 2 ++ drivers/s390/crypto/zcrypt_cex4.c | 71 ++++++++++++++++++++++++++----------- 5 files changed, 61 insertions(+), 27 deletions(-) commit d64e5e9120a6afc8ebb9e9b46c1302f13b16b68d Author: Harald Freudenberger Date: Thu Nov 11 14:31:46 2021 +0100 s390/ap/zcrypt: debug feature improvements This patch adds some debug feature improvements related to some failures happened in the past. With CEX8 the max request and response sizes have been extended but the user space applications did not rework their code and thus ran into receive buffer issues. This ffdc patch here helps with additional checks and debug feature messages in debugging and pointing to the root cause of some failures related to wrong buffer sizes. Signed-off-by: Harald Freudenberger Reviewed-by: Jürgen Christ Signed-off-by: Vasily Gorbik drivers/s390/crypto/ap_queue.c | 3 ++- drivers/s390/crypto/zcrypt_api.c | 19 +++++++++++++++++++ drivers/s390/crypto/zcrypt_msgtype50.c | 8 ++++++++ drivers/s390/crypto/zcrypt_msgtype6.c | 32 +++++++++++++++++++++++++++++--- 4 files changed, 58 insertions(+), 4 deletions(-) commit 72f00505f2d2eced9789e98ca081f8229f03b2ed Author: Dan Carpenter Date: Mon Mar 7 17:13:18 2022 +0300 ptp: ocp: off by in in ptp_ocp_tod_gnss_name() The > ARRAY_SIZE() needs to be >= ARRAY_SIZE() to prevent an out of bounds access. Fixes: 9f492c4cb235 ("ptp: ocp: add TOD debug information") Signed-off-by: Dan Carpenter Acked-by: Richard Cochran Acked-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220307141318.GA18867@kili Signed-off-by: Jakub Kicinski drivers/ptp/ptp_ocp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f96272a90d9eaea9933aaab704ddbd258feb3841 Author: Frederic Weisbecker Date: Tue Feb 8 17:16:35 2022 +0100 lib/irq_poll: Declare IRQ_POLL softirq vector as ksoftirqd-parking safe The following warning may appear while setting a CPU down: NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #20!!! The IRQ_POLL_SOFTIRQ vector can be raised during the hotplug cpu_down() path after ksoftirqd is parked and before the CPU actually dies. However this is handled afterward at the CPUHP_IRQ_POLL_DEAD stage where the queue gets migrated. Hence this warning can be considered spurious and the vector can join the "hotplug-safe" list. Reported-and-tested-by: Paul Menzel Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Paul E. McKenney Cc: Paul Menzel include/linux/interrupt.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit a2d266a8f1fc9c0576e4407c4d5dee83ee29d6f0 Merge: 4d558d4d88af 62dc30150c06 Author: Arnd Bergmann Date: Mon Mar 7 23:47:47 2022 +0100 Merge tag 'v5.17-next-soc.2' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/drivers mmsys: fix compilation by adding SW reset infrastructure * tag 'v5.17-next-soc.2' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: mmsys: add sw0_rst_offset in mmsys driver data Link: https://lore.kernel.org/r/e1b90372-a041-db6e-f35a-d17b26069e40@gmail.com Signed-off-by: Arnd Bergmann commit 0345691b24c076655ce8f0f4bfd24cba3467ccbd Author: Frederic Weisbecker Date: Tue Feb 8 17:16:34 2022 +0100 tick/rcu: Stop allowing RCU_SOFTIRQ in idle RCU_SOFTIRQ used to be special in that it could be raised on purpose within the idle path to prevent from stopping the tick. Some code still prevents from unnecessary warnings related to this specific behaviour while entering in dynticks-idle mode. However the nohz layout has changed quite a bit in ten years, and the removal of CONFIG_RCU_FAST_NO_HZ has been the final straw to this safe-conduct. Now the RCU_SOFTIRQ vector is expected to be raised from sane places. A remaining corner case is admitted though when the vector is invoked in fragile hotplug path. Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Paul E. McKenney Cc: Paul Menzel include/linux/interrupt.h | 8 +++++++- kernel/time/tick-sched.c | 50 +++++++++++++++++++++++++++++++++++++---------- 2 files changed, 47 insertions(+), 11 deletions(-) commit 2984539959dbaf4e65e19bf90c2419304a81a985 Author: Frederic Weisbecker Date: Tue Feb 8 17:16:33 2022 +0100 tick/rcu: Remove obsolete rcu_needs_cpu() parameters With the removal of CONFIG_RCU_FAST_NO_HZ, the parameters in rcu_needs_cpu() are not necessary anymore. Simply remove them. Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Paul E. McKenney Cc: Paul Menzel include/linux/rcutiny.h | 3 +-- include/linux/rcutree.h | 2 +- kernel/rcu/tree.c | 3 +-- kernel/time/tick-sched.c | 10 ++++------ 4 files changed, 7 insertions(+), 11 deletions(-) commit a1ff03cd6fb9c501fff63a4a2bface9adcfa81cd Author: Frederic Weisbecker Date: Wed Feb 2 01:01:07 2022 +0100 tick: Detect and fix jiffies update stall On some rare cases, the timekeeper CPU may be delaying its jiffies update duty for a while. Known causes include: * The timekeeper is waiting on stop_machine in a MULTI_STOP_DISABLE_IRQ or MULTI_STOP_RUN state. Disabled interrupts prevent from timekeeping updates while waiting for the target CPU to complete its stop_machine() callback. * The timekeeper vcpu has VMEXIT'ed for a long while due to some overload on the host. Detect and fix these situations with emergency timekeeping catchups. Original-patch-by: Paul E. McKenney Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner kernel/time/tick-sched.c | 17 +++++++++++++++++ kernel/time/tick-sched.h | 4 ++++ 2 files changed, 21 insertions(+) commit e33c89256e66ba64ce5190c7f2c2741e619c6321 Author: Joey Gouly Date: Tue Mar 1 10:14:35 2022 +0000 Revert "arm64: Mitigate MTE issues with str{n}cmp()" This reverts commit 59a68d4138086c015ab8241c3267eec5550fbd44. Now that the str{n}cmp functions have been updated to handle MTE properly, the workaround to use the generic functions is no longer needed. Signed-off-by: Joey Gouly Cc: Robin Murphy Cc: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Acked-by: Mark Rutland Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220301101435.19327-4-joey.gouly@arm.com Signed-off-by: Will Deacon arch/arm64/include/asm/assembler.h | 5 ----- arch/arm64/include/asm/string.h | 2 -- arch/arm64/lib/strcmp.S | 2 +- arch/arm64/lib/strncmp.S | 2 +- 4 files changed, 2 insertions(+), 9 deletions(-) commit 387d828adffcf1eb949f3141079c479793c59aac Author: Joey Gouly Date: Tue Mar 1 10:14:34 2022 +0000 arm64: lib: Import latest version of Arm Optimized Routines' strncmp Import the latest version of the Arm Optimized Routines strncmp function based on the upstream code of string/aarch64/strncmp.S at commit 189dfefe37d5 from: https://github.com/ARM-software/optimized-routines This latest version includes MTE support. Note that for simplicity Arm have chosen to contribute this code to Linux under GPLv2 rather than the original MIT OR Apache-2.0 WITH LLVM-exception license. Arm is the sole copyright holder for this code. Signed-off-by: Joey Gouly Cc: Robin Murphy Cc: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Acked-by: Mark Rutland Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220301101435.19327-3-joey.gouly@arm.com Signed-off-by: Will Deacon arch/arm64/lib/strncmp.S | 234 ++++++++++++++++++++++++++++------------------- 1 file changed, 141 insertions(+), 93 deletions(-) commit 507f788d05e7fba6cf478ffa1c99f5c2b0020f63 Author: Joey Gouly Date: Tue Mar 1 10:14:33 2022 +0000 arm64: lib: Import latest version of Arm Optimized Routines' strcmp Import the latest version of the Arm Optimized Routines strcmp function based on the upstream code of string/aarch64/strcmp.S at commit 189dfefe37d5 from: https://github.com/ARM-software/optimized-routines This latest version includes MTE support. Note that for simplicity Arm have chosen to contribute this code to Linux under GPLv2 rather than the original MIT OR Apache-2.0 WITH LLVM-exception license. Arm is the sole copyright holder for this code. Signed-off-by: Joey Gouly Cc: Robin Murphy Cc: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Acked-by: Mark Rutland Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220301101435.19327-2-joey.gouly@arm.com Signed-off-by: Will Deacon arch/arm64/lib/strcmp.S | 238 +++++++++++++++++++++++++----------------------- 1 file changed, 126 insertions(+), 112 deletions(-) commit e2dc49ef6c6b0e76c6d37cbec1161662570044e7 Author: Mark Brown Date: Thu Mar 3 19:28:17 2022 +0000 kselftest/arm64: Log the PIDs of the parent and child in sve-ptrace If the test triggers a problem it may well result in a log message from the kernel such as a WARN() or BUG(). If these include a PID it can help with debugging to know if it was the parent or child process that triggered the issue, since the test is just creating a new thread the process name will be the same either way. Print the PIDs of the parent and child on startup so users have this information to hand should it be needed. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220303192817.2732509-1-broonie@kernel.org Signed-off-by: Will Deacon tools/testing/selftests/arm64/fp/sve-ptrace.c | 2 ++ 1 file changed, 2 insertions(+) commit 24a147bcef8ca039cb75d6d4b68c7cc339b11178 Author: Linu Cherian Date: Mon Mar 7 20:00:14 2022 +0530 irqchip/gic-v3: Workaround Marvell erratum 38545 when reading IAR When a IAR register read races with a GIC interrupt RELEASE event, GIC-CPU interface could wrongly return a valid INTID to the CPU for an interrupt that is already released(non activated) instead of 0x3ff. As a side effect, an interrupt handler could run twice, once with interrupt priority and then with idle priority. As a workaround, gic_read_iar is updated so that it will return a valid interrupt ID only if there is a change in the active priority list after the IAR read on all the affected Silicons. Since there are silicon variants where both 23154 and 38545 are applicable, workaround for erratum 23154 has been extended to address both of them. Signed-off-by: Linu Cherian Reviewed-by: Marc Zyngier Acked-by: Catalin Marinas Link: https://lore.kernel.org/r/20220307143014.22758-1-lcherian@marvell.com Signed-off-by: Will Deacon Documentation/arm64/silicon-errata.rst | 2 +- arch/arm64/Kconfig | 8 ++++++-- arch/arm64/include/asm/arch_gicv3.h | 23 +++++++++++++++++++++-- arch/arm64/include/asm/cputype.h | 13 +++++++++++++ arch/arm64/kernel/cpu_errata.c | 20 +++++++++++++++++--- 5 files changed, 58 insertions(+), 8 deletions(-) commit 1310222c276b7946e440a7ab49c1e1508561f5fd Author: Anshuman Khandual Date: Wed Feb 16 10:36:52 2022 +0530 arm64/mm: Drop use_1G_block() pud_sect_supported() already checks for PUD level block mapping support i.e on ARM64_4K_PAGES config. Hence pud_sect_supported(), along with some other required alignment checks can help completely drop use_1G_block(). Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/1644988012-25455-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Will Deacon arch/arm64/mm/mmu.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) commit cf5a501d985ba1b6ace9b18c64346441819bffea Author: Muchun Song Date: Wed Mar 2 16:46:23 2022 +0800 arm64: avoid flushing icache multiple times on contiguous HugeTLB When a contiguous HugeTLB page is mapped, set_pte_at() will be called CONT_PTES/CONT_PMDS times. Therefore, __sync_icache_dcache() will flush cache multiple times if the page is executable (to ensure the I-D cache coherency). However, the first flushing cache already covers subsequent cache flush operations. So only flusing cache for the head page if it is a HugeTLB page to avoid redundant cache flushing. In the next patch, it is also depends on this change since the tail vmemmap pages of HugeTLB is mapped with read-only meanning only head page struct can be modified. Signed-off-by: Muchun Song Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220302084624.33340-1-songmuchun@bytedance.com Signed-off-by: Will Deacon arch/arm64/mm/flush.c | 7 +++++++ 1 file changed, 7 insertions(+) commit f2c281204b47309534f26dc63cee2a130c2b497b Author: Mark Brown Date: Mon Mar 7 18:08:59 2022 +0000 arm64: cpufeature: Warn if we attempt to read a zero width field Add a WARN_ON_ONCE() when extracting a field if no width is specified. This should never happen outside of development since it will be triggered with or without the feature so long as the relevant ID register is present. If the warning triggers hope that the field was the standard 4 bits wide and soldier on. Suggested-by: Marc Zyngier Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220307180900.3045812-1-broonie@kernel.org Signed-off-by: Will Deacon arch/arm64/include/asm/cpufeature.h | 2 ++ 1 file changed, 2 insertions(+) commit b8fc780137b4b2d7b84d75488b429fd882e0dd3b Author: Mark Brown Date: Wed Mar 2 13:42:25 2022 +0000 arm64: cpufeature: Add missing .field_width for GIC system registers This was missed when making specification of a field standard. Fixes: 0a2eec83c2c23cf6 ("arm64: cpufeature: Always specify and use a field width for capabilities") Reported-by: Qian Cai Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220302134225.159217-1-broonie@kernel.org Signed-off-by: Will Deacon arch/arm64/kernel/cpufeature.c | 1 + 1 file changed, 1 insertion(+) commit 0a32c88ddb9af30e8a16d41d7b9b824c27d29459 Author: David Engraf Date: Fri Feb 25 11:40:08 2022 +0100 arm64: signal: nofpsimd: Do not allocate fp/simd context when not available Commit 6d502b6ba1b2 ("arm64: signal: nofpsimd: Handle fp/simd context for signal frames") introduced saving the fp/simd context for signal handling only when support is available. But setup_sigframe_layout() always reserves memory for fp/simd context. The additional memory is not touched because preserve_fpsimd_context() is not called and thus the magic is invalid. This may lead to an error when parse_user_sigframe() checks the fp/simd area and does not find a valid magic number. Signed-off-by: David Engraf Reviwed-by: Mark Brown Fixes: 6d502b6ba1b267b3 ("arm64: signal: nofpsimd: Handle fp/simd context for signal frames") Cc: # 5.6.x Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20220225104008.820289-1-david.engraf@sysgo.com Signed-off-by: Will Deacon arch/arm64/kernel/signal.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) commit 614c0b9fee711dd89b1dd65c88ba83612a373fdc Author: Mark Rutland Date: Thu Feb 24 18:10:28 2022 +0000 arm64: prevent instrumentation of bp hardening callbacks We may call arm64_apply_bp_hardening() early during entry (e.g. in el0_ia()) before it is safe to run instrumented code. Unfortunately this may result in running instrumented code in two cases: * The hardening callbacks called by arm64_apply_bp_hardening() are not marked as `noinstr`, and have been observed to be instrumented when compiled with either GCC or LLVM. * Since arm64_apply_bp_hardening() itself is only marked as `inline` rather than `__always_inline`, it is possible that the compiler decides to place it out-of-line, whereupon it may be instrumented. For example, with defconfig built with clang 13.0.0, call_hvc_arch_workaround_1() is compiled as: | : | d503233f paciasp | f81f0ffe str x30, [sp, #-16]! | 320183e0 mov w0, #0x80008000 | d503201f nop | d4000002 hvc #0x0 | f84107fe ldr x30, [sp], #16 | d50323bf autiasp | d65f03c0 ret ... but when CONFIG_FTRACE=y and CONFIG_KCOV=y this is compiled as: | : | d503245f bti c | d503201f nop | d503201f nop | d503233f paciasp | a9bf7bfd stp x29, x30, [sp, #-16]! | 910003fd mov x29, sp | 94000000 bl 0 <__sanitizer_cov_trace_pc> | 320183e0 mov w0, #0x80008000 | d503201f nop | d4000002 hvc #0x0 | a8c17bfd ldp x29, x30, [sp], #16 | d50323bf autiasp | d65f03c0 ret ... with a patchable function entry registered with ftrace, and a direct call to __sanitizer_cov_trace_pc(). Neither of these are safe early during entry sequences. This patch avoids the unsafe instrumentation by marking arm64_apply_bp_hardening() as `__always_inline` and by marking the hardening functions as `noinstr`. This avoids the potential for instrumentation, and causes clang to consistently generate the function as with the defconfig sample. Note: in the defconfig compilation, when CONFIG_SVE=y, x30 is spilled to the stack without being placed in a frame record, which will result in a missing entry if call_hvc_arch_workaround_1() is backtraced. Similar is true of qcom_link_stack_sanitisation(), where inline asm spills the LR to a GPR prior to corrupting it. This is not a significant issue presently as we will only backtrace here if an exception is taken, and in such cases we may omit entries for other reasons today. The relevant hardening functions were introduced in commits: ec82b567a74fbdff ("arm64: Implement branch predictor hardening for Falkor") b092201e00206141 ("arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support") ... and these were subsequently moved in commit: d4647f0a2ad71110 ("arm64: Rewrite Spectre-v2 mitigation code") The arm64_apply_bp_hardening() function was introduced in commit: 0f15adbb2861ce6f ("arm64: Add skeleton to harden the branch predictor against aliasing attacks") ... and was subsequently moved and reworked in commit: 6279017e807708a0 ("KVM: arm64: Move BP hardening helpers into spectre.h") Fixes: ec82b567a74fbdff ("arm64: Implement branch predictor hardening for Falkor") Fixes: b092201e00206141 ("arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support") Fixes: d4647f0a2ad71110 ("arm64: Rewrite Spectre-v2 mitigation code") Fixes: 0f15adbb2861ce6f ("arm64: Add skeleton to harden the branch predictor against aliasing attacks") Fixes: 6279017e807708a0 ("KVM: arm64: Move BP hardening helpers into spectre.h") Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Catalin Marinas Cc: James Morse Cc: Marc Zyngier Cc: Mark Brown Cc: Will Deacon Acked-by: Marc Zyngier Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20220224181028.512873-1-mark.rutland@arm.com Signed-off-by: Will Deacon arch/arm64/include/asm/spectre.h | 3 ++- arch/arm64/kernel/proton-pack.c | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) commit 2369f171d5c5550b85ce96fd35d4438cf2e6b09e Author: Huang Shijie Date: Wed Feb 9 09:26:42 2022 +0000 arm64: crash_core: Export MODULES, VMALLOC, and VMEMMAP ranges The following interrelated ranges are needed by the kdump crash tool: MODULES_VADDR ~ MODULES_END, VMALLOC_START ~ VMALLOC_END, VMEMMAP_START ~ VMEMMAP_END Since these values change from time to time, it is preferable to export them via vmcoreinfo than to change the crash's code frequently. Signed-off-by: Huang Shijie Link: https://lore.kernel.org/r/20220209092642.9181-1-shijie@os.amperecomputing.com Signed-off-by: Will Deacon Documentation/admin-guide/kdump/vmcoreinfo.rst | 8 ++++++++ arch/arm64/kernel/crash_core.c | 6 ++++++ 2 files changed, 14 insertions(+) commit 97dfad194ca8de04c7292d4f4c8dc493c0d20f85 Author: Robin Murphy Date: Thu Feb 17 14:24:15 2022 +0000 iommu/arm-smmu: Account for PMU interrupts In preparation for SMMUv2 PMU support, rejig our IRQ setup code to account for PMU interrupts as additional resources. We can simplify the whole flow by only storing the context IRQs, since the global IRQs are devres-managed and we never refer to them beyond the initial request. CC: Lad Prabhakar Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/b2a40caaf1622eb35c555074a0d72f4f0513cff9.1645106346.git.robin.murphy@arm.com Signed-off-by: Will Deacon drivers/iommu/arm/arm-smmu/arm-smmu.c | 93 +++++++++++++++++------------------ drivers/iommu/arm/arm-smmu/arm-smmu.h | 5 +- 2 files changed, 46 insertions(+), 52 deletions(-) commit a45194b9de18671adf4acb1741c64298bf32006b Author: Krzysztof Kozlowski Date: Mon Mar 7 18:29:01 2022 +0100 MAINTAINERS: dt-bindings: update Krzysztof Kozlowski's email Use Krzysztof Kozlowski's @kernel.org account in dt-bindings maintainer entry. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220307172901.156929-1-krzysztof.kozlowski@canonical.com MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9fce18ab0bc20fd7c00c6bc880ed7aaea655918b Merge: 5e36946abcfb a50b7926d015 Author: Mark Brown Date: Mon Mar 7 20:37:00 2022 +0000 ASoC: fsl_sai: Cleanups and 1:1 bclk:mclk ratio support Merge series from Sascha Hauer : This series has some updates for the fsl_sai driver: Some general cleanup patches, a bugfix in the ip revision checking and finally the mclk setting is made more accurate and support for 1:1 bclk:mclk setting is added. commit 5e36946abcfb566bd8126caba62389d79415ca2b Merge: 2f4d6de53327 0f33105bb2f7 Author: Mark Brown Date: Mon Mar 7 20:36:58 2022 +0000 ASoC: SOF: updates for 5.18 Merge series from Pierre-Louis Bossart : A couple of updates for Intel and AMD hardware, along with minor cleanups Ajit Kumar Pandey (4): ASoC: SOF: amd: Flush cache after ATU_BASE_ADDR_GRP register update ASoC: SOF: amd: Use semaphore register to synchronize ipc's irq ASoC: SOF: amd: Move group register configuration to acp-loader ASoC: SOF: amd: Increase ACP_HW_SEM_RETRY_COUNT value Curtis Malainey (1): ASoC: SOF: fix 32 signed bit overflow Gongjun Song (1): ASoC: SOF: Intel: pci-tgl: add RPL-S support Peter Ujfalusi (2): ASoC: SOF: amd: acp-pcm: Take buffer information directly from runtime ASoC: SOF: amd: Do not set ipc_pcm_params ops as it is optional Pierre-Louis Bossart (2): ASoC: SOF: debug: clarify operator precedence ASoC: SOF: Intel: hda: clarify operator precedence include/sound/sof/header.h | 2 +- include/uapi/sound/sof/abi.h | 2 +- sound/soc/sof/amd/acp-dsp-offset.h | 1 + sound/soc/sof/amd/acp-ipc.c | 22 ++++++++++++++-------- sound/soc/sof/amd/acp-loader.c | 9 +++++++++ sound/soc/sof/amd/acp-pcm.c | 7 ++++--- sound/soc/sof/amd/acp-stream.c | 3 +++ sound/soc/sof/amd/acp.c | 29 ++++++++++++++--------------- sound/soc/sof/amd/acp.h | 3 +-- sound/soc/sof/amd/renoir.c | 1 - sound/soc/sof/debug.c | 2 +- sound/soc/sof/intel/hda.c | 2 +- sound/soc/sof/intel/pci-tgl.c | 2 ++ 13 files changed, 52 insertions(+), 33 deletions(-) -- 2.30.2 commit 2f4d6de5332753a6a45fade4a56cd08c37626497 Merge: 3066987e11d3 ce73ef6ec671 Author: Mark Brown Date: Mon Mar 7 20:36:57 2022 +0000 ASoC: Intel: boards: cleanups for 5.18 Merge series from Pierre-Louis Bossart : Updates to clean-up the GPIOLIB dependency and a quirk for HP SoundWire devices. commit 3066987e11d3997db8212c6ed0aebaac0899dd5b Merge: fc14fac286a0 1e974e5b82b3 Author: Mark Brown Date: Mon Mar 7 20:36:55 2022 +0000 ASoC: audio_graph_card2: Support variable slot widths Merge series from Richard Fitzgerald : This adds support for I2S/TDM links where the slot width varies depending on the sample width, in a way that cannot be guessed by component hw_params(). A typical example is: - 16-bit samples use 16-bit slots - 24-bit samples use 32-bit slots There is no way for a component hw_params() to deduce from the information it is passed that 24-bit samples will be in 32-bit slots. Some audio hardware cannot support a fixed slot width or a slot width equal to the sample width in all cases. This is usually due either to limitations of the audio serial port or system clocking restrictions. commit fc14fac286a05d36202f8114d00a9935ca2e0756 Merge: 468f252930d8 6b4528b5532f Author: Mark Brown Date: Mon Mar 7 20:36:54 2022 +0000 ASoC: codecs: Add Awinic AW8738 audio amplifier driver Merge series from Stephan Gerhold : This series adds a simple driver and DT schema for the Awinic AW8738 audio amplifier. It's fairly simple - the main difference to simple-amplifier is that there is a "one-wire pulse control" that allows configuring the amplifier to one of a few pre-defined modes. This can be used to configure the speaker-guard function (primarily the power limit for the amplifier). commit 5b835d4cade1723c5944a231cc685801f5a5cc6c Author: Max Filippov Date: Sat Mar 5 21:05:54 2022 -0800 xtensa: use XCHAL_NUM_AREGS as pt_regs::areg size struct pt_regs is used to access both kernel and user exception frames. User exception frames may contain up to XCHAL_NUM_AREG registers that task creation and signal delivery code may access, but pt_regs::areg array has only 16 entries that cover only the kernel exception frame. This results in the following build error: arch/xtensa/kernel/process.c: In function 'copy_thread': arch/xtensa/kernel/process.c:262:52: error: array subscript 53 is above array bounds of 'long unsigned int[16]' [-Werror=array-bounds] 262 | put_user(regs->areg[caller_ars+1], Change struct pt_regs::areg size to XCHAL_NUM_AREGS so that it covers the whole user exception frame. Adjust task_pt_regs and drop additional register copying code from copy_thread now that the whole user exception stack frame is copied. Reported-by: Kees Cook Signed-off-by: Max Filippov Reviewed-by: Kees Cook arch/xtensa/include/asm/ptrace.h | 7 +++---- arch/xtensa/kernel/process.c | 10 ---------- 2 files changed, 3 insertions(+), 14 deletions(-) commit 6fad9ddc7d9f6dfb8a53c192f746c26e0d72ee35 Author: Max Filippov Date: Sat Mar 5 21:01:49 2022 -0800 xtensa: rename PT_SIZE to PT_KERNEL_SIZE PT_SIZE is used by the xtensa port to designate kernel exception frame size. In preparation for struct pt_regs size change rename PT_SIZE to PT_KERNEL_SIZE for clarity and change its definition to always cover only the kernel exception frame. Signed-off-by: Max Filippov Reviewed-by: Kees Cook arch/xtensa/kernel/asm-offsets.c | 2 +- arch/xtensa/kernel/entry.S | 14 +++++++------- arch/xtensa/kernel/vectors.S | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) commit 53b97af4a44abd21344cc9f13986ba53051287bb Author: Philip Yang Date: Fri Mar 4 09:33:27 2022 -0500 drm/amdkfd: Add format attribute to kfd_smi_event_add To enable compiler type-checked against the format string in callers. All warnings (new ones prefixed by >>): >> warning: function 'kfd_smi_event_add' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format] Fixes: d58b8a99cbb8 ("drm/amdkfd: Add SMI add event helper") Reported-by: kernel test robot Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 1 + 1 file changed, 1 insertion(+) commit 4020aad85c6785ddac8d51f345ff9e3328ce773a Author: Keith Busch Date: Thu Mar 3 12:13:12 2022 -0800 nvme: add support for enhanced metadata NVM Express ratified TP 4068 defines new protection information formats. Implement support for the CRC64 guard tags. Since the block layer doesn't support variable length reference tags, driver support for the Storage Tag space is not supported at this time. Cc: Hannes Reinecke Cc: "Martin K. Petersen" Cc: Klaus Jensen Signed-off-by: Keith Busch Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220303201312.3255347-9-kbusch@kernel.org Signed-off-by: Jens Axboe drivers/nvme/host/core.c | 162 ++++++++++++++++++++++++++++++++++++++++------- drivers/nvme/host/nvme.h | 4 +- include/linux/nvme.h | 53 ++++++++++++++-- 3 files changed, 188 insertions(+), 31 deletions(-) commit a7d4383f17e10f338ea757a849f02298790d24fb Author: Keith Busch Date: Thu Mar 3 12:13:11 2022 -0800 block: add pi for extended integrity The NVMe specification defines new data integrity formats beyond the t10 tuple. Add support for the specification defined CRC64 formats, assuming the reference tag does not need to be split with the "storage tag". Cc: Hannes Reinecke Cc: "Martin K. Petersen" Signed-off-by: Keith Busch Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220303201312.3255347-8-kbusch@kernel.org Signed-off-by: Jens Axboe block/Kconfig | 1 + block/t10-pi.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++++ include/linux/t10-pi.h | 20 +++++ 3 files changed, 215 insertions(+) commit f3813f4b287e480b1fcd62ca798d8556644b8278 Author: Keith Busch Date: Thu Mar 3 12:13:10 2022 -0800 crypto: add rocksoft 64b crc guard tag framework Hardware specific features may be able to calculate a crc64, so provide a framework for drivers to register their implementation. If nothing is registered, fallback to the generic table lookup implementation. The implementation is modeled after the crct10dif equivalent. Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20220303201312.3255347-7-kbusch@kernel.org Signed-off-by: Jens Axboe crypto/Kconfig | 5 ++ crypto/Makefile | 1 + crypto/crc64_rocksoft_generic.c | 89 ++++++++++++++++++++++++++++ crypto/testmgr.c | 7 +++ crypto/testmgr.h | 15 +++++ include/linux/crc64.h | 5 ++ lib/Kconfig | 9 +++ lib/Makefile | 1 + lib/crc64-rocksoft.c | 126 ++++++++++++++++++++++++++++++++++++++++ 9 files changed, 258 insertions(+) commit cbc0a40e17da361a2ada8d669413ccfbd2028f2d Author: Keith Busch Date: Thu Mar 3 12:13:09 2022 -0800 lib: add rocksoft model crc64 The NVM Express specification extended data integrity fields to 64 bits using the Rocksoft parameters. Add the poly to the crc64 table generation, and provide a generic library routine implementing the algorithm. The Rocksoft 64-bit CRC model parameters are as follows: Poly: 0xAD93D23594C93659 Initial value: 0xFFFFFFFFFFFFFFFF Reflected Input: True Reflected Output: True Xor Final: 0xFFFFFFFFFFFFFFFF Since this model used reflected bits, the implementation generates the reflected table so the result is ordered consistently. Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Martin K. Petersen Signed-off-by: Keith Busch Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220303201312.3255347-6-kbusch@kernel.org Signed-off-by: Jens Axboe include/linux/crc64.h | 2 ++ lib/crc64.c | 28 ++++++++++++++++++++++++++++ lib/gen_crc64table.c | 51 ++++++++++++++++++++++++++++++++++++++++----------- 3 files changed, 70 insertions(+), 11 deletions(-) commit 7ee8809df990d1de379002973baee1681e8d7dd3 Author: Keith Busch Date: Thu Mar 3 12:13:08 2022 -0800 linux/kernel: introduce lower_48_bits function Recent data integrity field enhancements allow reference tags to be up to 48 bits. Introduce an inline helper function since this will be a repeated operation. Suggested-by: Bart Van Assche Signed-off-by: Keith Busch Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20220303201312.3255347-5-kbusch@kernel.org Signed-off-by: Jens Axboe include/linux/kernel.h | 9 +++++++++ 1 file changed, 9 insertions(+) commit c2ea5fcf53d5f21e6aff0de11d55bc202822df6a Author: Keith Busch Date: Thu Mar 3 12:13:07 2022 -0800 asm-generic: introduce be48 unaligned accessors The NVMe protocol extended the data integrity fields with unaligned 48-bit reference tags. Provide some helper accessors in preparation for these. Reviewed-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke Reviewed-by: Chaitanya Kulkarni Acked-by: Arnd Bergmann Signed-off-by: Keith Busch Reviewed-by: Bart Van Assche Link: https://lore.kernel.org/r/20220303201312.3255347-4-kbusch@kernel.org Signed-off-by: Jens Axboe include/asm-generic/unaligned.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) commit 84b735429f5fe6f57fc0b3fff3932dce1471e668 Author: Keith Busch Date: Thu Mar 3 12:13:06 2022 -0800 nvme: allow integrity on extended metadata formats The block integrity subsystem knows how to construct protection information buffers with metadata beyond the protection information fields. Remove the driver restriction. Note, this can only work if the PI field appears first in the metadata, as the integrity subsystem doesn't calculate guard tags on preceding metadata. Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20220303201312.3255347-3-kbusch@kernel.org Signed-off-by: Jens Axboe drivers/nvme/host/core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit c340b990d58c856c1636e0c10abb9e4351ad852a Author: Keith Busch Date: Thu Mar 3 12:13:05 2022 -0800 block: support pi with extended metadata The nvme spec allows protection information formats with metadata extending beyond the pi field. Use the actual size of the metadata field for incrementing the buffer. Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20220303201312.3255347-2-kbusch@kernel.org Signed-off-by: Jens Axboe block/bio-integrity.c | 1 + block/t10-pi.c | 4 ++-- include/linux/blk-integrity.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) commit d57c1cf43e7b33fdd790d50d972e0e5d6a0d20fe Merge: e41ffa9cf0b1 c75e707fe1aa Author: Jens Axboe Date: Mon Mar 7 12:48:02 2022 -0700 Merge branch 'for-5.18/write-streams' into for-5.18/64bit-pi * for-5.18/write-streams: block: remove the per-bio/request write hint nvme: remove support or stream based temperature hint commit e41ffa9cf0b1f74474a2fb961895a12c2d5ad7f9 Merge: b83ac18fce79 fbe7c2ef5e1d Author: Jens Axboe Date: Mon Mar 7 12:46:18 2022 -0700 Merge branch 'for-5.18/alloc-cleanups' into for-5.18/64bit-pi * for-5.18/alloc-cleanups: nilfs2: pass the operation to bio_alloc ext4: pass the operation to bio_alloc mpage: pass the operation to bio_alloc commit b83ac18fce795d626142260d4371b9fa0bc8216f Merge: bc8419944f68 a76370690c3b Author: Jens Axboe Date: Mon Mar 7 12:46:16 2022 -0700 Merge branch 'for-5.18/drivers' into for-5.18/64bit-pi * for-5.18/drivers: (51 commits) bcache: fixup multiple threads crash bcache: fixup bcache_dev_sectors_dirty_add() multithreaded CPU false sharing floppy: use memcpy_{to,from}_bvec drbd: use bvec_kmap_local in recv_dless_read drbd: use bvec_kmap_local in drbd_csum_bio bcache: use bvec_kmap_local in bio_csum nvdimm-btt: use bvec_kmap_local in btt_rw_integrity nvdimm-blk: use bvec_kmap_local in nd_blk_rw_integrity zram: use memcpy_from_bvec in zram_bvec_write zram: use memcpy_to_bvec in zram_bvec_read aoe: use bvec_kmap_local in bvcpy iss-simdisk: use bvec_kmap_local in simdisk_submit_bio nvme: check that EUI/GUID/UUID are globally unique nvme: check for duplicate identifiers earlier nvme: fix the check for duplicate unique identifiers nvme: cleanup __nvme_check_ids nvme: remove nssa from struct nvme_ctrl nvme: explicitly set non-error for directives nvme: expose cntrltype and dctype through sysfs nvme: send uevent on connection up ... commit bc8419944f68161810702ea353aace17846829bc Merge: ffb217a13a2e 97939610b893 Author: Jens Axboe Date: Mon Mar 7 12:46:13 2022 -0700 Merge branch 'for-5.18/block' into for-5.18/64bit-pi * for-5.18/block: (96 commits) block: remove bio_devname ext4: stop using bio_devname raid5-ppl: stop using bio_devname raid1: stop using bio_devname md-multipath: stop using bio_devname dm-integrity: stop using bio_devname dm-crypt: stop using bio_devname pktcdvd: remove a pointless debug check in pkt_submit_bio block: remove handle_bad_sector block: fix and cleanup bio_check_ro bfq: fix use-after-free in bfq_dispatch_request blk-crypto: show crypto capabilities in sysfs block: don't delete queue kobject before its children block: simplify calling convention of elv_unregister_queue() block: remove redundant semicolon block: default BLOCK_LEGACY_AUTOLOAD to y block: update io_ticks when io hang block, bfq: don't move oom_bfqq block, bfq: avoid moving bfqq to it's parent bfqg block, bfq: cleanup bfq_bfqq_to_bfqg() ... commit c75e707fe1aab32f1dc8e09845533b6542d9aaa9 Author: Christoph Hellwig Date: Fri Mar 4 18:55:56 2022 +0100 block: remove the per-bio/request write hint With the NVMe support for this gone, there are no consumers of these hints left, so remove them. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220304175556.407719-2-hch@lst.de Signed-off-by: Jens Axboe block/bio.c | 2 -- block/blk-crypto-fallback.c | 1 - block/blk-merge.c | 14 -------------- block/blk-mq-debugfs.c | 24 ------------------------ block/blk-mq.c | 1 - block/bounce.c | 1 - block/fops.c | 3 --- drivers/md/raid1.c | 2 -- drivers/md/raid5-ppl.c | 28 +++------------------------- drivers/md/raid5.c | 6 ------ fs/btrfs/extent_io.c | 1 - fs/buffer.c | 13 +++++-------- fs/direct-io.c | 3 --- fs/ext4/page-io.c | 5 +---- fs/f2fs/data.c | 2 -- fs/gfs2/lops.c | 1 - fs/iomap/buffered-io.c | 2 -- fs/iomap/direct-io.c | 1 - fs/mpage.c | 1 - fs/zonefs/super.c | 1 - include/linux/blk_types.h | 1 - include/linux/blkdev.h | 3 --- 22 files changed, 9 insertions(+), 107 deletions(-) commit 85e6c775762aa4067d2c2b8121e59a06564d0dc4 Author: Christoph Hellwig Date: Fri Mar 4 18:55:55 2022 +0100 nvme: remove support or stream based temperature hint This support was added for RocksDB, but RocksDB ended up not using it. At the same time drives on the open marked (vs those build for OEMs for non-Linux support) that actually support streams are extremly rare. Don't bloat the nvme driver for it. Signed-off-by: Christoph Hellwig Acked-by: Jens Axboe Reviewed-by: Keith Busch Link: https://lore.kernel.org/r/20220304175556.407719-1-hch@lst.de [axboe: fold in ctrl->nr_streams removal from Keith] Signed-off-by: Jens Axboe drivers/nvme/host/core.c | 143 ----------------------------------------------- drivers/nvme/host/nvme.h | 1 - 2 files changed, 144 deletions(-) commit 82911009637e5b0bc3fdc003f72b4acd50b8840f Merge: b46bebaf2a58 fbe7c2ef5e1d Author: Jens Axboe Date: Mon Mar 7 12:45:53 2022 -0700 Merge branch 'for-5.18/alloc-cleanups' into for-5.18/write-streams * for-5.18/alloc-cleanups: nilfs2: pass the operation to bio_alloc ext4: pass the operation to bio_alloc mpage: pass the operation to bio_alloc commit b46bebaf2a58cc77099b5f4de45f3d570e74aa05 Merge: 13400b145426 a76370690c3b Author: Jens Axboe Date: Mon Mar 7 12:44:39 2022 -0700 Merge branch 'for-5.18/drivers' into for-5.18/write-streams * for-5.18/drivers: (51 commits) bcache: fixup multiple threads crash bcache: fixup bcache_dev_sectors_dirty_add() multithreaded CPU false sharing floppy: use memcpy_{to,from}_bvec drbd: use bvec_kmap_local in recv_dless_read drbd: use bvec_kmap_local in drbd_csum_bio bcache: use bvec_kmap_local in bio_csum nvdimm-btt: use bvec_kmap_local in btt_rw_integrity nvdimm-blk: use bvec_kmap_local in nd_blk_rw_integrity zram: use memcpy_from_bvec in zram_bvec_write zram: use memcpy_to_bvec in zram_bvec_read aoe: use bvec_kmap_local in bvcpy iss-simdisk: use bvec_kmap_local in simdisk_submit_bio nvme: check that EUI/GUID/UUID are globally unique nvme: check for duplicate identifiers earlier nvme: fix the check for duplicate unique identifiers nvme: cleanup __nvme_check_ids nvme: remove nssa from struct nvme_ctrl nvme: explicitly set non-error for directives nvme: expose cntrltype and dctype through sysfs nvme: send uevent on connection up ... commit 13400b145426e2a13294fc42c5686dff30f19677 Merge: ffb217a13a2e 97939610b893 Author: Jens Axboe Date: Mon Mar 7 12:44:37 2022 -0700 Merge branch 'for-5.18/block' into for-5.18/write-streams * for-5.18/block: (96 commits) block: remove bio_devname ext4: stop using bio_devname raid5-ppl: stop using bio_devname raid1: stop using bio_devname md-multipath: stop using bio_devname dm-integrity: stop using bio_devname dm-crypt: stop using bio_devname pktcdvd: remove a pointless debug check in pkt_submit_bio block: remove handle_bad_sector block: fix and cleanup bio_check_ro bfq: fix use-after-free in bfq_dispatch_request blk-crypto: show crypto capabilities in sysfs block: don't delete queue kobject before its children block: simplify calling convention of elv_unregister_queue() block: remove redundant semicolon block: default BLOCK_LEGACY_AUTOLOAD to y block: update io_ticks when io hang block, bfq: don't move oom_bfqq block, bfq: avoid moving bfqq to it's parent bfqg block, bfq: cleanup bfq_bfqq_to_bfqg() ... commit 0c9992315e738e7d6e927ef36839a466b080dba6 Author: Rafael J. Wysocki Date: Mon Mar 7 20:28:26 2022 +0100 ACPICA: Avoid walking the ACPI Namespace if it is not there ACPICA commit b1c3656ef4950098e530be68d4b589584f06cddc Prevent acpi_ns_walk_namespace() from crashing when called with start_node equal to ACPI_ROOT_OBJECT if the Namespace has not been instantiated yet and acpi_gbl_root_node is NULL. For instance, this can happen if the kernel is run with "acpi=off" in the command line. Link: https://github.com/acpica/acpica/commit/b1c3656ef4950098e530be68d4b589584f06cddc Link: https://lore.kernel.org/linux-acpi/CAJZ5v0hJWW_vZ3wwajE7xT38aWjY7cZyvqMJpXHzUL98-SiCVQ@mail.gmail.com/ Reported-by: Hans de Goede Signed-off-by: Rafael J. Wysocki drivers/acpi/acpica/nswalk.c | 3 +++ 1 file changed, 3 insertions(+) commit 66435063c5f31caa70ecadb3de4fe4d17b141b51 Author: Kuldeep Singh Date: Mon Mar 7 23:51:01 2022 +0530 arm64: dts: stingray: Fix spi clock name SPI clock name for pl022 is "sspclk" and not "spiclk". Also fix below dtc warning: clock-names:0: 'spiclk' is not one of ['SSPCLK', 'sspclk'] Signed-off-by: Kuldeep Singh Signed-off-by: Florian Fainelli arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit bb8555fe87154e90dcd5a05082fd499d46c93fb5 Author: Kuldeep Singh Date: Mon Mar 7 23:51:00 2022 +0530 arm64: dts: ns2: Fix spi clock name SPI clock name for pl022 is "sspclk" and not "spiclk". Also fix below dtc warning: clock-names:0: 'spiclk' is not one of ['SSPCLK', 'sspclk'] Signed-off-by: Kuldeep Singh Signed-off-by: Florian Fainelli arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 8d26c4328b468e449df21314ef993eeaefc0306f Author: Leon Romanovsky Date: Mon Mar 7 13:33:25 2022 +0200 PCI/IOV: Fix wrong kernel-doc identifier Replace "-" to be ":" in comment section to be aligned with kernel-doc format. drivers/pci/iov.c:67: warning: Function parameter or member 'dev' not described in 'pci_iov_get_pf_drvdata' drivers/pci/iov.c:67: warning: Function parameter or member 'pf_driver' not described in 'pci_iov_get_pf_drvdata' Fixes: a7e9f240c0da ("PCI/IOV: Add pci_iov_get_pf_drvdata() to allow VF reaching the drvdata of a PF") Reported-by: Stephen Rothwell Signed-off-by: Leon Romanovsky Acked-by: Randy Dunlap Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/8cecf7df45948a256dc56148cf9e87b2f2bb4198.1646652504.git.leonro@nvidia.com Signed-off-by: Alex Williamson drivers/pci/iov.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 4467b8bad2401794fb89a0268c8c8257180bf60f Author: Guillaume Ranquet Date: Mon Mar 7 18:26:56 2022 +0100 clocksource/drivers/timer-of: Check return value of of_iomap in timer_of_base_init() of_base->base can either be iomapped using of_io_request_and_map() or of_iomap() depending whether or not an of_base->name has been set. Thus check of_base->base against NULL as of_iomap() does not return a PTR_ERR() in case of error. Fixes: 9aea417afa6b ("clocksource/drivers/timer-of: Don't request the resource by name") Signed-off-by: Guillaume Ranquet Link: https://lore.kernel.org/r/20220307172656.4836-1-granquet@baylibre.com Signed-off-by: Daniel Lezcano drivers/clocksource/timer-of.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 58dedf0a4782ce42b4d31f1f62e5ad80a1b73d72 Merge: 7e57714cd0ad fc153c1c58cb Author: Thomas Gleixner Date: Mon Mar 7 19:12:38 2022 +0100 Merge branch 'clocksource.2022.02.01b' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into timers/core Pull clocksource watchdog update from Paul McKenney: - Add a config option for the maximum skew of the watchdog. Link: https://lore.kernel.org/r/20220224000718.GA3747431@paulmck-ThinkPad-P17-Gen-1 commit eb31228b1dce9658d496a8463f8d01cf2831f4cd Author: Guo Zhengkui Date: Mon Mar 7 11:39:59 2022 +0800 perf tools: Use ARRAY_SIZE() instead of ad hoc equivalent, spotted by array_size.cocci Fix the following coccicheck warning: tools/perf/util/trace-event-parse.c:209:35-36: WARNING: Use ARRAY_SIZE ARRAY_SIZE(arr) is a macro provided in tools/include/linux/kernel.h, which not only measures the size of the array, but also makes sure that `arr` is really an array. It has been tested with gcc (Debian 8.3.0-6) 8.3.0. Signed-off-by: Guo Zhengkui Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220307034008.4024-1-guozhengkui@vivo.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/trace-event-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1f48989cdc7d57d32a56b7cc5eb968c04d30529c Author: James Clark Date: Mon Mar 7 17:19:17 2022 +0000 perf script: Output branch sample type The type info is saved when using '-j save_type'. Output this in 'perf script' so it can be accessed by other tools or for debugging. It's appended to the end of the list of fields so any existing tools that split on / and access fields via an index are not affected. Also output '-' instead of 'N/A' when the branch type isn't saved because / is used as a field separator. Entries before this change look like this: 0xaaaadb350838/0xaaaadb3507a4/P/-/-/0 And afterwards like this: 0xaaaadb350838/0xaaaadb3507a4/P/-/-/0/CALL or this if no type info is saved: 0x7fb57586df6b/0x7fb5758731f0/P/-/-/143/- Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Anshuman Khandual Cc: German Gomez Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220307171917.2555829-5-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-script.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit b2dac688a5265379e0f13856b78cb627af07cf42 Author: James Clark Date: Mon Mar 7 17:19:16 2022 +0000 perf script: Refactor branch stack printing Remove duplicate code so that future changes to flags are always made to all 3 printing variations. Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Anshuman Khandual Cc: German Gomez Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220307171917.2555829-4-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/builtin-script.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) commit 66fd6c9d6972eeeaeed2eed7d2a225f9c4fb09a9 Author: James Clark Date: Mon Mar 7 17:19:15 2022 +0000 perf session: Print branch stack entry type in --dump-raw-trace This can help with debugging issues. It only prints when -j save_type is used otherwise an empty string is printed. Before the change: 101603801707130 0xa70 [0x630]: PERF_RECORD_SAMPLE(IP, 0x2): 1108/1108: 0xffff9c1df24c period: 10694 addr: 0 ... branch stack: nr:64 ..... 0: 0000ffff9c26029c -> 0000ffff9c26f340 0 cycles P 0 ..... 1: 0000ffff9c2601bc -> 0000ffff9c26f340 0 cycles P 0 After the change: 101603801707130 0xa70 [0x630]: PERF_RECORD_SAMPLE(IP, 0x2): 1108/1108: 0xffff9c1df24c period: 10694 addr: 0 ... branch stack: nr:64 ..... 0: 0000ffff9c26029c -> 0000ffff9c26f340 0 cycles P 0 CALL ..... 1: 0000ffff9c2601bc -> 0000ffff9c26f340 0 cycles P 0 IND_CALL Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Anshuman Khandual Cc: German Gomez Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220307171917.2555829-3-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/session.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 8f431a28696d27e3370ebd1a5fd1681a8c773a8e Author: James Clark Date: Mon Mar 7 17:19:14 2022 +0000 perf evsel: Add error message for unsupported branch stack cases EOPNOTSUPP is a possible return value when branch stacks are requested but they aren't enabled in the kernel or hardware. It's also returned if they aren't supported on the specific event type. The currently printed error message about sampling/overflow-interrupts is not correct in this case. Add a check for branch stacks before sample_period is checked because sample_period is also set (to the default value) when using branch stacks. Before this change (when branch stacks aren't supported): perf record -j any Error: cycles: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat' After this change: perf record -j any Error: cycles: PMU Hardware or event type doesn't support branch stack sampling. Signed-off-by: James Clark Cc: Alexander Shishkin Cc: Anshuman Khandual Cc: German Gomez Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220307171917.2555829-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/evsel.c | 4 ++++ 1 file changed, 4 insertions(+) commit 1ec7ed5163c70a0d040150d2279f932c7e7c143f Author: Brian Norris Date: Fri Feb 25 11:44:32 2022 +0200 Revert "ath: add support for special 0x0 regulatory domain" This reverts commit 2dc016599cfa9672a147528ca26d70c3654a5423. Users are reporting regressions in regulatory domain detection and channel availability. The problem this was trying to resolve was fixed in firmware anyway: QCA6174 hw3.0: sdio-4.4.1: add firmware.bin_WLAN.RMH.4.4.1-00042 https://github.com/kvalo/ath10k-firmware/commit/4d382787f0efa77dba40394e0bc604f8eff82552 Link: https://bbs.archlinux.org/viewtopic.php?id=254535 Link: http://lists.infradead.org/pipermail/ath10k/2020-April/014871.html Link: http://lists.infradead.org/pipermail/ath10k/2020-May/015152.html Link: https://lore.kernel.org/all/1c160dfb-6ccc-b4d6-76f6-4364e0adb6dd@reox.at/ Fixes: 2dc016599cfa ("ath: add support for special 0x0 regulatory domain") Cc: Cc: Wen Gong Signed-off-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200527165718.129307-1-briannorris@chromium.org drivers/net/wireless/ath/regd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 389e3bff69b4341b42779833063c7b462a6e6d42 Author: Claudiu Beznea Date: Fri Mar 4 15:35:58 2022 +0200 clocksource/drivers/timer-microchip-pit64b: Use 5MHz for clockevent Use 5MHz clock for clockevent timers. This increases timer's resolution. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220304133601.2404086-4-claudiu.beznea@microchip.com Signed-off-by: Daniel Lezcano drivers/clocksource/timer-microchip-pit64b.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit ff10ee97cb203262e88d9c8bc87369cbd4004a0c Author: Claudiu Beznea Date: Fri Mar 4 15:35:57 2022 +0200 clocksource/drivers/timer-microchip-pit64b: Use notrace Use notrace for mchp_pit64b_sched_read_clk() to avoid recursive call of prepare_ftrace_return() when issuing: echo function_graph > /sys/kernel/debug/tracing/current_tracer Fixes: 625022a5f160 ("clocksource/drivers/timer-microchip-pit64b: Add Microchip PIT64B support") Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220304133601.2404086-3-claudiu.beznea@microchip.com Signed-off-by: Daniel Lezcano drivers/clocksource/timer-microchip-pit64b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 34f03f7f3e9f79412b5bf8db9f2778c9ed2fd733 Author: Claudiu Beznea Date: Fri Mar 4 15:35:56 2022 +0200 clocksource/drivers/timer-microchip-pit64b: Remove mmio selection PIT64B timer driver doesn't depend on CLKSRC_MMIO since commit e85c1d21b16b ("clocksource/drivers/timer-microchip-pit64b: Add clocksource suspend/resume"). Remove the selection. Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220304133601.2404086-2-claudiu.beznea@microchip.com Signed-off-by: Daniel Lezcano drivers/clocksource/Kconfig | 1 - 1 file changed, 1 deletion(-) commit cea9ffe0094d468b17814056fcebe7b3840af5f0 Author: David Heidelberg Date: Fri Mar 4 00:33:06 2022 +0100 dt-bindings: timer: Tegra: Convert text bindings to yaml Convert Tegra timer binding into yaml format. This commit also merge 3 text bindings with almost identical content (differens in number of registers). Reviewed-by: Rob Herring Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20220303233307.61753-1-david@ixit.cz Signed-off-by: Daniel Lezcano .../bindings/timer/nvidia,tegra-timer.yaml | 150 +++++++++++++++++++++ .../bindings/timer/nvidia,tegra20-timer.txt | 24 ---- .../bindings/timer/nvidia,tegra210-timer.txt | 36 ----- .../bindings/timer/nvidia,tegra30-timer.txt | 28 ---- 4 files changed, 150 insertions(+), 88 deletions(-) commit bf127df3cceada8693888fc86a3121c38ef25701 Author: Nathan Chancellor Date: Thu Mar 3 11:42:12 2022 -0700 clocksource/drivers/imx-tpm: Move tpm_read_sched_clock() under CONFIG_ARM When building this driver for an architecture other than ARCH=arm: drivers/clocksource/timer-imx-tpm.c:78:20: error: unused function 'tpm_read_sched_clock' [-Werror,-Wunused-function] static u64 notrace tpm_read_sched_clock(void) ^ 1 error generated. Move the function definition under the existing CONFIG_ARM section so there is no more warning. Fixes: 10720e120e2b ("clocksource/drivers/imx-tpm: Exclude sched clock for ARM64") Signed-off-by: Nathan Chancellor Reviewed-by: Peng Fan Link: https://lore.kernel.org/r/20220303184212.2356245-1-nathan@kernel.org Signed-off-by: Daniel Lezcano drivers/clocksource/timer-imx-tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8c4b810a87005eb46564a48a69b5b255e515fa62 Author: Marc Zyngier Date: Thu Feb 3 17:05:02 2022 +0000 clocksource/drivers/arm_arch_timer: Use event stream scaling when available With FEAT_ECV and the 1GHz counter, it is pretty likely that the event stream divider doesn't fit in the field that holds the divider value (we only have 4 bits to describe counter bits [15:0] Thankfully, FEAT_ECV also provides a scaling mechanism to switch the field to cover counter bits [23:8] instead. Enable this on arm64 when ECV is available (32bit doesn't have any detection infrastructure and is unlikely to be run on an ARMv8.6 system anyway). Signed-off-by: Marc Zyngier Cc: Mark Rutland Cc: Daniel Lezcano Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220203170502.2694422-1-maz@kernel.org Signed-off-by: Daniel Lezcano drivers/clocksource/arm_arch_timer.c | 13 +++++++++++-- include/clocksource/arm_arch_timer.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) commit 0a3a4b9d2bb7928f54579421bbadd4aa9c4a94f0 Author: Alim Akhtar Date: Mon Feb 21 23:15:47 2022 +0530 clocksource/drivers/exynos_mct: Increase the size of name array Variable _name_ hold mct_tick number per cpu and it is currently limited to 10. Which restrict the scalability of the MCT driver for the SoC which has more local timers interrupts (>= 12). Increase the length of it to make mct_tick printed correctly for each local timer interrupts per CPU. Signed-off-by: Alim Akhtar Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220221174547.26176-3-alim.akhtar@samsung.com Signed-off-by: Daniel Lezcano drivers/clocksource/exynos_mct.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit f49b82a0a54fa85451ed96c35f24679522d59c7a Author: Alim Akhtar Date: Mon Feb 21 23:15:46 2022 +0530 clocksource/drivers/exynos_mct: Bump up mct max irq number Bump-up maximum number of MCT IRQ to match the binding documentation. This make driver scalable for SoC which has more than 12 timer irqs, like recently added FSD SoC. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alim Akhtar Link: https://lore.kernel.org/r/20220221174547.26176-2-alim.akhtar@samsung.com Signed-off-by: Daniel Lezcano drivers/clocksource/exynos_mct.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit dfc597c9bca9b4447820a59fe86526f016be1458 Author: Alim Akhtar Date: Mon Feb 21 23:15:45 2022 +0530 clocksource/drivers/exynos_mct: Remove mct interrupt index enum MCT driver define an enum which list global and local timer's irq index. Most of them are not used but MCT_G0_IRQ and MCT_L0_IRQ and these two are at a fixed offset/index. Get rid of this enum and use a #define for the used irq index. No functional changes expected. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Alim Akhtar Link: https://lore.kernel.org/r/20220221174547.26176-1-alim.akhtar@samsung.com Signed-off-by: Daniel Lezcano drivers/clocksource/exynos_mct.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) commit ab8da93dc06d82f464c47ab30e6c75190702f369 Author: Krzysztof Kozlowski Date: Sun Feb 20 11:38:15 2022 +0100 clocksource/drivers/exynos_mct: Handle DTS with higher number of interrupts The driver statically defines maximum number of interrupts it can handle, however it does not respect that limit when configuring them. When provided with a DTS with more interrupts than assumed, the driver will overwrite static array mct_irqs leading to silent memory corruption. Validate the interrupts coming from DTS to avoid this. This does not change the fact that such DTS might not boot at all, because it is simply incompatible, however at least some warning will be printed. Fixes: 36ba5d527e95 ("ARM: EXYNOS: add device tree support for MCT controller driver") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Link: https://lore.kernel.org/r/20220220103815.135380-1-krzysztof.kozlowski@canonical.com Signed-off-by: Daniel Lezcano drivers/clocksource/exynos_mct.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit bceaae3bac0ce27c549bb050336d8d08abc2ee54 Author: Drew Fustini Date: Thu Feb 3 21:35:05 2022 -0800 clocksource/drivers/timer-ti-dm: Fix regression from errata i940 fix The existing fix for errata i940 causes a conflict for IPU2 which is using timer 3 and 4. From arch/arm/boot/dts/dra7-ipu-dsp-common.dtsi: &ipu2 { mboxes = <&mailbox6 &mbox_ipu2_ipc3x>; ti,timers = <&timer3>; ti,watchdog-timers = <&timer4>, <&timer9>; }; The conflict was noticed when booting mainline on the BeagleBoard X15 which has a TI AM5728 SoC: remoteproc remoteproc1: 55020000.ipu is available remoteproc remoteproc1: powering up 55020000.ipu remoteproc remoteproc1: Booting fw image dra7-ipu2-fw.xem4 omap-rproc 55020000.ipu: could not get timer platform device omap-rproc 55020000.ipu: omap_rproc_enable_timers failed: -19 remoteproc remoteproc1: can't start rproc 55020000.ipu: -19 This change modifies the errata fix to instead use timer 15 and 16 which resolves the timer conflict. It does not appear to introduce any latency regression. Results from cyclictest with original errata fix using dmtimer 3 and 4: # cyclictest --mlockall --smp --priority=80 --interval=200 --distance=0 policy: fifo: loadavg: 0.02 0.03 0.05 T: 0 ( 1449) P:80 I:200 C: 800368 Min: 0 Act: 32 Avg: 22 Max: 128 T: 1 ( 1450) P:80 I:200 C: 800301 Min: 0 Act: 12 Avg: 23 Max: 70 The results after the change to dmtimer 15 and 16: # cyclictest --mlockall --smp --priority=80 --interval=200 --distance=0 policy: fifo: loadavg: 0.36 0.19 0.07 T: 0 ( 1711) P:80 I:200 C: 759599 Min: 0 Act: 6 Avg: 22 Max: 108 T: 1 ( 1712) P:80 I:200 C: 759539 Min: 0 Act: 19 Avg: 23 Max: 79 Fixes: 25de4ce5ed02 ("clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940") Link: https://lore.kernel.org/linux-omap/YfWsG0p6to3IJuvE@x1/ Suggested-by: Suman Anna Reviewed-by: Tony Lindgren Signed-off-by: Drew Fustini Link: https://lore.kernel.org/r/20220204053503.1409162-1-dfustini@baylibre.com Signed-off-by: Daniel Lezcano arch/arm/boot/dts/dra7-l4.dtsi | 5 ++--- arch/arm/boot/dts/dra7.dtsi | 8 ++++---- drivers/clocksource/timer-ti-dm-systimer.c | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) commit 43d26c4fc6c446d766253d546f0083d78023d34a Author: Zhi Wang Date: Tue Feb 22 10:05:32 2022 -0500 drm/i915/gvt: add the missing mdev attribute "name" The mdev attribute "name" is required by some middle software, e.g. KubeVirt, an open source SW that manages VM on Kubernetes cluster uses the mdev sysfs directory/file structure to discover mediated device in nodes in the cluster. v2: - Fix the missing defination in gvt_type_attrs. (Zhenyu) Cc: Zhenyu Wang Cc: Hui Chun Ong Cc: Terrence Xu Cc: Zhi Wang Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220222150532.9090-1-zhi.a.wang@intel.com Reviewed-by: Zhenyu Wang drivers/gpu/drm/i915/gvt/kvmgt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit d1d28bd9a0f896c7d2f7147ca631f86c49b16d7f Author: Lianjie Zhang Date: Sun Mar 6 15:38:18 2022 +0800 mm/slub: use helper macro __ATTR_XX_MODE for SLAB_ATTR(_RO) This allows more concise code, and VERIFY_OCTAL_PERMISSIONS() can help validate any future change. Signed-off-by: Lianjie Zhang Acked-by: David Rientjes Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220306073818.15089-1-zhanglianjie@uniontech.com mm/slub.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit b3627647f9ea7473d10fb08a95fd7c4133a17ca4 Merge: 92ec1a5c275a 25e94139218c Author: Mauro Carvalho Chehab Date: Mon Mar 7 17:38:29 2022 +0100 Merge tag 'br-v5.18s' of git://linuxtv.org/hverkuil/media_tree into media_stage Tag branch * tag 'br-v5.18s' of git://linuxtv.org/hverkuil/media_tree: ivtv: fix incorrect device_caps for ivtvfb media: rcar-csi2: Drop comma after SoC match table sentinel media: camss: Replace hard coded value with parameter media: saa7134: fix incorrect use to determine if list is empty media: MAINTAINERS: update rksip1 maintainers info MAINTAINERS: update media vimc driver maintainers media: i2c: max2175: Use rbtree rather than flat register cache Signed-off-by: Mauro Carvalho Chehab commit 92ec1a5c275acf8ec9999b7969a14745def5a8da Merge: 12fdba564afd 42356ecbdb69 Author: Mauro Carvalho Chehab Date: Mon Mar 7 17:36:23 2022 +0100 Merge tag 'br-v5.18r' of git://linuxtv.org/hverkuil/media_tree into media_stage Tag branch * tag 'br-v5.18r' of git://linuxtv.org/hverkuil/media_tree: media: amphion: add amphion vpu entry in Kconfig and Makefile MAINTAINERS: add AMPHION VPU CODEC V4L2 driver entry media: amphion: implement malone decoder rpc interface media: amphion: implement windsor encoder rpc interface media: amphion: add v4l2 m2m vpu decoder stateful driver media: amphion: add v4l2 m2m vpu encoder stateful driver media: amphion: add vpu v4l2 m2m support media: amphion: implement vpu core communication based on mailbox media: amphion: add vpu core driver media: amphion: add amphion vpu device driver media: add nv12m_8l128 and nv12m_10be_8l128 video format. dt-bindings: media: amphion: add amphion video codec bindings Signed-off-by: Mauro Carvalho Chehab commit 25e94139218c0293b4375233c14f2256d7dcfaa8 Author: Hans Verkuil Date: Sun Mar 6 12:29:11 2022 +0100 ivtv: fix incorrect device_caps for ivtvfb The VIDIOC_G_FBUF and related overlay ioctls no longer worked (-ENOTTY was returned). The root cause was the introduction of the caps field in ivtv-driver.h. While loading the ivtvfb module would update the video_device device_caps field with V4L2_CAP_VIDEO_OUTPUT_OVERLAY it would not update that caps field, and that's what the overlay ioctls would look at. It's a bad idea to keep information in two places, so drop the caps field and only use vdev.device_caps. Signed-off-by: Hans Verkuil Reported-by: Martin Dauskardt Fixes: 2161536516ed (media: media/pci: set device_caps in struct video_device) drivers/media/pci/ivtv/ivtv-driver.h | 1 - drivers/media/pci/ivtv/ivtv-ioctl.c | 10 +++++----- drivers/media/pci/ivtv/ivtv-streams.c | 11 ++++------- 3 files changed, 9 insertions(+), 13 deletions(-) commit 9ef9abf4ff57aaedd661622f7d008dd71ece1ffb Author: Geert Uytterhoeven Date: Thu Mar 3 13:43:57 2022 +0100 media: rcar-csi2: Drop comma after SoC match table sentinel It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Signed-off-by: Hans Verkuil drivers/media/platform/rcar-vin/rcar-csi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a312f8982632fb1a882a8dc3c9fd127d082c1c02 Author: Souptick Joarder (HPE) Date: Tue Mar 1 11:35:30 2022 +0530 media: camss: Replace hard coded value with parameter Kernel test robot reported below warning -> drivers/media/platform/qcom/camss/camss-csid-gen2.c:407:3: warning: Value stored to 'val' is never read [clang-analyzer-deadcode.DeadStores] Replace hard coded value with val. Reported-by: kernel test robot Signed-off-by: Souptick Joarder (HPE) Reviewed-by: Robert Foss Signed-off-by: Hans Verkuil drivers/media/platform/qcom/camss/camss-csid-gen2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9f1f4b642451d35667a4dc6a9c0a89d954b530a3 Author: Jakob Koschel Date: Mon Feb 28 15:26:26 2022 +0100 media: saa7134: fix incorrect use to determine if list is empty 'dev' will *always* be set by list_for_each_entry(). It is incorrect to assume that the iterator value will be NULL if the list is empty. Instead of checking the pointer it should be checked if the list is empty. Fixes: 79dd0c69f05f ("V4L: 925: saa7134 alsa is now a standalone module") Signed-off-by: Jakob Koschel Signed-off-by: Hans Verkuil drivers/media/pci/saa7134/saa7134-alsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3843760486261c7c8483731e1e87dde55b522088 Author: Dafna Hirschfeld Date: Sat Feb 26 13:35:38 2022 +0200 media: MAINTAINERS: update rksip1 maintainers info Due to changes in maintainers info/position Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil MAINTAINERS | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit da024867debb2a13d5dafd7fa1d8ab9ec8ae53d7 Author: Shuah Khan Date: Tue Feb 22 17:48:01 2022 -0700 MAINTAINERS: update media vimc driver maintainers Based on the dicussion with Hans Verkuil and others in the thread below, vimc is need of a maintainer. I will start maintaining the driver with help from Kieran Bingham as the reviewer. Link: https://lore.kernel.org/linux-media/5d5dee88-9dbf-e4d0-4a91-11ff4ecd82ea@xs4all.nl/ Signed-off-by: Shuah Khan Acked-by: Helen Koike Signed-off-by: Hans Verkuil MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 42a55435b0ef6b80a3e81e8ca642cd866d260b08 Author: Mark Brown Date: Tue Feb 22 21:52:44 2022 +0000 media: i2c: max2175: Use rbtree rather than flat register cache The max2175 uses a flat register cache but supplies only a single default value and has many volatile registers. This is a poor fit for a flat cache since the cache will assume a default of zero for any register not yet written which can lead to bugs for example when regmap_update_bits() suppresses a noop write. A rbtree cache is a much better fit, this will only cache default values and values that have been written to the device with any reads of uncached values going to the hardware. Convert the driver to use a rbtree cache. Since the device is controlled via I2C the cost of manging the rbtree should be immaterial compared to the cost of accessing the device. Signed-off-by: Mark Brown Signed-off-by: Hans Verkuil drivers/media/i2c/max2175.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 42356ecbdb69e49cffd0c1df791280965f9f90e1 Author: Ming Qian Date: Thu Feb 24 11:10:13 2022 +0800 media: amphion: add amphion vpu entry in Kconfig and Makefile Add V4L2 driver entry for the amphion vpu encoder/decoder. Signed-off-by: Ming Qian Signed-off-by: Hans Verkuil drivers/media/platform/Kconfig | 19 +++++++++++++++++++ drivers/media/platform/Makefile | 2 ++ 2 files changed, 21 insertions(+) commit af850794b8e9d701092331208823abb6311bb941 Author: Ming Qian Date: Thu Feb 24 11:10:11 2022 +0800 MAINTAINERS: add AMPHION VPU CODEC V4L2 driver entry Add AMPHION VPU CODEC v4l2 driver entry Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Signed-off-by: Hans Verkuil MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) commit 145e936380edb6a2e963adf95796f71501c806cd Author: Ming Qian Date: Thu Feb 24 11:10:08 2022 +0800 media: amphion: implement malone decoder rpc interface This part implements the malone decoder rpc interface. Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil drivers/media/platform/amphion/vpu_malone.c | 1625 +++++++++++++++++++++++++++ drivers/media/platform/amphion/vpu_malone.h | 44 + 2 files changed, 1669 insertions(+) commit d82977796c48bed9d0a427b65f161dab9d2e6df3 Author: Ming Qian Date: Thu Feb 24 11:10:07 2022 +0800 media: amphion: implement windsor encoder rpc interface This part implements the windsor encoder rpc interface. Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Reported-by: kernel test robot Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil drivers/media/platform/amphion/vpu_windsor.c | 1169 ++++++++++++++++++++++++++ drivers/media/platform/amphion/vpu_windsor.h | 37 + 2 files changed, 1206 insertions(+) commit 6de8d628df6ef657435cf40da32071ac5d87b199 Author: Ming Qian Date: Thu Feb 24 11:10:06 2022 +0800 media: amphion: add v4l2 m2m vpu decoder stateful driver This consists of video decoder implementation plus decoder controls. Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil drivers/media/platform/amphion/vdec.c | 1691 +++++++++++++++++++++++++++++++++ 1 file changed, 1691 insertions(+) commit 0401e659c1f922e46887b1bab5a8fe87978d2458 Author: Ming Qian Date: Thu Feb 24 11:10:05 2022 +0800 media: amphion: add v4l2 m2m vpu encoder stateful driver This consists of video encoder implementation plus encoder controls. Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil drivers/media/platform/amphion/venc.c | 1358 +++++++++++++++++++++++++++++++++ 1 file changed, 1358 insertions(+) commit 3cd084519c6f91cbef9d604bcf26844fa81d4922 Author: Ming Qian Date: Thu Feb 24 11:10:04 2022 +0800 media: amphion: add vpu v4l2 m2m support vpu_v4l2.c implements the v4l2 m2m driver methods. vpu_helpers.c implements the common helper functions vpu_color.c converts the v4l2 colorspace with the VUI parameters that specified by ITU-T | ISO/IEC Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Reported-by: kernel test robot Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil drivers/media/platform/amphion/vpu_color.c | 183 +++++++ drivers/media/platform/amphion/vpu_helpers.c | 413 ++++++++++++++++ drivers/media/platform/amphion/vpu_helpers.h | 74 +++ drivers/media/platform/amphion/vpu_v4l2.c | 712 +++++++++++++++++++++++++++ drivers/media/platform/amphion/vpu_v4l2.h | 55 +++ 5 files changed, 1437 insertions(+) commit 61cbf1c1fa6d74a6a232a365e0aeddcab11036e4 Author: Ming Qian Date: Thu Feb 24 11:10:03 2022 +0800 media: amphion: implement vpu core communication based on mailbox driver use mailbox to communicate with vpu core. and there are a command buffer and a message buffer. driver will write commands to the command buffer, then trigger a vpu core interrupt vpu core will write messages to the message buffer, then trigger a cpu interrupt. Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Reported-by: kernel test robot Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil drivers/media/platform/amphion/vpu_cmds.c | 433 ++++++++++++++++++++++++++++++ drivers/media/platform/amphion/vpu_cmds.h | 25 ++ drivers/media/platform/amphion/vpu_mbox.c | 118 ++++++++ drivers/media/platform/amphion/vpu_mbox.h | 16 ++ drivers/media/platform/amphion/vpu_msgs.c | 385 ++++++++++++++++++++++++++ drivers/media/platform/amphion/vpu_msgs.h | 14 + 6 files changed, 991 insertions(+) commit 9f599f351e86acf0fc13e42771f97b7fb4dbbea4 Author: Ming Qian Date: Thu Feb 24 11:10:02 2022 +0800 media: amphion: add vpu core driver The vpu supports encoder and decoder. it needs vpu core to handle it. core will run either encoder or decoder firmware. This driver is for support the vpu core. Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil drivers/media/platform/amphion/vpu_codec.h | 68 +++ drivers/media/platform/amphion/vpu_core.c | 871 +++++++++++++++++++++++++++++ drivers/media/platform/amphion/vpu_core.h | 15 + drivers/media/platform/amphion/vpu_dbg.c | 494 ++++++++++++++++ drivers/media/platform/amphion/vpu_rpc.c | 257 +++++++++ drivers/media/platform/amphion/vpu_rpc.h | 456 +++++++++++++++ 6 files changed, 2161 insertions(+) commit b50a64fc54af5bacb2821c344611947ff4bdc0d2 Author: Ming Qian Date: Thu Feb 24 11:10:01 2022 +0800 media: amphion: add amphion vpu device driver The amphion vpu codec ip contains encoder and decoder. Windsor is the encoder, it supports to encode H.264. Malone is the decoder, it features a powerful video processing unit able to decode many formats, such as H.264, HEVC, and other formats. This Driver is for this IP that is based on the v4l2 mem2mem framework. Supported SoCs are: IMX8QXP, IMX8QM Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Reported-by: kernel test robot Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil drivers/media/platform/amphion/Makefile | 20 ++ drivers/media/platform/amphion/vpu.h | 362 +++++++++++++++++++++++++++++ drivers/media/platform/amphion/vpu_defs.h | 187 +++++++++++++++ drivers/media/platform/amphion/vpu_drv.c | 260 +++++++++++++++++++++ drivers/media/platform/amphion/vpu_imx8q.c | 271 +++++++++++++++++++++ drivers/media/platform/amphion/vpu_imx8q.h | 115 +++++++++ 6 files changed, 1215 insertions(+) commit 72a74c8f0a0df12c7d7ea012aa70d95152858dea Author: Ming Qian Date: Thu Feb 24 11:10:00 2022 +0800 media: add nv12m_8l128 and nv12m_10be_8l128 video format. nv12m_8l128 is 8-bit tiled nv12 format used by amphion decoder. nv12m_10be_8l128 is 10-bit tiled format used by amphion decoder. The tile size is 8x128 Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Signed-off-by: Hans Verkuil .../userspace-api/media/v4l/pixfmt-yuv-planar.rst | 28 +++++++++++++++++++--- drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ include/uapi/linux/videodev2.h | 2 ++ 3 files changed, 29 insertions(+), 3 deletions(-) commit 38ad8b32f3afd4314c486685bd1bd7c4c762bf82 Author: Ming Qian Date: Thu Feb 24 11:09:59 2022 +0800 dt-bindings: media: amphion: add amphion video codec bindings Add devicetree binding documentation for amphion Video Processing Unit IP presents on NXP i.MX8Q Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil .../devicetree/bindings/media/amphion,vpu.yaml | 180 +++++++++++++++++++++ 1 file changed, 180 insertions(+) commit 468f252930d8fda0e4365b788b4b621fe59c05ce Author: Dan Carpenter Date: Fri Mar 4 16:12:56 2022 +0300 ASoC: amd: vg: fix signedness bug in acp5x_audio_probe() The "adata->i2s_irq" variable is unsigned so the error handling will not work. Fixes: 87d71a128771 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220304131256.GA28739@kili Signed-off-by: Mark Brown sound/soc/amd/vangogh/acp5x-pcm-dma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 12fdba564afd1f80eeaeed55c1c81761addda161 Merge: 5ad05ecad432 3d1e4228c9dd Author: Mauro Carvalho Chehab Date: Mon Mar 7 16:43:02 2022 +0100 Merge tag 'for-5.18-2.6-signed' of git://linuxtv.org/sailus/media_tree into media_stage Even yet more V4L2 patches for 5.18 * tag 'for-5.18-2.6-signed' of git://linuxtv.org/sailus/media_tree: media: i2c: Fix pixel array positions in ov8865 media: adv7183: Convert to GPIO descriptors media: m5mols: Convert to use GPIO descriptors media: noon010p30: Convert to use GPIO descriptors media: mt9m111: Drop unused include media: adv7511: Drop unused include media: i2c: isl7998x: Add driver for Intersil ISL7998x media: dt-bindings: Add Intersil ISL79987 DT bindings media: media-entity: Clarify media_entity_cleanup() usage media: i2c: imx274: Drop surplus includes media: i2c: ccs: Drop unused include v4l: fwnode: Remove now-redundant loop from v4l2_fwnode_parse_reference() v4l: fwnode: Drop redunant -ENODATA check in property reference parsing media: media-entity: Simplify media_pipeline_start() media: media-entity: Add media_pad_is_streaming() helper function media: Add a driver for the og01a1b camera sensor media: i2c: ov5648: Fix lockdep error media: ov5640: Fix set format, v4l2_mbus_pixelcode not updated Signed-off-by: Mauro Carvalho Chehab commit 5ad05ecad4326ddaa26a83ba2233a67be24c1aaa Author: Sean Young Date: Sun Feb 20 15:28:24 2022 +0100 media: gpio-ir-tx: fix transmit with long spaces on Orange Pi PC Calling udelay for than 1000us does not always yield the correct results. Cc: stable@vger.kernel.org Reported-by: Михаил Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab drivers/media/rc/gpio-ir-tx.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) commit 1092347165cf5ed1453c1f211641a859818a2828 Author: Sean Young Date: Wed Feb 9 17:03:12 2022 +0100 media: lirc: remove unused feature LIRC_CAN_SET_REC_DUTY_CYCLE There is no hardware which can filter input on the duty cycle, so no driver implements this. On top of that, LIRC_CAN_SET_REC_DUTY_CYCLE has the same value as LIRC_CAN_MEASURE_CARRIER (0x02000000). Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Documentation/userspace-api/media/lirc.h.rst.exceptions | 1 - include/uapi/linux/lirc.h | 1 - 2 files changed, 2 deletions(-) commit c81652a4a88ce65312e56321812ae54a73dae963 Merge: 8268d067508b 0bff66dcbe55 Author: Mauro Carvalho Chehab Date: Mon Mar 7 16:26:54 2022 +0100 Merge tag 'br-v5.18q' of git://linuxtv.org/hverkuil/media_tree into media_stage Tag branch * tag 'br-v5.18q' of git://linuxtv.org/hverkuil/media_tree: media: cec: seco: Drop pointless include media: hantro: sunxi: Fix VP9 steps media: imx: csis: Store pads format separately doc: media: Document VP9 reference_mode miss-placement doc: media: Document MM21 tiled format media: imx: imx8mq-mipi-csi2: Remove YUV422 2X8 media: v4l2-core: Initialize h264 scaling matrix media: imx: imx-mipi-csis: Add output format media: imx: imx-mipi-csis: Add BGR888 media: imx: imx-mipi-csis: Add RGB565_1X16 media: imx: imx-mipi-csis: Set PIXEL_MODE for YUV422 media: imx: imx7-media-csi: Use dual sampling for YUV 1X16 media: imx: Rename imx7-mipi-csis.c to imx-mipi-csis.c media: imx: De-stage imx7-mipi-csis Signed-off-by: Mauro Carvalho Chehab commit 8268d067508b0fb9988b5423a8539a21caba5f44 Merge: 8bd4aaf438e3 d8ebe298d008 Author: Mauro Carvalho Chehab Date: Mon Mar 7 16:24:56 2022 +0100 Merge tag 'br-v5.18l' of git://linuxtv.org/hverkuil/media_tree into media_stage Tag branch * tag 'br-v5.18l' of git://linuxtv.org/hverkuil/media_tree: (39 commits) media: imx-jpeg: Set V4L2_BUF_FLAG_LAST at eos media: meson-ir-tx: remove incorrect doc comment media: vivid: use time_is_after_jiffies() instead of open coding it media: wl128x: use time_is_before_jiffies() instead of open coding it media: tda8083: use time_is_after_jiffies() instead of open coding it media: stv0299: use time_is_before_jiffies() instead of open coding it media: si21xx: use time_is_before_jiffies() instead of open coding it media: cedrus: h264: Fix neighbour info buffer size media: cx88-mpeg: clear interrupt status register before streaming video media: cedrus: H265: Fix neighbour info buffer size media: fsl-viu: use GFP_KERNEL media: cx18: use GFP_KERNEL drivers: meson: vdec: add VP9 support to GXM stkwebcam: add new Asus laptop to upside_down table media: imx-jpeg: fix a bug of accessing array out of bounds media: sun6i-csi: fix colorspace in sun6i_video_try_fmt() media: usb: go7007: s2250-board: fix leak in probe() media: cedrus: Add watchdog for job completion pixfmt-yuv-planar.rst: fix typo: 'Cr, Cr' -> 'Cr, Cb' media: imx-jpeg: Remove unnecessary print function dev_err() ... Signed-off-by: Mauro Carvalho Chehab commit 8bd4aaf438e39f88e4321e0cad2d42284c2269af Author: Dmitry Osipenko Date: Sun Feb 20 21:46:21 2022 +0100 media: staging: tegra-vde: De-stage driver The TODO of tegra-vde driver has been completed, driver now supports V4L2 stateless video decoding API. Relocate driver to drivers/media. Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab MAINTAINERS | 2 +- drivers/media/platform/Kconfig | 17 +++++++++++++++++ drivers/media/platform/Makefile | 2 ++ .../tegra-vde => media/platform/tegra/vde}/Makefile | 2 +- .../platform/tegra/vde}/dmabuf-cache.c | 0 .../media/tegra-vde => media/platform/tegra/vde}/h264.c | 0 .../tegra-vde => media/platform/tegra/vde}/iommu.c | 0 .../tegra-vde => media/platform/tegra/vde}/trace.h | 2 +- .../media/tegra-vde => media/platform/tegra/vde}/v4l2.c | 0 .../media/tegra-vde => media/platform/tegra/vde}/vde.c | 0 .../media/tegra-vde => media/platform/tegra/vde}/vde.h | 0 drivers/staging/media/Kconfig | 2 -- drivers/staging/media/Makefile | 1 - drivers/staging/media/tegra-vde/Kconfig | 17 ----------------- drivers/staging/media/tegra-vde/TODO | 4 ---- 15 files changed, 22 insertions(+), 27 deletions(-) commit a097abd401f208d5f8d6cb1727a37ee20b8658e2 Author: Dmitry Osipenko Date: Sun Feb 20 21:46:20 2022 +0100 media: staging: tegra-vde: Bump BSEV DMA timeout BSEV DMA timeouts if VDE is downclocked by x10. Bump the timeout to allow DMA to complete. We don't support freq scaling yet, this is just a minor improvement which may become useful sometime later. Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/staging/media/tegra-vde/h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 313db7d235a0af753ad163a140cb46350d4d1d08 Author: Dmitry Osipenko Date: Sun Feb 20 21:46:19 2022 +0100 media: staging: tegra-vde: Remove legacy UAPI support The legacy UAPI became unnecessary with the V4L stateless decoder API support addition to the Tegra decoder driver. Remove legacy UAPI support. Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/staging/media/tegra-vde/dmabuf-cache.c | 2 +- drivers/staging/media/tegra-vde/h264.c | 61 +++--- drivers/staging/media/tegra-vde/iommu.c | 2 +- drivers/staging/media/tegra-vde/uapi.h | 73 ------- drivers/staging/media/tegra-vde/vde.c | 283 +------------------------ drivers/staging/media/tegra-vde/vde.h | 11 - 6 files changed, 35 insertions(+), 397 deletions(-) commit 24d5d2bafb4609e787d6f8454c5df80734499987 Author: Dmitry Osipenko Date: Sun Feb 20 21:46:18 2022 +0100 media: staging: tegra-vde: Support V4L stateless video decoder API Expose Tegra video decoder as a generic V4L M2M stateless video decoder. Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/staging/media/tegra-vde/Kconfig | 7 + drivers/staging/media/tegra-vde/Makefile | 2 +- drivers/staging/media/tegra-vde/h264.c | 304 ++++++++- drivers/staging/media/tegra-vde/v4l2.c | 1018 ++++++++++++++++++++++++++++++ drivers/staging/media/tegra-vde/vde.c | 74 ++- drivers/staging/media/tegra-vde/vde.h | 86 +++ 6 files changed, 1483 insertions(+), 8 deletions(-) commit 9aa94a316466dc4df6808a4754f13f68bc2e2fa7 Author: Dmitry Osipenko Date: Sun Feb 20 21:46:17 2022 +0100 media: staging: tegra-vde: Factor out H.264 code Factor out H.264 hardware programming code into separate source file in a preparation to support V4L API by the Tegra video decoder driver. Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/staging/media/tegra-vde/Makefile | 2 +- drivers/staging/media/tegra-vde/h264.c | 647 +++++++++++++++++++++++++++++++ drivers/staging/media/tegra-vde/vde.c | 626 +----------------------------- drivers/staging/media/tegra-vde/vde.h | 42 ++ 4 files changed, 706 insertions(+), 611 deletions(-) commit c47383f849097c2b3547e28365578cd9e5811378 Author: Johnson Wang Date: Thu Jan 6 14:54:04 2022 +0800 mfd: Add support for the MediaTek MT6366 PMIC This adds support for the MediaTek MT6366 PMIC. This is a multifunction device with the following sub modules: - Regulator - RTC - Codec - Interrupt It is interfaced to the host controller using SPI interface by a proprietary hardware called PMIC wrapper or pwrap. MT6366 MFD is a child device of the pwrap. Signed-off-by: Johnson Wang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220106065407.16036-2-johnson.wang@mediatek.com drivers/mfd/mt6358-irq.c | 1 + include/linux/mfd/mt6358/registers.h | 7 +++++++ include/linux/mfd/mt6397/core.h | 1 + 3 files changed, 9 insertions(+) commit 5b6ab28d06780c87320ceade61698bb6719c85db Author: Johan Hovold Date: Mon Mar 7 15:23:19 2022 +0100 USB: serial: pl2303: fix GS type detection At least some PL2303GS have a bcdDevice of 0x605 instead of 0x100 as the datasheet claims. Add it to the list of known release numbers for the HXN (G) type. Fixes: 894758d0571d ("USB: serial: pl2303: tighten type HXN (G) detection") Reported-by: Matyáš Kroupa Link: https://lore.kernel.org/r/165de6a0-43e9-092c-2916-66b115c7fbf4@gmail.com Cc: stable@vger.kernel.org # 5.13 Signed-off-by: Johan Hovold drivers/usb/serial/pl2303.c | 1 + 1 file changed, 1 insertion(+) commit e477e51a41cb5d6034f3c5ea85a71ad4613996b9 Author: Jiasheng Jiang Date: Thu Feb 24 10:23:31 2022 +0800 mfd: mc13xxx: Add check for mc13xxx_irq_request As the potential failure of the devm_request_threaded_irq(), it should be better to check the return value of the mc13xxx_irq_request() and return error if fails. Fixes: 8e00593557c3 ("mfd: Add mc13892 support to mc13xxx") Signed-off-by: Jiasheng Jiang Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220224022331.3208275-1-jiasheng@iscas.ac.cn drivers/mfd/mc13xxx-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit c58e496311a50c087eeeaaae81083cd643fe5128 Author: Luca Ceresoli Date: Wed Feb 23 18:59:08 2022 +0100 rtc: max77686: Add MAX77714 support The RTC included in the MAX77714 PMIC is very similar to the one in the MAX77686. Reuse the rtc-max77686.c driver with the minimum required changes for the MAX77714 RTC. Signed-off-by: Luca Ceresoli Reviewed-by: Krzysztof Kozlowski Acked-by: Alexandre Belloni Signed-off-by: Lee Jones drivers/rtc/Kconfig | 2 +- drivers/rtc/rtc-max77686.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) commit 3f6f1f1f9f12c16934304ceca342b7ba83639da9 Author: Luca Ceresoli Date: Wed Feb 23 18:59:07 2022 +0100 watchdog: max77620: Add comment to clarify set_timeout procedure Clarify why we need to ping the watchdog before changing the timeout by quoting the MAX77714 datasheet. Signed-off-by: Luca Ceresoli Reviewed-by: Guenter Roeck Signed-off-by: Lee Jones drivers/watchdog/max77620_wdt.c | 5 +++++ 1 file changed, 5 insertions(+) commit 254099d8fafcd80e11a3246f6ff62af816a2b566 Author: Luca Ceresoli Date: Wed Feb 23 18:59:06 2022 +0100 watchdog: max77620: Add support for the max77714 variant The MAX77714 is a MFD chip whose watchdog has the same programming procedures as the MAX77620 watchdog, but most register offsets and bit masks are different, as well as some features. Support the MAX77714 watchdog by adding a variant description table holding the differences. All the features implemented by this driver are available on the MAX77714 except for the lack of a WDTOFFC bit. Instead of using a "HAS_*" flag we handle this by holding in the cnfg_glbl2_cfg_bits struct field the bits (i.e. the features) to enable in the CNFG_GLBL2 register. These bits differ among the two models. This implementation allows to avoid any conditional code, keeping the execution flow unchanged. Signed-off-by: Luca Ceresoli Reviewed-by: Guenter Roeck Signed-off-by: Lee Jones drivers/watchdog/Kconfig | 2 +- drivers/watchdog/max77620_wdt.c | 80 ++++++++++++++++++++++++++++++++--------- 2 files changed, 65 insertions(+), 17 deletions(-) commit 60b050ff3a60273d56b4017d0f45d5ca71aae5ad Author: Luca Ceresoli Date: Wed Feb 23 18:59:05 2022 +0100 mfd: max77714: Add driver for Maxim MAX77714 PMIC Add a simple driver for the Maxim MAX77714 PMIC, supporting RTC and watchdog only. Signed-off-by: Luca Ceresoli Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones MAINTAINERS | 2 + drivers/mfd/Kconfig | 14 ++++ drivers/mfd/Makefile | 1 + drivers/mfd/max77714.c | 152 +++++++++++++++++++++++++++++++++++++++++++ include/linux/mfd/max77714.h | 60 +++++++++++++++++ 5 files changed, 229 insertions(+) commit d1f3188478743ee302c8b0c1f6d17a82c517fa9d Author: Luca Ceresoli Date: Wed Feb 23 18:59:04 2022 +0100 dt-bindings: mfd: Add Maxim MAX77714 PMIC Add bindings for the MAX77714 PMIC with GPIO, RTC and watchdog. Signed-off-by: Luca Ceresoli Reviewed-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones .../devicetree/bindings/mfd/maxim,max77714.yaml | 68 ++++++++++++++++++++++ MAINTAINERS | 5 ++ 2 files changed, 73 insertions(+) commit 3e2e90fefc9bc6f81a477d35db5e3be1bcb9e62d Author: Luca Ceresoli Date: Wed Feb 23 18:59:03 2022 +0100 rtc: max77686: Remove unused code to read in 12-hour mode The MAX77714 RTC chip is explicitly set to 24-hour mode in max77686_rtc_probe() -> max77686_rtc_init_reg() and never changed back to 12-hour mode. Accordingly info->rtc_24hr_mode is set to 1 in the same place and never modified later, so it is de facto a constant. Yet there is code to read 12-hour time, which is unreachable. Remove the unused variable, the unreachable code to manage 12-hour mode and the defines that become unused due to the above changes. Signed-off-by: Luca Ceresoli Reviewed-by: Krzysztof Kozlowski Acked-by: Alexandre Belloni Signed-off-by: Lee Jones drivers/rtc/rtc-max77686.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) commit a26d84633c2ba3c41fd7692986fb2231c9228c4e Author: Luca Ceresoli Date: Wed Feb 23 18:59:02 2022 +0100 rtc: max77686: Rename day-of-month defines RTC_DATE and REG_RTC_DATE are used for the registers holding the day of month. Rename these constants to mean what they mean. Signed-off-by: Luca Ceresoli Reviewed-by: Krzysztof Kozlowski Acked-by: Alexandre Belloni Signed-off-by: Lee Jones drivers/mfd/max77686.c | 2 +- drivers/rtc/rtc-max77686.c | 16 ++++++++-------- include/linux/mfd/max77686-private.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) commit 72c356c2cf4066c355cc69ca7127ba70df717d93 Author: Luca Ceresoli Date: Wed Feb 23 18:59:01 2022 +0100 rtc: max77686: Convert comments to kernel-doc format Convert the comments documenting this struct to kernel-doc format for standardization and readability. Signed-off-by: Luca Ceresoli Reviewed-by: Krzysztof Kozlowski Acked-by: Alexandre Belloni Reviewed-by: Randy Dunlap Signed-off-by: Lee Jones drivers/rtc/rtc-max77686.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) commit 97939610b893de068c82c347d06319cd231a4602 Author: Christoph Hellwig Date: Fri Mar 4 19:01:05 2022 +0100 block: remove bio_devname All callers are gone, so remove this wrapper. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-11-hch@lst.de Signed-off-by: Jens Axboe block/bio.c | 6 ------ include/linux/bio.h | 2 -- 2 files changed, 8 deletions(-) commit 734294e47a2ec48fd25dcf2d96cdf2c6c6740c00 Author: Christoph Hellwig Date: Fri Mar 4 19:01:04 2022 +0100 ext4: stop using bio_devname Use the %pg format specifier to save on stack consuption and code size. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-10-hch@lst.de Signed-off-by: Jens Axboe fs/ext4/page-io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit c7dec4623c9cde20dad8de319d177ed6aa382aaa Author: Christoph Hellwig Date: Fri Mar 4 19:01:03 2022 +0100 raid5-ppl: stop using bio_devname Use the %pg format specifier to save on stack consuption and code size. Signed-off-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-9-hch@lst.de Signed-off-by: Jens Axboe drivers/md/raid5-ppl.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) commit ac483eb375fa4a815a515945a5456086c197430e Author: Christoph Hellwig Date: Fri Mar 4 19:01:02 2022 +0100 raid1: stop using bio_devname Use the %pg format specifier to save on stack consuption and code size. Signed-off-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-8-hch@lst.de Signed-off-by: Jens Axboe drivers/md/raid1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit ee1925bd834418218c782c94e889f826d40b14d5 Author: Christoph Hellwig Date: Fri Mar 4 19:01:01 2022 +0100 md-multipath: stop using bio_devname Use the %pg format specifier to save on stack consuption and code size. Signed-off-by: Christoph Hellwig Acked-by: Song Liu Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-7-hch@lst.de Signed-off-by: Jens Axboe drivers/md/md-multipath.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 0a806cfde82fcd1fb856864e33d17c68d1b51dee Author: Christoph Hellwig Date: Fri Mar 4 19:01:00 2022 +0100 dm-integrity: stop using bio_devname Use the %pg format specifier to save on stack consuption and code size. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-6-hch@lst.de Signed-off-by: Jens Axboe drivers/md/dm-integrity.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 66671719650085f92fd460d2a356c33f9198dd35 Author: Christoph Hellwig Date: Fri Mar 4 19:00:59 2022 +0100 dm-crypt: stop using bio_devname Use the %pg format specifier to save on stack consuption and code size. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-5-hch@lst.de Signed-off-by: Jens Axboe drivers/md/dm-crypt.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit 47c426d5241795cfcd9be748c44d1b2e2987ce70 Author: Christoph Hellwig Date: Fri Mar 4 19:00:58 2022 +0100 pktcdvd: remove a pointless debug check in pkt_submit_bio ->queuedata is set up in pkt_init_queue, so it can't be NULL here. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-4-hch@lst.de Signed-off-by: Jens Axboe drivers/block/pktcdvd.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) commit ad740780bbc2fe37856f944dbbaff07aac9db9e3 Author: Christoph Hellwig Date: Fri Mar 4 19:00:57 2022 +0100 block: remove handle_bad_sector Use the %pg format specifier instead of the stack hungry bdevname function, and remove handle_bad_sector given that it is not pointless. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-3-hch@lst.de Signed-off-by: Jens Axboe block/blk-core.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) commit 57e95e4670d1126c103305bcf34a9442f49f6d6a Author: Christoph Hellwig Date: Fri Mar 4 19:00:56 2022 +0100 block: fix and cleanup bio_check_ro Don't use a WARN_ON when printing a potentially user triggered condition. Also don't print the partno when the block device name already includes it, and use the %pg specifier to simplify printing the block device name. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-2-hch@lst.de Signed-off-by: Jens Axboe block/blk-core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) commit a58c22cfbbf62fefca090334bbd35fd132e92a23 Author: Miaoqian Lin Date: Mon Mar 7 12:38:12 2022 +0000 video: fbdev: omapfb: Add missing of_node_put() in dvic_probe_of The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: f76ee892a99e ("omapfb: copy omapdss & displays for omapfb") Signed-off-by: Miaoqian Lin Signed-off-by: Helge Deller drivers/video/fbdev/omap2/omapfb/displays/connector-dvi.c | 1 + 1 file changed, 1 insertion(+) commit b15e3bc76925eb1366348483fca89f115c8cde31 Author: Jonathan Neuschäfer Date: Sun Mar 6 15:23:12 2022 +0100 spi: npcm-fiu: Fix typo ("npxm") The platform is called NPCM, not NPXM. Signed-off-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20220306142312.109017-1-j.neuschaefer@gmx.net Signed-off-by: Mark Brown drivers/spi/spi-npcm-fiu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 320689a1b543ca1396b3ed43bb18045e4a7ffd79 Author: Jon Hunter Date: Mon Mar 7 11:35:29 2022 +0000 spi: Fix Tegra QSPI example When running dt_binding_check on the nvidia,tegra210-quad.yaml binding document the following error is reported ... nvidia,tegra210-quad.example.dt.yaml:0:0: /example-0/spi@70410000/flash@0: failed to match any schema with compatible: ['spi-nor'] Update the example in the binding document to fix the above error. Signed-off-by: Jon Hunter Fixes: 9684752e5fe3 ("dt-bindings: spi: Add Tegra Quad SPI device tree binding") Link: https://lore.kernel.org/r/20220307113529.315685-1-jonathanh@nvidia.com Signed-off-by: Mark Brown Documentation/devicetree/bindings/spi/nvidia,tegra210-quad.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fa0f3db49e10ac61774e1c90167ec79429d6fd56 Author: Xingbang Liu Date: Wed Mar 2 15:15:21 2022 +0800 spi: qup: replace spin_lock_irqsave by spin_lock in hard IRQ The code has been in a irq-disabled context since it is hard IRQ. There is no necessity to do it again. Signed-off-by: Xingbang Liu Link: https://lore.kernel.org/r/20220302071521.6638-1-liu.airalert@gmail.com Signed-off-by: Mark Brown drivers/spi/spi-qup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit c59dbc642d4e76187516960780b6cd26e7f2c943 Author: Yihao Han Date: Thu Mar 3 04:50:54 2022 -0800 spi: cadence: fix platform_get_irq.cocci warning Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Signed-off-by: Yihao Han Link: https://lore.kernel.org/r/20220303125054.3574-1-hanyihao@vivo.com Signed-off-by: Mark Brown drivers/spi/spi-cadence-xspi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit af524ae5ad13a9c28acf0b2ec4489d5903c4fbed Author: Kuldeep Singh Date: Thu Mar 3 00:59:15 2022 +0530 spi: Update NXP Flexspi maintainer details Add Han Xu as flexspi maintainer. Also, update my email address as previous one is not working anymore. Signed-off-by: Kuldeep Singh Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220302192915.6193-1-singh.kuldeep87k@gmail.com Signed-off-by: Mark Brown Documentation/devicetree/bindings/spi/spi-nxp-fspi.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit bbc7ba0fa06ab4aee26969a9454ca32e4a8fcb1c Author: Tom Rix Date: Sat Mar 5 08:24:38 2022 -0800 regulator: cleanup comments For spdx Remove leading space, add space after // Replacements overriden to overridden Calulate to Calculate addional to additional regulatior to regulator devive to device Signed-off-by: Tom Rix Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220305162438.689442-1-trix@redhat.com Signed-off-by: Mark Brown drivers/regulator/max8973-regulator.c | 2 +- drivers/regulator/sc2731-regulator.c | 2 +- drivers/regulator/ti-abb-regulator.c | 6 +++--- drivers/regulator/wm8350-regulator.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) commit 71a6254c8b8aa3dcac3a5cb1d1cc2a2d3a840bfb Author: Richard Fitzgerald Date: Fri Mar 4 14:40:15 2022 +0000 ASoC: cs42l42: Add warnings about DETECT_MODE and PLL_START DETECT_MODE and PLL_START must be zero while HP_PDN and ADC_PDN are both 1. If this condition is broken it can discharge FILT+ and it can then take up to 1 second for FILT+ to recharge. There is no workaround required for this, simply avoiding settings and sequences that would break the requirement. The driver already meets the requirement. But it is not obvious from reading the code that this requirement exists, or what is ensuring it is met. So it would not currently be obvious to someone changing the code that there is certain special behaviour that must be maintained. To avoid accidental breakage in the future: - Add comments into the register definitions to warn about this so that anyone changing the code around DETECT_MODE and PLL_START is aware of this requirement. - Add a comment where PLL_START is written to 1 to highlight the requirement and why it is satisfied. - Add a comment in cs42l42_setup_hs_type_detect() when DETECT_MODE is initialized. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220304144015.398656-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown sound/soc/codecs/cs42l42.c | 13 ++++++++++++- sound/soc/codecs/cs42l42.h | 9 ++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) commit b6b62d942bbc4d926bcf3799ea3bcaeb105fd04f Author: Simon Trimmer Date: Thu Mar 3 15:50:16 2022 +0000 ASoC: wm_adsp: Expand firmware loading search options The parts supported by this driver can have product-specific firmware and tunings files. Typically these have been used on embedded systems where the manufacturer is responsible for installing the correct product-specific firmware files into /lib/firmware. However, the linux-firmware repository places all available firmwares into /lib/firmware and it is up to the driver to select the correct product-specific firmware from that directory. For example a product containing four smart amplifiers may provide firmware specific for that product and each of the amplifiers may have coefficient files containing tunings for their placement in the mechanical design. This change extends firmware (wmfw) and coefficient (bin) filenames to be of the general form: part-dspN-fwtype<-system_name<-asoc_component_prefix>>.type Where the cirrus subdirectory, system_name and asoc_component_prefix are optional. New files will be placed in the cirrus subdirectory to avoid polluting the main /lib/firmware/ location. The generic name must be searched in /lib/firmware before /lib/firmware/cirrus so that a generic file in the new location does not override existing product-specific files in the legacy location. The search order for firmware files is: - cirrus/part-dspN-fwtype-system_name-asoc_component_prefix.wmfw - cirrus/part-dspN-fwtype-system_name.wmfw - part-dspN-fwtype.wmfw - cirrus/part-dspN-fwtype.wmfw - Qualifications are added to the filename so that rightwards is more specific. - The system_name is provided by the codec driver. - The asoc_component_prefix is used to identify tunings for individual parts because it would already exist to disambiguate the controls and it makes it obvious which firmware file applies to which device. The optional coefficient file must have the same filename construction as the discovered wmfw except: - where the wmfw has only system_name then the bin file can optionally include the asoc_component_prefix. This is to allow a common wmfw for all amps but separate tunings per amp. Signed-off-by: Simon Trimmer Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220303155016.122125-1-simont@opensource.cirrus.com Signed-off-by: Mark Brown sound/soc/codecs/wm_adsp.c | 99 ++++++++++++++++++++++++++++++++++++++++------ sound/soc/codecs/wm_adsp.h | 1 + 2 files changed, 88 insertions(+), 12 deletions(-) commit 405afed8a728f23cfaa02f75bbc8bdd6b7322123 Author: Jiasheng Jiang Date: Wed Mar 2 14:28:44 2022 +0800 ASoC: fsi: Add check for clk_enable As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes: ab6f6d85210c ("ASoC: fsi: add master clock control functions") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220302062844.46869-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown sound/soc/sh/fsi.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) commit 6ed5dbba6c971fe644f5c2b4aae436b39da99f18 Author: Srinivas Kandagatla Date: Fri Mar 4 16:09:34 2022 +0000 ASoC: qcom: select correct WCD938X config for SC7280 SC7280 config selected WCD938X instead of WCD938X_SDW Soundwire codecs. WCD938X_SDW actually selects WCD938X, so directly selecting WCD938X results in unmet dependencies and below warning WARNING: unmet direct dependencies detected for SND_SOC_WCD938X Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && SND_SOC_WCD938X_SDW [=n] && (SOUNDWIRE [=n] || !SOUNDWIRE [=n]) Selected by [m]: - SND_SOC_SC7280 [=m] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=m] && SND_SOC_QCOM [=m] && (I2C [=y] && SOUNDWIRE [=n] || COMPILE_TEST [=y]) Fix this issue by selecting WCD SoundWire codecs instead of component driver. Fixes: 57350bd41c3a ("ASoC: qcom: SC7280: Add machine driver") Reported-by: Randy Dunlap Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220304160934.32010-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown sound/soc/qcom/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 139cad4bde675552466da5af61b4686da9fc8008 Author: Lucas Tanure Date: Fri Mar 4 15:07:05 2022 +0000 ASoC: cs35l41: Remove unnecessary param cs35l41_private is not used on cs35l41_handle_pdata Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220304150721.3802-5-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown sound/soc/codecs/cs35l41.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit dacf1497a8ea388cca67081dc25780c50f77fa42 Author: Lucas Tanure Date: Fri Mar 4 15:07:03 2022 +0000 ASoC: cs35l41: Fix max number of TX channels This device only has 4 TX channels. Fixes: fe1024d50477b ("ASoC: cs35l41: Combine adjacent register writes") Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220304150721.3802-3-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown sound/soc/codecs/cs35l41.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b41d6195b2f0c5d5df009aa518958f3c46e66d9a Author: Derek Fang Date: Mon Mar 7 18:21:54 2022 +0800 ASoC: rt5682s: Stabilize the combo jack detection Changes: 1. Revise rt5682s_sar_power_mode and rt5682s_headset_detect to be more rational. 2. Manually set to the jack-unplugging state via rt5682s_headset_detect during going to suspend. Close unnecessary powers and prepare for re-detecting the CBJ during resuming. 3. Simplize rt5682s_resume. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20220307102154.26065-1-derek.fang@realtek.com Signed-off-by: Mark Brown sound/soc/codecs/rt5682s.c | 47 +++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-) commit db0350da8084ad549bca16cc0486c11cc70a1f9b Author: Jiasheng Jiang Date: Fri Mar 4 10:38:21 2022 +0800 ASoC: wm8350: Handle error for wm8350_register_irq As the potential failure of the wm8350_register_irq(), it should be better to check it and return error if fails. Also, use 'free_' in order to avoid the same code. Fixes: a6ba2b2dabb5 ("ASoC: Implement WM8350 headphone jack detection") Signed-off-by: Jiasheng Jiang Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220304023821.391936-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown sound/soc/codecs/wm8350.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) commit f590797fa3c1bccdd19e55441592a23b46aef449 Author: Miaoqian Lin Date: Mon Mar 7 12:45:39 2022 +0000 ASoC: atmel: Add missing of_node_put() in at91sam9g20ek_audio_probe This node pointer is returned by of_parse_phandle() with refcount incremented in this function. Calling of_node_put() to avoid the refcount leak. Fixes: 531f67e41dcd ("ASoC: at91sam9g20ek-wm8731: convert to dt support") Signed-off-by: Miaoqian Lin Reviewed-by: Codrin Ciubotariu Link: https://lore.kernel.org/r/20220307124539.1743-1-linmq006@gmail.com Signed-off-by: Mark Brown sound/soc/atmel/sam9g20_wm8731.c | 1 + 1 file changed, 1 insertion(+) commit 9a33f5632ca573e512c49fa46cc7131cbc83d4c9 Author: Dan Carpenter Date: Fri Mar 4 16:15:34 2022 +0300 ASoC: amd: pcm-dma: Fix signedness bug in acp3x_audio_probe() The "adata->i2s_irq" variable is unsigned so this error handling code will not work. Fixes: 87d71a128771 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220304131534.GD28739@kili Signed-off-by: Mark Brown sound/soc/amd/raven/acp3x-pcm-dma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 00925272f166db31fed73f3c00c151eb5f7ce1d8 Author: Dan Carpenter Date: Fri Mar 4 16:13:35 2022 +0300 ASoC: amd: pcm-dma: Fix signedness bug in acp_pdm_audio_probe() The "adata->pdm_irq" variable is unsigned so the error handling will not work. Fixes: 87d71a128771 ("ASoC: amd: pcm-dma: Use platform_get_irq() to get the interrupt") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220304131335.GB28739@kili Signed-off-by: Mark Brown sound/soc/amd/renoir/acp3x-pdm-dma.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 899a9a7f624b5a9d100c9ac6b3f0960981f0e4c5 Author: Dan Carpenter Date: Fri Mar 4 16:14:49 2022 +0300 ASoC: amd: acp: Fix signedness bug in renoir_audio_probe() The "adata->i2s_irq" is unsigned so this error handling will not work. Fixes: 3304a242f45a ("ASoC: amd: Use platform_get_irq_byname() to get the interrupt") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220304131449.GC28739@kili Signed-off-by: Mark Brown sound/soc/amd/acp/acp-renoir.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit ce73ef6ec67104d1fcc4c5911d77ce83288a0998 Author: Anthony I Gilea Date: Fri Mar 4 14:45:32 2022 -0600 ASoC: Intel: sof_sdw: fix quirks for 2022 HP Spectre x360 13" HP changed the DMI identification for 2022 devices: Product Name: HP Spectre x360 Conv 13-ap0001na Product Name: 8709 This patch relaxes the DMI_MATCH criterion to work with all versions of this product. Reviewed-by: Rander Wang Signed-off-by: Anthony I Gilea Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304204532.54675-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown drivers/soundwire/dmi-quirks.c | 2 +- sound/soc/intel/boards/sof_sdw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit bdfc385948bf8e73629b3580941c9d810711713b Author: Pierre-Louis Bossart Date: Fri Mar 4 14:45:31 2022 -0600 ASoC: Intel: boards: add GPIOLIB dependency where missed We have eleven machine drivers who make explicit references to gpios. Let's add the dependency. The use of 'depends on' instead of 'select' is intentional. On one side it could be argued that the GPIOs are required, but on the other it might create more issues with randconfig builds. This patch sticks with the existing direction of using 'depends' on high-level non-audio dependencies Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220304204532.54675-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/Kconfig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 32666b866f55a224d2f07f83594fcf37a922b6c9 Author: Pierre-Louis Bossart Date: Fri Mar 4 14:45:30 2022 -0600 ASoC: Intel: boards: remove explicit dependency on GPIOLIB when DMIC is used" This patch reverts commit 4262ddc2ad63 ("ASoC: Intel: boards: add explicit dependency on GPIOLIB when DMIC is used") and all follow-up additions of this dependency. Now that the DMIC does not depend on GPIOLIB we can simplify again. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20220304204532.54675-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/Kconfig | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) commit a50b7926d015c3b8194ab1d7c8aa86db8e4b7700 Author: Ahmad Fatoum Date: Wed Mar 2 09:34:28 2022 +0100 ASoC: fsl_sai: implement 1:1 bclk:mclk ratio support With higher channel counts, we may need higher clock rates. Starting with SAI v3.1 (i.MX8MM), we can bypass the divider and get a 1:1 bclk:mclk ratio. Add the necessary support. Signed-off-by: Viorel Suman Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220302083428.3804687-8-s.hauer@pengutronix.de Signed-off-by: Mark Brown sound/soc/fsl/fsl_sai.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) commit 1d4cbdf7bf2eaa794528250a29aed08f1df7f837 Author: Sascha Hauer Date: Wed Mar 2 09:34:27 2022 +0100 ASoC: fsl_sai: use DIV_ROUND_CLOSEST() to calculate divider In fsl_sai_set_bclk() we want to calculate the divider that gets us closest to the desired frequency, so use DIV_ROUND_CLOSEST() instead of just doing a clk_rate/freq. Also discard invalid ratios earlier. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220302083428.3804687-7-s.hauer@pengutronix.de Signed-off-by: Mark Brown sound/soc/fsl/fsl_sai.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) commit c56359f4f2adfb81cf7cbea1e8ef9bfc59dbd4ec Author: Sascha Hauer Date: Wed Mar 2 09:34:26 2022 +0100 ASoC: fsl_sai: Use better variable names "ret" is normally used as a variable name for return values. In fsl_sai_set_bclk() it stores the difference between the desired rate and the rate we can archieve, so rename it to "diff". Also rename "savesub" to "bestdiff" as that stores the best difference we have found. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220302083428.3804687-6-s.hauer@pengutronix.de Signed-off-by: Mark Brown sound/soc/fsl/fsl_sai.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit 99c1e74f25d435c1c714b8ee0dceb7ebb7d2f2f1 Author: Sascha Hauer Date: Wed Mar 2 09:34:25 2022 +0100 ASoC: fsl_sai: store full version instead of major/minor The driver tests for the hardware revision being newer than 3.1 with (sai->verid.major >= 3 && sai->verid.minor >= 1). The result is obviously wrong for hardware revision 4.0. Fix this by storing the full version in a single variable and comparing to that one. No practical change at the moment as there is no 4.0 ip version currently. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220302083428.3804687-5-s.hauer@pengutronix.de Signed-off-by: Mark Brown sound/soc/fsl/fsl_sai.c | 8 +++----- sound/soc/fsl/fsl_sai.h | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) commit 814c9fc46fb987bdb3af093e4818c86e62db4fa5 Author: Ahmad Fatoum Date: Wed Mar 2 09:34:24 2022 +0100 ASoC: fsl_sai: simplify register poking in fsl_sai_set_bclk Depending on SAI synchronization mode, the same value is either written to FSL_SAI_TCR2 or FSL_SAI_RCR2 or nothing is written at all. As the computation is the same either way, factor it out to make it clearer what the difference is. No functional change. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220302083428.3804687-4-s.hauer@pengutronix.de Signed-off-by: Mark Brown sound/soc/fsl/fsl_sai.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) commit cb00b4c18f89aa8ffb847cd033467f0958c025a0 Author: Sascha Hauer Date: Wed Mar 2 09:34:23 2022 +0100 ASoC: fsl_sai: simplify irq return value Instead of using a boolean "irq_none" to describe the interrupt handlers return value use a variable of type irqreturn_t and return it directly. No functional change. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220302083428.3804687-3-s.hauer@pengutronix.de Signed-off-by: Mark Brown sound/soc/fsl/fsl_sai.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) commit bd393e2ecc30bde95fcfab23af8246d1724e25cd Author: Sascha Hauer Date: Wed Mar 2 09:34:22 2022 +0100 ASoC: fsl_sai: Drop unnecessary defines The fsl_sai driver has FSL_FMT_TRANSMITTER and FSL_FMT_RECEIVER defines which are used in a single function only then are then only translated into a bool 'tx' variable. Drop the defines and pass the boolean value directly to fsl_sai_set_dai_sysclk_tr(). No functional change. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220302083428.3804687-2-s.hauer@pengutronix.de Signed-off-by: Mark Brown sound/soc/fsl/fsl_sai.c | 16 ++++++---------- sound/soc/fsl/fsl_sai.h | 3 --- 2 files changed, 6 insertions(+), 13 deletions(-) commit 6b4528b5532f84f385b4e756637698cf4ae211f3 Author: Jonathan Albrieux Date: Fri Mar 4 11:24:52 2022 +0100 ASoC: codecs: Add Awinic AW8738 audio amplifier driver The Awinic AW8738 is a simple audio amplifier using a single GPIO. The main difference to simple-amplifier is that there is a "one-wire pulse control" that allows configuring the amplifier to one of a few pre-defined modes. This can be used to configure the speaker-guard function (primarily the power limit for the amplifier). Add a simple driver that allows setting it up in the device tree with a specified mode number. Signed-off-by: Jonathan Albrieux Co-developed-by: Stephan Gerhold Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20220304102452.26856-3-stephan@gerhold.net Signed-off-by: Mark Brown sound/soc/codecs/Kconfig | 10 +++++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/aw8738.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) commit b3284430615c27ca441967f99fbde957b434e092 Author: Stephan Gerhold Date: Fri Mar 4 11:24:51 2022 +0100 ASoC: dt-bindings: Add schema for "awinic,aw8738" Add a DT schema for describing Awinic AW8738 audio amplifiers. They are fairly simple and controlled using a single GPIO. The number of pulses during power up selects one of a few pre-defined operation modes. This can be used to configure the speaker-guard function (primarily the power limit for the amplifier). Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20220304102452.26856-2-stephan@gerhold.net Signed-off-by: Mark Brown .../devicetree/bindings/sound/awinic,aw8738.yaml | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) commit 1e974e5b82b3d75069b50445cd248cee0199654e Author: Richard Fitzgerald Date: Mon Feb 28 17:27:54 2022 +0000 ASoC: audio_graph_card2: Add support for variable slot widths Some audio hardware cannot support the same slot width for all sample widths, or a slot width equal to the sample width for all sample widths. This is usually due either to limitations of the audio serial port or system clocking restrictions. A typical example would be: - 16-bit samples in 16-bit slots - 24-bit samples in 32-bit slots The new dai-tdm-slot-width-map property allows setting a mapping of sample widths and the corresponding tdm slot widths and slot counts. Although the slot count is usually the same for all cases this does allow for adding padding slots to maintain the same bitclk frequency. The property is added to each endpoint node that needs the component DAI to be told the TDM slot width and count. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220228172754.453783-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown include/sound/simple_card_utils.h | 11 ++++ sound/soc/generic/audio-graph-card2.c | 4 ++ sound/soc/generic/simple-card-utils.c | 97 +++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) commit 26e5366dd30569a469e1a87998b866b814deccf8 Author: Richard Fitzgerald Date: Mon Feb 28 17:27:53 2022 +0000 ASoC: dt-bindings: audio-graph-port: Add dai-tdm-slot-width-map Some audio hardware cannot support a fixed slot width for all sample widths, or a slot width equal to the sample width for all sample widths. This is usually due either to limitations of the audio serial port or system clocking restrictions. This property allows setting a mapping of sample widths and the corresponding tdm slot widths. The slot count is also provided for each slot width - although this would almost always be the same for all slot widths this allows for possibly adding extra padding slots to maintain a fixed bitclock frequency. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20220228172754.453783-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown .../devicetree/bindings/sound/audio-graph-port.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) commit 0f33105bb2f77c870542d5bc08cf94b8c4e26f36 Author: Pierre-Louis Bossart Date: Fri Mar 4 14:57:33 2022 -0600 ASoC: SOF: Intel: hda: clarify operator precedence cppcheck warning sound/soc/sof/intel/hda.c:545:46: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] char *level = flags & SOF_DBG_DUMP_OPTIONAL ? KERN_DEBUG : KERN_ERR; Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-11-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/intel/hda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9188812539d1d9a13dac690c95ec657259859ba4 Author: Pierre-Louis Bossart Date: Fri Mar 4 14:57:32 2022 -0600 ASoC: SOF: debug: clarify operator precedence cppcheck warning: for '&' and '?'. [clarifyCalculation] char *level = flags & SOF_DBG_DUMP_OPTIONAL ? KERN_DEBUG : KERN_ERR; ^ sound/soc/sof/debug.c:398:46: style: Clarify calculation precedence Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-10-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4aaa06b227f737da5c10feb93a6b203920d5a1e7 Author: Curtis Malainey Date: Fri Mar 4 14:57:31 2022 -0600 ASoC: SOF: fix 32 signed bit overflow Shifting in a signed 32bit container past the signed bit is technically undefined behaviour. Fix by using unsigned types. Found via cppcheck. Reviewed-by: Ranjani Sridharan Reviewed-by: Liam Girdwood Signed-off-by: Curtis Malainey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown include/sound/sof/header.h | 2 +- include/uapi/sound/sof/abi.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 8e85cab858562734b9d323f392ba9956bbdc133c Author: Ajit Kumar Pandey Date: Fri Mar 4 14:57:30 2022 -0600 ASoC: SOF: amd: Increase ACP_HW_SEM_RETRY_COUNT value Host is trying to acquire semaphore lock based on HW_SEM_RETRY_COUNT value which is set to 10 by default. So host will loop for 10 times trying to acquire lock before giving error msg "Failed to acquire HW lock". Though this loop count of 10 is good enough with most of the times but we have observed such failure msg in very few cases(~5 %). Increase ACP_HW_SEM_RETRY_COUNT to avoid such issue and loop for a significant time period before throwing error. We're setting newer loop count to quite higher value of 10K but it's very unlikely that it will loop for this count, since for most of the cases lock will get acquired at much lesser loop iterations. Reviewed-by: Ranjani Sridharan Signed-off-by: Ajit Kumar Pandey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/amd/acp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7cf467ac9cf33f0975095f080a79f6ec6d9be5b6 Author: Ajit Kumar Pandey Date: Fri Mar 4 14:57:29 2022 -0600 ASoC: SOF: amd: Move group register configuration to acp-loader We are using PTE_GRP1 for DMA operations to load firmware binaries but we are enabling PTE_GRP and flushing ATU cache much before in probe callbacks. This can cause issue if we try to load firmware runtime during system resume as probe callback will not be invoked hence PTE_GRP will not be enabled. Moreover it makes more sense to flush the cache after register configuration. Move PTE group register configuration to acp-loader within pre_fw_run callback to avoid such issue. Reviewed-by: Ranjani Sridharan Signed-off-by: Ajit Kumar Pandey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/amd/acp-loader.c | 9 +++++++++ sound/soc/sof/amd/acp.c | 14 -------------- 2 files changed, 9 insertions(+), 14 deletions(-) commit dc0d4ed26dd2166b47c29d6a9829ac798e62a0fc Author: Ajit Kumar Pandey Date: Fri Mar 4 14:57:28 2022 -0600 ASoC: SOF: amd: Use semaphore register to synchronize ipc's irq Add lock and unlock around ipc irq handling code using hw semaphore register that exhibit special property for register read calls. As host and DSP firmware uses few shared registers, there is a possible race condition around those shared registers values. This lock ensure synchronization between Firmware and host ipc interrupts. Reviewed-by: Ranjani Sridharan Signed-off-by: Ajit Kumar Pandey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/amd/acp-dsp-offset.h | 1 + sound/soc/sof/amd/acp-ipc.c | 14 ++++++++++++++ sound/soc/sof/amd/acp.c | 15 ++++++++++++++- sound/soc/sof/amd/acp.h | 1 + 4 files changed, 30 insertions(+), 1 deletion(-) commit b7485ec850591ad62fde0526bd7fdc56cdc04efd Author: Ajit Kumar Pandey Date: Fri Mar 4 14:57:27 2022 -0600 ASoC: SOF: amd: Flush cache after ATU_BASE_ADDR_GRP register update ACP_SRAM_PTE block has cache that needs to be flushed after every PTE updates. This patch updates ACPAXI2AXI_ATU_CTRL register to flush cache after updating PTE with stream physical address. Reviewed-by: Ranjani Sridharan Signed-off-by: Ajit Kumar Pandey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/amd/acp-stream.c | 3 +++ 1 file changed, 3 insertions(+) commit 9c2611b2a620f90219f85e4b40bbe3e26ab81e2c Author: Peter Ujfalusi Date: Fri Mar 4 14:57:26 2022 -0600 ASoC: SOF: amd: Do not set ipc_pcm_params ops as it is optional The ipc_pcm_params() ops implementation for AMD is a NOP and since the callback is marked now as optional, it can be dropped along with the empty function. Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/amd/acp-ipc.c | 8 -------- sound/soc/sof/amd/acp.h | 2 -- sound/soc/sof/amd/renoir.c | 1 - 3 files changed, 11 deletions(-) commit edca0623f6d7928b312780d4e885258ca9e562fe Author: Peter Ujfalusi Date: Fri Mar 4 14:57:25 2022 -0600 ASoC: SOF: amd: acp-pcm: Take buffer information directly from runtime Instead of using the values from ipc_params, take them directly from substream->runtime. This is in preparation of making the platform hw_params callback to be IPC agnostic. Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Reviewed-by: Daniel Baluta Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/amd/acp-pcm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit d66c57c5ff8a24859fe7506d290d0b705c2576c0 Author: Gongjun Song Date: Fri Mar 4 14:57:24 2022 -0600 ASoC: SOF: Intel: pci-tgl: add RPL-S support Add PCI DID for Intel Raptor Lake S. Reviewed-by: Kai Vehmanen Signed-off-by: Gongjun Song Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220304205733.62233-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/sof/intel/pci-tgl.c | 2 ++ 1 file changed, 2 insertions(+) commit 5e02fb590e83684f63217f93a9cdeabd6a925f9c Author: Lucas Tanure Date: Thu Mar 3 17:30:42 2022 +0000 ASoC: cs35l41: Fix DSP mbox start command and global enable order Global enable must happen before CSPL_MBOX_CMD_RESUME command is sent. Move it to PRE_PMU as both events use SND_SOC_DAPM_OUT_DRV_E macro. Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220303173059.269657-4-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown sound/soc/codecs/cs35l41.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 16639d39bdf577168d3fe34315917a94365c8d19 Author: Lucas Tanure Date: Thu Mar 3 17:30:41 2022 +0000 ASoC: cs35l41: Fix max number of TX channels This device only has 4 TX channels. Fixes: fe1024d50477b ("ASoC: cs35l41: Combine adjacent register writes") Signed-off-by: Lucas Tanure Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220303173059.269657-3-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown sound/soc/codecs/cs35l41.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 03a7895ee701e873c88c06bdb830ff40adb2be73 Author: David Rhodes Date: Thu Mar 3 17:30:40 2022 +0000 ASoC: cs35l41: Fix GPIO2 configuration Fix GPIO2 polarity and direction configuration Fixes: fe1024d50477b ("ASoC: cs35l41: Combine adjacent register writes") Signed-off-by: David Rhodes Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220303173059.269657-2-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown sound/soc/codecs/cs35l41.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a4abd55a2490fd6407ddb6810e41f64ebd66d3af Author: Christophe Leroy Date: Fri Mar 4 18:04:04 2022 +0100 powerpc/kexec: Declare kexec_paca static kexec_paca is exclusively used in kexec/core_64.c Declare it static. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/094983ee851644165b7700c73cac63cfe20596cd.1646413435.git.christophe.leroy@csgroup.eu arch/powerpc/include/asm/asm-prototypes.h | 2 -- arch/powerpc/kexec/core_64.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) commit e15c703be48edc3b2f96b66d4f548dc88b44266c Author: Christophe Leroy Date: Fri Mar 4 18:04:03 2022 +0100 powerpc/smp: Declare current_set static current_set extern not needed anymore since commit eafd825ed710 ("powerpc/64: Simplify __secondary_start paca->kstack handling") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a55eb65c9d7319f0af3c31e3f6ba36522f10003d.1646413435.git.christophe.leroy@csgroup.eu arch/powerpc/include/asm/asm-prototypes.h | 1 - arch/powerpc/kernel/smp.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) commit e86debbbb5f89c2575110cfdce89d1820577aa94 Author: Christophe Leroy Date: Fri Mar 4 18:04:02 2022 +0100 powerpc: Cleanup asm-prototypes.c Last call to sys_swapcontext() from ASM was removed by commit fbcee2ebe8ed ("powerpc/32: Always save non volatile GPRs at syscall entry") sys_debug_setcontext() prototype not needed anymore since commit f3675644e172 ("powerpc/syscalls: signal_{32, 64} - switch to SYSCALL_DEFINE") sys_switch_endian() prototype not needed anymore since commit 81dac8177862 ("powerpc/64: Make sys_switch_endian() traceable") Signed-off-by: Christophe Leroy [mpe: Keep _mcount() prototype to avoid modpost errors] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3ed660a585df2080ea8412ec20fbf652f5bf013a.1646413435.git.christophe.leroy@csgroup.eu arch/powerpc/include/asm/asm-prototypes.h | 6 ------ 1 file changed, 6 deletions(-) commit 2ca48dbb210767b9e7166d7d47febc8fcd1da6e1 Author: Christophe Leroy Date: Thu Feb 17 13:01:59 2022 +0100 powerpc/ftrace: Use STK_GOT in ftrace_mprofile.S Instead of open coding offset value 24, use STK_GOT when accessing got register in stack. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/9042bb30fa972056715fe5b6598a7c8049681293.1645099283.git.christophe.leroy@csgroup.eu arch/powerpc/kernel/trace/ftrace_mprofile.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit a5f04d1f2724db036ba4087873c0691881932bc9 Author: Christophe Leroy Date: Thu Feb 17 13:01:58 2022 +0100 powerpc/ftrace: Regroup PPC64 specific operations in ftrace_mprofile.S CONFIG_MPROFILE_KERNEL is only for PPC64 and ftrace_mprofile.o is build on PPC64 only when CONFIG_MPROFILE_KERNEL is defined. Move saving of r0 inside #ifdef PPC64 Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/619dfb672bf4f1b777a4b3f8b4f14e637fea2716.1645099283.git.christophe.leroy@csgroup.eu arch/powerpc/kernel/trace/ftrace_mprofile.S | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 228216716cb5f9a19d70bfc40bdc0d6a7fb7e72f Author: Christophe Leroy Date: Thu Feb 17 13:01:57 2022 +0100 powerpc/ftrace: Refactor ftrace_{regs_}caller ftrace_caller() and frace_regs_caller() have now a lot in common. Refactor them using GAS macros. Signed-off-by: Christophe Leroy Reviewed-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/9d7df9e4fc98a86051489f61d3c9bc67f92f7e27.1645099283.git.christophe.leroy@csgroup.eu arch/powerpc/kernel/trace/ftrace_mprofile.S | 147 +++++++++------------------- 1 file changed, 45 insertions(+), 102 deletions(-) commit 9bdb2eec3dde4d66b71cb4bbaebde0caed2cf0e3 Author: Christophe Leroy Date: Thu Feb 17 13:01:56 2022 +0100 powerpc/ftrace: Don't use lmw/stmw in ftrace_regs_caller() For the same reason as commit a85c728cb5e1 ("powerpc/32: Don't use lmw/stmw for saving/restoring non volatile regs"), don't use lmw/stmw in ftrace_regs_caller(). Use the same macros for PPC32 and PPC64. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ec286d2cc6989668a96f14543275437d2f3f0e3a.1645099283.git.christophe.leroy@csgroup.eu arch/powerpc/kernel/trace/ftrace_mprofile.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) commit 57201d657eb76d735298405d3200a3b1f67197e1 Author: Pratik R. Sampat Date: Thu Feb 17 16:23:21 2022 +0530 selftest/powerpc: Add PAPR sysfs attributes sniff test Include a testcase to check if the sysfs files for energy and frequency related have its related attribute files exist and populated Signed-off-by: Pratik R. Sampat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220217105321.52941-3-psampat@linux.ibm.com tools/testing/selftests/powerpc/Makefile | 1 + .../selftests/powerpc/papr_attributes/.gitignore | 2 + .../selftests/powerpc/papr_attributes/Makefile | 7 ++ .../selftests/powerpc/papr_attributes/attr_test.c | 107 +++++++++++++++++++++ 4 files changed, 117 insertions(+) commit 3c14b73454cf9f6e2146443fdfbdfb912c0efed3 Author: Pratik R. Sampat Date: Thu Feb 17 16:23:20 2022 +0530 powerpc/pseries: Interface to represent PAPR firmware attributes Adds a syscall interface to represent the energy and frequency related PAPR attributes on the system using the new H_CALL "H_GET_ENERGY_SCALE_INFO". H_GET_EM_PARMS H_CALL was previously responsible for exporting this information in the lparcfg, however the H_GET_EM_PARMS H_CALL will be deprecated P10 onwards. The H_GET_ENERGY_SCALE_INFO H_CALL is of the following call format: hcall( uint64 H_GET_ENERGY_SCALE_INFO, // Get energy scale info uint64 flags, // Per the flag request uint64 firstAttributeId,// The attribute id uint64 bufferAddress, // Guest physical address of the output buffer uint64 bufferSize // The size in bytes of the output buffer ); As specified in PAPR+ v2.11, section 14.14.3. This H_CALL can query either all the attributes at once with firstAttributeId = 0, flags = 0 as well as query only one attribute at a time with firstAttributeId = id, flags = 1. The output buffer consists of the following 1. number of attributes - 8 bytes 2. array offset to the data location - 8 bytes 3. version info - 1 byte 4. A data array of size num attributes, which contains the following: a. attribute ID - 8 bytes b. attribute value in number - 8 bytes c. attribute name in string - 64 bytes d. attribute value in string - 64 bytes The new H_CALL exports information in direct string value format, hence a new interface has been introduced in /sys/firmware/papr/energy_scale_info to export this information to userspace so that the firmware can add new values without the need for the kernel to be changed. The H_CALL returns the name, numeric value and string value (if exists) The format of exposing the sysfs information is as follows: /sys/firmware/papr/energy_scale_info/ |-- / |-- desc |-- value |-- value_desc (if exists) |-- / |-- desc |-- value |-- value_desc (if exists) ... The energy information that is exported is useful for userspace tools such as powerpc-utils. Currently these tools infer the "power_mode_data" value in the lparcfg, which in turn is obtained from the to be deprecated H_GET_EM_PARMS H_CALL. On future platforms, such userspace utilities will have to look at the data returned from the new H_CALL being populated in this new sysfs interface and report this information directly without the need of interpretation. Signed-off-by: Pratik R. Sampat Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220217105321.52941-2-psampat@linux.ibm.com .../testing/sysfs-firmware-papr-energy-scale-info | 29 ++ arch/powerpc/include/asm/firmware.h | 4 +- arch/powerpc/include/asm/hvcall.h | 3 +- arch/powerpc/kvm/trace_hv.h | 1 + arch/powerpc/platforms/pseries/Makefile | 3 +- arch/powerpc/platforms/pseries/firmware.c | 1 + .../platforms/pseries/papr_platform_attributes.c | 361 +++++++++++++++++++++ 7 files changed, 399 insertions(+), 3 deletions(-) commit cc15ff3275694fedc33cd3d53212a43eec7aa0bc Author: Ganesh Goudar Date: Thu Jan 20 17:49:31 2022 +0530 powerpc/mce: Avoid using irq_work_queue() in realmode In realmode mce handler we use irq_work_queue() to defer the processing of mce events, irq_work_queue() can only be called when translation is enabled because it touches memory outside RMA, hence we enable translation before calling irq_work_queue and disable on return, though it is not safe to do in realmode. To avoid this, program the decrementer and call the event processing functions from timer handler. Signed-off-by: Ganesh Goudar Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220120121931.517974-1-ganeshgr@linux.ibm.com arch/powerpc/include/asm/machdep.h | 2 ++ arch/powerpc/include/asm/mce.h | 13 +++++++ arch/powerpc/include/asm/paca.h | 1 + arch/powerpc/kernel/mce.c | 60 +++++++++++++++++--------------- arch/powerpc/kernel/time.c | 2 ++ arch/powerpc/platforms/pseries/pseries.h | 1 + arch/powerpc/platforms/pseries/ras.c | 32 +---------------- arch/powerpc/platforms/pseries/setup.c | 1 + 8 files changed, 53 insertions(+), 59 deletions(-) commit 0a182611d149b5b747014fbb230ec35b20a45c86 Author: Ganesh Goudar Date: Fri Jan 7 19:44:28 2022 +0530 powerpc/mce: Modify the real address error logging messages To avoid ambiguity, modify the strings in real address error logging messages to "foreign/control memory" from "foreign", Since the error discriptions in P9 user manual and P10 user manual are different for same type of errors. P9 User Manual for MCE: DSISR:59 Host real address to foreign space during translation. DSISR:60 Host real address to foreign space on a load or store access. P10 User Manual for MCE: DSISR:59 D-side tablewalk used a host real address in the control memory address range. DSISR:60 D-side operand access to control memory address space. Signed-off-by: Ganesh Goudar Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220107141428.67862-3-ganeshgr@linux.ibm.com arch/powerpc/kernel/mce.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 0f4ef8a3bf784f250abc7d0155ae4e9fa22d8210 Author: Ganesh Goudar Date: Fri Jan 7 19:44:27 2022 +0530 selftests/powerpc: Add test for real address error handling Add test for real address or control memory address access error handling, using NX-GZIP engine. The error is injected by accessing the control memory address using illegal instruction, on successful handling the process attempting to access control memory address using illegal instruction receives SIGBUS. Signed-off-by: Ganesh Goudar Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220107141428.67862-2-ganeshgr@linux.ibm.com tools/testing/selftests/powerpc/Makefile | 3 +- tools/testing/selftests/powerpc/mce/Makefile | 7 +++ .../testing/selftests/powerpc/mce/inject-ra-err.c | 65 ++++++++++++++++++++++ tools/testing/selftests/powerpc/mce/vas-api.h | 1 + 4 files changed, 75 insertions(+), 1 deletion(-) commit 0f54bddefe7f5e4c98bea6f945ebdf85d1c44117 Author: Ganesh Goudar Date: Fri Jan 7 19:44:26 2022 +0530 powerpc/pseries: Parse control memory access error Add support to parse and log control memory access error for pseries. These changes are made according to PAPR v2.11 10.3.2.2.12. Signed-off-by: Ganesh Goudar Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220107141428.67862-1-ganeshgr@linux.ibm.com arch/powerpc/platforms/pseries/ras.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) commit 49c3af43e65fbcc13860e0cf5fb2507b13e9724c Author: Naveen N. Rao Date: Mon Feb 14 16:11:51 2022 +0530 powerpc/bpf: Simplify bpf_to_ppc() and adopt it for powerpc64 Convert bpf_to_ppc() to a macro to help simplify its usage since codegen_context is available in all places it is used. Adopt it also for powerpc64 for uniformity and get rid of the global b2p structure. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/09f0540ce3e0cd4120b5b33993b5e73b6ef9e979.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit.h | 11 ++--- arch/powerpc/net/bpf_jit_comp.c | 8 ++-- arch/powerpc/net/bpf_jit_comp32.c | 90 ++++++++++++++++++------------------- arch/powerpc/net/bpf_jit_comp64.c | 93 ++++++++++++++++++++------------------- 4 files changed, 98 insertions(+), 104 deletions(-) commit 3a3fc9bf103974d9a886fa37087d5d491c806e00 Author: Jordan Niethe Date: Mon Feb 14 16:11:50 2022 +0530 powerpc64/bpf: Store temp registers' bpf to ppc mapping In bpf_jit_build_body(), the mapping of TMP_REG_1 and TMP_REG_2's bpf register to ppc register is evalulated at every use despite not changing. Instead, determine the ppc register once and store the result. Signed-off-by: Jordan Niethe [Rebased, converted additional usage sites] Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0944e2f0fa6dd254ea401f1c946fb6c9a5294278.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit_comp64.c | 197 +++++++++++++++++--------------------- 1 file changed, 86 insertions(+), 111 deletions(-) commit 036d559c0bdea75bf4840ba6780790d08572480c Author: Naveen N. Rao Date: Mon Feb 14 16:11:49 2022 +0530 powerpc/bpf: Use _Rn macros for GPRs Use _Rn macros to specify register names to make their usage clear. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7df626b8cdc6141d4295ac16137c82ad570b6637.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit_comp32.c | 30 ++++++++--------- arch/powerpc/net/bpf_jit_comp64.c | 68 +++++++++++++++++++-------------------- 2 files changed, 49 insertions(+), 49 deletions(-) commit 576a6c3a00c1a2a3645e039b126b52f6c7755e54 Author: Naveen N. Rao Date: Mon Feb 14 16:11:48 2022 +0530 powerpc/bpf: Move bpf_jit64.h into bpf_jit_comp64.c There is no need for a separate header anymore. Move the contents of bpf_jit64.h into bpf_jit_comp64.c Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b873a8e6eff7d91bf2a2cabdd53082aadfe20761.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit64.h | 69 --------------------------------------- arch/powerpc/net/bpf_jit_comp64.c | 54 +++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 70 deletions(-) commit 7b187dcdb5d348aa916dcda769313512c08e85a5 Author: Naveen N. Rao Date: Mon Feb 14 16:11:47 2022 +0530 powerpc/bpf: Cleanup bpf_jit.h - PPC_EX32() is only used by ppc32 JIT. Move it to bpf_jit_comp32.c - PPC_LI64() is only valid in ppc64. #ifdef it - PPC_FUNC_ADDR() is not used anymore. Remove it. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/58f5b66b2f8546bbbee620f62103a8e97a63eb7c.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit.h | 10 +--------- arch/powerpc/net/bpf_jit_comp32.c | 2 ++ 2 files changed, 3 insertions(+), 9 deletions(-) commit 794abc08d75e9f2833f493090af14b748e182c5f Author: Naveen N. Rao Date: Mon Feb 14 16:11:46 2022 +0530 powerpc64/bpf: Get rid of PPC_BPF_[LL|STL|STLU] macros All these macros now have a single user. Expand their usage in place. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e0526fc7633a34f983a7a330712b55bdfaf20482.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit64.h | 22 ---------------------- arch/powerpc/net/bpf_jit_comp64.c | 21 +++++++++++++++------ 2 files changed, 15 insertions(+), 28 deletions(-) commit 391c271f4deb7356482d12f962a6fc018b6a3fb0 Author: Naveen N. Rao Date: Mon Feb 14 16:11:45 2022 +0530 powerpc64/bpf: Convert some of the uses of PPC_BPF_[LL|STL] to PPC_BPF_[LD|STD] PPC_BPF_[LL|STL] are macros meant for scenarios where we may have to deal with a non-word aligned offset. Limit their usage to only those scenarios by converting the rest to just use PPC_BPF_[LD|STD]. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0eb472428165a307f6fdaf22b0c33cbf13a9a635.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit_comp64.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) commit 74bbe3f08463c48a27088be4823a5803b7f7d9a1 Author: Naveen N. Rao Date: Mon Feb 14 16:11:44 2022 +0530 powerpc/bpf: Rename PPC_BL_ABS() to PPC_BL() PPC_BL_ABS() is just doing a relative branch with link. The name suggests that it is for branching to an absolute address, which is incorrect. Rename the macro to a more appropriate PPC_BL(). Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f0e57b6c7a6ee40dba645535b70da46f46e8af5e.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit.h | 6 +++--- arch/powerpc/net/bpf_jit_comp32.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) commit feb6307289d85262c5aed04d6f192d38abba7c45 Author: Naveen N. Rao Date: Mon Feb 14 16:11:43 2022 +0530 powerpc64/bpf: Optimize instruction sequence used for function calls When calling BPF helpers, we load the function address to call into a register. This can result in upto 5 instructions. Optimize this by instead using the kernel toc in r2 and adjusting offset to the BPF helper. This works since all BPF helpers are part of kernel text, and all BPF programs/functions utilize the kernel TOC. Further more: - load the actual function entry address in elf v1, rather than loading it through the function descriptor address. - load the Local Entry Point (LEP) in elf v2 skipping TOC setup. - consolidate code across elf abi v1 and v2 by using r12 on both. Reported-by: Anton Blanchard Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1233c7544e60dcb021c52b1f840b0f21a87b33ed.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit_comp64.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) commit 43d636f8b4fd2ee668e75e835fae2fcf4bc0f699 Author: Naveen N. Rao Date: Mon Feb 14 16:11:42 2022 +0530 powerpc64/bpf elfv1: Do not load TOC before calling functions BPF helpers always reside in core kernel and all BPF programs use the kernel TOC. As such, there is no need to load the TOC before calling helpers or other BPF functions. Drop code to do the same. Add a check to ensure we don't proceed if this assumption ever changes in future. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a3cd3da4d24d95d845cd10382b1af083600c9074.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit.h | 2 +- arch/powerpc/net/bpf_jit_comp.c | 4 +++- arch/powerpc/net/bpf_jit_comp32.c | 8 ++++++-- arch/powerpc/net/bpf_jit_comp64.c | 39 ++++++++++++++++++++------------------- 4 files changed, 30 insertions(+), 23 deletions(-) commit b10cb163c4b31b03ac5014abbfd0b868913fd8e3 Author: Naveen N. Rao Date: Mon Feb 14 16:11:41 2022 +0530 powerpc64/bpf elfv2: Setup kernel TOC in r2 on entry In preparation for using kernel TOC, load the same in r2 on entry. With elfv1, the kernel TOC is already setup by our caller. We adjust the number of instructions to skip on a tail call accordingly. We get rid of the #ifdef in bpf_jit_emit_tail_call() since FUNCTION_DESCR_SIZE is itself under a #ifdef. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/18a05a4ceec14a8617c9dd4b7128d0afa83fd14e.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit_comp64.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 4eeac2b0aaadc3d1943d348d8565f7cfb93272b9 Author: Naveen N. Rao Date: Mon Feb 14 16:11:40 2022 +0530 powerpc64: Set PPC64_ELF_ABI_v[1|2] macros to 1 Set macros to 1 so that they can be used with __is_defined(). Suggested-by: Christophe Leroy Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/abad4868416ddfd42893f99c0cad8e5faf998095.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/include/asm/types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1d4866d5652f7a19dcbed0c4e366c3402c7775b7 Author: Naveen N. Rao Date: Mon Feb 14 16:11:39 2022 +0530 powerpc64/bpf: Use r12 for constant blinding In preparation for preserving kernel toc in r2, switch BPF_REG_AX from r2 to r12. r12 is not used by bpf JIT except during external helper/bpf calls, or with BPF_NOSPEC. These sequences aren't emitted when BPF_REG_AX is used for constant blinding and other purposes. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e109f98617eacb4512c17a48525e94eda42889e6.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c2067f7f88830cdd020c775ffefe84a8177337af Author: Naveen N. Rao Date: Mon Feb 14 16:11:38 2022 +0530 powerpc64/bpf: Do not save/restore LR on each call to bpf_stf_barrier() Instead of saving and restoring LR before each invocation to bpf_stf_barrier(), set SEEN_FUNC flag so that we save/restore LR in prologue/epilogue. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/4446f25478d82a2a4ac9dab2ebdfd88ddf923eb7.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit_comp64.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 0ffdbce6f4a89bb7c0002904d6438ec83cf05ce7 Author: Naveen N. Rao Date: Mon Feb 14 16:11:37 2022 +0530 powerpc/bpf: Handle large branch ranges with BPF_EXIT In some scenarios, it is possible that the program epilogue is outside the branch range for a BPF_EXIT instruction. Instead of rejecting such programs, emit epilogue as an alternate exit point from the program. Track the location of the same so that subsequent exits can take either of the two paths. Reported-by: Jordan Niethe Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/33aa2e92645a92712be23b18035a2c6dcb92ff8d.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit.h | 2 ++ arch/powerpc/net/bpf_jit_comp.c | 22 +++++++++++++++++++++- arch/powerpc/net/bpf_jit_comp32.c | 7 +++++-- arch/powerpc/net/bpf_jit_comp64.c | 7 +++++-- 4 files changed, 33 insertions(+), 5 deletions(-) commit bafb5898de5d2f15133774cb049fe55720b9c92f Author: Naveen N. Rao Date: Mon Feb 14 16:11:36 2022 +0530 powerpc/bpf: Emit a single branch instruction for known short branch ranges PPC_BCC() emits two instructions to accommodate scenarios where we need to branch outside the range of a conditional branch. PPC_BCC_SHORT() emits a single branch instruction and can be used when the branch is known to be within a conditional branch range. Convert some of the uses of PPC_BCC() in the powerpc BPF JIT over to PPC_BCC_SHORT() where we know the branch range. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/edbca01377d1d5f472868bf6d8962b0a0d85b96f.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit_comp32.c | 8 ++++---- arch/powerpc/net/bpf_jit_comp64.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) commit acd7408d2748533d767387cb4308692fba543658 Author: Naveen N. Rao Date: Mon Feb 14 16:11:35 2022 +0530 powerpc/bpf: Skip branch range validation during first pass During the first pass, addrs[] is still being populated. So, all branches to following instructions will appear to be going to the start of the JIT program. Ignore branch range validation for such instructions and assume those to be in range. Branch range validation will happen during the second pass after addrs[] is setup properly. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/bc517413d11636e20dbfc88503dad14bcbe391e2.1644834730.git.naveen.n.rao@linux.vnet.ibm.com arch/powerpc/net/bpf_jit.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 591b4b268435f00d2f0b81f786c2c7bd5ef66416 Author: Michael Ellerman Date: Wed Feb 23 12:58:21 2022 +1100 powerpc/code-patching: Pre-map patch area Paul reported a warning with DEBUG_ATOMIC_SLEEP=y: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:256 in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 1, name: swapper/0 preempt_count: 0, expected: 0 ... Call Trace: dump_stack_lvl+0xa0/0xec (unreliable) __might_resched+0x2f4/0x310 kmem_cache_alloc+0x220/0x4b0 __pud_alloc+0x74/0x1d0 hash__map_kernel_page+0x2cc/0x390 do_patch_instruction+0x134/0x4a0 arch_jump_label_transform+0x64/0x78 __jump_label_update+0x148/0x180 static_key_enable_cpuslocked+0xd0/0x120 static_key_enable+0x30/0x50 check_kvm_guest+0x60/0x88 pSeries_smp_probe+0x54/0xb0 smp_prepare_cpus+0x3e0/0x430 kernel_init_freeable+0x20c/0x43c kernel_init+0x30/0x1a0 ret_from_kernel_thread+0x5c/0x64 Peter pointed out that this is because do_patch_instruction() has disabled interrupts, but then map_patch_area() calls map_kernel_page() then hash__map_kernel_page() which does a sleeping memory allocation. We only see the warning in KVM guests with SMT enabled, which is not particularly common, or on other platforms if CONFIG_KPROBES is disabled, also not common. The reason we don't see it in most configurations is that another path that happens to have interrupts enabled has allocated the required page tables for us, eg. there's a path in kprobes init that does that. That's just pure luck though. As Christophe suggested, the simplest solution is to do a dummy map/unmap when we initialise the patching, so that any required page table levels are pre-allocated before the first call to do_patch_instruction(). This works because the unmap doesn't free any page tables that were allocated by the map, it just clears the PTE, leaving the page table levels there for the next map. Reported-by: Paul Menzel Debugged-by: Peter Zijlstra Suggested-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220223015821.473097-1-mpe@ellerman.id.au arch/powerpc/lib/code-patching.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit d4679ac8ea2e5078704aa1c026db36580cc1bf9a Author: Michael Ellerman Date: Tue Feb 22 22:34:49 2022 +1100 powerpc/64s: Don't use DSISR for SLB faults Since commit 46ddcb3950a2 ("powerpc/mm: Show if a bad page fault on data is read or write.") we use page_fault_is_write(regs->dsisr) in __bad_page_fault() to determine if the fault is for a read or write, and change the message printed accordingly. But SLB faults, aka Data Segment Interrupts, don't set DSISR (Data Storage Interrupt Status Register) to a useful value. All ISA versions from v2.03 through v3.1 specify that the Data Segment Interrupt sets DSISR "to an undefined value". As far as I can see there's no mention of SLB faults setting DSISR in any BookIV content either. This manifests as accesses that should be a read being incorrectly reported as writes, for example, using the xmon "dump" command: 0:mon> d 0x5deadbeef0000000 5deadbeef0000000 [359526.415354][ C6] BUG: Unable to handle kernel data access on write at 0x5deadbeef0000000 [359526.415611][ C6] Faulting instruction address: 0xc00000000010a300 cpu 0x6: Vector: 380 (Data SLB Access) at [c00000000ffbf400] pc: c00000000010a300: mread+0x90/0x190 If we disassemble the PC, we see a load instruction: 0:mon> di c00000000010a300 c00000000010a300 89490000 lbz r10,0(r9) We can also see in exceptions-64s.S that the data_access_slb block doesn't set IDSISR=1, which means it doesn't load DSISR into pt_regs. So the value we're using to determine if the fault is a read/write is some stale value in pt_regs from a previous page fault. Rework the printing logic to separate the SLB fault case out, and only print read/write in the cases where we can determine it. The result looks like eg: 0:mon> d 0x5deadbeef0000000 5deadbeef0000000 [ 721.779525][ C6] BUG: Unable to handle kernel data access at 0x5deadbeef0000000 [ 721.779697][ C6] Faulting instruction address: 0xc00000000014cbe0 cpu 0x6: Vector: 380 (Data SLB Access) at [c00000000ffbf390] 0:mon> d 0 0000000000000000 [ 742.793242][ C6] BUG: Kernel NULL pointer dereference at 0x00000000 [ 742.793316][ C6] Faulting instruction address: 0xc00000000014cbe0 cpu 0x6: Vector: 380 (Data SLB Access) at [c00000000ffbf390] Fixes: 46ddcb3950a2 ("powerpc/mm: Show if a bad page fault on data is read or write.") Reported-by: Nageswara R Sastry Signed-off-by: Michael Ellerman Reviewed-by: Nicholas Piggin Link: https://lore.kernel.org/r/20220222113449.319193-1-mpe@ellerman.id.au arch/powerpc/mm/fault.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit fa1321b11bd01752f5be2415e74a0e1a7c378262 Author: Jakob Koschel Date: Mon Feb 28 15:24:33 2022 +0100 powerpc/sysdev: fix incorrect use to determine if list is empty 'gtm' will *always* be set by list_for_each_entry(). It is incorrect to assume that the iterator value will be NULL if the list is empty. Instead of checking the pointer it should be checked if the list is empty. Fixes: 83ff9dcf375c ("powerpc/sysdev: implement FSL GTM support") Signed-off-by: Jakob Koschel Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220228142434.576226-1-jakobkoschel@gmail.com arch/powerpc/sysdev/fsl_gtm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 37e6764895ef7431f45ff603a548549d409993d2 Author: Haren Myneni Date: Wed Mar 2 00:51:58 2022 -0800 powerpc/pseries/vas: Add VAS migration handler Since the VAS windows belong to the VAS hardware resource, the hypervisor expects the partition to close them on source partition and reopen them after the partition migrated on the destination machine. This handler is called before pseries_suspend() to close these windows and again invoked after migration. All active windows for both default and QoS types will be closed and mark them inactive and reopened after migration with this handler. During the migration, the user space receives paste instruction failure if it issues copy/paste on these inactive windows. The current migration implementation does not freeze the user space and applications can continue to open VAS windows while migration is in progress. So when the migration_in_progress flag is set, VAS open window API returns -EBUSY. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/05e45ff4f8babd2490ccb7ae923884f4aa21a7e5.camel@linux.ibm.com arch/powerpc/platforms/pseries/mobility.c | 5 ++ arch/powerpc/platforms/pseries/vas.c | 98 ++++++++++++++++++++++++++++++- arch/powerpc/platforms/pseries/vas.h | 14 +++++ 3 files changed, 116 insertions(+), 1 deletion(-) commit 716d7a2e3764cb79061371767bff1a691adb4e7f Author: Haren Myneni Date: Sun Feb 27 23:52:08 2022 -0800 powerpc/pseries/vas: Modify reconfig open/close functions for migration VAS is a hardware engine stays on the chip. So when the partition migrates, all VAS windows on the source system have to be closed and reopen them on the destination after migration. The kernel has to consider both DLPAR CPU and migration events to take action on VAS windows. So using VAS_WIN_NO_CRED_CLOSE and VAS_WIN_MIGRATE_CLOSE status bits and windows will be reopened after migration only after both status bits are cleared. This patch make changes to the current reconfig_open/close_windows functions to support migration: - Set VAS_WIN_MIGRATE_CLOSE to the window status when closes and reopen windows with the same status during resume. - Continue to close all windows even if deallocate HCALL failed (should not happen) since no way to stop migration with the current LPM implementation. - If the DLPAR CPU event happens while migration is in progress, set VAS_WIN_NO_CRED_CLOSE to the window status. Close window happens with the first event (migration or DLPAR) and Reopen window happens only with the last event (migration or DLPAR). Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0aad580387cb58379496b4cbbd7c5596e9ea70be.camel@linux.ibm.com arch/powerpc/include/asm/vas.h | 2 + arch/powerpc/platforms/pseries/vas.c | 88 +++++++++++++++++++++++++++++------- 2 files changed, 73 insertions(+), 17 deletions(-) commit 278fe1cc2205a05bfd92c794be3d207372b17289 Author: Haren Myneni Date: Sun Feb 27 23:51:28 2022 -0800 powerpc/pseries/vas: Define global hv_cop_caps struct The coprocessor capabilities struct is used to get default and QoS capabilities from the hypervisor during init, DLPAR event and migration. So instead of allocating this struct for each event, define global struct and reuse it which allows the migration code to avoid adding an error path. Also disable copy/paste feature flag if any capabilities HCALL is failed. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin Acked-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/57da6a270fcb9308cd57be7c88037029343080f7.camel@linux.ibm.com arch/powerpc/platforms/pseries/vas.c | 47 +++++++++++++++--------------------- 1 file changed, 20 insertions(+), 27 deletions(-) commit 45f06eac30e5abebecc66e41e7c89d5b4413bac1 Author: Haren Myneni Date: Mon Feb 28 17:16:10 2022 -0800 powerpc/pseries/vas: Add 'update_total_credits' entry for QoS capabilities pseries supports two types of credits - Default (uses normal priority FIFO) and Qality of service (QoS uses high priority FIFO). The user decides the number of QoS credits and sets this value with HMC interface. The total credits for QoS capabilities can be changed dynamically with HMC interface which invokes drmgr to communicate to the kernel. This patch creats 'update_total_credits' entry for QoS capabilities so that drmgr command can write the new target QoS credits in sysfs. Instead of using this value, the kernel gets the new QoS capabilities from the hypervisor whenever update_total_credits is updated to make sure sync with the QoS target credits in the hypervisor. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b01ef31a0f964686d00243e7de7f09c73c07e69e.camel@linux.ibm.com arch/powerpc/platforms/pseries/vas-sysfs.c | 54 ++++++++++++++++++++++++++---- arch/powerpc/platforms/pseries/vas.c | 2 +- arch/powerpc/platforms/pseries/vas.h | 1 + 3 files changed, 50 insertions(+), 7 deletions(-) commit b903737bc522e0ef3f45a2a60c364ff547572c9b Author: Haren Myneni Date: Mon Feb 28 17:15:36 2022 -0800 powerpc/pseries/vas: sysfs interface to export capabilities The hypervisor provides the available VAS GZIP capabilities such as default or QoS window type and the target available credits in each type. This patch creates sysfs entries and exports the target, used and the available credits for each feature. This interface can be used by the user space to determine the credits usage or to set the target credits in the case of QoS type (for DLPAR). /sys/devices/vas/vas0/gzip/default_capabilities (default GZIP capabilities) nr_total_credits /* Total credits available. Can be /* changed with DLPAR operation */ nr_used_credits /* Used credits */ /sys/devices/vas/vas0/gzip/qos_capabilities (QoS GZIP capabilities) nr_total_credits nr_used_credits Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/702d8b626ebfac2b52f4995eebeafe1c9a6fcb75.camel@linux.ibm.com arch/powerpc/platforms/pseries/Makefile | 2 +- arch/powerpc/platforms/pseries/vas-sysfs.c | 226 +++++++++++++++++++++++++++++ arch/powerpc/platforms/pseries/vas.c | 6 + arch/powerpc/platforms/pseries/vas.h | 6 + 4 files changed, 239 insertions(+), 1 deletion(-) commit c656cfe571a9b8b882e31177f554bd79141fc015 Author: Haren Myneni Date: Mon Feb 28 17:15:04 2022 -0800 powerpc/pseries/vas: Reopen windows with DLPAR core add VAS windows can be closed in the hypervisor due to lost credits when the core is removed and the kernel gets fault for NX requests on these inactive windows. If the NX requests are issued on these inactive windows, OS gets page faults and the paste failure will be returned to the user space. If the lost credits are available later with core add, reopen these windows and set them active. Later when the OS sees page faults on these active windows, it creates mapping on the new paste address. Then the user space can continue to use these windows and send HW compression requests to NX successfully. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d9f360e21355e6826142c81146acfa9b60bc7ecc.camel@linux.ibm.com arch/powerpc/platforms/pseries/vas.c | 91 +++++++++++++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) commit 8ef7b9e1765a52c8023d9133a2438ac9f6da486a Author: Haren Myneni Date: Mon Feb 28 17:14:28 2022 -0800 powerpc/pseries/vas: Close windows with DLPAR core removal The hypervisor assigns vas credits (windows) for each LPAR based on the number of cores configured in that system. The OS is expected to release credits when cores are removed, and may allocate more when cores are added. So there is a possibility of using excessive credits (windows) in the LPAR and the hypervisor expects the system to close the excessive windows so that NX load can be equally distributed across all LPARs in the system. When the OS closes the excessive windows in the hypervisor, it sets the window status inactive and invalidates window virtual address mapping. The user space receives paste instruction failure if any NX requests are issued on the inactive window. Then the user space can use with the available open windows or retry NX requests until this window active again. This patch also adds the notifier for core removal/add to close windows in the hypervisor if the system lost credits (core removal) and reopen windows in the hypervisor when the previously lost credits are available. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/108928f9c00a48cc6a722315d482d07cf66acf5a.camel@linux.ibm.com arch/powerpc/include/asm/vas.h | 2 + arch/powerpc/platforms/pseries/vas.c | 207 +++++++++++++++++++++++++++++++++-- arch/powerpc/platforms/pseries/vas.h | 3 + 3 files changed, 204 insertions(+), 8 deletions(-) commit 6a8d4ca891aa5f9402973eab5d7d9cf3929678b7 Author: Haren Myneni Date: Mon Feb 28 17:13:54 2022 -0800 powerpc/vas: Map paste address only if window is active The paste address mapping is done with mmap() after the window is opened with ioctl. The partition has to close VAS windows in the hypervisor if it lost credits due to DLPAR core removal. But the kernel marks these windows inactive until the previously lost credits are available later. If the window is inactive due to DLPAR after this mmap(), the paste instruction returns failure until the the OS reopens this window again. Before the user space issuing mmap(), there is a possibility of happening DLPAR core removal event which causes the corresponding window inactive. So if the window is not active, return mmap() failure with -EACCES and expects the user space reissue mmap() when the window is active or open a new window when the credit is available. Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/bbb203c26b324534e25658cb1dbbcb5160a2f93a.camel@linux.ibm.com arch/powerpc/platforms/book3s/vas-api.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) commit b5c63d90cc2de8ac6724fec84d1d72cfebcae41d Author: Haren Myneni Date: Mon Feb 28 17:13:15 2022 -0800 powerpc/vas: Return paste instruction failure if no active window The VAS window may not be active if the system looses credits and the NX generates page fault when it receives request on unmap paste address. The kernel handles the fault by remap new paste address if the window is active again, Otherwise return the paste instruction failure if the executed instruction that caused the fault was a paste. Signed-off-by: Nicholas Piggin Signed-off-by: Haren Myneni Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/492b9aefd593061d51dda67ee4d2fc449c000dce.camel@linux.ibm.com arch/powerpc/include/asm/ppc-opcode.h | 2 ++ arch/powerpc/platforms/book3s/vas-api.c | 54 +++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) commit 1fe3a33ba0a37e7aa0df0acbe31d5dda7610c16e Author: Haren Myneni Date: Mon Feb 28 17:12:41 2022 -0800 powerpc/vas: Add paste address mmap fault handler The user space opens VAS windows and issues NX requests by pasting CRB on the corresponding paste address mmap. When the system lost credits due to core removal, the kernel has to close the window in the hypervisor and make the window inactive by unmapping this paste address. Also the OS has to handle NX request page faults if the user space issue NX requests. This handler maps the new paste address with the same VMA when the window is active again (due to core add with DLPAR). Otherwise returns paste failure. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3956e1c1fdfde69127055ff1c0256c7d71104030.camel@linux.ibm.com arch/powerpc/include/asm/vas.h | 10 +++++ arch/powerpc/platforms/book3s/vas-api.c | 68 +++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) commit 976410cd2cb4c6ed53bd12c192fc46bbcc0fbce7 Author: Haren Myneni Date: Mon Feb 28 17:12:04 2022 -0800 powerpc/pseries/vas: Save PID in pseries_vas_window struct The kernel sets the VAS window with PID when it is opened in the hypervisor. During DLPAR operation, windows can be closed and reopened in the hypervisor when the credit is available. So saves this PID in pseries_vas_window struct when the window is opened initially and reuse it later during DLPAR operation. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a57cbe6d292fe49ad55a0b49c5679d6a24d8fe73.camel@linux.ibm.com arch/powerpc/platforms/pseries/vas.c | 9 +++++---- arch/powerpc/platforms/pseries/vas.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) commit 40562fe4fa3d94c7462ec909ab89b075e26c59ac Author: Haren Myneni Date: Mon Feb 28 17:11:28 2022 -0800 powerpc/pseries/vas: Use common names in VAS capability structure nr_total/nr_used_credits provides credits usage to user space via sysfs and the same interface can be used on PowerNV in future. Changed with proper naming so that applicable on both pseries and PowerNV. Signed-off-by: Haren Myneni Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f4313e9f198ee4f8d4fa4d015d8d1873e17851e6.camel@linux.ibm.com arch/powerpc/platforms/pseries/vas.c | 10 +++++----- arch/powerpc/platforms/pseries/vas.h | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) commit 9ef78b62938ab0d3068292231a3e161f8ee351fb Merge: 4bc06c59f62d e40b38a41ce9 Author: Michael Ellerman Date: Tue Mar 8 00:02:29 2022 +1100 Merge branch 'topic/ppc-kvm' into next Merge our topic branch containing powerpc KVM related commits. Alexey Kardashevskiy (1): KVM: PPC: Merge powerpc's debugfs entry content into generic entry Fabiano Rosas (9): KVM: PPC: Book3S HV: Stop returning internal values to userspace KVM: PPC: Fix vmx/vsx mixup in mmio emulation KVM: PPC: mmio: Reject instructions that access more than mmio.data size KVM: PPC: mmio: Return to guest after emulation failure KVM: PPC: Book3s: mmio: Deliver DSI after emulation failure KVM: PPC: Book3S HV: Check return value of kvmppc_radix_init KVM: PPC: Book3S HV: Delay setting of kvm ops KVM: PPC: Book3S HV: Free allocated memory if module init fails KVM: PPC: Decrement module refcount if init_vm fails Jason Wang (1): powerpc/kvm: no need to initialise statics to 0 Nour-eddine Taleb (1): KVM: PPC: Book3S HV: remove unnecessary casts commit 172e611b54e813c49a35b6b74bccaa99f27bf566 Author: Krzysztof Kozlowski Date: Tue Feb 15 08:53:44 2022 +0100 dt-bindings: mfd: maxim,max77802: Convert to dtschema Convert the MFD part of Maxim MAX77802 PMIC to DT schema format. The example DTS was copied from existing DTS (exynos5800-peach-pi.dts), so keep the license as GPL-2.0-only. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Javier Martinez Canillas Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220215075344.31421-3-krzysztof.kozlowski@canonical.com Documentation/devicetree/bindings/mfd/max77802.txt | 25 --- .../devicetree/bindings/mfd/maxim,max77802.yaml | 194 +++++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 195 insertions(+), 26 deletions(-) commit 6b9d48b418fbc91ae8dbcba2cfe078c4736a77f2 Author: Krzysztof Kozlowski Date: Tue Feb 15 08:53:43 2022 +0100 regulator: dt-bindings: maxim,max77802: Convert to dtschema Convert the regulators of Maxim MAX77802 PMIC to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Javier Martinez Canillas Acked-by: Mark Brown Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220215075344.31421-2-krzysztof.kozlowski@canonical.com .../devicetree/bindings/regulator/max77802.txt | 111 --------------------- .../bindings/regulator/maxim,max77802.yaml | 85 ++++++++++++++++ 2 files changed, 85 insertions(+), 111 deletions(-) commit ed6e9aa8f52f88975b4692eb00bdeaf35cd3d529 Author: Krzysztof Kozlowski Date: Tue Feb 15 08:47:59 2022 +0100 dt-bindings: mfd: maxim,max14577: Convert to dtschema Convert the MFD part of Maxim MAX14577/MAX77836 MUIC to DT schema format. The example DTS was copied from existing DTS (exynos3250-rinato.dts), so keep the license as GPL-2.0-only. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220215074759.29402-4-krzysztof.kozlowski@canonical.com Documentation/devicetree/bindings/mfd/max14577.txt | 147 ---------------- .../devicetree/bindings/mfd/maxim,max14577.yaml | 195 +++++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 196 insertions(+), 148 deletions(-) commit e1cd4265e547e02efc2a2547e8f390a7a9041787 Author: Krzysztof Kozlowski Date: Tue Feb 15 08:47:58 2022 +0100 regulator: dt-bindings: maxim,max14577: Convert to dtschema Convert the regulator bindings of Maxim MAX14577/MAX77835 MUIC to DT schema format. The existing bindings were defined in ../bindings/mfd/max14577.txt. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Mark Brown Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220215074759.29402-3-krzysztof.kozlowski@canonical.com .../bindings/regulator/maxim,max14577.yaml | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) commit ce44e3aeec43a887a7999f4e0e50df1e4557af78 Author: Krzysztof Kozlowski Date: Tue Feb 15 08:47:57 2022 +0100 dt-bindings: power: supply: maxim,max14577: Convert to dtschema Convert the Charger bindings of Maxim MAX14577/MAX77836 MUIC to DT schema format. The existing bindings were defined in ../bindings/mfd/max14577.txt. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Acked-by: Sebastian Reichel Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220215074759.29402-2-krzysztof.kozlowski@canonical.com .../bindings/power/supply/maxim,max14577.yaml | 84 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 85 insertions(+) commit 7db7a24657c969291921d6580d62748b1320dd2f Author: Krzysztof Kozlowski Date: Mon Jan 24 09:23:47 2022 +0100 spi: s3c64xx: Allow controller-data to be optional The Samsung SoC SPI driver requires to provide controller-data node for each of SPI peripheral device nodes. Make this controller-data node optional, so DTS could be simpler. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Reviewed-by: Andi Shyti Reviwed-by: Mark Brown Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220124082347.32747-5-krzysztof.kozlowski@canonical.com drivers/spi/spi-s3c64xx.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) commit 96f06006a3505287b37ba19d4e50e504ac5b6a50 Author: Krzysztof Kozlowski Date: Mon Jan 24 09:23:46 2022 +0100 mfd: dt-bindings: google,cros-ec: Fix indentation in example Correct level of indentation in the example. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220124082347.32747-4-krzysztof.kozlowski@canonical.com Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f412fe11c1a9d815565f3918c56f3fd02167c734 Author: Krzysztof Kozlowski Date: Mon Jan 24 09:23:45 2022 +0100 mfd: dt-bindings: google,cros-ec: Reference Samsung SPI bindings The ChromeOS Embedded Controller appears on boards with Samsung Exynos SoC, where Exynos SPI bindings expect controller-data node. Reference SPI peripheral bindings which include now Samsung SPI peripheral parts. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220124082347.32747-3-krzysztof.kozlowski@canonical.com .../devicetree/bindings/mfd/google,cros-ec.yaml | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) commit 0ff4827ed66f3cdb9d4f5cfad4a3c211215ff4f0 Author: Krzysztof Kozlowski Date: Mon Jan 24 09:23:44 2022 +0100 spi: dt-bindings: samsung: Convert to dtschema Convert the Samsung SoC (S3C24xx, S3C64xx, S5Pv210, Exynos) SPI controller bindings to DT schema format. The conversion also drops requirement from providing controller-data and its data for each of SPI peripheral device nodes. The dtschema cannot express this and the requirement is being relaxed in the driver now. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Acked-by: Pratyush Yadav Reviewed-by: Mark Brown Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220124082347.32747-2-krzysztof.kozlowski@canonical.com .../bindings/soc/samsung/exynos-usi.yaml | 2 +- .../bindings/spi/samsung,spi-peripheral-props.yaml | 33 ++++ .../devicetree/bindings/spi/samsung,spi.yaml | 187 +++++++++++++++++++++ .../bindings/spi/spi-peripheral-props.yaml | 1 + .../devicetree/bindings/spi/spi-samsung.txt | 122 -------------- MAINTAINERS | 2 +- 6 files changed, 223 insertions(+), 124 deletions(-) commit 04732ff2a1f0f4c37164a788af2a69a01d6c6191 Author: Krzysztof Kozlowski Date: Tue Jan 11 18:48:05 2022 +0100 MAINTAINERS: mfd: Cover MAX77843 by Maxim PMIC/MUIC for Exynos boards entry The MAX77843 is used in Exynos5433-based TM2 boards and shares some parts of code with MAX77693 (regulator and haptic motor drivers). Include all MAX77843 drivers in the entry for Maxim PMIC/MUIC drivers for Exynos boards, so they will receive some dedicated review coverage. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220111174805.223732-6-krzysztof.kozlowski@canonical.com MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) commit aec499c75cf8e0b599be4d559e6922b613085f8f Author: Alan Kao Date: Wed Mar 2 15:42:45 2022 +0800 nds32: Remove the architecture The nds32 architecture, also known as AndeStar V3, is a custom 32-bit RISC target designed by Andes Technologies. Support was added to the kernel in 2016 as the replacement RISC-V based V5 processors were already announced, and maintained by (current or former) Andes employees. As explained by Alan Kao, new customers are now all using RISC-V, and all known nds32 users are already on longterm stable kernels provided by Andes, with no development work going into mainline support any more. While the port is still in a reasonably good shape, it only gets worse over time without active maintainers, so it seems best to remove it before it becomes unusable. As always, if it turns out that there are mainline users after all, and they volunteer to maintain the port in the future, the removal can be reverted. Link: https://lore.kernel.org/linux-mm/YhdWNLUhk+x9RAzU@yamatobi.andestech.com/ Link: https://lore.kernel.org/lkml/20220302065213.82702-1-alankao@andestech.com/ Link: https://www.andestech.com/en/products-solutions/andestar-architecture/ Signed-off-by: Alan Kao [arnd: rewrite changelog to provide more background] Signed-off-by: Arnd Bergmann .../interrupt-controller/andestech,ativic32.txt | 19 - .../devicetree/bindings/nds32/andestech-boards | 40 - Documentation/devicetree/bindings/nds32/atl2c.txt | 28 - Documentation/devicetree/bindings/nds32/cpus.txt | 38 - .../devicetree/bindings/perf/nds32v3-pmu.txt | 17 - .../bindings/timer/andestech,atcpit100-timer.txt | 33 - .../features/core/cBPF-JIT/arch-support.txt | 1 - .../features/core/eBPF-JIT/arch-support.txt | 1 - .../core/generic-idle-thread/arch-support.txt | 1 - .../features/core/jump-labels/arch-support.txt | 1 - .../core/thread-info-in-task/arch-support.txt | 1 - .../features/core/tracehook/arch-support.txt | 1 - .../features/debug/KASAN/arch-support.txt | 1 - .../debug/debug-vm-pgtable/arch-support.txt | 1 - .../debug/gcov-profile-all/arch-support.txt | 1 - Documentation/features/debug/kcov/arch-support.txt | 1 - Documentation/features/debug/kgdb/arch-support.txt | 1 - .../features/debug/kmemleak/arch-support.txt | 1 - .../debug/kprobes-on-ftrace/arch-support.txt | 1 - .../features/debug/kprobes/arch-support.txt | 1 - .../features/debug/kretprobes/arch-support.txt | 1 - .../features/debug/optprobes/arch-support.txt | 1 - .../features/debug/stackprotector/arch-support.txt | 1 - .../features/debug/uprobes/arch-support.txt | 1 - .../debug/user-ret-profiler/arch-support.txt | 1 - .../features/io/dma-contiguous/arch-support.txt | 1 - .../locking/cmpxchg-local/arch-support.txt | 1 - .../features/locking/lockdep/arch-support.txt | 1 - .../locking/queued-rwlocks/arch-support.txt | 1 - .../locking/queued-spinlocks/arch-support.txt | 1 - .../features/perf/kprobes-event/arch-support.txt | 1 - .../features/perf/perf-regs/arch-support.txt | 1 - .../features/perf/perf-stackdump/arch-support.txt | 1 - .../sched/membarrier-sync-core/arch-support.txt | 1 - .../features/sched/numa-balancing/arch-support.txt | 1 - .../seccomp/seccomp-filter/arch-support.txt | 1 - .../time/arch-tick-broadcast/arch-support.txt | 1 - .../features/time/clockevents/arch-support.txt | 1 - .../time/context-tracking/arch-support.txt | 1 - .../features/time/irq-time-acct/arch-support.txt | 1 - .../features/time/virt-cpuacct/arch-support.txt | 1 - .../features/vm/ELF-ASLR/arch-support.txt | 1 - .../features/vm/PG_uncached/arch-support.txt | 1 - Documentation/features/vm/THP/arch-support.txt | 1 - Documentation/features/vm/TLB/arch-support.txt | 1 - .../features/vm/huge-vmap/arch-support.txt | 1 - .../features/vm/ioremap_prot/arch-support.txt | 1 - .../features/vm/pte_special/arch-support.txt | 1 - MAINTAINERS | 12 - arch/nds32/Kbuild | 4 - arch/nds32/Kconfig | 101 -- arch/nds32/Kconfig.cpu | 218 --- arch/nds32/Kconfig.debug | 2 - arch/nds32/Makefile | 63 - arch/nds32/boot/.gitignore | 2 - arch/nds32/boot/Makefile | 16 - arch/nds32/boot/dts/Makefile | 2 - arch/nds32/boot/dts/ae3xx.dts | 90 -- arch/nds32/configs/defconfig | 104 -- arch/nds32/include/asm/Kbuild | 8 - arch/nds32/include/asm/assembler.h | 39 - arch/nds32/include/asm/barrier.h | 15 - arch/nds32/include/asm/bitfield.h | 985 ------------- arch/nds32/include/asm/cache.h | 12 - arch/nds32/include/asm/cache_info.h | 13 - arch/nds32/include/asm/cacheflush.h | 53 - arch/nds32/include/asm/current.h | 12 - arch/nds32/include/asm/delay.h | 39 - arch/nds32/include/asm/elf.h | 180 --- arch/nds32/include/asm/fixmap.h | 29 - arch/nds32/include/asm/fpu.h | 126 -- arch/nds32/include/asm/fpuemu.h | 44 - arch/nds32/include/asm/ftrace.h | 46 - arch/nds32/include/asm/futex.h | 101 -- arch/nds32/include/asm/highmem.h | 65 - arch/nds32/include/asm/io.h | 84 -- arch/nds32/include/asm/irqflags.h | 41 - arch/nds32/include/asm/l2_cache.h | 137 -- arch/nds32/include/asm/linkage.h | 11 - arch/nds32/include/asm/memory.h | 91 -- arch/nds32/include/asm/mmu.h | 12 - arch/nds32/include/asm/mmu_context.h | 62 - arch/nds32/include/asm/nds32.h | 82 -- arch/nds32/include/asm/nds32_fpu_inst.h | 109 -- arch/nds32/include/asm/page.h | 64 - arch/nds32/include/asm/perf_event.h | 16 - arch/nds32/include/asm/pgalloc.h | 62 - arch/nds32/include/asm/pgtable.h | 377 ----- arch/nds32/include/asm/pmu.h | 386 ----- arch/nds32/include/asm/proc-fns.h | 44 - arch/nds32/include/asm/processor.h | 104 -- arch/nds32/include/asm/ptrace.h | 77 - arch/nds32/include/asm/sfp-machine.h | 158 --- arch/nds32/include/asm/shmparam.h | 19 - arch/nds32/include/asm/stacktrace.h | 39 - arch/nds32/include/asm/string.h | 17 - arch/nds32/include/asm/suspend.h | 11 - arch/nds32/include/asm/swab.h | 35 - arch/nds32/include/asm/syscall.h | 142 -- arch/nds32/include/asm/syscalls.h | 14 - arch/nds32/include/asm/thread_info.h | 72 - arch/nds32/include/asm/tlb.h | 11 - arch/nds32/include/asm/tlbflush.h | 46 - arch/nds32/include/asm/uaccess.h | 282 ---- arch/nds32/include/asm/unistd.h | 6 - arch/nds32/include/asm/vdso.h | 24 - arch/nds32/include/asm/vdso_datapage.h | 37 - arch/nds32/include/asm/vdso_timer_info.h | 14 - arch/nds32/include/asm/vermagic.h | 9 - arch/nds32/include/asm/vmalloc.h | 4 - arch/nds32/include/uapi/asm/Kbuild | 2 - arch/nds32/include/uapi/asm/auxvec.h | 19 - arch/nds32/include/uapi/asm/byteorder.h | 13 - arch/nds32/include/uapi/asm/cachectl.h | 14 - arch/nds32/include/uapi/asm/fp_udfiex_crtl.h | 16 - arch/nds32/include/uapi/asm/param.h | 11 - arch/nds32/include/uapi/asm/ptrace.h | 25 - arch/nds32/include/uapi/asm/sigcontext.h | 84 -- arch/nds32/include/uapi/asm/unistd.h | 16 - arch/nds32/kernel/.gitignore | 2 - arch/nds32/kernel/Makefile | 33 - arch/nds32/kernel/asm-offsets.c | 28 - arch/nds32/kernel/atl2c.c | 65 - arch/nds32/kernel/cacheinfo.c | 49 - arch/nds32/kernel/devtree.c | 19 - arch/nds32/kernel/dma.c | 82 -- arch/nds32/kernel/ex-entry.S | 177 --- arch/nds32/kernel/ex-exit.S | 193 --- arch/nds32/kernel/ex-scall.S | 100 -- arch/nds32/kernel/fpu.c | 266 ---- arch/nds32/kernel/ftrace.c | 278 ---- arch/nds32/kernel/head.S | 197 --- arch/nds32/kernel/irq.c | 9 - arch/nds32/kernel/module.c | 278 ---- arch/nds32/kernel/nds32_ksyms.c | 25 - arch/nds32/kernel/perf_event_cpu.c | 1500 -------------------- arch/nds32/kernel/pm.c | 80 -- arch/nds32/kernel/process.c | 256 ---- arch/nds32/kernel/ptrace.c | 118 -- arch/nds32/kernel/setup.c | 369 ----- arch/nds32/kernel/signal.c | 384 ----- arch/nds32/kernel/sleep.S | 131 -- arch/nds32/kernel/stacktrace.c | 53 - arch/nds32/kernel/sys_nds32.c | 84 -- arch/nds32/kernel/syscall_table.c | 17 - arch/nds32/kernel/time.c | 11 - arch/nds32/kernel/traps.c | 354 ----- arch/nds32/kernel/vdso.c | 231 --- arch/nds32/kernel/vdso/.gitignore | 2 - arch/nds32/kernel/vdso/Makefile | 79 -- arch/nds32/kernel/vdso/datapage.S | 21 - arch/nds32/kernel/vdso/gen_vdso_offsets.sh | 15 - arch/nds32/kernel/vdso/gettimeofday.c | 269 ---- arch/nds32/kernel/vdso/note.S | 11 - arch/nds32/kernel/vdso/sigreturn.S | 19 - arch/nds32/kernel/vdso/vdso.S | 18 - arch/nds32/kernel/vdso/vdso.lds.S | 75 - arch/nds32/kernel/vmlinux.lds.S | 70 - arch/nds32/lib/Makefile | 4 - arch/nds32/lib/clear_user.S | 42 - arch/nds32/lib/copy_from_user.S | 45 - arch/nds32/lib/copy_page.S | 40 - arch/nds32/lib/copy_template.S | 69 - arch/nds32/lib/copy_to_user.S | 45 - arch/nds32/lib/memcpy.S | 30 - arch/nds32/lib/memmove.S | 70 - arch/nds32/lib/memset.S | 33 - arch/nds32/lib/memzero.S | 18 - arch/nds32/math-emu/Makefile | 10 - arch/nds32/math-emu/faddd.c | 24 - arch/nds32/math-emu/fadds.c | 24 - arch/nds32/math-emu/fcmpd.c | 24 - arch/nds32/math-emu/fcmps.c | 24 - arch/nds32/math-emu/fd2s.c | 22 - arch/nds32/math-emu/fd2si.c | 30 - arch/nds32/math-emu/fd2siz.c | 30 - arch/nds32/math-emu/fd2ui.c | 30 - arch/nds32/math-emu/fd2uiz.c | 30 - arch/nds32/math-emu/fdivd.c | 27 - arch/nds32/math-emu/fdivs.c | 26 - arch/nds32/math-emu/fmuld.c | 23 - arch/nds32/math-emu/fmuls.c | 23 - arch/nds32/math-emu/fnegd.c | 21 - arch/nds32/math-emu/fnegs.c | 21 - arch/nds32/math-emu/fpuemu.c | 406 ------ arch/nds32/math-emu/fs2d.c | 23 - arch/nds32/math-emu/fs2si.c | 29 - arch/nds32/math-emu/fs2siz.c | 29 - arch/nds32/math-emu/fs2ui.c | 29 - arch/nds32/math-emu/fs2uiz.c | 30 - arch/nds32/math-emu/fsi2d.c | 22 - arch/nds32/math-emu/fsi2s.c | 22 - arch/nds32/math-emu/fsqrtd.c | 21 - arch/nds32/math-emu/fsqrts.c | 21 - arch/nds32/math-emu/fsubd.c | 27 - arch/nds32/math-emu/fsubs.c | 27 - arch/nds32/math-emu/fui2d.c | 22 - arch/nds32/math-emu/fui2s.c | 22 - arch/nds32/mm/Makefile | 10 - arch/nds32/mm/alignment.c | 575 -------- arch/nds32/mm/cacheflush.c | 338 ----- arch/nds32/mm/extable.c | 16 - arch/nds32/mm/fault.c | 396 ------ arch/nds32/mm/init.c | 263 ---- arch/nds32/mm/mm-nds32.c | 96 -- arch/nds32/mm/mmap.c | 73 - arch/nds32/mm/proc.c | 536 ------- arch/nds32/mm/tlb.c | 50 - drivers/clocksource/Kconfig | 9 - drivers/clocksource/Makefile | 1 - drivers/clocksource/timer-atcpit100.c | 266 ---- drivers/irqchip/Makefile | 1 - drivers/irqchip/irq-ativic32.c | 156 -- drivers/net/ethernet/faraday/Kconfig | 12 +- drivers/video/console/Kconfig | 2 +- scripts/recordmcount.pl | 3 - tools/include/asm/barrier.h | 2 - tools/perf/arch/nds32/Build | 1 - tools/perf/arch/nds32/util/Build | 1 - tools/perf/arch/nds32/util/header.c | 29 - tools/testing/selftests/vDSO/vdso_config.h | 4 - 221 files changed, 6 insertions(+), 15814 deletions(-) commit 4fddb6211da1749a5fb683a33d7d4890d1290b1b Author: Krzysztof Kozlowski Date: Tue Jan 11 18:48:04 2022 +0100 dt-bindings: mfd: maxim,max77843: Add MAX77843 bindings Document the bindings for MAX77843 MFD driver, based on Exynos5433 TM2 devicetree. These are neither accurate nor finished bindings but at least allow parsing existing DTS files. The example DTS was copied from existing DTS (exynos5433-tm2-common.dtsi), so keep the license as GPL-2.0-only. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220111174805.223732-5-krzysztof.kozlowski@canonical.com .../devicetree/bindings/mfd/maxim,max77843.yaml | 144 +++++++++++++++++++++ 1 file changed, 144 insertions(+) commit 77357c50e4003f38e3e058fa64ae5e84dec414a3 Author: Krzysztof Kozlowski Date: Tue Jan 11 18:48:03 2022 +0100 regulator: dt-bindings: maxim,max77843: Add MAX77843 bindings Document the bindings for MAX77843 regulator driver. The bindings are almost identical to MAX77693 bindings, except the actual names of regulators. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Mark Brown Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220111174805.223732-4-krzysztof.kozlowski@canonical.com .../bindings/regulator/maxim,max77843.yaml | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) commit 9729cad0278b4fdde172bb7b5da65bd1a0e0fb8b Author: Krzysztof Kozlowski Date: Tue Jan 11 18:48:02 2022 +0100 dt-bindings: extcon: maxim,max77843: Add MAX77843 bindings Document the bindings for MAX77843 MUIC/extcon driver, based on Exynos5433 TM2 devicetree. These are neither accurate nor finished bindings but at least allow parsing existing DTS files. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220111174805.223732-3-krzysztof.kozlowski@canonical.com .../devicetree/bindings/extcon/maxim,max77843.yaml | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) commit 4bc06c59f62d3d376294f92cf808fc889b3ff431 Merge: 8219d31effa7 5e5a6c544165 Author: Michael Ellerman Date: Mon Mar 7 23:34:32 2022 +1100 Merge branch 'topic/func-desc-lkdtm' into next Merge a topic branch we are maintaining with some cross-architecture changes to function descriptor handling and their use in LKDTM. From Christophe's cover letter: Fix LKDTM for PPC64/IA64/PARISC PPC64/IA64/PARISC have function descriptors. LKDTM doesn't work on those three architectures because LKDTM messes up function descriptors with functions. This series does some cleanup in the three architectures and refactors function descriptors so that it can then easily use it in a generic way in LKDTM. commit 57d29a2935c9aab0aaef6264bf6a58aad3859e7c Author: Tom Rix Date: Sat Mar 5 10:13:46 2022 -0800 net: rtnetlink: fix error handling in rtnl_fill_statsinfo() The clang static analyzer reports this issue rtnetlink.c:5481:2: warning: Undefined or garbage value returned to caller return err; ^~~~~~~~~~ There is a function level err variable, in the list_for_each_entry_rcu block there is a shadow err. Remove the shadow. In the same block, the call to nla_nest_start_noflag() can fail without setting an err. Set the err to -EMSGSIZE. Fixes: 216e690631f5 ("net: rtnetlink: rtnl_fill_statsinfo(): Permit non-EMSGSIZE error returns") Signed-off-by: Tom Rix Reviewed-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller net/core/rtnetlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cd5169841c49dab75ecc3b20b3bd1100395b6909 Author: Tom Rix Date: Sat Mar 5 09:14:48 2022 -0800 net: dsa: return success if there was nothing to do Clang static analysis reports this representative issue dsa.c:486:2: warning: Undefined or garbage value returned to caller return err; ^~~~~~~~~~ err is only set in the loop. If the loop is empty, garbage will be returned. So initialize err to 0 to handle this noop case. Signed-off-by: Tom Rix Reviewed-by: Andrew Lunn Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/dsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 0273d10182ec4507a43b868dd80fd62860b7e948 Author: Guo Zhengkui Date: Sun Mar 6 00:18:35 2022 +0800 selftests: net: fix array_size.cocci warning Fit the following coccicheck warning: tools/testing/selftests/net/reuseport_bpf_numa.c:89:28-29: WARNING: Use ARRAY_SIZE. It has been tested with gcc (Debian 8.3.0-6) 8.3.0 on x86_64. Signed-off-by: Guo Zhengkui Signed-off-by: David S. Miller tools/testing/selftests/net/reuseport_bpf_numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3f059a7e8c13c62addc1808d13a41d1f6dc24bd1 Author: Xi Ruoyao Date: Sun Aug 29 20:49:09 2021 +0800 mips: remove reference to "newer Loongson-3" Newest Loongson-3 processors have moved to use LoongArch architecture. Sadly, the LL/SC issue is still existing on both latest Loongson-3 processors using MIPS64 (Loongson-3A4000) and LoongArch (Loongson-3A5000). As it's very unlikely there will be new Loongson-3 processors using MIPS64, let's stop people from false hoping. Signed-off-by: Xi Ruoyao Cc: Huacai Chen Signed-off-by: Thomas Bogendoerfer arch/mips/Kconfig | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) commit 34275ac292ae141ebc1296b72f005f71b25998a7 Author: Paul Cercueil Date: Sun Mar 6 15:16:48 2022 +0000 mips: Always permit to build u-boot images The platforms where the kernel should be loaded above 0x8000.0000 do not support loading u-boot images, that doesn't mean that we shouldn't be able to generate them. Additionally, since commit 79876cc1d7b8 ("MIPS: new Kconfig option ZBOOT_LOAD_ADDRESS"), the $(zload-y) variable was no longer hardcoded, which made it impossible to use the uzImage.bin target. Fixes: 79876cc1d7b8 ("MIPS: new Kconfig option ZBOOT_LOAD_ADDRESS") Cc: Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer arch/mips/Makefile | 4 ---- 1 file changed, 4 deletions(-) commit 6ddcba9d480b6bcced4223a729794dfa6becb7eb Author: Maciej W. Rozycki Date: Fri Mar 4 21:13:11 2022 +0000 MIPS: Sanitise Cavium switch cases in TLB handler synthesizers It makes no sense to fall through to `break'. Therefore reorder the switch statements so as to have the Cavium cases first, followed by the default case, which improves readability and pacifies code analysis tools. No change in semantics, assembly produced is exactly the same. Reported-by: kernel test robot Signed-off-by: Maciej W. Rozycki Fixes: bc431d2153cc ("MIPS: Fix fall-through warnings for Clang") Signed-off-by: Thomas Bogendoerfer arch/mips/mm/tlbex.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) commit 244eae91a94c6dab82b3232967d10eeb9dfa21c6 Author: Maciej W. Rozycki Date: Fri Mar 4 20:16:23 2022 +0000 DEC: Limit PMAX memory probing to R3k systems Recent tightening of the opcode table in binutils so as to consistently disallow the assembly or disassembly of CP0 instructions not supported by the processor architecture chosen has caused a regression like below: arch/mips/dec/prom/locore.S: Assembler messages: arch/mips/dec/prom/locore.S:29: Error: opcode not supported on this processor: r4600 (mips3) `rfe' in a piece of code used to probe for memory with PMAX DECstation models, which have non-REX firmware. Those computers always have an R2000 CPU and consequently the exception handler used in memory probing uses the RFE instruction, which those processors use. While adding 64-bit support this code was correctly excluded for 64-bit configurations, however it should have also been excluded for irrelevant 32-bit configurations. Do this now then, and only enable PMAX memory probing for R3k systems. Reported-by: Jan-Benedict Glaw Reported-by: Sudip Mukherjee Signed-off-by: Maciej W. Rozycki Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org # v2.6.12+ Signed-off-by: Thomas Bogendoerfer arch/mips/dec/prom/Makefile | 2 +- arch/mips/include/asm/dec/prom.h | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) commit 97bf0395c226907e1a9b908511a35192bf1e09bb Author: Randy Dunlap Date: Fri Mar 4 08:24:27 2022 -0800 mips: DEC: honor CONFIG_MIPS_FP_SUPPORT=n Include the DECstation interrupt handler in opting out of FPU support. Fixes a linker error: mips-linux-ld: arch/mips/dec/int-handler.o: in function `fpu': (.text+0x148): undefined reference to `handle_fpe_int' Fixes: 183b40f992c8 ("MIPS: Allow FP support to be disabled") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Paul Burton Cc: Thomas Bogendoerfer Cc: Maciej W. Rozycki Cc: linux-mips@vger.kernel.org Acked-by: Maciej W. Rozycki Signed-off-by: Thomas Bogendoerfer arch/mips/dec/int-handler.S | 6 +++--- arch/mips/dec/setup.c | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) commit d17b66417308996e7e64b270a3c7f3c1fbd4cfc8 Author: Alexander Lobakin Date: Wed Feb 23 01:30:23 2022 +0000 MIPS: fix fortify panic when copying asm exception handlers With KCFLAGS="-O3", I was able to trigger a fortify-source memcpy() overflow panic on set_vi_srs_handler(). Although O3 level is not supported in the mainline, under some conditions that may've happened with any optimization settings, it's just a matter of inlining luck. The panic itself is correct, more precisely, 50/50 false-positive and not at the same time. From the one side, no real overflow happens. Exception handler defined in asm just gets copied to some reserved places in the memory. But the reason behind is that C code refers to that exception handler declares it as `char`, i.e. something of 1 byte length. It's obvious that the asm function itself is way more than 1 byte, so fortify logics thought we are going to past the symbol declared. The standard way to refer to asm symbols from C code which is not supposed to be called from C is to declare them as `extern const u8[]`. This is fully correct from any point of view, as any code itself is just a bunch of bytes (including 0 as it is for syms like _stext/_etext/etc.), and the exact size is not known at the moment of compilation. Adjust the type of the except_vec_vi_*() and related variables. Make set_handler() take `const` as a second argument to avoid cast-away warnings and give a little more room for optimization. Signed-off-by: Alexander Lobakin Signed-off-by: Thomas Bogendoerfer arch/mips/include/asm/setup.h | 2 +- arch/mips/kernel/traps.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) commit 0c1794c200e943ea95a28c0a8c7eda6b5c004a9d Author: Guo Zhengkui Date: Mon Mar 7 17:07:59 2022 +0800 nfp: xsk: avoid newline at the end of message in NL_SET_ERR_MSG_MOD Fix the following coccicheck warning: drivers/net/ethernet/netronome/nfp/nfp_net_common.c:3434:8-48: WARNING avoid newline at end of message in NL_SET_ERR_MSG_MOD Signed-off-by: Guo Zhengkui Reviewed-by: Niklas Söderlund Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7de8eb0d9039f16e1122d7aa524a1502a160c4ff Author: Dust Li Date: Mon Mar 7 09:54:24 2022 +0800 net/smc: fix compile warning for smc_sysctl kernel test robot reports multiple warning for smc_sysctl: In file included from net/smc/smc_sysctl.c:17: >> net/smc/smc_sysctl.h:23:5: warning: no previous prototype \ for function 'smc_sysctl_init' [-Wmissing-prototypes] int smc_sysctl_init(void) ^ and >> WARNING: modpost: vmlinux.o(.text+0x12ced2d): Section mismatch \ in reference from the function smc_sysctl_exit() to the variable .init.data:smc_sysctl_ops The function smc_sysctl_exit() references the variable __initdata smc_sysctl_ops. This is often because smc_sysctl_exit lacks a __initdata annotation or the annotation of smc_sysctl_ops is wrong. and net/smc/smc_sysctl.c: In function 'smc_sysctl_init_net': net/smc/smc_sysctl.c:47:17: error: 'struct netns_smc' has no member named 'smc_hdr' 47 | net->smc.smc_hdr = register_net_sysctl(net, "net/smc", table); Since we don't need global sysctl initialization. To make things clean and simple, remove the global pernet_operations and smc_sysctl_{init|exit}. Call smc_sysctl_net_{init|exit} directly from smc_net_{init|exit}. Also initialized sysctl_autocorking_size if CONFIG_SYSCTL it not set, this make sure SMC autocorking is enabled by default if CONFIG_SYSCTL is not set. Fixes: 462791bbfa35 ("net/smc: add sysctl interface for SMC") Reported-by: kernel test robot Signed-off-by: Dust Li Tested-by: Randy Dunlap # build-tested Signed-off-by: David S. Miller net/smc/Makefile | 3 ++- net/smc/af_smc.c | 15 ++++++--------- net/smc/smc_sysctl.c | 19 ++----------------- net/smc/smc_sysctl.h | 9 +++++---- 4 files changed, 15 insertions(+), 31 deletions(-) commit 52c92286b71e28d88642a4a416f40fbdb6cbb46f Author: Peter Geis Date: Sat Mar 5 16:58:35 2022 -0500 mmc: dw-mmc-rockchip: Fix handling invalid clock rates The Rockchip rk356x ciu clock cannot be set as low as the dw-mmc hardware supports. This leads to a situation during card initialization where the clock is set lower than the clock driver can support. The dw-mmc-rockchip driver spews errors when this happens. For normal operation this only happens a few times during boot, but when cd-broken is enabled (in cases such as the SoQuartz module) this fires multiple times each poll cycle. Fix this by testing the lowest possible frequency that the clock driver can support which is within the mmc specification. Divide that rate by the internal divider and set f_min to this. Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220305215835.2210388-3-pgwipeout@gmail.com Signed-off-by: Ulf Hansson drivers/mmc/host/dw_mmc-rockchip.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) commit c4313e75001492f8a288d3ffd595544cbc880821 Author: Peter Geis Date: Sat Mar 5 16:58:34 2022 -0500 mmc: dw_mmc: Support setting f_min from host drivers Host drivers may not be able to support frequencies as low as dw-mmc supports. Unfortunately f_min isn't available when the drv_data->init function is called, as the mmc_host struct hasn't been set up yet. Support the host drivers saving the requested minimum frequency, so we can later set f_min when it is available. Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220305215835.2210388-2-pgwipeout@gmail.com Signed-off-by: Ulf Hansson drivers/mmc/host/dw_mmc.c | 7 ++++++- drivers/mmc/host/dw_mmc.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) commit 0ffd498db172258fde312bb8671816f18b2f6d0c Author: Geert Uytterhoeven Date: Thu Mar 3 13:49:18 2022 +0100 mmc: host: Drop commas after SoC match table sentinels It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Add comments to clarify the purpose of the empty elements. Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/9050fa278eaaa9e6ec719a3b158a2fad285560d0.1646311673.git.geert+renesas@glider.be Signed-off-by: Ulf Hansson drivers/mmc/host/renesas_sdhi_internal_dmac.c | 2 +- drivers/mmc/host/sdhci-of-esdhc.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) commit 7a9f778c7f5ab2539085c49c63a898ee0557524e Merge: 1f311c94aabd 1760fdb6fe9f Author: Ulf Hansson Date: Mon Mar 7 12:53:29 2022 +0100 Merge branch 'fixes' into next commit 6845d64d51cf69c096176e34864e161429bcb664 Author: Ard Biesheuvel Date: Wed Mar 2 12:38:18 2022 +0100 ARM: 9184/1: return_address: disable again for CONFIG_ARM_UNWIND=y Commit 41918ec82eb6 ("ARM: ftrace: enable the graph tracer with the EABI unwinder") removed the dummy version of return_address() that was provided for the CONFIG_ARM_UNWIND=y case, on the assumption that the removal of the kernel_text_address() call from unwind_frame() in the preceding patch made it safe to do so. However, this turns out not to be the case: Corentin reports warnings about suspicious RCU usage and other strange behavior that seems to originate in the stack unwinding that occurs in return_address(). Given that the function graph tracer (which is what these changes were enabling for CONFIG_ARM_UNWIND=y builds) does not appear to care about this distinction, let's revert return_address() to the old state. Cc: Corentin Labbe Fixes: 41918ec82eb6 ("ARM: ftrace: enable the graph tracer with the EABI unwinder") Signed-off-by: Ard Biesheuvel Reported-by: Corentin Labbe Tested-by: Corentin Labbe Signed-off-by: Russell King (Oracle) arch/arm/include/asm/ftrace.h | 18 ++++++++++++++++++ arch/arm/kernel/Makefile | 5 ++++- 2 files changed, 22 insertions(+), 1 deletion(-) commit 81679376470ef4e070d3ab04b578b2eef1013e46 Author: Ard Biesheuvel Date: Wed Mar 2 12:36:56 2022 +0100 ARM: 9183/1: unwind: avoid spurious warnings on bogus code addresses Corentin reports that since commit 538b9265c063 ("ARM: unwind: track location of LR value in stack frame"), numerous spurious warnings are emitted into the kernel log: [ 0.000000] unwind: Index not found c0f0c440 [ 0.000000] unwind: Index not found 00000000 [ 0.000000] unwind: Index not found c0f0c440 [ 0.000000] unwind: Index not found 00000000 This is due to the fact that the commit in question removes a check whether the PC value in the unwound frame is actually a kernel text address, on the assumption that such an address will not be associated with valid unwind data to begin with, which is checked right after. The reason for removing this check was that unwind_frame() will be called by the ftrace graph tracer code, which means that it can no longer be safely instrumented itself, or any code that it calls, as it could cause infinite recursion. In order to prevent the spurious diagnostics, let's add back the call to kernel_text_address(), but this time, only call it if no unwind data could be found for the address in question. This is more efficient for the common successful case, and should avoid any unintended recursion, considering that kernel_text_address() will only be called if no unwind data was found. Cc: Corentin Labbe Fixes: 538b9265c063 ("ARM: unwind: track location of LR value in stack frame") Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) arch/arm/kernel/unwind.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 334ff12284fc56bdc5af6d310c6381d96906f5a0 Author: Jiapeng Chong Date: Mon Mar 7 08:41:49 2022 +0800 netfilter: bridge: clean up some inconsistent indenting Eliminate the follow smatch warning: net/bridge/netfilter/nf_conntrack_bridge.c:385 nf_ct_bridge_confirm() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Florian Westphal net/bridge/netfilter/nf_conntrack_bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bf8d87c076f55b8b4dfdb6bc6c6b6dc0c2ccb487 Author: Li Chen Date: Fri Jan 21 15:48:23 2022 +0800 PCI: endpoint: Fix misused goto label Fix a misused goto label jump since that can result in a memory leak. Link: https://lore.kernel.org/r/17e7b9b9ee6.c6d9c6a02564.4545388417402742326@zohomail.com Signed-off-by: Li Chen Signed-off-by: Lorenzo Pieralisi Acked-by: Kishon Vijay Abraham I drivers/pci/endpoint/functions/pci-epf-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e21af12622c0fb36f719ef9bd5aa1defcffb8004 Merge: cd0b6277c3aa 67dbd6c0a2c4 Author: David S. Miller Date: Mon Mar 7 11:40:41 2022 +0000 Merge branch 'netif_rx-part3' Sebastian Andrzej Siewior says: ==================== net: Convert user to netif_rx(), part 3. This is the third and last batch of converting netif_rx_ni() caller to netif_rx(). The change making this possible is net-next and netif_rx_ni() is a wrapper around netif_rx(). This is a clean up in order to remove netif_rx_ni(). The micrel phy driver is patched twice within this series: the first is is to replace netif_rx_ni() and second to move netif_rx() outside of the IRQ-off section. It is probably simpler to keep it within this series. ==================== Signed-off-by: David S. Miller commit 67dbd6c0a2c427211244e344b85a55d6e82886bf Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:53 2022 +0100 net: phy: micrel: Move netif_rx() outside of IRQ-off section. lan8814_match_rx_ts() invokes netif_rx() with disables interrupts outside which will create a warning. Invoking netif_rx_ni() with disabled interrupts is wrong even without the recent rework because netif_rx_ni() would enable interrupts while processing the softirq. This in turn can lead to dead lock if an interrupts triggers and attempts to acquire kszphy_ptp_priv::rx_ts_lock. Move netif_rx() outside the IRQ-off section. Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Russell King Cc: Divya Koppera Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/phy/micrel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 2655926aea9beea62c9ba80c032485456fd848f0 Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:52 2022 +0100 net: Remove netif_rx_any_context() and netif_rx_ni(). Remove netif_rx_any_context and netif_rx_ni() because there are no more users in tree. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller include/linux/netdevice.h | 10 ---------- 1 file changed, 10 deletions(-) commit e1f9e434617fb28097223d9484de66218bc0b52d Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:51 2022 +0100 net: phy: micrel: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Russell King Cc: Divya Koppera Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/phy/micrel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 63d57cd674541f3633d7e3e025c26c0ec01090fc Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:50 2022 +0100 phonet: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Remi Denis-Courmont Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller net/phonet/af_phonet.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit d33d0dc9275d29be68ae1bacf430e30dc112d769 Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:49 2022 +0100 bluetooth: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller net/bluetooth/6lowpan.c | 2 +- net/bluetooth/bnep/core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 94da81e2fc4285db373fe9a1eb012c2ee205b110 Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:48 2022 +0100 batman-adv: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Antonio Quartulli Cc: Marek Lindner Cc: Simon Wunderlich Cc: Sven Eckelmann Cc: b.a.t.m.a.n@lists.open-mesh.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Sven Eckelmann Signed-off-by: David S. Miller net/batman-adv/bridge_loop_avoidance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit a0f0db8292e6fdb6b467a2270fa88b219ac98fb7 Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:47 2022 +0100 tipc: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Jon Maloy Cc: Ying Xue Cc: tipc-discussion@lists.sourceforge.net Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller net/tipc/bearer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3d391f6518fddcd44367d463aa20a50145f3ea3f Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:46 2022 +0100 tun: vxlan: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/tun.c | 2 +- drivers/net/vxlan/vxlan_core.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit 4bcc4249b4cf4df17429a5299c456ba9e76de779 Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:45 2022 +0100 staging: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Sebastian Andrzej Siewior Acked-by: Greg Kroah-Hartman Signed-off-by: David S. Miller drivers/staging/gdm724x/gdm_lte.c | 2 +- drivers/staging/wlan-ng/p80211netdev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit a70d20704ad5230912b6f0113d7226cea19cde91 Author: Sebastian Andrzej Siewior Date: Sun Mar 6 22:57:44 2022 +0100 s390: net: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Alexander Gordeev Cc: Alexandra Winter Cc: Christian Borntraeger Cc: Heiko Carstens Cc: Sven Schnelle Cc: Vasily Gorbik Cc: Wenjia Zhang Cc: linux-s390@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/s390/net/ctcm_main.c | 2 +- drivers/s390/net/netiucv.c | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) commit cd0b6277c3aafdf855a7cded10defd7705e6580e Merge: 669b258a793d 3914a9c07e8c Author: David S. Miller Date: Mon Mar 7 11:31:34 2022 +0000 Merge branch 'ptp-is_sync' Kurt Kanzenbach says: ==================== ptp: Add generic is_sync() function as multiple PHY drivers such as micrel or TI dp83640 need to inspect whether a given skb represents a PTP Sync message, provide a generic function for it. This avoids code duplication and can be reused by future PHY IEEE 1588 implementations. ==================== Signed-off-by: David S. Miller commit 3914a9c07e8c3a30f178f1c92e2354b9cffdecb5 Author: Kurt Kanzenbach Date: Sat Mar 5 12:21:27 2022 +0100 micrel: Use generic ptp_msg_is_sync() function Use generic ptp_msg_is_sync() function to avoid code duplication. Signed-off-by: Kurt Kanzenbach Signed-off-by: David S. Miller drivers/net/phy/micrel.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) commit 1246b229c6e8712f4da2d2a0d0b2542ff3daa837 Author: Kurt Kanzenbach Date: Sat Mar 5 12:21:26 2022 +0100 dp83640: Use generic ptp_msg_is_sync() function Use generic ptp_msg_is_sync() function to avoid code duplication. Signed-off-by: Kurt Kanzenbach Signed-off-by: David S. Miller drivers/net/phy/dp83640.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) commit f72de02ebece2e962462bc0c1e9efd29eaa029b2 Author: Kurt Kanzenbach Date: Sat Mar 5 12:21:25 2022 +0100 ptp: Add generic PTP is_sync() function PHY drivers such as micrel or dp83640 need to analyze whether a given skb is a PTP sync message for one step functionality. In order to avoid code duplication introduce a generic function and move it to ptp classify. Signed-off-by: Kurt Kanzenbach Signed-off-by: David S. Miller include/linux/ptp_classify.h | 15 +++++++++++++++ net/core/ptp_classifier.c | 12 ++++++++++++ 2 files changed, 27 insertions(+) commit 96ba61ee5331eb6e2f4c2baeb994b9ceb01d8266 Author: Dmitry Osipenko Date: Sun Feb 20 21:46:16 2022 +0100 media: v4l2-ctrls: Add new V4L2_H264_DECODE_PARAM_FLAG_P/BFRAME flags Add new V4L2_H264_DECODE_PARAM_FLAG_P/BFRAME flags that are needed by NVIDIA Tegra video decoder. Userspace will have to set these flags in accordance to the type of a decoded frame. Reviewed-by: Nicolas Dufresne Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Documentation/userspace-api/media/v4l/ext-ctrls-codec-stateless.rst | 6 ++++++ include/uapi/linux/v4l2-controls.h | 2 ++ 2 files changed, 8 insertions(+) commit f81dd043ec41b71b4f6808ffe1457401de6fa8eb Author: Richard Zhu Date: Mon Feb 21 14:33:57 2022 +0800 PCI: imx6: Enable i.MX6QP PCIe power management support i.MX6QP PCIe supports the reset logic, thus it can reset itself to the initialized state when exit from L2 or L3 states. Enable the i.MX6QP PCIe suspend/resume operations support. Link: https://lore.kernel.org/r/1645425237-4071-2-git-send-email-hongxing.zhu@nxp.com Signed-off-by: Richard Zhu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Lucas Stach drivers/pci/controller/dwc/pci-imx6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 875fa4c0d85ae5e6c622e1e9f72ce6c21b6134b1 Author: Laurent Pinchart Date: Tue Feb 15 12:20:32 2022 +0100 media: doc: pixfmt-rgb: Fix V4L2_PIX_FMT_BGR24 format description The V4L2_PIX_FMT_BGR24 format is incorrectly described, with the B and G components swapped. Fix it. Fixes: 2ac9280cb459 ("media: doc: pixfmt-rgb: Make 8 bits per component table more compact") Signed-off-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Documentation/userspace-api/media/v4l/pixfmt-rgb.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3a6cddab2d807242b8461404203e51e0ca490f77 Author: Muhammad Usama Anjum Date: Fri Jan 28 18:07:22 2022 +0100 media: imx: imx8mq-mipi_csi2: Remove unneeded code ret is constant in imx8mq_mipi_csi_pm_suspend(). This function cannot return error. Remove the return variable. Simplify other functions which are using this function. Signed-off-by: Muhammad Usama Anjum Reviewed-by: Fabio Estevam Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/staging/media/imx/imx8mq-mipi-csi2.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) commit f99c4ad386dd487fde4aeb203ff3b1f5f47a5a82 Author: Colin Ian King Date: Mon Jan 24 00:02:42 2022 +0100 media: dvb_frontends: make static read-only array fec_tab const The static array fec_tab is read-only so it make sense to make it const. Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/dvb-frontends/stv0299.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 9de01d22409a37f7f198c22c03c6b220d14a7d4c Author: Colin Ian King Date: Sun Jan 23 23:56:27 2022 +0100 media: dib7000p: make static read-only arrays notch and sine const The static arrays notch and sine are read-only so it make sense to make them const. Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/dvb-frontends/dib7000p.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 211e6e863531b5273e0b201932154e39ce62403d Author: Colin Ian King Date: Sun Jan 23 23:52:56 2022 +0100 media: dvb_frontend: make static read-only array DIB3000MC_I2C_ADDRESS const The static array DIB3000MC_I2C_ADDRESS is read-only so it make sense to make it const. Also add spaces to clean up checkpatch warnings. Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/dvb-frontends/dib3000mc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f63429f483c9611c7a5bd84e6bf6d8f6d7c801d7 Author: Lad Prabhakar Date: Fri Jan 21 01:26:22 2022 +0100 media: dt-bindings: media: renesas,csi2: Update data-lanes property CSI-2 (CSI4LNK0) on R-Car and RZ/G2 supports 4-lane mode which is already handled by rcar-csi2.c driver. This patch updates the data-lanes property to describe the same. Signed-off-by: Lad Prabhakar Reviewed-by: Jacopo Mondi Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Documentation/devicetree/bindings/media/renesas,csi2.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 4e541b06b0e8ae6ebd85a913dba8db43d3ce6fe3 Author: Christophe JAILLET Date: Thu Jan 6 22:50:07 2022 +0100 media: Remove usage of the deprecated "pci-dma-compat.h" API In [1], Christoph Hellwig has proposed to remove the wrappers in include/linux/pci-dma-compat.h. Some reasons why this API should be removed have been given by Julia Lawall in [2]. A coccinelle script has been used to perform the needed transformation. It can be found in [3]. [1]: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infradead.org/ [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902170.2424@hadrien/ [3]: https://lore.kernel.org/kernel-janitors/20200716192821.321233-1-christophe.jaillet@wanadoo.fr/ Signed-off-by: Christophe JAILLET Reviewed-by: Arnd Bergmann Acked-by: Mauro Carvalho Chehab Reviewed-by: Christoph Hellwig Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/pci/cx18/cx18-queue.h | 6 +++--- drivers/media/pci/ivtv/ivtv-queue.h | 25 ++++++++++++++----------- drivers/media/pci/ivtv/ivtv-udma.h | 8 ++++---- 3 files changed, 21 insertions(+), 18 deletions(-) commit a53becd1eb19ed759e02c8fcef5f90820252a9ac Author: Yang Li Date: Tue Jan 25 01:28:39 2022 +0100 media: mtk-vcodec: Remove duplicated include in mtk_vcodec_enc_drv.c Fix following includecheck warning: ./drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c: linux/pm_runtime.h is included more than once. Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 1 - 1 file changed, 1 deletion(-) commit 07922937e9a580825f9965c46fd15e23ba5754b6 Author: Dongliang Mu Date: Fri Feb 18 10:41:30 2022 +0100 media: hdpvr: initialize dev->worker at hdpvr_register_videodev hdpvr_register_videodev is responsible to initialize a worker in hdpvr_device. However, the worker is only initialized at hdpvr_start_streaming other than hdpvr_register_videodev. When hdpvr_probe does not initialize its worker, the hdpvr_disconnect will encounter one WARN in flush_work.The stack trace is as follows: hdpvr_disconnect+0xb8/0xf2 drivers/media/usb/hdpvr/hdpvr-core.c:425 usb_unbind_interface+0xbf/0x3a0 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1206 [inline] device_release_driver_internal+0x22a/0x230 drivers/base/dd.c:1237 bus_remove_device+0x108/0x160 drivers/base/bus.c:529 device_del+0x1fe/0x510 drivers/base/core.c:3592 usb_disable_device+0xd1/0x1d0 drivers/usb/core/message.c:1419 usb_disconnect+0x109/0x330 drivers/usb/core/hub.c:2228 Fix this by moving the initialization of dev->worker to the starting of hdpvr_register_videodev Reported-by: syzkaller Signed-off-by: Dongliang Mu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/usb/hdpvr/hdpvr-video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit db95031d8f753c5112c43d7ea367ef92053321b1 Author: Bryan O'Donoghue Date: Tue Jan 11 13:52:12 2022 +0100 media: camss: Point sm8250 at the correct vdda regulators Reviewing the RB5 schematic its clear that we have missed out on defining both of the power-rails associated with the CSI PHY. Other PHYs such as the UFS, PCIe and USB connect to these rails and define each regulator individually. This means if we were to switch off the other various PHYs which enable these rails, the CAMSS would not appropriately power-on the CSI PHY. Reviewed-by: Robert Foss Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/qcom/camss/camss.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 0c4d7fda5cbebb6d19346a3c9d1f17d5c16bf6b3 Author: Bryan O'Donoghue Date: Tue Jan 11 13:52:11 2022 +0100 media: camss: Point sdm845 at the correct vdda regulators Reviewing the RB3 schematic its clear that we have missed out on defining one of the power-rails associated with the CSI PHY. Other PHYs such as the UFS, PCIe and USB connect to these rails and define each regulator individually. This means if we were to switch off the other various PHYs which enable these rails, the CAMSS would not appropriately power-on the CSI PHY. Reviewed-by: Robert Foss Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/qcom/camss/camss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 81bdfa4f86ade3417552b08e5ee1eea6d0f58375 Author: Bryan O'Donoghue Date: Tue Jan 11 13:52:10 2022 +0100 media: camss: Set unused regulators to the empty set If a CAMSS block has no regulator set the regulator array to the empty set as opposed to setting the first element of the array to NULL. Suggested-by: Bjorn Andersson Reviewed-by: Robert Foss Signed-off-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/qcom/camss/camss.c | 60 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) commit 0d8140179715465c4fa976b516e3428bf3fc2e43 Author: Bryan O'Donoghue Date: Tue Jan 11 13:52:09 2022 +0100 media: camss: Add regulator_bulk support Add the ability to enable or disable multiple regulators in bulk with camss. This is useful for sm8250, sdm845 and it looks like sdm660 where we have more than one CSI regulator to do at once. It should just work for standalone existing vdda regulators and parts which don't have an explicitly defined CSI regulator. [hverkuil: fix camss-csid.c:163:13: warning: 'ret' may be used uninitialized in this function] Reported-by: Vladimir Zapolskiy Signed-off-by: Bryan O'Donoghue Reviewed-by: Robert Foss Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/qcom/camss/camss-csid.c | 45 ++++++++---- drivers/media/platform/qcom/camss/camss-csid.h | 3 +- drivers/media/platform/qcom/camss/camss.c | 94 +++++++++++++------------- drivers/media/platform/qcom/camss/camss.h | 2 +- 4 files changed, 80 insertions(+), 64 deletions(-) commit 088c0384bc87fe21ccd941765d20c7c31e6a6e90 Author: Bryan O'Donoghue Date: Tue Jan 11 13:52:06 2022 +0100 media: dt-bindings: media: camss: Add vdda supply declarations sm8250 Add in missing vdda-phy-supply and vdda-pll-supply declarations. The sm8250 USB, PCIe, UFS, DSI and CSI PHYs use a common set of vdda rails. Define the CSI vdda regulators in the same way the qmp PHY does. Reviewed-by: Robert Foss Signed-off-by: Bryan O'Donoghue Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab .../devicetree/bindings/media/qcom,sm8250-camss.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 849139d46d096bc8022a1a38153e740b464fca46 Author: Bryan O'Donoghue Date: Tue Jan 11 13:52:05 2022 +0100 media: dt-bindings: media: camss: Fixup vdda regulator descriptions sdm845 If we review the schematic for RB3 Thundercomm document Turbox-845 we see that the CAMSS CSI PHY has the same basic power-rail layout as UFS, PCIe and USB PHYs. We should therefore have two regulator declarations as is the case for UFS, PCIe and USB. Reviewed-by: Robert Foss Signed-off-by: Bryan O'Donoghue Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab .../devicetree/bindings/media/qcom,sdm845-camss.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 87137d55f3dcfc3e3664f072ba6bad7bf9bb1ff7 Author: Lad Prabhakar Date: Thu Jan 13 11:44:15 2022 +0100 media: davinci: vpif: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). While at it, propagate error code in case devm_request_irq() fails instead of returning -EINVAL. Signed-off-by: Lad Prabhakar Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/davinci/vpif.c | 18 +++++++++++------- drivers/media/platform/davinci/vpif_capture.c | 27 ++++++++++++++++----------- drivers/media/platform/davinci/vpif_display.c | 24 +++++++++++++++--------- 3 files changed, 42 insertions(+), 27 deletions(-) commit e6a21a14106d9718aa4f8e115b1e474888eeba44 Author: Jiasheng Jiang Date: Fri Jan 14 07:28:40 2022 +0100 media: vidtv: Check for null return of vzalloc As the possible failure of the vzalloc(), e->encoder_buf might be NULL. Therefore, it should be better to check it in order to guarantee the success of the initialization. If fails, we need to free not only 'e' but also 'e->name'. Also, if the allocation for ctx fails, we need to free 'e->encoder_buf' else. Fixes: f90cf6079bf6 ("media: vidtv: add a bridge driver") Signed-off-by: Jiasheng Jiang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/test-drivers/vidtv/vidtv_s302m.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) commit 479f4a6e602a46c110affeeb866d2d03422418ee Author: Xu Wang Date: Fri Jan 14 09:22:14 2022 +0100 media: mtk-mdp: Remove redundant 'flush_workqueue()' calls 'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. Signed-off-by: Xu Wang Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 2 -- 1 file changed, 2 deletions(-) commit 553189144c9e27bf047b392ae377c522246076f7 Author: Sergey Senozhatsky Date: Wed Jan 19 09:14:17 2022 +0100 media: videobuf2-dma-contig: Invalidate vmap range before DMA range Christoph suggests [1] that invalidating vmap range before direct mapping range makes more sense. [1]: https://lore.kernel.org/all/20220111085958.GA22795@lst.de/ Signed-off-by: Sergey Senozhatsky Acked-by: Marek Szyprowski Reviewed-by: Christoph Hellwig Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/common/videobuf2/videobuf2-dma-contig.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 68d0c3311ec10c14a908e96c1e0b95550fa02999 Author: Dafna Hirschfeld Date: Tue Jan 25 09:02:13 2022 +0100 media: stk1160: use dma_alloc_noncontiguous API Replace the urb buffers allocation to use the noncontiguous API. This improves performance on ARM platforms where DMA coherent allocations produce uncached mappings. Note that the noncontiguous API requires the driver to handle synchronization. This commit is similar to this one for the uvc driver: https://lkml.org/lkml/2021/3/12/1506 Performance tests on rock-pi4 (Arm64) shows about 15x improvements: == DMA NONCONTIGUOUS == total durations: 20.63678480 sec urb processing durations: 0.286864889 sec uS/qty: 286864/2508 avg: 114.379 min: 0.583 max: 155.461 (uS) FPS: 24.92 lost: 0 done: 500 raw decode speed: 11.603 Gbits/s bytes 414831228.000 bytes/urb: 165403 == DMA COHERENT == total durations: 20.73551767 sec urb processing durations: 4.541559160 sec uS/qty: 4541559/2509 avg: 1810.107 min: 0.583 max: 2113.163 (uS) FPS: 24.90 lost: 0 done: 500 raw decode speed: 730.738 Mbits/s bytes 414785444.000 bytes/urb: 165319 Performance tests on x86 laptop show no significant difference: == DMA NONCONTIGUOUS == total durations: 20.220590102 sec urb processing durations: 0.63021818 sec uS/qty: 63021/2512 avg: 25.088 min: 0.138 max: 146.750 (uS) FPS: 24.72 lost: 0 done: 500 raw decode speed: 52.751 Gbits/s bytes 415421032.000 bytes/urb: 165374 == DMA COHERENT == total durations: 20.220475614 sec urb processing durations: 0.64751972 sec uS/qty: 64751/2512 avg: 25.777 min: 0.168 max: 132.250 (uS) FPS: 24.72 lost: 0 done: 500 raw decode speed: 51.927 Gbits/s bytes 415422794.000 bytes/urb: 165375 [hverkuil: incorporated Ezequiel's suggestions from his review] Signed-off-by: Dafna Hirschfeld Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/usb/stk1160/stk1160-v4l.c | 4 ++ drivers/media/usb/stk1160/stk1160-video.c | 114 ++++++++++++++++++------------ drivers/media/usb/stk1160/stk1160.h | 10 +++ 3 files changed, 84 insertions(+), 44 deletions(-) commit 69fd04d06adb2cc67ce491df14fe3125bac6f7a7 Author: Dafna Hirschfeld Date: Tue Jan 25 09:02:12 2022 +0100 media: stk1160: move transfer_buffer and urb to same struct 'stk1160_urb' Instead of having two separated arrays, one for the urbs and one for their buffers, have one array of a struct containing both. In addition, the array is just 16 pointers, no need to dynamically allocate it. Signed-off-by: Dafna Hirschfeld Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/usb/stk1160/stk1160-v4l.c | 2 +- drivers/media/usb/stk1160/stk1160-video.c | 52 +++++++++++-------------------- drivers/media/usb/stk1160/stk1160.h | 11 ++++--- 3 files changed, 25 insertions(+), 40 deletions(-) commit fbe04b49a54e31f4321d632270207f0e6304cd16 Author: Dafna Hirschfeld Date: Tue Jan 25 09:02:11 2022 +0100 media: stk1160: If start stream fails, return buffers with VB2_BUF_STATE_QUEUED If the callback 'start_streaming' fails, then all queued buffers in the driver should be returned with state 'VB2_BUF_STATE_QUEUED'. Currently, they are returned with 'VB2_BUF_STATE_ERROR' which is wrong. Fix this. This also fixes the warning: [ 65.583633] WARNING: CPU: 5 PID: 593 at drivers/media/common/videobuf2/videobuf2-core.c:1612 vb2_start_streaming+0xd4/0x160 [videobuf2_common] [ 65.585027] Modules linked in: snd_usb_audio snd_hwdep snd_usbmidi_lib snd_rawmidi snd_soc_hdmi_codec dw_hdmi_i2s_audio saa7115 stk1160 videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc crct10dif_ce panfrost snd_soc_simple_card snd_soc_audio_graph_card snd_soc_spdif_tx snd_soc_simple_card_utils gpu_sched phy_rockchip_pcie snd_soc_rockchip_i2s rockchipdrm analogix_dp dw_mipi_dsi dw_hdmi cec drm_kms_helper drm rtc_rk808 rockchip_saradc industrialio_triggered_buffer kfifo_buf rockchip_thermal pcie_rockchip_host ip_tables x_tables ipv6 [ 65.589383] CPU: 5 PID: 593 Comm: v4l2src0:src Tainted: G W 5.16.0-rc4-62408-g32447129cb30-dirty #14 [ 65.590293] Hardware name: Radxa ROCK Pi 4B (DT) [ 65.590696] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 65.591304] pc : vb2_start_streaming+0xd4/0x160 [videobuf2_common] [ 65.591850] lr : vb2_start_streaming+0x6c/0x160 [videobuf2_common] [ 65.592395] sp : ffff800012bc3ad0 [ 65.592685] x29: ffff800012bc3ad0 x28: 0000000000000000 x27: ffff800012bc3cd8 [ 65.593312] x26: 0000000000000000 x25: ffff00000d8a7800 x24: 0000000040045612 [ 65.593938] x23: ffff800011323000 x22: ffff800012bc3cd8 x21: ffff00000908a8b0 [ 65.594562] x20: ffff00000908a8c8 x19: 00000000fffffff4 x18: ffffffffffffffff [ 65.595188] x17: 000000040044ffff x16: 00400034b5503510 x15: ffff800011323f78 [ 65.595813] x14: ffff000013163886 x13: ffff000013163885 x12: 00000000000002ce [ 65.596439] x11: 0000000000000028 x10: 0000000000000001 x9 : 0000000000000228 [ 65.597064] x8 : 0101010101010101 x7 : 7f7f7f7f7f7f7f7f x6 : fefefeff726c5e78 [ 65.597690] x5 : ffff800012bc3990 x4 : 0000000000000000 x3 : ffff000009a34880 [ 65.598315] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000007cd99f0 [ 65.598940] Call trace: [ 65.599155] vb2_start_streaming+0xd4/0x160 [videobuf2_common] [ 65.599672] vb2_core_streamon+0x17c/0x1a8 [videobuf2_common] [ 65.600179] vb2_streamon+0x54/0x88 [videobuf2_v4l2] [ 65.600619] vb2_ioctl_streamon+0x54/0x60 [videobuf2_v4l2] [ 65.601103] v4l_streamon+0x3c/0x50 [videodev] [ 65.601521] __video_do_ioctl+0x1a4/0x428 [videodev] [ 65.601977] video_usercopy+0x320/0x828 [videodev] [ 65.602419] video_ioctl2+0x3c/0x58 [videodev] [ 65.602830] v4l2_ioctl+0x60/0x90 [videodev] [ 65.603227] __arm64_sys_ioctl+0xa8/0xe0 [ 65.603576] invoke_syscall+0x54/0x118 [ 65.603911] el0_svc_common.constprop.3+0x84/0x100 [ 65.604332] do_el0_svc+0x34/0xa0 [ 65.604625] el0_svc+0x1c/0x50 [ 65.604897] el0t_64_sync_handler+0x88/0xb0 [ 65.605264] el0t_64_sync+0x16c/0x170 [ 65.605587] ---[ end trace 578e0ba07742170d ]--- Fixes: 8ac456495a33d ("[media] stk1160: Stop device and unqueue buffers when start_streaming() fails") Signed-off-by: Dafna Hirschfeld Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/usb/stk1160/stk1160-core.c | 2 +- drivers/media/usb/stk1160/stk1160-v4l.c | 10 +++++----- drivers/media/usb/stk1160/stk1160.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) commit 447b437f3f18ba38ed879d2268975ffd1c9f8ea0 Author: Dafna Hirschfeld Date: Tue Jan 25 09:02:10 2022 +0100 media: stk1160: fix number of buffers in case not all buffers are created In case we fail to allocate a transfer_buffer then we break the buffers creation loop and update the number of buffers to the number of successfully allocated which should be 'i' and not 'i - 1' nor 'i + 1' Signed-off-by: Dafna Hirschfeld Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/usb/stk1160/stk1160-video.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit cf1abc501a5c76e390efdf74edf63e9328efdbad Author: Adam Ford Date: Tue Jan 25 18:11:27 2022 +0100 media: hantro: Add support for i.MX8MM Hantro-G1 The i.MX8MM has a Hantro G1 video decoder similar to the imx8mq but lacks the post-processor present in the imx8mq. Add support in the driver for it with the post-processing removed. Signed-off-by: Adam Ford Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/staging/media/hantro/hantro_drv.c | 1 + drivers/staging/media/hantro/hantro_hw.h | 1 + drivers/staging/media/hantro/imx8m_vpu_hw.c | 12 ++++++++++++ 3 files changed, 14 insertions(+) commit 176f093c60764915b8cba26ce578ff26a9c6c1e3 Author: Adam Ford Date: Tue Jan 25 18:11:26 2022 +0100 media: dt-bindings: media: nxp, imx8mq-vpu: Add support for G1 on imx8mm The i.MX8M mini appears to have a similar G1 decoder but the post-processing isn't present, so different compatible flag is required. Since all the other parameters are the same with imx8mq, just add the new compatible flag to nxp,imx8mq-vpu.yaml. Signed-off-by: Adam Ford Reviewed-by: Ezequiel Garcia Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Documentation/devicetree/bindings/media/nxp,imx8mq-vpu.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 6971efb70ac3e43d19bf33ef5f83bea0271831ee Author: Adam Ford Date: Tue Jan 25 18:11:23 2022 +0100 media: hantro: Allow i.MX8MQ G1 and G2 to run independently The VPU in the i.MX8MQ is really the combination of Hantro G1 and Hantro G2. With the updated vpu-blk-ctrl, the power domains system can enable and disable them separately as well as pull them out of reset. This simplifies the code and lets them run independently while still retaining backwards compatibility with older device trees for those using G1. Signed-off-by: Adam Ford Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/staging/media/hantro/hantro_drv.c | 10 ++++++ drivers/staging/media/hantro/hantro_hw.h | 1 + drivers/staging/media/hantro/imx8m_vpu_hw.c | 50 +++++++++++++++++++++-------- 3 files changed, 48 insertions(+), 13 deletions(-) commit f3116f2e52e63d8e5b615040013f00c535126fc1 Author: Adam Ford Date: Tue Jan 25 18:11:22 2022 +0100 media: dt-bindings: media: nxp, imx8mq-vpu: Split G1 and G2 nodes The G1 and G2 are independent and separate decoder blocks that are enabled by the vpu-blk-ctrl power-domain controller, which now has a proper driver. Because these blocks only share the power-domain, and can be independently fused out, update the bindings to support separate nodes for the G1 and G2 decoders with vpu-blk-ctrl power-domain support. The new DT + old kernel isn't a supported configuration. Signed-off-by: Adam Ford Reviewed-by: Rob Herring Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab .../devicetree/bindings/media/nxp,imx8mq-vpu.yaml | 65 +++++++++------------- 1 file changed, 27 insertions(+), 38 deletions(-) commit cf4a3ab5981ac4cb997176878ec992fd0f556af1 Author: Ettore Chimenti Date: Tue Feb 15 19:13:13 2022 +0100 media: cec: seco: add newlines in debug messages Newlines were missing in almost all regular and debug printk. Signed-off-by: Ettore Chimenti Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/cec/platform/seco/seco-cec.c | 54 +++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) commit fde18c3bac3f964d8333ae53b304d8fee430502b Author: Pavel Skripkin Date: Thu Jan 20 20:37:30 2022 +0100 media: Revert "media: em28xx: add missing em28xx_close_extension" This reverts commit 2c98b8a3458df03abdc6945bbef67ef91d181938. Reverted patch causes problems with Hauppauge WinTV dualHD as Maximilian reported [1]. Since quick solution didn't come up let's just revert it to make this device work with upstream kernels. Link: https://lore.kernel.org/all/6a72a37b-e972-187d-0322-16336e12bdc5@elbmurf.de/ [1] Reported-by: Maximilian Böhm Tested-by: Maximilian Böhm Signed-off-by: Pavel Skripkin Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/usb/em28xx/em28xx-cards.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 22beb839f48d841ec75974872863dc253d37c21c Author: Stanimir Varbanov Date: Tue Feb 1 16:51:29 2022 +0100 media: venus: hfi_cmds: List HDR10 property as unsupported for v1 and v3 The HFI_PROPERTY_PARAM_VENC_HDR10_PQ_SEI HFI property is not supported on Venus v1 and v3. cc: stable@vger.kernel.org # 5.13+ Fixes: 9172652d72f8 ("media: venus: venc: Add support for CLL and Mastering display controls") Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/qcom/venus/hfi_cmds.c | 2 ++ 1 file changed, 2 insertions(+) commit 61b3317dd424a3488b6754d7ff8301944d9d17d7 Author: Stanimir Varbanov Date: Tue Feb 8 02:18:16 2022 +0100 media: venus: venc: Fix h264 8x8 transform control During encoder driver open controls are initialized via a call to v4l2_ctrl_handler_setup which returns EINVAL error for V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM v4l2 control. The control default value is disabled and because of firmware limitations 8x8 transform cannot be disabled for the supported HIGH and CONSTRAINED_HIGH profiles. To fix the issue change the control default value to enabled (this is fine because the firmware enables 8x8 transform for high and constrained_high profiles by default). Also, correct the checking of profile ids in s_ctrl from hfi to v4l2 ids. cc: stable@vger.kernel.org # 5.15+ Fixes: bfee75f73c37 ("media: venus: venc: add support for V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM control") Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/qcom/venus/venc.c | 4 ++-- drivers/media/platform/qcom/venus/venc_ctrls.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) commit 8403fdd775858a7bf04868d43daea0acbe49ddfc Author: Ameer Hamza Date: Mon Dec 6 11:43:15 2021 +0100 media: venus: vdec: fixed possible memory leak issue The venus_helper_alloc_dpb_bufs() implementation allows an early return on an error path when checking the id from ida_alloc_min() which would not release the earlier buffer allocation. Move the direct kfree() from the error checking of dma_alloc_attrs() to the common fail path to ensure that allocations are released on all error paths in this function. Addresses-Coverity: 1494120 ("Resource leak") cc: stable@vger.kernel.org # 5.16+ Fixes: 40d87aafee29 ("media: venus: vdec: decoded picture buffer handling during reconfig sequence") Signed-off-by: Ameer Hamza Reviewed-by: Kieran Bingham Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/qcom/venus/helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6a2eb253a33105a8eeed60389a761af968e4ae85 Author: Stanimir Varbanov Date: Wed Nov 24 23:25:12 2021 +0100 media: venus: core: Fix kerneldoc warnings Describe missing structure members: core.h: warning: Function parameter or member 'sys_err_done' not described in 'venus_core' 'fw_min_cnt' not described in 'venus_inst' 'flags' not described in 'venus_inst' 'dpb_ids' not described in 'venus_inst' Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/qcom/venus/core.h | 4 ++++ 1 file changed, 4 insertions(+) commit f2b03c1056ef5c0829678f51273eace3e6327884 Author: Shunzhou Jiang Date: Mon Mar 7 10:53:57 2022 +0800 soc: s4: Add support for power domains controller Add support s4 Power controller. In s4, power control registers are in secure domain, and should be accessed by smc. Signed-off-by: Shunzhou Jiang Reviewed-by: Kevin Hilman Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220307025357.1368673-3-shunzhou.jiang@amlogic.com drivers/soc/amlogic/meson-secure-pwrc.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) commit 40b358f6156ac516e33e5252a8769737054da24e Author: Shunzhou Jiang Date: Mon Mar 7 10:53:56 2022 +0800 dt-bindings: power: add Amlogic s4 power domains bindings Add the bindings for the Amlogic Secure power domains, controlling the secure power domains. The bindings targets the Amlogic s4, in which the power domains registers are in secure world. Signed-off-by: Shunzhou Jiang Reviewed-by: Martin Blumenstingl Acked-by: Rob Herring Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220307025357.1368673-2-shunzhou.jiang@amlogic.com .../bindings/power/amlogic,meson-sec-pwrc.yaml | 3 ++- include/dt-bindings/power/meson-s4-power.h | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) commit e6e1e7b19fa132d23d09c465942aab4c110d3da9 Author: Randy Dunlap Date: Fri Mar 4 22:40:36 2022 -0800 m68k: coldfire/device.c: only build for MCF_EDMA when h/w macros are defined When CONFIG_MCF_EDMA is set (due to COMPILE_TEST, not due to CONFIG_M5441x), coldfire/device.c has compile errors due to missing MCFEDMA_* symbols. In the .config file that was provided, CONFIG_M5206=y, not CONFIG_M5441x, so is not included in coldfire/device.c. Only build the MCF_EDMA code in coldfire/device.c if the MCFEDMA_* hardware macros are defined. Fixes these build errors: ../arch/m68k/coldfire/device.c:512:35: error: 'MCFEDMA_BASE' undeclared here (not in a function); did you mean 'MCFDMA_BASE1'? 512 | .start = MCFEDMA_BASE, ../arch/m68k/coldfire/device.c:513:50: error: 'MCFEDMA_SIZE' undeclared here (not in a function) 513 | .end = MCFEDMA_BASE + MCFEDMA_SIZE - 1, ../arch/m68k/coldfire/device.c:517:35: error: 'MCFEDMA_IRQ_INTR0' undeclared here (not in a function) 517 | .start = MCFEDMA_IRQ_INTR0, ../arch/m68k/coldfire/device.c:523:35: error: 'MCFEDMA_IRQ_INTR16' undeclared here (not in a function) 523 | .start = MCFEDMA_IRQ_INTR16, ../arch/m68k/coldfire/device.c:529:35: error: 'MCFEDMA_IRQ_INTR56' undeclared here (not in a function) 529 | .start = MCFEDMA_IRQ_INTR56, ../arch/m68k/coldfire/device.c:535:35: error: 'MCFEDMA_IRQ_ERR' undeclared here (not in a function) 535 | .start = MCFEDMA_IRQ_ERR, Fixes: d7e9d01ac292 ("m68k: add ColdFire mcf5441x eDMA platform support") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Link: lore.kernel.org/r/202203030252.P752DK46-lkp@intel.com Cc: Angelo Dureghello Cc: Greg Ungerer Cc: Greg Ungerer Cc: Geert Uytterhoeven Cc: linux-m68k@lists.linux-m68k.org Cc: uclinux-dev@uclinux.org Signed-off-by: Greg Ungerer arch/m68k/coldfire/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit ef09b537c5f09a0bb62c66cae7d0d9359d2a551d Author: Angelo Dureghello Date: Wed Feb 2 20:47:00 2022 +0100 m68k: m5441x: remove erroneous clock disable Remove erroneous esdhc clock disable. Signed-off-by: Angelo Dureghello Signed-off-by: Greg Ungerer arch/m68k/coldfire/m5441x.c | 1 - 1 file changed, 1 deletion(-) commit ffe74a6dc9bc47c7c1bb8e9a3d017f6bd5496d76 Author: Greg Ungerer Date: Mon Jan 17 17:53:51 2022 +1000 m68knommu: fix ucsimm sparse warnings Sparse reports the following warnings: arch/m68k/68000/ucsimm.c:19:15: sparse: sparse: symbol 'cs8900a_hwaddr' was not declared. Should it be static? arch/m68k/68000/ucsimm.c:22:1: sparse: sparse: symbol 'getserialnum' was not declared. Should it be static? arch/m68k/68000/ucsimm.c:23:1: sparse: sparse: symbol 'gethwaddr' was not declared. Should it be static? arch/m68k/68000/ucsimm.c:24:1: sparse: sparse: symbol 'getbenv' was not declared. Should it be static? 'cs8900a_hwaddr' is not used anywhere else in the kernel, so it can be removed. All of 'getserialnum', 'gethwaddr' and 'getbenv' are only used in this file, so they can all be made static. It turns out that these also cause compiler warnings like this too: arch/m68k/68000/ucsimm.c:22:15: warning: no previous prototype for 'getserialnum' [-Wmissing-prototypes] Also fixed by making them all static. Signed-off-by: Greg Ungerer Reported-by: kernel test robot arch/m68k/68000/ucsimm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 5fb4d4690b77baa8611d7be90e713a9a8faa97e8 Author: Greg Ungerer Date: Mon Jan 17 15:21:54 2022 +1000 m68knommu: fix 'screen_bits' defined but not used The 'screen_bits' LCD initializer bit array is only required if CONFIG_INIT_LCD is enabled, otherwise we get the following warning: arch/m68k/68000/screen.h:4:22: warning: 'screen_bits' defined but not used [-Wunused-variable] static unsigned char screen_bits[] = { ^~~~~~~~~~~ Make the inclusion of 'screen_bits' conditional on CONFIG_INIT_LCD. Signed-off-by: Greg Ungerer Reported-by: kernel test robot arch/m68k/68000/screen.h | 2 ++ 1 file changed, 2 insertions(+) commit b73119222f2dd6b1c294cc6ef4b1fb7f9ff3adf5 Author: Greg Ungerer Date: Mon Jan 17 15:15:45 2022 +1000 m68knommu: fix warning: no previous prototype for 'init_dragen2' Fix the compile time warning: arch/m68k/68000/dragen2.c:38:13: warning: no previous prototype for 'init_dragen2' [-Wmissing-prototypes] 38 | void __init init_dragen2(char *command, int size) | ^~~~~~~~~~~~ There already exists a header file prototype, but that file was not included in the dragen2.c code. Signed-off-by: Greg Ungerer Reported-by: kernel test robot arch/m68k/68000/dragen2.c | 1 + 1 file changed, 1 insertion(+) commit 6496f3a717099526f09bc3c8269d00f9a97c7740 Author: Bjorn Helgaas Date: Fri Jan 21 15:02:58 2022 -0600 xtensa: Remove unused early_read_config_byte() et al declarations early_read_config_byte() and similar are declared but never defined. Remove the unused declarations. Signed-off-by: Bjorn Helgaas Message-Id: <20220121210258.1152803-1-helgaas@kernel.org> Signed-off-by: Max Filippov arch/xtensa/include/asm/pci-bridge.h | 9 --------- 1 file changed, 9 deletions(-) commit 9ddef266bcff8fdd138d61c4ada25cfdf062e3c1 Author: Jason Wang Date: Mon Dec 20 16:47:56 2021 +0800 xtensa: use strscpy to copy strings The strlcpy should not be used because it doesn't limit the source length. So that it will lead some potential bugs. But the strscpy doesn't require reading memory from the src string beyond the specified "count" bytes, and since the return value is easier to error-check than strlcpy()'s. In addition, the implementation is robust to the string changing out from underneath it, unlike the current strlcpy() implementation. Thus, replace strlcpy with strscpy. Signed-off-by: Jason Wang Message-Id: <20211220084756.955307-1-wangborong@cdjrlc.com> Signed-off-by: Max Filippov arch/xtensa/kernel/setup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit b8f9a9aa02bfbf3557bebed066e0523aad482878 Author: Jason Wang Date: Mon Dec 20 16:46:02 2021 +0800 net: xtensa: use strscpy to copy strings The strlcpy should not be used because it doesn't limit the source length. So that it will lead some potential bugs. But the strscpy doesn't require reading memory from the src string beyond the specified "count" bytes, and since the return value is easier to error-check than strlcpy()'s. In addition, the implementation is robust to the string changing out from underneath it, unlike the current strlcpy() implementation. Thus, replace strlcpy with strscpy. Signed-off-by: Jason Wang Message-Id: <20211220084602.952091-1-wangborong@cdjrlc.com> Signed-off-by: Max Filippov arch/xtensa/platforms/iss/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 9225b337072a10bf9b09df8bf281437488dd8a26 Author: Rob Clark Date: Fri Mar 4 12:21:45 2022 -0800 drm/msm: Fix dirtyfb refcounting refcount_t complains about 0->1 transitions, which isn't *quite* what we wanted. So use dirtyfb==1 to mean that the fb is not connected to any output that requires dirtyfb flushing, so that we can keep the underflow and overflow checking. Fixes: 9e4dde28e9cd ("drm/msm: Avoid dirtyfb stalls on video mode displays (v2)") Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220304202146.845566-1-robdclark@gmail.com drivers/gpu/drm/msm/msm_fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 5e776d7b20f040f3219128cee17a1191d66a0f3f Author: Geert Uytterhoeven Date: Thu Mar 3 09:36:35 2022 +0100 ata: Drop commas after OF match table sentinels It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Add comments to clarify the purpose of the empty elements. Rewrap entries to a single line to have a consistent style. Signed-off-by: Geert Uytterhoeven Reviewed-by: Sergey Shtylyov Acked-by: Florian Fainelli [ahci_brcm] Reviewed-by: Kieran Bingham Reviewed-by: Linus Walleij Signed-off-by: Damien Le Moal drivers/ata/ahci_brcm.c | 2 +- drivers/ata/ahci_ceva.c | 2 +- drivers/ata/ahci_da850.c | 2 +- drivers/ata/ahci_dm816.c | 2 +- drivers/ata/ahci_imx.c | 2 +- drivers/ata/ahci_mtk.c | 2 +- drivers/ata/ahci_mvebu.c | 2 +- drivers/ata/ahci_octeon.c | 2 +- drivers/ata/ahci_platform.c | 2 +- drivers/ata/ahci_qoriq.c | 2 +- drivers/ata/ahci_st.c | 2 +- drivers/ata/ahci_sunxi.c | 2 +- drivers/ata/ahci_xgene.c | 2 +- drivers/ata/pata_ftide010.c | 6 ++---- drivers/ata/pata_ixp4xx_cf.c | 2 +- drivers/ata/pata_macio.c | 18 +++++------------- drivers/ata/pata_mpc52xx.c | 2 +- drivers/ata/pata_octeon_cf.c | 6 ++---- drivers/ata/pata_of_platform.c | 2 +- drivers/ata/sata_fsl.c | 10 +++------- drivers/ata/sata_gemini.c | 6 ++---- drivers/ata/sata_highbank.c | 2 +- drivers/ata/sata_mv.c | 2 +- drivers/ata/sata_rcar.c | 2 +- 24 files changed, 33 insertions(+), 51 deletions(-) commit c7fa848ff01dad9ed3146a6b1a7d3622131bcedd Author: Nicholas Piggin Date: Thu Mar 3 15:33:10 2022 +1000 KVM: PPC: Book3S HV P9: Fix "lost kick" race When new work is created that requires attention from the hypervisor (e.g., to inject an interrupt into the guest), fast_vcpu_kick is used to pull the target vcpu out of the guest if it may have been running. Therefore the work creation side looks like this: vcpu->arch.doorbell_request = 1; kvmppc_fast_vcpu_kick_hv(vcpu) { smp_mb(); cpu = vcpu->cpu; if (cpu != -1) send_ipi(cpu); } And the guest entry side *should* look like this: vcpu->cpu = smp_processor_id(); smp_mb(); if (vcpu->arch.doorbell_request) { // do something (abort entry or inject doorbell etc) } But currently the store and load are flipped, so it is possible for the entry to see no doorbell pending, and the doorbell creation misses the store to set cpu, resulting lost work (or at least delayed until the next guest exit). Fix this by reordering the entry operations and adding a smp_mb between them. The P8 path appears to have a similar race which is commented but not addressed yet. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220303053315.1056880-2-npiggin@gmail.com arch/powerpc/kvm/book3s_hv.c | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) commit a76370690c3b382ee1c91a93a447c8e25865c8e2 Merge: 13d4ef0f66b7 887554ab9658 Author: Jens Axboe Date: Sun Mar 6 08:13:09 2022 -0700 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache into for-5.18/drivers Pull bcache updates from Coly: "We have 2 patches for Linux v5.18, both of them are from Mingzhe Zou. The first patch improves bcache initialization speed by avoid unnecessary cost of cache consistency, the second one fixes a potential NULL pointer deference in bcache initialization time." * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache: bcache: fixup multiple threads crash bcache: fixup bcache_dev_sectors_dirty_add() multithreaded CPU false sharing commit 887554ab96588de2917b6c8c73e552da082e5368 Author: Mingzhe Zou Date: Fri Feb 11 14:39:15 2022 +0800 bcache: fixup multiple threads crash When multiple threads to check btree nodes in parallel, the main thread wait for all threads to stop or CACHE_SET_IO_DISABLE flag: wait_event_interruptible(check_state->wait, atomic_read(&check_state->started) == 0 || test_bit(CACHE_SET_IO_DISABLE, &c->flags)); However, the bch_btree_node_read and bch_btree_node_read_done maybe call bch_cache_set_error, then the CACHE_SET_IO_DISABLE will be set. If the flag already set, the main thread return error. At the same time, maybe some threads still running and read NULL pointer, the kernel will crash. This patch change the event wait condition, the main thread must wait for all threads to stop. Fixes: 8e7102273f597 ("bcache: make bch_btree_check() to be multithreaded") Signed-off-by: Mingzhe Zou Cc: stable@vger.kernel.org # v5.7+ Signed-off-by: Coly Li drivers/md/bcache/btree.c | 6 ++++-- drivers/md/bcache/writeback.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) commit 7b1002f7cfe581930f63787a0b3de0144e61ed55 Author: Mingzhe Zou Date: Fri Jan 7 16:21:13 2022 +0800 bcache: fixup bcache_dev_sectors_dirty_add() multithreaded CPU false sharing When attaching a cached device (a.k.a backing device) to a cache device, bch_sectors_dirty_init() is called to count dirty sectors and stripes (see what bcache_dev_sectors_dirty_add() does) on the cache device. When bcache_dev_sectors_dirty_add() is called, set_bit(stripe, d->full_dirty_stripes) or clear_bit(stripe, d->full_dirty_stripes) operation will always be performed. In full_dirty_stripes, each 1bit represents stripe_size (8192) sectors (512B), so 1bit=4MB (8192*512), and each CPU cache line=64B=512bit=2048MB. When 20 threads process a cached disk with 100G dirty data, a single thread processes about 23M at a time, and 20 threads total 460M. These full_dirty_stripes bits corresponding to the 460M data is likely to fall in the same CPU cache line. When one of these threads performs a set_bit or clear_bit operation, the same CPU cache line of other threads will become invalid and must read the full_dirty_stripes from the main memory again. Compared with single thread, the time of a bcache_dev_sectors_dirty_add() call is increased by about 50 times in our test (100G dirty data, 20 threads, bcache_dev_sectors_dirty_add() is called more than 20 million times). This patch tries to test_bit before set_bit or clear_bit operation. Therefore, a lot of force set and clear operations will be avoided, and most of bcache_dev_sectors_dirty_add() calls will only read CPU cache line. Signed-off-by: Mingzhe Zou Signed-off-by: Coly Li drivers/md/bcache/writeback.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) commit 669b258a793db9f1c3bff29ce2bbd61b810503ad Author: Lianjie Zhang Date: Sun Mar 6 16:28:08 2022 +0800 bonding: helper macro __ATTR_RO to make code more clear Signed-off-by: Lianjie Zhang Signed-off-by: David S. Miller drivers/net/bonding/bond_sysfs_slave.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit 83b7b77af37a89a1ef82201ac8fb45456ecc25bb Merge: 4c22aac3f83e f9834dbdd322 Author: David S. Miller Date: Sun Mar 6 11:05:31 2022 +0000 Merge branch 'netif_rx-conversions-part2' Sebastian Andrzej Siewior says: ==================== net: Convert user to netif_rx(), part 2. This is the second batch of converting netif_rx_ni() caller to netif_rx(). The change making this possible is net-next and netif_rx_ni() is a wrapper around netif_rx(). This is a clean up in order to remove netif_rx_ni(). The brcmfmac changes are slilghtly larger because the inirq parameter can be removed. ==================== Signed-off-by: David S. Miller commit f9834dbdd322f144f7b51f2fe8017fc6b870b3ec Author: Sebastian Andrzej Siewior Date: Sat Mar 5 23:12:52 2022 +0100 wireless: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Johannes Berg Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller net/wireless/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit afb6d39f329248598b044a87bad382e938c5ddda Author: Sebastian Andrzej Siewior Date: Sat Mar 5 23:12:51 2022 +0100 wireless: Marvell: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Amitkumar Karwar Cc: Ganapathi Bhat Cc: Kalle Valo Cc: Sharvari Harisangam Cc: Xinming Hu Cc: libertas-dev@lists.infradead.org Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/wireless/marvell/libertas/rx.c | 4 ++-- drivers/net/wireless/marvell/mwifiex/uap_txrx.c | 2 +- drivers/net/wireless/marvell/mwifiex/util.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) commit b381728e7e282e2f5c2581d6919aa4fc08f5a88a Author: Sebastian Andrzej Siewior Date: Sat Mar 5 23:12:50 2022 +0100 wireless: brcmfmac: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Arend van Spriel Cc: Chi-hsien Lin Cc: Chung-hsien Hsu Cc: Franky Lin Cc: Hante Meuleman Cc: Kalle Valo Cc: SHA-cyfmac-dev-list@infineon.com Cc: Wright Feng Cc: brcm80211-dev-list.pdl@broadcom.com Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller .../net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 4 ++-- .../net/wireless/broadcom/brcm80211/brcmfmac/core.c | 18 +++++------------- .../net/wireless/broadcom/brcm80211/brcmfmac/core.h | 2 +- .../wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 10 +++++----- .../wireless/broadcom/brcm80211/brcmfmac/fwsignal.h | 2 +- .../net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 5 ++--- .../net/wireless/broadcom/brcm80211/brcmfmac/proto.h | 6 +++--- 7 files changed, 19 insertions(+), 28 deletions(-) commit 1cd2ef9fcb67115030b20ea2b560635efce746da Author: Sebastian Andrzej Siewior Date: Sat Mar 5 23:12:49 2022 +0100 wireless: Atheros: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Kalle Valo Cc: Maya Erez Cc: linux-wireless@vger.kernel.org Cc: wil6210@qti.qualcomm.com Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/wireless/ath/ath6kl/txrx.c | 2 +- drivers/net/wireless/ath/wil6210/txrx.c | 2 +- drivers/net/wireless/ath/wil6210/wmi.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit e77975e02b593cbcc1ab2325b1729614d01de71f Author: Sebastian Andrzej Siewior Date: Sat Mar 5 23:12:48 2022 +0100 slip/plip: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Signed-off-by: Sebastian Andrzej Siewior Acked-by: Oliver Hartkopp Signed-off-by: David S. Miller drivers/net/plip/plip.c | 2 +- drivers/net/slip/slip.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit b903117b48681e12fae38e09c874f38c45186dc6 Author: Sebastian Andrzej Siewior Date: Sat Mar 5 23:12:47 2022 +0100 mctp: serial: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Jeremy Kerr Cc: Matt Johnston Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/mctp/mctp-serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 00f4a0afb7eafdf3dae764ec0c40fe6abfdf8254 Author: Sebastian Andrzej Siewior Date: Sat Mar 5 23:12:46 2022 +0100 can: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Marc Kleine-Budde Cc: Oliver Hartkopp Cc: Wolfgang Grandegger Cc: linux-can@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Oliver Hartkopp Acked-by: Marc Kleine-Budde Signed-off-by: David S. Miller drivers/net/can/dev/dev.c | 2 +- drivers/net/can/slcan.c | 2 +- drivers/net/can/spi/hi311x.c | 6 +++--- drivers/net/can/spi/mcp251x.c | 4 ++-- drivers/net/can/vcan.c | 2 +- drivers/net/can/vxcan.c | 2 +- net/can/af_can.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) commit a3d73e15909bdcf25f341e6623cc165ba7eb5968 Author: Sebastian Andrzej Siewior Date: Sat Mar 5 23:12:45 2022 +0100 net: phy: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Radu Pirea Cc: Richard Cochran Cc: Russell King Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/phy/dp83640.c | 6 +++--- drivers/net/phy/mscc/mscc_ptp.c | 2 +- drivers/net/phy/nxp-c45-tja11xx.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) commit 4c22aac3f83ea3c4c90fa964a88e197f16b8cae0 Merge: 925a24213b5c 4b4f052e2d89 Author: David S. Miller Date: Sun Mar 6 11:04:01 2022 +0000 Merge branch 'tuntap-kfree_skb_reason' Dongli Zhang says: ==================== tun/tap: use kfree_skb_reason() to trace dropped skb The commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()") has introduced the kfree_skb_reason() to help track the reason. The tun and tap are commonly used as virtio-net/vhost-net backend. This is to use kfree_skb_reason() to trace the dropped skb for those two drivers. Changed since v1: - I have renamed many of the reasons since v1. I make them as generic as possible so that they can be re-used by core networking and drivers. Changed since v2: - declare drop_reason as type "enum skb_drop_reason" - handle the drop in skb_list_walk_safe() case for tap driver, and kfree_skb_list_reason() is introduced Changed since v3 (only for PATCH 4/4): - rename to TAP_FILTER and TAP_TXFILTER - honor reverse xmas tree style declaration for 'drop_reason' in tun_net_xmit() Changed since v4: - make kfree_skb_list() static inline - add 'computation' to SKB_CSUM comment - change COPY_DATA to UCOPY_FAULT - add 'metadata' to DEV_HDR comment - expand comment on DEV_READY - change SKB_TRIM to NOMEM - chnage SKB_PULL to HDR_TRUNC Changed since v5: - rebase to net-next The following reasons are introduced. - SKB_DROP_REASON_SKB_CSUM - SKB_DROP_REASON_SKB_GSO_SEG - SKB_DROP_REASON_SKB_UCOPY_FAULT - SKB_DROP_REASON_DEV_HDR - SKB_DROP_REASON_FULL_RING - SKB_DROP_REASON_DEV_READY - SKB_DROP_REASON_NOMEM - SKB_DROP_REASON_HDR_TRUNC - SKB_DROP_REASON_TAP_FILTER - SKB_DROP_REASON_TAP_TXFILTER This is the output for TUN device. -0 [029] ..s1. 450.727651: kfree_skb: skbaddr=0000000023d235cc protocol=0 location=00000000a6748854 reason: NOT_SPECIFIED -0 [000] b.s3. 451.165671: kfree_skb: skbaddr=000000006b5de7cc protocol=4 location=000000007c2b9eae reason: FULL_RING -0 [000] b.s3. 453.149650: kfree_skb: skbaddr=000000006b5de7cc protocol=4 location=000000007c2b9eae reason: FULL_RING -0 [000] b.s3. 455.133576: kfree_skb: skbaddr=000000006b5de7cc protocol=4 location=000000007c2b9eae reason: FULL_RING -0 [000] b.s3. 457.117566: kfree_skb: skbaddr=000000006b5de7cc protocol=4 location=000000007c2b9eae reason: FULL_RING This is the output for TAP device. arping-7053 [006] ..s1. 1000.047753: kfree_skb: skbaddr=000000008618a587 protocol=2054 location=00000000743ad4a7 reason: FULL_RING -0 [022] ..s1. 1000.778514: kfree_skb: skbaddr=000000002c1e706c protocol=0 location=00000000a6748854 reason: NOT_SPECIFIED arping-7053 [006] ..s1. 1001.047830: kfree_skb: skbaddr=000000008618a587 protocol=2054 location=00000000743ad4a7 reason: FULL_RING arping-7053 [006] ..s1. 1002.047918: kfree_skb: skbaddr=000000008618a587 protocol=2054 location=00000000743ad4a7 reason: FULL_RING arping-7053 [006] ..s1. 1003.048017: kfree_skb: skbaddr=000000008618a587 protocol=2054 location=00000000743ad4a7 reason: FULL_RING ==================== Signed-off-by: David S. Miller commit 4b4f052e2d89c2eb7e13ee28ba9e85f8097aef3d Author: Dongli Zhang Date: Fri Mar 4 06:55:07 2022 -0800 net: tun: track dropped skb via kfree_skb_reason() The TUN can be used as vhost-net backend. E.g, the tun_net_xmit() is the interface to forward the skb from TUN to vhost-net/virtio-net. However, there are many "goto drop" in the TUN driver. Therefore, the kfree_skb_reason() is involved at each "goto drop" to help userspace ftrace/ebpf to track the reason for the loss of packets. The below reasons are introduced: - SKB_DROP_REASON_DEV_READY - SKB_DROP_REASON_NOMEM - SKB_DROP_REASON_HDR_TRUNC - SKB_DROP_REASON_TAP_FILTER - SKB_DROP_REASON_TAP_TXFILTER Cc: Joao Martins Cc: Joe Jin Signed-off-by: Dongli Zhang Signed-off-by: David S. Miller drivers/net/tun.c | 37 ++++++++++++++++++++++++++++--------- include/linux/skbuff.h | 18 ++++++++++++++++++ include/trace/events/skb.h | 5 +++++ 3 files changed, 51 insertions(+), 9 deletions(-) commit 45a15d89fbcd280571eba8e5ca309e14ba6afa8f Author: Dongli Zhang Date: Fri Mar 4 06:55:06 2022 -0800 net: tun: split run_ebpf_filter() and pskb_trim() into different "if statement" No functional change. Just to split the if statement into different conditions to use kfree_skb_reason() to trace the reason later. Cc: Joao Martins Cc: Joe Jin Signed-off-by: Dongli Zhang Reviewed-by: David Ahern Signed-off-by: David S. Miller drivers/net/tun.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 736f16de75f9bb32d76f652cb66f04d1bc685057 Author: Dongli Zhang Date: Fri Mar 4 06:55:05 2022 -0800 net: tap: track dropped skb via kfree_skb_reason() The TAP can be used as vhost-net backend. E.g., the tap_handle_frame() is the interface to forward the skb from TAP to vhost-net/virtio-net. However, there are many "goto drop" in the TAP driver. Therefore, the kfree_skb_reason() is involved at each "goto drop" to help userspace ftrace/ebpf to track the reason for the loss of packets. The below reasons are introduced: - SKB_DROP_REASON_SKB_CSUM - SKB_DROP_REASON_SKB_GSO_SEG - SKB_DROP_REASON_SKB_UCOPY_FAULT - SKB_DROP_REASON_DEV_HDR - SKB_DROP_REASON_FULL_RING Cc: Joao Martins Cc: Joe Jin Signed-off-by: Dongli Zhang Signed-off-by: David S. Miller drivers/net/tap.c | 35 +++++++++++++++++++++++++---------- include/linux/skbuff.h | 13 +++++++++++++ include/trace/events/skb.h | 5 +++++ 3 files changed, 43 insertions(+), 10 deletions(-) commit 925a24213b5cc80fcef8858e6dc1f97ea2b17afb Author: Dust Li Date: Fri Mar 4 17:17:19 2022 +0800 Revert "net/smc: don't req_notify until all CQEs drained" This reverts commit a505cce6f7cfaf2aa2385aab7286063c96444526. Leon says: We already discussed that. SMC should be changed to use RDMA CQ pool API drivers/infiniband/core/cq.c. ib_poll_handler() has much better implementation (tracing, IRQ rescheduling, proper error handling) than this SMC variant. Since we will switch to ib_poll_handler() in the future, revert this patch. Link: https://lore.kernel.org/netdev/20220301105332.GA9417@linux.alibaba.com/ Suggested-by: Leon Romanovsky Suggested-by: Karsten Graul Signed-off-by: Dust Li Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller net/smc/smc_wr.c | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) commit c344b9fc2108eeaa347c387219886cf87e520e93 Merge: 401af75c4975 50c6b8a9aea2 Author: Alexei Starovoitov Date: Sat Mar 5 18:38:15 2022 -0800 Merge branch 'bpf: add __percpu tagging in vmlinux BTF' Hao Luo says: ==================== This patchset is very much similar to Yonghong's patchset on adding __user tagging [1], where a "user" btf_type_tag was introduced to describe __user memory pointers. Similar approach can be applied on __percpu pointers. The __percpu attribute in kernel is used to identify pointers that point to memory allocated in percpu region. Normally, accessing __percpu memory requires using special functions like per_cpu_ptr() etc. Directly accessing __percpu pointer is meaningless. Currently vmlinux BTF does not have a way to differentiate a __percpu pointer from a regular pointer. So BPF programs are allowed to load __percpu memory directly, which is an incorrect behavior. With the previous work that encodes __user information in BTF, a nice framework has been set up to allow us to encode __percpu information in BTF and let the verifier to reject programs that try to directly access percpu pointer. Previously, there is a PTR_TO_PERCPU_BTF_ID reg type which is used to represent those percpu static variables in the kernel. Pahole is able to collect variables that are stored in ".data..percpu" section in the kernel image and emit BTF information for those variables. The bpf_per_cpu_ptr() and bpf_this_cpu_ptr() helper functions were added to access these variables. Now with __percpu information, we can tag those __percpu fields in a struct (such as cgroup->rstat_cpu) and allow the pair of bpf percpu helpers to access them as well. In addition to adding __percpu tagging, this patchset also fixes a harmless bug in the previous patch that introduced __user. Patch 01/04 is for that. Patch 02/04 adds the new attribute "percpu". Patch 03/04 adds MEM_PERCPU tag for PTR_TO_BTF_ID and replaces PTR_TO_PERCPU_BTF_ID with (BTF_ID | MEM_PERCPU). Patch 04/04 refactors the btf_tag test a bit and adds tests for percpu tag. Like [1], the minimal requirements for btf_type_tag is clang (>= clang14) and pahole (>= 1.23). [1] https://lore.kernel.org/bpf/20211220015110.3rqxk5qwub3pa2gh@ast-mbp.dhcp.thefacebook.com/t/ ==================== Signed-off-by: Alexei Starovoitov commit 50c6b8a9aea2b8dc6c4ffb0cc502b94f7f57a0dc Author: Hao Luo Date: Fri Mar 4 11:16:57 2022 -0800 selftests/bpf: Add a test for btf_type_tag "percpu" Add test for percpu btf_type_tag. Similar to the "user" tag, we test the following cases: 1. __percpu struct field. 2. __percpu as function parameter. 3. per_cpu_ptr() accepts dynamically allocated __percpu memory. Because the test for "user" and the test for "percpu" are very similar, a little bit of refactoring has been done in btf_tag.c. Basically, both tests share the same function for loading vmlinux and module btf. Example output from log: > ./test_progs -v -t btf_tag libbpf: prog 'test_percpu1': BPF program load failed: Permission denied libbpf: prog 'test_percpu1': -- BEGIN PROG LOAD LOG -- ... ; g = arg->a; 1: (61) r1 = *(u32 *)(r1 +0) R1 is ptr_bpf_testmod_btf_type_tag_1 access percpu memory: off=0 ... test_btf_type_tag_mod_percpu:PASS:btf_type_tag_percpu 0 nsec #26/6 btf_tag/btf_type_tag_percpu_mod1:OK libbpf: prog 'test_percpu2': BPF program load failed: Permission denied libbpf: prog 'test_percpu2': -- BEGIN PROG LOAD LOG -- ... ; g = arg->p->a; 2: (61) r1 = *(u32 *)(r1 +0) R1 is ptr_bpf_testmod_btf_type_tag_1 access percpu memory: off=0 ... test_btf_type_tag_mod_percpu:PASS:btf_type_tag_percpu 0 nsec #26/7 btf_tag/btf_type_tag_percpu_mod2:OK libbpf: prog 'test_percpu_load': BPF program load failed: Permission denied libbpf: prog 'test_percpu_load': -- BEGIN PROG LOAD LOG -- ... ; g = (__u64)cgrp->rstat_cpu->updated_children; 2: (79) r1 = *(u64 *)(r1 +48) R1 is ptr_cgroup_rstat_cpu access percpu memory: off=48 ... test_btf_type_tag_vmlinux_percpu:PASS:btf_type_tag_percpu_load 0 nsec #26/8 btf_tag/btf_type_tag_percpu_vmlinux_load:OK load_btfs:PASS:could not load vmlinux BTF 0 nsec test_btf_type_tag_vmlinux_percpu:PASS:btf_type_tag_percpu 0 nsec test_btf_type_tag_vmlinux_percpu:PASS:btf_type_tag_percpu_helper 0 nsec #26/9 btf_tag/btf_type_tag_percpu_vmlinux_helper:OK Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220304191657.981240-5-haoluo@google.com .../selftests/bpf/bpf_testmod/bpf_testmod.c | 14 ++ tools/testing/selftests/bpf/prog_tests/btf_tag.c | 164 +++++++++++++++++---- .../selftests/bpf/progs/btf_type_tag_percpu.c | 66 +++++++++ 3 files changed, 215 insertions(+), 29 deletions(-) commit 5844101a1be9b8636024cb31c865ef13c7cc6db3 Author: Hao Luo Date: Fri Mar 4 11:16:56 2022 -0800 bpf: Reject programs that try to load __percpu memory. With the introduction of the btf_type_tag "percpu", we can add a MEM_PERCPU to identify those pointers that point to percpu memory. The ability of differetiating percpu pointers from regular memory pointers have two benefits: 1. It forbids unexpected use of percpu pointers, such as direct loads. In kernel, there are special functions used for accessing percpu memory. Directly loading percpu memory is meaningless. We already have BPF helpers like bpf_per_cpu_ptr() and bpf_this_cpu_ptr() that wrap the kernel percpu functions. So we can now convert percpu pointers into regular pointers in a safe way. 2. Previously, bpf_per_cpu_ptr() and bpf_this_cpu_ptr() only work on PTR_TO_PERCPU_BTF_ID, a special reg_type which describes static percpu variables in kernel (we rely on pahole to encode them into vmlinux BTF). Now, since we can identify __percpu tagged pointers, we can also identify dynamically allocated percpu memory as well. It means we can use bpf_xxx_cpu_ptr() on dynamic percpu memory. This would be very convenient when accessing fields like "cgroup->rstat_cpu". Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220304191657.981240-4-haoluo@google.com include/linux/bpf.h | 11 +++++++++-- kernel/bpf/btf.c | 8 +++++++- kernel/bpf/verifier.c | 24 ++++++++++++++---------- 3 files changed, 30 insertions(+), 13 deletions(-) commit 9216c916237805c93d054ed022afb172ddbc3ed1 Author: Hao Luo Date: Fri Mar 4 11:16:55 2022 -0800 compiler_types: Define __percpu as __attribute__((btf_type_tag("percpu"))) This is similar to commit 7472d5a642c9 ("compiler_types: define __user as __attribute__((btf_type_tag("user")))"), where a type tag "user" was introduced to identify the pointers that point to user memory. With that change, the newest compile toolchain can encode __user information into vmlinux BTF, which can be used by the BPF verifier to enforce safe program behaviors. Similarly, we have __percpu attribute, which is mainly used to indicate memory is allocated in percpu region. The __percpu pointers in kernel are supposed to be used together with functions like per_cpu_ptr() and this_cpu_ptr(), which perform necessary calculation on the pointer's base address. Without the btf_type_tag introduced in this patch, __percpu pointers will be treated as regular memory pointers in vmlinux BTF and BPF programs are allowed to directly dereference them, generating incorrect behaviors. Now with "percpu" btf_type_tag, the BPF verifier is able to differentiate __percpu pointers from regular pointers and forbids unexpected behaviors like direct load. The following is an example similar to the one given in commit 7472d5a642c9: [$ ~] cat test.c #define __percpu __attribute__((btf_type_tag("percpu"))) int foo(int __percpu *arg) { return *arg; } [$ ~] clang -O2 -g -c test.c [$ ~] pahole -JV test.o ... File test.o: [1] INT int size=4 nr_bits=32 encoding=SIGNED [2] TYPE_TAG percpu type_id=1 [3] PTR (anon) type_id=2 [4] FUNC_PROTO (anon) return=1 args=(3 arg) [5] FUNC foo type_id=4 [$ ~] for the function argument "int __percpu *arg", its type is described as PTR -> TYPE_TAG(percpu) -> INT The kernel can use this information for bpf verification or other use cases. Like commit 7472d5a642c9, this feature requires clang (>= clang14) and pahole (>= 1.23). Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220304191657.981240-3-haoluo@google.com include/linux/compiler_types.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit bff61f6faedb36db6b135da898840d29aa74cbbb Author: Hao Luo Date: Fri Mar 4 11:16:54 2022 -0800 bpf: Fix checking PTR_TO_BTF_ID in check_mem_access With the introduction of MEM_USER in commit c6f1bfe89ac9 ("bpf: reject program if a __user tagged memory accessed in kernel way") PTR_TO_BTF_ID can be combined with a MEM_USER tag. Therefore, most likely, when we compare reg_type against PTR_TO_BTF_ID, we want to use the reg's base_type. Previously the check in check_mem_access() wants to say: if the reg is BTF_ID but not NULL, the execution flow falls into the 'then' branch. But now a reg of (BTF_ID | MEM_USER), which should go into the 'then' branch, goes into the 'else'. The end results before and after this patch are the same: regs tagged with MEM_USER get rejected, but not in a way we intended. So fix the condition, the error message now is correct. Before (log from commit 696c39011538): $ ./test_progs -v -n 22/3 ... libbpf: prog 'test_user1': BPF program load failed: Permission denied libbpf: prog 'test_user1': -- BEGIN PROG LOAD LOG -- R1 type=ctx expected=fp 0: R1=ctx(id=0,off=0,imm=0) R10=fp0 ; int BPF_PROG(test_user1, struct bpf_testmod_btf_type_tag_1 *arg) 0: (79) r1 = *(u64 *)(r1 +0) func 'bpf_testmod_test_btf_type_tag_user_1' arg0 has btf_id 136561 type STRUCT 'bpf_testmod_btf_type_tag_1' 1: R1_w=user_ptr_bpf_testmod_btf_type_tag_1(id=0,off=0,imm=0) ; g = arg->a; 1: (61) r1 = *(u32 *)(r1 +0) R1 invalid mem access 'user_ptr_' Now: libbpf: prog 'test_user1': BPF program load failed: Permission denied libbpf: prog 'test_user1': -- BEGIN PROG LOAD LOG -- R1 type=ctx expected=fp 0: R1=ctx(id=0,off=0,imm=0) R10=fp0 ; int BPF_PROG(test_user1, struct bpf_testmod_btf_type_tag_1 *arg) 0: (79) r1 = *(u64 *)(r1 +0) func 'bpf_testmod_test_btf_type_tag_user_1' arg0 has btf_id 104036 type STRUCT 'bpf_testmod_btf_type_tag_1' 1: R1_w=user_ptr_bpf_testmod_btf_type_tag_1(id=0,ref_obj_id=0,off=0,imm=0) ; g = arg->a; 1: (61) r1 = *(u32 *)(r1 +0) R1 is ptr_bpf_testmod_btf_type_tag_1 access user memory: off=0 Note the error message for the reason of rejection. Fixes: c6f1bfe89ac9 ("bpf: reject program if a __user tagged memory accessed in kernel way") Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220304191657.981240-2-haoluo@google.com kernel/bpf/verifier.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 401af75c4975759d45c3627a7588351b4ab3e2a8 Merge: caec54953482 8218ccb5bd68 Author: Alexei Starovoitov Date: Sat Mar 5 15:29:36 2022 -0800 Merge branch 'Fixes for bad PTR_TO_BTF_ID offset' Kumar Kartikeya Dwivedi says: ==================== This set fixes a bug related to bad var_off being permitted for kfunc call in case of PTR_TO_BTF_ID, consolidates offset checks for all register types allowed as helper or kfunc arguments into a common shared helper, and introduces a couple of other checks to harden the kfunc release logic and prevent future bugs. Some selftests are also included that fail in absence of these fixes, serving as demonstration of the issues being fixed. Changelog: ---------- v3 -> v4: v3: https://lore.kernel.org/bpf/20220304000508.2904128-1-memxor@gmail.com * Update commit message for __diag patch to say clang instead of LLVM (Nathan) * Address nits for check_func_arg_reg_off (Martin) * Add comment for fixed_off_ok case, remove is_kfunc check (Martin) v2 -> v3: v2: https://lore.kernel.org/bpf/20220303045029.2645297-1-memxor@gmail.com * Add my SoB to __diag for clang patch (Nathan) v1 -> v2: v1: https://lore.kernel.org/bpf/20220301065745.1634848-1-memxor@gmail.com * Put reg->off check for release kfunc inside check_func_arg_reg_off, make the check a bit more readable * Squash verifier selftests errstr update into patch 3 for bisect (Alexei) * Include fix from Nathan for clang warning about missing prototypes * Add unified __diag_ingore_all that works for both GCC/LLVM (Alexei) Older discussion: Link: https://lore.kernel.org/bpf/20220219113744.1852259-1-memxor@gmail.com Kumar Kartikeya Dwivedi (7): bpf: Add check_func_arg_reg_off function bpf: Fix PTR_TO_BTF_ID var_off check bpf: Disallow negative offset in check_ptr_off_reg bpf: Harden register offset checks for release helpers and kfuncs compiler_types.h: Add unified __diag_ignore_all for GCC/LLVM bpf: Replace __diag_ignore with unified __diag_ignore_all selftests/bpf: Add tests for kfunc register offset checks ==================== Acked-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov commit 8218ccb5bd68976ed5d75028ef50c13a857eee25 Author: Kumar Kartikeya Dwivedi Date: Sat Mar 5 04:16:45 2022 +0530 selftests/bpf: Add tests for kfunc register offset checks Include a few verifier selftests that test against the problems being fixed by previous commits, i.e. release kfunc always require PTR_TO_BTF_ID fixed and var_off to be 0, and negative offset is not permitted and returns a helpful error message. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220304224645.3677453-9-memxor@gmail.com net/bpf/test_run.c | 11 ++++ tools/testing/selftests/bpf/verifier/calls.c | 83 ++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) commit 0b206c6d1066f1ee85e4238a1e34d7437148a9a3 Author: Kumar Kartikeya Dwivedi Date: Sat Mar 5 04:16:44 2022 +0530 bpf: Replace __diag_ignore with unified __diag_ignore_all Currently, -Wmissing-prototypes warning is ignored for GCC, but not clang. This leads to clang build warning in W=1 mode. Since the flag used by both compilers is same, we can use the unified __diag_ignore_all macro that works for all supported versions and compilers which have __diag macro support (currently GCC >= 8.0, and Clang >= 11.0). Also add nf_conntrack_bpf.h include to prevent missing prototype warning for register_nf_conntrack_bpf. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220304224645.3677453-8-memxor@gmail.com net/bpf/test_run.c | 4 ++-- net/netfilter/nf_conntrack_bpf.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) commit 4d1ea705d797e66edd70ffa708b83888a210a437 Author: Kumar Kartikeya Dwivedi Date: Sat Mar 5 04:16:43 2022 +0530 compiler_types.h: Add unified __diag_ignore_all for GCC/LLVM Add a __diag_ignore_all macro, to ignore warnings for both GCC and LLVM, without having to specify the compiler type and version. By default, GCC 8 and clang 11 are used. This will be used by bpf subsystem to ignore -Wmissing-prototypes warning for functions that are meant to be global functions so that they are in vmlinux BTF, but don't have a prototype. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220304224645.3677453-7-memxor@gmail.com include/linux/compiler-clang.h | 3 +++ include/linux/compiler-gcc.h | 3 +++ include/linux/compiler_types.h | 4 ++++ 3 files changed, 10 insertions(+) commit f014a00bbeb09cea16017b82448d32a468a6b96f Author: Nathan Chancellor Date: Sat Mar 5 04:16:42 2022 +0530 compiler-clang.h: Add __diag infrastructure for clang Add __diag macros similar to those in compiler-gcc.h, so that warnings that need to be adjusted for specific cases but not globally can be ignored when building with clang. Signed-off-by: Nathan Chancellor Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220304224645.3677453-6-memxor@gmail.com [ Kartikeya: wrote commit message ] include/linux/compiler-clang.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) commit 24d5bb806c7e2c0b9972564fd493069f612d90dd Author: Kumar Kartikeya Dwivedi Date: Sat Mar 5 04:16:41 2022 +0530 bpf: Harden register offset checks for release helpers and kfuncs Let's ensure that the PTR_TO_BTF_ID reg being passed in to release BPF helpers and kfuncs always has its offset set to 0. While not a real problem now, there's a very real possibility this will become a problem when more and more kfuncs are exposed, and more BPF helpers are added which can release PTR_TO_BTF_ID. Previous commits already protected against non-zero var_off. One of the case we are concerned about now is when we have a type that can be returned by e.g. an acquire kfunc: struct foo { int a; int b; struct bar b; }; ... and struct bar is also a type that can be returned by another acquire kfunc. Then, doing the following sequence: struct foo *f = bpf_get_foo(); // acquire kfunc if (!f) return 0; bpf_put_bar(&f->b); // release kfunc ... would work with the current code, since the btf_struct_ids_match takes reg->off into account for matching pointer type with release kfunc argument type, but would obviously be incorrect, and most likely lead to a kernel crash. A test has been included later to prevent regressions in this area. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220304224645.3677453-5-memxor@gmail.com include/linux/bpf_verifier.h | 3 ++- kernel/bpf/btf.c | 33 +++++++++++++++++++-------------- kernel/bpf/verifier.c | 25 ++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 18 deletions(-) commit e1fad0ff46b32819d30cb487f1d39ba24e515843 Author: Kumar Kartikeya Dwivedi Date: Sat Mar 5 04:16:40 2022 +0530 bpf: Disallow negative offset in check_ptr_off_reg check_ptr_off_reg only allows fixed offset to be set for PTR_TO_BTF_ID, where reg->off < 0 doesn't make sense. This would shift the pointer backwards, and fails later in btf_struct_ids_match or btf_struct_walk due to out of bounds access (since offset is interpreted as unsigned). Improve the verifier by rejecting this case by using a better error message for BPF helpers and kfunc, by putting a check inside the check_func_arg_reg_off function. Also, update existing verifier selftests to work with new error string. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220304224645.3677453-4-memxor@gmail.com kernel/bpf/verifier.c | 6 ++++++ tools/testing/selftests/bpf/verifier/bounds_deduction.c | 2 +- tools/testing/selftests/bpf/verifier/ctx.c | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) commit 655efe5089f077485eec848272bd7e26b1a5a735 Author: Kumar Kartikeya Dwivedi Date: Sat Mar 5 04:16:39 2022 +0530 bpf: Fix PTR_TO_BTF_ID var_off check When kfunc support was added, check_ctx_reg was called for PTR_TO_CTX register, but no offset checks were made for PTR_TO_BTF_ID. Only reg->off was taken into account by btf_struct_ids_match, which protected against type mismatch due to non-zero reg->off, but when reg->off was zero, a user could set the variable offset of the register and allow it to be passed to kfunc, leading to bad pointer being passed into the kernel. Fix this by reusing the extracted helper check_func_arg_reg_off from previous commit, and make one call before checking all supported register types. Since the list is maintained, any future changes will be taken into account by updating check_func_arg_reg_off. This function prevents non-zero var_off to be set for PTR_TO_BTF_ID, but still allows a fixed non-zero reg->off, which is needed for type matching to work correctly when using pointer arithmetic. ARG_DONTCARE is passed as arg_type, since kfunc doesn't support accepting a ARG_PTR_TO_ALLOC_MEM without relying on size of parameter type from BTF (in case of pointer), or using a mem, len pair. The forcing of offset check for ARG_PTR_TO_ALLOC_MEM is done because ringbuf helpers obtain the size from the header located at the beginning of the memory region, hence any changes to the original pointer shouldn't be allowed. In case of kfunc, size is always known, either at verification time, or using the length parameter, hence this forcing is not required. Since this check will happen once already for PTR_TO_CTX, remove the check_ptr_off_reg call inside its block. Fixes: e6ac2450d6de ("bpf: Support bpf program calling kernel function") Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220304224645.3677453-3-memxor@gmail.com kernel/bpf/btf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) commit 25b35dd28138f61f9a0fb8b76c0483761fd228bd Author: Kumar Kartikeya Dwivedi Date: Sat Mar 5 04:16:38 2022 +0530 bpf: Add check_func_arg_reg_off function Lift the list of register types allowed for having fixed and variable offsets when passed as helper function arguments into a common helper, so that they can be reused for kfunc checks in later commits. Keeping a common helper aids maintainability and allows us to follow the same consistent rules across helpers and kfuncs. Also, convert check_func_arg to use this function. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220304224645.3677453-2-memxor@gmail.com include/linux/bpf_verifier.h | 3 ++ kernel/bpf/verifier.c | 69 ++++++++++++++++++++++++++------------------ 2 files changed, 44 insertions(+), 28 deletions(-) commit f28af984e771efd1ded81b865b50fa13b69bcde5 Author: fengping.yu Date: Sat Mar 5 14:45:40 2022 -0800 Input: mt6779-keypad - add MediaTek keypad driver This patch adds matrix keypad support for Mediatek SoCs. Signed-off-by: fengping.yu Reviewed-by: Marco Felsch Reviewed-by: Andy Shevchenko Reviewed-by: Mattijs Korpershoek Signed-off-by: Mattijs Korpershoek Link: https://lore.kernel.org/r/20220303154302.252041-3-mkorpershoek@baylibre.com Signed-off-by: Dmitry Torokhov drivers/input/keyboard/Kconfig | 12 ++ drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/mt6779-keypad.c | 221 +++++++++++++++++++++++++++++++++ 3 files changed, 234 insertions(+) commit 60b2a80360ab86e98ac7353fa314e508857deb0c Author: fengping.yu Date: Sat Mar 5 14:45:18 2022 -0800 dt-bindings: input: Add bindings for Mediatek matrix keypad This patch add devicetree bindings for Mediatek matrix keypad driver. Signed-off-by: fengping.yu Reviewed-by: Marco Felsch Signed-off-by: Mattijs Korpershoek Reviewed-by: Rob Herring Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220303154302.252041-2-mkorpershoek@baylibre.com Signed-off-by: Dmitry Torokhov .../bindings/input/mediatek,mt6779-keypad.yaml | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) commit 4cee08fbd2cb160efb57f87a1e622c5248a2c22e Author: Jiri Olsa Date: Thu Feb 24 16:52:38 2022 +0100 perf tools: Remove bpf_map__set_priv()/bpf_map__priv() usage Both bpf_map__set_priv()/bpf_map__priv() are deprecated and will be eventually removed. Use hashmap to replace that functionality. Suggested-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Acked-by: Andrii Nakryiko Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220224155238.714682-3-jolsa@kernel.org Cc: Mark Rutland Cc: Peter Zijlstra Cc: Ian Rogers Cc: Arnaldo Carvalho de Melo Cc: Ingo Molnar Cc: Namhyung Kim Cc: Alexander Shishkin Cc: bpf@vger.kernel.org Cc: lkml Cc: linux-perf-users@vger.kernel.org tools/perf/util/bpf-loader.c | 66 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 7 deletions(-) commit a3bfc0d76f63dbe406bb64e5ea14e217f97b2b24 Author: Jiri Olsa Date: Thu Feb 24 16:52:37 2022 +0100 perf tools: Remove bpf_program__set_priv/bpf_program__priv usage Both bpf_program__set_priv/bpf_program__priv are deprecated and will be eventually removed. Using hashmap to replace that functionality. Suggested-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Acked-by: Andrii Nakryiko Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220224155238.714682-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo tools/perf/util/bpf-loader.c | 98 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 82 insertions(+), 16 deletions(-) commit d57159efde1fbc35ed128f6be37d06ad88f660a7 Author: German Gomez Date: Wed Jan 26 16:07:09 2022 +0000 perf test: Add perf_event_attr tests for the arm_spe event Adds a couple of perf_event_attr tests for the fix introduced in [1]. The tests check that the correct sample_period value is set in the struct perf_event_attr of the arm_spe events. [1]: https://lore.kernel.org/all/20220118144054.2541-1-german.gomez@arm.com/ Reviewed-by: James Clark Signed-off-by: German Gomez Tested-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Song Liu Cc: Yonghong Song Link: https://lore.kernel.org/r/20220126160710.32983-1-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo tools/perf/tests/attr/README | 2 ++ tools/perf/tests/attr/base-record-spe | 40 +++++++++++++++++++++++ tools/perf/tests/attr/test-record-spe-period | 12 +++++++ tools/perf/tests/attr/test-record-spe-period-term | 12 +++++++ 4 files changed, 66 insertions(+) commit 2c0fd42c1c8b6463c76979be40fa6fe3da49d975 Author: Zhengjun Xing Date: Fri Feb 25 00:23:50 2022 +0800 perf vendor events intel: Add uncore event list for Alderlake Add JSON uncore events for Alderlake to perf. Based on JSON list v1.06: https://download.01.org/perfmon/ADL/ Signed-off-by: Zhengjun Xing Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220224162350.1975130-1-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo .../arch/x86/alderlake/uncore-memory.json | 222 +++++++++++++++++++++ .../arch/x86/alderlake/uncore-other.json | 40 ++++ 2 files changed, 262 insertions(+) commit f9900dd0053ec35863ea50dcbefbaf143cb41419 Author: Zhengjun Xing Date: Fri Feb 25 00:23:29 2022 +0800 perf vendor events intel: Add core event list for Alderlake Add JSON core events for Alderlake to perf. It is a hybrid event list for both Atom and Core. Based on JSON list v1.06: https://download.01.org/perfmon/ADL/ Signed-off-by: Zhengjun Xing Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220224162329.1975081-1-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo .../perf/pmu-events/arch/x86/alderlake/cache.json | 1140 +++++++++++++ .../arch/x86/alderlake/floating-point.json | 158 ++ .../pmu-events/arch/x86/alderlake/frontend.json | 491 ++++++ .../perf/pmu-events/arch/x86/alderlake/memory.json | 318 ++++ .../perf/pmu-events/arch/x86/alderlake/other.json | 146 ++ .../pmu-events/arch/x86/alderlake/pipeline.json | 1721 ++++++++++++++++++++ .../arch/x86/alderlake/virtual-memory.json | 258 +++ tools/perf/pmu-events/arch/x86/mapfile.csv | 2 + 8 files changed, 4234 insertions(+) commit 2a7ceac9e58167fadc3496c5f694543d4bbe03ef Author: Karolina Drobnik Date: Fri Mar 4 13:52:49 2022 +0100 memblock tests: Fix testing with 32-bit physical addresses Building memblock simulator on x86_64 with 32BIT_PHYS_ADDR_T=1 produces "cast to pointer from integer of different size" warnings. Fix them by building the binary in 32-bit environment when using 32-bit physical addresses. Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport tools/testing/memblock/scripts/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit cca96584b35765bf9eb5f38ca55a144ea2ba0de4 Author: Rob Clark Date: Sat Mar 5 09:34:03 2022 -0800 drm/msm/a6xx: Fix missing ARRAY_SIZE() check Fixes: f6d62d091cfd ("drm/msm/a6xx: add support for Adreno 660 GPU") Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220305173405.914989-1-robdclark@gmail.com drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) commit caec549534823d8d0fad43ab6753fd03ddb1c456 Merge: d59e3cbaef70 aa963bcb0adc Author: Alexei Starovoitov Date: Sat Mar 5 09:38:15 2022 -0800 Merge branch 'libbpf: support custom SEC() handlers' Andrii Nakryiko says: ==================== Add ability for user applications and libraries to register custom BPF program SEC() handlers. See patch #2 for examples where this is useful. Patch #1 does some preliminary refactoring to allow exponsing program init, preload, and attach callbacks as public API. It also establishes a protocol to allow optional auto-attach behavior. This will also help the case of sometimes auto-attachable uprobes. v4->v5: - API documentation improvements (Daniel); v3->v4: - init_fn -> prog_setup_fn, preload_fn -> prog_prepare_load_fn (Alexei); v2->v3: - moved callbacks and cookie into OPTS struct (Alan); - added more test scenarios (Alan); - address most of Alan's feedback, but kept API name; v1->v2: - resubmitting due to git send-email screw up. Cc: Alan Maguire ==================== Signed-off-by: Alexei Starovoitov commit aa963bcb0adc1adb79a97260fae55461359d1ed2 Author: Andrii Nakryiko Date: Fri Mar 4 17:01:29 2022 -0800 selftests/bpf: Add custom SEC() handling selftest Add a selftest validating various aspects of libbpf's handling of custom SEC() handlers. It also demonstrates how libraries can ensure very early callbacks registration and unregistration using __attribute__((constructor))/__attribute__((destructor)) functions. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Tested-by: Alan Maguire Reviewed-by: Alan Maguire Link: https://lore.kernel.org/bpf/20220305010129.1549719-4-andrii@kernel.org .../selftests/bpf/prog_tests/custom_sec_handlers.c | 176 +++++++++++++++++++++ .../selftests/bpf/progs/test_custom_sec_handlers.c | 63 ++++++++ 2 files changed, 239 insertions(+) commit 697f104db8a6177daa5e1ffadda09c2e9285ad18 Author: Andrii Nakryiko Date: Fri Mar 4 17:01:28 2022 -0800 libbpf: Support custom SEC() handlers Allow registering and unregistering custom handlers for BPF program. This allows user applications and libraries to plug into libbpf's declarative SEC() definition handling logic. This allows to offload complex and intricate custom logic into external libraries, but still provide a great user experience. One such example is USDT handling library, which has a lot of code and complexity which doesn't make sense to put into libbpf directly, but it would be really great for users to be able to specify BPF programs with something like SEC("usdt/::") and have correct BPF program type set (BPF_PROGRAM_TYPE_KPROBE, as it is uprobe) and even support BPF skeleton's auto-attach logic. In some cases, it might be even good idea to override libbpf's default handling, like for SEC("perf_event") programs. With custom library, it's possible to extend logic to support specifying perf event specification right there in SEC() definition without burdening libbpf with lots of custom logic or extra library dependecies (e.g., libpfm4). With current patch it's possible to override libbpf's SEC("perf_event") handling and specify a completely custom ones. Further, it's possible to specify a generic fallback handling for any SEC() that doesn't match any other custom or standard libbpf handlers. This allows to accommodate whatever legacy use cases there might be, if necessary. See doc comments for libbpf_register_prog_handler() and libbpf_unregister_prog_handler() for detailed semantics. This patch also bumps libbpf development version to v0.8 and adds new APIs there. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Tested-by: Alan Maguire Reviewed-by: Alan Maguire Link: https://lore.kernel.org/bpf/20220305010129.1549719-3-andrii@kernel.org tools/lib/bpf/libbpf.c | 204 ++++++++++++++++++++++++++++++----------- tools/lib/bpf/libbpf.h | 109 ++++++++++++++++++++++ tools/lib/bpf/libbpf.map | 6 ++ tools/lib/bpf/libbpf_version.h | 2 +- 4 files changed, 268 insertions(+), 53 deletions(-) commit 4fa5bcfe07f7e97d9a140c465e1056c91651c41d Author: Andrii Nakryiko Date: Fri Mar 4 17:01:27 2022 -0800 libbpf: Allow BPF program auto-attach handlers to bail out Allow some BPF program types to support auto-attach only in subste of cases. Currently, if some BPF program type specifies attach callback, it is assumed that during skeleton attach operation all such programs either successfully attach or entire skeleton attachment fails. If some program doesn't support auto-attachment from skeleton, such BPF program types shouldn't have attach callback specified. This is limiting for cases when, depending on how full the SEC("") definition is, there could either be enough details to support auto-attach or there might not be and user has to use some specific API to provide more details at runtime. One specific example of such desired behavior might be SEC("uprobe"). If it's specified as just uprobe auto-attach isn't possible. But if it's SEC("uprobe/:") then there are enough details to support auto-attach. Note that there is a somewhat subtle difference between auto-attach behavior of BPF skeleton and using "generic" bpf_program__attach(prog) (which uses the same attach handlers under the cover). Skeleton allow some programs within bpf_object to not have auto-attach implemented and doesn't treat that as an error. Instead such BPF programs are just skipped during skeleton's (optional) attach step. bpf_program__attach(), on the other hand, is called when user *expects* auto-attach to work, so if specified program doesn't implement or doesn't support auto-attach functionality, that will be treated as an error. Another improvement to the way libbpf is handling SEC()s would be to not require providing dummy kernel function name for kprobe. Currently, SEC("kprobe/whatever") is necessary even if actual kernel function is determined by user at runtime and bpf_program__attach_kprobe() is used to specify it. With changes in this patch, it's possible to support both SEC("kprobe") and SEC("kprobe/ Signed-off-by: Alexei Starovoitov Tested-by: Alan Maguire Reviewed-by: Alan Maguire Link: https://lore.kernel.org/bpf/20220305010129.1549719-2-andrii@kernel.org tools/lib/bpf/libbpf.c | 140 ++++++++++++++++++++++++++++++------------------- 1 file changed, 85 insertions(+), 55 deletions(-) commit c042639a70ed00ab2138f507ae1d6fa57c66ce11 Author: Chris Morgan Date: Thu Mar 3 14:39:57 2022 -0600 ARM: dts: rockchip: Update regulator name for PX3 The regulator name of SWITCH_REG1 does not match any other board with a rk818 PMIC, nor does it correspond to a regulator in the rk808-regulator driver. Changing name to SWITCH_REG which is consistent with other boards and is in the driver. Signed-off-by: Chris Morgan Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20220303203958.4904-4-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner arch/arm/boot/dts/rk3188-px3-evb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f188620d6f96d398988a22934aa2cac5043c739c Author: Chris Morgan Date: Thu Mar 3 14:39:56 2022 -0600 ARM: dts: rockchip: Add #clock-cells value for rk805 Based on a brief discussion on the mailing list it was determined that clock-cells should be a required parameter in the event that a consumer of the clock gets added in an overlay. Signed-off-by: Chris Morgan Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20220303203958.4904-3-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner arch/arm/boot/dts/rv1108-elgin-r1.dts | 1 + arch/arm/boot/dts/rv1108-evb.dts | 1 + 2 files changed, 2 insertions(+) commit 9d25aadd55bb8c37c468661b506f932d15492028 Author: Chris Morgan Date: Thu Mar 3 14:39:56 2022 -0600 arm64: dts: rockchip: Add #clock-cells value for rk805 Based on a brief discussion on the mailing list it was determined that clock-cells should be a required parameter in the event that a consumer of the clock gets added in an overlay. Signed-off-by: Chris Morgan Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20220303203958.4904-3-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner arch/arm64/boot/dts/rockchip/rk3328-a1.dts | 1 + 1 file changed, 1 insertion(+) commit 079d76ab304227dd29e7bba76736567b5ac73030 Author: Chris Morgan Date: Thu Mar 3 14:39:55 2022 -0600 arm64: dts: rockchip: Remove vcc13 and vcc14 for rk808 The Rockchip rk808 Power Management IC does not have a vcc13 or a vcc14. The schematics for at least the Pinebook Pro suggest this is actually vcc1 and vcc2, and may be an artifact from the reference design schematic). Signed-off-by: Chris Morgan Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20220303203958.4904-2-macroalpha82@gmail.com Signed-off-by: Heiko Stuebner arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 2 -- arch/arm64/boot/dts/rockchip/rk3399-roc-pc.dtsi | 2 -- 2 files changed, 4 deletions(-) commit 37cbd3c522869247ed4525b5042ff4c6a276c813 Author: Rob Herring Date: Fri Mar 4 14:25:58 2022 -0600 arm64: dts: rockchip: Fix SDIO regulator supply properties on rk3399-firefly A label reference without brackets is a path string, not a phandle as intended. Add the missing brackets. Fixes: a5002c41c383 ("arm64: dts: rockchip: add WiFi module support for Firefly-RK3399") Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220304202559.317749-1-robh@kernel.org Signed-off-by: Heiko Stuebner arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ab552fcb17cc9e4afe0e4ac4df95fc7b30e8490a Author: Zhang Wensheng Date: Thu Mar 3 15:03:34 2022 +0800 bfq: fix use-after-free in bfq_dispatch_request KASAN reports a use-after-free report when doing normal scsi-mq test [69832.239032] ================================================================== [69832.241810] BUG: KASAN: use-after-free in bfq_dispatch_request+0x1045/0x44b0 [69832.243267] Read of size 8 at addr ffff88802622ba88 by task kworker/3:1H/155 [69832.244656] [69832.245007] CPU: 3 PID: 155 Comm: kworker/3:1H Not tainted 5.10.0-10295-g576c6382529e #8 [69832.246626] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [69832.249069] Workqueue: kblockd blk_mq_run_work_fn [69832.250022] Call Trace: [69832.250541] dump_stack+0x9b/0xce [69832.251232] ? bfq_dispatch_request+0x1045/0x44b0 [69832.252243] print_address_description.constprop.6+0x3e/0x60 [69832.253381] ? __cpuidle_text_end+0x5/0x5 [69832.254211] ? vprintk_func+0x6b/0x120 [69832.254994] ? bfq_dispatch_request+0x1045/0x44b0 [69832.255952] ? bfq_dispatch_request+0x1045/0x44b0 [69832.256914] kasan_report.cold.9+0x22/0x3a [69832.257753] ? bfq_dispatch_request+0x1045/0x44b0 [69832.258755] check_memory_region+0x1c1/0x1e0 [69832.260248] bfq_dispatch_request+0x1045/0x44b0 [69832.261181] ? bfq_bfqq_expire+0x2440/0x2440 [69832.262032] ? blk_mq_delay_run_hw_queues+0xf9/0x170 [69832.263022] __blk_mq_do_dispatch_sched+0x52f/0x830 [69832.264011] ? blk_mq_sched_request_inserted+0x100/0x100 [69832.265101] __blk_mq_sched_dispatch_requests+0x398/0x4f0 [69832.266206] ? blk_mq_do_dispatch_ctx+0x570/0x570 [69832.267147] ? __switch_to+0x5f4/0xee0 [69832.267898] blk_mq_sched_dispatch_requests+0xdf/0x140 [69832.268946] __blk_mq_run_hw_queue+0xc0/0x270 [69832.269840] blk_mq_run_work_fn+0x51/0x60 [69832.278170] process_one_work+0x6d4/0xfe0 [69832.278984] worker_thread+0x91/0xc80 [69832.279726] ? __kthread_parkme+0xb0/0x110 [69832.280554] ? process_one_work+0xfe0/0xfe0 [69832.281414] kthread+0x32d/0x3f0 [69832.282082] ? kthread_park+0x170/0x170 [69832.282849] ret_from_fork+0x1f/0x30 [69832.283573] [69832.283886] Allocated by task 7725: [69832.284599] kasan_save_stack+0x19/0x40 [69832.285385] __kasan_kmalloc.constprop.2+0xc1/0xd0 [69832.286350] kmem_cache_alloc_node+0x13f/0x460 [69832.287237] bfq_get_queue+0x3d4/0x1140 [69832.287993] bfq_get_bfqq_handle_split+0x103/0x510 [69832.289015] bfq_init_rq+0x337/0x2d50 [69832.289749] bfq_insert_requests+0x304/0x4e10 [69832.290634] blk_mq_sched_insert_requests+0x13e/0x390 [69832.291629] blk_mq_flush_plug_list+0x4b4/0x760 [69832.292538] blk_flush_plug_list+0x2c5/0x480 [69832.293392] io_schedule_prepare+0xb2/0xd0 [69832.294209] io_schedule_timeout+0x13/0x80 [69832.295014] wait_for_common_io.constprop.1+0x13c/0x270 [69832.296137] submit_bio_wait+0x103/0x1a0 [69832.296932] blkdev_issue_discard+0xe6/0x160 [69832.297794] blk_ioctl_discard+0x219/0x290 [69832.298614] blkdev_common_ioctl+0x50a/0x1750 [69832.304715] blkdev_ioctl+0x470/0x600 [69832.305474] block_ioctl+0xde/0x120 [69832.306232] vfs_ioctl+0x6c/0xc0 [69832.306877] __se_sys_ioctl+0x90/0xa0 [69832.307629] do_syscall_64+0x2d/0x40 [69832.308362] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [69832.309382] [69832.309701] Freed by task 155: [69832.310328] kasan_save_stack+0x19/0x40 [69832.311121] kasan_set_track+0x1c/0x30 [69832.311868] kasan_set_free_info+0x1b/0x30 [69832.312699] __kasan_slab_free+0x111/0x160 [69832.313524] kmem_cache_free+0x94/0x460 [69832.314367] bfq_put_queue+0x582/0x940 [69832.315112] __bfq_bfqd_reset_in_service+0x166/0x1d0 [69832.317275] bfq_bfqq_expire+0xb27/0x2440 [69832.318084] bfq_dispatch_request+0x697/0x44b0 [69832.318991] __blk_mq_do_dispatch_sched+0x52f/0x830 [69832.319984] __blk_mq_sched_dispatch_requests+0x398/0x4f0 [69832.321087] blk_mq_sched_dispatch_requests+0xdf/0x140 [69832.322225] __blk_mq_run_hw_queue+0xc0/0x270 [69832.323114] blk_mq_run_work_fn+0x51/0x60 [69832.323942] process_one_work+0x6d4/0xfe0 [69832.324772] worker_thread+0x91/0xc80 [69832.325518] kthread+0x32d/0x3f0 [69832.326205] ret_from_fork+0x1f/0x30 [69832.326932] [69832.338297] The buggy address belongs to the object at ffff88802622b968 [69832.338297] which belongs to the cache bfq_queue of size 512 [69832.340766] The buggy address is located 288 bytes inside of [69832.340766] 512-byte region [ffff88802622b968, ffff88802622bb68) [69832.343091] The buggy address belongs to the page: [69832.344097] page:ffffea0000988a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802622a528 pfn:0x26228 [69832.346214] head:ffffea0000988a00 order:2 compound_mapcount:0 compound_pincount:0 [69832.347719] flags: 0x1fffff80010200(slab|head) [69832.348625] raw: 001fffff80010200 ffffea0000dbac08 ffff888017a57650 ffff8880179fe840 [69832.354972] raw: ffff88802622a528 0000000000120008 00000001ffffffff 0000000000000000 [69832.356547] page dumped because: kasan: bad access detected [69832.357652] [69832.357970] Memory state around the buggy address: [69832.358926] ffff88802622b980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [69832.360358] ffff88802622ba00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [69832.361810] >ffff88802622ba80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb [69832.363273] ^ [69832.363975] ffff88802622bb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc [69832.375960] ffff88802622bb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [69832.377405] ================================================================== In bfq_dispatch_requestfunction, it may have function call: bfq_dispatch_request __bfq_dispatch_request bfq_select_queue bfq_bfqq_expire __bfq_bfqd_reset_in_service bfq_put_queue kmem_cache_free In this function call, in_serv_queue has beed expired and meet the conditions to free. In the function bfq_dispatch_request, the address of in_serv_queue pointing to has been released. For getting the value of idle_timer_disabled, it will get flags value from the address which in_serv_queue pointing to, then the problem of use-after-free happens; Fix the problem by check in_serv_queue == bfqd->in_service_queue, to get the value of idle_timer_disabled if in_serve_queue is equel to bfqd->in_service_queue. If the space of in_serv_queue pointing has been released, this judge will aviod use-after-free problem. And if in_serv_queue may be expired or finished, the idle_timer_disabled will be false which would not give effects to bfq_update_dispatch_stats. Reported-by: Hulk Robot Signed-off-by: Zhang Wensheng Link: https://lore.kernel.org/r/20220303070334.3020168-1-zhangwensheng5@huawei.com Signed-off-by: Jens Axboe block/bfq-iosched.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) commit d59e3cbaef707f0d3dc1e3b6735cb25060ca74c2 Merge: 2057b8b70e86 22f5dba5065d Author: David S. Miller Date: Sat Mar 5 11:16:56 2022 +0000 Merge branch 'bnxt_en-updates' Michael Chan says: ==================== bnxt_en: Updates. This patch series contains mainly NVRAM related features. More NVRAM error checking and logging are added when installing firmware packages. A new devlink hw health report is now added to report and diagnose NVRAM issues. Other miscellaneous patches include reporting correctly cards that don't support link pause, adding an internal unknown link state, and avoiding unnecessary link toggle during firmware reset. ==================== Signed-off-by: David S. Miller commit 22f5dba5065d4149cf5186da6255894ed119179d Author: Vikas Gupta Date: Sat Mar 5 03:54:42 2022 -0500 bnxt_en: add an nvm test for hw diagnose Add an NVM test function for devlink hw reporter. In this function an NVM VPD area is read followed by a write. Test result is cached and if it is successful then the next test can be conducted only after HW_RETEST_MIN_TIME to avoid frequent writes to the NVM. Reviewed-by: Edwin Peer Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt.h | 20 ++++-- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 82 ++++++++++++++++++++++- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 22 +++--- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 7 ++ 4 files changed, 113 insertions(+), 18 deletions(-) commit bafed3f231f7037ce881de2278c14a679ee9c937 Author: Kalesh AP Date: Sat Mar 5 03:54:41 2022 -0500 bnxt_en: implement hw health reporter This reporter will report NVM errors which are non-fatal. When we receive these NVM error events, we'll report it through this new hw health reporter. Reviewed-by: Edwin Peer Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt.c | 19 ++++++ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 33 ++++++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 73 +++++++++++++++++++++++ drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h | 1 + 4 files changed, 126 insertions(+) commit f16a9169286691d23906a1bb1c8e07e53113586c Author: Edwin Peer Date: Sat Mar 5 03:54:40 2022 -0500 bnxt_en: Do not destroy health reporters during reset Health reporter state should be maintained over resets. Previously reporters were destroyed if the device capabilities changed, but since none of the reporters depend on capabilities anymore, this logic should be removed. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt.c | 7 +--- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 44 +++++++++++------------ drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h | 2 +- 3 files changed, 24 insertions(+), 29 deletions(-) commit 7c492a2530c1f05441da541307c2534230dfd59b Author: Michael Chan Date: Sat Mar 5 03:54:39 2022 -0500 bnxt_en: Eliminate unintended link toggle during FW reset If the flow control settings have been changed, a subsequent FW reset may cause the ethernet link to toggle unnecessarily. This link toggle will increase the down time by a few seconds. The problem is caused by bnxt_update_phy_setting() detecting a false mismatch in the flow control settings between the stored software settings and the current FW settings after the FW reset. This mismatch is caused by the AUTONEG bit added to link_info->req_flow_ctrl in an inconsistent way in bnxt_set_pauseparam() in autoneg mode. The AUTONEG bit should not be added to link_info->req_flow_ctrl. Reviewed-by: Colin Winegarden Reviewed-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 9a3bc77ec65efa3d58e4da0d0e64cefdd9c1692e Author: Michael Chan Date: Sat Mar 5 03:54:38 2022 -0500 bnxt_en: Properly report no pause support on some cards Some cards are configured to never support link pause or PFC. Discover these cards and properly report no pause support to ethtool. Disable PFC settings from DCBNL if PFC is unsupported. Reviewed-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 6 ++++-- drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c | 3 ++- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 15 ++++++++++----- 4 files changed, 17 insertions(+), 9 deletions(-) commit 0f5a4841f2ec504fba753c86f824a23ed8d0df1f Author: Edwin Peer Date: Sat Mar 5 03:54:37 2022 -0500 bnxt_en: introduce initial link state of unknown This will force link state to always be logged for initial NIC open. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt.c | 33 +++++++++++++++-------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 6 ++++- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 +-- 3 files changed, 29 insertions(+), 14 deletions(-) commit 02acd399533e44523cdadb260837f6c53d146f80 Author: Kalesh AP Date: Sat Mar 5 03:54:36 2022 -0500 bnxt_en: parse result field when NVRAM package install fails Instead of always returning -ENOPKG, decode the firmware error code further when the HWRM_NVM_INSTALL_UPDATE firmware call fails. Return a more suitable error code to userspace and log an error in dmesg. Reviewed-by: Somnath Kotur Reviewed-by: Pavan Chebbi Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 44 ++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) commit 54ff1e3e8fc3aad09d5dfc426bb462e261c37a1b Author: Kalesh AP Date: Sat Mar 5 03:54:35 2022 -0500 bnxt_en: add more error checks to HWRM_NVM_INSTALL_UPDATE FW returns error code "NVM_INSTALL_UPDATE_CMD_ERR_CODE_ANTI_ROLLBACK" in the response to indicate that HWRM_NVM_INSTALL_UPDATE command has failed due to Anti-rollback feature. Parse the error and return an appropriate error code to the user. Reviewed-by: Somnath Kotur Reviewed-by: Edwin Peer Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 4 ++++ 1 file changed, 4 insertions(+) commit 8e42aef0b7307c024bedf8716628392977f27f55 Author: Kalesh AP Date: Sat Mar 5 03:54:34 2022 -0500 bnxt_en: refactor error handling of HWRM_NVM_INSTALL_UPDATE This is in anticipation of handling more "cmd_err" from FW in the next patch. Reviewed-by: Somnath Kotur Reviewed-by: Edwin Peer Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 26 ++++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) commit 2057b8b70e86d31e9a83c48948e56add2cc5668c Merge: c409f9b91f71 0b79b8dc97b9 Author: David S. Miller Date: Sat Mar 5 11:12:09 2022 +0000 Merge branch 'axienet-napi-gro-support' Robert Hancock says: ==================== NAPI/GRO support for axienet driver Add support for NAPI and GRO receive in the Xilinx AXI Ethernet driver, and some other related cleanups. ==================== Signed-off-by: David S. Miller commit 0b79b8dc97b9df4f873f63161e3050bafc4c4237 Author: Robert Hancock Date: Fri Mar 4 20:24:43 2022 -0600 net: axienet: add coalesce timer ethtool configuration Add the ability to configure the RX/TX coalesce timer with ethtool. Change default setting to scale with the clock rate rather than being a fixed number of clock cycles. Signed-off-by: Robert Hancock Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet.h | 10 +++-- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 51 ++++++++++++++++++----- 2 files changed, 47 insertions(+), 14 deletions(-) commit 40da5d680e02ca8d61237192db4b5833d3c9639f Author: Robert Hancock Date: Fri Mar 4 20:24:42 2022 -0600 net: axienet: reduce default RX interrupt threshold to 1 Now that NAPI has been implemented, the hardware interrupt mitigation mechanism is not needed to avoid excessive interrupt load in most cases. Reduce the default RX interrupt threshold to 1 to reduce introduced latency. This can be increased with ethtool if desired if some applications still want to reduce interrupts. Signed-off-by: Robert Hancock Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit cc37610caaf8d13a6ecb8afd1fe2ebc2424ff622 Author: Robert Hancock Date: Fri Mar 4 20:24:41 2022 -0600 net: axienet: implement NAPI and GRO receive Implement NAPI and GRO receive. In addition to better performance, this also avoids handling RX packets in hard IRQ context, which reduces the IRQ latency impact to other devices. Signed-off-by: Robert Hancock Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet.h | 6 ++ drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 81 +++++++++++++++-------- 2 files changed, 59 insertions(+), 28 deletions(-) commit 0155ae6eb84dbeecb7199a2fd9dee72e046ac875 Author: Robert Hancock Date: Fri Mar 4 20:24:40 2022 -0600 net: axienet: don't set IRQ timer when IRQ delay not used When the RX or TX coalesce count is set to 1, there's no point in setting the delay timer value since an interrupt will already be raised on every packet, and the delay interrupt just causes extra pointless interrupts. Signed-off-by: Robert Hancock Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) commit 84b9ccc0749a7036bcaf707f02273dcbd4756fbf Author: Robert Hancock Date: Fri Mar 4 20:24:39 2022 -0600 net: axienet: Clean up DMA start/stop and error handling Simplify the DMA error handling process, and remove some duplicated code between the DMA error handling and the stop function. Signed-off-by: Robert Hancock Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 280 ++++++++-------------- 1 file changed, 105 insertions(+), 175 deletions(-) commit 17882fd4256721451457ee57532bbae0cd5cacfe Author: Robert Hancock Date: Fri Mar 4 20:24:38 2022 -0600 net: axienet: Clean up device used for DMA calls Instead of using lp->ndev.parent to find the correct device to use for DMA API calls, just use the dev attribute in the device structure. Signed-off-by: Robert Hancock Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) commit 7a7d340ba4d9351e4c8847b898a2b996727a922a Author: Robert Hancock Date: Fri Mar 4 20:24:37 2022 -0600 net: axienet: fix RX ring refill allocation failure handling If a memory allocation error occurred during an attempt to refill a slot in the RX ring after the packet was received, the hardware tail pointer would still have been updated to point to or past the slot which remained marked as previously completed. This would likely result in the DMA engine raising an error when it eventually tried to use that slot again. If a slot cannot be refilled, then just stop processing and do not move the tail pointer past it. On the next attempt, we should skip receiving the packet from the empty slot and just try to refill it again. This failure mode has not actually been observed, but was found as part of other driver updates. Fixes: 8a3b7a252dca ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Robert Hancock Signed-off-by: David S. Miller drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 72 +++++++++++++---------- 1 file changed, 42 insertions(+), 30 deletions(-) commit c409f9b91f7157b8e3de6ddfd10d5a380a26caf4 Merge: 6dff1574c20b 59dc7b4f7f45 Author: David S. Miller Date: Sat Mar 5 11:04:25 2022 +0000 Merge branch 'dsa-realtek-add-rtl8_4t-tags' Luiz Angelo Daros de Luca says: ==================== net: dsa: realtek: add rtl8_4t tag This patch series adds support for rtl8_4t tag. It is a variant of rtl8_4 tag, with identical values but placed at the end of the packet (before CRC). It forces checksum in software before adding the tag as those extra bytes at the end of the packet would be summed together with the rest of the payload. When the switch removes the tag before sending the packet to the network, that checksum will not match. It might be useful to diagnose or avoid checksum offload issues. With an ethertype tag like rtl8_4, the cpu port ethernet driver must work with cksum_start and chksum_offset to correctly calculate checksums. If not, the checksum field will be broken (it will contain the fake ip header sum). In those cases, using 'rtl8_4t' might be an alternative way to avoid checksum offload, either using runtime or device-tree property. Regards, Luiz v4-v5) - tags in alphabetical order in dsa_port.yaml - remove ret var from rtl8365mb_change_tag_protocol - Comment typos fixes v3-v4) - added rtl8_4 and rtl8_4t to dsa_port.yaml - removed generic considerations about checksum problems with DSA tags. They belong to Documentation/networking/dsa/dsa.rst v2-v3) - updated tag documentation (file header) - do not remove position and format from rtl8365mb_cpu - reinstate cpu to rtl8365mb - moved rtl8365mb_change_tag_protocol after rtl8365mb_cpu_config - do not modify rtl8365mb_cpu_config() logic - remove cpu arg from rtl8365mb_cpu_config(); get it from priv - dropped tag_protocol from rtl8365mb. It is now derived from cpu->position. - init cpu struct before dsa_register as default tag must be already defined before dsa_register() - fix formatting issues v1-v2) - remove mention to tail tagger, use trailing tagger. - use void* instead of char* for pointing to tag beginning - use memcpy to avoid problems with unaligned tags - calculate checksum if it still pending - keep in-use tag protocol in memory instead of reading from switch register ==================== Signed-off-by: David S. Miller commit 59dc7b4f7f4569123ab658540a8c5c4f641d2201 Author: Luiz Angelo Daros de Luca Date: Wed Mar 2 22:52:35 2022 -0300 net: dsa: realtek: rtl8365mb: add support for rtl8_4t The trailing tag is also supported by this family. The default is still rtl8_4 but now the switch supports changing the tag to rtl8_4t. Reintroduce the dropped cpu in struct rtl8365mb (removed by 6147631). Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Alvin Šipraga Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/realtek/rtl8365mb.c | 77 +++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 15 deletions(-) commit cd87fecdedd7b54c61f5d7c2b7237b43126ac50a Author: Luiz Angelo Daros de Luca Date: Wed Mar 2 22:52:34 2022 -0300 net: dsa: tag_rtl8_4: add rtl8_4t trailing variant Realtek switches supports the same tag both before ethertype or between payload and the CRC. Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Alvin Šipraga Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller include/net/dsa.h | 2 + net/dsa/tag_rtl8_4.c | 152 +++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 118 insertions(+), 36 deletions(-) commit 617c3cc3aafd826c549b83f055f1e710adbdf99a Author: Luiz Angelo Daros de Luca Date: Wed Mar 2 22:52:33 2022 -0300 dt-bindings: net: dsa: add rtl8_4 and rtl8_4t tag formats Realtek rtl8365mb DSA driver can use these two tag formats. Cc: devicetree@vger.kernel.org Signed-off-by: Luiz Angelo Daros de Luca Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Documentation/devicetree/bindings/net/dsa/dsa-port.yaml | 2 ++ 1 file changed, 2 insertions(+) commit fc4cf4293f0da3985ca66edc2cf067531d933c42 Author: Takashi Iwai Date: Sat Mar 5 09:33:08 2022 +0100 ALSA: x86: Use standard mmap helper for Intel HDMI LPE audio Intel HDMI LPE audio driver has its own mmap callback that mimics with the noncached page attributes, but this is rather superfluous and can be replaced with the standard helper, as the device is only for playback and the write-cache should suffice. This patch drops the own code and just uses the standard helper. Link: https://lore.kernel.org/r/20220305083308.15718-1-tiwai@suse.de Signed-off-by: Takashi Iwai sound/x86/intel_hdmi_audio.c | 13 ------------- 1 file changed, 13 deletions(-) commit d460975eeea80a4ef9a089ee6e413f72fb742316 Merge: d7f15befac80 cd94df179541 Author: Takashi Iwai Date: Sat Mar 5 09:28:31 2022 +0100 Merge branch 'for-linus' into for-next Back-merge of 5.17-devel branch for further work on Intel LPE HDMI stuff Signed-off-by: Takashi Iwai commit cd94df1795418056a19ff4cb44eadfc18ac99a57 Author: Reza Jahanbakhshi Date: Fri Mar 4 22:23:02 2022 +0100 ALSA: usb-audio: add mapping for new Corsair Virtuoso SE New device id for Corsair Virtuoso SE RGB Wireless that currently is not in the mixer_map. This entry in the mixer_map is necessary in order to label its mixer appropriately and allow userspace to pick the correct volume controls. For instance, my own Corsair Virtuoso SE RGB Wireless headset has this new ID and consequently, the sidetone and volume are not working correctly without this change. > sudo lsusb -v | grep -i corsair Bus 007 Device 011: ID 1b1c:0a40 Corsair CORSAIR VIRTUOSO SE Wireless Gam idVendor 0x1b1c Corsair iManufacturer 1 Corsair iProduct 2 CORSAIR VIRTUOSO SE Wireless Gaming Headset Signed-off-by: Reza Jahanbakhshi Cc: Link: https://lore.kernel.org/r/20220304212303.195949-1-reza.jahanbakhshi@gmail.com Signed-off-by: Takashi Iwai sound/usb/mixer_maps.c | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 0c20fce13e6e111463e3a15ce3cf6713fe518388 Author: Tim Crawford Date: Fri Mar 4 10:08:40 2022 -0700 ALSA: hda/realtek: Add quirk for Clevo NP70PNJ Fixes headset detection on Clevo NP70PNJ. Signed-off-by: Tim Crawford Cc: Link: https://lore.kernel.org/r/20220304170840.3351-1-tcrawford@system76.com Signed-off-by: Takashi Iwai sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) commit 17154addc5c1a175bcf3441ff0d9598efa1f05cd Author: Rob Clark Date: Thu Feb 24 14:23:21 2022 -0800 drm/msm: Add MSM_SUBMIT_FENCE_SN_IN Add a way for userspace to specify the sequence number fence used to track completion of the submit. As the seqno fence is simply an incrementing counter which is local to the submitqueue, it is easy for userspace to know the next value. This is useful for native userspace drivers in a vm guest, as the guest to host roundtrip can have high latency. Assigning the fence seqno in the guest userspace allows the guest to continue without waiting for response from the host. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220224222321.60653-1-robdclark@gmail.com drivers/gpu/drm/msm/msm_drv.c | 3 ++- drivers/gpu/drm/msm/msm_gem_submit.c | 42 ++++++++++++++++++++++++++++++------ include/uapi/drm/msm_drm.h | 4 +++- 3 files changed, 41 insertions(+), 8 deletions(-) commit 6dff1574c20b833d702e893caf3592d307be53d4 Merge: 43ff0d76f235 7d9bf018f907 Author: Jakub Kicinski Date: Fri Mar 4 21:54:33 2022 -0800 Merge branch 'mptcp-selftest-refinements-and-a-new-test' Mat Martineau says: ==================== mptcp: Selftest refinements and a new test Patches 1 and 11 improve the printed output of the mptcp_join.sh selftest. Patches 2-8 add a test for the MP_FASTCLOSE option, including prerequisite changes like additional MPTCP MIBs. Patches 9-10 add some groundwork for upcoming tests. ==================== Link: https://lore.kernel.org/r/20220304193636.219315-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 7d9bf018f907bccd04ada1ad9c613a79b07526cd Author: Geliang Tang Date: Fri Mar 4 11:36:36 2022 -0800 selftests: mptcp: update output info of chk_rm_nr This patch updated the output info of chk_rm_nr. Renamed 'sf' to 'rmsf', which means 'remove subflow'. Added the display of whether the inverted namespaces has been used to check the mib counters. The new output looks like this: 002 remove multiple subflows syn[ ok ] - synack[ ok ] - ack[ ok ] rm [ ok ] - rmsf [ ok ] 003 remove single address syn[ ok ] - synack[ ok ] - ack[ ok ] add[ ok ] - echo [ ok ] rm [ ok ] - rmsf [ ok ] invert Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) commit 26516e10c4335286df1cac9f8c874e08750054d2 Author: Geliang Tang Date: Fri Mar 4 11:36:35 2022 -0800 selftests: mptcp: add more arguments for chk_join_nr This patch added five more arguments for chk_join_nr(). The default values of them are all zero. The first two, csum_ns1 and csum_ns1, are passed to chk_csum_nr(), to check the mib counters of the checksum errors in ns1 and ns2. A '+' can be added into this two arguments to represent that multiple checksum errors are allowed when doing this check. For example, chk_csum_nr "" +2 +2 indicates that two or more checksum errors are allowed in both ns1 and ns2. The remaining two, fail_nr and rst_nr, are passed to chk_fail_nr() and chk_rst_nr() respectively, to check the sending and receiving mib counters of MP_FAIL and MP_RST. Also did some cleanups in chk_fail_nr(), renamed two local variables and updated the output message. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 47 +++++++++++++++++-------- 1 file changed, 33 insertions(+), 14 deletions(-) commit 8117dac3e7c31b2bf4e7d24d53b5e63625871e15 Author: Geliang Tang Date: Fri Mar 4 11:36:34 2022 -0800 selftests: mptcp: add invert check in check_transfer This patch added the invert bytes check for the output data in check_transfer(). Instead of the file mismatch error: [ FAIL ] file received by server does not match (in, out): -rw------- 1 root root 45643832 Jan 16 15:04 /tmp/tmp.9xpM6Paivv Trailing bytes are: MPTCP_TEST_FILE_END_MARKER -rw------- 1 root root 45643832 Jan 16 15:04 /tmp/tmp.wnz1Yp4u7Z Trailing bytes are: MPTCP_TEST_FILE_END_MARKER Print out the inverted bytes like this: file received by server has inverted byte at 7454789 file received by server has inverted byte at 7454790 file received by server has inverted byte at 7454791 file received by server has inverted byte at 7454792 Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) commit 01542c9bf9ab04493e027f55b5e0d5fdfdc1780f Author: Geliang Tang Date: Fri Mar 4 11:36:33 2022 -0800 selftests: mptcp: add fastclose testcase This patch added the self test for MP_FASTCLOSE. Reused the argument addr_nr_ns2 of do_transfer() to pass the extra arguments '-I 2' to mptcp_connect commands. Then mptcp_connect disconnected the connections to trigger the MP_FASTCLOSE sending and receiving. Used chk_fclose_nr to check the MP_FASTCLOSE mibs and used chk_rst_nr to check the MP_RST mibs. This test used the test_linkfail value to make 1024KB test files. The output looks like this: Created /tmp/tmp.XB8sfv1hJ0 (size 1024 KB) containing data sent by client Created /tmp/tmp.RtTDbzqrXI (size 1024 KB) containing data sent by server 001 fastclose test syn[ ok ] - synack[ ok ] - ack[ ok ] ctx[ ok ] - fclzrx[ ok ] rtx[ ok ] - rstrx [ ok ] invert Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) commit 34b572b76fecbcc4f209f87269a07ccb9872f6f2 Author: Geliang Tang Date: Fri Mar 4 11:36:32 2022 -0800 selftests: mptcp: reuse linkfail to make given size files This patch reused the test_linkfail values above 2 to make test files with the given sizes (KB) for both the client side and the server side. It's useful for the test cases using different file sizes. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 32 +++++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) commit cbfafac4cf8fa885c7c5d5b3914a9f9ce3b4565b Author: Geliang Tang Date: Fri Mar 4 11:36:31 2022 -0800 selftests: mptcp: add extra_args in do_transfer Instead of using a global variable mptcp_connect, this patch added a new local variable extra_args in do_transfer() to store the extra arguments passing to the mptcp_connect commands. This patch also renamed the speed level 'least' to 'speed_*'. This more flexible way can avoid the need to add new speed levels in the future. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) commit 922fd2b39e5a3c0220974687ad2afcf5654819e6 Author: Geliang Tang Date: Fri Mar 4 11:36:30 2022 -0800 selftests: mptcp: add the MP_RST mibs check This patch added a new function chk_rst_nr() to check the numbers of the MP_RST sending and receiving mibs. Showed in the output whether the inverted namespaces check order is used. Since if we pass -Cz to mptcp_join.sh, the MP_RST information is showed twice. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) commit e40dd439d6daefe647ecf23bb1b15141c34edd1d Author: Geliang Tang Date: Fri Mar 4 11:36:29 2022 -0800 mptcp: add the mibs for MP_RST This patch added two more mibs for MP_RST, MPTCP_MIB_MPRSTTX for the MP_RST sending and MPTCP_MIB_MPRSTRX for the MP_RST receiving. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski net/mptcp/mib.c | 2 ++ net/mptcp/mib.h | 2 ++ net/mptcp/options.c | 2 ++ 3 files changed, 6 insertions(+) commit e8e947ef50f6f24710f3557bc327deb185b52f84 Author: Geliang Tang Date: Fri Mar 4 11:36:28 2022 -0800 selftests: mptcp: add the MP_FASTCLOSE mibs check This patch added a new function chk_fclose_nr() to check the numbers of the MP_FASTCLOSE sending and receiving mibs. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) commit 1e75629cb964b5b2fdf79553da8d1a3c72b62faa Author: Geliang Tang Date: Fri Mar 4 11:36:27 2022 -0800 mptcp: add the mibs for MP_FASTCLOSE This patch added two more mibs for MP_FASTCLOSE, MPTCP_MIB_MPFASTCLOSETX for the MP_FASTCLOSE sending and MPTCP_MIB_MPFASTCLOSERX for receiving. Also added a debug log for MP_FASTCLOSE receiving, printed out the recv_key of MP_FASTCLOSE in mptcp_parse_option to show that MP_RST is received. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski net/mptcp/mib.c | 2 ++ net/mptcp/mib.h | 2 ++ net/mptcp/options.c | 3 +++ 3 files changed, 7 insertions(+) commit 9a0a93672c14feaf441c7078c00065c5d163d12a Author: Geliang Tang Date: Fri Mar 4 11:36:26 2022 -0800 selftests: mptcp: adjust output alignment for more tests The number of self tests in mptcp_join.sh will soon be more than 100, the output alignment is no longer OK. This patch adjusted it. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski tools/testing/selftests/net/mptcp/mptcp_join.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) commit 43ff0d76f23571e8cfc60bf08af4f89ef78f20f0 Author: Meng Tang Date: Thu Mar 3 18:08:15 2022 +0800 bcm63xx_enet: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Meng Tang Link: https://lore.kernel.org/r/20220303100815.25605-1-tangmeng@uniontech.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/broadcom/bcm63xx_enet.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 61fd7ac2152237c3aa4057de81b98cb9a4967cd7 Author: Jonathan Lemon Date: Thu Mar 3 21:46:15 2022 -0800 ptp: ocp: Add serial port information to the debug summary On the debug summary page, show the /dev/ttyS mapping. Signed-off-by: Jonathan Lemon Link: https://lore.kernel.org/r/20220304054615.1737-1-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski drivers/ptp/ptp_ocp.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 349fa2796e5235d81df6e01f122e75124e34b859 Author: Horatiu Vultur Date: Fri Mar 4 15:09:18 2022 +0100 net: sparx5: Fix initialization of variables on stack The variables 'res' inside the functions sparx5_ptp_get_1ppm and sparx5_ptp_get_nominal_value was not initialized. So in case of the default case of the switch after, it would return an uninitialized variable. This makes also the clang builds to failed. Fixes: 0933bd04047c3b ("net: sparx5: Add support for ptp clocks") Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220304140918.3356873-1-horatiu.vultur@microchip.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 2bc0a832fad341a745786ba158e9a32ab1beced6 Merge: 6646dc241dd0 6dfbe29f45fb Author: Jakub Kicinski Date: Fri Mar 4 19:42:04 2022 -0800 Merge tag 'for-net-next-2022-03-04' 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 new PID/VID (0x13d3/0x3567) for MT7921 - Add new PID/VID (0x2550/0x8761) for Realtek 8761BU - Add support for LG LGSBWAC02 (MT7663BUN) - Add support for BCM43430A0 and BCM43430A1 - Add support for Intel Madison Peak (MsP2) * tag 'for-net-next-2022-03-04' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: (21 commits) Bluetooth: btusb: Add another Realtek 8761BU Bluetooth: hci_bcm: add BCM43430A0 & BCM43430A1 Bluetooth: use memset avoid memory leaks Bluetooth: btmtksdio: Fix kernel oops when sdio suspend. Bluetooth: btusb: Add a new PID/VID 13d3/3567 for MT7921 Bluetooth: move adv_instance_cnt read within the device lock Bluetooth: hci_event: Add missing locking on hdev in hci_le_ext_adv_term_evt Bluetooth: btusb: Make use of of BIT macro to declare flags Bluetooth: Fix not checking for valid hdev on bt_dev_{info,warn,err,dbg} Bluetooth: mediatek: fix the conflict between mtk and msft vendor event Bluetooth: mt7921s: support bluetooth reset mechanism Bluetooth: make array bt_uuid_any static const Bluetooth: 6lowpan: No need to clear memory twice Bluetooth: btusb: Improve stability for QCA devices Bluetooth: btusb: add support for LG LGSBWAC02 (MT7663BUN) Bluetooth: btusb: Add support for Intel Madison Peak (MsP2) device Bluetooth: Improve skb handling in mgmt_device_connected() Bluetooth: Fix skb allocation in mgmt_remote_name() & mgmt_device_connected() Bluetooth: mgmt: Remove unneeded variable Bluetooth: hci_sync: fix undefined return of hci_disconnect_all_sync() ... ==================== Link: https://lore.kernel.org/r/20220304193919.649815-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 6646dc241dd09e1e6141b32cd72e5b59c17c0ce5 Merge: 1039135aedfc 7df5072cc05f Author: Jakub Kicinski Date: Fri Mar 4 19:28:17 2022 -0800 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2022-03-04 We've added 32 non-merge commits during the last 14 day(s) which contain a total of 59 files changed, 1038 insertions(+), 473 deletions(-). The main changes are: 1) Optimize BPF stackmap's build_id retrieval by caching last valid build_id, as consecutive stack frames are likely to be in the same VMA and therefore have the same build id, from Hao Luo. 2) Several improvements to arm64 BPF JIT, that is, support for JITing the atomic[64]_fetch_add, atomic[64]_[fetch_]{and,or,xor} and lastly atomic[64]_{xchg|cmpxchg}. Also fix the BTF line info dump for JITed programs, from Hou Tao. 3) Optimize generic BPF map batch deletion by only enforcing synchronize_rcu() barrier once upon return to user space, from Eric Dumazet. 4) For kernel build parse DWARF and generate BTF through pahole with enabled multithreading, from Kui-Feng Lee. 5) BPF verifier usability improvements by making log info more concise and replacing inv with scalar type name, from Mykola Lysenko. 6) Two follow-up fixes for BPF prog JIT pack allocator, from Song Liu. 7) Add a new Kconfig to allow for loading kernel modules with non-matching BTF type info; their BTF info is then removed on load, from Connor O'Brien. 8) Remove reallocarray() usage from bpftool and switch to libbpf_reallocarray() in order to fix compilation errors for older glibc, from Mauricio Vásquez. 9) Fix libbpf to error on conflicting name in BTF when type declaration appears before the definition, from Xu Kuohai. 10) Fix issue in BPF preload for in-kernel light skeleton where loaded BPF program fds prevent init process from setting up fd 0-2, from Yucong Sun. 11) Fix libbpf reuse of pinned perf RB map when max_entries is auto-determined by libbpf, from Stijn Tintel. 12) Several cleanups for libbpf and a fix to enforce perf RB map #pages to be non-zero, from Yuntao Wang. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (32 commits) bpf: Small BPF verifier log improvements libbpf: Add a check to ensure that page_cnt is non-zero bpf, x86: Set header->size properly before freeing it x86: Disable HAVE_ARCH_HUGE_VMALLOC on 32-bit x86 bpf, test_run: Fix overflow in XDP frags bpf_test_finish selftests/bpf: Update btf_dump case for conflicting names libbpf: Skip forward declaration when counting duplicated type names bpf: Add some description about BPF_JIT_ALWAYS_ON in Kconfig bpf, docs: Add a missing colon in verifier.rst bpf: Cache the last valid build_id libbpf: Fix BPF_MAP_TYPE_PERF_EVENT_ARRAY auto-pinning bpf, selftests: Use raw_tp program for atomic test bpf, arm64: Support more atomic operations bpftool: Remove redundant slashes bpf: Add config to allow loading modules with BTF mismatches bpf, arm64: Feed byte-offset into bpf line info bpf, arm64: Call build_prologue() first in first JIT pass bpf: Fix issue with bpf preload module taking over stdout/stdin of kernel. bpftool: Bpf skeletons assert type sizes bpf: Cleanup comments ... ==================== Link: https://lore.kernel.org/r/20220304164313.31675-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit 0564eeb71bbb0e1a566fb701f90155bef9e7a224 Merge: b652de1e3dfb 8d25b7beca7e Author: Paolo Bonzini Date: Fri Mar 4 18:39:29 2022 -0500 Merge branch 'kvm-bugfixes' into HEAD Merge bugfixes from 5.17 before merging more tricky work. commit ea87f1eb4fd81375a3abf564f6f2999561985831 Author: Rob Herring Date: Thu Mar 3 10:57:09 2022 -0600 dt-bindings: arm: Allow 32-bit 'cpu-release-addr' values While the DT Spec says 'cpu-release-addr' is always 64-bit, some 32-bit Arm DTs used a 32-bit value. We're now stuck with those cases, so add uint32 as a valid type. Signed-off-by: Rob Herring Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220303165710.1859862-1-robh@kernel.org Documentation/devicetree/bindings/arm/cpus.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 92c45b63ce22c8898aa41806e8d6692bcd577510 Author: Mark Tomlinson Date: Thu Aug 6 16:14:55 2020 +1200 PCI: Reduce warnings on possible RW1C corruption For hardware that only supports 32-bit writes to PCI there is the possibility of clearing RW1C (write-one-to-clear) bits. A rate-limited messages was introduced by fb2659230120, but rate-limiting is not the best choice here. Some devices may not show the warnings they should if another device has just produced a bunch of warnings. Also, the number of messages can be a nuisance on devices which are otherwise working fine. Change the ratelimit to a single warning per bus. This ensures no bus is 'starved' of emitting a warning and also that there isn't a continuous stream of warnings. It would be preferable to have a warning per device, but the pci_dev structure is not available here, and a lookup from devfn would be far too slow. Suggested-by: Bjorn Helgaas Fixes: fb2659230120 ("PCI: Warn on possible RW1C corruption for sub-32 bit config writes") Link: https://lore.kernel.org/r/20200806041455.11070-1-mark.tomlinson@alliedtelesis.co.nz Signed-off-by: Mark Tomlinson Signed-off-by: Bjorn Helgaas Reviewed-by: Florian Fainelli Reviewed-by: Rob Herring Acked-by: Scott Branden drivers/pci/access.c | 9 ++++++--- include/linux/pci.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) commit 73f7e05609ece4030f2745c4c0c01e0be6889590 Author: Wenpeng Liang Date: Wed Mar 2 14:48:30 2022 +0800 RDMA/hns: Refactor the alloc_cqc() Abstract the alloc_cqc() into several parts and separate the process unrelated to allocating CQC. Link: https://lore.kernel.org/r/20220302064830.61706-10-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_cq.c | 65 +++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 28 deletions(-) commit b65afbd2a05cdc7cff1c0db742b2ed4510d4826f Author: Chengchang Tang Date: Wed Mar 2 14:48:29 2022 +0800 RDMA/hns: Refactor the alloc_srqc() Abstract the alloc_srqc() into several parts and separate the alloc_srqn() from the alloc_srqc(). Link: https://lore.kernel.org/r/20220302064830.61706-9-liangwenpeng@huawei.com Signed-off-by: Chengchang Tang Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_srq.c | 80 +++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 28 deletions(-) commit 904de76c42b7d758e75197f8d532a1ffafc3caad Author: Wenpeng Liang Date: Wed Mar 2 14:48:28 2022 +0800 RDMA/hns: Clean up the return value check of hns_roce_alloc_cmd_mailbox() hns_roce_alloc_cmd_mailbox() never returns NULL, so the check should be IS_ERR(). And the error code should be converted as the function's return value. Link: https://lore.kernel.org/r/20220302064830.61706-8-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++-- drivers/infiniband/hw/hns/hns_roce_mr.c | 6 ++---- drivers/infiniband/hw/hns/hns_roce_srq.c | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) commit cf7f8f5c1c541ece6ec265432c8cf22a6edf067b Author: Chengchang Tang Date: Wed Mar 2 14:48:27 2022 +0800 RDMA/hns: Remove similar code that configures the hardware contexts Remove duplicate code for creating and destroying hardware contexts via mailbox. Link: https://lore.kernel.org/r/20220302064830.61706-7-liangwenpeng@huawei.com Signed-off-by: Chengchang Tang Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_cmd.c | 12 ++++++++++++ drivers/infiniband/hw/hns/hns_roce_cmd.h | 5 +++++ drivers/infiniband/hw/hns/hns_roce_cq.c | 8 ++++---- drivers/infiniband/hw/hns/hns_roce_device.h | 2 -- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++-- drivers/infiniband/hw/hns/hns_roce_mr.c | 29 ++++++++--------------------- drivers/infiniband/hw/hns/hns_roce_srq.c | 20 ++++---------------- 7 files changed, 35 insertions(+), 45 deletions(-) commit 162e29feabba9232a07af5fb07b6b9ae4717d512 Author: Chengchang Tang Date: Wed Mar 2 14:48:26 2022 +0800 RDMA/hns: Refactor mailbox functions The current mailbox functions have too many parameters, making the code difficult to maintain. So construct a new structure mbox_msg to pass the information needed by mailbox. Link: https://lore.kernel.org/r/20220302064830.61706-6-liangwenpeng@huawei.com Signed-off-by: Chengchang Tang Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_cmd.c | 73 ++++++++-------- drivers/infiniband/hw/hns/hns_roce_cmd.h | 2 +- drivers/infiniband/hw/hns/hns_roce_cq.c | 9 +- drivers/infiniband/hw/hns/hns_roce_device.h | 14 +++- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 111 ++++++++++++------------- drivers/infiniband/hw/hns/hns_roce_hw_v2_dfx.c | 4 +- drivers/infiniband/hw/hns/hns_roce_mr.c | 13 +-- drivers/infiniband/hw/hns/hns_roce_srq.c | 6 +- 8 files changed, 120 insertions(+), 112 deletions(-) commit e50cda2b9f840e7a11951421e65a6a779c0aa6f1 Author: Wenpeng Liang Date: Wed Mar 2 14:48:25 2022 +0800 RDMA/hns: Fix the wrong type of parameter "op" of the mailbox The "op" field of the mailbox occupies 8 bits, so the parameter "op" should be of type u8. Link: https://lore.kernel.org/r/20220302064830.61706-5-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_cmd.c | 12 +++++------ drivers/infiniband/hw/hns/hns_roce_cmd.h | 2 +- drivers/infiniband/hw/hns/hns_roce_device.h | 6 +++--- drivers/infiniband/hw/hns/hns_roce_hem.c | 4 ++-- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 33 ++++++++++++++--------------- 5 files changed, 28 insertions(+), 29 deletions(-) commit 479dc93ba75da134e84c1993c9b62caa6f6ccdc6 Author: Wenpeng Liang Date: Wed Mar 2 14:48:24 2022 +0800 RDMA/hns: Remove redundant parameter "mailbox" in the mailbox The parameter "out_param" of the mailbox is always null when the context is destroyed. So remove the function parameter "mailbox". Link: https://lore.kernel.org/r/20220302064830.61706-4-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_device.h | 1 - drivers/infiniband/hw/hns/hns_roce_mr.c | 11 +++++------ drivers/infiniband/hw/hns/hns_roce_srq.c | 6 ++---- 3 files changed, 7 insertions(+), 11 deletions(-) commit 0018ed4bb07feb8b1b2bcb125650db63941c3160 Author: Chengchang Tang Date: Wed Mar 2 14:48:23 2022 +0800 RDMA/hns: Remove fixed parameter “timeout” in the mailbox The value of the function parameter “timeout” is unique. Therefore, it is unnecessary to specify the parameter “timeout” value each time. So remove it. Link: https://lore.kernel.org/r/20220302064830.61706-3-liangwenpeng@huawei.com Signed-off-by: Chengchang Tang Signed-off-by: Haoyue Xu Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_cmd.c | 22 ++++++++-------- drivers/infiniband/hw/hns/hns_roce_cmd.h | 2 +- drivers/infiniband/hw/hns/hns_roce_cq.c | 5 ++-- drivers/infiniband/hw/hns/hns_roce_device.h | 3 +-- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 35 ++++++++++---------------- drivers/infiniband/hw/hns/hns_roce_hw_v2_dfx.c | 3 +-- drivers/infiniband/hw/hns/hns_roce_mr.c | 9 +++---- drivers/infiniband/hw/hns/hns_roce_srq.c | 6 ++--- 8 files changed, 34 insertions(+), 51 deletions(-) commit 5a32949d81ccc80fa6614894fb0a45e2fffb1862 Author: Chengchang Tang Date: Wed Mar 2 14:48:22 2022 +0800 RDMA/hns: Remove the unused parameter "op_modifier" in mailbox The parameter "op_modifier" is only used for HIP06. It is useless for HIP08 and later versions. After removing HIP06, this parameter is no longer used, so remove it. Link: https://lore.kernel.org/r/20220302064830.61706-2-liangwenpeng@huawei.com Signed-off-by: Chengchang Tang Signed-off-by: Haoyue Xu Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hns/hns_roce_cmd.c | 36 ++++++++++---------------- drivers/infiniband/hw/hns/hns_roce_cmd.h | 3 +-- drivers/infiniband/hw/hns/hns_roce_cq.c | 4 +-- drivers/infiniband/hw/hns/hns_roce_device.h | 2 +- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 26 +++++++++---------- drivers/infiniband/hw/hns/hns_roce_hw_v2_dfx.c | 2 +- drivers/infiniband/hw/hns/hns_roce_mr.c | 6 ++--- drivers/infiniband/hw/hns/hns_roce_srq.c | 4 +-- 8 files changed, 37 insertions(+), 46 deletions(-) commit 75853406fa27961044e7dc03c7dc8544477e81f5 Author: Samuel Holland Date: Sun Feb 13 22:22:59 2022 -0600 power: supply: Add a driver for Injoinic power bank ICs This driver supports several chip variants which all share the same I2C register interface. Since the chip will turn off and become inaccessible under conditions outside of software control (e.g. upon button press or input voltage removal), some special handling is needed to delay the initialization of the IC until it is accessible. Signed-off-by: Samuel Holland Signed-off-by: Sebastian Reichel MAINTAINERS | 5 + drivers/power/supply/Kconfig | 8 + drivers/power/supply/Makefile | 1 + drivers/power/supply/ip5xxx_power.c | 638 ++++++++++++++++++++++++++++++++++++ 4 files changed, 652 insertions(+) commit 78eb753ea1d76356245ef8c008be70fbbac3f19d Author: Samuel Holland Date: Sun Feb 13 22:22:58 2022 -0600 dt-bindings: trivial-devices: Add Injoinic power bank ICs Some Injoinic power bank ICs feature an I2C interface which allows monitoring and controlling the battery charger and boost converter. Acked-by: Rob Herring Signed-off-by: Samuel Holland Signed-off-by: Sebastian Reichel Documentation/devicetree/bindings/trivial-devices.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) commit 14ea3e701c9599374bab4dc78002bd4a2757be23 Author: Samuel Holland Date: Sun Feb 13 22:22:57 2022 -0600 dt-bindings: vendor-prefixes: Add Injoinic Add prefix for Injoinic Technology Corp. (http://www.injoinic.com/) Acked-by: Rob Herring Signed-off-by: Samuel Holland Signed-off-by: Sebastian Reichel Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) commit 7c4a539ec38f4ce400a0f3fcb5ff6c940fcd67bb Author: Yajun Deng Date: Thu Mar 3 10:42:32 2022 +0800 RDMA/core: Fix ib_qp_usecnt_dec() called when error ib_destroy_qp() would called by ib_create_qp_user() if error, the former contains ib_qp_usecnt_dec(), but ib_qp_usecnt_inc() was not called before. So move ib_qp_usecnt_inc() into create_qp(). Fixes: d2b10794fc13 ("RDMA/core: Create clean QP creations interface for uverbs") Link: https://lore.kernel.org/r/20220303024232.2847388-1-yajun.deng@linux.dev Signed-off-by: Yajun Deng Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe drivers/infiniband/core/uverbs_cmd.c | 1 - drivers/infiniband/core/uverbs_std_types_qp.c | 1 - drivers/infiniband/core/verbs.c | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) commit c17f2a53c3f4936d46db0e811366ef030783e9f3 Author: Souptick Joarder (HPE) Date: Tue Mar 1 10:58:50 2022 +0530 power: supply: ab8500: Remove unused variable Kernel test robot reported below warning -> drivers/power/supply/ab8500_chargalg.c:790:13: warning: variable 'delta_i_ua' set but not used [-Wunused-but-set-variable] Remove unused variable delta_i_ua. Reported-by: kernel test robot Signed-off-by: Souptick Joarder (HPE) Signed-off-by: Sebastian Reichel drivers/power/supply/ab8500_chargalg.c | 3 --- 1 file changed, 3 deletions(-) commit b135e324d7a2e7fa0a7ef925076136e799b79f44 Author: Mike Marciniszyn Date: Tue Feb 8 14:25:09 2022 -0500 IB/hfi1: Allow larger MTU without AIP The AIP code signals the phys_mtu in the following query_port() fragment: props->phys_mtu = HFI1_CAP_IS_KSET(AIP) ? hfi1_max_mtu : ib_mtu_enum_to_int(props->max_mtu); Using the largest MTU possible should not depend on AIP. Fix by unconditionally using the hfi1_max_mtu value. Fixes: 6d72344cf6c4 ("IB/ipoib: Increase ipoib Datagram mode MTU's upper limit") Link: https://lore.kernel.org/r/1644348309-174874-1-git-send-email-mike.marciniszyn@cornelisnetworks.com Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Jason Gunthorpe drivers/infiniband/hw/hfi1/verbs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit e6824196f81f9a159a9473aaa5b0ed782d905745 Author: Yang Li Date: Tue Mar 1 16:16:19 2022 +0800 power: supply: da9150-fg: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq_byname() already prints an error. Eliminate the follow coccicheck warning: ./drivers/power/supply/da9150-fg.c:524:2-9: line 524 is redundant because platform_get_irq() already prints an error Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Adam Thomson Signed-off-by: Sebastian Reichel drivers/power/supply/da9150-fg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 8652b62ee6f157ceba66dc3fe3a4afbac3b0a0f5 Author: Colin Ian King Date: Wed Mar 2 13:08:32 2022 +0000 power: supply: ab8500: fix a handful of spelling mistakes There are a few spelling mistakes in comments and in a dev_err error message. Fix them. Signed-off-by: Colin Ian King Signed-off-by: Sebastian Reichel drivers/power/supply/ab8500_chargalg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 1ae4a91c923220b96c81e4a116595f4060f65c7f Author: Linus Walleij Date: Tue Mar 1 13:42:54 2022 +0100 power: supply: ab8500_fg: Account for line impedance We add the line impedance to the inner resistance determined from the battery voltage or other means to improve the capacity estimations. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel drivers/power/supply/ab8500_fg.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 8dc355748a7cb4b374d1296bdd68f66c18aced9e Author: Linus Walleij Date: Tue Mar 1 13:42:53 2022 +0100 dt-bindings: power: supply: ab8500_fg: Add line impedance To improve the inner resistance measurement of the battery we need to account for the line impedance of the connector to the battery. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Acked-by: Rob Herring Signed-off-by: Sebastian Reichel .../devicetree/bindings/power/supply/stericsson,ab8500-fg.yaml | 5 +++++ 1 file changed, 5 insertions(+) commit 4f084810ec26f3b7f58294cfa4e6028b1827f5fe Author: Yihao Han Date: Tue Mar 1 18:34:51 2022 -0800 power: supply: axp20x_usb_power: fix platform_get_irq.cocci warnings Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Signed-off-by: Yihao Han Signed-off-by: Sebastian Reichel drivers/power/supply/axp20x_usb_power.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 99dcda8d1f6afa824cdb8ffc3ffa15ef530f6d83 Author: Yihao Han Date: Thu Mar 3 04:27:19 2022 -0800 power: supply: axp20x_ac_power: fix platform_get_irq.cocci warning Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Signed-off-by: Yihao Han Signed-off-by: Sebastian Reichel drivers/power/supply/axp20x_ac_power.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 6dee930f6f6776d1e5a7edf542c6863b47d9f078 Author: Jiasheng Jiang Date: Thu Mar 3 17:43:22 2022 +0800 power: supply: wm8350-power: Add missing free in free_charger_irq In free_charger_irq(), there is no free for 'WM8350_IRQ_CHG_FAST_RDY'. Therefore, it should be better to add it in order to avoid the memory leak. Fixes: 14431aa0c5a4 ("power_supply: Add support for WM8350 PMU") Signed-off-by: Jiasheng Jiang Acked-by: Charles Keepax Signed-off-by: Sebastian Reichel drivers/power/supply/wm8350_power.c | 1 + 1 file changed, 1 insertion(+) commit b0b14b5ba11bec56fad344a4a0b2e16449cc8b94 Author: Jiasheng Jiang Date: Fri Mar 4 09:57:51 2022 +0800 power: supply: wm8350-power: Handle error for wm8350_register_irq As the potential failure of the wm8350_register_irq(), it should be better to check it and return error if fails. Also, use 'free_' in order to avoid same code. Fixes: 14431aa0c5a4 ("power_supply: Add support for WM8350 PMU") Signed-off-by: Jiasheng Jiang Acked-by: Charles Keepax Signed-off-by: Sebastian Reichel drivers/power/supply/wm8350_power.c | 96 +++++++++++++++++++++++++++++++------ 1 file changed, 82 insertions(+), 14 deletions(-) commit c8aee3f41cb84a9ac3b6b5ba2e92cda6cf50d0a0 Author: Linus Walleij Date: Sat Feb 26 00:28:00 2022 +0100 power: supply: Static data for Samsung batteries If we detect a Samsung SDI battery, we return a static struct power_supply_battery_info and avoid looking further. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel drivers/power/supply/Kconfig | 6 + drivers/power/supply/Makefile | 1 + drivers/power/supply/power_supply_core.c | 63 +- drivers/power/supply/samsung-sdi-battery.c | 918 +++++++++++++++++++++++++++++ drivers/power/supply/samsung-sdi-battery.h | 13 + 5 files changed, 974 insertions(+), 27 deletions(-) commit 5f9ffe89803387078c3b253970795fa7ed447f18 Author: Rob Clark Date: Thu Mar 3 16:52:17 2022 -0800 drm/msm/a6xx: Zap counters across context switch Any app controlled perfcntr collection (GL_AMD_performance_monitor, etc) does not require counters to maintain state across context switches. So clear them if systemwide profiling is not active. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220304005317.776110-5-robdclark@gmail.com drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) commit 90f45c42d7d7b0ec0fd797485c07fc421c474e12 Author: Rob Clark Date: Thu Mar 3 16:52:16 2022 -0800 drm/msm: Add SYSPROF param (v2) Add a SYSPROF param for system profiling tools like Mesa's pps-producer (perfetto) to control behavior related to system-wide performance counter collection. In particular, for profiling, one wants to ensure that GPU context switches do not effect perfcounter state, and might want to suppress suspend (which would cause counters to lose state). v2: Swap the order in msm_file_private_set_sysprof() [sboyd] and initialize the sysprof_active refcount to one (because the under/ overflow checking in refcount_t doesn't expect a 0->1 transition) meaning that values greater than 1 means sysprof is active. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220304005317.776110-4-robdclark@gmail.com drivers/gpu/drm/msm/adreno/adreno_gpu.c | 4 ++++ drivers/gpu/drm/msm/msm_drv.c | 8 +++++++ drivers/gpu/drm/msm/msm_gpu.c | 2 ++ drivers/gpu/drm/msm/msm_gpu.h | 27 +++++++++++++++++++++++ drivers/gpu/drm/msm/msm_submitqueue.c | 39 +++++++++++++++++++++++++++++++++ include/uapi/drm/msm_drm.h | 1 + 6 files changed, 81 insertions(+) commit f7ddbf5581b474fe4a0a29244acaa1bf72234675 Author: Rob Clark Date: Thu Mar 3 16:52:15 2022 -0800 drm/msm: Add SET_PARAM ioctl It was always expected to have a use for this some day, so we left a placeholder. Now we do. (And I expect another use in the not too distant future when we start allowing userspace to allocate GPU iova.) Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220304005317.776110-3-robdclark@gmail.com drivers/gpu/drm/msm/adreno/a2xx_gpu.c | 1 + drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 1 + drivers/gpu/drm/msm/adreno/a4xx_gpu.c | 1 + drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 1 + drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 1 + drivers/gpu/drm/msm/adreno/adreno_gpu.c | 10 ++++++++++ drivers/gpu/drm/msm/adreno/adreno_gpu.h | 2 ++ drivers/gpu/drm/msm/msm_drv.c | 20 ++++++++++++++++++++ drivers/gpu/drm/msm/msm_gpu.h | 2 ++ include/uapi/drm/msm_drm.h | 27 +++++++++++++++------------ 10 files changed, 54 insertions(+), 12 deletions(-) commit 57cfe41c5f50aaad92942ff9947c6cee54b9d314 Author: Rob Clark Date: Thu Mar 3 16:52:14 2022 -0800 drm/msm: Update generated headers Update headers from mesa commit: commit 7e63fa2bb13cf14b765ad06d046789ee1879b5ef Author: Rob Clark AuthorDate: Wed Mar 2 17:11:10 2022 -0800 freedreno/registers: Add a couple regs we need for kernel Signed-off-by: Rob Clark Part-of: Signed-off-by: Rob Clark [for display bits:] Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20220304005317.776110-2-robdclark@gmail.com drivers/gpu/drm/msm/adreno/a2xx.xml.h | 26 +- drivers/gpu/drm/msm/adreno/a3xx.xml.h | 30 +- drivers/gpu/drm/msm/adreno/a4xx.xml.h | 112 +++- drivers/gpu/drm/msm/adreno/a5xx.xml.h | 63 ++- drivers/gpu/drm/msm/adreno/a6xx.xml.h | 674 +++++++++++++++--------- drivers/gpu/drm/msm/adreno/a6xx_gmu.xml.h | 26 +- drivers/gpu/drm/msm/adreno/adreno_common.xml.h | 31 +- drivers/gpu/drm/msm/adreno/adreno_pm4.xml.h | 46 +- drivers/gpu/drm/msm/disp/mdp4/mdp4.xml.h | 37 +- drivers/gpu/drm/msm/disp/mdp5/mdp5.xml.h | 37 +- drivers/gpu/drm/msm/disp/mdp_common.xml.h | 37 +- drivers/gpu/drm/msm/dsi/dsi.xml.h | 37 +- drivers/gpu/drm/msm/dsi/dsi_phy_10nm.xml.h | 37 +- drivers/gpu/drm/msm/dsi/dsi_phy_14nm.xml.h | 37 +- drivers/gpu/drm/msm/dsi/dsi_phy_20nm.xml.h | 37 +- drivers/gpu/drm/msm/dsi/dsi_phy_28nm.xml.h | 37 +- drivers/gpu/drm/msm/dsi/dsi_phy_28nm_8960.xml.h | 37 +- drivers/gpu/drm/msm/dsi/dsi_phy_5nm.xml.h | 480 ----------------- drivers/gpu/drm/msm/dsi/dsi_phy_7nm.xml.h | 43 +- drivers/gpu/drm/msm/dsi/mmss_cc.xml.h | 37 +- drivers/gpu/drm/msm/dsi/sfpb.xml.h | 37 +- drivers/gpu/drm/msm/hdmi/hdmi.xml.h | 37 +- drivers/gpu/drm/msm/hdmi/qfprom.xml.h | 37 +- 23 files changed, 894 insertions(+), 1118 deletions(-) commit 13d4ef0f66b7ee9415e101e213acaf94a0cb28ee Author: Christoph Hellwig Date: Thu Mar 3 14:19:05 2022 +0300 floppy: use memcpy_{to,from}_bvec Use the helpers instead of open coding them. Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220303111905.321089-11-hch@lst.de Signed-off-by: Jens Axboe drivers/block/floppy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 3eddaa60b8411c135d1c71090dea9b59ff3f2e26 Author: Christoph Hellwig Date: Thu Mar 3 14:19:04 2022 +0300 drbd: use bvec_kmap_local in recv_dless_read Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220303111905.321089-10-hch@lst.de Signed-off-by: Jens Axboe drivers/block/drbd/drbd_receiver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 472278508dce25316e806e45778658c3e4b353b3 Author: Christoph Hellwig Date: Thu Mar 3 14:19:03 2022 +0300 drbd: use bvec_kmap_local in drbd_csum_bio Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220303111905.321089-9-hch@lst.de Signed-off-by: Jens Axboe drivers/block/drbd/drbd_worker.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 07fee7aba5472d0e65345146a68b4bd1a8b656c3 Author: Christoph Hellwig Date: Thu Mar 3 14:19:02 2022 +0300 bcache: use bvec_kmap_local in bio_csum Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220303111905.321089-8-hch@lst.de Signed-off-by: Jens Axboe drivers/md/bcache/request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3205190655ea56ea5e00815eeff4dab2bde0af80 Author: Christoph Hellwig Date: Thu Mar 3 14:19:01 2022 +0300 nvdimm-btt: use bvec_kmap_local in btt_rw_integrity Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220303111905.321089-7-hch@lst.de Signed-off-by: Jens Axboe drivers/nvdimm/btt.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit 20072ec828640b7d23a0cfdbccf0dea48e77ba3e Author: Christoph Hellwig Date: Thu Mar 3 14:19:00 2022 +0300 nvdimm-blk: use bvec_kmap_local in nd_blk_rw_integrity Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220303111905.321089-6-hch@lst.de Signed-off-by: Jens Axboe drivers/nvdimm/blk.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit bd3d3203eb84d08a6daef805efe9316b79d3bf3c Author: Christoph Hellwig Date: Thu Mar 3 14:18:59 2022 +0300 zram: use memcpy_from_bvec in zram_bvec_write Use memcpy_from_bvec instead of open coding the logic. Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220303111905.321089-5-hch@lst.de Signed-off-by: Jens Axboe drivers/block/zram/zram_drv.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit b3bd0a8a74ab970cc1cf0849e66bd0906741105b Author: Christoph Hellwig Date: Thu Mar 3 14:18:58 2022 +0300 zram: use memcpy_to_bvec in zram_bvec_read Use the proper helper instead of open coding the copy. Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Link: https://lore.kernel.org/r/20220303111905.321089-4-hch@lst.de Signed-off-by: Jens Axboe drivers/block/zram/zram_drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit b7ab4611b6c793100197abc93e069d6f9aab7960 Author: Christoph Hellwig Date: Thu Mar 3 14:18:57 2022 +0300 aoe: use bvec_kmap_local in bvcpy Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220303111905.321089-3-hch@lst.de Signed-off-by: Jens Axboe drivers/block/aoe/aoecmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 143a70b8b4300faa92ad82468f65dccd440e7957 Author: Christoph Hellwig Date: Thu Mar 3 14:18:56 2022 +0300 iss-simdisk: use bvec_kmap_local in simdisk_submit_bio Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit. Signed-off-by: Christoph Hellwig Reviewed-by: Ira Weiny Acked-by: Max Filippov Link: https://lore.kernel.org/r/20220303111905.321089-2-hch@lst.de Signed-off-by: Jens Axboe arch/xtensa/platforms/iss/simdisk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3a9cf77b60dc9839b6674943bb7c9dcd524b6294 Author: Artem Bityutskiy Date: Wed Mar 2 10:16:00 2022 +0200 intel_idle: add core C6 optimization for SPR Add a Sapphire Rapids Xeon C6 optimization, similar to what we have for Sky Lake Xeon: if package C6 is disabled, adjust C6 exit latency and target residency to match core C6 values, instead of using the default package C6 values. Signed-off-by: Artem Bityutskiy Signed-off-by: Rafael J. Wysocki drivers/idle/intel_idle.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit da0e58c038e60e7e65d30813ebdfe91687aa8a24 Author: Artem Bityutskiy Date: Wed Mar 2 10:15:59 2022 +0200 intel_idle: add 'preferred_cstates' module argument On Sapphire Rapids Xeon (SPR) the C1 and C1E states are basically mutually exclusive - only one of them can be enabled. By default, 'intel_idle' driver enables C1 and disables C1E. However, some users prefer to use C1E instead of C1, because it saves more energy. This patch adds a new module parameter ('preferred_cstates') for enabling C1E and disabling C1. Here is the idea behind it. 1. This option has effect only for "mutually exclusive" C-states like C1 and C1E on SPR. 2. It does not have any effect on independent C-states, which do not require other C-states to be disabled (most states on most platforms as of today). 3. For mutually exclusive C-states, the 'intel_idle' driver always has a reasonable default, such as enabling C1 on SPR by default. On other platforms, the default may be different. 4. Users can override the default using the 'preferred_cstates' parameter. 5. The parameter accepts the preferred C-states bit-mask, similarly to the existing 'states_off' parameter. 6. This parameter is not limited to C1/C1E, and leaves room for supporting other mutually exclusive C-states, if they come in the future. Today 'intel_idle' can only be compiled-in, which means that on SPR, in order to disable C1 and enable C1E, users should boot with the following kernel argument: intel_idle.preferred_cstates=4 Signed-off-by: Artem Bityutskiy Signed-off-by: Rafael J. Wysocki drivers/idle/intel_idle.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) commit 9edf3c0ffef0ec1bed8300315852b5c6a0997130 Author: Artem Bityutskiy Date: Wed Mar 2 10:15:58 2022 +0200 intel_idle: add SPR support Add Sapphire Rapids Xeon support. Up until very recently, the C1 and C1E C-states were independent, but this has changed in some new chips, including Sapphire Rapids Xeon (SPR). In these chips the C1 and C1E states cannot be enabled at the same time. The "C1E promotion" bit in 'MSR_IA32_POWER_CTL' also has its semantics changed a bit. Here are the C1, C1E, and "C1E promotion" bit rules on Xeons before SPR. 1. If C1E promotion bit is disabled. a. C1 requests end up with C1 C-state. b. C1E requests end up with C1E C-state. 2. If C1E promotion bit is enabled. a. C1 requests end up with C1E C-state. b. C1E requests end up with C1E C-state. Here are the C1, C1E, and "C1E promotion" bit rules on Sapphire Rapids Xeon. 1. If C1E promotion bit is disabled. a. C1 requests end up with C1 C-state. b. C1E requests end up with C1 C-state. 2. If C1E promotion bit is enabled. a. C1 requests end up with C1E C-state. b. C1E requests end up with C1E C-state. Before SPR Xeon, the 'intel_idle' driver was disabling C1E promotion and was exposing C1 and C1E as independent C-states. But on SPR, C1 and C1E cannot be enabled at the same time. This patch adds both C1 and C1E states. However, C1E is marked as with the "CPUIDLE_FLAG_UNUSABLE" flag, which means that in won't be registered by default. The C1E promotion bit will be cleared, which means that by default only C1 and C6 will be registered on SPR. The next patch will add an option for enabling C1E and disabling C1 on SPR. Signed-off-by: Artem Bityutskiy Signed-off-by: Rafael J. Wysocki drivers/idle/intel_idle.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) commit 48e9fbd1a28480caf2ac5ec6fcb79ac221735c5d Author: Christian König Date: Tue Mar 1 15:13:15 2022 +0100 drm/amdgpu: initialize the vmid_wait with the stub fence This way we don't need to check for NULL any more. Signed-off-by: Christian König Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) commit 6103b2f24e4a9716ca3f5de654964f2a083086be Author: Christian König Date: Tue Mar 1 09:57:41 2022 +0100 drm/amdgpu: properly embed the IBs into the job We now have standard macros for that. Signed-off-by: Christian König Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 7 +------ drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 6 ++++-- 2 files changed, 5 insertions(+), 8 deletions(-) commit cdc7893fc93f1969038ed333b33eac1452c8d255 Author: Christian König Date: Tue Mar 1 09:51:58 2022 +0100 drm/amdgpu: use job and ib structures directly in CS parsers Instead of providing the ib index provide the job and ib pointers directly to the patch and parse functions for UVD and VCE. Also move the set/get functions for IB values to the IB declerations. Signed-off-by: Christian König Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.h | 13 ---- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 23 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 36 +++++----- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 116 ++++++++++++++++--------------- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h | 7 +- drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 13 ++-- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 25 ++++--- 9 files changed, 130 insertions(+), 114 deletions(-) commit a190f8dc4aaf6064527bb81c07f7cff1904dc927 Author: Christian König Date: Mon Feb 21 13:51:17 2022 +0100 drm/amdgpu: header cleanup No function change, just move a bunch of definitions from amdgpu.h into separate header files. Signed-off-by: Christian König Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu.h | 95 ------------------------ drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.h | 93 +++++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_job.h | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 35 +++++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_trace_points.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 1 + drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 1 + 10 files changed, 132 insertions(+), 100 deletions(-) commit 8c7442f026d2e36e1185b9dd79db51601d875b7b Author: Jingwen Chen Date: Wed Mar 2 17:44:38 2022 +0800 drm/amd/amdgpu: set disabled vcn to no_schduler [Why] after the reset domain introduced, the sched.ready will be init after hw_init, which will overwrite the setup in vcn hw_init, and lead to vcn ib test fail. [How] set disabled vcn to no_scheduler Fixes: 5fd8518d187ed0 ("drm/amdgpu: Move scheduler init to after XGMI is ready") Signed-off-by: Jingwen Chen Acked-by: Andrey Grodzovsky Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 2 ++ 1 file changed, 2 insertions(+) commit d18b8eadd83e3d8d63a45f9479478640dbcfca02 Author: Christian König Date: Wed Feb 23 14:35:31 2022 +0100 drm/amdgpu: install ctx entities with cmpxchg Since we removed the context lock we need to make sure that not two threads are trying to install an entity at the same time. Signed-off-by: Christian König Fixes: 461fa7b0ac565e ("drm/amdgpu: remove ctx->lock") Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit b664a56e8626264276ee27edf949e748f6be52de Author: Yifan Zhang Date: Thu Mar 3 15:51:43 2022 +0800 drm/amdkfd: implement get_atc_vmid_pasid_mapping_info for gfx10.3 This patch implements get_atc_vmid_pasid_mapping_info for gfx10.3 Signed-off-by: Yifan Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) commit c8b0507f40deea3d5014b5b4989b6a06ffedde70 Author: Yifan Zhang Date: Thu Mar 3 15:57:38 2022 +0800 drm/amdkfd: judge get_atc_vmid_pasid_mapping_info before call Fix the NULL point issue: [ 3076.255609] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 3076.255624] #PF: supervisor instruction fetch in kernel mode [ 3076.255637] #PF: error_code(0x0010) - not-present page [ 3076.255649] PGD 0 P4D 0 [ 3076.255660] Oops: 0010 [#1] SMP NOPTI [ 3076.255669] CPU: 20 PID: 2415 Comm: kfdtest Tainted: G W OE 5.11.0-41-generic #45~20.04.1-Ubuntu [ 3076.255691] Hardware name: AMD Splinter/Splinter-RPL, BIOS VS2326337N.FD 02/07/2022 [ 3076.255706] RIP: 0010:0x0 [ 3076.255718] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. [ 3076.255732] RSP: 0018:ffffb64283e3fc10 EFLAGS: 00010297 [ 3076.255744] RAX: 0000000000000000 RBX: 0000000000000008 RCX: 0000000000000027 [ 3076.255759] RDX: ffffb64283e3fc1e RSI: 0000000000000008 RDI: ffff8c7a87f60000 [ 3076.255776] RBP: ffffb64283e3fc78 R08: ffff8c7d88518ac0 R09: ffffb64283e3fa60 [ 3076.255791] R10: 0000000000000001 R11: 0000000000000001 R12: 000000000000000f [ 3076.255805] R13: ffff8c7bdcea5800 R14: ffff8c7a9f3f3000 R15: ffff8c7a8696bc00 [ 3076.255820] FS: 0000000000000000(0000) GS:ffff8c7d88500000(0000) knlGS:0000000000000000 [ 3076.255839] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3076.255851] CR2: ffffffffffffffd6 CR3: 0000000109e3c000 CR4: 0000000000750ee0 [ 3076.255866] PKRU: 55555554 [ 3076.255873] Call Trace: [ 3076.255884] dbgdev_wave_reset_wavefronts+0x72/0x160 [amdgpu] [ 3076.256025] process_termination_cpsch.cold+0x26/0x2f [amdgpu] [ 3076.256182] ? ktime_get_mono_fast_ns+0x4e/0xa0 [ 3076.256196] kfd_process_dequeue_from_all_devices+0x49/0x70 [amdgpu] [ 3076.256328] kfd_process_notifier_release+0x187/0x2b0 [amdgpu] [ 3076.256451] ? mn_itree_inv_end+0xdc/0x110 [ 3076.256463] __mmu_notifier_release+0x74/0x1f0 [ 3076.256474] exit_mmap+0x170/0x200 [ 3076.256484] ? __handle_mm_fault+0x677/0x920 [ 3076.256496] ? _cond_resched+0x19/0x30 [ 3076.256507] mmput+0x5d/0x130 [ 3076.256518] do_exit+0x332/0xaf0 [ 3076.256526] ? handle_mm_fault+0xd7/0x2b0 [ 3076.256537] do_group_exit+0x43/0xa0 [ 3076.256548] __x64_sys_exit_group+0x18/0x20 [ 3076.256559] do_syscall_64+0x38/0x90 [ 3076.256569] entry_SYSCALL_64_after_hwframe+0x44/0xa9 Signed-off-by: Yifan Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) commit 11eb648d014eb9e80bf553004551dd6694dfb5a0 Author: Ruijing Dong Date: Wed Mar 2 15:19:22 2022 -0500 drm/amdgpu/vcn: Add vcn firmware log vcn fwlog is for debugging purpose only, by default, it is disabled. Signed-off-by: Ruijing Dong Reviewed-by: Leo Liu Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 10 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 122 +++++++++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 4 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 7 ++ drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 4 + drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 3 + drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 3 + 9 files changed, 163 insertions(+), 1 deletion(-) commit b6065ebf55ff2fe3dae98e7cedb6ec4aa3c33f91 Author: Ruijing Dong Date: Wed Mar 2 13:52:49 2022 -0500 drm/amdgpu/vcn: Update fw shared data structure Add fw log in fw shared data structure. Reviewed-by: Leo Liu Signed-off-by: Ruijing Dong Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 14 +++++++++----- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 26 ++++++++++++++++++++++++-- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 18 +++++++++--------- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 18 +++++++++--------- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 20 ++++++++++---------- 5 files changed, 61 insertions(+), 35 deletions(-) commit 811c04dbb3dc43304b35688d4009117e28c1e9ce Author: David Yu Date: Wed Mar 2 21:45:11 2022 -0500 drm/amdgpu: Add DFC CAP support for aldebaran Add DFC CAP support for aldebaran Initialize cap microcode in psp_init_sriov_microcode, the ta microcode will be initialized in psp_vxx_init_microcode Signed-off-by: David Yu Reviewed-by: Shaoyun.liu Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) commit 24bf9fd19740df5aedb3bc801206f81dcb4acc4f Author: Harish Kasiviswanathan Date: Sun Feb 20 17:46:49 2022 -0500 drm/amdgpu: Set correct DMA mask for aldebaran Aldebaran has 48-bit physical address support Reviewed-by: Felix Kuehling Signed-off-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 9e08564727fc7770b30715fb81348aee54fa50c3 Author: Lijo Lazar Date: Fri Feb 25 14:54:13 2022 +0530 drm/amdgpu: Refactor mode2 reset logic for v13.0.2 Use IP version and refactor reset logic to apply to a list of devices. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/aldebaran.c | 66 +++++++++++++++++++++++-------- drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 8 ++-- 2 files changed, 54 insertions(+), 20 deletions(-) commit 90d282582aa709eeadaf33db71e92718c9471e31 Author: Aric Cyr Date: Sun Feb 20 20:45:59 2022 -0500 drm/amd/display: 3.2.175 drm/amd/display: 3.2.175 This version brings along following fixes: - Remove invalid RDPCS Programming in DAL - Make functional resource functions non-static - Reset VIC if HDMI_VIC is present - Add frame alternate 3D & restrict HW packed on dongles - Reg to turn on/off PSR Power seq in FSM - Modify plane removal sequence to avoid hangs - Pass HostVM enable flag into DCN3.1 DML - DC Validation failures - Program OPP before ODM - Refactor fixed VS w/a for PHY tests - Pass deep sleep disabled allow info to dmub fw - Refine the EDID override - [FW Promotion] Release 0.0.106.0 - Add verify_link_cap back for hdmi Acked-by: Alan Liu Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 493a7508d737a03b620bb0806e222bd39a9ebca0 Author: Charlene Liu Date: Sun Feb 20 19:02:20 2022 -0500 drm/amd/display: add verify_link_cap back for hdmi [why] hdmi specific: add verify link cap after retrive link cap. Reviewed-by: Alvin Lee Acked-by: Alan Liu Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 36b362f5af1ee23ef502b519c2a8e2d273b2f156 Author: Anthony Koo Date: Sun Feb 20 11:37:09 2022 -0500 drm/amd/display: [FW Promotion] Release 0.0.106.0 Acked-by: Alan Liu Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 575d0df6dae46f1b5d26a35ce0ccbc5aafd40e1d Author: jinzh Date: Thu Feb 10 22:50:06 2022 +0800 drm/amd/display: refine the EDID override [Why] We already get the SBIOS EDID via ACPI on KMD, but after that, we just use the monitor EDID to set it HDR caps [How] Make the SBIOS EDID override to read_edid() That can change the read EDID caps from the right EDID Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: jinzh Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dm_helpers.h | 3 +++ 1 file changed, 3 insertions(+) commit 5f5d08b7eb0ab09700b22bec2adcecb8a1de1120 Author: Robin Chen Date: Thu Feb 17 19:19:22 2022 +0800 drm/amd/display: Pass deep sleep disabled allow info to dmub fw [Why] The deep sleep mode need to be disabled in some PSR scenario. Reviewed-by: Anthony Koo Acked-by: Alan Liu Signed-off-by: Robin Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dc.h | 1 + 1 file changed, 1 insertion(+) commit 7a1bae874b5ec07ac97f02018dfad73fb9bae567 Author: George Shen Date: Thu Feb 17 16:01:15 2022 -0500 drm/amd/display: Refactor fixed VS w/a for PHY tests [Why/How] Refactor original w/a to unify naming and simplify logic. This also re-enables the code that was previously skipped due to the disabling of the previous workaround logic. Reviewed-by: Wenjing Liu Reviewed-by: Nevenko Stupar Acked-by: Alan Liu Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) commit f70b88b994a35755f1a065ba4b43d2ad4b401e15 Author: Wesley Chalmers Date: Tue Feb 8 18:12:49 2022 -0500 drm/amd/display: Program OPP before ODM [WHY] HW expects OPP to be configured before ODM is enabled. Failure to do so can cause errors. Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: Wesley Chalmers Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher .../amd/display/dc/dce110/dce110_hw_sequencer.c | 49 +++++++++++----------- 1 file changed, 25 insertions(+), 24 deletions(-) commit 863fa85e6a01c8b239009825dd9de1f64d7d020a Author: Michael Strauss Date: Wed Feb 16 17:01:18 2022 -0500 drm/amd/display: Pass HostVM enable flag into DCN3.1 DML [WHY] Calculations differ with HostVM enabled/disabled, causing underflow in configs with high refresh displays + scaling due to lower available BW [HOW] Check riommu_active in order to pass correct HostVM enablement to DML Reviewed-by: Nicholas Kazlauskas Acked-by: Alan Liu Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 1 + 1 file changed, 1 insertion(+) commit b4060db9251f919506e4d672737c6b8ab9a84701 Author: Douglas Anderson Date: Wed Feb 23 08:34:48 2022 -0800 PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend() The PM Runtime docs say: Drivers in ->remove() callback should undo the runtime PM changes done in ->probe(). Usually this means calling pm_runtime_disable(), pm_runtime_dont_use_autosuspend() etc. From grepping code, it's clear that many people aren't aware of the need to call pm_runtime_dont_use_autosuspend(). When brainstorming solutions, one idea that came up was to leverage the new-ish devm_pm_runtime_enable() function. The idea here is that: * When the devm action is called we know that the driver is being removed. It's the perfect time to undo the use_autosuspend. * The code of pm_runtime_dont_use_autosuspend() already handles the case of being called when autosuspend wasn't enabled. Suggested-by: Laurent Pinchart Signed-off-by: Douglas Anderson Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki drivers/base/power/runtime.c | 5 +++++ include/linux/pm_runtime.h | 4 ++++ 2 files changed, 9 insertions(+) commit 0d6356d6cdd0afeb546f4e8ca653748a8ec3ba26 Author: Wan Jiabing Date: Mon Feb 28 11:16:56 2022 +0800 docs: fix 'make htmldocs' warning in perf Fix following 'make htmldocs' warnings: ./Documentation/admin-guide/perf/hisi-pcie-pmu.rst: WARNING: document isn't included in any toctree Fixes: c8602008e247 ("docs: perf: Add description for HiSilicon PCIe PMU driver") Signed-off-by: Wan Jiabing Reviewed-by: John Garry Link: https://lore.kernel.org/r/20220228031700.1669086-1-wanjiabing@vivo.com Signed-off-by: Jonathan Corbet Documentation/admin-guide/perf/index.rst | 1 + 1 file changed, 1 insertion(+) commit 7f8e249dccc4c530cf26c2c091f5bb64e701c262 Author: Jaegeuk Kim Date: Thu Mar 3 13:21:27 2022 -0800 f2fs: introduce F2FS_UNFAIR_RWSEM to support unfair rwsem Unfair rwsem should be used when blk-cg is on. Otherwise, there is regression. FYI, we noticed a -26.7% regression of aim7.jobs-per-min due to commit: commit: e4544b63a7ee49e7fbebf35ece0a6acd3b9617ae ("f2fs: move f2fs to use reader-unfair rwsems") https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master in testcase: aim7 on test machine: 88 threads 2 sockets Intel(R) Xeon(R) Gold 6238M CPU @ 2.10GHz with 128G memory with following parameters: disk: 4BRD_12G md: RAID0 fs: f2fs test: sync_disk_rw load: 100 cpufreq_governor: performance ucode: 0x500320a test-description: AIM7 is a traditional UNIX system level benchmark suite which is used to test and measure the performance of multiuser system. test-url: https://sourceforge.net/projects/aimbench/files/aim-suite7/ Reported-by: kernel test robot Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/Kconfig | 7 +++++++ fs/f2fs/f2fs.h | 10 ++++++++++ 2 files changed, 17 insertions(+) commit 50c63009f6ab37eb78d8b4f9bc606a12b2b46505 Author: Jaegeuk Kim Date: Wed Mar 2 11:39:08 2022 -0800 f2fs: avoid an infinite loop in f2fs_sync_dirty_inodes If one read IO is always failing, we can fall into an infinite loop in f2fs_sync_dirty_inodes. This happens during xfstests/generic/475. [ 142.803335] Buffer I/O error on dev dm-1, logical block 8388592, async page read ... [ 382.887210] submit_bio_noacct+0xdd/0x2a0 [ 382.887213] submit_bio+0x80/0x110 [ 382.887223] __submit_bio+0x4d/0x300 [f2fs] [ 382.887282] f2fs_submit_page_bio+0x125/0x200 [f2fs] [ 382.887299] __get_meta_page+0xc9/0x280 [f2fs] [ 382.887315] f2fs_get_meta_page+0x13/0x20 [f2fs] [ 382.887331] f2fs_get_node_info+0x317/0x3c0 [f2fs] [ 382.887350] f2fs_do_write_data_page+0x327/0x6f0 [f2fs] [ 382.887367] f2fs_write_single_data_page+0x5b7/0x960 [f2fs] [ 382.887386] f2fs_write_cache_pages+0x302/0x890 [f2fs] [ 382.887405] ? preempt_count_add+0x7a/0xc0 [ 382.887408] f2fs_write_data_pages+0xfd/0x320 [f2fs] [ 382.887425] ? _raw_spin_unlock+0x1a/0x30 [ 382.887428] do_writepages+0xd3/0x1d0 [ 382.887432] filemap_fdatawrite_wbc+0x69/0x90 [ 382.887434] filemap_fdatawrite+0x50/0x70 [ 382.887437] f2fs_sync_dirty_inodes+0xa4/0x270 [f2fs] [ 382.887453] f2fs_write_checkpoint+0x189/0x1640 [f2fs] [ 382.887469] ? schedule_timeout+0x114/0x150 [ 382.887471] ? ttwu_do_activate+0x6d/0xb0 [ 382.887473] ? preempt_count_add+0x7a/0xc0 [ 382.887476] kill_f2fs_super+0xca/0x100 [f2fs] [ 382.887491] deactivate_locked_super+0x35/0xa0 [ 382.887494] deactivate_super+0x40/0x50 [ 382.887497] cleanup_mnt+0x139/0x190 [ 382.887499] __cleanup_mnt+0x12/0x20 [ 382.887501] task_work_run+0x64/0xa0 [ 382.887505] exit_to_user_mode_prepare+0x1b7/0x1c0 [ 382.887508] syscall_exit_to_user_mode+0x27/0x50 [ 382.887510] do_syscall_64+0x48/0xc0 [ 382.887513] entry_SYSCALL_64_after_hwframe+0x44/0xae Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/checkpoint.c | 7 +++++++ fs/f2fs/f2fs.h | 5 +++++ 2 files changed, 12 insertions(+) commit 0d2be10b3037c12d68003856b8d6c83d1b80e0c9 Author: Andrew Halaney Date: Thu Feb 24 15:23:12 2022 -0600 Documentation/locking/locktypes: Fix PREEMPT_RT _bh() description With PREEMPT_RT the _bh() version of a spinlock leaves preemption enabled, align the doc to say that instead of the opposite. Reported-by: Leah Leshchinsky Signed-off-by: Andrew Halaney Reviewed-by: Boqun Feng Link: https://lore.kernel.org/r/20220224212312.2601153-1-ahalaney@redhat.com Signed-off-by: Jonathan Corbet Documentation/locking/locktypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit be6692b923355206ab8cd3705d3ef0e0768adb90 Author: Qianggui Song Date: Fri Feb 25 13:52:05 2022 +0800 irqchip/meson-gpio: add select trigger type callback Due to some chips may use different registers and offset, provide a set trigger type call back and add one for old controller. Signed-off-by: Qianggui Song Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220225055207.1048-4-qianggui.song@amlogic.com drivers/irqchip/irq-meson-gpio.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) commit cc311074f681443266ed9f5969a5b5a0e833c5bc Author: Qianggui Song Date: Fri Feb 25 13:52:04 2022 +0800 irqchip/meson-gpio: support more than 8 channels gpio irq Current meson gpio irqchip driver only support 8 channels for gpio irq line, later chips may have more then 8 channels, so need to modify code to support more. Signed-off-by: Qianggui Song Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220225055207.1048-3-qianggui.song@amlogic.com drivers/irqchip/irq-meson-gpio.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) commit d6a3be863dcf8c51ba2d18d8fd47a1fadb1336aa Author: Qianggui Song Date: Fri Feb 25 13:52:03 2022 +0800 dt-bindings: interrupt-controller: New binding for Meson-S4 SoCs Update dt-binding document for GPIO interrupt controller of Meson-S4 SoCs Acked-by: Rob Herring Signed-off-by: Qianggui Song Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220225055207.1048-2-qianggui.song@amlogic.com .../devicetree/bindings/interrupt-controller/amlogic,meson-gpio-intc.txt | 1 + 1 file changed, 1 insertion(+) commit 19e7bf836997f37b7c70cf8f3091e76b79769673 Author: Suman Anna Date: Wed Feb 16 13:42:24 2022 +0530 remoteproc: wkup_m3: Set sysfs_read_only flag The Wakeup M3 remote processor is controlled by the wkup_m3_ipc client driver, so set the newly introduced 'sysfs_read_only' flag to not allow any overriding of the remoteproc firmware, state, recovery, or coredump from userspace. Signed-off-by: Suman Anna Signed-off-by: Puranjay Mohan Link: https://lore.kernel.org/r/20220216081224.9956-3-p-mohan@ti.com Signed-off-by: Mathieu Poirier drivers/remoteproc/wkup_m3_rproc.c | 1 + 1 file changed, 1 insertion(+) commit 26c9da51949916b73d995a2c89412c346903273d Author: Puranjay Mohan Date: Wed Feb 16 13:42:23 2022 +0530 remoteproc: Introduce sysfs_read_only flag The remoteproc framework provides sysfs interfaces for changing the firmware name and for starting/stopping a remote processor through the sysfs files 'state' and 'firmware'. The 'coredump' file is used to set the coredump configuration. The 'recovery' sysfs file can also be used similarly to control the error recovery state machine of a remoteproc. These interfaces are currently allowed irrespective of how the remoteprocs were booted (like remoteproc self auto-boot, remoteproc client-driven boot etc). These interfaces can adversely affect a remoteproc and its clients especially when a remoteproc is being controlled by a remoteproc client driver(s). Also, not all remoteproc drivers may want to support the sysfs interfaces by default. Add support to make the remoteproc sysfs files read only by introducing a state flag 'sysfs_read_only' that the individual remoteproc drivers can set based on their usage needs. The default behavior is to allow the sysfs operations as before. Implement attribute_group->is_visible() to make the sysfs entries read only when 'sysfs_read_only' flag is set. Signed-off-by: Puranjay Mohan Link: https://lore.kernel.org/r/20220216081224.9956-2-p-mohan@ti.com Signed-off-by: Mathieu Poirier drivers/remoteproc/remoteproc_sysfs.c | 19 ++++++++++++++++++- include/linux/remoteproc.h | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) commit bf0cd60b7e33cf221fbe1114e4acb2c828b0af0d Author: Takashi Sakamoto Date: Fri Mar 4 21:56:47 2022 +0900 ALSA: firewire-lib: fix uninitialized flag for AV/C deferred transaction AV/C deferred transaction was supported at a commit 00a7bb81c20f ("ALSA: firewire-lib: Add support for deferred transaction") while 'deferrable' flag can be uninitialized for non-control/notify AV/C transactions. UBSAN reports it: kernel: ================================================================================ kernel: UBSAN: invalid-load in /build/linux-aa0B4d/linux-5.15.0/sound/firewire/fcp.c:363:9 kernel: load of value 158 is not a valid value for type '_Bool' kernel: CPU: 3 PID: 182227 Comm: irq/35-firewire Tainted: P OE 5.15.0-18-generic #18-Ubuntu kernel: Hardware name: Gigabyte Technology Co., Ltd. AX370-Gaming 5/AX370-Gaming 5, BIOS F42b 08/01/2019 kernel: Call Trace: kernel: kernel: show_stack+0x52/0x58 kernel: dump_stack_lvl+0x4a/0x5f kernel: dump_stack+0x10/0x12 kernel: ubsan_epilogue+0x9/0x45 kernel: __ubsan_handle_load_invalid_value.cold+0x44/0x49 kernel: fcp_response.part.0.cold+0x1a/0x2b [snd_firewire_lib] kernel: fcp_response+0x28/0x30 [snd_firewire_lib] kernel: fw_core_handle_request+0x230/0x3d0 [firewire_core] kernel: handle_ar_packet+0x1d9/0x200 [firewire_ohci] kernel: ? handle_ar_packet+0x1d9/0x200 [firewire_ohci] kernel: ? transmit_complete_callback+0x9f/0x120 [firewire_core] kernel: ar_context_tasklet+0xa8/0x2e0 [firewire_ohci] kernel: tasklet_action_common.constprop.0+0xea/0xf0 kernel: tasklet_action+0x22/0x30 kernel: __do_softirq+0xd9/0x2e3 kernel: ? irq_finalize_oneshot.part.0+0xf0/0xf0 kernel: do_softirq+0x75/0xa0 kernel: kernel: kernel: __local_bh_enable_ip+0x50/0x60 kernel: irq_forced_thread_fn+0x7e/0x90 kernel: irq_thread+0xba/0x190 kernel: ? irq_thread_fn+0x60/0x60 kernel: kthread+0x11e/0x140 kernel: ? irq_thread_check_affinity+0xf0/0xf0 kernel: ? set_kthread_struct+0x50/0x50 kernel: ret_from_fork+0x22/0x30 kernel: kernel: ================================================================================ This commit fixes the bug. The bug has no disadvantage for the non- control/notify AV/C transactions since the flag has an effect for AV/C response with INTERIM (0x0f) status which is not used for the transactions in AV/C general specification. Fixes: 00a7bb81c20f ("ALSA: firewire-lib: Add support for deferred transaction") Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20220304125647.78430-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai sound/firewire/fcp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 6dfbe29f45fb0bde29213dbd754a79e8bfc6ecef Author: Helmut Grohne Date: Sat Feb 26 16:22:56 2022 +0100 Bluetooth: btusb: Add another Realtek 8761BU This device is sometimes wrapped with a label "EDUP". T: Bus=01 Lev=02 Prnt=02 Port=02 Cnt=03 Dev#=107 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2550 ProdID=8761 Rev= 2.00 S: Manufacturer=Realtek S: Product=Bluetooth Radio S: SerialNumber=00E04C239987 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: Helmut Grohne Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1955351 Signed-off-by: Marcel Holtmann drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+) commit 01da346c1802f046496845cccd7c871ca35f24a7 Author: Luca Weiss Date: Fri Feb 25 21:41:38 2022 +0100 Bluetooth: hci_bcm: add BCM43430A0 & BCM43430A1 Add the compatible for BCM43430A0 bluetooth used in lg-lenok and BCM43430A1 used in asus-sparrow. Signed-off-by: Luca Weiss Signed-off-by: Marcel Holtmann drivers/bluetooth/hci_bcm.c | 2 ++ 1 file changed, 2 insertions(+) commit d3715b2333e9a21692ba16ef8645eda584a9515d Author: Minghao Chi (CGEL ZTE) Date: Fri Feb 25 07:41:52 2022 +0000 Bluetooth: use memset avoid memory leaks Use memset to initialize structs to prevent memory leaks in l2cap_ecred_connect Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Signed-off-by: Marcel Holtmann net/bluetooth/l2cap_core.c | 1 + 1 file changed, 1 insertion(+) commit 97f2f2c5317f55ae3440733a090a96a251da222b Author: Yian Chen Date: Tue Mar 1 10:01:59 2022 +0800 iommu/vt-d: Enable ATS for the devices in SATC table Starting from Intel VT-d v3.2, Intel platform BIOS can provide additional SATC table structure. SATC table includes a list of SoC integrated devices that support ATC (Address translation cache). Enabling ATC (via ATS capability) can be a functional requirement for SATC device operation or optional to enhance device performance/functionality. This is determined by the bit of ATC_REQUIRED in SATC table. When IOMMU is working in scalable mode, software chooses to always enable ATS for every device in SATC table because Intel SoC devices in SATC table are trusted to use ATS. On the other hand, if IOMMU is in legacy mode, ATS of SATC capable devices can work transparently to software and be automatically enabled by IOMMU hardware. As the result, there is no need for software to enable ATS on these devices. This also removes dmar_find_matched_atsr_unit() helper as it becomes dead code now. Signed-off-by: Yian Chen Link: https://lore.kernel.org/r/20220222185416.1722611-1-yian.chen@intel.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20220301020159.633356-13-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 40 ++++++++++++++++++++++++++++++++++++++-- include/linux/intel-iommu.h | 1 - 2 files changed, 38 insertions(+), 3 deletions(-) commit b897a1b7ad3f239fa19ee40aec429e96f5162669 Author: YueHaibing Date: Tue Mar 1 10:01:58 2022 +0800 iommu/vt-d: Remove unused function intel_svm_capable() This is unused since commit 4048377414162 ("iommu/vt-d: Use iommu_sva_alloc(free)_pasid() helpers"). Signed-off-by: YueHaibing Link: https://lore.kernel.org/r/20220216113851.25004-1-yuehaibing@huawei.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20220301020159.633356-12-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/svm.c | 5 ----- 1 file changed, 5 deletions(-) commit 45967ffb9e50aa3472cc6c69a769ef0f09cced5d Author: Marco Bonelli Date: Tue Mar 1 10:01:57 2022 +0800 iommu/vt-d: Add missing "__init" for rmrr_sanity_check() rmrr_sanity_check() calls arch_rmrr_sanity_check(), which is marked as "__init". Add the annotation for rmrr_sanity_check() too. This function is currently only called from dmar_parse_one_rmrr() which is also "__init". Signed-off-by: Marco Bonelli Link: https://lore.kernel.org/r/20220210023141.9208-1-marco@mebeim.net Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20220301020159.633356-11-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2852631d96a643e0b21a9b14ad38caf465d7225f Author: Andy Shevchenko Date: Tue Mar 1 10:01:56 2022 +0800 iommu/vt-d: Move intel_iommu_ops to header file Compiler is not happy about hidden declaration of intel_iommu_ops. .../iommu.c:414:24: warning: symbol 'intel_iommu_ops' was not declared. Should it be static? Move declaration to header file to make compiler happy. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220207141240.8253-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20220301020159.633356-10-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/dmar.c | 2 -- include/linux/intel-iommu.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) commit 2187a57ef0c572bcca3ab2497cfcfce664ddbf70 Author: Lu Baolu Date: Tue Mar 1 10:01:55 2022 +0800 iommu/vt-d: Fix indentation of goto labels Remove blanks before goto labels. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220214025704.3184654-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220301020159.633356-9-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 782861df7dcd67b7fed47f3b6b9bf40851760c6f Author: Lu Baolu Date: Tue Mar 1 10:01:54 2022 +0800 iommu/vt-d: Remove unnecessary prototypes Some prototypes in iommu.c are unnecessary. Delete them. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220214025704.3184654-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220301020159.633356-8-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 5 ----- 1 file changed, 5 deletions(-) commit 763e656c693771d2190bc6c6010e71f403e47301 Author: Lu Baolu Date: Tue Mar 1 10:01:53 2022 +0800 iommu/vt-d: Remove unnecessary includes Remove unnecessary include files and sort the remaining alphabetically. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220214025704.3184654-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220301020159.633356-7-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) commit 586081d3f6b13ec9dfdfdf3d7842a688b376fa5e Author: Lu Baolu Date: Tue Mar 1 10:01:52 2022 +0800 iommu/vt-d: Remove DEFER_DEVICE_DOMAIN_INFO Allocate and set the per-device iommu private data during iommu device probe. This makes the per-device iommu private data always available during iommu_probe_device() and iommu_release_device(). With this changed, the dummy DEFER_DEVICE_DOMAIN_INFO pointer could be removed. The wrappers for getting the private data and domain are also cleaned. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220214025704.3184654-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220301020159.633356-6-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/debugfs.c | 3 +- drivers/iommu/intel/iommu.c | 186 +++++++++++++++--------------------------- drivers/iommu/intel/pasid.c | 12 +-- drivers/iommu/intel/svm.c | 6 +- include/linux/intel-iommu.h | 2 - 5 files changed, 79 insertions(+), 130 deletions(-) commit ee2653bbe89df777e222ec1aa015c2ed7ea06b6b Author: Lu Baolu Date: Tue Mar 1 10:01:51 2022 +0800 iommu/vt-d: Remove domain and devinfo mempool The domain and devinfo memory blocks are only allocated during device probe and released during remove. There's no hot-path context, hence no need for memory pools. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220214025704.3184654-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220301020159.633356-5-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 104 +++----------------------------------------- 1 file changed, 5 insertions(+), 99 deletions(-) commit c8850a6e6d71e2f95cfe1eae8c8dd195dd05b950 Author: Lu Baolu Date: Tue Mar 1 10:01:50 2022 +0800 iommu/vt-d: Remove iova_cache_get/put() These have been done in drivers/iommu/dma-iommu.c. Remove this duplicate code. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220214025704.3184654-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220301020159.633356-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 5 ----- 1 file changed, 5 deletions(-) commit c5d27545fb2f3810c1ee192f4f3e0822172fa474 Author: Lu Baolu Date: Tue Mar 1 10:01:49 2022 +0800 iommu/vt-d: Remove finding domain in dmar_insert_one_dev_info() The Intel IOMMU driver has already converted to use default domain framework in iommu core. There's no need to find a domain for the device in the domain attaching path. Cleanup that code. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220214025704.3184654-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220301020159.633356-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 21 --------------------- 1 file changed, 21 deletions(-) commit 402e6688a7df482cc57be0b0dd5b443d995073fb Author: Lu Baolu Date: Tue Mar 1 10:01:48 2022 +0800 iommu/vt-d: Remove intel_iommu::domains The "domains" field of the intel_iommu structure keeps the mapping of domain_id to dmar_domain. This information is not used anywhere. Remove and cleanup it to avoid unnecessary memory consumption. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20220214025704.3184654-1-baolu.lu@linux.intel.com Link: https://lore.kernel.org/r/20220301020159.633356-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel drivers/iommu/intel/iommu.c | 68 ++------------------------------------------- include/linux/intel-iommu.h | 1 - 2 files changed, 3 insertions(+), 66 deletions(-) commit 067e95fc34f017c66e1711f3a08098d59ad4da1a Merge: f266c11bce79 5b61343b5059 Author: Joerg Roedel Date: Fri Mar 4 16:46:19 2022 +0100 Merge branch 'core' into x86/vt-d commit eb3f05179a27b98f99e590bf2164582113f23f7e Author: Yake Yang Date: Wed Feb 23 07:56:00 2022 +0800 Bluetooth: btmtksdio: Fix kernel oops when sdio suspend. Do not kfree the skb when the skb failed to send with __hci_cmd_sync 2435.241210] Call trace: [ 2435.241224] kfree_skb+0x20/0x140 [ 2435.241240] btmtksdio_sdio_wakeup+0x8c/0xcc [ 2435.241360] hci_suspend_notifier+0x108/0x184 [ 2435.241377] notifier_call_chain_robust+0x58/0xd8 [ 2435.241390] blocking_notifier_call_chain_robust+0x54/0x84 [ 2435.241402] pm_notifier_call_chain_robust+0x2c/0x4c [ 2435.241414] suspend_prepare+0x40/0x238 [ 2435.241425] enter_state+0xec/0x3a8 [ 2435.241436] pm_suspend+0x60/0xcc [ 2435.241446] state_store+0xb8/0x114 [ 2435.241460] kobj_attr_store+0x18/0x2c [ 2435.241473] sysfs_kf_write+0x44/0x58 [ 2435.241486] kernfs_fop_write_iter+0xf4/0x190 [ 2435.241500] vfs_write+0x2b0/0x2e4 [ 2435.241511] ksys_write+0x80/0xec [ 2435.241523] __arm64_sys_write+0x24/0x30 [ 2435.241538] el0_svc_common+0xf0/0x1d8 [ 2435.241550] do_el0_svc_compat+0x28/0x54 [ 2435.241564] el0_svc_compat+0x10/0x1c [ 2435.241574] el0_sync_compat_handler+0xa8/0xcc [ 2435.241586] el0_sync_compat+0x188/0x1c0 [ 2435.241606] Code: a9014ff4 910003fd b40002c0 aa0003f3 (b84d4c08) [ 2435.241619] ---[ end trace d496539b850baf14 ]--- Fixes: ce64b3e94919 ("Bluetooth: mt7921s: Support wake on bluetooth") Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Yake Yang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtksdio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c5e25bb585cea7458b173e017309ef6ca22b44ed Author: Yake Yang Date: Wed Feb 23 07:55:59 2022 +0800 Bluetooth: btusb: Add a new PID/VID 13d3/3567 for MT7921 Add VID 13D3 & PID 3567 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=05 Lev=01 Prnt=01 Port=00 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=13d3 ProdID=3567 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 Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Yake Yang Signed-off-by: Marcel Holtmann drivers/bluetooth/btusb.c | 3 +++ 1 file changed, 3 insertions(+) commit 4bd80d7a4039ac605a1e9ae767d2b01dbfc9b61e Author: Niels Dossche Date: Sun Feb 13 00:14:30 2022 +0100 Bluetooth: move adv_instance_cnt read within the device lock The field adv_instance_cnt is always accessed within a device lock, except in the function add_advertising. A concurrent remove of an advertisement with adding another one could result in the if check "if a new instance was actually added" to not trigger, resulting in not triggering the "advertising added event". Signed-off-by: Niels Dossche Signed-off-by: Marcel Holtmann net/bluetooth/mgmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 728abc0151b06b3cb1d084ca2ee7418c3fad89e2 Author: Niels Dossche Date: Wed Feb 9 15:08:51 2022 +0100 Bluetooth: hci_event: Add missing locking on hdev in hci_le_ext_adv_term_evt Both hci_find_adv_instance and hci_remove_adv_instance have a comment above their function definition saying that these two functions require the caller to hold the hdev->lock lock. However, hci_le_ext_adv_term_evt does not acquire that lock and neither does its caller hci_le_meta_evt (hci_le_meta_evt calls hci_le_ext_adv_term_evt via an indirect function call because of the lookup in hci_le_ev_table). The other event handlers all acquire and release the hdev->lock and they follow the rule that hci_find_adv_instance and hci_remove_adv_instance must be called while holding the hdev->lock lock. The solution is to make sure hci_le_ext_adv_term_evt also acquires and releases the hdev->lock lock. The check on ev->status which logs a warning and does an early return is not covered by the lock because other functions also access ev->status without holding the lock. Signed-off-by: Niels Dossche Signed-off-by: Marcel Holtmann net/bluetooth/hci_event.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) commit f95fd5f364839ec48b18b80312ed86bf51908e56 Author: Luiz Augusto von Dentz Date: Thu Mar 3 14:17:07 2022 -0800 Bluetooth: btusb: Make use of of BIT macro to declare flags This makes use of BIT macro when declaring BTUSB flags which makes it understand how many bits are in use and many are left. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann drivers/bluetooth/btusb.c | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) commit 9b392e0e0b6d026da5a62bb79a08f32e27af858e Author: Luiz Augusto von Dentz Date: Thu Mar 3 13:11:57 2022 -0800 Bluetooth: Fix not checking for valid hdev on bt_dev_{info,warn,err,dbg} This fixes attemting to print hdev->name directly which causes them to print an error: kernel: read_version:367: (efault): sock 000000006a3008f2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann include/net/bluetooth/bluetooth.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) commit e4412654e260842e1a94ffe0d4026e8a6fd34246 Author: Sean Wang Date: Wed Feb 9 02:17:41 2022 +0800 Bluetooth: mediatek: fix the conflict between mtk and msft vendor event There is a conflict between MediaTek wmt event and msft vendor extension logic in the core layer since 145373cb1b1f ("Bluetooth: Add framework for Microsoft vendor extension") was introduced because we changed the type of mediatek wmt event to the type of msft vendor event in the driver. But the purpose we reported mediatek event to the core layer is for the diagnostic purpose with that we are able to see the full packet trace via monitoring socket with btmon. Thus, it is harmless we keep the original type of mediatek vendor event here to avoid breaking the msft extension function especially they can be supported by Mediatek chipset like MT7921 , MT7922 devices and future devices. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtk.h | 1 + drivers/bluetooth/btmtksdio.c | 9 +-------- drivers/bluetooth/btusb.c | 8 -------- 3 files changed, 2 insertions(+), 16 deletions(-) commit 8fafe702253d50bf90daf324ae86b5ad5ac8a5e1 Author: Chih-Ying Chiang Date: Wed Feb 9 02:17:40 2022 +0800 Bluetooth: mt7921s: support bluetooth reset mechanism Implement .cmd_timeout to reset the MT7921s device via a dedicated GPIO pin when the firmware hang or the command has no response. Co-developed-by: Mark Chen Signed-off-by: Mark Chen Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Chih-Ying Chiang Signed-off-by: Marcel Holtmann drivers/bluetooth/btmtk.h | 6 +++ drivers/bluetooth/btmtksdio.c | 113 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 118 insertions(+), 1 deletion(-) commit e616fec63f517449e153051b785b1769775562ce Author: Colin Ian King Date: Mon Feb 14 21:51:30 2022 +0000 Bluetooth: make array bt_uuid_any static const Don't populate the read-only array bt_uuid_any 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: Marcel Holtmann net/bluetooth/mgmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit f1b8eea0fa662709fd8f3e32511bafeee99b10b3 Author: Christophe JAILLET Date: Sun Feb 13 22:30:47 2022 +0100 Bluetooth: 6lowpan: No need to clear memory twice 'peer_addr' is a structure embedded in 'struct lowpan_peer'. So there is no need to explicitly call memset(0) on it. It is already zeroed by kzalloc() when 'peer' is allocated. Signed-off-by: Christophe JAILLET Signed-off-by: Marcel Holtmann net/bluetooth/6lowpan.c | 1 - 1 file changed, 1 deletion(-) commit 599ece4f8f073097904d411ee70280a2ec890ad3 Author: Zijun Hu Date: Mon Feb 14 18:43:39 2022 +0800 Bluetooth: btusb: Improve stability for QCA devices WCN6855 2.1 will reset to apply firmware downloaded, so wait a moment for reset done then go ahead to improve stability. Signed-off-by: Zijun Hu Signed-off-by: Marcel Holtmann drivers/bluetooth/btusb.c | 8 ++++++++ 1 file changed, 8 insertions(+) commit 467e98cda80fd2fd966bc21652335643b30dac8f Author: Piotr Dymacz Date: Fri Feb 11 10:31:03 2022 +0100 Bluetooth: btusb: add support for LG LGSBWAC02 (MT7663BUN) The LG LGSBWAC02 (FCC ID: BEJLGSBWAC02) is a combo Wi-Fi/BT module which can be found in several different LG TV models. This module is based on already supported MediaTek MT7663U series. Device from /sys/kernel/debug/usb/devices: T: Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=043e ProdID=310c Rev= 1.00 S: Manufacturer=MediaTek Inc. S: Product=Wireless_Device S: SerialNumber=000000000 C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=100mA A: FirstIf#= 0 IfCount= 2 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= 8 Cls=ff(vend.) Sub=ff Prot=ff Driver=mt7663u E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=08(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=09(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Piotr Dymacz Signed-off-by: Marcel Holtmann drivers/bluetooth/btusb.c | 5 +++++ 1 file changed, 5 insertions(+) commit 2ca57c8099268001f41aa158cac92838daed323e Author: Kiran K Date: Mon Jan 31 22:02:35 2022 +0530 Bluetooth: btusb: Add support for Intel Madison Peak (MsP2) device $ lsusb Bus 003 Device 003: ID 8087:0035 Intel Corp. $ cat /sys/kernel/debug/usb/devices T: Bus=03 Lev=01 Prnt=01 Port=09 Cnt=02 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 2.01 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=8087 ProdID=0035 Rev= 0.00 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=1ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms Signed-off-by: Kiran K Signed-off-by: Marcel Holtmann drivers/bluetooth/btusb.c | 1 + 1 file changed, 1 insertion(+) commit c2b2a1a77f6b2694b7249073083ad6a0c918eef3 Author: Radoslaw Biernacki Date: Tue Feb 1 20:10:33 2022 +0000 Bluetooth: Improve skb handling in mgmt_device_connected() This patch introduce eir_skb_put_data() that can be used to simplify operations on eir in goal of eliminating the necessity of intermediary buffers. eir_skb_put_data() is in pair to what eir_append_data() does with help of eir_len, but without awkwardness when passing return value to skb_put() (as it returns updated offset not size). Signed-off-by: Radoslaw Biernacki Signed-off-by: Luiz Augusto von Dentz net/bluetooth/eir.h | 15 +++++++++++++++ net/bluetooth/mgmt.c | 25 ++++++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) commit ba17bb62ce415950753c19d16bb43b2bd3701158 Author: Radoslaw Biernacki Date: Tue Feb 1 20:10:32 2022 +0000 Bluetooth: Fix skb allocation in mgmt_remote_name() & mgmt_device_connected() This patch fixes skb allocation, as lack of space for ev might push skb tail beyond its end. Also introduce eir_precalc_len() that can be used instead of magic numbers for similar eir operations on skb. Fixes: cf1bce1de7eeb ("Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_FOUND") Fixes: e96741437ef0a ("Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_CONNECTED") Signed-off-by: Angela Czubak Signed-off-by: Marek Maslanka Signed-off-by: Radoslaw Biernacki Signed-off-by: Luiz Augusto von Dentz net/bluetooth/eir.h | 5 +++++ net/bluetooth/mgmt.c | 18 ++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) commit a6fbb2bf51adc117e7d4030e4fd55f0763ab890d Author: Minghao Chi Date: Tue Jan 18 07:50:33 2022 +0000 Bluetooth: mgmt: Remove unneeded variable Return value from mgmt_cmd_complete() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: CGEL ZTE Signed-off-by: Luiz Augusto von Dentz net/bluetooth/mgmt.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 8cd3c55c629efd91e5f2b3e89d850575c5b90d47 Author: Tom Rix Date: Tue Feb 1 09:42:56 2022 -0800 Bluetooth: hci_sync: fix undefined return of hci_disconnect_all_sync() clang static analysis reports this problem hci_sync.c:4428:2: warning: Undefined or garbage value returned to caller return err; ^~~~~~~~~~ If there are no connections this function is a noop but err is never set and a false error could be reported. Return 0 as other hci_* functions do. Fixes: 182ee45da083 ("Bluetooth: hci_sync: Rework hci_suspend_notifier") Signed-off-by: Tom Rix Signed-off-by: Luiz Augusto von Dentz net/bluetooth/hci_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3a0318140a6f8c3ab60f1f46c3f203923cb01882 Author: Changcheng Deng Date: Fri Jan 21 01:35:08 2022 +0000 Bluetooth: mgmt: Replace zero-length array with flexible-array member There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use "flexible array members" for these cases. The older style of one-element or zero-length arrays should no longer be used. Reference: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Luiz Augusto von Dentz include/net/bluetooth/mgmt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f7659f8bcdf86b119d945f3335f20eda219a23ff Author: Marc Zyngier Date: Fri Mar 4 12:04:49 2022 +0000 KVM: arm64: Only open the interrupt window on exit due to an interrupt Now that we properly account for interrupts taken whilst the guest was running, it becomes obvious that there is no need to open this accounting window if we didn't exit because of an interrupt. This saves a number of system register accesses and other barriers if we exited for any other reason (such as a trap, for example). Signed-off-by: Marc Zyngier Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20220304135914.1464721-1-maz@kernel.org arch/arm64/kvm/arm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit b09c68dc57c9d44071d83bb935b733f53ea2b2b4 Author: Sascha Hauer Date: Fri Mar 4 13:52:56 2022 +0100 clk: imx: pll14xx: Support dynamic rates The pll1443x PLL so far only supports rates from a rate table passed during initialization. Calculating PLL settings dynamically helps audio applications to get their desired rates, so support for this is added in this patch. The strategy to get to the PLL setting for a rate is: - First try to only adjust kdiv which specifies the fractional part of the PLL. This setting can be changed without glitches on the output and is therefore preferred - When that isn't possible then the rate table is searched for suitable rates, so for standard rates the same settings are used as without this patch - As a last resort the best settings are calculated dynamically The code in this patch is based on patches from Adrian Alonso and Mads Bligaard Nielsen Signed-off-by: Sascha Hauer Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220304125256.2125023-9-s.hauer@pengutronix.de Signed-off-by: Abel Vesa drivers/clk/imx/clk-pll14xx.c | 143 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 126 insertions(+), 17 deletions(-) commit 80cbc80612a01461a257f2c2eb9976cbadfb7be2 Author: Sascha Hauer Date: Fri Mar 4 13:52:55 2022 +0100 clk: imx: pll14xx: Add pr_fmt Print all messages from within the pll14xx driver with a common prefix using pr_fmt. No need to print function names anymore, so drop them from the messages. Signed-off-by: Sascha Hauer Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220304125256.2125023-8-s.hauer@pengutronix.de Signed-off-by: Abel Vesa drivers/clk/imx/clk-pll14xx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit 5ff50031cb8852bfcf587d003ba6bad3c2336852 Author: Sascha Hauer Date: Fri Mar 4 13:52:54 2022 +0100 clk: imx: pll14xx: explicitly return lowest rate clk_pll14xx_round_rate() returns the lowest rate by indexing into the rate table with the variable i. i is actually pll->rate_count as this is the value we come out of the loop with. Use pll->rate_count explicitly to make it a bit more clear what is being done. While at it fix a typo in the comment. No functional change. Signed-off-by: Sascha Hauer Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220304125256.2125023-7-s.hauer@pengutronix.de Signed-off-by: Abel Vesa drivers/clk/imx/clk-pll14xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 052d03a043afebb8e26ec17de52e8cdc8b217ef9 Author: Sascha Hauer Date: Fri Mar 4 13:52:53 2022 +0100 clk: imx: pll14xx: name variables after usage In clk_pll1443x_set_rate() 'tmp' is used for the content of different registers which makes it a bit hard to follow. Use different variables named after the registers to make it clearer. No functional change intended. Signed-off-by: Sascha Hauer Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220304125256.2125023-6-s.hauer@pengutronix.de Signed-off-by: Abel Vesa drivers/clk/imx/clk-pll14xx.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) commit 53990cf9d5b489fc0ec08e5c4df7139fc311a824 Author: Sascha Hauer Date: Fri Mar 4 13:52:52 2022 +0100 clk: imx: pll14xx: consolidate rate calculation The PLL driver has support for two different PLLs: The pll1416x and the pll1443x. The latter has support for an additional kdiv value. recalc_rate can be the same calculation when kdiv is assumed to be zero for the PLL which doesn't support that value. Signed-off-by: Sascha Hauer Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220304125256.2125023-5-s.hauer@pengutronix.de Signed-off-by: Abel Vesa drivers/clk/imx/clk-pll14xx.c | 59 +++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 33 deletions(-) commit 58f4980ccbecf633df1fcb113e2a9f04842eccc6 Author: Sascha Hauer Date: Fri Mar 4 13:52:51 2022 +0100 clk: imx: pll14xx: Use FIELD_GET/FIELD_PREP Linux has these marvelous FIELD_GET/FIELD_PREP macros for easy access to bitfields in registers. Use them and remove the now unused *_SHIFT defines. Signed-off-by: Sascha Hauer Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220304125256.2125023-4-s.hauer@pengutronix.de Signed-off-by: Abel Vesa drivers/clk/imx/clk-pll14xx.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) commit d77461a616b659bd88dc153e3a86dba5bf78aa8a Author: Sascha Hauer Date: Fri Mar 4 13:52:50 2022 +0100 clk: imx: pll14xx: Drop wrong shifting The code tries to mask the bits in SDIV_MASK from 'tmp'. SDIV_MASK already contains the shifted value, so shifting it again is wrong. No functional change though as SDIV_SHIFT is zero. Signed-off-by: Sascha Hauer Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220304125256.2125023-3-s.hauer@pengutronix.de Signed-off-by: Abel Vesa drivers/clk/imx/clk-pll14xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 485b4ff57c2777c15bfe2e6e6a204200b040e131 Author: Sascha Hauer Date: Fri Mar 4 13:52:49 2022 +0100 clk: imx: pll14xx: Use register defines consistently The driver has defines for the registers, but they are mostly unused. Use the defines consistently throughout the driver. While at it rename DIV_CTL to DIV_CTL0 because that's the name in the reference manual. Signed-off-by: Sascha Hauer Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220304125256.2125023-2-s.hauer@pengutronix.de Signed-off-by: Abel Vesa drivers/clk/imx/clk-pll14xx.c | 49 ++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 24 deletions(-) commit d097cc045b64948ca3048ced4a43cc74eaf641a5 Author: Peng Fan Date: Fri Feb 25 16:17:33 2022 +0800 clk: imx8mp: remove SYS PLL 1/2 clock gates Remove the PLL 1/2 gates as it make AMP clock management harder without obvious benifit. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220225081733.2294166-4-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa drivers/clk/imx/clk-imx8mp.c | 48 +++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 32 deletions(-) commit 38ce00adc16319544c8c56edd36324d2c1b98a50 Author: Peng Fan Date: Fri Feb 25 16:17:32 2022 +0800 clk: imx8mn: remove SYS PLL 1/2 clock gates Remove the PLL 1/2 gates as it make AMP clock management harder without obvious benifit. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220225081733.2294166-3-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa drivers/clk/imx/clk-imx8mn.c | 50 ++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 34 deletions(-) commit d25cbd3e392730f459f1fbf5f959c16b460a59ca Author: Peng Fan Date: Fri Feb 25 16:17:31 2022 +0800 clk: imx8mm: remove SYS PLL 1/2 clock gates Remove the PLL 1/2 gates as it make AMP clock management harder without obvious benifit. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220225081733.2294166-2-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa drivers/clk/imx/clk-imx8mm.c | 49 +++++++++++++++----------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) commit 24defbe194b650218680fcd9dec8cd103537b531 Author: Peng Fan Date: Mon Feb 28 10:09:08 2022 +0800 clk: imx: add i.MX93 clk Add i.MX93 clk driver. i.MX93 clk hardware design is different compared with i.MX8M. It supports 4 sources for each clk root and the sources are separated into a few groups, low speed/fast io/audio and etc. Reviewed-by: Abel Vesa Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220228020908.2810346-6-peng.fan@oss.nxp.com [abel.vesa@nxp.com: Added missing module license and description] Signed-off-by: Abel Vesa drivers/clk/imx/Kconfig | 6 + drivers/clk/imx/Makefile | 2 + drivers/clk/imx/clk-imx93.c | 341 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 349 insertions(+) commit 1b26cb8a77a49d8f8b5b723ef1db4cd6d2434dfc Author: Peng Fan Date: Mon Feb 28 10:09:07 2022 +0800 clk: imx: support fracn gppll This PLL module is a Fractional-N synthesizer, supporting 30-bit numerator and denominator. Numerator is a signed number. It has feature to adjust fractional portion of feedback divider dynamically. This fracn gppll is used in i.MX93. Reviewed-by: Abel Vesa Reviewed-by: Sascha Hauer Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220228020908.2810346-5-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa drivers/clk/imx/Makefile | 1 + drivers/clk/imx/clk-fracn-gppll.c | 323 ++++++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk.h | 21 +++ 3 files changed, 345 insertions(+) commit 11994196178d9038d659c2b9468d7c219b708a37 Author: Peng Fan Date: Mon Feb 28 10:09:06 2022 +0800 clk: imx: add i.MX93 composite clk i.MX93 CCM ROOT clock has a mux, gate and divider in one register, here is to combine all these into one composite clk and simplify clk tree. i.MX93 CCM is a new IP compared with i.MX8M, so introduce a new file. Reviewed-by: Abel Vesa Reviewed-by: Stephen Boyd Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220228020908.2810346-4-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa drivers/clk/imx/Makefile | 1 + drivers/clk/imx/clk-composite-93.c | 93 ++++++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk.h | 9 ++++ 3 files changed, 103 insertions(+) commit 9a45081bb1fd5d15253994fcdbed652a56174d5e Author: Peng Fan Date: Mon Feb 28 10:09:05 2022 +0800 dt-bindings: clock: add i.MX93 clock definition Add i.MX93 clock definition Reviewed-by: Abel Vesa Acked-by: Krzysztof Kozlowski Acked-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220228020908.2810346-3-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa include/dt-bindings/clock/imx93-clock.h | 201 ++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) commit 245830990da69abc913b80af0b43c5cbeb902c5d Author: Peng Fan Date: Mon Feb 28 10:09:04 2022 +0800 dt-bindings: clock: Add imx93 clock support Add the clock dt-binding file for i.MX93. Reviewed-by: Abel Vesa Reviewed-by: Rob Herring Reviewed-by: Stephen Boyd Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20220228020908.2810346-2-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa .../devicetree/bindings/clock/imx93-clock.yaml | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) commit 135efc3a76d127691afaf1864e4ab627bf09d53d Author: Dan Carpenter Date: Mon Feb 28 10:50:14 2022 +0300 clk: imx: off by one in imx_lpcg_parse_clks_from_dt() The > needs to be >= to prevent an off by one access. Fixes: d5f1e6a2bb61 ("clk: imx: imx8qxp-lpcg: add parsing clocks from device tree") Reported-by: kernel test robot Signed-off-by: Dan Carpenter Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20220228075014.GD13685@kili Signed-off-by: Abel Vesa drivers/clk/imx/clk-imx8qxp-lpcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8cf0e06a72306d30e1a01b2b68ab362036757d32 Author: Abel Vesa Date: Tue Feb 22 10:21:40 2022 +0200 dt-bindings: fsl: scu: add imx8dxl scu clock support Add imx8dxl scu clock support. Signed-off-by: Abel Vesa Acked-by: Rob Herring Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20220222082140.2073629-1-abel.vesa@nxp.com Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 1 + 1 file changed, 1 insertion(+) commit eccac77ede3946c90143447cdc785dc16aec4b24 Author: Abel Vesa Date: Thu Jan 27 16:10:52 2022 +0200 clk: imx7d: Remove audio_mclk_root_clk The audio_mclk_root_clk was added as a gate with the CCGR121 (0x4790), but according to the reference manual, there is no such gate. The CCGR121 belongs to ECSPI2 and it is not shared. Fixes: 8f6d8094b215b57 ("ARM: imx: add imx7d clk tree support") Reported-by: David Wolfe Signed-off-by: Abel Vesa Reviewed-by: Peng Fan Link: https://lore.kernel.org/r/20220127141052.1900174-2-abel.vesa@nxp.com drivers/clk/imx/clk-imx7d.c | 1 - 1 file changed, 1 deletion(-) commit 8e6958c80ead0f9891c9db6f64841050f63785ba Merge: 92877b9e7433 1e364921b008 Author: Marc Zyngier Date: Fri Mar 4 14:37:32 2022 +0000 Merge branch irq/misc-5.18 into irq/irqchip-next * irq/misc-5.18: : . : Misc irq chip changes for 5.18 : : - GICv3: Relax ordering of previous stores to only include the ISH domain : : - nvic: Unmap MMIo region on probe failure : : - xilinx: Switch to GENERIC_IRQ_MULTI_HANDLER when used on microblaze : . irqchip/xilinx: Switch to GENERIC_IRQ_MULTI_HANDLER irqchip/nvic: Release nvic_base upon failure irqchip/gic-v3: Use dsb(ishst) to order writes with ICC_SGI1R_EL1 accesses Signed-off-by: Marc Zyngier commit 92877b9e7433c5fb98d31c18af6e873509be1f2e Merge: 0c8b522d3e3f 098fdbc3531f Author: Marc Zyngier Date: Fri Mar 4 14:37:22 2022 +0000 Merge branch irq/plic-cleanups into irq/irqchip-next * irq/plic-cleanups: : . : SiFive PLIC cleanups from Niklas Cassel: : : - Clarify some of the namings in the driver : : - Make sure S-mode interrupts are disabled when running in M-mode : . irqchip/sifive-plic: Disable S-mode IRQs if running in M-mode irqchip/sifive-plic: Improve naming scheme for per context offsets Signed-off-by: Marc Zyngier commit 1e364921b0085780153b1d03640ca41e1be83e8b Author: Michal Simek Date: Fri Mar 4 08:51:29 2022 +0100 irqchip/xilinx: Switch to GENERIC_IRQ_MULTI_HANDLER Register the Xilinx driver as the root interrupt controller using the GENERIC_IRQ_MULTI_HANDLER API, instead of the arch-specific hack. Signed-off-by: Michal Simek Reviewed-by: Stefan Asserhall [maz: repainted commit message] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/e6c6595a81f662bf839cee3109d0fa58a596ea47.1646380284.git.michal.simek@xilinx.com arch/microblaze/Kconfig | 2 ++ arch/microblaze/include/asm/irq.h | 3 --- arch/microblaze/kernel/irq.c | 16 +--------------- drivers/irqchip/irq-xilinx-intc.c | 30 ++++++++++++++++-------------- 4 files changed, 19 insertions(+), 32 deletions(-) commit 144c4a77a3e1e520daba85eafd28999af22e1aa5 Author: Mario Limonciello Date: Thu Mar 3 07:13:28 2022 -0600 thunderbolt: Rename EEPROM handling bits to match USB4 spec The structure `tb_eeprom_ctl` is used to show the bits accessed when reading/writing EEPROM. As this structure is specified in the USB4 spec as `VSC_CS_4` update the names and use of members to match the specification. This should not change anything functionally. Signed-off-by: Mario Limonciello Signed-off-by: Mika Westerberg drivers/thunderbolt/eeprom.c | 24 ++++++++++++------------ drivers/thunderbolt/tb_regs.h | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) commit 51d4d64c7ce50a501db4688b36448819755ae74d Author: Mario Limonciello Date: Thu Mar 3 07:13:27 2022 -0600 thunderbolt: Clarify register definitions for `tb_cap_plug_events` The USB4 1.0 specification outlines the `cap_plug_events` structure as `VSC_CS_1`. This shows that 4 bits of `VSC_CS_1` are TBT3 compatible in USB4, but TBT3 controllers also support disabling XHCI. Update the names and comments to more closely match the specification. This should not change anything functionally. Signed-off-by: Mario Limonciello Signed-off-by: Mika Westerberg drivers/thunderbolt/tb_regs.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) commit 6915812bbd109787ebdb865561dc9164d4b01f56 Author: Mario Limonciello Date: Thu Mar 3 07:13:26 2022 -0600 thunderbolt: Do not make DROM read success compulsory The USB4 specification doesn't make any requirements that reading a device router's DROM is needed for the operation of the device. Other connection manager solutions don't necessarily read it or gate the usability of the device on whether it was read. So make failures when reading the DROM show warnings but not fail the initialization of the router. Signed-off-by: Mario Limonciello Signed-off-by: Mika Westerberg drivers/thunderbolt/switch.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit a283de3ec646f19b09f3c8e4c8f57c0e017c9b2b Author: Mario Limonciello Date: Thu Mar 3 07:13:25 2022 -0600 thunderbolt: Do not resume routers if UID is not set Routers might not have a UID set if the DROM read failed during initialization previously. Normally upon resume the UID is re-read to confirm it's the same device connected. * If the DROM read failed during init but then succeeded during resume it could either be a new device or faulty device * If the DROM read failed during init and also failed during resume it might be a different device plugged in all together. Detect this situation and prevent re-using the same configuration in these cirucmstances. Signed-off-by: Mario Limonciello Signed-off-by: Mika Westerberg drivers/thunderbolt/switch.c | 4 ++++ 1 file changed, 4 insertions(+) commit e87491a9fd4e33eaf18ef69d8295bb07b31452b2 Author: Mario Limonciello Date: Thu Mar 3 07:13:24 2022 -0600 thunderbolt: Retry DROM reads for more failure scenarios Currently DROM reads are only retried in the case that parsing failed. However if the size or CRC fails, then there should also be a retry. This helps with reading the DROM on TBT3 devices connected to AMD Yellow Carp which will sometimes fail on the first attempt. Signed-off-by: Mario Limonciello Signed-off-by: Mika Westerberg drivers/thunderbolt/eeprom.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) commit 92499dec3aa9c251e605b42e1024e805bbaa50ad Author: Tudor Ambarus Date: Tue Jan 11 15:05:56 2022 +0200 ARM: dts: at91: sama7g5: Add NAND support Add NAND support. The sama7g5's SMC IP is the same as sama5d2's with a slightly change: it provides a synchronous clock output (SMC clock) that is dedicated to FPGA usage. Since this doesn't interfere with the SMC NAND configuration, thus code will not be added in the current nand driver to address the FPGA usage, use the sama5d2's compatible and choose not to introduce dedicated compatibles for sama7g5. Tested with Micron MT29F4G08ABAEAWP NAND flash. Signed-off-by: Tudor Ambarus [nicolas.ferre@microchip.com: add the definition of PMC_MCK1 in include/dt-bindings/clock/at91.h from another patch] Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220111130556.905978-1-tudor.ambarus@microchip.com arch/arm/boot/dts/sama7g5.dtsi | 55 ++++++++++++++++++++++++++++++++++++++++ include/dt-bindings/clock/at91.h | 1 + 2 files changed, 56 insertions(+) commit bf9ad37dc8a30cce22ae95d6c2ca6abf8731d305 Author: Oleg Nesterov Date: Tue Jul 14 14:26:34 2015 +0200 signal, x86: Delay calling signals in atomic on RT enabled kernels On x86_64 we must disable preemption before we enable interrupts for stack faults, int3 and debugging, because the current task is using a per CPU debug stack defined by the IST. If we schedule out, another task can come in and use the same stack and cause the stack to be corrupted and crash the kernel on return. When CONFIG_PREEMPT_RT is enabled, spinlock_t locks become sleeping, and one of these is the spin lock used in signal handling. Some of the debug code (int3) causes do_trap() to send a signal. This function calls a spinlock_t lock that has been converted to a sleeping lock. If this happens, the above issues with the corrupted stack is possible. Instead of calling the signal right away, for PREEMPT_RT and x86, the signal information is stored on the stacks task_struct and TIF_NOTIFY_RESUME is set. Then on exit of the trap, the signal resume code will send the signal when preemption is enabled. [ rostedt: Switched from #ifdef CONFIG_PREEMPT_RT to ARCH_RT_DELAYS_SIGNAL_SEND and added comments to the code. ] [bigeasy: Add on 32bit as per Yang Shi, minor rewording. ] [ tglx: Use a config option ] Signed-off-by: Oleg Nesterov Signed-off-by: Steven Rostedt Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/Ygq5aBB/qMQw6aP5@linutronix.de arch/x86/Kconfig | 1 + include/linux/sched.h | 3 +++ kernel/Kconfig.preempt | 12 +++++++++++- kernel/entry/common.c | 14 ++++++++++++++ kernel/signal.c | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) commit 1039135aedfc5021b4827eb87276d7b4272024ac Author: Jiapeng Chong Date: Fri Mar 4 16:36:53 2022 +0800 net: ethernet: sun: Remove redundant code Since the starting value in the for loop is greater than or equal to 1, the restriction is CAS_FLAG_REG_PLUS is in the file cassini.h is defined as 0x1 by macro, and the for loop and if condition is not satisfied, so the code here is redundant. Clean up the following smatch warning: drivers/net/ethernet/sun/cassini.c:3513 cas_start_dma() warn: we never enter this loop. drivers/net/ethernet/sun/cassini.c:1239 cas_init_rx_dma() warn: we never enter this loop. drivers/net/ethernet/sun/cassini.c:1247 cas_init_rx_dma() warn: we never enter this loop. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: David S. Miller drivers/net/ethernet/sun/cassini.c | 16 ---------------- 1 file changed, 16 deletions(-) commit 844f63f5dba811dab87c8650e011bc914c51f86b Merge: 34fe804e6804 6402528b7a0b Author: David S. Miller Date: Fri Mar 4 13:06:12 2022 +0000 Merge branch 'nfp-AF_XDP-zero-copy' Simon Horman says: ==================== Add AF_XDP zero-copy support for NFP Niklas Söderlund says: This series adds AF_XDP zero-copy support for the NFP driver. The series is based on previous work done by Jakub Kicinski. Patch 1/5 and 2/5 prepares the driver for AF_XDP support by refactoring functions that will act differently once AF_XDP is active or not making the driver easier to read and by preparing some functions to be reused outside the local file scope. Patch 3/5 and 4/5 prepares the driver for dealing the UMEM while finally patch 5/5 adds AF_XDP support. Based on work by Jakub Kicinski. ==================== Signed-off-by: David S. Miller commit 6402528b7a0bf9869aca1f7eed43b809d57f0ae5 Author: Niklas Söderlund Date: Fri Mar 4 11:22:14 2022 +0100 nfp: xsk: add AF_XDP zero-copy Rx and Tx support This patch adds zero-copy Rx and Tx support for AF_XDP sockets. It do so by adding a separate NAPI poll function that is attached to a each channel when the XSK socket is attached with XDP_SETUP_XSK_POOL, and restored when the XSK socket is terminated, this is done per channel. Support for XDP_TX is implemented and the XDP buffer can safely be moved from the Rx to the Tx queue and correctly freed and returned to the XSK pool once it's transmitted. Note that when AF_XDP zero-copy is enabled, the XDP action XDP_PASS will allocate a new buffer and copy the zero-copy frame prior passing it to the kernel stack. This patch is based on previous work by Jakub Kicinski. Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/Makefile | 1 + drivers/net/ethernet/netronome/nfp/nfp_net.h | 31 +- .../net/ethernet/netronome/nfp/nfp_net_common.c | 98 +++- .../net/ethernet/netronome/nfp/nfp_net_debugfs.c | 33 +- drivers/net/ethernet/netronome/nfp/nfp_net_xsk.c | 592 +++++++++++++++++++++ drivers/net/ethernet/netronome/nfp/nfp_net_xsk.h | 29 + 6 files changed, 756 insertions(+), 28 deletions(-) commit 9c91a3653fbb69d07f328edb11380552042f9114 Author: Niklas Söderlund Date: Fri Mar 4 11:22:13 2022 +0100 nfp: xsk: add configuration check for XSK socket chunk size In preparation for adding AF_XDP support add a configuration check to make sure the buffer size can not be set to a larger value then the XSK socket chunk size. Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: David S. Miller .../net/ethernet/netronome/nfp/nfp_net_common.c | 42 +++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) commit 543bd14fc8f64e44437780aaecd0911c718c471a Author: Niklas Söderlund Date: Fri Mar 4 11:22:12 2022 +0100 nfp: xsk: add an array of xsk buffer pools to each data path Each data path needs an array of xsk pools to track if an xsk socket is in use. Add this array and make sure it's handled correctly when the data path is duplicated. Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfp_net.h | 4 ++++ drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 19 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) commit 58eb43635344d5a99ab1316d0e66621fb6a5efef Author: Jakub Kicinski Date: Fri Mar 4 11:22:11 2022 +0100 nfp: wrap napi add/del logic There will be more NAPI register logic once AF_XDP support is added, wrap our already conditional napi add/del into helpers. Signed-off-by: Jakub Kicinski Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: David S. Miller .../net/ethernet/netronome/nfp/nfp_net_common.c | 38 +++++++++++++--------- 1 file changed, 22 insertions(+), 16 deletions(-) commit 3cdb35fb9cd5a03ba882bbce327d26a2eb40d30c Author: Niklas Söderlund Date: Fri Mar 4 11:22:10 2022 +0100 nfp: expose common functions to be used for AF_XDP There are some common functionality that can be reused in the upcoming AF_XDP support. Expose those functions in the header. While at it mark some arguments of nfp_net_rx_csum() as const. Signed-off-by: Niklas Söderlund Signed-off-by: Simon Horman Signed-off-by: David S. Miller drivers/net/ethernet/netronome/nfp/nfp_net.h | 14 ++++++++++++++ drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 16 ++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) commit 34fe804e68049b0b359a7426cee983fdb1d52b7a Merge: a972711d89ae 608111fc580f Author: David S. Miller Date: Fri Mar 4 13:03:10 2022 +0000 Merge branch 'sparx5-ptp' Horatiu Vultur says: ==================== net: sparx5: Add PTP Hardware Clock support Add support for PTP Hardware Clock (PHC) for sparx5. ==================== Signed-off-by: David S. Miller commit 608111fc580fe9a1b9a2a35d5a4f92784274b0d5 Author: Horatiu Vultur Date: Fri Mar 4 12:09:00 2022 +0100 net: sparx5: Implement get_ts_info Implement the function get_ts_info in ethtool_ops which is needed to get the HW capabilities for timestamping. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller .../net/ethernet/microchip/sparx5/sparx5_ethtool.c | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) commit d31d37912ea79f1e47e8c2998eae0109f57dc298 Author: Horatiu Vultur Date: Fri Mar 4 12:08:59 2022 +0100 net: sparx5: Add support for ptp interrupts When doing 2-step timestamping the HW will generate an interrupt when it managed to timestamp a frame. It is the SW responsibility to read it from the FIFO. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller .../net/ethernet/microchip/sparx5/sparx5_main.c | 13 +++ .../net/ethernet/microchip/sparx5/sparx5_main.h | 2 + drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 119 +++++++++++++++++++++ 3 files changed, 134 insertions(+) commit 70dfe25cd8666d1d1518d615283940108bb364e7 Author: Horatiu Vultur Date: Fri Mar 4 12:08:58 2022 +0100 net: sparx5: Update extraction/injection for timestamping Update both the extraction and injection to do timestamping of the frames. The extraction is always doing the timestamping while for injection is doing the timestamping only if it is configured. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller .../net/ethernet/microchip/sparx5/sparx5_fdma.c | 2 + .../net/ethernet/microchip/sparx5/sparx5_main.h | 32 ++++ .../net/ethernet/microchip/sparx5/sparx5_netdev.c | 20 +++ .../net/ethernet/microchip/sparx5/sparx5_packet.c | 29 +++- drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 166 +++++++++++++++++++++ 5 files changed, 248 insertions(+), 1 deletion(-) commit 589a07b8eb49e5293c42cb40100eb9ee02731faf Author: Horatiu Vultur Date: Fri Mar 4 12:08:57 2022 +0100 net: sparx5: Implement SIOCSHWTSTAMP and SIOCGHWTSTAMP Implement the ioctl callbacks SIOCSHWTSTAMP and SIOCGHWTSTAMP to allow to configure the ports to enable/disable timestamping for TX. The RX timestamping is always enabled. The HW is capable to run both 1-step timestamping and 2-step timestamping. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller .../net/ethernet/microchip/sparx5/sparx5_main.h | 9 +++ .../net/ethernet/microchip/sparx5/sparx5_netdev.c | 19 ++++++ drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 74 ++++++++++++++++++++++ 3 files changed, 102 insertions(+) commit 0933bd04047c3b96ba49545a8f91e7e6f8f666ff Author: Horatiu Vultur Date: Fri Mar 4 12:08:56 2022 +0100 net: sparx5: Add support for ptp clocks The sparx5 has 3 PHC. Enable each of them, for now all the timestamping is happening on the first PHC. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller drivers/net/ethernet/microchip/sparx5/Makefile | 3 +- .../net/ethernet/microchip/sparx5/sparx5_main.c | 7 + .../net/ethernet/microchip/sparx5/sparx5_main.h | 21 ++ drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 326 +++++++++++++++++++++ 4 files changed, 356 insertions(+), 1 deletion(-) commit 3193a6118140707c19db5b734f6b2afdbc743e62 Author: Horatiu Vultur Date: Fri Mar 4 12:08:55 2022 +0100 net: sparx5: Add registers that are used by ptp functionality Add the registers that will be used to configure the PHC in the HW. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller .../net/ethernet/microchip/sparx5/sparx5_main.c | 1 + .../ethernet/microchip/sparx5/sparx5_main_regs.h | 335 ++++++++++++++++++++- 2 files changed, 334 insertions(+), 2 deletions(-) commit 6015fb905d89063231ed33bc15be19ef0fc339b8 Author: Horatiu Vultur Date: Fri Mar 4 12:08:54 2022 +0100 dts: sparx5: Enable ptp interrupt Add support for ptp interrupt. This interrupt is used when using 2-step timestamping. For each timestamp that is added in a queue, an interrupt is generated. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller arch/arm64/boot/dts/microchip/sparx5.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit b066ad26ebf2cabcd961eab33910f19a0e79593b Author: Horatiu Vultur Date: Fri Mar 4 12:08:53 2022 +0100 dt-bindings: net: sparx5: Extend with the ptp interrupt Extend dt-bindings for sparx5 with ptp interrupt. This is generated when doing 2-step timestamping and the timestamp can be read from the FIFO. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml | 2 ++ 1 file changed, 2 insertions(+) commit 8f68f53a9325cf4413e262bc28d904a825e5f141 Author: Horatiu Vultur Date: Fri Mar 4 12:08:52 2022 +0100 net: sparx5: Move ifh from port to local variable Currently the ifh is not changed, it is fixed for each frame for each port that is sent out. Move this on the stack because this ifh needs to be change based on the frames that are send out. This is needed for PTP frames. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller drivers/net/ethernet/microchip/sparx5/sparx5_main.h | 2 +- drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c | 3 +-- drivers/net/ethernet/microchip/sparx5/sparx5_packet.c | 8 ++++++-- 3 files changed, 8 insertions(+), 5 deletions(-) commit a972711d89aedf91a52468011651a3b033d7d4b9 Merge: 828553d2c3b0 8a1b415d70b7 Author: David S. Miller Date: Fri Mar 4 12:45:19 2022 +0000 Merge branch 'lan937x-t1-phy-driver' Arun Ramadoss says: ==================== Add support for LAN937x T1 Phy Driver LAN937x is a Multi-port 100Base-T1 Switch and it internally uses LAN87xx T1 Phy. This series of patch update the initialization routine for the LAN87xx phy and also add LAN937x part support. Added the T1 Phy master-slave configuration through ethtool. ==================== Signed-off-by: David S. Miller commit 8a1b415d70b78e002a8f18bf6da99c6d7ec8055b Author: Arun Ramadoss Date: Fri Mar 4 15:14:01 2022 +0530 net: phy: added ethtool master-slave configuration support To configure the T1 phy as master or slave using the ethtool -s master-slave , the config_aneg and read status functions are added. Signed-off-by: Prasanna Vengateshan Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller drivers/net/phy/microchip_t1.c | 90 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) commit 680baca546f23709548c054393536e10a4e38a25 Author: Arun Ramadoss Date: Fri Mar 4 15:14:00 2022 +0530 net: phy: added the LAN937x phy support LAN937x T1 switch is based on LAN87xx Phy, so reusing the init script of the LAN87xx. There is a workaround in accessing the DSP bank register for LAN937x Phy. Whenever there is a bank switch to DSP registers, then we need a one dummy read access before proceeding to the actual register access. Signed-off-by: Prasanna Vengateshan Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller drivers/net/phy/microchip_t1.c | 55 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) commit 8637034bc63f38d631a94c1b8f655291ca81ad3e Author: Arun Ramadoss Date: Fri Mar 4 15:13:59 2022 +0530 net: phy: updated the initialization routine for LAN87xx The new initialization sequence is the improvement to the existing init routine. Init routine does soft reset, run init script and set Hw_init. Added the new access_smi_poll_timeout() for polling smi bank write. Signed-off-by: Prasanna Vengateshan Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller drivers/net/phy/microchip_t1.c | 217 +++++++++++++++++++++++++++++++++-------- 1 file changed, 175 insertions(+), 42 deletions(-) commit ccc8cc5baddea785c6bb584a13a2504b00d490e8 Author: Arun Ramadoss Date: Fri Mar 4 15:13:58 2022 +0530 net: phy: removed empty lines in LAN87XX Removed the empty lines in struct phy_drivers. Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller drivers/net/phy/microchip_t1.c | 4 ---- 1 file changed, 4 deletions(-) commit 79cea9a9c93a42b6f9344a4128c5030df212552c Author: Arun Ramadoss Date: Fri Mar 4 15:13:57 2022 +0530 net: phy: used the PHY_ID_MATCH_MODEL macro for LAN87XX Used the PHY_ID_MATCH_MODEL MACRO for describing the phy_id and phy_id_mask. Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller drivers/net/phy/microchip_t1.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 8eee3d3536268f3f4468dd9e9deeec1492761786 Author: Arun Ramadoss Date: Fri Mar 4 15:13:56 2022 +0530 net: phy: used genphy_soft_reset for phy reset in LAN87xx Replaced the current code of resetting of LAN87xx phy to genphy_soft_reset library function. Signed-off-by: Arun Ramadoss Signed-off-by: David S. Miller drivers/net/phy/microchip_t1.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) commit 828553d2c3b07ec419e6f080c1e74efff31bc774 Merge: 6af3b428cd02 ece19502834d Author: David S. Miller Date: Fri Mar 4 12:43:01 2022 +0000 Merge branch 'lan8814-1588-support' Divya Koppera says: ==================== Add support for 1588 in LAN8814 The following patch series contains: - Fix for concurrent register access, which provides atomic access to extended page register reads/writes. - Provides dt-bindings related to latency and timestamping that are required for LAN8814 phy. - 1588 hardware timestamping support in LAN8814 phy. ==================== Signed-off-by: David S. Miller commit ece19502834d84ece2e056db28257ca2aa6e4d48 Author: Divya Koppera Date: Fri Mar 4 15:04:18 2022 +0530 net: phy: micrel: 1588 support for LAN8814 phy Add support for 1588 in LAN8814 phy driver. It supports 1-step and 2-step timestamping. Co-developed-by: Horatiu Vultur Signed-off-by: Divya Koppera Signed-off-by: David S. Miller drivers/net/phy/micrel.c | 1088 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1066 insertions(+), 22 deletions(-) commit 2358dd3fd325fc9689652f0c8d4a09475dd31b46 Author: Divya Koppera Date: Fri Mar 4 15:04:17 2022 +0530 dt-bindings: net: micrel: Configure latency values and timestamping check for LAN8814 phy Supports configuring latency values and also adds check for phy timestamping feature. Signed-off-by: Divya Koppera Signed-off-by: David S. Miller Documentation/devicetree/bindings/net/micrel.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) commit 4488f6b6148045424459ef1d5b153c6895ee1dbb Author: Divya Koppera Date: Fri Mar 4 15:04:16 2022 +0530 net: phy: micrel: Fix concurrent register access Make Extended page register accessing atomic, to overcome unexpected output from register reads/writes. Fixes: 7c2dcfa295b1 ("net: phy: micrel: Add support for LAN8804 PHY") Signed-off-by: Divya Koppera Signed-off-by: David S. Miller drivers/net/phy/micrel.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) commit 6af3b428cd02b09db79f0ee0265dcb8799d9327c Merge: 9f9919f73c94 6c2728b7c141 Author: David S. Miller Date: Fri Mar 4 12:17:11 2022 +0000 Merge branch 'skb-drop-reasons' Menglong Dong says: ==================== net: dev: add skb drop reasons to net/core/dev.c In the commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()"), we added the support of reporting the reasons of skb drops to kfree_skb tracepoint. And in this series patches, reasons for skb drops are added to the link layer, which means that 'net/core/dev.c' is our target. Following functions are processed: sch_handle_egress() __dev_xmit_skb() enqueue_to_backlog() do_xdp_generic() sch_handle_ingress() __netif_receive_skb_core() and following new drop reasons are added (what they mean can be see in the document of them): SKB_DROP_REASON_QDISC_EGRESS SKB_DROP_REASON_QDISC_DROP SKB_DROP_REASON_CPU_BACKLOG SKB_DROP_REASON_XDP SKB_DROP_REASON_QDISC_INGRESS SKB_DROP_REASON_PTYPE_ABSENT In order to add skb drop reasons to kfree_skb_list(), the function kfree_skb_list_reason() is introduced in the 2th patch, which will be used in __dev_xmit_skb() in the 3th patch. ==================== Signed-off-by: David S. Miller commit 6c2728b7c14164928cb7cb9c847dead101b2d503 Author: Menglong Dong Date: Fri Mar 4 14:00:46 2022 +0800 net: dev: use kfree_skb_reason() for __netif_receive_skb_core() Add reason for skb drops to __netif_receive_skb_core() when packet_type not found to handle the skb. For this purpose, the drop reason SKB_DROP_REASON_PTYPE_ABSENT is introduced. Take ether packets for example, this case mainly happens when L3 protocol is not supported. Signed-off-by: Menglong Dong Signed-off-by: David S. Miller include/linux/skbuff.h | 5 +++++ include/trace/events/skb.h | 1 + net/core/dev.c | 8 +++++--- 3 files changed, 11 insertions(+), 3 deletions(-) commit a568aff26ac03ee9eb1482683514914a5ec3b4c3 Author: Menglong Dong Date: Fri Mar 4 14:00:45 2022 +0800 net: dev: use kfree_skb_reason() for sch_handle_ingress() Replace kfree_skb() used in sch_handle_ingress() with kfree_skb_reason(). Following drop reasons are introduced: SKB_DROP_REASON_TC_INGRESS Signed-off-by: Menglong Dong Signed-off-by: David S. Miller include/linux/skbuff.h | 1 + include/trace/events/skb.h | 1 + net/core/dev.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) commit 7e726ed81e1ddd5fdc431e02b94fcfe2a9876d42 Author: Menglong Dong Date: Fri Mar 4 14:00:44 2022 +0800 net: dev: use kfree_skb_reason() for do_xdp_generic() Replace kfree_skb() used in do_xdp_generic() with kfree_skb_reason(). The drop reason SKB_DROP_REASON_XDP is introduced for this case. Signed-off-by: Menglong Dong Signed-off-by: David S. Miller include/linux/skbuff.h | 1 + include/trace/events/skb.h | 1 + net/core/dev.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) commit 44f0bd40803c0e04f1c8cd59df3c7acce783ae9c Author: Menglong Dong Date: Fri Mar 4 14:00:43 2022 +0800 net: dev: use kfree_skb_reason() for enqueue_to_backlog() Replace kfree_skb() used in enqueue_to_backlog() with kfree_skb_reason(). The skb rop reason SKB_DROP_REASON_CPU_BACKLOG is introduced for the case of failing to enqueue the skb to the per CPU backlog queue. The further reason can be backlog queue full or RPS flow limition, and I think we needn't to make further distinctions. Signed-off-by: Menglong Dong Signed-off-by: David S. Miller include/linux/skbuff.h | 6 ++++++ include/trace/events/skb.h | 1 + net/core/dev.c | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) commit 7faef0547f4c29031a68d058918b031a8e520d49 Author: Menglong Dong Date: Fri Mar 4 14:00:42 2022 +0800 net: dev: add skb drop reasons to __dev_xmit_skb() Add reasons for skb drops to __dev_xmit_skb() by replacing kfree_skb_list() with kfree_skb_list_reason(). The drop reason of SKB_DROP_REASON_QDISC_DROP is introduced for qdisc enqueue fails. Signed-off-by: Menglong Dong Signed-off-by: David S. Miller include/linux/skbuff.h | 4 ++++ include/trace/events/skb.h | 1 + net/core/dev.c | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) commit 215b0f1963d4e34fccac6992b3debe26f78a6eb8 Author: Menglong Dong Date: Fri Mar 4 14:00:41 2022 +0800 net: skb: introduce the function kfree_skb_list_reason() To report reasons of skb drops, introduce the function kfree_skb_list_reason() and make kfree_skb_list() an inline call to it. This function will be used in the next commit in __dev_xmit_skb(). Signed-off-by: Menglong Dong Signed-off-by: David S. Miller include/linux/skbuff.h | 8 +++++++- net/core/skbuff.c | 7 ++++--- 2 files changed, 11 insertions(+), 4 deletions(-) commit 98b4d7a4e7374a44c4afd9f08330e72f6ad0d644 Author: Menglong Dong Date: Fri Mar 4 14:00:40 2022 +0800 net: dev: use kfree_skb_reason() for sch_handle_egress() Replace kfree_skb() used in sch_handle_egress() with kfree_skb_reason(). The drop reason SKB_DROP_REASON_TC_EGRESS is introduced. Considering the code path of tc egerss, we make it distinct with the drop reason of SKB_DROP_REASON_QDISC_DROP in the next commit. Signed-off-by: Menglong Dong Signed-off-by: David S. Miller include/linux/skbuff.h | 1 + include/trace/events/skb.h | 1 + net/core/dev.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) commit 9f9919f73c94ae00af4e6ad45179282122f24988 Merge: 4ee508ff78c8 ad0a043fc26c Author: David S. Miller Date: Fri Mar 4 12:02:19 2022 +0000 Merge branch 'netif_rx' Sebastian Andrzej Siewior says: ==================== net: Convert user to netif_rx(). This is the first batch of converting netif_rx_ni() caller to netif_rx(). The change making this possible is net-next and netif_rx_ni() is a wrapper around netif_rx(). This is a clean up in order to remove netif_rx_ni(). Cc: Andrew Lunn Cc: bridge@lists.linux-foundation.org Cc: Chris Zankel Cc: Florian Fainelli Cc: Horatiu Vultur Cc: Jonathan Corbet Cc: Kurt Kanzenbach Cc: linux-doc@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: Łukasz Stelmach Cc: Max Filippov Cc: Mike Travis Cc: Nikolay Aleksandrov Cc: Robin Holt Cc: Roopa Prabhu Cc: Steve Wahl Cc: UNGLinuxDriver@microchip.com Cc: Vivien Didelot Cc: Vladimir Oltean ==================== Signed-off-by: David S. Miller commit ad0a043fc26c17522ede3cc986d559f05ece20f4 Author: Sebastian Andrzej Siewior Date: Thu Mar 3 18:15:05 2022 +0100 net: dev: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller net/core/dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 2e83bdd5d6cf4cee3204efe4ea6f33f5f743dd8d Author: Sebastian Andrzej Siewior Date: Thu Mar 3 18:15:04 2022 +0100 net: bridge: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: bridge@lists.linux-foundation.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller net/bridge/br_arp_nd_proxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 566214f44697c0191b9b6673e3c73116c9b7817f Author: Sebastian Andrzej Siewior Date: Thu Mar 3 18:15:03 2022 +0100 net: macvlan: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/macvlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 90f77c1c512ffe2e91473658b5eb259b5da04b04 Author: Sebastian Andrzej Siewior Date: Thu Mar 3 18:15:02 2022 +0100 net: ethernet: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Łukasz Stelmach Cc: Horatiu Vultur Cc: UNGLinuxDriver@microchip.com Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/ethernet/asix/ax88796c_main.c | 2 +- drivers/net/ethernet/davicom/dm9051.c | 2 +- drivers/net/ethernet/micrel/ks8851_spi.c | 2 +- drivers/net/ethernet/microchip/enc28j60.c | 2 +- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 2 +- drivers/net/ethernet/qualcomm/qca_spi.c | 2 +- drivers/net/ethernet/qualcomm/qca_uart.c | 2 +- drivers/net/ethernet/vertexcom/mse102x.c | 2 +- drivers/net/ethernet/wiznet/w5100.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) commit db00cc9da079315f199e2b65cc4e05eeb94236e2 Author: Sebastian Andrzej Siewior Date: Thu Mar 3 18:15:01 2022 +0100 net: dsa: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Kurt Kanzenbach Cc: Andrew Lunn Cc: Vivien Didelot Cc: Florian Fainelli Cc: Vladimir Oltean Signed-off-by: Sebastian Andrzej Siewior Acked-by: Kurt Kanzenbach # hellcreek Signed-off-by: David S. Miller drivers/net/dsa/hirschmann/hellcreek_hwtstamp.c | 2 +- drivers/net/dsa/mv88e6xxx/hwtstamp.c | 2 +- drivers/net/dsa/sja1105/sja1105_ptp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit 3fb4430e73bfa58b14606512239c86b4d186f1ea Author: Sebastian Andrzej Siewior Date: Thu Mar 3 18:15:00 2022 +0100 net: caif: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/net/caif/caif_serial.c | 2 +- net/caif/chnl_net.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 4343b866aa941077f7dc1421e57f618b2482d03e Author: Sebastian Andrzej Siewior Date: Thu Mar 3 18:14:59 2022 +0100 net: sgi-xp: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Robin Holt Cc: Steve Wahl Cc: Mike Travis Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller drivers/misc/sgi-xp/xpnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit aa4e5761bff54036a13fba539165033772799beb Author: Sebastian Andrzej Siewior Date: Thu Mar 3 18:14:58 2022 +0100 net: xtensa: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Chris Zankel Cc: Max Filippov Cc: linux-xtensa@linux-xtensa.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Max Filippov Signed-off-by: David S. Miller arch/xtensa/platforms/iss/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 21f95a88eab49eebc70f25f17567aacb9cdafc01 Author: Sebastian Andrzej Siewior Date: Thu Mar 3 18:14:57 2022 +0100 docs: networking: Use netif_rx(). Since commit baebdf48c3600 ("net: dev: Makes sure netif_rx() can be invoked in any context.") the function netif_rx() can be used in preemptible/thread context as well as in interrupt context. Use netif_rx(). Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller Documentation/networking/timestamping.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5f5399843c0ec3bd562dfd533f32e4074ca90314 Author: Tudor Ambarus Date: Mon Feb 28 10:59:06 2022 +0200 ARM: configs: at91: sama7: Unselect CONFIG_DMATEST The DMA test client should be selected only when one is debugging a DMA Device driver. There's no need to select the DMA test client by default, unselect it. Signed-off-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220228085906.18508-1-tudor.ambarus@microchip.com arch/arm/configs/sama7_defconfig | 1 - 1 file changed, 1 deletion(-) commit 3759326db7066e8a097f9399a445de0df73c5f35 Author: Claudiu Beznea Date: Mon Feb 28 14:23:26 2022 +0200 ARM: configs: at91: add eic Add eic. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220228122326.1400954-3-claudiu.beznea@microchip.com arch/arm/configs/sama7_defconfig | 1 + 1 file changed, 1 insertion(+) commit def8abbb1464579c37f15b3d7a95e5f3bab758dc Author: Mihai Sain Date: Wed Mar 2 16:53:29 2022 +0100 ARM: at91: add support in soc driver for new SAMA5D29 Add detection of new SAMA5D29 by the SoC driver. Signed-off-by: Mihai Sain Signed-off-by: Nicolas Ferre Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220302155329.27668-1-nicolas.ferre@microchip.com drivers/soc/atmel/soc.c | 3 +++ drivers/soc/atmel/soc.h | 1 + 2 files changed, 4 insertions(+) commit 003e17e75a3cf40d6ab6bd913e7ff2cdea4612e7 Author: Claudiu Beznea Date: Mon Feb 28 14:23:25 2022 +0200 ARM: dts: at91: sama7g5: add eic node Add EIC node. Signed-off-by: Claudiu Beznea Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220228122326.1400954-2-claudiu.beznea@microchip.com arch/arm/boot/dts/sama7g5.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit cbb92a7717d2e1c512b7e81c6b22c7298b58a881 Author: Tudor Ambarus Date: Wed Mar 2 18:18:54 2022 +0200 ARM: dts: at91: sama7g5: Remove unused properties in i2c nodes The "atmel,use-dma-rx", "atmel,use-dma-rx" dt properties are not used by the i2c-at91 driver, nor they are defined in the bindings file, thus remove them. Cc: stable@vger.kernel.org Fixes: 7540629e2fc7 ("ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek") Signed-off-by: Tudor Ambarus Reviewed-by: Eugen Hristev Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20220302161854.32177-1-tudor.ambarus@microchip.com arch/arm/boot/dts/sama7g5.dtsi | 6 ------ 1 file changed, 6 deletions(-) commit 72a4501b5d089772671360a6ec74d5350acf8c2e Author: Jamie Iles Date: Mon Jan 17 17:48:16 2022 +0000 i3c: support dynamically added i2c devices I2C devices can be added to the system dynamically through several sources other than static board info including device tree overlays and sysfs i2c new_device. Add an I2C bus notifier to attach the clients at runtime if they were not defined in the board info. For DT devices find the LVR in the reg property, for user-space new_device additions we synthesize a conservative setting of no spike filters and fast mode only. Cc: Alexandre Belloni Signed-off-by: Jamie Iles Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220117174816.1963463-3-quic_jiles@quicinc.com drivers/i3c/master.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 127 insertions(+), 1 deletion(-) commit 31b9887c7258ca47d9c665a80f19f006c86756b1 Author: Jamie Iles Date: Mon Jan 17 17:48:15 2022 +0000 i3c: remove i2c board info from i2c_dev_desc I2C board info is only required during adapter setup so there is no requirement to keeping a pointer to it once running. To support dynamic device addition we can't rely on board info - user-space creation through sysfs won't have a boardinfo. Cc: Alexandre Belloni Signed-off-by: Jamie Iles Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220117174816.1963463-2-quic_jiles@quicinc.com drivers/i3c/master.c | 18 ++++++++++-------- include/linux/i3c/master.h | 1 - 2 files changed, 10 insertions(+), 9 deletions(-) commit dd340570a67172e51880e5eac6b8ff1456cf794d Author: Mihai Sain Date: Wed Mar 2 17:02:35 2022 +0100 ARM: dts: at91: sam9x60ek: modify vdd_1v5 regulator to vdd_1v15 This regulator is powering the vddcore pins from MPU. Its real value on the board and in the MPU datasheet is 1.15V. Signed-off-by: Mihai Sain Signed-off-by: Nicolas Ferre Reviewed-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220302160235.28336-1-nicolas.ferre@microchip.com arch/arm/boot/dts/at91-sam9x60ek.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 4f23f6d45821701c68b99c2847a075472b53198c Author: Yong Wu Date: Wed Dec 8 14:07:44 2021 +0200 iommu/mediatek: Always tlb_flush_all when each PM resume Prepare for 2 HWs that sharing pgtable in different power-domains. When there are 2 M4U HWs, it may has problem in the flush_range in which we get the pm_status via the m4u dev, BUT that function don't reflect the real power-domain status of the HW since there may be other HW also use that power-domain. DAM allocation is often done while the allocating device is runtime suspended. In such a case the iommu will also be suspended and partial flushing of the tlb will not be executed. Therefore, we add a tlb_flush_all in the pm_runtime_resume to make sure the tlb is always clean. In other case, the iommu's power should be active via device link with smi. Signed-off-by: Yong Wu [move the call to mtk_iommu_tlb_flush_all to the bottom of resume cb, improve doc/log] Signed-off-by: Dafna Hirschfeld Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211208120744.2415-6-dafna.hirschfeld@collabora.com Signed-off-by: Joerg Roedel drivers/iommu/mtk_iommu.c | 7 +++++++ 1 file changed, 7 insertions(+) commit 15672b6dc5d03a947e9180db1d6564f43b0c6799 Author: Yong Wu Date: Wed Dec 8 14:07:43 2021 +0200 iommu/mediatek: Add tlb_lock in tlb_flush_all The tlb_flush_all touches the registers controlling tlb operations. Protect it with the tlb_lock spinlock. This also require the range_sync func to release that spinlock before calling tlb_flush_all. Signed-off-by: Yong Wu [refactor commit log] Signed-off-by: Dafna Hirschfeld Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211208120744.2415-5-dafna.hirschfeld@collabora.com Signed-off-by: Joerg Roedel drivers/iommu/mtk_iommu.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) commit ad5042ecbe944bd34d0bdd23f3b728a7e92c0e12 Author: Yong Wu Date: Wed Dec 8 14:07:42 2021 +0200 iommu/mediatek: Remove the power status checking in tlb flush all To simplify the code, Remove the power status checking in the tlb_flush_all, remove this: if (pm_runtime_get_if_in_use(data->dev) <= 0) continue; The mtk_iommu_tlb_flush_all is called from a) isr b) tlb flush range fail case c) iommu_create_device_direct_mappings In first two cases, the power and clock are always enabled. In the third case tlb flush is unnecessary because in a later patch in the series a full flush from the pm_runtime_resume callback is added. In addition, writing the tlb control register when the iommu is not resumed is ok and the write is ignored. Signed-off-by: Yong Wu [refactor commit log] Signed-off-by: Dafna Hirschfeld Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211208120744.2415-4-dafna.hirschfeld@collabora.com Signed-off-by: Joerg Roedel drivers/iommu/mtk_iommu.c | 5 ----- 1 file changed, 5 deletions(-) commit 4ea794452ae7220bb02ad950d77d86adcbb86b10 Author: Sebastian Reichel Date: Wed Dec 8 14:07:41 2021 +0200 iommu/mediatek: Always check runtime PM status in tlb flush range callback In case of v4l2_reqbufs() it is possible, that a TLB flush is done without runtime PM being enabled. In that case the "Partial TLB flush timed out, falling back to full flush" warning is printed. Commit c0b57581b73b ("iommu/mediatek: Add power-domain operation") introduced has_pm as optimization to avoid checking runtime PM when there is no power domain attached. But without the PM domain there is still the device driver's runtime PM suspend handler, which disables the clock. Thus flushing should also be avoided when there is no PM domain involved. Signed-off-by: Sebastian Reichel Reviewed-by: Dafna Hirschfeld Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Yong Wu Link: https://lore.kernel.org/r/20211208120744.2415-3-dafna.hirschfeld@collabora.com Signed-off-by: Joerg Roedel drivers/iommu/mtk_iommu.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) commit 17224e08af73fbbc5334226ae75feecb1e037cae Author: Yong Wu Date: Wed Dec 8 14:07:40 2021 +0200 iommu/mediatek: Remove for_each_m4u in tlb_sync_all The tlb_sync_all is called from these three functions: a) flush_iotlb_all: it will be called for each a iommu HW. b) tlb_flush_range_sync: it already has for_each_m4u. c) in irq: When IOMMU HW translation fault, Only need flush itself. Thus, No need for_each_m4u in this tlb_sync_all. Remove it. Signed-off-by: Yong Wu Reviewed-by: Dafna Hirschfeld Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211208120744.2415-2-dafna.hirschfeld@collabora.com Signed-off-by: Joerg Roedel drivers/iommu/mtk_iommu.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) commit 4ee508ff78c83c4bf855148f026315fa58c7baf4 Merge: f2ecfa06afc6 3d5985a185e6 Author: David S. Miller Date: Fri Mar 4 09:45:51 2022 +0000 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-03-03 Jacob Keller says: This series refactors the ice networking driver VF storage from a simple static array to a hash table. It also introduces krefs and proper locking and protection to prevent common use-after-free and concurrency issues. There are two motivations for this work. First is to make the ice driver more resilient by preventing a whole class of use-after-free bugs that can occur around concurrent access to VF structures while removing VFs. The second is to prepare the ice driver for future virtualization work to support Scalable IOV, an alternative VF implementation compared to Single Root IOV. The new VF implementation will allow for more dynamic VF creation and removal, necessitating a more robust implementation for VF storage that can't rely on the existing mechanisms to prevent concurrent access violations. The first few patches are cleanup and preparatory work needed to make the conversion to the hash table safe. Following this preparatory work is a patch to migrate the VF structures and variables to a new sub-structure for code clarity. Next introduce new interface functions to abstract the VF storage. Finally, the driver is actually converted to the hash table and kref implementation. ==================== Signed-off-by: David S. Miller commit 5b61343b50590fb04a3f6be2cdc4868091757262 Author: Robin Murphy Date: Thu Mar 3 14:40:08 2022 +0000 iommu/iova: Improve 32-bit free space estimate For various reasons based on the allocator behaviour and typical use-cases at the time, when the max32_alloc_size optimisation was introduced it seemed reasonable to couple the reset of the tracked size to the update of cached32_node upon freeing a relevant IOVA. However, since subsequent optimisations focused on helping genuine 32-bit devices make best use of even more limited address spaces, it is now a lot more likely for cached32_node to be anywhere in a "full" 32-bit address space, and as such more likely for space to become available from IOVAs below that node being freed. At this point, the short-cut in __cached_rbnode_delete_update() really doesn't hold up any more, and we need to fix the logic to reliably provide the expected behaviour. We still want cached32_node to only move upwards, but we should reset the allocation size if *any* 32-bit space has become available. Reported-by: Yunfei Wang Signed-off-by: Robin Murphy Reviewed-by: Miles Chen Link: https://lore.kernel.org/r/033815732d83ca73b13c11485ac39336f15c3b40.1646318408.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel drivers/iommu/iova.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 06687a03805e29dcf068a8e6436ed2a2bbd8b9e9 Author: Suravee Suthikulpanit Date: Tue Mar 1 14:26:22 2022 +0530 iommu/amd: Improve error handling for amd_iommu_init_pci Add error messages to prevent silent failure. Signed-off-by: Vasant Hegde Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20220301085626.87680-2-vasant.hegde@amd.com Signed-off-by: Joerg Roedel drivers/iommu/amd/init.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) commit f2ecfa06afc692f85e749a219e116acdc6501080 Merge: f9f52c347428 162fbf6a2f95 Author: David S. Miller Date: Fri Mar 4 09:21:24 2022 +0000 Merge branch 'ocelot-felix-cleanups' Vladimir Oltean says: ==================== Cleanups for ocelot/felix drivers This patch set is an assorted collection of minor cleanups brought to the felix DSA driver and ocelot switch library. ==================== Signed-off-by: David S. Miller commit 162fbf6a2f958673cabaa844b5dc0e0b301a757a Author: Vladimir Oltean Date: Thu Mar 3 16:01:26 2022 +0200 net: dsa: felix: remove redundant assignment in felix_8021q_cpu_port_deinit Due to an apparently incorrect conflict resolution on my part in commit 54c319846086 ("net: mscc: ocelot: enforce FDB isolation when VLAN-unaware"), "ocelot->ports[port]->is_dsa_8021q_cpu = false" was supposed to be replaced by "ocelot_port_unset_dsa_8021q_cpu(ocelot, port)" which does the same thing, and more. But now we have both, so the direct assignment is redundant. Remove it. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 1 - 1 file changed, 1 deletion(-) commit 5d3bb7dda43ad22a0caa78b0222beab0462a669e Author: Vladimir Oltean Date: Thu Mar 3 16:01:25 2022 +0200 net: dsa: felix: print error message in felix_check_xtr_pkt() Packet extraction failures over register-based MMIO are silent, and difficult to pinpoint. Add an error message to remedy this. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit dbd032856ba39b6e90d525b7e6340d61a04fcc8f Author: Vladimir Oltean Date: Thu Mar 3 16:01:24 2022 +0200 net: dsa: felix: initialize "err" to 0 in felix_check_xtr_pkt() Automated tools complain that felix_check_xtr_pkt() has logic to drain the CPU queue on the reception of a PTP packet over Ethernet, yet it returns an uninitialized error code in the case where the CPU queue was empty. This is not likely to happen (/possible if hardware works correctly), but it isn't a fatal condition either. The PTP packet will be dequeued from the CPU queue when the next PTP packet arrives. So initialize "err" to 0 for the case where nothing was dequeued during this iteration. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d219b4b674e9424ff047ecc568b79401427ad709 Author: Vladimir Oltean Date: Thu Mar 3 16:01:23 2022 +0200 net: dsa: felix: drop the ptp_type argument from felix_check_xtr_pkt() The DSA ->port_rxtstamp() function is never called for PTP_CLASS_NONE: dsa_skb_defer_rx_timestamp: if (type == PTP_CLASS_NONE) return false; if (likely(ds->ops->port_rxtstamp)) return ds->ops->port_rxtstamp(ds, p->dp->index, skb, type); So practically, the argument is unused, so remove it. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 28c1305b0b721166912189afd6238c1613bb7891 Author: Vladimir Oltean Date: Thu Mar 3 16:01:22 2022 +0200 net: dsa: felix: remove ocelot->npi assignment from felix_8021q_cpu_port_init This assignment is redundant, since ocelot->npi has already been set to -1 by felix_npi_port_deinit(). Call path: felix_change_tag_protocol -> felix_del_tag_protocol(DSA_TAG_PROTO_OCELOT) -> felix_teardown_tag_npi -> felix_npi_port_deinit -> felix_set_tag_protocol(DSA_TAG_PROTO_OCELOT_8021Q) -> felix_setup_tag_8021q -> felix_8021q_cpu_port_init Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 1 - 1 file changed, 1 deletion(-) commit c3cde44f3c6e44ce42368066dede0bc3c9b1952a Author: Vladimir Oltean Date: Thu Mar 3 16:01:21 2022 +0200 net: mscc: ocelot: use pretty names for IPPROTO_UDP and IPPROTO_TCP Hardcoding these IP protocol numbers in is2_entry_set() obscures the purpose of the code, so replace the magic numbers with the definitions from linux/in.h. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/ethernet/mscc/ocelot_vcap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c5a0edaeb9e1eb6dc5fcaf4e33bdaa1701bd41fb Author: Vladimir Oltean Date: Thu Mar 3 16:01:20 2022 +0200 net: mscc: ocelot: use list_for_each_entry in ocelot_vcap_block_remove_filter Simplify ocelot_vcap_block_remove_filter by using list_for_each_entry instead of list_for_each. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/ethernet/mscc/ocelot_vcap.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) commit 62dc30150c06774a8122c52aedd0eddaceaf5940 Author: Rex-BC Chen Date: Thu Feb 17 16:26:25 2022 +0800 soc: mediatek: mmsys: add sw0_rst_offset in mmsys driver data There are different software reset registers for difference MTK SoCs. Therefore, we add a new variable "sw0_rst_offset" to control it. Signed-off-by: Rex-BC Chen Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220217082626.15728-2-rex-bc.chen@mediatek.com Signed-off-by: Matthias Brugger drivers/soc/mediatek/mt8183-mmsys.h | 2 ++ drivers/soc/mediatek/mtk-mmsys.c | 6 ++++-- drivers/soc/mediatek/mtk-mmsys.h | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) commit e1d15646565b284e9ef2433234d6cfdaf66695f1 Author: Eddie James Date: Tue Mar 1 16:44:46 2022 -0600 USB: serial: pl2303: add IBM device IDs IBM manufactures a PL2303 device for UPS communications. Add the vendor and product IDs so that the PL2303 driver binds to the device. Signed-off-by: Eddie James Signed-off-by: Joel Stanley Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20220301224446.21236-1-eajames@linux.ibm.com Cc: stable@vger.kernel.org [ johan: amend the SoB chain ] Signed-off-by: Johan Hovold drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 3 +++ 2 files changed, 4 insertions(+) commit d7f15befac809ba365742464e1b0bebf07149c58 Author: Xiaoke Wang Date: Fri Mar 4 16:38:20 2022 +0800 ALSA: lola: add a check for the return of vmalloc() vmalloc() is a memory allocation function which can return NULL when some internal memory errors happen. So it is better to check the return of it to catch the error in time. Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_4221FC4089F6DF01C48F192E5784038BA205@qq.com Signed-off-by: Takashi Iwai sound/pci/lola/lola_mixer.c | 2 ++ 1 file changed, 2 insertions(+) commit 3cffb26fbb5202c6a4bee4b99d6bef5623003fbb Author: Colin Ian King Date: Wed Mar 2 17:07:28 2022 +0000 ALSA: echoaudio: remove redundant assignment to variable bytes The variable bytes is being assigned a value that is never read, it is being re-assigned inside a following if block. The assignment is redundant and can be removed. Cleans up clang scan build warning: sound/pci/echoaudio/midi.c:211:9: warning: Although the value stored to 'bytes' is used in the enclosing expression, the value is never actually read from 'bytes' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220302170728.1094633-1-colin.i.king@gmail.com Signed-off-by: Takashi Iwai sound/pci/echoaudio/midi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2d684f4e155c1e80ff63bd503930171c460eac5b Author: Martin Jücker Date: Sat Jan 29 23:01:53 2022 +0100 drm/exynos: fimd: add BGR support for exynos4/5 In the downstream kernels for exynos4 and exynos5 devices, there is an undocumented register that controls the order of the RGB output. It can be set to either normal order or reversed, which enables BGR support for those SoCs. This patch enables the BGR support for all the SoCs that were found to have at least one device with this logic in the corresponding downstream kernels. Signed-off-by: Martin Jücker Signed-off-by: Inki Dae drivers/gpu/drm/exynos/exynos_drm_fimd.c | 42 ++++++++++++++++++++++++++++++-- include/video/samsung_fimd.h | 4 +++ 2 files changed, 44 insertions(+), 2 deletions(-) commit fedc89821990013608bc210c9aef5bb33a1345a7 Author: Marek Szyprowski Date: Mon Jan 24 14:52:46 2022 +0100 drm/exynos: Search for TE-gpio in DSI panel's node TE-gpio, if defined, is placed in the panel's node, not the parent DSI node. Change the devm_gpiod_get_optional() to gpiod_get_optional() and pass proper device node to it. The code already has a proper cleanup path, so it looks that the devm_* variant has been applied accidentally during the conversion to gpiod API. Fixes: ee6c8b5afa62 ("drm/exynos: Replace legacy gpio interface for gpiod interface") Signed-off-by: Marek Szyprowski Fixed a typo. Signed-off-by: Inki Dae drivers/gpu/drm/exynos/exynos_drm_dsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8e3fa9d841db7517c1dcc365a911eaeacee09f20 Author: Marek Szyprowski Date: Fri Jan 21 11:00:39 2022 +0100 drm/exynos: Don't fail if no TE-gpio is defined for DSI driver TE-gpio is optional and if it is not found then gpiod_get_optional() returns NULL. In such case the code will continue and try to convert NULL gpiod to irq what in turn fails. The failure is then propagated and driver is not registered. Fix this by returning early from exynos_dsi_register_te_irq() if no TE-gpio is found. Fixes: ee6c8b5afa62 ("drm/exynos: Replace legacy gpio interface for gpiod interface") Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae drivers/gpu/drm/exynos/exynos_drm_dsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 25b522796223197063660f73db5212b5312c2660 Author: Lad Prabhakar Date: Wed Dec 22 19:01:34 2021 +0000 drm/exynos: gsc: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae drivers/gpu/drm/exynos/exynos_drm_gsc.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) commit 61f5fc8d5d577f201c39c886309fa30d91c9e392 Author: Lad Prabhakar Date: Wed Dec 22 19:01:33 2021 +0000 drm/exynos/fimc: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae drivers/gpu/drm/exynos/exynos_drm_fimc.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) commit 9df3f43acf9ad389484f4d24345672206ca315df Author: Lad Prabhakar Date: Wed Dec 22 19:01:32 2021 +0000 drm/exynos/exynos_drm_fimd: Use platform_get_irq_byname() to get the interrupt platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_byname(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae drivers/gpu/drm/exynos/exynos_drm_fimd.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) commit 6a91548e6b5ca9805dda068ed55a71f3bf33208e Author: Lad Prabhakar Date: Wed Dec 22 19:01:31 2021 +0000 drm/exynos: mixer: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae drivers/gpu/drm/exynos/exynos_mixer.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) commit 970dc5ed6b6aa8bd6cca138436e89f0cb0b8be85 Author: Lad Prabhakar Date: Wed Dec 22 19:01:30 2021 +0000 drm/exynos/exynos7_drm_decon: Use platform_get_irq_byname() to get the interrupt platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_byname(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae drivers/gpu/drm/exynos/exynos7_drm_decon.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) commit 69d6941949ea8a113ffc89410b0cb79bc7b35a0b Author: Lad Prabhakar Date: Tue Mar 1 12:35:26 2022 +0000 dt-bindings: memory: renesas,rpc-if: Document RZ/V2L SoC Document RZ/V2L RPC-IF bindings. RZ/V2L RPC-IF is identical to one found on the RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,rzg2l-rpc-if" will be used as a fallback. While at it, drop the comment "# RZ/G2L family" for "renesas,rzg2l-rpc-if" compatible string as this will avoid changing the line for every new SoC addition. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220301123527.15950-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski .../devicetree/bindings/memory-controllers/renesas,rpc-if.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 5b5ab1bfa1898c6d52936a57c25c5ceba2cb2f87 Author: Jia-Ju Bai Date: Fri Feb 25 05:25:52 2022 -0800 memory: emif: check the pointer temp in get_device_details() The pointer temp is allocated by devm_kzalloc(), so it should be checked for error handling. Fixes: 7ec944538dde ("memory: emif: add basic infrastructure for EMIF driver") Signed-off-by: Jia-Ju Bai Link: https://lore.kernel.org/r/20220225132552.27894-1-baijiaju1990@gmail.com Signed-off-by: Krzysztof Kozlowski drivers/memory/emif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fd7bd80b46373887b390852f490f21b07e209498 Author: Jiasheng Jiang Date: Thu Feb 24 10:54:44 2022 +0800 memory: emif: Add check for setup_interrupts As the potential failure of the devm_request_threaded_irq(), it should be better to check the return value of the setup_interrupts() and return error if fails. Fixes: 68b4aee35d1f ("memory: emif: add interrupt and temperature handling") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220224025444.3256530-1-jiasheng@iscas.ac.cn Signed-off-by: Krzysztof Kozlowski drivers/memory/emif.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 3d1e4228c9dd5c945a5cb621749f358766ee5777 Author: Daniel Scally Date: Wed Mar 2 22:24:48 2022 +0000 media: i2c: Fix pixel array positions in ov8865 The ov8865's datasheet gives the pixel array as 3296x2528, and the active portion as the centre 3264x2448. This makes for a top offset of 40 and a left offset of 16, not 32 and 80. Fixes: acd25e220921 ("media: i2c: Add .get_selection() support to ov8865") Reported-by: Jean-Michel Hautbois Signed-off-by: Daniel Scally Reviewed-by: Kieran Bingham Reviewed-by: Paul Kocialkowski Signed-off-by: Sakari Ailus drivers/media/i2c/ov8865.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 3e4fcec038e00a4d9f29987625ecb498e4941c39 Author: Linus Walleij Date: Wed Feb 23 01:34:16 2022 +0100 media: adv7183: Convert to GPIO descriptors This driver is using two GPIO numbers passed as platform data. No board file in the kernel defines this however, so we can just change the mechanism without side effects. Let's just switch it to use GPIO descriptors and add some comments on how to provide these. Signed-off-by: Linus Walleij Signed-off-by: Sakari Ailus drivers/media/i2c/adv7183.c | 51 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 26 deletions(-) commit aaaf357fa61c00376cd8718d36bf06b7f0cbeead Author: Linus Walleij Date: Thu Feb 24 01:13:07 2022 +0100 media: m5mols: Convert to use GPIO descriptors The Fujitsu M5MOLS sensor driver is using a reset GPIO number passed from platform data. No machine/board descriptor file in the kernel is using this so let's replace it with a GPIO descriptor. Cc: Kyungmin Park Cc: Heungjun Kim Signed-off-by: Linus Walleij Signed-off-by: Sakari Ailus drivers/media/i2c/m5mols/m5mols.h | 2 ++ drivers/media/i2c/m5mols/m5mols_capture.c | 1 - drivers/media/i2c/m5mols/m5mols_core.c | 29 ++++++++++------------------- include/media/i2c/m5mols.h | 4 ---- 4 files changed, 12 insertions(+), 24 deletions(-) commit b70f5cd874ccf85c20882e12ba75a61a11ce4018 Author: Linus Walleij Date: Thu Feb 24 01:11:29 2022 +0100 media: noon010p30: Convert to use GPIO descriptors The noon010pc30 sensor driver is using legacy gpio numbers passed through platform data and open coding reverse polarity on the GPIOs used for reset and standby. Nothing in the kernel defines any platform data for this driver so we can just convert the driver to use GPIO descriptors and requires that these specify the correct polarity instead. Cc: Sylwester Nawrocki Cc: Hans Verkuil Signed-off-by: Linus Walleij Signed-off-by: Sakari Ailus drivers/media/i2c/noon010pc30.c | 75 +++++++++++++++++++---------------------- include/media/i2c/noon010pc30.h | 4 --- 2 files changed, 35 insertions(+), 44 deletions(-) commit 200ae4b56891707ef9ab2f7ca4e8d0daeea32e39 Author: Linus Walleij Date: Thu Feb 24 00:50:11 2022 +0100 media: mt9m111: Drop unused include This driver includes but does not use any symbols from this file. Drop the include. Signed-off-by: Linus Walleij Signed-off-by: Sakari Ailus drivers/media/i2c/mt9m111.c | 1 - 1 file changed, 1 deletion(-) commit 10fa965ca4fa62a34a3c0f7a817d6474fc76cbbb Author: Linus Walleij Date: Wed Feb 23 18:28:16 2022 +0100 media: adv7511: Drop unused include The adv7511 driver includes the legacy GPIO header yet fails to use any symbols from it. Drop the include. Cc: Hans Verkuil Signed-off-by: Linus Walleij Signed-off-by: Sakari Ailus drivers/media/i2c/adv7511-v4l2.c | 1 - 1 file changed, 1 deletion(-) commit f9f52c3474282a5485b28cf188b47d6e2efee185 Author: Dust Li Date: Thu Mar 3 19:35:27 2022 +0800 net/smc: fix document build WARNING from smc-sysctl.rst Stephen reported the following warning messages from smc-sysctl.rst Documentation/networking/smc-sysctl.rst:3: WARNING: Title overline too short. Documentation/networking/smc-sysctl.rst: WARNING: document isn't included in any toctree Fix the title overline and add smc-sysctl entry into Documentation/networking/index.rst Fixes: 12bbb0d163a9 ("net/smc: add sysctl for autocorking") Reported-by: Stephen Rothwell Signed-off-by: Dust Li Link: https://lore.kernel.org/r/20220303113527.62047-1-dust.li@linux.alibaba.com Signed-off-by: Jakub Kicinski Documentation/networking/index.rst | 1 + Documentation/networking/smc-sysctl.rst | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) commit 2f5e65de0496c2e46c91afd93be2006cb9ace1d6 Author: Haowen Bai Date: Thu Mar 3 09:38:49 2022 +0800 net: marvell: Use min() instead of doing it manually Fix following coccicheck warning: drivers/net/ethernet/marvell/mv643xx_eth.c:1664:35-36: WARNING opportunity for min() Signed-off-by: Haowen Bai Link: https://lore.kernel.org/r/1646271529-7659-1-git-send-email-baihaowen88@gmail.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 6de7e4f02640fba2ffa6ac04e2be13785d614175 Merge: 2ab82efeeed8 afab9d91d872 Author: Dave Airlie Date: Fri Mar 4 14:30:28 2022 +1000 Merge tag 'drm-msm-next-2022-03-01' of https://gitlab.freedesktop.org/drm/msm into drm-next We're experimenting a bit with the process this time, with Dmitry collecting display patches and merging them into msm-next with me handling the gpu/etc side of things. Summary of interesting new bits and pieces * dpu + dp support for sc8180x * dp support for sm8350 * dpu + dsi support for qcm2290 * 10nm dsi phy tuning support * bridge support for dp encoder * gpu support for additional 7c3 SKUs * assorted cleanups and fixes Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGu=Jdrw6DqYOYPTMks7=zatrsvdR=o6DpjqZ=TQQhFZuw@mail.gmail.com commit 9e1a3ce0a952450a1163cc93ab1df6d4fa8c8155 Author: Kees Cook Date: Wed Feb 23 19:32:10 2022 -0800 binfmt_elf: Introduce KUnit test Adds simple KUnit test for some binfmt_elf internals: specifically a regression test for the problem fixed by commit 8904d9cd90ee ("ELF: fix overflow in total mapping size calculation"). $ ./tools/testing/kunit/kunit.py run --arch x86_64 \ --kconfig_add CONFIG_IA32_EMULATION=y '*binfmt_elf' ... [19:41:08] ================== binfmt_elf (1 subtest) ================== [19:41:08] [PASSED] total_mapping_size_test [19:41:08] =================== [PASSED] binfmt_elf ==================== [19:41:08] ============== compat_binfmt_elf (1 subtest) =============== [19:41:08] [PASSED] total_mapping_size_test [19:41:08] ================ [PASSED] compat_binfmt_elf ================ [19:41:08] ============================================================ [19:41:08] Testing complete. Passed: 2, Failed: 0, Crashed: 0, Skipped: 0, Errors: 0 Cc: Eric Biederman Cc: David Gow Cc: Alexey Dobriyan Cc: "Magnus Groß" Cc: kunit-dev@googlegroups.com Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Kees Cook --- v1: https://lore.kernel.org/lkml/20220224054332.1852813-1-keescook@chromium.org v2: - improve commit log - fix comment URL (Daniel) - drop redundant KUnit Kconfig help info (Daniel) - note in Kconfig help that COMPAT builds add a compat test (David) fs/Kconfig.binfmt | 10 ++++++++ fs/binfmt_elf.c | 4 ++++ fs/binfmt_elf_test.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ fs/compat_binfmt_elf.c | 2 ++ 4 files changed, 80 insertions(+) commit 2ab82efeeed885c0210a0029df93bb95a316e8c7 Merge: c9e9ce0b6f85 b2006061ae28 Author: Dave Airlie Date: Fri Mar 4 14:16:30 2022 +1000 Merge tag 'drm-intel-gt-next-2022-03-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Cross-subsystem Changes: - drm-next backmerge for buddy allocator changes Driver Changes: - Skip i915_perf init for DG2 as it is not yet enabled (Ram) - Add missing workarounds for DG2 (Clint) - Add 64K page/align support for platforms like DG2 that require it (Matt A, Ram, Bob) - Add accelerated migration support for DG2 (Matt A) - Add flat CCS support for XeHP SDV (Abdiel, Ram) - Add Compute Command Streamer (CCS) engine support for XeHP SDV (Michel, Daniele, Aravind, Matt R) - Don't support parallel submission on compute / render (Matt B, Matt R) - Disable i915 build on PREEMPT_RT until RT behaviour fixed (Sebastian) - Remove RPS interrupt support for TGL+ (Jose) - Fix S/R with PM_EARLY for non-GTT mappable objects on DG2 (Matt, Lucas) - Skip stolen memory init if it is fully reserved (Jose) - Use iosys_map for GuC data structures that may be in LMEM BAR or SMEM (Lucas) - Do not complain about stale GuC reset notifications for banned contexts (John) - Move context descriptor fields to intel_lrc.h - Start adding support for small BAR (Matt A) - Clarify vma lifetime (Thomas) - Simplify subplatform detection on TGL (Jose) - Correct the param count for unset GuC SLPC param (Vinay, Umesh) - Read RP_STATE_CAP correctly on Gen12 with GuC SLPC (Vinay) - Initialize GuC submission locks and queues early (Daniele) - Fix GuC flag query helper function to not modify state (John) - Drop fake lmem support now we have real hardware available (Lucas) - Move misplaced W/A to their correct locations (Srinivasan) - Use get_reset_domain() helper (Tejas) - Move context descriptor fields to intel_lrc.h (Matt R) - Selftest improvements (Matt A) Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YiBzY1dM7bKwMQ3H@jlahtine-mobl.ger.corp.intel.com commit c9e9ce0b6f85ac330adee912745048a0af5f315d Merge: f298a2b94c7b 701920ca9822 Author: Dave Airlie Date: Fri Mar 4 13:41:52 2022 +1000 Merge tag 'drm-misc-next-2022-03-03' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for v5.18: UAPI Changes: Cross-subsystem Changes: - Improve performance of some fbdev ops, in some cases up to 6x faster. Core Changes: - Some small DP fixes. - Find panels in subnodes of OF devices, and add of_get_drm_panel_display_mode to retrieve mode. - Add drm_object_property_get_default_value and use it for resetting zpos in plane state reset, removing the need for individual drivers to do it. - Same for color encoding and color range props. - Update panic handling todo doc. - Add todo that format conversion helpers should be sped up similarly to fbdev ops. Driver Changes: - Add panel orientation property to simpledrm for quirked panels. - Assorted small fixes to tiny/repaper, nouveau, stm, omap, ssd130x. - Add crc support to stm/ltdc. - Add MIPI DBI compatible SPI driver - Assorted small fixes to tiny panels and bridge drivers. - Add AST2600 support to aspeed. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/48fabd78-ade9-f80b-c724-13726c7be69e@linux.intel.com commit f298a2b94c7bca7f664b99d374cf3e5d79bf9327 Merge: 66a8af1f6e3c 8ba3c7bd4dca Author: Dave Airlie Date: Fri Mar 4 13:09:15 2022 +1000 Merge tag 'du-next-20220303' of git://linuxtv.org/pinchartl/media into drm-next - R-Car LVDS support for M3-W+ (R8A77961) SoC - R-Car DU misc fixes and cleanups Signed-off-by: Dave Airlie From: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/YiCwy3FR3gPng4dN@pendragon.ideasonboard.com commit 66a8af1f6e3c10190dff14a5668661c092a2a85f Merge: 38a15ad9488e cf5086d35d8c Author: Dave Airlie Date: Fri Mar 4 12:50:47 2022 +1000 Merge tag 'drm/tegra/for-5.18-rc1' of https://gitlab.freedesktop.org/drm/tegra into drm-next drm/tegra: Changes for v5.18-rc1 This contains a couple more minor fixes that didn't seem urgent enough for v5.17. On top of that this improves YUV format support on older chips. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20220301124426.1207653-1-thierry.reding@gmail.com commit f41ee8b91c00770d718be2ff4852a80017ae9ab3 Author: Chao Yu Date: Fri Mar 4 09:49:13 2022 +0800 f2fs: fix to do sanity check on curseg->alloc_type As Wenqing Liu reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215657 - Overview UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2 when mount and operate a corrupted image - Reproduce tested on kernel 5.17-rc4, 5.17-rc6 1. mkdir test_crash 2. cd test_crash 3. unzip tmp2.zip 4. mkdir mnt 5. ./single_test.sh f2fs 2 - Kernel dump [ 46.434454] loop0: detected capacity change from 0 to 131072 [ 46.529839] F2FS-fs (loop0): Mounted with checkpoint version = 7548c2d9 [ 46.738319] ================================================================================ [ 46.738412] UBSAN: array-index-out-of-bounds in fs/f2fs/segment.c:3460:2 [ 46.738475] index 231 is out of range for type 'unsigned int [2]' [ 46.738539] CPU: 2 PID: 939 Comm: umount Not tainted 5.17.0-rc6 #1 [ 46.738547] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 [ 46.738551] Call Trace: [ 46.738556] [ 46.738563] dump_stack_lvl+0x47/0x5c [ 46.738581] ubsan_epilogue+0x5/0x50 [ 46.738592] __ubsan_handle_out_of_bounds+0x68/0x80 [ 46.738604] f2fs_allocate_data_block+0xdff/0xe60 [f2fs] [ 46.738819] do_write_page+0xef/0x210 [f2fs] [ 46.738934] f2fs_do_write_node_page+0x3f/0x80 [f2fs] [ 46.739038] __write_node_page+0x2b7/0x920 [f2fs] [ 46.739162] f2fs_sync_node_pages+0x943/0xb00 [f2fs] [ 46.739293] f2fs_write_checkpoint+0x7bb/0x1030 [f2fs] [ 46.739405] kill_f2fs_super+0x125/0x150 [f2fs] [ 46.739507] deactivate_locked_super+0x60/0xc0 [ 46.739517] deactivate_super+0x70/0xb0 [ 46.739524] cleanup_mnt+0x11a/0x200 [ 46.739532] __cleanup_mnt+0x16/0x20 [ 46.739538] task_work_run+0x67/0xa0 [ 46.739547] exit_to_user_mode_prepare+0x18c/0x1a0 [ 46.739559] syscall_exit_to_user_mode+0x26/0x40 [ 46.739568] do_syscall_64+0x46/0xb0 [ 46.739584] entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is we missed to do sanity check on curseg->alloc_type, result in out-of-bound accessing on sbi->block_count[] array, fix it. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/segment.c | 7 +++++++ 1 file changed, 7 insertions(+) commit e40b38a41ce916d6a3a4751d59a01b6c0c03afd0 Author: Nour-eddine Taleb Date: Thu Mar 3 15:34:16 2022 +0100 KVM: PPC: Book3S HV: remove unnecessary casts Remove unnecessary casts, from "void *" to "struct kvmppc_xics *" Signed-off-by: Nour-eddine Taleb Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220303143416.201851-1-kernel.noureddine@gmail.com arch/powerpc/kvm/book3s_xics.c | 2 +- arch/powerpc/kvm/book3s_xive.c | 2 +- arch/powerpc/kvm/book3s_xive_native.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) commit 51ef2be546e2e480e56fdb59fdeb9a4406e8d52e Author: Marek Vasut Date: Thu Feb 17 16:44:07 2022 +0100 media: i2c: isl7998x: Add driver for Intersil ISL7998x Add driver for the Intersil ISL7998x Analog to MIPI CSI-2/BT656 decoder. This chip supports 1/2/4 analog video inputs and converts them into 1/2/4 VCs in MIPI CSI2 stream. This driver currently supports ISL79987 and both 720x480 and 720x576 resolutions, however as per specification, all inputs must use the same resolution and standard. The only supported pixel format is now YUYV/YUV422. The chip should support RGB565 on the CSI2 as well, but this is currently unsupported. Signed-off-by: Marek Vasut Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Cc: Rob Herring To: linux-media@vger.kernel.org Signed-off-by: Michael Tretter Acked-by: Hans Verkuil [Sakari Ailus: Always call pm_runtime_get_and_resume in pre_streamon] Signed-off-by: Sakari Ailus MAINTAINERS | 8 + drivers/media/i2c/Kconfig | 10 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/isl7998x.c | 1628 ++++++++++++++++++++++++++++++++++++ include/uapi/linux/v4l2-controls.h | 6 + 5 files changed, 1653 insertions(+) commit f0fb3328100e2be01b2b71e5e48e9800b13ed5a2 Author: Marek Vasut Date: Thu Feb 17 16:44:06 2022 +0100 media: dt-bindings: Add Intersil ISL79987 DT bindings Add bindings for the Intersil ISL79987 analog to MIPI CSI-2 decoder. Signed-off-by: Marek Vasut Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Cc: Rob Herring Cc: devicetree@vger.kernel.org To: linux-media@vger.kernel.org Signed-off-by: Michael Tretter Reviewed-by: Rob Herring Acked-by: Hans Verkuil Signed-off-by: Sakari Ailus .../bindings/media/i2c/isil,isl79987.yaml | 113 +++++++++++++++++++++ 1 file changed, 113 insertions(+) commit 443bf23d0048e014065d1a7fac8144fb0a40805b Author: Laurent Pinchart Date: Thu Feb 24 14:57:47 2022 +0200 media: media-entity: Clarify media_entity_cleanup() usage Being able to call cleanup functions on objects that haven't been initialized but whose memory has been zeroed simplifies error handling. The media_entity_cleanup() function documentation doesn't tell whether this is allowed or not, and inspection of its implementation doesn't provide any clue as the function is currently empty. Update the documentation to explicitly allow this usage pattern. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus include/media/media-entity.h | 4 ++++ 1 file changed, 4 insertions(+) commit ff43dd75157e74fb37da96656b14264aac4252bd Author: Linus Walleij Date: Wed Feb 23 18:33:43 2022 +0100 media: i2c: imx274: Drop surplus includes The driver already includes which is what it uses, drop the legacy and includes. Cc: Sakari Ailus Signed-off-by: Linus Walleij Signed-off-by: Sakari Ailus drivers/media/i2c/imx274.c | 2 -- 1 file changed, 2 deletions(-) commit d184cc910e3f6f5bfd6c862149c707b3537e4df9 Author: Linus Walleij Date: Wed Feb 23 18:31:17 2022 +0100 media: i2c: ccs: Drop unused include The driver already includes which is what it uses, drop the legacy include. Cc: Sakari Ailus Signed-off-by: Linus Walleij Signed-off-by: Sakari Ailus drivers/media/i2c/ccs/ccs-core.c | 1 - 1 file changed, 1 deletion(-) commit 5f1501fd47882b1cf86ca232dd5d090cd9010ba2 Author: Sakari Ailus Date: Sat Jan 29 00:26:07 2022 +0200 v4l: fwnode: Remove now-redundant loop from v4l2_fwnode_parse_reference() v4l2_fwnode_parse_reference() relied on counting the number of references for async array memory allocation. The array is long gone so remove counting the references now. This also changes how the function arrives in different unsuccessful return values but the functionality remains unchanged. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart drivers/media/v4l2-core/v4l2-fwnode.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) commit cb2a3293ca7a4e24fba3804a706d79aa598b940e Author: Sakari Ailus Date: Wed Feb 23 13:47:48 2022 +0200 v4l: fwnode: Drop redunant -ENODATA check in property reference parsing The check of -ENODATA return value from fwnode_property_get_reference_args() was made redundant by commit c343bc2ce2c6 ("ACPI: properties: Align return codes of __acpi_node_get_property_reference()"). -ENOENT remains to be used to signal there are no further entries. Remove the check for -ENODATA. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart drivers/media/v4l2-core/v4l2-fwnode.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) commit 3056a8e936bb090865402bfe6f3a730a28790033 Author: Laurent Pinchart Date: Thu Jan 13 17:00:42 2022 +0200 media: media-entity: Simplify media_pipeline_start() The media_pipeline_start() function has two purposes: it constructs a pipeline by recording the entities that are part of it, gathered from a graph walk, and validate the media links. The pipeline pointer is stored in the media_entity structure as part of this process, and the entity's stream count is increased, to record that the entity is streaming. When multiple video nodes are present in a pipeline, media_pipeline_start() is typically called on all of them, with the same pipeline pointer. This is taken into account in media_pipeline_start() by skipping validation for entities that are already part of the pipeline, while returning an error if an entity is part of a different pipeline. It turns out that this process is overly complicated. When media_pipeline_start() is called for the first time, it constructs the full pipeline, adding all entities and validating all the links. Subsequent calls to media_pipeline_start() are then nearly no-ops, they only increase the stream count on the pipeline and on all entities. The media_entity stream_count field is used for two purposes: checking if the entity is streaming, and detecting when a call to media_pipeline_stop() balances needs to reset the entity pipe pointer to NULL. The former can easily be replaced by a check of the pipe pointer. Simplify media_pipeline_start() by avoiding the pipeline walk on all calls but the first one, and drop the media_entity stream_count field. media_pipeline_stop() is updated accordingly. Signed-off-by: Laurent Pinchart [Sakari Ailus: Drop redundant '!= NULL' as discussed] Signed-off-by: Sakari Ailus drivers/media/mc/mc-entity.c | 52 +++++++++++++++++++------------------------- include/media/media-entity.h | 11 ++++------ 2 files changed, 26 insertions(+), 37 deletions(-) commit f17bc788f7b97c36b8f3fbef14555a2a16ee3f69 Author: Laurent Pinchart Date: Thu Jan 13 17:00:41 2022 +0200 media: media-entity: Add media_pad_is_streaming() helper function Add a function to test if a pad is part of a pipeline currently streaming, and use it through drivers to replace direct access to the stream_count field. This will help reworking pipeline start/stop without disturbing drivers. Signed-off-by: Laurent Pinchart Signed-off-by: Sakari Ailus drivers/media/mc/mc-entity.c | 3 ++- drivers/media/platform/exynos4-is/common.c | 5 ++++- drivers/media/platform/exynos4-is/fimc-isp.c | 2 +- drivers/media/platform/exynos4-is/fimc-lite.c | 6 +++--- drivers/media/platform/rcar-vin/rcar-core.c | 2 +- include/media/media-entity.h | 12 ++++++++++++ 6 files changed, 23 insertions(+), 7 deletions(-) commit 472377febf848a08f67ed73bb0dc13a907575f82 Author: Shawn Tu Date: Tue Feb 15 23:13:45 2022 +0800 media: Add a driver for the og01a1b camera sensor Add a V4L2 sub-device driver for Omnivision og01a1b b&w image sensor. This is a camera sensor using the I2C bus for control and the CSI-2 bus for data. This driver supports following features: - manual exposure and analog/digital gain control support - vblank/hblank control support - test pattern support - media controller support - runtime PM support - support following resolutions: + 1280x1024 at 120FPS Signed-off-by: Shawn Tu [Sakari Ailus: Update according to recent v4l2-async API changes] Signed-off-by: Sakari Ailus MAINTAINERS | 6 + drivers/media/i2c/Kconfig | 13 + drivers/media/i2c/Makefile | 1 + drivers/media/i2c/og01a1b.c | 1128 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1148 insertions(+) commit d4cb5d3c4cee28aa89b02bc33d930a6cf75e7f79 Author: Hans de Goede Date: Thu Feb 3 13:33:12 2022 +0100 media: i2c: ov5648: Fix lockdep error ov5648_state_init() calls ov5648_state_mipi_configure() which uses __v4l2_ctrl_s_ctrl[_int64](). This means that sensor->mutex (which is also sensor->ctrls.handler.lock) must be locked before calling ov5648_state_init(). ov5648_state_mipi_configure() is also used in other places where the lock is already held so it cannot be changed itself. Note this is based on an identical (tested) fix for the ov8865 driver, this has only been compile-tested. Cc: Paul Kocialkowski Reviewed-by: Paul Kocialkowski Signed-off-by: Hans de Goede Signed-off-by: Sakari Ailus drivers/media/i2c/ov5648.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit f6d344cd5fa6a15e1ec2da350470b35a3f55f74c Author: Muhammad Usama Anjum Date: Thu Feb 17 03:38:17 2022 +0500 selftests: Fix build when $(O) points to a relative path Build of bpf and tc-testing selftests fails when the relative path of the build directory is specified. make -C tools/testing/selftests O=build0 make[1]: Entering directory '/linux_mainline/tools/testing/selftests/bpf' ../../../scripts/Makefile.include:4: *** O=build0 does not exist. Stop. make[1]: Entering directory '/linux_mainline/tools/testing/selftests/tc-testing' ../../../scripts/Makefile.include:4: *** O=build0 does not exist. Stop. Makefiles of bpf and tc-testing include scripts/Makefile.include file. This file has sanity checking inside it which checks the output path. The output path is not relative to the bpf or tc-testing. The sanity check fails. Expand the output path to get rid of this error. The fix is the same as mentioned in commit 150a27328b68 ("bpf, preload: Fix build when $(O) points to a relative path"). Signed-off-by: Muhammad Usama Anjum Signed-off-by: Shuah Khan tools/testing/selftests/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit a50a88f026fb28ece512c50e8ef7cd4ef6d0a291 Author: Geliang Tang Date: Wed Mar 2 13:29:13 2022 +0800 selftests: netfilter: fix a build error on openSUSE This patch fixed the following build error on openSUSE Leap 15.3: ======================================================================= gcc nf-queue.c -lmnl -o tools/testing/selftests/netfilter/nf-queue nf-queue.c:13:10: fatal error: libmnl/libmnl.h: No such file or directory #include ^~~~~~~~~~~~~~~~~ compilation terminated. ======================================================================= It is because libmnl.h is put in the directory of "/usr/include/libmnl/libmnl/" on openSUSE, not "/usr/include/libmnl/": > rpm -ql libmnl-devel /usr/include/libmnl /usr/include/libmnl/libmnl /usr/include/libmnl/libmnl/libmnl.h /usr/lib64/libmnl.so /usr/lib64/pkgconfig/libmnl.pc Suggested-by: Kai Liu Signed-off-by: Geliang Tang Reviewed-by: Shuah Khan Signed-off-by: Shuah Khan tools/testing/selftests/netfilter/Makefile | 1 + 1 file changed, 1 insertion(+) commit 946ad0499d984be13ec02f8257ca0527ec287bf2 Author: Muhammad Usama Anjum Date: Wed Mar 2 23:01:20 2022 +0500 selftests: kvm: add generated file to the .gitignore Add hyperv_svm_test to the .gitignore file. Signed-off-by: Muhammad Usama Anjum Reviewed-by: Kees Cook Signed-off-by: Shuah Khan tools/testing/selftests/kvm/.gitignore | 1 + 1 file changed, 1 insertion(+) commit c7b9c68fc01b468983c8f4745f400fa74c831005 Author: Muhammad Usama Anjum Date: Wed Mar 2 23:01:19 2022 +0500 selftests/exec: add generated files to .gitignore Add generated files non-regular and null-argv to .gitignore file. Signed-off-by: Muhammad Usama Anjum Reviewed-by: Kees Cook Signed-off-by: Shuah Khan tools/testing/selftests/exec/.gitignore | 2 ++ 1 file changed, 2 insertions(+) commit edcb647b4bfb19674d58bff2e6ef96e0dbcccfdf Author: Muhammad Usama Anjum Date: Wed Mar 2 23:01:18 2022 +0500 selftests: add kselftest_install to .gitignore Add kselftest_install directory to the .gitignore which is created while creation of tar ball of objects: make -C tools/testing/selftests gen_tar Signed-off-by: Muhammad Usama Anjum Reviewed-by: Kees Cook Signed-off-by: Shuah Khan tools/testing/selftests/.gitignore | 1 + 1 file changed, 1 insertion(+) commit 344150999b7fc88502a65bbb147a47503eca2033 Author: Chao Yu Date: Thu Jan 27 13:44:49 2022 +0800 f2fs: fix to avoid potential deadlock Quoted from Jing Xia's report, there is a potential deadlock may happen between kworker and checkpoint as below: [T:writeback] [T:checkpoint] - wb_writeback - blk_start_plug bio contains NodeA was plugged in writeback threads - do_writepages -- sync write inodeB, inc wb_sync_req[DATA] - f2fs_write_data_pages - f2fs_write_single_data_page -- write last dirty page - f2fs_do_write_data_page - set_page_writeback -- clear page dirty flag and PAGECACHE_TAG_DIRTY tag in radix tree - f2fs_outplace_write_data - f2fs_update_data_blkaddr - f2fs_wait_on_page_writeback -- wait NodeA to writeback here - inode_dec_dirty_pages - writeback_sb_inodes - writeback_single_inode - do_writepages - f2fs_write_data_pages -- skip writepages due to wb_sync_req[DATA] - wbc->pages_skipped += get_dirty_pages() -- PAGECACHE_TAG_DIRTY is not set but get_dirty_pages() returns one - requeue_inode -- requeue inode to wb->b_dirty queue due to non-zero.pages_skipped - blk_finish_plug Let's try to avoid deadlock condition by forcing unplugging previous bio via blk_finish_plug(current->plug) once we'v skipped writeback in writepages() due to valid sbi->wb_sync_req[DATA/NODE]. Fixes: 687de7f1010c ("f2fs: avoid IO split due to mixed WB_SYNC_ALL and WB_SYNC_NONE") Signed-off-by: Zhiguo Niu Signed-off-by: Jing Xia Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim fs/f2fs/data.c | 6 +++++- fs/f2fs/node.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) commit 309d955985ee9e94697c197b7b489555f1ac7259 Author: Rob Herring Date: Mon Feb 28 14:10:05 2022 -0600 dt-bindings: kbuild: Support partial matches with DT_SCHEMA_FILES DT_SCHEMA_FILES is currently restricted to a list of exact files with the full source tree path (i.e. Documentation/devicetree/bindings/...). Loosen this requirement and let DT_SCHEMA_FILES be a partial match. With this, checking all schema files in a directory is possible: $ make DT_SCHEMA_FILES=/gpio/ dt_binding_check Or all schema files with 'qcom' in the path or filename: $ make DT_SCHEMA_FILES=qcom dt_binding_check Cc: Masahiro Yamada Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220228201006.1484903-1-robh@kernel.org Documentation/devicetree/bindings/Makefile | 15 +++++---------- Documentation/devicetree/bindings/writing-schema.rst | 9 +++++---- 2 files changed, 10 insertions(+), 14 deletions(-) commit 3d5985a185e6abfc0b38ed187819016a79eca864 Author: Jacob Keller Date: Wed Feb 16 13:37:38 2022 -0800 ice: convert VF storage to hash table with krefs and RCU The ice driver stores VF structures in a simple array which is allocated once at the time of VF creation. The VF structures are then accessed from the array by their VF ID. The ID must be between 0 and the number of allocated VFs. Multiple threads can access this table: * .ndo operations such as .ndo_get_vf_cfg or .ndo_set_vf_trust * interrupts, such as due to messages from the VF using the virtchnl communication * processing such as device reset * commands to add or remove VFs The current implementation does not keep track of when all threads are done operating on a VF and can potentially result in use-after-free issues caused by one thread accessing a VF structure after it has been released when removing VFs. Some of these are prevented with various state flags and checks. In addition, this structure is quite static and does not support a planned future where virtualization can be more dynamic. As we begin to look at supporting Scalable IOV with the ice driver (as opposed to just supporting Single Root IOV), this structure is not sufficient. In the future, VFs will be able to be added and removed individually and dynamically. To allow for this, and to better protect against a whole class of use-after-free bugs, replace the VF storage with a combination of a hash table and krefs to reference track all of the accesses to VFs through the hash table. A hash table still allows efficient look up of the VF given its ID, but also allows adding and removing VFs. It does not require contiguous VF IDs. The use of krefs allows the cleanup of the VF memory to be delayed until after all threads have released their reference (by calling ice_put_vf). To prevent corruption of the hash table, a combination of RCU and the mutex table_lock are used. Addition and removal from the hash table use the RCU-aware hash macros. This allows simple read-only look ups that iterate to locate a single VF can be fast using RCU. Accesses which modify the hash table, or which can't take RCU because they sleep, will hold the mutex lock. By using this design, we have a stronger guarantee that the VF structure can't be released until after all threads are finished operating on it. We also pave the way for the more dynamic Scalable IOV implementation in the future. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_eswitch.c | 16 + drivers/net/ethernet/intel/ice/ice_ethtool.c | 13 +- drivers/net/ethernet/intel/ice/ice_lib.c | 24 +- drivers/net/ethernet/intel/ice/ice_main.c | 8 + drivers/net/ethernet/intel/ice/ice_repr.c | 4 + drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 2 + drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 376 +++++++++++++++------ drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | 45 ++- 8 files changed, 363 insertions(+), 125 deletions(-) commit 80901bff812984624918d9d03f9286e3245ee9a5 Merge: 25bf4df4d18b b949c21fc23e Author: Jakub Kicinski Date: Thu Mar 3 11:55:12 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net net/batman-adv/hard-interface.c commit 690bb6fb64f5 ("batman-adv: Request iflink once in batadv-on-batadv check") commit 6ee3c393eeb7 ("batman-adv: Demote batadv-on-batadv skip error message") https://lore.kernel.org/all/20220302163049.101957-1-sw@simonwunderlich.de/ net/smc/af_smc.c commit 4d08b7b57ece ("net/smc: Fix cleanup when register ULP fails") commit 462791bbfa35 ("net/smc: add sysctl interface for SMC") https://lore.kernel.org/all/20220302112209.355def40@canb.auug.org.au/ Signed-off-by: Jakub Kicinski commit 01399a994bb477bb7d0a32665ce77407da849faf Author: Andy Shevchenko Date: Tue Mar 1 00:39:35 2022 +0200 ACPI: docs: enumeration: Unify Package () for properties Unify Package () representation for properties: - make them one line where it's possible - add spaces between parentheses and curly braces - drop the explicit size of package Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki Documentation/firmware-guide/acpi/enumeration.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit a889e50ea088a525338e7fb9adc887d407e4a5c4 Author: Andy Shevchenko Date: Tue Mar 1 00:39:36 2022 +0200 ACPI: docs: enumeration: Drop comma for terminator entry Drop comma for terminator entry to avoid copy'n'paste of this pattern. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki Documentation/firmware-guide/acpi/enumeration.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 6bf87c4de91ca31f829587f69cd8ea13576a483d Author: Andy Shevchenko Date: Tue Mar 1 00:39:34 2022 +0200 ACPI: docs: enumeration: Drop ugly ifdeffery from the examples The ifdeffery around ACPI ID tables are ugly and in some cases even less valuable than plain definitions. Drop them for good to avoid spreading rather bad pattern. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki Documentation/firmware-guide/acpi/enumeration.rst | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) commit e92e19747c1e0eb805c7c72fa991da7a292b43a6 Author: Andy Shevchenko Date: Tue Mar 1 00:39:33 2022 +0200 ACPI: docs: enumeration: Amend PWM enumeration ASL example Drop blank line and add a closing curly brace to make ASL example closer to the reality. Fixes: ef3d13b86763 ("docs: firmware-guide: ACPI: Add a PWM example") Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki Documentation/firmware-guide/acpi/enumeration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e8a62f363661d824495737427d59ba3fce91ae34 Author: Andy Shevchenko Date: Tue Mar 1 00:39:32 2022 +0200 ACPI: docs: enumeration: Remove redundant .owner assignment The owner member of the struct i2c_driver is assigned by a corresponding macro. No need to assign it explicitly. Fixes: 59c3987805a9 ("ACPI: add documentation about ACPI 5 enumeration") Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki Documentation/firmware-guide/acpi/enumeration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d72f06cee0d5cad0056967f0edc2c23b984238ba Author: Andy Shevchenko Date: Tue Mar 1 00:39:31 2022 +0200 ACPI: docs: enumeration: Update UART serial bus resource documentation In some cases UART serial bus resource may be represented by struct serdev_device. Fixes: 53c7626356c7 ("serdev: Add ACPI support") Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki Documentation/firmware-guide/acpi/enumeration.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) commit b625fe694626992c1d640b37c691cfcfc58d6006 Author: Andy Shevchenko Date: Tue Mar 1 00:39:30 2022 +0200 ACPI: docs: enumeration: Discourage to use custom _DSM methods Since we have _DSD established and specified (ACPI v5.1+) there is no need to use custom _DSM methods. Rewrite documentation to use _DSD. Fixes: f60e7074902a ("misc: at25: Make use of device property API") Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki Documentation/firmware-guide/acpi/enumeration.rst | 48 ++++++++++------------- 1 file changed, 21 insertions(+), 27 deletions(-) commit 27e932a31496f75b78ea41fd5ccadd0f75d8e8be Author: Shuai Xue Date: Sun Feb 27 20:25:46 2022 +0800 ACPI: APEI: rename ghes_init() with an "acpi_" prefix ghes_init() sticks out in acpi_init() because it is the only functions without an "acpi_" prefix. Rename ghes_init with an "acpi_" prefix, then all looks fine. Signed-off-by: Shuai Xue Signed-off-by: Rafael J. Wysocki drivers/acpi/apei/ghes.c | 2 +- drivers/acpi/bus.c | 2 +- include/acpi/apei.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) commit dc4e8c07e9e2f69387579c49caca26ba239f7270 Author: Shuai Xue Date: Sun Feb 27 20:25:45 2022 +0800 ACPI: APEI: explicit init of HEST and GHES in apci_init() From commit e147133a42cb ("ACPI / APEI: Make hest.c manage the estatus memory pool") was merged, ghes_init() relies on acpi_hest_init() to manage the estatus memory pool. On the other hand, ghes_init() relies on sdei_init() to detect the SDEI version and (un)register events. The dependencies are as follows: ghes_init() => acpi_hest_init() => acpi_bus_init() => acpi_init() ghes_init() => sdei_init() HEST is not PCI-specific and initcall ordering is implicit and not well-defined within a level. Based on above, remove acpi_hest_init() from acpi_pci_root_init() and convert ghes_init() and sdei_init() from initcalls to explicit calls in the following order: acpi_hest_init() ghes_init() sdei_init() Signed-off-by: Shuai Xue Signed-off-by: Rafael J. Wysocki drivers/acpi/apei/ghes.c | 19 ++++++++----------- drivers/acpi/bus.c | 2 ++ drivers/acpi/pci_root.c | 3 --- drivers/firmware/Kconfig | 1 + drivers/firmware/arm_sdei.c | 13 ++----------- include/acpi/apei.h | 4 +++- include/linux/arm_sdei.h | 2 ++ 7 files changed, 18 insertions(+), 26 deletions(-) commit eb087f305919ee8169ad65665610313e74260463 Author: Mario Limonciello Date: Fri Feb 25 13:06:46 2022 -0600 ACPI: processor idle: Check for architectural support for LPI When `osc_pc_lpi_support_confirmed` is set through `_OSC` and `_LPI` is populated then the cpuidle driver assumes that LPI is fully functional. However currently the kernel only provides architectural support for LPI on ARM. This leads to high power consumption on X86 platforms that otherwise try to enable LPI. So probe whether or not LPI support is implemented before enabling LPI in the kernel. This is done by overloading `acpi_processor_ffh_lpi_probe` to check whether it returns `-EOPNOTSUPP`. It also means that all future implementations of `acpi_processor_ffh_lpi_probe` will need to follow these semantics as well. Reviewed-by: Sudeep Holla Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki drivers/acpi/processor_idle.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) commit 01f6c7338ce267959975da65d86ba34f44d54220 Author: Mario Limonciello Date: Fri Feb 25 13:06:45 2022 -0600 cpuidle: PSCI: Move the `has_lpi` check to the beginning of the function Currently the first thing checked is whether the PCSI cpu_suspend function has been initialized. Another change will be overloading `acpi_processor_ffh_lpi_probe` and calling it sooner. So make the `has_lpi` check the first thing checked to prepare for that change. Reviewed-by: Sudeep Holla Signed-off-by: Mario Limonciello Signed-off-by: Rafael J. Wysocki arch/arm64/kernel/cpuidle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit fb916db1f04f8c5f005fafcbe6ae01f40abd6aff Author: Jacob Keller Date: Wed Feb 16 13:37:37 2022 -0800 ice: introduce VF accessor functions Before we switch the VF data structure storage mechanism to a hash, introduce new accessor functions to define the new interface. * ice_get_vf_by_id is a function used to obtain a reference to a VF from the table based on its VF ID * ice_has_vfs is used to quickly check if any VFs are configured * ice_get_num_vfs is used to get an exact count of how many VFs are configured We can drop the old ice_validate_vf_id function, since every caller was just going to immediately access the VF table to get a reference anyways. This way we simply use the single ice_get_vf_by_id to both validate the VF ID is within range and that there exists a VF with that ID. This change enables us to more easily convert the codebase to the hash table since most callers now properly use the interface. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_eswitch.c | 6 +- drivers/net/ethernet/intel/ice/ice_ethtool.c | 2 +- drivers/net/ethernet/intel/ice/ice_lib.c | 4 +- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 131 +++++++++++++++-------- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | 25 +++++ 5 files changed, 115 insertions(+), 53 deletions(-) commit 000773c00f52f2a6084ec04c2efdc2a28ee29d9c Author: Jacob Keller Date: Wed Feb 16 13:37:36 2022 -0800 ice: factor VF variables to separate structure We maintain a number of values for VFs within the ice_pf structure. This includes the VF table, the number of allocated VFs, the maximum number of supported SR-IOV VFs, the number of queue pairs per VF, the number of MSI-X vectors per VF, and a bitmap of the VFs with detected MDD events. We're about to add a few more variables to this list. Clean this up first by extracting these members out into a new ice_vfs structure defined in ice_virtchnl_pf.h Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice.h | 10 +-- drivers/net/ethernet/intel/ice/ice_eswitch.c | 20 +++-- drivers/net/ethernet/intel/ice/ice_ethtool.c | 2 +- drivers/net/ethernet/intel/ice/ice_lib.c | 8 +- drivers/net/ethernet/intel/ice/ice_main.c | 2 +- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 94 ++++++++++++------------ drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | 15 +++- 7 files changed, 83 insertions(+), 68 deletions(-) commit 3dc8a1f6f64481a8a5a669633e880f26dae0d752 Author: Dongdong Liu Date: Tue Jan 18 17:21:17 2022 +0800 PCI: Support BAR sizes up to 8TB Current kernel reports that BARs larger than 128GB, e.g., this 4TB BAR, are disabled: pci 0000:01:00.0: disabling BAR 4: [mem 0x00000000-0x3ffffffffff 64bit pref] (bad alignment 0x40000000000) Increase the maximum BAR size from 128GB to 8TB for future expansion. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20220118092117.10089-1-liudongdong3@huawei.com Signed-off-by: Dongdong Liu Signed-off-by: Bjorn Helgaas drivers/pci/setup-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d90a25f86dc83df9ce7f1446372cda8029e87f7c Author: Christoph Hellwig Date: Wed Feb 16 15:31:38 2022 +1100 mm: build migrate_vma_* for all configs with ZONE_DEVICE support This code will be used for device coherent memory as well in a bit, so relax the ifdef a bit. Link: https://lkml.kernel.org/r/20220210072828.2930359-15-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Alistair Popple Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Ben Skeggs Cc: Chaitanya Kulkarni Cc: Christian Knig Cc: Dan Williams Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Karol Herbst Cc: Logan Gunthorpe Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) mm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 76cbbead253ddcae9878be0d702208bb1e4fac6f Author: Christoph Hellwig Date: Wed Feb 16 15:31:38 2022 +1100 mm: move the migrate_vma_* device migration code into its own file Split the code used to migrate to and from ZONE_DEVICE memory from migrate.c into a new file. Link: https://lkml.kernel.org/r/20220210072828.2930359-14-hch@lst.de Signed-off-by: Christoph Hellwig Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Chaitanya Kulkarni Cc: Christian Knig Cc: Dan Williams Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Karol Herbst Cc: Logan Gunthorpe Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) mm/Kconfig | 3 + mm/Makefile | 1 + mm/migrate.c | 753 --------------------------------------------------- mm/migrate_device.c | 766 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 770 insertions(+), 753 deletions(-) commit aaf7d70cc595c78d27e915451e93a4459cfc36f3 Author: Christoph Hellwig Date: Wed Feb 16 15:31:37 2022 +1100 mm: refactor the ZONE_DEVICE handling in migrate_vma_pages Make the flow a little more clear and prepare for adding a new ZONE_DEVICE memory type. Link: https://lkml.kernel.org/r/20220210072828.2930359-13-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Alistair Popple Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Ben Skeggs Cc: Chaitanya Kulkarni Cc: Christian Knig Cc: Dan Williams Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Karol Herbst Cc: Logan Gunthorpe Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) mm/migrate.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) commit 1776c0d102482d4aeccd56e404285bc47a481be8 Author: Christoph Hellwig Date: Wed Feb 16 15:31:37 2022 +1100 mm: refactor the ZONE_DEVICE handling in migrate_vma_insert_page Make the flow a little more clear and prepare for adding a new ZONE_DEVICE memory type. Link: https://lkml.kernel.org/r/20220210072828.2930359-12-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Alistair Popple Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Ben Skeggs Cc: Chaitanya Kulkarni Cc: Christian Knig Cc: Dan Williams Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Karol Herbst Cc: Logan Gunthorpe Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) mm/migrate.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) commit f9f38f78c5d5eef3717b48d84263b4b46ee0110a Author: Christoph Hellwig Date: Wed Feb 16 15:31:37 2022 +1100 mm: refactor check_and_migrate_movable_pages Remove up to two levels of indentation by using continue statements and move variables to local scope where possible. Link: https://lkml.kernel.org/r/20220210072828.2930359-11-hch@lst.de Signed-off-by: Christoph Hellwig Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Chaitanya Kulkarni Cc: Christian Knig Cc: Dan Williams Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Karol Herbst Cc: Logan Gunthorpe Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) mm/gup.c | 81 +++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 37 deletions(-) commit 5cbf9942c9630f82bd71dfac141e6c1b511a9460 Author: Christoph Hellwig Date: Wed Feb 16 15:31:37 2022 +1100 mm: generalize the pgmap based page_free infrastructure Key off on the existence of ->page_free to prepare for adding support for more pgmap types that are device managed and thus need the free callback. Link: https://lkml.kernel.org/r/20220210072828.2930359-10-hch@lst.de Signed-off-by: Christoph Hellwig Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Chaitanya Kulkarni Cc: Christian Knig Cc: Dan Williams Cc: Felix Kuehling Cc: Jason Gunthorpe Cc: Karol Herbst Cc: Logan Gunthorpe Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) mm/memremap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit f74515986e63516e81f6656e974ba6eb69ba7f19 Author: Christoph Hellwig Date: Wed Feb 16 15:31:37 2022 +1100 fsdax: depend on ZONE_DEVICE || FS_DAX_LIMITED Add a depends on ZONE_DEVICE support or the s390-specific limited DAX support, as one of the two is required at runtime for fsdax code to actually work. Link: https://lkml.kernel.org/r/20220210072828.2930359-9-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Chaitanya Kulkarni Cc: Christian Knig Cc: Dan Williams Cc: Felix Kuehling Cc: Karol Herbst Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) fs/Kconfig | 1 + 1 file changed, 1 insertion(+) commit 27674ef6c73f0c9096a9827dc5d6ba9fc7808422 Author: Christoph Hellwig Date: Wed Feb 16 15:31:36 2022 +1100 mm: remove the extra ZONE_DEVICE struct page refcount ZONE_DEVICE struct pages have an extra reference count that complicates the code for put_page() and several places in the kernel that need to check the reference count to see that a page is not being used (gup, compaction, migration, etc.). Clean up the code so the reference count doesn't need to be treated specially for ZONE_DEVICE pages. Note that this excludes the special idle page wakeup for fsdax pages, which still happens at refcount 1. This is a separate issue and will be sorted out later. Given that only fsdax pages require the notifiacation when the refcount hits 1 now, the PAGEMAP_OPS Kconfig symbol can go away and be replaced with a FS_DAX check for this hook in the put_page fastpath. Based on an earlier patch from Ralph Campbell . Link: https://lkml.kernel.org/r/20220210072828.2930359-8-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Reviewed-by: Ralph Campbell Reviewed-by: Jason Gunthorpe Reviewed-by: Dan Williams Acked-by: Felix Kuehling Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Chaitanya Kulkarni Cc: Christian Knig Cc: Karol Herbst Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) arch/powerpc/kvm/book3s_hv_uvmem.c | 1 - drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 1 - drivers/gpu/drm/nouveau/nouveau_dmem.c | 1 - fs/Kconfig | 1 - include/linux/memremap.h | 12 +++---- include/linux/mm.h | 6 ++-- lib/test_hmm.c | 1 - mm/Kconfig | 4 --- mm/internal.h | 2 ++ mm/memcontrol.c | 11 ++---- mm/memremap.c | 57 +++++++++++--------------------- mm/migrate.c | 6 ---- mm/swap.c | 16 +++------ 13 files changed, 36 insertions(+), 83 deletions(-) commit dc90f0846df4870b6cc8528c31e5c60f18fb68be Author: Christoph Hellwig Date: Wed Feb 16 15:31:36 2022 +1100 mm: don't include in Move the check for the actual pgmap types that need the free at refcount one behavior into the out of line helper, and thus avoid the need to pull memremap.h into mm.h. Link: https://lkml.kernel.org/r/20220210072828.2930359-7-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe Reviewed-by: Dan Williams Acked-by: Felix Kuehling Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Chaitanya Kulkarni Cc: Karol Herbst Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) arch/arm64/mm/mmu.c | 1 + arch/powerpc/kvm/book3s_hv_uvmem.c | 1 + arch/powerpc/mm/book3s64/pgtable.c | 1 + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 + drivers/gpu/drm/drm_cache.c | 2 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 1 + drivers/gpu/drm/nouveau/nouveau_svm.c | 1 + drivers/infiniband/core/rw.c | 1 + drivers/nvdimm/pmem.h | 1 + drivers/nvme/host/pci.c | 1 + drivers/nvme/target/io-cmd-bdev.c | 1 + fs/fuse/virtio_fs.c | 1 + fs/proc/page.c | 1 + include/linux/memremap.h | 18 ++++++++++++++++++ include/linux/mm.h | 20 -------------------- lib/test_hmm.c | 1 + mm/memcontrol.c | 1 + mm/memremap.c | 6 +++++- 18 files changed, 38 insertions(+), 22 deletions(-) commit 895749455f6054e0c7b40a6ec449a3ab6db51bdd Author: Christoph Hellwig Date: Wed Feb 16 15:31:35 2022 +1100 mm: simplify freeing of devmap managed pages Make put_devmap_managed_page return if it took charge of the page or not and remove the separate page_is_devmap_managed helper. Link: https://lkml.kernel.org/r/20220210072828.2930359-6-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe Reviewed-by: Chaitanya Kulkarni Reviewed-by: Dan Williams Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Christian Knig Cc: Felix Kuehling Cc: Karol Herbst Cc: Lyude Paul Cc: Miaohe Lin Cc: Muchun Song Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) include/linux/mm.h | 34 ++++++++++------------------------ mm/memremap.c | 20 +++++++++----------- mm/swap.c | 10 +--------- 3 files changed, 20 insertions(+), 44 deletions(-) commit 75e55d8a107edb2fd6e02b1fa8a81531209cda04 Author: Christoph Hellwig Date: Wed Feb 16 15:31:35 2022 +1100 mm: move free_devmap_managed_page to memremap.c free_devmap_managed_page has nothing to do with the code in swap.c, move it to live with the rest of the code for devmap handling. Link: https://lkml.kernel.org/r/20220210072828.2930359-5-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe Reviewed-by: Chaitanya Kulkarni Reviewed-by: Muchun Song Reviewed-by: Dan Williams Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Christian Knig Cc: Felix Kuehling Cc: Karol Herbst Cc: Lyude Paul Cc: Miaohe Lin Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) include/linux/mm.h | 1 - mm/memremap.c | 21 +++++++++++++++++++++ mm/swap.c | 23 ----------------------- 3 files changed, 21 insertions(+), 24 deletions(-) commit 730ff52194cdb324b7680e5054c546f7b52de8a2 Author: Christoph Hellwig Date: Wed Feb 16 15:31:35 2022 +1100 mm: remove pointless includes from hmm.h pulls in the world for no good reason at all. Remove the includes and push a few ones into the users instead. Link: https://lkml.kernel.org/r/20220210072828.2930359-4-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe Reviewed-by: Chaitanya Kulkarni Reviewed-by: Muchun Song Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Christian Knig Cc: Dan Williams Cc: Felix Kuehling Cc: Karol Herbst Cc: Lyude Paul Cc: Miaohe Lin Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 1 + drivers/gpu/drm/nouveau/nouveau_dmem.c | 1 + include/linux/hmm.h | 9 ++------- lib/test_hmm.c | 2 ++ 4 files changed, 6 insertions(+), 7 deletions(-) commit 5c3f1f9cc4cbbf491233982b5975ae2d284de5df Author: Christoph Hellwig Date: Wed Feb 16 15:31:35 2022 +1100 mm: remove the __KERNEL__ guard from __KERNEL__ ifdefs don't make sense outside of include/uapi/. Link: https://lkml.kernel.org/r/20220210072828.2930359-3-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe Reviewed-by: Chaitanya Kulkarni Reviewed-by: Muchun Song Reviewed-by: Dan Williams Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Alex Deucher Cc: Alistair Popple Cc: Ben Skeggs Cc: Christian Knig Cc: Felix Kuehling Cc: Karol Herbst Cc: Lyude Paul Cc: Miaohe Lin Cc: "Pan, Xinhui" Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) include/linux/mm.h | 4 ---- 1 file changed, 4 deletions(-) commit be8a80b3e20e3ecb24c2a5f22cd1c9b120341f3e Author: Christoph Hellwig Date: Wed Feb 16 15:31:35 2022 +1100 mm: remove a pointless CONFIG_ZONE_DEVICE check in memremap_pages Patch series "start sorting out the ZONE_DEVICE refcount mess", v2. This series removes the offset by one refcount for ZONE_DEVICE pages that are freed back to the driver owning them, which is just device private ones for now, but also the planned device coherent pages and the ehanced p2p ones pending. It does not address the fsdax pages yet, which will be attacked in a follow on series. This patch (of 27): memremap.c is only built when CONFIG_ZONE_DEVICE is set, so remove the superflous extra check. Link: https://lkml.kernel.org/r/20220210072828.2930359-1-hch@lst.de Link: https://lkml.kernel.org/r/20220210072828.2930359-2-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe Reviewed-by: Chaitanya Kulkarni Reviewed-by: Muchun Song Reviewed-by: Dan Williams Reviewed-by: Miaohe Lin Tested-by: "Sierra Guiza, Alejandro (Alex)" Cc: Felix Kuehling Cc: Alex Deucher Cc: Christian Knig Cc: "Pan, Xinhui" Cc: Ben Skeggs Cc: Karol Herbst Cc: Lyude Paul Cc: Alistair Popple Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Matthew Wilcox (Oracle) mm/memremap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit c8263bd605009355edf781f2dd711de633998475 Author: Hugh Dickins Date: Wed Mar 2 17:35:30 2022 -0800 mm/munlock: mlock_vma_page() check against VM_SPECIAL Although mmap_region() and mlock_fixup() take care that VM_LOCKED is never left set on a VM_SPECIAL vma, there is an interval while file->f_op->mmap() is using vm_insert_page(s), when VM_LOCKED may still be set while VM_SPECIAL bits are added: so mlock_vma_page() should ignore VM_LOCKED while any VM_SPECIAL bits are set. This showed up as a "Bad page" still mlocked, when vfree()ing pages which had been vm_inserted by remap_vmalloc_range_partial(): while release_pages() and __page_cache_release(), and so put_page(), catch pages still mlocked when freeing (and clear_page_mlock() caught them when unmapping), the vfree() path is unprepared for them: fix it? but these pages should not have been mlocked in the first place. I assume that an mlockall(MCL_FUTURE) had been done in the past; or maybe the user got to specify MAP_LOCKED on a vmalloc'ing driver mmap. Signed-off-by: Hugh Dickins Signed-off-by: Matthew Wilcox (Oracle) mm/internal.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit f8a665b1594799fb25fa9cd6a623469707c69c16 Merge: b042b27868c0 26a17b12d7f3 6e031ec0e5a2 Author: Alex Williamson Date: Thu Mar 3 09:55:34 2022 -0700 Merge branches 'v5.18/vfio/next/mlx5-migration-v10', 'v5.18/vfio/next/pm-fixes' and 'v5.18/vfio/next/uml-build-fix' into v5.18/vfio/next/next commit b042b27868c00142da1a7e31f4740a5fbd5628ed Merge: cfb92440ee71 88faa5e8ead6 Author: Alex Williamson Date: Thu Mar 3 09:51:03 2022 -0700 Merge tag 'mlx5-vfio-v10' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux into v5.18/vfio/next/mlx5-migration-v10 Add mlx5 live migration driver and v2 migration protocol This series adds mlx5 live migration driver for VFs that are migration capable and includes the v2 migration protocol definition and mlx5 implementation. The mlx5 driver uses the vfio_pci_core split to create a specific VFIO PCI driver that matches the mlx5 virtual functions. The driver provides the same experience as normal vfio-pci with the addition of migration support. In HW the migration is controlled by the PF function, using its mlx5_core driver, and the VFIO PCI VF driver co-ordinates with the PF to execute the migration actions. The bulk of the v2 migration protocol is semantically the same v1, however it has been recast into a FSM for the device_state and the actual syscall interface uses normal ioctl(), read() and write() instead of building a syscall interface using the region. Several bits of infrastructure work are included here: - pci_iov_vf_id() to help drivers like mlx5 figure out the VF index from a BDF - pci_iov_get_pf_drvdata() to clarify the tricky locking protocol when a VF reaches into its PF's driver - mlx5_core uses the normal SRIOV lifecycle and disables SRIOV before driver remove, to be compatible with pci_iov_get_pf_drvdata() - Lifting VFIO_DEVICE_FEATURE into core VFIO code This series comes after alot of discussion. Some major points: - v1 ABI compatible migration defined using the same FSM approach: https://lore.kernel.org/all/0-v1-a4f7cab64938+3f-vfio_mig_states_jgg@nvidia.com/ - Attempts to clarify how the v1 API works: Alex's: https://lore.kernel.org/kvm/163909282574.728533.7460416142511440919.stgit@omen/ Jason's: https://lore.kernel.org/all/0-v3-184b374ad0a8+24c-vfio_mig_doc_jgg@nvidia.com/ - Etherpad exploring the scope and questions of general VFIO migration: https://lore.kernel.org/kvm/87mtm2loml.fsf@redhat.com/ NOTE: As this series touched mlx5_core parts we need to send this in a pull request format to VFIO to avoid conflicts. Matching qemu changes can be previewed here: https://github.com/jgunthorpe/qemu/commits/vfio_migration_v2 Link: https://lore.kernel.org/all/20220224142024.147653-1-yishaih@nvidia.com Signed-of-by: Leon Romanovsky commit c4c2c7db64e19f815956c750c461d67867f1cdaf Author: Jacob Keller Date: Wed Feb 16 13:37:35 2022 -0800 ice: convert ice_for_each_vf to include VF entry iterator The ice_for_each_vf macro is intended to be used to loop over all VFs. The current implementation relies on an iterator that is the index into the VF array in the PF structure. This forces all users to perform a look up themselves. This abstraction forces a lot of duplicate work on callers and leaks the interface implementation to the caller. Replace this with an implementation that includes the VF pointer the primary iterator. This version simplifies callers which just want to iterate over every VF, as they no longer need to perform their own lookup. The "i" iterator value is replaced with a new unsigned int "bkt" parameter, as this will match the necessary interface for replacing the VF array with a hash table. For now, the bkt is the VF ID, but in the future it will simply be the hash bucket index. Document that it should not be treated as a VF ID. This change aims to simplify switching from the array to a hash table. I considered alternative implementations such as an xarray but decided that the hash table was the simplest and most suitable implementation. I also looked at methods to hide the bkt iterator entirely, but I couldn't come up with a feasible solution that worked for hash table iterators. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_eswitch.c | 63 ++++----- drivers/net/ethernet/intel/ice/ice_ethtool.c | 7 +- drivers/net/ethernet/intel/ice/ice_lib.c | 21 ++- drivers/net/ethernet/intel/ice/ice_main.c | 44 +++---- drivers/net/ethernet/intel/ice/ice_repr.c | 15 +-- drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 6 +- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 143 +++++++++++---------- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | 16 ++- 8 files changed, 163 insertions(+), 152 deletions(-) commit 19281e866808840d2de3f79a929c361b54b017d9 Author: Jacob Keller Date: Wed Feb 16 13:37:34 2022 -0800 ice: use ice_for_each_vf for iteration during removal When removing VFs, the driver takes a weird approach of assigning pf->num_alloc_vfs to 0 before iterating over the VFs using a temporary variable. This logic has been in the driver for a long time, and seems to have been carried forward from i40e. We want to refactor the way VFs are stored, and iterating over the data structure without the ice_for_each_vf interface impedes this work. The logic relies on implicitly using the num_alloc_vfs as a sort of "safe guard" for accessing VF data. While this sort of guard makes sense for Single Root IOV where all VFs are added at once, the data structures don't work for VFs which can be added and removed dynamically. We also have a separate state flag, ICE_VF_DEINIT_IN_PROGRESS which is a stronger protection against concurrent removal and access. Avoid the custom tmp iteration and replace it with the standard ice_for_each_vf iterator. Delay the assignment of num_alloc_vfs until after this loop finishes. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 59e1f857e37795e2aaf73d083be6eb472fe8fcc8 Author: Jacob Keller Date: Wed Feb 16 13:37:33 2022 -0800 ice: remove checks in ice_vc_send_msg_to_vf The ice_vc_send_msg_to_vf function is used by the PF to send a response to a VF. This function has overzealous checks to ensure its not passed a NULL VF pointer and to ensure that the passed in struct ice_vf has a valid vf_id sub-member. These checks have existed since commit 1071a8358a28 ("ice: Implement virtchnl commands for AVF support") and function as simple sanity checks. We are planning to refactor the ice driver to use a hash table along with appropriate locks in a future refactor. This change will modify how the ice_validate_vf_id function works. Instead of a simple >= check to ensure the VF ID is between some range, it will check the hash table to see if the specified VF ID is actually in the table. This requires that the function properly lock the table to prevent race conditions. The checks may seem ok at first glance, but they don't really provide much benefit. In order for ice_vc_send_msg_to_vf to have these checks fail, the callers must either (1) pass NULL as the VF, (2) construct an invalid VF pointer manually, or (3) be using a VF pointer which becomes invalid after they obtain it properly using ice_get_vf_by_id. For (1), a cursory glance over callers of ice_vc_send_msg_to_vf can show that in most cases the functions already operate assuming their VF pointer is valid, such as by derferencing vf->pf or other members. They obtain the VF pointer by accessing the VF array using the VF ID, which can never produce a NULL value (since its a simple address operation on the array it will not be NULL. The sole exception for (1) is that ice_vc_process_vf_msg will forward a NULL VF pointer to this function as part of its goto error handler logic. This requires some minor cleanup to simply exit immediately when an invalid VF ID is detected (Rather than use the same error flow as the rest of the function). For (2), it is unexpected for a flow to construct a VF pointer manually instead of accessing the VF array. Defending against this is likely to just hide bad programming. For (3), it is definitely true that VF pointers could become invalid, for example if a thread is processing a VF message while the VF gets removed. However, the correct solution is not to add additional checks like this which do not guarantee to prevent the race. Instead we plan to solve the root of the problem by preventing the possibility entirely. This solution will require the change to a hash table with proper locking and reference counts of the VF structures. When this is done, ice_validate_vf_id will require locking of the hash table. This will be problematic because all of the callers of ice_vc_send_msg_to_vf will already have to take the lock to obtain the VF pointer anyways. With a mutex, this leads to a double lock that could hang the kernel thread. Avoid this by removing the checks which don't provide much value, so that we can safely add the necessary protections properly. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) commit 44efe75f736f489892a71fb5b69e6f2271327613 Author: Jacob Keller Date: Wed Feb 16 13:37:32 2022 -0800 ice: move VFLR acknowledge during ice_free_vfs After removing all VFs, the driver clears the VFLR indication for VFs. This has been in ice since the beginning of SR-IOV support in the ice driver. The implementation was copied from i40e, and the motivation for the VFLR indication clearing is described in the commit f7414531a0cf ("i40e: acknowledge VFLR when disabling SR-IOV") The commit explains that we need to clear the VFLR indication because the virtual function undergoes a VFLR event. If we don't indicate that it is complete it can cause an issue when VFs are re-enabled due to a "phantom" VFLR. The register block read was added under a pci_vfs_assigned check originally. This was done because we added the check after calling pci_disable_sriov. This was later moved to disable SRIOV earlier in the flow so that the VF drivers could be torn down before we removed functionality. Move the VFLR acknowledge into the main loop that tears down VF resources. This avoids using the tmp value for iterating over VFs multiple times. The result will make it easier to refactor the VF array in a future change. It's possible we might want to modify this flow to also stop checking pci_vfs_assigned. However, it seems reasonable to keep this change: we should only clear the VFLR if we actually disabled SR-IOV. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 27 +++++++----------------- 1 file changed, 8 insertions(+), 19 deletions(-) commit 294627a67e964d3000357e8ac57cc26f049da296 Author: Jacob Keller Date: Wed Feb 16 13:37:31 2022 -0800 ice: move clear_malvf call in ice_free_vfs The ice_mbx_clear_malvf function is used to clear the indication and count of how many times a VF was detected as malicious. During ice_free_vfs, we use this function to ensure that all removed VFs are reset to a clean state. The call currently is done at the end of ice_free_vfs() using a tmp value to iterate over all of the entries in the bitmap. This separate iteration using tmp is problematic for a planned refactor of the VF array data structure. To avoid this, lets move the call slightly higher into the function inside the loop where we teardown all of the VFs. This avoids one use of the tmp value used for iteration. We'll fix the other user in a future change. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) commit cd0f4f3b2c048fe99ccd2e0df2c0900408ce8507 Author: Jacob Keller Date: Wed Feb 16 13:37:30 2022 -0800 ice: pass num_vfs to ice_set_per_vf_res() We are planning to replace the simple array structure tracking VFs with a hash table. This change will also remove the "num_alloc_vfs" variable. Instead, new access functions to use the hash table as the source of truth will be introduced. These will generally be equivalent to existing checks, except during VF initialization. Specifically, ice_set_per_vf_res() cannot use the hash table as it will be operating prior to VF structures being inserted into the hash table. Instead of using pf->num_alloc_vfs, simply pass the num_vfs value in from the caller. Note that a sub-function of ice_set_per_vf_res, ice_determine_res, also implicitly depends on pf->num_alloc_vfs. Replace ice_determine_res with a simpler inline implementation based on rounddown_pow_of_two. Note that we must explicitly check that the argument is non-zero since it does not play well with zero as a value. Instead of using the function and while loop, simply calculate the number of queues we have available by dividing by num_vfs. Check if the desired queues are available. If not, round down to the nearest power of 2 that fits within our available queues. This matches the behavior of ice_determine_res but is easier to follow as simple in-line logic. Remove ice_determine_res entirely. With this change, we no longer depend on the pf->num_alloc_vfs during the initialization phase of VFs. This will allow us to safely remove it in a future planned refactor of the VF data structures. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 87 +++++++----------------- 1 file changed, 26 insertions(+), 61 deletions(-) commit b03d519d3460f3aaf8b5afef582dd98466925352 Author: Jacob Keller Date: Wed Feb 16 13:37:29 2022 -0800 ice: store VF pointer instead of VF ID The VSI structure contains a vf_id field used to associate a VSI with a VF. This is used mainly for ICE_VSI_VF as well as partially for ICE_VSI_CTRL associated with the VFs. This API was designed with the idea that VFs are stored in a simple array that was expected to be static throughout most of the driver's life. We plan on refactoring VF storage in a few key ways: 1) converting from a simple static array to a hash table 2) using krefs to track VF references obtained from the hash table 3) use RCU to delay release of VF memory until after all references are dropped This is motivated by the goal to ensure that the lifetime of VF structures is accounted for, and prevent various use-after-free bugs. With the existing vsi->vf_id, the reference tracking for VFs would become somewhat convoluted, because each VSI maintains a vf_id field which will then require performing a look up. This means all these flows will require reference tracking and proper usage of rcu_read_lock, etc. We know that the VF VSI will always be backed by a valid VF structure, because the VSI is created during VF initialization and removed before the VF is destroyed. Rely on this and store a reference to the VF in the VSI structure instead of storing a VF ID. This will simplify the usage and avoid the need to perform lookups on the hash table in the future. For ICE_VSI_VF, it is expected that vsi->vf is always non-NULL after ice_vsi_alloc succeeds. Because of this, use WARN_ON when checking if a vsi->vf pointer is valid when dealing with VF VSIs. This will aid in debugging code which violates this assumption and avoid more disastrous panics. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice.h | 3 +- drivers/net/ethernet/intel/ice/ice_base.c | 4 +- drivers/net/ethernet/intel/ice/ice_eswitch.c | 7 +- drivers/net/ethernet/intel/ice/ice_lib.c | 178 +++++++++++++-------- drivers/net/ethernet/intel/ice/ice_lib.h | 3 +- drivers/net/ethernet/intel/ice/ice_main.c | 10 +- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- .../net/ethernet/intel/ice/ice_vf_vsi_vlan_ops.c | 19 ++- drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 5 +- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 6 +- 10 files changed, 142 insertions(+), 95 deletions(-) commit df830543d63c9a8e4594d92c0c1ffb48c240947f Author: Jacob Keller Date: Wed Feb 16 13:37:28 2022 -0800 ice: refactor unwind cleanup in eswitch mode The code for supporting eswitch mode and port representors on VFs uses an unwind based cleanup flow when handling errors. These flows are used to cleanup and get everything back to the state prior to attempting to switch from legacy to representor mode or back. The unwind iterations make sense, but complicate a plan to refactor the VF array structure. In the future we won't have a clean method of reversing an iteration of the VFs. Instead, we can change the cleanup flow to just iterate over all VF structures and clean up appropriately. First notice that ice_repr_add_for_all_vfs and ice_repr_rem_from_all_vfs have an additional step of re-assigning the VC ops. There is no good reason to do this outside of ice_repr_add and ice_repr_rem. It can simply be done as the last step of these functions. Second, make sure ice_repr_rem is safe to call on a VF which does not have a representor. Check if vf->repr is NULL first and exit early if so. Move ice_repr_rem_from_all_vfs above ice_repr_add_for_all_vfs so that we can call it from the cleanup function. In ice_eswitch.c, replace the unwind iteration with a call to ice_eswitch_release_reprs. This will go through all of the VFs and revert the VF back to the standard model without the eswitch mode. To make this safe, ensure this function checks whether or not the represent or has been moved. Rely on the metadata destination in vf->repr->dst. This must be NULL if the representor has not been moved to eswitch mode. Ensure that we always re-assign this value back to NULL after freeing it, and move the ice_eswitch_release_reprs so that it can be called from the setup function. With these changes, eswitch cleanup no longer uses an unwind flow that is problematic for the planned VF data structure change. Signed-off-by: Jacob Keller Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen drivers/net/ethernet/intel/ice/ice_eswitch.c | 63 ++++++++++++++-------------- drivers/net/ethernet/intel/ice/ice_repr.c | 45 ++++++++++---------- 2 files changed, 53 insertions(+), 55 deletions(-) commit 7df5072cc05fd1aab5823bbc465d033cd292fca8 Author: Mykola Lysenko Date: Tue Mar 1 14:27:45 2022 -0800 bpf: Small BPF verifier log improvements In particular these include: 1) Remove output of inv for scalars in print_verifier_state 2) Replace inv with scalar in verifier error messages 3) Remove _value suffixes for umin/umax/s32_min/etc (except map_value) 4) Remove output of id=0 5) Remove output of ref_obj_id=0 Signed-off-by: Mykola Lysenko Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220301222745.1667206-1-mykolal@fb.com kernel/bpf/verifier.c | 64 +++--- tools/testing/selftests/bpf/prog_tests/align.c | 218 ++++++++++----------- tools/testing/selftests/bpf/prog_tests/log_buf.c | 4 +- .../selftests/bpf/verifier/atomic_invalid.c | 6 +- tools/testing/selftests/bpf/verifier/bounds.c | 4 +- tools/testing/selftests/bpf/verifier/calls.c | 6 +- tools/testing/selftests/bpf/verifier/ctx.c | 4 +- .../selftests/bpf/verifier/direct_packet_access.c | 2 +- .../selftests/bpf/verifier/helper_access_var_len.c | 6 +- tools/testing/selftests/bpf/verifier/jmp32.c | 16 +- tools/testing/selftests/bpf/verifier/precise.c | 4 +- tools/testing/selftests/bpf/verifier/raw_stack.c | 4 +- .../testing/selftests/bpf/verifier/ref_tracking.c | 6 +- .../selftests/bpf/verifier/search_pruning.c | 2 +- tools/testing/selftests/bpf/verifier/sock.c | 2 +- tools/testing/selftests/bpf/verifier/spill_fill.c | 38 ++-- tools/testing/selftests/bpf/verifier/unpriv.c | 4 +- .../selftests/bpf/verifier/value_illegal_alu.c | 4 +- .../selftests/bpf/verifier/value_ptr_arith.c | 4 +- tools/testing/selftests/bpf/verifier/var_off.c | 2 +- 20 files changed, 203 insertions(+), 197 deletions(-) commit 266fa94673d325f489f74d0a9a12024a7f1ee49c Author: Srinivas Kandagatla Date: Thu Mar 3 11:03:21 2022 +0000 soundwire: qcom: use __maybe_unused for swrm_runtime_resume() swrm_runtime_resume() would not be defined when CONFIG_PM=n This causes below build failure drivers/soundwire/qcom.c:1460:12: error: 'swrm_runtime_resume' defined but not used [-Werror=unused-function] Mark the resume swrm_runtime_resume() with __maybe_unused attribute. Reported-by: Geert Uytterhoeven Reported-by: Stephen Rothwell Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220303110321.23666-1-srinivas.kandagatla@linaro.org [redo commit title and log] Signed-off-by: Vinod Koul drivers/soundwire/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c48d8c5c0c40bb2e7c88543ede481c26f6649d14 Merge: df00b1d26c3c 2079f41ec6ff Author: Jens Axboe Date: Thu Mar 3 08:51:48 2022 -0700 Merge tag 'nvme-5.18-2022-03-03' of git://git.infradead.org/nvme into for-5.18/drivers Pull NVMe updates from Christoph: "nvme updates for Linux 5.18 - add vectored-io support for user-passthrough (Kanchan Joshi) - add verbose error logging (Alan Adamson) - support buffered I/O on block devices in nvmet (Chaitanya Kulkarni) - central discovery controller support (Martin Belanger) - fix and extended the globally unique idenfier validation (me) - move away from the deprecated IDA APIs (Sagi Grimberg) - misc code cleanup (Keith Busch, Max Gurtovoy, Qinghua Jin, Chaitanya Kulkarni)" * tag 'nvme-5.18-2022-03-03' of git://git.infradead.org/nvme: (27 commits) nvme: check that EUI/GUID/UUID are globally unique nvme: check for duplicate identifiers earlier nvme: fix the check for duplicate unique identifiers nvme: cleanup __nvme_check_ids nvme: remove nssa from struct nvme_ctrl nvme: explicitly set non-error for directives nvme: expose cntrltype and dctype through sysfs nvme: send uevent on connection up nvme: add vectored-io support for user-passthrough nvme: add verbose error logging nvme: add a helper to initialize connect_q nvme-rdma: add helpers for mapping/unmapping request nvmet-tcp: replace ida_simple[get|remove] with the simler ida_[alloc|free] nvmet-rdma: replace ida_simple[get|remove] with the simler ida_[alloc|free] nvmet-fc: replace ida_simple[get|remove] with the simler ida_[alloc|free] nvmet: replace ida_simple[get|remove] with the simler ida_[alloc|free] nvme-fc: replace ida_simple[get|remove] with the simler ida_[alloc|free] nvme: replace ida_simple[get|remove] with the simler ida_[alloc|free] nvmet: allow bdev in buffered_io mode nvmet: use i_size_read() to set size for file-ns ... commit 007e433cf0373334a2bef1b0c9831647184906ba Author: Guenter Roeck Date: Tue Feb 22 14:36:10 2022 -0800 hwmon: Add driver for Texas Instruments TMP464 and TMP468 Add support for Texas Instruments TMP464 and TMP468 temperature sensor ICs. TI's TMP464 is an I2C temperature sensor chip. This chip is similar to TI's TMP421 chip, but with 16bit-wide registers (instead of 8bit-wide registers). The chip has one local sensor and four remote sensors. TMP468 is similar to TMP464 but has one local and eight remote sensors. Originally-from: Agathe Porte Cc: Agathe Porte Cc: Krzysztof Adamski Tested-by: Agathe Porte Link: https://lore.kernel.org/r/20220222223610.23098-2-linux@roeck-us.net Signed-off-by: Guenter Roeck Documentation/hwmon/index.rst | 1 + Documentation/hwmon/tmp464.rst | 73 +++++ MAINTAINERS | 2 + drivers/hwmon/Kconfig | 11 + drivers/hwmon/Makefile | 1 + drivers/hwmon/tmp464.c | 712 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 800 insertions(+) commit b4fa042e92e17f243bdfa2c53e3cd4c8b3dfb56c Author: Agathe Porte Date: Tue Feb 22 14:36:09 2022 -0800 dt-bindings: hwmon: add tmp464.yaml Add basic description of the tmp464 driver DT bindings. Signed-off-by: Agathe Porte Cc: Krzysztof Adamski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220222223610.23098-1-linux@roeck-us.net Signed-off-by: Guenter Roeck .../devicetree/bindings/hwmon/ti,tmp464.yaml | 114 +++++++++++++++++++++ MAINTAINERS | 7 ++ 2 files changed, 121 insertions(+) commit 41332d6e3a430adc91e0af115b4261b0d2f116ec Author: Yuntao Wang Date: Thu Mar 3 08:59:21 2022 +0800 libbpf: Add a check to ensure that page_cnt is non-zero The page_cnt parameter is used to specify the number of memory pages allocated for each per-CPU buffer, it must be non-zero and a power of 2. Currently, the __perf_buffer__new() function attempts to validate that the page_cnt is a power of 2 but forgets checking for the case where page_cnt is zero, we can fix it by replacing 'page_cnt & (page_cnt - 1)' with 'page_cnt == 0 || (page_cnt & (page_cnt - 1))'. If so, we also don't need to add a check in perf_buffer__new_v0_6_0() to make sure that page_cnt is non-zero and the check for zero in perf_buffer__new_raw_v0_6_0() can also be removed. The code will be cleaner and more readable. Signed-off-by: Yuntao Wang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220303005921.53436-1-ytcoode@gmail.com tools/lib/bpf/libbpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit cc5095747edfb054ca2068d01af20be3fcc3634f Author: Theodore Ts'o Date: Thu Mar 3 09:38:47 2022 -0500 ext4: don't BUG if someone dirty pages without asking ext4 first [un]pin_user_pages_remote is dirtying pages without properly warning the file system in advance. A related race was noted by Jan Kara in 2018[1]; however, more recently instead of it being a very hard-to-hit race, it could be reliably triggered by process_vm_writev(2) which was discovered by Syzbot[2]. This is technically a bug in mm/gup.c, but arguably ext4 is fragile in that if some other kernel subsystem dirty pages without properly notifying the file system using page_mkwrite(), ext4 will BUG, while other file systems will not BUG (although data will still be lost). So instead of crashing with a BUG, issue a warning (since there may be potential data loss) and just mark the page as clean to avoid unprivileged denial of service attacks until the problem can be properly fixed. More discussion and background can be found in the thread starting at [2]. [1] https://lore.kernel.org/linux-mm/20180103100430.GE4911@quack2.suse.cz [2] https://lore.kernel.org/r/Yg0m6IjcNmfaSokM@google.com Reported-by: syzbot+d59332e2db681cf18f0318a06e994ebbb529a8db@syzkaller.appspotmail.com Reported-by: Lee Jones Signed-off-by: Theodore Ts'o Link: https://lore.kernel.org/r/YiDS9wVfq4mM2jGK@mit.edu fs/ext4/inode.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit b2963932346f0631c5145f656a22d4237f0956fa Author: Bob Peterson Date: Thu Mar 3 07:32:43 2022 -0500 gfs2: Remove return value for gfs2_indirect_init The return value from function gfs2_indirect_init is never used, so remove it. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher fs/gfs2/bmap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit 98d107b84614a1c6b0b8009feae49c5fb0ef4758 Author: Linyu Yuan Date: Thu Mar 3 13:09:03 2022 +0200 usb: host: xhci: Remove some unnecessary return value initializations The ret/retval will be set when it used, no need to init at definition. [modified subject line -Mathias] Signed-off-by: Linyu Yuan Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220303110903.1662404-10-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit c2b0d55080a2c670fede6e82c7019f4329ab07fe Author: Linyu Yuan Date: Thu Mar 3 13:09:02 2022 +0200 usb: host: xhci: add blank line in xhci_halt() It is more readable to add blank lines. Signed-off-by: Linyu Yuan Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220303110903.1662404-9-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci.c | 3 +++ 1 file changed, 3 insertions(+) commit c63d5757d0fcbcb6cb4ceb038ef1c477a51c0930 Author: Linyu Yuan Date: Thu Mar 3 13:09:01 2022 +0200 usb: host: xhci: update hci_version operation in xhci_gen_setup() There is no need to store temperary value in hcc_params. Signed-off-by: Linyu Yuan Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220303110903.1662404-8-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit ddfaee6255945a59f897033ffb55cfcdc5bcf946 Author: Linyu Yuan Date: Thu Mar 3 13:09:00 2022 +0200 usb: host: xhci: fix a comment typo in xhci_mem_init() It should be Device Context, not doorbell. Signed-off-by: Linyu Yuan Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220303110903.1662404-7-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 81720ec5320c3a02a4b2faf597127de5478cbf02 Author: Linyu Yuan Date: Thu Mar 3 13:08:59 2022 +0200 usb: host: xhci: use ffs() in xhci_mem_init() The for loop to find page size bit can be replaced with ffs(). Signed-off-by: Linyu Yuan Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220303110903.1662404-6-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-mem.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) commit 70c05e4cf63054cd755ca66c1819327b22cb085f Author: Henry Lin Date: Thu Mar 3 13:08:58 2022 +0200 xhci: fix runtime PM imbalance in USB2 resume A race between system resume and device-initiated resume may result in runtime PM imbalance on USB2 root hub. If a device-initiated resume starts and system resume xhci_bus_resume() directs U0 before hub driver sees the resuming device in RESUME state, device-initiated resume will not be finished in xhci_handle_usb2_port_link_resume(). In this case, usb_hcd_end_port_resume() call is missing. This changes calls usb_hcd_end_port_resume() if resuming device reaches U0 to keep runtime PM balance. Fixes: a231ec41e6f6 ("xhci: refactor U0 link state handling in get_port_status") Cc: stable@vger.kernel.org Signed-off-by: Henry Lin Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220303110903.1662404-5-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-hub.c | 3 +++ 1 file changed, 3 insertions(+) commit 05519b8589a679edb8fa781259893d20bece04ad Author: Anssi Hannula Date: Thu Mar 3 13:08:57 2022 +0200 xhci: fix uninitialized string returned by xhci_decode_ctrl_ctx() xhci_decode_ctrl_ctx() returns the untouched buffer as-is if both "drop" and "add" parameters are zero. Fix the function to return an empty string in that case. It was not immediately clear from the possible call chains whether this issue is currently actually triggerable or not. Note that before commit 4843b4b5ec64 ("xhci: fix even more unsafe memory usage in xhci tracing") the result effect in the failure case was different as a static buffer was used here, but the code still worked incorrectly. Fixes: 90d6d5731da7 ("xhci: Add tracing for input control context") Cc: stable@vger.kernel.org Signed-off-by: Anssi Hannula Signed-off-by: Mathias Nyman commit 4843b4b5ec64 ("xhci: fix even more unsafe memory usage in xhci tracing") Link: https://lore.kernel.org/r/20220303110903.1662404-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci.h | 2 ++ 1 file changed, 2 insertions(+) commit 3105bc977d7cbf2edc35e24cc7e009686f6e4a56 Author: Anssi Hannula Date: Thu Mar 3 13:08:56 2022 +0200 xhci: fix garbage USBSTS being logged in some cases xhci_decode_usbsts() is expected to return a zero-terminated string by its only caller, xhci_stop_endpoint_command_watchdog(), which directly logs the return value: xhci_warn(xhci, "USBSTS:%s\n", xhci_decode_usbsts(str, usbsts)); However, if no recognized bits are set in usbsts, the function will return without having called any sprintf() and therefore return an untouched non-zero-terminated caller-provided buffer, causing garbage to be output to log. Fix that by always including the raw value in the output. Note that before commit 4843b4b5ec64 ("xhci: fix even more unsafe memory usage in xhci tracing") the result effect in the failure case was different as a static buffer was used here, but the code still worked incorrectly. Fixes: 9c1aa36efdae ("xhci: Show host status when watchdog triggers and host is assumed dead.") Cc: stable@vger.kernel.org Signed-off-by: Anssi Hannula Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220303110903.1662404-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 14073ce951b5919da450022c050772902f24f054 Author: Mathias Nyman Date: Thu Mar 3 13:08:55 2022 +0200 xhci: make xhci_handshake timeout for xhci_reset() adjustable xhci_reset() timeout was increased from 250ms to 10 seconds in order to give Renesas 720201 xHC enough time to get ready in probe. xhci_reset() is called with interrupts disabled in other places, and waiting for 10 seconds there is not acceptable. Add a timeout parameter to xhci_reset(), and adjust it back to 250ms when called from xhci_stop() or xhci_shutdown() where interrupts are disabled, and successful reset isn't that critical. This solves issues when deactivating host mode on platforms like SM8450. For now don't change the timeout if xHC is reset in xhci_resume(). No issues are reported for it, and we need the reset to succeed. Locking around that reset needs to be revisited later. Additionally change the signed integer timeout parameter in xhci_handshake() to a u64 to match the timeout value we pass to readl_poll_timeout_atomic() Fixes: 22ceac191211 ("xhci: Increase reset timeout for Renesas 720201 host.") Cc: stable@vger.kernel.org Reported-by: Sergey Shtylyov Reported-by: Pavan Kondeti Tested-by: Pavan Kondeti Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220303110903.1662404-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman drivers/usb/host/xhci-hub.c | 2 +- drivers/usb/host/xhci-mem.c | 2 +- drivers/usb/host/xhci.c | 20 +++++++++----------- drivers/usb/host/xhci.h | 7 +++++-- 4 files changed, 16 insertions(+), 15 deletions(-) commit 676748389f5db74e7d28f9d630eebd75cb8a11b4 Author: Sven Peter Date: Sat Feb 26 13:59:12 2022 +0100 usb: typec: tipd: Forward plug orientation to typec subsystem In order to bring up the USB3 PHY on the Apple M1 we need to know the orientation of the Type-C cable. Extract it from the status register and forward it to the typec subsystem. Reviewed-by: Heikki Krogerus Cc: stable Signed-off-by: Sven Peter Link: https://lore.kernel.org/r/20220226125912.59828-1-sven@svenpeter.dev Signed-off-by: Greg Kroah-Hartman drivers/usb/typec/tipd/core.c | 5 +++++ drivers/usb/typec/tipd/tps6598x.h | 1 + 2 files changed, 6 insertions(+) commit f8a98c45569a2bf2bf6c07fe83f41ee1f04bb29b Author: Geert Uytterhoeven Date: Thu Mar 3 13:50:21 2022 +0100 usb: Drop commas after SoC match table sentinels It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5cae409f647272a5679291ebc0000bfeccc14160.1646311762.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman drivers/usb/gadget/udc/renesas_usb3.c | 2 +- drivers/usb/host/xhci-rcar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 4bf2283cb2084aa44ba79d30ca8e0e886ac98f8a Author: Krzysztof Kozlowski Date: Wed Mar 2 20:09:38 2022 +0100 dt-bindings: usb: samsung,exynos-usb2: convert to dtschema Convert the Samsung Exynos SoC USB 2.0 EHCI and OHCI Controller bindings to DT schema format. Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220302190938.6195-3-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman .../devicetree/bindings/usb/exynos-usb.txt | 66 ------------ .../bindings/usb/samsung,exynos-usb2.yaml | 117 +++++++++++++++++++++ 2 files changed, 117 insertions(+), 66 deletions(-) commit 949ea75b7ba4a8ea883b9d1a2bd0d391ffd86a80 Author: Krzysztof Kozlowski Date: Wed Mar 2 20:09:37 2022 +0100 dt-bindings: usb: samsung,exynos-dwc3: convert to dtschema Convert the Samsung Exynos SoC USB 3.0 DWC3 Controller bindings to DT schema format. Reviewed-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220302190938.6195-2-krzysztof.kozlowski@canonical.com Signed-off-by: Greg Kroah-Hartman .../devicetree/bindings/usb/exynos-usb.txt | 49 -------- .../bindings/usb/samsung,exynos-dwc3.yaml | 129 +++++++++++++++++++++ 2 files changed, 129 insertions(+), 49 deletions(-) commit 25bf4df4d18b4546a5821d77b5fac149a3a4961f Merge: 01e2d1579682 4db073174f95 Author: David S. Miller Date: Thu Mar 3 14:42:46 2022 +0000 Merge branch 'ptp-ocp-next' Jonathan Lemon says: ==================== ptp: ocp: TOD and monitoring updates Add a series of patches for monitoring the status of the driver and adjusting TOD handling, especially around leap seconds. Add documentation for the new sysfs nodes. ==================== Signed-off-by: David S. Miller commit 4db073174f95653c5436615fc3a9a8dbae659b65 Author: Jonathan Lemon Date: Wed Mar 2 13:34:59 2022 -0800 docs: ABI: Document new timecard sysfs nodes. Add documentation for the tod_correction, clock_status_drift, and clock_status_offset nodes. Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller Documentation/ABI/testing/sysfs-timecard | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) commit e68462a0d99dff5879ca10d4d1da978e6142c9ec Author: Vadim Fedorenko Date: Wed Mar 2 13:34:58 2022 -0800 ptp: ocp: adjust utc_tai_offset to TOD info utc_tai_offset is used to correct IRIG, DCF and NMEA outputs and is set during initialisation but is not corrected during leap second announce event. Add watchdog code to control this correction. Signed-off-by: Vadim Fedorenko Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 51 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) commit 44a412d13b31fdfdb79e76f9c959e83f86dfe578 Author: Vadim Fedorenko Date: Wed Mar 2 13:34:57 2022 -0800 ptp: ocp: add tod_correction attribute TOD correction register is used to compensate for leap seconds in different domains. Export it as an attribute with write access. Signed-off-by: Vadim Fedorenko Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) commit 2f23f486cf626a9a2ea70da0dac93c63e89f6595 Author: Vadim Fedorenko Date: Wed Mar 2 13:34:56 2022 -0800 ptp: ocp: Expose clock status drift and offset Monitoring of clock variance could be done through checking the offset and the drift updates that are applied to atomic clocks. Expose these values as attributes for the timecard. Signed-off-by: Vadim Fedorenko Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) commit 9f492c4cb2351c43e5ea64285e729a21392950df Author: Vadim Fedorenko Date: Wed Mar 2 13:34:55 2022 -0800 ptp: ocp: add TOD debug information TOD information is currently displayed only on module load, which doesn't provide updated information as the system runs. Create a debug file which provides the current TOD status information, and move the information display there. Signed-off-by: Vadim Fedorenko Signed-off-by: Jonathan Lemon Signed-off-by: David S. Miller drivers/ptp/ptp_ocp.c | 106 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 70 insertions(+), 36 deletions(-) commit 01e2d1579682734585510c7bbba917e25446299a Merge: 6fb8661c8f97 c803475fd8dd Author: David S. Miller Date: Thu Mar 3 14:38:49 2022 +0000 Merge branch 'skb-mono-delivery-time' Martin KaFai Lau says: ==================== Preserve mono delivery time (EDT) in skb->tstamp skb->tstamp was first used as the (rcv) timestamp. The major usage is to report it to the user (e.g. SO_TIMESTAMP). Later, skb->tstamp is also set as the (future) delivery_time (e.g. EDT in TCP) during egress and used by the qdisc (e.g. sch_fq) to make decision on when the skb can be passed to the dev. Currently, there is no way to tell skb->tstamp having the (rcv) timestamp or the delivery_time, so it is always reset to 0 whenever forwarded between egress and ingress. While it makes sense to always clear the (rcv) timestamp in skb->tstamp to avoid confusing sch_fq that expects the delivery_time, it is a performance issue [0] to clear the delivery_time if the skb finally egress to a fq@phy-dev. This set is to keep the mono delivery time and make it available to the final egress interface. Please see individual patch for the details. [0] (slide 22): https://linuxplumbersconf.org/event/11/contributions/953/attachments/867/1658/LPC_2021_BPF_Datapath_Extensions.pdf v6: - Add kdoc and use non-UAPI type in patch 6 (Jakub) v5: netdev: - Patch 3 in v4 is broken down into smaller patches 3, 4, and 5 in v5 - The mono_delivery_time bit clearing in __skb_tstamp_tx() is done in __net_timestamp() instead. This is patch 4 in v5. - Missed a skb_clear_delivery_time() for the 'skip_classify' case in dev.c in v4. That is fixed in patch 5 in v5 for correctness. The skb_clear_delivery_time() will be moved to a later stage in Patch 10, so it was an intermediate error in v4. - Added delivery time handling for nfnetlink_{log, queue}.c in patch 9 (Daniel) - Added delivery time handling in the IPv6 IOAM hop-by-hop option which has an experimental IANA assigned value 49 in patch 8 - Added delivery time handling in nf_conntrack for the ipv6 defrag case in patch 7 - Removed unlikely() from testing skb->mono_delivery_time (Daniel) bpf: - Remove the skb->tstamp dance in ingress. Depends on bpf insn rewrite to return 0 if skb->tstamp has delivery time in patch 11. It is to backward compatible with the existing tc-bpf@ingress in patch 11. - bpf_set_delivery_time() will also allow dtime == 0 and dtime_type == BPF_SKB_DELIVERY_TIME_NONE as argument in patch 12. v4: netdev: - Push the skb_clear_delivery_time() from ip_local_deliver() and ip6_input() to ip_local_deliver_finish() and ip6_input_finish() to accommodate the ipvs forward path. This is the notable change in v4 at the netdev side. - Patch 3/8 first does the skb_clear_delivery_time() after sch_handle_ingress() in dev.c and this will make the tc-bpf forward path work via the bpf_redirect_*() helper. - The next patch 4/8 (new in v4) will then postpone the skb_clear_delivery_time() from dev.c to the ip_local_deliver_finish() and ip6_input_finish() after taking care of the tstamp usage in the ip defrag case. This will make the kernel forward path also work, e.g. the ip[6]_forward(). - Fixed a case v3 which missed setting the skb->mono_delivery_time bit when sending TCP rst/ack in some cases (e.g. from a ctl_sk). That case happens at ip_send_unicast_reply() and tcp_v6_send_response(). It is fixed in patch 1/8 (and then patch 3/8) in v4. bpf: - Adding __sk_buff->delivery_time_type instead of adding __sk_buff->mono_delivery_time as in v3. The tc-bpf can stay with one __sk_buff->tstamp instead of having two 'time' fields while one is 0 and another is not. tc-bpf can use the new __sk_buff->delivery_time_type to tell what is stored in __sk_buff->tstamp. - bpf_skb_set_delivery_time() helper is added to set __sk_buff->tstamp from non mono delivery_time to mono delivery_time - Most of the convert_ctx_access() bpf insn rewrite in v3 is gone, so no new rewrite added for __sk_buff->tstamp. The only rewrite added is for reading the new __sk_buff->delivery_time_type. - Added selftests, test_tc_dtime.c v3: - Feedback from v2 is using shinfo(skb)->tx_flags could be racy. - Considered to reuse a few bits in skb->tstamp to represent different semantics, other than more code churns, it will break the bpf usecase which currently can write and then read back the skb->tstamp. - Went back to v1 idea on adding a bit to skb and address the feedbacks on v1: - Added one bit skb->mono_delivery_time to flag that the skb->tstamp has the mono delivery_time (EDT), instead of adding a bit to flag if the skb->tstamp has been forwarded or not. - Instead of resetting the delivery_time back to the (rcv) timestamp during recvmsg syscall which may be too late and not useful, the delivery_time reset in v3 happens earlier once the stack knows that the skb will be delivered locally. - Handled the tapping@ingress case by af_packet - No need to change the (rcv) timestamp to mono clock base as in v1. The added one bit to flag skb->mono_delivery_time is enough to keep the EDT delivery_time during forward. - Added logic to the bpf side to make the existing bpf running at ingress can still get the (rcv) timestamp when reading the __sk_buff->tstamp. New __sk_buff->mono_delivery_time is also added. Test is still needed to test this piece. ==================== Signed-off-by: David S. Miller commit c803475fd8ddc9996abd446fdccf5479b3c7b609 Author: Martin KaFai Lau Date: Wed Mar 2 11:56:41 2022 -0800 bpf: selftests: test skb->tstamp in redirect_neigh This patch adds tests on forwarding the delivery_time for the following cases - tcp/udp + ip4/ip6 + bpf_redirect_neigh - tcp/udp + ip4/ip6 + ip[6]_forward - bpf_skb_set_delivery_time - The old rcv timestamp expectation on tc-bpf@ingress Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller .../testing/selftests/bpf/prog_tests/tc_redirect.c | 434 +++++++++++++++++++++ tools/testing/selftests/bpf/progs/test_tc_dtime.c | 349 +++++++++++++++++ 2 files changed, 783 insertions(+) commit 8d21ec0e46ed6e39994accff8eb4f2be3d2e76b5 Author: Martin KaFai Lau Date: Wed Mar 2 11:56:34 2022 -0800 bpf: Add __sk_buff->delivery_time_type and bpf_skb_set_skb_delivery_time() * __sk_buff->delivery_time_type: This patch adds __sk_buff->delivery_time_type. It tells if the delivery_time is stored in __sk_buff->tstamp or not. It will be most useful for ingress to tell if the __sk_buff->tstamp has the (rcv) timestamp or delivery_time. If delivery_time_type is 0 (BPF_SKB_DELIVERY_TIME_NONE), it has the (rcv) timestamp. Two non-zero types are defined for the delivery_time_type, BPF_SKB_DELIVERY_TIME_MONO and BPF_SKB_DELIVERY_TIME_UNSPEC. For UNSPEC, it can only happen in egress because only mono delivery_time can be forwarded to ingress now. The clock of UNSPEC delivery_time can be deduced from the skb->sk->sk_clockid which is how the sch_etf doing it also. * Provide forwarded delivery_time to tc-bpf@ingress: With the help of the new delivery_time_type, the tc-bpf has a way to tell if the __sk_buff->tstamp has the (rcv) timestamp or the delivery_time. During bpf load time, the verifier will learn if the bpf prog has accessed the new __sk_buff->delivery_time_type. If it does, it means the tc-bpf@ingress is expecting the skb->tstamp could have the delivery_time. The kernel will then read the skb->tstamp as-is during bpf insn rewrite without checking the skb->mono_delivery_time. This is done by adding a new prog->delivery_time_access bit. The same goes for writing skb->tstamp. * bpf_skb_set_delivery_time(): The bpf_skb_set_delivery_time() helper is added to allow setting both delivery_time and the delivery_time_type at the same time. If the tc-bpf does not need to change the delivery_time_type, it can directly write to the __sk_buff->tstamp as the existing tc-bpf has already been doing. It will be most useful at ingress to change the __sk_buff->tstamp from the (rcv) timestamp to a mono delivery_time and then bpf_redirect_*(). bpf only has mono clock helper (bpf_ktime_get_ns), and the current known use case is the mono EDT for fq, and only mono delivery time can be kept during forward now, so bpf_skb_set_delivery_time() only supports setting BPF_SKB_DELIVERY_TIME_MONO. It can be extended later when use cases come up and the forwarding path also supports other clock bases. Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller include/linux/filter.h | 3 +- include/uapi/linux/bpf.h | 41 +++++++++- net/core/filter.c | 169 ++++++++++++++++++++++++++++++++--------- tools/include/uapi/linux/bpf.h | 41 +++++++++- 4 files changed, 216 insertions(+), 38 deletions(-) commit 7449197d600d30d038b1ce6285ab4747096eac7f Author: Martin KaFai Lau Date: Wed Mar 2 11:56:28 2022 -0800 bpf: Keep the (rcv) timestamp behavior for the existing tc-bpf@ingress The current tc-bpf@ingress reads and writes the __sk_buff->tstamp as a (rcv) timestamp which currently could either be 0 (not available) or ktime_get_real(). This patch is to backward compatible with the (rcv) timestamp expectation at ingress. If the skb->tstamp has the delivery_time, the bpf insn rewrite will read 0 for tc-bpf running at ingress as it is not available. When writing at ingress, it will also clear the skb->mono_delivery_time bit. /* BPF_READ: a = __sk_buff->tstamp */ if (!skb->tc_at_ingress || !skb->mono_delivery_time) a = skb->tstamp; else a = 0 /* BPF_WRITE: __sk_buff->tstamp = a */ if (skb->tc_at_ingress) skb->mono_delivery_time = 0; skb->tstamp = a; [ A note on the BPF_CGROUP_INET_INGRESS which can also access skb->tstamp. At that point, the skb is delivered locally and skb_clear_delivery_time() has already been done, so the skb->tstamp will only have the (rcv) timestamp. ] If the tc-bpf@egress writes 0 to skb->tstamp, the skb->mono_delivery_time has to be cleared also. It could be done together during convert_ctx_access(). However, the latter patch will also expose the skb->mono_delivery_time bit as __sk_buff->delivery_time_type. Changing the delivery_time_type in the background may surprise the user, e.g. the 2nd read on __sk_buff->delivery_time_type may need a READ_ONCE() to avoid compiler optimization. Thus, in expecting the needs in the latter patch, this patch does a check on !skb->tstamp after running the tc-bpf and clears the skb->mono_delivery_time bit if needed. The earlier discussion on v4 [0]. The bpf insn rewrite requires the skb's mono_delivery_time bit and tc_at_ingress bit. They are moved up in sk_buff so that bpf rewrite can be done at a fixed offset. tc_skip_classify is moved together with tc_at_ingress. To get one bit for mono_delivery_time, csum_not_inet is moved down and this bit is currently used by sctp. [0]: https://lore.kernel.org/bpf/20220217015043.khqwqklx45c4m4se@kafai-mbp.dhcp.thefacebook.com/ Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller include/linux/skbuff.h | 18 ++++++++----- net/core/filter.c | 71 +++++++++++++++++++++++++++++++++++++++++++------- net/sched/act_bpf.c | 2 ++ net/sched/cls_bpf.c | 2 ++ 4 files changed, 77 insertions(+), 16 deletions(-) commit cd14e9b7b8d312dfbf75ce1f78552902e51b9045 Author: Martin KaFai Lau Date: Wed Mar 2 11:56:22 2022 -0800 net: Postpone skb_clear_delivery_time() until knowing the skb is delivered locally The previous patches handled the delivery_time in the ingress path before the routing decision is made. This patch can postpone clearing delivery_time in a skb until knowing it is delivered locally and also set the (rcv) timestamp if needed. This patch moves the skb_clear_delivery_time() from dev.c to ip_local_deliver_finish() and ip6_input_finish(). Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller net/core/dev.c | 8 ++------ net/ipv4/ip_input.c | 1 + net/ipv6/ip6_input.c | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) commit 80fcec675112bd2f697ca1ca74ceb923c53cd569 Author: Martin KaFai Lau Date: Wed Mar 2 11:56:15 2022 -0800 net: Get rcv tstamp if needed in nfnetlink_{log, queue}.c If skb has the (rcv) timestamp available, nfnetlink_{log, queue}.c logs/outputs it to the userspace. When the locally generated skb is looping from egress to ingress over a virtual interface (e.g. veth, loopback...), skb->tstamp may have the delivery time before it is known that will be delivered locally and received by another sk. Like handling the delivery time in network tapping, use ktime_get_real() to get the (rcv) timestamp. The earlier added helper skb_tstamp_cond() is used to do this. false is passed to the second 'cond' arg such that doing ktime_get_real() or not only depends on the netstamp_needed_key static key. Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller net/netfilter/nfnetlink_log.c | 6 ++++-- net/netfilter/nfnetlink_queue.c | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) commit b6561f8491ca899e5a08311796085c9738d631ae Author: Martin KaFai Lau Date: Wed Mar 2 11:56:09 2022 -0800 net: ipv6: Get rcv timestamp if needed when handling hop-by-hop IOAM option IOAM is a hop-by-hop option with a temporary iana allocation (49). Since it is hop-by-hop, it is done before the input routing decision. One of the traced data field is the (rcv) timestamp. When the locally generated skb is looping from egress to ingress over a virtual interface (e.g. veth, loopback...), skb->tstamp may have the delivery time before it is known that it will be delivered locally and received by another sk. Like handling the network tapping (tcpdump) in the earlier patch, this patch gets the timestamp if needed without over-writing the delivery_time in the skb->tstamp. skb_tstamp_cond() is added to do the ktime_get_real() with an extra cond arg to check on top of the netstamp_needed_key static key. skb_tstamp_cond() will also be used in a latter patch and it needs the netstamp_needed_key check. Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller include/linux/skbuff.h | 11 +++++++++++ net/ipv6/ioam6.c | 19 +++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) commit 335c8cf3b537601e1a42a19996471f1c2572cdec Author: Martin KaFai Lau Date: Wed Mar 2 11:56:03 2022 -0800 net: ipv6: Handle delivery_time in ipv6 defrag A latter patch will postpone the delivery_time clearing until the stack knows the skb is being delivered locally (i.e. calling skb_clear_delivery_time() at ip_local_deliver_finish() for IPv4 and at ip6_input_finish() for IPv6). That will allow other kernel forwarding path (e.g. ip[6]_forward) to keep the delivery_time also. A very similar IPv6 defrag codes have been duplicated in multiple places: regular IPv6, nf_conntrack, and 6lowpan. Unlike the IPv4 defrag which is done before ip_local_deliver_finish(), the regular IPv6 defrag is done after ip6_input_finish(). Thus, no change should be needed in the regular IPv6 defrag logic because skb_clear_delivery_time() should have been called. 6lowpan also does not need special handling on delivery_time because it is a non-inet packet_type. However, cf_conntrack has a case in NF_INET_PRE_ROUTING that needs to do the IPv6 defrag earlier. Thus, it needs to save the mono_delivery_time bit in the inet_frag_queue which is similar to how it is handled in the previous patch for the IPv4 defrag. This patch chooses to do it consistently and stores the mono_delivery_time in the inet_frag_queue for all cases such that it will be easier for the future refactoring effort on the IPv6 reasm code. Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller net/ieee802154/6lowpan/reassembly.c | 1 + net/ipv6/netfilter/nf_conntrack_reasm.c | 1 + net/ipv6/reassembly.c | 1 + 3 files changed, 3 insertions(+) commit 8672406eb5d77333ca14e9612e3166704b367c40 Author: Martin KaFai Lau Date: Wed Mar 2 11:55:57 2022 -0800 net: ip: Handle delivery_time in ip defrag A latter patch will postpone the delivery_time clearing until the stack knows the skb is being delivered locally. That will allow other kernel forwarding path (e.g. ip[6]_forward) to keep the delivery_time also. An earlier attempt was to do skb_clear_delivery_time() in ip_local_deliver() and ip6_input(). The discussion [0] requested to move it one step later into ip_local_deliver_finish() and ip6_input_finish() so that the delivery_time can be kept for the ip_vs forwarding path also. To do that, this patch also needs to take care of the (rcv) timestamp usecase in ip_is_fragment(). It needs to expect delivery_time in the skb->tstamp, so it needs to save the mono_delivery_time bit in inet_frag_queue such that the delivery_time (if any) can be restored in the final defragmented skb. [Note that it will only happen when the locally generated skb is looping from egress to ingress over a virtual interface (e.g. veth, loopback...), skb->tstamp may have the delivery time before it is known that it will be delivered locally and received by another sk.] [0]: https://lore.kernel.org/netdev/ca728d81-80e8-3767-d5e-d44f6ad96e43@ssi.bg/ Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller include/net/inet_frag.h | 2 ++ net/ipv4/inet_fragment.c | 1 + net/ipv4/ip_fragment.c | 1 + 3 files changed, 4 insertions(+) commit d98d58a002619b5c165f1eedcd731e2fe2c19088 Author: Martin KaFai Lau Date: Wed Mar 2 11:55:50 2022 -0800 net: Set skb->mono_delivery_time and clear it after sch_handle_ingress() The previous patches handled the delivery_time before sch_handle_ingress(). This patch can now set the skb->mono_delivery_time to flag the skb->tstamp is used as the mono delivery_time (EDT) instead of the (rcv) timestamp and also clear it with skb_clear_delivery_time() after sch_handle_ingress(). This will make the bpf_redirect_*() to keep the mono delivery_time and used by a qdisc (fq) of the egress-ing interface. A latter patch will postpone the skb_clear_delivery_time() until the stack learns that the skb is being delivered locally and that will make other kernel forwarding paths (ip[6]_forward) able to keep the delivery_time also. Thus, like the previous patches on using the skb->mono_delivery_time bit, calling skb_clear_delivery_time() is not limited within the CONFIG_NET_INGRESS to avoid too many code churns among this set. Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller include/linux/skbuff.h | 3 +-- net/core/dev.c | 8 ++++++-- net/ipv4/ip_output.c | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) commit d93376f503c7a586707925957592c0f16f4db0b1 Author: Martin KaFai Lau Date: Wed Mar 2 11:55:44 2022 -0800 net: Clear mono_delivery_time bit in __skb_tstamp_tx() In __skb_tstamp_tx(), it may clone the egress skb and queues the clone to the sk_error_queue. The outgoing skb may have the mono delivery_time while the (rcv) timestamp is expected for the clone, so the skb->mono_delivery_time bit needs to be cleared from the clone. This patch adds the skb->mono_delivery_time clearing to the existing __net_timestamp() and use it in __skb_tstamp_tx(). The __net_timestamp() fast path usage in dev.c is changed to directly call ktime_get_real() since the mono_delivery_time bit is not set at that point. Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller include/linux/skbuff.h | 1 + net/core/dev.c | 4 ++-- net/core/skbuff.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) commit 27942a15209f564ed8ee2a9e126cb7b105181355 Author: Martin KaFai Lau Date: Wed Mar 2 11:55:38 2022 -0800 net: Handle delivery_time in skb->tstamp during network tapping with af_packet A latter patch will set the skb->mono_delivery_time to flag the skb->tstamp is used as the mono delivery_time (EDT) instead of the (rcv) timestamp. skb_clear_tstamp() will then keep this delivery_time during forwarding. This patch is to make the network tapping (with af_packet) to handle the delivery_time stored in skb->tstamp. Regardless of tapping at the ingress or egress, the tapped skb is received by the af_packet socket, so it is ingress to the af_packet socket and it expects the (rcv) timestamp. When tapping at egress, dev_queue_xmit_nit() is used. It has already expected skb->tstamp may have delivery_time, so it does skb_clone()+net_timestamp_set() to ensure the cloned skb has the (rcv) timestamp before passing to the af_packet sk. This patch only adds to clear the skb->mono_delivery_time bit in net_timestamp_set(). When tapping at ingress, it currently expects the skb->tstamp is either 0 or the (rcv) timestamp. Meaning, the tapping at ingress path has already expected the skb->tstamp could be 0 and it will get the (rcv) timestamp by ktime_get_real() when needed. There are two cases for tapping at ingress: One case is af_packet queues the skb to its sk_receive_queue. The skb is either not shared or new clone created. The newly added skb_clear_delivery_time() is called to clear the delivery_time (if any) and set the (rcv) timestamp if needed before the skb is queued to the sk_receive_queue. Another case, the ingress skb is directly copied to the rx_ring and tpacket_get_timestamp() is used to get the (rcv) timestamp. The newly added skb_tstamp() is used in tpacket_get_timestamp() to check the skb->mono_delivery_time bit before returning skb->tstamp. As mentioned earlier, the tapping@ingress has already expected the skb may not have the (rcv) timestamp (because no sk has asked for it) and has handled this case by directly calling ktime_get_real(). Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller include/linux/skbuff.h | 24 ++++++++++++++++++++++++ net/core/dev.c | 4 +++- net/packet/af_packet.c | 4 +++- 3 files changed, 30 insertions(+), 2 deletions(-) commit de799101519aad23c6096041ba2744d7b5517e6a Author: Martin KaFai Lau Date: Wed Mar 2 11:55:31 2022 -0800 net: Add skb_clear_tstamp() to keep the mono delivery_time Right now, skb->tstamp is reset to 0 whenever the skb is forwarded. If skb->tstamp has the mono delivery_time, clearing it can hurt the performance when it finally transmits out to fq@phy-dev. The earlier patch added a skb->mono_delivery_time bit to flag the skb->tstamp carrying the mono delivery_time. This patch adds skb_clear_tstamp() helper which keeps the mono delivery_time and clears everything else. The delivery_time clearing will be postponed until the stack knows the skb will be delivered locally. It will be done in a latter patch. Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller drivers/net/loopback.c | 2 +- include/linux/skbuff.h | 10 +++++++++- net/bridge/br_forward.c | 2 +- net/core/filter.c | 6 +++--- net/core/skbuff.c | 2 +- net/ipv4/ip_forward.c | 2 +- net/ipv6/ip6_output.c | 2 +- net/netfilter/ipvs/ip_vs_xmit.c | 6 +++--- net/netfilter/nf_dup_netdev.c | 2 +- net/netfilter/nf_flow_table_ip.c | 4 ++-- net/netfilter/nft_fwd_netdev.c | 2 +- net/openvswitch/vport.c | 2 +- net/xfrm/xfrm_interface.c | 2 +- 13 files changed, 26 insertions(+), 18 deletions(-) commit a1ac9c8acec1605c6b43af418f79facafdced680 Author: Martin KaFai Lau Date: Wed Mar 2 11:55:25 2022 -0800 net: Add skb->mono_delivery_time to distinguish mono delivery_time from (rcv) timestamp skb->tstamp was first used as the (rcv) timestamp. The major usage is to report it to the user (e.g. SO_TIMESTAMP). Later, skb->tstamp is also set as the (future) delivery_time (e.g. EDT in TCP) during egress and used by the qdisc (e.g. sch_fq) to make decision on when the skb can be passed to the dev. Currently, there is no way to tell skb->tstamp having the (rcv) timestamp or the delivery_time, so it is always reset to 0 whenever forwarded between egress and ingress. While it makes sense to always clear the (rcv) timestamp in skb->tstamp to avoid confusing sch_fq that expects the delivery_time, it is a performance issue [0] to clear the delivery_time if the skb finally egress to a fq@phy-dev. For example, when forwarding from egress to ingress and then finally back to egress: tcp-sender => veth@netns => veth@hostns => fq@eth0@hostns ^ ^ reset rest This patch adds one bit skb->mono_delivery_time to flag the skb->tstamp is storing the mono delivery_time (EDT) instead of the (rcv) timestamp. The current use case is to keep the TCP mono delivery_time (EDT) and to be used with sch_fq. A latter patch will also allow tc-bpf@ingress to read and change the mono delivery_time. In the future, another bit (e.g. skb->user_delivery_time) can be added for the SCM_TXTIME where the clock base is tracked by sk->sk_clockid. [ This patch is a prep work. The following patches will get the other parts of the stack ready first. Then another patch after that will finally set the skb->mono_delivery_time. ] skb_set_delivery_time() function is added. It is used by the tcp_output.c and during ip[6] fragmentation to assign the delivery_time to the skb->tstamp and also set the skb->mono_delivery_time. A note on the change in ip_send_unicast_reply() in ip_output.c. It is only used by TCP to send reset/ack out of a ctl_sk. Like the new skb_set_delivery_time(), this patch sets the skb->mono_delivery_time to 0 for now as a place holder. It will be enabled in a latter patch. A similar case in tcp_ipv6 can be done with skb_set_delivery_time() in tcp_v6_send_response(). [0] (slide 22): https://linuxplumbersconf.org/event/11/contributions/953/attachments/867/1658/LPC_2021_BPF_Datapath_Extensions.pdf Signed-off-by: Martin KaFai Lau Signed-off-by: David S. Miller include/linux/skbuff.h | 13 +++++++++++++ net/bridge/netfilter/nf_conntrack_bridge.c | 5 +++-- net/ipv4/ip_output.c | 7 +++++-- net/ipv4/tcp_output.c | 16 +++++++++------- net/ipv6/ip6_output.c | 5 +++-- net/ipv6/netfilter.c | 5 +++-- net/ipv6/tcp_ipv6.c | 2 +- 7 files changed, 37 insertions(+), 16 deletions(-) commit 1918ace1382d43430c8a61294fa4385065a46804 Author: Toshiaki Makita Date: Fri Feb 25 10:53:09 2022 +0900 net/mlx5: Support GRE conntrack offload Support GREv0 without NAT. Signed-off-by: Toshiaki Makita Acked-by: Paul Blakey Signed-off-by: Pablo Neira Ayuso drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) commit fcb6aa86532c1f321440f56f739a26ef856e6475 Author: Toshiaki Makita Date: Fri Feb 25 10:53:08 2022 +0900 act_ct: Support GRE offload Support GREv0 without NAT. Signed-off-by: Toshiaki Makita Acked-by: Paul Blakey Signed-off-by: Pablo Neira Ayuso net/sched/act_ct.c | 115 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 91 insertions(+), 24 deletions(-) commit 4e8d9584d154479d357327f76d4e49486915c9c9 Author: Toshiaki Makita Date: Fri Feb 25 10:53:07 2022 +0900 netfilter: flowtable: Support GRE Support GREv0 without NAT. Signed-off-by: Toshiaki Makita Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_flow_table_core.c | 10 ++++-- net/netfilter/nf_flow_table_ip.c | 62 +++++++++++++++++++++++++++++------ net/netfilter/nf_flow_table_offload.c | 22 +++++++++---- net/netfilter/nft_flow_offload.c | 13 ++++++++ 4 files changed, 88 insertions(+), 19 deletions(-) commit f1082dd31fe461d482d69da2a8eccfeb7bf07ac2 Author: Phil Sutter Date: Wed Feb 16 15:55:38 2022 +0100 netfilter: nf_tables: Reject tables of unsupported family An nftables family is merely a hollow container, its family just a number and such not reliant on compile-time options other than nftables support itself. Add an artificial check so attempts at using a family the kernel can't support fail as early as possible. This helps user space detect kernels which lack e.g. NFPROTO_INET. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_tables_api.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) commit 6fb8661c8f97bb062d2ecc7a57591d38e6c4f8c8 Merge: 43113ff73453 ac4552096023 Author: David S. Miller Date: Thu Mar 3 14:15:31 2022 +0000 Merge branch 'dsa-unicast-filtering' Vladimir Oltean says: ==================== DSA unicast filtering This series doesn't attempt anything extremely brave, it just changes the way in which standalone ports which support FDB isolation work. Up until now, DSA has recommended that switch drivers configure standalone ports in a separate VID/FID with learning disabled, and with the CPU port as the only destination, reached trivially via flooding. That works, except that standalone ports will deliver all packets to the CPU. We can leverage the hardware FDB as a MAC DA filter, and disable flooding towards the CPU port, to force the dropping of packets with unknown MAC DA. We handle port promiscuity by re-enabling flooding towards the CPU port. This is relevant because the bridge puts its automatic (learning + flooding) ports in promiscuous mode, and this makes some things work automagically, like for example bridging with a foreign interface. We don't delve yet into the territory of managing CPU flooding more aggressively while under a bridge. The only switch driver that benefits from this work right now is the NXP LS1028A switch (felix). The others need to implement FDB isolation first, before DSA is going to install entries to the port's standalone database. Otherwise, these entries might collide with bridge FDB/MDB entries. This work was done mainly to have all the required features in place before somebody starts seriously architecting DSA support for multiple CPU ports. Otherwise it is much more difficult to bolt these features on top of multiple CPU ports. ==================== Signed-off-by: David S. Miller commit ac45520960234cfa4be89b5aa072ac0fc7e57c07 Author: Vladimir Oltean Date: Wed Mar 2 21:14:17 2022 +0200 net: mscc: ocelot: accept configuring bridge port flags on the NPI port In order for the Felix DSA driver to be able to turn on/off flooding towards its CPU port, we need to redirect calls on the NPI port to actually act upon the index in the analyzer block that corresponds to the CPU port module. This was never necessary until now because DSA (or the bridge) never called ocelot_port_bridge_flags() for the NPI port. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/ethernet/mscc/ocelot.c | 3 +++ 1 file changed, 3 insertions(+) commit 0cc369800e5fcba2b53a18fb24ff2036c8240868 Author: Vladimir Oltean Date: Wed Mar 2 21:14:16 2022 +0200 net: dsa: felix: stop clearing CPU flooding in felix_setup_tag_8021q felix_migrate_flood_to_tag_8021q_port() takes care of clearing the flooding bits on the old CPU port (which was the CPU port module), so manually clearing this bit from PGID_UC, PGID_MC, PGID_BC is redundant. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 10 ---------- 1 file changed, 10 deletions(-) commit 90897569beb132f741c8a3fc14f8782eda0425f7 Author: Vladimir Oltean Date: Wed Mar 2 21:14:15 2022 +0200 net: dsa: felix: start off with flooding disabled on the CPU port The driver probes with all ports as standalone, and it supports unicast filtering. So DSA will call port_fdb_add() for all necessary addresses on the current CPU port. We also handle migrations when the CPU port hardware resource changes (on tagging protocol change), so there should not be any unknown address that we have to receive while not promiscuous. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 17 ----------------- 1 file changed, 17 deletions(-) commit b903a6bd2e1921598d569be4da91f5927745382b Author: Vladimir Oltean Date: Wed Mar 2 21:14:14 2022 +0200 net: dsa: felix: migrate flood settings from NPI to tag_8021q CPU port When the tagging protocol changes from "ocelot" to "ocelot-8021q" or in reverse, the DSA promiscuity setting that was applied for the old CPU port must be transferred to the new one. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 47 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) commit f9cef64fa23f6c1ff177be5082113c5a94e34e5d Author: Vladimir Oltean Date: Wed Mar 2 21:14:13 2022 +0200 net: dsa: felix: migrate host FDB and MDB entries when changing tag proto The "ocelot" and "ocelot-8021q" tagging protocols make use of different hardware resources, and host FDB entries have different destination ports in the switch analyzer module, practically speaking. So when the user requests a tagging protocol change, the driver must migrate all host FDB and MDB entries from the NPI port (in fact CPU port module) towards the same physical port, but this time used as a regular port. It is pointless for the felix driver to keep a copy of the host addresses, when we can create and export DSA helpers for walking through the addresses that it already needs to keep on the CPU port, for refcounting purposes. felix_classify_db() is moved up to avoid a forward declaration. We pass "bool change" because dp->fdbs and dp->mdbs are uninitialized lists when felix_setup() first calls felix_set_tag_protocol(), so we need to avoid calling dsa_port_walk_fdbs() during probe time. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller drivers/net/dsa/ocelot/felix.c | 171 ++++++++++++++++++++++++++++++++++------- include/net/dsa.h | 7 ++ net/dsa/dsa.c | 40 ++++++++++ 3 files changed, 192 insertions(+), 26 deletions(-) commit 7569459a52c95bc6e82c0b4075c4380df55cd343 Author: Vladimir Oltean Date: Wed Mar 2 21:14:12 2022 +0200 net: dsa: manage flooding on the CPU ports DSA can treat IFF_PROMISC and IFF_ALLMULTI on standalone user ports as signifying whether packets with an unknown MAC DA will be received or not. Since known MAC DAs are handled by FDB/MDB entries, this means that promiscuity is analogous to including/excluding the CPU port from the flood domain of those packets. There are two ways to signal CPU flooding to drivers. The first (chosen here) is to synthesize a call to ds->ops->port_bridge_flags() for the CPU port, with a mask of BR_FLOOD | BR_MCAST_FLOOD. This has the effect of turning on egress flooding on the CPU port regardless of source. The alternative would be to create a new ds->ops->port_host_flood() which is called per user port. Some switches (sja1105) have a flood domain that is managed per {ingress port, egress port} pair, so it would make more sense for this kind of switch to not flood the CPU from port A if just port B requires it. Nonetheless, the sja1105 has other quirks that prevent it from making use of unicast filtering, and without a concrete user making use of this feature, I chose not to implement it. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/slave.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) commit 499aa9e1b3329263bd26856699899120e56b2d7d Author: Vladimir Oltean Date: Wed Mar 2 21:14:11 2022 +0200 net: dsa: install the primary unicast MAC address as standalone port host FDB To be able to safely turn off CPU flooding for standalone ports, we need to ensure that the dev_addr of each DSA slave interface is installed as a standalone host FDB entry for compatible switches. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/slave.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) commit 5e8a1e03aa4dc5744032d4c925adcc35d41e523d Author: Vladimir Oltean Date: Wed Mar 2 21:14:10 2022 +0200 net: dsa: install secondary unicast and multicast addresses as host FDB/MDB In preparation of disabling flooding towards the CPU in standalone ports mode, identify the addresses requested by upper interfaces and use the new API for DSA FDB isolation to request the hardware driver to offload these as FDB or MDB objects. The objects belong to the user port's database, and are installed pointing towards the CPU port. Because dev_uc_add()/dev_mc_add() is VLAN-unaware, we offload to the port standalone database addresses with VID 0 (also VLAN-unaware). So this excludes switches with global VLAN filtering from supporting unicast filtering, because there, it is possible for a port of a switch to join a VLAN-aware bridge, and this changes the VLAN awareness of standalone ports, requiring VLAN-aware standalone host FDB entries. For the same reason, hellcreek, which requires VLAN awareness in standalone mode, is also exempted from unicast filtering. We create "standalone" variants of dsa_port_host_fdb_add() and dsa_port_host_mdb_add() (and the _del coresponding functions). We also create a separate work item type for handling deferred standalone host FDB/MDB entries compared to the switchdev one. This is done for the purpose of clarity - the procedure for offloading a bridge FDB entry is different than offloading a standalone one, and the switchdev event work handles only FDBs anyway, not MDBs. Deferral is needed for standalone entries because ndo_set_rx_mode runs in atomic context. We could probably optimize things a little by first queuing up all entries that need to be offloaded, and scheduling the work item just once, but the data structures that we can pass through __dev_uc_sync() and __dev_mc_sync() are limiting (there is nothing like a void *priv), so we'd have to keep the list of queued events somewhere in struct dsa_switch, and possibly a lock for it. Too complicated for now. Adding the address to the master is handled by dev_uc_sync(), adding it to the hardware is handled by __dev_uc_sync(). So this is the reason why dsa_port_standalone_host_fdb_add() does not call dev_uc_add(). Not that it had the rtnl_mutex anyway - ndo_set_rx_mode has it, but is atomic. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/dsa_priv.h | 37 +++++++++++++ net/dsa/port.c | 160 +++++++++++++++++++++++++++++++++++++++-------------- net/dsa/slave.c | 116 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 273 insertions(+), 40 deletions(-) commit 68d6d71eafd1c14c77f0468cfe374a53d34d819c Author: Vladimir Oltean Date: Wed Mar 2 21:14:09 2022 +0200 net: dsa: rename the host FDB and MDB methods to contain the "bridge" namespace We are preparing to add API in port.c that adds FDB and MDB entries that correspond to the port's standalone database. Rename the existing methods to make it clear that the FDB and MDB entries offloaded come from the bridge database. Since the function names lengthen in dsa_slave_switchdev_event_work(), we place "addr" and "vid" in temporary variables, to shorten those. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/dsa_priv.h | 16 ++++++++-------- net/dsa/port.c | 16 ++++++++-------- net/dsa/slave.c | 30 ++++++++++++------------------ 3 files changed, 28 insertions(+), 34 deletions(-) commit 35aae5ab91219f295b298ea922308d33c06470b3 Author: Vladimir Oltean Date: Wed Mar 2 21:14:08 2022 +0200 net: dsa: remove workarounds for changing master promisc/allmulti only while up Lennert Buytenhek explains in commit df02c6ff2e39 ("dsa: fix master interface allmulti/promisc handling"), dated Nov 2008, that changing the promiscuity of interfaces that are down (here the master) is broken. This fact regarding promisc/allmulti has changed since commit b6c40d68ff64 ("net: only invoke dev->change_rx_flags when device is UP") by Vlad Yasevich, dated Nov 2013. Therefore, DSA now has unnecessary complexity to handle master state transitions from down to up. In fact, syncing the unicast and multicast addresses can happen completely asynchronously to the administrative state changes. This change reduces that complexity by effectively fully reverting commit df02c6ff2e39 ("dsa: fix master interface allmulti/promisc handling"). Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller net/dsa/slave.c | 45 ++++++++------------------------------------- 1 file changed, 8 insertions(+), 37 deletions(-) commit 43113ff73453c231af2c8e700cb4ff8bca97cff6 Author: Karol Kolacinski Date: Tue Mar 1 10:38:03 2022 -0800 ice: add TTY for GNSS module for E810T device Add a new ice_gnss.c file for holding the basic GNSS module functions. If the device supports GNSS module, call the new ice_gnss_init and ice_gnss_release functions where appropriate. Implement basic functionality for reading the data from GNSS module using TTY device. Add I2C read AQ command. It is now required for controlling the external physical connectors via external I2C port expander on E810-T adapters. Future changes will introduce write functionality. Signed-off-by: Karol Kolacinski Signed-off-by: Sudhansu Sekhar Mishra Tested-by: Sunitha Mekala Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller drivers/net/ethernet/intel/ice/Makefile | 1 + drivers/net/ethernet/intel/ice/ice.h | 6 + drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 21 ++ drivers/net/ethernet/intel/ice/ice_common.c | 53 ++++ drivers/net/ethernet/intel/ice/ice_common.h | 6 + drivers/net/ethernet/intel/ice/ice_gnss.c | 376 ++++++++++++++++++++++++ drivers/net/ethernet/intel/ice/ice_gnss.h | 50 ++++ drivers/net/ethernet/intel/ice/ice_lib.c | 5 +- drivers/net/ethernet/intel/ice/ice_main.c | 11 + drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 31 ++ drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 7 + 11 files changed, 566 insertions(+), 1 deletion(-) commit 3631e48df0dbfcce3b08f0ccafcaa587657379cd Author: Woody Lin Date: Wed Mar 2 19:49:23 2022 +0800 serial: samsung: Add samsung_early_read to support early kgdboc The 'kgdboc_earlycon_init' looks for boot console that has both .read and .write callbacks. Adds 'samsung_early_read' to samsung_tty.c's early console to support kgdboc. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Woody Lin Link: https://lore.kernel.org/r/20220302114923.144523-1-woodylin@google.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/samsung_tty.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit 3f8bab174cb26aa5a8053c4457cc733881e3ad88 Author: Jiri Slaby Date: Thu Mar 3 09:08:31 2022 +0100 serial: make uart_console_write->putchar()'s character an unsigned char Currently, uart_console_write->putchar's second parameter (the character) is of type int. It makes little sense, provided uart_console_write() accepts the input string as "const char *s" and passes its content -- the characters -- to putchar(). So switch the character's type to unsigned char. We don't use char as that is signed on some platforms. That would cause troubles for drivers which (implicitly) cast the char to u16 when writing to the device. Sign extension would happen in that case and the value written would be completely different to the provided char. DZ is an example of such a driver -- on MIPS, it uses u16 for dz_out in dz_console_putchar(). Note we do the char -> uchar conversion implicitly in uart_console_write(). Provided we do not change size of the data type, sign extension does not happen there, so the problem is void. This makes the types consistent and unified with the rest of the uart layer, which uses unsigned char in most places already. One exception is xmit_buf, but that is going to be converted later. Cc: Paul Cercueil Cc: Tobias Klauser Cc: Russell King Cc: Vineet Gupta Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: Florian Fainelli Cc: bcm-kernel-feedback-list@broadcom.com Cc: Alexander Shiyan Cc: Baruch Siach Cc: "Maciej W. Rozycki" Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Karol Gugala Cc: Mateusz Holenko Cc: Vladimir Zapolskiy Cc: Neil Armstrong Cc: Kevin Hilman Cc: Jerome Brunet Cc: Martin Blumenstingl Cc: Taichi Sugaya Cc: Takao Orito Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: "Andreas Färber" Cc: Manivannan Sadhasivam Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Andy Gross Cc: Bjorn Andersson Cc: Krzysztof Kozlowski Cc: Orson Zhai Cc: Baolin Wang Cc: Chunyan Zhang Cc: Patrice Chotard Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: "David S. Miller" Cc: Peter Korsgaard Cc: Michal Simek Acked-by: Richard Genoud [atmel_serial] Acked-by: Uwe Kleine-König Acked-by: Paul Cercueil Acked-by: Neil Armstrong # meson_serial Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220303080831.21783-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman drivers/tty/goldfish.c | 2 +- drivers/tty/hvc/hvc_dcc.c | 2 +- drivers/tty/serial/21285.c | 2 +- drivers/tty/serial/8250/8250_early.c | 2 +- drivers/tty/serial/8250/8250_ingenic.c | 2 +- drivers/tty/serial/8250/8250_port.c | 2 +- drivers/tty/serial/altera_jtaguart.c | 4 ++-- drivers/tty/serial/altera_uart.c | 2 +- drivers/tty/serial/amba-pl010.c | 2 +- drivers/tty/serial/amba-pl011.c | 6 +++--- drivers/tty/serial/apbuart.c | 2 +- drivers/tty/serial/ar933x_uart.c | 2 +- drivers/tty/serial/arc_uart.c | 2 +- drivers/tty/serial/atmel_serial.c | 2 +- drivers/tty/serial/bcm63xx_uart.c | 2 +- drivers/tty/serial/clps711x.c | 2 +- drivers/tty/serial/digicolor-usart.c | 2 +- drivers/tty/serial/dz.c | 2 +- drivers/tty/serial/earlycon-arm-semihost.c | 2 +- drivers/tty/serial/earlycon-riscv-sbi.c | 2 +- drivers/tty/serial/fsl_linflexuart.c | 4 ++-- drivers/tty/serial/fsl_lpuart.c | 4 ++-- drivers/tty/serial/imx.c | 2 +- drivers/tty/serial/imx_earlycon.c | 2 +- drivers/tty/serial/ip22zilog.c | 2 +- drivers/tty/serial/lantiq.c | 2 +- drivers/tty/serial/liteuart.c | 2 +- drivers/tty/serial/lpc32xx_hs.c | 2 +- drivers/tty/serial/meson_uart.c | 2 +- drivers/tty/serial/milbeaut_usio.c | 2 +- drivers/tty/serial/mps2-uart.c | 4 ++-- drivers/tty/serial/mvebu-uart.c | 4 ++-- drivers/tty/serial/mxs-auart.c | 2 +- drivers/tty/serial/omap-serial.c | 4 ++-- drivers/tty/serial/owl-uart.c | 2 +- drivers/tty/serial/pch_uart.c | 2 +- drivers/tty/serial/pic32_uart.c | 2 +- drivers/tty/serial/pmac_zilog.c | 2 +- drivers/tty/serial/pxa.c | 2 +- drivers/tty/serial/qcom_geni_serial.c | 2 +- drivers/tty/serial/rda-uart.c | 2 +- drivers/tty/serial/sa1100.c | 2 +- drivers/tty/serial/samsung_tty.c | 4 ++-- drivers/tty/serial/sb1250-duart.c | 2 +- drivers/tty/serial/sccnxp.c | 2 +- drivers/tty/serial/serial_core.c | 2 +- drivers/tty/serial/serial_txx9.c | 2 +- drivers/tty/serial/sh-sci.c | 2 +- drivers/tty/serial/sifive.c | 4 ++-- drivers/tty/serial/sprd_serial.c | 4 ++-- drivers/tty/serial/st-asc.c | 2 +- drivers/tty/serial/stm32-usart.c | 2 +- drivers/tty/serial/sunplus-uart.c | 5 +++-- drivers/tty/serial/sunsab.c | 2 +- drivers/tty/serial/sunsu.c | 2 +- drivers/tty/serial/sunzilog.c | 4 ++-- drivers/tty/serial/uartlite.c | 4 ++-- drivers/tty/serial/vr41xx_siu.c | 2 +- drivers/tty/serial/vt8500_serial.c | 2 +- drivers/tty/serial/xilinx_uartps.c | 2 +- drivers/tty/serial/zs.c | 2 +- include/linux/serial_core.h | 2 +- 62 files changed, 77 insertions(+), 76 deletions(-) commit dc8fea13f98ace0ae8815dd44d1e60c184f3f930 Author: Minghao Chi (CGEL ZTE) Date: Thu Mar 3 09:21:31 2022 +0000 spi: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Link: https://lore.kernel.org/r/20220303092131.2060044-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown drivers/spi/spi-npcm-fiu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) commit 8f2b025abc31bc15d38657d1286d7470bbbd5efa Author: Jiaxin Yu Date: Wed Mar 2 09:35:33 2022 +0800 ASoC: bt-sco: fix bt-sco-pcm-wb dai widget don't connect to the endpoint This patch fix the second dai driver's dai widget can't connect to the endpoint. Because "bt-sco-pcm" and "bt-sco-pcm-wb" dai driver have the same stream_name, so it will cause they have the same widget name. Therefor it will just create only one route when do snd_soc_dapm_add_route that only find the widget through the widget name. Signed-off-by: Jiaxin Yu Link: https://lore.kernel.org/r/20220302013533.29068-1-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown sound/soc/codecs/bt-sco.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit e94769900f4302b4034945e5d9ec8262a2f5e086 Author: Meng Tang Date: Wed Mar 2 17:43:51 2022 +0800 ASoC: hdac_hda: Avoid unexpected match when pcm_name is "Analog" pcm name can be "Analog" and "Alt Analog", cpcm->name can be "Analog Codec DAI" and "Alt Analog Codec DAI". When pcm_name is "Analog", "Analog Codec DAI" and "Alt Analog Codec DAI" are both satisfy the 'if (strstr(cpcm->name, pcm_name))' condition, which may cause the returned cpcm to be "Alt Analog Codec DAI". Even if we get the pcm name by id, and "Analog Codec DAI" goes into the loop before "Alt Analog Codec DAI", but I still think we'd better have multiple insurances against unexpected return values. After, we can correctly return the expected result even if other relevant places are changed. Signed-off-by: Meng Tang Link: https://lore.kernel.org/r/20220302094351.3487-1-tangmeng@uniontech.com Signed-off-by: Mark Brown sound/soc/codecs/hdac_hda.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit bbfbf7a5e77e4c899982c7df4cf3197cb6f99be4 Author: Florian Westphal Date: Wed Feb 16 20:22:26 2022 +0100 Revert "netfilter: conntrack: mark UDP zero checksum as CHECKSUM_UNNECESSARY" This reverts commit 5bed9f3f63f8f9d2b1758c24640cbf77b5377511. Gal Presman says: this patch broke geneve tunnels, or possibly all udp tunnels? A simple test that creates two geneve tunnels and runs tcp iperf fails and results in checksum errors (TcpInCsumErrors). Original commit wanted to fix nf_reject with zero checksum, so it appears better to change nf reject infra instead. Fixes: 5bed9f3f63f8f ("netfilter: conntrack: mark UDP zero checksum as CHECKSUM_UNNECESSARY") Reported-by: Gal Pressman Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso net/netfilter/nf_conntrack_proto_udp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 8ba3c7bd4dca7ac358e834eabf840012d9564356 Author: Laurent Pinchart Date: Mon Feb 21 18:54:41 2022 +0200 drm: rcar-du: Don't restart group when enabling plane on Gen3 On Gen3 hardware enabling a VSP plane doesn't change any register that requires DRES to take effect. Avoid a group restart in that case. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham drivers/gpu/drm/rcar-du/rcar_du_plane.c | 6 ++++++ drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) commit aaaf9361f0348dd13131e392190b3793e135f7e3 Author: Laurent Pinchart Date: Mon Feb 21 18:54:41 2022 +0200 drm: rcar-du: Don't select VSP1 sink on Gen3 The VSP1 sink selection through register DEFR8 is only available on Gen2 hardware. Skip it on Gen3. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham drivers/gpu/drm/rcar-du/rcar_du_plane.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 80e4390981618e290616dbd06ea190d4576f219d Author: Randy Dunlap Date: Mon Feb 28 14:04:53 2022 -0800 dma-debug: fix return value of __setup handlers When valid kernel command line parameters dma_debug=off dma_debug_entries=100 are used, they are reported as Unknown parameters and added to init's environment strings, polluting it. Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc5 dma_debug=off dma_debug_entries=100", will be passed to user space. and Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc5 dma_debug=off dma_debug_entries=100 Return 1 from these __setup handlers to indicate that the command line option has been handled. Fixes: 59d3daafa1726 ("dma-debug: add kernel command line parameters") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Cc: Joerg Roedel Cc: Christoph Hellwig Cc: Marek Szyprowski Cc: iommu@lists.linux-foundation.org Cc: Robin Murphy Signed-off-by: Christoph Hellwig kernel/dma/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 88faa5e8ead62a2a559b1246bba7aa982fde7c67 Author: Yishai Hadas Date: Thu Feb 24 16:20:24 2022 +0200 vfio/mlx5: Use its own PCI reset_done error handler Register its own handler for pci_error_handlers.reset_done and update state accordingly. Link: https://lore.kernel.org/all/20220224142024.147653-16-yishaih@nvidia.com Reviewed-by: Alex Williamson Signed-off-by: Yishai Hadas Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky drivers/vfio/pci/mlx5/main.c | 57 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) commit 915076f70efad04bf6fc843970a3c7763487011a Author: Yishai Hadas Date: Thu Feb 24 16:20:23 2022 +0200 vfio/pci: Expose vfio_pci_core_aer_err_detected() Expose vfio_pci_core_aer_err_detected() to be used by drivers as part of their pci_error_handlers structure. Next patch for mlx5 driver will use it. Link: https://lore.kernel.org/all/20220224142024.147653-15-yishaih@nvidia.com Reviewed-by: Alex Williamson Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky drivers/vfio/pci/vfio_pci_core.c | 7 ++++--- include/linux/vfio_pci_core.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) commit 6fadb021266d03c5fd7bca2cfa1607efd246dad1 Author: Yishai Hadas Date: Thu Feb 24 16:20:22 2022 +0200 vfio/mlx5: Implement vfio_pci driver for mlx5 devices This patch adds support for vfio_pci driver for mlx5 devices. It uses vfio_pci_core to register to the VFIO subsystem and then implements the mlx5 specific logic in the migration area. The migration implementation follows the definition from uapi/vfio.h and uses the mlx5 VF->PF command channel to achieve it. This patch implements the suspend/resume flows. Link: https://lore.kernel.org/all/20220224142024.147653-14-yishaih@nvidia.com Reviewed-by: Alex Williamson Signed-off-by: Yishai Hadas Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky MAINTAINERS | 6 + drivers/vfio/pci/Kconfig | 3 + drivers/vfio/pci/Makefile | 2 + drivers/vfio/pci/mlx5/Kconfig | 10 + drivers/vfio/pci/mlx5/Makefile | 4 + drivers/vfio/pci/mlx5/cmd.h | 1 + drivers/vfio/pci/mlx5/main.c | 623 +++++++++++++++++++++++++++++++++++++++++ 7 files changed, 649 insertions(+) commit f1d98f346ee34ef41369ace9f91fc4f46a3e30cb Author: Yishai Hadas Date: Thu Feb 24 16:20:21 2022 +0200 vfio/mlx5: Expose migration commands over mlx5 device Expose migration commands over the device, it includes: suspend, resume, get vhca id, query/save/load state. As part of this adds the APIs and data structure that are needed to manage the migration data. Link: https://lore.kernel.org/all/20220224142024.147653-13-yishaih@nvidia.com Reviewed-by: Alex Williamson Signed-off-by: Yishai Hadas Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky drivers/vfio/pci/mlx5/cmd.c | 259 ++++++++++++++++++++++++++++++++++++++++++++ drivers/vfio/pci/mlx5/cmd.h | 35 ++++++ 2 files changed, 294 insertions(+) commit 0f3f9cd7f752f6e685e378620babc5e34af6fb9f Author: Jason Gunthorpe Date: Thu Feb 24 16:20:20 2022 +0200 vfio: Remove migration protocol v1 documentation v1 was never implemented and is replaced by v2. The old uAPI documentation is removed from the header file. The old uAPI definitions are still kept in the header file to ease transition for userspace copying these headers. They will be fully removed down the road. Link: https://lore.kernel.org/all/20220224142024.147653-12-yishaih@nvidia.com Signed-off-by: Jason Gunthorpe Tested-by: Shameer Kolothum Reviewed-by: Alex Williamson Reviewed-by: Cornelia Huck Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky include/uapi/linux/vfio.h | 200 +--------------------------------------------- 1 file changed, 2 insertions(+), 198 deletions(-) commit f5ff79fddf0efecca538046b5cc20fb3ded2ec4f Author: Christoph Hellwig Date: Sat Feb 26 16:40:21 2022 +0100 dma-mapping: remove CONFIG_DMA_REMAP CONFIG_DMA_REMAP is used to build a few helpers around the core vmalloc code, and to use them in case there is a highmem page in dma-direct, and to make dma coherent allocations be able to use non-contiguous pages allocations for DMA allocations in the dma-iommu layer. Right now it needs to be explicitly selected by architectures, and is only done so by architectures that require remapping to deal with devices that are not DMA coherent. Make it unconditional for builds with CONFIG_MMU as it is very little extra code, but makes it much more likely that large DMA allocations succeed on x86. This fixes hot plugging a NVMe thunderbolt SSD for me, which tries to allocate a 1MB buffer that is otherwise hard to obtain due to memory fragmentation on a heavily used laptop. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy arch/arm/Kconfig | 2 +- arch/xtensa/Kconfig | 2 +- drivers/iommu/dma-iommu.c | 14 +++++--------- kernel/dma/Kconfig | 7 +------ kernel/dma/Makefile | 2 +- kernel/dma/direct.c | 18 +++++++----------- 6 files changed, 16 insertions(+), 29 deletions(-) commit 8cb3d83b959be0631cd719b995c40c3cda21cd47 Author: Jason Gunthorpe Date: Thu Feb 24 16:20:19 2022 +0200 vfio: Extend the device migration protocol with RUNNING_P2P The RUNNING_P2P state is designed to support multiple devices in the same VM that are doing P2P transactions between themselves. When in RUNNING_P2P the device must be able to accept incoming P2P transactions but should not generate outgoing P2P transactions. As an optional extension to the mandatory states it is defined as in between STOP and RUNNING: STOP -> RUNNING_P2P -> RUNNING -> RUNNING_P2P -> STOP For drivers that are unable to support RUNNING_P2P the core code silently merges RUNNING_P2P and RUNNING together. Unless driver support is present, the new state cannot be used in SET_STATE. Drivers that support this will be required to implement 4 FSM arcs beyond the basic FSM. 2 of the basic FSM arcs become combination transitions. Compared to the v1 clarification, NDMA is redefined into FSM states and is described in terms of the desired P2P quiescent behavior, noting that halting all DMA is an acceptable implementation. Link: https://lore.kernel.org/all/20220224142024.147653-11-yishaih@nvidia.com Signed-off-by: Jason Gunthorpe Tested-by: Shameer Kolothum Reviewed-by: Kevin Tian Reviewed-by: Alex Williamson Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky drivers/vfio/vfio.c | 87 +++++++++++++++++++++++++++++++++++++---------- include/linux/vfio.h | 1 + include/uapi/linux/vfio.h | 36 ++++++++++++++++++-- 3 files changed, 104 insertions(+), 20 deletions(-) commit 115dcec65f61d53e25e1bed5e380468b30f98b14 Author: Jason Gunthorpe Date: Thu Feb 24 16:20:18 2022 +0200 vfio: Define device migration protocol v2 Replace the existing region based migration protocol with an ioctl based protocol. The two protocols have the same general semantic behaviors, but the way the data is transported is changed. This is the STOP_COPY portion of the new protocol, it defines the 5 states for basic stop and copy migration and the protocol to move the migration data in/out of the kernel. Compared to the clarification of the v1 protocol Alex proposed: https://lore.kernel.org/r/163909282574.728533.7460416142511440919.stgit@omen This has a few deliberate functional differences: - ERROR arcs allow the device function to remain unchanged. - The protocol is not required to return to the original state on transition failure. Instead userspace can execute an unwind back to the original state, reset, or do something else without needing kernel support. This simplifies the kernel design and should userspace choose a policy like always reset, avoids doing useless work in the kernel on error handling paths. - PRE_COPY is made optional, userspace must discover it before using it. This reflects the fact that the majority of drivers we are aware of right now will not implement PRE_COPY. - segmentation is not part of the data stream protocol, the receiver does not have to reproduce the framing boundaries. The hybrid FSM for the device_state is described as a Mealy machine by documenting each of the arcs the driver is required to implement. Defining the remaining set of old/new device_state transitions as 'combination transitions' which are naturally defined as taking multiple FSM arcs along the shortest path within the FSM's digraph allows a complete matrix of transitions. A new VFIO_DEVICE_FEATURE of VFIO_DEVICE_FEATURE_MIG_DEVICE_STATE is defined to replace writing to the device_state field in the region. This allows returning a brand new FD whenever the requested transition opens a data transfer session. The VFIO core code implements the new feature and provides a helper function to the driver. Using the helper the driver only has to implement 6 of the FSM arcs and the other combination transitions are elaborated consistently from those arcs. A new VFIO_DEVICE_FEATURE of VFIO_DEVICE_FEATURE_MIGRATION is defined to report the capability for migration and indicate which set of states and arcs are supported by the device. The FSM provides a lot of flexibility to make backwards compatible extensions but the VFIO_DEVICE_FEATURE also allows for future breaking extensions for scenarios that cannot support even the basic STOP_COPY requirements. The VFIO_DEVICE_FEATURE_MIG_DEVICE_STATE with the GET option (i.e. VFIO_DEVICE_FEATURE_GET) can be used to read the current migration state of the VFIO device. Data transfer sessions are now carried over a file descriptor, instead of the region. The FD functions for the lifetime of the data transfer session. read() and write() transfer the data with normal Linux stream FD semantics. This design allows future expansion to support poll(), io_uring, and other performance optimizations. The complicated mmap mode for data transfer is discarded as current qemu doesn't take meaningful advantage of it, and the new qemu implementation avoids substantially all the performance penalty of using a read() on the region. Link: https://lore.kernel.org/all/20220224142024.147653-10-yishaih@nvidia.com Signed-off-by: Jason Gunthorpe Tested-by: Shameer Kolothum Reviewed-by: Kevin Tian Reviewed-by: Alex Williamson Reviewed-by: Cornelia Huck Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky drivers/vfio/vfio.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++ include/linux/vfio.h | 20 +++++ include/uapi/linux/vfio.h | 174 +++++++++++++++++++++++++++++++++++++--- 3 files changed, 380 insertions(+), 13 deletions(-) commit 445ad495f0ff71553693e6a2a9d7a3bc6917ca36 Author: Jason Gunthorpe Date: Thu Feb 24 16:20:17 2022 +0200 vfio: Have the core code decode the VFIO_DEVICE_FEATURE ioctl Invoke a new device op 'device_feature' to handle just the data array portion of the command. This lifts the ioctl validation to the core code and makes it simpler for either the core code, or layered drivers, to implement their own feature values. Provide vfio_check_feature() to consolidate checking the flags/etc against what the driver supports. Link: https://lore.kernel.org/all/20220224142024.147653-9-yishaih@nvidia.com Signed-off-by: Jason Gunthorpe Tested-by: Shameer Kolothum Reviewed-by: Alex Williamson Reviewed-by: Cornelia Huck Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky drivers/vfio/pci/vfio_pci.c | 1 + drivers/vfio/pci/vfio_pci_core.c | 94 ++++++++++++++++------------------------ drivers/vfio/vfio.c | 46 ++++++++++++++++++-- include/linux/vfio.h | 32 ++++++++++++++ include/linux/vfio_pci_core.h | 2 + 5 files changed, 114 insertions(+), 61 deletions(-) commit ef132dc40a28e07ba10b707b505781ffca46b97f Merge: ca0a53dcec94 44cd5765495b Author: David S. Miller Date: Thu Mar 3 10:43:37 2022 +0000 Merge branch 'nfc-llcp-cleanups' Krzysztof Kozlowski says: ==================== nfc: llcp: few cleanups/improvements These are improvements, not fixing any experienced issue, just looking correct to me from the code point of view. Changes since v1 ================ 1. Split from the fix. Testing ======= Under QEMU only. The NFC/LLCP code was not really tested on a device. ==================== Signed-off-by: David S. Miller commit 44cd5765495b30bc2527463f4a4b8c028e11535b Author: Krzysztof Kozlowski Date: Wed Mar 2 20:25:23 2022 +0100 nfc: llcp: Revert "NFC: Keep socket alive until the DISC PDU is actually sent" This reverts commit 17f7ae16aef1f58bc4af4c7a16b8778a91a30255. The commit brought a new socket state LLCP_DISCONNECTING, which was never set, only read, so socket could never set to such state. Remove the dead code. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller net/nfc/llcp.h | 1 - net/nfc/llcp_core.c | 7 ------- net/nfc/llcp_sock.c | 7 ------- 3 files changed, 15 deletions(-) commit a06b8044169f6d5c3eb34772c13d2c0c1b205352 Author: Krzysztof Kozlowski Date: Wed Mar 2 20:25:22 2022 +0100 nfc: llcp: protect nfc_llcp_sock_unlink() calls nfc_llcp_sock_link() is called in all paths (bind/connect) as a last action, still protected with lock_sock(). When cleaning up in llcp_sock_release(), call nfc_llcp_sock_unlink() in a mirrored way: earlier and still under the lock_sock(). Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller net/nfc/llcp_sock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit a736491239f4b434fc76a2ba0c1bdb8eaf9eb792 Author: Krzysztof Kozlowski Date: Wed Mar 2 20:25:21 2022 +0100 nfc: llcp: use test_bit() Use test_bit() instead of open-coding it, just like in other places touching the bitmap. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller net/nfc/llcp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4dbbf673f7d711e3f26396c43cbd391dc8f6c354 Author: Krzysztof Kozlowski Date: Wed Mar 2 20:25:20 2022 +0100 nfc: llcp: use centralized exiting of bind on errors Coding style encourages centralized exiting of functions, so rewrite llcp_sock_bind() error paths to use such pattern. This reduces the duplicated cleanup code, make success path visually shorter and also cleans up the errors in proper order (in reversed way from initialization). No functional impact expected. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller net/nfc/llcp_sock.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) commit ec10fd154d934cc4195da3cbd017a12817b41d51 Author: Krzysztof Kozlowski Date: Wed Mar 2 20:25:19 2022 +0100 nfc: llcp: simplify llcp_sock_connect() error paths The llcp_sock_connect() error paths were using a mixed way of central exit (goto) and cleanup Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller net/nfc/llcp_sock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 13a3585b264bfeba018941a713b8d7fc9b8221a2 Author: Krzysztof Kozlowski Date: Wed Mar 2 20:25:18 2022 +0100 nfc: llcp: nullify llcp_sock->dev on connect() error paths Nullify the llcp_sock->dev on llcp_sock_connect() error paths, symmetrically to the code llcp_sock_bind(). The non-NULL value of llcp_sock->dev is used in a few places to check whether the socket is still valid. There was no particular issue observed with missing NULL assignment in connect() error path, however a similar case - in the bind() error path - was triggereable. That one was fixed in commit 4ac06a1e013c ("nfc: fix NULL ptr dereference in llcp_sock_getname() after failed connect"), so the change here seems logical as well. Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller net/nfc/llcp_sock.c | 1 + 1 file changed, 1 insertion(+) commit ca0a53dcec9495d1dc5bbc369c810c520d728373 Merge: cbcc44db2cf7 ba95e7930957 Author: David S. Miller Date: Thu Mar 3 10:37:23 2022 +0000 Merge branch 'net-hw-counters-for-soft-devices' Ido Schimmel says: ==================== HW counters for soft devices Petr says: Offloading switch device drivers may be able to collect statistics of the traffic taking place in the HW datapath that pertains to a certain soft netdevice, such as a VLAN. In this patch set, add the necessary infrastructure to allow exposing these statistics to the offloaded netdevice in question, and add mlxsw offload. Across HW platforms, the counter itself very likely constitutes a limited resource, and the act of counting may have a performance impact. Therefore this patch set makes the HW statistics collection opt-in and togglable from userspace on a per-netdevice basis. Additionally, HW devices may have various limiting conditions under which they can realize the counter. Therefore it is also possible to query whether the requested counter is realized by any driver. In TC parlance, which is to a degree reused in this patch set, two values are recognized: "request" tracks whether the user enabled collecting HW statistics, and "used" tracks whether any HW statistics are actually collected. In the past, this author has expressed the opinion that `a typical user doing "ip -s l sh", including various scripts, wants to see the full picture and not worry what's going on where'. While that would be nice, unfortunately it cannot work: - Packets that trap from the HW datapath to the SW datapath would be double counted. For a given netdevice, some traffic can be purely a SW artifact, and some may flow through the HW object corresponding to the netdevice. But some traffic can also get trapped to the SW datapath after bumping the HW counter. It is not clear how to make sure double-counting does not occur in the SW datapath in that case, while still making sure that possibly divergent SW forwarding path gets bumped as appropriate. So simply adding HW and SW stats may work roughly, most of the time, but there are scenarios where the result is nonsensical. - HW devices will have limitations as to what type of traffic they can count. In case of mlxsw, which is part of this patch set, there is no reasonable way to count all traffic going through a certain netdevice, such as a VLAN netdevice enslaved to a bridge. It is however very simple to count traffic flowing through an L3 object, such as a VLAN netdevice with an IP address. Similarly for physical netdevices, the L3 object at which the counter is installed is the subport carrying untagged traffic. These are not "just counters". It is important that the user understands what is being counted. It would be incorrect to conflate these statistics with another existing statistics suite. To that end, this patch set introduces a statistics suite called "L3 stats". This label should make it easy to understand what is being counted, and to decide whether a given device can or cannot implement this suite for some type of netdevice. At the same time, the code is written to make future extensions easy, should a device pop up that can implement a different flavor of statistics suite (say L2, or an address-family-specific suite). For example, using a work-in-progress iproute2[1], to turn on and then list the counters on a VLAN netdevice: # ip stats set dev swp1.200 l3_stats on # ip stats show dev swp1.200 group offload subgroup l3_stats 56: swp1.200: group offload subgroup l3_stats on used on RX: bytes packets errors dropped missed mcast 0 0 0 0 0 0 TX: bytes packets errors dropped carrier collsns 0 0 0 0 0 0 The patchset progresses as follows: - Patch #1 is a cleanup. - In patch #2, remove the assumption that all LINK_OFFLOAD_XSTATS are dev-backed. The only attribute defined under the nest is currently IFLA_OFFLOAD_XSTATS_CPU_HIT. L3_STATS differs from CPU_HIT in that the driver that supplies the statistics is not the same as the driver that implements the netdevice. Make the code compatible with this in patch #2. - In patch #3, add the possibility to filter inside nests. The filter_mask field of RTM_GETSTATS header determines which top-level attributes should be included in the netlink response. This saves processing time by only including the bits that the user cares about instead of always dumping everything. This is doubly important for HW-backed statistics that would typically require a trip to the device to fetch the stats. In this patch, the UAPI is extended to allow filtering inside IFLA_STATS_LINK_OFFLOAD_XSTATS in particular, but the scheme is easily extensible to other nests as well. - In patch #4, propagate extack where we need it. In patch #5, make it possible to propagate errors from drivers to the user. - In patch #6, add the in-kernel APIs for keeping track of the new stats suite, and the notifiers that the core uses to communicate with the drivers. - In patch #7, add UAPI for obtaining the new stats suite. - In patch #8, add a new UAPI message, RTM_SETSTATS, which will carry the message to toggle the newly-added stats suite. In patch #9, add the toggle itself. At this point the core is ready for drivers to add support for the new stats suite. - In patches #10, #11 and #12, apply small tweaks to mlxsw code. - In patch #13, add support for L3 stats, which are realized as RIF counters. - Finally in patch #14, a selftest is added to the net/forwarding directory. Technically this is a HW-specific test, in that without a HW implementing the counters, it just will not pass. But devices that support L3 statistics at all are likely to be able to reuse this selftest, so it seems appropriate to put it in the general forwarding directory. We also have a netdevsim implementation, and a corresponding selftest that verifies specifically some of the core code. We intend to contribute these later. Interested parties can take a look at the raw code at [2]. [1] https://github.com/pmachata/iproute2/commits/soft_counters [2] https://github.com/pmachata/linux_mlxsw/commits/petrm_soft_counters_2 v2: - Patch #3: - Do not declare strict_start_type at the new policies, since they are used with nla_parse_nested() (sans _deprecated). - Use NLA_POLICY_NESTED to declare what the nest contents should be - Use NLA_POLICY_MASK instead of BITFIELD32 for the filtering attribute. - Patch #6: - s/monotonous/monotonic/ in commit message - Use a newly-added struct rtnl_hw_stats64 for stats transfer - Patch #7: - Use a newly-added struct rtnl_hw_stats64 for stats transfer - Patch #8: - Do not declare strict_start_type at the new policies, since they are used with nla_parse_nested() (sans _deprecated). - Patch #13: - Use a newly-added struct rtnl_hw_stats64 for stats transfer ==================== Signed-off-by: David S. Miller commit ba95e7930957e853ffae2d4528e057abe486a005 Author: Petr Machata Date: Wed Mar 2 18:31:28 2022 +0200 selftests: forwarding: hw_stats_l3: Add a new test Add a test that verifies operation of L3 HW statistics. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller .../selftests/net/forwarding/hw_stats_l3.sh | 332 +++++++++++++++++++++ 1 file changed, 332 insertions(+) commit 8d0f7d3ac6472899e6dea3b812313ee824c6745d Author: Petr Machata Date: Wed Mar 2 18:31:27 2022 +0200 mlxsw: Add support for IFLA_OFFLOAD_XSTATS_L3_STATS Spectrum machines support L3 stats by binding a counter to a RIF, a hardware object representing a router interface. Recognize the netdevice notifier events, NETDEV_OFFLOAD_XSTATS_*, to support enablement, disablement, and reporting back to core. As a netdevice gains a RIF, if L3 stats are enabled, install the counters, and ping the core so that a userspace notification can be emitted. Similarly, as a netdevice loses a RIF, push the as-yet-unreported statistics to the core, so that they are not lost, and ping the core to emit userspace notification. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 + .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 291 ++++++++++++++++++++- 2 files changed, 293 insertions(+), 2 deletions(-) commit c1de13f91ee5afeec3a1eaa9d4818ab48f8f96d9 Author: Petr Machata Date: Wed Mar 2 18:31:26 2022 +0200 mlxsw: Extract classification of router-related events to a helper Several more events are coming in the following patches, and extending the if statement is getting awkward. Instead, convert it to a switch. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) commit 9834e2467c868a670e469ef1176e991ac4aac53d Author: Petr Machata Date: Wed Mar 2 18:31:25 2022 +0200 mlxsw: spectrum_router: Drop mlxsw_sp arg from counter alloc/free functions The mlxsw_sp reference is carried by the mlxsw_sp_rif object that is passed to these functions as well. Just deduce the former from the latter, and drop the explicit mlxsw_sp parameter. Adapt callers. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c | 4 ++-- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 14 ++++++-------- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h | 6 ++---- 3 files changed, 10 insertions(+), 14 deletions(-) commit 8fe96f586b8326073ab193f2e5cf951d7cd4d609 Author: Petr Machata Date: Wed Mar 2 18:31:24 2022 +0200 mlxsw: reg: Fix packing of router interface counters The function mlxsw_reg_ritr_counter_pack() formats a register to configure a router interface (RIF) counter. The parameter `egress' determines whether an ingress or egress counter is to be configured. RITR, the register in question, has two sets of counter-related fields: one for ingress, one for egress. When setting values of the fields, the function sets the proper counter index field, but when setting the counter type, it always sets the egress field. Thus configuration of ingress counters is broken, and in fact an attempt to configure an ingress counter mangles a previously configured egress counter. This was never discovered, because there is currently no way to enable ingress counters on a router interface, only the egress one. Fix in an obvious way. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller drivers/net/ethernet/mellanox/mlxsw/reg.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) commit 5fd0b838efac16046509f7fb100455d0463b9687 Author: Petr Machata Date: Wed Mar 2 18:31:23 2022 +0200 net: rtnetlink: Add UAPI toggle for IFLA_OFFLOAD_XSTATS_L3_STATS The offloaded HW stats are designed to allow per-netdevice enablement and disablement. Add an attribute, IFLA_STATS_SET_OFFLOAD_XSTATS_L3_STATS, which should be carried by the RTM_SETSTATS message, and expresses a desire to toggle L3 offload xstats on or off. As part of the above, add an exported function rtnl_offload_xstats_notify() that drivers can use when they have installed or deinstalled the counters backing the HW stats. At this point, it is possible to enable, disable and query L3 offload xstats on netdevices. (However there is no driver actually implementing these.) Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller include/linux/rtnetlink.h | 3 ++ include/uapi/linux/if_link.h | 1 + include/uapi/linux/rtnetlink.h | 2 ++ net/core/rtnetlink.c | 75 ++++++++++++++++++++++++++++++++---------- 4 files changed, 64 insertions(+), 17 deletions(-) commit 03ba35667091337d8e632cf4b814f1c1b914609b Author: Petr Machata Date: Wed Mar 2 18:31:22 2022 +0200 net: rtnetlink: Add RTM_SETSTATS The offloaded HW stats are designed to allow per-netdevice enablement and disablement. These stats are only accessible through RTM_GETSTATS, and therefore should be toggled by a RTM_SETSTATS message. Add it, and the necessary skeleton handler. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller include/uapi/linux/rtnetlink.h | 2 ++ net/core/rtnetlink.c | 66 ++++++++++++++++++++++++++++++++++++++++++ security/selinux/nlmsgtab.c | 1 + 3 files changed, 69 insertions(+) commit 0e7788fd76222dba3229eada9162efab185923fc Author: Petr Machata Date: Wed Mar 2 18:31:21 2022 +0200 net: rtnetlink: Add UAPI for obtaining L3 offload xstats Add a new IFLA_STATS_LINK_OFFLOAD_XSTATS child attribute, IFLA_OFFLOAD_XSTATS_L3_STATS, to carry statistics for traffic that takes place in a HW router. The offloaded HW stats are designed to allow per-netdevice enablement and disablement. Additionally, as a netdevice is configured, it may become or cease being suitable for binding of a HW counter. Both of these aspects need to be communicated to the userspace. To that end, add another child attribute, IFLA_OFFLOAD_XSTATS_HW_S_INFO: - attr nest IFLA_OFFLOAD_XSTATS_HW_S_INFO - attr nest IFLA_OFFLOAD_XSTATS_L3_STATS - attr IFLA_OFFLOAD_XSTATS_HW_S_INFO_REQUEST - {0,1} as u8 - attr IFLA_OFFLOAD_XSTATS_HW_S_INFO_USED - {0,1} as u8 Thus this one attribute is a nest that can be used to carry information about various types of HW statistics, and indexing is very simply done by wrapping the information for a given statistics suite into the attribute that carries the suite is the RTM_GETSTATS query. At the same time, because _HW_S_INFO is nested directly below IFLA_STATS_LINK_OFFLOAD_XSTATS, it is possible through filtering to request only the metadata about individual statistics suites, without having to hit the HW to get the actual counters. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller include/uapi/linux/if_link.h | 11 +++ net/core/rtnetlink.c | 170 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 181 insertions(+) commit 9309f97aef6d8250bb484dabeac925c3a7c57716 Author: Petr Machata Date: Wed Mar 2 18:31:20 2022 +0200 net: dev: Add hardware stats support Offloading switch device drivers may be able to collect statistics of the traffic taking place in the HW datapath that pertains to a certain soft netdevice, such as VLAN. Add the necessary infrastructure to allow exposing these statistics to the offloaded netdevice in question. The API was shaped by the following considerations: - Collection of HW statistics is not free: there may be a finite number of counters, and the act of counting may have a performance impact. It is therefore necessary to allow toggling whether HW counting should be done for any particular SW netdevice. - As the drivers are loaded and removed, a particular device may get offloaded and unoffloaded again. At the same time, the statistics values need to stay monotonic (modulo the eventual 64-bit wraparound), increasing only to reflect traffic measured in the device. To that end, the netdevice keeps around a lazily-allocated copy of struct rtnl_link_stats64. Device drivers then contribute to the values kept therein at various points. Even as the driver goes away, the struct stays around to maintain the statistics values. - Different HW devices may be able to count different things. The motivation behind this patch in particular is exposure of HW counters on Nvidia Spectrum switches, where the only practical approach to counting traffic on offloaded soft netdevices currently is to use router interface counters, and count L3 traffic. Correspondingly that is the statistics suite added in this patch. Other devices may be able to measure different kinds of traffic, and for that reason, the APIs are built to allow uniform access to different statistics suites. - Because soft netdevices and offloading drivers are only loosely bound, a netdevice uses a notifier chain to communicate with the drivers. Several new notifiers, NETDEV_OFFLOAD_XSTATS_*, have been added to carry messages to the offloading drivers. - Devices can have various conditions for when a particular counter is available. As the device is configured and reconfigured, the device offload may become or cease being suitable for counter binding. A netdevice can use a notifier type NETDEV_OFFLOAD_XSTATS_REPORT_USED to ping offloading drivers and determine whether anyone currently implements a given statistics suite. This information can then be propagated to user space. When the driver decides to unoffload a netdevice, it can use a newly-added function, netdev_offload_xstats_report_delta(), to record outstanding collected statistics, before destroying the HW counter. This patch adds a helper, call_netdevice_notifiers_info_robust(), for dispatching a notifier with the possibility of unwind when one of the consumers bails. Given the wish to eventually get rid of the global notifier block altogether, this helper only invokes the per-netns notifier block. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller include/linux/netdevice.h | 42 +++++++ include/uapi/linux/if_link.h | 15 +++ net/core/dev.c | 267 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 323 insertions(+), 1 deletion(-) commit 216e690631f5c95a4bdde5d1237025edfe61bbf6 Author: Petr Machata Date: Wed Mar 2 18:31:19 2022 +0200 net: rtnetlink: rtnl_fill_statsinfo(): Permit non-EMSGSIZE error returns Obtaining stats for the IFLA_STATS_LINK_OFFLOAD_XSTATS nest involves a HW access, and can fail for more reasons than just netlink message size exhaustion. Therefore do not always return -EMSGSIZE on the failure path, but respect the error code provided by the callee. Set the error explicitly where it is reasonable to assume -EMSGSIZE as the failure reason. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller net/core/rtnetlink.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) commit 05415bccbb09a4eb0a3d57e7edfea73d4ce15b74 Author: Petr Machata Date: Wed Mar 2 18:31:18 2022 +0200 net: rtnetlink: Propagate extack to rtnl_offload_xstats_fill() Later patches add handlers for more HW-backed statistics. An extack will be useful when communicating HW / driver errors to the client. Add the arguments as appropriate. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller net/core/rtnetlink.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit 46efc97b73060823fdc18103a5e317a8327d44e1 Author: Petr Machata Date: Wed Mar 2 18:31:17 2022 +0200 net: rtnetlink: RTM_GETSTATS: Allow filtering inside nests The filter_mask field of RTM_GETSTATS header determines which top-level attributes should be included in the netlink response. This saves processing time by only including the bits that the user cares about instead of always dumping everything. This is doubly important for HW-backed statistics that would typically require a trip to the device to fetch the stats. So far there was only one HW-backed stat suite per attribute. However, IFLA_STATS_LINK_OFFLOAD_XSTATS is a nest, and will gain a new stat suite in the following patches. It would therefore be advantageous to be able to filter within that nest, and select just one or the other HW-backed statistics suite. Extend rtnetlink so that RTM_GETSTATS permits attributes in the payload. The scheme is as follows: - RTM_GETSTATS - struct if_stats_msg - attr nest IFLA_STATS_GET_FILTERS - attr IFLA_STATS_LINK_OFFLOAD_XSTATS - u32 filter_mask This scheme reuses the existing enumerators by nesting them in a dedicated context attribute. This is covered by policies as usual, therefore a gradual opt-in is possible. Currently only IFLA_STATS_LINK_OFFLOAD_XSTATS nest has filtering enabled, because for the SW counters the issue does not seem to be that important. rtnl_offload_xstats_get_size() and _fill() are extended to observe the requested filters. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller include/uapi/linux/if_link.h | 10 +++ net/core/rtnetlink.c | 141 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 128 insertions(+), 23 deletions(-) commit f6e0fb81298825e195888d2a32e6f7b6e64abf76 Author: Petr Machata Date: Wed Mar 2 18:31:16 2022 +0200 net: rtnetlink: Stop assuming that IFLA_OFFLOAD_XSTATS_* are dev-backed The IFLA_STATS_LINK_OFFLOAD_XSTATS attribute is a nest whose child attributes carry various special hardware statistics. The code that handles this nest was written with the idea that all these statistics would be exposed by the device driver of a physical netdevice. In the following patches, a new attribute is added to the abovementioned nest, which however can be defined for some soft netdevices. The NDO-based approach to querying these does not work, because it is not the soft netdevice driver that exposes these statistics, but an offloading NIC driver that does so. The current code does not scale well to this usage. Simply rewrite it back to the pattern seen in other fill-like and get_size-like functions elsewhere. Extract to helpers the code that is concerned with handling specifically NDO-backed statistics so that it can be easily reused should more such statistics be added. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller net/core/rtnetlink.c | 97 +++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 50 deletions(-) commit 6b524a1d012b61d605e052db0555e9d8fee29f04 Author: Petr Machata Date: Wed Mar 2 18:31:15 2022 +0200 net: rtnetlink: Namespace functions related to IFLA_OFFLOAD_XSTATS_* The currently used names rtnl_get_offload_stats() and rtnl_get_offload_stats_size() do not clearly show the namespace. The former function additionally seems to have been named this way in accordance with the NDO name, as opposed to the naming used in the rtnetlink.c file (and indeed elsewhere in the netlink handling code). As more and differently-flavored attributes are introduced, a common clear prefix is needed for all related functions. Rename the functions to follow the rtnl_offload_xstats_* naming scheme. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller net/core/rtnetlink.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit cbcc44db2cf7b836896733acc0e5ea966136ed22 Author: Manish Chopra Date: Wed Mar 2 02:52:22 2022 -0800 qed: validate and restrict untrusted VFs vlan promisc mode Today when VFs are put in promiscuous mode, they can request PF to configure device for them to receive all VLANs traffic regardless of what vlan is configured by the PF (via ip link) and PF allows this config request regardless of whether VF is trusted or not. From security POV, when VLAN is configured for VF through PF (via ip link), honour such config requests from VF only when they are configured to be trusted, otherwise restrict such VFs vlan promisc mode config. Cc: stable@vger.kernel.org Fixes: f990c82c385b ("qed*: Add support for ndo_set_vf_trust") Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Signed-off-by: David S. Miller drivers/net/ethernet/qlogic/qed/qed_sriov.c | 28 ++++++++++++++++++++++++++-- drivers/net/ethernet/qlogic/qed/qed_sriov.h | 1 + 2 files changed, 27 insertions(+), 2 deletions(-) commit 4e6e6bec7440b9b76f312f28b1f4e944eebb3abc Author: Manish Chopra Date: Wed Mar 2 02:52:21 2022 -0800 qed: display VF trust config Driver does support SR-IOV VFs trust configuration but it does not display it when queried via ip link utility. Cc: stable@vger.kernel.org Fixes: f990c82c385b ("qed*: Add support for ndo_set_vf_trust") Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Signed-off-by: David S. Miller drivers/net/ethernet/qlogic/qed/qed_sriov.c | 1 + 1 file changed, 1 insertion(+) commit d52b453608569357ab242ab780597e4b6118a4d4 Merge: a8ff736d3139 a7bf6d7c9249 Author: David S. Miller Date: Thu Mar 3 10:14:06 2022 +0000 Merge branch 'stmmac-SA8155p-ADP' @ 2022-03-02 10:39 Bhupesh Sharma 2022-03-02 10:39 ` [PATCH v2 1/2 net-next] net: stmmac: Add support for SM8150 Bhupesh Sharma 2022-03-02 10:39 ` [PATCH v2 2/2 net-next] net: stmmac: dwmac-qcom-ethqos: Adjust rgmii loopback_en per platform Bhupesh Sharma 0 siblings, 2 replies; 3+ messages in thread Bhupesh Sharma says: ==================== net: stmmac: Enable support for Qualcomm SA8155p-ADP board Changes since v1: ----------------- - v1 can be seen here: https://lore.kernel.org/netdev/20220126221725.710167-1-bhupesh.sharma@linaro.org/t/ - Fixed review comments from Bjorn - broke the v1 series into two separate series - one each for 'net' tree and 'arm clock/dts' tree - so as to ease review of the same from the respective maintainers. - This series is intended for the 'net' tree. The SA8155p-ADP board supports on-board ethernet (Gibabit Interface), with support for both RGMII and RMII buses. This patchset adds the support for the same. Note that this patchset is based on an earlier sent patchset for adding PDC controller support on SM8150 (see [1]). [1]. https://lore.kernel.org/linux-arm-msm/20220226184028.111566-1-bhupesh.sharma@linaro.org/T/ ==================== Signed-off-by: David S. Miller commit a7bf6d7c9249946996bc622a7a8584f2c48ea372 Author: Bjorn Andersson Date: Wed Mar 2 16:09:50 2022 +0530 net: stmmac: dwmac-qcom-ethqos: Adjust rgmii loopback_en per platform Not all platforms should have RGMII_CONFIG_LOOPBACK_EN and the result it about 50% packet loss on incoming messages. So make it possile to configure this per compatible and enable it for QCS404. Cc: David S. Miller Signed-off-by: Bjorn Andersson Signed-off-by: David S. Miller .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) commit d90b3120473a770a10d81dd633e8e475ea86f944 Author: Vinod Koul Date: Wed Mar 2 16:09:49 2022 +0530 net: stmmac: Add support for SM8150 This adds compatible, POR config & driver data for ethernet controller found in SM8150 SoC. Cc: David S. Miller Signed-off-by: Vinod Koul [bhsharma: Massage the commit log and other cosmetic changes] Signed-off-by: Bhupesh Sharma Signed-off-by: David S. Miller drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) commit 4f01d09b2bbfbcb47b3eb305560a7f4857a32260 Author: Zheyu Ma Date: Wed Mar 2 22:33:11 2022 +0800 video: fbdev: sm712fb: Fix crash in smtcfb_write() When the sm712fb driver writes three bytes to the framebuffer, the driver will crash: BUG: unable to handle page fault for address: ffffc90001ffffff RIP: 0010:smtcfb_write+0x454/0x5b0 Call Trace: vfs_write+0x291/0xd60 ? do_sys_openat2+0x27d/0x350 ? __fget_light+0x54/0x340 ksys_write+0xce/0x190 do_syscall_64+0x43/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Fix it by removing the open-coded endianness fixup-code. Signed-off-by: Zheyu Ma Signed-off-by: Helge Deller drivers/video/fbdev/sm712fb.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) commit 961e366c85314c31a367fcf32fa944be64167d75 Author: Yihao Han Date: Tue Mar 1 19:44:08 2022 -0800 video: fbdev: s3c-fb: fix platform_get_irq.cocci warning Remove dev_err() messages after platform_get_irq*() failures. platform_get_irq() already prints an error. Generated by: scripts/coccinelle/api/platform_get_irq.cocci Signed-off-by: Yihao Han Signed-off-by: Helge Deller drivers/video/fbdev/s3c-fb.c | 1 - 1 file changed, 1 deletion(-) commit a8ff736d31396cdd913660c34ff77b549aa853b3 Merge: 42f0c1934c7c cc10e84b2ec3 Author: David S. Miller Date: Thu Mar 3 09:55:28 2022 +0000 Merge branch 'page_pool-stats' Joe Damato says: ==================== page_pool: Add stats counters Greetings: Welcome to v9. This revisions adds a commit which updates the page_pool documentation to describe the stats API, structures, and fields. Additionally, this revision contains a minor cosmetic change suggested by Saeed in page_pool_recycle_in_ring in commit 2: "page_pool: Add recycle stats", which removes an unnecessary #ifdef. There are no functional changes in this revision. Benchmark output from the v7 cover [1] is pasted below, as it is still relevant since no functional changes have been made in this revision: Benchmarks have been re-run. As always, results between runs are highly variable; you'll find results showing that stats disabled are both faster and slower than stats enabled in back to back benchmark runs. Raw benchmark output with stats off [2] and stats on [3] are available for examination. Test system: - 2x Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz - 2 NUMA zones, with 18 cores per zone and 2 threads per core bench_page_pool_simple results, loops=200000000 test name stats enabled stats disabled cycles nanosec cycles nanosec for_loop 0 0.335 0 0.336 atomic_inc 14 6.106 13 6.022 lock 30 13.365 32 13.968 no-softirq-page_pool01 75 32.884 74 32.308 no-softirq-page_pool02 79 34.696 74 32.302 no-softirq-page_pool03 110 48.005 105 46.073 tasklet_page_pool01_fast_path 14 6.156 14 6.211 tasklet_page_pool02_ptr_ring 41 18.028 39 17.391 tasklet_page_pool03_slow 107 46.646 105 46.123 bench_page_pool_cross_cpu results, loops=20000000 returning_cpus=4: test name stats enabled stats disabled cycles nanosec cycles nanosec page_pool_cross_cpu CPU(0) 3973 1731.596 4015 1750.015 page_pool_cross_cpu CPU(1) 3976 1733.217 4022 1752.864 page_pool_cross_cpu CPU(2) 3973 1731.615 4016 1750.433 page_pool_cross_cpu CPU(3) 3976 1733.218 4021 1752.806 page_pool_cross_cpu CPU(4) 994 433.305 1005 438.217 page_pool_cross_cpu average 3378 - 3415 - bench_page_pool_cross_cpu results, loops=20000000 returning_cpus=8: test name stats enabled stats disabled cycles nanosec cycles nanosec page_pool_cross_cpu CPU(0) 6969 3037.488 6909 3011.463 page_pool_cross_cpu CPU(1) 6974 3039.469 6913 3012.961 page_pool_cross_cpu CPU(2) 6969 3037.575 6910 3011.585 page_pool_cross_cpu CPU(3) 6974 3039.415 6913 3012.961 page_pool_cross_cpu CPU(4) 6969 3037.288 6909 3011.368 page_pool_cross_cpu CPU(5) 6972 3038.732 6913 3012.920 page_pool_cross_cpu CPU(6) 6969 3037.350 6909 3011.386 page_pool_cross_cpu CPU(7) 6973 3039.356 6913 3012.921 page_pool_cross_cpu CPU(8) 871 379.934 864 376.620 page_pool_cross_cpu average 6293 - 6239 - Thanks. [1]: https://lore.kernel.org/all/1645810914-35485-1-git-send-email-jdamato@fastly.com/ [2]: https://gist.githubusercontent.com/jdamato-fsly/d7c34b9fa7be1ce132a266b0f2b92aea/raw/327dcd71d11ece10238fbf19e0472afbcbf22fd4/v7_stats_disabled [3]: https://gist.githubusercontent.com/jdamato-fsly/d7c34b9fa7be1ce132a266b0f2b92aea/raw/327dcd71d11ece10238fbf19e0472afbcbf22fd4/v7_stats_enabled v8 -> v9: - Add documentation about the page_pool_get_stats API, stats structures, and fields to Documentation/networking/page_pool.rst. - Remove unnecessary #ifdef in page_pool_recycle_in_ring. v7 -> v8: - Rename mlx5 ethtool stats so that users have a better idea of their meaning. v6 -> v7: - stats split out into two structs one single per-page pool struct for allocation path stats and one per-cpu pointer for recycle path stats. - page_pool_get_stats updated to use a wrapper struct to gather stats for allocation and recycle stats with a single argument. - placement of structs adjusted - mlx5 driver modified to use page_pool_get_stats API v5 -> v6: - Per cpu page_pool_stats struct pointer is now marked as ____cacheline_aligned_in_smp. Placement of the field in the struct is unchanged; it is the last field. v4 -> v5: - Fixed the description of the kernel option in Kconfig. - Squashed commits 1-10 from v4 into a single commit for easier review. - Changed the comment style of the comment for the this_cpu_inc_alloc_stat macro. - Changed the return type of page_pool_get_stats from struct page_pool_stat * to bool. v3 -> v4: - Restructured stats to be per-cpu per-pool. - Global stats and proc file were removed. - Exposed an API (page_pool_get_stats) for batching the pool stats. v2 -> v3: - patch 8/10 ("Add stat tracking cache refill") fixed placement of counter increment. - patch 10/10 ("net-procfs: Show page pool stats in proc") updated: - fix unused label warning from kernel test robot, - fixed page_pool_seq_show to only display the refill stat once, - added a remove_proc_entry for page_pool_stat to dev_proc_net_exit. v1 -> v2: - A new kernel config option has been added, which defaults to N, preventing this code from being compiled in by default - The stats structure has been converted to a per-cpu structure - The stats are now exported via proc (/proc/net/page_pool_stat) ==================== Signed-off-by: David S. Miller commit cc10e84b2ec3aea2cb82129bdf4185d4c05a486d Author: Joe Damato Date: Tue Mar 1 23:55:51 2022 -0800 mlx5: add support for page_pool_get_stats This change adds support for the page_pool_get_stats API to mlx5. If the user has enabled CONFIG_PAGE_POOL_STATS in their kernel, ethtool will output page pool stats. Signed-off-by: Joe Damato Acked-by: Saeed Mahameed Signed-off-by: David S. Miller drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 75 ++++++++++++++++++++++ drivers/net/ethernet/mellanox/mlx5/core/en_stats.h | 27 +++++++- 2 files changed, 101 insertions(+), 1 deletion(-) commit a3dd98281b9f265c7b89cb0c7a91739bff2e6506 Author: Joe Damato Date: Tue Mar 1 23:55:50 2022 -0800 Documentation: update networking/page_pool.rst Add the new stats API, kernel config parameter, and stats structure information to the page_pool documentation. Signed-off-by: Joe Damato Signed-off-by: David S. Miller Documentation/networking/page_pool.rst | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) commit 6b95e3388b1ea0ca63500c5a6e39162dbf828433 Author: Joe Damato Date: Tue Mar 1 23:55:49 2022 -0800 page_pool: Add function to batch and return stats Adds a function page_pool_get_stats which can be used by drivers to obtain stats for a specified page_pool. Signed-off-by: Joe Damato Acked-by: Jesper Dangaard Brouer Reviewed-by: Ilias Apalodimas Signed-off-by: David S. Miller include/net/page_pool.h | 17 +++++++++++++++++ net/core/page_pool.c | 25 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) commit ad6fa1e1ab1b8164f1ba296b1b4dc556a483bcad Author: Joe Damato Date: Tue Mar 1 23:55:48 2022 -0800 page_pool: Add recycle stats Add per-cpu stats tracking page pool recycling events: - cached: recycling placed page in the page pool cache - cache_full: page pool cache was full - ring: page placed into the ptr ring - ring_full: page released from page pool because the ptr ring was full - released_refcnt: page released (and not recycled) because refcnt > 1 Signed-off-by: Joe Damato Acked-by: Jesper Dangaard Brouer Reviewed-by: Ilias Apalodimas Signed-off-by: David S. Miller include/net/page_pool.h | 16 ++++++++++++++++ net/core/page_pool.c | 30 ++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) commit 8610037e8106b48c79cfe0afb92b2b2466e51c3d Author: Joe Damato Date: Tue Mar 1 23:55:47 2022 -0800 page_pool: Add allocation stats Add per-pool statistics counters for the allocation path of a page pool. These stats are incremented in softirq context, so no locking or per-cpu variables are needed. This code is disabled by default and a kernel config option is provided for users who wish to enable them. The statistics added are: - fast: successful fast path allocations - slow: slow path order-0 allocations - slow_high_order: slow path high order allocations - empty: ptr ring is empty, so a slow path allocation was forced. - refill: an allocation which triggered a refill of the cache - waive: pages obtained from the ptr ring that cannot be added to the cache due to a NUMA mismatch. Signed-off-by: Joe Damato Acked-by: Jesper Dangaard Brouer Reviewed-by: Ilias Apalodimas Signed-off-by: David S. Miller include/net/page_pool.h | 18 ++++++++++++++++++ net/Kconfig | 13 +++++++++++++ net/core/page_pool.c | 24 ++++++++++++++++++++---- 3 files changed, 51 insertions(+), 4 deletions(-) commit 841281fe52a769fedcf615880a33a2d0b2062b70 Author: Laurent Pinchart Date: Wed Jan 26 22:13:23 2022 +0200 drm: rcar-du: Drop LVDS device tree backward compatibility The rcar-du driver goes to great lengths to preserve device tree backward compatibility for the LVDS encoders by patching old device trees at runtime. The last R-Car Gen2 platform was converted to the new bindings commit edb0c3affe5214a2 ("ARM: dts: r8a7793: Convert to new LVDS DT bindings"), in v4.17, and the last RZ/G1 platform converted in commit 6a6a797625b5fe85 ("ARM: dts: r8a7743: Convert to new LVDS DT bindings"), in v5.0. Both are older than commit 58256143cff7c2e0 ("clk: renesas: Remove R-Car Gen2 legacy DT clock support"), in v5.5, which removes support for legacy bindings for clocks. The LVDS compatibility code is thus not needed anymore. Drop it. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham drivers/gpu/drm/rcar-du/Makefile | 6 - drivers/gpu/drm/rcar-du/rcar_du_drv.c | 21 +- drivers/gpu/drm/rcar-du/rcar_du_of.c | 323 --------------------- drivers/gpu/drm/rcar-du/rcar_du_of.h | 20 -- .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7790.dts | 69 ----- .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7791.dts | 43 --- .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7793.dts | 43 --- .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7795.dts | 43 --- .../gpu/drm/rcar-du/rcar_du_of_lvds_r8a7796.dts | 43 --- 9 files changed, 4 insertions(+), 607 deletions(-) commit ed6e76676b2657b71a0b9e5e847d96e4de0b394b Author: Nikita Yushchenko Date: Fri Dec 24 08:23:07 2021 +0300 drm: rcar-du: lvds: Add r8a77961 support The M3-W+ SoC has the same LVDS encoder as other R-Car Gen3 chips. Add support for M3-W+ (R8A77961) SoC to the LVDS encoder driver. Signed-off-by: Nikita Yushchenko Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart drivers/gpu/drm/rcar-du/rcar_lvds.c | 1 + 1 file changed, 1 insertion(+) commit 3a9a6f3da073304fe64a27a319760524a6f5f671 Author: Nikita Yushchenko Date: Fri Dec 24 08:23:09 2021 +0300 dt-bindings: display: bridge: renesas,lvds: Document r8a77961 bindings Document the R-Car M3-W+ (R8A77961) SoC in the R-Car LVDS encoder bindings. Signed-off-by: Nikita Yushchenko Reviewed-by: Laurent Pinchart Acked-by: Rob Herring Signed-off-by: Laurent Pinchart Documentation/devicetree/bindings/display/bridge/renesas,lvds.yaml | 1 + 1 file changed, 1 insertion(+) commit 701920ca9822eb63b420b3bcb627f2c1ec759903 Author: Colin Ian King Date: Wed Mar 2 17:53:09 2022 +0000 drm/ssd130x: remove redundant initialization of pointer mode Pointer mode is being assigned a value that is never read, it is being re-assigned later with a new value. The initialization is redundant and can be removed. Cleans up clang scan build warning: drivers/gpu/drm/solomon/ssd130x.c:582:27: warning: Value stored to 'mode' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Acked-by: Javier Martinez Canillas Signed-off-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220302175309.1098827-1-colin.i.king@gmail.com drivers/gpu/drm/solomon/ssd130x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c4b9c570965f75d0d55e639747f1e5ccdad2fae0 Author: Johan Hovold Date: Mon Feb 28 09:49:19 2022 +0100 USB: serial: simple: add Nokia phone driver Add a new "simple" driver for certain Nokia phones, including Nokia 130 (RM-1035) which exposes two serial ports in "charging only" mode: Bus 001 Device 009: ID 0421:069a Nokia Mobile Phones 130 [RM-1035] (Charging only) Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0421 Nokia Mobile Phones idProduct 0x069a 130 [RM-1035] (Charging only) bcdDevice 1.00 iManufacturer 1 Nokia iProduct 2 Nokia 130 (RM-1035) iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0037 bNumInterfaces 2 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Device Status: 0x0000 (Bus Powered) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220228084919.10656-1-johan@kernel.org Signed-off-by: Johan Hovold drivers/usb/serial/Kconfig | 1 + drivers/usb/serial/usb-serial-simple.c | 7 +++++++ 2 files changed, 8 insertions(+) commit 02a08d78f5c429c7dc8e5b9417b4efb518b3d041 Author: Ingo Molnar Date: Thu Mar 3 08:57:08 2022 +0100 perf/x86/intel/uncore: Fix the build on !CONFIG_PHYS_ADDR_T_64BIT 'val2' is unused if !CONFIG_PHYS_ADDR_T_64BIT: arch/x86/events/intel/uncore_discovery.c:213:18: error: unused variable ‘val2’ [-Werror=unused-variable] Signed-off-by: Ingo Molnar arch/x86/events/intel/uncore_discovery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 42f0c1934c7cb3e94c2fe8f5771245fa5631d0e7 Author: Tao Chen Date: Tue Mar 1 06:35:42 2022 -0800 tcp: Remove the unused api Last tcp_write_queue_head() use was removed in commit 114f39feab36 ("tcp: restore autocorking"), so remove it. Signed-off-by: Tao Chen Link: https://lore.kernel.org/r/SYZP282MB33317DEE1253B37C0F57231E86029@SYZP282MB3331.AUSP282.PROD.OUTLOOK.COM Signed-off-by: Jakub Kicinski include/net/tcp.h | 5 ----- 1 file changed, 5 deletions(-) commit bf08824a0f4776fc0626b82b6924fa1a5643eacb Author: Kurt Kanzenbach Date: Mon Feb 28 20:58:56 2022 +0100 flow_dissector: Add support for HSR Network drivers such as igb or igc call eth_get_headlen() to determine the header length for their to be constructed skbs in receive path. When running HSR on top of these drivers, it results in triggering BUG_ON() in skb_pull(). The reason is the skb headlen is not sufficient for HSR to work correctly. skb_pull() notices that. For instance, eth_get_headlen() returns 14 bytes for TCP traffic over HSR which is not correct. The problem is, the flow dissection code does not take HSR into account. Therefore, add support for it. Reported-by: Anthony Harivel Signed-off-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/20220228195856.88187-1-kurt@linutronix.de Signed-off-by: Jakub Kicinski include/linux/if_hsr.h | 16 ++++++++++++++++ net/core/flow_dissector.c | 17 +++++++++++++++++ net/hsr/hsr_main.h | 16 ---------------- 3 files changed, 33 insertions(+), 16 deletions(-) commit 002028857384242ebf1195c0b406e1570fd06457 Author: Baruch Siach Date: Mon Feb 28 14:10:03 2022 +0200 net: dsa: mv88e6xxx: support RMII cmode Add support for direct RMII MAC mode. This allows hardware with CPU port connected in direct 100M fixed link to work properly. Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/a962d1ccbeec42daa10dd8aff0e66e31f0faf1eb.1646050203.git.baruch@tkos.co.il Signed-off-by: Jakub Kicinski drivers/net/dsa/mv88e6xxx/port.c | 3 +++ 1 file changed, 3 insertions(+) commit 13b0bd2e62e7b16f273eb681174c842567015a39 Author: Baruch Siach Date: Mon Feb 28 14:10:02 2022 +0200 net: dsa: mv88e6xxx: don't error out cmode set on missing lane When the given cmode has no serdes, mv88e6xxx_serdes_get_lane() returns -NODEV. Earlier in the same function the code skips serdes handing in this case. Do the same after cmode set. Signed-off-by: Baruch Siach Link: https://lore.kernel.org/r/cd95cf3422ae8daf297a01fa9ec3931b203cdf45.1646050203.git.baruch@tkos.co.il Signed-off-by: Jakub Kicinski drivers/net/dsa/mv88e6xxx/port.c | 2 ++ 1 file changed, 2 insertions(+) commit cb1d8fba91f2ecf828000707cc56a376498078a4 Author: Yang Li Date: Sun Feb 27 21:22:08 2022 +0800 net: openvswitch: remove unneeded semicolon Eliminate the following coccicheck warning: ./net/openvswitch/flow.c:379:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220227132208.24658-1-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski net/openvswitch/flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d922a99b96d0030f2e7e8128e98f29123172bd03 Author: Baowen Zheng Date: Wed Mar 2 11:29:29 2022 +0800 flow_offload: improve extack msg for user when adding invalid filter Add extack message to return exact message to user when adding invalid filter with conflict flags for TC action. In previous implement we just return EINVAL which is confusing for user. Signed-off-by: Baowen Zheng Reviewed-by: Roi Dayan Link: https://lore.kernel.org/r/1646191769-17761-1-git-send-email-baowen.zheng@corigine.com Signed-off-by: Jakub Kicinski net/sched/act_api.c | 2 ++ 1 file changed, 2 insertions(+) commit 2102a27e49174c3133e02b7b74bc27316506afaf Merge: 432509013f66 0a62b2098987 Author: Jakub Kicinski Date: Wed Mar 2 22:13:06 2022 -0800 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 40GbE Intel Wired LAN Driver Updates 2022-03-01 This series contains updates to iavf driver only. Mateusz adds support for interrupt moderation for 50G and 100G speeds as well as support for the driver to specify a request as its primary MAC address. He also refactors VLAN V2 capability exchange into more generic extended capabilities to ease the addition of future capabilities. Finally, he corrects the incorrect return of iavf_status values and removes non-inclusive language. Minghao Chi removes unneeded variables, instead returning values directly. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: iavf: Remove non-inclusive language iavf: Fix incorrect use of assigning iavf_status to int iavf: stop leaking iavf_status as "errno" values iavf: remove redundant ret variable iavf: Add usage of new virtchnl format to set default MAC iavf: refactor processing of VLAN V2 capability message iavf: Add support for 50G/100G in AIM algorithm ==================== Link: https://lore.kernel.org/r/20220301185939.3005116-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 432509013f6668411730c0e51e9703b85a064de7 Author: Christophe JAILLET Date: Tue Mar 1 14:12:12 2022 +0100 nfp: flower: Remove usage of the deprecated ida_simple_xxx API Use ida_alloc_xxx()/ida_free() instead to ida_simple_get()/ida_simple_remove(). The latter is deprecated and more verbose. Signed-off-by: Christophe JAILLET Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220301131212.26348-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit 9ae1ef4b1634547d7ab7d15a9ffd48df8ce6883c Author: Russell King (Oracle) Date: Tue Mar 1 08:51:39 2022 +0000 net: sfp: use %pe for printing errors Convert sfp to use %pe for printing error codes, which can print them as errno symbols rather than numbers. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/E1nOyEN-00BuuE-OB@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski drivers/net/phy/sfp.c | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) commit ab1198e5a1dc02970a4ba490d4ec3c80d4d027f2 Author: Russell King (Oracle) Date: Tue Mar 1 08:51:34 2022 +0000 net: phylink: use %pe for printing errors Convert phylink to use %pe for printing error codes, which can print them as errno symbols rather than numbers. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/E1nOyEI-00Buu8-K9@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski drivers/net/phy/phylink.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) commit 74a335a07a17d131b9263bfdbdcb5e40673ca9ca Author: Harold Huang Date: Thu Mar 3 10:24:40 2022 +0800 tuntap: add sanity checks about msg_controllen in sendmsg In patch [1], tun_msg_ctl was added to allow pass batched xdp buffers to tun_sendmsg. Although we donot use msg_controllen in this path, we should check msg_controllen to make sure the caller pass a valid msg_ctl. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fe8dd45bb7556246c6b76277b1ba4296c91c2505 Reported-by: Eric Dumazet Suggested-by: Jason Wang Signed-off-by: Harold Huang Acked-by: Jason Wang Link: https://lore.kernel.org/r/20220303022441.383865-1-baymaxhuang@gmail.com Signed-off-by: Jakub Kicinski drivers/net/tap.c | 3 ++- drivers/net/tun.c | 3 ++- drivers/vhost/net.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) commit fa452e0a609a038e5ef9d2e042bb80e08e1af7af Merge: a577223a97df 6ee3c393eeb7 Author: Jakub Kicinski Date: Wed Mar 2 21:58:02 2022 -0800 Merge tag 'batadv-next-pullrequest-20220302' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - Remove redundant 'flush_workqueue()' calls, by Christophe JAILLET - Migrate to linux/container_of.h, by Sven Eckelmann - Demote batadv-on-batadv skip error message, by Sven Eckelmann * tag 'batadv-next-pullrequest-20220302' of git://git.open-mesh.org/linux-merge: batman-adv: Demote batadv-on-batadv skip error message batman-adv: Migrate to linux/container_of.h batman-adv: Remove redundant 'flush_workqueue()' calls batman-adv: Start new development cycle ==================== Link: https://lore.kernel.org/r/20220302163522.102842-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski commit 6b71b69dd98b197deea0806417e88308e0876a10 Author: Colin Ian King Date: Tue Mar 1 12:16:44 2022 +0000 ext4: remove redundant assignment to variable split_flag1 Variable split_flag1 is being assigned a value that is never read, it is being re-assigned a new value in the following code block. The assignment is redundant and can be removed. Cleans up clang scan build warning: fs/ext4/extents.c:3371:2: warning: Value stored to 'split_flag1' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220301121644.997833-1-colin.i.king@gmail.com Signed-off-by: Theodore Ts'o fs/ext4/extents.c | 1 - 1 file changed, 1 deletion(-) commit 5c93e8ecd5bd3bfdee013b6da0850357eb6ca4d8 Author: Zhang Yi Date: Tue Mar 1 19:17:04 2022 +0800 ext4: fix underflow in ext4_max_bitmap_size() when ext4 filesystem is created with 64k block size, ^extent and ^huge_file features. the upper_limit would underflow during the computations in ext4_max_bitmap_size(). The problem is the size of block index tree for such large block size is more than i_blocks can carry. So fix the computation to count with this possibility. After this fix, the 'res' cannot overflow loff_t on the extreme case of filesystem with huge_files and 64K block size, so this patch also revert commit 75ca6ad408f4 ("ext4: fix loff_t overflow in ext4_max_bitmap_size()"). Signed-off-by: Zhang Yi Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220301111704.2153829-1-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o fs/ext4/super.c | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) commit fd9b6fad667c7516a130cf0f3caddcb965710c12 Author: Yang Li Date: Tue Mar 1 17:21:36 2022 +0800 ext4: fix ext4_mb_clear_bb() kernel-doc comment Remove the excess description of @bh in ext4_mb_clear_bb() kernel-doc comment to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/ext4/mballoc.c:5895: warning: Excess function parameter 'bh' description in 'ext4_mb_clear_bb' Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220301092136.34764-1-yang.lee@linux.alibaba.com Signed-off-by: Theodore Ts'o fs/ext4/mballoc.c | 1 - 1 file changed, 1 deletion(-) commit 7aab5c84a0f6ec2290e2ba4a6b245178b1bf949a Author: Ye Bin Date: Mon Feb 28 10:48:15 2022 +0800 ext4: fix fs corruption when tring to remove a non-empty directory with IO error We inject IO error when rmdir non empty direcory, then got issue as follows: step1: mkfs.ext4 -F /dev/sda step2: mount /dev/sda test step3: cd test step4: mkdir -p 1/2 step5: rmdir 1 [ 110.920551] ext4_empty_dir: inject fault [ 110.921926] EXT4-fs warning (device sda): ext4_rmdir:3113: inode #12: comm rmdir: empty directory '1' has too many links (3) step6: cd .. step7: umount test step8: fsck.ext4 -f /dev/sda e2fsck 1.42.9 (28-Dec-2013) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Entry '..' in .../??? (13) has deleted/unused inode 12. Clear? yes Pass 3: Checking directory connectivity Unconnected directory inode 13 (...) Connect to /lost+found? yes Pass 4: Checking reference counts Inode 13 ref count is 3, should be 2. Fix? yes Pass 5: Checking group summary information /dev/sda: ***** FILE SYSTEM WAS MODIFIED ***** /dev/sda: 12/131072 files (0.0% non-contiguous), 26157/524288 blocks ext4_rmdir if (!ext4_empty_dir(inode)) goto end_rmdir; ext4_empty_dir bh = ext4_read_dirblock(inode, 0, DIRENT_HTREE); if (IS_ERR(bh)) return true; Now if read directory block failed, 'ext4_empty_dir' will return true, assume directory is empty. Obviously, it will lead to above issue. To solve this issue, if read directory block failed 'ext4_empty_dir' just return false. To avoid making things worse when file system is already corrupted, 'ext4_empty_dir' also return false. Signed-off-by: Ye Bin Cc: stable@kernel.org Link: https://lore.kernel.org/r/20220228024815.3952506-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o fs/ext4/inline.c | 9 ++++----- fs/ext4/namei.c | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) commit a861fb9fa51da7b1957f612b742ce62a95591628 Author: Wang Qing Date: Sun Feb 27 19:15:20 2022 -0800 ext4: use time_is_before_jiffies() instead of open coding it Use the helper function time_is_{before,after}_jiffies() to improve code readability. Signed-off-by: Wang Qing Link: https://lore.kernel.org/r/1646018120-61462-1-git-send-email-wangqing@vivo.com Signed-off-by: Theodore Ts'o fs/ext4/resize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit b3998b3bc658017dc36c69a8224fb11a3d1b1382 Author: Ritesh Harjani Date: Mon Feb 21 13:26:15 2022 +0530 ext4: improve fast_commit performance and scalability Currently ext4_fc_commit_dentry_updates() is of quadratic time complexity, which is causing performance bottlenecks with high threads/file/dir count with fs_mark. This patch makes commit dentry updates (and hence ext4_fc_commit()) path to linear time complexity. Hence improves the performance of workloads which does fsync on multiple threads/open files one-by-one. Absolute numbers in avg file creates per sec (from fs_mark in 1K order) ======================================================================= no. Order without-patch(K) with-patch(K) Diff(%) 1 1 16.90 17.51 +3.60 2 2,2 32.08 31.80 -0.87 3 3,3 53.97 55.01 +1.92 4 4,4 78.94 76.90 -2.58 5 5,5 95.82 95.37 -0.46 6 6,6 87.92 103.38 +17.58 7 6,10 0.73 126.13 +17178.08 8 6,14 2.33 143.19 +6045.49 workload type ============== For e.g. 7th row order of 6,10 (2^6 == 64 && 2^10 == 1024) echo /run/riteshh/mnt/{1..64} |sed -E 's/[[:space:]]+/ -d /g' \ | xargs -I {} bash -c "sudo fs_mark -L 100 -D 1024 -n 1024 -s0 -S5 -d {}" Perf profile (w/o patches) ============================= 87.15% [kernel] [k] ext4_fc_commit --> Heavy contention/bottleneck 1.98% [kernel] [k] perf_event_interrupt 0.96% [kernel] [k] power_pmu_enable 0.91% [kernel] [k] update_sd_lb_stats.constprop.0 0.67% [kernel] [k] ktime_get Signed-off-by: Ritesh Harjani Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/930f35d4fd5f83e2673c868781d9ebf15e91bf4e.1645426817.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o fs/ext4/ext4.h | 2 ++ fs/ext4/fast_commit.c | 74 ++++++++++++++++++++++++++++++++++++++------------- fs/ext4/fast_commit.h | 1 + 3 files changed, 59 insertions(+), 18 deletions(-) commit f48a0c475c2aec8f2274703e1dc7be503f40f7cc Author: Lukasz Luba Date: Wed Mar 2 11:29:17 2022 +0000 Documentation: EM: Describe new registration method using DT The new registration method allows to get power values from the DT OPP definition. The new OPP entry property "opp-microwatt" contains total power expressed in micro-Watts. Align the EM documentation with this new possible registration method of EM. Signed-off-by: Lukasz Luba Signed-off-by: Viresh Kumar Documentation/power/energy-model.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 32bf8bc9a077680566b2b4f88b9b46e6cc740179 Author: Lukasz Luba Date: Wed Mar 2 11:29:16 2022 +0000 OPP: Add support of "opp-microwatt" for EM registration The Energy Model (EM) can be created based on DT entry: 'dynamic-power-coefficient'. It's a 'simple' EM which is limited to the dynamic power. It has to fit into the math formula which requires also information about voltage. Some of the platforms don't expose voltage information, thus it's not possible to use EM registration using DT. This patch aims to fix it. It introduces new implementation of the EM registration callback. The new mechanism relies on the new OPP feature allowing to get power (which is coming from "opp-microwatt" DT property) expressed in micro-Watts. The patch also opens new opportunity to better support platforms, which have a decent static power. It allows to register the EM based on real power measurements which models total power (static + dynamic), so better reflects real HW. Signed-off-by: Lukasz Luba Signed-off-by: Viresh Kumar drivers/opp/of.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) commit caeea9e6671984c3865918459d756b961a24bb49 Author: Lukasz Luba Date: Wed Mar 2 11:29:15 2022 +0000 PM: EM: add macro to set .active_power() callback conditionally The Energy Model is able to use new power values coming from DT. Add a new macro which is helpful in setting the .active_power() callback conditionally in setup time. The dual-macro implementation handles both kernel configurations: w/ EM and w/o EM built-in. Reported-by: kernel test robot Signed-off-by: Lukasz Luba Signed-off-by: Viresh Kumar include/linux/energy_model.h | 2 ++ 1 file changed, 2 insertions(+) commit 4f9a7a1dc2a294c5c5c4b0246e2281e6ec88fb91 Author: Lukasz Luba Date: Wed Mar 2 11:29:14 2022 +0000 OPP: Add "opp-microwatt" supporting code Add new property to the OPP: power value. The OPP entry in the DT can have "opp-microwatt". Add the needed code to handle this new property in the existing infrastructure. Signed-off-by: Lukasz Luba Signed-off-by: Viresh Kumar drivers/opp/core.c | 25 +++++++++++++++++++++++++ drivers/opp/debugfs.c | 3 +++ drivers/opp/of.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- include/linux/pm_opp.h | 12 +++++++++++- 4 files changed, 84 insertions(+), 3 deletions(-) commit 0409ab77728d705f376ae28fd7114161295e7ed2 Author: Lukasz Luba Date: Wed Mar 2 11:29:13 2022 +0000 dt-bindings: opp: Add "opp-microwatt" entry in the OPP Add new entry for the OPP which provides information about power expressed in micro-Watts. It is useful for the Energy Model framework. Signed-off-by: Lukasz Luba Reviewed-by: Rob Herring Signed-off-by: Viresh Kumar .../devicetree/bindings/opp/opp-v2-base.yaml | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) commit 8ddb80c5fcf455fe38156636126a83eadacfb743 Author: Dmitry Baryshkov Date: Wed Mar 2 03:14:10 2022 +0300 dt-bindings: display/msm: add missing brace in dpu-qcm2290.yaml Add missing brace in dpu-qcm2290.yaml. While we are at it, also fix indentation for another brace, so it matches the corresponding line. Reported-by: Rob Herring Cc: Loic Poulain Reviewed-by: Bjorn Andersson Signed-off-by: Dmitry Baryshkov Fixes: 164f69d9d45a ("dt-bindings: msm: disp: add yaml schemas for QCM2290 DPU bindings") Link: https://lore.kernel.org/r/20220302001410.2264039-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Signed-off-by: Dmitry Baryshkov Documentation/devicetree/bindings/display/msm/dpu-qcm2290.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 3192f1d9b61a59d7c82fef187bffa7281fbdc9f5 Author: Weiguo Li Date: Thu Mar 3 00:17:39 2022 +0800 drm/amdgpu: remove redundant null check Remove the redundant null check since the caller ensures that 'ctx' is never NULL. Reviewed-by: Christian König Signed-off-by: Weiguo Li Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 6 ------ 1 file changed, 6 deletions(-) commit 825e0af0d453f18bb84feb40bff447cf59d61979 Author: Alex Deucher Date: Tue Mar 1 10:54:51 2022 -0500 drm/amdgpu/sdma5: drop unused cyan skillfish firmware Leftover from bring up. Not used anymore. Acked-by: Christian König Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) commit 31f5f46043c7e7fa453b0b64ea12073d524e2150 Author: Alex Deucher Date: Tue Mar 1 10:51:54 2022 -0500 drm/amdgpu/gfx10: drop unused cyan skillfish firmware Leftover from bring up. Not used anymore. Acked-by: Christian König Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) commit 1b537e64105dd8f04c8e7d5fbd8e97f9dda2dadd Author: Alex Deucher Date: Tue Mar 1 10:47:37 2022 -0500 drm/amdgpu: remove unused gpu_info firmwares These were leftover from bring up and are no longer necessary. The information is available via the IP discovery table. Acked-by: Christian König Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 23 ----------------------- 1 file changed, 23 deletions(-) commit 45a3e06be4d351af8f81b43407b3eafa5c75827d Author: Alex Deucher Date: Mon Feb 28 14:31:59 2022 -0500 drm/amdgpu: Use IP versions in convert_tiling_flags_to_modifier() Rather than checking the asic_type. Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit fe5e8f07fc25c850e4f46967699a9b29b0ef647d Author: Dillon Varone Date: Thu Feb 10 18:17:39 2022 -0500 drm/amd/display: Modify plane removal sequence to avoid hangs. Reviewed-by: Aric Cyr Acked-by: Alan Liu Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) commit 7952fa0d3e187504d509aa32f46d4d430e4eb634 Author: Danijel Slivka Date: Wed Mar 2 11:29:55 2022 +0100 drm/amd/pm: new v3 SmuMetrics data structure for Sienna Cichlid structure changed in smc_fw_version >= 0x3A4900, "uint16_t VcnActivityPercentage" replaced with "uint16_t VcnUsagePercentage0" and "uint16_t VcnUsagePercentage1" Signed-off-by: Danijel Slivka Acked-by: Evan Quan Reviewed-by: Evan Quan Signed-off-by: Alex Deucher .../inc/pmfw_if/smu11_driver_if_sienna_cichlid.h | 58 +++++++ .../drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 181 ++++++++++++++------- 2 files changed, 178 insertions(+), 61 deletions(-) commit d7709eb6a197171715f370227173e817a3da85c8 Author: Prike Liang Date: Tue Mar 1 17:33:09 2022 +0800 drm/amdgpu: enable gfxoff routine for GC 10.3.7 Enable gfxoff routine for GC 10.3.7. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 +++ drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 1 + 2 files changed, 4 insertions(+) commit fabe1753851c62d0292a39d89a4a8d7f15c96794 Author: Prike Liang Date: Tue Mar 1 14:08:24 2022 +0800 drm/amdgpu: enable gfx power gating for GC 10.3.7 Enable gfx power gating for GC 10.3.7. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/nv.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) commit 9a1358bb2ce3738826bce0799d47d6963ccb51bf Author: Prike Liang Date: Tue Mar 1 11:22:23 2022 +0800 drm/amdgpu/nv: enable clock gating for GC 10.3.7 subblock This will enable the following block clock gating. - MC - SDMA - HDP - ATHUB - IH - VCN/JPEG Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/nv.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 00bfab4457c2b57897ea710a423684979c5b0239 Author: Prike Liang Date: Tue Mar 1 10:48:11 2022 +0800 drm/amdgpu: enable gfx clock gating control for GC 10.3.7 Enable gfx cg gate/ungate control for GC 10.3.7. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 + 1 file changed, 1 insertion(+) commit b6901d93cc126bbfbdc6caf5f0c03b82945e43f2 Author: Qiang Yu Date: Tue Mar 1 14:11:59 2022 +0800 drm/amdgpu: fix suspend/resume hang regression Regression has been reported that suspend/resume may hang with the previous vm ready check commit. So bring back the evicted list check as a temp fix. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1922 Fixes: c1a66c3bc425 ("drm/amdgpu: check vm ready by amdgpu_vm->evicting flag") Reviewed-by: Christian König Signed-off-by: Qiang Yu Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit e6fac6a9c9eb42a9362f9f093dcb8862f2b38383 Author: Yifan Zha Date: Tue Mar 1 13:54:42 2022 +0800 drm/amdgpu: Move CAP firmware loading to the beginning of PSP firmware list [Why] As PSP needs to verify the signature, CAP firmware must be loaded first when PSP loads firmwares. Otherwise, when DFC feature is enabled, CP firmwares would be loaded failed. [ 1149.160480] [drm] MM table gpu addr = 0x800022f000, cpu addr = 00000000a62afcea. [ 1149.209874] [drm] failed to load ucode CP_CE(0x8) [ 1149.209878] [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF0007) [ 1149.215914] [drm] failed to load ucode CP_PFP(0x9) [ 1149.215917] [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF0007) [ 1149.221941] [drm] failed to load ucode CP_ME(0xA) [ 1149.221944] [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF0007) [ 1149.228082] [drm] failed to load ucode CP_MEC1(0xB) [ 1149.228085] [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF0007) [ 1149.234209] [drm] failed to load ucode CP_MEC2(0xD) [ 1149.234212] [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF0007) [ 1149.242379] [drm] failed to load ucode VCN(0x1C) [ 1149.242382] [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF0007) [How] Move CAP UCODE ID to the beginning of AMDGPU_UCODE_ID enum list. Signed-off-by: Yifan Zha Reviewed-by: Bokun Zhang Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 5aa061474b1e0cc9605877190e23a880cf1551e4 Author: Andrey Grodzovsky Date: Tue Mar 1 12:58:23 2022 -0500 drm/amdgpu: Bump minor version for hot plug tests enabling. This will allow to enable the tests only after latest fix after which the tests passed on my system. I tested on NV21 standalone and Vega 10 and Polaris as pair with DRI_PRIME. It's possible there might be still issues on ASICs i don't have at my posession but that that the point of enbling the tests finally - if other people during testing will encounter errors they will report and I will be able to fix. The releated merge request for enabling libdrm tests suite is in https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/227 Signed-off-by: Andrey Grodzovsky Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 57230f0ce6eda6d47a2029b7b3a39cc5bb63fe32 Author: Andrey Grodzovsky Date: Mon Feb 28 19:03:36 2022 -0500 drm/amdgpu: Fix sigsev when accessing MMIO on hot unplug. Protect with drm_dev_enter/exit Reviewed-by: Christian König Signed-off-by: Andrey Grodzovsky Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 7d4108e4ceb30a89c63ae62bea284cf42985cf31 Author: Yifan Zhang Date: Wed Mar 2 14:09:07 2022 -0500 drm/amdgpu: convert code name to ip version for noretry set Use IP version rather than codename for noretry set. Acked-by: Christian König Reviewed-by: Huang Rui Signed-off-by: Yifan Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) commit 957b0787ee5d5c0848e2dde625c09850e1ada22e Author: Yifan Zhang Date: Tue Mar 1 18:26:43 2022 +0800 drm/amdgpu: move amdgpu_gmc_noretry_set after ip_versions populated otherwise adev->ip_versions is still empty when amdgpu_gmc_noretry_set is called. Reviewed-by: Huang Rui Signed-off-by: Yifan Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 80e0c2cb37b6e00ec0b41c7670e24f72b2d54ceb Author: yipechai Date: Thu Feb 17 15:40:12 2022 +0800 drm/amdgpu: Remove redundant .ras_fini initialization in some ras blocks 1. Define amdgpu_ras_block_late_fini_default in amdgpu_ras.c as .ras_fini common function, which is called when .ras_fini of ras block isn't initialized. 2. Remove the code of using amdgpu_ras_block_late_fini to initialize .ras_fini in ras blocks. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 8 ++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 1 - drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ---- drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 4 ---- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 8 -------- drivers/gpu/drm/amd/amdgpu/hdp_v4_0.c | 1 - drivers/gpu/drm/amd/amdgpu/mca_v3_0.c | 3 --- drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 1 - drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 ---- 9 files changed, 8 insertions(+), 26 deletions(-) commit 30e58102d5164ce5df10bbff4c9d05acbd12a5fe Author: yipechai Date: Thu Feb 17 15:33:24 2022 +0800 drm/amdgpu: Remove redundant calls of amdgpu_ras_block_late_fini in mca ras block Remove redundant calls of amdgpu_ras_block_late_fini in mca ras block. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_mca.c | 6 ------ drivers/gpu/drm/amd/amdgpu/amdgpu_mca.h | 3 --- drivers/gpu/drm/amd/amdgpu/mca_v3_0.c | 21 +++------------------ 3 files changed, 3 insertions(+), 27 deletions(-) commit 149d7ba1f8fe515a2a36ff95fa659720e72fe4ed Author: yipechai Date: Mon Feb 14 16:15:19 2022 +0800 drm/amdgpu: Remove redundant calls of amdgpu_ras_block_late_fini in sdma ras block Remove redundant calls of amdgpu_ras_block_late_fini in sdma ras block. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 7 ------- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 1 - drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) commit aa8e65dfc75f684cd46d49f71453ea3512a1e770 Author: yipechai Date: Thu Feb 17 15:02:32 2022 +0800 drm/amdgpu: Remove redundant calls of amdgpu_ras_block_late_fini in hdp ras block Remove redundant calls of amdgpu_ras_block_late_fini in hdp ras block. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c | 4 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.h | 1 - drivers/gpu/drm/amd/amdgpu/hdp_v4_0.c | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) commit f148c143ef3f6e897f4a1012d1bcae3aa240bd8a Author: yipechai Date: Mon Feb 14 16:10:32 2022 +0800 drm/amdgpu: Remove redundant calls of amdgpu_ras_block_late_fini in xgmi ras block Remove redundant calls of amdgpu_ras_block_late_fini in xgmi ras block. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) commit 0dca257d6dc5526c4c293f306b7b47765987de22 Author: yipechai Date: Mon Feb 14 16:07:55 2022 +0800 drm/amdgpu: Remove redundant calls of amdgpu_ras_block_late_fini in umc ras block Remove redundant calls of amdgpu_ras_block_late_fini in umc ras block. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 7 ------- drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h | 1 - drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +- 4 files changed, 2 insertions(+), 10 deletions(-) commit f578a37d19c65361e141735cdcb691d3930b8647 Author: yipechai Date: Mon Feb 14 16:04:08 2022 +0800 drm/amdgpu: Remove redundant calls of amdgpu_ras_block_late_fini in nbio ras block Remove redundant calls of amdgpu_ras_block_late_fini in nbio ras block. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 7 ------- drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h | 1 - drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) commit 9dad47c50f9bf19153c092a73eb4721344f4a78d Author: yipechai Date: Mon Feb 14 16:01:02 2022 +0800 drm/amdgpu: Remove redundant calls of amdgpu_ras_block_late_fini in mmhub ras block Remove redundant calls of amdgpu_ras_block_late_fini in mmhub ras block. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 4 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h | 1 - drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) commit 35366481d0941e9b470ccf09d85407381b5d6135 Author: yipechai Date: Mon Feb 14 15:59:35 2022 +0800 drm/amdgpu: Remove redundant calls of amdgpu_ras_block_late_fini in gfx ras block Remove redundant calls of amdgpu_ras_block_late_fini in gfx ras block. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 7 ------- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 1 - drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) commit 1f211a827cbda87bd0ec145a1f44f2615c3f56d3 Author: yipechai Date: Mon Feb 14 15:46:32 2022 +0800 drm/amdgpu: centrally calls the .ras_fini function of all ras blocks centrally calls the .ras_fini function of all ras blocks. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 10 ---------- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 20 ++++++++++++++------ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 ---- drivers/gpu/drm/amd/amdgpu/soc15.c | 3 --- 5 files changed, 14 insertions(+), 26 deletions(-) commit 667c7091a39e8b360d34f37aed5f8dd85bdc45f7 Author: yipechai Date: Thu Feb 17 14:55:19 2022 +0800 drm/amdgpu: Optimize xxx_ras_fini function of each ras block 1. Move the variables of ras block instance members from specific xxx_ras_fini to general ras_fini call. 2. Function calls inside the modules only use parameters passed from xxx_ras_fini instead of ras block instance members. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 8 ++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) commit 01d468d9a420152e4a1270992e69a37ea0c98e04 Author: yipechai Date: Thu Feb 17 14:52:20 2022 +0800 drm/amdgpu: Modify .ras_fini function pointer parameter Modify .ras_fini function pointer parameter so that we can remove redundant intermediate calls in some ras blocks. Signed-off-by: yipechai Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 8 ++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/mca_v3_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/soc15.c | 2 +- 19 files changed, 24 insertions(+), 24 deletions(-) commit b51759661e2987993fb49eadcc262d6a2ab2a698 Author: Shah Dharati Date: Wed Feb 16 14:17:41 2022 -0500 drm/amd/display: Adding a dc_debug option and dmub setting to use PHY FSM for PSR [Why] PSR Power on/off is done in PSR. Add a dc_debug option and dmub setting to use PHY implementation of this instead. [How] Add a dc_debug option and dmub setting to use PHY FSM Power up/down for PSR. Co-authored-by: Shah Dharati Reviewed-by: Hansen Dsouza Acked-by: Alan Liu Signed-off-by: Shah Dharati Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 1 + drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 1 + drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 8 ++++++-- 4 files changed, 9 insertions(+), 2 deletions(-) commit 91dcfe5fd9d3a59aec4a40031c1eef00b41b8f74 Author: Dillon Varone Date: Mon Feb 14 10:47:46 2022 -0500 drm/amd/display: Add frame alternate 3D & restrict HW packed on dongles [WHY?] Some projectors support frame alternate 3D modes at 120Hz, but DAL3 does not create timings. Most active DP to HDMI dongles do not translate infoframes properly to use HW packing stereo mode. [HOW?] Create frame alternate 3D timings for displays that support it. Disable HW packing 3D mode on DP active dongles. Reviewed-by: Martin Leung Acked-by: Alan Liu Signed-off-by: Dillon Varone Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_link.c | 11 +++++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 ++- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 11 ----------- 3 files changed, 13 insertions(+), 12 deletions(-) commit ca6fcfa8d4461c889636ef5dd51bdec96c6122bd Author: Tom Rix Date: Sun Feb 27 07:33:42 2022 -0800 drm/amdgpu: Fix realloc of ptr Clang static analysis reports this error amdgpu_debugfs.c:1690:9: warning: 1st function call argument is an uninitialized value tmp = krealloc_array(tmp, i + 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ realloc uses tmp, so tmp can not be garbage. And the return needs to be checked. Fixes: 5ce5a584cb82 ("drm/amdgpu: add debugfs for reset registers list") Reviewed-by: Christian König Signed-off-by: Tom Rix Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 4affb123033851381dcff4887982f6c7bad938af Author: Chris Park Date: Tue Feb 15 17:14:16 2022 -0500 drm/amd/display: Reset VIC if HDMI_VIC is present [Why] HDMI Compliance requires VIC to be set to 0 on 2D mode if HDMI_VIC is present. [How] When VIC and HDMI_VIC is both present, reset VIC to 0. Reviewed-by: Martin Leung Acked-by: Alan Liu Signed-off-by: Chris Park Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 ++ 1 file changed, 2 insertions(+) commit 6dc0fded62806373855350ec8c3ccb1567ddd465 Author: Nicholas Kazlauskas Date: Thu Feb 3 12:08:36 2022 -0500 drm/amd/display: Make functional resource functions non-static [Why & How] To align coding style for how we use this across DCN. The resource creation ones can remain static, however. Reviewed-by: Eric Yang Acked-by: Alan Liu Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c | 4 ++-- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) commit 1e242bf8bc1b37c74619403d0dd59d0f862af943 Author: Hansen Dsouza Date: Fri Feb 4 20:24:33 2022 -0500 drm/amd/display: Remove invalid RDPCS Programming in DAL RDPCS programming is done in DMUB remove legacy invalid code Reviewed-by: Alvin Lee Acked-by: Alan Liu Signed-off-by: Hansen Dsouza Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.c | 9 --------- 1 file changed, 9 deletions(-) commit d58b8a99cbb84c1eb3b3613d23c1a328695a9455 Author: Philip Yang Date: Fri Feb 25 12:33:51 2022 -0500 drm/amdkfd: Add SMI add event helper To remove duplicate code, unify event message format and simplify new event add in the following patches. Use KFD_SMI_EVENT_MSG_SIZE to define msg size, the same size will be used in user space to alloc the msg receive buffer. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 68 ++++++++++------------------- include/uapi/linux/kfd_ioctl.h | 1 + 2 files changed, 23 insertions(+), 46 deletions(-) commit 38abd56bed580c98e4284a578380f5f70634a0fd Author: Philip Yang Date: Thu Dec 16 10:59:29 2021 -0500 drm/amdkfd: Correct SMI event read size sizeof(buf) is 8 bytes because it is defined as unsigned char *buf, each SMI event read only copy max 8 bytes to user buffer. Correct this by using the buf allocate size. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit e433d6843310a259f0be18c80de26d75b9f7fd35 Author: Philip Yang Date: Fri Feb 25 14:58:03 2022 -0500 Revert "drm/amdkfd: process_info lock not needed for svm" This reverts commit 3abfe30d803e62cc75dec254eefab3b04d69219b. To fix deadlock in kFDSVMEvictTest when xnack off. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit b8cb6ab68674d7889c0dcfac2d542a63b9e36d82 Author: Meng Tang Date: Fri Feb 25 17:47:22 2022 +0800 gpu/amd: vega10_hwmgr: fix inappropriate private variable name In file vega10_hwmgr.c, the names of struct vega10_power_state * and struct pp_power_state * are confusingly used, which may lead to some confusion. Status quo is that variables of type struct vega10_power_state * are named "vega10_ps", "ps", "vega10_power_state". A more appropriate usage is that struct are named "ps" is used for variabled of type struct pp_power_state *. So rename struct vega10_power_state * which are named "ps" and "vega10_power_state" to "vega10_ps", I also renamed "psa" to "vega10_psa" and "psb" to "vega10_psb" to make it more clearly. The rows longer than 100 columns are involved. Reviewed-by: Evan Quan Signed-off-by: Meng Tang Signed-off-by: Alex Deucher .../gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 68 ++++++++++++---------- 1 file changed, 38 insertions(+), 30 deletions(-) commit 52e8da704d8d3ca8b951fbc39cf8d6bce5c33db8 Author: Luben Tuikov Date: Thu Feb 24 16:29:52 2022 -0500 drm/amd/display: Don't fill up the logs Don't fill up the logs with: [253557.859575] [drm:amdgpu_dm_atomic_check [amdgpu]] DSC precompute is not needed. [253557.892966] [drm:amdgpu_dm_atomic_check [amdgpu]] DSC precompute is not needed. [253557.926070] [drm:amdgpu_dm_atomic_check [amdgpu]] DSC precompute is not needed. [253557.959344] [drm:amdgpu_dm_atomic_check [amdgpu]] DSC precompute is not needed. which prints many times a second, when the kernel is run with drm.debug=2. Instead of DRM_DEBUG_DRIVER(), make it DRM_INFO_ONCE(). Cc: Alex Deucher Cc: Roman Li Cc: Felix Kuehling Cc: Hersen Wu Cc: Daniel Wheeler Fixes: 17ce8a6907f7 ("drm/amd/display: Add dsc pre-validation in atomic check") Signed-off-by: Luben Tuikov Reviewed-by: Roman Li Signed-off-by: Alex Deucher drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit f44b645fe0070c0f1ac34a358252a7123c56e709 Author: Masahiro Yamada Date: Fri Feb 18 13:46:34 2022 +0900 certs: simplify empty certs creation in certs/Makefile To create an empty cert file, we need to pass "" to the extract-cert tool, which is common for all the three call-sites of cmd_extract_certs. Factor out the logic into extract-cert-in. One exceptional case is PKCS#11 case, where we override extract-cert-in with the URI. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier certs/Makefile | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) commit 6ce019f73d52513239314e75376a5ca622aa3632 Author: Masahiro Yamada Date: Fri Feb 18 13:46:33 2022 +0900 certs: include certs/signing_key.x509 unconditionally I do not see much sense in the #if conditional in system_certificates.S; even if the condition is true, there exists no signing key when CONFIG_MODULE_SIG_KEY="". So, certs/Makefile generates empty certs/signing_key.x509 in such a case. We can always do this, irrespective of CONFIG_MODULE_SIG or (CONFIG_IMA_APPRAISE_MODSIG && CONFIG_MODULES). We only need to check CONFIG_MODULE_SIG_KEY, then both *.S and Makefile will become much simpler. Signed-off-by: Masahiro Yamada certs/Makefile | 16 ---------------- certs/system_certificates.S | 3 --- 2 files changed, 19 deletions(-) commit 280ee3c3aaa8158e69db5453d8ffd11fce49979c Author: Yang Yingliang Date: Fri Feb 25 15:27:24 2022 +0800 crypto: octeontx2 - fix missing unlock Add the missing unlock before return from error path. Fixes: 4363f3d3ce8f ("crypto: octeontx2 - add synchronization between mailbox accesses") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Herbert Xu drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c | 4 +++- drivers/crypto/marvell/octeontx2/otx2_cptpf_mbox.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) commit e6205ad58a7ac194abfb33897585b38687d797fa Author: Wan Jiabing Date: Fri Feb 25 14:38:59 2022 +0800 hwrng: cavium - fix NULL but dereferenced coccicheck error Fix following coccicheck warning: ./drivers/char/hw_random/cavium-rng-vf.c:182:17-20: ERROR: pdev is NULL but dereferenced. Signed-off-by: Wan Jiabing Reviewed-by: Sunil Goutham Signed-off-by: Herbert Xu drivers/char/hw_random/cavium-rng-vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 959e375464912a32b9d971642d933ae71b9f0267 Author: Andy Shevchenko Date: Wed Feb 23 18:26:20 2022 +0200 crypto: cavium/nitrox - don't cast parameter in bit operations While in this particular case it would not be a (critical) issue, the pattern itself is bad and error prone in case the location of the parameter is changed. Don't cast parameter to unsigned long pointer in the bit operations. Instead copy to a local variable on stack of a proper type and use. Fixes: cf718eaa8f9b ("crypto: cavium/nitrox - Enabled Mailbox support") Signed-off-by: Andy Shevchenko Signed-off-by: Herbert Xu drivers/crypto/cavium/nitrox/nitrox_mbx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 647d41d3952d726d4ae49e853a9eff68ebad3b3f Author: Petr Vorel Date: Wed Feb 23 16:11:15 2022 +0100 crypto: vmx - add missing dependencies vmx-crypto module depends on CRYPTO_AES, CRYPTO_CBC, CRYPTO_CTR or CRYPTO_XTS, thus add them. These dependencies are likely to be enabled, but if CRYPTO_DEV_VMX=y && !CRYPTO_MANAGER_DISABLE_TESTS and either of CRYPTO_AES, CRYPTO_CBC, CRYPTO_CTR or CRYPTO_XTS is built as module or disabled, alg_test() from crypto/testmgr.c complains during boot about failing to allocate the generic fallback implementations (2 == ENOENT): [ 0.540953] Failed to allocate xts(aes) fallback: -2 [ 0.541014] alg: skcipher: failed to allocate transform for p8_aes_xts: -2 [ 0.541120] alg: self-tests for p8_aes_xts (xts(aes)) failed (rc=-2) [ 0.544440] Failed to allocate ctr(aes) fallback: -2 [ 0.544497] alg: skcipher: failed to allocate transform for p8_aes_ctr: -2 [ 0.544603] alg: self-tests for p8_aes_ctr (ctr(aes)) failed (rc=-2) [ 0.547992] Failed to allocate cbc(aes) fallback: -2 [ 0.548052] alg: skcipher: failed to allocate transform for p8_aes_cbc: -2 [ 0.548156] alg: self-tests for p8_aes_cbc (cbc(aes)) failed (rc=-2) [ 0.550745] Failed to allocate transformation for 'aes': -2 [ 0.550801] alg: cipher: Failed to load transform for p8_aes: -2 [ 0.550892] alg: self-tests for p8_aes (aes) failed (rc=-2) Fixes: c07f5d3da643 ("crypto: vmx - Adding support for XTS") Fixes: d2e3ae6f3aba ("crypto: vmx - Enabling VMX module for PPC64") Suggested-by: Nicolai Stange Signed-off-by: Petr Vorel Signed-off-by: Herbert Xu drivers/crypto/vmx/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) commit 9578de385c783e525bfe06bd6e775f95a8759ccb Author: Harsha Date: Wed Feb 23 16:05:04 2022 +0530 MAINTAINERS: Add maintainer for Xilinx ZynqMP SHA3 driver This patch adds an entry for ZynqMP SHA3 driver in the list of Maintainers. Signed-off-by: Harsha Signed-off-by: Herbert Xu MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) commit 7ecc3e34474b7055994314ab6cff75eac7d03b71 Author: Harsha Date: Wed Feb 23 16:05:03 2022 +0530 crypto: xilinx - Add Xilinx SHA3 driver This patch adds SHA3 driver support for the Xilinx ZynqMP SoC. Xilinx ZynqMP SoC has SHA3 engine used for secure hash calculation. The flow is SHA3 request from Userspace -> SHA3 driver-> ZynqMp driver-> Firmware -> SHA3 HW Engine SHA3 HW engine in Xilinx ZynqMP SoC, does not support parallel processing of 2 hash requests. Therefore, software fallback is being used for init, update, final, export and import in the ZynqMP SHA driver For digest, the calculation of SHA3 hash is done by the hardened SHA3 accelerator in Xilinx ZynqMP SoC. Signed-off-by: Harsha Signed-off-by: Kalyani Akula Signed-off-by: Herbert Xu drivers/crypto/Kconfig | 10 ++ drivers/crypto/xilinx/Makefile | 1 + drivers/crypto/xilinx/zynqmp-sha.c | 283 +++++++++++++++++++++++++++++++++++++ 3 files changed, 294 insertions(+) commit 80f940ef527efdd8e36c69f7b5ee8e07ac8891d9 Author: Harsha Date: Wed Feb 23 16:05:02 2022 +0530 firmware: xilinx: Add ZynqMP SHA API for SHA3 functionality This patch adds zynqmp_pm_sha_hash API in the ZynqMP firmware to compute SHA3 hash of given data. Signed-off-by: Harsha Signed-off-by: Kalyani Akula Acked-by: Michal Simek Signed-off-by: Herbert Xu drivers/firmware/xilinx/zynqmp.c | 26 ++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 8 ++++++++ 2 files changed, 34 insertions(+) commit 52af29abffca9f091bb6e8f615d693b5380cbe7a Author: Harsha Date: Wed Feb 23 16:05:01 2022 +0530 crypto: xilinx - Updated Makefile for xilinx subdirectory This patch updates the Makefile for xilinx subdirectory. CONFIG_CRYPTO_DEV_ZYNQMP_AES protects zynqmp-aes-gcm.o and it is used twice (in drivers/crypto/Makefile and drivers/crypto/xilinx/Makefile) and it is enough to use it once. Signed-off-by: Harsha Reviewed-by: Michal Simek Signed-off-by: Herbert Xu drivers/crypto/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7976c1492571a5fb234c416559a0d9790855c635 Author: Ard Biesheuvel Date: Wed Feb 23 08:07:01 2022 +0100 crypto: crypto_xor - use helpers for unaligned accesses Dereferencing a misaligned pointer is undefined behavior in C, and may result in codegen on architectures such as ARM that trigger alignments traps and expensive fixups in software. Instead, use the get_aligned()/put_aligned() accessors, which are cheap or even completely free when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y. In the converse case, the prior alignment checks ensure that the casts are safe, and so no unaligned accessors are necessary. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu crypto/algapi.c | 24 +++++++++++++++++++++--- include/crypto/algapi.h | 10 ++++++++-- 2 files changed, 29 insertions(+), 5 deletions(-) commit 4920a4a7262dd1c647b515c05358ccbee0ab828c Author: Tom Rix Date: Mon Feb 21 14:31:18 2022 -0800 crypto: cleanup comments For spdx /* */ for *.h, // for *.c Space before spdx tag Replacements paramenters to parameters aymmetric to asymmetric sigature to signature boudary to boundary compliled to compiled eninges to engines explicity to explicitly Signed-off-by: Tom Rix Acked-by: Jarkko Sakkinen Signed-off-by: Herbert Xu crypto/asymmetric_keys/signature.c | 2 +- crypto/asymmetric_keys/x509_parser.h | 2 +- crypto/async_tx/async_xor.c | 8 ++++---- crypto/async_tx/raid6test.c | 4 ++-- crypto/cfb.c | 2 +- crypto/sm2.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) commit 35d2bf20683f60288441844ab19ce671075643e6 Author: Nicolai Stange Date: Mon Feb 21 13:11:01 2022 +0100 crypto: dh - calculate Q from P for the full public key verification As the ->q in struct dh_ctx gets never set anywhere, the code in dh_is_pubkey_valid() for doing the full public key validation in accordance to SP800-56Arev3 is effectively dead. However, for safe-prime groups Q = (P - 1)/2 by definition and as the safe-prime groups are the only possible groups in FIPS mode (via those ffdheXYZ() templates), this enables dh_is_pubkey_valid() to calculate Q on the fly for these. Implement this. With this change, the last code accessing struct dh_ctx's ->q is now gone. Remove this member from struct dh_ctx. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/dh.c | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) commit 81771ff2411a4cd1224c4b16e0b4247e71bba0de Author: Nicolai Stange Date: Mon Feb 21 13:11:00 2022 +0100 lib/mpi: export mpi_rshift A subsequent patch will make the crypto/dh's dh_is_pubkey_valid() to calculate a safe-prime groups Q parameter from P: Q = (P - 1) / 2. For implementing this, mpi_rshift() will be needed. Export it so that it's accessible from crypto/dh. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu lib/mpi/mpi-bit.c | 1 + 1 file changed, 1 insertion(+) commit 32f07cc40c9bb41452dc9d6c514a2012d9682b39 Author: Nicolai Stange Date: Mon Feb 21 13:10:59 2022 +0100 crypto: dh - disallow plain "dh" usage in FIPS mode SP800-56Arev3, sec. 5.5.2 ("Assurance of Domain-Parameter Validity") asserts that an implementation needs to verify domain paramtere validity, which boils down to either - the domain parameters corresponding to some known safe-prime group explicitly listed to be approved in the document or - for parameters conforming to a "FIPS 186-type parameter-size set", that the implementation needs to perform an explicit domain parameter verification, which would require access to the "seed" and "counter" values used in their generation. The latter is not easily feasible and moreover, SP800-56Arev3 states that safe-prime groups are preferred and that FIPS 186-type parameter sets should only be supported for backward compatibility, if it all. Mark "dh" as not fips_allowed in testmgr. Note that the safe-prime ffdheXYZ(dh) wrappers are not affected by this change: as these enforce some approved safe-prime group each, their usage is still allowed in FIPS mode. This change will effectively render the keyctl(KEYCTL_DH_COMPUTE) syscall unusable in FIPS mode, but it has been brought up that this might even be a good thing ([1]). [1] https://lore.kernel.org/r/20211217055227.GA20698@gondor.apana.org.au Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/testmgr.c | 1 - 1 file changed, 1 deletion(-) commit d6097b8d5d55f26cd2244e7e7f00a5a077772a91 Author: Nicolai Stange Date: Mon Feb 21 13:10:58 2022 +0100 crypto: api - allow algs only in specific constructions in FIPS mode Currently we do not distinguish between algorithms that fail on the self-test vs. those which are disabled in FIPS mode (not allowed). Both are marked as having failed the self-test. Recently the need arose to allow the usage of certain algorithms only as arguments to specific template instantiations in FIPS mode. For example, standalone "dh" must be blocked, but e.g. "ffdhe2048(dh)" is allowed. Other potential use cases include "cbcmac(aes)", which must only be used with ccm(), or "ghash", which must be used only for gcm(). This patch allows this scenario by adding a new flag FIPS_INTERNAL to indicate those algorithms that are not FIPS-allowed. They can then be used as template arguments only, i.e. when looked up via crypto_grab_spawn() to be more specific. The FIPS_INTERNAL bit gets propagated upwards recursively into the surrounding template instances, until the construction eventually matches an explicit testmgr entry with ->fips_allowed being set, if any. The behaviour to skip !->fips_allowed self-test executions in FIPS mode will be retained. Note that this effectively means that FIPS_INTERNAL algorithms are handled very similarly to the INTERNAL ones in this regard. It is expected that the FIPS_INTERNAL algorithms will receive sufficient testing when the larger constructions they're a part of, if any, get exercised by testmgr. Note that as a side-effect of this patch algorithms which are not FIPS-allowed will now return ENOENT instead of ELIBBAD. Hopefully this is not an issue as some people were relying on this already. Link: https://lore.kernel.org/r/YeEVSaMEVJb3cQkq@gondor.apana.org.au Originally-by: Herbert Xu Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/algapi.c | 18 ++++++++++++++++-- crypto/api.c | 19 +++++++++++++++++-- crypto/tcrypt.c | 4 ++-- crypto/testmgr.c | 23 +++++++++++++++++++---- include/linux/crypto.h | 9 +++++++++ 5 files changed, 63 insertions(+), 10 deletions(-) commit c8e8236cf71f1e808120804339d2c23dc304f9cd Author: Nicolai Stange Date: Mon Feb 21 13:10:57 2022 +0100 crypto: dh - allow for passing NULL to the ffdheXYZ(dh)s' ->set_secret() Ephemeral key generation can be requested from any of the ffdheXYZ(dh) variants' common ->set_secret() by passing it an (encoded) struct dh with the key parameter being unset, i.e. with ->key_size == 0. As the whole purpose of the ffdheXYZ(dh) templates is to fill in the group parameters as appropriate, they expect ->p and ->g to be unset in any input struct dh as well. This means that a user would have to encode an all-zeroes struct dh instance via crypto_dh_encode_key() when requesting ephemeral key generation from a ffdheXYZ(dh) instance, which is kind of pointless. Make dh_safe_prime_set_secret() to decode a struct dh from the supplied buffer only if the latter is non-NULL and initialize it with all zeroes otherwise. That is, it is now possible to call crypto_kpp_set_secret(tfm, NULL, 0); on any ffdheXYZ(dh) tfm for requesting ephemeral key generation. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/dh.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) commit 209b7fc9c9249c400610cec1cbfba848f293f2e9 Author: Nicolai Stange Date: Mon Feb 21 13:10:56 2022 +0100 crypto: testmgr - add keygen tests for ffdheXYZ(dh) templates Now that the ffdheXYZ(dh) templates support ephemeral key generation, add ->keygen = 1 TVs for each of them to the testmgr.c. In order to facilitate string merging by the compiler, set party B's secret and public keys to the ones specified for party A in the respective existing known answer test. With GCC 7.5 on x86_64, this leads to an increase of testmgr.o size by less than half a kB. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/testmgr.h | 578 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 568 insertions(+), 10 deletions(-) commit 1e207964566738b49b003e80063fd712af75b82c Author: Nicolai Stange Date: Mon Feb 21 13:10:55 2022 +0100 crypto: dh - implement private key generation primitive for ffdheXYZ(dh) The support for NVME in-band authentication currently in the works ([1]) needs to generate ephemeral DH keys for use with the RFC 7919 safe-prime FFDHE groups. In analogy to ECDH and its ecc_gen_privkey(), implement a dh_safe_prime_gen_privkey() and invoke it from the ffdheXYZ(dh) templates' common ->set_secret(), i.e. dh_safe_prime_set_secret(), in case the input ->key_size is zero. As the RFC 7919 FFDHE groups are classified as approved safe-prime groups by SP800-56Arev3, it's worthwhile to make the new dh_safe_prime_gen_privkey() to follow the approach specified in SP800-56Arev3, sec. 5.6.1.1.3 ("Key-Pair Generation Using Extra Random Bits") in order to achieve conformance. SP800-56Arev3 specifies a lower as well as an upper bound on the generated key's length: - it must be >= two times the maximum supported security strength of the group in question and - it must be <= the length of the domain parameter Q. For any safe-prime group Q = (P - 1)/2 by definition and the individual maximum supported security strengths as specified by SP800-56Arev3 have been made available as part of the FFDHE dh_safe_prime definitions introduced with a previous patch. Make dh_safe_prime_gen_privkey() pick twice the maximum supported strength rounded up to the next power of two for the output key size. This choice respects both, the lower and upper bounds given by SP800-90Arev3 for any of the approved safe-prime groups and is also in line with the NVME base spec 2.0, which requires the key size to be >= 256bits. [1] https://lore.kernel.org/r/20211202152358.60116-1-hare@suse.de Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/Kconfig | 1 + crypto/dh.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 138 insertions(+), 3 deletions(-) commit 60a273e9aecd8ee8a7d84f78f366795a67607829 Author: Nicolai Stange Date: Mon Feb 21 13:10:54 2022 +0100 crypto: testmgr - add known answer tests for ffdheXYZ(dh) templates Add known answer tests for the ffdhe2048(dh), ffdhe3072(dh), ffdhe4096(dh), ffdhe6144(dh) and ffdhe8192(dh) templates introduced with the previous patch to the testmgr. All TVs have been generated with OpenSSL. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/testmgr.c | 37 +++ crypto/testmgr.h | 871 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 908 insertions(+) commit 7dce59819750d78513c70bf4a9024e265af88b23 Author: Nicolai Stange Date: Mon Feb 21 13:10:53 2022 +0100 crypto: dh - implement ffdheXYZ(dh) templates Current work on NVME in-band authentication support ([1]) needs to invoke DH with the FFDHE safe-prime group parameters specified in RFC 7919. Introduce a new CRYPTO_DH_RFC7919_GROUPS Kconfig option. If enabled, make dh_generic register a couple of ffdheXYZ(dh) templates, one for each group: ffdhe2048(dh), ffdhe3072(dh), ffdhe4096(dh), ffdhe6144(dh) and ffdhe8192(dh). Their respective ->set_secret() expects a (serialized) struct dh, just like the underlying "dh" implementation does, but with the P and G values unset so that the safe-prime constants for the given group can be filled in by the wrapping template. Internally, a struct dh_safe_prime instance is being defined for each of the ffdheXYZ(dh) templates as appropriate. In order to prepare for future key generation, fill in the maximum security strength values as specified by SP800-56Arev3 on the go, even though they're not needed at this point yet. Implement the respective ffdheXYZ(dh) crypto_template's ->create() by simply forwarding any calls to the __dh_safe_prime_create() helper introduced with the previous commit, passing the associated dh_safe_prime in addition to the received ->create() arguments. [1] https://lore.kernel.org/r/20211202152358.60116-1-hare@suse.de Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/Kconfig | 6 ++ crypto/dh.c | 298 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 303 insertions(+), 1 deletion(-) commit d902981f09bf935f257953d227a7721e8e541052 Author: Nicolai Stange Date: Mon Feb 21 13:10:52 2022 +0100 crypto: dh - introduce common code for built-in safe-prime group support Recent work on NVME in-band authentication support ([1]) needs to invoke the "dh" KPP with the FFDHE safe-prime group parameters as specified in RFC 7919 and generate ephemeral keys suitable for the respective group. By coincidence, the requirements from NIST SP800-56Arev3, sec. 5.5.2 ("Assurance of Domain-Parameter Validity") basically boil down to disallowing any group parameters not among the approved safe-prime groups specified in either RFC 7919 or RFC 3526 in FIPS mode. Furthermore, SP800-56Arev3 specifies the respective security strength for each of the approved safe-prime groups, which has a direct impact on the minimum key lengths. In this light, it's desirable to introduce built-in support for the RFC 7919 safe-prime groups to the kernel's DH implementation, provide a SP800-56Arev3 conforming key generation primitive for those and render non-approved group parameters unusable in FIPS mode on the way. As suggested ([2]) in the course of discussion to previous iterations of this patchset, the built-in support for ffdhe groups would be best made available in the form of templates wrapping the existing "dh" implementation, one for each group specified by RFC 7919: ffdhe2048(dh), ffdhe3072(dh), ffdhe4096(dh), ffdhe6144(dh) and ffdhe8192(dh). As these templates differ only in the safe-prime constants they'd configure the inner "dh" transforms with, they can share almost all of their "dh"-wrapping template implementation code. Introduce this common code to dh_generic. The actual dump of the RFC 7919 safe-prime constants will be deferred to the next patch in order to facilitate review. The ephemeral key generation primitive mentioned above likewise deserves a patch on its own, as does the mechanism by which unapproved groups are rendered unusable in FIPS mode. Define a struct dh_safe_prime container for specifying the individual templates' associated safe-prime group constants. All ffdheXYZ(dh) template instances will store a pointer to such a dh_safe_prime in their context areas each. Implement the common __dh_safe_prime_create() template instantiation helper. The intention is that the individual ffdheXYZ(dh) crypto_templates' ->create() implementations will simply forward any calls to __dh_safe_prime_create(), passing a suitable dh_safe_prime in addition to the received ->create() arguments. __dh_safe_prime_create() would then create and register a kpp_instance as appropriate, storing the given dh_safe_prime pointer alongside a crypto_kpp_spawn for the inner "dh" kpp_alg in the context area. As the ffdheXYZ(dh) kpp_instances are supposed to act as proxies to the inner "dh" kpp_alg, make each of their associated crypto_kpp transforms to in turn own an inner "dh" transform, a pointer to which gets stored in the context area. Setup and teardown are getting handled from the outer ->init_tfm() and ->exit_tfm() respectively. In order to achieve the overall goal and let the ffdheXYZ(dh) kpp_instances configure the inner "dh" transforms with the respective group parameters, make their common ->set_secret(), the new dh_safe_prime_set_secret(), fill in the P and G values before forwarding the call to the inner "dh"'s ->set_secret(). Note that the outer ->set_secret() can obtain the P value associated with the given ffdheXYZ(dh) kpp_instance by means of the dh_safe_prime referenced from the latter's context. The value of G OTOH always equals constant 2 for the safe-prime groups. Finally, make the remaining two kpp_alg primitives both operating on kpp_requests, i.e. ->generate_public_key() and ->compute_shared_secret(), to merely forward any request to the inner "dh" implementation. However, a kpp_request instance received from the outside cannot get simply passed on as-is, because its associated transform (crypto_kpp_reqtfm()) will have been set to the outer ffdheXYZ(dh) one. In order to handle this, reserve some space in the outer ffdheXYZ(dh) kpp_requests' context areas for in turn storing an inner kpp_request suitable for "dh" each. Make the outer ->generate_public_key() and ->compute_shared_secret() respectively to setup this inner kpp_request by means of the new dh_safe_prime_prepare_dh_req() helper before handing it over to the "dh" implementation for further processing. dh_safe_prime_prepare_dh_req() basically copies the outer kpp_request received from the outside over to the inner one, but installs the inner transform and its own ->complete() proxy callback therein. This completion callback, the new dh_safe_prime_complete_req(), doesn't do anything beyond completing the outer request. Note that there exist some examples in crypto/, which would simply install the completion handler from the outer request at the inner one in similar setups, e.g. seqiv. However, this would mean that the user-provided completion handler won't get called with the address of the outer kpp_request initially submitted and the handler might not be prepared for this. Users could certainly work around this by setting the callback ->data properly, but IMO it's cleaner this way. Furthermore, it might make sense to extend dh_safe_prime_complete_req() in the future and move e.g. those post-computation FIPS checks from the generic "dh" implementation to the ffdheXYZ(dh) templates. [1] https://lore.kernel.org/r/20211202152358.60116-1-hare@suse.de [2] https://lore.kernel.org/r/20211217055227.GA20698@gondor.apana.org.au Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/dh.c | 208 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) commit fae198935c442e09afa3ecca197e144f732068d7 Author: Nicolai Stange Date: Mon Feb 21 13:10:51 2022 +0100 crypto: dh - split out deserialization code from crypto_dh_decode() A subsequent commit will introduce "dh" wrapping templates of the form "ffdhe2048(dh)", "ffdhe3072(dh)" and so on in order to provide built-in support for the well-known safe-prime ffdhe group parameters specified in RFC 7919. Those templates' ->set_secret() will wrap the inner "dh" implementation's ->set_secret() and set the ->p and ->g group parameters as appropriate on the way inwards. More specifically, - A ffdheXYZ(dh) user would call crypto_dh_encode() on a struct dh instance having ->p == ->g == NULL as well as ->p_size == ->g_size == 0 and pass the resulting buffer to the outer ->set_secret(). - This outer ->set_secret() would then decode the struct dh via crypto_dh_decode_key(), set ->p, ->g, ->p_size as well as ->g_size as appropriate for the group in question and encode the struct dh again before passing it further down to the inner "dh"'s ->set_secret(). The problem is that crypto_dh_decode_key() implements some basic checks which would reject parameter sets with ->p_size == 0 and thus, the ffdheXYZ templates' ->set_secret() cannot use it as-is for decoding the passed buffer. As the inner "dh"'s ->set_secret() will eventually conduct said checks on the final parameter set anyway, the outer ->set_secret() really only needs the decoding functionality. Split out the pure struct dh decoding part from crypto_dh_decode_key() into the new __crypto_dh_decode_key(). __crypto_dh_decode_key() gets defined in crypto/dh_helper.c, but will have to get called from crypto/dh.c and thus, its declaration must be somehow made available to the latter. Strictly speaking, __crypto_dh_decode_key() is internal to the dh_generic module, yet it would be a bit over the top to introduce a new header like e.g. include/crypto/internal/dh.h containing just a single prototype. Add the __crypto_dh_decode_key() declaration to include/crypto/dh.h instead. Provide a proper kernel-doc annotation, even though __crypto_dh_decode_key() is purposedly not on the function list specified in Documentation/crypto/api-kpp.rst. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/dh_helper.c | 27 +++++++++++++++++++-------- include/crypto/dh.h | 16 ++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) commit 215bebc8c6ac438c382a6a56bd2764a2d4e1da72 Author: Nicolai Stange Date: Mon Feb 21 13:10:50 2022 +0100 crypto: dh - constify struct dh's pointer members struct dh contains several pointer members corresponding to DH parameters: ->key, ->p and ->g. A subsequent commit will introduce "dh" wrapping templates of the form "ffdhe2048(dh)", "ffdhe3072(dh)" and so on in order to provide built-in support for the well-known safe-prime ffdhe group parameters specified in RFC 7919. These templates will need to set the group parameter related members of the (serialized) struct dh instance passed to the inner "dh" kpp_alg instance, i.e. ->p and ->g, to some constant, static storage arrays. Turn the struct dh pointer members' types into "pointer to const" in preparation for this. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu include/crypto/dh.h | 6 +++--- security/keys/dh.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) commit 48c6d8b878c1d811015cfba1a302d8474a9aace6 Author: Nicolai Stange Date: Mon Feb 21 13:10:49 2022 +0100 crypto: dh - remove struct dh's ->q member The only current user of the DH KPP algorithm, the keyctl(KEYCTL_DH_COMPUTE) syscall, doesn't set the domain parameter ->q in struct dh. Remove it and any associated (de)serialization code in crypto_dh_encode_key() and crypto_dh_decode_key. Adjust the encoded ->secret values in testmgr's DH test vectors accordingly. Note that the dh-generic implementation would have initialized its struct dh_ctx's ->q from the decoded struct dh's ->q, if present. If this struct dh_ctx's ->q would ever have been non-NULL, it would have enabled a full key validation as specified in NIST SP800-56A in dh_is_pubkey_valid(). However, as outlined above, ->q is always NULL in practice and the full key validation code is effectively dead. A later patch will make dh_is_pubkey_valid() to calculate Q from P on the fly, if possible, so don't remove struct dh_ctx's ->q now, but leave it there until that has happened. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/dh.c | 6 ------ crypto/dh_helper.c | 17 ++++------------- crypto/testmgr.h | 16 ++++++---------- include/crypto/dh.h | 4 ---- 4 files changed, 10 insertions(+), 33 deletions(-) commit 46ed5269bf7dac752f78fc5f8dc5efb52b483fe7 Author: Nicolai Stange Date: Mon Feb 21 13:10:48 2022 +0100 crypto: kpp - provide support for KPP spawns The upcoming support for the RFC 7919 ffdhe group parameters will be made available in the form of templates like "ffdhe2048(dh)", "ffdhe3072(dh)" and so on. Template instantiations thereof would wrap the inner "dh" kpp_alg and also provide kpp_alg services to the outside again. The primitves needed for providing kpp_alg services from template instances have been introduced with the previous patch. Continue this work now and implement everything needed for enabling template instances to make use of inner KPP algorithms like "dh". More specifically, define a struct crypto_kpp_spawn in close analogy to crypto_skcipher_spawn, crypto_shash_spawn and alike. Implement a crypto_grab_kpp() and crypto_drop_kpp() pair for binding such a spawn to some inner kpp_alg and for releasing it respectively. Template implementations can instantiate transforms from the underlying kpp_alg by means of the new crypto_spawn_kpp(). Finally, provide the crypto_spawn_kpp_alg() helper for accessing a spawn's underlying kpp_alg during template instantiation. Annotate everything with proper kernel-doc comments, even though include/crypto/internal/kpp.h is not considered for the generated docs. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/kpp.c | 9 ++++++ include/crypto/internal/kpp.h | 75 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) commit 1038fd78a1b8269b642ce09600242682186a78e2 Author: Nicolai Stange Date: Mon Feb 21 13:10:47 2022 +0100 crypto: kpp - provide support for KPP template instances The upcoming support for the RFC 7919 ffdhe group parameters will be made available in the form of templates like "ffdhe2048(dh)", "ffdhe3072(dh)" and so on. Template instantiations thereof would wrap the inner "dh" kpp_alg and also provide kpp_alg services to the outside again. Furthermore, it might be perhaps be desirable to provide KDF templates in the future, which would similarly wrap an inner kpp_alg and present themselves to the outside as another kpp_alg, transforming the shared secret on its way out. Introduce the bits needed for supporting KPP template instances. Everything related to inner kpp_alg spawns potentially being held by such template instances will be deferred to a subsequent patch in order to facilitate review. Define struct struct kpp_instance in close analogy to the already existing skcipher_instance, shash_instance and alike, but wrapping a struct kpp_alg. Implement the new kpp_register_instance() template instance registration primitive. Provide some helper functions for - going back and forth between a generic struct crypto_instance and the new struct kpp_instance, - obtaining the instantiating kpp_instance from a crypto_kpp transform and - for accessing a given kpp_instance's implementation specific context data. Annotate everything with proper kernel-doc comments, even though include/crypto/internal/kpp.h is not considered for the generated docs. Signed-off-by: Nicolai Stange Reviewed-by: Hannes Reinecke Signed-off-by: Herbert Xu crypto/kpp.c | 20 +++++++++++ include/crypto/internal/kpp.h | 83 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) commit 4058cf08945c18a6de193f4118fd05d83d3d4285 Author: Corentin Labbe Date: Mon Feb 21 12:08:33 2022 +0000 crypto: engine - check if BH is disabled during completion When doing iperf over ipsec with crypto hardware sun8i-ce, I hit some spinlock recursion bug. This is due to completion function called with enabled BH. Add check a to detect this. Fixes: 735d37b5424b ("crypto: engine - Introduce the block request crypto engine framework") Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu crypto/crypto_engine.c | 1 + 1 file changed, 1 insertion(+) commit 7f22421103c5a7f9a1726f0ed125274c38174ddb Author: Corentin Labbe Date: Mon Feb 21 12:08:32 2022 +0000 crypto: gemini - call finalize with bh disabled Doing ipsec produces a spinlock recursion warning. This is due to not disabling BH during crypto completion function. Fixes: 46c5338db7bd45b2 ("crypto: sl3516 - Add sl3516 crypto engine") Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu drivers/crypto/gemini/sl3516-ce-cipher.c | 2 ++ 1 file changed, 2 insertions(+) commit dba633342994ce47d347bcf5522ba28301247b79 Author: Corentin Labbe Date: Mon Feb 21 12:08:31 2022 +0000 crypto: amlogic - call finalize with bh disabled Doing ipsec produces a spinlock recursion warning. This is due to not disabling BH during crypto completion function. Fixes: 48fe583fe541 ("crypto: amlogic - Add crypto accelerator for amlogic GXL") Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu drivers/crypto/amlogic/amlogic-gxl-cipher.c | 2 ++ 1 file changed, 2 insertions(+) commit f75a749b6d78aeae2ce90e14fcc4b7b3ba46126d Author: Corentin Labbe Date: Mon Feb 21 12:08:30 2022 +0000 crypto: sun8i-ce - call finalize with bh disabled Doing ipsec produces a spinlock recursion warning. This is due to not disabling BH during crypto completion function. Fixes: 06f751b61329 ("crypto: allwinner - Add sun8i-ce Crypto Engine") Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c | 3 +++ drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c | 3 +++ 2 files changed, 6 insertions(+) commit b169b3766242b6f3336e24a6c8ee1522978b57a7 Author: Corentin Labbe Date: Mon Feb 21 12:08:29 2022 +0000 crypto: sun8i-ss - call finalize with bh disabled Doing ipsec produces a spinlock recursion warning. This is due to not disabling BH during crypto completion function. Fixes: f08fcced6d00 ("crypto: allwinner - Add sun8i-ss cryptographic offloader") Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu drivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c | 3 +++ drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 3 +++ 2 files changed, 6 insertions(+) commit 2f5ee72ee950a677069ee8ab75af40cebba3bb3c Author: Corentin Labbe Date: Mon Feb 21 11:52:34 2022 +0000 crypto: cavium/zip - register algorithm only if hardware is present On my renesas salavator-X, I saw some cavium driver failing crypto self-tests. But salvator does not have such hardware. This is due to cavium/zip driver registering algorithms even if hardware is not present. The solution is to move algorithm registration in the probe function. This permits also to simplify module init/exit by using module_pci_driver. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu drivers/crypto/cavium/zip/zip_main.c | 83 +++++++++++++++--------------------- 1 file changed, 35 insertions(+), 48 deletions(-) commit 53e748c2758ca24854b6ce89fb08a93a36772dc0 Author: Claudiu Beznea Date: Mon Feb 21 09:59:28 2022 +0200 hwrng: atmel - remove extra line Remove extra line. Signed-off-by: Claudiu Beznea Signed-off-by: Herbert Xu drivers/char/hw_random/atmel-rng.c | 1 - 1 file changed, 1 deletion(-) commit c4f51eab6ce0b7138f375673dbb2789e49b6d028 Author: Claudiu Beznea Date: Mon Feb 21 09:59:27 2022 +0200 hwrng: atmel - add runtime pm support Add runtime PM support. Signed-off-by: Claudiu Beznea Signed-off-by: Herbert Xu drivers/char/hw_random/atmel-rng.c | 44 +++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 12 deletions(-) commit b953188525973314e32586e45bbd3d4768891c27 Author: Claudiu Beznea Date: Mon Feb 21 09:59:26 2022 +0200 hwrng: atmel - use __maybe_unused and pm_ptr() for pm ops Use __maybe_unused and pm_ptr() for pm ops. Signed-off-by: Claudiu Beznea Signed-off-by: Herbert Xu drivers/char/hw_random/atmel-rng.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) commit 9fbd8b306fcb8d1f1294972f26a3e4d57134c4ad Author: Claudiu Beznea Date: Mon Feb 21 09:59:25 2022 +0200 hwrng: atmel - move set of TRNG_HALFR in atmel_trng_init() Move set of TRNG_HALFR in atmel_trng_init() as this function is also called on resume path. In case of SAMA7G5 where backup and self-refresh PM mode is available most of the SoC parts are powered of (including TRNG) when entering suspend. In that case on resuming path TRNG_HALFR should also be re-configured. Signed-off-by: Claudiu Beznea Signed-off-by: Herbert Xu drivers/char/hw_random/atmel-rng.c | 49 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 24 deletions(-) commit f14b02088fb8b6633bc32b052e0d66308f191cc8 Author: Claudiu Beznea Date: Mon Feb 21 09:59:24 2022 +0200 hwrng: atmel - rename enable/disable functions to init/cleanup s/atmel_trng_disable/atmel_trng_cleanup/g and s/atmel_trng_enable/atmel_trng_init/g to cope with struct hwrng::{init, cleanup} members. Signed-off-by: Claudiu Beznea Signed-off-by: Herbert Xu drivers/char/hw_random/atmel-rng.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit a223ea9f89ab960eb254ba78429efd42eaf845eb Author: Claudiu Beznea Date: Mon Feb 21 09:59:23 2022 +0200 hwrng: atmel - disable trng on failure path Call atmel_trng_disable() on failure path of probe. Fixes: a1fa98d8116f ("hwrng: atmel - disable TRNG during suspend") Signed-off-by: Claudiu Beznea Signed-off-by: Herbert Xu drivers/char/hw_random/atmel-rng.c | 1 + 1 file changed, 1 insertion(+) commit 0934683dd1c7d307cac29902ee5e0ab50aa279f9 Author: Claudiu Beznea Date: Mon Feb 21 09:59:22 2022 +0200 hwrng: atmel - add wait for ready support on read Add wait for ready support on read. Signed-off-by: Claudiu Beznea Signed-off-by: Herbert Xu drivers/char/hw_random/atmel-rng.c | 43 ++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 13 deletions(-) commit e41d27eaf5485df99f366bf7c5382375bb2c19ca Author: Tommy Haung Date: Wed Mar 2 10:49:29 2022 +0800 drm/aspeed: Add AST2600 chip support Add AST2600 chip support and setting. Signed-off-by: Tommy Haung Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley Link: https://patchwork.freedesktop.org/patch/msgid/20220302024930.18758-5-tommy_huang@aspeedtech.com drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 9 +++++++++ 1 file changed, 9 insertions(+) commit 5e2421ce79703b969eeb9684cedaa76be5305ddd Author: Tommy Haung Date: Wed Mar 2 10:49:28 2022 +0800 drm/aspeed: Update INTR_STS handling Add interrupt clear register define for further chip support. Signed-off-by: Tommy Haung Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley Link: https://patchwork.freedesktop.org/patch/msgid/20220302024930.18758-4-tommy_huang@aspeedtech.com drivers/gpu/drm/aspeed/aspeed_gfx.h | 1 + drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) commit ff8dcfebe08dfb2524041116d4afce53ffe0b015 Author: Sebastian Andrzej Siewior Date: Fri Feb 11 19:15:00 2022 +0100 staging: greybus: gpio: Use generic_handle_irq_safe(). Instead of manually disabling interrupts before invoking use generic_handle_irq_safe() which can be invoked with enabled and disabled interrupts. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Greg Kroah-Hartman Acked-by: Johan Hovold Cc: Alex Elder Cc: Rui Miguel Silva Link: https://lore.kernel.org/r/20220211181500.1856198-8-bigeasy@linutronix.de drivers/staging/greybus/gpio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit bfe6b967948c251955bcf175cb2d4e8d169102ca Author: Sebastian Andrzej Siewior Date: Fri Feb 11 19:14:59 2022 +0100 net: usb: lan78xx: Use generic_handle_irq_safe(). Instead of manually disabling interrupts before invoking use generic_handle_irq_safe() which can be invoked with enabled and disabled interrupts. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Woojung Huh Cc: "David S. Miller" Cc: Jakub Kicinski Cc: UNGLinuxDriver@microchip.com Link: https://lore.kernel.org/r/20220211181500.1856198-7-bigeasy@linutronix.de drivers/net/usb/lan78xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 83d9b7e3955d32d3e4e3321029f655716cb21c99 Author: Sebastian Andrzej Siewior Date: Fri Feb 11 19:14:58 2022 +0100 mfd: ezx-pcap: Use generic_handle_irq_safe(). Instead of manually disabling interrupts before invoking use generic_handle_irq_safe() which can be invoked with enabled and disabled interrupts. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Lee Jones Link: https://lore.kernel.org/r/20220211181500.1856198-6-bigeasy@linutronix.de drivers/mfd/ezx-pcap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit 1b9855de1ef4a3f82119f9d8b054a588c7c315fb Author: Sebastian Andrzej Siewior Date: Fri Feb 11 19:14:57 2022 +0100 misc: hi6421-spmi-pmic: Use generic_handle_irq_safe(). generic_handle_irq() is invoked from a regular interrupt service routine. This handler will become a forced-threaded handler on PREEMPT_RT and will be invoked with enabled interrupts. The generic_handle_irq() must be invoked with disabled interrupts in order to avoid deadlocks. Instead of manually disabling interrupts before invoking use generic_handle_irq_safe() which can be invoked with enabled and disabled interrupts. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Mauro Carvalho Chehab Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220211181500.1856198-5-bigeasy@linutronix.de drivers/misc/hi6421v600-irq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 1d366c2f9df8279df2adbb60471f86fc40a1c39e Author: Robert Hancock Date: Thu Jan 27 11:50:13 2022 -0600 i2c: xiic: Make bus names unique This driver is for an FPGA logic core, so there can be arbitrarily many instances of the bus on a given system. Previously all of the I2C bus names were "xiic-i2c" which caused issues with lm_sensors when trying to map human-readable names to sensor inputs because it could not properly distinguish the busses, for example. Append the platform device name to the I2C bus name so it is unique between different instances. Fixes: e1d5b6598cdc ("i2c: Add support for Xilinx XPS IIC Bus Interface") Signed-off-by: Robert Hancock Tested-by: Michal Simek Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-xiic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 8bbe98bdccef0bb4fe88c666c28a3d4fe51151f7 Merge: 530e214c5b5a 676b2daabaf9 Author: Alexei Starovoitov Date: Wed Mar 2 13:24:37 2022 -0800 Merge branch 'fixes for bpf_prog_pack' Song Liu says: ==================== Changes v1 => v2: 1. Rephrase comments in 2/2. (Yonghong) Two fixes for bpf_prog_pack. ==================== Signed-off-by: Alexei Starovoitov commit 676b2daabaf9a993db0e02a5ce79b984aaa0388b Author: Song Liu Date: Wed Mar 2 09:51:26 2022 -0800 bpf, x86: Set header->size properly before freeing it On do_jit failure path, the header is freed by bpf_jit_binary_pack_free. While bpf_jit_binary_pack_free doesn't require proper ro_header->size, bpf_prog_pack_free still uses it. Set header->size in bpf_int_jit_compile before calling bpf_jit_binary_pack_free. Fixes: 1022a5498f6f ("bpf, x86_64: Use bpf_jit_binary_pack_alloc") Fixes: 33c9805860e5 ("bpf: Introduce bpf_jit_binary_pack_[alloc|finalize|free]") Reported-by: Kui-Feng Lee Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220302175126.247459-3-song@kernel.org arch/x86/net/bpf_jit_comp.c | 5 ++++- kernel/bpf/core.c | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) commit eed1fcee556fd8569afe94178b0c2784a5a6b717 Author: Song Liu Date: Wed Mar 2 09:51:25 2022 -0800 x86: Disable HAVE_ARCH_HUGE_VMALLOC on 32-bit x86 kernel test robot reported kernel BUG like: [ 44.587744][ T1] kernel BUG at arch/x86/mm/physaddr.c:76! [ 44.590151][ T1] __vmalloc_area_node (mm/vmalloc.c:622 mm/vmalloc.c:2995) [ 44.590151][ T1] __vmalloc_node_range (mm/vmalloc.c:3108) [ 44.590151][ T1] __vmalloc_node (mm/vmalloc.c:3157) which is triggered with HAVE_ARCH_HUGE_VMALLOC on 32-bit x86. Since BPF only uses HAVE_ARCH_HUGE_VMALLOC for x86_64, turn it off for 32-bit x86. Fixes: fac54e2bfb5b ("x86/Kconfig: Select HAVE_ARCH_HUGE_VMALLOC with HAVE_ARCH_HUGE_VMAP") Reported-by: kernel test robot Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220302175126.247459-2-song@kernel.org arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 55b6f82e9443aaf0c6c3a27c394481555ed0da50 Author: Jean Delvare Date: Tue Mar 1 17:39:37 2022 +0100 i2c: i801: Add support for the Process Call command The Process Call command is implemented by the hardware since the very first Intel 82801 chipset, and trivial to support. Oscar Romero Matamala from the Georgia Institute of Technology told me it is needed for an experiment his team is working on at the moment, so let's just add support for it. Signed-off-by: Jean Delvare Reviewed-by: Jarkko Nikula Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-i801.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 9c02c6391c88a9d2669c2ff8da92cf6efd7f760b Author: Jean Delvare Date: Tue Mar 1 17:28:59 2022 +0100 i2c: i801: Drop useless masking in i801_access I went all the way back to kernel 2.6.12 and that masking was never needed. I suppose it was there in anticipation of software PEC support, but that was never added to the driver (and never will be, as this is made obsolete by hardware PEC). I'm also removing initialization to 0, which is not needed either, and would prevent the compiler from reporting an actual usage of uninitialized variables. Signed-off-by: Jean Delvare Reviewed-by: Jarkko Nikula Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-i801.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit dca669354e6ff494222dfc461bed1087264f3755 Author: Rob Herring Date: Mon Feb 28 15:38:02 2022 -0600 dt-bindings: Another pass removing cases of 'allOf' containing a '$ref' Another pass at removing unnecessary use of 'allOf' with a '$ref'. json-schema versions draft7 and earlier have a weird behavior in that any keywords combined with a '$ref' are ignored (silently). The correct form was to put a '$ref' under an 'allOf'. This behavior is now changed in the 2019-09 json-schema spec and '$ref' can be mixed with other keywords. Cc: Krzysztof Kozlowski Cc: Thierry Reding Cc: Sam Ravnborg Cc: Dmitry Torokhov Cc: Pavel Machek Cc: Guenter Roeck Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: "David S. Miller" Cc: Kishon Vijay Abraham I Cc: Sebastian Reichel Cc: Mathieu Poirier Signed-off-by: Rob Herring Acked-by: Mark Brown Reviewed-by: Greg Kroah-Hartman Acked-By: Vinod Koul Acked-by: Lee Jones Acked-by: Marek Behún Acked-by: Miquel Raynal Reviewed-by: Laurent Pinchart Acked-by: Jakub Kicinski Acked-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220228213802.1639658-1-robh@kernel.org .../devicetree/bindings/connector/usb-connector.yaml | 3 +-- .../devicetree/bindings/display/brcm,bcm2711-hdmi.yaml | 3 +-- .../devicetree/bindings/display/bridge/adi,adv7511.yaml | 5 ++--- .../bindings/display/bridge/synopsys,dw-hdmi.yaml | 5 ++--- .../bindings/display/panel/display-timings.yaml | 3 +-- Documentation/devicetree/bindings/display/ste,mcde.yaml | 4 ++-- Documentation/devicetree/bindings/input/adc-joystick.yaml | 9 ++++----- .../devicetree/bindings/leds/cznic,turris-omnia-leds.yaml | 3 +-- Documentation/devicetree/bindings/leds/leds-lp50xx.yaml | 3 +-- Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 12 ++++-------- .../devicetree/bindings/mtd/rockchip,nand-controller.yaml | 3 +-- Documentation/devicetree/bindings/net/ti,cpsw-switch.yaml | 3 +-- .../devicetree/bindings/phy/phy-stm32-usbphyc.yaml | 3 +-- .../devicetree/bindings/power/supply/sbs,sbs-manager.yaml | 4 +--- .../devicetree/bindings/remoteproc/ti,k3-r5f-rproc.yaml | 3 +-- Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml | 15 +++------------ Documentation/devicetree/bindings/sound/st,stm32-sai.yaml | 3 +-- .../devicetree/bindings/sound/tlv320adcx140.yaml | 13 ++++++------- Documentation/devicetree/bindings/spi/spi-controller.yaml | 4 +--- Documentation/devicetree/bindings/usb/st,stusb160x.yaml | 4 +--- 20 files changed, 36 insertions(+), 69 deletions(-) commit 3c36fe9302d153283a0cea9e4e25a9e2143ac232 Author: Rafael J. Wysocki Date: Tue Feb 22 20:51:42 2022 +0100 ACPI: bus: Introduce acpi_bus_for_each_dev() In order to avoid exposing acpi_bus_type to modules, introduce an acpi_bus_for_each_dev() helper for iterating over all ACPI device objects and make typec_link_ports() use it instead of the raw bus_for_each_dev() along with acpi_bus_type. Having done that, drop the acpi_bus_type export. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Greg Kroah-Hartman Reviewed-by: Heikki Krogerus drivers/acpi/bus.c | 7 ++++++- drivers/usb/typec/port-mapper.c | 2 +- include/acpi/acpi_bus.h | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) commit 9ae2ac4d31a85ce59cc560d514a31b95f4ace154 Author: Thomas Zimmermann Date: Wed Feb 23 20:38:04 2022 +0100 drm: Add TODO item for optimizing format helpers Add a TODO item for optimizing blitting and format-conversion helpers in DRM and fbdev. There's always demand for faster graphics output. v4: * fix typos (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220223193804.18636-6-tzimmermann@suse.de Documentation/gpu/todo.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) commit ad3c72b0c6b912a0e917ae8010c62cc98012ab1e Author: Krzysztof Kozlowski Date: Sat Jan 29 18:55:14 2022 +0100 arm64: dts: lg: align pl330 node name with dtschema Fixes dtbs_check warnings like: dma@c1128000: $nodename:0: 'dma@c1128000' does not match '^dma-controller(@.*)?$' Signed-off-by: Krzysztof Kozlowski Acked-by: Chanho Min Link: https://lore.kernel.org/r/20220129175514.298942-2-krzysztof.kozlowski@canonical.com arch/arm64/boot/dts/lg/lg1312.dtsi | 2 +- arch/arm64/boot/dts/lg/lg1313.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 8ede5890faaa28ac380b040bc933ead56ae9ec28 Author: Krzysztof Kozlowski Date: Sat Jan 29 18:55:13 2022 +0100 arm64: dts: lg: add dma-cells to pl330 node dma-cells property is required for dma-controller. Fixes dtbs_check warnings like: dma@c1128000: '#dma-cells' is a required property Signed-off-by: Krzysztof Kozlowski Acked-by: Chanho Min Link: https://lore.kernel.org/r/20220129175514.298942-1-krzysztof.kozlowski@canonical.com arch/arm64/boot/dts/lg/lg1312.dtsi | 1 + arch/arm64/boot/dts/lg/lg1313.dtsi | 1 + 2 files changed, 2 insertions(+) commit e7f127b213faf9494b2c4215e72055a824814fac Author: Krzysztof Kozlowski Date: Sat Jan 29 18:56:21 2022 +0100 arm64: dts: juno: align pl330 node name with dtschema Fixes dtbs_check warning: dma@7ff00000: $nodename:0: 'dma@7ff00000' does not match '^dma-controller(@.*)?$' Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220129175621.299254-1-krzysztof.kozlowski@canonical.com arch/arm64/boot/dts/arm/juno-base.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 0d03011894d23241db1a1cad5c12aede60897d5e Author: Thomas Zimmermann Date: Wed Feb 23 20:38:03 2022 +0100 fbdev: Improve performance of cfb_imageblit() Improve the performance of cfb_imageblit() by manually unrolling the inner blitting loop and moving some invariants out. The compiler failed to do this automatically. This change keeps cfb_imageblit() in sync with sys_imagebit(). A microbenchmark measures the average number of CPU cycles for cfb_imageblit() after a stabilizing period of a few minutes (i7-4790, FullHD, simpledrm, kernel with debugging). cfb_imageblit(), new: 15724 cycles cfb_imageblit(): old: 30566 cycles In the optimized case, cfb_imageblit() is now ~2x faster than before. v3: * fix commit description (Pekka) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220223193804.18636-5-tzimmermann@suse.de drivers/video/fbdev/core/cfbimgblt.c | 51 +++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 9 deletions(-) commit 3c54c95bd917d43d12fe1b192df9aa4c5973449b Author: Thomas Zimmermann Date: Wed Feb 23 20:38:02 2022 +0100 fbdev: Remove trailing whitespaces from cfbimgblt.c Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220223193804.18636-4-tzimmermann@suse.de drivers/video/fbdev/core/cfbimgblt.c | 60 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) commit 6f29e04938bf509fccfad490a74284cf158891ce Author: Thomas Zimmermann Date: Wed Feb 23 20:38:01 2022 +0100 fbdev: Improve performance of sys_imageblit() Improve the performance of sys_imageblit() by manually unrolling the inner blitting loop and moving some invariants out. The compiler failed to do this automatically. The resulting binary code was even slower than the cfb_imageblit() helper, which uses the same algorithm, but operates on I/O memory. A microbenchmark measures the average number of CPU cycles for sys_imageblit() after a stabilizing period of a few minutes (i7-4790, FullHD, simpledrm, kernel with debugging). The value for CFB is given as a reference. sys_imageblit(), new: 25934 cycles sys_imageblit(), old: 35944 cycles cfb_imageblit(): 30566 cycles In the optimized case, sys_imageblit() is now ~30% faster than before and ~20% faster than cfb_imageblit(). v2: * move switch out of inner loop (Gerd) * remove test for alignment of dst1 (Sam) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220223193804.18636-3-tzimmermann@suse.de drivers/video/fbdev/core/sysimgblt.c | 49 ++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 11 deletions(-) commit 7dbc515f5ca4b7867e34c0c4379591cb8b47d64f Author: Thomas Zimmermann Date: Wed Feb 23 20:38:00 2022 +0100 fbdev: Improve performance of sys_fillrect() Improve the performance of sys_fillrect() by using word-aligned 32/64-bit mov instructions. While the code tried to implement this, the compiler failed to create fast instructions. The resulting binary instructions were even slower than cfb_fillrect(), which uses the same algorithm, but operates on I/O memory. A microbenchmark measures the average number of CPU cycles for sys_fillrect() after a stabilizing period of a few minutes (i7-4790, FullHD, simpledrm, kernel with debugging). The value for CFB is given as a reference. sys_fillrect(), new: 26586 cycles sys_fillrect(), old: 166603 cycles cfb_fillrect(): 41012 cycles In the optimized case, sys_fillrect() is now ~6x faster than before and ~1.5x faster than the CFB implementation. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220223193804.18636-2-tzimmermann@suse.de drivers/video/fbdev/core/sysfillrect.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) commit a113870165b862440a31a8614fa6905a85033486 Author: Potin Lai Date: Wed Mar 2 20:38:17 2022 +0800 dt-bindings: hwmon: Add sample averaging properties for ADM1275 Add documentation of new properties for sample averaging in PMON_CONFIG register. New properties: - adi,volt-curr-sample-average - adi,power-sample-average Signed-off-by: Potin Lai Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220302123817.27025-3-potin.lai@quantatw.com Signed-off-by: Guenter Roeck .../devicetree/bindings/hwmon/adi,adm1275.yaml | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) commit a3cd66d7cbadcc0c29884f25b754fd22699c719c Author: Potin Lai Date: Wed Mar 2 20:38:16 2022 +0800 hwmon: (adm1275) Allow setting sample averaging Current driver assume PWR_AVG and VI_AVG as 1 by default, and user needs to set sample averaging via sysfs manually. This patch parses the properties "adi,power-sample-average" and "adi,volt-curr-sample-average" from device tree, and setting sample averaging during probe. Input value must be one of value in the list [1, 2, 4, 8, 16, 32, 64, 128]. Signed-off-by: Potin Lai Link: https://lore.kernel.org/r/20220302123817.27025-2-potin.lai@quantatw.com Signed-off-by: Guenter Roeck drivers/hwmon/pmbus/adm1275.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) commit f53bfe4d698430bd602c37042db4021dc2603b8d Author: Marcello Sylvester Bauer Date: Wed Mar 2 10:49:21 2022 +0100 hwmon: (xdpe12284) Add regulator support Add simple on/off regulator support for xdpe12284 and other pmbus parts supported by the xdpe12284 driver. Signed-off-by: Marcello Sylvester Bauer Link: https://lore.kernel.org/r/f69b8e7fa32cd2bad9516d8fa590abb87c7e4869.1646214248.git.sylv@sylv.io Signed-off-by: Guenter Roeck drivers/hwmon/pmbus/Kconfig | 6 ++++++ drivers/hwmon/pmbus/xdpe12284.c | 11 +++++++++++ 2 files changed, 17 insertions(+) commit efdab64d88ab693bdcadc23780e347cc4185d4be Author: Marcello Sylvester Bauer Date: Wed Mar 2 10:49:20 2022 +0100 hwmon: (xdpe12284) Add support for xdpe11280 Add support for another Infineon Multi-phase controller chip. The xdpe11280 uses linear instead of vid data format for VOUT. Detect VOUT_MODE format during identification and skip the xdpe122 related adaptions in case it is linear. Signed-off-by: Marcello Sylvester Bauer Link: https://lore.kernel.org/r/fa6a4b636a05ecb337d132824efca2545188a2a2.1646214248.git.sylv@sylv.io Signed-off-by: Guenter Roeck Documentation/hwmon/xdpe12284.rst | 12 ++++++++---- drivers/hwmon/pmbus/xdpe12284.c | 21 ++++++++++++++++++--- 2 files changed, 26 insertions(+), 7 deletions(-) commit ff4670ed6e8137642b0760aa198bc04188451b80 Author: Marcello Sylvester Bauer Date: Wed Mar 2 10:49:19 2022 +0100 dt-bindings: trivial-devices: Add xdpe11280 Add Infineon Multi-phase Digital Controller XDPE11280. Signed-off-by: Marcello Sylvester Bauer Acked-by: Rob Herring Link: https://lore.kernel.org/r/81c0523ba790965a371d267bb1944652d80f5f72.1646214248.git.sylv@sylv.io Signed-off-by: Guenter Roeck Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ 1 file changed, 2 insertions(+) commit a577223a97df241df26b91a95d03eec8c9fe0b36 Author: Wang Qing Date: Tue Mar 1 22:41:14 2022 -0800 net: hamradio: fix compliation error add missing ")" which caused by previous commit. Fixes: 61c4fb9c4d09 ("net: hamradio: use time_is_after_jiffies() instead of open coding it") Link: https://lore.kernel.org/all/1646018012-61129-1-git-send-email-wangqing@vivo.com/ Signed-off-by: Wang Qing Link: https://lore.kernel.org/r/1646203277-83159-1-git-send-email-wangqing@vivo.com Signed-off-by: Jakub Kicinski drivers/net/hamradio/dmascc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 602a4eda68839bb33ca35c54d400e0685bac1d71 Author: Yicong Yang Date: Sat Jan 15 18:49:21 2022 +0800 PCI/AER: Update aer-inject URL The link to the aer-inject referenced leads to an empty repo and seems no longer used. Replace it with the link mentioned in Documentation/PCI/pcieaer-howto.rst. Link: https://lore.kernel.org/r/20220115104921.21606-1-yangyicong@hisilicon.com Signed-off-by: Yicong Yang Signed-off-by: Bjorn Helgaas drivers/pci/pcie/Kconfig | 2 +- drivers/pci/pcie/aer_inject.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 168678d765d3659fddffe80a70668488066a9569 Author: Mike Snitzer Date: Wed Mar 2 12:19:47 2022 -0500 dm mpath: use DMINFO instead of printk with KERN_INFO Signed-off-by: Mike Snitzer drivers/md/dm-mpath.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 385411ffba0c3305491346b98ba4d2cd8063f002 Author: Christoph Hellwig Date: Tue Mar 1 10:38:15 2022 +0200 dm: stop using bdevname Just use the %pg format specifier instead. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer drivers/md/dm-cache-target.c | 10 ++++------ drivers/md/dm-clone-target.c | 10 ++++------ drivers/md/dm-mpath.c | 6 ++---- drivers/md/dm-table.c | 30 ++++++++++++++---------------- drivers/md/dm-thin.c | 8 +++----- 5 files changed, 27 insertions(+), 37 deletions(-) commit 977ff73e64151d94811f4ba905419c90573f63e1 Author: Christoph Hellwig Date: Tue Mar 1 10:38:14 2022 +0200 dm-zoned: remove the ->name field in struct dmz_dev Just use the %pg format specifier to print the block device name directly. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer drivers/md/dm-zoned-metadata.c | 4 ++-- drivers/md/dm-zoned-target.c | 1 - drivers/md/dm-zoned.h | 9 ++++----- 3 files changed, 6 insertions(+), 8 deletions(-) commit 227178d238b3ebdc2347045b52e2f2a8d4809a11 Merge: d5dd781bcc81 c4dcd7100c26 Author: Mark Brown Date: Wed Mar 2 16:58:51 2022 +0000 ASoC: Intel: machine driver updates for 5.18 Merge series from Pierre-Louis Bossart : Two cleanups to remove an unused filename and typos, and one addition of an ACPI matching table for a Dell SoundWire SKU without local microphones. The main change is the addition of a common 'sof-ssp-amp' machine driver for devices with amplifiers only (no headset codec) and different connections using I2S links (Bluetooth offload, HDMI receiver). It's likely that the amplifier will be swapped out by OEMs, this machine driver provides a relatively generic solution to avoid copy-paste of similar solutions. commit cdbec3ede0b8cb318c36f5cc945b9360329cbd25 Author: Paul Moore Date: Tue Mar 1 12:39:20 2022 -0500 selinux: shorten the policy capability enum names The SELinux policy capability enum names are rather long and follow the "POLICYDB_CAPABILITY_XXX format". While the "POLICYDB_" prefix is helpful in tying the enums to other SELinux policy constants, macros, etc. there is no reason why we need to spell out "CAPABILITY" completely. Shorten "CAPABILITY" to "CAP" in order to make things a bit shorter and cleaner. Moving forward, the SELinux policy capability enum names should follow the "POLICYDB_CAP_XXX" format. Signed-off-by: Paul Moore security/selinux/ima.c | 4 ++-- security/selinux/include/policycap.h | 22 +++++++++++----------- security/selinux/include/policycap_names.h | 2 +- security/selinux/include/security.h | 18 +++++++++--------- security/selinux/selinuxfs.c | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) commit eb103a51640ee32ab01c51e13bf8fca211f25f61 Author: Jan Kara Date: Fri Feb 25 13:54:45 2022 +0100 reiserfs: Deprecate reiserfs Reiserfs is relatively old filesystem and its development has ceased quite some years ago. Linux distributions moved away from it towards other filesystems such as btrfs, xfs, or ext4. To reduce maintenance burden on cross filesystem changes (such as new mount API, iomap, folios ...) let's add a deprecation notice when the filesystem is mounted and schedule its removal to 2025. Link: https://lore.kernel.org/r/20220225125445.29942-1-jack@suse.cz Signed-off-by: Jan Kara fs/reiserfs/Kconfig | 10 +++++++--- fs/reiserfs/super.c | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) commit 35732a0694cd2e8642d90f9b49a99742faadd869 Author: Srinivasa Rao Mandadapu Date: Wed Mar 2 18:13:01 2022 +0530 soundwire: qcom: constify static struct qcom_swrm_data global variables The qcom_swrm_data structures is only required for setting soundwire params, so make the qcom_swrm_data structure const to allow the compiler to put it in read-only memory and avoid unintentional modifications. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/1646224982-3361-3-git-send-email-quic_srivasam@quicinc.com Signed-off-by: Vinod Koul drivers/soundwire/qcom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 04d46a7b38375aef945b663a3957f85025f74934 Author: Srinivas Kandagatla Date: Mon Feb 28 17:25:28 2022 +0000 soundwire: qcom: add in-band wake up interrupt support Some of the Qualcomm SoundWire Controller instances like the ones that are connected to RX path along with Headset connections support Waking up Controller from Low power clock stop state using SoundWire In-band interrupt. SoundWire Slave on the bus would initiate this by pulling the data line high, while the clock is stopped. Add support to this wake up interrupt. Signed-off-by: Srinivas Kandagatla Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220228172528.3489-4-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul drivers/soundwire/qcom.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) commit c7449e766de3c7334d5ded1ab18e17fb9fb4dd76 Author: Srinivas Kandagatla Date: Mon Feb 28 17:25:27 2022 +0000 dt-bindings: soundwire: qcom: document optional wake irq Wake IRQ is optional interrupt that can be wired up on SoundWire controller instances like RX path along with MBHC(Multi Button Headset connection). Document this in bindings. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220228172528.3489-3-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul Documentation/devicetree/bindings/soundwire/qcom,sdw.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) commit 74e79da9fd46a59788ad58982e63fe9dbc496cb1 Author: Srinivas Kandagatla Date: Mon Feb 28 17:25:26 2022 +0000 soundwire: qcom: add runtime pm support Add support to runtime PM using SoundWire clock stop Mode0 on supported controller instances and soft reset on instances that do not support clock stop. Signed-off-by: Srinivas Kandagatla Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220228172528.3489-2-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul drivers/soundwire/qcom.c | 156 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 1 deletion(-) commit b25c7dc13fb8842e8634bd846a7a96f2176f0244 Author: Samuel Sjöberg Date: Wed Mar 2 16:03:28 2022 +0100 staging: rts5208: fix Lines should not end with a '('. Fix the following check reported by checkpatch.pl: CHECK: Lines should not end with a '(' retval = ms_transfer_tpc( Signed-off-by: Samuel Sjöberg Link: https://lore.kernel.org/r/20220302150328.2722-1-info@samuelsjoberg.se Signed-off-by: Greg Kroah-Hartman drivers/staging/rts5208/ms.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) commit 4c11113c1a3d10f5b617e5d2b9acd8d1d715450f Author: Mark Brown Date: Fri Feb 25 18:46:58 2022 +0000 KVM: arm64: Enable Cortex-A510 erratum 2077057 by default The recently added configuration option for Cortex A510 erratum 2077057 does not have a "default y" unlike other errata fixes. This appears to simply be an oversight since the help text suggests enabling the option if unsure and there's nothing in the commit log to suggest it is intentional. Fixes: 1dd498e5e26ad ("KVM: arm64: Workaround Cortex-A510's single-step and PAC trap errata") Signed-off-by: Mark Brown Acked-by: Catalin Marinas Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220225184658.172527-1-broonie@kernel.org arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) commit b2006061ae28fe7e84af6c9757ee89c4e505e92b Author: Srinivasan Shanmugam Date: Tue Mar 1 15:15:49 2022 -0800 drm/i915/xehpsdv: Move render/compute engine reset domains related workarounds Registers that exist in the shared render/compute reset domain need to be placed on an engine workaround list to ensure that they are properly re-applied whenever an RCS or CCS engine is reset. We have a number of workarounds (updating registers MLTICTXCTL, L3SQCREG1_CCS0, GEN12_MERT_MOD_CTRL, and GEN12_GAMCNTRL_CTRL) that are incorrectly implemented on the 'gt' workaround list and need to be moved accordingly. Cc: Matt Roper Signed-off-by: Srinivasan Shanmugam Signed-off-by: Matt Roper Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-14-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/intel_workarounds.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) commit ff6b19d3a0f939465b1e40040c4c4869154bf516 Author: Matt Roper Date: Tue Mar 1 15:15:48 2022 -0800 drm/i915/xehp: Add compute workarounds Additional workarounds are required once we start exposing CCS engines. Note that we have a number of workarounds that update registers in the shared render/compute reset domain. Historically we've just added such registers to the RCS engine's workaround list. But going forward we should be more careful to place such workarounds on a wa_list for an engine that definitely exists and is not fused off (e.g., a platform with no RCS would never apply the RCS wa_list). We'll keep rcs_engine_wa_init() focused on RCS-specific workarounds that only need to be applied if the RCS engine is present. A separate general_render_compute_wa_init() function will be used to define workarounds that touch registers in the shared render/compute reset domain and that we need to apply regardless of what render and/or compute engines actually exist. Any workarounds defined in this new function will internally be added to the first present RCS or CCS engine's workaround list to ensure they get applied (and only get applied once rather than being needlessly re-applied several times). Co-author: Srinivasan Shanmugam Signed-off-by: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-13-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/intel_gt_regs.h | 1 + drivers/gpu/drm/i915/gt/intel_lrc.c | 8 +++++ drivers/gpu/drm/i915/gt/intel_workarounds.c | 47 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) commit 88ed07cb2737e15b7ea412dd8ab37de2397cccdf Author: Daniele Ceraolo Spurio Date: Tue Mar 1 21:20:08 2022 -0800 drm/i915/xehp: handle fused off CCS engines HW resources are divided across the active CCS engines at the compute slice level, with each CCS having priority on one of the cslices. If a compute slice has no enabled DSS, its paired compute engine is not usable in full parallel execution because the other ones already fully saturate the HW, so consider it fused off. v2 (José): - moved it to its own function - fixed definition of ccs_mask v3 (Matt): - Replace fls() condition with a simple IP version test v4 (Matt): - Don't try to calculate a ccs_mask using intel_slicemask_from_dssmask() until we've determined that we're running on an Xe_HP platform where the logic makes sense (and won't overflow). Cc: Stuart Summers Cc: Vinay Belgaumkar Cc: Ashutosh Dixit Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Stuart Summers Signed-off-by: Matt Roper Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220302052008.1884985-1-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/intel_engine_cs.c | 25 +++++++++++++++++++++++++ drivers/gpu/drm/i915/gt/intel_sseu.c | 17 ++++++++++++++--- drivers/gpu/drm/i915/gt/intel_sseu.h | 4 +++- 3 files changed, 42 insertions(+), 4 deletions(-) commit e393e2aa0ad7ae0d187de93f4cbcfc480d28b5f6 Author: Matthew Brost Date: Tue Mar 1 15:15:46 2022 -0800 drm/i915/xehp: Don't support parallel submission on compute / render A different emit breadcrumbs ring programming is required for compute / render and we don't have UMD user so just reject parallel submission for these engine classes. Signed-off-by: Matthew Brost Signed-off-by: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-11-matthew.d.roper@intel.com drivers/gpu/drm/i915/gem/i915_gem_context.c | 10 ++++++++++ drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c | 4 ++++ 2 files changed, 14 insertions(+) commit ea4ca894a160002f4488324ec39083d992cc7163 Author: Daniele Ceraolo Spurio Date: Tue Mar 1 15:15:45 2022 -0800 drm/i915/xehp/guc: enable compute engine inside GuC Tell GuC that CCS is enabled by setting the CCS mask in its ADS. Cc: Vinay Belgaumkar Original-author: Michel Thierry Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Daniele Ceraolo Spurio Reviewed-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-10-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 1 + 1 file changed, 1 insertion(+) commit 87cb6d80f2d196427e64d2e6179ee9b1a3609dce Author: Matt Roper Date: Tue Mar 1 16:15:54 2022 -0800 drm/i915/xehp: Enable ccs/dual-ctx in RCU_MODE We have to specify in the Render Control Unit Mode register when CCS is enabled. v2: - Move RCU_MODE programming to a helper function. (Tvrtko) - Clean up and clarify comments. (Tvrtko) - Add RCU_MODE to the GuC save/restore list. (Daniele) v3: - Move this patch before the GuC ADS update to enable compute engines; the definition of RCU_MODE and its insertion into the save/restore list moves to this patch. (Daniele) v4: - Call xehp_enable_ccs_engines() directly in guc_resume() and execlists_resume() rather than adding an extra layer of wrapping to the engine->resume() vfunc. (Umesh) Bspec: 46034 Original-author: Michel Thierry Cc: Daniele Ceraolo Spurio Cc: Tvrtko Ursulin Cc: Vinay Belgaumkar Cc: Umesh Nerlige Ramappa Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Aravind Iddamsetty Signed-off-by: Matt Roper Reviewed-by: Umesh Nerlige Ramappa Link: https://patchwork.freedesktop.org/patch/msgid/20220302001554.1836066-1-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/intel_engine.h | 2 ++ drivers/gpu/drm/i915/gt/intel_engine_cs.c | 17 +++++++++++++++++ drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 3 +++ drivers/gpu/drm/i915/gt/intel_gt_regs.h | 3 +++ drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 4 ++++ drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 3 +++ 6 files changed, 32 insertions(+) commit adfadb5638bf32e97326ec05ae379be561e13677 Author: Matt Roper Date: Tue Mar 1 15:15:43 2022 -0800 drm/i915/xehp: Define context scheduling attributes in lrc descriptor In Dual Context mode the EUs are shared between render and compute command streamers. The hardware provides a field in the lrc descriptor to indicate the prioritization of the thread dispatch associated to the corresponding context. The context priority is set to 'low' at creation time and relies on the existing context priority to set it to low/normal/high. Bspec: 46145, 46260 Original-author: Michel Thierry Cc: Tvrtko Ursulin Signed-off-by: Aravind Iddamsetty Signed-off-by: Prasad Nallani Signed-off-by: Matt Roper Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-8-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/intel_engine_cs.c | 4 +++- drivers/gpu/drm/i915/gt/intel_engine_types.h | 1 + drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 6 +++++- drivers/gpu/drm/i915/gt/intel_lrc.h | 17 +++++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) commit f4c1fdb93992ffc55899f38ddebcc0e1c390226e Author: Matt Roper Date: Tue Mar 1 15:15:42 2022 -0800 drm/i915: Move context descriptor fields to intel_lrc.h This is a more appropriate header for these definitions. v2: - Cleanup whitespace. (Lucas) Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-7-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/intel_engine_cs.c | 1 + drivers/gpu/drm/i915/gt/intel_gt_regs.h | 34 ------------------------------- drivers/gpu/drm/i915/gt/intel_lrc.h | 34 +++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 34 deletions(-) commit c674c5b9342e5cb0f3d9e9bcaf37dbe2087845e5 Author: Matt Roper Date: Tue Mar 1 15:15:41 2022 -0800 drm/i915/xehp: CCS should use RCS setup functions The compute engine handles the same commands the render engine can (except 3D pipeline), so it makes sense that CCS is more similar to RCS than non-render engines. The CCS context state (lrc) is also similar to the render one, so reuse it. Note that the compute engine has its own CTX_R_PWR_CLK_STATE register. In order to avoid having multiple RCS && CCS checks, add the following engine flag: - I915_ENGINE_HAS_RCS_REG_STATE - use the render (larger) reg state ctx. BSpec: 46260 Original-author: Michel Thierry Cc: Tvrtko Ursulin Cc: Daniele Ceraolo Spurio Signed-off-by: Aravind Iddamsetty Signed-off-by: Matt Roper Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-6-matthew.d.roper@intel.com drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 8 +++++--- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 6 ++++++ drivers/gpu/drm/i915/gt/intel_engine_types.h | 1 + drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 2 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 4 ++-- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) commit 803efd297e315859ac7830445699f01eeb1f7822 Author: Daniele Ceraolo Spurio Date: Tue Mar 1 15:15:40 2022 -0800 drm/i915/xehp: compute engine pipe_control CCS will reuse the RCS functions for breadcrumb and flush emission. However, CCS pipe_control has additional programming restrictions: - Command Streamer Stall Enable must be always set - Post Sync Operations must not be set to Write PS Depth Count - 3D-related bits must not be set v2: - Drop unwanted blank line. (Lucas) Bspec: 47112 Cc: Vinay Belgaumkar Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Aravind Iddamsetty Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-5-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/gen8_engine_cs.c | 34 ++++++++++++++++++++-------- drivers/gpu/drm/i915/gt/intel_gpu_commands.h | 15 ++++++++++++ 2 files changed, 40 insertions(+), 9 deletions(-) commit 505c4857fb13fb0ea88a42b843c91d0b9f8231fe Author: Matt Roper Date: Tue Mar 1 15:15:39 2022 -0800 drm/i915/xehp: Add Compute CS IRQ handlers Add execlists and GuC interrupts for compute CS into existing IRQ handlers. All compute command streamers belong to the same compute class, so the only change needed to enable their interrupts is to program their GT engine interrupt mask registers. CCS0 shares the register with CCS1, while CCS2 and CCS3 are in a new one. BSpec: 50844, 54029, 54030, 53223, 53224. Original-author: Michel Thierry Cc: Tvrtko Ursulin Cc: Vinay Belgaumkar Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Aravind Iddamsetty Signed-off-by: Matt Roper Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-4-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/intel_gt_irq.c | 15 ++++++++++++++- drivers/gpu/drm/i915/gt/intel_gt_regs.h | 3 +++ drivers/gpu/drm/i915/i915_drv.h | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) commit 4b88ad503d6d2ea11891a355e656bf428ec815e6 Author: Matt Roper Date: Tue Mar 1 15:15:38 2022 -0800 drm/i915/xehp: CCS shares the render reset domain The reset domain is shared between render and all compute engines, so resetting one will affect the others. Note: Before performing a reset on an RCS or CCS engine, the GuC will attempt to preempt-to-idle the other non-hung RCS/CCS engines to avoid impacting other clients (since some shared modules will be reset). If other engines are executing non-preemptable workloads, the impact is unavoidable and some work may be lost. Bspec: 52549 Original-author: Michel Thierry Cc: Tvrtko Ursulin Cc: Vinay Belgaumkar Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Aravind Iddamsetty Signed-off-by: Matt Roper Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-3-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/intel_engine_cs.c | 4 ++++ 1 file changed, 4 insertions(+) commit 944823c9463916dd53f365e9aa07f23360968080 Author: Matt Roper Date: Tue Mar 1 15:15:37 2022 -0800 drm/i915/xehp: Define compute class and engine Introduce a Compute Command Streamer (CCS), which has access to the media and GPGPU pipelines (but not the 3D pipeline). To begin with, define the compute class/engine common functions, based on the existing render ones. v2: - Add kerneldoc for drm_i915_gem_engine_class since we're adding a new element to it. (Daniel) - Make engine class <-> guc class converters use lookup tables to make it more clear/explicit how the IDs map. (Tvrtko) v3: - Don't update uapi for now; we'll just include the driver-internal changes for the time being. Bspec: 46167, 45544 Original-author: Michel Thierry Cc: Daniele Ceraolo Spurio Cc: Tvrtko Ursulin Cc: Vinay Belgaumkar Signed-off-by: Rodrigo Vivi Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Aravind Iddamsetty Signed-off-by: Matt Roper Reviewed-by: Tvrtko Ursulin #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20220301231549.1817978-2-matthew.d.roper@intel.com drivers/gpu/drm/i915/gt/intel_engine_cs.c | 28 ++++++++++++++++++++++++ drivers/gpu/drm/i915/gt/intel_engine_types.h | 9 +++++++- drivers/gpu/drm/i915/gt/intel_engine_user.c | 5 ++++- drivers/gpu/drm/i915/gt/intel_gt_regs.h | 4 ++++ drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 32 ++++++++++++++++++++-------- drivers/gpu/drm/i915/i915_reg.h | 4 ++++ 6 files changed, 71 insertions(+), 11 deletions(-) commit e1c21608e3cfc4b44ecdf04e12986b6564667095 Author: Mark Pearson Date: Fri Feb 25 13:25:05 2022 -0500 platform/x86: thinkpad_acpi: Add PSC mode support The Lenovo AMD platforms use PSC mode for providing platform profile support. Detect if PSC mode is available and add support for setting the different profile modes appropriately. Note - if both MMC mode and PSC mode are available then MMC mode will be used in preference. Tested on T14 G1 AMD and T14s G2 AMD. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220225182505.7234-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/thinkpad_acpi.c | 172 ++++++++++++++++++++++++----------- 1 file changed, 119 insertions(+), 53 deletions(-) commit c6455af548991ed22c89528f998fd965c052fb2e Author: Bjorn Andersson Date: Thu Feb 24 19:51:05 2022 -0800 phy: qcom-qmp: add sc8280xp UFS PHY Reuse the SM8350 UFS PHY initialization sequence to add support for the same found in the Qualcomm SC8280XP platform. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220225035105.2294599-2-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul drivers/phy/qualcomm/phy-qcom-qmp.c | 3 +++ 1 file changed, 3 insertions(+) commit f01da68667dce6f9cfd48dc98c3c0704fa0b55cb Author: Bjorn Andersson Date: Thu Feb 24 19:51:04 2022 -0800 dt-bindings: phy: qcom,qmp: add sc8180x and sc8280xp ufs compatibles Add compatible for the UFS PHY found in the Qualcomm SC8280XP platform and document the required clocks for this and the SC8180X UFS PHY. Signed-off-by: Bjorn Andersson Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220225035105.2294599-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul Documentation/devicetree/bindings/phy/qcom,qmp-phy.yaml | 3 +++ 1 file changed, 3 insertions(+) commit 7addff4018f0d5b94a8f5816fa752ea05ccfa23e Author: Bjorn Andersson Date: Thu Feb 24 19:40:49 2022 -0800 phy: qcom-snps: Add sc8280xp support The Qualcomm sc8280xp platform comes with a 5nm femto USB PHY which, in contrast to previously seen platforms, has the SIDDQ bit in the COMMON0 register default to high. So make the driver match on the 5nm compatible and make sure to clear the SIDDQ bit on phy_init. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220225034049.2294207-2-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 5 +++++ 1 file changed, 5 insertions(+) commit 641024df6a8215b19e87b10ede7e68d3c5d2281c Author: Bjorn Andersson Date: Thu Feb 24 19:40:48 2022 -0800 dt-bindings: phy: qcom,usb-snps-femto-v2: Add sc8180x and sc8280xp Add compatible for the femto USB PHY found in sc8180x, sc8280xp and the generic 5nm form of the latter. Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220225034049.2294207-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul Documentation/devicetree/bindings/phy/qcom,usb-snps-femto-v2.yaml | 3 +++ 1 file changed, 3 insertions(+) commit bb1fea8454b4babd04b401f4dd9f4e8f6b82900b Author: Vinod Koul Date: Wed Mar 2 20:04:27 2022 +0530 dt-bindings: Revert "dt-bindings: soc: grf: add naneng combo phy register compatible" This reverts commit b3df807e1fb0 ("dt-bindings: soc: grf: add naneng combo phy register compatible") as that was wrongly merged, so better to drop the wrong patch Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20220302143427.447748-1-vkoul@kernel.org Signed-off-by: Vinod Koul Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 -- 1 file changed, 2 deletions(-) commit e02cebea3fbcaa4de8e31c88ff64f90c26497eaa Author: Pratyush Yadav Date: Tue Mar 1 16:46:21 2022 +0530 phy: dt-bindings: Add Cadence D-PHY Rx bindings The Rx mode DPHY is different from Tx mode DPHY. Add a separate binding for it. Signed-off-by: Pratyush Yadav Reviewed-by: Laurent Pinchart Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220301111621.2992275-5-p.yadav@ti.com Signed-off-by: Vinod Koul .../devicetree/bindings/phy/cdns,dphy-rx.yaml | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) commit 222e7d3f623506460658db7a3acdb7847329888d Author: Pratyush Yadav Date: Tue Mar 1 16:46:20 2022 +0530 phy: dt-bindings: cdns,dphy: add power-domains property This property is needed on TI platforms to enable the PD of the DPHY before it can be used. Signed-off-by: Pratyush Yadav Reviewed-by: Laurent Pinchart Acked-by: Rob Herring Link: https://lore.kernel.org/r/20220301111621.2992275-4-p.yadav@ti.com Signed-off-by: Vinod Koul Documentation/devicetree/bindings/phy/cdns,dphy.yaml | 5 +++++ 1 file changed, 5 insertions(+) commit 40b95583561e18480d36c732b89cc1126725078c Author: Pratyush Yadav Date: Tue Mar 1 16:46:19 2022 +0530 phy: dt-bindings: Convert Cadence DPHY binding to YAML Convert Cadence DPHY binding to YAML. Signed-off-by: Pratyush Yadav Reviewed-by: Laurent Pinchart Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220301111621.2992275-3-p.yadav@ti.com Signed-off-by: Vinod Koul .../devicetree/bindings/phy/cdns,dphy.txt | 20 --------- .../devicetree/bindings/phy/cdns,dphy.yaml | 51 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 20 deletions(-) commit 41d393aaead4e51d709b860176102b18bedb3c68 Author: Pratyush Yadav Date: Tue Mar 1 16:46:18 2022 +0530 phy: cadence: Add Cadence D-PHY Rx driver The Cadence D-PHY can be configured in Tx (DSI) mode or Rx (CSI) mode. Both modes have a different programming sequence and share little among them. In addition, a PHY configured in Tx mode cannot be used in Rx mode and vice versa. For this reason, create a separate driver for the Rx mode to make it easier to read and maintain. Signed-off-by: Pratyush Yadav Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220301111621.2992275-2-p.yadav@ti.com Signed-off-by: Vinod Koul drivers/phy/cadence/Kconfig | 8 ++ drivers/phy/cadence/Makefile | 1 + drivers/phy/cadence/cdns-dphy-rx.c | 255 +++++++++++++++++++++++++++++++++++++ 3 files changed, 264 insertions(+) commit 7a37e890bd5db4a89a17ec9bcd7e5f4a33396648 Author: Lad Prabhakar Date: Tue Mar 1 12:42:55 2022 +0000 dt-bindings: phy: renesas,usb2-phy: Document RZ/V2L phy bindings Document USB phy bindings for RZ/V2L SoC. RZ/V2L USB phy is identical to one found on the RZ/G2L SoC. No driver changes are required as generic compatible string "renesas,rzg2l-usb2-phy" will be used as a fallback. While at it, drop the comment "RZ/G2L family" for "renesas,rzg2l-usb2-phy" compatible string as this will avoid changing the line for every new SoC addition. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Acked-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220301124255.16836-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Vinod Koul Documentation/devicetree/bindings/phy/renesas,usb2-phy.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a3d38af35d61a1e2045b73b4e43fa5ffb9d71008 Author: David E. Box Date: Thu Feb 24 17:24:57 2022 -0800 selftests: sdsi: test sysfs setup Tests file configuration and error handling of the Intel Software Defined Silicon sysfs ABI. Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20220225012457.1661574-2-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede MAINTAINERS | 1 + tools/testing/selftests/drivers/sdsi/sdsi.sh | 25 +++ tools/testing/selftests/drivers/sdsi/sdsi_test.py | 226 ++++++++++++++++++++++ 3 files changed, 252 insertions(+) commit f6d92cfc79e830d9976c69e80f97d80bae7c9c6c Author: David E. Box Date: Thu Feb 24 17:24:56 2022 -0800 tools arch x86: Add Intel SDSi provisiong tool Add tool for key certificate and activation payload provisioning on Intel CPUs supporting Software Defined Silicon (SDSi). Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20220225012457.1661574-1-david.e.box@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede MAINTAINERS | 1 + tools/arch/x86/intel_sdsi/Makefile | 21 ++ tools/arch/x86/intel_sdsi/intel_sdsi.c | 558 +++++++++++++++++++++++++++++++++ 3 files changed, 580 insertions(+) commit 81d9d7f8bb8bacd96b2e0e5779e3fba9e86da73f Author: Tom Rix Date: Wed Mar 2 04:45:35 2022 -0800 drm/panfrost: cleanup comments For spdx change tab to space delimiter Use // for *.c Replacements commited to committed regsiters to registers initialze to initialize Signed-off-by: Tom Rix Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20220302124535.358060-1-trix@redhat.com drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +- drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c | 2 +- drivers/gpu/drm/panfrost/panfrost_issues.h | 2 +- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- drivers/gpu/drm/panfrost/panfrost_regs.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) commit 13262fc26c1837c51a5131dbbdd67a2387f8bfc7 Author: Jiasheng Jiang Date: Wed Mar 2 17:20:51 2022 +0800 spi: spi-zynqmp-gqspi: Handle error for dma_set_mask As the potential failure of the dma_set_mask(), it should be better to check it and return error if fails. Fixes: 126bdb606fd2 ("spi: spi-zynqmp-gqspi: return -ENOMEM if dma_map_single fails") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220302092051.121343-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown drivers/spi/spi-zynqmp-gqspi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit d149dd2a806b9d11e570c3731eca8bda3c5f6238 Author: Rob Herring Date: Tue Mar 1 15:23:57 2022 -0600 spi: dt-bindings: mediatek: Set min size for 'mediatek,pad-select' The minimum array length defaults to the same size as the maximum. For 'mediatek,pad-select', the example has a length of 2 and in-tree .dts files have a length of 1, but the schema says the length must be 4. There's currently no warning in the example because the schema fixups are not handling this case correctly. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220301212358.1887668-1-robh@kernel.org Signed-off-by: Mark Brown Documentation/devicetree/bindings/spi/mediatek,spi-mt65xx.yaml | 1 + 1 file changed, 1 insertion(+) commit ee8ad9440f18478796dbd7e0891efcc44376ab70 Author: Lad Prabhakar Date: Tue Mar 1 13:42:43 2022 +0000 spi: dt-bindings: renesas,rspi: Drop comment for generic compatible string Drop comment "# RZ/A and RZ/G2{L,LC}" for generic compatible string "renesas,rspi-rz" as this will avoid changing the line for every new SoC addition. Suggested-by: Geert Uytterhoeven Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220301134244.20174-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown Documentation/devicetree/bindings/spi/renesas,rspi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 80c056656d46ffbece6125dee3f25adbc36d1486 Author: Vincent Whitchurch Date: Tue Mar 1 12:18:31 2022 +0100 regulator: virtual: add devicetree support The reg-virt-consumer is very useful for development and testing of regulator drivers since it allows voltages and modes to be set from userspace. However, it currently requires platform data so it cannot be used without patching the kernel. Add support for probing it from the devicetree to remedy this. Since this driver is only meant for testing and is a purely software construct, no binding documentation is added. Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220301111831.3742383-4-vincent.whitchurch@axis.com Signed-off-by: Mark Brown drivers/regulator/virtual.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) commit d2fb5487ecb2a28b61ff261ae18488afc98d24a6 Author: Vincent Whitchurch Date: Tue Mar 1 12:18:30 2022 +0100 regulator: virtual: warn against production use This driver is only meant for debugging and testing. Currently, it's not possible to use it without patching the kernel since it requires platform data, but we'll be adding devicetree support, so add a loud warning to make it clear that it's still only meant for debugging and testing. Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220301111831.3742383-3-vincent.whitchurch@axis.com Signed-off-by: Mark Brown drivers/regulator/virtual.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) commit 75c3543e39f0c94644eac5965b3efe50c2c5c39d Author: Vincent Whitchurch Date: Tue Mar 1 12:18:29 2022 +0100 regulator: virtual: use dev_err_probe() Use dev_err_probe() to avoid printing spurious warnings on probe deferral. Signed-off-by: Vincent Whitchurch Link: https://lore.kernel.org/r/20220301111831.3742383-2-vincent.whitchurch@axis.com Signed-off-by: Mark Brown drivers/regulator/virtual.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) commit d5dd781bcc81aa31b62310927f25cfa2574450f1 Author: Dan Carpenter Date: Tue Mar 1 11:11:04 2022 +0300 ASoC: qcom: Fix error code in lpass_platform_copy() The copy_to/from_user() functions return the number of bytes remaining to be copied. This function needs to return negative error codes because snd_soc_pcm_component_copy_user() treats positive returns as success in soc_component_ret(). Fixes: 7d7209557b67 ("ASoC: qcom: Add support for codec dma driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220301081104.GB17375@kili Signed-off-by: Mark Brown sound/soc/qcom/lpass-platform.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) commit de2c6f98817fa5decb9b7d3b3a8a3ab864c10588 Author: Jiasheng Jiang Date: Fri Oct 15 08:13:53 2021 +0000 ASoC: soc-compress: prevent the potentially use of null pointer There is one call trace that snd_soc_register_card() ->snd_soc_bind_card()->soc_init_pcm_runtime() ->snd_soc_dai_compress_new()->snd_soc_new_compress(). In the trace the 'codec_dai' transfers from card->dai_link, and we can see from the snd_soc_add_pcm_runtime() in snd_soc_bind_card() that, if value of card->dai_link->num_codecs is 0, then 'codec_dai' could be null pointer caused by index out of bound in 'asoc_rtd_to_codec(rtd, 0)'. And snd_soc_register_card() is called by various platforms. Therefore, it is better to add the check in the case of misusing. And because 'cpu_dai' has already checked in soc_init_pcm_runtime(), there is no need to check again. Adding the check as follow, then if 'codec_dai' is null, snd_soc_new_compress() will not pass through the check 'if (playback + capture != 1)', avoiding the leftover use of 'codec_dai'. Fixes: 467fece ("ASoC: soc-dai: move snd_soc_dai_stream_valid() to soc-dai.c") Signed-off-by: Jiasheng Jiang Reported-by: kernel test robot Reported-by: Dan Carpenter Link: https://lore.kernel.org/r/1634285633-529368-1-git-send-email-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown sound/soc/soc-compress.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) commit 300689fb04b3f23c1ac1abfe960b48ec414df597 Author: Sascha Hauer Date: Tue Mar 1 12:34:46 2022 +0100 ASoC: soc-generic-dmaengine-pcm: set period_bytes_min based on maxburst In dmaengine_pcm_set_runtime_hwparams() period_bytes_min is hardcoded to 256. For some applications that may be too big. This patch changes that to calculate the value based on dma_data->maxburst. The correct value would be maxburst multiplied by the address width of the hardware FIFO. Unfortunately the address width is dynamically calculated based on the stream parameters and is not known at open time, so the worst case is chosen here which is 8 bytes, the maximum that is supported by dmaengine drivers. Not all drivers may set a maxburst value, so we fall back to the previously used hardcoded value of 256 bytes. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220301113446.1053171-1-s.hauer@pengutronix.de Signed-off-by: Mark Brown sound/soc/soc-generic-dmaengine-pcm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 45ea97d74313bae681328b0c36fa348036777644 Author: Jiasheng Jiang Date: Tue Mar 1 16:47:42 2022 +0800 ASoC: dwc-i2s: Handle errors for clk_enable As the potential failure of the clk_enable(), it should be better to check it, as same as clk_prepare_enable(). Fixes: c9afc1834e81 ("ASoC: dwc: Disallow building designware_pcm as a module") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220301084742.3751939-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown sound/soc/dwc/dwc-i2s.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) commit a2253ec7aef2c942630ecbe3380690bd3a704a94 Author: Zhen Ni Date: Wed Mar 2 16:15:02 2022 +0800 ASoC: amd: use asoc_substream_to_rtd() Uses asoc_substream_to_rtd() helper. Signed-off-by: Zhen Ni Link: https://lore.kernel.org/r/20220302081502.25367-1-nizhen@uniontech.com Signed-off-by: Mark Brown sound/soc/amd/vangogh/acp5x-mach.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit f9e2ca0640e59d19af0ff285ee5591ed39069b09 Author: Jiasheng Jiang Date: Tue Mar 1 17:06:37 2022 +0800 ASoC: atmel_ssc_dai: Handle errors for clk_enable As the potential failure of the clk_enable(), it should be better to check it and return error if fals. Fixes: cbaadf0f90d6 ("ASoC: atmel_ssc_dai: refactor the startup and shutdown") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220301090637.3776558-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown sound/soc/atmel/atmel_ssc_dai.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit 2ecf362d220317debf5da376e0390e9f7a3f7b29 Author: Jiasheng Jiang Date: Tue Mar 1 16:17:17 2022 +0800 ASoC: mxs-saif: Handle errors for clk_enable As the potential failure of the clk_enable(), it should be better to check it, like mxs_saif_trigger(). Fixes: d0ba4c014934 ("ASoC: mxs-saif: set a base clock rate for EXTMASTER mode work") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220301081717.3727190-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown sound/soc/mxs/mxs-saif.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) commit c4dcd7100c26881b1095d5b2651d61190fc5f247 Author: Libin Yang Date: Tue Mar 1 13:49:03 2022 -0600 ASoC: Intel: soc-acpi: add entries in ADL match table Support configuration with SoundWire RT1316 amplifiers on link0 and link1, and RT711 on link2 for headphone/headset. This product does not support local microphones. Reviewed-by: Bard Liao Signed-off-by: Libin Yang Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220301194903.60859-9-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/common/soc-acpi-intel-adl-match.c | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit 2fe14ff61bd6d4fabe313435dd378b5a38eb6102 Author: Brent Lu Date: Tue Mar 1 13:49:02 2022 -0600 ASoC: Intel: sof_ssp_amp: rename driver and support cs35l41 amplifier Add support of CS35L41 amplifier to the machine driver, as well as the support of HDMI playback and BT offload DAI Link. Rename the driver to a generic name to support different amplifiers from different vendors. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220301194903.60859-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/Kconfig | 12 +- sound/soc/intel/boards/Makefile | 4 +- sound/soc/intel/boards/sof_rt1308.c | 257 ------------ sound/soc/intel/boards/sof_ssp_amp.c | 483 ++++++++++++++++++++++ sound/soc/intel/common/soc-acpi-intel-adl-match.c | 6 + 5 files changed, 499 insertions(+), 263 deletions(-) commit 709ec7bec6b34ee136fff4b1b5265baaae7319a3 Author: Brent Lu Date: Tue Mar 1 13:49:01 2022 -0600 ASoC: Intel: cirrus-common: support cs35l41 amplifier Implement cs35l41 support code in this common module so it could be shared between multiple SOF machine drivers. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220301194903.60859-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/Kconfig | 3 + sound/soc/intel/boards/Makefile | 3 + sound/soc/intel/boards/sof_cirrus_common.c | 163 +++++++++++++++++++++++++++++ sound/soc/intel/boards/sof_cirrus_common.h | 25 +++++ 4 files changed, 194 insertions(+) commit 024979b67b392569dde3f9294f9b66651d2c0a93 Author: Brent Lu Date: Tue Mar 1 13:49:00 2022 -0600 ASoC: Intel: sof_rt1308: move rt1308 code to common module Move the code related to rt1308 dai link to the realtek common module. It creates a clean base to add more amplifier support to this machine driver in the future. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220301194903.60859-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/Kconfig | 1 + sound/soc/intel/boards/sof_realtek_common.c | 98 +++++++++++++++++++++++++++++ sound/soc/intel/boards/sof_realtek_common.h | 4 ++ sound/soc/intel/boards/sof_rt1308.c | 70 ++++----------------- 4 files changed, 114 insertions(+), 59 deletions(-) commit e1d5e13324020c4b405e63cae34560c7992bec2e Author: Brent Lu Date: Tue Mar 1 13:48:59 2022 -0600 ASoC: Intel: boards: create sof-realtek-common module Move sof_realtek_common.o to a dedicated module like the module to support maxim amplifiers. Reviewed-by: Bard Liao Signed-off-by: Brent Lu Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220301194903.60859-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/Kconfig | 4 ++++ sound/soc/intel/boards/Makefile | 7 +++++-- sound/soc/intel/boards/sof_realtek_common.c | 9 +++++++++ sound/soc/intel/boards/sof_rt5682.c | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) commit 612896ec5a4edbf98c4a631503899da04df76480 Author: Trond Myklebust Date: Thu Feb 24 11:48:35 2022 -0500 NFS: Cache all entries in the readdirplus reply Even if we're not able to cache all the entries in the readdir buffer, let's ensure that we do prime the dcache. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) commit da793fb0f56c0a53d0d461d80d9c1936a39afc30 Author: balamurugan.c Date: Tue Mar 1 13:48:58 2022 -0600 ASoC: Intel: add RT1308 I2S machine driver and HDMI-in capture via I2S support. Adding separate I2S machine driver for RT1308. Adding support for HDMI-In capture via I2S in slave mode configuration. Reviewed-by: Ranjani Sridharan Signed-off-by: balamurugan.c Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220301194903.60859-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/Kconfig | 12 + sound/soc/intel/boards/Makefile | 2 + sound/soc/intel/boards/sof_rt1308.c | 305 ++++++++++++++++++++++ sound/soc/intel/common/soc-acpi-intel-tgl-match.c | 12 + 4 files changed, 331 insertions(+) commit 0adf85b445c7fbc5d2df1f8c1bc54d62c4340237 Author: Trond Myklebust Date: Sun Feb 27 12:46:24 2022 -0500 NFS: Optimise away the previous cookie field Replace the 'previous cookie' field in struct nfs_entry with the array->last_cookie. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 26 ++++++++++++++------------ fs/nfs/nfs2xdr.c | 1 - fs/nfs/nfs3xdr.c | 1 - fs/nfs/nfs4xdr.c | 1 - include/linux/nfs_xdr.h | 3 +-- 5 files changed, 15 insertions(+), 17 deletions(-) commit b0365ccb0712efacf99936e94e92eb7ae63de4d5 Author: Trond Myklebust Date: Wed Feb 23 13:29:59 2022 -0500 NFS: Fix up forced readdirplus Avoid clearing the entire readdir page cache if we're just doing forced readdirplus for the 'ls -l' heuristic. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 56 +++++++++++++++++++++++++++++++++++--------------- fs/nfs/nfstrace.h | 1 + include/linux/nfs_fs.h | 1 + 3 files changed, 41 insertions(+), 17 deletions(-) commit f648022faa68ef76058aa121d1aa3a967d59cae8 Author: Trond Myklebust Date: Wed Feb 23 11:31:51 2022 -0500 NFS: Convert readdir page cache to use a cookie based index Instead of using a linear index to address the pages, use the cookie of the first entry, since that is what we use to match the page anyway. This allows us to avoid re-reading the entire cache on a seekdir() type of operation. The latter is very common when re-exporting NFS, and is a major performance drain. The change does affect our duplicate cookie detection, since we can no longer rely on the page index as a linear offset for detecting whether we looped backwards. However since we no longer do a linear search through all the pages on each call to nfs_readdir(), this is less of a concern than it was previously. The other downside is that invalidate_mapping_pages() no longer can use the page index to avoid clearing pages that have been read. A subsequent patch will restore the functionality this provides to the 'ls -l' heuristic. Signed-off-by: Trond Myklebust fs/nfs/Kconfig | 4 ++ fs/nfs/dir.c | 149 +++++++++++++++++++++---------------------------- include/linux/nfs_fs.h | 2 - 3 files changed, 69 insertions(+), 86 deletions(-) commit 9332cf14e2db4253bec827da66bd95e6c0f6a2f3 Author: Trond Myklebust Date: Sat Feb 26 18:38:41 2022 -0500 NFS: Clean up page array initialisation/free Signed-off-by: Trond Myklebust fs/nfs/dir.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) commit 11d03d0a1ed8dbdabab1b5ab21861ad5cad4aef2 Author: Trond Myklebust Date: Sat Feb 19 19:09:21 2022 -0500 NFS: Trace effects of the readdirplus heuristic Enable tracking of when the readdirplus heuristic causes a page cache invalidation. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 11 ++++++++++- fs/nfs/nfstrace.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) commit eace45a18ccb34a746c3060601103aa14ca29923 Author: Trond Myklebust Date: Sat Feb 19 19:19:35 2022 -0500 NFS: Trace effects of readdirplus on the dcache Trace the effects of readdirplus on attribute and dentry revalidation. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 5 +++++ fs/nfs/nfstrace.h | 3 +++ 2 files changed, 8 insertions(+) commit 310e3187450db2ca5699758296d23fc2ce3f37f0 Author: Trond Myklebust Date: Sat Feb 19 19:24:38 2022 -0500 NFS: Add basic readdir tracing Add tracing to track how often the client goes to the server for updated readdir information. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 13 ++++++++++- fs/nfs/nfstrace.h | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) commit 0b3cc71b5ab31ef90eb9b8b2d8ca580fbf88c590 Author: Trond Myklebust Date: Sat Feb 19 10:06:05 2022 -0500 NFS: Don't request readdirplus when revalidation was forced If the revalidation was forced, due to the presence of a LOOKUP_EXCL or a LOOKUP_REVAL flag, then readdirplus won't help. It also can't help when we're doing a path component lookup. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) commit 2c2c336506e9bd4056fca25301b8a06fb7aefd32 Author: Trond Myklebust Date: Sat Feb 19 09:56:45 2022 -0500 NFS: Readdirplus can't help lookup for case insensitive filesystems If the filesystem is case insensitive, then readdirplus can't help with cache misses, since it won't return case folded variants of the filename. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 2 ++ 1 file changed, 2 insertions(+) commit f1eebb3bf707b267bd8ed945d00a81c8ca31bd73 Author: Pierre-Louis Bossart Date: Tue Mar 1 13:48:57 2022 -0600 ASoC: Intel: boards: fix spelling in comments copy/paste spelling issues with platforms and buttons. Reviewed-by: Ranjani Sridharan Reviewed-by: FRED OH Reviewed-by: Péter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220301194903.60859-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown sound/soc/intel/boards/bdw-rt5650.c | 2 +- sound/soc/intel/boards/bdw-rt5677.c | 2 +- sound/soc/intel/boards/broadwell.c | 2 +- sound/soc/intel/boards/bxt_da7219_max98357a.c | 2 +- sound/soc/intel/boards/bxt_rt298.c | 2 +- sound/soc/intel/boards/bytcht_cx2072x.c | 2 +- sound/soc/intel/boards/bytcht_da7213.c | 2 +- sound/soc/intel/boards/bytcht_es8316.c | 2 +- sound/soc/intel/boards/bytcr_rt5640.c | 2 +- sound/soc/intel/boards/bytcr_rt5651.c | 2 +- sound/soc/intel/boards/cht_bsw_max98090_ti.c | 4 ++-- sound/soc/intel/boards/cht_bsw_nau8824.c | 4 ++-- sound/soc/intel/boards/cht_bsw_rt5645.c | 2 +- sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +- sound/soc/intel/boards/glk_rt5682_max98357a.c | 2 +- sound/soc/intel/boards/haswell.c | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) commit c49c68944f2d4c3827cd8ac7f70da277674d11ad Author: Trond Myklebust Date: Fri Feb 18 12:04:06 2022 -0500 NFSv4: Ask for a full XDR buffer of readdir goodness Instead of pretending that we know the ratio of directory info vs readdirplus attribute info, just set the 'dircount' field to the same value as the 'maxcount' field. Signed-off-by: Trond Myklebust fs/nfs/nfs3xdr.c | 7 ++++--- fs/nfs/nfs4xdr.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) commit ad1e109a4109ce0cbdfebfbe1958d0c333166d5c Author: Trond Myklebust Date: Thu Feb 17 15:46:23 2022 -0500 NFS: Don't ask for readdirplus unless it can help nfs_getattr() If attribute caching is turned off, then use of readdirplus is not going to help stat() performance. Readdirplus also doesn't help if a file is being written to, since we will have to flush those writes in order to sync the mtime/ctime. Signed-off-by: Trond Myklebust fs/nfs/inode.c | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) commit 230bc98f7a2a49eb472d184bdec91fd3096384b3 Author: Trond Myklebust Date: Thu Feb 17 11:08:24 2022 -0500 NFS: Improve heuristic for readdirplus The heuristic for readdirplus is designed to try to detect 'ls -l' and similar patterns. It does so by looking for cache hit/miss patterns in both the attribute cache and in the dcache of the files in a given directory, and then sets a flag for the readdirplus code to interpret. The problem with this approach is that a single attribute or dcache miss can cause the NFS code to force a refresh of the attributes for the entire set of files contained in the directory. To be able to make a more nuanced decision, let's sample the number of hits and misses in the set of open directory descriptors. That allows us to set thresholds at which we start preferring READDIRPLUS over regular READDIR, or at which we start to force a re-read of the remaining readdir cache using READDIRPLUS. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 80 ++++++++++++++++++++++++++++++++------------------ fs/nfs/inode.c | 4 +-- fs/nfs/internal.h | 4 +-- fs/nfs/nfstrace.h | 1 - include/linux/nfs_fs.h | 5 ++-- 5 files changed, 58 insertions(+), 36 deletions(-) commit 9c3f4d988c23d099095c8b75cbd449e0466fa102 Author: Trond Myklebust Date: Thu Feb 17 13:02:37 2022 -0500 NFS: Reduce use of uncached readdir When reading a very large directory, we want to try to keep the page cache up to date if doing so is inexpensive. With the change to allow readdir to continue reading even when the cache is incomplete, we no longer need to fall back to uncached readdir in order to scale to large directories. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) commit 9ff89c25d8addeee8eea84fa828f1d2ad659cc54 Author: Trond Myklebust Date: Mon Feb 7 15:07:01 2022 -0500 NFS: Simplify nfs_readdir_xdr_to_array() Recent changes to readdir mean that we can cope with partially filled page cache entries, so we no longer need to rely on looping in nfs_readdir_xdr_to_array(). Signed-off-by: Trond Myklebust fs/nfs/dir.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) commit 6c34f05b754622f473b546fd19ad3a89bd65bd89 Author: Trond Myklebust Date: Tue Feb 22 16:23:12 2022 -0500 NFS: If the cookie verifier changes, we must invalidate the page cache Ensure that if the cookie verifier changes when we use the zero-valued cookie, then we invalidate any cached pages. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit 580f236737d13ee25d5b0b1d124f50014fe6833b Author: Trond Myklebust Date: Mon Feb 7 13:37:00 2022 -0500 NFS: Adjust the amount of readahead performed by NFS readdir The current NFS readdir code will always try to maximise the amount of readahead it performs on the assumption that we can cache anything that isn't immediately read by the process. There are several cases where this assumption breaks down, including when the 'ls -l' heuristic kicks in to try to force use of readdirplus as a batch replacement for lookup/getattr. This patch therefore tries to tone down the amount of readahead we perform, and adjust it to try to match the amount of data being requested by user space. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++- include/linux/nfs_fs.h | 1 + 2 files changed, 53 insertions(+), 1 deletion(-) commit c8f0523ba398b72ffdb6e41930c089b75a6e2acf Author: Trond Myklebust Date: Sat Feb 26 09:38:19 2022 -0500 NFS: Don't advance the page pointer unless the page is full When we hit the end of the data in the readdir page, we don't want to start filling a new page, unless this one is full. Signed-off-by: Trond Myklebust fs/nfs/dir.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) commit 728dd0ab37421396927749fc8cec9c2009c526c8 Author: Trond Myklebust Date: Tue Feb 22 08:59:33 2022 -0500 NFS: Don't re-read the entire page cache to find the next cookie If the page cache entry that was last read gets invalidated for some reason, then make sure we can re-create it on the next call to readdir. This, combined with the cache page validation, allows us to reuse the cached value of page-index on successive calls to nfs_readdir. Credit is due to Benjamin Coddington for showing that the concept works, and that it allows for improved cache sharing between processes even in the case where pages are lost due to LRU or active invalidation. Suggested-by: Benjamin Coddington Signed-off-by: Trond Myklebust fs/nfs/dir.c | 10 +++++++--- include/linux/nfs_fs.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) commit a6264056b39ee0c478e1d73bfc40f61a8cf3673f Author: Pierre-Louis Bossart Date: Tue Mar 1 13:48:56 2022 -0600 ASoC: soc-acpi: remove sof_fw_filename We've been using a default firmware name for each PCI/ACPI/OF platform for a while. The machine-specific sof_fw_filename is in practice not different from the default, and newer devices don't set this field, so let's remove the redundant definitions. When OEMs modify the base firmware, they can keep the same firmware name but store the file in a separate directory. Reviewed-by: Bard Liao Reviewed-by: Rander Wang Reviewed-by: Péter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220301194903.60859-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown include/sound/soc-acpi.h | 2 -- sound/soc/intel/common/soc-acpi-intel-adl-match.c | 13 ------------- sound/soc/intel/common/soc-acpi-intel-bxt-match.c | 6 ------ sound/soc/intel/common/soc-acpi-intel-byt-match.c | 11 ----------- sound/soc/intel/common/soc-acpi-intel-cht-match.c | 12 ------------ sound/soc/intel/common/soc-acpi-intel-cml-match.c | 11 ----------- sound/soc/intel/common/soc-acpi-intel-cnl-match.c | 4 ---- sound/soc/intel/common/soc-acpi-intel-ehl-match.c | 1 - sound/soc/intel/common/soc-acpi-intel-glk-match.c | 6 ------ sound/soc/intel/common/soc-acpi-intel-hda-match.c | 2 -- sound/soc/intel/common/soc-acpi-intel-hsw-bdw-match.c | 5 ----- sound/soc/intel/common/soc-acpi-intel-icl-match.c | 5 ----- sound/soc/intel/common/soc-acpi-intel-jsl-match.c | 7 ------- sound/soc/intel/common/soc-acpi-intel-tgl-match.c | 7 ------- sound/soc/sof/intel/hda.c | 5 +---- sound/soc/sof/intel/pci-tng.c | 1 - 16 files changed, 1 insertion(+), 97 deletions(-) commit d09e673f497164442ad7976a870d7cc857783fd4 Author: Trond Myklebust Date: Tue Feb 22 08:31:28 2022 -0500 NFS: Store the change attribute in the directory page cache Use the change attribute and the first cookie in a directory page cache entry to validate that the page is up to date. Suggested-by: Benjamin Coddington Signed-off-by: Trond Myklebust fs/nfs/dir.c | 68 +++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 31 deletions(-) commit 0bf126163c3e7e6d722622073046aed567a5551e Author: Robert Hancock Date: Thu Jan 27 11:34:50 2022 -0600 iio: adc: xilinx-ams: Fix single channel switching sequence Some of the AMS channels need to be read by switching into single-channel mode from the normal polling sequence. There was a logic issue in this switching code that could cause the first read of these channels to read back as zero. It appears that the sequencer should be set back to default mode before changing the channel selection, and the channel should be set before switching the sequencer back into single-channel mode. Also, write 1 to the EOC bit in the status register to clear it before waiting for it to become set, so that we actually wait for a new conversion to complete, and don't proceed based on a previous conversion completing. Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver") Signed-off-by: Robert Hancock Acked-by: Michal Simek Link: https://lore.kernel.org/r/20220127173450.3684318-5-robert.hancock@calian.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/adc/xilinx-ams.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit d5d786fb531697be74c567b3844c6897ddf1ffdd Author: Robert Hancock Date: Thu Jan 27 11:34:49 2022 -0600 iio: adc: xilinx-ams: Fixed wrong sequencer register settings Register settings used for the sequencer configuration register were incorrect, causing some inputs to not be read properly. Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver") Signed-off-by: Robert Hancock Reviewed-by: Michael Tretter Acked-by: Michal Simek Link: https://lore.kernel.org/r/20220127173450.3684318-4-robert.hancock@calian.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/adc/xilinx-ams.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 1f21a41578062d439cc485bce2d8b664f9a6170e Author: Robert Hancock Date: Thu Jan 27 11:34:48 2022 -0600 iio: adc: xilinx-ams: Fixed missing PS channels The code forgot to increment num_channels for the PS channel inputs, resulting in them not being enabled as they should. Fixes: d5c70627a794 ("iio: adc: Add Xilinx AMS driver") Signed-off-by: Robert Hancock Reviewed-by: Michael Tretter Acked-by: Michal Simek Link: https://lore.kernel.org/r/20220127173450.3684318-3-robert.hancock@calian.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/adc/xilinx-ams.c | 1 + 1 file changed, 1 insertion(+) commit 5165102efa41c2aedc77441612f4506a8a8671db Author: Robert Hancock Date: Thu Jan 27 11:34:47 2022 -0600 dt-bindings: iio: adc: zynqmp_ams: Add clock entry The AMS driver DT binding was missing the clock entry, which is actually mandatory according to the driver implementation. Add this in. Fixes: 39dd2d1e251d ("dt-bindings: iio: adc: Add Xilinx AMS binding documentation") Signed-off-by: Robert Hancock Reviewed-by: Rob Herring Acked-by: Michal Simek Link: https://lore.kernel.org/r/20220127173450.3684318-2-robert.hancock@calian.com Cc: Signed-off-by: Jonathan Cameron Documentation/devicetree/bindings/iio/adc/xlnx,zynqmp-ams.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) commit c87b7b12f48db86ac9909894f4dc0107d7df6375 Author: Haibo Chen Date: Tue Feb 22 10:42:21 2022 +0800 iio: accel: mma8452: use the correct logic to get mma8452_data The original logic to get mma8452_data is wrong, the *dev point to the device belong to iio_dev. we can't use this dev to find the correct i2c_client. The original logic happen to work because it finally use dev->driver_data to get iio_dev. Here use the API to_i2c_client() is wrong and make reader confuse. To correct the logic, it should be like this struct mma8452_data *data = iio_priv(dev_get_drvdata(dev)); But after commit 8b7651f25962 ("iio: iio_device_alloc(): Remove unnecessary self drvdata"), the upper logic also can't work. When try to show the avialable scale in userspace, will meet kernel dump, kernel handle NULL pointer dereference. So use dev_to_iio_dev() to correct the logic. Dual fixes tags as the second reflects when the bug was exposed, whilst the first reflects when the original bug was introduced. Fixes: c3cdd6e48e35 ("iio: mma8452: refactor for seperating chip specific data") Fixes: 8b7651f25962 ("iio: iio_device_alloc(): Remove unnecessary self drvdata") Signed-off-by: Haibo Chen Reviewed-by: Martin Kepplinger Cc: Link: https://lore.kernel.org/r/1645497741-5402-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Jonathan Cameron drivers/iio/accel/mma8452.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 571426631acf46e2999c7ecd1e9d048172969a43 Author: Billy Tsai Date: Mon Feb 21 09:27:05 2022 +0800 iio: adc: aspeed: Add divider flag to fix incorrect voltage reading. The formula for the ADC sampling period in ast2400/ast2500 is: ADC clock period = PCLK * 2 * (ADC0C[31:17] + 1) * (ADC0C[9:0]) When ADC0C[9:0] is set to 0 the sampling voltage will be lower than expected, because the hardware may not have enough time to charge/discharge to a stable voltage. This patch use the flag CLK_DIVIDER_ONE_BASED which will use the raw value read from the register, with the value of zero considered invalid to conform to the corrected formula. Fixes: 573803234e72 ("iio: Aspeed ADC") Reported-by: Konstantin Klubnichkin Signed-off-by: Billy Tsai Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20220221012705.22008-1-billy_tsai@aspeedtech.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/adc/aspeed_adc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 6270bf1f0197739a9cddaf0a40699a99b7357cb5 Author: Haibo Chen Date: Thu Feb 24 19:29:51 2022 +0800 iio: imu: st_lsm6dsx: use dev_to_iio_dev() to get iio_dev struct dev_get_drvdata() on iio_dev->dev no longer returns the iio_dev. Use dev_to_iio_dev() to get iio_dev struct. Fixes: 8b7651f25962 ("iio: iio_device_alloc(): Remove unnecessary self drvdata") Signed-off-by: Haibo Chen Link: https://lore.kernel.org/r/1645702191-9400-1-git-send-email-haibo.chen@nxp.com Cc: Signed-off-by: Jonathan Cameron drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 098fdbc3531f06aae2426b3a6f9bd730e7691258 Author: Niklas Cassel Date: Wed Mar 2 13:15:53 2022 +0000 irqchip/sifive-plic: Disable S-mode IRQs if running in M-mode When detecting a context for a privilege mode different from the current running privilege mode, we simply skip to the next context register. This means that we never clear the S-mode enable bits when running in M-mode. On canaan k210, a bunch of S-mode interrupts are enabled by the bootrom. These S-mode specific interrupts should never trigger, since we never set the mie.SEIE bit in the parent interrupt controller (riscv-intc). However, we will be able to see the mip.SEIE bit set as pending. This isn't a good default when CONFIG_RISCV_M_MODE is set, since in that case we will never enter a lower privilege mode (e.g. S-mode). Let's clear the S-mode enable bits when running the kernel in M-mode, such that we won't have a interrupt pending bit set, which we will never clear. Signed-off-by: Niklas Cassel Reviewed-by: Anup Patel Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220302131544.3166154-3-Niklas.Cassel@wdc.com drivers/irqchip/irq-sifive-plic.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) commit 0d3616bbd03cdfaa8a5fdf38e0fec2b1ef6ec0a0 Author: Niklas Cassel Date: Wed Mar 2 13:15:52 2022 +0000 irqchip/sifive-plic: Improve naming scheme for per context offsets The PLIC supports a fixed number of contexts (15872). Each context has fixed register offsets in PLIC. The number of contexts that we need to initialize depends on the privilege modes supported by each hart. Therefore, this mapping between PLIC context registers to hart privilege modes is platform specific, and is currently supplied via device tree. For example, canaan,k210 has the following mapping: Context0: hart0 M-mode Context1: hart0 S-mode Context2: hart1 M-mode Context3: hart1 S-mode While sifive,fu540 has the following mapping: Context0: hart0 M-mode Context1: hart1 M-mode Context2: hart1 S-mode Because the number of contexts per hart is not fixed, the names ENABLE_PER_HART and CONTEXT_PER_HART for the register offsets are quite confusing and might mislead the reader to think that these are fixed register offsets per hart. Rename the offsets to more clearly highlight that these are per PLIC context and not per hart. Signed-off-by: Niklas Cassel Reviewed-by: Anup Patel Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220302131544.3166154-2-Niklas.Cassel@wdc.com drivers/irqchip/irq-sifive-plic.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) commit 150430366b2dcb170d309952143e32eb814fe7f8 Author: Liu Ying Date: Wed Feb 16 16:58:42 2022 +0800 drm/bridge: nwl-dsi: Remove superfluous write to NWL_DSI_IRQ_MASK register To initialize register NWL_DSI_IRQ_MASK, it's enough to write it only once in function nwl_dsi_init_interrupts(). Signed-off-by: Liu Ying Reviewed-by: Guido Günther Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220216085842.1973868-1-victor.liu@nxp.com drivers/gpu/drm/bridge/nwl-dsi.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) commit c0bbed9051b6eb293be6128d060bb49e999ef7d4 Author: Hsin-Yi Wang Date: Thu Feb 17 16:22:25 2022 +0800 drm/bridge: Clear the DP_AUX_I2C_MOT bit passed in aux read command. If the previous transfer didn't end with a command without DP_AUX_I2C_MOT, the next read trasnfer will miss the first byte. But if the command in previous transfer is requested with length 0, it's a no-op to anx7625 since it can't process this command. anx7625 requires the last command to be read command with length > 0. It's observed that if we clear the DP_AUX_I2C_MOT in read transfer, we can still get correct data. Clear the read commands with DP_AUX_I2C_MOT bit to fix this issue. Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel") Signed-off-by: Hsin-Yi Wang Reviewed-by: Xin Ji Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220217082224.1823916-1-hsinyi@chromium.org drivers/gpu/drm/bridge/analogix/anx7625.c | 2 ++ 1 file changed, 2 insertions(+) commit faabb26838f30b5a49178a50c8286e900928400f Author: Hans de Goede Date: Thu Feb 24 12:02:41 2022 +0100 platform/surface: Remove Surface 3 Button driver The Surface 3 buttons are now handled by the generic soc_button_array driver. As part of adding support to soc_button_array the ACPI code now instantiates a platform_device rather then an i2c_client so there no longer is an i2c_client for this driver to bind to. Signed-off-by: Hans de Goede Reviewed-by: Maximilian Luz Link: https://lore.kernel.org/r/20220224110241.9613-3-hdegoede@redhat.com drivers/platform/surface/Kconfig | 7 - drivers/platform/surface/Makefile | 1 - drivers/platform/surface/surface3_button.c | 247 ----------------------------- 3 files changed, 255 deletions(-) commit 60c7353c6b23537448c7b24498f7bbf8973a81ef Author: Hans de Goede Date: Thu Feb 24 12:02:40 2022 +0100 Input: soc_button_array - add support for Microsoft Surface 3 (MSHW0028) buttons The drivers/platform/surface/surface3_button.c code is alsmost a 1:1 copy of the soc_button_array code. The only big difference is that it binds to an i2c_client rather then to a platform_device. The cause of this is the ACPI resources for the MSHW0028 device containing a bogus I2cSerialBusV2 resource which causes the kernel to instantiate an i2c_client for it instead of a platform_device. Add "MSHW0028" to the ignore_serial_bus_ids[] list in drivers/apci/scan.c, so that a platform_device will be instantiated and add support for the MSHW0028 HID to soc_button_array. This fully replaces surface3_button, which will be removed in a separate commit (since it binds to the now no longer created i2c_client it no longer does anyyhing after this commit). Note the MSHW0028 id is used by Microsoft to describe the tablet buttons on both the Surface 3 and the Surface 3 Pro and the actual API/implementation for the Surface 3 Pro is quite different. The changes in this commit should not impact the separate surfacepro3_button driver: 1. Because of the bogus I2cSerialBusV2 resource problem that driver binds to the acpi_device itself, so instantiating a platform_device instead of an i2c_client does not matter. 2. The soc_button_array driver will not bind to the MSHW0028 device on the Surface 3 Pro, because it has no GPIO resources. Signed-off-by: Hans de Goede Reviewed-by: Maximilian Luz Acked-by: Rafael J. Wysocki Acked-by: Dmitry Torokhov Link: https://lore.kernel.org/r/20220224110241.9613-2-hdegoede@redhat.com drivers/acpi/scan.c | 5 +++++ drivers/input/misc/soc_button_array.c | 24 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) commit a8b2b8b06e10224c547d90ea97c483b4de511b22 Author: Sebastian Andrzej Siewior Date: Mon Feb 14 19:59:08 2022 +0100 drm/i915: Depend on !PREEMPT_RT. There are a few sections in the driver which are not compatible with PREEMPT_RT. They trigger warnings and can lead to deadlocks at runtime. Disable the i915 driver on a PREEMPT_RT enabled kernel. This way PREEMPT_RT itself can be enabled without needing to address the i915 issues first. The RT related patches are still in RT queue and will be handled later. Signed-off-by: Sebastian Andrzej Siewior Acked-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YgqmfKhwU5spS069@linutronix.de drivers/gpu/drm/i915/Kconfig | 1 + 1 file changed, 1 insertion(+) commit cb18448bbf1c845aecaa09b04cfdcceb070d9236 Author: Hans de Goede Date: Wed Feb 23 14:31:53 2022 +0100 platform/x86: x86-android-tablets: Lenovo Yoga Tablet 2 830/1050 sound support The ACPI tables for the codec setup on the Lenovo Yoga Tablet 2 830/1050 miss 2 things compared to their Windows (Lenovo Yoga Tablet 2 1051) counterparts: 1. There is no CLKE ACPI method to enable output of the 32KHz PMU clock on pin 6 of the SUS GPIO controller 2. The GPIOs used by the codec are not listed in the fwnode for the codec Add pinctrl code to set the SUS6 pin mux manually and a gpio-lookup table for the GPIOs to work around both issues. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220223133153.730337-6-hdegoede@redhat.com drivers/platform/x86/x86-android-tablets.c | 69 ++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) commit bf8fd1a9736eaff5a5b823415e5a0d165a42e5d6 Author: Hans de Goede Date: Wed Feb 23 14:31:52 2022 +0100 platform/x86: x86-android-tablets: Workaround Lenovo Yoga Tablet 2 830/1050 poweroff hang These tablets' DSDT does not set acpi_gbl_reduced_hardware, so acpi_power_off gets used as pm_power_off handler. Not setting acpi_gbl_reduced_hardware may very well be correct for these tablets, but acpi_power_off is broken on them. Using acpi_power_off causes "poweroff" to hang hard. Requiring pressing the powerbutton for 30 seconds *twice* followed by a normal 3 second press to recover. Avoid this by overriding the global pm_power_off handler to do an EFI poweroff, which does work, instead. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220223133153.730337-5-hdegoede@redhat.com drivers/platform/x86/x86-android-tablets.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) commit 67dfc2b441b4b724acb74361e9e2e23506721e4f Author: Hans de Goede Date: Wed Feb 23 14:31:51 2022 +0100 platform/x86: x86-android-tablets: Add Lenovo Yoga Tablet 2 830 / 1050 data The Lenovo Yoga Tablet 2 series comes in 4 versions: 830F, 830L, 1050F and 1050L. The F postfix indicates a wifi only version and the L postfix indicates a LTE version. The 830 models are 8" and the 1050 models are 10". Despite there being 8" and 10" versions all models use the same mainboard, with an identical BIOS and thus identical DMI strings, so support for all 4 models is added through a single DMI table entry. As all devices dealt with in the x86-android-tablets modules, these are x86 ACPI tablets which ships with Android x86 as factory OS. The mainboard's DSDT contain a bunch of I2C devices which are not actually there, causing various resource conflicts. Enumeration of these is skipped through the acpi_quirk_skip_i2c_client_enumeration(). Add support for manually instantiating the I2C devices which are actually present on this tablet by adding the necessary device info to the x86-android-tablets module. This has been tested on a 830F and a 1050L tablet. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220223133153.730337-4-hdegoede@redhat.com drivers/platform/x86/x86-android-tablets.c | 184 +++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) commit 7fa7dfafe40a75e93a5f59bcb4e382d0af436ace Author: Hans de Goede Date: Wed Feb 23 14:31:50 2022 +0100 platform/x86: x86-android-tablets: Fix EBUSY error when requesting IOAPIC IRQs Sometimes IRQs used by GPIOs in direct-IRQ mode are already registered because they are used as ACPI "Interrupt () {}" resource for one of the many bogus I2C devices present in the broken DSDTs of Android x86 tablets. This is an issue if the existing (bogus) ACPI resource uses different trigger settings then what is being requested, leading to an -EBUSY error return of acpi_register_gsi(). Fix this by calling acpi_unregister_gsi() first, so that the acpi_register_gsi() is allowed to change the trigger settings. In cases where the GSI has not been registered yet the acpi_unregister_gsi() is a no-op. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220223133153.730337-3-hdegoede@redhat.com drivers/platform/x86/x86-android-tablets.c | 6 ++++++ 1 file changed, 6 insertions(+) commit f97afae4d78097f7c854fa4890c6536582fd7e1e Merge: bf779aaf56ea 2f46d7f7e959 Author: Hans de Goede Date: Wed Mar 2 11:43:23 2022 +0100 Merge remote-tracking branch 'pdx86/platform-drivers-x86-pinctrl-pmu_clk' into review-hans-gcc12 commit bf779aaf56ea23864e39e9862b3b3a8436236e07 Author: Mark Pearson Date: Tue Feb 22 13:51:37 2022 -0500 platform/x86: thinkpad_acpi: Add dual fan probe Instead of having quirks for systems that have a second fan it would be nice to detect this setup. Unfortunately, confirmed by the Lenovo FW team, there is no way to retrieve this information from the EC or BIOS. Recommendation was to attempt to read the fan and if successful then assume a 2nd fan is present. The fans are also supposed to spin up on boot for some time, so in theory we could check for a speed > 0. In testing this seems to hold true but as I couldn't test on all platforms I've avoided implementing this. It also breaks for the corner case where you load the module once the fans are idle. Tested on P1G4, P1G3, X1C9 and T14 (no fans) and it works correctly. For the platforms with dual fans where it was confirmed to work I have removed the quirks. Potentially this could be done for all platforms but I've left untested platforms in for now. On these platforms the fans will be enabled and then detected - so no impact. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220222185137.4325-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/thinkpad_acpi.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) commit 402576d9804e9dc9b31af4e3613aa8da9ebce84e Author: Naveen Krishna Chatradhi Date: Tue Feb 22 10:35:01 2022 +0530 Documentation: Add x86/amd_hsmp driver This documentation for amd_hsmp driver explains how to use the device interface. Signed-off-by: Naveen Krishna Chatradhi Acked-by: Song Liu Link: https://lore.kernel.org/r/20220222050501.18789-2-nchatrad@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Documentation/x86/amd_hsmp.rst | 86 ++++++++++++++++++++++++++++++++++++++++++ Documentation/x86/index.rst | 1 + 2 files changed, 87 insertions(+) commit 91f410aa679a035e7abdff47daca4418c384c770 Author: Suma Hegde Date: Tue Feb 22 10:35:00 2022 +0530 platform/x86: Add AMD system management interface Recent Fam19h EPYC server line of processors from AMD support system management functionality via HSMP (Host System Management Port) interface. The Host System Management Port (HSMP) is an interface to provide OS-level software with access to system management functions via a set of mailbox registers. More details on the interface can be found in chapter "7 Host System Management Port (HSMP)" of the following PPR https://www.amd.com/system/files/TechDocs/55898_B1_pub_0.50.zip This patch adds new amd_hsmp module under the drivers/platforms/x86/ which creates miscdevice with an IOCTL interface to the user space. /dev/hsmp is for running the hsmp mailbox commands. Signed-off-by: Suma Hegde Signed-off-by: Naveen Krishna Chatradhi Reviewed-by: Carlos Bilbao Acked-by: Song Liu Reviewed-by: Nathan Fontenot Link: https://lore.kernel.org/r/20220222050501.18789-1-nchatrad@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Documentation/userspace-api/ioctl/ioctl-number.rst | 2 + MAINTAINERS | 10 + arch/x86/include/asm/amd_hsmp.h | 16 + arch/x86/include/uapi/asm/amd_hsmp.h | 203 ++++++++++ drivers/platform/x86/Kconfig | 13 + drivers/platform/x86/Makefile | 1 + drivers/platform/x86/amd_hsmp.c | 425 +++++++++++++++++++++ 7 files changed, 670 insertions(+) commit f094399fae9cde11c3f98565eb150522aa7c15ab Author: Hans de Goede Date: Thu Feb 24 11:18:48 2022 +0100 surface: surface3_power: Fix battery readings on batteries without a serial number The battery on the 2nd hand Surface 3 which I recently bought appears to not have a serial number programmed in. This results in any I2C reads from the registers containing the serial number failing with an I2C NACK. This was causing mshw0011_bix() to fail causing the battery readings to not work at all. Ignore EREMOTEIO (I2C NACK) errors when retrieving the serial number and continue with an empty serial number to fix this. Fixes: b1f81b496b0d ("platform/x86: surface3_power: MSHW0011 rev-eng implementation") BugLink: https://github.com/linux-surface/linux-surface/issues/608 Reviewed-by: Benjamin Tissoires Reviewed-by: Maximilian Luz Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220224101848.7219-1-hdegoede@redhat.com drivers/platform/surface/surface3_power.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) commit 32370191c0851da069d242f581cbe2fdb80040cb Author: Mario Limonciello Date: Wed Feb 23 11:52:37 2022 -0600 platform/x86: amd-pmc: Set QOS during suspend on CZN w/ timer wakeup commit 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup") adds support for using another platform timer in lieu of the RTC which doesn't work properly on some systems. This path was validated and worked well before submission. During the 5.16-rc1 merge window other patches were merged that caused this to stop working properly. When this feature was used with 5.16-rc1 or later some OEM laptops with the matching firmware requirements from that commit would shutdown instead of program a timer based wakeup. This was bisected to commit 8d89835b0467 ("PM: suspend: Do not pause cpuidle in the suspend-to-idle path"). This wasn't supposed to cause any negative impacts and also tested well on both Intel and ARM platforms. However this changed the semantics of when CPUs are allowed to be in the deepest state. For the AMD systems in question it appears this causes a firmware crash for timer based wakeup. It's hypothesized to be caused by the `amd-pmc` driver sending `OS_HINT` and all the CPUs going into a deep state while the timer is still being programmed. It's likely a firmware bug, but to avoid it don't allow setting CPUs into the deepest state while using CZN timer wakeup path. If later it's discovered that this also occurs from "regular" suspends without a timer as well or on other silicon, this may be later expanded to run in the suspend path for more scenarios. Cc: stable@vger.kernel.org # 5.16+ Suggested-by: Rafael J. Wysocki Link: https://lore.kernel.org/linux-acpi/BL1PR12MB51570F5BD05980A0DCA1F3F4E23A9@BL1PR12MB5157.namprd12.prod.outlook.com/T/#mee35f39c41a04b624700ab2621c795367f19c90e Fixes: 8d89835b0467 ("PM: suspend: Do not pause cpuidle in the suspend-to-idle path") Fixes: 23f62d7ab25b ("PM: sleep: Pause cpuidle later and resume it earlier during system transitions") Fixes: 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup") Reviewed-by: Rafael J. Wysocki Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220223175237.6209-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede drivers/platform/x86/amd-pmc.c | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) commit 1f311c94aabdb419c28e3147bcc8ab89269f1a7e Author: Ricky WU Date: Wed Mar 2 09:43:01 2022 +0000 mmc: rtsx: add 74 Clocks in power on flow SD spec definition: "Host provides at least 74 Clocks before issuing first command" After 1ms for the voltage stable then start issuing the Clock signals if POWER STATE is MMC_POWER_OFF to MMC_POWER_UP to issue Clock signal to card MMC_POWER_UP to MMC_POWER_ON to stop issuing signal to card Signed-off-by: Ricky Wu Link: https://lore.kernel.org/r/1badf10aba764191a1a752edcbf90389@realtek.com Signed-off-by: Ulf Hansson drivers/mmc/host/rtsx_pci_sdmmc.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) commit d06957d7a6929e6a4aa959cb59d66f0c095fc974 Author: Boqun Feng Date: Thu Feb 17 11:45:19 2022 +0800 PCI: hv: Avoid the retarget interrupt hypercall in irq_unmask() on ARM64 On ARM64 Hyper-V guests, SPIs are used for the interrupts of virtual PCI devices, and SPIs can be managed directly via GICD registers. Therefore the retarget interrupt hypercall is not needed on ARM64. An arch-specific interface hv_arch_irq_unmask() is introduced to handle the architecture level differences on this. For x86, the behavior remains unchanged, while for ARM64 no hypercall is invoked when unmasking an irq for virtual PCI devices. Link: https://lore.kernel.org/r/20220217034525.1687678-1-boqun.feng@gmail.com Signed-off-by: Boqun Feng Signed-off-by: Lorenzo Pieralisi Reviewed-by: Michael Kelley drivers/pci/controller/pci-hyperv.c | 233 +++++++++++++++++++----------------- 1 file changed, 122 insertions(+), 111 deletions(-) commit e26557a0aa68acfb705b51947b7c756401a1ab71 Author: Andrew Jeffery Date: Tue Sep 21 14:09:36 2021 +0930 leds: pca955x: Allow zero LEDs to be specified It's valid to use the PCA955x devices just for GPIOs and not for LEDs. In this case, as PCA955X_TYPE_GPIO is now equivalent to PCA955X_TYPE_NONE, remove the test for whether we have any child nodes specified in the devicetree. A consequence of this is it's now possible to bind the driver to a PCA955x device when dynamically instantiated through the I2C subsystem's `new_device` interface. Signed-off-by: Andrew Jeffery Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Reviewed-by: Joel Stanley Reviewed-by: Cédric Le Goater Signed-off-by: Pavel Machek drivers/leds/leds-pca955x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit ca386253ff6fb86128a7c61e1c38ca91de38048d Author: Andrew Jeffery Date: Tue Sep 21 14:09:35 2021 +0930 leds: pca955x: Make the gpiochip always expose all pins The devicetree binding allows specifying which pins are GPIO vs LED. Limiting the instantiated gpiochip to just these pins as the driver currently does requires an arbitrary mapping between pins and GPIOs, but such a mapping is not implemented by the driver. As a result, specifying GPIOs in such a way that they don't map 1-to-1 to pin indexes does not function as expected. Establishing such a mapping is more complex than not and even if we did, doing so leads to a slightly hairy userspace experience as the behaviour of the PCA955x gpiochip would depend on how the pins are assigned in the devicetree. Instead, always expose all pins via the gpiochip to provide a stable interface and track which pins are in use. Specifying a pin as `type = ;` in the devicetree becomes a no-op. I've assessed the impact of this change by looking through all of the affected devicetrees as of the tag leds-5.15-rc1: ``` $ git grep -l 'pca955[0123]' $(find . -name dts -type d) arch/arm/boot/dts/aspeed-bmc-ibm-everest.dts arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts arch/arm/boot/dts/aspeed-bmc-opp-mihawk.dts arch/arm/boot/dts/aspeed-bmc-opp-mowgli.dts arch/arm/boot/dts/aspeed-bmc-opp-swift.dts arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts ``` These are all IBM-associated platforms. I've analysed both the devicetrees and schematics where necessary to determine whether any systems hit the hazard of the current broken behaviour. For the most part, the systems specify the pins as either all LEDs or all GPIOs, or at least do so in a way such that the broken behaviour isn't exposed. The main counter-point to this observation is the Everest system whose devicetree describes a large number of PCA955x devices and in some cases has pin assignments that hit the hazard. However, there does not seem to be any use of the affected GPIOs in the userspace associated with Everest. Regardless, any use of the hazardous GPIOs in Everest is already broken, so let's fix the interface and then fix any already broken userspace with it. Signed-off-by: Andrew Jeffery Acked-by: Linus Walleij Reviewed-by: Cédric Le Goater Signed-off-by: Pavel Machek drivers/leds/leds-pca955x.c | 65 ++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 31 deletions(-) commit 76f22f4dcae645ea468811f9d30ec04f9ffaa1ea Author: Sunrisepeak Date: Sun Feb 27 22:52:04 2022 +0800 Documentation: sound: fix typo in control-names.rst change 'cannel' to 'channel' Signed-off-by: Sunrisepeak Link: https://lore.kernel.org/r/20220227145204.16600-1-speakshen@163.com Signed-off-by: Takashi Iwai Documentation/sound/designs/control-names.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b665eae7a788c5e2bc10f9ac3c0137aa0ad1fc97 Author: Randy Dunlap Date: Mon Feb 28 14:05:56 2022 -0800 printk: fix return value of printk.devkmsg __setup handler If an invalid option value is used with "printk.devkmsg=", it is silently ignored. If a valid option value is used, it is honored but the wrong return value (0) is used, indicating that the command line option had an error and was not handled. This string is not added to init's environment strings due to init/main.c::unknown_bootoption() checking for a '.' in the boot option string and then considering that string to be an "Unused module parameter". Print a warning message if a bad option string is used. Always return 1 from the __setup handler to indicate that the command line option has been handled. Fixes: 750afe7babd1 ("printk: add kernel parameter to control writes to /dev/kmsg") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Cc: Borislav Petkov Cc: Andrew Morton Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: John Ogness Reviewed-by: John Ogness Reviewed-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220228220556.23484-1-rdunlap@infradead.org kernel/printk/printk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) commit 6ee3c393eeb7d16a3c228c4fa23913b76c7e7df3 Author: Sven Eckelmann Date: Sun Feb 27 23:40:40 2022 +0100 batman-adv: Demote batadv-on-batadv skip error message The error message "Cannot find parent device" was shown for users of macvtap (on batadv devices) whenever the macvtap was moved to a different netns. This happens because macvtap doesn't provide an implementation for rtnl_link_ops->get_link_net. The situation for which this message is printed is actually not an error but just a warning that the optional sanity check was skipped. So demote the message from error to warning and adjust the text to better explain what happened. Reported-by: Leonardo Mörlein Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich net/batman-adv/hard-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit eb7da4f17dfcee649767f89e17842f664a459549 Author: Sven Eckelmann Date: Fri Jan 21 17:14:44 2022 +0100 batman-adv: Migrate to linux/container_of.h The commit d2a8ebbf8192 ("kernel.h: split out container_of() and typeof_member() macros") introduced a new header for the container_of related macros from (previously) linux/kernel.h. Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich net/batman-adv/bat_iv_ogm.c | 2 +- net/batman-adv/bat_v_elp.c | 2 +- net/batman-adv/bat_v_ogm.c | 2 +- net/batman-adv/bridge_loop_avoidance.c | 1 + net/batman-adv/distributed-arp-table.c | 2 +- net/batman-adv/gateway_client.c | 1 + net/batman-adv/hard-interface.c | 2 +- net/batman-adv/main.c | 1 + net/batman-adv/multicast.c | 1 + net/batman-adv/network-coding.c | 2 +- net/batman-adv/originator.c | 2 +- net/batman-adv/send.c | 2 +- net/batman-adv/soft-interface.c | 2 +- net/batman-adv/tp_meter.c | 2 +- net/batman-adv/translation-table.c | 2 +- net/batman-adv/tvlv.c | 2 +- 16 files changed, 16 insertions(+), 12 deletions(-) commit 71bb9ab6e3511b7bb98678a19eb8cf1ccbf3ca2f Author: Adrian Hunter Date: Mon Feb 28 13:36:52 2022 +0200 scsi: ufs: Fix runtime PM messages never-ending cycle Kernel messages produced during runtime PM can cause a never-ending cycle because user space utilities (e.g. journald or rsyslog) write the messages back to storage, causing runtime resume, more messages, and so on. Messages that tell of things that are expected to happen, are arguably unnecessary, so suppress them. UFS driver messages are changes to from dev_err() to dev_dbg() which means they will not display unless activated by dynamic debug of building with -DDEBUG. sdev->silence_suspend is set to skip messages from sd_suspend_common() "Synchronizing SCSI cache", "Stopping disk" and scsi_report_sense() "Power-on or device reset occurred" message (Note, that message appears when the LUN is accessed after runtime PM, not during runtime PM) Example messages from Ubuntu 21.10: $ dmesg | tail [ 1620.380071] ufshcd 0000:00:12.5: ufshcd_print_pwr_info:[RX, TX]: gear=[1, 1], lane[1, 1], pwr[SLOWAUTO_MODE, SLOWAUTO_MODE], rate = 0 [ 1620.408825] ufshcd 0000:00:12.5: ufshcd_print_pwr_info:[RX, TX]: gear=[4, 4], lane[2, 2], pwr[FAST MODE, FAST MODE], rate = 2 [ 1620.409020] ufshcd 0000:00:12.5: ufshcd_find_max_sup_active_icc_level: Regulator capability was not set, actvIccLevel=0 [ 1620.409524] sd 0:0:0:0: Power-on or device reset occurred [ 1622.938794] sd 0:0:0:0: [sda] Synchronizing SCSI cache [ 1622.939184] ufs_device_wlun 0:0:0:49488: Power-on or device reset occurred [ 1625.183175] ufshcd 0000:00:12.5: ufshcd_print_pwr_info:[RX, TX]: gear=[1, 1], lane[1, 1], pwr[SLOWAUTO_MODE, SLOWAUTO_MODE], rate = 0 [ 1625.208041] ufshcd 0000:00:12.5: ufshcd_print_pwr_info:[RX, TX]: gear=[4, 4], lane[2, 2], pwr[FAST MODE, FAST MODE], rate = 2 [ 1625.208311] ufshcd 0000:00:12.5: ufshcd_find_max_sup_active_icc_level: Regulator capability was not set, actvIccLevel=0 [ 1625.209035] sd 0:0:0:0: Power-on or device reset occurred Note for stable: depends on patch "scsi: core: sd: Add silence_suspend flag to suppress some PM messages". Link: https://lore.kernel.org/r/20220228113652.970857-3-adrian.hunter@intel.com Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen drivers/scsi/ufs/ufshcd.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) commit af4edb1d50c6d1044cb34bc43621411b7ba2cffe Author: Adrian Hunter Date: Mon Feb 28 13:36:51 2022 +0200 scsi: core: sd: Add silence_suspend flag to suppress some PM messages Kernel messages produced during runtime PM can cause a never-ending cycle because user space utilities (e.g. journald or rsyslog) write the messages back to storage, causing runtime resume, more messages, and so on. Messages that tell of things that are expected to happen are arguably unnecessary, so add a flag to suppress them. This flag is used by the UFS driver. Link: https://lore.kernel.org/r/20220228113652.970857-2-adrian.hunter@intel.com Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen drivers/scsi/scsi_error.c | 9 +++++++-- drivers/scsi/sd.c | 6 ++++-- include/scsi/scsi_device.h | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) commit e81ce97f571607757f29a8a25ae0051e72b3c832 Author: Hannes Reinecke Date: Tue Mar 1 15:37:18 2022 +0100 scsi: lpfc: Use rport as argument for lpfc_chk_tgt_mapped() We only need the rport structure for lpfc_chk_tgt_mapped(). Link: https://lore.kernel.org/r/20220301143718.40913-6-hare@suse.de Cc: James Smart Reviewed-by: James Smart Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_scsi.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) commit 123a3af35d084569c80b53de0e8e631567d0396f Author: Hannes Reinecke Date: Tue Mar 1 15:37:17 2022 +0100 scsi: lpfc: Use rport as argument for lpfc_send_taskmgmt() Instead of passing in a scsi_cmnd we should be using the rport; we already have the target and LUN ID as parameters, so there's no need to pass the scsi_cmnd too. Link: https://lore.kernel.org/r/20220301143718.40913-5-hare@suse.de Cc: James Smart Reviewed-by: James Smart Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_scsi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit bb21fc9911eea92afd476f7e64b327716e042a25 Author: Hannes Reinecke Date: Tue Mar 1 15:37:16 2022 +0100 scsi: lpfc: Use fc_block_rport() Use fc_block_rport() instead of fc_block_scsi_eh() as the SCSI command will be removed as argument for SCSI EH functions. Link: https://lore.kernel.org/r/20220301143718.40913-4-hare@suse.de Cc: James Smart Reviewed-by: James Smart Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_scsi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) commit 45c59287ff01589dab148048ef3d18d3211eee1d Author: Hannes Reinecke Date: Tue Mar 1 15:37:15 2022 +0100 scsi: lpfc: Drop lpfc_no_handler() The default SCSI EH action for a non-existing EH callback is to return FAILED, so having a callback just returning FAILED is pointless. Link: https://lore.kernel.org/r/20220301143718.40913-3-hare@suse.de Cc: James Smart Reviewed-by: Christoph Hellwig Reviewed-by: James Smart Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_scsi.c | 10 ---------- 1 file changed, 10 deletions(-) commit bf180cc1a5da39cd23e52127370a6f11494689b3 Author: Hannes Reinecke Date: Tue Mar 1 15:37:14 2022 +0100 scsi: lpfc: Kill lpfc_bus_reset_handler() lpfc_bus_reset_handler() is really just a loop calling lpfc_target_reset_handler() over all targets, which is what the error handler will be doing anyway. Link: https://lore.kernel.org/r/20220301143718.40913-2-hare@suse.de Cc: James Smart Reviewed-by: James Smart Reviewed-by: Christoph Hellwig Signed-off-by: Hannes Reinecke Signed-off-by: Martin K. Petersen drivers/scsi/lpfc/lpfc_scsi.c | 91 ------------------------------------------- 1 file changed, 91 deletions(-) commit 98cdcd6c6b4a3abacc65dd7ec66a230a5dffc3f8 Author: Zheyu Ma Date: Mon Feb 28 14:54:15 2022 +0000 scsi: wd719x: Return proper error code when dma_set_mask() fails During the process of driver probing, the probe function should return < 0 for failure, otherwise the kernel will treat value >= 0 as success. Set 'err' to the error value returned by dma_set_mask() in case of failure. Link: https://lore.kernel.org/r/1646060055-11361-1-git-send-email-zheyuma97@gmail.com Reviewed-by: Johannes Thumshirn Signed-off-by: Zheyu Ma Signed-off-by: Martin K. Petersen drivers/scsi/wd719x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 69af1c9577aae2149f79be6f485609250fdfb0ad Author: Mike Christie Date: Sat Feb 26 17:04:35 2022 -0600 scsi: iscsi: Drop temp workq_name When the workqueue code was created it didn't allow variable args so we have been using a temp buffer. Drop that. Link: https://lore.kernel.org/r/20220226230435.38733-7-michael.christie@oracle.com Reviewed-by: Chris Leech Reviewed-by: Lee Duncan Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/libiscsi.c | 6 ++---- include/scsi/libiscsi.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) commit 7cb6683ce761eda9b474e4d612cdfc2067a5ea07 Author: Mike Christie Date: Sat Feb 26 17:04:34 2022 -0600 scsi: iscsi: Use the session workqueue for recovery Use the session workqueue for recovery and unbinding. If there are delays during device blocking/cleanup then it will no longer affect other sessions. Link: https://lore.kernel.org/r/20220226230435.38733-6-michael.christie@oracle.com Reviewed-by: Chris Leech Reviewed-by: Lee Duncan Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) commit 5842ea3668310466dcf645a23b6cd5012ce2eadf Author: Mike Christie Date: Sat Feb 26 17:04:33 2022 -0600 scsi: iscsi: ql4xxx: Use per-session workqueue for unbinding We currently allocate a workqueue per host and only use it for removing the target. For the session per host case we could be using this workqueue to be able to do recoveries (block, unblock, timeout handling) in parallel. To also allow offload drivers to do their session recoveries in parallel, this drops the per host workqueue and replaces it with a per session one. Link: https://lore.kernel.org/r/20220226230435.38733-5-michael.christie@oracle.com Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/qla4xxx/ql4_os.c | 2 +- drivers/scsi/scsi_transport_iscsi.c | 19 ++++++++++++++----- include/scsi/scsi_transport_iscsi.h | 2 ++ 3 files changed, 17 insertions(+), 6 deletions(-) commit d8ec5d67b8bb6593223f24c04e1d530d86748250 Author: Mike Christie Date: Sat Feb 26 17:04:32 2022 -0600 scsi: iscsi: Remove iscsi_scan_finished() qla4xxx does not use iscsi_scan_finished() anymore so remove it. Link: https://lore.kernel.org/r/20220226230435.38733-4-michael.christie@oracle.com Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 39 ++++--------------------------------- include/scsi/scsi_transport_iscsi.h | 2 -- 2 files changed, 4 insertions(+), 37 deletions(-) commit b07c348f8ffb2885500a1c93f7be0edeead61ad5 Author: Mike Christie Date: Sat Feb 26 17:04:31 2022 -0600 scsi: iscsi: Speed up session unblocking and removal When the iSCSI class was added upstream, blocking a queue was fast because it just set some flag bits and didn't handle I/O that was in the process of being sent to the driver. That's no longer the case so blocking a queue is expensive and we can end up with a backlog of blocks by the time we have relogged in and are trying to start the queues. For the session unblock case, this has try to cancel the block and recovery work in case they are still queued so we can avoid unneeded queue manipulations. For removal, we also now try to cancel all the recovery related works since a couple lines down we will set the session and device state so running those functions are not necessary. Link: https://lore.kernel.org/r/20220226230435.38733-3-michael.christie@oracle.com Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit 8dd3dff3bf3e9d91df3a4c3665d3da873b6095b8 Author: Mike Christie Date: Sat Feb 26 17:04:30 2022 -0600 scsi: iscsi: Fix recovery and unblocking race If the user sets the iscsi_eh_timer_workq/iscsi_eh workqueue's max_active to greater than 1, the recovery_work could be running when __iscsi_unblock_session() runs. The cancel_delayed_work() will then not wait for the running work and we can race where we end up with the wrong session state and scsi_device state set. This replaces the cancel_delayed_work() with the sync version. Link: https://lore.kernel.org/r/20220226230435.38733-2-michael.christie@oracle.com Reviewed-by: Lee Duncan Reviewed-by: Chris Leech Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_iscsi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) commit 07e0984b96ec1ba8c6de1c092b986b00ea0c114c Author: James Smart Date: Tue Mar 1 09:55:36 2022 -0800 scsi: scsi_transport_fc: Fix FPIN Link Integrity statistics counters In the original FPIN commit, stats were incremented by the event_count. Event_count is the minimum # of events that must occur before an FPIN is sent. Thus, its not the actual number of events, and could be significantly off (too low) as it doesn't reflect anything not reported. Rather than attempt to count events, have the statistic count how many FPINS cross the threshold and were reported. Link: https://lore.kernel.org/r/20220301175536.60250-1-jsmart2021@gmail.com Fixes: 3dcfe0de5a97 ("scsi: fc: Parse FPIN packets and update statistics") Cc: # v5.11+ Cc: Shyam Sundar Cc: Nilesh Javali Reviewed-by: Himanshu Madhani Signed-off-by: James Smart Signed-off-by: Martin K. Petersen drivers/scsi/scsi_transport_fc.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) commit 32698c955295957d63f042f4bb30e9d613ca8b55 Author: Damien Le Moal Date: Mon Feb 28 18:48:57 2022 +0900 scsi: libsas: Clean up sas_form_port() Sparse throws a warning about context imbalance ("different lock contexts for basic block") in sas_form_port() as it gets confused with the fact that a port is locked within one of the two search loops and unlocked afterward outside of the search loops once the phy is added to the port. Since this code is not easy to follow, improve it by factoring out the code adding the phy to the port once the port is locked into the helper function sas_form_port_add_phy(). This helper can then be called directly within the port search loops, avoiding confusion and clearing the sparse warning. Link: https://lore.kernel.org/r/20220228094857.557329-1-damien.lemoal@opensource.wdc.com Reviewed-by: John Garry Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen drivers/scsi/libsas/sas_port.c | 73 ++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 31 deletions(-) commit 26440303310591e29121964ede0048583cb3126d Author: Christoph Hellwig Date: Thu Feb 24 18:55:52 2022 +0100 scsi: core: Remove This header is empty now except for an include of , so remove it. Link: https://lore.kernel.org/r/20220224175552.988286-9-hch@lst.de Reviewed-by: Bart Van Assche Reviewed-by: John Garry Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen drivers/cdrom/cdrom.c | 1 - drivers/scsi/scsi_transport_sas.c | 1 - include/linux/bsg-lib.h | 1 - include/scsi/scsi_cmnd.h | 1 - include/scsi/scsi_request.h | 7 ------- 5 files changed, 11 deletions(-) commit 6aded12b10e0c9536ee2c8ee33a1f7ed52f9cb34 Author: Christoph Hellwig Date: Thu Feb 24 18:55:51 2022 +0100 scsi: core: Remove struct scsi_request Let submitters initialize the scmd->allowed field directly instead of indirecting through struct scsi_request and remove the now superfluous structure. Link: https://lore.kernel.org/r/20220224175552.988286-8-hch@lst.de Reviewed-by: Bart Van Assche Reviewed-by: John Garry Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen drivers/scsi/scsi_debugfs.c | 2 +- drivers/scsi/scsi_error.c | 4 +--- drivers/scsi/scsi_ioctl.c | 12 ++++-------- drivers/scsi/scsi_lib.c | 6 +----- drivers/scsi/sg.c | 4 +--- drivers/scsi/sr.c | 2 -- drivers/scsi/st.c | 4 +--- drivers/target/target_core_pscsi.c | 2 +- include/scsi/scsi_cmnd.h | 1 - include/scsi/scsi_request.h | 9 --------- 10 files changed, 10 insertions(+), 36 deletions(-) commit dbb4c84d87af7416bb7e35f8e6dd8d87d5f221d4 Author: Christoph Hellwig Date: Thu Feb 24 18:55:50 2022 +0100 scsi: core: Move the result field from struct scsi_request to struct scsi_cmnd Prepare for removing the scsi_request structure by moving the result field to struct scsi_cmnd. Link: https://lore.kernel.org/r/20220224175552.988286-7-hch@lst.de Reviewed-by: Bart Van Assche Reviewed-by: John Garry Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen drivers/block/pktcdvd.c | 2 +- drivers/scsi/scsi_bsg.c | 8 +++----- drivers/scsi/scsi_ioctl.c | 9 ++++----- drivers/scsi/scsi_lib.c | 15 ++++----------- drivers/scsi/sg.c | 3 +-- drivers/scsi/sr.c | 2 +- drivers/scsi/st.c | 7 +++---- drivers/target/target_core_pscsi.c | 9 ++++----- include/scsi/scsi_request.h | 1 - 9 files changed, 21 insertions(+), 35 deletions(-) commit a9a4ea1166d640d1b397f24afc1cd7e96c46cd03 Author: Christoph Hellwig Date: Thu Feb 24 18:55:49 2022 +0100 scsi: core: Move the resid_len field from struct scsi_request to struct scsi_cmnd Prepare for removing the scsi_request structure by moving the resid_len field to struct scsi_cmnd. Link: https://lore.kernel.org/r/20220224175552.988286-6-hch@lst.de Reviewed-by: Bart Van Assche Reviewed-by: John Garry Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen drivers/scsi/scsi_bsg.c | 4 ++-- drivers/scsi/scsi_error.c | 6 +++--- drivers/scsi/scsi_ioctl.c | 2 +- drivers/scsi/scsi_lib.c | 6 +++--- drivers/scsi/sg.c | 2 +- drivers/scsi/st.c | 2 +- drivers/target/target_core_pscsi.c | 2 +- include/scsi/scsi_cmnd.h | 6 +++--- include/scsi/scsi_request.h | 1 - 9 files changed, 15 insertions(+), 16 deletions(-) commit 5b794f98074a8b7e8eb77dd43746062940b51160 Author: Christoph Hellwig Date: Thu Feb 24 18:55:48 2022 +0100 scsi: core: Remove the sense and sense_len fields from struct scsi_request Just use the sense_buffer field in struct scsi_cmnd for the sense data and move the sense_len field over to struct scsi_cmnd. Link: https://lore.kernel.org/r/20220224175552.988286-5-hch@lst.de Reviewed-by: Bart Van Assche Reviewed-by: John Garry Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen drivers/scsi/scsi_bsg.c | 7 ++++--- drivers/scsi/scsi_ioctl.c | 16 ++++++++-------- drivers/scsi/scsi_lib.c | 18 +++++++----------- drivers/scsi/sg.c | 7 ++++--- drivers/scsi/sr.c | 2 +- drivers/scsi/st.c | 5 +++-- drivers/target/target_core_pscsi.c | 3 ++- include/scsi/scsi_cmnd.h | 1 + include/scsi/scsi_request.h | 2 -- 9 files changed, 30 insertions(+), 31 deletions(-) commit ce70fd9a551af7424a7dace2a1ba05a7de8eae27 Author: Christoph Hellwig Date: Thu Feb 24 18:55:47 2022 +0100 scsi: core: Remove the cmd field from struct scsi_request Now that each scsi_request is backed by a scsi_cmnd, there is no need to indirect the CDB storage. Change all submitters of SCSI passthrough requests to store the CDB information directly in the scsi_cmnd, and while doing so allocate the full 32 bytes that cover all Linux supported SCSI hosts instead of requiring dynamic allocation for > 16 byte CDBs. On 64-bit systems this does not change the size of the scsi_cmnd at all, while on 32-bit systems it slightly increases it for now, but that increase will be made up by the removal of the remaining scsi_request fields. Link: https://lore.kernel.org/r/20220224175552.988286-4-hch@lst.de Reviewed-by: Bart Van Assche Reviewed-by: John Garry Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen drivers/ata/libata-scsi.c | 4 +++- drivers/block/pktcdvd.c | 6 ++++-- drivers/scsi/scsi_bsg.c | 23 +++++++++++------------ drivers/scsi/scsi_debugfs.c | 4 +--- drivers/scsi/scsi_error.c | 28 ++++++++++++++-------------- drivers/scsi/scsi_ioctl.c | 37 +++++++++++++++++-------------------- drivers/scsi/scsi_lib.c | 19 ++++++++----------- drivers/scsi/scsi_logging.c | 5 +---- drivers/scsi/sd.c | 28 +--------------------------- drivers/scsi/sg.c | 30 +++++++++++------------------- drivers/scsi/sr.c | 24 +++++++++++++----------- drivers/scsi/st.c | 12 +++++++----- drivers/scsi/ufs/ufshpb.c | 22 ++++++++++------------ drivers/target/target_core_pscsi.c | 12 ++++++++---- drivers/usb/storage/cypress_atacb.c | 1 - drivers/usb/storage/isd200.c | 4 ++-- include/scsi/scsi_cmnd.h | 7 +------ include/scsi/scsi_eh.h | 4 +--- include/scsi/scsi_request.h | 11 ----------- 19 files changed, 113 insertions(+), 168 deletions(-) commit 71bada345b33b9297e7cc9415db6328c99b554f9 Author: Christoph Hellwig Date: Thu Feb 24 18:55:46 2022 +0100 scsi: core: Don't memset() the entire scsi_cmnd in scsi_init_command() Replace the big fat memset that requires saving and restoring various fields with just initializing those fields that need initialization. All the clearing to 0 is moved to scsi_prepare_cmd() as scsi_ioctl_reset() alreadly uses kzalloc() to allocate a pre-zeroed command. This is still conservative and can probably be optimized further. Link: https://lore.kernel.org/r/20220224175552.988286-3-hch@lst.de Reviewed-by: Bart Van Assche Reviewed-by: John Garry Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen drivers/scsi/scsi_lib.c | 60 +++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 32 deletions(-) commit c49ff72cff4caff709b2edb98421bd87bec1d853 Author: Christoph Hellwig Date: Thu Feb 24 18:55:45 2022 +0100 scsi: target: pscsi: Remove struct pscsi_plugin_task Copy directly from the se_cmd CDB to the one in the scsi_request. This temporarily limits the pscsi backend to supporting only up to 16 byte CDBs, but this restriction will be lifted later in this series. Link: https://lore.kernel.org/r/20220224175552.988286-2-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen drivers/target/target_core_pscsi.c | 51 +++++++++++++------------------------- drivers/target/target_core_pscsi.h | 4 --- 2 files changed, 17 insertions(+), 38 deletions(-) commit 96946d892a05bde359b273aea317296b8f0c223c Merge: a02192151b7d cd73cda742fb Author: Jakub Kicinski Date: Tue Mar 1 18:29:35 2022 -0800 Merge branch 'if_ether-h-add-industrial-fieldbus-ethertypes' Daniel Braunwarth says: ==================== if_ether.h: add industrial fieldbus Ethertypes This set of patches adds the Ethertypes for PROFINET and EtherCAT. The defines should be used by iproute2 to extend the list of available link layer protocols. ==================== Link: https://lore.kernel.org/r/20220228133029.100913-1-daniel@braunwarth.dev Signed-off-by: Jakub Kicinski commit cd73cda742fbe1f33ed7306c7a01aa64f4e6ebd5 Author: Daniel Braunwarth Date: Mon Feb 28 14:30:29 2022 +0100 if_ether.h: add EtherCAT Ethertype Add the Ethertype for EtherCAT protocol. Signed-off-by: Daniel Braunwarth Signed-off-by: Jakub Kicinski include/uapi/linux/if_ether.h | 1 + 1 file changed, 1 insertion(+) commit dd0ca255f3d27a1bb43d8e9529fb3645f9a341a3 Author: Daniel Braunwarth Date: Mon Feb 28 14:30:28 2022 +0100 if_ether.h: add PROFINET Ethertype Add the Ethertype for PROFINET protocol. Signed-off-by: Daniel Braunwarth Signed-off-by: Jakub Kicinski include/uapi/linux/if_ether.h | 1 + 1 file changed, 1 insertion(+) commit a02192151b7dbf855084c38dca380d77c7658353 Author: Sven Eckelmann Date: Mon Feb 28 01:32:40 2022 +0100 macvtap: advertise link netns via netlink Assign rtnl_link_ops->get_link_net() callback so that IFLA_LINK_NETNSID is added to rtnetlink messages. This fixes iproute2 which otherwise resolved the link interface to an interface in the wrong namespace. Test commands: ip netns add nst ip link add dummy0 type dummy ip link add link macvtap0 link dummy0 type macvtap ip link set macvtap0 netns nst ip -netns nst link show macvtap0 Before: 10: macvtap0@gre0: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 500 link/ether 5e:8f:ae:1d:60:50 brd ff:ff:ff:ff:ff:ff After: 10: macvtap0@if2: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 500 link/ether 5e:8f:ae:1d:60:50 brd ff:ff:ff:ff:ff:ff link-netnsid 0 Reported-by: Leonardo Mörlein Signed-off-by: Sven Eckelmann Link: https://lore.kernel.org/r/20220228003240.1337426-1-sven@narfation.org Signed-off-by: Jakub Kicinski drivers/net/macvtap.c | 6 ++++++ 1 file changed, 6 insertions(+) commit 323d51cac6a1defa48620adb3f440f7634083aa3 Author: Wan Jiabing Date: Tue Mar 1 19:23:54 2022 +0800 nfp: avoid newline at end of message in NL_SET_ERR_MSG_MOD Fix the following coccicheck warning: ./drivers/net/ethernet/netronome/nfp/flower/qos_conf.c:750:7-55: WARNING avoid newline at end of message in NL_SET_ERR_MSG_MOD Signed-off-by: Wan Jiabing Reviewed-by: Simon Horman Link: https://lore.kernel.org/r/20220301112356.1820985-1-wanjiabing@vivo.com Signed-off-by: Jakub Kicinski drivers/net/ethernet/netronome/nfp/flower/qos_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit fb3f903769e805221eb19209b3d9128d398038a1 Author: Harold Huang Date: Mon Feb 28 11:38:05 2022 +0800 tun: support NAPI for packets received from batched XDP buffs In tun, NAPI is supported and we can also use NAPI in the path of batched XDP buffs to accelerate packet processing. What is more, after we use NAPI, GRO is also supported. The iperf shows that the throughput of single stream could be improved from 4.5Gbps to 9.2Gbps. Additionally, 9.2 Gbps nearly reachs the line speed of the phy nic and there is still about 15% idle cpu core remaining on the vhost thread. Test topology: [iperf server]<--->tap<--->dpdk testpmd<--->phy nic<--->[iperf client] Iperf stream: iperf3 -c 10.0.0.2 -i 1 -t 10 Before: ... [ 5] 5.00-6.00 sec 558 MBytes 4.68 Gbits/sec 0 1.50 MBytes [ 5] 6.00-7.00 sec 556 MBytes 4.67 Gbits/sec 1 1.35 MBytes [ 5] 7.00-8.00 sec 556 MBytes 4.67 Gbits/sec 2 1.18 MBytes [ 5] 8.00-9.00 sec 559 MBytes 4.69 Gbits/sec 0 1.48 MBytes [ 5] 9.00-10.00 sec 556 MBytes 4.67 Gbits/sec 1 1.33 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 5.39 GBytes 4.63 Gbits/sec 72 sender [ 5] 0.00-10.04 sec 5.39 GBytes 4.61 Gbits/sec receiver After: ... [ 5] 5.00-6.00 sec 1.07 GBytes 9.19 Gbits/sec 0 1.55 MBytes [ 5] 6.00-7.00 sec 1.08 GBytes 9.30 Gbits/sec 0 1.63 MBytes [ 5] 7.00-8.00 sec 1.08 GBytes 9.25 Gbits/sec 0 1.72 MBytes [ 5] 8.00-9.00 sec 1.08 GBytes 9.25 Gbits/sec 77 1.31 MBytes [ 5] 9.00-10.00 sec 1.08 GBytes 9.24 Gbits/sec 0 1.48 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 10.8 GBytes 9.28 Gbits/sec 166 sender [ 5] 0.00-10.04 sec 10.8 GBytes 9.24 Gbits/sec receiver Reported-at: https://lore.kernel.org/all/CACGkMEvTLG0Ayg+TtbN4q4pPW-ycgCCs3sC3-TF8cuRTf7Pp1A@mail.gmail.com Signed-off-by: Harold Huang Acked-by: Jason Wang Link: https://lore.kernel.org/r/20220228033805.1579435-1-baymaxhuang@gmail.com Signed-off-by: Jakub Kicinski drivers/net/tun.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) commit 422ce83667d6710ad0735734785815fd53327471 Merge: ef739f1dd3ac 09a99ab16c60 Author: Jakub Kicinski Date: Tue Mar 1 17:12:46 2022 -0800 Merge branch 'sfc-optimize-rxqs-count-and-affinities' Íñigo Huguet says: ==================== sfc: optimize RXQs count and affinities In sfc driver one RX queue per physical core was allocated by default. Later on, IRQ affinities were set spreading the IRQs in all NUMA local CPUs. However, with that default configuration it result in a non very optimal configuration in many modern systems. Specifically, in systems with hyper threading and 2 NUMA nodes, affinities are set in a way that IRQs are handled by all logical cores of one same NUMA node. Handling IRQs from both hyper threading siblings has no benefit, and setting affinities to one queue per physical core is neither a very good idea because there is a performance penalty for moving data across nodes (I was able to check it with some XDP tests using pktgen). This patches reduce the default number of channels to one per physical core in the local NUMA node. Then, they set IRQ affinities to CPUs in the local NUMA node only. This way we save hardware resources since channels are limited resources. We also leave more room for XDP_TX channels without hitting driver's limit of 32 channels per interface. Running performance tests using iperf with a SFC9140 device showed no performance penalty for reducing the number of channels. RX XDP tests showed that performance can go down to less than half if the IRQ is handled by a CPU in a different NUMA node, which doesn't happen with the new defaults from this patches. ==================== Link: https://lore.kernel.org/r/20220228132254.25787-1-ihuguet@redhat.com Signed-off-by: Jakub Kicinski commit 09a99ab16c6050eb1ea74ab39fdb7feedc73dee6 Author: Íñigo Huguet Date: Mon Feb 28 14:22:54 2022 +0100 sfc: set affinity hints in local NUMA node only Affinity hints were being set to CPUs in local NUMA node first, and then in other CPUs. This was creating 2 unintended issues: 1. Channels created to be assigned each to a different physical core were assigned to hyperthreading siblings because of being in same NUMA node. Since the patch previous to this one, this did not longer happen with default rss_cpus modparam because less channels are created. 2. XDP channels could be assigned to CPUs in different NUMA nodes, decreasing performance too much (to less than half in some of my tests). This patch sets the affinity hints spreading the channels only in local NUMA node's CPUs. A fallback for the case that no CPU in local NUMA node is online has been added too. Example of CPUs being assigned in a non optimal way before this and the previous patch (note: in this system, xdp-8 to xdp-15 are created because num_possible_cpus == 64, but num_present_cpus == 32 so they're never used): $ lscpu | grep -i numa NUMA node(s): 2 NUMA node0 CPU(s): 0-7,16-23 NUMA node1 CPU(s): 8-15,24-31 $ grep -H . /proc/irq/*/0000:07:00.0*/../smp_affinity_list /proc/irq/141/0000:07:00.0-0/../smp_affinity_list:0 /proc/irq/142/0000:07:00.0-1/../smp_affinity_list:1 /proc/irq/143/0000:07:00.0-2/../smp_affinity_list:2 /proc/irq/144/0000:07:00.0-3/../smp_affinity_list:3 /proc/irq/145/0000:07:00.0-4/../smp_affinity_list:4 /proc/irq/146/0000:07:00.0-5/../smp_affinity_list:5 /proc/irq/147/0000:07:00.0-6/../smp_affinity_list:6 /proc/irq/148/0000:07:00.0-7/../smp_affinity_list:7 /proc/irq/149/0000:07:00.0-8/../smp_affinity_list:16 /proc/irq/150/0000:07:00.0-9/../smp_affinity_list:17 /proc/irq/151/0000:07:00.0-10/../smp_affinity_list:18 /proc/irq/152/0000:07:00.0-11/../smp_affinity_list:19 /proc/irq/153/0000:07:00.0-12/../smp_affinity_list:20 /proc/irq/154/0000:07:00.0-13/../smp_affinity_list:21 /proc/irq/155/0000:07:00.0-14/../smp_affinity_list:22 /proc/irq/156/0000:07:00.0-15/../smp_affinity_list:23 /proc/irq/157/0000:07:00.0-xdp-0/../smp_affinity_list:8 /proc/irq/158/0000:07:00.0-xdp-1/../smp_affinity_list:9 /proc/irq/159/0000:07:00.0-xdp-2/../smp_affinity_list:10 /proc/irq/160/0000:07:00.0-xdp-3/../smp_affinity_list:11 /proc/irq/161/0000:07:00.0-xdp-4/../smp_affinity_list:12 /proc/irq/162/0000:07:00.0-xdp-5/../smp_affinity_list:13 /proc/irq/163/0000:07:00.0-xdp-6/../smp_affinity_list:14 /proc/irq/164/0000:07:00.0-xdp-7/../smp_affinity_list:15 /proc/irq/165/0000:07:00.0-xdp-8/../smp_affinity_list:24 /proc/irq/166/0000:07:00.0-xdp-9/../smp_affinity_list:25 /proc/irq/167/0000:07:00.0-xdp-10/../smp_affinity_list:26 /proc/irq/168/0000:07:00.0-xdp-11/../smp_affinity_list:27 /proc/irq/169/0000:07:00.0-xdp-12/../smp_affinity_list:28 /proc/irq/170/0000:07:00.0-xdp-13/../smp_affinity_list:29 /proc/irq/171/0000:07:00.0-xdp-14/../smp_affinity_list:30 /proc/irq/172/0000:07:00.0-xdp-15/../smp_affinity_list:31 CPUs assignments after this and previous patch, so normal channels created only one per core in NUMA node and affinities set only to local NUMA node: $ grep -H . /proc/irq/*/0000:07:00.0*/../smp_affinity_list /proc/irq/116/0000:07:00.0-0/../smp_affinity_list:0 /proc/irq/117/0000:07:00.0-1/../smp_affinity_list:1 /proc/irq/118/0000:07:00.0-2/../smp_affinity_list:2 /proc/irq/119/0000:07:00.0-3/../smp_affinity_list:3 /proc/irq/120/0000:07:00.0-4/../smp_affinity_list:4 /proc/irq/121/0000:07:00.0-5/../smp_affinity_list:5 /proc/irq/122/0000:07:00.0-6/../smp_affinity_list:6 /proc/irq/123/0000:07:00.0-7/../smp_affinity_list:7 /proc/irq/124/0000:07:00.0-xdp-0/../smp_affinity_list:16 /proc/irq/125/0000:07:00.0-xdp-1/../smp_affinity_list:17 /proc/irq/126/0000:07:00.0-xdp-2/../smp_affinity_list:18 /proc/irq/127/0000:07:00.0-xdp-3/../smp_affinity_list:19 /proc/irq/128/0000:07:00.0-xdp-4/../smp_affinity_list:20 /proc/irq/129/0000:07:00.0-xdp-5/../smp_affinity_list:21 /proc/irq/130/0000:07:00.0-xdp-6/../smp_affinity_list:22 /proc/irq/131/0000:07:00.0-xdp-7/../smp_affinity_list:23 /proc/irq/132/0000:07:00.0-xdp-8/../smp_affinity_list:0 /proc/irq/133/0000:07:00.0-xdp-9/../smp_affinity_list:1 /proc/irq/134/0000:07:00.0-xdp-10/../smp_affinity_list:2 /proc/irq/135/0000:07:00.0-xdp-11/../smp_affinity_list:3 /proc/irq/136/0000:07:00.0-xdp-12/../smp_affinity_list:4 /proc/irq/137/0000:07:00.0-xdp-13/../smp_affinity_list:5 /proc/irq/138/0000:07:00.0-xdp-14/../smp_affinity_list:6 /proc/irq/139/0000:07:00.0-xdp-15/../smp_affinity_list:7 Signed-off-by: Íñigo Huguet Acked-by: Martin Habets Signed-off-by: Jakub Kicinski drivers/net/ethernet/sfc/efx_channels.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit c265b569a45fd03385154ee0ec7cac96fb7e6a0a Author: Íñigo Huguet Date: Mon Feb 28 14:22:53 2022 +0100 sfc: default config to 1 channel/core in local NUMA node only Handling channels from CPUs in different NUMA node can penalize performance, so better configure only one channel per core in the same NUMA node than the NIC, and not per each core in the system. Fallback to all other online cores if there are not online CPUs in local NUMA node. Signed-off-by: Íñigo Huguet Acked-by: Martin Habets Signed-off-by: Jakub Kicinski drivers/net/ethernet/sfc/efx_channels.c | 51 ++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 17 deletions(-) commit ef739f1dd3ac1f47b8c81ce9e201aade9813441c Author: Jakub Kicinski Date: Tue Mar 1 14:24:46 2022 -0800 net: smc: fix different types in min() Fix build: include/linux/minmax.h:45:25: note: in expansion of macro ‘__careful_cmp’ 45 | #define min(x, y) __careful_cmp(x, y, <) | ^~~~~~~~~~~~~ net/smc/smc_tx.c:150:24: note: in expansion of macro ‘min’ 150 | corking_size = min(sock_net(&smc->sk)->smc.sysctl_autocorking_size, | ^~~ Fixes: 12bbb0d163a9 ("net/smc: add sysctl for autocorking") Link: https://lore.kernel.org/r/20220301222446.1271127-1-kuba@kernel.org Signed-off-by: Jakub Kicinski net/smc/smc_tx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 719ca379729002b0ec888069a36e508a26e51204 Author: Rob Herring Date: Tue Mar 1 15:05:13 2022 -0600 dt-bindings: display/msm: Drop bogus interrupt flags cell on MDSS nodes The MDSS interrupt provider is a single cell, so specifying interrupt flags on the consumers is incorrect. Signed-off-by: Rob Herring Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220301210513.1855076-1-robh@kernel.org Signed-off-by: Rob Clark Documentation/devicetree/bindings/display/msm/dpu-msm8998.yaml | 4 ++-- Documentation/devicetree/bindings/display/msm/dpu-qcm2290.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) commit 4f0bfdfd8323e5b461fc1042143a1097dba9fced Author: Kees Cook Date: Wed Feb 23 19:34:31 2022 -0800 ELF: Properly redefine PT_GNU_* in terms of PT_LOOS The PT_GNU_* program header types are actually offsets from PT_LOOS, so redefine them as such, reorder them, and add the missing PT_GNU_RELRO. Cc: Eric Biederman Cc: Peter Collingbourne Cc: Catalin Marinas Cc: Dave Martin Signed-off-by: Kees Cook include/uapi/linux/elf.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 7dc6ea7c56bd76ab88d09504a90879479e3851ef Author: Kees Cook Date: Wed Feb 23 20:38:53 2022 -0800 MAINTAINERS: Update execve entry with more details The UAPI elf.h header was missed in the original MAINTAINER entry. Add it. Include linux-mm mailing list since that's where execve has traditionally been discussed. Note that this area is Supported, and aim at the git tree. Cc: Eric Biederman Signed-off-by: Kees Cook MAINTAINERS | 4 ++++ 1 file changed, 4 insertions(+) commit b452722e6ff39a1b8111d5b36b8562aaead1726e Author: Tom Rix Date: Fri Feb 11 08:09:40 2022 -0800 exec: cleanup comments Remove the second 'from'. Replace 'backwords' with 'backwards'. Replace 'visibile' with 'visible'. Signed-off-by: Tom Rix Acked-by: Randy Dunlap Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220211160940.2516243-1-trix@redhat.com fs/exec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 2b4bfbe0967697c9b5de83dbaf5b49db4b367ec0 Author: Akira Kawata Date: Thu Jan 27 21:40:17 2022 +0900 fs/binfmt_elf: Refactor load_elf_binary function I delete load_addr because it is not used anymore. And I rename load_addr_set to first_pt_load because it is used only to capture the first iteration of the loop. Signed-off-by: Akira Kawata Acked-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220127124014.338760-3-akirakawata1@gmail.com fs/binfmt_elf.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) commit 0da1d5002745cdc721bc018b582a8a9704d56c42 Author: Akira Kawata Date: Thu Jan 27 21:40:16 2022 +0900 fs/binfmt_elf: Fix AT_PHDR for unusual ELF files BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=197921 As pointed out in the discussion of buglink, we cannot calculate AT_PHDR as the sum of load_addr and exec->e_phoff. : The AT_PHDR of ELF auxiliary vectors should point to the memory address : of program header. But binfmt_elf.c calculates this address as follows: : : NEW_AUX_ENT(AT_PHDR, load_addr + exec->e_phoff); : : which is wrong since e_phoff is the file offset of program header and : load_addr is the memory base address from PT_LOAD entry. : : The ld.so uses AT_PHDR as the memory address of program header. In normal : case, since the e_phoff is usually 64 and in the first PT_LOAD region, it : is the correct program header address. : : But if the address of program header isn't equal to the first PT_LOAD : address + e_phoff (e.g. Put the program header in other non-consecutive : PT_LOAD region), ld.so will try to read program header from wrong address : then crash or use incorrect program header. This is because exec->e_phoff is the offset of PHDRs in the file and the address of PHDRs in the memory may differ from it. This patch fixes the bug by calculating the address of program headers from PT_LOADs directly. Signed-off-by: Akira Kawata Reported-by: kernel test robot Acked-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220127124014.338760-2-akirakawata1@gmail.com fs/binfmt_elf.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) commit d65bc29be0ae4ca2368df25dc6f6247aefb57f07 Author: Alexey Dobriyan Date: Sun Feb 13 22:25:20 2022 +0300 binfmt: move more stuff undef CONFIG_COREDUMP struct linux_binfmt::core_dump and struct min_coredump::min_coredump are used under CONFIG_COREDUMP only. Shrink those embedded configs a bit. Signed-off-by: Alexey Dobriyan Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/YglbIFyN+OtwVyjW@localhost.localdomain fs/binfmt_elf.c | 2 ++ fs/binfmt_elf_fdpic.c | 2 +- fs/binfmt_flat.c | 2 ++ include/linux/binfmts.h | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) commit 9132c3947b09a6c67372424ff69f867f2cee82f8 Author: Kees Cook Date: Mon Jan 31 17:16:37 2022 -0800 selftests/exec: Test for empty string on NULL argv Test for the NULL argv argument producing a single empty string on exec. Cc: Eric Biederman Cc: Shuah Khan Cc: Yang Yingliang Cc: Andrew Morton Cc: linux-kselftest@vger.kernel.org Signed-off-by: Kees Cook Link: https://lore.kernel.org/lkml/20220201011637.2457646-1-keescook@chromium.org tools/testing/selftests/exec/Makefile | 1 + tools/testing/selftests/exec/null-argv.c | 78 ++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) commit dcd46d897adb70d63e025f175a00a89797d31a43 Author: Kees Cook Date: Mon Jan 31 16:09:47 2022 -0800 exec: Force single empty string when argv is empty Quoting[1] Ariadne Conill: "In several other operating systems, it is a hard requirement that the second argument to execve(2) be the name of a program, thus prohibiting a scenario where argc < 1. POSIX 2017 also recommends this behaviour, but it is not an explicit requirement[2]: The argument arg0 should point to a filename string that is associated with the process being started by one of the exec functions. ... Interestingly, Michael Kerrisk opened an issue about this in 2008[3], but there was no consensus to support fixing this issue then. Hopefully now that CVE-2021-4034 shows practical exploitative use[4] of this bug in a shellcode, we can reconsider. This issue is being tracked in the KSPP issue tracker[5]." While the initial code searches[6][7] turned up what appeared to be mostly corner case tests, trying to that just reject argv == NULL (or an immediately terminated pointer list) quickly started tripping[8] existing userspace programs. The next best approach is forcing a single empty string into argv and adjusting argc to match. The number of programs depending on argc == 0 seems a smaller set than those calling execve with a NULL argv. Account for the additional stack space in bprm_stack_limits(). Inject an empty string when argc == 0 (and set argc = 1). Warn about the case so userspace has some notice about the change: process './argc0' launched './argc0' with NULL argv: empty string added Additionally WARN() and reject NULL argv usage for kernel threads. [1] https://lore.kernel.org/lkml/20220127000724.15106-1-ariadne@dereferenced.org/ [2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html [3] https://bugzilla.kernel.org/show_bug.cgi?id=8408 [4] https://www.qualys.com/2022/01/25/cve-2021-4034/pwnkit.txt [5] https://github.com/KSPP/linux/issues/176 [6] https://codesearch.debian.net/search?q=execve%5C+*%5C%28%5B%5E%2C%5D%2B%2C+*NULL&literal=0 [7] https://codesearch.debian.net/search?q=execlp%3F%5Cs*%5C%28%5B%5E%2C%5D%2B%2C%5Cs*NULL&literal=0 [8] https://lore.kernel.org/lkml/20220131144352.GE16385@xsang-OptiPlex-9020/ Reported-by: Ariadne Conill Reported-by: Michael Kerrisk Cc: Matthew Wilcox Cc: Christian Brauner Cc: Rich Felker Cc: Eric Biederman Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Acked-by: Christian Brauner Acked-by: Ariadne Conill Acked-by: Andy Lutomirski Link: https://lore.kernel.org/r/20220201000947.2453721-1-keescook@chromium.org fs/exec.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) commit 84158b7f6a0624b81800b4e7c90f7fb7fdecf66c Author: Jann Horn Date: Wed Jan 26 03:57:39 2022 +0100 coredump: Also dump first pages of non-executable ELF libraries When I rewrote the VMA dumping logic for coredumps, I changed it to recognize ELF library mappings based on the file being executable instead of the mapping having an ELF header. But turns out, distros ship many ELF libraries as non-executable, so the heuristic goes wrong... Restore the old behavior where FILTER(ELF_HEADERS) dumps the first page of any offset-0 readable mapping that starts with the ELF magic. This fix is technically layer-breaking a bit, because it checks for something ELF-specific in fs/coredump.c; but since we probably want to share this between standard ELF and FDPIC ELF anyway, I guess it's fine? And this also keeps the change small for backporting. Cc: stable@vger.kernel.org Fixes: 429a22e776a2 ("coredump: rework elf/elf_fdpic vma_dump_size() into common helper") Reported-by: Bill Messmer Signed-off-by: Jann Horn Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220126025739.2014888-1-jannh@google.com fs/coredump.c | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) commit 10b19249192ae28ee9092ceca327a83d27d88bd0 Author: Alexey Dobriyan Date: Sun Oct 3 15:11:24 2021 +0300 ELF: fix overflow in total mapping size calculation Kernel assumes that ELF program headers are ordered by mapping address, but doesn't enforce it. It is possible to make mapping size extremely huge by simply shuffling first and last PT_LOAD segments. As long as PT_LOAD segments do not overlap, it is silly to require sorting by v_addr anyway because mmap() doesn't care. Don't assume PT_LOAD segments are sorted and calculate min and max addresses correctly. Signed-off-by: Alexey Dobriyan Tested-by: "Magnus Groß" Link: https://lore.kernel.org/all/Yfqm7HbucDjPbES+@fractal.localdomain/ Signed-off-by: Kees Cook Link: https://lore.kernel.org/lkml/YVmd7D0M6G%2FDcP4O@localhost.localdomain fs/binfmt_elf.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) commit 530e214c5b5acbfaf819d884b196f3c61f5eca3d Author: Stanislav Fomichev Date: Mon Feb 28 15:23:32 2022 -0800 bpf, test_run: Fix overflow in XDP frags bpf_test_finish Syzkaller reports another issue: WARNING: CPU: 0 PID: 10775 at include/linux/thread_info.h:230 check_copy_size include/linux/thread_info.h:230 [inline] WARNING: CPU: 0 PID: 10775 at include/linux/thread_info.h:230 copy_to_user include/linux/uaccess.h:199 [inline] WARNING: CPU: 0 PID: 10775 at include/linux/thread_info.h:230 bpf_test_finish.isra.0+0x4b2/0x680 net/bpf/test_run.c:171 This can happen when the userspace buffer is smaller than head + frags. Return ENOSPC in this case. Fixes: 7855e0db150a ("bpf: test_run: add xdp_shared_info pointer in bpf_test_finish signature") Reported-by: syzbot+5f81df6205ecbbc56ab5@syzkaller.appspotmail.com Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Cc: Lorenzo Bianconi Link: https://lore.kernel.org/bpf/20220228232332.458871-1-sdf@google.com net/bpf/test_run.c | 5 +++++ 1 file changed, 5 insertions(+) commit 7e302637ba6192a2b432b327ab59ada6cb7907d4 Author: Melissa Wen Date: Mon Feb 28 17:16:47 2022 -0100 drm/v3d: centralize error handling when init scheduler fails Remove redundant error message (since now it is very similar to what we do in drm_sched_init) and centralize all error handling in a unique place, as we follow the same steps in any case of failure. Signed-off-by: Melissa Wen Acked-by: Andrey Grodzovsky Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/20220228181647.3794298-1-mwen@igalia.com drivers/gpu/drm/v3d/v3d_sched.c | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) commit e2a1e7abaee128020fde54d386ec8959b1e9eb61 Author: John Harrison Date: Thu Feb 24 17:52:32 2022 -0800 drm/i915/guc: Do not complain about stale reset notifications It is possible for reset notifications to arrive for a context that is in the process of being banned. So don't flag these as an error, just report it as informational (because it is still useful to know that resets are happening even if they are being ignored). v2: Better wording for the message (review feedback from Tvrtko). v3: Fix rebase issue (review feedback from Daniele). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20220225015232.1939497-1-John.C.Harrison@Intel.com drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) commit f568cbd9aef24a02b22884d92c154f3af076b383 Author: Nuno Sá Date: Fri Feb 25 14:01:29 2022 +0100 dt-bindings: iio: Add ltc2688 documentation Document the LTC2688 devicetree properties. Signed-off-by: Nuno Sá Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20220225130129.69-4-nuno.sa@analog.com Signed-off-by: Jonathan Cameron .../devicetree/bindings/iio/dac/adi,ltc2688.yaml | 146 +++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 147 insertions(+) commit 52302f87d0a126a34686f40cdd4ab28f9e824a68 Author: Nuno Sá Date: Fri Feb 25 14:01:28 2022 +0100 iio: ABI: add ABI file for the LTC2688 DAC Define the sysfs interface for toggle or dither capable channels. Dither capable channels will have the extended interface: * out_voltageY_dither_en * out_voltageY_dither_raw * out_voltageY_dither_offset * out_voltageY_dither_raw_available * out_voltageY_dither_frequency * out_voltageY_dither_frequency_available * out_voltageY_dither_phase * out_voltageY_dither_phase_available Toggle enabled channels will have: * out_voltageY_toggle_en * out_voltageY_raw0 * out_voltageY_raw1 * out_voltageY_symbol The common interface present in all channels is: * out_voltageY_raw (not present in toggle enabled channels) * out_voltageY_raw_available * out_voltageY_powerdown * out_voltageY_scale * out_voltageY_offset * out_voltageY_calibbias * out_voltageY_calibscale Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220225130129.69-3-nuno.sa@analog.com Signed-off-by: Jonathan Cameron .../ABI/testing/sysfs-bus-iio-dac-ltc2688 | 86 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 87 insertions(+) commit 832cb9eeb9312dd2e14133681d3920b773ef1eac Author: Nuno Sá Date: Fri Feb 25 14:01:27 2022 +0100 iio: dac: add support for ltc2688 The LTC2688 is a 16 channel, 16 bit, +-15V DAC with an integrated precision reference. It is guaranteed monotonic and has built in rail-to-rail output buffers that can source or sink up to 20 mA. Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220225130129.69-2-nuno.sa@analog.com Signed-off-by: Jonathan Cameron MAINTAINERS | 7 + drivers/iio/dac/Kconfig | 11 + drivers/iio/dac/Makefile | 1 + drivers/iio/dac/ltc2688.c | 1071 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1090 insertions(+) commit b497e06d2714b22200e0bad76111229c960debd5 Author: Paulo Miguel Almeida Date: Sat Feb 26 17:25:31 2022 +1300 staging: pi433: prevent uninitialized data from being printed out local_buffer is not initialised before data is passed to spi_sync_transfer. In case spi* function fails then the dev_dbg statement after that can potentially print out uninitialised data this patch initialises local_buffer array. Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/Yhmruyr2BUn0+3O3@mail.google.com Signed-off-by: Greg Kroah-Hartman drivers/staging/pi433/rf69.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 095f746502740d76a086ab127e11b3c4dba78141 Author: Martin Kaiser Date: Sun Feb 27 17:41:47 2022 +0100 staging: r8188eu: use ieee80211 helper to read the "order" bit Use the ieee80211 helper to read the "order" bit. The driver-specific macro GetOrder can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220227164147.1168847-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 2 +- drivers/staging/r8188eu/include/wifi.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) commit 0beae891d3bae1161eaa2e48de4d68c0d5166afe Author: Martin Kaiser Date: Sun Feb 27 17:41:46 2022 +0100 staging: r8188eu: use ieee80211 helper to read the protected bit Use the ieee80211 helper to read the "protected" bit. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220227164147.1168847-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3371c86dc0546b7777ec574a3b713883dabb410d Author: Martin Kaiser Date: Sun Feb 27 17:41:45 2022 +0100 staging: r8188eu: use ieee80211 helper to read "more data" Use the ieee80211 helper to read the "more data" bit. The driver-specific macro GetMData can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220227164147.1168847-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 2 +- drivers/staging/r8188eu/include/wifi.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) commit 7c22fd48fd4e9a89a8400828e77f169a604cfa3b Author: Martin Kaiser Date: Sun Feb 27 17:41:44 2022 +0100 staging: r8188eu: use ieee80211 helper to check for more fragments Use the ieee80211 helper to check the "more fragments" bit. Remove the internal GetMFrag macro. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220227164147.1168847-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 2 +- drivers/staging/r8188eu/include/wifi.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) commit 1c167e3b8304b0b9ec39a48d26c645185456aa93 Author: Martin Kaiser Date: Sun Feb 27 17:41:43 2022 +0100 staging: r8188eu: use ieee80211 helper for qos bit Use the ieee80211_is_data_qos helper function to read the qos bit. This helper function returns a bool. Change the qos field in struct rx_pkt_attrib from u8 to bool and fix up the other places where it is used. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220227164147.1168847-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 9 +++------ drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c | 2 +- drivers/staging/r8188eu/include/rtw_recv.h | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) commit aacd0400c7f3eccfba3df30d80f194abe1aa4111 Author: Martin Kaiser Date: Sun Feb 27 17:41:42 2022 +0100 staging: r8188eu: refactor validate_recv_frame's error handling Refactor the error handling of validate_recv_frame. It's simpler to default to _FAIL. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220227164147.1168847-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) commit d7e168c76f16c280f7ad8a09b8ecddd53c208a3f Author: Martin Kaiser Date: Sun Feb 27 17:41:41 2022 +0100 staging: r8188eu: use ieee80211 helpers to check the frame type Use the ieee80211_is_... helper functions to check the frame type in the validate_recv_frame function. Add a temporary variable for the 16-bit frame control field. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220227164147.1168847-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) commit e9f3ac5edb25e47d6cc2b6fd2f4e1542ec7150e6 Author: Martin Kaiser Date: Sun Feb 27 17:41:40 2022 +0100 staging: r8188eu: use ieee80211 define for management frame type Replace the driver-internal define for management frame type with IEEE80211_FTYPE_MGMT. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220227164147.1168847-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_mlme_ext.c | 3 ++- drivers/staging/r8188eu/core/rtw_recv.c | 2 +- drivers/staging/r8188eu/include/wifi.h | 25 ++++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-) commit e092f715ff5fee7f54beeb060e065398f91e8150 Author: Martin Kaiser Date: Sat Feb 26 19:14:57 2022 +0100 staging: r8188eu: remove unused define Remove the rtw_dequeue_recvframe define, which is not used. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220226181457.1138035-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/rtw_recv.h | 1 - 1 file changed, 1 deletion(-) commit 1b627cc172910d2678c3e5362daa8e7ad97f4eb6 Author: Martin Kaiser Date: Sat Feb 26 19:14:56 2022 +0100 staging: r8188eu: get_rx_status is not used Remove the unused function get_rx_status. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220226181457.1138035-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/rtw_recv.h | 5 ----- 1 file changed, 5 deletions(-) commit dde7b6ea87806376832dc3e663546d3aa97218a5 Author: Martin Kaiser Date: Sat Feb 26 19:14:55 2022 +0100 staging: r8188eu: recvframe_push is not used The recvframe_push function is not used. It can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220226181457.1138035-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/rtw_recv.h | 20 -------------------- 1 file changed, 20 deletions(-) commit 905eebcf28d06a6d6e1a74afa1577c21b1601cca Author: Martin Kaiser Date: Sat Feb 26 19:14:54 2022 +0100 staging: r8188eu: cnt is set but not used In function recv_func, the cnt variable is set but not used. It can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220226181457.1138035-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) commit 1327fcf175fa63d3b7a058b8148ed7714acdc035 Author: Martin Kaiser Date: Sat Feb 26 19:14:53 2022 +0100 staging: r8188eu: fix endless loop in recv_func Fix an endless loop in recv_func. If pending_frame is not NULL, we're stuck in the while loop forever. We have to call rtw_alloc_recvframe each time we loop. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Reported-by: Pavel Skripkin Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220226181457.1138035-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 6e1e59c1caf6d1981bfab8a2c920ad2e9995471c Author: Martin Kaiser Date: Sat Feb 26 19:14:52 2022 +0100 staging: r8188eu: irq_prepare_beacon_tasklet is unused irq_prepare_beacon_tasklet in struct recv_priv is not used for r8188eu. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220226181457.1138035-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/rtw_recv.h | 1 - 1 file changed, 1 deletion(-) commit 18ba5748c24dc42a3280f94eb7b52a9bbb756c48 Author: Martin Kaiser Date: Sat Feb 26 19:14:51 2022 +0100 staging: r8188eu: smooth_rssi_data is not used struct smooth_rssi_data is not used in this driver. It can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220226181457.1138035-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/include/rtw_recv.h | 7 ------- 1 file changed, 7 deletions(-) commit 2d19e698e7f1c2453340b515f18adc779c42b11e Author: Paulo Miguel Almeida Date: Sat Feb 26 11:40:33 2022 +1300 staging: pi433: remove rf69_get_flag function resolving enum conflict The reason why rf69_get_flag() existed was to provide a high-level way to obtain values out of 1 (of 2) flags registers using bit masking. The idea was to map the possible flag values found in the data sheet like shown in page 70 of the RFM69HCW datasheet. However, due to the fact that enums values in C must be unique, there was a naming conflict on 'fifo_not_empty' which is used by the tx_start_condition enum. So the author decided to create a 'fifo_empty' one which would negate the value that comes from the flag register as the solution to that conflict (which is very confusing). this patch removes rf69_get_flag function which subsequently solves the enum redeclaration problem so kernel developers can follow the data sheet more easily. Reviewed-by: Dan Carpenter Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/Yhla4a1Clpguoo2h@mail.google.com Signed-off-by: Greg Kroah-Hartman drivers/staging/pi433/pi433_if.c | 8 +++---- drivers/staging/pi433/rf69.c | 44 --------------------------------------- drivers/staging/pi433/rf69.h | 1 - drivers/staging/pi433/rf69_enum.h | 20 ------------------ 4 files changed, 4 insertions(+), 69 deletions(-) commit ed01d1b9bca21b186aa05b5beab4df88d42cf335 Author: Michael Straube Date: Fri Feb 25 18:48:27 2022 +0100 staging: r8188eu: remove _linked_rx_signal_strength_display() The function _linked_rx_signal_strength_display() only sets two local variables that are not used after setting. Remove the function and remove resulting dead code. The HW_DEF_RA_INFO_DUMP case in GetHalDefVar8188EUsb() does not set the passed variable. It just calls check_fwstate() which does nothing than return true or false. So it is safe to remove this call to GetHalDefVar8188EUsb(). The HAL_DEF_UNDERCORATEDSMOOTHEDPWDB case in GetHalDefVar8188EUsb() does nothing than set the passed variable and it is safe to remove this call to GetHalDefVar8188EUsb() as well. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220225174827.15927-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/staging/r8188eu/core/rtw_mlme_ext.c | 20 -------------------- drivers/staging/r8188eu/hal/usb_halinit.c | 13 ------------- drivers/staging/r8188eu/include/hal_intf.h | 2 -- 3 files changed, 35 deletions(-) commit 50dc963bc12ce84fb70b90a83109f27ce92fc42f Author: Paulo Miguel Almeida Date: Sat Feb 26 17:52:59 2022 +1300 staging: pi433: remove TODOs-related item from the TODO file All occurences of code annotated with TODO in this driver have been addressed in the last couple of years by the community. The last occurrence of the word "TODO" was in the form of a multi-line comment in the header file intended to be exposed to userspace once this driver moves away from the staging folder. This patch removes that TODO as well as the TODO-related item from the driver's TODO file Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/YhmyK1Utaoj924im@mail.google.com Signed-off-by: Greg Kroah-Hartman drivers/staging/pi433/TODO | 1 - drivers/staging/pi433/pi433_if.h | 2 -- 2 files changed, 3 deletions(-) commit 55927cb44db43a57699fa652e2437a91620385dc Author: Frank Wunderlich Date: Tue Mar 1 16:24:18 2022 +0100 arm64: dts: broadcom: Fix sata nodename After converting ahci-platform txt binding to yaml nodename is reported as not matching the standard: arch/arm64/boot/dts/broadcom/northstar2/ns2-svk.dt.yaml: ahci@663f2000: $nodename:0: 'ahci@663f2000' does not match '^sata(@.*)?$' Fix it to match binding. Fixes: ac9aae00f0fc ("arm64: dts: Add SATA3 AHCI and SATA3 PHY DT nodes for NS2") Signed-off-by: Frank Wunderlich Signed-off-by: Florian Fainelli arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3dd9a926ec2308e49445f22abef149fc64e9332e Author: Ulf Hansson Date: Tue Mar 1 12:53:00 2022 +0100 mmc: rtsx: Fix build errors/warnings for unused variable The struct device *dev, is no longer needed at various functions, let's therefore drop it to fix the build errors/warnings. Fixes: 7570fb41e450 ("mmc: rtsx: Let MMC core handle runtime PM") Cc: Kai-Heng Feng Reported-by: kernel test robot Signed-off-by: Ulf Hansson Link: https://lore.kernel.org/r/20220301115300.64332-1-ulf.hansson@linaro.org Signed-off-by: Greg Kroah-Hartman drivers/mmc/host/rtsx_pci_sdmmc.c | 6 ------ 1 file changed, 6 deletions(-) commit 47b95e8ab731511b7ed7924ec3ec922e14737e4e Author: Wei Yongjun Date: Tue Mar 1 07:58:06 2022 +0000 serial: mvebu-uart: fix return value check in mvebu_uart_clock_probe() In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: b7e2b5360f9b ("serial: mvebu-uart: implement UART clock driver for configuring UART base clock") Reported-by: Hulk Robot Reviewed-by: Pali Rohár Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20220301075806.3950108-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/mvebu-uart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 6e124e58ae2e0e3f6400dce21e942a94a67a7949 Author: Tomasz Moń Date: Tue Mar 1 07:03:32 2022 +0100 sc16is7xx: Set AUTOCTS and AUTORTS bits Let serial core know that the chip automatically handles RTS/CTS signal. This elimines completely unnecessary I2C/SPI bus traffic. Cease reading from RX FIFO (by disabling RDI interrupt) when throttled. Eventually the FIFO will fill up and the device will drive RTS output inactive. Unthrottle by enabling back RDI interrupt. Indirectly controlling RTS via RX FIFO state seems to be the only option because RTS bit is ignored when hardware flow control is enabled. Signed-off-by: Tomasz Moń Link: https://lore.kernel.org/r/20220301060332.2561851-4-tomasz.mon@camlingroup.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/sc16is7xx.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) commit 21144bab4f1191e01e1cf785720e6af99d86a347 Author: Tomasz Moń Date: Tue Mar 1 07:03:31 2022 +0100 sc16is7xx: Handle modem status lines The uart_handle_cts_change() and uart_handle_dcd_change() must be called with port lock being held. Acquire the lock after reading MSR register. Do not acquire spin lock when reading MSR register because I2C/SPI port functions cannot be called with spinlocks held. Update rng and dsr counters. Wake up delta_msr_wait to allow tty notice modem status change. Co-developed-by: Lech Perczak Co-developed-by: Tomasz Moń Signed-off-by: Lech Perczak Signed-off-by: Tomasz Moń Link: https://lore.kernel.org/r/20220301060332.2561851-3-tomasz.mon@camlingroup.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/sc16is7xx.c | 120 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 114 insertions(+), 6 deletions(-) commit cc4c1d05eb10c3ad4c6315f1897bc56b1e7429aa Author: Tomasz Moń Date: Tue Mar 1 07:03:30 2022 +0100 sc16is7xx: Properly resume TX after stop sc16is7xx_stop_tx() clears THRI bit and thus disables THRI interrupt. This makes it possible for transmission to cease indefinitely when more than 64 characters are being sent. The sc16is7xx_handle_tx() call executed by sc16is7xx_tx_proc() can send up to FIFO length (64) characters. If more characters are written to the output buffer, then the THRI interrupt is needed. Solve the issue by enabling THRI interrupt in sc16is7xx_tx_proc(). Signed-off-by: Tomasz Moń Link: https://lore.kernel.org/r/20220301060332.2561851-2-tomasz.mon@camlingroup.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/sc16is7xx.c | 47 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) commit 16b3ac9041a33fd34990717096476145d08d42fc Author: Greg Kroah-Hartman Date: Tue Mar 1 22:06:50 2022 +0100 Revert "tty: serial: meson: *" This reverts the following commits: 31979060cc07 tty: serial: meson: Fix the compile link error reported by kernel test robot 5427c352a993 tty: serial: meson: Added S4 SOC compatibility 19b2ba0baffc tty: serial: meson: The system stuck when you run the stty command on the console to change the baud rate e5fc2b99840d tty: serial: meson: Make some bit of the REG5 register writable 44023b8e1f14 tty: serial: meson: Describes the calculation of the UART baud rate clock using a clock frame 6436dd8f9b25 tty: serial: meson: Use devm_ioremap_resource to get register mapped memory 841f913e770f tty: serial: meson: Move request the register region to probe They seem to cause lots of problems with existing hardware platforms, and caused build issues, so revert the whole series all at once. Link: https://lore.kernel.org/r/849a95fd-ae81-9a3b-0c06-dd7826af9eb2@baylibre.com Link: https://lore.kernel.org/all/20220225073922.3947-1-yu.tu@amlogic.com/ Reported-by: Marek Szyprowski Reported-by: Jerome Brunet Cc: Neil Armstrong Cc: Yu Tu Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/Kconfig | 1 - drivers/tty/serial/meson_uart.c | 221 ++++++++++++---------------------------- 2 files changed, 67 insertions(+), 155 deletions(-) commit a106848c42b6a0ed4817008373562a4ab67f9e7e Author: Hammer Hsieh Date: Tue Mar 1 12:19:46 2022 +0800 serial: sunplus-uart: Fix compile error while CONFIG_SERIAL_SUNPLUS_CONSOLE=n 1. Fix implicit declaration of function 'wait_for_xmitr' issue. 2. Fix 'sunplus_uart_console' undeclared here issue. 3. Fix use of undeclared identifier 'sunplus_uart_console' issue. Fixes: 9e8d5470325f ("serial: sunplus-uart: Add Sunplus SoC UART Driver") Reported-by: Randy Dunlap Reported-by: kernel test robot Tested-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: Hammer Hsieh Link: https://lore.kernel.org/r/1646108386-29905-1-git-send-email-hammerh0314@gmail.com Signed-off-by: Greg Kroah-Hartman drivers/tty/serial/sunplus-uart.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 966ffbd8615a5c1b0bf474314bbd9ea8eb6ef423 Author: Heiko Carstens Date: Mon Feb 21 21:25:19 2022 +0100 s390/mm: convert pte_val()/pXd_val() into functions Disallow constructs like this: pte_val(*pte) = __pa(addr) | prot; which would directly write into a page table. Users are supposed to use the set_pte()/set_pXd() primitives, which guarantee block concurrent (aka atomic) writes. Reviewed-by: Claudio Imbrenda Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/page.h | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) commit e1fc74ff23463f308709b824eed0d73e0a345f4e Author: Heiko Carstens Date: Mon Feb 21 21:25:09 2022 +0100 s390/mm,gmap: don't use pte_val()/pXd_val() as lvalue Convert pgtable code so pte_val()/pXd_val() aren't used as lvalue anymore. This allows in later step to convert pte_val()/pXd_val() to functions, which in turn makes it impossible to use these macros to modify page table entries like they have been used before. Therefore a construct like this: pte_val(*pte) = __pa(addr) | prot; which would directly write into a page table, isn't possible anymore with the last step of this series. Reviewed-by: Claudio Imbrenda Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/mm/gmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 933b7253adf61eb4b7be2e7b1ec64217a5d8434c Author: Heiko Carstens Date: Mon Feb 21 21:24:51 2022 +0100 s390/mm,hugetlb: don't use pte_val()/pXd_val() as lvalue Convert pgtable code so pte_val()/pXd_val() aren't used as lvalue anymore. This allows in later step to convert pte_val()/pXd_val() to functions, which in turn makes it impossible to use these macros to modify page table entries like they have been used before. Therefore a construct like this: pte_val(*pte) = __pa(addr) | prot; which would directly write into a page table, isn't possible anymore with the last step of this series. Reviewed-by: Claudio Imbrenda Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/mm/hugetlbpage.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) commit 869a9dbc10d25c5544169209fd4284f1f570c233 Author: Heiko Carstens Date: Mon Feb 21 21:24:35 2022 +0100 s390/mm,pageattr: don't use pte_val()/pXd_val() as lvalue Convert pgtable code so pte_val()/pXd_val() aren't used as lvalue anymore. This allows in later step to convert pte_val()/pXd_val() to functions, which in turn makes it impossible to use these macros to modify page table entries like they have been used before. Therefore a construct like this: pte_val(*pte) = __pa(addr) | prot; which would directly write into a page table, isn't possible anymore with the last step of this series. Reviewed-by: Claudio Imbrenda Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/mm/pageattr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) commit 4a366f519a3c8883a6bc24efa710bc0e75bc3558 Author: Heiko Carstens Date: Mon Feb 21 21:24:01 2022 +0100 s390/mm,pgtable: don't use pte_val()/pXd_val() as lvalue Convert pgtable code so pte_val()/pXd_val() aren't used as lvalue anymore. This allows in later step to convert pte_val()/pXd_val() to functions, which in turn makes it impossible to use these macros to modify page table entries like they have been used before. Therefore a construct like this: pte_val(*pte) = __pa(addr) | prot; which would directly write into a page table, isn't possible anymore with the last step of this series. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/pgtable.h | 144 ++++++++++++++++++---------------------- arch/s390/mm/pgtable.c | 22 +++--- 2 files changed, 77 insertions(+), 89 deletions(-) commit b8e3b37900a57f9e7b32a92cb16313b32c41c0db Author: Heiko Carstens Date: Mon Feb 21 20:50:07 2022 +0100 s390/mm: use set_pXd()/set_pte() helper functions everywhere Use the new set_pXd()/set_pte() helper functions at all places where page table entries are modified. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/hugetlb.h | 4 ++-- arch/s390/include/asm/pgalloc.h | 8 ++++---- arch/s390/include/asm/pgtable.h | 18 +++++++++--------- arch/s390/mm/gmap.c | 12 ++++++------ arch/s390/mm/hugetlbpage.c | 2 +- arch/s390/mm/kasan_init.c | 8 ++++---- arch/s390/mm/pageattr.c | 17 +++++++++-------- arch/s390/mm/pgtable.c | 22 +++++++++++----------- arch/s390/mm/vmem.c | 10 +++++----- 9 files changed, 51 insertions(+), 50 deletions(-) commit f29111f117aaafa2887e13923f6e88fc11f5e065 Author: Heiko Carstens Date: Mon Feb 21 21:18:29 2022 +0100 s390/mm: add set_pte_bit()/clear_pte_bit() helper functions Add set_pte_bit()/clear_pte_bit() and set_pXd_bit()/clear_pXd_bit helper functions which are supposed to be used if bits within ptes/pXds are set/cleared. The only point of these helper functions is to get more readable code. This is quite similar to what arm64 has. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/pgtable.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) commit e2aaae2d3677563c1bb6cd15fbddd701381823be Author: Heiko Carstens Date: Thu Feb 10 16:08:29 2022 +0100 s390/mm: add set_pXd()/set_pte() helper functions Add set_pXd()/set_pte() helper functions which must be used to update page table entries. The new helpers use WRITE_ONCE() to make sure that a page table entry is written to only once. Without this the compiler could otherwise generate code which writes several times to a page table entry when updating its contents from invalid to valid, which could lead to surprising results especially for multithreaded processes... Reviewed-by: Claudio Imbrenda Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/include/asm/pgtable.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) commit f0003a9e4c18ae71308fb6b24de8248ac6180777 Author: Vasily Gorbik Date: Fri Feb 25 09:41:24 2022 +0100 s390/entry: remove unused expoline thunk Remove __s390_indirect_jump_r13use_r14 expoline thunk unused since commit fbbdfca5c553 ("s390/entry.S: factor out SIEEXIT macro"). Signed-off-by: Vasily Gorbik arch/s390/kernel/entry.S | 1 - 1 file changed, 1 deletion(-) commit 1a5e3f262e0310365cf7b5c8b8fc3a6e94a19cb7 Author: Heiko Carstens Date: Tue Feb 22 15:27:52 2022 +0100 s390/ftrace: make use of epsw to get psw mask Finally use epsw to create a complete psw mask within pt_regs. Without this only some bits are correct, while other bits are (incorrectly) always zero. The epsw instruction is quite heavy weight, however given that this only effects ftrace_regs_caller this seems to be the right thing, so we finally get a complete psw mask for ftrace kprobed functions. Reviewed-by: Sven Schnelle Acked-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/kernel/mcount.S | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) commit 96f6641a6a284102fe9f52c9789e98f0a18ece11 Author: Heiko Carstens Date: Thu Feb 17 15:46:01 2022 +0100 s390/ptrace: remove opencoded offsetof Remove opencoded offsetof and use offsetof instead. The generated code is identical before/after this change. Reviewed-by: Sven Schnelle Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/kernel/ptrace.c | 164 +++++++++++++++++++++------------------------- 1 file changed, 76 insertions(+), 88 deletions(-) commit 4851d2262236c27cafbecb0fd2440db1f1e726d3 Author: Alexander Gordeev Date: Tue Feb 15 14:10:48 2022 +0100 s390/smp: sort out physical vs virtual pointers usage With commit 5789284710aa ("s390/smp: reallocate IPL CPU lowcore") virtual addresses are wrongly passed to memblock_free_late() and SPX instructions on IPL CPU reinitialization. Note: this does not fix a bug currently, since virtual and physical addresses are identical. Fixes: 5789284710aa ("s390/smp: reallocate IPL CPU lowcore") Reviewed-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Vasily Gorbik arch/s390/kernel/smp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 8944d05f9bbf910c8b241e29a3de114900e31e42 Author: Harald Freudenberger Date: Wed Feb 16 12:30:34 2022 +0100 s390/ap: enable sysfs attribute scans to force AP bus rescan This patch switches the sysfs attribute /sys/bus/ap/scans from read-only to read-write. If there is something written to this attribute, an AP bus rescan is forced. If an AP bus scan is triggered this way a debug feature entry line reports this in /sys/kernel/debug/s390dbf/ap/sprintf. Signed-off-by: Harald Freudenberger Reviewed-by: Jakob Naucke Reviewed-by: Juergen Christ Signed-off-by: Vasily Gorbik drivers/s390/crypto/ap_bus.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit 283915850a4455e8af40ce5b8d291dc79638cdae Author: Tony Krowiak Date: Fri Oct 1 13:39:13 2021 -0400 s390/ap: notify drivers on config changed and scan complete callbacks This patch introduces an extension to the ap bus to notify device drivers when the host AP configuration changes - i.e., adapters, domains or control domains are added or removed. When an adapter or domain is added to the host's AP configuration, the AP bus will create the associated queue devices in the linux sysfs device model. Each new type 10 (i.e., CEX4) or newer queue device with an APQN that is not reserved for the default device driver will get bound to the vfio_ap device driver. Likewise, whan an adapter or domain is removed from the host's AP configuration, the AP bus will remove the associated queue devices from the sysfs device model. Each of the queues that is bound to the vfio_ap device driver will get unbound. With the introduction of hot plug support, binding or unbinding of a queue device will result in plugging or unplugging one or more queues from a guest that is using the queue. If there are multiple changes to the host's AP configuration, it could result in the probe and remove callbacks getting invoked multiple times. Each time queues are plugged into or unplugged from a guest, the guest's VCPUs must be taken out of SIE. If this occurs multiple times due to changes in the host's AP configuration, that can have an undesirable negative affect on the guest's performance. To alleviate this problem, this patch introduces two new callbacks: one to notify the vfio_ap device driver when the AP bus scan routine detects a change to the host's AP configuration; and, one to notify the driver when the AP bus is done scanning. This will allow the vfio_ap driver to do bulk processing of all affected adapters, domains and control domains for affected guests rather than plugging or unplugging them one at a time when the probe or remove callback is invoked. The two new callbacks are: void (*on_config_changed)(struct ap_config_info *new_config_info, struct ap_config_info *old_config_info); This callback is invoked at the start of the AP bus scan function when it determines that the host AP configuration information has changed since the previous scan. This is done by storing an old and current QCI info struct and comparing them. If there is any difference, the callback is invoked. void (*on_scan_complete)(struct ap_config_info *new_config_info, struct ap_config_info *old_config_info); The on_scan_complete callback is invoked after the ap bus scan is completed if the host AP configuration data has changed. Signed-off-by: Tony Krowiak Signed-off-by: Vasily Gorbik drivers/s390/crypto/ap_bus.c | 81 ++++++++++++++++++++++++++++++++++++++++++-- drivers/s390/crypto/ap_bus.h | 12 +++++++ 2 files changed, 91 insertions(+), 2 deletions(-) commit 4f8206b882868b62dc15ddfc0c17bb031876afb5 Author: Tony Krowiak Date: Fri Feb 1 16:21:11 2019 -0500 s390/ap: driver callback to indicate resource in use Introduces a new driver callback to prevent a root user from re-assigning the APQN of a queue that is in use by a non-default host device driver to a default host device driver and vice versa. The callback will be invoked whenever a change to the AP bus's sysfs apmask or aqmask attributes would result in one or more APQNs being re-assigned. If the callback responds in the affirmative for any driver queried, the change to the apmask or aqmask will be rejected with a device busy error. For this patch, only non-default drivers will be queried. Currently, there is only one non-default driver, the vfio_ap device driver. The vfio_ap device driver facilitates pass-through of an AP queue to a guest. The idea here is that a guest may be administered by a different sysadmin than the host and we don't want AP resources to unexpectedly disappear from a guest's AP configuration (i.e., adapters and domains assigned to the matrix mdev). This will enforce the proper procedure for removing AP resources intended for guest usage which is to first unassign them from the matrix mdev, then unbind them from the vfio_ap device driver. Signed-off-by: Tony Krowiak Reviewed-by: Harald Freudenberger Reviewed-by: Halil Pasic Signed-off-by: Vasily Gorbik drivers/s390/crypto/ap_bus.c | 145 ++++++++++++++++++++++++++++++++++++++++--- drivers/s390/crypto/ap_bus.h | 4 ++ 2 files changed, 139 insertions(+), 10 deletions(-) commit 9ba142f472c1e4ec514f3bad1134b6b6ad8f6c13 Author: Vasily Gorbik Date: Thu Feb 3 00:49:41 2022 +0100 s390/test_unwind: fix and extend kprobes test Running kprobe test on a kernel built with clang 14 didn't actually trigger pgm_pre_handler() and no unwinder code was called. Even though do_report_trap() is a global symbol, clang inlined it in several local functions including illegal_op() handler, so that kprobbing a global symbol didn't have a desired effect. To achieve the same test result (unwinding from a program check handler) introduce a local function and probe an instruction in the middle, so that kprobe doesn't take KPROBE_ON_FTRACE path. While at it, add another test for KPROBE_ON_FTRACE. Signed-off-by: Vasily Gorbik arch/s390/lib/test_unwind.c | 83 +++++++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 33 deletions(-) commit 829ec7491c401e4a3068955a438578d2c2ae8acc Author: Vasily Gorbik Date: Mon Jan 31 19:06:52 2022 +0100 s390/test_unwind: add ftrace test Signed-off-by: Vasily Gorbik arch/s390/lib/test_unwind.c | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) commit 8a0c9705502701cc6a5d87d70bc6b631ec939265 Author: Vasily Gorbik Date: Tue Feb 1 21:04:16 2022 +0100 s390/test_unwind: add "backtrace" module parameter By default no backtraces are printed when a test succeeds, but sometimes it is useful to spot issues automated test doesn't cover. Add "backtrace" module parameter to force it. Signed-off-by: Vasily Gorbik arch/s390/lib/test_unwind.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 93bd3232448f699f47d06590aeb56edfebab4495 Author: Vasily Gorbik Date: Mon Jan 31 19:00:56 2022 +0100 s390/test_unwind: minor cleanup - make current_test static - use current_test consistently - add TEST_WITH_FLAGS macro to contract parametrized tests definition Signed-off-by: Vasily Gorbik arch/s390/lib/test_unwind.c | 72 ++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 44 deletions(-) commit 81eac9079663bba7020b58c896baca839a6af8f0 Author: Vasily Gorbik Date: Tue Feb 1 19:54:22 2022 +0100 s390/test_unwind: show tests as skipped if unsupported Signed-off-by: Vasily Gorbik arch/s390/lib/test_unwind.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) commit 42b01a553a56d9bc7c75b700fd274f1ec4a3763f Author: Vasily Gorbik Date: Sat Jan 29 00:34:13 2022 +0100 s390: always use the packed stack layout -mpacked-stack option has been supported by both minimum gcc and clang versions for a while. With commit e2bc3e91d91e ("scripts/min-tool-version.sh: Raise minimum clang version to 13.0.0 for s390") minimum clang version now also supports a combination of flags -mpacked-stack -mbackchain -pg -mfentry and fulfills all requirements to always enable the packed stack layout. Reviewed-by: Heiko Carstens Signed-off-by: Vasily Gorbik arch/s390/Kconfig | 16 +--------------- arch/s390/Makefile | 9 ++------- arch/s390/include/asm/stacktrace.h | 10 +--------- arch/s390/kernel/mcount.S | 6 +----- arch/s390/net/bpf_jit_comp.c | 1 - 5 files changed, 5 insertions(+), 37 deletions(-) commit 9a4f03ad6d67b63e7d2a3fe16c30511f5fb80040 Merge: f413f685c6c0 c194dad21025 Author: Vasily Gorbik Date: Tue Mar 1 21:02:48 2022 +0100 Merge branch 'fixes' into features This helps to avoid several merge conflicts later. * fixes: s390/extable: fix exception table sorting s390/ftrace: fix arch_ftrace_get_regs implementation s390/ftrace: fix ftrace_caller/ftrace_regs_caller generation s390/setup: preserve memory at OLDMEM_BASE and OLDMEM_SIZE s390/cio: verify the driver availability for path_event call s390/module: fix building test_modules_helpers.o with clang MAINTAINERS: downgrade myself to Reviewer for s390 MAINTAINERS: add Alexander Gordeev as maintainer for s390 Signed-off-by: Vasily Gorbik commit 620c803f42defec5c43d3f46cadc101de9aa37ea Author: Andy Shevchenko Date: Thu Feb 24 01:56:22 2022 +0200 ACPI: LPSS: Provide an SSP type to the driver The SPI driver wants to know the exact type of the controller. Provide this information to it, hence allow to fix Intel Wildcat Point case in the future. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki drivers/acpi/acpi_lpss.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) commit f167c1a13879a76efd622e8d857609108ef57162 Author: Andy Shevchenko Date: Thu Feb 24 01:56:21 2022 +0200 ACPI: LPSS: Constify properties member in struct lpss_device_desc The properties are static and not supposed to be modified, constify them. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki drivers/acpi/acpi_lpss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 2cbfae0f50f7a0f8fc9d552bd856f6cd7b7608b6 Author: Andy Shevchenko Date: Thu Feb 24 01:56:20 2022 +0200 ACPI: platform: Constify properties parameter in acpi_create_platform_device() Properties are not and should not be changed in the callee, hence constify properties parameter in acpi_create_platform_device(). Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki drivers/acpi/acpi_platform.c | 2 +- include/linux/acpi.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit d7583c8a57485da19feb6dd85573763a8c5ec1d1 Author: Akhil R Date: Thu Feb 10 21:06:03 2022 +0530 i2c: tegra: Add SMBus block read function Emulate SMBus block read using ContinueXfer to read the length byte Signed-off-by: Akhil R Reviewed-by: Dmitry Osipenko Acked-by: Thierry Reding Signed-off-by: Wolfram Sang drivers/i2c/busses/i2c-tegra.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) commit 023bbde3db41078780f5d57e5354212f974c4bca Author: Vincent Whitchurch Date: Tue Mar 1 15:49:32 2022 +0100 pstore: Add prefix to ECC messages The "No errors detected" message from the ECC code is shown at the end of the pstore log and can be confusing or misleading, especially since it usually appears just after a kernel crash log which normally means quite the opposite of "no errors". Prefix the message to clarify that this message is only about ECC-detected errors. Signed-off-by: Vincent Whitchurch Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220301144932.89549-1-vincent.whitchurch@axis.com fs/pstore/ram_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit e068ef3fd5a3574359b80ff823089ca59057f9c8 Author: Daniele Ceraolo Spurio Date: Mon Feb 14 17:11:23 2022 -0800 drm/i915/guc: Initialize GuC submission locks and queues early Move initialization of submission-related spinlock, lists and workers to init_early. This fixes an issue where if the GuC init fails we might still try to get the lock in the context cleanup code. Note that it is safe to call the GuC context cleanup code even if the init failed because all contexts are initialized with an invalid GuC ID, which will cause the GuC side of the cleanup to be skipped, so it is easier to just make sure the variables are initialized than to special case the cleanup to handle the case when they're not. References: https://gitlab.freedesktop.org/drm/intel/-/issues/4932 Signed-off-by: Daniele Ceraolo Spurio Cc: Matthew Brost Cc: John Harrison Reviewed-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220215011123.734572-1-daniele.ceraolospurio@intel.com drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 27 ++++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) commit 4d558d4d88afcaad01ea20bcfcfb37d904756d2d Merge: 16e769e2ae1f 20f36361b7dd Author: Arnd Bergmann Date: Tue Mar 1 19:24:20 2022 +0100 Merge tag 'qcom-drivers-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers Qualcomm driver updates for v5.18 This refactors the Qualcomm mdt file loader, to partially decouple it from the SCM peripheral-authentication-service. This is needed as newer platforms, such as the Qualcomm SM8450, require the metadata to remain accessible to TrustZone during a longer time. This is followed by the introduction of remoteproc drivers for SM8450 (Snapdragon 8 Gen 1). It changes the way hardware version differences are handled in the LLCC driver and introduces support for Qualcomm SM8450. While updating the dt binding for LLCC it also introduces the missing SM8350 compatible. The ocmem and aoss drivers gains missing put_device() calls and rpmpd gains a missing check for kcalloc() failure. The SPM driver is updated to avoid instantiating the SPM cpuidle devices if the CPUs aren't controlled by SPM, such as when Snapdragon 8916 operates in 32-bit mode without PSCI. The RPM power-domain driver gains MSM8226 support. Lastly the socinfo driver gains knowledge about a few new SoCs and PMICs. * tag 'qcom-drivers-for-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (37 commits) soc: qcom: rpmpd: Add MSM8226 support dt-bindings: power: rpmpd: Add MSM8226 to rpmpd binding soc: qcom: mdt_loader: Fix split-firmware condition dt-bindings: arm: msm: Add LLCC compatible for SM8450 dt-bindings: arm: msm: Add LLCC compatible for SM8350 soc: qcom: llcc: Add configuration data for SM8450 SoC soc: qcom: llcc: Update register offsets for newer LLCC HW soc: qcom: llcc: Add missing llcc configuration data soc: qcom: llcc: Add write-cache cacheable support soc: qcom: llcc: Update the logic for version info extraction soc: qcom: llcc: Add support for 16 ways of allocation soc: qcom: socinfo: Add some more PMICs and SoCs firmware: qcom: scm: Add support for MC boot address API firmware: qcom: scm: Drop cpumask parameter from set_boot_addr() firmware: qcom: scm: Simplify set_cold/warm_boot_addr() cpuidle: qcom-spm: Check if any CPU is managed by SPM remoteproc: qcom: pas: Add SM8450 remoteproc support dt-bindings: remoteproc: qcom: pas: Add SM8450 PAS compatibles remoteproc: qcom: pas: Carry PAS metadata context soc: qcom: mdt_loader: Extract PAS operations ... Link: https://lore.kernel.org/r/20220301042055.1804859-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit c807a335d3b1691028831e723a481efd2ccb52c6 Merge: c687cdc66ffc 156f91f1c49a Author: Arnd Bergmann Date: Tue Mar 1 19:22:16 2022 +0100 Merge tag 'qcom-arm64-defconfig-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/defconfig Qualcomm ARM64 defconfig updates for v5.17 This enables GCC, TLMM pinctrl and the main interconnect provider for the SM8450 platform. * tag 'qcom-arm64-defconfig-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: defconfig: Add SM8450 icc configs arm64: defconfig: Add SM8450 pinctrl config arm64: defconfig: Add SM8450 GCC config Link: https://lore.kernel.org/r/20211222152219.3752973-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 0c8b522d3e3ff1dcd0c32a953a8aeb6d89a59dfe Merge: 86c12c738651 d2febf6bbec5 Author: Marc Zyngier Date: Tue Mar 1 18:21:38 2022 +0000 Merge branch irq/qcom-pdc-cleanup into irq/irqchip-next * irq/qcom-pdc-cleanup: : . : Spring cleanup for the Qualcomm PDC driver, simplifying its : use of irq domains, replacing open-coded functionnalities with : the core code equivalent, and fixing the dodgy locking. : . irqchip/qcom-pdc: Drop open coded version of __assign_bit() irqchip/qcom-pdc: Fix broken locking irqchip/qcom-pdc: Kill qcom_pdc_translate helper irqchip/qcom-pdc: Kill non-wakeup irqdomain irqchip/qcom-pdc: Kill PDC_NO_PARENT_IRQ Signed-off-by: Marc Zyngier commit 55ddcd9f3226b21c5b63d893712c85e85d73f4cb Author: Colin Ian King Date: Tue Mar 1 09:03:27 2022 +0000 powercap: DTPM: Fix spelling mistake "initialze" -> "initialize" There is a spelling mistake in a pr_info() message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Rafael J. Wysocki drivers/powercap/dtpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 5bf19d0aa3d2f22d4c050c030f436ab97b7e6f1e Author: kernel test robot Date: Tue Mar 1 11:28:54 2022 +0800 powercap: DTPM: dtpm_node_callback[] can be static drivers/powercap/dtpm.c:525:22: warning: symbol 'dtpm_node_callback' was not declared. Should it be static? Fixes: 3759ec678e89 ("powercap/drivers/dtpm: Add hierarchy creation") Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Rafael J. Wysocki drivers/powercap/dtpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7a64ca17e4dd50d5f910769167f3553902777844 Author: Randy Dunlap Date: Mon Feb 28 14:05:44 2022 -0800 PM: suspend: fix return value of __setup handler If an invalid option is given for "test_suspend=