]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pci: Save P2P bridge resource if possible
authorGavin Shan <shangw@linux.vnet.ibm.com>
Sun, 3 Jun 2012 22:15:25 +0000 (22:15 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 7 Sep 2012 00:45:30 +0000 (10:45 +1000)
commit9c8d6f40e6c7b2c98cef095aed68a667dd8364e8
tree1d6aefff7b785d3dc2c3acd40eba9e9d57de9293
parentb0855a1c1d4d841a9236f11b306824307adbf2fb
powerpc/pci: Save P2P bridge resource if possible

When PCI probe flag PCI_REASSIGN_ALL_RSRC has been passed into PCI
core, it's hoped that all resources to be reassigned by PCI core.
As to particular P2P (PCI-to-PCI) bridge, the size of the corresponding
BAR (I/O, MMIO, prefetchable MMIO) is calculated by the resources
required by the PCI devices behind the P2P bridge. That means that
the information like start/end address retrieved from the hardware
registers of the P2P bridge is meainingless in the case. However,
we still count that in and the BARs might have been configured by
firmware with non-zero size. That leads to space waste.

The patch explicitly sets the size of P2P bridge BARs to zero in
case that resource reassignment is expected with PCI probe flag
PCI_REASSIGN_ALL_RSRC. In the result, it will save overall resource
required by the system without waste.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/pci-common.c