linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Alexandre Courbot <gnurou@gmail.com>,
	Ladislav Michl <ladis@linux-mips.org>,
	Aaro Koskinen <aaro.koskinen@iki.fi>, Keerthy <j-keerthy@ti.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Tero Kristo <t-kristo@ti.com>,
	linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] gpio: omap: Remove custom PM calls and use cpu_pm instead
Date: Thu, 20 Sep 2018 16:47:56 -0700	[thread overview]
Message-ID: <20180920234756.GC5662@atomide.com> (raw)
In-Reply-To: <35a1dccf-2b15-2d61-9210-7f3893c27795@ti.com>

* Grygorii Strashko <grygorii.strashko@ti.com> [180920 23:05]:
> On 09/20/2018 02:35 PM, Tony Lindgren wrote:
> > +static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev)
> > +{
> > +	struct platform_device *pdev = to_platform_device(dev);
> > +	struct gpio_bank *bank = platform_get_drvdata(pdev);
> > +	unsigned long flags;
> > +	int error = 0;
> > +
> > +	raw_spin_lock_irqsave(&bank->lock, flags);
> > +	/* Must be idled only by CPU_CLUSTER_PM_ENTER? */
> > +	if (bank->irq_usage) {
> > +		error = -EBUSY;
> 
> Sry, I didn't get how will it work with suspend to ram?
> omap_device will call this handler and, seems, abort suspend always
> if gpio bank has gpios requested as IRQ. Am I missing smth?

Heh yeah we have _od_suspend_noirq() call pm_generic_suspend_noirq()
which will succeed. But note how after that omap_device_idle() gets
called only if pm_generic_runtime_suspend() == 0 and we still allow
supend with no error.

So for gpio interrupts there's nothing that needs to be done at that
point and the cpu_pm notifier will take care of things just before
suspend.

Do you have any better ideas?

Regards,

Tony

  reply	other threads:[~2018-09-20 23:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 19:35 [PATCHv2 0/3] omap gpio add level idle, cpu_pm and drop runtime_irq_safe Tony Lindgren
2018-09-20 19:35 ` [PATCH 1/3] gpio: omap: Add level wakeup handling for omap4 based SoCs Tony Lindgren
2018-09-21  5:45   ` Keerthy
2018-09-20 19:35 ` [PATCH 2/3] gpio: omap: Remove custom PM calls and use cpu_pm instead Tony Lindgren
2018-09-20 23:01   ` Grygorii Strashko
2018-09-20 23:47     ` Tony Lindgren [this message]
2018-09-21  0:58       ` Grygorii Strashko
2018-09-20 19:35 ` [PATCH 3/3] gpio: omap: Get rid of pm_runtime_irq_safe() Tony Lindgren
2018-09-22  3:12 ` [PATCHv2 0/3] omap gpio add level idle, cpu_pm and drop runtime_irq_safe Grygorii Strashko
2018-09-25  6:53 ` Linus Walleij
2018-09-25 14:35   ` Tony Lindgren

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=20180920234756.GC5662@atomide.com \
    --to=tony@atomide.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=gnurou@gmail.com \
    --cc=grygorii.strashko@ti.com \
    --cc=j-keerthy@ti.com \
    --cc=ladis@linux-mips.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=t-kristo@ti.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).