kernel threads crash
Subsystems (20)
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread b929cbc0 ('tt_upgw_0') at 0xb929cbc0 after exception #1792
or
Xenomai: suspending kernel thread b929cbc0 ('tt_upgw_0') at 0x0 after exception #1025
or
Xenomai: suspending kernel thread b911f518 ('rtnet-rtpc') at 0xb911f940 after exception #1792
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12
Signature · 1 line
/Jesper
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792
Quoted 7 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12
Signature · 1 line
Philippe.
Thanks i'll give 2.5.6 a shot.
Also it has come to my attention that there is some source files (arch/powerpc/platforms/85xx/cpci6200.c, arch/powerpc/platforms/85xx/cpci6200.h, arch/powerpc/platforms/85xx/cpci6200_timer.c) that are probably not covered by the adeos patch. Am i correct in assuming these need some work to support i-pipe?
/Jesper
Quoted 58 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 8 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12
Quoted 9 lines · Jesper Christensen
Thanks i'll give 2.5.6 a shot.
Also it has come to my attention that there is some source files (
arch/powerpc/platforms/85xx/cpci6200.c,arch/powerpc/platforms/85xx/cpci6200.h,arch/powerpc/platforms/85xx/cpci6200_timer.c) that are probably not covered by the adeos patch. Am i correct in assuming these need some work to support i-pipe?
I can't tell since I have no access to them, this is probably not a mainline port.
In any case, if any of those files implements the support for the programmable interrupt controller, hw timer, gpios and/or any form of cascaded interrupt handling, this is correct: they should be made I-pipe aware.
Quoted 63 lines
/Jesper
Quoted 58 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 8 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12
Signature · 1 line
Philippe.
Just in case ;)
/Jesper
Quoted 12 lines · Philippe Gerum
Quoted 10 lines · Jesper Christensen
Thanks i'll give 2.5.6 a shot.
Also it has come to my attention that there is some source files (
arch/powerpc/platforms/85xx/cpci6200.c,arch/powerpc/platforms/85xx/cpci6200.h,arch/powerpc/platforms/85xx/cpci6200_timer.c) that are probably not covered by the adeos patch. Am i correct in assuming these need some work to support i-pipe?
Quoted 78 lines
I can't tell since I have no access to them, this is probably not a mainline port.
In any case, if any of those files implements the support for the programmable interrupt controller, hw timer, gpios and/or any form of cascaded interrupt handling, this is correct: they should be made I-pipe aware.
Quoted 68 lines
/Jesper
Quoted 62 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 9 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12
arch/powerpc/boot/dts/cpci6200.dts +486 -0
@@ -0,0 +1,486 @@ +/* + * CPCI6200 Device Tree Source + * + * Author; [email protected] + * + * Copyright 2008 Emerson Network Power Embedded Computing Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +/dts-v1/; + +/ { + model = "CPCI6200"; + compatible = "CPCI6200"; + #address-cells = <1>; + #size-cells = <1>; + + aliases { + ethernet0 = &enet0; + ethernet1 = &enet1; + ethernet2 = &enet2; + ethernet3 = &enet3; + serial0 = &serial0; + serial1 = &serial1; + pci1 = &pci1; + pci2 = &pci2; + }; + + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,8572@0 { + device_type = "cpu"; + reg = <0>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x8000>; // L1=32K + i-cache-size = <0x8000>; // L1=32K + timebase-frequency = <0>; // from bootwrapper + bus-frequency = <0>; // from bw + clock-frequency = <0>; // from bootwrapper + next-level-cache = <&L2>; + }; + PowerPC,8572@1 { + device_type = "cpu"; + reg = <1>; + d-cache-line-size = <32>; // 32 bytes + i-cache-line-size = <32>; // 32 bytes + d-cache-size = <0x8000>; // L1=32K + i-cache-size = <0x8000>; // L1=32K + timebase-frequency = <0>; // from bootwrapper + bus-frequency = <0>; // from bw + clock-frequency = <0>; // from bootwrapper + next-level-cache = <&L2>; + }; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x80000000>; // 2 GB (fixed by bootwrapper) + }; + + soc8572@f1000000 { + device_type = "soc"; + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <2>; + ranges = <0x0 0xf1000000 0x00100000>; + reg = <0xf1000000 0x00100000>; + bus-frequency = <0>; + + memory-controller@2000 { + compatible = "fsl,8572-memory-controller"; + device_type = "memory-controller"; + reg = <0x2000 0x1000>; + virtual-reg = <0xf1002000>; + interrupts = <0x12 2>; + interrupt-parent = <&soc8572_pic>; + }; + + memory-controller@6000 { + compatible = "fsl,mpc8572-memory-controller"; + device_type = "memory-controller"; + reg = <0x6000 0x1000>; + virtual-reg = <0xf1006000>; + interrupts = <0x12 2>; + interrupt-parent = <&soc8572_pic>; + }; + + L2: l2_cache-controller@20000 { + compatible = "fsl,8572-l2-cache-controller"; + device_type = "l2_cache-controller"; + reg = <0x20000 0x1000>; + virtual-reg = <0xf1020000>; + cache-line-size = <32>; // 32 bytes + cache-size = <0x100000>; // L2, 1MB + interrupts = <0x10 2>; + interrupt-parent = <&soc8572_pic>; + }; + + i2c@3000 { + cell-index = <0>; + compatible = "fsl-i2c"; + device_type = "i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x3000 0x100>; + virtual-reg = <0xf1003000>; + dfsrr; + + rtc@68 { + device_type = "rtc"; + compatible = "m41t82"; + reg = <0x68>; + interrupts = <0x9 1>; + interrupt-parent = <&soc8572_pic>; + }; + }; + + i2c@3100 { + cell-index = <1>; + compatible = "fsl-i2c-ipmi"; + #address-cells = <1>; + device_type = "i2c"; + #size-cells = <0>; + reg = <0x3100 0x100>; + virtual-reg = <0xf1003100>; + dfsrr; + }; + + dma@c300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma"; + reg = <0xc300 0x4>; + ranges = <0x0 0xc100 0x200>; + cell-index = <1>; + dma-channel@0 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&soc8572_pic>; + interrupts = <76 2>; + }; + dma-channel@80 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&soc8572_pic>; + interrupts = <77 2>; + }; + dma-channel@100 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&soc8572_pic>; + interrupts = <78 2>; + }; + dma-channel@180 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&soc8572_pic>; + interrupts = <79 2>; + }; + }; + + dma@21300 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,mpc8572-dma", "fsl,eloplus-dma"; + reg = <0x21300 0x4>; + ranges = <0x0 0x21100 0x200>; + cell-index = <0>; + dma-channel@0 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x0 0x80>; + cell-index = <0>; + interrupt-parent = <&soc8572_pic>; + interrupts = <20 2>; + }; + dma-channel@80 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x80 0x80>; + cell-index = <1>; + interrupt-parent = <&soc8572_pic>; + interrupts = <21 2>; + }; + dma-channel@100 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x100 0x80>; + cell-index = <2>; + interrupt-parent = <&soc8572_pic>; + interrupts = <22 2>; + }; + dma-channel@180 { + compatible = "fsl,mpc8572-dma-channel", + "fsl,eloplus-dma-channel"; + reg = <0x180 0x80>; + cell-index = <3>; + interrupt-parent = <&soc8572_pic>; + interrupts = <23 2>; + }; + }; + + mdio@24520 { + compatible = "fsl,gianfar-mdio"; + cell-index = <0>; + #address-cells = <1>; + #size-cells = <0>; + device_type = "mdio"; + reg = <0x24520 0x20>; + + phy0_1: ethernet-phy@1 { + compatible = "broadcom,bcm5482"; + device_type = "ethernet-phy"; + interrupt-parent = <&soc8572_pic>; + interrupts = <0xa 1>; + reg = <1>; + }; + + phy0_2: ethernet-phy@2 { + compatible = "broadcom,bcm5482"; + device_type = "ethernet-phy"; + interrupt-parent = <&soc8572_pic>; + interrupts = <0xa 1>; + reg = <2>; + }; + }; + + mdio@26520 { + compatible = "fsl,gianfar-mdio"; + cell-index = <1>; + #address-cells = <1>; + #size-cells = <0>; + device_type = "mdio"; + reg = <0x26520 0x20>; + + phy1_3: ethernet-phy@3 { + compatible = "broadcom,bcm5482"; + device_type = "ethernet-phy"; + interrupt-parent = <&soc8572_pic>; + interrupts = <0xa 1>; + reg = <3>; + }; + + phy1_4: ethernet-phy@4 { + compatible = "broadcom,bcm5482"; + device_type = "ethernet-phy"; + interrupt-parent = <&soc8572_pic>; + interrupts = <0xa 1>; + reg = <4>; + }; + }; + + enet0: ethernet@24000 { /* MAC addresses set by bootwrapper */ + cell-index = <0>; + compatible = "gianfar"; + device_type = "network"; + model = "eTSEC"; + reg = <0x24000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <0x1d 2 0x1e 2 0x22 2>; + interrupt-parent = <&soc8572_pic>; + phy-handle = <&phy0_1>; + phy-connection-type = "rgmii-id"; + }; + + enet1: ethernet@25000 { + cell-index = <1>; + compatible = "gianfar"; + device_type = "network"; + model = "eTSEC"; + reg = <0x25000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <0x23 2 0x24 2 0x28 2>; + interrupt-parent = <&soc8572_pic>; + phy-handle = <&phy0_2>; + phy-connection-type = "rgmii-id"; + }; + + enet2: ethernet@26000 { + cell-index = <2>; + compatible = "gianfar"; + device_type = "network"; + model = "eTSEC"; + reg = <0x26000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <0x1f 2 0x20 2 0x21 2>; + interrupt-parent = <&soc8572_pic>; + phy-handle = <&phy1_3>; + phy-connection-type = "rgmii-id"; + }; + + enet3: ethernet@27000 { + cell-index = <3>; + compatible = "gianfar"; + device_type = "network"; + model = "eTSEC"; + reg = <0x27000 0x1000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <0x25 2 0x26 2 0x27 2>; + interrupt-parent = <&soc8572_pic>; + phy-handle = <&phy1_4>; + phy-connection-type = "rgmii-id"; + }; + + serial0: serial@4500 { + cell-index = <0>; + compatible = "ns16550"; + device_type = "serial"; + reg = <0x4500 0x100>; + virtual-reg = <0xf1004500>; + clock-frequency = <0>; + current-speed = <9600>; + interrupts = <0x2a 2>; + interrupt-parent = <&soc8572_pic>; + }; + + serial1: serial@4600 { + cell-index = <1>; + compatible = "ns16550"; + device_type = "serial"; + reg = <0x4600 0x100>; + virtual-reg = <0xf1004500>; + clock-frequency = <0>; + current-speed = <9600>; + interrupts = <0x2a 2>; + interrupt-parent = <&soc8572_pic>; + }; + + global-utilities@e0000 { //global utilities reg + compatible = "fsl,mpc8572-guts"; + reg = <0xe0000 0x1000>; + fsl,has-rstcr; + }; + + crypto@30000 { + compatible = "fsl,sec3.0", "fsl,sec2.4", "fsl,sec2.2", + "fsl,sec2.1", "fsl,sec2.0"; + reg = <0x30000 0x10000>; + interrupts = <45 2 58 2>; + interrupt-parent = <&soc8572_pic>; + fsl,num-channels = <4>; + fsl,channel-fifo-len = <24>; + fsl,exec-units-mask = <0x9fe>; + fsl,descriptor-types-mask = <0x3ab0ebf>; + }; + + soc8572_pic: pic@40000 { + compatible = "chrp,open-pic"; + device_type = "open-pic"; + clock-frequency = <0>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <2>; + reg = <0x40000 0x40000>; + big-endian; + }; + }; + + pci1: pci@f1009000 { + cell-index = <0>; + compatible = "fsl,mpc8548-pcie"; + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0xf1009000 0x1000>; + bus-range = <0x0 0xff>; + ranges = <0x02000000 0x0 0xf0400000 0xf0400000 0x0 0x00400000 + 0x01000000 0x0 0x00000000 0xf0000000 0x0 0x00400000>; + clock-frequency = <0>; + interrupts = <0x19 2>; + interrupt-parent = <&soc8572_pic>; + interrupt-map-mask = <0xf800 0x0 0x0 0x7>; + interrupt-map = < + /* IDSEL 0x0 */ + 0x0000 0 0 1 &soc8572_pic 4 1 + 0x0000 0 0 2 &soc8572_pic 5 1 + 0x0000 0 0 3 &soc8572_pic 6 1 + 0x0000 0 0 4 &soc8572_pic 7 1>; + pcie@0 { + reg = <0 0 0 0 0>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + ranges = <0x02000000 0x0 0xf0400000 + 0x02000000 0x0 0xf0400000 + 0x0 0x00400000 + + 0x01000000 0x0 0x00000000 + 0x01000000 0x0 0x00000000 + 0x0 0x00400000>; + }; + }; + + pci2: pci@f100a000 { + cell-index = <2>; + compatible = "fsl,mpc8548-pcie"; + device_type = "pci"; + #interrupt-cells = <1>; + #size-cells = <2>; + #address-cells = <3>; + reg = <0xf100a000 0x1000>; + bus-range = <0x0 0xff>; + ranges = <0x02000000 0 0xe0000000 0xe0000000 0x0 0x08000000 + 0x42000000 0 0xe8000000 0xe8000000 0x0 0x08000000 + 0x01000000 0 0x00000000 0xf0800000 0x0 0x00800000>; + clock-frequency = <0>; + interrupt-parent = <&soc8572_pic>; + interrupts = <0x1a 2>; + interrupt-map-mask = <0xf800 0x0 0x0 0x7>; + interrupt-map = < + /* IDSEL 0x0 */ + 0x0000 0 0 1 &soc8572_pic 0 1 + 0x0000 0 0 2 &soc8572_pic 1 1 + 0x0000 0 0 3 &soc8572_pic 2 1 + 0x0000 0 0 4 &soc8572_pic 3 1>; + pcie@0 { + reg = <0 0 0 0 0>; + #size-cells = <2>; + #address-cells = <3>; + device_type = "pci"; + ranges = <0x02000000 0x0 0xe0000000 + 0x02000000 0x0 0xe0000000 + 0x0 0x08000000 + + 0x42000000 0x0 0xe8000000 + 0x42000000 0x0 0xe8000000 + 0x0 0x08000000 + + 0x01000000 0x0 0x00000000 + 0x01000000 0x0 0x00000000 + 0x0 0x00800000>; + }; + }; + + board_timers@f2020000 { + device_type = "board_timers"; + reg = <0xf2020000 0x4c>; + interrupts = <0xb 1>; + interrupt-parent = <&soc8572_pic>; + }; + + serial@f2013000 { + device_type = "serial"; + compatible = "ns16550"; + reg = <0xf2013000 0x100>; + virtual-reg = <0xf2013000>; + clock-frequency = <10000000>; + current-speed = <9600>; + interrupts = <0xb 1>; + interrupt-parent = <&soc8572_pic>; + }; + + serial@f2014000 { + device_type = "serial"; + compatible = "ns16550"; + reg = <0xf2014000 0x100>; + virtual-reg = <0xf2014000>; + clock-frequency = <10000000>; + current-speed = <9600>; + interrupts = <0xb 1>; + interrupt-parent = <&soc8572_pic>; + }; + + chosen { + bootargs = "root=/dev/sda2 console=ttyS0,9600"; + linux,stdout-path = "/soc8572@f1000000/serial@4500"; + }; +};
arch/powerpc/boot/dts/mvme3100.dts +360 -0
360 lines not on this page · raw message
arch/powerpc/boot/dts/mvme4100.dts +437 -0
437 lines not on this page · raw message
arch/powerpc/boot/dts/mvme7100.dts +461 -0
461 lines not on this page · raw message
arch/powerpc/boot/main.c +9 -0
@@ -10,6 +10,7 @@*/ #include <stdarg.h> #include <stddef.h> +#include "../../../include/linux/autoconf.h" #include "elf.h" #include "page.h" #include "string.h"
@@ -142,8 +143,16 @@ static char cmdline[COMMAND_LINE_SIZE] __attribute__((__section__("__builtin_cmdline"))); +#ifdef CONFIG_CMDLINE_BOOL +static char compiled_string[COMMAND_LINE_SIZE ] =CONFIG_CMDLINE ; +#endif +static void prep_cmdline (void *chosen) { +#ifdef CONFIG_CMDLINE_BOOL +memcpy (cmdline, compiled_string,COMMAND_LINE_SIZE ); +#endif +if (cmdline[0 ] =='\0' )getprop (chosen,"bootargs" , cmdline,COMMAND_LINE_SIZE -1 );
arch/powerpc/boot/Makefile +21 -6
@@ -60,7 +60,7 @@ gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ - fsl-soc.c mpc8xx.c pq2.c + fsl-soc.c mpc8xx.c pq2.c src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \ cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
@@ -70,7 +70,8 @@ cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \ cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \ virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \ - cuboot-acadia.c + cuboot-acadia.c pplusboot-mvme3100.c pplusboot-mvme7100.c \ + pplusboot-mvme4100.c pplusboot-cpci6200.c src-boot := $(src-wlib) $(src-plat) empty.c src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -124,7 +125,7 @@ $(obj)/wrapper.a: $(obj-wlib) FORCE $(call if_changed,bootar) -hostprogs-y := addnote addRamDisk hack-coff mktree dtc +hostprogs-y := addnote addRamDisk hack-coff mktree dtc mkprep targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
@@ -133,7 +134,7 @@ dtstree := $(srctree)/$(src)/dts wrapper :=$(srctree)/$(src)/wrapper -wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \ +wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree mkprep dtc) \ $(wrapper) FORCE #############
@@ -227,6 +228,7 @@ image-$(CONFIG_WARP) += cuImage.warp image-$(CONFIG_YOSEMITE) += cuImage.yosemite + # Board ports in arch/powerpc/platform/8xx/Kconfig image-$(CONFIG_MPC86XADS) += cuImage.mpc866ads image-$(CONFIG_MPC885ADS) += cuImage.mpc885ads
@@ -268,6 +270,12 @@ image-$(CONFIG_SBC8548) += cuImage.sbc8548 image-$(CONFIG_SBC8560) += cuImage.sbc8560 image-$(CONFIG_KSI8560) += cuImage.ksi8560 +image-$(CONFIG_MVME3100) += pplusImage.mvme3100 +image-$(CONFIG_MVME4100) += pplusImage.mvme4100 +image-$(CONFIG_CPCI6200) += pplusImage.cpci6200 + +# Board ports in arch/powerpc/platform/86xx/Kconfig +image-$(CONFIG_MVME7100) += pplusImage.mvme7100 # Board ports in arch/powerpc/platform/embedded6xx/Kconfig image-$(CONFIG_STORCENTER) += cuImage.storcenter
@@ -287,7 +295,8 @@ initrd-y := $(patsubst zImage%, zImage.initrd%, \ $(patsubst dtbImage%, dtbImage.initrd%, \ $(patsubst simpleImage%, simpleImage.initrd%, \ - $(patsubst treeImage%, treeImage.initrd%, $(image-y))))) + $(patsubst treeImage%, treeImage.initrd%, $(image-y)) \ + $(patsubst pplusImage%, pplusImage.initrd%, $(image-y))))) initrd-y := $(filter-out $(image-y), $(initrd-y)) targets += $(image-y) $(initrd-y)
@@ -341,6 +350,12 @@ $(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb) +$(obj)/pplusImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) + $(call if_changed,wrap,pplusboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz) + +$(obj)/pplusImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) + $(call if_changed,wrap,pplusboot-$*,,$(obj)/$*.dtb) + # Rule to build device tree blobs $(obj)/%.dtb: $(dtstree)/%.dts $(obj)/dtc $(obj)/dtc -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts
@@ -362,7 +377,7 @@ clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \ zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \ zImage.iseries zImage.miboot zImage.pmac zImage.pseries \ - otheros.bld *.dtb + otheros.bld *.dtb pplusImage.* # clean up files cached by wrapper clean-kernel := vmlinux.strip vmlinux.bin
arch/powerpc/boot/mkprep.c +314 -0
314 lines not on this page · raw message
arch/powerpc/boot/ppcboot.h +5 -5
@@ -43,10 +43,10 @@unsigned long bi_sramstart;/* start of SRAM memory */ unsigned long bi_sramsize;/* size of SRAM memory */ #if defined(TARGET_8xx) || defined(TARGET_CPM2 ) || defined(TARGET_85xx) ||\ - defined(TARGET_83xx) + defined(TARGET_83xx) || defined(TARGET_MVME7100 ) || defined(TARGET_MVME3100 ) || defined(TARGET_MVME4100 ) || defined(TARGET_CPCI6200 )unsigned long bi_immr_base;/* base of IMMR register */ #endif -#if defined(TARGET_PPC_MPC52xx) +#if defined(TARGET_PPC_MPC52xx)unsigned long bi_mbar_base;/* base of internal registers */ #endif unsigned long bi_bootflags;/* boot / reboot flag (for LynxOS) */
@@ -78,18 +78,18 @@hymod_conf_t bi_hymod_conf;/* hymod configuration information */ #endif #if defined(TARGET_EVB64260 ) || defined(TARGET_405EP ) || defined(TARGET_44x) || \ - defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1 ) + defined(TARGET_85xx) || defined(TARGET_MVME7100 ) || defined(TARGET_MVME3100 ) || defined(TARGET_MVME4100 ) || defined(TARGET_CPCI6200 ) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1 )/* second onboard ethernet port */ unsigned char bi_enet1addr[6 ];#define HAVE_ENET1ADDR #endif #if defined(TARGET_EVB64260 ) || defined(TARGET_440GX ) || \ - defined(TARGET_85xx) || defined(TARGET_HAS_ETH2 ) + defined(TARGET_85xx) || defined(TARGET_HAS_ETH2 ) || defined(TARGET_MVME7100 ) || defined(TARGET_MVME3100 ) || defined(TARGET_MVME4100 ) || defined(TARGET_CPCI6200 )/* third onboard ethernet ports */ unsigned char bi_enet2addr[6 ];#define HAVE_ENET2ADDR #endif -#if defined(TARGET_440GX ) || defined(TARGET_HAS_ETH3 ) +#if defined(TARGET_440GX ) || defined(TARGET_HAS_ETH3 ) || defined(TARGET_MVME7100 ) || defined(TARGET_MVME4100 ) || defined(TARGET_CPCI6200 )/* fourth onboard ethernet ports */ unsigned char bi_enet3addr[6 ];#define HAVE_ENET3ADDR
arch/powerpc/boot/pplusboot-cpci6200.c +232 -0
232 lines not on this page · raw message
arch/powerpc/boot/pplusboot-mvme3100.c +181 -0
181 lines not on this page · raw message
arch/powerpc/boot/pplusboot-mvme4100.c +195 -0
195 lines not on this page · raw message
arch/powerpc/boot/pplusboot-mvme7100.c +210 -0
197 lines not on this page · raw message
arch/powerpc/configs/cpci6200_defconfig +1813 -0
1,813 lines not on this page · raw message
arch/powerpc/configs/mvme3100_defconfig +1830 -0
1,830 lines not on this page · raw message
arch/powerpc/configs/mvme4100_defconfig +1859 -0
1,859 lines not on this page · raw message
arch/powerpc/configs/mvme7100_defconfig +1863 -0
1,863 lines not on this page · raw message
arch/powerpc/include/asm/cpci6200_timer.h +40 -0
Lines of this file are not shown. View the raw message.
arch/powerpc/include/asm/mvme3100_timer.h +41 -0
41 lines not on this page · raw message
arch/powerpc/include/asm/mvme4100_timer.h +40 -0
Lines of this file are not shown. View the raw message.
arch/powerpc/include/asm/mvme7100_timer.h +40 -0
Lines of this file are not shown. View the raw message.
arch/powerpc/kernel/head_fsl_booke.S +119 -0
119 lines not on this page · raw message
arch/powerpc/platforms/85xx/cpci6200.c +1868 -0
1,868 lines not on this page · raw message
arch/powerpc/platforms/85xx/cpci6200.h +180 -0
180 lines not on this page · raw message
arch/powerpc/platforms/85xx/cpci6200_timer.c +394 -0
394 lines not on this page · raw message
arch/powerpc/platforms/85xx/Kconfig +76 -0
76 lines not on this page · raw message
arch/powerpc/platforms/85xx/mvme3100.c +1025 -0
1,025 lines not on this page · raw message
arch/powerpc/platforms/85xx/mvme3100.h +119 -0
119 lines not on this page · raw message
arch/powerpc/platforms/85xx/mvme3100_timer.c +392 -0
392 lines not on this page · raw message
arch/powerpc/platforms/85xx/mvme4100.c +1543 -0
1,543 lines not on this page · raw message
arch/powerpc/platforms/85xx/mvme4100.h +192 -0
192 lines not on this page · raw message
arch/powerpc/platforms/85xx/mvme4100_timer.c +394 -0
394 lines not on this page · raw message
arch/powerpc/platforms/85xx/smp.c +75 -5
80 lines not on this page · raw message
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +24 -0
Lines of this file are not shown. View the raw message.
arch/powerpc/platforms/86xx/mpc86xx_smp.c +41 -3
44 lines not on this page · raw message
arch/powerpc/platforms/86xx/mvme7100.c +1734 -0
1,734 lines not on this page · raw message
arch/powerpc/platforms/86xx/mvme7100.h +158 -0
158 lines not on this page · raw message
arch/powerpc/platforms/86xx/mvme7100_timer.c +396 -0
396 lines not on this page · raw message
arch/powerpc/sysdev/fsl_pci.c +152 -0
152 lines not on this page · raw message
drivers/char/ipmi/ipmi_msghandler.c +282 -43
325 lines not on this page · raw message
drivers/char/ipmi/ipmi_oops_console.c +256 -0
256 lines not on this page · raw message
drivers/char/ipmi/ipmi_serial.c +2298 -0
2,298 lines not on this page · raw message
drivers/char/ipmi/ipmi_serial_direct.c +643 -0
643 lines not on this page · raw message
drivers/char/ipmi/ipmi_serial_radisys_ascii.c +611 -0
611 lines not on this page · raw message
drivers/char/ipmi/ipmi_serial_terminal_mode.c +880 -0
880 lines not on this page · raw message
drivers/char/ipmi/ipmi_si_intf.c +159 -31
190 lines not on this page · raw message
drivers/char/ipmi/ipmi_smb.c +1859 -0
1,859 lines not on this page · raw message
drivers/hwmon/lm90.c +199 -1
200 lines not on this page · raw message
drivers/i2c/busses/i2c-mpc-ipmi.c +584 -0
584 lines not on this page · raw message
drivers/i2c/i2c-core.c +621 -179
800 lines not on this page · raw message
drivers/mtd/maps/cpci6200_nor.c +128 -0
128 lines not on this page · raw message
drivers/mtd/maps/mvme3100_nor.c +164 -0
164 lines not on this page · raw message
drivers/mtd/maps/mvme4100_nor.c +128 -0
128 lines not on this page · raw message
drivers/mtd/maps/mvme7100_nor.c +128 -0
128 lines not on this page · raw message
drivers/mtd/nand/cpci6200_nand.c +423 -0
423 lines not on this page · raw message
drivers/mtd/nand/mvme4100_nand.c +423 -0
423 lines not on this page · raw message
drivers/mtd/nand/mvme7100_nand.c +420 -0
420 lines not on this page · raw message
drivers/rtc/rtc-ds1375.c +276 -0
276 lines not on this page · raw message
drivers/rtc/rtc-m41t80.c +54 -10
64 lines not on this page · raw message
drivers/vme/ca91c042.c +1931 -0
1,931 lines not on this page · raw message
drivers/vme/ca91c042.h +390 -0
390 lines not on this page · raw message
drivers/vme/Kconfig +69 -0
69 lines not on this page · raw message
drivers/vme/tsi148.c +1858 -0
1,858 lines not on this page · raw message
drivers/vme/tsi148.h +1190 -0
1,190 lines not on this page · raw message
drivers/vme/vmedrv.c +774 -0
774 lines not on this page · raw message
drivers/vme/vmedrv.h +447 -0
447 lines not on this page · raw message
drivers/vme/vmelinux.c +1907 -0
1,907 lines not on this page · raw message
drivers/watchdog/cpci6200_wdt.c +449 -0
449 lines not on this page · raw message
drivers/watchdog/mvme4100_wdt.c +450 -0
450 lines not on this page · raw message
drivers/watchdog/mvme7100_wdt.c +450 -0
450 lines not on this page · raw message
fs/yaffs2/devextras.h +196 -0
196 lines not on this page · raw message
fs/yaffs2/Kconfig +156 -0
156 lines not on this page · raw message
fs/yaffs2/moduleconfig.h +65 -0
65 lines not on this page · raw message
fs/yaffs2/yaffs_checkptrw.c +397 -0
397 lines not on this page · raw message
fs/yaffs2/yaffs_ecc.c +326 -0
326 lines not on this page · raw message
fs/yaffs2/yaffs_ecc.h +44 -0
44 lines not on this page · raw message
fs/yaffs2/yaffs_fs.c +2542 -0
2,542 lines not on this page · raw message
fs/yaffs2/yaffs_guts.c +7580 -0
7,580 lines not on this page · raw message
fs/yaffs2/yaffs_guts.h +904 -0
904 lines not on this page · raw message
fs/yaffs2/yaffs_mtdif1.c +365 -0
365 lines not on this page · raw message
fs/yaffs2/yaffs_mtdif2.c +246 -0
246 lines not on this page · raw message
fs/yaffs2/yaffs_mtdif.c +241 -0
241 lines not on this page · raw message
fs/yaffs2/yaffs_nand.c +135 -0
135 lines not on this page · raw message
fs/yaffs2/yaffs_nand.h +44 -0
44 lines not on this page · raw message
fs/yaffs2/yaffs_packedtags1.c +50 -0
50 lines not on this page · raw message
fs/yaffs2/yaffs_packedtags2.c +206 -0
206 lines not on this page · raw message
fs/yaffs2/yaffs_packedtags2.h +43 -0
43 lines not on this page · raw message
fs/yaffs2/yaffs_qsort.c +163 -0
163 lines not on this page · raw message
fs/yaffs2/yaffs_tagscompat.c +541 -0
541 lines not on this page · raw message
fs/yaffs2/yportenv.h +203 -0
203 lines not on this page · raw message
include/linux/i2c.h +225 -1
226 lines not on this page · raw message
include/linux/ipmi_imb.h +146 -0
146 lines not on this page · raw message
include/linux/ipmi_radisys.h +128 -0
128 lines not on this page · raw message
include/linux/ipmi_serial_sm.h +306 -0
306 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
With the risk of jinx'ing it the 2.5.6 version seems to have done the trick. Huge thanks to you Philippe, you have saved my head from decapitation :)
/Jesper
Quoted 90 lines · Philippe Gerum
Quoted 10 lines · Jesper Christensen
Thanks i'll give 2.5.6 a shot.
Also it has come to my attention that there is some source files (
arch/powerpc/platforms/85xx/cpci6200.c,arch/powerpc/platforms/85xx/cpci6200.h,arch/powerpc/platforms/85xx/cpci6200_timer.c) that are probably not covered by the adeos patch. Am i correct in assuming these need some work to support i-pipe?I can't tell since I have no access to them, this is probably not a mainline port.
In any case, if any of those files implements the support for the programmable interrupt controller, hw timer, gpios and/or any form of cascaded interrupt handling, this is correct: they should be made I-pipe aware.
Quoted 68 lines
/Jesper
Quoted 62 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 9 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread b92a39d0 ('tt_upgw_0') at 0xb92a39d0 after exception #1792
/Jesper
Quoted 58 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 8 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12
Quoted 5 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792
You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.
Quoted 69 lines
/Jesper
Quoted 42 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 8 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 16 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
Problem is the NIP in question is the address of the thread structure as seen in the error message.
/Jesper
Quoted 89 lines · Philippe Gerum
Quoted 6 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 73 lines
/Jesper
Quoted 44 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 9 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 18 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Quoted 2 lines · Jesper Christensen
Problem is the NIP in question is the address of the thread structure as seen in the error message.
LR?
Quoted 95 lines
/Jesper
Quoted 89 lines · Philippe Gerum
Quoted 6 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 73 lines
/Jesper
Quoted 44 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 9 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 18 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
How do i see that?
/Jesper
Quoted 113 lines · Philippe Gerum
Quoted 3 lines · Jesper Christensen
Problem is the NIP in question is the address of the thread structure as seen in the error message.
LR?
Quoted 104 lines
/Jesper
Quoted 98 lines · Philippe Gerum
Quoted 7 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 78 lines
/Jesper
Quoted 46 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 10 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 20 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Quoted 2 lines · Jesper Christensen
How do i see that?
include/asm-powerpc/system.h +1 -1
@@ -104,7 +104,7 @@ typedef struct xnarch_fltinfo {#define xnarch_fault_trap (fi) ((unsigned int)(fi)->regs->trap)#define xnarch_fault_code (fi) ((fi)->regs->dar)#define xnarch_fault_pc (fi) ((fi)->regs->nip) -#define xnarch_fault_pc (fi) ((fi)->regs->nip) +#define xnarch_fault_lr (fi) ((fi)->regs->link)/* FIXME: FPU faults ignored by the nanokernel on PPC. */ #define xnarch_fault_fpu_p (fi) (0)/* The following predicates are only usable over a regular Linux stack
ksrc/nucleus/pod.c +2 -2
@@ -2591,8 +2591,8 @@ int xnpod_trap_fault(xnarch_fltinfo_t *fltinfo)if (!xnpod_userspace_p ()) {xnprintf - ("suspending kernel thread %p ('%s') at 0x%lx after exception #%u\n" , - thread, thread->name,xnarch_fault_pc (fltinfo), + ("suspending kernel thread %p ('%s') at nip=0x%lx, lr=0x%lx after exception #%u\n" , + thread, thread->name,xnarch_fault_pc (fltinfo),xnarch_fault_lr (fltinfo),xnarch_fault_trap (fltinfo));xnpod_suspend_thread (thread,XNSUSP ,XN_INFINITE ,XN_RELATIVE ,NULL );
Quoted 118 lines
/Jesper
Quoted 113 lines · Philippe Gerum
Quoted 3 lines · Jesper Christensen
Problem is the NIP in question is the address of the thread structure as seen in the error message.
LR?
Quoted 104 lines
/Jesper
Quoted 98 lines · Philippe Gerum
Quoted 7 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 78 lines
/Jesper
Quoted 46 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 10 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 20 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
I'll just give them a run and see, thanks!
/Jesper
Quoted 171 lines · Philippe Gerum
Quoted 3 lines · Jesper Christensen
How do i see that?
include/asm-powerpc/system.h +1
-1@@ -104,7 +104,7 @@ typedef struct xnarch_fltinfo {#define xnarch_fault_trap (fi) ((unsigned int)(fi)->regs->trap)#define xnarch_fault_code (fi) ((fi)->regs->dar)#define xnarch_fault_pc (fi) ((fi)->regs->nip) -#define xnarch_fault_pc (fi) ((fi)->regs->nip) +#define xnarch_fault_lr (fi) ((fi)->regs->link)/* FIXME: FPU faults ignored by the nanokernel on PPC. */ #define xnarch_fault_fpu_p (fi) (0)/* The following predicates are only usable over a regular Linux stack ksrc/nucleus/pod.c +2
-2@@ -2591,8 +2591,8 @@ int xnpod_trap_fault(xnarch_fltinfo_t *fltinfo)if (!xnpod_userspace_p ()) {xnprintf - ("suspending kernel thread %p ('%s') at 0x%lx after exception #%u\n" , - thread, thread->name,xnarch_fault_pc (fltinfo), + ("suspending kernel thread %p ('%s') at nip=0x%lx, lr=0x%lx after exception #%u\n" , + thread, thread->name,xnarch_fault_pc (fltinfo),xnarch_fault_lr (fltinfo),xnarch_fault_trap (fltinfo));xnpod_suspend_thread (thread,XNSUSP ,XN_INFINITE ,XN_RELATIVE ,NULL );Quoted 137 lines
/Jesper
Quoted 130 lines · Philippe Gerum
Quoted 4 lines · Jesper Christensen
Problem is the NIP in question is the address of the thread structure as seen in the error message.
LR?
Quoted 117 lines
/Jesper
Quoted 109 lines · Philippe Gerum
Quoted 8 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 85 lines
/Jesper
Quoted 48 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 11 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 23 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 12 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
hmm...
Xenomai: suspending kernel thread b911f518 ('rtnet-rtpc') at nip=0x1088860, lr=0x1088862 after exception #1025
LR points to nowhere...Maybe i should do a hexdump of the stack and manually decode it.
/Jesper
Quoted 208 lines · Jesper Christensen
I'll just give them a run and see, thanks!
/Jesper
Quoted 184 lines · Philippe Gerum
Quoted 4 lines · Jesper Christensen
How do i see that?
include/asm-powerpc/system.h +1
-1@@ -104,7 +104,7 @@ typedef struct xnarch_fltinfo {#define xnarch_fault_trap (fi) ((unsigned int)(fi)->regs->trap)#define xnarch_fault_code (fi) ((fi)->regs->dar)#define xnarch_fault_pc (fi) ((fi)->regs->nip) -#define xnarch_fault_pc (fi) ((fi)->regs->nip) +#define xnarch_fault_lr (fi) ((fi)->regs->link)/* FIXME: FPU faults ignored by the nanokernel on PPC. */ #define xnarch_fault_fpu_p (fi) (0)/* The following predicates are only usable over a regular Linux stack ksrc/nucleus/pod.c +2
-2@@ -2591,8 +2591,8 @@ int xnpod_trap_fault(xnarch_fltinfo_t *fltinfo)if (!xnpod_userspace_p ()) {xnprintf - ("suspending kernel thread %p ('%s') at 0x%lx after exception #%u\n" , - thread, thread->name,xnarch_fault_pc (fltinfo), + ("suspending kernel thread %p ('%s') at nip=0x%lx, lr=0x%lx after exception #%u\n" , + thread, thread->name,xnarch_fault_pc (fltinfo),xnarch_fault_lr (fltinfo),xnarch_fault_trap (fltinfo));xnpod_suspend_thread (thread,XNSUSP ,XN_INFINITE ,XN_RELATIVE ,NULL );Quoted 149 lines
/Jesper
Quoted 141 lines · Philippe Gerum
Quoted 5 lines · Jesper Christensen
Problem is the NIP in question is the address of the thread structure as seen in the error message.
LR?
Quoted 127 lines
/Jesper
Quoted 120 lines · Philippe Gerum
Quoted 9 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 92 lines
/Jesper
Quoted 50 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 12 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 26 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 13 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-coreQuoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
I have managed to print the stack of a faulting thread:
Xenomai: suspending kernel thread b911f518 ('rtnet-rtpc') at nip=0xb911f940, lr=0xb911f940, r1=0xaf2c4580 after exception #1792
Xenomai: dumping stack at af2c4600
Xenomai: 0xaf2c45ec - 0xaf2c45fc: 00000000 af2c4600 8009a334
00000000 00000000
Xenomai: 0xaf2c45d8 - 0xaf2c45e8: 00000000 0 00000000 00000000
00000000
Xenomai: 0xaf2c45c4 - 0xaf2c45d4: b911f518 0 00000000 af2c45f08009a364
Xenomai: 0xaf2c45b0 - 0xaf2c45c0: 00000000 0 00000000 00000000
00000000
Xenomai: 0xaf2c459c - 0xaf2c45ac: 00000000 0 00000000 b911f5188009a334
Xenomai: 0xaf2c4588 - 0xaf2c4598: 00000000 b911f4e0 af2c45d0b911649c 00000000
Xenomai: 0xaf2c4574 - 0xaf2c4584: 805e3988 8000000 805a89f0
00000001 b911f940
Xenomai: 0xaf2c4560 - 0xaf2c4570: b911f940 20000000 22000022b911ebb8 00000700
Xenomai: 0xaf2c454c - 0xaf2c455c: 805a89f0 b911f940 00029000
ffffffff 8009b2e4
Xenomai: 0xaf2c4538 - 0xaf2c4548: 00000000 b911ebb8 805e50c4805e3988 805a89f0
Xenomai: 0xaf2c4524 - 0xaf2c4534: 00100100 ffffffff 00000000af2c4580 8000bf48
Xenomai: 0xaf2c4510 - 0xaf2c4520: 00000000 0 00000000 00000000
00200200
Xenomai: 0xaf2c44fc - 0xaf2c450c: 805e3988 22000022 00000000
00000000 00000000
Manually decoded link register words:
---------------------------------------------------------------------------------------------------------8009a334:
$ powerpc-linux-gnu-addr2line -e vmlinux 0x8009a334 linux-2.6.29.6/arch/powerpc/include/asm/xenomai/bits/pod.h:168
8009a364:
$ powerpc-linux-gnu-addr2line -e vmlinux 0x8009a364 linux-2.6.29.6/arch/powerpc/include/asm/xenomai/bits/pod.h:172
b911649c:
$ powerpc-linux-gnu-addr2line -e ../3rd_party/XM-Linux/rtnet_build/stack/rtnet.ko 0x249c rtnet_build/stack/rtnet_rtpc.c:201
8000bf48:
$ powerpc-linux-gnu-addr2line -e vmlinux 0x8000bf48 linux-2.6.29.6/arch/powerpc/kernel/ipipe.c:429 (ipipe_trigger_irq(unsigned irq) at local_irq_restore_hw(flags);)
---------------------------------------------------------------------------------------------------------
Notice the "r1" register in the first line i assume should point to a back chain word, but the value is 00000001 and the "link register" word immediately after is b911f940 which points to:
# grep b911f940 /proc/kallsyms b911f940 b pending_calls_lock [rtnet]
I'm not sure of the significance of the stack frame after that one.
/Jesper
Quoted 252 lines · Jesper Christensen
hmm...
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at nip=0x1088860, lr=0x1088862 after exception #1025LR points to nowhere...Maybe i should do a hexdump of the stack and manually decode it.
/Jesper
Quoted 225 lines · Jesper Christensen
I'll just give them a run and see, thanks!
/Jesper
Quoted 206 lines · Philippe Gerum
Quoted 5 lines · Jesper Christensen
How do i see that?
include/asm-powerpc/system.h +1
-1@@ -104,7 +104,7 @@ typedef struct xnarch_fltinfo {#define xnarch_fault_trap (fi) ((unsigned int)(fi)->regs->trap)#define xnarch_fault_code (fi) ((fi)->regs->dar)#define xnarch_fault_pc (fi) ((fi)->regs->nip) -#define xnarch_fault_pc (fi) ((fi)->regs->nip) +#define xnarch_fault_lr (fi) ((fi)->regs->link)/* FIXME: FPU faults ignored by the nanokernel on PPC. */ #define xnarch_fault_fpu_p (fi) (0)/* The following predicates are only usable over a regular Linux stack ksrc/nucleus/pod.c +2
-2@@ -2591,8 +2591,8 @@ int xnpod_trap_fault(xnarch_fltinfo_t *fltinfo)if (!xnpod_userspace_p ()) {xnprintf - ("suspending kernel thread %p ('%s') at 0x%lx after exception #%u\n" , - thread, thread->name,xnarch_fault_pc (fltinfo), + ("suspending kernel thread %p ('%s') at nip=0x%lx, lr=0x%lx after exception #%u\n" , + thread, thread->name,xnarch_fault_pc (fltinfo),xnarch_fault_lr (fltinfo),xnarch_fault_trap (fltinfo));xnpod_suspend_thread (thread,XNSUSP ,XN_INFINITE ,XN_RELATIVE ,NULL );Quoted 169 lines
/Jesper
Quoted 159 lines · Philippe Gerum
Quoted 6 lines · Jesper Christensen
Problem is the NIP in question is the address of the thread structure as seen in the error message.
LR?
Quoted 142 lines
/Jesper
Quoted 131 lines · Philippe Gerum
Quoted 10 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 99 lines
/Jesper
Quoted 52 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 13 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 29 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 14 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-coreQuoted 11 lines
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Quoted 7 lines
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Quoted 3 lines · Jesper Christensen
I have managed to print the stack of a faulting thread:
Did you test the patch I directed you to? We may be chasing an already known issue here...
Signature · 1 line
Gilles.
Sorry about that, yes i merged that in right away.
/Jesper
Quoted 10 lines · Gilles Chanteperdrix
Quoted 4 lines · Jesper Christensen
I have managed to print the stack of a faulting thread:
Did you test the patch I directed you to? We may be chasing an already known issue here...
Quoted 57 lines · Jesper Christensen
I have managed to print the stack of a faulting thread:
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at nip=0xb911f940, lr=0xb911f940, r1=0xaf2c4580 after exception #1792Xenomai: dumping stack at
af2c4600
Xenomai:0xaf2c45ec-0xaf2c45fc: 00000000af2c46008009a334
00000000 00000000
Xenomai:0xaf2c45d8-0xaf2c45e8: 00000000 0 00000000 00000000
00000000
Xenomai:0xaf2c45c4-0xaf2c45d4:b911f5180 00000000af2c45f08009a364
Xenomai:0xaf2c45b0-0xaf2c45c0: 00000000 0 00000000 00000000
00000000
Xenomai:0xaf2c459c-0xaf2c45ac: 00000000 0 00000000b911f5188009a334
Xenomai:0xaf2c4588-0xaf2c4598: 00000000b911f4e0af2c45d0b911649c00000000
Xenomai:0xaf2c4574-0xaf2c4584:805e39888000000805a89f0
00000001b911f940
Xenomai:0xaf2c4560-0xaf2c4570:b911f94020000000 22000022b911ebb800000700
Xenomai:0xaf2c454c-0xaf2c455c:805a89f0b911f94000029000
ffffffff8009b2e4
Xenomai:0xaf2c4538-0xaf2c4548: 00000000b911ebb8805e50c4805e3988805a89f0
Xenomai:0xaf2c4524-0xaf2c4534: 00100100 ffffffff 00000000af2c45808000bf48
Xenomai:0xaf2c4510-0xaf2c4520: 00000000 0 00000000 00000000
00200200
Xenomai:0xaf2c44fc-0xaf2c450c:805e398822000022 00000000
00000000 00000000Manually decoded link register words:
---------------------------------------------------------------------------------------------------------8009a334:$ powerpc-linux-gnu-addr2line -e vmlinux 0x8009a334 linux-2.6.29.6/arch/powerpc/include/asm/xenomai/bits/pod.h:168
8009a364:$ powerpc-linux-gnu-addr2line -e vmlinux 0x8009a364 linux-2.6.29.6/arch/powerpc/include/asm/xenomai/bits/pod.h:172
b911649c:$ powerpc-linux-gnu-addr2line -e ../3rd_party/XM-Linux/rtnet_build/stack/rtnet.ko 0x249c rtnet_build/stack/rtnet_rtpc.c:201
8000bf48:$ powerpc-linux-gnu-addr2line -e vmlinux 0x8000bf48 linux-2.6.29.6/arch/powerpc/kernel/ipipe.c:429 (ipipe_trigger_irq(unsigned irq) at local_irq_restore_hw(flags);)---------------------------------------------------------------------------------------------------------
Quoted 9 lines
Notice the "r1" register in the first line i assume should point to a back chain word, but the value is 00000001 and the "link register" word immediately after is
b911f940which points to:# grep b911f940 /proc/kallsyms b911f940 b pending_calls_lock [rtnet]I'm not sure of the significance of the stack frame after that one.
IIRC, you said that you are using rtnet-rtpc for a special use case. Given the fact that this interface very well documented and highly intuitive to use ;), I wouldn't be too surprised if you ran into a race or an invalid use case.
Is the rtpc-using code part of your tarball? If so, can you break it out and explain on it how you use rtpc?
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Unfortunately it's not part of the tar ball, but i might be able to post a source file that sums it up pretty well.
/Jesper
Quoted 80 lines · Jan Kiszka
Quoted 57 lines · Jesper Christensen
I have managed to print the stack of a faulting thread:
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at nip=0xb911f940, lr=0xb911f940, r1=0xaf2c4580 after exception #1792Xenomai: dumping stack at
af2c4600
Xenomai:0xaf2c45ec-0xaf2c45fc: 00000000af2c46008009a334
00000000 00000000
Xenomai:0xaf2c45d8-0xaf2c45e8: 00000000 0 00000000 00000000
00000000
Xenomai:0xaf2c45c4-0xaf2c45d4:b911f5180 00000000af2c45f08009a364
Xenomai:0xaf2c45b0-0xaf2c45c0: 00000000 0 00000000 00000000
00000000
Xenomai:0xaf2c459c-0xaf2c45ac: 00000000 0 00000000b911f5188009a334
Xenomai:0xaf2c4588-0xaf2c4598: 00000000b911f4e0af2c45d0b911649c00000000
Xenomai:0xaf2c4574-0xaf2c4584:805e39888000000805a89f0
00000001b911f940
Xenomai:0xaf2c4560-0xaf2c4570:b911f94020000000 22000022b911ebb800000700
Xenomai:0xaf2c454c-0xaf2c455c:805a89f0b911f94000029000
ffffffff8009b2e4
Xenomai:0xaf2c4538-0xaf2c4548: 00000000b911ebb8805e50c4805e3988805a89f0
Xenomai:0xaf2c4524-0xaf2c4534: 00100100 ffffffff 00000000af2c45808000bf48
Xenomai:0xaf2c4510-0xaf2c4520: 00000000 0 00000000 00000000
00200200
Xenomai:0xaf2c44fc-0xaf2c450c:805e398822000022 00000000
00000000 00000000Manually decoded link register words:
---------------------------------------------------------------------------------------------------------8009a334:$ powerpc-linux-gnu-addr2line -e vmlinux 0x8009a334 linux-2.6.29.6/arch/powerpc/include/asm/xenomai/bits/pod.h:168
8009a364:$ powerpc-linux-gnu-addr2line -e vmlinux 0x8009a364 linux-2.6.29.6/arch/powerpc/include/asm/xenomai/bits/pod.h:172
b911649c:$ powerpc-linux-gnu-addr2line -e ../3rd_party/XM-Linux/rtnet_build/stack/rtnet.ko 0x249c rtnet_build/stack/rtnet_rtpc.c:201
8000bf48:$ powerpc-linux-gnu-addr2line -e vmlinux 0x8000bf48 linux-2.6.29.6/arch/powerpc/kernel/ipipe.c:429 (ipipe_trigger_irq(unsigned irq) at local_irq_restore_hw(flags);)---------------------------------------------------------------------------------------------------------
Quoted 10 lines
Notice the "r1" register in the first line i assume should point to a back chain word, but the value is 00000001 and the "link register" word immediately after is
b911f940which points to:# grep b911f940 /proc/kallsyms b911f940 b pending_calls_lock [rtnet]I'm not sure of the significance of the stack frame after that one.
IIRC, you said that you are using rtnet-rtpc for a special use case. Given the fact that this interface very well documented and highly intuitive to use ;), I wouldn't be too surprised if you ran into a race or an invalid use case.
Is the rtpc-using code part of your tarball? If so, can you break it out and explain on it how you use rtpc?
Jan
Speaking of rtpc, could there be a race condition when using a rtdm_lock_t to synchronize between a linux thread and a xenomai thread?
/Jesper
Quoted 80 lines · Jan Kiszka
Quoted 57 lines · Jesper Christensen
I have managed to print the stack of a faulting thread:
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at nip=0xb911f940, lr=0xb911f940, r1=0xaf2c4580 after exception #1792Xenomai: dumping stack at
af2c4600
Xenomai:0xaf2c45ec-0xaf2c45fc: 00000000af2c46008009a334
00000000 00000000
Xenomai:0xaf2c45d8-0xaf2c45e8: 00000000 0 00000000 00000000
00000000
Xenomai:0xaf2c45c4-0xaf2c45d4:b911f5180 00000000af2c45f08009a364
Xenomai:0xaf2c45b0-0xaf2c45c0: 00000000 0 00000000 00000000
00000000
Xenomai:0xaf2c459c-0xaf2c45ac: 00000000 0 00000000b911f5188009a334
Xenomai:0xaf2c4588-0xaf2c4598: 00000000b911f4e0af2c45d0b911649c00000000
Xenomai:0xaf2c4574-0xaf2c4584:805e39888000000805a89f0
00000001b911f940
Xenomai:0xaf2c4560-0xaf2c4570:b911f94020000000 22000022b911ebb800000700
Xenomai:0xaf2c454c-0xaf2c455c:805a89f0b911f94000029000
ffffffff8009b2e4
Xenomai:0xaf2c4538-0xaf2c4548: 00000000b911ebb8805e50c4805e3988805a89f0
Xenomai:0xaf2c4524-0xaf2c4534: 00100100 ffffffff 00000000af2c45808000bf48
Xenomai:0xaf2c4510-0xaf2c4520: 00000000 0 00000000 00000000
00200200
Xenomai:0xaf2c44fc-0xaf2c450c:805e398822000022 00000000
00000000 00000000Manually decoded link register words:
---------------------------------------------------------------------------------------------------------8009a334:$ powerpc-linux-gnu-addr2line -e vmlinux 0x8009a334 linux-2.6.29.6/arch/powerpc/include/asm/xenomai/bits/pod.h:168
8009a364:$ powerpc-linux-gnu-addr2line -e vmlinux 0x8009a364 linux-2.6.29.6/arch/powerpc/include/asm/xenomai/bits/pod.h:172
b911649c:$ powerpc-linux-gnu-addr2line -e ../3rd_party/XM-Linux/rtnet_build/stack/rtnet.ko 0x249c rtnet_build/stack/rtnet_rtpc.c:201
8000bf48:$ powerpc-linux-gnu-addr2line -e vmlinux 0x8000bf48 linux-2.6.29.6/arch/powerpc/kernel/ipipe.c:429 (ipipe_trigger_irq(unsigned irq) at local_irq_restore_hw(flags);)---------------------------------------------------------------------------------------------------------
Quoted 10 lines
Notice the "r1" register in the first line i assume should point to a back chain word, but the value is 00000001 and the "link register" word immediately after is
b911f940which points to:# grep b911f940 /proc/kallsyms b911f940 b pending_calls_lock [rtnet]I'm not sure of the significance of the stack frame after that one.
IIRC, you said that you are using rtnet-rtpc for a special use case. Given the fact that this interface very well documented and highly intuitive to use ;), I wouldn't be too surprised if you ran into a race or an invalid use case.
Is the rtpc-using code part of your tarball? If so, can you break it out and explain on it how you use rtpc?
Jan
Quoted 2 lines · Jesper Christensen
Speaking of rtpc, could there be a race condition when using a
rtdm_lock_tto synchronize between a linux thread and a xenomai thread?
Without seeing at some code, I can't comment on this meaningfully.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
There you go:
-----------------------------------------------------------------------------------
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/workqueue.h>
#include <rtnet_rtpc.h>
#include <up.h>
static rtdm_lock_t umsg_list_lock = RTDM_LOCK_UNLOCKED;
static rtdm_nrtsig_t up_nrt_signal;LIST_HEAD(umsg_list);
static void up_work_queue_handler(struct work_struct *work); DECLARE_WORK(wq, up_work_queue_handler);
u32 up_user_pid = 0;
struct up_msg_buf *up_alloc_msg_buf(int cmd, size_t psize, struct genl_info *info,
up_msg_finalize fin)
{
struct up_msg_buf *ret;
ret = kmalloc(sizeof(struct up_msg_buf) + psize, GFP_KERNEL);
if(!ret)
return ret;
memset(ret, 0, sizeof(struct up_msg_buf));
/* Initialize some fields */
if(info) {
ret->pid = info->snd_pid;
ret->seq = info->snd_seq;
}
ret->cmd = cmd;
ret->finalize = fin;
return ret;}
void up_queue_umsg(struct up_msg_buf *umsg, int op, int len, U8 upid) {
rtdm_lockctx_t context;
umsg->hdr.opcode = op;
umsg->hdr.plen = len;
umsg->hdr.up_id = upid;
rtdm_lock_get_irqsave(&umsg_list_lock, context);
list_add_tail(&umsg->list_entry, &umsg_list);
rtdm_lock_put_irqrestore(&umsg_list_lock, context);
rtdm_nrtsig_pend(&up_nrt_signal);}
static int up_handle_cmd_msg_rt(struct rt_proc_call *call) {
struct up_cmd_param *params;
struct up_msg_buf *resp;
params = rtpc_get_priv(call, struct up_cmd_param);
resp = params->resp_buf;
if(resp)
resp->cmd = UP_NL_C_CMD;
switch(params->hdr.opcode) {
case UP_CMD_INIT:
break;
case UP_CMD_CREATE_REQ:
{
struct up_config *c = (struct up_config *)¶ms->msg.config;
int *res = (int *)resp->payload;
*res = up_create(params->hdr.up_id, c);
if(*res < 0)
rtdm_printk("Error creating UP\n");
up_queue_umsg(resp, UP_CMD_CREATE_RES, sizeof(int), 0);
break;
}
default:
rtdm_printk("Unknown cmd message: op=%d\n", params->hdr.opcode);
return -ENOTSUPP;
}
return 0;
}static int up_handle_cmd_msg_nrt(struct sk_buff *skb, struct genl_info *info)
{
int ret;
struct up_cmd_param params;
struct up_user_hdr *uhdr = (struct up_user_hdr *)info->userhdr;
//TODO: Allocate response buffer based on message type
switch(uhdr->opcode) {
case UP_CMD_INIT:
up_user_pid = info->snd_pid;
params.resp_buf = NULL;
break;
default:
params.resp_buf = up_alloc_msg_buf(UP_NL_C_CMD,
sizeof(cmdMsg_t),
info, NULL);
break;
};
memcpy(¶ms.hdr, info->userhdr, sizeof(struct up_user_hdr));
if(params.hdr.plen > sizeof(cmdMsg_t))
printk("up_handle_cmd_msg_nrt(): ERROR plen=%u >sizeof(cmdMsg_t)=%u\n", params.hdr.plen, sizeof(cmdMsg_t));
if(params.hdr.plen)
nla_memcpy(¶ms.msg, info->attrs[UP_NL_A_MSG], params.hdr.plen);
ret = rtpc_dispatch_call(up_handle_cmd_msg_rt, 0, ¶ms,
sizeof(params),
NULL, NULL, NULL);
if(ret < 0)
kfree(params.resp_buf);
return ret;}
/* netlink attribute policy */
static const struct nla_policy up_genl_policy[UP_NL_A_MAX + 1] = {
[UP_NL_A_MSG] = { .type = NLA_BINARY }
};/* Generic netlink event operation definition */
static struct genl_ops up_genl_ops_cmd = {
.cmd = UP_NL_C_CMD,
.flags = 0,
.policy = up_genl_policy,
.doit = up_handle_cmd_msg_nrt,
.dumpit = NULL
};
/* Generic netlink family */
static struct genl_family up_genl_family = {
.id = GENL_ID_GENERATE,
.hdrsize = UP_GENL_HDRLEN,
.name = "up",
.version = UP_NL_VERSION,
.maxattr = UP_NL_A_MAX
};
static void up_work_queue_handler(struct work_struct *work) {
struct up_msg_buf *msg;
struct sk_buff *skb;
struct up_user_hdr *uhdr;
rtdm_lockctx_t context;
int rc;
rtdm_lock_get_irqsave(&umsg_list_lock, context);
while(!list_empty(&umsg_list)) {
msg = (struct up_msg_buf *)umsg_list.next;
list_del(&msg->list_entry);
rtdm_lock_put_irqrestore(&umsg_list_lock, context);
/* construct netlink message and send */
skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
if(!skb)
goto failure;
uhdr = genlmsg_put(skb, msg->pid, msg->seq, &up_genl_family,
0, msg->cmd);
if(!uhdr)
goto skb_failure;
memcpy(uhdr, &msg->hdr, sizeof(struct up_user_hdr));
rc = nla_put(skb, UP_NL_A_MSG, msg->hdr.plen, &msg->payload);
if(rc != 0)
goto skb_failure;
genlmsg_end(skb, uhdr);
rc = genlmsg_unicast(skb, msg->pid);
if(msg->finalize)
msg->finalize(msg);
else
kfree(msg);
if(rc < 0)
goto skb_failure;
rtdm_lock_get_irqsave(&umsg_list_lock, context);
}
rtdm_lock_put_irqrestore(&umsg_list_lock, context);
return;skb_failure:
nlmsg_free(skb);
failure:
printk("Response failure\n");}
static void up_signal_handler(rtdm_nrtsig_t nrt_sig, void *arg)
{
/* Schedule work to be done in process context */
schedule_work(&wq);
}static int __init up_init(void)
{
int rc = 0;
printk("UP module loading\n");
rc = genl_register_family(&up_genl_family);
if(rc != 0)
return rc;
rc = genl_register_ops(&up_genl_family, &up_genl_ops_cmd);
if(rc != 0)
goto failure;
rc = rtdm_nrtsig_init(&up_nrt_signal, up_signal_handler, NULL);
if(rc < 0)
goto failure;
rc = up_init();
if(rc < 0)
goto failure;
return 0;failure:
printk("UP module loading failed\n");
genl_unregister_family(&up_genl_family);
return rc;
}static void __exit up_release(void)
{
printk("UP module unloading\n");
rtdm_nrtsig_destroy(&up_nrt_signal);
genl_unregister_family(&up_genl_family);
up_release();}
module_init(up_init);module_exit(up_release);
-----------------------------------------------------------------------------------
/Jesper
Quoted 10 lines · Jan Kiszka
Quoted 3 lines · Jesper Christensen
Speaking of rtpc, could there be a race condition when using a
rtdm_lock_tto synchronize between a linux thread and a xenomai thread?Without seeing at some code, I can't comment on this meaningfully.
Jan
Quoted 28 lines · Jesper Christensen
There you go:
-----------------------------------------------------------------------------------
#include <
linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/workqueue.h>#include <
rtnet_rtpc.h>
#include <up.h>static
rtdm_lock_tumsg_list_lock=RTDM_LOCK_UNLOCKED;
staticrtdm_nrtsig_tup_nrt_signal;LIST_HEAD(umsg_list);static void
up_work_queue_handler(struct work_struct *work);DECLARE_WORK(wq, up_work_queue_handler);u32
up_user_pid= 0;struct
up_msg_buf*up_alloc_msg_buf(int cmd,size_tpsize, structgenl_info*info,
up_msg_finalizefin)
Quoted 9 lines
{
struct up_msg_buf *ret;
ret = kmalloc(sizeof(struct up_msg_buf) + psize, GFP_KERNEL);
if(!ret)
return ret;
memset(ret, 0, sizeof(struct up_msg_buf));[ kzalloc = kmalloc + memset ]
Quoted 16 lines
/* Initialize some fields */ if(info) { ret->pid = info->snd_pid; ret->seq = info->snd_seq; } ret->cmd = cmd; ret->finalize = fin; return ret;}
void
up_queue_umsg(struct up_msg_buf *umsg, int op, int len, U8 upid)
Quoted 14 lines
{
rtdm_lockctx_t context;
umsg->hdr.opcode = op;
umsg->hdr.plen = len;
umsg->hdr.up_id = upid;
rtdm_lock_get_irqsave(&umsg_list_lock, context);
list_add_tail(&umsg->list_entry, &umsg_list);
rtdm_lock_put_irqrestore(&umsg_list_lock, context);
rtdm_nrtsig_pend(&up_nrt_signal);Why this signaling here? Either the message is processed synchronously (/wrt dispatch_call) so that you can release it after return from the dispatcher, or it's handled asynchronously, but then this signal comes too early as the RT work is potentially still ongoing.
Quoted 18 lines
}
static int
up_handle_cmd_msg_rt(struct rt_proc_call *call){ struct up_cmd_param *params; struct up_msg_buf *resp; params = rtpc_get_priv(call, struct up_cmd_param); resp = params->resp_buf; if(resp) resp->cmd = UP_NL_C_CMD; switch(params->hdr.opcode) {
Quoted 8 lines
case UP_CMD_INIT:
break;
case UP_CMD_CREATE_REQ:
{
struct up_config *c = (struct up_config *)¶ms->msg.config;
int *res = (int *)resp->payload;
*res = up_create(params->hdr.up_id, c);I can only assume this function doesn't do anything crazy.
Quoted 43 lines
if(*res < 0) rtdm_printk("Error creating UP\n"); up_queue_umsg(resp, UP_CMD_CREATE_RES, sizeof(int), 0); break; } default: rtdm_printk("Unknown cmd message: op=%d\n", params->hdr.opcode); return -ENOTSUPP; } return 0; }static int
up_handle_cmd_msg_nrt(struct sk_buff *skb, struct genl_info *info){ int ret; struct up_cmd_param params; struct up_user_hdr *uhdr = (struct up_user_hdr *)info->userhdr; //TODO: Allocate response buffer based on message type switch(uhdr->opcode) { case UP_CMD_INIT: up_user_pid = info->snd_pid; params.resp_buf = NULL; break; default: params.resp_buf = up_alloc_msg_buf(UP_NL_C_CMD, sizeof(cmdMsg_t), info, NULL); break; }; memcpy(¶ms.hdr, info->userhdr, sizeof(struct up_user_hdr)); if(params.hdr.plen > sizeof(cmdMsg_t)) printk("up_handle_cmd_msg_nrt(): ERROR plen=%u >
Quoted 8 lines
sizeof(cmdMsg_t)=%u\n", params.hdr.plen,
sizeof(cmdMsg_t));if(params.hdr.plen)
nla_memcpy(¶ms.msg, info->attrs[UP_NL_A_MSG], params.hdr.plen);ret = rtpc_dispatch_call(up_handle_cmd_msg_rt, 0, ¶ms,
sizeof(params),NULL, NULL, NULL);
That shouldn't build (too many arguments).
Quoted 106 lines
if(ret < 0) kfree(params.resp_buf); return ret;}
/* netlink attribute policy */
static const struct nla_policy up_genl_policy[UP_NL_A_MAX + 1] = { [UP_NL_A_MSG] = { .type = NLA_BINARY } };/* Generic netlink event operation definition */
static structgenl_opsup_genl_ops_cmd= {
.cmd =UP_NL_C_CMD,
.flags = 0,
.policy =up_genl_policy,
.doit =up_handle_cmd_msg_nrt,
.dumpit = NULL
};/* Generic netlink family */
static structgenl_familyup_genl_family= {
.id =GENL_ID_GENERATE,
.hdrsize =UP_GENL_HDRLEN,
.name = "up",
.version =UP_NL_VERSION,
.maxattr =UP_NL_A_MAX
};static void
up_work_queue_handler(struct work_struct *work){ struct up_msg_buf *msg; struct sk_buff *skb; struct up_user_hdr *uhdr; rtdm_lockctx_t context; int rc; rtdm_lock_get_irqsave(&umsg_list_lock, context); while(!list_empty(&umsg_list)) { msg = (struct up_msg_buf *)umsg_list.next; list_del(&msg->list_entry); rtdm_lock_put_irqrestore(&umsg_list_lock, context); /* construct netlink message and send */ skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); if(!skb) goto failure; uhdr = genlmsg_put(skb, msg->pid, msg->seq, &up_genl_family, 0, msg->cmd); if(!uhdr) goto skb_failure; memcpy(uhdr, &msg->hdr, sizeof(struct up_user_hdr)); rc = nla_put(skb, UP_NL_A_MSG, msg->hdr.plen, &msg->payload); if(rc != 0) goto skb_failure; genlmsg_end(skb, uhdr); rc = genlmsg_unicast(skb, msg->pid); if(msg->finalize) msg->finalize(msg); else kfree(msg); if(rc < 0) goto skb_failure; rtdm_lock_get_irqsave(&umsg_list_lock, context); } rtdm_lock_put_irqrestore(&umsg_list_lock, context); return;
skb_failure:nlmsg_free(skb); failure: printk("Response failure\n");}
static void
up_signal_handler(rtdm_nrtsig_t nrt_sig, void *arg){ /* Schedule work to be done in process context */ schedule_work(&wq); }static int
__initup_init(void){ int rc = 0; printk("UP module loading\n"); rc = genl_register_family(&up_genl_family); if(rc != 0) return rc; rc = genl_register_ops(&up_genl_family, &up_genl_ops_cmd);
Quoted 8 lines
if(rc != 0)
goto failure;
rc = rtdm_nrtsig_init(&up_nrt_signal, up_signal_handler, NULL);
if(rc < 0)
goto failure;
rc = up_init();Endless recursion???
Quoted 24 lines
if(rc < 0) goto failure; return 0;failure:
printk("UP module loading failed\n"); genl_unregister_family(&up_genl_family); return rc; }static void
__exitup_release(void){ printk("UP module unloading\n"); rtdm_nrtsig_destroy(&up_nrt_signal); genl_unregister_family(&up_genl_family); up_release();
Quoted 5 lines
}
module_init(up_init);module_exit(up_release);
The way you use rtpc itself looks correct on first glance. But the two fishy spots and that signaling inconsistency I found make me wonder if this code corresponds to what crashes your box.
Can you describe again what service rtpc needs to execute in the RT domain, and what data is exchanged between both worlds?
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 34 lines · Jan Kiszka
Quoted 32 lines · Jesper Christensen
There you go:
-----------------------------------------------------------------------------------
#include <
linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/workqueue.h>#include <
rtnet_rtpc.h>
#include <up.h>static
rtdm_lock_tumsg_list_lock=RTDM_LOCK_UNLOCKED;
staticrtdm_nrtsig_tup_nrt_signal;LIST_HEAD(umsg_list);static void
up_work_queue_handler(struct work_struct *work);DECLARE_WORK(wq, up_work_queue_handler);u32
up_user_pid= 0;struct
up_msg_buf*up_alloc_msg_buf(int cmd,size_tpsize, structgenl_info*info,
up_msg_finalizefin){ struct up_msg_buf *ret;
Quoted 9 lines
Quoted 6 lines
ret = kmalloc(sizeof(struct up_msg_buf) + psize, GFP_KERNEL); if(!ret) return ret; memset(ret, 0, sizeof(struct up_msg_buf));[ kzalloc = kmalloc + memset ]
Got it.
Quoted 28 lines
Quoted 28 lines
/* Initialize some fields */ if(info) { ret->pid = info->snd_pid; ret->seq = info->snd_seq; } ret->cmd = cmd; ret->finalize = fin; return ret;}
void
up_queue_umsg(struct up_msg_buf *umsg, int op, int len, U8 upid){ rtdm_lockctx_t context; umsg->hdr.opcode = op; umsg->hdr.plen = len; umsg->hdr.up_id = upid; rtdm_lock_get_irqsave(&umsg_list_lock, context); list_add_tail(&umsg->list_entry, &umsg_list); rtdm_lock_put_irqrestore(&umsg_list_lock, context);
Quoted 9 lines
Quoted 3 lines
rtdm_nrtsig_pend(&up_nrt_signal);Why this signaling here? Either the message is processed synchronously (/wrt
dispatch_call) so that you can release it after return from the dispatcher, or it's handled asynchronously, but then this signal comes too early as the RT work is potentially still ongoing.
Well this is for dispatching messages the other way (via the work_queue). The rt part will (by design) not modify the umsg buffer after this call. This mechanism is also needed to pass unsolicited messages from rt to userland.
Quoted 21 lines
Quoted 21 lines
}
static int
up_handle_cmd_msg_rt(struct rt_proc_call *call){ struct up_cmd_param *params; struct up_msg_buf *resp; params = rtpc_get_priv(call, struct up_cmd_param); resp = params->resp_buf; if(resp) resp->cmd = UP_NL_C_CMD; switch(params->hdr.opcode) { case UP_CMD_INIT: break;
Quoted 8 lines
Quoted 6 lines
case UP_CMD_CREATE_REQ: { struct up_config *c = (struct up_config *)¶ms->msg.config; int *res = (int *)resp->payload; *res = up_create(params->hdr.up_id, c);I can only assume this function doesn't do anything crazy.
You are correct. It is only called once during startup.
Quoted 46 lines
Quoted 46 lines
if(*res < 0) rtdm_printk("Error creating UP\n"); up_queue_umsg(resp, UP_CMD_CREATE_RES, sizeof(int), 0); break; } default: rtdm_printk("Unknown cmd message: op=%d\n", params->hdr.opcode); return -ENOTSUPP; } return 0; }static int
up_handle_cmd_msg_nrt(struct sk_buff *skb, struct genl_info *info){ int ret; struct up_cmd_param params; struct up_user_hdr *uhdr = (struct up_user_hdr *)info->userhdr; //TODO: Allocate response buffer based on message type switch(uhdr->opcode) { case UP_CMD_INIT: up_user_pid = info->snd_pid; params.resp_buf = NULL; break; default: params.resp_buf = up_alloc_msg_buf(UP_NL_C_CMD, sizeof(cmdMsg_t), info, NULL); break; }; memcpy(¶ms.hdr, info->userhdr, sizeof(struct up_user_hdr)); if(params.hdr.plen > sizeof(cmdMsg_t)) printk("up_handle_cmd_msg_nrt(): ERROR plen=%u >sizeof(cmdMsg_t)=%u\n", params.hdr.plen,
sizeof(cmdMsg_t));
Quoted 9 lines
Quoted 7 lines
if(params.hdr.plen)
nla_memcpy(¶ms.msg, info->attrs[UP_NL_A_MSG], params.hdr.plen);ret = rtpc_dispatch_call(up_handle_cmd_msg_rt, 0, ¶ms,
sizeof(params),NULL, NULL, NULL);That shouldn't build (too many arguments).
That is actually a concurrency bug fix i made in rtnet (in the tar file :) that prevented multiple userland threads from sending rt pings at the same time.
Quoted 110 lines
Quoted 110 lines
if(ret < 0) kfree(params.resp_buf); return ret;}
/* netlink attribute policy */
static const struct nla_policy up_genl_policy[UP_NL_A_MAX + 1] = { [UP_NL_A_MSG] = { .type = NLA_BINARY } };/* Generic netlink event operation definition */
static structgenl_opsup_genl_ops_cmd= {
.cmd =UP_NL_C_CMD,
.flags = 0,
.policy =up_genl_policy,
.doit =up_handle_cmd_msg_nrt,
.dumpit = NULL
};/* Generic netlink family */
static structgenl_familyup_genl_family= {
.id =GENL_ID_GENERATE,
.hdrsize =UP_GENL_HDRLEN,
.name = "up",
.version =UP_NL_VERSION,
.maxattr =UP_NL_A_MAX
};static void
up_work_queue_handler(struct work_struct *work){ struct up_msg_buf *msg; struct sk_buff *skb; struct up_user_hdr *uhdr; rtdm_lockctx_t context; int rc; rtdm_lock_get_irqsave(&umsg_list_lock, context); while(!list_empty(&umsg_list)) { msg = (struct up_msg_buf *)umsg_list.next; list_del(&msg->list_entry); rtdm_lock_put_irqrestore(&umsg_list_lock, context); /* construct netlink message and send */ skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); if(!skb) goto failure; uhdr = genlmsg_put(skb, msg->pid, msg->seq, &up_genl_family, 0, msg->cmd); if(!uhdr) goto skb_failure; memcpy(uhdr, &msg->hdr, sizeof(struct up_user_hdr)); rc = nla_put(skb, UP_NL_A_MSG, msg->hdr.plen, &msg->payload); if(rc != 0) goto skb_failure; genlmsg_end(skb, uhdr); rc = genlmsg_unicast(skb, msg->pid); if(msg->finalize) msg->finalize(msg); else kfree(msg); if(rc < 0) goto skb_failure; rtdm_lock_get_irqsave(&umsg_list_lock, context); } rtdm_lock_put_irqrestore(&umsg_list_lock, context); return;
skb_failure:nlmsg_free(skb); failure: printk("Response failure\n");}
static void
up_signal_handler(rtdm_nrtsig_t nrt_sig, void *arg){ /* Schedule work to be done in process context */ schedule_work(&wq); }static int
__initup_init(void){ int rc = 0; printk("UP module loading\n"); rc = genl_register_family(&up_genl_family); if(rc != 0) return rc; rc = genl_register_ops(&up_genl_family, &up_genl_ops_cmd); if(rc != 0) goto failure;
Quoted 8 lines
Quoted 6 lines
rc = rtdm_nrtsig_init(&up_nrt_signal, up_signal_handler, NULL); if(rc < 0) goto failure; rc = up_init();Endless recursion???
Woops, typo, sorry
Quoted 31 lines
Quoted 25 lines
if(rc < 0) goto failure; return 0;failure:
printk("UP module loading failed\n"); genl_unregister_family(&up_genl_family); return rc; }static void
__exitup_release(void){ printk("UP module unloading\n"); rtdm_nrtsig_destroy(&up_nrt_signal); genl_unregister_family(&up_genl_family); up_release();Quoted 6 lines
}
module_init(up_init);module_exit(up_release);
Quoted 10 lines
The way you use rtpc itself looks correct on first glance. But the two fishy spots and that signaling inconsistency I found make me wonder if this code corresponds to what crashes your box.
Can you describe again what service rtpc needs to execute in the RT domain, and what data is exchanged between both worlds?
Jan
Thank you very much for your observations. To answer your question, the data exchanged is basically session information which is used by two threads on the rt side (session setup, release and modification). The two threads receive udp packet from a ethernet interface, manipulates some headers and forwards them on another interface (if the session exists).
Now obviously i can not fully guarantee that there are no race conditions there, but even then i cannot se how it should lead to a stack corruption.
/jesper
If i run switchtest i get the following output:
[[email protected] /bin]# switchtest
== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
r8: 1 != 2
r9: 1 != 2
r10: 1 != 2
r11: 1 != 2
r12: 1 != 2
r13: 1 != 2
r14: 1 != 2
r15: 1 != 2
r16: 1 != 2
r17: 1 != 2
r18: 1 != 2
r19: 1 != 2
r20: 1 != 2
r21: 1 != 2
r22: 1 != 2
r23: 1 != 2
r24: 1 != 2
r25: 1 != 2
r26: 1 != 2
r27: 1 != 2
r28: 1 != 2
r29: 1 != 2
r30: 1 != 2
r31: 1 != 2
== FPU check routines: OK.
== Threads: sleeper_ufps0-0 rtk0-1 rtk0-2 rtk_fp0-3 rtk_fp0-4 rtk_fp_ufpp0-5 rtk_fp_ufpp0-6 rtup0-7 rtup0-8 rtup_ufpp0-9 rtup_ufpp0-10 rtus0-11 rtus0-12 rtus_ufps0-13 rtus_ufps0-14 rtuo0-15 rtuo0-16 rtuo_ufpp0-17 rtuo_ufpp0-18 rtuo_ufps0-19 rtuo_ufps0-20 rtuo_ufpp_ufps0-21 rtuo_ufpp_ufps0-22
And then it halts. dmesg shows:
Xenomai: suspending kernel thread ae819678 ('rtk5/0') at nip=0x80319aa0, lr=0x80319a70, r1=0xafa90510 after exception #1792
switchtest -n runs normally, should i use some sort of soft float flag in my compilations?
/Jesper
Quoted 2 lines · Jesper Christensen
If i run switchtest i get the following output:
If still talking about the cpci6200, this patch should apply:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=3d6fa118ef282c60dfeb0e690a579e8357bb7d13
Quoted 61 lines
[[email protected] /bin]# switchtest
== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
r8: 1 != 2
r9: 1 != 2
r10: 1 != 2
r11: 1 != 2
r12: 1 != 2
r13: 1 != 2
r14: 1 != 2
r15: 1 != 2
r16: 1 != 2
r17: 1 != 2
r18: 1 != 2
r19: 1 != 2
r20: 1 != 2
r21: 1 != 2
r22: 1 != 2
r23: 1 != 2
r24: 1 != 2
r25: 1 != 2
r26: 1 != 2
r27: 1 != 2
r28: 1 != 2
r29: 1 != 2
r30: 1 != 2
r31: 1 != 2
== FPU check routines: OK.
== Threads: sleeper_ufps0-0 rtk0-1 rtk0-2 rtk_fp0-3 rtk_fp0-4 rtk_fp_ufpp0-5 rtk_fp_ufpp0-6 rtup0-7 rtup0-8 rtup_ufpp0-9 rtup_ufpp0-10 rtus0-11 rtus0-12 rtus_ufps0-13 rtus_ufps0-14 rtuo0-15 rtuo0-16 rtuo_ufpp0-17 rtuo_ufpp0-18 rtuo_ufps0-19 rtuo_ufps0-20 rtuo_ufpp_ufps0-21 rtuo_ufpp_ufps0-22And then it halts. dmesg shows:
Xenomai: suspending kernel thread
ae819678('rtk5/0') at nip=0x80319aa0, lr=0x80319a70, r1=0xafa90510 after exception #1792switchtest -n runs normally, should i use some sort of soft float flag in my compilations?
/Jesper
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
Great thanks, but i can't help wondering if the problems i'm seeing are related to some of my userspace programs using fp.
/Jesper
Quoted 73 lines · Philippe Gerum
Quoted 3 lines · Jesper Christensen
If i run switchtest i get the following output:
If still talking about the cpci6200, this patch should apply:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=3d6fa118ef282c60dfeb0e690a579e8357bb7d13Quoted 62 lines
[[email protected] /bin]# switchtest
== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
r8: 1 != 2
r9: 1 != 2
r10: 1 != 2
r11: 1 != 2
r12: 1 != 2
r13: 1 != 2
r14: 1 != 2
r15: 1 != 2
r16: 1 != 2
r17: 1 != 2
r18: 1 != 2
r19: 1 != 2
r20: 1 != 2
r21: 1 != 2
r22: 1 != 2
r23: 1 != 2
r24: 1 != 2
r25: 1 != 2
r26: 1 != 2
r27: 1 != 2
r28: 1 != 2
r29: 1 != 2
r30: 1 != 2
r31: 1 != 2
== FPU check routines: OK.
== Threads: sleeper_ufps0-0 rtk0-1 rtk0-2 rtk_fp0-3 rtk_fp0-4 rtk_fp_ufpp0-5 rtk_fp_ufpp0-6 rtup0-7 rtup0-8 rtup_ufpp0-9 rtup_ufpp0-10 rtus0-11 rtus0-12 rtus_ufps0-13 rtus_ufps0-14 rtuo0-15 rtuo0-16 rtuo_ufpp0-17 rtuo_ufpp0-18 rtuo_ufps0-19 rtuo_ufps0-20 rtuo_ufpp_ufps0-21 rtuo_ufpp_ufps0-22And then it halts. dmesg shows:
Xenomai: suspending kernel thread
ae819678('rtk5/0') at nip=0x80319aa0, lr=0x80319a70, r1=0xafa90510 after exception #1792switchtest -n runs normally, should i use some sort of soft float flag in my compilations?
/Jesper
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Quoted 2 lines · Jesper Christensen
Great thanks, but i can't help wondering if the problems i'm seeing are related to some of my userspace programs using fp.
I don't think so. The switchtest programs exercises the FPU hardware in a certain way to make sure it is available in real-time mode from kernel space (which is an utterly crappy legacy, but we will have to deal with it until Xenomai 3.x). As far as I can see from your .config, you can't have such support, so switchtest was basically trying to test an inexistent feature.
Quoted 79 lines
/Jesper
Quoted 73 lines · Philippe Gerum
Quoted 3 lines · Jesper Christensen
If i run switchtest i get the following output:
If still talking about the cpci6200, this patch should apply:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=3d6fa118ef282c60dfeb0e690a579e8357bb7d13Quoted 62 lines
[[email protected] /bin]# switchtest
== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
r8: 1 != 2
r9: 1 != 2
r10: 1 != 2
r11: 1 != 2
r12: 1 != 2
r13: 1 != 2
r14: 1 != 2
r15: 1 != 2
r16: 1 != 2
r17: 1 != 2
r18: 1 != 2
r19: 1 != 2
r20: 1 != 2
r21: 1 != 2
r22: 1 != 2
r23: 1 != 2
r24: 1 != 2
r25: 1 != 2
r26: 1 != 2
r27: 1 != 2
r28: 1 != 2
r29: 1 != 2
r30: 1 != 2
r31: 1 != 2
== FPU check routines: OK.
== Threads: sleeper_ufps0-0 rtk0-1 rtk0-2 rtk_fp0-3 rtk_fp0-4 rtk_fp_ufpp0-5 rtk_fp_ufpp0-6 rtup0-7 rtup0-8 rtup_ufpp0-9 rtup_ufpp0-10 rtus0-11 rtus0-12 rtus_ufps0-13 rtus_ufps0-14 rtuo0-15 rtuo0-16 rtuo_ufpp0-17 rtuo_ufpp0-18 rtuo_ufps0-19 rtuo_ufps0-20 rtuo_ufpp_ufps0-21 rtuo_ufpp_ufps0-22And then it halts. dmesg shows:
Xenomai: suspending kernel thread
ae819678('rtk5/0') at nip=0x80319aa0, lr=0x80319a70, r1=0xafa90510 after exception #1792switchtest -n runs normally, should i use some sort of soft float flag in my compilations?
/Jesper
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
Quoted 10 lines · Philippe Gerum
Quoted 2 lines · Jesper Christensen
Great thanks, but i can't help wondering if the problems i'm seeing are related to some of my userspace programs using fp.
I don't think so. The switchtest programs exercises the FPU hardware in a certain way to make sure it is available in real-time mode from kernel space (which is an utterly crappy legacy, but we will have to deal with it until Xenomai 3.x). As far as I can see from your .config, you can't have such support, so switchtest was basically trying to test an inexistent feature.
In fact, switchtest whether Xenomai FPU switch routines work when the Linux kernel itself uses FPU in kernel-space. Currently, the only place when this happens is in the RAID code: x86 uses mmx/sse, and some power pcs use altivec. Some powerpc also fix unaligned accesses to floating point data in kernel-space, I do not know if this may interfere, which is why the powerpc code is compiled even without RAID.
Signature · 1 line
Gilles.
Quoted 12 lines · Gilles Chanteperdrix
Quoted 10 lines · Philippe Gerum
Quoted 2 lines · Jesper Christensen
Great thanks, but i can't help wondering if the problems i'm seeing are related to some of my userspace programs using fp.
I don't think so. The switchtest programs exercises the FPU hardware in a certain way to make sure it is available in real-time mode from kernel space (which is an utterly crappy legacy, but we will have to deal with it until Xenomai 3.x). As far as I can see from your .config, you can't have such support, so switchtest was basically trying to test an inexistent feature.
Quoted 8 lines
In fact, switchtest whether Xenomai FPU switch routines work when the Linux kernel itself uses FPU in kernel-space. Currently, the only place when this happens is in the RAID code: x86 uses mmx/sse, and some power pcs use altivec. Some powerpc also fix unaligned accesses to floating point data in kernel-space, I do not know if this may interfere, which is why the powerpc code is compiled even without RAID.
AFAICS, fp_regs_set() on ppc is issuing a load float instruction in kernel space which could be unaligned, and therefore trap. Looking at the .config for the target system, hw FPU support is disabled in the alignment code, so basically, this would beget a nop.
Signature · 1 line
Philippe.
Quoted 22 lines · Philippe Gerum
Quoted 12 lines · Gilles Chanteperdrix
Quoted 10 lines · Philippe Gerum
Quoted 2 lines · Jesper Christensen
Great thanks, but i can't help wondering if the problems i'm seeing are related to some of my userspace programs using fp.
I don't think so. The switchtest programs exercises the FPU hardware in a certain way to make sure it is available in real-time mode from kernel space (which is an utterly crappy legacy, but we will have to deal with it until Xenomai 3.x). As far as I can see from your .config, you can't have such support, so switchtest was basically trying to test an inexistent feature.
Quoted 8 lines
In fact, switchtest whether Xenomai FPU switch routines work when the Linux kernel itself uses FPU in kernel-space. Currently, the only place when this happens is in the RAID code: x86 uses mmx/sse, and some power pcs use altivec. Some powerpc also fix unaligned accesses to floating point data in kernel-space, I do not know if this may interfere, which is why the powerpc code is compiled even without RAID.
Quoted 4 lines
AFAICS,
fp_regs_set()on ppc is issuing a load float instruction in kernel space which could be unaligned, and therefore trap. Looking at the .config for the target system, hw FPU support is disabled in the alignment code, so basically, this would beget a nop.
A nop in fixing the issue, I mean.
Signature · 1 line
Philippe.
Okay
/Jesper
Quoted 35 lines · Philippe Gerum
Quoted 25 lines · Philippe Gerum
Quoted 14 lines · Gilles Chanteperdrix
Quoted 5 lines · Philippe Gerum
Quoted 3 lines · Jesper Christensen
Great thanks, but i can't help wondering if the problems i'm seeing are related to some of my userspace programs using fp.
Quoted 7 lines
I don't think so. The switchtest programs exercises the FPU hardware in a certain way to make sure it is available in real-time mode from kernel space (which is an utterly crappy legacy, but we will have to deal with it until Xenomai 3.x). As far as I can see from your .config, you can't have such support, so switchtest was basically trying to test an inexistent feature.
Quoted 9 lines
In fact, switchtest whether Xenomai FPU switch routines work when the Linux kernel itself uses FPU in kernel-space. Currently, the only place when this happens is in the RAID code: x86 uses mmx/sse, and some power pcs use altivec. Some powerpc also fix unaligned accesses to floating point data in kernel-space, I do not know if this may interfere, which is why the powerpc code is compiled even without RAID.
Quoted 5 lines
AFAICS,
fp_regs_set()on ppc is issuing a load float instruction in kernel space which could be unaligned, and therefore trap. Looking at the .config for the target system, hw FPU support is disabled in the alignment code, so basically, this would beget a nop.A nop in fixing the issue, I mean.
Quoted 3 lines · Jesper Christensen
Problem is the NIP in question is the address of the thread structure as seen in the error message.
Is your code spawning -rt kernel threads frequently/periodically, or only when the application initializes?
Quoted 94 lines
/Jesper
Quoted 89 lines · Philippe Gerum
Quoted 6 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 73 lines
/Jesper
Quoted 44 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 9 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 18 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
Only during init:
# cat /proc/xenomai/sched CPU PID CLASS PRI TIMEOUT TIMEBASE STAT NAME 0 0 idle -1 - master R ROOT/0 1 0 idle -1 - master R ROOT/1 0 0 rt 98 - master W rtnet-stack 0 0 rt 0 - master W rtnet-rtpc 0 0 rt 99 - master S tt_upgw_0 1 0 rt 99 27us master D tt_upgw_1 0 720 rt 0 - master X upgmu 0 724 rt 0 979ms599us master D upgmu
/Jesper
Quoted 115 lines · Philippe Gerum
Quoted 4 lines · Jesper Christensen
Problem is the NIP in question is the address of the thread structure as seen in the error message.
Is your code spawning -rt kernel threads frequently/periodically, or only when the application initializes?
Quoted 104 lines
/Jesper
Quoted 98 lines · Philippe Gerum
Quoted 7 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 78 lines
/Jesper
Quoted 46 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 10 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 20 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Quoted 9 lines · Philippe Gerum
Quoted 5 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792You should build your code statically into the kernel, not as a module, and find out which code raises the MCE.
It's a program check exception, not a machine check, but the rest remains applicable.
Quoted 74 lines
CONFIG_DEBUG_INFO=y, then objdump -dl vmlinux, looking for the NIP mentioned.Quoted 69 lines
/Jesper
Quoted 42 lines · Philippe Gerum
Quoted 24 lines · Jesper Christensen
Hi
I'm trying to implement some gateway functionality in the kernel on a emerson CPCI6200 board, but have run into some strange errors. The kernel module is made up of two threads that run every 1 ms. I have also made use of the rtpc dispatcher in rtnet to dispatch control messages from a netlink socket to the RT part of my kernel module.
The problem is that when loaded the threads get suspended due to exceptions:
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0xb929cbc0after exception #1792or
Xenomai: suspending kernel thread
b929cbc0('tt_upgw_0') at0x0after exception #1025or
Xenomai: suspending kernel thread
b911f518('rtnet-rtpc') at0xb911f940after exception #1792Quoted 8 lines
I have ported the "gianfar" driver from linux to rtnet.
The versions and hardware are listed below. The errors are most likely due to faulty software on my part, but i would like to ask if there are any known issues with the versions or hardware i'm using. I would also like to ask if there are any ways of further debugging the errors as i am not getting very far with the above messages.
A severe bug at kthread init was fixed in the 2.5.5.2 - 2.5.6 timeframe, which would cause exactly the kind of weird behavior you are seeing right now. The bug triggered random code execution due to stack memory pollution at init on powerpc for Xenomai kthreads:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=90699565cbce41f2cec193d57857bb5817efc19a
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=da20c20d4b4d892d40c657ad1d32ddb6d0ceb47c
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a5886b354dc18f054b187b58cfbacfb60bccaf47Quoted 16 lines
You need at the very least those three patches (from the top of my head), but it would be much better to upgrade to 2.5.6.
Quoted 11 lines
System info:
Linux kernel: 2.6.29.6
i-pipe version: 2.7-04
processor: powerpc mpc8572
xenomai version: 2.5.3
rtnet version: 0.9.12_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 1 line
Philippe.
Quoted 5 lines · Jesper Christensen
I have updated to xenomai 2.5.6, but i'm still seeing exceptions (considerably less often though):
Xenomai: suspending kernel thread
b92a39d0('tt_upgw_0') at0xb92a39d0after exception #1792
There was an alignment issue with rtnet on ARM some time ago, which was solved by the following patch:
http://rtnet.git.sourceforge.net/git/gitweb.cgi?p=rtnet/rtnet;a=commit;h=1b38434c6137d3b4a708e00d8fef6a4b422c6593
Maybe it is related?
Regards.
Signature · 1 line
Gilles.
Quoted 1 line · Jesper Christensen
I have ported the "gianfar" driver from linux to rtnet.
Can you publish this driver? I have been wanting to make a rtnet gianfar myself.
Thanks,
Richard
I have made a number of changes to rtnet (scatter gather support, icmp fixes etc.) so maybe i could send you a tar ball of the entire directory?
/Jesper
Quoted 13 lines · Richard Cochran
Quoted 2 lines · Jesper Christensen
I have ported the "gianfar" driver from linux to rtnet.
Can you publish this driver? I have been wanting to make a rtnet gianfar myself.
Thanks,
Richard
Quoted 2 lines · Jesper Christensen
I have made a number of changes to rtnet (scatter gather support, icmp fixes etc.) so maybe i could send you a tar ball of the entire directory?
Yes, please do.
thanks,
Richard
Quoted 15 lines · Richard Cochran
Quoted 13 lines · Jesper Christensen
Quoted 4 lines
I have ported the "gianfar" driver from linux to rtnet.
Can you publish this driver? I have been wanting to make a rtnet gianfar myself.
Thanks,
Richard
There you go.
/Jesper
Quoted 31 lines · Richard Cochran
Quoted 3 lines · Jesper Christensen
I have made a number of changes to rtnet (scatter gather support, icmp fixes etc.) so maybe i could send you a tar ball of the entire directory?
Yes, please do.
thanks,
RichardQuoted 19 lines · Richard Cochran
Quoted 17 lines · Jesper Christensen
Quoted 6 lines
I have ported the "gianfar" driver from linux to rtnet.
Can you publish this driver? I have been wanting to make a rtnet gianfar myself.
Thanks,
Richard
Quoted 2 lines · Jesper Christensen
There you go.
Even better would be individual patches (one for each topic) so that we can more easily review/merge your improvements into RTnet. If you are not familiar with this process, maybe you can convince Richard to do the break-up... :)
Also, please follow up on RTnet-list(s) about RTnet topics.
TIA,
Jan
Quoted 31 lines · Richard Cochran
Quoted 29 lines · Jesper Christensen
Quoted 4 lines
I have made a number of changes to rtnet (scatter gather support, icmp fixes etc.) so maybe i could send you a tar ball of the entire directory?
Yes, please do.
thanks,
RichardQuoted 18 lines · Richard Cochran
Quoted 17 lines · Jesper Christensen
Quoted 6 lines
I have ported the "gianfar" driver from linux to rtnet.
Can you publish this driver? I have been wanting to make a rtnet gianfar myself.
Thanks,
Richard
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Yeah we've been stupid enough not to use the version from the git repository, but i'll see what i can do over the next few days (snowed under at work :( ). I should be able to do some diffs against the git repository.
/Jesper
Quoted 55 lines · Jan Kiszka
Quoted 3 lines · Jesper Christensen
There you go.
Even better would be individual patches (one for each topic) so that we can more easily review/merge your improvements into RTnet. If you are not familiar with this process, maybe you can convince Richard to do the break-up... :)
Also, please follow up on RTnet-list(s) about RTnet topics.
TIA,
JanQuoted 38 lines · Richard Cochran
Quoted 37 lines · Jesper Christensen
Quoted 6 lines
I have made a number of changes to rtnet (scatter gather support, icmp fixes etc.) so maybe i could send you a tar ball of the entire directory?
Yes, please do.
thanks,
RichardQuoted 22 lines · Richard Cochran
Quoted 21 lines · Jesper Christensen
Quoted 8 lines
I have ported the "gianfar" driver from linux to rtnet.
Can you publish this driver? I have been wanting to make a rtnet gianfar myself.
Thanks,
Richard