lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190618113946.GF28892@ulmo>
Date:   Tue, 18 Jun 2019 13:39:46 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     Sowjanya Komatineni <skomatineni@...dia.com>
Cc:     jonathanh@...dia.com, tglx@...utronix.de, jason@...edaemon.net,
        marc.zyngier@....com, linus.walleij@...aro.org, stefan@...er.ch,
        mark.rutland@....com, pdeschrijver@...dia.com, pgaikwad@...dia.com,
        sboyd@...nel.org, linux-clk@...r.kernel.org,
        linux-gpio@...r.kernel.org, jckuo@...dia.com, josephl@...dia.com,
        talho@...dia.com, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org, mperttunen@...dia.com,
        spatra@...dia.com, robh+dt@...nel.org, digetx@...il.com,
        devicetree@...r.kernel.org
Subject: Re: [PATCH V3 03/17] gpio: tegra: use resume_noirq for tegra gpio
 resume

On Tue, Jun 18, 2019 at 12:46:17AM -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 GPIO restore to happen
> during resume_noirq.
> 
> Signed-off-by: Sowjanya Komatineni <skomatineni@...dia.com>
> ---
>  drivers/gpio/gpio-tegra.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
> index f57bfc07ae22..f3c58c597ab9 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;
> @@ -506,6 +506,15 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)
>  
>  	return irq_set_irq_wake(bank->irq, enable);
>  }
> +
> +static const struct dev_pm_ops tegra_gpio_pm_ops = {
> +	.suspend = &tegra_gpio_suspend,
> +	.resume_noirq = &tegra_gpio_resume_noirq
> +};
> +
> +#define TEGRA_GPIO_PM	(&tegra_gpio_pm_ops)
> +#else
> +#define TEGRA_GPIO_PM	NULL

This seems completely unnecessary...

>  #endif
>  
>  #ifdef	CONFIG_DEBUG_FS
> @@ -553,10 +562,6 @@ 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)
> -};
> -

... because this should work correctly irrespective of how PM_SLEEP is
configured. So I think you just need to:

	s/tegra_gpio_resume/tegra_gpio_resume_noirq/

in the above to make this work. No need for this preprocessor macro
business.

Thierry

>  static int tegra_gpio_probe(struct platform_device *pdev)
>  {
>  	struct tegra_gpio_info *tgi;
> @@ -706,7 +711,7 @@ static const struct of_device_id tegra_gpio_of_match[] = {
>  static struct platform_driver tegra_gpio_driver = {
>  	.driver		= {
>  		.name	= "tegra-gpio",
> -		.pm	= &tegra_gpio_pm_ops,
> +		.pm	= TEGRA_GPIO_PM,
>  		.of_match_table = tegra_gpio_of_match,
>  	},
>  	.probe		= tegra_gpio_probe,
> -- 
> 2.7.4
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ