Re: [PATCH v3 11/13] PCI: apple: Use gpiod_set_value_cansleep in probe flow
From: Manivannan Sadhasivam
Date: Sun Apr 13 2025 - 13:17:54 EST
On Tue, Apr 01, 2025 at 10:17:11AM +0100, Marc Zyngier wrote:
> From: Hector Martin <marcan@xxxxxxxxx>
>
> 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")
> Reviewed-by: Rob Herring (Arm) <robh@xxxxxxxxxx>
> Acked-by: Alyssa Rosenzweig <alyssa@xxxxxxxxxxxxx>
> Tested-by: Janne Grunau <j@xxxxxxxxxx>
> Signed-off-by: Hector Martin <marcan@xxxxxxxxx>
> Signed-off-by: Alyssa Rosenzweig <alyssa@xxxxxxxxxxxxx>
> Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
- Mani
> ---
> drivers/pci/controller/pcie-apple.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c
> index c00ec0781fabc..505adf64bd66d 100644
> --- a/drivers/pci/controller/pcie-apple.c
> +++ b/drivers/pci/controller/pcie-apple.c
> @@ -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);
> --
> 2.39.2
>
--
மணிவண்ணன் சதாசிவம்