]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
PCI: Ignore requested alignment for IOV BARs
authorYongji Xie <xyjxie@linux.vnet.ibm.com>
Wed, 15 Feb 2017 06:50:22 +0000 (14:50 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 18 Apr 2017 19:47:19 +0000 (14:47 -0500)
We would call pci_reassigndev_resource_alignment() before
pci_init_capabilities().  So the requested alignment would never work for
IOV BARs.

Furthermore, it's meaningless to request additional alignment for IOV BARs,
the IOV BAR alignment is only determined by the VF BAR size.

Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
drivers/pci/pci.c

index 7904d02ffdb97e5f23d915e9c83edbf599ddf58b..679af2a253ad900ac64620efcc0cf7cbb78ffec6 100644 (file)
@@ -5084,7 +5084,7 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev)
        command &= ~PCI_COMMAND_MEMORY;
        pci_write_config_word(dev, PCI_COMMAND, command);
 
-       for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) {
+       for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
                r = &dev->resource[i];
                if (!(r->flags & IORESOURCE_MEM))
                        continue;