PCI: Don't resize resources when realigning all devices in system
authorYongji Xie <elohimes@gmail.com>
Mon, 10 Apr 2017 11:58:14 +0000 (19:58 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 19 Apr 2017 17:52:47 +0000 (12:52 -0500)
commite3adec72a3c50b733eb277a9f93c044f59ff55eb
tree001be0a9f278e5196e85a7d487ffdea161767b5c
parent0dde1c08d1b9dea01cefb327dba8a6e3ae795214
PCI: Don't resize resources when realigning all devices in system

The "pci=resource_alignment" argument aligns BARs of designated devices by
artificially increasing their size.  Increasing the size increases the
alignment and prevents other resources from being assigned in the same
alignment region, e.g., in the same page, but it can break drivers that use
the BAR size to locate things, e.g., ilo_map_device() does this:

  off = pci_resource_len(pdev, bar) - 0x2000;

The new pcibios_default_alignment() interface allows an arch to request
that *all* BARs in the system be aligned to a larger size.  In this case,
we don't need to artificially increase the resource size because we know
every BAR of every device will be realigned, so nothing will share the same
alignment region.

Use IORESOURCE_STARTALIGN to request realignment of PCI BARs when we know
we're realigning all BARs in the system.

[bhelgaas: comment, changelog]
Signed-off-by: Yongji Xie <elohimes@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pci.c