AgeCommit message (Collapse)Author
2022-04-02rtc: armada38x: provide set_offset_nsecrtcRussell King
Armada 388 resets the prescaler when the time register is written, so it requires the current second as close to the start of that second as possible. The data sheet is a bit unclear, so this has been confirmed on real hardware. Verified on Armada 388 based Clearfog. Signed-off-by: Russell King <>
2022-04-02rtc: pcf8523: provide set_offset_nsecRussell King
When we set the time, we set the STOP bit, set the time, and then clear the STOP bit. Concerning the timing, the PCF8523 data sheet says: "The first increment of the time circuits is between 0.499878s and 0.500000s after STOP is released." However, practical measurement shows this is not the case - with the I2C bus speed at 100kHz on iMX6, it takes about 5ms for the rtclib call for setting the time to complete. However, reading back when the second actually flips shows that there's an additional 10ms which can't be accounted for by the read - a read of the RTC takes 1.7 to 1.8 ms. Practical measurement shows that the first increment occurs about 515ms after the write, which means we need to set the current second 485ms after it has started. Signed-off-by: Russell King <>
2022-04-02rtc: pre-register hookRussell King
Add a pre-register hook to allow RTC drivers to adjust the default set_offset_nsec value. Signed-off-by: Russell King <>
2022-04-02rtc: add procfs sysctl to control RTC updatesRussell King
Add a procfs sysctl to allow the RTC updates by the NTP code to be disabled. This is necessary if one wishes to adjust the RTC trimming. When performing such an adjustment, one would want to compare the RTC against a good reference. One way to do that is to synchronise the systems own time using NTP, but doing so causes the kernel to set the RTC every 11 minutes. This repeated setting prevents measuring the long-term drift of the RTC, and so prevents any attempt to trim the RTC for better accuracy. This sysctl defaults to enabled, so existing behaviour is preserved. When one wishes to adjust the long-term drift, the RTC update can be disabled via: echo 0 > /proc/sys/kernel/ntp_rtc_sync, the drift measured, and the update subsequently re-enabled. The next update will be triggered by the next successful adjtimex call. Signed-off-by: Russell King <>
2022-04-02rtc: export RTC setting offset via sysfsRussell King
Export the RTC time set offset via sysfs so the value can be read and tweaked as necessary. This is useful when determining the correct setting for a RTC, as it eliminates the need to rebuild/install/reboot from the test cycle. Signed-off-by: Russell King <>
2022-03-20Linux 5.17Linus Torvalds
Signed-off-by: Linus Torvalds <>
2022-03-20Merge tag 'for-linus-5.17' of git:// Torvalds
Pull kvm fix from Paolo Bonzini: "Fix for the SLS mitigation, which makes a 'SETcc/RET' pair grow to 'SETcc/RET/INT3'. This doesn't fit in 4 bytes any more, so the alignment has to change to 8 for this case" * tag 'for-linus-5.17' of git:// kvm/emulate: Fix SETcc emulation function offsets with SLS
2022-03-20Merge branch 'for-linus' of ↵Linus Torvalds
git:// Pull input fixes from Dmitry Torokhov: "Two driver fixes: - a fix for zinitix touchscreen to properly report contacts - a fix for aiptek tablet driver to be more resilient to devices with incorrect descriptors" * 'for-linus' of git:// Input: aiptek - properly check endpoint type Input: zinitix - do not report shadow fingers
2022-03-20kvm/emulate: Fix SETcc emulation function offsets with SLSBorislav Petkov
The commit in Fixes started adding INT3 after RETs as a mitigation against straight-line speculation. The fastop SETcc implementation in kvm's insn emulator uses macro magic to generate all possible SETcc functions and to jump to them when emulating the respective instruction. However, it hardcodes the size and alignment of those functions to 4: a three-byte SETcc insn and a single-byte RET. BUT, with SLS, there's an INT3 that gets slapped after the RET, which brings the whole scheme out of alignment: 15: 0f 90 c0 seto %al 18: c3 ret 19: cc int3 1a: 0f 1f 00 nopl (%rax) 1d: 0f 91 c0 setno %al 20: c3 ret 21: cc int3 22: 0f 1f 00 nopl (%rax) 25: 0f 92 c0 setb %al 28: c3 ret 29: cc int3 and this explodes like this: int3: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 2435 Comm: qemu-system-x86 Not tainted 5.17.0-rc8-sls #1 Hardware name: Dell Inc. Precision WorkStation T3400 /0TP412, BIOS A14 04/30/2012 RIP: 0010:setc+0x5/0x8 [kvm] Code: 00 00 0f 1f 00 0f b6 05 43 24 06 00 c3 cc 0f 1f 80 00 00 00 00 0f 90 c0 c3 cc 0f \ 1f 00 0f 91 c0 c3 cc 0f 1f 00 0f 92 c0 c3 cc <0f> 1f 00 0f 93 c0 c3 cc 0f 1f 00 \ 0f 94 c0 c3 cc 0f 1f 00 0f 95 c0 Call Trace: <TASK> ? x86_emulate_insn [kvm] ? x86_emulate_instruction [kvm] ? vmx_handle_exit [kvm_intel] ? kvm_arch_vcpu_ioctl_run [kvm] ? kvm_vcpu_ioctl [kvm] ? __x64_sys_ioctl ? do_syscall_64 ? entry_SYSCALL_64_after_hwframe </TASK> Raise the alignment value when SLS is enabled and use a macro for that instead of hard-coding naked numbers. Fixes: e463a09af2f0 ("x86: Add straight-line-speculation mitigation") Reported-by: Jamie Heilman <> Signed-off-by: Borislav Petkov <> Acked-by: Peter Zijlstra (Intel) <> Tested-by: Jamie Heilman <> Link: [Add a comment and a bit of safety checking, since this is going to be changed again for IBT support. - Paolo] Signed-off-by: Paolo Bonzini <>
2022-03-19Merge tag 'soc-fixes-5.17-4' of ↵Linus Torvalds
git:// Pull ARM SoC fix from Arnd Bergmann: "Here is one last regression fix for 5.17, reverting a patch that went into 5.16 as a cleanup that ended up breaking external interrupts on Layerscape chips. The revert makes it work again, but also reintroduces a build time warning about the nonstandard DT binding that will have to be dealt with in the future" * tag 'soc-fixes-5.17-4' of git:// Revert "arm64: dts: freescale: Fix 'interrupt-map' parent address cells"
2022-03-19Merge tag 'scsi-fixes' of ↵Linus Torvalds
git:// Pull SCSI fixes from James Bottomley: "Two small(ish) fixes, both in drivers" * tag 'scsi-fixes' of git:// scsi: fnic: Finish scsi_cmnd before dropping the spinlock scsi: mpt3sas: Page fault in reply q processing
2022-03-19Merge tag 'perf-tools-fixes-for-v5.17-2022-03-19' of ↵Linus Torvalds
git:// Pull perf tools fixes from Arnaldo Carvalho de Melo: - Avoid iterating empty evlist, fixing a segfault with 'perf stat --null' - Ignore case in topdown.slots check, fixing issue with Intel Icelake JSON metrics. - Fix symbol size calculation condition for fixing up corner case symbol end address obtained from Kallsyms. * tag 'perf-tools-fixes-for-v5.17-2022-03-19' of git:// perf parse-events: Ignore case in topdown.slots check perf evlist: Avoid iteration for empty evlist. perf symbols: Fix symbol size calculation condition
2022-03-19Merge tag 'char-misc-5.17-final' of ↵Linus Torvalds
git:// Pull char/misc driver fix from Greg KH: "Here is a single driver fix for 5.17-final that has been submitted many times but I somehow missed it in my patch queue: - fix for counter sysfs code for reported problem This has been in linux-next all week with no reported issues" * tag 'char-misc-5.17-final' of git:// counter: Stop using dev_get_drvdata() to get the counter device
2022-03-19Merge tag 'usb-5.17-final' of ↵Linus Torvalds
git:// Pull USB fixes from Greg KH: "Here are some small remaining USB fixes for 5.17-final. They include: - two USB gadget driver fixes for reported problems - usbtmc driver fix for syzbot found issues - musb patch partial revert to resolve a reported regression. All of these have been in linux-next this week with no reported problems" * tag 'usb-5.17-final' of git:// usb: gadget: Fix use-after-free bug by not setting udc->dev.driver usb: usbtmc: Fix bug in pipe direction for control transfers partially Revert "usb: musb: Set the DT node on the child device" usb: gadget: rndis: prevent integer overflow in rndis_set_response()
2022-03-18perf parse-events: Ignore case in topdown.slots checkIan Rogers
An issue with icelakex metrics: That causes the slots not to be first. Fixes: 94dbfd6781a0e87b ("perf parse-events: Architecture specific leader override") Reported-by: Caleb Biggers <> 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 <> Cc: Zhengjun Xing <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
2022-03-18perf evlist: Avoid iteration for empty evlist.Ian Rogers
As seen with 'perf stat --null ..' and reported in: v2. Avoids setting evsel in the empty list case as suggested by Jiri Olsa. Committer testing: Before: $ perf stat --null sleep 1 Segmentation fault (core dumped) $ After: $ perf stat --null sleep 1 Performance counter stats for 'sleep 1': 1.010340646 seconds time elapsed 0.001420000 seconds user 0.000000000 seconds sys $ Fixes: 472832d2c000b961 ("perf evlist: Refactor evlist__for_each_cpu()") Reported-by: Arnaldo Carvalho de Melo <> Signed-off-by: Ian Rogers <> Tested-by: Arnaldo Carvalho de Melo <> Acked-by: Jiri Olsa <> Cc: Adrian Hunter <> Cc: Ian Rogers <> Cc: Namhyung Kim <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
2022-03-18perf symbols: Fix symbol size calculation conditionMichael Petlan
Before this patch, the symbol end address fixup to be called, needed two conditions being met: if (prev->end == prev->start && prev->end != curr->start) Where "prev->end == prev->start" means that prev is zero-long (and thus needs a fixup) and "prev->end != curr->start" means that fixup hasn't been applied yet However, this logic is incorrect in the following situation: *curr = {rb_node = {__rb_parent_color = 278218928, rb_right = 0x0, rb_left = 0x0}, start = 0xc000000000062354, end = 0xc000000000062354, namelen = 40, type = 2 '\002', binding = 0 '\000', idle = 0 '\000', ignore = 0 '\000', inlined = 0 '\000', arch_sym = 0 '\000', annotate2 = false, name = 0x1159739e "kprobe_optinsn_page\t[__builtin__kprobes]"} *prev = {rb_node = {__rb_parent_color = 278219041, rb_right = 0x109548b0, rb_left = 0x109547c0}, start = 0xc000000000062354, end = 0xc000000000062354, namelen = 12, type = 2 '\002', binding = 1 '\001', idle = 0 '\000', ignore = 0 '\000', inlined = 0 '\000', arch_sym = 0 '\000', annotate2 = false, name = 0x1095486e "optinsn_slot"} In this case, prev->start == prev->end == curr->start == curr->end, thus the condition above thinks that "we need a fixup due to zero length of prev symbol, but it has been probably done, since the prev->end == curr->start", which is wrong. After the patch, the execution path proceeds to arch__symbols__fixup_end function which fixes up the size of prev symbol by adding page_size to its end offset. Fixes: 3b01a413c196c910 ("perf symbols: Improve kallsyms symbol end addr calculation") Signed-off-by: Michael Petlan <> Cc: Athira Jajeev <> Cc: Jiri Olsa <> Cc: Kajol Jain <> Cc: Madhavan Srinivasan <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
2022-03-18Merge tag 'arm64-fixes' of ↵Linus Torvalds
git:// Pull arm64 fixes from Catalin Marinas: "Fix two compiler warnings introduced by recent commits: pointer arithmetic and double initialisation of struct field" * tag 'arm64-fixes' of git:// arm64: errata: avoid duplicate field initializer arm64: fix clang warning about TRAMP_VALIAS
2022-03-18Merge tag '5.17-rc8-smb3-fix' of git:// Torvalds
Pull cifs fix from Steve French: "Small fix for regression in multiuser mounts. The additional improvements suggested by Ronnie to make the server and session status handling code easier to read can wait for the 5.18 merge window." * tag '5.17-rc8-smb3-fix' of git:// smb3: fix incorrect session setup check for multiuser mounts
2022-03-18Merge tag 'block-5.17-2022-03-18' of git:// Torvalds
Pull block fixes from Jens Axboe: - Revert of a nvme target feature (Hannes) - Fix a memory leak with rq-qos (Ming) * tag 'block-5.17-2022-03-18' of git:// nvmet: revert "nvmet: make discovery NQN configurable" block: release rq qos structures for queue without disk
2022-03-18Merge tag 'drm-fixes-2022-03-18' of git:// Torvalds
Pull drm fixes from Dave Airlie: "A few minor changes to finish things off, one mgag200 regression, imx fix and couple of panel changes. imx: - Don't test bus flags in atomic check mgag200: - Fix PLL setup on some models panel: - Fix bpp settings on Innolux G070Y2-L01 - Fix DRM_PANEL_EDP Kconfig dependencies" * tag 'drm-fixes-2022-03-18' of git:// drm: Don't make DRM_PANEL_BRIDGE dependent on DRM_KMS_HELPERS drm/panel: simple: Fix Innolux G070Y2-L01 BPP settings drm/imx: parallel-display: Remove bus flags check in imx_pd_bridge_atomic_check() drm/mgag200: Fix PLL setup for g200wb and g200ew
2022-03-18arm64: errata: avoid duplicate field initializerArnd Bergmann
The '.type' field is initialized both in place and in the macro as reported by this W=1 warning: arch/arm64/include/asm/cpufeature.h:281:9: error: initialized field overwritten [-Werror=override-init] 281 | (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU) | ^ arch/arm64/kernel/cpu_errata.c:136:17: note: in expansion of macro 'ARM64_CPUCAP_LOCAL_CPU_ERRATUM' 136 | .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/cpu_errata.c:145:9: note: in expansion of macro 'ERRATA_MIDR_RANGE' 145 | ERRATA_MIDR_RANGE(m, var, r_min, var, r_max) | ^~~~~~~~~~~~~~~~~ arch/arm64/kernel/cpu_errata.c:613:17: note: in expansion of macro 'ERRATA_MIDR_REV_RANGE' 613 | ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2), | ^~~~~~~~~~~~~~~~~~~~~ arch/arm64/include/asm/cpufeature.h:281:9: note: (near initialization for 'arm64_errata[18].type') 281 | (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU) | ^ Remove the extranous initializer. Signed-off-by: Arnd Bergmann <> Fixes: 1dd498e5e26a ("KVM: arm64: Workaround Cortex-A510's single-step and PAC trap errata") Link: Signed-off-by: Catalin Marinas <>
2022-03-18arm64: fix clang warning about TRAMP_VALIASArnd Bergmann
The newly introduced TRAMP_VALIAS definition causes a build warning with clang-14: arch/arm64/include/asm/vectors.h:66:31: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic] return (char *)TRAMP_VALIAS + SZ_2K * slot; Change the addition to something clang does not complain about. Fixes: bd09128d16fa ("arm64: Add percpu vectors for EL1") Signed-off-by: Arnd Bergmann <> Acked-by: James Morse <> Link: Signed-off-by: Catalin Marinas <>
2022-03-18Merge tag 'drm-misc-fixes-2022-03-17' of ↵Dave Airlie
git:// into drm-fixes * drm/imx: Don't test bus flags in atomic check * drm/mgag200: Fix PLL setup on some models * drm/panel: Fix bpp settings on Innolux G070Y2-L01; Fix DRM_PANEL_EDP Kconfig dependencies Signed-off-by: Dave Airlie <> From: Thomas Zimmermann <> Link:
2022-03-17Merge tag 'net-5.17-final' of ↵Linus Torvalds
git:// Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, ipsec, and wireless. A few last minute revert / disable and fix patches came down from our sub-trees. We're not waiting for any fixes at this point. Current release - regressions: - Revert "netfilter: nat: force port remap to prevent shadowing well-known ports", restore working conntrack on asymmetric paths - Revert "ath10k: drop beacon and probe response which leak from other channel", restore working AP and mesh mode on QCA9984 - eth: intel: fix hang during reboot/shutdown Current release - new code bugs: - netfilter: nf_tables: disable register tracking, it needs more work to cover all corner cases Previous releases - regressions: - ipv6: fix skb_over_panic in __ip6_append_data when (admin-only) extension headers get specified - esp6: fix ESP over TCP/UDP, interpret ipv6_skip_exthdr's return value more selectively - bnx2x: fix driver load failure when FW not present in initrd Previous releases - always broken: - vsock: stop destroying unrelated sockets in nested virtualization - packet: fix slab-out-of-bounds access in packet_recvmsg() Misc: - add Paolo Abeni to networking maintainers!" * tag 'net-5.17-final' of git:// (26 commits) iavf: Fix hang during reboot/shutdown net: mscc: ocelot: fix backwards compatibility with single-chain tc-flower offload net: bcmgenet: skip invalid partial checksums bnx2x: fix built-in kernel driver load failure net: phy: mscc: Add MODULE_FIRMWARE macros net: dsa: Add missing of_node_put() in dsa_port_parse_of net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit() Revert "ath10k: drop beacon and probe response which leak from other channel" hv_netvsc: Add check for kvmalloc_array iavf: Fix double free in iavf_reset_task ice: destroy flow director filter mutex after releasing VSIs ice: fix NULL pointer dereference in ice_update_vsi_tx_ring_stats() Add Paolo Abeni to networking maintainers atm: eni: Add check for dma_map_single net/packet: fix slab-out-of-bounds access in packet_recvmsg() net: mdio: mscc-miim: fix duplicate debugfs entry net: phy: marvell: Fix invalid comparison in the resume and suspend functions esp6: fix check on ipv6_skip_exthdr's return value net: dsa: microchip: add spi_device_id tables netfilter: nf_tables: disable register tracking ...
2022-03-17Merge tag 'acpi-5.17-rc9' of ↵Linus Torvalds
git:// Pull ACPI fix from Rafael Wysocki: "Revert recent commit that caused multiple systems to misbehave due to firmware issues" * tag 'acpi-5.17-rc9' of git:// Revert "ACPI: scan: Do not add device IDs from _CID if _HID is not valid"
2022-03-17Merge branch 'akpm' (patches from Andrew)Linus Torvalds
Merge misc fixes from Andrew Morton: "Four patches. Subsystems affected by this patch series: mm/swap, kconfig, ocfs2, and selftests" * emailed patches from Andrew Morton <>: selftests: vm: fix clang build error multiple output files ocfs2: fix crash when initialize filecheck kobj fails configs/debug: restore DEBUG_INFO=y for overriding mm: swap: get rid of livelock in swapin readahead
2022-03-17selftests: vm: fix clang build error multiple output filesYosry Ahmed
When building the vm selftests using clang, some errors are seen due to having headers in the compilation command: clang -Wall -I ../../../../usr/include -no-pie gup_test.c ../../../../mm/gup_test.h -lrt -lpthread -o .../tools/testing/selftests/vm/gup_test clang: error: cannot specify -o when generating multiple output files make[1]: *** [../ .../tools/testing/selftests/vm/gup_test] Error 1 Rework to add the header files to LOCAL_HDRS before including ../, since the dependency is evaluated in '$(OUTPUT)/%:%.c $(LOCAL_HDRS)' in file Link: Signed-off-by: Yosry Ahmed <> Cc: Shuah Khan <> Cc: Nathan Chancellor <> Cc: Nick Desaulniers <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2022-03-17ocfs2: fix crash when initialize filecheck kobj failsJoseph Qi
Once s_root is set, genric_shutdown_super() will be called if fill_super() fails. That means, we will call ocfs2_dismount_volume() twice in such case, which can lead to kernel crash. Fix this issue by initializing filecheck kobj before setting s_root. Link: Fixes: 5f483c4abb50 ("ocfs2: add kobject for online file check") Signed-off-by: Joseph Qi <> Cc: Mark Fasheh <> Cc: Joel Becker <> Cc: Junxiao Bi <> Cc: Changwei Ge <> Cc: Gang He <> Cc: Jun Piao <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2022-03-17configs/debug: restore DEBUG_INFO=y for overridingQian Cai
Previously, I failed to realize that Kees' patch [1] has not been merged into the mainline yet, and dropped DEBUG_INFO=y too eagerly from the mainline. As the results, "make debug.config" won't be able to flip DEBUG_INFO=n from the existing .config. This should close the gaps of a few weeks before Kees' patch is there, and work regardless of their merging status anyway. Link: [1] Link: Signed-off-by: Qian Cai <> Reported-by: Daniel Thompson <> Reviewed-by: Daniel Thompson <> Cc: Kees Cook <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2022-03-17mm: swap: get rid of livelock in swapin readaheadGuo Ziliang
In our testing, a livelock task was found. Through sysrq printing, same stack was found every time, as follows: __swap_duplicate+0x58/0x1a0 swapcache_prepare+0x24/0x30 __read_swap_cache_async+0xac/0x220 read_swap_cache_async+0x58/0xa0 swapin_readahead+0x24c/0x628 do_swap_page+0x374/0x8a0 __handle_mm_fault+0x598/0xd60 handle_mm_fault+0x114/0x200 do_page_fault+0x148/0x4d0 do_translation_fault+0xb0/0xd4 do_mem_abort+0x50/0xb0 The reason for the livelock is that swapcache_prepare() always returns EEXIST, indicating that SWAP_HAS_CACHE has not been cleared, so that it cannot jump out of the loop. We suspect that the task that clears the SWAP_HAS_CACHE flag never gets a chance to run. We try to lower the priority of the task stuck in a livelock so that the task that clears the SWAP_HAS_CACHE flag will run. The results show that the system returns to normal after the priority is lowered. In our testing, multiple real-time tasks are bound to the same core, and the task in the livelock is the highest priority task of the core, so the livelocked task cannot be preempted. Although cond_resched() is used by __read_swap_cache_async, it is an empty function in the preemptive system and cannot achieve the purpose of releasing the CPU. A high-priority task cannot release the CPU unless preempted by a higher-priority task. But when this task is already the highest priority task on this core, other tasks will not be able to be scheduled. So we think we should replace cond_resched() with schedule_timeout_uninterruptible(1), schedule_timeout_interruptible will call set_current_state first to set the task state, so the task will be removed from the running queue, so as to achieve the purpose of giving up the CPU and prevent it from running in kernel mode for too long. (akpm: ugly hack becomes uglier. But it fixes the issue in a backportable-to-stable fashion while we hopefully work on something better) Link: Signed-off-by: Guo Ziliang <> Reported-by: Zeal Robot <> Reviewed-by: Ran Xiaokai <> Reviewed-by: Jiang Xuexin <> Reviewed-by: Yang Yang <> Acked-by: Hugh Dickins <> Cc: Naoya Horiguchi <> Cc: Michal Hocko <> Cc: Minchan Kim <> Cc: Johannes Weiner <> Cc: Roger Quadros <> Cc: Ziliang Guo <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
2022-03-17iavf: Fix hang during reboot/shutdownIvan Vecera
Recent commit 974578017fc1 ("iavf: Add waiting so the port is initialized in remove") adds a wait-loop at the beginning of iavf_remove() to ensure that port initialization is finished prior unregistering net device. This causes a regression in reboot/shutdown scenario because in this case callback iavf_shutdown() is called and this callback detaches the device, makes it down if it is running and sets its state to __IAVF_REMOVE. Later shutdown callback of associated PF driver (e.g. ice_shutdown) is called. That callback calls among other things sriov_disable() that calls indirectly iavf_remove() (see stack trace below). As the adapter state is already __IAVF_REMOVE then the mentioned loop is end-less and shutdown process hangs. The patch fixes this by checking adapter's state at the beginning of iavf_remove() and skips the rest of the function if the adapter is already in remove state (shutdown is in progress). Reproducer: 1. Create VF on PF driven by ice or i40e driver 2. Ensure that the VF is bound to iavf driver 3. Reboot [52625.981294] sysrq: SysRq : Show Blocked State [52625.988377] task:reboot state:D stack: 0 pid:17359 ppid: 1 f2 [52625.996732] Call Trace: [52625.999187] __schedule+0x2d1/0x830 [52626.007400] schedule+0x35/0xa0 [52626.010545] schedule_hrtimeout_range_clock+0x83/0x100 [52626.020046] usleep_range+0x5b/0x80 [52626.023540] iavf_remove+0x63/0x5b0 [iavf] [52626.027645] pci_device_remove+0x3b/0xc0 [52626.031572] device_release_driver_internal+0x103/0x1f0 [52626.036805] pci_stop_bus_device+0x72/0xa0 [52626.040904] pci_stop_and_remove_bus_device+0xe/0x20 [52626.045870] pci_iov_remove_virtfn+0xba/0x120 [52626.050232] sriov_disable+0x2f/0xe0 [52626.053813] ice_free_vfs+0x7c/0x340 [ice] [52626.057946] ice_remove+0x220/0x240 [ice] [52626.061967] ice_shutdown+0x16/0x50 [ice] [52626.065987] pci_device_shutdown+0x34/0x60 [52626.070086] device_shutdown+0x165/0x1c5 [52626.074011] kernel_restart+0xe/0x30 [52626.077593] __do_sys_reboot+0x1d2/0x210 [52626.093815] do_syscall_64+0x5b/0x1a0 [52626.097483] entry_SYSCALL_64_after_hwframe+0x65/0xca Fixes: 974578017fc1 ("iavf: Add waiting so the port is initialized in remove") Signed-off-by: Ivan Vecera <> Link: Signed-off-by: Jakub Kicinski <>
2022-03-17net: mscc: ocelot: fix backwards compatibility with single-chain tc-flower ↵Vladimir Oltean
offload ACL rules can be offloaded to VCAP IS2 either through chain 0, or, since the blamed commit, through a chain index whose number encodes a specific PAG (Policy Action Group) and lookup number. The chain number is translated through ocelot_chain_to_pag() into a PAG, and through ocelot_chain_to_lookup() into a lookup number. The problem with the blamed commit is that the above 2 functions don't have special treatment for chain 0. So ocelot_chain_to_pag(0) returns filter->pag = 224, which is in fact -32, but the "pag" field is an u8. So we end up programming the hardware with VCAP IS2 entries having a PAG of 224. But the way in which the PAG works is that it defines a subset of VCAP IS2 filters which should match on a packet. The default PAG is 0, and previous VCAP IS1 rules (which we offload using 'goto') can modify it. So basically, we are installing filters with a PAG on which no packet will ever match. This is the hardware equivalent of adding filters to a chain which has no 'goto' to it. Restore the previous functionality by making ACL filters offloaded to chain 0 go to PAG 0 and lookup number 0. The choice of PAG is clearly correct, but the choice of lookup number isn't "as before" (which was to leave the lookup a "don't care"). However, lookup 0 should be fine, since even though there are ACL actions (policers) which have a requirement to be used in a specific lookup, that lookup is 0. Fixes: 226e9cd82a96 ("net: mscc: ocelot: only install TCAM entries into a specific lookup and PAG") Signed-off-by: Vladimir Oltean <> Link: Signed-off-by: Jakub Kicinski <>
2022-03-17net: bcmgenet: skip invalid partial checksumsDoug Berger
The RXCHK block will return a partial checksum of 0 if it encounters a problem while receiving a packet. Since a 1's complement sum can only produce this result if no bits are set in the received data stream it is fair to treat it as an invalid partial checksum and not pass it up the stack. Fixes: 810155397890 ("net: bcmgenet: use CHECKSUM_COMPLETE for NETIF_F_RXCSUM") Signed-off-by: Doug Berger <> Acked-by: Florian Fainelli <> Link: Signed-off-by: Jakub Kicinski <>
2022-03-17bnx2x: fix built-in kernel driver load failureManish Chopra
Commit b7a49f73059f ("bnx2x: Utilize firmware") added request_firmware() logic in probe() which caused load failure when firmware file is not present in initrd (below), as access to firmware file is not feasible during probe. Direct firmware load for bnx2x/bnx2x-e2- failed with error -2 Direct firmware load for bnx2x/bnx2x-e2- failed with error -2 This patch fixes this issue by - 1. Removing request_firmware() logic from the probe() such that .ndo_open() handle it as it used to handle it earlier 2. Given request_firmware() is removed from probe(), so driver has to relax FW version comparisons a bit against the already loaded FW version (by some other PFs of same adapter) to allow different compatible/close enough FWs with which multiple PFs may run with (in different environments), as the given PF who is in probe flow has no idea now with which firmware file version it is going to initialize the device in ndo_open() Link: Reported-by: Paul Menzel <> Tested-by: Paul Menzel <> Fixes: b7a49f73059f ("bnx2x: Utilize firmware") Signed-off-by: Manish Chopra <> Signed-off-by: Ariel Elior <> Link: Signed-off-by: Jakub Kicinski <>
2022-03-17net: phy: mscc: Add MODULE_FIRMWARE macrosJuerg Haefliger
The driver requires firmware so define MODULE_FIRMWARE so that modinfo provides the details. Fixes: fa164e40c53b ("net: phy: mscc: split the driver into separate files") Signed-off-by: Juerg Haefliger <> Link: Signed-off-by: Jakub Kicinski <>
2022-03-17net: dsa: Add missing of_node_put() in dsa_port_parse_ofMiaoqian Lin
The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: 6d4e5c570c2d ("net: dsa: get port type at parse time") Signed-off-by: Miaoqian Lin <> Link: Signed-off-by: Paolo Abeni <>
2022-03-17drm: Don't make DRM_PANEL_BRIDGE dependent on DRM_KMS_HELPERSThomas Zimmermann
Fix a number of undefined references to drm_kms_helper.ko in drm_dp_helper.ko: arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_mst_duplicate_state': drm_dp_mst_topology.c:(.text+0x2df0): undefined reference to `__drm_atomic_helper_private_obj_duplicate_state' arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_delayed_destroy_work': drm_dp_mst_topology.c:(.text+0x370c): undefined reference to `drm_kms_helper_hotplug_event' arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_mst_up_req_work': drm_dp_mst_topology.c:(.text+0x7938): undefined reference to `drm_kms_helper_hotplug_event' arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_mst_link_probe_work': drm_dp_mst_topology.c:(.text+0x82e0): undefined reference to `drm_kms_helper_hotplug_event' This happens if panel-edp.ko has been configured with DRM_PANEL_EDP=y DRM_DP_HELPER=y DRM_KMS_HELPER=m which builds DP helpers into the kernel and KMS helpers sa a module. Making DRM_PANEL_EDP select DRM_KMS_HELPER resolves this problem. To avoid a resulting cyclic dependency with DRM_PANEL_BRIDGE, don't make the latter depend on DRM_KMS_HELPER and fix the one DRM bridge drivers that doesn't already select DRM_KMS_HELPER. As KMS helpers cannot be selected directly by the user, config symbols should avoid depending on it anyway. Signed-off-by: Thomas Zimmermann <> Fixes: 3755d35ee1d2 ("drm/panel: Select DRM_DP_HELPER for DRM_PANEL_EDP") Acked-by: Sam Ravnborg <> Tested-by: Brian Masney <> Reported-by: kernel test robot <> Cc: Thomas Zimmermann <> Cc: Naresh Kamboju <> Cc: Linux Kernel Functional Testing <> Cc: Lyude Paul <> Cc: Sam Ravnborg <> Cc: Daniel Vetter <> Cc: Maarten Lankhorst <> Cc: Maxime Ripard <> Cc: Cc: Dave Airlie <> Cc: Thierry Reding <> Link:
2022-03-17Merge drm/drm-fixes into drm-misc-fixesThomas Zimmermann
Backmerging drm/drm-fixes for commit 3755d35ee1d2 ("drm/panel: Select DRM_DP_HELPER for DRM_PANEL_EDP"). Signed-off-by: Thomas Zimmermann <>
2022-03-16smb3: fix incorrect session setup check for multiuser mountsSteve French
A recent change to how the SMB3 server (socket) and session status is managed regressed multiuser mounts by changing the check for whether session setup is needed to the socket (TCP_Server_info) structure instead of the session struct (cifs_ses). Add additional check in cifs_setup_sesion to fix this. Fixes: 73f9bfbe3d81 ("cifs: maintain a state machine for tcp/smb/tcon sessions") Reported-by: Ronnie Sahlberg <> Acked-by: Ronnie Sahlberg <> Reviewed-by: Shyam Prasad N <> Signed-off-by: Steve French <>
2022-03-16net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit()Nicolas Dichtel
This kind of interface doesn't have a mac header. This patch fixes bpf_redirect() to a PIM interface. Fixes: 27b29f63058d ("bpf: add bpf_redirect() helper") Signed-off-by: Nicolas Dichtel <> Link: Signed-off-by: Jakub Kicinski <>
2022-03-16Merge tag 'efi-urgent-for-v5.17-3' of ↵Linus Torvalds
git:// Pull EFI fix from Ard Biesheuvel: "Avoid spurious warnings about unknown boot parameters" * tag 'efi-urgent-for-v5.17-3' of git:// efi: fix return value of __setup handlers
2022-03-16Merge branch 'linus' of ↵Linus Torvalds
git:// Pull crypto fix from Herbert Xu: "This fixes a bug where qcom-rng can return a buffer that is not completely filled with random data" * 'linus' of git:// crypto: qcom-rng - ensure buffer for generate is completely filled
2022-03-16Revert "arm64: dts: freescale: Fix 'interrupt-map' parent address cells"Vladimir Oltean
This reverts commit 869f0ec048dc8fd88c0b2003373bd985795179fb. That updated the expected device tree binding format for the ls-extirq driver, without also updating the parsing code (ls_extirq_parse_map) to the new format. The context is that the ls-extirq driver uses the standard "interrupt-map" OF property in a non-standard way, as suggested by Rob Herring during review: This has turned out to be problematic, as Marc Zyngier discovered through commit 041284181226 ("of/irq: Allow matching of an interrupt-map local to an interrupt controller"), later fixed through commit de4adddcbcc2 ("of/irq: Add a quirk for controllers with their own definition of interrupt-map"). Marc's position, expressed on multiple opportunities, is that: (a) [ making private use of the reserved "interrupt-map" name in a driver ] "is wrong, by the very letter of what an interrupt-map means. If the interrupt map points to an interrupt controller, that's the target for the interrupt." (b) [ updating the driver's bindings to accept a non-reserved name for this property, as an alternative, is ] "is totally pointless. These machines have been in the wild for years, and existing DTs will be there *forever*." Considering the above, the Linux kernel has quirks in place to deal with the ls-extirq's non-standard use of the "interrupt-map". These quirks may be needed in other operating systems that consume this device tree, yet this is seen as the only viable solution. Therefore, the premise of the patch being reverted here is invalid. It doesn't matter whether the driver, in its non-standard use of the property, complies to the standard format or not, since this property isn't expected to be used for interrupt translation by the core. This change restores LS1088A, LS2088A/LS2085A and LX2160A to their previous bindings, which allows these systems to continue to use external interrupt lines with the correct polarity. Fixes: 869f0ec048dc ("arm64: dts: freescale: Fix 'interrupt-map' parent address cells") Signed-off-by: Vladimir Oltean <> Acked-by: Marc Zyngier <> Signed-off-by: Arnd Bergmann <>
2022-03-16Merge branch 'master' of ↵Jakub Kicinski
git:// Steffen Klassert says: ==================== pull request (net): ipsec 2022-03-16 1) Fix a kernel-info-leak in pfkey. From Haimin Zhang. 2) Fix an incorrect check of the return value of ipv6_skip_exthdr. From Sabrina Dubroca. * 'master' of git:// esp6: fix check on ipv6_skip_exthdr's return value af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register ==================== Link: Signed-off-by: Jakub Kicinski <>
2022-03-16Merge tag 'wireless-2022-03-16' of ↵Jakub Kicinski
git:// Kalle Valo says: ==================== wireless fixes for v5.17 Third set of fixes for v5.17. We have only one revert to fix an ath10k regression. * tag 'wireless-2022-03-16' of git:// Revert "ath10k: drop beacon and probe response which leak from other channel" ==================== Link: Signed-off-by: Jakub Kicinski <>
2022-03-16drm/panel: simple: Fix Innolux G070Y2-L01 BPP settingsMarek Vasut
The Innolux G070Y2-L01 supports two modes of operation: 1) FRC=Low/NC ... MEDIA_BUS_FMT_RGB666_1X7X3_SPWG ... BPP=6 2) FRC=High ..... MEDIA_BUS_FMT_RGB888_1X7X4_SPWG ... BPP=8 Currently the panel description mixes both, BPP from 1) and bus format from 2), which triggers a warning at panel-simple.c:615. Pick the later, set bpp=8, fix the warning. Fixes: a5d2ade627dca ("drm/panel: simple: Add support for Innolux G070Y2-L01") Signed-off-by: Marek Vasut <> Cc: Christoph Fritz <> Cc: Laurent Pinchart <> Cc: Maxime Ripard <> Cc: Sam Ravnborg <> Cc: Thomas Zimmermann <> Reviewed-by: Laurent Pinchart <> Link: Signed-off-by: Maarten Lankhorst <>
2022-03-16drm/imx: parallel-display: Remove bus flags check in ↵Christoph Niedermaier
imx_pd_bridge_atomic_check() If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this check was introduced. So remove the bus flags check, because it stops the initialization of the display with valid bus flags. Fixes: fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when available") Signed-off-by: Christoph Niedermaier <> Cc: Marek Vasut <> Cc: Boris Brezillon <> 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 <> Cc: To: Tested-by: Max Krummenacher <> Acked-by: Boris Brezillon <> Signed-off-by: Marek Vasut <> Link: Signed-off-by: Maarten Lankhorst <>
2022-03-16Merge tag 'nvme-5.17-2022-03-16' of git:// into block-5.17Jens Axboe
Pull NVMe fix from Christoph: "nvme fix for Linux 5.17 - last minute revert of a nvmet feature added in Linux 5.16 (Hannes Reinecke)" * tag 'nvme-5.17-2022-03-16' of git:// nvmet: revert "nvmet: make discovery NQN configurable"
2022-03-16Revert "ath10k: drop beacon and probe response which leak from other channel"Kalle Valo
This reverts commit 3bf2537ec2e33310b431b53fd84be8833736c256. I was reported privately that this commit breaks AP and mesh mode on QCA9984 (firmware 10.4- So revert the commit to fix the regression. There was a conflict due to cfg80211 API changes but that was easy to fix. Fixes: 3bf2537ec2e3 ("ath10k: drop beacon and probe response which leak from other channel") Signed-off-by: Kalle Valo <> Link: