From: Inha Song <ideal.song@samsung.com>
To: lee.jones@linaro.org, broonie@kernel.org
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
patches@opensource.wolfsonmicro.com, sameo@linux.intel.com,
Inha Song <ideal.song@samsung.com>
Subject: [alsa-devel] [PATCH] mfd: arizona: Call the runtime PM function if the state is runtime resumed
Date: Thu, 17 Sep 2015 17:28:47 +0900 [thread overview]
Message-ID: <1442478527-29304-1-git-send-email-ideal.song@samsung.com> (raw)
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
next reply other threads:[~2015-09-17 8:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 8:28 Inha Song [this message]
2015-09-17 8:25 ` [alsa-devel] [PATCH] mfd: arizona: Call the runtime PM function if the state is runtime resumed 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
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=1442478527-29304-1-git-send-email-ideal.song@samsung.com \
--to=ideal.song@samsung.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
--cc=sameo@linux.intel.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).