Title: [9087] trunk/drivers/rtc/rtc-bfin.c: rtc-bfin: fix resume path -- wait for the rtc to sync its state to the core and restore the core write complete interrupt
- Revision
- 9087
- Author
- vapier
- Date
- 2010-08-16 17:30:19 -0400 (Mon, 16 Aug 2010)
Log Message
rtc-bfin: fix resume path -- wait for the rtc to sync its state to the core and restore the core write complete interrupt
Modified Paths
Diff
Modified: trunk/drivers/rtc/rtc-bfin.c (9086 => 9087)
--- trunk/drivers/rtc/rtc-bfin.c 2010-08-16 21:26:39 UTC (rev 9086)
+++ trunk/drivers/rtc/rtc-bfin.c 2010-08-16 21:30:19 UTC (rev 9087)
@@ -435,9 +435,18 @@
{
if (device_may_wakeup(&pdev->dev))
disable_irq_wake(IRQ_RTC);
- else
- bfin_write_RTC_ISTAT(-1);
+ /*
+ * Since only some of the RTC bits are maintained externally in the
+ * Vbat domain, we need to wait for the RTC MMRs to be synced into
+ * the core after waking up. This happens every RTC 1HZ. Once that
+ * has happened, we can go ahead and re-enable the important write
+ * complete interrupt event.
+ */
+ while (!(bfin_read_RTC_ISTAT() & RTC_ISTAT_SEC))
+ continue;
+ bfin_rtc_int_set(RTC_ISTAT_WRITE_COMPLETE);
+
return 0;
}
#else
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits