2019-06-24 03:04:23

by Sowjanya Komatineni

[permalink] [raw]
Subject: [PATCH V4 03/18] gpio: tegra: use resume_noirq for tegra gpio resume

During SC7 resume, PARKED bit clear from the pinmux registers may
cause a glitch on the GPIO lines.

So, Tegra GPIOs restore should happen prior to restoring Tegra pinmux
to keep the GPIO lines in a known good state prior to clearing PARKED
bit.

This patch has fix for this by moving Tegra GPIOs restore to happen
very early than pinctrl resume.

Signed-off-by: Sowjanya Komatineni <[email protected]>
---
drivers/gpio/gpio-tegra.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index f57bfc07ae22..f427540568f9 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -410,7 +410,7 @@ static void tegra_gpio_irq_handler(struct irq_desc *desc)
}

#ifdef CONFIG_PM_SLEEP
-static int tegra_gpio_resume(struct device *dev)
+static int tegra_gpio_resume_noirq(struct device *dev)
{
struct tegra_gpio_info *tgi = dev_get_drvdata(dev);
unsigned long flags;
@@ -554,7 +554,8 @@ static inline void tegra_gpio_debuginit(struct tegra_gpio_info *tgi)
#endif

static const struct dev_pm_ops tegra_gpio_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume)
+ .suspend = tegra_gpio_suspend,
+ .resume_noirq = tegra_gpio_resume_noirq
};

static int tegra_gpio_probe(struct platform_device *pdev)
--
2.7.4


2019-06-25 13:43:53

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH V4 03/18] gpio: tegra: use resume_noirq for tegra gpio resume

On Mon, Jun 24, 2019 at 5:03 AM Sowjanya Komatineni
<[email protected]> wrote:

> During SC7 resume, PARKED bit clear from the pinmux registers may
> cause a glitch on the GPIO lines.
>
> So, Tegra GPIOs restore should happen prior to restoring Tegra pinmux
> to keep the GPIO lines in a known good state prior to clearing PARKED
> bit.
>
> This patch has fix for this by moving Tegra GPIOs restore to happen
> very early than pinctrl resume.
>
> Signed-off-by: Sowjanya Komatineni <[email protected]>

Can this patch be applied in isolation from the other patches?

WOuld be nice to have at least Thierry's ACK on it before I
apply it.

Yours,
Linus Walleij

2019-06-25 13:45:54

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH V4 03/18] gpio: tegra: use resume_noirq for tegra gpio resume

On Sun, Jun 23, 2019 at 08:02:44PM -0700, Sowjanya Komatineni wrote:
> During SC7 resume, PARKED bit clear from the pinmux registers may
> cause a glitch on the GPIO lines.
>
> So, Tegra GPIOs restore should happen prior to restoring Tegra pinmux
> to keep the GPIO lines in a known good state prior to clearing PARKED
> bit.
>
> This patch has fix for this by moving Tegra GPIOs restore to happen
> very early than pinctrl resume.
>
> Signed-off-by: Sowjanya Komatineni <[email protected]>
> ---
> drivers/gpio/gpio-tegra.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (659.00 B)
signature.asc (849.00 B)
Download all attachments

2019-06-26 17:07:10

by Sowjanya Komatineni

[permalink] [raw]
Subject: Re: [PATCH V4 03/18] gpio: tegra: use resume_noirq for tegra gpio resume


On 6/25/19 6:38 AM, Linus Walleij wrote:
> On Mon, Jun 24, 2019 at 5:03 AM Sowjanya Komatineni
> <[email protected]> wrote:
>
>> During SC7 resume, PARKED bit clear from the pinmux registers may
>> cause a glitch on the GPIO lines.
>>
>> So, Tegra GPIOs restore should happen prior to restoring Tegra pinmux
>> to keep the GPIO lines in a known good state prior to clearing PARKED
>> bit.
>>
>> This patch has fix for this by moving Tegra GPIOs restore to happen
>> very early than pinctrl resume.
>>
>> Signed-off-by: Sowjanya Komatineni <[email protected]>
> Can this patch be applied in isolation from the other patches?
>
> WOuld be nice to have at least Thierry's ACK on it before I
> apply it.
>
> Yours,
> Linus Walleij

Just to confirm, Will not include this in V5 as you are planning to
apply this patch separately.

Thanks

Sowjanya