From: Bjorn Helgaas <bhelgaas@google.com>
To: stable@vger.kernel.org
Cc: Myron Stowe <myron.stowe@redhat.com>,
linux-pci@vger.kernel.org, Amos Kong <kongjianjun@gmail.com>,
Adam Lee <adam.lee@canonical.com>,
linux-kernel@vger.kernel.org, Yuval Mintz <yuvalmin@broadcom.com>,
Ben Hutchings <ben@decadent.org.uk>,
Thomas Renninger <trenn@suse.de>
Subject: [PATCH v2 2/3] PCI: Remove PCIe Capability version checks
Date: Tue, 19 Nov 2013 14:35:50 -0700 [thread overview]
Message-ID: <20131119213550.3839.2581.stgit@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <20131119212714.3839.52182.stgit@bhelgaas-glaptop.roam.corp.google.com>
Commit c8b303d0206b28c4ff3aecada47108d1655ae00f upstream. This is part
of the fix for https://bugzilla.kernel.org/show_bug.cgi?id=65211
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>
CC: stable@vger.kernel.org # v3.7+
---
drivers/pci/access.c | 9 +++------
1 file 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)
{
int type = pci_pcie_type(dev);
- return pcie_cap_version(dev) > 1 ||
- type == PCI_EXP_TYPE_ENDPOINT ||
+ return type == PCI_EXP_TYPE_ENDPOINT ||
type == PCI_EXP_TYPE_LEG_END ||
type == PCI_EXP_TYPE_ROOT_PORT ||
type == PCI_EXP_TYPE_UPSTREAM ||
@@ -498,8 +497,7 @@ static inline bool pcie_cap_has_sltctl(const struct pci_dev *dev)
{
int type = pci_pcie_type(dev);
- return pcie_cap_version(dev) > 1 ||
- type == PCI_EXP_TYPE_ROOT_PORT ||
+ return type == PCI_EXP_TYPE_ROOT_PORT ||
(type == PCI_EXP_TYPE_DOWNSTREAM &&
pcie_caps_reg(dev) & PCI_EXP_FLAGS_SLOT);
}
@@ -508,8 +506,7 @@ static inline bool pcie_cap_has_rtctl(const struct pci_dev *dev)
{
int type = pci_pcie_type(dev);
- return pcie_cap_version(dev) > 1 ||
- type == PCI_EXP_TYPE_ROOT_PORT ||
+ return type == PCI_EXP_TYPE_ROOT_PORT ||
type == PCI_EXP_TYPE_RC_EC;
}
next prev parent reply other threads:[~2013-11-19 21:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-19 21:35 [PATCH v2 0/3] PCIe Capability accessor fixes [stable backports] Bjorn Helgaas
2013-11-19 21:35 ` [PATCH v2 1/3] PCI: Allow PCIe Capability link-related register access for switches Bjorn Helgaas
2013-11-19 21:35 ` Bjorn Helgaas [this message]
2013-11-19 22:04 ` [PATCH v2 2/3] PCI: Remove PCIe Capability version checks Myron Stowe
2013-11-19 21:35 ` [PATCH v2 3/3] PCI: Support PCIe Capability Slot registers only for ports with slots Bjorn Helgaas
2013-11-19 22:05 ` Myron Stowe
2013-11-20 7:13 ` [PATCH v2 0/3] PCIe Capability accessor fixes [stable backports] Adam Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131119213550.3839.2581.stgit@bhelgaas-glaptop.roam.corp.google.com \
--to=bhelgaas@google.com \
--cc=adam.lee@canonical.com \
--cc=ben@decadent.org.uk \
--cc=kongjianjun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=myron.stowe@redhat.com \
--cc=stable@vger.kernel.org \
--cc=trenn@suse.de \
--cc=yuvalmin@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®