]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Ignore requested alignment for PROBE_ONLY and fixed resources
authorYongji Xie <xyjxie@linux.vnet.ibm.com>
Tue, 13 Sep 2016 09:00:31 +0000 (17:00 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 28 Sep 2016 21:44:52 +0000 (16:44 -0500)
commita077068e574f6f31e6965245506bfe1bf9e7e55d
treeb6e2535a0411500b62aaebe0164d4a7ae09417bb
parent1372dac0367f9e37512ea4720cf3886bcb42562d
PCI: Ignore requested alignment for PROBE_ONLY and fixed resources

Users may request additional alignment of PCI resources, e.g., to align
BARs on page boundaries so they can be shared with guests via VFIO.  This
of course may require reallocation if firmware has already assigned the
BARs with smaller alignments.

If the platform has requested PCI_PROBE_ONLY, we should never change any
PCI BARs, so we can't provide any additional alignment.  Also, if a BAR is
marked as IORESOURCE_PCI_FIXED, e.g., for PCI Enhanced Allocation or if the
firmware depends on the current BAR value, we can't change the alignment.

In these cases, log a message and ignore the user's alignment requests.

[bhelgaas: changelog, use goto to simplify PCI_PROBE_ONLY check]
Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c