Merge tag 'dmaengine-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 4 May 2021 18:24:46 +0000 (11:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 4 May 2021 18:24:46 +0000 (11:24 -0700)
Pull dmaengine updates from Vinod Koul:
 "New drivers/devices:

   - Support for QCOM SM8150 GPI DMA

  Updates:

   - Big pile of idxd updates including support for performance
     monitoring

   - Support in dw-edma for interleaved dma

   - Support for synchronize() in Xilinx driver"

* tag 'dmaengine-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (42 commits)
  dmaengine: idxd: Enable IDXD performance monitor support
  dmaengine: idxd: Add IDXD performance monitor support
  dmaengine: idxd: remove MSIX masking for interrupt handlers
  dmaengine: idxd: device cmd should use dedicated lock
  dmaengine: idxd: support reporting of halt interrupt
  dmaengine: idxd: enable SVA feature for IOMMU
  dmaengine: idxd: convert sprintf() to sysfs_emit() for all usages
  dmaengine: idxd: add interrupt handle request and release support
  dmaengine: idxd: add support for readonly config mode
  dmaengine: idxd: add percpu_ref to descriptor submission path
  dmaengine: idxd: remove detection of device type
  dmaengine: idxd: iax bus removal
  dmaengine: idxd: fix cdev setup and free device lifetime issues
  dmaengine: idxd: fix group conf_dev lifetime
  dmaengine: idxd: fix engine conf_dev lifetime
  dmaengine: idxd: fix wq conf_dev 'struct device' lifetime
  dmaengine: idxd: fix idxd conf_dev 'struct device' lifetime
  dmaengine: idxd: use ida for device instance enumeration
  dmaengine: idxd: removal of pcim managed mmio mapping
  dmaengine: idxd: cleanup pci interrupt vector allocation management
  ...

1  2 
Documentation/devicetree/bindings/dma/qcom,gpi.yaml
drivers/dma/Kconfig
drivers/pci/pci.c
include/linux/cpuhotplug.h
include/linux/pci.h

@@@ -20,6 -20,7 +20,7 @@@ properties
    compatible:
      enum:
        - qcom,sdm845-gpi-dma
+       - qcom,sm8150-gpi-dma
  
    reg:
      maxItems: 1
@@@ -64,7 -65,7 +65,7 @@@ examples
      #include <dt-bindings/interrupt-controller/arm-gic.h>
      #include <dt-bindings/dma/qcom-gpi.h>
      gpi_dma0: dma-controller@800000 {
 -        compatible = "qcom,gpi-dma";
 +        compatible = "qcom,sdm845-gpi-dma";
          #dma-cells = <3>;
          reg = <0x00800000 0x60000>;
          iommus = <&apps_smmu 0x0016 0x0>;
diff --combined drivers/dma/Kconfig
@@@ -100,7 -100,7 +100,7 @@@ config AT_XDMA
  
  config AXI_DMAC
        tristate "Analog Devices AXI-DMAC DMA support"
 -      depends on MICROBLAZE || NIOS2 || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_SOCFPGA || COMPILE_TEST
 +      depends on MICROBLAZE || NIOS2 || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_INTEL_SOCFPGA || COMPILE_TEST
        select DMA_ENGINE
        select DMA_VIRTUAL_CHANNELS
        select REGMAP_MMIO
@@@ -300,6 -300,18 +300,18 @@@ config INTEL_IDXD_SV
        depends on PCI_PASID
        depends on PCI_IOV
  
+ config INTEL_IDXD_PERFMON
+       bool "Intel Data Accelerators performance monitor support"
+       depends on INTEL_IDXD
+       help
+         Enable performance monitor (pmu) support for the Intel(R)
+         data accelerators present in Intel Xeon CPU.  With this
+         enabled, perf can be used to monitor the DSA (Intel Data
+         Streaming Accelerator) events described in the Intel DSA
+         spec.
+         If unsure, say N.
  config INTEL_IOATDMA
        tristate "Intel I/OAT DMA support"
        depends on PCI && X86_64
diff --combined drivers/pci/pci.c
@@@ -693,6 -693,36 +693,36 @@@ u8 pci_find_ht_capability(struct pci_de
  EXPORT_SYMBOL_GPL(pci_find_ht_capability);
  
  /**
+  * pci_find_vsec_capability - Find a vendor-specific extended capability
+  * @dev: PCI device to query
+  * @vendor: Vendor ID for which capability is defined
+  * @cap: Vendor-specific capability ID
+  *
+  * If @dev has Vendor ID @vendor, search for a VSEC capability with
+  * VSEC ID @cap. If found, return the capability offset in
+  * config space; otherwise return 0.
+  */
+ u16 pci_find_vsec_capability(struct pci_dev *dev, u16 vendor, int cap)
+ {
+       u16 vsec = 0;
+       u32 header;
+       if (vendor != dev->vendor)
+               return 0;
+       while ((vsec = pci_find_next_ext_capability(dev, vsec,
+                                                    PCI_EXT_CAP_ID_VNDR))) {
+               if (pci_read_config_dword(dev, vsec + PCI_VNDR_HEADER,
+                                         &header) == PCIBIOS_SUCCESSFUL &&
+                   PCI_VNDR_HEADER_ID(header) == cap)
+                       return vsec;
+       }
+       return 0;
+ }
+ EXPORT_SYMBOL_GPL(pci_find_vsec_capability);
+ /**
   * pci_find_parent_resource - return resource region of parent bus of given
   *                          region
   * @dev: PCI device structure contains resources to be searched
@@@ -1870,10 -1900,20 +1900,10 @@@ static int pci_enable_device_flags(stru
        int err;
        int i, bars = 0;
  
 -      /*
 -       * Power state could be unknown at this point, either due to a fresh
 -       * boot or a device removal call.  So get the current power state
 -       * so that things like MSI message writing will behave as expected
 -       * (e.g. if the device really is in D0 at enable time).
 -       */
 -      if (dev->pm_cap) {
 -              u16 pmcsr;
 -              pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
 -              dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
 -      }
 -
 -      if (atomic_inc_return(&dev->enable_cnt) > 1)
 +      if (atomic_inc_return(&dev->enable_cnt) > 1) {
 +              pci_update_current_state(dev, dev->current_state);
                return 0;               /* already enabled */
 +      }
  
        bridge = pci_upstream_bridge(dev);
        if (bridge)
@@@ -4102,7 -4142,7 +4132,7 @@@ void pci_unmap_iospace(struct resource 
  #if defined(PCI_IOBASE) && defined(CONFIG_MMU)
        unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start;
  
 -      unmap_kernel_range(vaddr, resource_size(res));
 +      vunmap_range(vaddr, vaddr + resource_size(res));
  #endif
  }
  EXPORT_SYMBOL(pci_unmap_iospace);
@@@ -57,7 -57,7 +57,7 @@@ enum cpuhp_state 
        CPUHP_PAGE_ALLOC_DEAD,
        CPUHP_NET_DEV_DEAD,
        CPUHP_PCI_XGENE_DEAD,
 -      CPUHP_IOMMU_INTEL_DEAD,
 +      CPUHP_IOMMU_IOVA_DEAD,
        CPUHP_LUSTRE_CFS_DEAD,
        CPUHP_AP_ARM_CACHE_B15_RAC_DEAD,
        CPUHP_PADATA_DEAD,
        CPUHP_AP_CPU_PM_STARTING,
        CPUHP_AP_IRQ_GIC_STARTING,
        CPUHP_AP_IRQ_HIP04_STARTING,
 +      CPUHP_AP_IRQ_APPLE_AIC_STARTING,
        CPUHP_AP_IRQ_ARMADA_XP_STARTING,
        CPUHP_AP_IRQ_BCM2836_STARTING,
        CPUHP_AP_IRQ_MIPS_GIC_STARTING,
        CPUHP_AP_RISCV_TIMER_STARTING,
        CPUHP_AP_CLINT_TIMER_STARTING,
        CPUHP_AP_CSKY_TIMER_STARTING,
 +      CPUHP_AP_TI_GP_TIMER_STARTING,
        CPUHP_AP_HYPERV_TIMER_STARTING,
        CPUHP_AP_KVM_STARTING,
        CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
        CPUHP_AP_PERF_X86_RAPL_ONLINE,
        CPUHP_AP_PERF_X86_CQM_ONLINE,
        CPUHP_AP_PERF_X86_CSTATE_ONLINE,
+       CPUHP_AP_PERF_X86_IDXD_ONLINE,
        CPUHP_AP_PERF_S390_CF_ONLINE,
        CPUHP_AP_PERF_S390_CFD_ONLINE,
        CPUHP_AP_PERF_S390_SF_ONLINE,
        CPUHP_AP_PERF_ARM_HISI_DDRC_ONLINE,
        CPUHP_AP_PERF_ARM_HISI_HHA_ONLINE,
        CPUHP_AP_PERF_ARM_HISI_L3_ONLINE,
 +      CPUHP_AP_PERF_ARM_HISI_PA_ONLINE,
 +      CPUHP_AP_PERF_ARM_HISI_SLLC_ONLINE,
        CPUHP_AP_PERF_ARM_L2X0_ONLINE,
        CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE,
        CPUHP_AP_PERF_ARM_QCOM_L3_ONLINE,
diff --combined include/linux/pci.h
@@@ -856,12 -856,6 +856,12 @@@ struct module
   *            e.g. drivers/net/e100.c.
   * @sriov_configure: Optional driver callback to allow configuration of
   *            number of VFs to enable via sysfs "sriov_numvfs" file.
 + * @sriov_set_msix_vec_count: PF Driver callback to change number of MSI-X
 + *              vectors on a VF. Triggered via sysfs "sriov_vf_msix_count".
 + *              This will change MSI-X Table Size in the VF Message Control
 + *              registers.
 + * @sriov_get_vf_total_msix: PF driver callback to get the total number of
 + *              MSI-X vectors available for distribution to the VFs.
   * @err_handler: See Documentation/PCI/pci-error-recovery.rst
   * @groups:   Sysfs attribute groups.
   * @driver:   Driver model structure.
@@@ -877,8 -871,6 +877,8 @@@ struct pci_driver 
        int  (*resume)(struct pci_dev *dev);    /* Device woken up */
        void (*shutdown)(struct pci_dev *dev);
        int  (*sriov_configure)(struct pci_dev *dev, int num_vfs); /* On PF */
 +      int  (*sriov_set_msix_vec_count)(struct pci_dev *vf, int msix_vec_count); /* On PF */
 +      u32  (*sriov_get_vf_total_msix)(struct pci_dev *pf);
        const struct pci_error_handlers *err_handler;
        const struct attribute_group **groups;
        struct device_driver    driver;
@@@ -1085,6 -1077,7 +1085,7 @@@ u8 pci_find_next_ht_capability(struct p
  u16 pci_find_ext_capability(struct pci_dev *dev, int cap);
  u16 pci_find_next_ext_capability(struct pci_dev *dev, u16 pos, int cap);
  struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
+ u16 pci_find_vsec_capability(struct pci_dev *dev, u16 vendor, int cap);
  
  u64 pci_get_dsn(struct pci_dev *dev);
  
@@@ -1952,8 -1945,8 +1953,8 @@@ enum pci_fixup_pass 
  #ifdef CONFIG_LTO_CLANG
  #define __DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \
                                  class_shift, hook, stub)              \
 -      void stub(struct pci_dev *dev);                                 \
 -      void stub(struct pci_dev *dev)                                  \
 +      void __cficanonical stub(struct pci_dev *dev);                  \
 +      void __cficanonical stub(struct pci_dev *dev)                   \
        {                                                               \
                hook(dev);                                              \
        }                                                               \