]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pci: Improve detection of unassigned bridge resources
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 13 Oct 2008 13:56:31 +0000 (13:56 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 14 Oct 2008 23:13:29 +0000 (10:13 +1100)
commitd9607c64dc4d8c9bbc72defc2e4c6c2627d9c7ad
tree2c19b6c484c1930801bf194dab5d047e404c64d3
parent716c8d4f16a61c16d7e2b5454150f2cbcb6d9f13
powerpc/pci: Improve detection of unassigned bridge resources

When the powerpc PCI layer is not configured to re-assign everything,
it currently fails to detect that a PCI to PCI bridge has been left
unassigned by the firmware and tries to allocate resource for the
default window values in the bridge (0...X) (with the notable exception
of a hack we have in there that detects some Apple firmware unassigned
bridge resources).

This results in resource allocation failures, which are generally
fixed up later on but it causes scary warnings in the logs and we
have seen the fixup code fall over in some circumstances (a different
issue to fix as well).

This code improves that by providing a more complete & useful function
to intuit that a bridge was left unassigned by the firmware, and thus
force a full re-allocation by the PCI code without trying to allocate
the existing useless resources first.

The algorithm we use basically considers unassigned a window that
starts at 0 (PCI address) if the corresponding address space enable
bit is not set. In addition, for memory space, it considers such a
resource unassigned also if the host bridge isn't configured to
forward cycles to address 0 (ie, the resource basically overlaps
main memory).

This fixes a range of problems with things like Bare-Metal support
on pSeries machines, or attempt to use partial firmware PCI setup.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/pci-common.c