diff mbox

PCI: qcom: Use gpiod_set_value_cansleep()

Message ID 1500245798-20886-1-git-send-email-festevam@gmail.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Fabio Estevam July 16, 2017, 10:56 p.m. UTC
From: Fabio Estevam <fabio.estevam@nxp.com>

The reset GPIO can be connected to a I2C or SPI IO expander, which
may sleep, so it is safer to use the gpiod_set_value_cansleep()
variant instead.

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

Comments

Bjorn Helgaas Aug. 2, 2017, 9:43 p.m. UTC | #1
On Sun, Jul 16, 2017 at 07:56:38PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> The reset GPIO can be connected to a I2C or SPI IO expander, which
> may sleep, so it is safer to use the gpiod_set_value_cansleep()
> variant instead.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Any opinion, Stanimir?

> ---
>  drivers/pci/dwc/pcie-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
> index 68c5f2a..8359de0 100644
> --- a/drivers/pci/dwc/pcie-qcom.c
> +++ b/drivers/pci/dwc/pcie-qcom.c
> @@ -141,13 +141,13 @@ struct qcom_pcie {
>  
>  static void qcom_ep_reset_assert(struct qcom_pcie *pcie)
>  {
> -	gpiod_set_value(pcie->reset, 1);
> +	gpiod_set_value_cansleep(pcie->reset, 1);
>  	usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500);
>  }
>  
>  static void qcom_ep_reset_deassert(struct qcom_pcie *pcie)
>  {
> -	gpiod_set_value(pcie->reset, 0);
> +	gpiod_set_value_cansleep(pcie->reset, 0);
>  	usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500);
>  }
>  
> -- 
> 2.7.4
>
Stanimir Varbanov Aug. 3, 2017, 9:19 a.m. UTC | #2
Hi,

Thanks for the patch!

On 07/17/2017 01:56 AM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> The reset GPIO can be connected to a I2C or SPI IO expander, which
> may sleep, so it is safer to use the gpiod_set_value_cansleep()
> variant instead.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>  drivers/pci/dwc/pcie-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Stanimir Varbanov <svarbanov@mm-sol.com>

> 
> diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
> index 68c5f2a..8359de0 100644
> --- a/drivers/pci/dwc/pcie-qcom.c
> +++ b/drivers/pci/dwc/pcie-qcom.c
> @@ -141,13 +141,13 @@ struct qcom_pcie {
>  
>  static void qcom_ep_reset_assert(struct qcom_pcie *pcie)
>  {
> -	gpiod_set_value(pcie->reset, 1);
> +	gpiod_set_value_cansleep(pcie->reset, 1);
>  	usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500);
>  }
>  
>  static void qcom_ep_reset_deassert(struct qcom_pcie *pcie)
>  {
> -	gpiod_set_value(pcie->reset, 0);
> +	gpiod_set_value_cansleep(pcie->reset, 0);
>  	usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500);
>  }
>  
>
Bjorn Helgaas Aug. 3, 2017, 9:10 p.m. UTC | #3
On Sun, Jul 16, 2017 at 07:56:38PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> The reset GPIO can be connected to a I2C or SPI IO expander, which
> may sleep, so it is safer to use the gpiod_set_value_cansleep()
> variant instead.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Applied with Stanimir's ack to pci/host-qcom for v4.14, thanks!

> ---
>  drivers/pci/dwc/pcie-qcom.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
> index 68c5f2a..8359de0 100644
> --- a/drivers/pci/dwc/pcie-qcom.c
> +++ b/drivers/pci/dwc/pcie-qcom.c
> @@ -141,13 +141,13 @@ struct qcom_pcie {
>  
>  static void qcom_ep_reset_assert(struct qcom_pcie *pcie)
>  {
> -	gpiod_set_value(pcie->reset, 1);
> +	gpiod_set_value_cansleep(pcie->reset, 1);
>  	usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500);
>  }
>  
>  static void qcom_ep_reset_deassert(struct qcom_pcie *pcie)
>  {
> -	gpiod_set_value(pcie->reset, 0);
> +	gpiod_set_value_cansleep(pcie->reset, 0);
>  	usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500);
>  }
>  
> -- 
> 2.7.4
>
diff mbox

Patch

diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c
index 68c5f2a..8359de0 100644
--- a/drivers/pci/dwc/pcie-qcom.c
+++ b/drivers/pci/dwc/pcie-qcom.c
@@ -141,13 +141,13 @@  struct qcom_pcie {
 
 static void qcom_ep_reset_assert(struct qcom_pcie *pcie)
 {
-	gpiod_set_value(pcie->reset, 1);
+	gpiod_set_value_cansleep(pcie->reset, 1);
 	usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500);
 }
 
 static void qcom_ep_reset_deassert(struct qcom_pcie *pcie)
 {
-	gpiod_set_value(pcie->reset, 0);
+	gpiod_set_value_cansleep(pcie->reset, 0);
 	usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500);
 }