Commit 7654e9d4 authored by Sanchayan Maity's avatar Sanchayan Maity Committed by Linus Torvalds

drivers/rtc/rtc-snvs: fix suspend/resume

The alarm interrupt handler also reads registers which are part of SNVS
and need clocks enabled.  However, the resume function is called after
IRQ's have been enabled, hence this leads to a abort:

    Unhandled fault: external abort on non-linefetch (0x1008) at 0x908c604c
    Internal error: : 1008 [#1] ARM
    Modules linked in:
    CPU: 0 PID: 421 Comm: sh Not tainted 3.18.0-rc5-00135-g0689c67-dirty #1592
    task: 8e03e800 ti: 8cad8000 task.ti: 8cad8000
    PC is at snvs_rtc_irq_handler+0x14/0x74
    LR is at handle_irq_event_percpu+0x3c/0x144

Fix this by using the .{suspend/resume}_noirq callbacks instead of
.{suspend/resume} .
Signed-off-by: default avatarSanchayan Maity <maitysanchayan@gmail.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7f899399
...@@ -346,7 +346,10 @@ static int snvs_rtc_resume(struct device *dev) ...@@ -346,7 +346,10 @@ static int snvs_rtc_resume(struct device *dev)
} }
#endif #endif
static SIMPLE_DEV_PM_OPS(snvs_rtc_pm_ops, snvs_rtc_suspend, snvs_rtc_resume); static const struct dev_pm_ops snvs_rtc_pm_ops = {
.suspend_noirq = snvs_rtc_suspend,
.resume_noirq = snvs_rtc_resume,
};
static const struct of_device_id snvs_dt_ids[] = { static const struct of_device_id snvs_dt_ids[] = {
{ .compatible = "fsl,sec-v4.0-mon-rtc-lp", }, { .compatible = "fsl,sec-v4.0-mon-rtc-lp", },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment