[PATCH] Using msleep() instead of HZ

Use msleep() in a few places.

Signed-off-by: Luca Falavigna <dktrkranz@gmail.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Luca Falavigna and committed by Linus Torvalds 47f176fd 8d451687

+8 -17
+4 -12
drivers/char/rtc.c
··· 78 #include <linux/sysctl.h> 79 #include <linux/wait.h> 80 #include <linux/bcd.h> 81 82 #include <asm/current.h> 83 #include <asm/uaccess.h> ··· 895 struct proc_dir_entry *ent; 896 #if defined(__alpha__) || defined(__mips__) 897 unsigned int year, ctrl; 898 - unsigned long uip_watchdog; 899 char *guess = NULL; 900 #endif 901 #ifdef __sparc__ ··· 1000 /* Each operating system on an Alpha uses its own epoch. 1001 Let's try to guess which one we are using now. */ 1002 1003 - uip_watchdog = jiffies; 1004 if (rtc_is_updating() != 0) 1005 - while (jiffies - uip_watchdog < 2*HZ/100) { 1006 - barrier(); 1007 - cpu_relax(); 1008 - } 1009 1010 spin_lock_irq(&rtc_lock); 1011 year = CMOS_READ(RTC_YEAR); ··· 1209 1210 void rtc_get_rtc_time(struct rtc_time *rtc_tm) 1211 { 1212 - unsigned long uip_watchdog = jiffies; 1213 unsigned char ctrl; 1214 #ifdef CONFIG_MACH_DECSTATION 1215 unsigned int real_year; ··· 1216 1217 /* 1218 * read RTC once any update in progress is done. The update 1219 - * can take just over 2ms. We wait 10 to 20ms. There is no need to 1220 * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP. 1221 * If you need to know *exactly* when a second has started, enable 1222 * periodic update complete interrupts, (via ioctl) and then ··· 1225 */ 1226 1227 if (rtc_is_updating() != 0) 1228 - while (jiffies - uip_watchdog < 2*HZ/100) { 1229 - barrier(); 1230 - cpu_relax(); 1231 - } 1232 1233 /* 1234 * Only the values that we read from the RTC are set. We leave
··· 78 #include <linux/sysctl.h> 79 #include <linux/wait.h> 80 #include <linux/bcd.h> 81 + #include <linux/delay.h> 82 83 #include <asm/current.h> 84 #include <asm/uaccess.h> ··· 894 struct proc_dir_entry *ent; 895 #if defined(__alpha__) || defined(__mips__) 896 unsigned int year, ctrl; 897 char *guess = NULL; 898 #endif 899 #ifdef __sparc__ ··· 1000 /* Each operating system on an Alpha uses its own epoch. 1001 Let's try to guess which one we are using now. */ 1002 1003 if (rtc_is_updating() != 0) 1004 + msleep(20); 1005 1006 spin_lock_irq(&rtc_lock); 1007 year = CMOS_READ(RTC_YEAR); ··· 1213 1214 void rtc_get_rtc_time(struct rtc_time *rtc_tm) 1215 { 1216 unsigned char ctrl; 1217 #ifdef CONFIG_MACH_DECSTATION 1218 unsigned int real_year; ··· 1221 1222 /* 1223 * read RTC once any update in progress is done. The update 1224 + * can take just over 2ms. We wait 20ms. There is no need to 1225 * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP. 1226 * If you need to know *exactly* when a second has started, enable 1227 * periodic update complete interrupts, (via ioctl) and then ··· 1230 */ 1231 1232 if (rtc_is_updating() != 0) 1233 + msleep(20); 1234 1235 /* 1236 * Only the values that we read from the RTC are set. We leave
+4 -5
kernel/irq/autoprobe.c
··· 9 #include <linux/irq.h> 10 #include <linux/module.h> 11 #include <linux/interrupt.h> 12 13 /* 14 * Autodetection depends on the fact that any interrupt that ··· 27 */ 28 unsigned long probe_irq_on(void) 29 { 30 - unsigned long val, delay; 31 irq_desc_t *desc; 32 unsigned int i; 33 ··· 46 } 47 48 /* Wait for longstanding interrupts to trigger. */ 49 - for (delay = jiffies + HZ/50; time_after(delay, jiffies); ) 50 - /* about 20ms delay */ barrier(); 51 52 /* 53 * enable any unassigned irqs ··· 68 /* 69 * Wait for spurious interrupts to trigger 70 */ 71 - for (delay = jiffies + HZ/10; time_after(delay, jiffies); ) 72 - /* about 100ms delay */ barrier(); 73 74 /* 75 * Now filter out any obviously spurious interrupts
··· 9 #include <linux/irq.h> 10 #include <linux/module.h> 11 #include <linux/interrupt.h> 12 + #include <linux/delay.h> 13 14 /* 15 * Autodetection depends on the fact that any interrupt that ··· 26 */ 27 unsigned long probe_irq_on(void) 28 { 29 + unsigned long val; 30 irq_desc_t *desc; 31 unsigned int i; 32 ··· 45 } 46 47 /* Wait for longstanding interrupts to trigger. */ 48 + msleep(20); 49 50 /* 51 * enable any unassigned irqs ··· 68 /* 69 * Wait for spurious interrupts to trigger 70 */ 71 + msleep(100); 72 73 /* 74 * Now filter out any obviously spurious interrupts