[{"id":2196573,"web_url":"http://patchwork.ozlabs.org/comment/2196573/","msgid":"<20190618113946.GF28892@ulmo>","list_archive_url":null,"date":"2019-06-18T11:39:46","subject":"Re: [PATCH V3 03/17] gpio: tegra: use resume_noirq for tegra gpio\n\tresume","submitter":{"id":26234,"url":"http://patchwork.ozlabs.org/api/people/26234/","name":"Thierry Reding","email":"thierry.reding@gmail.com"},"content":"On Tue, Jun 18, 2019 at 12:46:17AM -0700, Sowjanya Komatineni wrote:\n> During SC7 resume, PARKED bit clear from the pinmux registers may\n> cause a glitch on the GPIO lines.\n> \n> So, Tegra GPIOs restore should happen prior to restoring Tegra pinmux\n> to keep the GPIO lines in a known good state prior to clearing PARKED\n> bit.\n> \n> This patch has fix for this by moving Tegra GPIO restore to happen\n> during resume_noirq.\n> \n> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>\n> ---\n>  drivers/gpio/gpio-tegra.c | 17 +++++++++++------\n>  1 file changed, 11 insertions(+), 6 deletions(-)\n> \n> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c\n> index f57bfc07ae22..f3c58c597ab9 100644\n> --- a/drivers/gpio/gpio-tegra.c\n> +++ b/drivers/gpio/gpio-tegra.c\n> @@ -410,7 +410,7 @@ static void tegra_gpio_irq_handler(struct irq_desc *desc)\n>  }\n>  \n>  #ifdef CONFIG_PM_SLEEP\n> -static int tegra_gpio_resume(struct device *dev)\n> +static int tegra_gpio_resume_noirq(struct device *dev)\n>  {\n>  \tstruct tegra_gpio_info *tgi = dev_get_drvdata(dev);\n>  \tunsigned long flags;\n> @@ -506,6 +506,15 @@ static int tegra_gpio_irq_set_wake(struct irq_data *d, unsigned int enable)\n>  \n>  \treturn irq_set_irq_wake(bank->irq, enable);\n>  }\n> +\n> +static const struct dev_pm_ops tegra_gpio_pm_ops = {\n> +\t.suspend = &tegra_gpio_suspend,\n> +\t.resume_noirq = &tegra_gpio_resume_noirq\n> +};\n> +\n> +#define TEGRA_GPIO_PM\t(&tegra_gpio_pm_ops)\n> +#else\n> +#define TEGRA_GPIO_PM\tNULL\n\nThis seems completely unnecessary...\n\n>  #endif\n>  \n>  #ifdef\tCONFIG_DEBUG_FS\n> @@ -553,10 +562,6 @@ static inline void tegra_gpio_debuginit(struct tegra_gpio_info *tgi)\n>  \n>  #endif\n>  \n> -static const struct dev_pm_ops tegra_gpio_pm_ops = {\n> -\tSET_SYSTEM_SLEEP_PM_OPS(tegra_gpio_suspend, tegra_gpio_resume)\n> -};\n> -\n\n... because this should work correctly irrespective of how PM_SLEEP is\nconfigured. So I think you just need to:\n\n\ts/tegra_gpio_resume/tegra_gpio_resume_noirq/\n\nin the above to make this work. No need for this preprocessor macro\nbusiness.\n\nThierry\n\n>  static int tegra_gpio_probe(struct platform_device *pdev)\n>  {\n>  \tstruct tegra_gpio_info *tgi;\n> @@ -706,7 +711,7 @@ static const struct of_device_id tegra_gpio_of_match[] = {\n>  static struct platform_driver tegra_gpio_driver = {\n>  \t.driver\t\t= {\n>  \t\t.name\t= \"tegra-gpio\",\n> -\t\t.pm\t= &tegra_gpio_pm_ops,\n> +\t\t.pm\t= TEGRA_GPIO_PM,\n>  \t\t.of_match_table = tegra_gpio_of_match,\n>  \t},\n>  \t.probe\t\t= tegra_gpio_probe,\n> -- \n> 2.7.4\n>","headers":{"Return-Path":"<linux-gpio-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-gpio-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdmarc=pass (p=none dis=none) header.from=gmail.com","ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"b1+lB03T\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 45SmMw1GR9z9sBr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 18 Jun 2019 21:39:56 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1729669AbfFRLjv (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tTue, 18 Jun 2019 07:39:51 -0400","from mail-wm1-f67.google.com ([209.85.128.67]:34625 \"EHLO\n\tmail-wm1-f67.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1729110AbfFRLjv (ORCPT\n\t<rfc822; linux-gpio@vger.kernel.org>); Tue, 18 Jun 2019 07:39:51 -0400","by mail-wm1-f67.google.com with SMTP id w9so2101203wmd.1;\n\tTue, 18 Jun 2019 04:39:48 -0700 (PDT)","from localhost (p2E5BEF36.dip0.t-ipconnect.de. [46.91.239.54])\n\tby smtp.gmail.com with ESMTPSA id\n\tt4sm2011203wmi.6.2019.06.18.04.39.46\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tTue, 18 Jun 2019 04:39:47 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=pmUt8lFiUPWZLjBFgsF3jpurujBshdu03eQoe96VKqQ=;\n\tb=b1+lB03TmvASIGZoa8HEqIYLiwH+oLOeOsQgwFyuqTij7Woidf+MDTS4vMmSZ7XLwu\n\tDdxT81ijbrzlCDfKfBRqKPBBi93FHf5RpsF/KRWaMOmvsBPND/ZfdYNaCmUBhmvCYCXd\n\tKdA0AVmx3cjLwP2dsC+PCpbIKymah+8/d9fWPAAMKd1pdUX12NmbBoargNmxNLEL0W92\n\tz0NEZAY+4EpaOEE1B911cV0NTL4cwl8JI4VjW4VuxYxY9u9E41kysGR14P2irIaKJu2g\n\tgz5o897LYz4+dVsSUW9qSE9zrhdlP7Jxvk6dqIRxMOj+4b2WnebbTUC2YhBrYi7StzT7\n\t9n8Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=pmUt8lFiUPWZLjBFgsF3jpurujBshdu03eQoe96VKqQ=;\n\tb=K5o6hax51Q6bypE60jCHNIh5gRLqBtyhZbKt9D1kyOYCAtm84kYzc5JZvbZKTlDGcT\n\tCjqEPEdLlPZI1RT5HXPrXBJQL523jlsso3VmhjaxYQ98NxB4s7YfjLXJt97PjT5sXVim\n\tritVKGoSHrdzF2Qy9WF+RPm8ldSYZNAbz3fJ/Md0xfJu2pIbaZXkW+RPyaZPNnvMBWMc\n\tdVfJ3/r8IzOrhvhLsy4+grw3CvUYAs4kjo4KZpLTtBBUsw/tcWxmA4ne6Oi+/IpFJe4j\n\txW4vdl5SbrAh6vv81lgpTnTdpTw3nMfH/NzPzJghBLgI+/i4li2aNArVutnXvgG1h7W5\n\tEEjw==","X-Gm-Message-State":"APjAAAVWQoy+LZCXLW8hr0j2OObew+KBwdKEkQseOxlIQXnQiKdbS8Dj\n\tTHav1LZDmmizAbKQjfo9YVc=","X-Google-Smtp-Source":"APXvYqxpFdQipyUacfPF//MyvbOs9+KN+3Nmm2IG0sm8DCrJVSFT6UM5LI6HdRMfXvcRjgRLabUfMw==","X-Received":"by 2002:a1c:7a15:: with SMTP id v21mr3234180wmc.82.1560857987831;\n\tTue, 18 Jun 2019 04:39:47 -0700 (PDT)","Date":"Tue, 18 Jun 2019 13:39:46 +0200","From":"Thierry Reding <thierry.reding@gmail.com>","To":"Sowjanya Komatineni <skomatineni@nvidia.com>","Cc":"jonathanh@nvidia.com, tglx@linutronix.de, jason@lakedaemon.net,\n\tmarc.zyngier@arm.com, linus.walleij@linaro.org, stefan@agner.ch,\n\tmark.rutland@arm.com, pdeschrijver@nvidia.com, pgaikwad@nvidia.com,\n\tsboyd@kernel.org, linux-clk@vger.kernel.org,\n\tlinux-gpio@vger.kernel.org, jckuo@nvidia.com, josephl@nvidia.com,\n\ttalho@nvidia.com, linux-tegra@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, mperttunen@nvidia.com,\n\tspatra@nvidia.com, robh+dt@kernel.org, digetx@gmail.com,\n\tdevicetree@vger.kernel.org","Subject":"Re: [PATCH V3 03/17] gpio: tegra: use resume_noirq for tegra gpio\n\tresume","Message-ID":"<20190618113946.GF28892@ulmo>","References":"<1560843991-24123-1-git-send-email-skomatineni@nvidia.com>\n\t<1560843991-24123-4-git-send-email-skomatineni@nvidia.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"DEueqSqTbz/jWVG1\"","Content-Disposition":"inline","In-Reply-To":"<1560843991-24123-4-git-send-email-skomatineni@nvidia.com>","User-Agent":"Mutt/1.11.4 (2019-03-13)","Sender":"linux-gpio-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-gpio.vger.kernel.org>","X-Mailing-List":"linux-gpio@vger.kernel.org"}}]