From: Linus Walleij <linus.walleij@linaro.org>
To: Srinivas Neeli <srinivas.neeli@xilinx.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Michal Simek <michal.simek@xilinx.com>,
Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>,
sgoud@xilinx.com, Robert Hancock <hancock@sedsystems.ca>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
git@xilinx.com
Subject: Re: [LINUX PATCH V3 7/9] gpio: gpio-xilinx: Add support for suspend and resume
Date: Wed, 18 Nov 2020 01:38:50 +0100 [thread overview]
Message-ID: <CACRpkdasQEgsOEim5oFMBk-K24SzxYAR17jzuPR3_CTjYZ1hvA@mail.gmail.com> (raw)
In-Reply-To: <1605201148-4508-8-git-send-email-srinivas.neeli@xilinx.com>
Hi Srinivas,
On Thu, Nov 12, 2020 at 6:13 PM Srinivas Neeli
<srinivas.neeli@xilinx.com> wrote:
> Add support for suspend and resume, pm runtime suspend and resume.
> Added free and request calls.
>
> Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
> ---
> Changes in V3:
> -Created new patch for suspend and resume.
(...)
I'm following the idea here I think.
> @@ -544,6 +618,8 @@ static int xgpio_probe(struct platform_device *pdev)
> + pm_runtime_enable(&pdev->dev);
> + status = pm_runtime_get_sync(&pdev->dev);
> + if (status < 0)
> + goto err_unprepare_clk;
Now the clock is enabled a second time. Because
runtime PM kicks in.
Do this instead:
pm_runtime_get_noresume()
pm_runtime_set_active()
pm_runtime_enable()
Now runtime PM knows it is active and will not call
runtime resume and enable the clock a second time.
> + pm_runtime_put(&pdev->dev);
> return 0;
This is right, now pm runtime will gate the clock
until the first GPIO is requested.
> +err_pm_put:
> + pm_runtime_put_sync(&pdev->dev);
> err_unprepare_clk:
> + pm_runtime_disable(&pdev->dev);
> clk_disable_unprepare(chip->clk);
> return status;
Use this on the errorpath instead:
pm_runtime_put_noidle()
pm_runtime_disable()
clk_disable_unprepare();
Now the code will not call runtime suspend to
gate the clock a second time.
Double-check the references to the clock and check
in debugfs that the clock really gets disabled if you're
not using any GPIOs.
Yours,
Linus Walleij
next prev parent reply other threads:[~2020-11-18 0:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 17:12 [LINUX PATCH V3 0/9] gpio-xilinx: Update on xilinx gpio driver Srinivas Neeli
2020-11-12 17:12 ` [LINUX PATCH V3 1/9] gpio: gpio-xilinx: Arrange headers in sorting order Srinivas Neeli
2020-11-17 23:57 ` Linus Walleij
2020-11-12 17:12 ` [LINUX PATCH V3 2/9] dt-bindings: gpio: gpio-xilinx: Add clk support to xilinx soft gpio IP Srinivas Neeli
2020-11-17 23:59 ` Linus Walleij
2020-11-12 17:12 ` [LINUX PATCH V3 3/9] gpio: gpio-xilinx: Add clock support Srinivas Neeli
2020-11-17 23:53 ` Linus Walleij
2020-11-18 0:00 ` Linus Walleij
2020-11-12 17:12 ` [LINUX PATCH V3 4/9] gpio: gpio-xilinx: Reduce spinlock array to single Srinivas Neeli
2020-11-18 0:02 ` Linus Walleij
2020-11-12 17:12 ` [LINUX PATCH V3 5/9] gpio: gpio-xilinx: Add interrupt support Srinivas Neeli
2020-11-16 16:44 ` Robert Hancock
2020-11-18 0:15 ` Linus Walleij
2020-11-12 17:12 ` [LINUX PATCH V3 6/9] gpio: gpio-xilinx: Add remove function Srinivas Neeli
2020-11-18 0:17 ` Linus Walleij
2020-11-12 17:12 ` [LINUX PATCH V3 7/9] gpio: gpio-xilinx: Add support for suspend and resume Srinivas Neeli
2020-11-18 0:38 ` Linus Walleij [this message]
2020-11-12 17:12 ` [LINUX PATCH V3 8/9] gpio: gpio-xilinx: Check return value of of_property_read_u32 Srinivas Neeli
2020-11-18 0:39 ` Linus Walleij
2020-11-12 17:12 ` [LINUX PATCH V3 9/9] MAINTAINERS: add fragment for xilinx GPIO drivers Srinivas Neeli
2020-11-18 0:40 ` Linus Walleij
2020-11-13 7:44 ` [LINUX PATCH V3 0/9] gpio-xilinx: Update on xilinx gpio driver Michal Simek
2020-11-18 0:42 ` Linus Walleij
2020-11-19 5:29 ` Srinivas Neeli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACRpkdasQEgsOEim5oFMBk-K24SzxYAR17jzuPR3_CTjYZ1hvA@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=bgolaszewski@baylibre.com \
--cc=git@xilinx.com \
--cc=hancock@sedsystems.ca \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=sgoud@xilinx.com \
--cc=shubhrajyoti.datta@xilinx.com \
--cc=srinivas.neeli@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).