[PATCH] PCI: Don't update VF's BAR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



VF BARs are RO zero, so updating VF BARs will not take any effect.
See the SR-IOV spec r1.1, sec 3.4.1.11.

Signed-off-by: Wei Yang <weiyang@xxxxxxxxxxxxxxxxxx>
---
 drivers/pci/setup-res.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 232f925..334b394 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -37,6 +37,13 @@ void pci_update_resource(struct pci_dev *dev, int resno)
 	struct resource *res = dev->resource + resno;
 
 	/*
+	 * Per SRIOV SPEC 3.4.1.11, VF BARs are RO zero.
+	 * If this is a VF, just return.
+	 */
+	if (dev->is_virtfn)
+		return;
+
+	/*
 	 * Ignore resources for unimplemented BARs and unused resource slots
 	 * for 64 bit BARs.
 	 */
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux