linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH] mfd: arizona: Call the runtime PM function if the state is runtime resumed
@ 2015-09-17  8:28 Inha Song
  2015-09-17  8:25 ` Charles Keepax
  0 siblings, 1 reply; 14+ messages in thread
From: Inha Song @ 2015-09-17  8:28 UTC (permalink / raw)
  To: lee.jones, broonie; +Cc: linux-kernel, alsa-devel, patches, sameo, Inha Song

This patch call runtiem PM function manually if the state is runtime resumed
before enter suspend.

This case has occurred when wake-up by the resume after entering to
suspend during the playback.
$ aplay -> runtime_resume() -> suspend() -> resume()

In this case, Can occurred an error when enter suspend.
--
[   82.559234] PM: suspend of devices complete after 57.252 msecs
[   82.567978] arizona spi1.0: Failed to read IRQ status: -108
[   82.567989] arizona spi1.0: Failed to read main IRQ status: -108
[   82.568027] arizona spi1.0: Failed to read IRQ status: -108
[   82.568036] arizona spi1.0: Failed to read main IRQ status: -108
....
So, we should call runtime_suspend() manually when enter suspend
if the state is runtime resume.

Also should call runtime_resume() when wake-up by resume if the state
was runtime resume before entering suspend.

Signed-off-by: Inha Song <ideal.song@samsung.com>
---
 drivers/mfd/arizona-core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 908c69b..de55706 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -683,6 +683,10 @@ static int arizona_suspend(struct device *dev)
 	struct arizona *arizona = dev_get_drvdata(dev);
 
 	dev_dbg(arizona->dev, "Suspend, disabling IRQ\n");
+
+	if (!pm_runtime_status_suspended(dev))
+		arizona_runtime_suspend(dev);
+
 	disable_irq(arizona->irq);
 
 	return 0;
@@ -713,6 +717,10 @@ static int arizona_resume(struct device *dev)
 	struct arizona *arizona = dev_get_drvdata(dev);
 
 	dev_dbg(arizona->dev, "Late resume, reenabling IRQ\n");
+
+	if (!pm_runtime_status_suspended(dev))
+		arizona_runtime_resume(dev);
+
 	enable_irq(arizona->irq);
 
 	return 0;
-- 
2.0.0.390.gcb682f8


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-09-27 16:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-17  8:28 [alsa-devel] [PATCH] mfd: arizona: Call the runtime PM function if the state is runtime resumed Inha Song
2015-09-17  8:25 ` Charles Keepax
2015-09-17  9:05   ` Inha Song
2015-09-17  9:16     ` Charles Keepax
2015-09-18  6:49       ` Inha Song
2015-09-18  8:24         ` Charles Keepax
2015-09-21  2:16           ` Inha Song
2015-09-22  7:46             ` Charles Keepax
2015-09-23  2:04               ` Inha Song
2015-09-23 14:43                 ` Charles Keepax
2015-09-24  1:38                   ` Inha Song
2015-09-24  7:41                     ` Charles Keepax
2015-09-25  7:51                       ` Inha Song
2015-09-27 16:06                         ` Charles Keepax

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).