Re: [patch] jiffies wraparound [Re: 2.1.125 Show stopper list: Draft]

Andrea Arcangeli (andrea@e-mind.com)
Thu, 15 Oct 1998 00:50:24 +0200 (CEST)


On Wed, 14 Oct 1998, Andrea Arcangeli wrote:

>On Tue, 13 Oct 1998, Andrea Arcangeli wrote:
>
>>Here a fix for the drivers/scsi and drivers/char and include/linux
>>directories. The patch is against 2.1.125 + my parport update that I
>>sent to Linus some days ago.
>
>Here a new incremental patch against my last one. This patch will fix some
>minor things in my last patch + it fixs linux/arch/i386/kernel and
>linux/kernel/. This patch also initialize jiffies to -120*HZ so that
>jiffies wrap bug can be triggered faster ;-).

This new incremental patch against the last one should fix the
linux/drivers/net/ directory.

The whole jiffies-wraparound-patch against 2.1.125 can be found at:

ftp://e-mind.com/pub/linux/kernel-patches/jiffies-3-2.1.125....

Tomorrow I' ll try to fix also drivers/block and net/ipv4/ that contains
some bug of the same type too.

Andrea Arcangeli

Index: linux/drivers/net/3c505.c
diff -u linux/drivers/net/3c505.c:1.1.1.1 linux/drivers/net/3c505.c:1.1.1.1.12.1
--- linux/drivers/net/3c505.c:1.1.1.1 Fri Oct 2 19:23:05 1998
+++ linux/drivers/net/3c505.c Thu Oct 15 00:29:14 1998
@@ -271,7 +271,7 @@
do {
stat1 = inb_status(base_addr);
} while (stat1 != inb_status(base_addr) && jiffies < timeout);
- if (jiffies >= timeout)
+ if (time_after_eq(jiffies, timeout))
TIMEOUT_MSG(__LINE__);
return stat1;
}
@@ -297,22 +297,22 @@
do {
inb_command(dev->base_addr);
timeout = jiffies + 2;
- while ((jiffies <= timeout) && !(inb_status(dev->base_addr) & ACRF));
+ while (time_before_eq(jiffies, timeout) && !(inb_status(dev->base_addr) & ACRF));
} while (inb_status(dev->base_addr) & ACRF);
set_hsf(dev, HSF_PCB_NAK);
}
outb_control(adapter->hcr_val | ATTN | DIR, dev);
timeout = jiffies + 1;
- while (jiffies <= timeout);
+ while (time_before_eq(jiffies, timeout));
outb_control(adapter->hcr_val & ~ATTN, dev);
timeout = jiffies + 1;
- while (jiffies <= timeout);
+ while (time_before_eq(jiffies, timeout));
outb_control(adapter->hcr_val | FLSH, dev);
timeout = jiffies + 1;
- while (jiffies <= timeout);
+ while (time_before_eq(jiffies, timeout));
outb_control(adapter->hcr_val & ~FLSH, dev);
timeout = jiffies + 1;
- while (jiffies <= timeout);
+ while (time_before_eq(jiffies, timeout));

outb_control(orig_hcr, dev);
if (!start_receive(dev, &adapter->tx_pcb))
@@ -346,7 +346,7 @@
{
unsigned int timeout;
outb_command(byte, base_addr);
- for (timeout = jiffies + 5; jiffies < timeout;) {
+ for (timeout = jiffies + 5; time_before(jiffies, timeout);) {
if (inb_status(base_addr) & HCRE)
return FALSE;
}
@@ -444,7 +444,7 @@
/* now wait for the acknowledgement */
sti();

- for (timeout = jiffies + 5; jiffies < timeout;) {
+ for (timeout = jiffies + 5; time_before(jiffies, timeout);) {
switch (GET_ASF(dev->base_addr)) {
case ASF_PCB_ACK:
adapter->send_pcb_semaphore = 0;
@@ -496,8 +496,8 @@

/* get the command code */
timeout = jiffies + 2;
- while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && jiffies < timeout);
- if (jiffies >= timeout) {
+ while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && time_before(jiffies, timeout));
+ if (time_after_eq(jiffies, timeout)) {
TIMEOUT_MSG(__LINE__);
return FALSE;
}
@@ -505,8 +505,8 @@

/* read the data length */
timeout = jiffies + 3;
- while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && jiffies < timeout);
- if (jiffies >= timeout) {
+ while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && time_before(jiffies, timeout));
+ if (time_after_eq(jiffies, timeout)) {
TIMEOUT_MSG(__LINE__);
printk("%s: status %02x\n", dev->name, stat);
return FALSE;
@@ -732,7 +732,7 @@
* receive a PCB from the adapter
*/
timeout = jiffies + 3;
- while ((inb_status(dev->base_addr) & ACRF) != 0 && jiffies < timeout) {
+ while ((inb_status(dev->base_addr) & ACRF) != 0 && time_before(jiffies, timeout)) {
if (receive_pcb(dev, &adapter->irx_pcb)) {
switch (adapter->irx_pcb.command) {
case 0:
@@ -965,7 +965,7 @@
else {
int timeout = jiffies + TIMEOUT;
while (adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] == 0 && jiffies < timeout);
- if (jiffies >= timeout)
+ if (time_after_eq(jiffies, timeout))
TIMEOUT_MSG(__LINE__);
}

@@ -983,8 +983,8 @@
printk("%s: couldn't send 82586 configure command\n", dev->name);
else {
int timeout = jiffies + TIMEOUT;
- while (adapter->got[CMD_CONFIGURE_82586] == 0 && jiffies < timeout);
- if (jiffies >= timeout)
+ while (adapter->got[CMD_CONFIGURE_82586] == 0 && time_before(jiffies, timeout));
+ if (time_after_eq(jiffies, timeout))
TIMEOUT_MSG(__LINE__);
}

@@ -1166,8 +1166,8 @@
printk("%s: couldn't send get statistics command\n", dev->name);
else {
int timeout = jiffies + TIMEOUT;
- while (adapter->got[CMD_NETWORK_STATISTICS] == 0 && jiffies < timeout);
- if (jiffies >= timeout) {
+ while (adapter->got[CMD_NETWORK_STATISTICS] == 0 && time_before(jiffies, timeout));
+ if (time_after_eq(jiffies, timeout)) {
TIMEOUT_MSG(__LINE__);
return &adapter->stats;
}
@@ -1259,8 +1259,8 @@
printk("%s: couldn't send set_multicast command\n", dev->name);
else {
int timeout = jiffies + TIMEOUT;
- while (adapter->got[CMD_LOAD_MULTICAST_LIST] == 0 && jiffies < timeout);
- if (jiffies >= timeout) {
+ while (adapter->got[CMD_LOAD_MULTICAST_LIST] == 0 && time_before(jiffies, timeout));
+ if (time_after_eq(jiffies, timeout)) {
TIMEOUT_MSG(__LINE__);
}
}
@@ -1283,8 +1283,8 @@
printk("%s: couldn't send 82586 configure command\n", dev->name);
else {
int timeout = jiffies + TIMEOUT;
- while (adapter->got[CMD_CONFIGURE_82586] == 0 && jiffies < timeout);
- if (jiffies >= timeout)
+ while (adapter->got[CMD_CONFIGURE_82586] == 0 && time_before(jiffies, timeout));
+ if (time_after_eq(jiffies, timeout))
TIMEOUT_MSG(__LINE__);
}
}
@@ -1361,7 +1361,7 @@
/* If HCR.DIR is up, we pull it down. HSR.DIR should follow. */
outb(0, dev->base_addr + PORT_CONTROL);
timeout = jiffies + 30;
- while (jiffies < timeout);
+ while (time_before(jiffies, timeout));
restore_flags(flags);
if (inb_status(addr) & DIR) {
if (elp_debug > 0)
@@ -1372,7 +1372,7 @@
/* If HCR.DIR is down, we pull it up. HSR.DIR should follow. */
outb(DIR, dev->base_addr + PORT_CONTROL);
timeout = jiffies + 30;
- while (jiffies < timeout);
+ while (time_before(jiffies, timeout));
restore_flags(flags);
if (!(inb_status(addr) & DIR)) {
if (elp_debug > 0)
@@ -1470,11 +1470,11 @@
*/
timeout = jiffies + 5;
okay = 0;
- while (jiffies < timeout && !(inb_status(dev->base_addr) & HCRE));
+ while (time_before(jiffies, timeout) && !(inb_status(dev->base_addr) & HCRE));
if ((inb_status(dev->base_addr) & HCRE)) {
outb_command(0, dev->base_addr); /* send a spurious byte */
timeout = jiffies + 5;
- while (jiffies < timeout && !(inb_status(dev->base_addr) & HCRE));
+ while (time_before(jiffies, timeout) && !(inb_status(dev->base_addr) & HCRE));
if (inb_status(dev->base_addr) & HCRE)
okay = 1;
}
@@ -1489,7 +1489,7 @@
*/
printk("assuming 3c505 still starting\n");
timeout = jiffies + 10 * HZ;
- while (jiffies < timeout && (inb_status(dev->base_addr) & 7));
+ while (time_before(jiffies, timeout) && (inb_status(dev->base_addr) & 7));
if (inb_status(dev->base_addr) & 7) {
printk("%s: 3c505 failed to start\n", dev->name);
} else {
Index: linux/drivers/net/3c523.c
diff -u linux/drivers/net/3c523.c:1.1.1.1.2.1 linux/drivers/net/3c523.c:1.1.1.1.2.1.2.1
--- linux/drivers/net/3c523.c:1.1.1.1.2.1 Fri Oct 9 19:22:27 1998
+++ linux/drivers/net/3c523.c Thu Oct 15 00:29:14 1998
@@ -149,7 +149,7 @@

#define DELAY(x) {int i=jiffies; \
if(loops_per_sec == 1) \
- while(i+(x)>jiffies); \
+ while(time_after(i+(x), jiffies)); \
else \
__delay((loops_per_sec>>5)*x); \
}
Index: linux/drivers/net/atp.c
diff -u linux/drivers/net/atp.c:1.1.1.1 linux/drivers/net/atp.c:1.1.1.1.12.1
--- linux/drivers/net/atp.c:1.1.1.1 Fri Oct 2 19:23:04 1998
+++ linux/drivers/net/atp.c Thu Oct 15 00:29:15 1998
@@ -556,7 +556,7 @@
}
num_tx_since_rx++;
} else if (num_tx_since_rx > 8
- && jiffies > dev->last_rx + 100) {
+ && jiffies - dev->last_rx > 100) {
if (net_debug > 2)
printk("%s: Missed packet? No Rx after %d Tx and %ld jiffies"
" status %02x CMR1 %02x.\n", dev->name,
Index: linux/drivers/net/dgrs.c
diff -u linux/drivers/net/dgrs.c:1.1.1.1 linux/drivers/net/dgrs.c:1.1.1.1.12.1
--- linux/drivers/net/dgrs.c:1.1.1.1 Fri Oct 2 19:23:06 1998
+++ linux/drivers/net/dgrs.c Thu Oct 15 00:29:16 1998
@@ -1098,7 +1098,7 @@
*/
proc_reset(dev0, 0);

- for (i = jiffies + 8 * HZ; i > jiffies; )
+ for (i = jiffies + 8 * HZ; time_after(i, jiffies); )
{
if (priv0->bcomm->bc_status >= BC_RUN)
break;
@@ -1196,7 +1196,7 @@
return (rc);

priv->intrcnt = 0;
- for (i = jiffies + 2*HZ + HZ/2; i > jiffies; )
+ for (i = jiffies + 2*HZ + HZ/2; time_after(i, jiffies); )
if (priv->intrcnt >= 2)
break;
if (priv->intrcnt < 2)
Index: linux/drivers/net/hp100.c
diff -u linux/drivers/net/hp100.c:1.1.1.1.2.1 linux/drivers/net/hp100.c:1.1.1.1.2.1.2.1
--- linux/drivers/net/hp100.c:1.1.1.1.2.1 Fri Oct 9 19:22:31 1998
+++ linux/drivers/net/hp100.c Thu Oct 15 00:29:17 1998
@@ -2796,9 +2796,9 @@
time=jiffies+(HZ/4);
do{
if ( hp100_inb( VG_LAN_CFG_1 ) & HP100_LINK_CABLE_ST ) break;
- } while (time>jiffies);
+ } while (time_after(time, jiffies));

- if ( jiffies >= time ) /* no signal->no logout */
+ if ( time_before_eq(jiffies, time) ) /* no signal->no logout */
return 0;

/* Drop the VG Link by clearing the link up cmd and load addr.*/
@@ -2810,10 +2810,10 @@
time=jiffies+(HZ/2);
do{
if ( !(hp100_inb( VG_LAN_CFG_1) & HP100_LINK_UP_ST) ) break;
- } while(time>jiffies);
+ } while(time_after(time, jiffies));

#ifdef HP100_DEBUG
- if (jiffies>=time)
+ if (time_before_eq(jiffies, time))
printk("hp100: %s: down_vg_link: Link does not go down?\n", dev->name);
#endif

@@ -2848,7 +2848,7 @@
time=jiffies+(HZ*5);
do{
if( !(hp100_inb(MAC_CFG_4) & HP100_MAC_SEL_ST) ) break;
- } while(time>jiffies);
+ } while(time_after(time, jiffies));

hp100_orb( HP100_AUTO_MODE, MAC_CFG_3); /* Autosel back on */
hp100_outl(savelan, 10_LAN_CFG_1);
@@ -2857,9 +2857,9 @@
time=jiffies+(3*HZ); /* Timeout 3s */
do {
if ( (hp100_inb( VG_LAN_CFG_1 )&HP100_LINK_CABLE_ST) == 0) break;
- } while (time>jiffies);
+ } while (time_after(time, jiffies));

- if(time<=jiffies)
+ if(time_before_eq(time, jiffies))
{
#ifdef HP100_DEBUG
printk( "hp100: %s: down_vg_link: timeout\n", dev->name );
@@ -2868,7 +2868,7 @@
}

time=jiffies+(2*HZ); /* This seems to take a while.... */
- do {} while (time>jiffies);
+ do {} while (time_after(time, jiffies));

return 0;
}
@@ -2918,7 +2918,7 @@
time = jiffies + (HZ/10);
do {
if (~(hp100_inb( VG_LAN_CFG_1 )& HP100_LINK_UP_ST) ) break;
- } while (time>jiffies);
+ } while (time_after(time, jiffies));

/* Start an addressed training and optionally request promiscuous port */
if ( (dev->flags) & IFF_PROMISC )
@@ -2955,9 +2955,9 @@
time = jiffies + ( 1*HZ ); /* 1 sec timeout for cable st */
do {
if ( hp100_inb( VG_LAN_CFG_1 ) & HP100_LINK_CABLE_ST ) break;
- } while ( jiffies < time );
+ } while ( time_before(jiffies, time) );

- if ( jiffies >= time )
+ if ( time_after_eq(jiffies, time) )
{
#ifdef HP100_DEBUG_TRAINING
printk( "hp100: %s: Link cable status not ok? Training aborted.\n", dev->name );
@@ -2979,11 +2979,11 @@
#endif
break;
}
- } while ( time > jiffies );
+ } while ( time_after(time, jiffies) );
}

/* If LINK_UP_ST is set, then we are logged into the hub. */
- if ( (jiffies<=time) && (val & HP100_LINK_UP_ST) )
+ if ( time_before_eq(jiffies, time) && (val & HP100_LINK_UP_ST) )
{
#ifdef HP100_DEBUG_TRAINING
printk( "hp100: %s: Successfully logged into the HUB.\n", dev->name);
Index: linux/drivers/net/ibmtr.c
diff -u linux/drivers/net/ibmtr.c:1.1.1.1 linux/drivers/net/ibmtr.c:1.1.1.1.12.1
--- linux/drivers/net/ibmtr.c:1.1.1.1 Fri Oct 2 19:23:07 1998
+++ linux/drivers/net/ibmtr.c Thu Oct 15 00:29:17 1998
@@ -416,7 +416,7 @@

timeout = jiffies + TR_SPIN_INTERVAL;
while(!readb(ti->mmio + ACA_OFFSET + ACA_RW + RRR_EVEN))
- if (jiffies > timeout) {
+ if (time_after(jiffies, timeout)) {
DPRINTK("Hardware timeout during initialization.\n");
kfree_s(ti, sizeof(struct tok_info));
return -ENODEV;
Index: linux/drivers/net/ltpc.c
diff -u linux/drivers/net/ltpc.c:1.1.1.1 linux/drivers/net/ltpc.c:1.1.1.1.12.1
--- linux/drivers/net/ltpc.c:1.1.1.1 Fri Oct 2 19:23:09 1998
+++ linux/drivers/net/ltpc.c Thu Oct 15 00:29:18 1998
@@ -998,7 +998,7 @@
sti();

timeout = jiffies+2;
- while(timeout>jiffies) ; /* wait for strays */
+ while(time_after(timeout, jiffies)) ; /* wait for strays */

straymask = irqhitmask; /* pick up any strays */

@@ -1008,7 +1008,7 @@
inb_p(0x227);
x=inb_p(0x226);
timeout = jiffies+2;
- while(timeout>jiffies) ;
+ while(time_after(timeout, jiffies)) ;
if(straymask != irqhitmask) base = 0x220;
}
if (!check_region(0x240,8)) {
@@ -1016,7 +1016,7 @@
inb_p(0x247);
y=inb_p(0x246);
timeout = jiffies+2;
- while(timeout>jiffies) ;
+ while(time_after(timeout, jiffies)) ;
if(straymask != irqhitmask) base = 0x240;
}

@@ -1079,7 +1079,7 @@
inb_p(base+1);
inb_p(base+3);
timeout = jiffies+2;
- while(timeout>jiffies) ; /* hold it in reset for a coupla jiffies */
+ while(time_after(timeout, jiffies)) ; /* hold it in reset for a coupla jiffies */
inb_p(base+0);
inb_p(base+2);
inb_p(base+7); /* clear reset */
@@ -1089,7 +1089,7 @@
inb_p(base+6); /* tri-state interrupt line */

timeout = jiffies+100;
- while(timeout>jiffies) {
+ while(time_after(timeout, jiffies)) {
/* wait for the card to complete initialization */
}

@@ -1129,13 +1129,13 @@
inb_p(base+1);
inb_p(base+0);
timeout = jiffies+100;
- while(timeout>jiffies) {
+ while(time_after(timeout, jiffies)) {
if ( 0xfa == inb_p(base+6) ) break;
}

inb_p(base+3);
inb_p(base+2);
- while(timeout>jiffies) {
+ while(time_after(timeout, jiffies)) {
if ( 0xfb == inb_p(base+6) ) break;
}

@@ -1185,7 +1185,7 @@
(void) inb_p(base+3);
(void) inb_p(base+2);
timeout = jiffies+100;
- while(timeout>jiffies) {
+ while(time_after(timeout, jiffies)) {
if( 0xf9 == inb_p(base+6)) break;
}

@@ -1264,7 +1264,7 @@
/* if it's in process, wait a bit for it to finish */
timeout = jiffies+HZ;
add_timer(&ltpc_timer);
- while(del_timer(&ltpc_timer) && (timeout > jiffies))
+ while(del_timer(&ltpc_timer) && time_after(timeout, jiffies))
{
add_timer(&ltpc_timer);
schedule();
Index: linux/drivers/net/rrunner.c
diff -u linux/drivers/net/rrunner.c:1.1.2.1 linux/drivers/net/rrunner.c:1.1.2.1.2.1
--- linux/drivers/net/rrunner.c:1.1.2.1 Fri Oct 9 19:22:32 1998
+++ linux/drivers/net/rrunner.c Thu Oct 15 00:29:18 1998
@@ -529,7 +529,7 @@
* Give the FirmWare time to chew on the `get running' command.
*/
myjif = jiffies + 5 * HZ;
- while ((jiffies < myjif) && !rrpriv->fw_running);
+ while (time_before(jiffies, myjif) && !rrpriv->fw_running);

for (i = 0; i < RX_RING_ENTRIES; i++) {
struct sk_buff *skb;
@@ -569,7 +569,7 @@
regs->ExtIo = 0x80;

i = jiffies + 1 * HZ;
- while (jiffies < i);
+ while (time_before(jiffies, i));
regs->ExtIo = tmp;
}
#endif
Index: linux/drivers/net/sdla.c
diff -u linux/drivers/net/sdla.c:1.1.1.1 linux/drivers/net/sdla.c:1.1.1.1.12.1
--- linux/drivers/net/sdla.c:1.1.1.1 Fri Oct 2 19:23:08 1998
+++ linux/drivers/net/sdla.c Thu Oct 15 00:29:18 1998
@@ -248,7 +248,7 @@
temp += z80_addr & SDLA_ADDR_MASK;

resp = ~resp1;
- while ((jiffies < done) && (resp != resp1) && (!resp2 || (resp != resp2)))
+ while (time_before(jiffies, done) && (resp != resp1) && (!resp2 || (resp != resp2)))
{
if (jiffies != now)
{
@@ -257,7 +257,7 @@
resp = *temp;
}
}
- return(jiffies < done ? jiffies - start : -1);
+ return(time_before(jiffies, done) ? jiffies - start : -1);
}

/* constants for Z80 CPU speed */
@@ -444,7 +444,7 @@

waiting = 1;
len = 0;
- while (waiting && (jiffies <= jiffs))
+ while (waiting && time_before_eq(jiffies, jiffs))
{
if (waiting++ % 3)
{
Index: linux/drivers/net/seeq8005.c
diff -u linux/drivers/net/seeq8005.c:1.1.1.1 linux/drivers/net/seeq8005.c:1.1.1.1.12.1
--- linux/drivers/net/seeq8005.c:1.1.1.1 Fri Oct 2 19:23:07 1998
+++ linux/drivers/net/seeq8005.c Thu Oct 15 00:29:18 1998
@@ -247,10 +247,10 @@
outw(0x5a5a, SEEQ_BUFFER);
}
j=jiffies+HZ;
- while ( ((inw(SEEQ_STATUS) & SEEQSTAT_FIFO_EMPTY) != SEEQSTAT_FIFO_EMPTY) && jiffies < j )
+ while ( ((inw(SEEQ_STATUS) & SEEQSTAT_FIFO_EMPTY) != SEEQSTAT_FIFO_EMPTY) && time_before(jiffies, j) )
mb();
outw( 0 , SEEQ_DMAAR);
- while ( ((inw(SEEQ_STATUS) & SEEQSTAT_WINDOW_INT) != SEEQSTAT_WINDOW_INT) && jiffies < j+HZ)
+ while ( ((inw(SEEQ_STATUS) & SEEQSTAT_WINDOW_INT) != SEEQSTAT_WINDOW_INT) && time_before(jiffies, j+HZ))
mb();
if ( (inw(SEEQ_STATUS) & SEEQSTAT_WINDOW_INT) == SEEQSTAT_WINDOW_INT)
outw( SEEQCMD_WINDOW_INT_ACK | (inw(SEEQ_STATUS)& SEEQCMD_INT_MASK), SEEQ_CMD);
@@ -707,7 +707,7 @@

/* drain FIFO */
tmp = jiffies;
- while ( (((status=inw(SEEQ_STATUS)) & SEEQSTAT_FIFO_EMPTY) == 0) && (jiffies < tmp + HZ))
+ while ( (((status=inw(SEEQ_STATUS)) & SEEQSTAT_FIFO_EMPTY) == 0) && (jiffies - tmp < HZ))
mb();

/* doit ! */
@@ -729,7 +729,7 @@
int status;

tmp = jiffies + HZ;
- while ( ( ((status=inw(SEEQ_STATUS)) & SEEQSTAT_WINDOW_INT) != SEEQSTAT_WINDOW_INT) && jiffies < tmp)
+ while ( ( ((status=inw(SEEQ_STATUS)) & SEEQSTAT_WINDOW_INT) != SEEQSTAT_WINDOW_INT) && time_before(jiffies, tmp))
mb();

if ( (status & SEEQSTAT_WINDOW_INT) == SEEQSTAT_WINDOW_INT)
Index: linux/drivers/net/shaper.c
diff -u linux/drivers/net/shaper.c:1.1.1.1 linux/drivers/net/shaper.c:1.1.1.1.12.1
--- linux/drivers/net/shaper.c:1.1.1.1 Fri Oct 2 19:23:09 1998
+++ linux/drivers/net/shaper.c Thu Oct 15 00:29:18 1998
@@ -157,7 +157,7 @@

skb->shapelatency=0;
skb->shapeclock=shaper->recovery;
- if(skb->shapeclock<jiffies)
+ if(time_before(skb->shapeclock, jiffies))
skb->shapeclock=jiffies;
skb->priority=0; /* short term bug fix */
skb->shapestamp=jiffies;
@@ -320,7 +320,7 @@

if(sh_debug)
printk("Clock = %d, jiffies = %ld\n", skb->shapeclock, jiffies);
- if(skb->shapeclock <= jiffies + SHAPER_BURST)
+ if(skb->shapeclock - jiffies <= SHAPER_BURST)
{
/*
* Pull the frame and get interrupts back on.
Index: linux/drivers/net/sktr.c
diff -u linux/drivers/net/sktr.c:1.1.1.1 linux/drivers/net/sktr.c:1.1.1.1.12.1
--- linux/drivers/net/sktr.c:1.1.1.1 Fri Oct 2 19:23:11 1998
+++ linux/drivers/net/sktr.c Thu Oct 15 00:29:18 1998
@@ -1017,7 +1017,7 @@
return;

sktr_chk_outstanding_cmds(dev);
- if(tp->LastSendTime + SEND_TIMEOUT < jiffies
+ if(time_before(tp->LastSendTime + SEND_TIMEOUT, jiffies)
&& (tp->QueueSkb < MAX_TX_QUEUE || tp->TplFree != tp->TplBusy))
{
/* Anything to send, but stalled to long */
@@ -1523,7 +1523,7 @@
current->timeout = tmp;
current->state = TASK_INTERRUPTIBLE;
schedule();
- } while(tmp > jiffies);
+ } while(time_after(tmp, jiffies));

return;
}

-
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/