summaryrefslogtreecommitdiffstats
path: root/drivers/char/ftape/lowlevel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
commit78c388aed2b7184182c08428db1de6c872d815f5 (patch)
tree4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /drivers/char/ftape/lowlevel
parenteb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff)
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'drivers/char/ftape/lowlevel')
-rw-r--r--drivers/char/ftape/lowlevel/fdc-io.c11
-rw-r--r--drivers/char/ftape/lowlevel/ftape-io.c7
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/char/ftape/lowlevel/fdc-io.c b/drivers/char/ftape/lowlevel/fdc-io.c
index 5441daee9..9fb9269f8 100644
--- a/drivers/char/ftape/lowlevel/fdc-io.c
+++ b/drivers/char/ftape/lowlevel/fdc-io.c
@@ -388,6 +388,8 @@ int fdc_interrupt_wait(unsigned int time)
struct wait_queue wait = {current, NULL};
sigset_t old_sigmask;
static int resetting = 0;
+ long timeout;
+
TRACE_FUN(ft_t_fdc_dma);
#if LINUX_VERSION_CODE >= KERNEL_VER(2,0,16)
@@ -400,8 +402,7 @@ int fdc_interrupt_wait(unsigned int time)
}
#endif
/* timeout time will be up to USPT microseconds too long ! */
- current->timeout = jiffies + (1000 * time + FT_USPT - 1) / FT_USPT;
- current->state = TASK_INTERRUPTIBLE;
+ timeout = (1000 * time + FT_USPT - 1) / FT_USPT;
spin_lock_irq(&current->sigmask_lock);
old_sigmask = current->blocked;
@@ -409,9 +410,10 @@ int fdc_interrupt_wait(unsigned int time)
recalc_sigpending(current);
spin_unlock_irq(&current->sigmask_lock);
+ current->state = TASK_INTERRUPTIBLE;
add_wait_queue(&ftape_wait_intr, &wait);
- while (!ft_interrupt_seen && current->state != TASK_RUNNING) {
- schedule(); /* sets TASK_RUNNING on timeout */
+ while (!ft_interrupt_seen && (current->state == TASK_INTERRUPTIBLE)) {
+ timeout = schedule_timeout(timeout);
}
spin_lock_irq(&current->sigmask_lock);
@@ -433,7 +435,6 @@ int fdc_interrupt_wait(unsigned int time)
*/
current->state = TASK_RUNNING;
if (ft_interrupt_seen) { /* woken up by interrupt */
- current->timeout = 0; /* interrupt hasn't cleared this */
ft_interrupt_seen = 0;
TRACE_EXIT 0;
}
diff --git a/drivers/char/ftape/lowlevel/ftape-io.c b/drivers/char/ftape/lowlevel/ftape-io.c
index e43da1e27..2fda1578b 100644
--- a/drivers/char/ftape/lowlevel/ftape-io.c
+++ b/drivers/char/ftape/lowlevel/ftape-io.c
@@ -89,17 +89,18 @@ void ftape_sleep(unsigned int time)
/* Time too small for scheduler, do a busy wait ! */
ftape_udelay(time);
} else {
+ long timeout;
unsigned long flags;
unsigned int ticks = (time + FT_USPT - 1) / FT_USPT;
TRACE(ft_t_any, "%d msec, %d ticks", time/1000, ticks);
- current->timeout = jiffies + ticks;
+ timeout = ticks;
current->state = TASK_INTERRUPTIBLE;
save_flags(flags);
sti();
do {
while (current->state != TASK_RUNNING) {
- schedule();
+ timeout = schedule_timeout(timeout);
}
/* Mmm. Isn't current->blocked == 0xffffffff ?
*/
@@ -108,7 +109,7 @@ void ftape_sleep(unsigned int time)
"awoken by non-blocked signal :-(");
break; /* exit on signal */
}
- } while (current->timeout > 0);
+ } while (timeout);
restore_flags(flags);
}
TRACE_EXIT;