* [PATCH] PCI: rockchip: Use gpiod_set_value_cansleep() to allow reset via expanders
@ 2017-08-20 0:07 Fabio Estevam
2017-08-24 16:33 ` Bjorn Helgaas
0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2017-08-20 0:07 UTC (permalink / raw)
To: bhelgaas; +Cc: heiko, linux-pci, Fabio Estevam
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 <festevam@gmail.com>
---
drivers/pci/host/pcie-rockchip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index 2eccd53..124b280 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -537,7 +537,7 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
int err, i;
u32 status;
- gpiod_set_value(rockchip->ep_gpio, 0);
+ gpiod_set_value_cansleep(rockchip->ep_gpio, 0);
err = reset_control_assert(rockchip->aclk_rst);
if (err) {
@@ -682,7 +682,7 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
rockchip_pcie_write(rockchip, PCIE_CLIENT_LINK_TRAIN_ENABLE,
PCIE_CLIENT_CONFIG);
- gpiod_set_value(rockchip->ep_gpio, 1);
+ gpiod_set_value_cansleep(rockchip->ep_gpio, 1);
/* 500ms timeout value should be enough for Gen1/2 training */
err = readl_poll_timeout(rockchip->apb_base + PCIE_CLIENT_BASIC_STATUS1,
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: rockchip: Use gpiod_set_value_cansleep() to allow reset via expanders
2017-08-20 0:07 [PATCH] PCI: rockchip: Use gpiod_set_value_cansleep() to allow reset via expanders Fabio Estevam
@ 2017-08-24 16:33 ` Bjorn Helgaas
2017-08-24 16:37 ` Heiko Stuebner
0 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2017-08-24 16:33 UTC (permalink / raw)
To: Fabio Estevam; +Cc: bhelgaas, heiko, linux-pci
On Sat, Aug 19, 2017 at 09:07:14PM -0300, Fabio Estevam wrote:
> 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 <festevam@gmail.com>
Waiting for Shawn's ack...
> ---
> drivers/pci/host/pcie-rockchip.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 2eccd53..124b280 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -537,7 +537,7 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
> int err, i;
> u32 status;
>
> - gpiod_set_value(rockchip->ep_gpio, 0);
> + gpiod_set_value_cansleep(rockchip->ep_gpio, 0);
>
> err = reset_control_assert(rockchip->aclk_rst);
> if (err) {
> @@ -682,7 +682,7 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
> rockchip_pcie_write(rockchip, PCIE_CLIENT_LINK_TRAIN_ENABLE,
> PCIE_CLIENT_CONFIG);
>
> - gpiod_set_value(rockchip->ep_gpio, 1);
> + gpiod_set_value_cansleep(rockchip->ep_gpio, 1);
>
> /* 500ms timeout value should be enough for Gen1/2 training */
> err = readl_poll_timeout(rockchip->apb_base + PCIE_CLIENT_BASIC_STATUS1,
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: rockchip: Use gpiod_set_value_cansleep() to allow reset via expanders
2017-08-24 16:33 ` Bjorn Helgaas
@ 2017-08-24 16:37 ` Heiko Stuebner
2017-08-28 0:27 ` Fabio Estevam
0 siblings, 1 reply; 5+ messages in thread
From: Heiko Stuebner @ 2017-08-24 16:37 UTC (permalink / raw)
To: Bjorn Helgaas, Shawn Lin; +Cc: Fabio Estevam, bhelgaas, linux-pci
Am Donnerstag, 24. August 2017, 11:33:23 CEST schrieb Bjorn Helgaas:
> On Sat, Aug 19, 2017 at 09:07:14PM -0300, Fabio Estevam wrote:
> > 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 <festevam@gmail.com>
>
> Waiting for Shawn's ack...
we might want to include him then, as I'm not sure if he patrols the
linux-pci list :-) . [I've added him]
>
> > ---
> > drivers/pci/host/pcie-rockchip.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> > index 2eccd53..124b280 100644
> > --- a/drivers/pci/host/pcie-rockchip.c
> > +++ b/drivers/pci/host/pcie-rockchip.c
> > @@ -537,7 +537,7 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
> > int err, i;
> > u32 status;
> >
> > - gpiod_set_value(rockchip->ep_gpio, 0);
> > + gpiod_set_value_cansleep(rockchip->ep_gpio, 0);
> >
> > err = reset_control_assert(rockchip->aclk_rst);
> > if (err) {
> > @@ -682,7 +682,7 @@ static int rockchip_pcie_init_port(struct rockchip_pcie *rockchip)
> > rockchip_pcie_write(rockchip, PCIE_CLIENT_LINK_TRAIN_ENABLE,
> > PCIE_CLIENT_CONFIG);
> >
> > - gpiod_set_value(rockchip->ep_gpio, 1);
> > + gpiod_set_value_cansleep(rockchip->ep_gpio, 1);
> >
> > /* 500ms timeout value should be enough for Gen1/2 training */
> > err = readl_poll_timeout(rockchip->apb_base + PCIE_CLIENT_BASIC_STATUS1,
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: rockchip: Use gpiod_set_value_cansleep() to allow reset via expanders
2017-08-24 16:37 ` Heiko Stuebner
@ 2017-08-28 0:27 ` Fabio Estevam
2017-08-28 0:46 ` Shawn Lin
0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2017-08-28 0:27 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Bjorn Helgaas, Shawn Lin, Bjorn Helgaas,
linux-pci@vger.kernel.org
On Thu, Aug 24, 2017 at 1:37 PM, Heiko Stuebner <heiko@sntech.de> wrote:
>> Waiting for Shawn's ack...
>
> we might want to include him then, as I'm not sure if he patrols the
> linux-pci list :-) . [I've added him]
Sorry, I missed to add Shawn on Cc. I have just resent the patch with him on Cc.
Thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI: rockchip: Use gpiod_set_value_cansleep() to allow reset via expanders
2017-08-28 0:27 ` Fabio Estevam
@ 2017-08-28 0:46 ` Shawn Lin
0 siblings, 0 replies; 5+ messages in thread
From: Shawn Lin @ 2017-08-28 0:46 UTC (permalink / raw)
To: Fabio Estevam, Heiko Stuebner
Cc: shawn.lin, Bjorn Helgaas, linux-pci@vger.kernel.org
On 2017/8/28 8:27, Fabio Estevam wrote:
> On Thu, Aug 24, 2017 at 1:37 PM, Heiko Stuebner <heiko@sntech.de> wrote:
>
>>> Waiting for Shawn's ack...
>>
>> we might want to include him then, as I'm not sure if he patrols the
>> linux-pci list :-) . [I've added him]
Aha, I also patrol linux-rockchip for pcie-rockchip, but this patch
didn't include it either.
>
> Sorry, I missed to add Shawn on Cc. I have just resent the patch with him on Cc.
>
Don't worry. I will check it out ASAP.
> Thanks
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-08-28 0:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-20 0:07 [PATCH] PCI: rockchip: Use gpiod_set_value_cansleep() to allow reset via expanders Fabio Estevam
2017-08-24 16:33 ` Bjorn Helgaas
2017-08-24 16:37 ` Heiko Stuebner
2017-08-28 0:27 ` Fabio Estevam
2017-08-28 0:46 ` Shawn Lin
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).