aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorWei Yang <weiyang@linux.vnet.ibm.com>2015-03-25 04:23:50 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2015-03-30 22:02:36 -0400
commit978d2d68312326b715a5913aaab1eaf24fe99108 (patch)
tree101dc75d31df4bf5cb714014319d44f87079c70f /drivers/pci
parent995df527f3990d91fe8f3d7d1917a7adc3938320 (diff)
PCI: Add pcibios_iov_resource_alignment() interface
Per the SR-IOV spec r1.1, sec 3.3.14, the required alignment of a PF's IOV BAR is the size of an individual VF BAR, and the size consumed is the individual VF BAR size times NumVFs. The PowerNV platform has additional alignment requirements to help support its Partitionable Endpoint device isolation feature (see Documentation/powerpc/pci_iov_resource_on_powernv.txt). Add a pcibios_iov_resource_alignment() interface to allow platforms to request additional alignment. [bhelgaas: changelog, adapt to reworked pci_sriov_resource_alignment(), drop "align" parameter] Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/iov.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 64c46925c62d..ee0ebff103a4 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -569,6 +569,12 @@ int pci_iov_resource_bar(struct pci_dev *dev, int resno)
569 4 * (resno - PCI_IOV_RESOURCES); 569 4 * (resno - PCI_IOV_RESOURCES);
570} 570}
571 571
572resource_size_t __weak pcibios_iov_resource_alignment(struct pci_dev *dev,
573 int resno)
574{
575 return pci_iov_resource_size(dev, resno);
576}
577
572/** 578/**
573 * pci_sriov_resource_alignment - get resource alignment for VF BAR 579 * pci_sriov_resource_alignment - get resource alignment for VF BAR
574 * @dev: the PCI device 580 * @dev: the PCI device
@@ -581,7 +587,7 @@ int pci_iov_resource_bar(struct pci_dev *dev, int resno)
581 */ 587 */
582resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno) 588resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
583{ 589{
584 return pci_iov_resource_size(dev, resno); 590 return pcibios_iov_resource_alignment(dev, resno);
585} 591}
586 592
587/** 593/**