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>
Tue, 15 Feb 2022 09:59:32 +0000 (18:59 +0900)
commit182bd25c764b5d162aafb83ad4b4dbb69a827133
treefd871974de005de89bb3f19161dd57b818e1c27d
parentcbbe8b7c4e761798548f254805031e1648c140e1
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