]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
PCI: Ignore BAR updates on virtual functions
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 13 Jan 2017 21:31:33 +0000 (14:31 -0700)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Thu, 26 Jan 2017 16:36:47 +0000 (14:36 -0200)
BugLink: http://bugs.launchpad.net/bugs/1625318
VF BARs are read-only zero, so updating VF BARs will not have any effect.
See the SR-IOV spec r1.1, sec 3.4.1.11.

We already ignore these updates because of 70675e0b6a1a ("PCI: Don't try to
restore VF BARs"); this merely restructures it slightly to make it easier
to split updates for standard and SR-IOV BARs.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
(cherry picked from commit 63880b230a4af502c56dde3d4588634c70c66006)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/pci/pci.c
drivers/pci/setup-res.c

index e311a9bf2c90d602e3ced4725b22562c733660cf..c2263b697693d3f499d67ed560a86dc964818b20 100644 (file)
@@ -519,10 +519,6 @@ static void pci_restore_bars(struct pci_dev *dev)
 {
        int i;
 
-       /* Per SR-IOV spec 3.4.1.11, VF BARs are RO zero */
-       if (dev->is_virtfn)
-               return;
-
        for (i = 0; i < PCI_BRIDGE_RESOURCES; i++)
                pci_update_resource(dev, i);
 }
index 604011e047d60b9db26e40e54769aeb7a957f53e..8f32dac69d0c9adf3d6248906640476785d2eeee 100644 (file)
@@ -36,10 +36,9 @@ void pci_update_resource(struct pci_dev *dev, int resno)
        enum pci_bar_type type;
        struct resource *res = dev->resource + resno;
 
-       if (dev->is_virtfn) {
-               dev_warn(&dev->dev, "can't update VF BAR%d\n", resno);
+       /* Per SR-IOV spec 3.4.1.11, VF BARs are RO zero */
+       if (dev->is_virtfn)
                return;
-       }
 
        /*
         * Ignore resources for unimplemented BARs and unused resource slots