diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-08-20 17:09:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-20 18:40:30 -0400 |
commit | d0fd93781c49cbe127f9e7a5b402e9b167c105a6 (patch) | |
tree | 1434323b3898dbb838b2f5cecf22b2bfc97906c8 | |
parent | 7f60459921bd24e86b21e07c42244c510b4f46b2 (diff) |
Blackfin RTC Driver: dont let RTC programming in bootloaders randomly cause ~5 second boot delays
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/rtc/rtc-bfin.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 9d2da1cd7773..34439ce3967e 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c | |||
@@ -363,6 +363,7 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev) | |||
363 | struct bfin_rtc *rtc; | 363 | struct bfin_rtc *rtc; |
364 | struct device *dev = &pdev->dev; | 364 | struct device *dev = &pdev->dev; |
365 | int ret = 0; | 365 | int ret = 0; |
366 | unsigned long timeout; | ||
366 | 367 | ||
367 | dev_dbg_stamp(dev); | 368 | dev_dbg_stamp(dev); |
368 | 369 | ||
@@ -377,6 +378,13 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev) | |||
377 | ret = request_irq(IRQ_RTC, bfin_rtc_interrupt, IRQF_SHARED, pdev->name, dev); | 378 | ret = request_irq(IRQ_RTC, bfin_rtc_interrupt, IRQF_SHARED, pdev->name, dev); |
378 | if (unlikely(ret)) | 379 | if (unlikely(ret)) |
379 | goto err; | 380 | goto err; |
381 | /* sometimes the bootloader touched things, but the write complete was not | ||
382 | * enabled, so let's just do a quick timeout here since the IRQ will not fire ... | ||
383 | */ | ||
384 | timeout = jiffies + HZ; | ||
385 | while (bfin_read_RTC_ISTAT() & RTC_ISTAT_WRITE_PENDING) | ||
386 | if (time_after(jiffies, timeout)) | ||
387 | break; | ||
380 | bfin_rtc_reset(dev, RTC_ISTAT_WRITE_COMPLETE); | 388 | bfin_rtc_reset(dev, RTC_ISTAT_WRITE_COMPLETE); |
381 | bfin_write_RTC_SWCNT(0); | 389 | bfin_write_RTC_SWCNT(0); |
382 | 390 | ||