aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2011-05-11 18:13:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-11 21:50:44 -0400
commit52cd4e5c620af9e21b5298bf01844b98573505a7 (patch)
tree6833280fd9b65c5e59472e9d63b1f975874af05d /drivers/rtc
parent9f381a61f58bb6487c93ce2233bb9992f8ea9211 (diff)
drivers/rtc/rtc-s3c.c: fixup wake support for rtc
The driver is not balancing set_irq and disable_irq_wake() calls, so ensure that it keeps track of whether the wake is enabled. The fixes the following error on S3C6410 devices: WARNING: at kernel/irq/manage.c:382 set_irq_wake+0x84/0xec() Unbalanced IRQ 92 wake disable Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-s3c.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index b3466c491cd3..16512ecae31a 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -46,6 +46,7 @@ static struct clk *rtc_clk;
46static void __iomem *s3c_rtc_base; 46static void __iomem *s3c_rtc_base;
47static int s3c_rtc_alarmno = NO_IRQ; 47static int s3c_rtc_alarmno = NO_IRQ;
48static int s3c_rtc_tickno = NO_IRQ; 48static int s3c_rtc_tickno = NO_IRQ;
49static bool wake_en;
49static enum s3c_cpu_type s3c_rtc_cpu_type; 50static enum s3c_cpu_type s3c_rtc_cpu_type;
50 51
51static DEFINE_SPINLOCK(s3c_rtc_pie_lock); 52static DEFINE_SPINLOCK(s3c_rtc_pie_lock);
@@ -562,8 +563,12 @@ static int s3c_rtc_suspend(struct platform_device *pdev, pm_message_t state)
562 } 563 }
563 s3c_rtc_enable(pdev, 0); 564 s3c_rtc_enable(pdev, 0);
564 565
565 if (device_may_wakeup(&pdev->dev)) 566 if (device_may_wakeup(&pdev->dev) && !wake_en) {
566 enable_irq_wake(s3c_rtc_alarmno); 567 if (enable_irq_wake(s3c_rtc_alarmno) == 0)
568 wake_en = true;
569 else
570 dev_err(&pdev->dev, "enable_irq_wake failed\n");
571 }
567 572
568 return 0; 573 return 0;
569} 574}
@@ -579,8 +584,10 @@ static int s3c_rtc_resume(struct platform_device *pdev)
579 writew(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON); 584 writew(tmp | ticnt_en_save, s3c_rtc_base + S3C2410_RTCCON);
580 } 585 }
581 586
582 if (device_may_wakeup(&pdev->dev)) 587 if (device_may_wakeup(&pdev->dev) && wake_en) {
583 disable_irq_wake(s3c_rtc_alarmno); 588 disable_irq_wake(s3c_rtc_alarmno);
589 wake_en = false;
590 }
584 591
585 return 0; 592 return 0;
586} 593}