Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Patch for 2.1.127
@ 1998-11-11 18:51 Nikita Schmidt
  1998-11-11 22:56 ` Peter Rye
  0 siblings, 1 reply; 2+ messages in thread
From: Nikita Schmidt @ 1998-11-11 18:51 UTC (permalink / raw)
  To: axp-list

Hi,

There seems to be a bug in 2.1.127 that causes kernel panic when the
kernel runs init.  I think the reason is the interface changes in
do_select(), which did not propagate into alpha-specific code.  The
patch below worked for me.

Nikita



--- linux-2.1.127/arch/alpha/kernel/osf_sys.c.orig	Wed Nov 11 15:02:13 1998
+++ linux-2.1.127/arch/alpha/kernel/osf_sys.c	Wed Nov 11 15:47:59 1998
@@ -1133,10 +1133,10 @@
 	   struct timeval32 *tvp)
 {
 	fd_set_buffer *fds;
-	unsigned long timeout;
+	long timeout;
 	int ret;
 
-	timeout = ~0UL;
+	timeout = MAX_SCHEDULE_TIMEOUT;
 	if (tvp) {
 		time_t sec, usec;
 
@@ -1147,8 +1147,6 @@
 
 		timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
 		timeout += sec * HZ;
-		if (timeout)
-			timeout += jiffies + 1;
 	}
 
 	ret = -ENOMEM;
@@ -1168,7 +1166,7 @@
 	zero_fd_set(n, fds->res_out);
 	zero_fd_set(n, fds->res_ex);
 
-	ret = do_select(n, fds, timeout);
+	ret = do_select(n, fds, &timeout);
 
 	/* OSF does not copy back the remaining time.  */
 
--- linux-2.1.127/arch/sparc64/kernel/sys_sparc32.c.orig	Wed Nov 11 15:25:30 1998
+++ linux-2.1.127/arch/sparc64/kernel/sys_sparc32.c	Wed Nov 11 15:47:59 1998
@@ -1110,10 +1110,11 @@
 {
 	fd_set_buffer *fds;
 	struct timeval32 *tvp = (struct timeval32 *)AA(tvp_x);
-	unsigned long timeout, nn;
+	long timeout;
+	unsigned long nn;
 	int ret;
 
-	timeout = ~0UL;
+	timeout = MAX_SCHEDULE_TIMEOUT;
 	if (tvp) {
 		time_t sec, usec;
 
@@ -1124,8 +1125,6 @@
 
 		timeout = (usec + 1000000/HZ - 1) / (1000000/HZ);
 		timeout += sec * HZ;
-		if (timeout)
-			timeout += jiffies + 1;
 	}
 
 	ret = -ENOMEM;
@@ -1147,12 +1146,11 @@
 	zero_fd_set(n, fds->res_out);
 	zero_fd_set(n, fds->res_ex);
 
-	ret = do_select(n, fds, timeout);
+	ret = do_select(n, fds, &timeout);
 
 	if (tvp && !(current->personality & STICKY_TIMEOUTS)) {
-		unsigned long timeout = current->timeout - jiffies - 1;
 		time_t sec = 0, usec = 0;
-		if ((long) timeout > 0) {
+		if (timeout) {
 			sec = timeout / HZ;
 			usec = timeout % HZ;
 			usec *= (1000000/HZ);
@@ -1160,7 +1158,6 @@
 		put_user(sec, &tvp->tv_sec);
 		put_user(usec, &tvp->tv_usec);
 	}
-	current->timeout = 0;
 
 	if (ret < 0)
 		goto out;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch for 2.1.127
  1998-11-11 18:51 Patch for 2.1.127 Nikita Schmidt
@ 1998-11-11 22:56 ` Peter Rye
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Rye @ 1998-11-11 22:56 UTC (permalink / raw)
  To: axp-list


    Nikita> Hi, There seems to be a bug in 2.1.127 that causes kernel panic
    Nikita> when the kernel runs init.  I think the reason is the interface
    Nikita> changes in do_select(), which did not propagate into
    Nikita> alpha-specific code.  The patch below worked for me.

Same problem here. Your patch fixed the problem nicely. Thanks.
SX164, egcs-1.1b.

Linux picu-sgh.demon.co.uk 2.1.127 #7 Wed Nov 11 22:37:08 GMT 1998 alpha unknown


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-11-12  6:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-11-11 18:51 Patch for 2.1.127 Nikita Schmidt
1998-11-11 22:56 ` Peter Rye

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox