Skip to content
  1. Jun 03, 2014
    • Bjorn Helgaas's avatar
      Merge branches 'pci/host-designware', 'pci/host-imx6', 'pci/host-mvebu' and... · 843a85ce
      Bjorn Helgaas authored
      Merge branches 'pci/host-designware', 'pci/host-imx6', 'pci/host-mvebu' and 'pci/host-tegra' into next
      
      * pci/host-designware:
        PCI: designware: Remove unnecessary use of 'conf_lock' spinlock
        PCI: designware: Use new OF interrupt mapping when possible
        PCI: designware: Fix iATU programming for cfg1, io and mem viewport
        PCI: designware: Fix comment for setting number of lanes
      
      * pci/host-imx6:
        PCI: designware: Split Exynos and i.MX bindings
      
      * pci/host-mvebu:
        PCI: mvebu: Use '%pa' for printing 'phys_addr_t' type
        PCI: mvebu: Remove unnecessary use of 'conf_lock' spinlock
        PCI: mvebu: split PCIe BARs into multiple MBus windows when needed
        bus: mvebu-mbus: allow several windows with the same target/attribute
        bus: mvebu-mbus: Avoid setting an undefined window size
        PCI: mvebu: fix off-by-one in the computed size of the mbus windows
      
      * pci/host-tegra:
        PCI: tegra: Use new OF interrupt mapping when possible
      843a85ce
    • Lucas Stach's avatar
      PCI: designware: Split Exynos and i.MX bindings · 1db823ee
      Lucas Stach authored
      
      
      The glue around the core designware IP is significantly different between
      the Exynos and i.MX implementation, which is reflected in the DT bindings.
      
      This changes the i.MX6 binding to reuse as much as possible from the common
      designware binding and removes old cruft.
      
      I removed the optional GPIOs with the following reasoning:
      - disable-gpio: endpoint specific GPIO, not currently wired up in any code.
        Should be handled by the PCI device driver, not the host controller
        driver.
      - wake-up-gpio: same as above.
      - power-on-gpio: No user in any upstream DT.  This should be handled by a
        regulator which shouldn't be controlled by the host driver, but rather by
        the PCI device driver.
      
      [bhelgaas: whitespace fixes]
      Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      1db823ee
    • Bjorn Helgaas's avatar
      Merge branch 'pci/iommu' into next · 0eeb4f2a
      Bjorn Helgaas authored
      * pci/iommu:
        PCI: Add bridge DMA alias quirk for ASMedia and Tundra bridges
        PCI: Add support for PCIe-to-PCI bridge DMA alias quirks
        PCI: Add function 1 DMA alias quirk for Marvell devices
        PCI: Add function 0 DMA alias quirk for Ricoh devices
        PCI: Add support for DMA alias quirks
        PCI: Convert pci_dev_flags definitions to bit shifts
        PCI: Add DMA alias iterator
      0eeb4f2a
  2. May 31, 2014
  3. May 30, 2014
  4. May 29, 2014
    • Bjorn Helgaas's avatar
      Merge branch 'pci/misc' into next · fdaf36bd
      Bjorn Helgaas authored
      * pci/misc:
        PCI: Fix return value from pci_user_{read,write}_config_*()
        PCI: Turn pcibios_penalize_isa_irq() into a weak function
        PCI: Test for std config alias when testing extended config space
      fdaf36bd
    • Bjorn Helgaas's avatar
      Merge branches 'pci/hotplug', 'pci/pci_is_bridge' and 'pci/virtualization' into next · d1a2523d
      Bjorn Helgaas authored
      * pci/hotplug:
        PCI: cpqphp: Fix possible null pointer dereference
        NVMe: Implement PCIe reset notification callback
        PCI: Notify driver before and after device reset
      
      * pci/pci_is_bridge:
        pcmcia: Use pci_is_bridge() to simplify code
        PCI: pciehp: Use pci_is_bridge() to simplify code
        PCI: acpiphp: Use pci_is_bridge() to simplify code
        PCI: cpcihp: Use pci_is_bridge() to simplify code
        PCI: shpchp: Use pci_is_bridge() to simplify code
        PCI: rpaphp: Use pci_is_bridge() to simplify code
        sparc/PCI: Use pci_is_bridge() to simplify code
        powerpc/PCI: Use pci_is_bridge() to simplify code
        ia64/PCI: Use pci_is_bridge() to simplify code
        x86/PCI: Use pci_is_bridge() to simplify code
        PCI: Use pci_is_bridge() to simplify code
        PCI: Add new pci_is_bridge() interface
        PCI: Rename pci_is_bridge() to pci_has_subordinate()
      
      * pci/virtualization:
        PCI: Introduce new device binding path using pci_dev.driver_override
      
      Conflicts:
      	drivers/pci/pci-sysfs.c
      d1a2523d
    • Bjorn Helgaas's avatar
      Merge branches 'pci/host-exynos', 'pci/host-rcar' and 'pci/amd-numa' into next · 79d458bf
      Bjorn Helgaas authored
      * pci/host-exynos:
        PCI: exynos: Remove unnecessary OOM messages
      
      * pci/host-rcar:
        PCI: rcar: Add gen2 device tree support
        PCI: rcar: Add R-Car PCIe device tree bindings
        PCI: rcar: Add MSI support for PCIe
        PCI: rcar: Add Renesas R-Car PCIe driver
        PCI: rcar: Use new OF interrupt mapping when possible
      
      * pci/amd-numa:
        x86/PCI: Clean up and mark early_root_info_init() as deprecated
        x86/PCI: Work around AMD Fam15h BIOSes that fail to provide _PXM
        x86/PCI: Warn if we have to "guess" host bridge node information
      79d458bf
    • Alex Williamson's avatar
      PCI: Introduce new device binding path using pci_dev.driver_override · 782a985d
      Alex Williamson authored
      
      
      The driver_override field allows us to specify the driver for a device
      rather than relying on the driver to provide a positive match of the
      device.  This shortcuts the existing process of looking up the vendor and
      device ID, adding them to the driver new_id, binding the device, then
      removing the ID, but it also provides a couple advantages.
      
      First, the above existing process allows the driver to bind to any device
      matching the new_id for the window where it's enabled.  This is often not
      desired, such as the case of trying to bind a single device to a meta
      driver like pci-stub or vfio-pci.  Using driver_override we can do this
      deterministically using:
      
        echo pci-stub > /sys/bus/pci/devices/0000:03:00.0/driver_override
        echo 0000:03:00.0 > /sys/bus/pci/devices/0000:03:00.0/driver/unbind
        echo 0000:03:00.0 > /sys/bus/pci/drivers_probe
      
      Previously we could not invoke drivers_probe after adding a device to
      new_id for a driver as we get non-deterministic behavior whether the driver
      we intend or the standard driver will claim the device.  Now it becomes a
      deterministic process, only the driver matching driver_override will probe
      the device.
      
      To return the device to the standard driver, we simply clear the
      driver_override and reprobe the device:
      
        echo > /sys/bus/pci/devices/0000:03:00.0/driver_override
        echo 0000:03:00.0 > /sys/bus/pci/devices/0000:03:00.0/driver/unbind
        echo 0000:03:00.0 > /sys/bus/pci/drivers_probe
      
      Another advantage to this approach is that we can specify a driver override
      to force a specific binding or prevent any binding.  For instance when an
      IOMMU group is exposed to userspace through VFIO we require that all
      devices within that group are owned by VFIO.  However, devices can be
      hot-added into an IOMMU group, in which case we want to prevent the device
      from binding to any driver (override driver = "none") or perhaps have it
      automatically bind to vfio-pci.  With driver_override it's a simple matter
      for this field to be set internally when the device is first discovered to
      prevent driver matches.
      
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      782a985d
    • Alex Williamson's avatar
      PCI: Add bridge DMA alias quirk for ASMedia and Tundra bridges · ebdb51eb
      Alex Williamson authored
      
      
      The quirk is intended to be extremely generic, but we only apply it to
      known offending devices.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=44881
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      ebdb51eb
    • Alex Williamson's avatar
      PCI: Add support for PCIe-to-PCI bridge DMA alias quirks · c8fe16e3
      Alex Williamson authored
      
      
      Several PCIe-to-PCI bridges fail to provide a PCIe capability, causing us
      to handle them as conventional PCI devices when they really use the
      requester ID of the secondary bus.  We need to differentiate these from
      PCIe-to-PCI bridges that actually use the conventional PCI ID when a PCIe
      capability is not present, such as those found on the root complex of may
      Intel chipsets.  Add a dev_flag bit to identify devices to be handled as
      standard PCIe-to-PCI bridges.
      
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      c8fe16e3
    • Alex Williamson's avatar
      PCI: Add function 1 DMA alias quirk for Marvell devices · cc346a47
      Alex Williamson authored
      
      
      Several Marvell devices and a JMicron device have a similar DMA requester
      ID problem to Ricoh, except they use function 1 as the PCIe requester ID.
      Add a quirk for these to populate the DMA alias with the correct devfn.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=42679
      Tested-by: default avatarGeorge Spelvin <linux@horizon.com>
      Tested-by: default avatarAndreas Schrägle <ajs124.ajs124@gmail.com>
      Tested-by: default avatarTobias N <qemu@suppser.de>
      Tested-by: default avatar <daxcore@online.de>
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      cc346a47
    • Alex Williamson's avatar
      PCI: Add function 0 DMA alias quirk for Ricoh devices · ec637fb2
      Alex Williamson authored
      
      
      The existing quirk for these devices (pci_get_dma_source()) doesn't really
      solve the problem; re-implement it using the DMA alias iterator.  We'll
      come back later and remove the existing quirk and dma_source interface.
      Note that device ID 0xe822 is typically function 0 and 0xe230 has been
      tested to not need the quirk and are therefore removed versus the
      equivalent dma_source quirk.  If there exist in other configurations we can
      re-add them.
      
      Link: https://bugzilla.redhat.com/show_bug.cgi?id=605888
      Tested-by: default avatarPat Erley <pat-lkml@erley.org>
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      ec637fb2
    • Alex Williamson's avatar
      PCI: Add support for DMA alias quirks · 31c2b815
      Alex Williamson authored
      
      
      Some devices are broken and use a requester ID other than their physical
      devfn.  Add a byte, using an existing gap in the pci_dev structure, to
      store an alternate "alias" devfn.  A bit in the dev_flags tells us when
      this is valid.  We then add the alias as one more step in the
      pci_for_each_dma_alias() iterator.
      
      Tested-by: default avatarGeorge Spelvin <linux@horizon.com>
      Tested-by: default avatarPat Erley <pat-lkml@erley.org>
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      31c2b815
    • Alex Williamson's avatar
      PCI: Convert pci_dev_flags definitions to bit shifts · 6b121592
      Alex Williamson authored
      
      
      Convert the pci_dev_flags definitions from decimal constants to bit shifts.
      We're only a few entries away from where using the decimal value becomes
      cumbersome.  No functional change.
      
      Tested-by: default avatarGeorge Spelvin <linux@horizon.com>
      Tested-by: default avatarPat Erley <pat-lkml@erley.org>
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      6b121592
    • Alex Williamson's avatar
      PCI: Add DMA alias iterator · c25dc828
      Alex Williamson authored
      
      
      In a mixed PCI/PCI-X/PCIe topology, bridges can take ownership of
      transactions, replacing the original requester ID with their own.
      Sometimes we just want to know the resulting device or resulting alias;
      other times we want each step in the chain.  This iterator allows either
      usage.  When an endpoint is connected via an unbroken chain of PCIe
      switches and root ports, it has no alias and its requester ID is visible to
      the root bus.  When PCI/X get in the way, we pick up aliases for bridges.
      
      The reason why we potentially care about each step in the path is because
      of PCI-X.  PCI-X has the concept of a requester ID, but bridges may or may
      not take ownership of various types of transactions.  We therefore leave it
      to the consumer of this function to prune out what they don't care about
      rather than attempt to flatten the alias ourselves.
      
      Tested-by: default avatarGeorge Spelvin <linux@horizon.com>
      Tested-by: default avatarPat Erley <pat-lkml@erley.org>
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      c25dc828
  5. May 28, 2014