lkml.org 
[lkml]   [1998]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: current->timeout = jiffies + ? -> schedule_timeout(?)
On Wed, 4 Nov 1998, Linus Torvalds wrote:

>
>
> On Wed, 4 Nov 1998, Stephen Frost wrote:
> >
> > Is everything that does a 'current->timeout = jiffies + x;' obsolete and
> > needing to be redone as 'schedule_timeout(x);'?
>
> Yes. However, I've done some of it already. Sending me patches is still a
> good idea, though.
>
> The areas that I haven't done are mainly:
> - non-PC drivers
> - ISDN
> - cdrom drivers
> - some of the more special serial and parallel port drivers

Okay, here is a patch for the ISDN, non-PC and some of the other
drivers. There were a couple (mcdx cdrom driver comes to mind) that did
some things w/ current->timeout values I wasn't sure I followed correctly
so I didn't modify them, someone w/ more experiance w/ those drivers and the
kernel in general will probably have to go through and fix those.

Also, I can't guarentee my modifications will even compile, but then,
without them I know it won't compile, so...

Here's the patch, there was another for ftape posted not too long ago
by someone else that I didn't include, if you want I'll send that along to you
as well.

Stephen

diff -u --recursive --new-file linux-2.1.127/arch/alpha/kernel/osf_sys.c linux/arch/alpha/kernel/osf_sys.c
--- linux-2.1.127/arch/alpha/kernel/osf_sys.c Sun Sep 13 13:22:17 1998
+++ linux/arch/alpha/kernel/osf_sys.c Thu Nov 5 08:24:56 1998
@@ -1306,6 +1306,7 @@
{
struct timeval tmp;
unsigned long ticks;
+ unsigned long tmp_timeout;

if (get_tv32(&tmp, sleep))
goto fault;
@@ -1313,18 +1314,17 @@
ticks = tmp.tv_usec;
ticks = (ticks + (1000000 / HZ) - 1) / (1000000 / HZ);
ticks += tmp.tv_sec * HZ;
- current->timeout = ticks + jiffies;
current->state = TASK_INTERRUPTIBLE;

- schedule();
+ tmp_timeout = schedule_timeout(ticks);

if (remain) {
ticks = jiffies;
- if (ticks < current->timeout)
- ticks = current->timeout - ticks;
+ if (ticks < tmp_timeout)
+ ticks = tmp_timeout - ticks;
else
ticks = 0;
- current->timeout = 0;
+ tmp_timeout = 0;
tmp.tv_sec = ticks / HZ;
tmp.tv_usec = ticks % HZ;
if (put_tv32(remain, &tmp))
diff -u --recursive --new-file linux-2.1.127/arch/m68k/atari/time.c linux/arch/m68k/atari/time.c
--- linux-2.1.127/arch/m68k/atari/time.c Sat Jun 13 16:14:32 1998
+++ linux/arch/m68k/atari/time.c Thu Nov 5 08:25:20 1998
@@ -279,8 +279,7 @@

while( RTC_READ(RTC_FREQ_SELECT) & RTC_UIP ) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + HWCLK_POLL_INTERVAL;
- schedule();
+ schedule_timeout(HWCLK_POLL_INTERVAL);
}

save_flags(flags);
diff -u --recursive --new-file linux-2.1.127/arch/mips/kernel/irixsig.c linux/arch/mips/kernel/irixsig.c
--- linux-2.1.127/arch/mips/kernel/irixsig.c Tue Oct 20 16:52:54 1998
+++ linux/arch/mips/kernel/irixsig.c Thu Nov 5 08:29:30 1998
@@ -603,21 +603,22 @@
error = -EINVAL;
goto out;
}
- expire = timespectojiffies(tp)+(tp->tv_sec||tp->tv_nsec)+jiffies;
- current->timeout = expire;
+ expire = timespectojiffies(tp)+(tp->tv_sec||tp->tv_nsec);
}

while(1) {
long tmp = 0;
+ long tmp_timeout = 0;

- current->state = TASK_INTERRUPTIBLE; schedule();
+ current->state = TASK_INTERRUPTIBLE;
+ tmp_timeout = schedule_timeout(expire);

for (i=0; i<=4; i++)
tmp |= (current->signal.sig[i] & kset.sig[i]);

if (tmp)
break;
- if (tp && expire <= jiffies) {
+ if (tp && tmp_timeout <= 0) {
timeo = 1;
break;
}
diff -u --recursive --new-file linux-2.1.127/arch/mips/kernel/sysirix.c linux/arch/mips/kernel/sysirix.c
--- linux-2.1.127/arch/mips/kernel/sysirix.c Tue Oct 20 16:52:54 1998
+++ linux/arch/mips/kernel/sysirix.c Thu Nov 5 08:30:54 1998
@@ -1083,10 +1083,11 @@
{
lock_kernel();
if(ticks) {
- current->timeout = ticks + jiffies;
current->state = TASK_INTERRUPTIBLE;
+ schedule_timeout(ticks);
}
- schedule();
+ else
+ schedule();
unlock_kernel();
return 0;
}
diff -u --recursive --new-file linux-2.1.127/arch/ppc/8xx_io/uart.c linux/arch/ppc/8xx_io/uart.c
--- linux-2.1.127/arch/ppc/8xx_io/uart.c Wed Sep 30 13:14:16 1998
+++ linux/arch/ppc/8xx_io/uart.c Thu Nov 5 09:02:01 1998
@@ -1314,12 +1314,11 @@
static void send_break(ser_info_t *info, int duration)
{
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + duration;
#ifdef SERIAL_DEBUG_SEND_BREAK
printk("rs_send_break(%d) jiff=%lu...", duration, jiffies);
#endif
begin_break(info);
- schedule();
+ schedule_timeout(duration);
end_break(info);
#ifdef SERIAL_DEBUG_SEND_BREAK
printk("done jiffies=%lu\n", jiffies);
@@ -1633,8 +1632,7 @@
if (info->blocked_open) {
if (info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + info->close_delay;
- schedule();
+ schedule_timeout(info->close_delay);
}
wake_up_interruptible(&info->open_wait);
}
@@ -1691,8 +1689,7 @@
#endif
current->state = TASK_INTERRUPTIBLE;
/* current->counter = 0; make us low-priority */
- current->timeout = jiffies + char_time;
- schedule();
+ schedule_timeout(char_time);
if (signal_pending(current))
break;
if (timeout && ((orig_jiffies + timeout) < jiffies))
diff -u --recursive --new-file linux-2.1.127/drivers/block/paride/pcd.c linux/drivers/block/paride/pcd.c
--- linux-2.1.127/drivers/block/paride/pcd.c Mon Sep 28 13:51:16 1998
+++ linux/drivers/block/paride/pcd.c Wed Nov 4 11:16:13 1998
@@ -559,8 +559,7 @@
static void pcd_sleep( int cs )

{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}

static int pcd_reset( int unit )
diff -u --recursive --new-file linux-2.1.127/drivers/block/paride/pf.c linux/drivers/block/paride/pf.c
--- linux-2.1.127/drivers/block/paride/pf.c Mon Sep 28 13:51:16 1998
+++ linux/drivers/block/paride/pf.c Wed Nov 4 11:16:09 1998
@@ -660,8 +660,7 @@
static void pf_sleep( int cs )

{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}


diff -u --recursive --new-file linux-2.1.127/drivers/block/paride/pg.c linux/drivers/block/paride/pg.c
--- linux-2.1.127/drivers/block/paride/pg.c Mon Sep 28 13:51:16 1998
+++ linux/drivers/block/paride/pg.c Wed Nov 4 11:16:01 1998
@@ -357,8 +357,7 @@
static void pg_sleep( int cs )

{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}

static int pg_wait( int unit, int go, int stop, int tmo, char * msg )
diff -u --recursive --new-file linux-2.1.127/drivers/block/paride/pt.c linux/drivers/block/paride/pt.c
--- linux-2.1.127/drivers/block/paride/pt.c Mon Sep 28 13:51:16 1998
+++ linux/drivers/block/paride/pt.c Wed Nov 4 11:15:56 1998
@@ -464,8 +464,7 @@
static void pt_sleep( int cs )

{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}

static int pt_poll_dsc( int unit, int pause, int tmo, char *msg )
diff -u --recursive --new-file linux-2.1.127/drivers/block/swim3.c linux/drivers/block/swim3.c
--- linux-2.1.127/drivers/block/swim3.c Fri Aug 28 18:18:04 1998
+++ linux/drivers/block/swim3.c Wed Nov 4 13:34:56 1998
@@ -740,8 +740,7 @@
break;
}
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
}
fs->ejected = 1;
release_drive(fs);
@@ -807,8 +806,7 @@
break;
}
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
}
if (err == 0 && (swim3_readbit(fs, SEEK_COMPLETE) == 0
|| swim3_readbit(fs, DISK_IN) == 0))
@@ -911,8 +909,7 @@
if (signal_pending(current))
break;
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
}
ret = swim3_readbit(fs, SEEK_COMPLETE) == 0
|| swim3_readbit(fs, DISK_IN) == 0;
diff -u --recursive --new-file linux-2.1.127/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
--- linux-2.1.127/drivers/cdrom/cdu31a.c Sat Oct 17 18:52:18 1998
+++ linux/drivers/cdrom/cdu31a.c Wed Nov 4 13:36:34 1998
@@ -409,8 +409,7 @@
if (cdu31a_irq <= 0)
{
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies;
- schedule();
+ schedule_timeout(0);
}
else /* Interrupt driven */
{
@@ -753,8 +752,7 @@
}

current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 2*HZ;
- schedule();
+ schedule_timeout(2*HZ);

sony_get_toc();
}
@@ -1012,8 +1010,7 @@
{
num_retries++;
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + HZ/10; /* Wait .1 seconds on retries */
- schedule();
+ schedule_timeout(HZ/10); /* Wait .1 seconds on retries */
goto retry_cd_operation;
}

diff -u --recursive --new-file linux-2.1.127/drivers/cdrom/mcd.c linux/drivers/cdrom/mcd.c
--- linux-2.1.127/drivers/cdrom/mcd.c Sat Jun 13 16:05:22 1998
+++ linux/drivers/cdrom/mcd.c Wed Nov 4 13:37:02 1998
@@ -1100,8 +1100,7 @@
return -EIO; /* drive doesn't respond */
if ((st & MST_READY) == 0) { /* no disk? wait a sec... */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + HZ;
- schedule();
+ schedule_timeout(HZ);
}
} while (((st & MST_READY) == 0) && count++ < MCD_RETRY_ATTEMPTS);

diff -u --recursive --new-file linux-2.1.127/drivers/cdrom/sbpcd.c linux/drivers/cdrom/sbpcd.c
--- linux-2.1.127/drivers/cdrom/sbpcd.c Mon Sep 14 14:34:01 1998
+++ linux/drivers/cdrom/sbpcd.c Thu Nov 5 07:57:59 1998
@@ -843,8 +843,7 @@
{
sti();
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + time;
- schedule();
+ schedule_timeout(time);
sti();
}
/*==========================================================================*/
diff -u --recursive --new-file linux-2.1.127/drivers/cdrom/sonycd535.c linux/drivers/cdrom/sonycd535.c
--- linux-2.1.127/drivers/cdrom/sonycd535.c Mon Aug 24 16:14:10 1998
+++ linux/drivers/cdrom/sonycd535.c Thu Nov 5 07:58:47 1998
@@ -336,8 +336,7 @@
{
if (sony535_irq_used <= 0) { /* poll */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies;
- schedule();
+ schedule_timeout(0);
} else { /* Interrupt driven */
cli();
enable_interrupts();
@@ -893,8 +892,7 @@
if (readStatus == BAD_STATUS) {
/* Sleep for a while, then retry */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + RETRY_FOR_BAD_STATUS;
- schedule();
+ schedule_timeout(RETRY_FOR_BAD_STATUS);
}
#if DEBUG > 0
printk(CDU535_MESSAGE_NAME
diff -u --recursive --new-file linux-2.1.127/drivers/char/pcxx.c linux/drivers/char/pcxx.c
--- linux-2.1.127/drivers/char/pcxx.c Wed May 20 21:54:37 1998
+++ linux/drivers/char/pcxx.c Thu Nov 5 08:01:33 1998
@@ -633,8 +633,7 @@
if(info->blocked_open) {
if(info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + info->close_delay;
- schedule();
+ schedule_timeout(info->close_delay);
}
wake_up_interruptible(&info->open_wait);
}
diff -u --recursive --new-file linux-2.1.127/drivers/char/radio-sf16fmi.c linux/drivers/char/radio-sf16fmi.c
--- linux-2.1.127/drivers/char/radio-sf16fmi.c Wed Nov 4 11:08:52 1998
+++ linux/drivers/char/radio-sf16fmi.c Thu Nov 5 08:02:10 1998
@@ -82,8 +82,7 @@
outbits(8, 0xC0, myport);
/* it is better than udelay(140000), isn't it? */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + HZ/7;
- schedule();
+ schedule_timeout(HZ/7);
/* ignore signals, we really should restore volume */
if (dev->curvol) fmi_unmute(myport);
return 0;
@@ -100,8 +99,7 @@
outb(val | 0x10, myport);
/* it is better than udelay(140000), isn't it? */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + HZ/7;
- schedule();
+ schedule_timeout(HZ/7);
/* do not do it..., 140ms is very looong time to get signal in real program
if (signal_pending(current))
return -EINTR;
diff -u --recursive --new-file linux-2.1.127/drivers/char/riscom8.c linux/drivers/char/riscom8.c
--- linux-2.1.127/drivers/char/riscom8.c Wed May 6 13:56:03 1998
+++ linux/drivers/char/riscom8.c Thu Nov 5 08:02:42 1998
@@ -1172,8 +1172,7 @@
timeout = jiffies+HZ;
while(port->IER & IER_TXEMPTY) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + port->timeout;
- schedule();
+ schedule_timeout(port->timeout);
if (jiffies > timeout)
break;
}
@@ -1189,8 +1188,7 @@
if (port->blocked_open) {
if (port->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + port->close_delay;
- schedule();
+ schedule_timeout(port->close_delay);
}
wake_up_interruptible(&port->open_wait);
}
diff -u --recursive --new-file linux-2.1.127/drivers/char/rocket.c linux/drivers/char/rocket.c
--- linux-2.1.127/drivers/char/rocket.c Tue Sep 1 13:32:36 1998
+++ linux/drivers/char/rocket.c Thu Nov 5 08:03:52 1998
@@ -1181,8 +1181,7 @@
if (info->blocked_open) {
if (info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + info->close_delay;
- schedule();
+ schedule_timeout(info->close_delay);
}
wake_up_interruptible(&info->open_wait);
} else {
@@ -1269,10 +1268,9 @@
static void send_break( struct r_port * info, int duration)
{
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + duration;
cli();
sSendBreak(&info->channel);
- schedule();
+ schedule_timeout(duration);
sClrBreak(&info->channel);
sti();
}
@@ -1666,8 +1664,7 @@
#endif
current->state = TASK_INTERRUPTIBLE;
current->counter = 0; /* make us low-priority */
- current->timeout = jiffies + check_time;
- schedule();
+ schedule_timeout(check_time);
if (signal_pending(current))
break;
}
diff -u --recursive --new-file linux-2.1.127/drivers/char/saa5249.c linux/drivers/char/saa5249.c
--- linux-2.1.127/drivers/char/saa5249.c Tue Oct 6 12:39:49 1998
+++ linux/drivers/char/saa5249.c Thu Nov 5 08:04:24 1998
@@ -242,8 +242,7 @@
recalc_sigpending(current);
spin_unlock_irq(&current->sigmask_lock);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + delay;
- schedule();
+ schedule_timeout(delay);

spin_lock_irq(&current->sigmask_lock);
current->blocked = oldblocked;
diff -u --recursive --new-file linux-2.1.127/drivers/char/serial167.c linux/drivers/char/serial167.c
--- linux-2.1.127/drivers/char/serial167.c Mon Oct 5 17:12:12 1998
+++ linux/drivers/char/serial167.c Thu Nov 5 08:04:44 1998
@@ -1952,8 +1952,7 @@
if (info->blocked_open) {
if (info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + info->close_delay;
- schedule();
+ schedule_timeout(info->close_delay);
}
wake_up_interruptible(&info->open_wait);
}
diff -u --recursive --new-file linux-2.1.127/drivers/char/specialix.c linux/drivers/char/specialix.c
--- linux-2.1.127/drivers/char/specialix.c Wed Nov 4 11:08:52 1998
+++ linux/drivers/char/specialix.c Thu Nov 5 08:05:21 1998
@@ -1551,8 +1551,7 @@
timeout = jiffies+HZ;
while(port->IER & IER_TXEMPTY) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + port->timeout;
- schedule();
+ schedule_timeout(port->timeout);
if (jiffies > timeout) {
printk (KERN_INFO "Timeout waiting for close\n");
break;
@@ -1571,8 +1570,7 @@
if (port->blocked_open) {
if (port->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + port->close_delay;
- schedule();
+ schedule_timeout(port->close_delay);
}
wake_up_interruptible(&port->open_wait);
}
diff -u --recursive --new-file linux-2.1.127/drivers/char/stallion.c linux/drivers/char/stallion.c
--- linux-2.1.127/drivers/char/stallion.c Fri Oct 23 11:26:04 1998
+++ linux/drivers/char/stallion.c Thu Nov 5 08:05:36 1998
@@ -1072,8 +1072,7 @@
#endif
if (len > 0) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + len;
- schedule();
+ schedule_timeout(len);
current->state = TASK_RUNNING;
}
}
diff -u --recursive --new-file linux-2.1.127/drivers/char/tpqic02.c linux/drivers/char/tpqic02.c
--- linux-2.1.127/drivers/char/tpqic02.c Fri Oct 9 14:56:59 1998
+++ linux/drivers/char/tpqic02.c Thu Nov 5 08:06:45 1998
@@ -588,9 +588,10 @@
/* not ready and no exception && timeout not expired yet */
while (((stat = inb_p(QIC02_STAT_PORT) & QIC02_STAT_MASK) == QIC02_STAT_MASK) && (jiffies<spin_t)) {
/* be `nice` to other processes on long operations... */
- current->timeout = jiffies + 3*HZ/10; /* nap 0.30 sec between checks, */
current->state = TASK_INTERRUPTIBLE;
- schedule(); /* but could be woken up earlier by signals... */
+ /* nap 0.30 sec between checks, */
+ /* but could be woken up earlier by signals... */
+ schedule_timeout(3*HZ/10);
}

/* don't use jiffies for this test because it may have changed by now */
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/act2000/act2000_isa.c linux/drivers/isdn/act2000/act2000_isa.c
--- linux-2.1.127/drivers/isdn/act2000/act2000_isa.c Thu May 21 17:24:06 1998
+++ linux/drivers/isdn/act2000/act2000_isa.c Thu Nov 5 08:34:29 1998
@@ -61,8 +61,7 @@
{
sti();
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + t;
- schedule();
+ schedule_timeout(t);
sti();
}

diff -u --recursive --new-file linux-2.1.127/drivers/isdn/avmb1/b1capi.c linux/drivers/isdn/avmb1/b1capi.c
--- linux-2.1.127/drivers/isdn/avmb1/b1capi.c Wed Apr 1 19:20:57 1998
+++ linux/drivers/isdn/avmb1/b1capi.c Thu Nov 5 08:34:58 1998
@@ -965,9 +965,8 @@

while (card->cardstate != CARD_RUNNING) {

- current->timeout = jiffies + HZ / 10; /* 0.1 sec */
current->state = TASK_INTERRUPTIBLE;
- schedule();
+ schedule_timeout(HZ/10); /* 0.1 sec */

if (signal_pending(current))
return -EINTR;
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/hisax/arcofi.c linux/drivers/isdn/hisax/arcofi.c
--- linux-2.1.127/drivers/isdn/hisax/arcofi.c Wed Apr 1 19:20:57 1998
+++ linux/drivers/isdn/hisax/arcofi.c Thu Nov 5 08:35:34 1998
@@ -40,8 +40,7 @@
while (cnt && !test_bit(HW_MON1_TX_END, &cs->HW_Flags)) {
cnt--;
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (10 * HZ) / 1000; /* Timeout 10ms */
- schedule();
+ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
}
restore_flags(flags);
sprintf(tmp, "arcofi tout %d", cnt);
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/hisax/asuscom.c linux/drivers/isdn/hisax/asuscom.c
--- linux-2.1.127/drivers/isdn/hisax/asuscom.c Wed Apr 1 19:20:57 1998
+++ linux/drivers/isdn/hisax/asuscom.c Thu Nov 5 08:36:03 1998
@@ -201,12 +201,10 @@
save_flags(flags);
sti();
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
byteout(cs->hw.asus.adr, 0); /* Reset Off */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
restore_flags(flags);
}

diff -u --recursive --new-file linux-2.1.127/drivers/isdn/hisax/diva.c linux/drivers/isdn/hisax/diva.c
--- linux-2.1.127/drivers/isdn/hisax/diva.c Wed Apr 1 19:20:58 1998
+++ linux/drivers/isdn/hisax/diva.c Thu Nov 5 08:36:49 1998
@@ -241,13 +241,11 @@
cs->hw.diva.ctrl_reg = 0; /* Reset On */
byteout(cs->hw.diva.ctrl, cs->hw.diva.ctrl_reg);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (10 * HZ) / 1000; /* Timeout 10ms */
- schedule();
+ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
cs->hw.diva.ctrl_reg |= DIVA_RESET; /* Reset Off */
byteout(cs->hw.diva.ctrl, cs->hw.diva.ctrl_reg);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (10 * HZ) / 1000; /* Timeout 10ms */
- schedule();
+ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
if (cs->subtyp == DIVA_ISA)
cs->hw.diva.ctrl_reg |= DIVA_ISA_LED_A;
else
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/hisax/elsa.c linux/drivers/isdn/hisax/elsa.c
--- linux-2.1.127/drivers/isdn/hisax/elsa.c Wed Apr 1 19:20:58 1998
+++ linux/drivers/isdn/hisax/elsa.c Thu Nov 5 08:37:49 1998
@@ -450,12 +450,10 @@
sti();
writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_POTA2, 0x20);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (10 * HZ) / 1000; /* Timeout 10ms */
- schedule();
+ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_POTA2, 0x00);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (10 * HZ) / 1000; /* Timeout 10ms */
- schedule();
+ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
writereg(cs->hw.elsa.ale, cs->hw.elsa.isac, IPAC_MASK, 0xc0);
schedule();
restore_flags(flags);
@@ -658,8 +656,7 @@
} else
return(0);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (110 * HZ) / 1000; /* Timeout 110ms */
- schedule();
+ schedule_timeout((110*HZ)/1000); /* Timeout 110ms */
restore_flags(flags);
cs->hw.elsa.ctrl_reg &= ~ELSA_ENA_TIMER_INT;
byteout(cs->hw.elsa.ctrl, cs->hw.elsa.ctrl_reg);
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/hisax/netjet.c linux/drivers/isdn/hisax/netjet.c
--- linux-2.1.127/drivers/isdn/hisax/netjet.c Wed Apr 1 19:21:02 1998
+++ linux/drivers/isdn/hisax/netjet.c Thu Nov 5 08:38:21 1998
@@ -971,13 +971,11 @@
cs->hw.njet.ctrl_reg = 0xff; /* Reset On */
byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (10 * HZ) / 1000; /* Timeout 10ms */
- schedule();
+ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
cs->hw.njet.ctrl_reg = 0x00; /* Reset Off and status read clear */
byteout(cs->hw.njet.base + NETJET_CTRL, cs->hw.njet.ctrl_reg);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (10 * HZ) / 1000; /* Timeout 10ms */
- schedule();
+ schedule_timeout((10*HZ)/1000); /* Timeout 10ms */
restore_flags(flags);
cs->hw.njet.auxd = 0;
cs->hw.njet.dmactrl = 0;
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/hisax/sedlbauer.c linux/drivers/isdn/hisax/sedlbauer.c
--- linux-2.1.127/drivers/isdn/hisax/sedlbauer.c Wed Apr 1 19:21:02 1998
+++ linux/drivers/isdn/hisax/sedlbauer.c Thu Nov 5 08:38:42 1998
@@ -242,12 +242,10 @@
save_flags(flags);
sti();
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
byteout(cs->hw.sedl.reset_off, 0); /* Reset Off */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
restore_flags(flags);
}
}
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/hisax/sportster.c linux/drivers/isdn/hisax/sportster.c
--- linux-2.1.127/drivers/isdn/hisax/sportster.c Wed Apr 1 19:21:02 1998
+++ linux/drivers/isdn/hisax/sportster.c Thu Nov 5 08:39:10 1998
@@ -165,13 +165,11 @@
save_flags(flags);
sti();
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
cs->hw.spt.res_irq &= ~SPORTSTER_RESET; /* Reset Off */
byteout(cs->hw.spt.cfg_reg + SPORTSTER_RES_IRQ, cs->hw.spt.res_irq);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
restore_flags(flags);
}

diff -u --recursive --new-file linux-2.1.127/drivers/isdn/hisax/teleint.c linux/drivers/isdn/hisax/teleint.c
--- linux-2.1.127/drivers/isdn/hisax/teleint.c Wed Apr 1 19:21:02 1998
+++ linux/drivers/isdn/hisax/teleint.c Thu Nov 5 08:39:31 1998
@@ -246,13 +246,11 @@
save_flags(flags);
sti();
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 3;
- schedule();
+ schedule_timeout(3);
cs->hw.hfc.cirm &= ~HFC_RESET;
byteout(cs->hw.hfc.addr | 1, cs->hw.hfc.cirm); /* Reset Off */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
restore_flags(flags);
}

diff -u --recursive --new-file linux-2.1.127/drivers/isdn/hisax/teles3c.c linux/drivers/isdn/hisax/teles3c.c
--- linux-2.1.127/drivers/isdn/hisax/teles3c.c Wed Apr 1 19:21:02 1998
+++ linux/drivers/isdn/hisax/teles3c.c Thu Nov 5 08:40:05 1998
@@ -79,13 +79,11 @@
save_flags(flags);
sti();
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 3;
- schedule();
+ schedule_timeout(3);
cs->hw.hfcD.cirm = HFCD_MEM8K;
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_CIRM, cs->hw.hfcD.cirm); /* Reset Off */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
cs->hw.hfcD.cirm |= HFCD_INTB;
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_CIRM, cs->hw.hfcD.cirm); /* INT B */
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_CLKDEL, 0x0e);
@@ -136,8 +134,7 @@
save_flags(flags);
sti();
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (80*HZ)/1000;
- schedule();
+ schedule_timeout((80*HZ)/1000);
cs->hw.hfcD.ctmt |= HFCD_TIM800;
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_CTMT, cs->hw.hfcD.ctmt);
cs->BC_Write_Reg(cs, HFCD_DATA, HFCD_MST_MODE, cs->hw.hfcD.mst_m);
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/icn/icn.c linux/drivers/isdn/icn/icn.c
--- linux-2.1.127/drivers/isdn/icn/icn.c Thu May 21 17:24:06 1998
+++ linux/drivers/isdn/icn/icn.c Thu Nov 5 08:41:24 1998
@@ -914,8 +914,7 @@
printk(KERN_DEBUG "Loader %d TO?\n", cardnumber);
#endif
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + ICN_BOOT_TIMEOUT1;
- schedule();
+ schedule_timeout(ICN_BOOT_TIMEOUT1);
} else {
#ifdef BOOT_DEBUG
printk(KERN_DEBUG "Loader %d OK\n", cardnumber);
@@ -941,8 +940,7 @@
printk(KERN_DEBUG "SLEEP(%d)\n",slsec); \
while (slsec) { \
current->state = TASK_INTERRUPTIBLE; \
- current->timeout = jiffies + HZ; \
- schedule(); \
+ schedule_timeout(HZ); \
slsec--; \
} \
}
@@ -1104,8 +1102,7 @@
return -EIO;
}
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 10;
- schedule();
+ schedule_timeout(10);
}
}
writeb(0x20, &sbuf_n);
@@ -1129,8 +1126,7 @@
printk(KERN_DEBUG "Proto TO?\n");
#endif
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + ICN_BOOT_TIMEOUT1;
- schedule();
+ schedule_timeout(ICN_BOOT_TIMEOUT1);
} else {
if ((card->secondhalf) || (!card->doubleS0)) {
#ifdef BOOT_DEBUG
@@ -1425,11 +1421,9 @@
if (!card->leased) {
card->leased = 1;
while (card->ptype == ISDN_PTYPE_UNKNOWN) {
- current->timeout = jiffies + ICN_BOOT_TIMEOUT1;
- schedule();
+ schedule_timeout(ICN_BOOT_TIMEOUT1);
}
- current->timeout = jiffies + ICN_BOOT_TIMEOUT1;
- schedule();
+ schedule_timeout(ICN_BOOT_TIMEOUT1);
sprintf(cbuf, "00;FV2ON\n01;EAZ%c\n02;EAZ%c\n",
(a & 1)?'1':'C', (a & 2)?'2':'C');
i = icn_writecmd(cbuf, strlen(cbuf), 0, card);
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/sc/init.c linux/drivers/isdn/sc/init.c
--- linux-2.1.127/drivers/isdn/sc/init.c Wed Apr 1 19:21:04 1998
+++ linux/drivers/isdn/sc/init.c Thu Nov 5 08:42:10 1998
@@ -165,8 +165,7 @@
pr_debug("Doing a SAFE probe reset\n");
outb(0xFF, io[b] + RESET_OFFSET);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + milliseconds(10000);
- schedule();
+ schedule_timeout(milliseconds(10000));
}
pr_debug("RAM Base for board %d is 0x%x, %s probe\n", b, ram[b],
ram[b] == 0 ? "will" : "won't");
@@ -514,8 +513,7 @@
*/
outb(PRI_BASEPG_VAL, pgport);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + HZ;
- schedule();
+ schedule_timeout(HZ);
sig = readl(rambase + SIG_OFFSET);
pr_debug("Looking for a signature, got 0x%x\n", sig);
#if 0
@@ -535,8 +533,7 @@
*/
outb(BRI_BASEPG_VAL, pgport);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + HZ;
- schedule();
+ schedule_timeout(HZ);
sig = readl(rambase + SIG_OFFSET);
pr_debug("Looking for a signature, got 0x%x\n", sig);
#if 0
@@ -571,8 +568,7 @@
x = 0;
while((inb(iobase + FIFOSTAT_OFFSET) & RF_HAS_DATA) && x < 100) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
x++;
}
if(x == 100) {
diff -u --recursive --new-file linux-2.1.127/drivers/isdn/sc/message.c linux/drivers/isdn/sc/message.c
--- linux-2.1.127/drivers/isdn/sc/message.c Wed Apr 1 19:21:04 1998
+++ linux/drivers/isdn/sc/message.c Thu Nov 5 08:42:26 1998
@@ -267,8 +267,7 @@
/* wait for the response */
while (tries < timeout) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);

pr_debug("SAR waiting..\n");

diff -u --recursive --new-file linux-2.1.127/drivers/macintosh/macserial.c linux/drivers/macintosh/macserial.c
--- linux-2.1.127/drivers/macintosh/macserial.c Tue Aug 4 19:08:05 1998
+++ linux/drivers/macintosh/macserial.c Thu Nov 5 08:07:17 1998
@@ -1264,8 +1264,7 @@
if (info->blocked_open) {
if (info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + info->close_delay;
- schedule();
+ schedule_timeout(info->close_delay);
}
wake_up_interruptible(&info->open_wait);
}
@@ -1301,8 +1300,7 @@
while ((read_zsreg(info->zs_channel, 1) & ALL_SNT) == 0) {
current->state = TASK_INTERRUPTIBLE;
current->counter = 0; /* make us low-priority */
- current->timeout = jiffies + char_time;
- schedule();
+ schedule_timeout(char_time);
if (signal_pending(current))
break;
if (timeout && ((orig_jiffies + timeout) < jiffies))
diff -u --recursive --new-file linux-2.1.127/drivers/macintosh/mediabay.c linux/drivers/macintosh/mediabay.c
--- linux-2.1.127/drivers/macintosh/mediabay.c Fri May 8 03:25:50 1998
+++ linux/drivers/macintosh/mediabay.c Thu Nov 5 08:07:42 1998
@@ -184,8 +184,7 @@

prev = media_bay_id;
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 1;
- schedule();
+ schedule_timeout(1);
if (signal_pending(current))
return 0;
}
diff -u --recursive --new-file linux-2.1.127/drivers/net/cs89x0.c linux/drivers/net/cs89x0.c
--- linux-2.1.127/drivers/net/cs89x0.c Fri Feb 20 21:28:22 1998
+++ linux/drivers/net/cs89x0.c Thu Nov 5 08:07:57 1998
@@ -403,8 +403,7 @@

/* wait 30 ms */
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + 3;
- schedule();
+ schedule_timeout(3);

if (lp->chip_type != CS8900) {
/* Hardware problem requires PNP registers to be reconfigured after a reset */
diff -u --recursive --new-file linux-2.1.127/drivers/net/sktr.c linux/drivers/net/sktr.c
--- linux-2.1.127/drivers/net/sktr.c Fri Oct 9 14:56:59 1998
+++ linux/drivers/net/sktr.c Thu Nov 5 08:09:48 1998
@@ -1526,11 +1526,10 @@
{
long tmp;

- tmp = jiffies + time/(1000000/HZ);
+ tmp = time/(1000000/HZ);
do {
- current->timeout = tmp;
current->state = TASK_INTERRUPTIBLE;
- schedule();
+ tmp = schedule_timeout(tmp);
} while(tmp > jiffies);

return;
diff -u --recursive --new-file linux-2.1.127/drivers/sbus/char/pcikbd.c linux/drivers/sbus/char/pcikbd.c
--- linux-2.1.127/drivers/sbus/char/pcikbd.c Wed Nov 4 11:08:53 1998
+++ linux/drivers/sbus/char/pcikbd.c Thu Nov 5 08:42:52 1998
@@ -691,8 +691,7 @@
== AUX_STAT_OBF)
pcimouse_inb(pcimouse_iobase + KBD_DATA_REG);
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + (5*HZ + 99) / 100;
- schedule();
+ schedule_timeout((5*HZ + 99)/100);
retries++;
}
return (retries < MAX_RETRIES);
diff -u --recursive --new-file linux-2.1.127/drivers/sbus/char/sab82532.c linux/drivers/sbus/char/sab82532.c
--- linux-2.1.127/drivers/sbus/char/sab82532.c Wed Nov 4 11:08:54 1998
+++ linux/drivers/sbus/char/sab82532.c Thu Nov 5 08:43:21 1998
@@ -1629,8 +1629,7 @@
if (info->blocked_open) {
if (info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + info->close_delay;
- schedule();
+ schedule_timeout(info->close_delay);
}
wake_up_interruptible(&info->open_wait);
}
@@ -1674,8 +1673,7 @@
while (info->xmit_cnt || !info->all_sent) {
current->state = TASK_INTERRUPTIBLE;
current->counter = 0;
- current->timeout = jiffies + char_time;
- schedule();
+ schedule_timeout(char_time);
if (signal_pending(current))
break;
if (timeout && (orig_jiffies + timeout) < jiffies)
diff -u --recursive --new-file linux-2.1.127/drivers/sbus/char/su.c linux/drivers/sbus/char/su.c
--- linux-2.1.127/drivers/sbus/char/su.c Wed Nov 4 11:08:54 1998
+++ linux/drivers/sbus/char/su.c Thu Nov 5 08:43:49 1998
@@ -1744,8 +1744,7 @@
if (info->blocked_open) {
if (info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + info->close_delay;
- schedule();
+ schedule_timeout(info->close_delay);
}
wake_up_interruptible(&info->open_wait);
}
@@ -1797,8 +1796,7 @@
#endif
current->state = TASK_INTERRUPTIBLE;
current->counter = 0; /* make us low-priority */
- current->timeout = jiffies + char_time;
- schedule();
+ schedule_timeout(char_time);
if (signal_pending(current))
break;
if (timeout && ((orig_jiffies + timeout) < jiffies))
diff -u --recursive --new-file linux-2.1.127/drivers/sbus/char/zs.c linux/drivers/sbus/char/zs.c
--- linux-2.1.127/drivers/sbus/char/zs.c Wed Nov 4 11:08:54 1998
+++ linux/drivers/sbus/char/zs.c Thu Nov 5 08:45:41 1998
@@ -1354,10 +1354,9 @@
if (!info->port)
return;
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + duration;
cli();
write_zsreg(info->zs_channel, 5, (info->curregs[5] | SND_BRK));
- schedule();
+ schedule_timeout(duration);
write_zsreg(info->zs_channel, 5, info->curregs[5]);
sti();
}
@@ -1543,8 +1542,7 @@
if (info->blocked_open) {
if (info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + info->close_delay;
- schedule();
+ schedule_timeout(info->close_delay);
}
wake_up_interruptible(&info->open_wait);
}
diff -u --recursive --new-file linux-2.1.127/drivers/sgi/char/sgiserial.c linux/drivers/sgi/char/sgiserial.c
--- linux-2.1.127/drivers/sgi/char/sgiserial.c Fri May 8 03:23:41 1998
+++ linux/drivers/sgi/char/sgiserial.c Thu Nov 5 08:46:12 1998
@@ -1279,10 +1279,9 @@
if (!info->port)
return;
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + duration;
cli();
write_zsreg(info->zs_channel, 5, (info->curregs[5] | SND_BRK));
- schedule();
+ schedule_timeout(duration);
write_zsreg(info->zs_channel, 5, info->curregs[5]);
sti();
}
@@ -1483,8 +1482,7 @@
if (info->blocked_open) {
if (info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + info->close_delay;
- schedule();
+ schedule_timeout(info->close_delay);
}
wake_up_interruptible(&info->open_wait);
}
diff -u --recursive --new-file linux-2.1.127/drivers/sound/cs4232.c linux/drivers/sound/cs4232.c
--- linux-2.1.127/drivers/sound/cs4232.c Wed Jul 22 16:45:52 1998
+++ linux/drivers/sound/cs4232.c Thu Nov 5 08:10:19 1998
@@ -96,9 +96,7 @@
static void sleep(unsigned howlong)
{
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + howlong;
- schedule();
- current->timeout = 0;
+ schedule_timeout(howlong);
}

int probe_cs4232(struct address_info *hw_config)
diff -u --recursive --new-file linux-2.1.127/drivers/sound/es1370.c linux/drivers/sound/es1370.c
--- linux-2.1.127/drivers/sound/es1370.c Wed Nov 4 11:08:56 1998
+++ linux/drivers/sound/es1370.c Thu Nov 5 08:14:37 1998
@@ -1017,11 +1017,8 @@
}
tmo = (count * HZ) / dac1_samplerate[(s->ctrl & CTRL_WTSRSEL) >> CTRL_SH_WTSRSEL];
tmo >>= sample_shift[(s->sctrl & SCTRL_P1FMT) >> SCTRL_SH_P1FMT];
- current->timeout = jiffies + (tmo ? tmo : 1);
- schedule();
- if (tmo && !current->timeout)
+ if (tmo && !schedule_timeout(two ? two : 1))
printk(KERN_DEBUG "es1370: dma timed out??\n");
- current->timeout = 0;
}
remove_wait_queue(&s->dma_dac1.wait, &wait);
current->state = TASK_RUNNING;
@@ -1055,11 +1052,9 @@
}
tmo = (count * HZ) / DAC2_DIVTOSR((s->ctrl & CTRL_PCLKDIV) >> CTRL_SH_PCLKDIV);
tmo >>= sample_shift[(s->sctrl & SCTRL_P2FMT) >> SCTRL_SH_P2FMT];
- current->timeout = jiffies + (tmo ? tmo : 1);
- schedule();
- if (tmo && !current->timeout)
+ schedule_timeout(two ? two : 1);
+ if (tmo && !schedule_timeout(two ? two : 1))
printk(KERN_DEBUG "es1370: dma timed out??\n");
- current->timeout = 0;
}
remove_wait_queue(&s->dma_dac2.wait, &wait);
current->state = TASK_RUNNING;
@@ -2201,11 +2196,8 @@
return -EBUSY;
}
tmo = (count * HZ) / 3100;
- current->timeout = tmo ? jiffies + tmo : 0;
- schedule();
- if (tmo && !current->timeout)
+ if (tmo && !schedule_timeout(two ? tmo : 0))
printk(KERN_DEBUG "es1370: midi timed out??\n");
- current->timeout = 0;
}
remove_wait_queue(&s->midi.owait, &wait);
current->state = TASK_RUNNING;
diff -u --recursive --new-file linux-2.1.127/drivers/sound/es1371.c linux/drivers/sound/es1371.c
--- linux-2.1.127/drivers/sound/es1371.c Fri Sep 4 18:32:27 1998
+++ linux/drivers/sound/es1371.c Thu Nov 5 08:15:52 1998
@@ -1462,11 +1462,8 @@
}
tmo = (count * HZ) / s->dac1rate;
tmo >>= sample_shift[(s->sctrl & SCTRL_P1FMT) >> SCTRL_SH_P1FMT];
- current->timeout = jiffies + (tmo ? tmo : 1);
- schedule();
- if (tmo && !current->timeout)
+ if (tmo && !schedule_timeout(tmo ? tmo : 1))
printk(KERN_DEBUG "es1371: dma timed out??\n");
- current->timeout = 0;
}
remove_wait_queue(&s->dma_dac1.wait, &wait);
current->state = TASK_RUNNING;
@@ -1500,11 +1497,8 @@
}
tmo = (count * HZ) / s->dac2rate;
tmo >>= sample_shift[(s->sctrl & SCTRL_P2FMT) >> SCTRL_SH_P2FMT];
- current->timeout = jiffies + (tmo ? tmo : 1);
- schedule();
- if (tmo && !current->timeout)
+ if (tmo && !schedule_timeout(tmo ? tmo : 1))
printk(KERN_DEBUG "es1371: dma timed out??\n");
- current->timeout = 0;
}
remove_wait_queue(&s->dma_dac2.wait, &wait);
current->state = TASK_RUNNING;
@@ -2635,11 +2629,8 @@
return -EBUSY;
}
tmo = (count * HZ) / 3100;
- current->timeout = tmo ? jiffies + tmo : 0;
- schedule();
- if (tmo && !current->timeout)
+ if (tmo && !schedule_timeout(tmo ? tmo : 0))
printk(KERN_DEBUG "es1371: midi timed out??\n");
- current->timeout = 0;
}
remove_wait_queue(&s->midi.owait, &wait);
current->state = TASK_RUNNING;
diff -u --recursive --new-file linux-2.1.127/drivers/sound/maui.c linux/drivers/sound/maui.c
--- linux-2.1.127/drivers/sound/maui.c Thu May 14 13:33:17 1998
+++ linux/drivers/sound/maui.c Thu Nov 5 08:16:42 1998
@@ -81,10 +81,8 @@
{
if (inb(HOST_STAT_PORT) & mask)
return 1;
- current->timeout = jiffies + HZ / 10;
current->state = TASK_INTERRUPTIBLE;
- schedule();
- current->timeout = 0;
+ schedule_timeout(HZ/10);
if (signal_pending(current))
return 0;
}
diff -u --recursive --new-file linux-2.1.127/drivers/sound/sgalaxy.c linux/drivers/sound/sgalaxy.c
--- linux-2.1.127/drivers/sound/sgalaxy.c Sat Oct 17 18:33:46 1998
+++ linux/drivers/sound/sgalaxy.c Thu Nov 5 08:17:55 1998
@@ -29,9 +29,7 @@
static void sleep( unsigned howlong )
{
current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + howlong;
- schedule();
- current->timeout = 0;
+ schedule_timeout(howlong);
}

#define DPORT 0x80
diff -u --recursive --new-file linux-2.1.127/drivers/sound/sonicvibes.c linux/drivers/sound/sonicvibes.c
--- linux-2.1.127/drivers/sound/sonicvibes.c Fri Sep 4 18:32:27 1998
+++ linux/drivers/sound/sonicvibes.c Thu Nov 5 08:18:55 1998
@@ -1245,11 +1245,8 @@
}
tmo = (count * HZ) / s->ratedac;
tmo >>= sample_shift[(s->fmt >> SV_CFMT_ASHIFT) & SV_CFMT_MASK];
- current->timeout = jiffies + (tmo ? tmo : 1);
- schedule();
- if (tmo && !current->timeout)
+ if (tmo && !schedule_timeout(tmo ? tmo : 1))
printk(KERN_DEBUG "sv: dma timed out??\n");
- current->timeout = 0;
}
remove_wait_queue(&s->dma_dac.wait, &wait);
current->state = TASK_RUNNING;
@@ -2025,11 +2022,8 @@
return -EBUSY;
}
tmo = (count * HZ) / 3100;
- current->timeout = tmo ? jiffies + tmo : 0;
- schedule();
- if (tmo && !current->timeout)
+ if (tmo && !schedule_timeout(tmo ? tmo : 0))
printk(KERN_DEBUG "sv: midi timed out??\n");
- current->timeout = 0;
}
remove_wait_queue(&s->midi.owait, &wait);
current->state = TASK_RUNNING;
diff -u --recursive --new-file linux-2.1.127/fs/ncpfs/sock.c linux/fs/ncpfs/sock.c
--- linux-2.1.127/fs/ncpfs/sock.c Fri Mar 6 20:37:42 1998
+++ linux/fs/ncpfs/sock.c Thu Nov 5 09:07:49 1998
@@ -94,7 +94,7 @@
poll_table wait_table;
struct poll_table_entry entry;
int init_timeout, max_timeout;
- int timeout;
+ int timeout; long tmp_timeout;
int retrans;
int major_timeout_seen;
int acknowledge_seen;
@@ -182,17 +182,16 @@
}
timeout = max_timeout;
}
- current->timeout = jiffies + timeout;
- schedule();
+ tmp_timout = schedule_timeout(timeout);
remove_wait_queue(entry.wait_address, &entry.wait);
fput(file);
current->state = TASK_RUNNING;
if (signal_pending(current)) {
- current->timeout = 0;
+ tmp_timout = 0;
result = -ERESTARTSYS;
break;
}
- if (!current->timeout) {
+ if (!tmp_timout) {
if (n < retrans)
continue;
if (server->m.flags & NCP_MOUNT_SOFT) {
@@ -209,7 +208,7 @@
major_timeout_seen = 1;
continue;
} else
- current->timeout = 0;
+ tmp_timeout = 0;
} else if (wait_table.nr) {
remove_wait_queue(entry.wait_address, &entry.wait);
fput(file);
diff -u --recursive --new-file linux-2.1.127/net/appletalk/ddp.c linux/net/appletalk/ddp.c
--- linux-2.1.127/net/appletalk/ddp.c Thu Aug 27 22:33:08 1998
+++ linux/net/appletalk/ddp.c Thu Nov 5 08:22:59 1998
@@ -383,9 +383,8 @@
/*
* Defer 1/10th
*/
- current->timeout = jiffies + (HZ/10);
current->state = TASK_INTERRUPTIBLE;
- schedule();
+ schedule_timeout(HZ/10);
if(atif->status & ATIF_PROBE_FAIL)
break;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.077 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site