aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2016-08-30 05:33:10 -0400
committerLee Jones <lee.jones@linaro.org>2016-10-04 10:48:03 -0400
commit3612b27cfb4a074c83cc74b928517aca2d872861 (patch)
treebd3bf12eeabf5e05b27b199ee9e18d9cac2649b5 /drivers/mfd
parent7235711aec8d9dd3c884e4761cb94c40f3849090 (diff)
mfd: arizona: Use suspend_noirq inplace of suspend_late
As runtime PM doesn't function whilst processing system suspend/resume operations and the Arizona IRQ handlers need runtime PM to function we must disable IRQs during these operations. Whilst this is already done in the driver we are using suspend/suspend_late and resume/resume_noirq to do so which has two problems. Firstly, as suspend_late is before suspend_noirq that means we still have a small window where an IRQ can cause issues. Secondly, if another suspend_late handler fails after ours has run then (as resume_noirq will not run) we will make unbalanced calls to enable_irq. This is all simply fixed by using the suspend_noirq callback rather than suspend_late. Whilst we are doing this tidy the code up a little, and use the appropriate helper macros. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/arizona-core.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index fcec650ca088..4c18c8ef05d9 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -750,7 +750,7 @@ static int arizona_suspend(struct device *dev)
750 return 0; 750 return 0;
751} 751}
752 752
753static int arizona_suspend_late(struct device *dev) 753static int arizona_suspend_noirq(struct device *dev)
754{ 754{
755 struct arizona *arizona = dev_get_drvdata(dev); 755 struct arizona *arizona = dev_get_drvdata(dev);
756 756
@@ -774,7 +774,7 @@ static int arizona_resume(struct device *dev)
774{ 774{
775 struct arizona *arizona = dev_get_drvdata(dev); 775 struct arizona *arizona = dev_get_drvdata(dev);
776 776
777 dev_dbg(arizona->dev, "Late resume, reenabling IRQ\n"); 777 dev_dbg(arizona->dev, "Resume, reenabling IRQ\n");
778 enable_irq(arizona->irq); 778 enable_irq(arizona->irq);
779 779
780 return 0; 780 return 0;
@@ -786,10 +786,8 @@ const struct dev_pm_ops arizona_pm_ops = {
786 arizona_runtime_resume, 786 arizona_runtime_resume,
787 NULL) 787 NULL)
788 SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume) 788 SET_SYSTEM_SLEEP_PM_OPS(arizona_suspend, arizona_resume)
789#ifdef CONFIG_PM_SLEEP 789 SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(arizona_suspend_noirq,
790 .suspend_late = arizona_suspend_late, 790 arizona_resume_noirq)
791 .resume_noirq = arizona_resume_noirq,
792#endif
793}; 791};
794EXPORT_SYMBOL_GPL(arizona_pm_ops); 792EXPORT_SYMBOL_GPL(arizona_pm_ops);
795 793