mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-30 11:04:25 +00:00
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>
This commit is contained in:
parent
7f60459921
commit
d0fd93781c
1 changed files with 8 additions and 0 deletions
|
@ -363,6 +363,7 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev)
|
||||||
struct bfin_rtc *rtc;
|
struct bfin_rtc *rtc;
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
unsigned long timeout;
|
||||||
|
|
||||||
dev_dbg_stamp(dev);
|
dev_dbg_stamp(dev);
|
||||||
|
|
||||||
|
@ -377,6 +378,13 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev)
|
||||||
ret = request_irq(IRQ_RTC, bfin_rtc_interrupt, IRQF_SHARED, pdev->name, dev);
|
ret = request_irq(IRQ_RTC, bfin_rtc_interrupt, IRQF_SHARED, pdev->name, dev);
|
||||||
if (unlikely(ret))
|
if (unlikely(ret))
|
||||||
goto err;
|
goto err;
|
||||||
|
/* sometimes the bootloader touched things, but the write complete was not
|
||||||
|
* enabled, so let's just do a quick timeout here since the IRQ will not fire ...
|
||||||
|
*/
|
||||||
|
timeout = jiffies + HZ;
|
||||||
|
while (bfin_read_RTC_ISTAT() & RTC_ISTAT_WRITE_PENDING)
|
||||||
|
if (time_after(jiffies, timeout))
|
||||||
|
break;
|
||||||
bfin_rtc_reset(dev, RTC_ISTAT_WRITE_COMPLETE);
|
bfin_rtc_reset(dev, RTC_ISTAT_WRITE_COMPLETE);
|
||||||
bfin_write_RTC_SWCNT(0);
|
bfin_write_RTC_SWCNT(0);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue