diff options
Diffstat (limited to 'drivers/char/rtc.c')
-rw-r--r-- | drivers/char/rtc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index d8f9e94ae475..cd4fe8b1709f 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -1209,6 +1209,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file) | |||
1209 | 1209 | ||
1210 | void rtc_get_rtc_time(struct rtc_time *rtc_tm) | 1210 | void rtc_get_rtc_time(struct rtc_time *rtc_tm) |
1211 | { | 1211 | { |
1212 | unsigned long uip_watchdog = jiffies; | ||
1212 | unsigned char ctrl; | 1213 | unsigned char ctrl; |
1213 | #ifdef CONFIG_MACH_DECSTATION | 1214 | #ifdef CONFIG_MACH_DECSTATION |
1214 | unsigned int real_year; | 1215 | unsigned int real_year; |
@@ -1224,8 +1225,10 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm) | |||
1224 | * Once the read clears, read the RTC time (again via ioctl). Easy. | 1225 | * Once the read clears, read the RTC time (again via ioctl). Easy. |
1225 | */ | 1226 | */ |
1226 | 1227 | ||
1227 | if (rtc_is_updating() != 0) | 1228 | while (rtc_is_updating() != 0 && jiffies - uip_watchdog < 2*HZ/100) { |
1228 | msleep(20); | 1229 | barrier(); |
1230 | cpu_relax(); | ||
1231 | } | ||
1229 | 1232 | ||
1230 | /* | 1233 | /* |
1231 | * Only the values that we read from the RTC are set. We leave | 1234 | * Only the values that we read from the RTC are set. We leave |