Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
authorLinus Torvalds <torvalds@g5.osdl.org>
Fri, 5 Aug 2005 14:49:30 +0000 (07:49 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 5 Aug 2005 14:49:30 +0000 (07:49 -0700)
drivers/char/rtc.c
drivers/sbus/char/vfc.h
drivers/sbus/char/vfc_dev.c
drivers/sbus/char/vfc_i2c.c

index d8f9e94..cd4fe8b 100644 (file)
@@ -1209,6 +1209,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file)
 
 void rtc_get_rtc_time(struct rtc_time *rtc_tm)
 {
+       unsigned long uip_watchdog = jiffies;
        unsigned char ctrl;
 #ifdef CONFIG_MACH_DECSTATION
        unsigned int real_year;
@@ -1224,8 +1225,10 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm)
         * Once the read clears, read the RTC time (again via ioctl). Easy.
         */
 
-       if (rtc_is_updating() != 0)
-               msleep(20);
+       while (rtc_is_updating() != 0 && jiffies - uip_watchdog < 2*HZ/100) {
+               barrier();
+               cpu_relax();
+       }
 
        /*
         * Only the values that we read from the RTC are set. We leave
index e56a43a..a7782e7 100644 (file)
@@ -129,8 +129,6 @@ struct vfc_dev {
        struct vfc_regs *phys_regs;
        unsigned int control_reg;
        struct semaphore device_lock_sem;
-       struct timer_list poll_timer;
-       wait_queue_head_t poll_wait;
        int instance;
        int busy;
        unsigned long which_io;
index 86ce541..7a10369 100644 (file)
@@ -137,7 +137,6 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance)
        dev->instance=instance;
        init_MUTEX(&dev->device_lock_sem);
        dev->control_reg=0;
-       init_waitqueue_head(&dev->poll_wait);
        dev->busy=0;
        return 0;
 }
index 1faf1e7..739cad9 100644 (file)
@@ -79,25 +79,10 @@ int vfc_pcf8584_init(struct vfc_dev *dev)
        return 0;
 }
 
-void vfc_i2c_delay_wakeup(struct vfc_dev *dev) 
-{
-       /* Used to profile code and eliminate too many delays */
-       VFC_I2C_DEBUG_PRINTK(("vfc%d: Delaying\n", dev->instance));
-       wake_up(&dev->poll_wait);
-}
-
 void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs) 
 {
-       DEFINE_WAIT(wait);
-       init_timer(&dev->poll_timer);
-       dev->poll_timer.expires = jiffies + usecs_to_jiffies(usecs);
-       dev->poll_timer.data=(unsigned long)dev;
-       dev->poll_timer.function=(void *)(unsigned long)vfc_i2c_delay_wakeup;
-       add_timer(&dev->poll_timer);
-       prepare_to_wait(&dev->poll_wait, &wait, TASK_UNINTERRUPTIBLE);
-       schedule();
-       del_timer(&dev->poll_timer);
-       finish_wait(&dev->poll_wait, &wait);
+       set_current_state(TASK_UNINTERRUPTIBLE);
+       schedule_timeout(usecs_to_jiffies(usecs));
 }
 
 void inline vfc_i2c_delay(struct vfc_dev *dev)