]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: Support SR-IOV on any function type
authorKelly Zytaruk <kelly.zytaruk@amd.com>
Tue, 9 Feb 2016 18:08:58 +0000 (13:08 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 29 Feb 2016 17:22:33 +0000 (11:22 -0600)
Previously, we only supported SR-IOV on PCI Express Endpoints and Root
Complex Integrated Endpoints.  This restriction has been present since
d1b054da8f59 ("PCI: initialize and release SR-IOV capability") added SR-IOV
support, but the spec does not require it.  In fact, the SR-IOV spec r1.1,
sec 3.3, says the SR-IOV extended capability may be present for any Type 0
function.

Remove the function type test, so we can support SR-IOV on any function.

Some AMD GPUs have display outputs, use the VGA class code, are Legacy
Endpoints, and support SR-IOV.  This change allows Linux to enable SR-IOV
on these devices.

[bhelgaas: changelog]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=112221
Signed-off-by: Kelly Zytaruk <kelly.zytaruk@amd.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/iov.c

index 31f31d460fc9de789d28d72365122224fa3b2551..fe4bd0aa91a622eb5ac185ef664d1ee9db698e41 100644 (file)
@@ -387,10 +387,6 @@ static int sriov_init(struct pci_dev *dev, int pos)
        struct resource *res;
        struct pci_dev *pdev;
 
-       if (pci_pcie_type(dev) != PCI_EXP_TYPE_RC_END &&
-           pci_pcie_type(dev) != PCI_EXP_TYPE_ENDPOINT)
-               return -ENODEV;
-
        pci_read_config_word(dev, pos + PCI_SRIOV_CTRL, &ctrl);
        if (ctrl & PCI_SRIOV_CTRL_VFE) {
                pci_write_config_word(dev, pos + PCI_SRIOV_CTRL, 0);