Skip to content
  1. Mar 22, 2022
    • Linus Torvalds's avatar
      Merge tag 'x86_build_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e10821b8
      Linus Torvalds authored
      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
      e10821b8
    • Linus Torvalds's avatar
      Merge tag 'x86_misc_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 22687350
      Linus Torvalds authored
      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
      22687350
    • Linus Torvalds's avatar
      Merge tag 'x86_cpu_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · d752e211
      Linus Torvalds authored
      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
      d752e211
    • Linus Torvalds's avatar
      Merge tag 'edac_updates_for_v5.18_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras · 5e891917
      Linus Torvalds authored
      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
      5e891917
    • Linus Torvalds's avatar
      Merge tag 'm68k-for-v5.18-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k · 1b74b460
      Linus Torvalds authored
      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
      1b74b460
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm · 90ea15b7
      Linus Torvalds authored
      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
      90ea15b7
    • Linus Torvalds's avatar
      Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 356a1adc
      Linus Torvalds authored
      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 <linux/personality.h>
        arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones
        ...
      356a1adc
    • Linus Torvalds's avatar
      Merge tag 'tpmdd-next-v5.18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd · 9d8e7007
      Linus Torvalds authored
      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
        ...
      9d8e7007
  2. Mar 21, 2022
  3. Mar 20, 2022
  4. Mar 19, 2022
  5. Mar 18, 2022
    • Arnd Bergmann's avatar
      arm64: errata: avoid duplicate field initializer · 316e46f6
      Arnd Bergmann authored
      
      
      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: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 1dd498e5 ("KVM: arm64: Workaround Cortex-A510's single-step and PAC trap errata")
      Link: https://lore.kernel.org/r/20220316183800.1546731-1-arnd@kernel.org
      
      
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      316e46f6
    • Arnd Bergmann's avatar
      arm64: fix clang warning about TRAMP_VALIAS · 7f34b43e
      Arnd Bergmann authored
      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: bd09128d
      
       ("arm64: Add percpu vectors for EL1")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarJames Morse <james.morse@arm.com>
      Link: https://lore.kernel.org/r/20220316183833.1563139-1-arnd@kernel.org
      
      
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      7f34b43e
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2022-03-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · ca5a5761
      Dave Airlie authored
      
      
       * 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: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/YjMNcqOuDFDoe+EN@linux-uq9g
      ca5a5761
    • Linus Torvalds's avatar
      Merge tag 'net-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 551acdc3
      Linus Torvalds authored
      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://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (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
        ...
      551acdc3
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.17-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · c81801eb
      Linus Torvalds authored
      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://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        Revert "ACPI: scan: Do not add device IDs from _CID if _HID is not valid"
      c81801eb
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 2ab99e54
      Linus Torvalds authored
      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 <akpm@linux-foundation.org>:
        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
      2ab99e54
    • Yosry Ahmed's avatar
      selftests: vm: fix clang build error multiple output files · 1c4debc4
      Yosry Ahmed authored
      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]: *** [../lib.mk:146: .../tools/testing/selftests/vm/gup_test] Error 1
      
      Rework to add the header files to LOCAL_HDRS before including ../lib.mk,
      since the dependency is evaluated in '$(OUTPUT)/%:%.c $(LOCAL_HDRS)' in
      file lib.mk.
      
      Link: https://lkml.kernel.org/r/20220304000645.1888133-1-yosryahmed@google.com
      
      
      Signed-off-by: default avatarYosry Ahmed <yosryahmed@google.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1c4debc4
    • Joseph Qi's avatar
      ocfs2: fix crash when initialize filecheck kobj fails · 7b0b1332
      Joseph Qi authored
      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: https://lkml.kernel.org/r/20220310081930.86305-1-joseph.qi@linux.alibaba.com
      Fixes: 5f483c4a
      
       ("ocfs2: add kobject for online file check")
      Signed-off-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Changwei Ge <gechangwei@live.cn>
      Cc: Gang He <ghe@suse.com>
      Cc: Jun Piao <piaojun@huawei.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7b0b1332
    • Qian Cai's avatar
      configs/debug: restore DEBUG_INFO=y for overriding · 8208257d
      Qian Cai authored
      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: https://lore.kernel.org/all/20220125075126.891825-1-keescook@chromium.org/ [1]
      Link: https://lkml.kernel.org/r/20220308153524.8618-1-quic_qiancai@quicinc.com
      
      
      Signed-off-by: default avatarQian Cai <quic_qiancai@quicinc.com>
      Reported-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
      Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
      Cc: Kees Cook <keescook@chromium.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8208257d
    • Guo Ziliang's avatar
      mm: swap: get rid of livelock in swapin readahead · 029c4628
      Guo Ziliang authored
      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: https://lkml.kernel.org/r/20220221111749.1928222-1-cgel.zte@gmail.com
      
      
      Signed-off-by: default avatarGuo Ziliang <guo.ziliang@zte.com.cn>
      Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
      Reviewed-by: default avatarRan Xiaokai <ran.xiaokai@zte.com.cn>
      Reviewed-by: default avatarJiang Xuexin <jiang.xuexin@zte.com.cn>
      Reviewed-by: default avatarYang Yang <yang.yang29@zte.com.cn>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Roger Quadros <rogerq@kernel.org>
      Cc: Ziliang Guo <guo.ziliang@zte.com.cn>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      029c4628
    • Ivan Vecera's avatar
      iavf: Fix hang during reboot/shutdown · b04683ff
      Ivan Vecera authored
      Recent commit 97457801 ("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: 97457801
      
       ("iavf: Add waiting so the port is initialized in remove")
      Signed-off-by: default avatarIvan Vecera <ivecera@redhat.com>
      Link: https://lore.kernel.org/r/20220317104524.2802848-1-ivecera@redhat.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b04683ff
    • Vladimir Oltean's avatar
      net: mscc: ocelot: fix backwards compatibility with single-chain tc-flower offload · 8e0341ae
      Vladimir Oltean authored
      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: 226e9cd8
      
       ("net: mscc: ocelot: only install TCAM entries into a specific lookup and PAG")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Link: https://lore.kernel.org/r/20220316192117.2568261-1-vladimir.oltean@nxp.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8e0341ae
    • Doug Berger's avatar
      net: bcmgenet: skip invalid partial checksums · 0f643c88
      Doug Berger authored
      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: 81015539
      
       ("net: bcmgenet: use CHECKSUM_COMPLETE for NETIF_F_RXCSUM")
      Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20220317012812.1313196-1-opendmb@gmail.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0f643c88
    • Manish Chopra's avatar
      bnx2x: fix built-in kernel driver load failure · 424e7834
      Manish Chopra authored
      Commit b7a49f73 ("bnx2x: Utilize firmware 7.13.21.0")
      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-7.13.15.0.fw failed with error -2
        Direct firmware load for bnx2x/bnx2x-e2-7.13.21.0.fw 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: https://lore.kernel.org/all/46f2d9d9-ae7f-b332-ddeb-b59802be2bab@molgen.mpg.de/
      
      
      Reported-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Tested-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
      Fixes: b7a49f73
      
       ("bnx2x: Utilize firmware 7.13.21.0")
      Signed-off-by: default avatarManish Chopra <manishc@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Link: https://lore.kernel.org/r/20220316214613.6884-1-manishc@marvell.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      424e7834
    • Juerg Haefliger's avatar
      net: phy: mscc: Add MODULE_FIRMWARE macros · f1858c27
      Juerg Haefliger authored
      The driver requires firmware so define MODULE_FIRMWARE so that modinfo
      provides the details.
      
      Fixes: fa164e40
      
       ("net: phy: mscc: split the driver into separate files")
      Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
      Link: https://lore.kernel.org/r/20220316151835.88765-1-juergh@canonical.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f1858c27