1. 03 Mar, 2022 3 commits
    • Jason Gunthorpe's avatar
      vfio: Extend the device migration protocol with RUNNING_P2P · 8cb3d83b
      Jason Gunthorpe authored
      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.comSigned-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Tested-by: default avatarShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
      Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
      Reviewed-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarYishai Hadas <yishaih@nvidia.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      8cb3d83b
    • Jason Gunthorpe's avatar
      vfio: Define device migration protocol v2 · 115dcec6
      Jason Gunthorpe authored
      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.comSigned-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Tested-by: default avatarShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
      Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
      Reviewed-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
      Signed-off-by: default avatarYishai Hadas <yishaih@nvidia.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      115dcec6
    • Jason Gunthorpe's avatar
      vfio: Have the core code decode the VFIO_DEVICE_FEATURE ioctl · 445ad495
      Jason Gunthorpe authored
      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.comSigned-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      Tested-by: default avatarShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
      Reviewed-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
      Signed-off-by: default avatarYishai Hadas <yishaih@nvidia.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      445ad495
  2. 27 Feb, 2022 7 commits
  3. 20 Feb, 2022 13 commits
  4. 19 Feb, 2022 5 commits
  5. 18 Feb, 2022 10 commits
    • Dmitry Torokhov's avatar
      Input: psmouse - set up dependency between PS/2 and SMBus companions · 7b1f781f
      Dmitry Torokhov authored
      When we switch from emulated PS/2 to native (RMI4 or Elan) protocols, we
      create SMBus companion devices that are attached to I2C/SMBus controllers.
      However, when suspending and resuming, we also need to make sure that we
      take into account the PS/2 device they are associated with, so that PS/2
      device is suspended after the companion and resumed before it, otherwise
      companions will not work properly. Before I2C devices were marked for
      asynchronous suspend/resume, this ordering happened naturally, but now we
      need to enforce it by establishing device links, with PS/2 devices being
      suppliers and SMBus companions being consumers.
      
      Fixes: 172d9319 ("i2c: enable async suspend/resume on i2c client devices")
      Reported-and-tested-by: default avatarHugh Dickins <hughd@google.com>
      Tested-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
      Link: https://lore.kernel.org/r/89456fcd-a113-4c82-4b10-a9bcaefac68f@google.com
      Link: https://lore.kernel.org/r/YgwQN8ynO88CPMju@google.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      7b1f781f
    • Rafael J. Wysocki's avatar
      Merge branch 'acpi-processor' · 82926564
      Rafael J. Wysocki authored
      Merge fix for a recent boot lockup regression on 32-bit ThinkPad T40.
      
      * acpi-processor:
        ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40
      82926564
    • Linus Torvalds's avatar
      Merge tag 'mtd/fixes-for-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · 7993e65f
      Linus Torvalds authored
      Pull MTD fixes from Miquel Raynal:
       "MTD changes:
      
         - Qcom:
            - Don't print error message on -EPROBE_DEFER
            - Fix kernel panic on skipped partition
            - Fix missing free for pparts in cleanup
      
         - phram: Prevent divide by zero bug in phram_setup()
      
        Raw NAND controller changes:
      
         - ingenic: Fix missing put_device in ingenic_ecc_get
      
         - qcom: Fix clock sequencing in qcom_nandc_probe()
      
         - omap2: Prevent invalid configuration and build error
      
         - gpmi: Don't leak PM reference in error path
      
         - brcmnand: Fix incorrect sub-page ECC status"
      
      * tag 'mtd/fixes-for-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        mtd: rawnand: brcmnand: Fixed incorrect sub-page ECC status
        mtd: rawnand: gpmi: don't leak PM reference in error path
        mtd: phram: Prevent divide by zero bug in phram_setup()
        mtd: rawnand: omap2: Prevent invalid configuration and build error
        mtd: parsers: qcom: Fix missing free for pparts in cleanup
        mtd: parsers: qcom: Fix kernel panic on skipped partition
        mtd: parsers: qcom: Don't print error message on -EPROBE_DEFER
        mtd: rawnand: qcom: Fix clock sequencing in qcom_nandc_probe()
        mtd: rawnand: ingenic: Fix missing put_device in ingenic_ecc_get
      7993e65f
    • Linus Torvalds's avatar
      Merge tag 'block-5.17-2022-02-17' of git://git.kernel.dk/linux-block · b9889768
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - Surprise removal fix (Christoph)
      
       - Ensure that pages are zeroed before submitted for userspace IO
         (Haimin)
      
       - Fix blk-wbt accounting issue with BFQ (Laibin)
      
       - Use bsize for discard granularity in loop (Ming)
      
       - Fix missing zone handling in blk_complete_request() (Pankaj)
      
      * tag 'block-5.17-2022-02-17' of git://git.kernel.dk/linux-block:
        block/wbt: fix negative inflight counter when remove scsi device
        block: fix surprise removal for drivers calling blk_set_queue_dying
        block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern
        block: loop:use kstatfs.f_bsize of backing file to set discard granularity
        block: Add handling for zone append command in blk_complete_request
      b9889768
    • Linus Torvalds's avatar
      Merge tag 'sound-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 2848551b
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of small patches, mostly for old and new regressions and
        device-specific fixes.
      
         - Regression fixes regarding ALSA core SG-buffer helpers
      
         - Regression fix for Realtek HD-audio mutex deadlock
      
         - Regression fix for USB-audio PM resume error
      
         - More coverage of ASoC core control API notification fixes
      
         - Old regression fixes for HD-audio probe mask
      
         - Fixes for ASoC Realtek codec work handling
      
         - Other device-specific quirks / fixes"
      
      * tag 'sound-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits)
        ASoC: intel: skylake: Set max DMA segment size
        ASoC: SOF: hda: Set max DMA segment size
        ALSA: hda: Set max DMA segment size
        ALSA: hda/realtek: Fix deadlock by COEF mutex
        ALSA: usb-audio: Don't abort resume upon errors
        ALSA: hda: Fix missing codec probe on Shenker Dock 15
        ALSA: hda: Fix regression on forced probe mask option
        ALSA: hda/realtek: Add quirk for Legion Y9000X 2019
        ALSA: usb-audio: revert to IMPLICIT_FB_FIXED_DEV for M-Audio FastTrack Ultra
        ASoC: wm_adsp: Correct control read size when parsing compressed buffer
        ASoC: qcom: Actually clear DMA interrupt register for HDMI
        ALSA: memalloc: invalidate SG pages before sync
        ALSA: memalloc: Fix dma_need_sync() checks
        MAINTAINERS: update cros_ec_codec maintainers
        ASoC: rt5682: do not block workqueue if card is unbound
        ASoC: rt5668: do not block workqueue if card is unbound
        ASoC: rt5682s: do not block workqueue if card is unbound
        ASoC: tas2770: Insert post reset delay
        ASoC: Revert "ASoC: mediatek: Check for error clk pointer"
        ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver
        ...
      2848551b
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 45a98a71
      Linus Torvalds authored
      Pull arm64 fix from Catalin Marinas:
       "Fix wrong branch label in the EL2 GICv3 initialisation code"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Correct wrong label in macro __init_el2_gicv3
      45a98a71
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · ea4b3d29
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix boot failure on 603 with DEBUG_PAGEALLOC and KFENCE
      
       - Fix 32-build with newer binutils that rejects 'ptesync' etc
      
      Thanks to Anders Roxell, Christophe Leroy, and Maxime Bizon.
      
      * tag 'powerpc-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/lib/sstep: fix 'ptesync' build error
        powerpc/603: Fix boot failure with DEBUG_PAGEALLOC and KFENCE
      ea4b3d29
    • Linus Torvalds's avatar
      Merge tag '5.17-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 7476b043
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Six small smb3 client fixes, three for stable:
      
         - fix for snapshot mount option
      
         - two ACL related fixes
      
         - use after free race fix
      
         - fix for confusing warning message logged with older dialects"
      
      * tag '5.17-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: fix confusing unneeded warning message on smb2.1 and earlier
        cifs: modefromsids must add an ACE for authenticated users
        cifs: fix double free race when mount fails in cifs_get_root()
        cifs: do not use uninitialized data in the owner/group sid
        cifs: fix set of group SID via NTSD xattrs
        smb3: fix snapshot mount option
      7476b043
    • Andy Lutomirski's avatar
      x86/ptrace: Fix xfpregs_set()'s incorrect xmm clearing · 44cad52c
      Andy Lutomirski authored
      xfpregs_set() handles 32-bit REGSET_XFP and 64-bit REGSET_FP. The actual
      code treats these regsets as modern FX state (i.e. the beginning part of
      XSTATE). The declarations of the regsets thought they were the legacy
      i387 format. The code thought they were the 32-bit (no xmm8..15) variant
      of XSTATE and, for good measure, made the high bits disappear by zeroing
      the wrong part of the buffer. The latter broke ptrace, and everything
      else confused anyone trying to understand the code. In particular, the
      nonsense definitions of the regsets confused me when I wrote this code.
      
      Clean this all up. Change the declarations to match reality (which
      shouldn't change the generated code, let alone the ABI) and fix
      xfpregs_set() to clear the correct bits and to only do so for 32-bit
      callers.
      
      Fixes: 6164331d ("x86/fpu: Rewrite xfpregs_set()")
      Reported-by: default avatarLuís Ferreira <contact@lsferreira.net>
      Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Cc: <stable@vger.kernel.org>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=215524
      Link: https://lore.kernel.org/r/YgpFnZpF01WwR8wU@zn.tnic
      44cad52c
    • Rafał Miłecki's avatar
      i2c: brcmstb: fix support for DSL and CM variants · 834cea3a
      Rafał Miłecki authored
      DSL and CM (Cable Modem) support 8 B max transfer size and have a custom
      DT binding for that reason. This driver was checking for a wrong
      "compatible" however which resulted in an incorrect setup.
      
      Fixes: e2e5a2c6 ("i2c: brcmstb: Adding support for CM and DSL SoCs")
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
      834cea3a
  6. 17 Feb, 2022 2 commits
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-fixes-5.17-rc5' of... · 9195e5e0
      Linus Torvalds authored
      Merge tag 'linux-kselftest-fixes-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull Kselftest fixes from Shuah Khan:
       "Fixes to ftrace, exec, and seccomp tests build, run-time and install
        bugs. These bugs are in the way of running the tests"
      
      * tag 'linux-kselftest-fixes-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/ftrace: Do not trace do_softirq because of PREEMPT_RT
        selftests/seccomp: Fix seccomp failure by adding missing headers
        selftests/exec: Add non-regular to TEST_GEN_PROGS
      9195e5e0
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-02-18' of git://anongit.freedesktop.org/drm/drm · b3d971ec
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Regular fixes for rc5, nothing really stands out, mostly some amdgpu
        and i915 fixes with mediatek, radeon and some misc fixes.
      
        cma-helper:
         - set VM_DONTEXPAND
      
        atomic:
         - error handling fix
      
        mediatek:
         - fix probe defer loop with external bridge
      
        amdgpu:
         - Stable pstate clock fixes for Dimgrey Cavefish and Beige Goby
         - S0ix SDMA fix
         - Yellow Carp GPU reset fix
      
        radeon:
         - Backlight fix for iMac 12,1
      
        i915:
         - GVT kerneldoc cleanup.
         - GVT Kconfig should depend on X86
         - Prevent out of range access in SWSCI display code
         - Fix mbus join and dbuf slice config lookup
         - Fix inverted priority selection in the TTM backend
         - Fix FBC plane end Y offset check"
      
      * tag 'drm-fixes-2022-02-18' of git://anongit.freedesktop.org/drm/drm:
        drm/atomic: Don't pollute crtc_state->mode_blob with error pointers
        drm/radeon: Fix backlight control on iMac 12,1
        drm/amd/pm: correct the sequence of sending gpu reset msg
        drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.
        drm/amd/pm: correct UMD pstate clocks for Dimgrey Cavefish and Beige Goby
        drm/i915/fbc: Fix the plane end Y offset check
        drm/i915/opregion: check port number bounds for SWSCI display power state
        drm/i915/ttm: tweak priority hint selection
        drm/i915: Fix mbus join config lookup
        drm/i915: Fix dbuf slice config lookup
        drm/cma-helper: Set VM_DONTEXPAND for mmap
        drm/mediatek: mtk_dsi: Avoid EPROBE_DEFER loop with external bridge
        drm/i915/gvt: Make DRM_I915_GVT depend on X86
        drm/i915/gvt: clean up kernel-doc in gtt.c
      b3d971ec