Re: [PATCH] jsm driver - Linux-2.6.12.3

2005-07-25 Thread V. ANANDA KRISHNAN
Hi All,

  I would like to rescind the patch that was posted here on Jul 19, 2005
with the subject [PATCH] jsm driver - Linux-2.6.12.3, since I am
submitting the patch against development kernel-2.6.13-rc3. The patch
takes care of the major device number change. A full description of the
change is given below.

  In the kernel-2.6.12.3 version, the jsm driver uses a static number of
253.  The major number 253 is a reserved for "LOCAL/EXPERIMENTAL USE" by
both char and block devices.  So the current patch takes advantage of
the dynamic allocation of major number by the kernel.
 
  Please CC me your comments.  Thanks.
  Signed-off-by: V. Ananda Krishnan <[EMAIL PROTECTED]>
    


diff -Naur linux-2.6.12.3/drivers/serial/jsm/jsm_driver.c linux-2.6.12.3-new/drivers/serial/jsm/jsm_driver.c
--- linux-2.6.12.3/drivers/serial/jsm/jsm_driver.c	2005-07-25 17:13:59.0 -0500
+++ linux-2.6.12.3-new/drivers/serial/jsm/jsm_driver.c	2005-07-25 17:14:39.0 -0500
@@ -42,7 +42,7 @@
 	.owner		= THIS_MODULE,
 	.driver_name	= JSM_DRIVER_NAME,
 	.dev_name	= "ttyn",
-	.major		= 253,
+	.major		= 0,
 	.minor		= JSM_MINOR_START,
 	.nr		= NR_PORTS,
 };


Re: [PATCH] jsm driver - Linux-2.6.12.3

2005-07-25 Thread V. ANANDA KRISHNAN
Hi All,

  I would like to rescind the patch that was posted here on Jul 19, 2005
with the subject [PATCH] jsm driver - Linux-2.6.12.3, since I am
submitting the patch against development kernel-2.6.13-rc3. The patch
takes care of the major device number change. A full description of the
change is given below.

  In the kernel-2.6.12.3 version, the jsm driver uses a static number of
253.  The major number 253 is a reserved for LOCAL/EXPERIMENTAL USE by
both char and block devices.  So the current patch takes advantage of
the dynamic allocation of major number by the kernel.
 
  Please CC me your comments.  Thanks.
  Signed-off-by: V. Ananda Krishnan [EMAIL PROTECTED]



diff -Naur linux-2.6.12.3/drivers/serial/jsm/jsm_driver.c linux-2.6.12.3-new/drivers/serial/jsm/jsm_driver.c
--- linux-2.6.12.3/drivers/serial/jsm/jsm_driver.c	2005-07-25 17:13:59.0 -0500
+++ linux-2.6.12.3-new/drivers/serial/jsm/jsm_driver.c	2005-07-25 17:14:39.0 -0500
@@ -42,7 +42,7 @@
 	.owner		= THIS_MODULE,
 	.driver_name	= JSM_DRIVER_NAME,
 	.dev_name	= ttyn,
-	.major		= 253,
+	.major		= 0,
 	.minor		= JSM_MINOR_START,
 	.nr		= NR_PORTS,
 };


Subject: [PATCH] mm/mempolicy.c linux-2.6.12.3

2005-07-22 Thread John Blackwood

Hello Andrea,

I believe that we are seeing a problem with one change from the patch

  2005/01/03 20:15:21-08:00 [EMAIL PROTECTED]
  [PATCH] mempolicy optimisation

in the mpol_free_shared_policy() routine in mm/mempolicy.c, where a
rb_erase() line was removed.

The corresponding portion of the original patch is shown below:

@@ -1086,11 +1084,11 @@
while (next) {
n = rb_entry(next, struct sp_node, nd);
next = rb_next(>nd);
-   rb_erase(>nd, >root);
mpol_free(n->policy);
kmem_cache_free(sn_cache, n);
}
spin_unlock(>lock);
+   p->root = RB_ROOT;
 }


When we build a 2.6.11.4 debug kernel on a 2 cpu NUMA-enabled opteron
system, and run the following set of commands:

echo "1" > /tmp/numatest
numactl --length=0x4000 --shm /tmp/numatest --localalloc
numactl --length=0x2000 --offset=0 --shm /tmp/numatest --membind=0
numactl --length=0x2000 --offset=0x2000 --shm /tmp/numatest --membind=1
ipcs
ipcrm -M "the_key_value_of_this_shm_area"


On the ipcrm call above, the system will oops:

general protection fault:  [1] PREEMPT SMP

Entering kdb (current=0x81008161a0f0, pid 3102) on processor 1 Oops: 


due to oops @ 0x802e51f3
 r15 = 0x0100  r14 = 0x81007d7a5470
 r13 = 0x810001eea460  r12 = 0x81007c4324f8
 rbp = 0x81007c4324f8  rbx = 0x81007c4324f8
 r11 = 0x0202  r10 = 0x2abc3db0
  r9 = 0x81007c4324a8   r8 = 0x
 rax = 0x000f  rcx = 0x
 rdx = 0x  rsi = 0x006b
 rdi = 0x6b6b6b6b6b6b6b6b orig_rax = 0x
 rip = 0x802e51f3   cs = 0x0010
  eflags = 0x00010202  rsp = 0x81007d06bc40
  ss = 0x81007d06a000  = 0x81007d06bba8
[1]kdb> bt
Stack traceback for pid 3102
0x81008161a0f0 3102 2761  11   R  0x81008161a480 *ipcrm
RSP   RIPFunction (args)
0x81007d06bc40 0x802e51f3 rb_next+0xb (0x810001eea7d8, 
0x810001eea518, 0x810001eea518, 0x0, 0x810001eea518)

0x81007d06bc58 0x80189c74 mpol_free_shared_policy+0x3a
0x81007d06bc88 0x8018d306 shmem_destroy_inode+0x1f
0x81007d06bc98 0x801ab0e8 destroy_inode+0x31 
(0x81007d7a5484)

0x81007d06bca8 0x801ac5a6 generic_delete_inode+0x10c
0x81007d06bcc8 0x801ac796 iput+0x77 (0x8100815673c8)
0x81007d06bcd8 0x801a915c dput+0x1c0 (0x81007d3e8408, 
0x1, 0x0, 0x0, 0x81007d3e8408)

0x81007d06bcf8 0x80190a9a __fput+0x128 (0x81007d3e8408)
0x81007d06bd28 0x8019096d fput+0x14
0x81007d06bd38 0x802d1a8c shm_destroy+0x4d
0x81007d06bd48 0x802d26d9 sys_shmctl+0x689


The rdi = 0x6b6b6b6b6b6b6b6b above (and additional debugging that I did)
shows that we called rb_next(>nd) in the while loop and we got back
a rb_node that we already just deallocated via kmem_cache_free() in that
same while loop execution.

As a result, on the debug kernel, the already deallocated rb_node has
0x6b6b6b6b6b6b6b6b in its memory locations and we oops when we try to
use this value as a pointer.

When I put back the rb_erase() line, the above example test, and lots
of others like it, start working again w/out oops-ing.

I'm no rb tree expert, but it seems that we still need to have the
rb_erase() line in the while loop:

diff -u linux-2.6.12.3/mm/mempolicy.c new/mm/mempolicy.c
--- linux-2.6.12.3/mm/mempolicy.c   2005-07-15 17:18:57.0 -0400
+++ new/mm/mempolicy.c  2005-07-22 11:12:56.0 -0400
@@ -1104,6 +1104,7 @@
while (next) {
n = rb_entry(next, struct sp_node, nd);
next = rb_next(>nd);
+   rb_erase(>nd, >root);
mpol_free(n->policy);
kmem_cache_free(sn_cache, n);
}



Thank you for your time and considerations.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Subject: [PATCH] mm/mempolicy.c linux-2.6.12.3

2005-07-22 Thread John Blackwood

Hello Andrea,

I believe that we are seeing a problem with one change from the patch

  2005/01/03 20:15:21-08:00 [EMAIL PROTECTED]
  [PATCH] mempolicy optimisation

in the mpol_free_shared_policy() routine in mm/mempolicy.c, where a
rb_erase() line was removed.

The corresponding portion of the original patch is shown below:

@@ -1086,11 +1084,11 @@
while (next) {
n = rb_entry(next, struct sp_node, nd);
next = rb_next(n-nd);
-   rb_erase(n-nd, p-root);
mpol_free(n-policy);
kmem_cache_free(sn_cache, n);
}
spin_unlock(p-lock);
+   p-root = RB_ROOT;
 }


When we build a 2.6.11.4 debug kernel on a 2 cpu NUMA-enabled opteron
system, and run the following set of commands:

echo 1  /tmp/numatest
numactl --length=0x4000 --shm /tmp/numatest --localalloc
numactl --length=0x2000 --offset=0 --shm /tmp/numatest --membind=0
numactl --length=0x2000 --offset=0x2000 --shm /tmp/numatest --membind=1
ipcs
ipcrm -M the_key_value_of_this_shm_area


On the ipcrm call above, the system will oops:

general protection fault:  [1] PREEMPT SMP

Entering kdb (current=0x81008161a0f0, pid 3102) on processor 1 Oops: 
NULL

due to oops @ 0x802e51f3
 r15 = 0x0100  r14 = 0x81007d7a5470
 r13 = 0x810001eea460  r12 = 0x81007c4324f8
 rbp = 0x81007c4324f8  rbx = 0x81007c4324f8
 r11 = 0x0202  r10 = 0x2abc3db0
  r9 = 0x81007c4324a8   r8 = 0x
 rax = 0x000f  rcx = 0x
 rdx = 0x  rsi = 0x006b
 rdi = 0x6b6b6b6b6b6b6b6b orig_rax = 0x
 rip = 0x802e51f3   cs = 0x0010
  eflags = 0x00010202  rsp = 0x81007d06bc40
  ss = 0x81007d06a000 regs = 0x81007d06bba8
[1]kdb bt
Stack traceback for pid 3102
0x81008161a0f0 3102 2761  11   R  0x81008161a480 *ipcrm
RSP   RIPFunction (args)
0x81007d06bc40 0x802e51f3 rb_next+0xb (0x810001eea7d8, 
0x810001eea518, 0x810001eea518, 0x0, 0x810001eea518)

0x81007d06bc58 0x80189c74 mpol_free_shared_policy+0x3a
0x81007d06bc88 0x8018d306 shmem_destroy_inode+0x1f
0x81007d06bc98 0x801ab0e8 destroy_inode+0x31 
(0x81007d7a5484)

0x81007d06bca8 0x801ac5a6 generic_delete_inode+0x10c
0x81007d06bcc8 0x801ac796 iput+0x77 (0x8100815673c8)
0x81007d06bcd8 0x801a915c dput+0x1c0 (0x81007d3e8408, 
0x1, 0x0, 0x0, 0x81007d3e8408)

0x81007d06bcf8 0x80190a9a __fput+0x128 (0x81007d3e8408)
0x81007d06bd28 0x8019096d fput+0x14
0x81007d06bd38 0x802d1a8c shm_destroy+0x4d
0x81007d06bd48 0x802d26d9 sys_shmctl+0x689


The rdi = 0x6b6b6b6b6b6b6b6b above (and additional debugging that I did)
shows that we called rb_next(n-nd) in the while loop and we got back
a rb_node that we already just deallocated via kmem_cache_free() in that
same while loop execution.

As a result, on the debug kernel, the already deallocated rb_node has
0x6b6b6b6b6b6b6b6b in its memory locations and we oops when we try to
use this value as a pointer.

When I put back the rb_erase() line, the above example test, and lots
of others like it, start working again w/out oops-ing.

I'm no rb tree expert, but it seems that we still need to have the
rb_erase() line in the while loop:

diff -u linux-2.6.12.3/mm/mempolicy.c new/mm/mempolicy.c
--- linux-2.6.12.3/mm/mempolicy.c   2005-07-15 17:18:57.0 -0400
+++ new/mm/mempolicy.c  2005-07-22 11:12:56.0 -0400
@@ -1104,6 +1104,7 @@
while (next) {
n = rb_entry(next, struct sp_node, nd);
next = rb_next(n-nd);
+   rb_erase(n-nd, p-root);
mpol_free(n-policy);
kmem_cache_free(sn_cache, n);
}



Thank you for your time and considerations.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] jsm driver - Linux-2.6.12.3

2005-07-19 Thread V. ANANDA KRISHNAN
I am using RHEL4.0-U1 as the distro. Here is the info on gcc version is
3.4.3-22.1

Thanks for your feed-back.

Ananda Krishnan
On Tue, 2005-07-19 at 22:47 +0400, Alexey Dobriyan wrote:
> On Tue, Jul 19, 2005 at 12:53:20PM -0500, V. ANANDA KRISHNAN wrote:
> > This patch takes care of (1) compiler warnings which displays the mixing
> > of declarations and code
> 
> With what gcc version and what CFLAGS?
> 
> > (2) dynamic allocation of major device number
> > instead of the static number 253 (3) the version update to reflect the
> > changes in the patch.
> 
> > --- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_driver.c
> > +++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_driver.c
> 
> > + * CHANGE LOG:
> > + * Jul 18, 2005: Changed the major number changed to 0 to use the dynamic
> > + * allocation of major number by OS.
> > + *
> 
> ChangeLog maintenance is the job of SCM. Don't add useless comments.
> 
> > --- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_neo.c
> > +++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_neo.c
> 
> > -   u8 ier = readb(>ch_neo_uart->ier);
> > -   u8 efr = readb(>ch_neo_uart->efr);
> > +   u8 ier, efr;
> > +   ier = readb(>ch_neo_uart->ier);
> > +   efr = readb(>ch_neo_uart->efr);
> 
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] jsm driver - Linux-2.6.12.3

2005-07-19 Thread Alexey Dobriyan
On Tue, Jul 19, 2005 at 12:53:20PM -0500, V. ANANDA KRISHNAN wrote:
> This patch takes care of (1) compiler warnings which displays the mixing
> of declarations and code

With what gcc version and what CFLAGS?

> (2) dynamic allocation of major device number
> instead of the static number 253 (3) the version update to reflect the
> changes in the patch.

> --- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_driver.c
> +++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_driver.c

> + * CHANGE LOG:
> + * Jul 18, 2005: Changed the major number changed to 0 to use the dynamic
> + *   allocation of major number by OS.
> + *

ChangeLog maintenance is the job of SCM. Don't add useless comments.

> --- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_neo.c
> +++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_neo.c

> - u8 ier = readb(>ch_neo_uart->ier);
> - u8 efr = readb(>ch_neo_uart->efr);
> + u8 ier, efr;
> + ier = readb(>ch_neo_uart->ier);
> + efr = readb(>ch_neo_uart->efr);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] jsm driver - Linux-2.6.12.3

2005-07-19 Thread V. ANANDA KRISHNAN
Hi All,

 Here is a patch to the jsm driver in the Linux (drivers/serial/jsm).
This patch takes care of (1) compiler warnings which displays the mixing
of declarations and code (2) dynamic allocation of major device number
instead of the static number 253 (3) the version update to reflect the
changes in the patch.

 Please CC me your comments.  Thanks.
Signed-off-by: V. Ananda Krishnan 





diff -Nuar linux-2.6.12.3.orig/drivers/serial/jsm/jsm_driver.c linux-2.6.12.3.new/drivers/serial/jsm/jsm_driver.c
--- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_driver.c	2005-07-19 15:16:20.0 -0500
+++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_driver.c	2005-07-19 15:18:57.0 -0500
@@ -22,6 +22,10 @@
  * Scott H Kilau <[EMAIL PROTECTED]>
  * Wendy Xiong   <[EMAIL PROTECTED]>
  *
+ * CHANGE LOG:
+ * Jul 18, 2005: Changed the major number changed to 0 to use the dynamic
+ *	allocation of major number by OS.
+ *
  ***/
 #include 
 #include 
@@ -42,7 +46,7 @@
 	.owner		= THIS_MODULE,
 	.driver_name	= JSM_DRIVER_NAME,
 	.dev_name	= "ttyn",
-	.major		= 253,
+	.major		= 0,
 	.minor		= JSM_MINOR_START,
 	.nr		= NR_PORTS,
 };
diff -Nuar linux-2.6.12.3.orig/drivers/serial/jsm/jsm.h linux-2.6.12.3.new/drivers/serial/jsm/jsm.h
--- linux-2.6.12.3.orig/drivers/serial/jsm/jsm.h	2005-07-19 15:16:21.00000 -0500
+++ linux-2.6.12.3.new/drivers/serial/jsm/jsm.h	2005-07-19 15:18:58.0 -0500
@@ -22,6 +22,9 @@
  * Scott H Kilau <[EMAIL PROTECTED]>
  * Wendy Xiong   <[EMAIL PROTECTED]>
  *
+ * CHANGE LOG:
+ * Jul 18, 2005: Changed the JSM_VERSION to "jsm: 1.2-1-INKERNEL"
+ *
  ***/
 
 #ifndef __JSM_DRIVER_H
@@ -90,7 +93,7 @@
 #define WRITEBUFLEN	((4096) + 4)
 #define MYFLIPLEN	N_TTY_BUF_SIZE
 
-#define JSM_VERSION	"jsm: 1.1-1-INKERNEL"
+#define JSM_VERSION	"jsm: 1.2-1-INKERNEL"
 #define JSM_PARTNUM	"40002438_A-INKERNEL"
 
 struct jsm_board;
diff -Nuar linux-2.6.12.3.orig/drivers/serial/jsm/jsm_neo.c linux-2.6.12.3.new/drivers/serial/jsm/jsm_neo.c
--- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_neo.c	2005-07-19 15:16:22.0 -0500
+++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_neo.c	2005-07-19 15:19:00.0 -0500
@@ -22,6 +22,9 @@
  * Scott H Kilau <[EMAIL PROTECTED]>
  * Wendy Xiong   <[EMAIL PROTECTED]>
  *
+ * CHANGE LOG:
+ * Jul 18, 2005: separated the mixed declarations and code.
+ *
  ***/
 #include 	/* For udelay */
 #include 	/* For the various UART offsets */
@@ -48,8 +51,9 @@
 
 static void neo_set_cts_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(>ch_neo_uart->ier);
-	u8 efr = readb(>ch_neo_uart->efr);
+	u8 ier, efr;
+	ier = readb(>ch_neo_uart->ier);
+	efr = readb(>ch_neo_uart->efr);
 
 	jsm_printk(PARAM, INFO, >ch_bd->pci_dev, "Setting CTSFLOW\n");
 
@@ -78,8 +82,9 @@
 
 static void neo_set_rts_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(>ch_neo_uart->ier);
-	u8 efr = readb(>ch_neo_uart->efr);
+	u8 ier, efr;
+	ier = readb(>ch_neo_uart->ier);
+	efr = readb(>ch_neo_uart->efr);
 
 	jsm_printk(PARAM, INFO, >ch_bd->pci_dev, "Setting RTSFLOW\n");
 
@@ -117,8 +122,9 @@
 
 static void neo_set_ixon_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(>ch_neo_uart->ier);
-	u8 efr = readb(>ch_neo_uart->efr);
+	u8 ier, efr;
+	ier = readb(>ch_neo_uart->ier);
+	efr = readb(>ch_neo_uart->efr);
 
 	jsm_printk(PARAM, INFO, >ch_bd->pci_dev, "Setting IXON FLOW\n");
 
@@ -153,8 +159,9 @@
 
 static void neo_set_ixoff_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(>ch_neo_uart->ier);
-	u8 efr = readb(>ch_neo_uart->efr);
+	u8 ier, efr;
+	ier = readb(>ch_neo_uart->ier);
+	efr = readb(>ch_neo_uart->efr);
 
 	jsm_printk(PARAM, INFO, >ch_bd->pci_dev, "Setting IXOFF FLOW\n");
 
@@ -190,8 +197,9 @@
 
 static void neo_set_no_input_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(>ch_neo_uart->ier);
-	u8 efr = readb(>ch_neo_uart->efr);
+	u8 ier, efr;
+	ier = readb(>ch_neo_uart->ier);
+	efr = readb(>ch_neo_uart->efr);
 
 	jsm_printk(PARAM, INFO, >ch_bd->pci_dev, "Unsetting Input FLOW\n");
 
@@ -228,8 +236,9 @@
 
 static void neo_set_no_output_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(>ch_neo_uart->ier);
-	u8 efr = readb(>ch_neo_uart->efr);
+	u8 ier, efr;
+	ier = readb(>ch_neo_uart->ier);
+	efr = readb(>ch_neo_uart->efr);
 
 	jsm_printk(PARAM, INFO, >ch_bd->pci_dev, "Unsetting Output FLOW\n");
 


[PATCH] jsm driver - Linux-2.6.12.3

2005-07-19 Thread V. ANANDA KRISHNAN
Hi All,

 Here is a patch to the jsm driver in the Linux (drivers/serial/jsm).
This patch takes care of (1) compiler warnings which displays the mixing
of declarations and code (2) dynamic allocation of major device number
instead of the static number 253 (3) the version update to reflect the
changes in the patch.

 Please CC me your comments.  Thanks.
Signed-off-by: V. Ananda Krishnan mansarov-at-us-dot-ibm-dot-com





diff -Nuar linux-2.6.12.3.orig/drivers/serial/jsm/jsm_driver.c linux-2.6.12.3.new/drivers/serial/jsm/jsm_driver.c
--- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_driver.c	2005-07-19 15:16:20.0 -0500
+++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_driver.c	2005-07-19 15:18:57.0 -0500
@@ -22,6 +22,10 @@
  * Scott H Kilau [EMAIL PROTECTED]
  * Wendy Xiong   [EMAIL PROTECTED]
  *
+ * CHANGE LOG:
+ * Jul 18, 2005: Changed the major number changed to 0 to use the dynamic
+ *	allocation of major number by OS.
+ *
  ***/
 #include linux/moduleparam.h
 #include linux/pci.h
@@ -42,7 +46,7 @@
 	.owner		= THIS_MODULE,
 	.driver_name	= JSM_DRIVER_NAME,
 	.dev_name	= ttyn,
-	.major		= 253,
+	.major		= 0,
 	.minor		= JSM_MINOR_START,
 	.nr		= NR_PORTS,
 };
diff -Nuar linux-2.6.12.3.orig/drivers/serial/jsm/jsm.h linux-2.6.12.3.new/drivers/serial/jsm/jsm.h
--- linux-2.6.12.3.orig/drivers/serial/jsm/jsm.h	2005-07-19 15:16:21.0 -0500
+++ linux-2.6.12.3.new/drivers/serial/jsm/jsm.h	2005-07-19 15:18:58.0 -0500
@@ -22,6 +22,9 @@
  * Scott H Kilau [EMAIL PROTECTED]
  * Wendy Xiong   [EMAIL PROTECTED]
  *
+ * CHANGE LOG:
+ * Jul 18, 2005: Changed the JSM_VERSION to jsm: 1.2-1-INKERNEL
+ *
  ***/
 
 #ifndef __JSM_DRIVER_H
@@ -90,7 +93,7 @@
 #define WRITEBUFLEN	((4096) + 4)
 #define MYFLIPLEN	N_TTY_BUF_SIZE
 
-#define JSM_VERSION	jsm: 1.1-1-INKERNEL
+#define JSM_VERSION	jsm: 1.2-1-INKERNEL
 #define JSM_PARTNUM	40002438_A-INKERNEL
 
 struct jsm_board;
diff -Nuar linux-2.6.12.3.orig/drivers/serial/jsm/jsm_neo.c linux-2.6.12.3.new/drivers/serial/jsm/jsm_neo.c
--- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_neo.c	2005-07-19 15:16:22.0 -0500
+++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_neo.c	2005-07-19 15:19:00.0 -0500
@@ -22,6 +22,9 @@
  * Scott H Kilau [EMAIL PROTECTED]
  * Wendy Xiong   [EMAIL PROTECTED]
  *
+ * CHANGE LOG:
+ * Jul 18, 2005: separated the mixed declarations and code.
+ *
  ***/
 #include linux/delay.h	/* For udelay */
 #include linux/serial_reg.h	/* For the various UART offsets */
@@ -48,8 +51,9 @@
 
 static void neo_set_cts_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(ch-ch_neo_uart-ier);
-	u8 efr = readb(ch-ch_neo_uart-efr);
+	u8 ier, efr;
+	ier = readb(ch-ch_neo_uart-ier);
+	efr = readb(ch-ch_neo_uart-efr);
 
 	jsm_printk(PARAM, INFO, ch-ch_bd-pci_dev, Setting CTSFLOW\n);
 
@@ -78,8 +82,9 @@
 
 static void neo_set_rts_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(ch-ch_neo_uart-ier);
-	u8 efr = readb(ch-ch_neo_uart-efr);
+	u8 ier, efr;
+	ier = readb(ch-ch_neo_uart-ier);
+	efr = readb(ch-ch_neo_uart-efr);
 
 	jsm_printk(PARAM, INFO, ch-ch_bd-pci_dev, Setting RTSFLOW\n);
 
@@ -117,8 +122,9 @@
 
 static void neo_set_ixon_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(ch-ch_neo_uart-ier);
-	u8 efr = readb(ch-ch_neo_uart-efr);
+	u8 ier, efr;
+	ier = readb(ch-ch_neo_uart-ier);
+	efr = readb(ch-ch_neo_uart-efr);
 
 	jsm_printk(PARAM, INFO, ch-ch_bd-pci_dev, Setting IXON FLOW\n);
 
@@ -153,8 +159,9 @@
 
 static void neo_set_ixoff_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(ch-ch_neo_uart-ier);
-	u8 efr = readb(ch-ch_neo_uart-efr);
+	u8 ier, efr;
+	ier = readb(ch-ch_neo_uart-ier);
+	efr = readb(ch-ch_neo_uart-efr);
 
 	jsm_printk(PARAM, INFO, ch-ch_bd-pci_dev, Setting IXOFF FLOW\n);
 
@@ -190,8 +197,9 @@
 
 static void neo_set_no_input_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(ch-ch_neo_uart-ier);
-	u8 efr = readb(ch-ch_neo_uart-efr);
+	u8 ier, efr;
+	ier = readb(ch-ch_neo_uart-ier);
+	efr = readb(ch-ch_neo_uart-efr);
 
 	jsm_printk(PARAM, INFO, ch-ch_bd-pci_dev, Unsetting Input FLOW\n);
 
@@ -228,8 +236,9 @@
 
 static void neo_set_no_output_flow_control(struct jsm_channel *ch)
 {
-	u8 ier = readb(ch-ch_neo_uart-ier);
-	u8 efr = readb(ch-ch_neo_uart-efr);
+	u8 ier, efr;
+	ier = readb(ch-ch_neo_uart-ier);
+	efr = readb(ch-ch_neo_uart-efr);
 
 	jsm_printk(PARAM, INFO, ch-ch_bd-pci_dev, Unsetting Output FLOW\n);
 


Re: [PATCH] jsm driver - Linux-2.6.12.3

2005-07-19 Thread Alexey Dobriyan
On Tue, Jul 19, 2005 at 12:53:20PM -0500, V. ANANDA KRISHNAN wrote:
 This patch takes care of (1) compiler warnings which displays the mixing
 of declarations and code

With what gcc version and what CFLAGS?

 (2) dynamic allocation of major device number
 instead of the static number 253 (3) the version update to reflect the
 changes in the patch.

 --- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_driver.c
 +++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_driver.c

 + * CHANGE LOG:
 + * Jul 18, 2005: Changed the major number changed to 0 to use the dynamic
 + *   allocation of major number by OS.
 + *

ChangeLog maintenance is the job of SCM. Don't add useless comments.

 --- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_neo.c
 +++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_neo.c

 - u8 ier = readb(ch-ch_neo_uart-ier);
 - u8 efr = readb(ch-ch_neo_uart-efr);
 + u8 ier, efr;
 + ier = readb(ch-ch_neo_uart-ier);
 + efr = readb(ch-ch_neo_uart-efr);

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] jsm driver - Linux-2.6.12.3

2005-07-19 Thread V. ANANDA KRISHNAN
I am using RHEL4.0-U1 as the distro. Here is the info on gcc version is
3.4.3-22.1

Thanks for your feed-back.

Ananda Krishnan
On Tue, 2005-07-19 at 22:47 +0400, Alexey Dobriyan wrote:
 On Tue, Jul 19, 2005 at 12:53:20PM -0500, V. ANANDA KRISHNAN wrote:
  This patch takes care of (1) compiler warnings which displays the mixing
  of declarations and code
 
 With what gcc version and what CFLAGS?
 
  (2) dynamic allocation of major device number
  instead of the static number 253 (3) the version update to reflect the
  changes in the patch.
 
  --- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_driver.c
  +++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_driver.c
 
  + * CHANGE LOG:
  + * Jul 18, 2005: Changed the major number changed to 0 to use the dynamic
  + * allocation of major number by OS.
  + *
 
 ChangeLog maintenance is the job of SCM. Don't add useless comments.
 
  --- linux-2.6.12.3.orig/drivers/serial/jsm/jsm_neo.c
  +++ linux-2.6.12.3.new/drivers/serial/jsm/jsm_neo.c
 
  -   u8 ier = readb(ch-ch_neo_uart-ier);
  -   u8 efr = readb(ch-ch_neo_uart-efr);
  +   u8 ier, efr;
  +   ier = readb(ch-ch_neo_uart-ier);
  +   efr = readb(ch-ch_neo_uart-efr);
 
 

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 2.6.12.3

2005-07-16 Thread Adrian Bunk
On Fri, Jul 15, 2005 at 09:48:16PM -0700, Greg KH wrote:
>...
> Summary of changes from v2.6.12.2 to v2.6.12.3
> ==
>...
> Ralf Baechle:
>   SMP fix for 6pack driver
>...

Will this patch [1] also be forward-ported to Linus' tree, or will 
2.6.12.3 stay the _only_ 2.6 kernel that ever offered this driver for 
SMP configs?

cu
Adrian

[1] "fix" is a wrong patch description since all it does is to remove 
the BROKEN_ON_SMP dependency

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 2.6.12.3

2005-07-16 Thread Adrian Bunk
On Fri, Jul 15, 2005 at 09:48:16PM -0700, Greg KH wrote:
...
 Summary of changes from v2.6.12.2 to v2.6.12.3
 ==
...
 Ralf Baechle:
   SMP fix for 6pack driver
...

Will this patch [1] also be forward-ported to Linus' tree, or will 
2.6.12.3 stay the _only_ 2.6 kernel that ever offered this driver for 
SMP configs?

cu
Adrian

[1] fix is a wrong patch description since all it does is to remove 
the BROKEN_ON_SMP dependency

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 2.6.12.3

2005-07-15 Thread Greg KH
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 12
-EXTRAVERSION = .2
+EXTRAVERSION = .3
 NAME=Woozy Numbat
 
 # *DOCUMENTATION*
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
--- a/arch/ppc/kernel/time.c
+++ b/arch/ppc/kernel/time.c
@@ -89,6 +89,9 @@ unsigned long tb_to_ns_scale;
 
 extern unsigned long wall_jiffies;
 
+/* used for timezone offset */
+static long timezone_offset;
+
 DEFINE_SPINLOCK(rtc_lock);
 
 EXPORT_SYMBOL(rtc_lock);
@@ -170,7 +173,7 @@ void timer_interrupt(struct pt_regs * re
 xtime.tv_sec - last_rtc_update >= 659 &&
 abs((xtime.tv_nsec / 1000) - (100-100/HZ)) < 
50/HZ &&
 jiffies - wall_jiffies == 1) {
-   if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) 
== 0)
+   if (ppc_md.set_rtc_time(xtime.tv_sec+1 + 
timezone_offset) == 0)
last_rtc_update = xtime.tv_sec+1;
else
/* Try again one minute later */
@@ -286,7 +289,7 @@ void __init time_init(void)
unsigned old_stamp, stamp, elapsed;
 
 if (ppc_md.time_init != NULL)
-time_offset = ppc_md.time_init();
+timezone_offset = ppc_md.time_init();
 
if (__USE_RTC()) {
/* 601 processor: dec counts down by 128 every 128ns */
@@ -331,10 +334,10 @@ void __init time_init(void)
set_dec(tb_ticks_per_jiffy);
 
/* If platform provided a timezone (pmac), we correct the time */
-if (time_offset) {
-   sys_tz.tz_minuteswest = -time_offset / 60;
+if (timezone_offset) {
+   sys_tz.tz_minuteswest = -timezone_offset / 60;
sys_tz.tz_dsttime = 0;
-   xtime.tv_sec -= time_offset;
+   xtime.tv_sec -= timezone_offset;
 }
 set_normalized_timespec(_to_monotonic,
 -xtime.tv_sec, -xtime.tv_nsec);
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -130,7 +130,7 @@ int start_fork_tramp(void *thread_arg, u
return(arg.pid);
 }
 
-static int ptrace_child(void)
+static int ptrace_child(void *arg)
 {
int ret;
int pid = os_getpid(), ppid = getppid();
@@ -159,16 +159,20 @@ static int ptrace_child(void)
_exit(ret);
 }
 
-static int start_ptraced_child(void)
+static int start_ptraced_child(void **stack_out)
 {
+   void *stack;
+   unsigned long sp;
int pid, n, status;

-   pid = fork();
-   if(pid == 0)
-   ptrace_child();
-
+   stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
+MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+   if(stack == MAP_FAILED)
+   panic("check_ptrace : mmap failed, errno = %d", errno);
+   sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
+   pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
if(pid < 0)
-   panic("check_ptrace : fork failed, errno = %d", errno);
+   panic("check_ptrace : clone failed, errno = %d", errno);
CATCH_EINTR(n = waitpid(pid, , WUNTRACED));
if(n < 0)
panic("check_ptrace : wait failed, errno = %d", errno);
@@ -176,6 +180,7 @@ static int start_ptraced_child(void)
panic("check_ptrace : expected SIGSTOP, got status = %d",
  status);
 
+   *stack_out = stack;
return(pid);
 }
 
@@ -183,12 +188,12 @@ static int start_ptraced_child(void)
  * just avoid using sysemu, not panic, but only if SYSEMU features are broken.
  * So only for SYSEMU features we test mustpanic, while normal host features
  * must work anyway!*/
-static int stop_ptraced_child(int pid, int exitcode, int mustexit)
+static int stop_ptraced_child(int pid, void *stack, int exitcode, int 
mustpanic)
 {
int status, n, ret = 0;
 
if(ptrace(PTRACE_CONT, pid, 0, 0) < 0)
-   panic("stop_ptraced_child : ptrace failed, errno = %d", errno);
+   panic("check_ptrace : ptrace failed, errno = %d", errno);
CATCH_EINTR(n = waitpid(pid, , 0));
if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
int exit_with = WEXITSTATUS(status);
@@ -199,13 +204,15 @@ static int stop_ptraced_child(int pid, i
printk("check_ptrace : child exited with exitcode %d, while "
  "expecting %d; status 0x%x", exit_with,
  exitcode, status);
-   if (mustexit)
+   if (mustpanic)
panic("\n");
else
printk("\n");
ret = -1;
}
 
+   if(munmap(stack, PAGE_SIZE) < 0)
+   panic("check_ptrace : munmap failed, errno = %d", errno);

Linux 2.6.12.3

2005-07-15 Thread Greg KH
We (the -stable team) are announcing the release of the 2.6.12.3 kernel.

The diffstat and short summary of the fixes are below.

I'll also be replying to this message with a copy of the patch between
2.6.12.2 and 2.6.12.3, as it is small enough to do so.

The updated 2.6.12.y git tree can be found at:

rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/linux-2.6.12.y.git
and can be browsed at the normal kernel.org git web browser:
www.kernel.org/git/

thanks,

greg k-h

--

 Makefile |2 
 arch/ppc/kernel/time.c   |   13 ++--
 arch/um/kernel/process.c |   48 ++---
 drivers/acpi/pci_irq.c   |2 
 drivers/char/tpm/tpm.c   |   76 ---
 drivers/char/tpm/tpm.h   |2 
 drivers/char/tpm/tpm_atmel.c |   16 +++--
 drivers/char/tpm/tpm_nsc.c   |   16 +++--
 drivers/char/tty_ioctl.c |4 -
 drivers/media/video/cx88/cx88-video.c|2 
 drivers/net/hamradio/Kconfig |2 
 drivers/net/shaper.c |   40 +-
 fs/char_dev.c|2 
 include/linux/if_shaper.h|2 
 net/ipv4/ip_output.c |3 -
 net/ipv4/netfilter/ip_conntrack_standalone.c |7 ++
 net/packet/af_packet.c   |6 ++
 17 files changed, 93 insertions(+), 150 deletions(-)


Summary of changes from v2.6.12.2 to v2.6.12.3
==

Alexander Nyberg:
  If ACPI doesn't find an irq listed, don't accept 0 as a valid PCI irq.

David S. Miller:
  fix Shaper driver lossage in 2.6.12

Greg Kroah-Hartman:
  Linux 2.6.12.3

john stultz:
  ppc32: stop misusing ntps time_offset value

KAMBAROV, ZAUR:
  coverity: tty_ldisc_ref return null check

Kylene Jo Hall:
  tpm breaks 8139cp

Michael Krufky:
  v4l cx88 hue offset fix

Paolo 'Blaisorblade' Giarrusso:
  uml: fix TT mode by reverting "use fork instead of clone"

Patrick McHardy:
  revert nf_reset change

Ralf Baechle:
  SMP fix for 6pack driver

Wen-chien Jesse Sung:
  fix semaphore handling in __unregister_chrdev_region
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Linux 2.6.12.3

2005-07-15 Thread Greg KH
We (the -stable team) are announcing the release of the 2.6.12.3 kernel.

The diffstat and short summary of the fixes are below.

I'll also be replying to this message with a copy of the patch between
2.6.12.2 and 2.6.12.3, as it is small enough to do so.

The updated 2.6.12.y git tree can be found at:

rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/linux-2.6.12.y.git
and can be browsed at the normal kernel.org git web browser:
www.kernel.org/git/

thanks,

greg k-h

--

 Makefile |2 
 arch/ppc/kernel/time.c   |   13 ++--
 arch/um/kernel/process.c |   48 ++---
 drivers/acpi/pci_irq.c   |2 
 drivers/char/tpm/tpm.c   |   76 ---
 drivers/char/tpm/tpm.h   |2 
 drivers/char/tpm/tpm_atmel.c |   16 +++--
 drivers/char/tpm/tpm_nsc.c   |   16 +++--
 drivers/char/tty_ioctl.c |4 -
 drivers/media/video/cx88/cx88-video.c|2 
 drivers/net/hamradio/Kconfig |2 
 drivers/net/shaper.c |   40 +-
 fs/char_dev.c|2 
 include/linux/if_shaper.h|2 
 net/ipv4/ip_output.c |3 -
 net/ipv4/netfilter/ip_conntrack_standalone.c |7 ++
 net/packet/af_packet.c   |6 ++
 17 files changed, 93 insertions(+), 150 deletions(-)


Summary of changes from v2.6.12.2 to v2.6.12.3
==

Alexander Nyberg:
  If ACPI doesn't find an irq listed, don't accept 0 as a valid PCI irq.

David S. Miller:
  fix Shaper driver lossage in 2.6.12

Greg Kroah-Hartman:
  Linux 2.6.12.3

john stultz:
  ppc32: stop misusing ntps time_offset value

KAMBAROV, ZAUR:
  coverity: tty_ldisc_ref return null check

Kylene Jo Hall:
  tpm breaks 8139cp

Michael Krufky:
  v4l cx88 hue offset fix

Paolo 'Blaisorblade' Giarrusso:
  uml: fix TT mode by reverting use fork instead of clone

Patrick McHardy:
  revert nf_reset change

Ralf Baechle:
  SMP fix for 6pack driver

Wen-chien Jesse Sung:
  fix semaphore handling in __unregister_chrdev_region
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Linux 2.6.12.3

2005-07-15 Thread Greg KH
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 12
-EXTRAVERSION = .2
+EXTRAVERSION = .3
 NAME=Woozy Numbat
 
 # *DOCUMENTATION*
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
--- a/arch/ppc/kernel/time.c
+++ b/arch/ppc/kernel/time.c
@@ -89,6 +89,9 @@ unsigned long tb_to_ns_scale;
 
 extern unsigned long wall_jiffies;
 
+/* used for timezone offset */
+static long timezone_offset;
+
 DEFINE_SPINLOCK(rtc_lock);
 
 EXPORT_SYMBOL(rtc_lock);
@@ -170,7 +173,7 @@ void timer_interrupt(struct pt_regs * re
 xtime.tv_sec - last_rtc_update = 659 
 abs((xtime.tv_nsec / 1000) - (100-100/HZ))  
50/HZ 
 jiffies - wall_jiffies == 1) {
-   if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) 
== 0)
+   if (ppc_md.set_rtc_time(xtime.tv_sec+1 + 
timezone_offset) == 0)
last_rtc_update = xtime.tv_sec+1;
else
/* Try again one minute later */
@@ -286,7 +289,7 @@ void __init time_init(void)
unsigned old_stamp, stamp, elapsed;
 
 if (ppc_md.time_init != NULL)
-time_offset = ppc_md.time_init();
+timezone_offset = ppc_md.time_init();
 
if (__USE_RTC()) {
/* 601 processor: dec counts down by 128 every 128ns */
@@ -331,10 +334,10 @@ void __init time_init(void)
set_dec(tb_ticks_per_jiffy);
 
/* If platform provided a timezone (pmac), we correct the time */
-if (time_offset) {
-   sys_tz.tz_minuteswest = -time_offset / 60;
+if (timezone_offset) {
+   sys_tz.tz_minuteswest = -timezone_offset / 60;
sys_tz.tz_dsttime = 0;
-   xtime.tv_sec -= time_offset;
+   xtime.tv_sec -= timezone_offset;
 }
 set_normalized_timespec(wall_to_monotonic,
 -xtime.tv_sec, -xtime.tv_nsec);
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c
--- a/arch/um/kernel/process.c
+++ b/arch/um/kernel/process.c
@@ -130,7 +130,7 @@ int start_fork_tramp(void *thread_arg, u
return(arg.pid);
 }
 
-static int ptrace_child(void)
+static int ptrace_child(void *arg)
 {
int ret;
int pid = os_getpid(), ppid = getppid();
@@ -159,16 +159,20 @@ static int ptrace_child(void)
_exit(ret);
 }
 
-static int start_ptraced_child(void)
+static int start_ptraced_child(void **stack_out)
 {
+   void *stack;
+   unsigned long sp;
int pid, n, status;

-   pid = fork();
-   if(pid == 0)
-   ptrace_child();
-
+   stack = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
+MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+   if(stack == MAP_FAILED)
+   panic(check_ptrace : mmap failed, errno = %d, errno);
+   sp = (unsigned long) stack + PAGE_SIZE - sizeof(void *);
+   pid = clone(ptrace_child, (void *) sp, SIGCHLD, NULL);
if(pid  0)
-   panic(check_ptrace : fork failed, errno = %d, errno);
+   panic(check_ptrace : clone failed, errno = %d, errno);
CATCH_EINTR(n = waitpid(pid, status, WUNTRACED));
if(n  0)
panic(check_ptrace : wait failed, errno = %d, errno);
@@ -176,6 +180,7 @@ static int start_ptraced_child(void)
panic(check_ptrace : expected SIGSTOP, got status = %d,
  status);
 
+   *stack_out = stack;
return(pid);
 }
 
@@ -183,12 +188,12 @@ static int start_ptraced_child(void)
  * just avoid using sysemu, not panic, but only if SYSEMU features are broken.
  * So only for SYSEMU features we test mustpanic, while normal host features
  * must work anyway!*/
-static int stop_ptraced_child(int pid, int exitcode, int mustexit)
+static int stop_ptraced_child(int pid, void *stack, int exitcode, int 
mustpanic)
 {
int status, n, ret = 0;
 
if(ptrace(PTRACE_CONT, pid, 0, 0)  0)
-   panic(stop_ptraced_child : ptrace failed, errno = %d, errno);
+   panic(check_ptrace : ptrace failed, errno = %d, errno);
CATCH_EINTR(n = waitpid(pid, status, 0));
if(!WIFEXITED(status) || (WEXITSTATUS(status) != exitcode)) {
int exit_with = WEXITSTATUS(status);
@@ -199,13 +204,15 @@ static int stop_ptraced_child(int pid, i
printk(check_ptrace : child exited with exitcode %d, while 
  expecting %d; status 0x%x, exit_with,
  exitcode, status);
-   if (mustexit)
+   if (mustpanic)
panic(\n);
else
printk(\n);
ret = -1;
}
 
+   if(munmap(stack, PAGE_SIZE)  0)
+   panic(check_ptrace : munmap failed, errno = %d, errno);
return ret;
 }