[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL-B5D27tOXNi1FUugdicEmUHCX0PMxP_2BVVpZJyAiq-b7Psw@mail.gmail.com>
Date: Tue, 19 Nov 2013 15:04:59 -0700
From: Myron Stowe <myron.stowe@...il.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: stable@...r.kernel.org, Myron Stowe <myron.stowe@...hat.com>,
linux-pci <linux-pci@...r.kernel.org>,
Amos Kong <kongjianjun@...il.com>,
Adam Lee <adam.lee@...onical.com>,
LKML <linux-kernel@...r.kernel.org>,
Yuval Mintz <yuvalmin@...adcom.com>,
Ben Hutchings <ben@...adent.org.uk>,
Thomas Renninger <trenn@...e.de>
Subject: Re: [PATCH v2 2/3] PCI: Remove PCIe Capability version checks
On Tue, Nov 19, 2013 at 2:35 PM, Bjorn Helgaas <bhelgaas@...gle.com> wrote:
> 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@...gle.com>
> Reviewed-By: Jiang Liu <jiang.liu@...wei.com>
> CC: stable@...r.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;
> }
>
>
> --
Acked-by: Myron Stowe <myron.stowe@...hat.com>
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists