Skip to content

Commit bcbdcf4

Browse files
sumitsemwalgregkh
authored andcommitted
PCI: Ignore BAR updates on virtual functions
From: Bjorn Helgaas <bhelgaas@google.com> [ Upstream commit 63880b230a4af502c56dde3d4588634c70c66006 ] 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 70675e0 ("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> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d4f09ea commit bcbdcf4

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

drivers/pci/pci.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,6 @@ static void pci_restore_bars(struct pci_dev *dev)
519519
{
520520
int i;
521521

522-
/* Per SR-IOV spec 3.4.1.11, VF BARs are RO zero */
523-
if (dev->is_virtfn)
524-
return;
525-
526522
for (i = 0; i < PCI_BRIDGE_RESOURCES; i++)
527523
pci_update_resource(dev, i);
528524
}

drivers/pci/setup-res.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
3434
int reg;
3535
struct resource *res = dev->resource + resno;
3636

37-
if (dev->is_virtfn) {
38-
dev_warn(&dev->dev, "can't update VF BAR%d\n", resno);
37+
/* Per SR-IOV spec 3.4.1.11, VF BARs are RO zero */
38+
if (dev->is_virtfn)
3939
return;
40-
}
4140

4241
/*
4342
* Ignore resources for unimplemented BARs and unused resource slots

0 commit comments

Comments
 (0)