powerpc/powernv/pci: Work around races in PCI bridge enabling
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 17 Aug 2018 07:30:39 +0000 (17:30 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Sep 2018 18:01:20 +0000 (20:01 +0200)
commitf8700e03c86c9d81483339a2d4fd33777a6debd8
tree614b4932d78a1acfe12ec414ba34ab7267d99689
parent0eb725c141ace79026c4f8430db302c028eed98d
powerpc/powernv/pci: Work around races in PCI bridge enabling

commit db2173198b9513f7add8009f225afa1f1c79bcc6 upstream.

The generic code is racy when multiple children of a PCI bridge try to
enable it simultaneously.

This leads to drivers trying to access a device through a
not-yet-enabled bridge, and this EEH errors under various
circumstances when using parallel driver probing.

There is work going on to fix that properly in the PCI core but it
will take some time.

x86 gets away with it because (outside of hotplug), the BIOS enables
all the bridges at boot time.

This patch does the same thing on powernv by enabling all bridges that
have child devices at boot time, thus avoiding subsequent races. It's
suitable for backporting to stable and distros, while the proper PCI
fix will probably be significantly more invasive.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: stable@vger.kernel.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/platforms/powernv/pci-ioda.c