PCI: apple: Probe all GPIOs for availability first
authorHector Martin <marcan@marcan.st>
Sun, 6 Feb 2022 12:15:39 +0000 (21:15 +0900)
committerHector Martin <marcan@marcan.st>
Sat, 19 Feb 2022 08:17:42 +0000 (17:17 +0900)
commite32bc8c035a6e7e0f0a63c2550672341c86746c3
tree2d4ed7cd0bd33a335c7606e90bd4a51d93ce74d2
parentd1e8c591c38eb7492e1d039f678897691ad198cd
PCI: apple: Probe all GPIOs for availability first

If we're probing the PCI controller and some GPIOs are not available and
cause a probe defer, we can end up leaving some ports initialized and
not others and making a mess.

Check for PERST# GPIOs for all ports first, and just return
-EPROBE_DEFER if any are not ready yet, without bringing anything up.

Fixes: 1e33888fbe44 ("PCI: apple: Add initial hardware bring-up")
Cc: stable@vger.kernel.org
Signed-off-by: Hector Martin <marcan@marcan.st>
drivers/pci/controller/pcie-apple.c