1. 17 Mar, 2022 2 commits
  2. 09 Mar, 2022 1 commit
  3. 04 Mar, 2022 3 commits
    • Artem Bityutskiy's avatar
      intel_idle: add core C6 optimization for SPR · 3a9cf77b
      Artem Bityutskiy authored
      Add a Sapphire Rapids Xeon C6 optimization, similar to what we have for Sky Lake
      Xeon: if package C6 is disabled, adjust C6 exit latency and target residency to
      match core C6 values, instead of using the default package C6 values.
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3a9cf77b
    • Artem Bityutskiy's avatar
      intel_idle: add 'preferred_cstates' module argument · da0e58c0
      Artem Bityutskiy authored
      On Sapphire Rapids Xeon (SPR) the C1 and C1E states are basically mutually
      exclusive - only one of them can be enabled. By default, 'intel_idle' driver
      enables C1 and disables C1E. However, some users prefer to use C1E instead of
      C1, because it saves more energy.
      
      This patch adds a new module parameter ('preferred_cstates') for enabling C1E
      and disabling C1. Here is the idea behind it.
      
      1. This option has effect only for "mutually exclusive" C-states like C1 and
         C1E on SPR.
      2. It does not have any effect on independent C-states, which do not require
         other C-states to be disabled (most states on most platforms as of today).
      3. For mutually exclusive C-states, the 'intel_idle' driver always has a
         reasonable default, such as enabling C1 on SPR by default. On other
         platforms, the default may be different.
      4. Users can override the default using the 'preferred_cstates' parameter.
      5. The parameter accepts the preferred C-states bit-mask, similarly to the
         existing 'states_off' parameter.
      6. This parameter is not limited to C1/C1E, and leaves room for supporting
         other mutually exclusive C-states, if they come in the future.
      
      Today 'intel_idle' can only be compiled-in, which means that on SPR, in order
      to disable C1 and enable C1E, users should boot with the following kernel
      argument: intel_idle.preferred_cstates=4
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      da0e58c0
    • Artem Bityutskiy's avatar
      intel_idle: add SPR support · 9edf3c0f
      Artem Bityutskiy authored
      Add Sapphire Rapids Xeon support.
      
      Up until very recently, the C1 and C1E C-states were independent, but this
      has changed in some new chips, including Sapphire Rapids Xeon (SPR). In these
      chips the C1 and C1E states cannot be enabled at the same time. The "C1E
      promotion" bit in 'MSR_IA32_POWER_CTL' also has its semantics changed a bit.
      
      Here are the C1, C1E, and "C1E promotion" bit rules on Xeons before SPR.
      
      1. If C1E promotion bit is disabled.
         a. C1  requests end up with C1  C-state.
         b. C1E requests end up with C1E C-state.
      2. If C1E promotion bit is enabled.
         a. C1  requests end up with C1E C-state.
         b. C1E requests end up with C1E C-state.
      
      Here are the C1, C1E, and "C1E promotion" bit rules on Sapphire Rapids Xeon.
      1. If C1E promotion bit is disabled.
         a. C1  requests end up with C1 C-state.
         b. C1E requests end up with C1 C-state.
      2. If C1E promotion bit is enabled.
         a. C1  requests end up with C1E C-state.
         b. C1E requests end up with C1E C-state.
      
      Before SPR Xeon, the 'intel_idle' driver was disabling C1E promotion and was
      exposing C1 and C1E as independent C-states. But on SPR, C1 and C1E cannot be
      enabled at the same time.
      
      This patch adds both C1 and C1E states. However, C1E is marked as with the
      "CPUIDLE_FLAG_UNUSABLE" flag, which means that in won't be registered by
      default. The C1E promotion bit will be cleared, which means that by default
      only C1 and C6 will be registered on SPR.
      
      The next patch will add an option for enabling C1E and disabling C1 on SPR.
      Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      9edf3c0f
  4. 03 Mar, 2022 2 commits
  5. 27 Feb, 2022 4 commits
  6. 26 Feb, 2022 22 commits
  7. 25 Feb, 2022 6 commits
    • Linus Torvalds's avatar
      Merge tag 'configfs-5.17-2022-02-25' of git://git.infradead.org/users/hch/configfs · 9137eda5
      Linus Torvalds authored
      Pull configfs fix from Christoph Hellwig:
      
       - fix a race in configfs_{,un}register_subsystem (ChenXiaoSong)
      
      * tag 'configfs-5.17-2022-02-25' of git://git.infradead.org/users/hch/configfs:
        configfs: fix a race in configfs_{,un}register_subsystem()
      9137eda5
    • Linus Torvalds's avatar
      Merge tag 'for-5.17-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · c0419188
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "This is a hopefully last batch of fixes for defrag that got broken in
        5.16, all stable material.
      
        The remaining reported problem is excessive IO with autodefrag due to
        various conditions in the defrag code not met or missing"
      
      * tag 'for-5.17-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: reduce extent threshold for autodefrag
        btrfs: autodefrag: only scan one inode once
        btrfs: defrag: don't use merged extent map for their generation check
        btrfs: defrag: bring back the old file extent search behavior
        btrfs: defrag: remove an ambiguous condition for rejection
        btrfs: defrag: don't defrag extents which are already at max capacity
        btrfs: defrag: don't try to merge regular extents with preallocated extents
        btrfs: defrag: allow defrag_one_cluster() to skip large extent which is not a target
        btrfs: prevent copying too big compressed lzo segment
      c0419188
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · ca745723
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
      
       - Older "does not even boot" regression in qib from July
      
       - Bug fixes for error unwind in rtrs
      
       - Avoid a deadlock syzkaller found in srp
      
       - Fix another UAF syzkaller found in cma
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA/cma: Do not change route.addr.src_addr outside state checks
        RDMA/ib_srp: Fix a deadlock
        RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close
        RDMA/rtrs-clt: Fix possible double free in error case
        IB/qib: Fix duplicate sysfs directory name
      ca745723
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 115ccd22
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
      
       - fix an bug generating spurious interrupts in gpio-rockchip
      
       - fix a race condition in gpiod_to_irq() called by GPIO consumers
      
      * tag 'gpio-fixes-for-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: Return EPROBE_DEFER if gc->to_irq is NULL
        gpio: rockchip: Reset int_bothedge when changing trigger
      115ccd22
    • Jason Gunthorpe's avatar
      RDMA/cma: Do not change route.addr.src_addr outside state checks · 22e9f710
      Jason Gunthorpe authored
      If the state is not idle then resolve_prepare_src() should immediately
      fail and no change to global state should happen. However, it
      unconditionally overwrites the src_addr trying to build a temporary any
      address.
      
      For instance if the state is already RDMA_CM_LISTEN then this will corrupt
      the src_addr and would cause the test in cma_cancel_operation():
      
                 if (cma_any_addr(cma_src_addr(id_priv)) && !id_priv->cma_dev)
      
      Which would manifest as this trace from syzkaller:
      
        BUG: KASAN: use-after-free in __list_add_valid+0x93/0xa0 lib/list_debug.c:26
        Read of size 8 at addr ffff8881546491e0 by task syz-executor.1/32204
      
        CPU: 1 PID: 32204 Comm: syz-executor.1 Not tainted 5.12.0-rc8-syzkaller #0
        Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
        Call Trace:
         __dump_stack lib/dump_stack.c:79 [inline]
         dump_stack+0x141/0x1d7 lib/dump_stack.c:120
         print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232
         __kasan_report mm/kasan/report.c:399 [inline]
         kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416
         __list_add_valid+0x93/0xa0 lib/list_debug.c:26
         __list_add include/linux/list.h:67 [inline]
         list_add_tail include/linux/list.h:100 [inline]
         cma_listen_on_all drivers/infiniband/core/cma.c:2557 [inline]
         rdma_listen+0x787/0xe00 drivers/infiniband/core/cma.c:3751
         ucma_listen+0x16a/0x210 drivers/infiniband/core/ucma.c:1102
         ucma_write+0x259/0x350 drivers/infiniband/core/ucma.c:1732
         vfs_write+0x28e/0xa30 fs/read_write.c:603
         ksys_write+0x1ee/0x250 fs/read_write.c:658
         do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
         entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      This is indicating that an rdma_id_private was destroyed without doing
      cma_cancel_listens().
      
      Instead of trying to re-use the src_addr memory to indirectly create an
      any address derived from the dst build one explicitly on the stack and
      bind to that as any other normal flow would do. rdma_bind_addr() will copy
      it over the src_addr once it knows the state is valid.
      
      This is similar to commit bc0bdc5a ("RDMA/cma: Do not change
      route.addr.src_addr.ss_family")
      
      Link: https://lore.kernel.org/r/0-v2-e975c8fd9ef2+11e-syz_cma_srcaddr_jgg@nvidia.com
      Cc: stable@vger.kernel.org
      Fixes: 732d41c5 ("RDMA/cma: Make the locking for automatic state transition more clear")
      Reported-by: syzbot+c94a3675a626f6333d74@syzkaller.appspotmail.com
      Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
      22e9f710
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 4b23c6ec
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A few small driver specific fixes"
      
      * tag 'spi-fix-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: rockchip: terminate dma transmission when slave abort
        spi: rockchip: Fix error in getting num-cs property
        spi: spi-zynq-qspi: Fix a NULL pointer dereference in zynq_qspi_exec_mem_op()
      4b23c6ec