From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Chuansheng Liu <chuansheng.liu@intel.com>
Cc: sameo@linux.intel.com, linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com
Subject: Re: mfd, arizona: Fix the deadlock between interrupt handler and dpm_suspend
Date: Wed, 10 Apr 2013 13:30:03 +0100 [thread overview]
Message-ID: <20130410123003.GZ9243@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1365597549.12565.4.camel@cliu38-desktop-build>
[-- Attachment #1: Type: text/plain, Size: 2429 bytes --]
On Wed, Apr 10, 2013 at 08:39:09PM +0800, Chuansheng Liu wrote:
> Here the arizona irq is not NOSUSPEND irq, so when doing device suspend,
> we can disable the arizona irq, and enable it until devices resuming finished.
Hrm, well - actually the primary IRQ probably ought to be a nosuspend in
the first place so this probably isn't what we want. Something like the
below which does a similar thing to what we do on resume might help
here... needs testing though.
From 538e817db94dc0c689ecfea7151b1a3f86bb204a Mon Sep 17 00:00:00 2001
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date: Wed, 10 Apr 2013 12:40:26 +0100
Subject: [PATCH] mfd: arizona: Disable interrupts during suspend
We aren't able to handle interrupts after the device has suspended since
we need to runtime resume it in order to do so but the controller may not
be available any more. Handle this in the same way as we handle a similar
issue on resume.
Reported-by: Chuansheng Liu <chuansheng.liu@intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/mfd/arizona-core.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 98023d8..c6be1f6 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -399,6 +399,26 @@ static int arizona_runtime_suspend(struct device *dev)
#endif
#ifdef CONFIG_PM_SLEEP
+static int arizona_suspend(struct device *dev)
+{
+ struct arizona *arizona = dev_get_drvdata(dev);
+
+ dev_dbg(arizona->dev, "Suspend, disabling IRQ\n");
+ disable_irq(arizona->irq);
+
+ return 0;
+}
+
+static int arizona_suspend_late(struct device *dev)
+{
+ struct arizona *arizona = dev_get_drvdata(dev);
+
+ dev_dbg(arizona->dev, "Late suspend, reenabling IRQ\n");
+ enable_irq(arizona->irq);
+
+ return 0;
+}
+
static int arizona_resume_noirq(struct device *dev)
{
struct arizona *arizona = dev_get_drvdata(dev);
@@ -424,8 +444,9 @@ const struct dev_pm_ops arizona_pm_ops = {
SET_RUNTIME_PM_OPS(arizona_runtime_suspend,
arizona_runtime_resume,
NULL)
- SET_SYSTEM_SLEEP_PM_OPS(NULL, arizona_resume)
+ SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
#ifdef CONFIG_PM_SLEEP
+ .suspend_late = arizona_suspend_late,
.resume_noirq = arizona_resume_noirq,
#endif
};
--
1.7.10.4
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-04-10 12:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-10 12:39 mfd, arizona: Fix the deadlock between interrupt handler and dpm_suspend Chuansheng Liu
2013-04-10 12:30 ` Mark Brown [this message]
2013-04-10 12:46 ` Liu, Chuansheng
2013-04-10 12:52 ` Mark Brown
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=20130410123003.GZ9243@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=chuansheng.liu@intel.com \
--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