latest jiffy wrap fixes

Andrea Arcangeli (andrea@e-mind.com)
Tue, 29 Dec 1998 16:11:51 +0100 (CET)


Here are the only still pending jiffy wrap fixes I have in my tree. I
have not tried it in hardware but they looks ok to me.

Index: linux/drivers/char/saa5249.c
diff -u linux/drivers/char/saa5249.c:1.1.1.1 linux/drivers/char/saa5249.c:1.1.1.1.2.1
--- linux/drivers/char/saa5249.c:1.1.1.1 Fri Nov 20 00:02:29 1998
+++ linux/drivers/char/saa5249.c Fri Nov 20 00:15:19 1998
@@ -460,7 +460,7 @@

if (!(infobits[8] & 0x10) && !(infobits[7] & 0xf0) && /* check FOUND-bit */
(memcmp(infobits, t->vdau[req.pgbuf].laststat, sizeof(infobits)) ||
- jiffies >= t->vdau[req.pgbuf].expire))
+ time_after_eq(jiffies, t->vdau[req.pgbuf].expire)))
{ /* check if new page arrived */
if (i2c_senddata(t, CCTWR, 8, 0, 0, 0, -1) ||
i2c_getdata(t, CCTRD, VTX_PAGESIZE, t->vdau[req.pgbuf].pgbuf, FALSE))
Index: linux/drivers/net/hp100.c
diff -u linux/drivers/net/hp100.c:1.1.1.1 linux/drivers/net/hp100.c:1.1.1.1.2.2
--- linux/drivers/net/hp100.c:1.1.1.1 Fri Nov 20 00:02:05 1998
+++ linux/drivers/net/hp100.c Thu Dec 17 15:43:31 1998
@@ -2798,7 +2798,7 @@
if ( hp100_inb( VG_LAN_CFG_1 ) & HP100_LINK_CABLE_ST ) break;
} while (time>jiffies);

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

/* Drop the VG Link by clearing the link up cmd and load addr.*/
@@ -2813,7 +2813,7 @@
} while(time>jiffies);

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

Index: linux/drivers/net/ltpc.c
diff -u linux/drivers/net/ltpc.c:1.1.1.2 linux/drivers/net/ltpc.c:1.1.1.1.2.4
--- linux/drivers/net/ltpc.c:1.1.1.2 Thu Dec 17 16:35:24 1998
+++ linux/drivers/net/ltpc.c Thu Dec 17 17:34:04 1998
@@ -1335,7 +1335,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/shaper.c
diff -u linux/drivers/net/shaper.c:1.1.1.1 linux/drivers/net/shaper.c:1.1.1.1.2.1
--- linux/drivers/net/shaper.c:1.1.1.1 Fri Nov 20 00:02:09 1998
+++ linux/drivers/net/shaper.c Fri Nov 20 00:15:26 1998
@@ -320,7 +320,7 @@

if(sh_debug)
printk("Clock = %d, jiffies = %ld\n", skb->shapeclock, jiffies);
- if(skb->shapeclock - jiffies <= SHAPER_BURST)
+ if(time_before_eq(skb->shapeclock - jiffies, SHAPER_BURST))
{
/*
* Pull the frame and get interrupts back on.

The wrap fix in 2.2.0-pre1 of svc.c add a time_after() but doesn't remove
the jiffy_time == 0 special case ;)

Index: linux/fs/lockd/svc.c
diff -u linux/fs/lockd/svc.c:1.1.1.2 linux/fs/lockd/svc.c:1.1.1.1.2.1
--- linux/fs/lockd/svc.c:1.1.1.2 Tue Dec 29 01:37:20 1998
+++ linux/fs/lockd/svc.c Fri Nov 20 00:15:34 1998
@@ -64,6 +64,7 @@
{
struct svc_serv *serv = rqstp->rq_server;
int err = 0;
+ unsigned long grace_period_expire;

/* Lock module and set up kernel thread */
MOD_INC_USE_COUNT;
@@ -111,7 +112,7 @@
}
#endif

- nlmsvc_grace_period += jiffies;
+ grace_period_expire = nlmsvc_grace_period + jiffies;
nlmsvc_timeout = nlm_timeout * HZ;

/*
@@ -136,7 +137,7 @@
*/
if (!nlmsvc_grace_period) {
timeout = nlmsvc_retry_blocked();
- } else if (time_after(jiffies, nlmsvc_grace_period))
+ } else if (time_before(grace_period_expire, jiffies))
nlmsvc_grace_period = 0;

/*

Index: linux/net/ipv4/tcp_output.c
diff -u linux/net/ipv4/tcp_output.c:1.1.1.1 linux/net/ipv4/tcp_output.c:1.1.1.1.2.4
--- linux/net/ipv4/tcp_output.c:1.1.1.1 Fri Nov 20 00:01:53 1998
+++ linux/net/ipv4/tcp_output.c Wed Nov 25 21:44:40 1998
@@ -958,7 +958,7 @@
tp->delack_timer.expires = timeout;
add_timer(&tp->delack_timer);
} else {
- if (timeout < tp->delack_timer.expires)
+ if (time_before(timeout, tp->delack_timer.expires))
mod_timer(&tp->delack_timer, timeout);
}
}

Andrea Arcangeli

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