PCI: apple: Probe all GPIOs for availability first
authorHector Martin <marcan@marcan.st>
Sun, 6 Feb 2022 12:15:39 +0000 (21:15 +0900)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Mar 2022 17:55:01 +0000 (10:55 -0700)
commitf1cda430f12a9eb44ea494d5f50db48ef5c84af7
treecf08913b32dc5f7b729c7802992fb54070cc3935
parent762f59c6724dabd7c3bac7e513d71fcc34dc563b
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