linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: imx6: Use gpio_set_value_cansleep()
@ 2015-10-27 23:41 Fabio Estevam
  2015-10-28  8:47 ` Lucas Stach
  2015-11-25 17:34 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2015-10-27 23:41 UTC (permalink / raw)
  To: bhelgaas; +Cc: l.stach, linux-pci, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

We are in a context where we can sleep, and the PCIe reset gpio may be
on an I2C expander.  Use the cansleep() variant when setting the GPIO
value.

Based on a patch from Russell King for pci-mvebu.c.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/pci/host/pci-imx6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index 6f43086..e73b7f2 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -289,9 +289,9 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
 
 	/* Some boards don't have PCIe reset GPIO. */
 	if (gpio_is_valid(imx6_pcie->reset_gpio)) {
-		gpio_set_value(imx6_pcie->reset_gpio, 0);
+		gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0);
 		msleep(100);
-		gpio_set_value(imx6_pcie->reset_gpio, 1);
+		gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1);
 	}
 	return 0;
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: imx6: Use gpio_set_value_cansleep()
  2015-10-27 23:41 [PATCH] PCI: imx6: Use gpio_set_value_cansleep() Fabio Estevam
@ 2015-10-28  8:47 ` Lucas Stach
  2015-11-25 17:34 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Lucas Stach @ 2015-10-28  8:47 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: bhelgaas, linux-pci, Fabio Estevam

Am Dienstag, den 27.10.2015, 21:41 -0200 schrieb Fabio Estevam:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> We are in a context where we can sleep, and the PCIe reset gpio may be
> on an I2C expander.  Use the cansleep() variant when setting the GPIO
> value.
> 
> Based on a patch from Russell King for pci-mvebu.c.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Simple enough,

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
>  drivers/pci/host/pci-imx6.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
> index 6f43086..e73b7f2 100644
> --- a/drivers/pci/host/pci-imx6.c
> +++ b/drivers/pci/host/pci-imx6.c
> @@ -289,9 +289,9 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
>  
>  	/* Some boards don't have PCIe reset GPIO. */
>  	if (gpio_is_valid(imx6_pcie->reset_gpio)) {
> -		gpio_set_value(imx6_pcie->reset_gpio, 0);
> +		gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0);
>  		msleep(100);
> -		gpio_set_value(imx6_pcie->reset_gpio, 1);
> +		gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1);
>  	}
>  	return 0;
>  

-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: imx6: Use gpio_set_value_cansleep()
  2015-10-27 23:41 [PATCH] PCI: imx6: Use gpio_set_value_cansleep() Fabio Estevam
  2015-10-28  8:47 ` Lucas Stach
@ 2015-11-25 17:34 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2015-11-25 17:34 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: bhelgaas, l.stach, linux-pci, Fabio Estevam

On Tue, Oct 27, 2015 at 09:41:58PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> We are in a context where we can sleep, and the PCIe reset gpio may be
> on an I2C expander.  Use the cansleep() variant when setting the GPIO
> value.
> 
> Based on a patch from Russell King for pci-mvebu.c.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Applied with Lucas' Reviewed-by to pci/host-imx6 for v4.5, thanks!

> ---
>  drivers/pci/host/pci-imx6.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
> index 6f43086..e73b7f2 100644
> --- a/drivers/pci/host/pci-imx6.c
> +++ b/drivers/pci/host/pci-imx6.c
> @@ -289,9 +289,9 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
>  
>  	/* Some boards don't have PCIe reset GPIO. */
>  	if (gpio_is_valid(imx6_pcie->reset_gpio)) {
> -		gpio_set_value(imx6_pcie->reset_gpio, 0);
> +		gpio_set_value_cansleep(imx6_pcie->reset_gpio, 0);
>  		msleep(100);
> -		gpio_set_value(imx6_pcie->reset_gpio, 1);
> +		gpio_set_value_cansleep(imx6_pcie->reset_gpio, 1);
>  	}
>  	return 0;
>  
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-25 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 23:41 [PATCH] PCI: imx6: Use gpio_set_value_cansleep() Fabio Estevam
2015-10-28  8:47 ` Lucas Stach
2015-11-25 17:34 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).