]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: apple: Use gpiod_set_value_cansleep in probe flow
authorHector Martin <marcan@marcan.st>
Tue, 1 Apr 2025 09:17:11 +0000 (10:17 +0100)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Wed, 23 Apr 2025 07:22:49 +0000 (12:52 +0530)
We're allowed to sleep here, so tell the GPIO core by using
gpiod_set_value_cansleep instead of gpiod_set_value.

Fixes: 1e33888fbe44 ("PCI: apple: Add initial hardware bring-up")
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tested-by: Janne Grunau <j@jannau.net>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Link: https://patch.msgid.link/20250401091713.2765724-12-maz@kernel.org
drivers/pci/controller/pcie-apple.c

index a3ff225d54ce4ee29f4f9082d451533c943ee2f8..eadce67e30c0404f541b4a1dca290948ebf45b6a 100644 (file)
@@ -562,7 +562,7 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
        rmw_set(PORT_APPCLK_EN, port->base + PORT_APPCLK);
 
        /* Assert PERST# before setting up the clock */
-       gpiod_set_value(reset, 1);
+       gpiod_set_value_cansleep(reset, 1);
 
        ret = apple_pcie_setup_refclk(pcie, port);
        if (ret < 0)
@@ -573,7 +573,7 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie,
 
        /* Deassert PERST# */
        rmw_set(PORT_PERST_OFF, port->base + PORT_PERST);
-       gpiod_set_value(reset, 0);
+       gpiod_set_value_cansleep(reset, 0);
 
        /* Wait for 100ms after PERST# deassertion (PCIe r5.0, 6.6.1) */
        msleep(100);