Thread (11 messages) 11 messages, 4 authors, 2018-09-25

[PATCH 2/3] gpio: omap: Remove custom PM calls and use cpu_pm instead

From: grygorii.strashko@ti.com (Grygorii Strashko)
Date: 2018-09-21 00:58:00
Also in: linux-gpio, linux-omap


On 09/20/2018 06:47 PM, Tony Lindgren wrote:
* Grygorii Strashko [off-list ref] [180920 23:05]:
quoted
On 09/20/2018 02:35 PM, Tony Lindgren wrote:
quoted
+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.
Ah, sry, You are right - ret not updated in this case
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.
So, just to summarize:
- gpio requested (incl irq) - is_suspended = true: no actions

- no gpio irqs requested - is_suspended = false: idle->omap_gpio_idle/unidle
  suspend->omap_gpio_runtime_suspend/resume

- gpio irqs requested - is_suspended = false: idle->omap_gpio_idle/unidle
  suspend->omap_gpio_idle/unidle
   
Do you have any better ideas?
No. It's looks good - thanks, but i'd like to try it, so will get back.


-- 
regards,
-grygorii
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help