summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.ibm.com>2018-09-12 12:47:37 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2019-02-07 11:57:06 +0100
commitcfbb4a7ab6bd5df7aca826b92ebb3565efd3d801 (patch)
tree033165eb1bf7777b3d0b3676947d0058ad44227c
parente8e25a7718cf64701ddf7f7b2e31c79815b613f1 (diff)
downloadlinux-cfbb4a7ab6bd5df7aca826b92ebb3565efd3d801.tar.gz
linux-cfbb4a7ab6bd5df7aca826b92ebb3565efd3d801.tar.bz2
linux-cfbb4a7ab6bd5df7aca826b92ebb3565efd3d801.zip
s390/pci: map IOV resources
Map IOV resources such that pci common code recognizes the IOV capability of PFs. Signed-off-by: Sebastian Ott <sebott@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/pci/pci.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index 353161c2e309..6b054ce8c9b6 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -482,6 +482,15 @@ void arch_teardown_msi_irqs(struct pci_dev *pdev)
}
}
+#ifdef CONFIG_PCI_IOV
+static struct resource iov_res = {
+ .name = "PCI IOV res",
+ .start = 0,
+ .end = -1,
+ .flags = IORESOURCE_MEM,
+};
+#endif
+
static void zpci_map_resources(struct pci_dev *pdev)
{
resource_size_t len;
@@ -495,6 +504,17 @@ static void zpci_map_resources(struct pci_dev *pdev)
(resource_size_t __force) pci_iomap(pdev, i, 0);
pdev->resource[i].end = pdev->resource[i].start + len - 1;
}
+
+#ifdef CONFIG_PCI_IOV
+ i = PCI_IOV_RESOURCES;
+
+ for (; i < PCI_SRIOV_NUM_BARS + PCI_IOV_RESOURCES; i++) {
+ len = pci_resource_len(pdev, i);
+ if (!len)
+ continue;
+ pdev->resource[i].parent = &iov_res;
+ }
+#endif
}
static void zpci_unmap_resources(struct pci_dev *pdev)