Re: [Xenomai-core] [PATCH] debug_maxlat as module_param

2005-12-17 Thread Philippe Gerum

Jan Kiszka wrote:

Gilles Chanteperdrix wrote:


Jan Kiszka wrote:
 Hi,
 
 this tiny patch exports the NMI watchdog's threshold as module parameter

 debug_maxlat of xeno_hal. This means that one can either override the
 value via a kernel parameter or in sysfs/modules/xeno_hal/parameters
 (before activating the hal).

rthal_maxlat_tsc should be updated when rthal_maxlat_us_arg changes.




I didn't digged that deep, is this possible during runtime? My current
workflow looks like this: unload xeno_nucleus (and higher modules),
change maxlat, reload the modules.

Mmh, I guess one has to register some update handler with sysfs in that
case. Any hint where to look for a pattern?



Please don't depend on sysfs for generic features since they would not 
be available on 2.4.



Jan




___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core



--

Philippe.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


[Xenomai-core] [PATCH] fix typos around 16550A driver

2005-12-17 Thread Jan Kiszka
Hi,

these are two typo fixes for the serial driver. One of them should have
broken kernel 2.4 compilation for this driver, the other is cosmetic

Jan


PS: What about this splnone in gatekeeper_thread(), BTW. Still needed?

--- ksrc/nucleus/shadow.c   (Revision 285)
+++ ksrc/nucleus/shadow.c   (Arbeitskopie)
@@ -384,7 +384,6 @@
set_current_state(TASK_INTERRUPTIBLE);
up(gk-sync); /* Make the request token available. */
schedule();
-   splnone();

if (kthread_should_stop())
break;
Index: ksrc/drivers/16550A/16550A.c
===
--- ksrc/drivers/16550A/16550A.c	(Revision 285)
+++ ksrc/drivers/16550A/16550A.c	(Arbeitskopie)
@@ -1025,7 +1025,7 @@
 
 device_class:   RTDM_CLASS_SERIAL,
 device_sub_class:   RTDM_SUBCLASS_16550A,
-driver_name:rt_16550A,
+driver_name:xeno_16550A,
 driver_version: RTDM_DRIVER_VER(1, 2, 1),
 peripheral_name:UART 16550A,
 provider_name:  Jan Kiszka,
Index: ksrc/drivers/16550A/Makefile
===
--- ksrc/drivers/16550A/Makefile	(Revision 285)
+++ ksrc/drivers/16550A/Makefile	(Arbeitskopie)
@@ -12,7 +12,7 @@
 
 O_TARGET := built-in.o
 
-obj-$(CONFIG_XENO_SKIN_16550A) := xeno_16550A.o
+obj-$(CONFIG_XENO_DRIVERS_16550A) := xeno_16550A.o
 
 list-multi := xeno_16550A.o
 


signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [PATCH] fix typos around 16550A driver

2005-12-17 Thread Philippe Gerum

Jan Kiszka wrote:

Hi,

these are two typo fixes for the serial driver. One of them should have
broken kernel 2.4 compilation for this driver, the other is cosmetic



Applied, thanks.


Jan


PS: What about this splnone in gatekeeper_thread(), BTW. Still needed?



Nope. Fixed.


--- ksrc/nucleus/shadow.c   (Revision 285)
+++ ksrc/nucleus/shadow.c   (Arbeitskopie)
@@ -384,7 +384,6 @@
set_current_state(TASK_INTERRUPTIBLE);
up(gk-sync); /* Make the request token available. */
schedule();
-   splnone();

if (kthread_should_stop())
break;




Index: ksrc/drivers/16550A/16550A.c
===
--- ksrc/drivers/16550A/16550A.c(Revision 285)
+++ ksrc/drivers/16550A/16550A.c(Arbeitskopie)
@@ -1025,7 +1025,7 @@
 
 device_class:   RTDM_CLASS_SERIAL,

 device_sub_class:   RTDM_SUBCLASS_16550A,
-driver_name:rt_16550A,
+driver_name:xeno_16550A,
 driver_version: RTDM_DRIVER_VER(1, 2, 1),
 peripheral_name:UART 16550A,
 provider_name:  Jan Kiszka,
Index: ksrc/drivers/16550A/Makefile
===
--- ksrc/drivers/16550A/Makefile(Revision 285)
+++ ksrc/drivers/16550A/Makefile(Arbeitskopie)
@@ -12,7 +12,7 @@
 
 O_TARGET := built-in.o
 
-obj-$(CONFIG_XENO_SKIN_16550A) := xeno_16550A.o

+obj-$(CONFIG_XENO_DRIVERS_16550A) := xeno_16550A.o
 
 list-multi := xeno_16550A.o
 





___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core



--

Philippe.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [bug] don't try this at home...

2005-12-17 Thread Philippe Gerum

Philippe Gerum wrote:

Philippe Gerum wrote:


Philippe Gerum wrote:


Jan Kiszka wrote:


Jan Kiszka wrote:


Hi Philippe,

I'm afraid this one is serious: let the attached migration stress test
run on likely any Xenomai since 2.0, preferably with
CONFIG_XENO_OPT_DEBUG on. Will give a nice crash sooner or later (I'm
trying to set up a serial console now).



Confirmed here. My test box went through some nifty triple salto out 
of the window running this frag for 2mn or so. Actually, the semop 
handshake is not even needed to cause the crash. At first sight, it 
looks like a migration issue taking place during the critical phase 
when a shadow thread switches back to Linux to terminate.





As it took some time to persuade my box to not just reboot but to 
give a

message, I'm posting here the kernel dump of the P-III running
nat_migration:

[...]
Xenomai: starting native API services.
ce649fb4 ce648000 0b17 0202 c0139246 cdf2819c cdf28070 0b12d310
   0037 ce648000  c02f0700 9a28  b7e94a70
bfed63c8
    ce648000 c0102fcb b7e94a70 bfed63dc b7faf4b0 bfed63c8

Call Trace:
 [c0139246] __ipipe_dispatch_event+0x96/0x130
 [c0102fcb] work_resched+0x6/0x1c
Xenomai: fatal: blocked thread migration[22175] rescheduled?!
(status=0x300010, sig=0, prev=watchdog/0[3])





This babe is awaken by Linux while Xeno sees it in a dormant state, 
likely after it has terminated. No wonder why things are going wild 
after that... Ok, job queued. Thanks.



 CPU  PIDPRI  TIMEOUT  STAT  NAME


0  0  0000500080  ROOT





   0  22175  1000300110  migration
Timer: none

cea05ee4 d0842c62 cdcb cea6d030 c02f0700 c035cbec c02f0700 0286
   c0139246 0022 c02f0700 cdf28070 cdf28070 0022 0001
c02f0700
   cea6d030 cdf28070 cea6d158 cea05f78 c02b26c0 cea04000 0238
d1244537
Call Trace:
 [c0139246] __ipipe_dispatch_event+0x96/0x130
 [c02b26c0] schedule+0x2d0/0x720
 [c0137b20] watchdog+0x0/0x80
 [c02b3967] schedule_timeout+0x47/0xb0
 [c0120070] process_timeout+0x0/0x10
 [c0120492] msleep_interruptible+0x42/0x60
 [c0137b70] watchdog+0x50/0x80
 [c012d0ab] kthread+0x8b/0x90
 [c012d020] kthread+0x0/0x90
 [c0100ef5] kernel_thread_helper+0x5/0x10




Fixed. The cause was related to the thread migration routine to 
primary mode (xnshadow_harden), which would spuriously call the Linux 
rescheduling procedure from the primary domain under certain 
circumstances. This bug only triggers on preemptible kernels. This 
also fixes the spinlock recursion issue which is sometimes triggered 
when the spinlock debug option is active.




Gasp. I've found a severe regression with this fix, so more work is 
needed. More later.




End of alert. Should be ok now.

--

Philippe.



Re: [Xenomai-core] [patch] fix posix userspace headers

2005-12-17 Thread Philippe Gerum

Jan Kiszka wrote:

Good evening,

this patch is required to compile some posix userspace program against
2.1 SVN.

Jan



Applied, thanks.





Index: include/posix/signal.h
===
--- include/posix/signal.h  (Revision 245)
+++ include/posix/signal.h  (Arbeitskopie)
@@ -20,6 +20,12 @@
 #ifndef _POSIX_SIGNAL_H
 #define _POSIX_SIGNAL_H
 
+#ifndef __KERNEL__

+
+#include_next signal.h
+
+#else /* __KERNEL__ */
+
 #include xenomai/posix/thread.h
 
 #define SIGACTION_FLAGS (SA_ONESHOT|SA_NOMASK|SA_SIGINFO)

@@ -46,4 +52,6 @@
 
 void pse51_signal_pkg_cleanup(void);
 
+#endif /* !__KERNEL__ */

+
 #endif /* !_POSIX_SIGNAL_H */




___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core



--

Philippe.



Re: [Xenomai-core] [doc-patch] rt_task_create user stack size

2005-12-17 Thread Philippe Gerum

Jan Kiszka wrote:

Hi,

Please apply this, the statement is no longer valid.



Applied, thanks.


--- ksrc/skins/native/task.c(revision 243)
+++ ksrc/skins/native/task.c(working copy)
@@ -117,7 +117,7 @@
  *
  * @param stksize The size of the stack (in bytes) for the new
  * task. If zero is passed, a reasonable pre-defined size will be
- * substituted. This parameter is ignored for user-space tasks.
+ * substituted.
  *
  * @param prio The base priority of the new task. This value must
  * range from [1 .. 99] (inclusive) where 1 is the lowest effective

Jan





___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core



--

Philippe.



[Xenomai-core] [PATCH] debug_maxlat as module_param

2005-12-17 Thread Jan Kiszka
Hi,

this tiny patch exports the NMI watchdog's threshold as module parameter
debug_maxlat of xeno_hal. This means that one can either override the
value via a kernel parameter or in sysfs/modules/xeno_hal/parameters
(before activating the hal).

Unfortunately, this tiny patch caused some headache to me as it first
made the kernel crash early during boot in sysfs_create_group(). I do
not understand why I need the second patch, I only guessed from the
kernel build output that some unlucky linking order screwed up
module_params in xenomai's non-generic arch files. If this is the only
solution, we have to verify if 2.4 still works (untested) and we have to
patch the Makefiles of the other archs.

Jan


PS: The NMI watchdog is nice, but we are really lacking a qualified
backtrace with all invoked functions in a critical path. I'm optimistic
that we will see Fu's first latency trace patch version already next
week. :)
Index: ksrc/arch/i386/hal.c
===
--- ksrc/arch/i386/hal.c	(Revision 285)
+++ ksrc/arch/i386/hal.c	(Arbeitskopie)
@@ -212,7 +212,8 @@
 unsigned long rthal_maxlat_tsc;
 EXPORT_SYMBOL(rthal_maxlat_tsc);
 
-static unsigned rthal_maxlat_us = CONFIG_XENO_HW_NMI_DEBUG_LATENCY_MAX;
+unsigned rthal_maxlat_us_arg = CONFIG_XENO_HW_NMI_DEBUG_LATENCY_MAX;
+module_param_named(debug_maxlat, rthal_maxlat_us_arg, uint, 0644);
 
 static void rthal_latency_above_max(struct pt_regs *regs)
 {
@@ -220,7 +221,7 @@
 snprintf(buf,
  sizeof(buf),
  NMI watchdog detected timer latency above %u us\n,
- rthal_maxlat_us);
+ rthal_maxlat_us_arg);
 die_nmi(regs, buf);
 }
 #endif
@@ -297,7 +298,7 @@
 
 #ifdef CONFIG_XENO_HW_NMI_DEBUG_LATENCY
 if (!p-mode) {
-rthal_maxlat_tsc = rthal_llimd(rthal_maxlat_us * 1000ULL,
+rthal_maxlat_tsc = rthal_llimd(rthal_maxlat_us_arg * 1000ULL,
RTHAL_CPU_FREQ,
10);
 
@@ -307,7 +308,7 @@
 printk(Xenomai: NMI watchdog not available.\n);
 else
 printk(Xenomai: NMI watchdog started (threshold=%u us).\n,
-		   rthal_maxlat_us);
+		   rthal_maxlat_us_arg);
 }
 #endif /* CONFIG_XENO_HW_NMI_DEBUG_LATENCY */
 
Index: scripts/prepare-kernel.sh
===
--- scripts/prepare-kernel.sh	(Revision 285)
+++ scripts/prepare-kernel.sh	(Arbeitskopie)
@@ -301,6 +301,7 @@
 # compilation files.
 
 do_links $xenomai_root/ksrc/arch/$xenomai_arch $linux_tree/arch/$linux_arch/xenomai
+do_links $xenomai_root/ksrc/arch/generic $linux_tree/arch/$linux_arch/xenomai/generic
 do_links $xenomai_root/ksrc $linux_tree/kernel/xenomai
 do_links $xenomai_root/ksrc/drivers $linux_tree/drivers/xenomai
 do_links $xenomai_root/include/asm-$xenomai_arch $linux_tree/include/asm-$linux_arch/xenomai
Index: ksrc/Makefile
===
--- ksrc/Makefile	(Revision 285)
+++ ksrc/Makefile	(Arbeitskopie)
@@ -2,14 +2,12 @@
 
 # Makefile frag for Linux v2.6
 
-obj-$(CONFIG_XENOMAI) += arch/ nucleus/ skins/
+obj-$(CONFIG_XENOMAI) += nucleus/ skins/
 
 else
 
 # Makefile frag for Linux v2.4
 
-subdir-$(CONFIG_XENOMAI) += arch
-
 subdir-$(CONFIG_XENO_OPT_NUCLEUS) += nucleus
 
 mod-subdirs := skins
Index: ksrc/arch/Makefile
===
--- ksrc/arch/Makefile	(Revision 285)
+++ ksrc/arch/Makefile	(Arbeitskopie)
@@ -1,15 +0,0 @@
-ifeq ($(PATCHLEVEL),6)
-
-# Makefile frag for Linux v2.6
-
-obj-$(CONFIG_XENOMAI) += generic/
-
-else
-
-# Makefile frag for Linux v2.4
-
-subdir-y += generic
-
-include $(TOPDIR)/Rules.make
-
-endif
Index: ksrc/arch/i386/Makefile
===
--- ksrc/arch/i386/Makefile	(Revision 285)
+++ ksrc/arch/i386/Makefile	(Arbeitskopie)
@@ -2,7 +2,7 @@
 
 # Makefile frag for Linux v2.6
 
-obj-$(CONFIG_XENOMAI) += xeno_hal.o
+obj-$(CONFIG_XENOMAI) += xeno_hal.o generic/
 
 xeno_hal-y := hal.o usercopy.o
 
@@ -14,6 +14,8 @@
 
 # Makefile frag for Linux v2.4
 
+subdir-y += generic
+
 USE_STANDARD_AS_RULE := true
 
 O_TARGET := built-in.o


signature.asc
Description: OpenPGP digital signature


Re: [Xenomai-core] [PATCH] debug_maxlat as module_param

2005-12-17 Thread Gilles Chanteperdrix
Jan Kiszka wrote:
  Hi,
  
  this tiny patch exports the NMI watchdog's threshold as module parameter
  debug_maxlat of xeno_hal. This means that one can either override the
  value via a kernel parameter or in sysfs/modules/xeno_hal/parameters
  (before activating the hal).

rthal_maxlat_tsc should be updated when rthal_maxlat_us_arg changes.

-- 


Gilles Chanteperdrix.



Re: [Xenomai-core] [PATCH] debug_maxlat as module_param

2005-12-17 Thread Jan Kiszka
Gilles Chanteperdrix wrote:
 Jan Kiszka wrote:
   Hi,
   
   this tiny patch exports the NMI watchdog's threshold as module parameter
   debug_maxlat of xeno_hal. This means that one can either override the
   value via a kernel parameter or in sysfs/modules/xeno_hal/parameters
   (before activating the hal).
 
 rthal_maxlat_tsc should be updated when rthal_maxlat_us_arg changes.
 

I didn't digged that deep, is this possible during runtime? My current
workflow looks like this: unload xeno_nucleus (and higher modules),
change maxlat, reload the modules.

Mmh, I guess one has to register some update handler with sysfs in that
case. Any hint where to look for a pattern?

Jan


signature.asc
Description: OpenPGP digital signature


Re: [Xenomai-core] [PATCH] debug_maxlat as module_param

2005-12-17 Thread Philippe Gerum

Jan Kiszka wrote:

Gilles Chanteperdrix wrote:


Jan Kiszka wrote:
 Hi,
 
 this tiny patch exports the NMI watchdog's threshold as module parameter

 debug_maxlat of xeno_hal. This means that one can either override the
 value via a kernel parameter or in sysfs/modules/xeno_hal/parameters
 (before activating the hal).

rthal_maxlat_tsc should be updated when rthal_maxlat_us_arg changes.




I didn't digged that deep, is this possible during runtime? My current
workflow looks like this: unload xeno_nucleus (and higher modules),
change maxlat, reload the modules.

Mmh, I guess one has to register some update handler with sysfs in that
case. Any hint where to look for a pattern?



Please don't depend on sysfs for generic features since they would not 
be available on 2.4.



Jan




___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core



--

Philippe.



[Xenomai-core] [PATCH] fix typos around 16550A driver

2005-12-17 Thread Jan Kiszka
Hi,

these are two typo fixes for the serial driver. One of them should have
broken kernel 2.4 compilation for this driver, the other is cosmetic

Jan


PS: What about this splnone in gatekeeper_thread(), BTW. Still needed?

--- ksrc/nucleus/shadow.c   (Revision 285)
+++ ksrc/nucleus/shadow.c   (Arbeitskopie)
@@ -384,7 +384,6 @@
set_current_state(TASK_INTERRUPTIBLE);
up(gk-sync); /* Make the request token available. */
schedule();
-   splnone();

if (kthread_should_stop())
break;
Index: ksrc/drivers/16550A/16550A.c
===
--- ksrc/drivers/16550A/16550A.c	(Revision 285)
+++ ksrc/drivers/16550A/16550A.c	(Arbeitskopie)
@@ -1025,7 +1025,7 @@
 
 device_class:   RTDM_CLASS_SERIAL,
 device_sub_class:   RTDM_SUBCLASS_16550A,
-driver_name:rt_16550A,
+driver_name:xeno_16550A,
 driver_version: RTDM_DRIVER_VER(1, 2, 1),
 peripheral_name:UART 16550A,
 provider_name:  Jan Kiszka,
Index: ksrc/drivers/16550A/Makefile
===
--- ksrc/drivers/16550A/Makefile	(Revision 285)
+++ ksrc/drivers/16550A/Makefile	(Arbeitskopie)
@@ -12,7 +12,7 @@
 
 O_TARGET := built-in.o
 
-obj-$(CONFIG_XENO_SKIN_16550A) := xeno_16550A.o
+obj-$(CONFIG_XENO_DRIVERS_16550A) := xeno_16550A.o
 
 list-multi := xeno_16550A.o
 


signature.asc
Description: OpenPGP digital signature


Re: [Xenomai-core] [PATCH] fix typos around 16550A driver

2005-12-17 Thread Philippe Gerum

Jan Kiszka wrote:

Hi,

these are two typo fixes for the serial driver. One of them should have
broken kernel 2.4 compilation for this driver, the other is cosmetic



Applied, thanks.


Jan


PS: What about this splnone in gatekeeper_thread(), BTW. Still needed?



Nope. Fixed.


--- ksrc/nucleus/shadow.c   (Revision 285)
+++ ksrc/nucleus/shadow.c   (Arbeitskopie)
@@ -384,7 +384,6 @@
set_current_state(TASK_INTERRUPTIBLE);
up(gk-sync); /* Make the request token available. */
schedule();
-   splnone();

if (kthread_should_stop())
break;




Index: ksrc/drivers/16550A/16550A.c
===
--- ksrc/drivers/16550A/16550A.c(Revision 285)
+++ ksrc/drivers/16550A/16550A.c(Arbeitskopie)
@@ -1025,7 +1025,7 @@
 
 device_class:   RTDM_CLASS_SERIAL,

 device_sub_class:   RTDM_SUBCLASS_16550A,
-driver_name:rt_16550A,
+driver_name:xeno_16550A,
 driver_version: RTDM_DRIVER_VER(1, 2, 1),
 peripheral_name:UART 16550A,
 provider_name:  Jan Kiszka,
Index: ksrc/drivers/16550A/Makefile
===
--- ksrc/drivers/16550A/Makefile(Revision 285)
+++ ksrc/drivers/16550A/Makefile(Arbeitskopie)
@@ -12,7 +12,7 @@
 
 O_TARGET := built-in.o
 
-obj-$(CONFIG_XENO_SKIN_16550A) := xeno_16550A.o

+obj-$(CONFIG_XENO_DRIVERS_16550A) := xeno_16550A.o
 
 list-multi := xeno_16550A.o
 





___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core



--

Philippe.