Merge branch 'remotes/lorenzo/pci/mmio-dma-ranges'
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 28 Nov 2019 14:54:53 +0000 (08:54 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 28 Nov 2019 14:54:53 +0000 (08:54 -0600)
  - Consolidate DT "dma-ranges" parsing and convert all host drivers to use
    shared parsing (Rob Herring)

* remotes/lorenzo/pci/mmio-dma-ranges:
  PCI: Make devm_of_pci_get_host_bridge_resources() static
  PCI: rcar: Use inbound resources for setup
  PCI: iproc: Use inbound resources for setup
  PCI: xgene: Use inbound resources for setup
  PCI: v3-semi: Use inbound resources for setup
  PCI: ftpci100: Use inbound resources for setup
  PCI: of: Add inbound resource parsing to helpers
  PCI: versatile: Enable COMPILE_TEST
  PCI: versatile: Remove usage of PHYS_OFFSET
  PCI: versatile: Use pci_parse_request_of_pci_ranges()
  PCI: xilinx-nwl: Use pci_parse_request_of_pci_ranges()
  PCI: xilinx: Use pci_parse_request_of_pci_ranges()
  PCI: xgene: Use pci_parse_request_of_pci_ranges()
  PCI: v3-semi: Use pci_parse_request_of_pci_ranges()
  PCI: rockchip: Drop storing driver private outbound resource data
  PCI: rockchip: Use pci_parse_request_of_pci_ranges()
  PCI: mobiveil: Use pci_parse_request_of_pci_ranges()
  PCI: mediatek: Use pci_parse_request_of_pci_ranges()
  PCI: iproc: Use pci_parse_request_of_pci_ranges()
  PCI: faraday: Use pci_parse_request_of_pci_ranges()
  PCI: dwc: Use pci_parse_request_of_pci_ranges()
  PCI: altera: Use pci_parse_request_of_pci_ranges()
  PCI: aardvark: Use pci_parse_request_of_pci_ranges()
  PCI: Export pci_parse_request_of_pci_ranges()
  resource: Add a resource_list_first_type helper

# Conflicts:
# drivers/pci/controller/pcie-rcar.c

1  2 
drivers/pci/controller/Kconfig
drivers/pci/controller/cadence/pcie-cadence-host.c
drivers/pci/controller/dwc/pcie-designware-host.c
drivers/pci/controller/pci-aardvark.c
drivers/pci/controller/pcie-iproc.c
drivers/pci/controller/pcie-mobiveil.c
drivers/pci/controller/pcie-rcar.c
drivers/pci/controller/pcie-rockchip-host.c
drivers/pci/controller/pcie-rockchip.h
drivers/pci/pci.h
include/linux/pci.h

Simple merge
Simple merge
Simple merge
@@@ -1032,30 -1029,23 +1032,28 @@@ static int rcar_pcie_inbound_ranges(str
        if (restype & IORESOURCE_PREFETCH)
                flags |= LAM_PREFETCH;
  
 -      /*
 -       * If the size of the range is larger than the alignment of the start
 -       * address, we have to use multiple entries to perform the mapping.
 -       */
 -      if (cpu_addr > 0) {
 -              unsigned long nr_zeros = __ffs64(cpu_addr);
 -              u64 alignment = 1ULL << nr_zeros;
 +      while (cpu_addr < cpu_end) {
 +              if (idx >= MAX_NR_INBOUND_MAPS - 1) {
 +                      dev_err(pcie->dev, "Failed to map inbound regions!\n");
 +                      return -EINVAL;
 +              }
 +              /*
 +               * If the size of the range is larger than the alignment of
 +               * the start address, we have to use multiple entries to
 +               * perform the mapping.
 +               */
 +              if (cpu_addr > 0) {
 +                      unsigned long nr_zeros = __ffs64(cpu_addr);
 +                      u64 alignment = 1ULL << nr_zeros;
  
-                       size = min(range->size, alignment);
-               } else {
-                       size = range->size;
 -              size = min(size, alignment);
 -      }
 -      /* Hardware supports max 4GiB inbound region */
 -      size = min(size, 1ULL << 32);
++                      size = min(size, alignment);
 +              }
 +              /* Hardware supports max 4GiB inbound region */
 +              size = min(size, 1ULL << 32);
  
 -      mask = roundup_pow_of_two(size) - 1;
 -      mask &= ~0xf;
 +              mask = roundup_pow_of_two(size) - 1;
 +              mask &= ~0xf;
  
 -      while (cpu_addr < cpu_end) {
                /*
                 * Set up 64-bit inbound regions as the range parser doesn't
                 * distinguish between 32 and 64-bit types.
Simple merge
Simple merge