|
@@ -1965,6 +1965,25 @@ static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus,
|
|
|
return phb->ioda.io_segsize;
|
|
|
}
|
|
|
|
|
|
+#ifdef CONFIG_PCI_IOV
|
|
|
+static resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev,
|
|
|
+ int resno)
|
|
|
+{
|
|
|
+ struct pci_dn *pdn = pci_get_pdn(pdev);
|
|
|
+ resource_size_t align, iov_align;
|
|
|
+
|
|
|
+ iov_align = resource_size(&pdev->resource[resno]);
|
|
|
+ if (iov_align)
|
|
|
+ return iov_align;
|
|
|
+
|
|
|
+ align = pci_iov_resource_size(pdev, resno);
|
|
|
+ if (pdn->vfs_expanded)
|
|
|
+ return pdn->vfs_expanded * align;
|
|
|
+
|
|
|
+ return align;
|
|
|
+}
|
|
|
+#endif /* CONFIG_PCI_IOV */
|
|
|
+
|
|
|
/* Prevent enabling devices for which we couldn't properly
|
|
|
* assign a PE
|
|
|
*/
|
|
@@ -2164,6 +2183,7 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,
|
|
|
ppc_md.pcibios_reset_secondary_bus = pnv_pci_reset_secondary_bus;
|
|
|
#ifdef CONFIG_PCI_IOV
|
|
|
ppc_md.pcibios_fixup_sriov = pnv_pci_ioda_fixup_iov_resources;
|
|
|
+ ppc_md.pcibios_iov_resource_alignment = pnv_pci_iov_resource_alignment;
|
|
|
#endif /* CONFIG_PCI_IOV */
|
|
|
pci_add_flags(PCI_REASSIGN_ALL_RSRC);
|
|
|
|