1. 29 Aug, 2013 4 commits
    • Bjorn Helgaas's avatar
      Merge branch 'pci/misc' into next · 2e8b5f62
      Bjorn Helgaas authored
      * pci/misc:
        PCI: Remove pcie_cap_has_devctl()
        PCI: Support PCIe Capability Slot registers only for ports with slots
        PCI: Remove PCIe Capability version checks
        PCI: Allow PCIe Capability link-related register access for switches
        PCI: Add offsets of PCIe capability registers
        PCI: Tidy bitmasks and spacing of PCIe capability definitions
        PCI: Remove obsolete comment reference to pci_pcie_cap2()
        PCI: Clarify PCI_EXP_TYPE_PCI_BRIDGE comment
        PCI: Rename PCIe capability definitions to follow convention
        PCI: Disable decoding for BAR sizing only when it was actually enabled
        PCI: Add comment about needing pci_msi_off() even when CONFIG_PCI_MSI=n
        PCI: Add pcibios_pm_ops for optional arch-specific hibernate functionality
      2e8b5f62
    • Bjorn Helgaas's avatar
      PCI: Remove pcie_cap_has_devctl() · fed24515
      Bjorn Helgaas authored
      pcie_cap_has_devctl() does nothing, so remove it.  Simplicity over
      consistency in this case.  No functional change.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-By: default avatarJiang Liu <jiang.liu@huawei.com>
      fed24515
    • Bjorn Helgaas's avatar
      PCI: Support PCIe Capability Slot registers only for ports with slots · 6d3a1741
      Bjorn Helgaas authored
      Previously we allowed callers to access Slot Capabilities, Status, and
      Control for Root Ports even if the Root Port did not implement a slot.
      This seems dubious because the spec only requires these registers if a
      slot is implemented.
      
      It's true that even Root Ports without slots must have *space* for these
      slot registers, because the Root Capabilities, Status, and Control
      registers are after the slot registers in the capability.  However,
      for a v1 PCIe Capability, the *semantics* of the slot registers are
      undefined unless a slot is implemented.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-By: default avatarJiang Liu <jiang.liu@huawei.com>
      6d3a1741
    • Bjorn Helgaas's avatar
      PCI: Remove PCIe Capability version checks · c8b303d0
      Bjorn Helgaas authored
      Previously we relied on the PCIe r3.0, sec 7.8, spec language that says
      "For Functions that do not implement the [Link, Slot, Root] registers,
      these spaces must be hardwired to 0b," which means that for v2 PCIe
      capabilities, we don't need to check the device type at all.
      
      But it's simpler if we don't need to check the capability version at all,
      and I think the spec is explicit enough about which registers are required
      for which types that we can remove the version checks.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-By: default avatarJiang Liu <jiang.liu@huawei.com>
      c8b303d0
  2. 28 Aug, 2013 5 commits
  3. 27 Aug, 2013 1 commit
  4. 26 Aug, 2013 4 commits
  5. 23 Aug, 2013 1 commit
  6. 22 Aug, 2013 7 commits
    • Bjorn Helgaas's avatar
      PCI: Add comment about needing pci_msi_off() even when CONFIG_PCI_MSI=n · da27f4b3
      Bjorn Helgaas authored
      Per f5f2b131 ("msi: sanely support hardware level msi disabling"), we
      want pci_msi_off() to work even if MSI support is not compiled into the
      kernel, and there are existing callers that use it when CONFIG_PCI_MSI=n.
      This adds a comment to that effect.
      
      No functional change.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      da27f4b3
    • Sebastian Ott's avatar
      PCI: Add pcibios_pm_ops for optional arch-specific hibernate functionality · 699c1985
      Sebastian Ott authored
      Platforms may want to provide architecture-specific functionality when
      a PCI device is doing a hibernate transition.  Add a weak symbol
      pcibios_pm_ops that architectures can override to do so.
      
      [bhelgaas: fold in return value checks from v2 patch]
      Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      699c1985
    • Yijing Wang's avatar
      PCI: Don't restrict MPS for slots below Root Ports · d4aa68f6
      Yijing Wang authored
      When booting with "pci=pcie_bus_safe", we previously limited the
      fabric MPS to 128 when we found:
      
        (1) A hotplug-capable Downstream Port ("dev->is_hotplug_bridge &&
            pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT"), or
      
        (2) A hotplug-capable Root Port with a slot that was either empty or
            contained a multi-function device ("dev->is_hotplug_bridge &&
            !list_is_singular(&dev->bus->devices)")
      
      Part (1) is valid, but part (2) is not.
      
      After a hot-add in the slot below a Root Port, we can reconfigure all
      MPS values in the fabric below the Root Port because the new device is
      the only thing below the Root Port and there are no active drivers.
      Therefore, there's no reason to limit the MPS for Root Ports, no
      matter what's in the slot.
      
      Test info:
      
          -+-[0000:40]-+-07.0-[0000:46]--+-00.0  Intel 82576 NIC
                                         \-00.1  Intel 82576 NIC
      
          0000:40:07.0 Root Port bridge to [bus 46] (MPS supported=256)
          0000:46:00.0 Endpoint                     (MPS supported=512)
          0000:46:00.1 Endpoint                     (MPS supported=512)
      
          # echo 0 > /sys/bus/pci/slots/7/power
          # echo 1 > /sys/bus/pci/slots/7/power
          pcieport 0000:40:07.0: PCI-E Max Payload Size set to 256/ 256 (was 256)
          pci 0000:46:00.0:      PCI-E Max Payload Size set to 256/ 512 (was 128)
          pci 0000:46:00.1:      PCI-E Max Payload Size set to 256/ 512 (was 128)
      
      Before this change, we set MPS to 128 for the Root Port and both NICs
      because the slot contained a multi-function device and
      
          dev->is_hotplug_bridge && !list_is_singular(&dev->bus->devices)
      
      was true.  After this change, we set it to 256.
      
      [bhelgaas: changelog, comments, split out upstream bridge check]
      Signed-off-by: default avatarYijing Wang <wangyijing@huawei.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Cc: Jon Mason <jdmason@kudzu.us>
      d4aa68f6
    • Bjorn Helgaas's avatar
      PCI: Simplify MPS test for Downstream Port · c2996948
      Bjorn Helgaas authored
      PCIe hotplug bridges are always either Root Ports or Downstream Ports.  No
      other device type can have a PCIe link leading downstream to a slot.
      
      Root Ports don't have an upstream bridge, so "dev->is_hotplug_bridge &&
      dev->bus->self" is true if and only if "dev" is a Downstream Port.  That
      means we can simplify this by looking at the type of "dev" itself, without
      looking upstream at all.
      
      No functional change.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      c2996948
    • Yijing Wang's avatar
      PCI: Remove unnecessary check for pcie_get_mps() failure · f6757711
      Yijing Wang authored
      After 59875ae4 ("PCI/core: Use PCI Express Capability accessors"),
      pcie_get_mps() never returns an error, so don't bother to check for it.
      
      No functional change.
      
      [bhelgaas: changelog, fix pcie_get_mps() doc]
      Signed-off-by: default avatarYijing Wang <wangyijing@huawei.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      f6757711
    • Bjorn Helgaas's avatar
      PCI: Simplify pcie_bus_configure_settings() interface · a58674ff
      Bjorn Helgaas authored
      Based on a patch by Jon Mason (see URL below).
      
      All users of pcie_bus_configure_settings() pass arguments of the form
      "bus, bus->self->pcie_mpss".  The "mpss" argument is redundant since we
      can easily look it up internally.  In addition, all callers check
      "bus->self" for NULL, which we can also do internally.
      
      This patch simplifies the interface and the callers.  No functional change.
      
      Reference: http://lkml.kernel.org/r/1317048850-30728-2-git-send-email-mason@myri.comSigned-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      a58674ff
    • Bjorn Helgaas's avatar
      PCI: Drop "PCI-E" prefix from Max Payload Size message · 2c25e34c
      Bjorn Helgaas authored
      The conventional spelling is "PCIe", but I think even that is superfluous,
      so remove the whole thing.
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      2c25e34c
  7. 15 Aug, 2013 2 commits
  8. 14 Aug, 2013 8 commits
  9. 12 Aug, 2013 8 commits