aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-08-28 13:33:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-29 14:11:42 -0500
commit6c944bc629b3080bb850e9a2d5797d5b602ce648 (patch)
tree736eaa9fe815d74d0ecaa91518e0e39920dabd28 /drivers/pci
parentb72a3a06c698143d5b315a2882c3ecb4c947ac5f (diff)
PCI: Remove PCIe Capability version checks
commit c8b303d0206b28c4ff3aecada47108d1655ae00f upstream. 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: Bjorn Helgaas <bhelgaas@google.com> Reviewed-By: Jiang Liu <jiang.liu@huawei.com> Acked-by: Myron Stowe <myron.stowe@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/access.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index e26c3bd9aca4..9a46fa9135d9 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -484,8 +484,7 @@ static inline bool pcie_cap_has_lnkctl(const struct pci_dev *dev)
484{ 484{
485 int type = pci_pcie_type(dev); 485 int type = pci_pcie_type(dev);
486 486
487 return pcie_cap_version(dev) > 1 || 487 return type == PCI_EXP_TYPE_ENDPOINT ||
488 type == PCI_EXP_TYPE_ENDPOINT ||
489 type == PCI_EXP_TYPE_LEG_END || 488 type == PCI_EXP_TYPE_LEG_END ||
490 type == PCI_EXP_TYPE_ROOT_PORT || 489 type == PCI_EXP_TYPE_ROOT_PORT ||
491 type == PCI_EXP_TYPE_UPSTREAM || 490 type == PCI_EXP_TYPE_UPSTREAM ||
@@ -498,8 +497,7 @@ static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev)
498{ 497{
499 int type = pci_pcie_type(dev); 498 int type = pci_pcie_type(dev);
500 499
501 return pcie_cap_version(dev) > 1 || 500 return type == PCI_EXP_TYPE_ROOT_PORT ||
502 type == PCI_EXP_TYPE_ROOT_PORT ||
503 (type == PCI_EXP_TYPE_DOWNSTREAM && 501 (type == PCI_EXP_TYPE_DOWNSTREAM &&
504 pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT); 502 pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT);
505} 503}
@@ -508,8 +506,7 @@ static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev)
508{ 506{
509 int type = pci_pcie_type(dev); 507 int type = pci_pcie_type(dev);
510 508
511 return pcie_cap_version(dev) > 1 || 509 return type == PCI_EXP_TYPE_ROOT_PORT ||
512 type == PCI_EXP_TYPE_ROOT_PORT ||
513 type == PCI_EXP_TYPE_RC_EC; 510 type == PCI_EXP_TYPE_RC_EC;
514} 511}
515 512