All of lore.kernel.org
 help / color / mirror / Atom feed
* every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
@ 2018-11-29  8:03 梁权
  2018-11-29 11:14 ` Jan Kiszka
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: 梁权 @ 2018-11-29  8:03 UTC (permalink / raw)
  To: xenomai

hi,
i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ; 
to  handler this interrupt immediately, i register  the interrupt handler in xenomai domain.Also there is a QT applictation running on the board;  and here is the problem i encounter:
if i open the interrupt and run the QT application simultaneously, the QT application will get wrong like this after a few minutes(but the linux is still running fine):
[ 1601.496828] Unhandled fault: page domain fault (0x01b) at 0xb6fa135c
[ 1601.503233] pgd = c5ea4000
[ 1601.505947] [b6fa135c] *pgd=8571e831, *pte=80be818f, *ppte=80be8a3e
[ 1601.512291] Internal error: : 1b [#2] PREEMPT ARM
[ 1601.517019] Modules linked in: motionDrv(O) FPGA(O)
[ 1601.521930] CPU: 0 PID: 882 Comm: HMI_V2 Tainted: G      D    O    4.14.67-gd315a9bb00 #104
[ 1601.530317] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1601.536418] I-pipe domain: Linux
[ 1601.539651] task: c5537600 task.stack: c52f4000
[ 1601.544226] PC is at __und_svc+0x70/0x84
[ 1601.548160] LR is at __und_svc+0x68/0x84
[ 1601.552095] pc : [<c010cef0>]    lr : [<c010cee8>]    psr: 60000193
[ 1601.558409] sp : c52f5fa8  ip : 20000193  fp : 32450e8c
[ 1601.563624] r10: b6fb8dc8  r9 : c52f4000  r8 : 0000001a
[ 1601.568870] r7 : c52f5fdc  r6 : ffffffff  r5 : 60000113  r4 : b6fa1360
[ 1601.575428] r3 : c0c901c0  r2 : 20000193  r1 : c52f5fa8  r0 : 00000000
[ 1601.581986] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
[ 1601.589245] Control: 10c5387d  Table: 85ea4019  DAC: 00000051
[ 1601.595010] Process HMI_V2 (pid: 882, stack limit = 0xc52f4218)
[ 1601.600957] Stack: (0xc52f5fa8 to 0xc52f6000)
[ 1601.605319] 5fa0:                   00000000 0000021b 000003eb b616f100 00000004 00000000
[ 1601.613554] 5fc0: b5400708 b6fb3550 0000001a 00000000 b6fb8dc8 32450e8c bedfd7b8 c52f5ff8
[ 1601.621759] 5fe0: b6fa135a b6fa1360 60000113 ffffffff 00000055 bf000000 00000000 00000000
[ 1601.629964] Backtrace: invalid frame pointer 0x32450e8c
[ 1601.635210] Code: e1a0100d eb0265e0 e3500000 1a000006 (e5140004) 
[ 1601.641340] ---[ end trace 0eef451faa9b7a24 ]---
or like this:
 Unable to handle kernel paging request at virtual address e5bcfe84
[ 1789.775575] pgd = c5ef0000
[ 1789.778320] [e5bcfe84] *pgd=00000000
[ 1789.781919] Internal error: Oops: 80000005 [#4] PREEMPT ARM
[ 1789.787500] Modules linked in: motionDrv(O) FPGA(O)
[ 1789.792442] CPU: 0 PID: 1135 Comm: HMI_V2 Tainted: G      D    O    4.14.67-gd315a9bb00 #104
[ 1789.800890] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1789.807021] I-pipe domain: Linux
[ 1789.810254] task: c5423600 task.stack: c5e14000
[ 1789.814799] PC is at 0xe5bcfe84
[ 1789.817971] LR is at 0xb57a00fb
[ 1789.821112] pc : [<e5bcfe84>]    lr : [<b57a00fb>]    psr: 000f0113
[ 1789.827395] sp : c5e15ff8  ip : b59b1cdc  fp : 0016e634
[ 1789.832642] r10: 0016e636  r9 : 0000000a  r8 : bec38350
[ 1789.837888] r7 : 0031c7e8  r6 : bec38218  r5 : bec38204  r4 : 008c2a38
[ 1789.844445] r3 : 00000000  r2 : 00000000  r1 : 0000003a  r0 : 00000001
[ 1789.851003] Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1789.858171] Control: 10c5387d  Table: 85ef0019  DAC: 00000055
[ 1789.863935] Process HMI_V2 (pid: 1135, stack limit = 0xc5e14218)
[ 1789.869975] Stack: (0xc5e15ff8 to 0xc5e16000)
[ 1789.874336] 5fe0:                                                       00000000 00000000
[ 1789.882541] Backtrace: invalid frame pointer 0x0016e634
[ 1789.887787] Code: bad PC value
[ 1789.890868] ---[ end trace 0eef451faa9b7a26 ]---
i don't think it is something wrong with the QT application; becase if i shut down the every millicsecond interrupt,
 it can run fine for 24 hours or more. And i use the 'top' command to check the QT application , found that
 it only occupy %2~%3 cpu usage, and its physical memory consumption is about 40M, the system still get 35M memory free.
 here is  the isr of the interrupt, i just do very simple things:
 static int int1msHandler(rtdm_irq_t *irq_handle)
 {
*(unsigned int *)(intc_reg_base + OFFSET_INTC_CONTROL) = 0x1;//enable new IRQ generation
  times1ms++; //just for test
  //udd_notify_event(&device);
  return RTDM_IRQ_HANDLED;
 }
so  it is possible that the xenomai domain interrupt is too frequently that the linux domain system call cannot be handle somtimes ? and how to slove this problem?
and here is my board info: linux 4.14 + ipipe-core-4.14.71-arm-4.patch + xenomai3.0.7 ; the am3352 is runing at 800M HZ frequency 
 Any help or clue are OK.
Thanks,
liang





--

----------------------------------------------
          梁权
THANKS & BR!


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

* Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29  8:03 every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong? 梁权
@ 2018-11-29 11:14 ` Jan Kiszka
  2018-11-29 15:15   ` 梁权
  2018-11-29 14:34 ` Philippe Gerum
  2018-11-29 16:40 ` Philippe Gerum
  2 siblings, 1 reply; 14+ messages in thread
From: Jan Kiszka @ 2018-11-29 11:14 UTC (permalink / raw)
  To: 梁权, xenomai

On 29.11.18 09:03, 梁权 via Xenomai wrote:
> hi,
> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ; 
> to  handler this interrupt immediately, i register  the interrupt handler in xenomai domain.Also there is a QT applictation running on the board;  and here is the problem i encounter:
> if i open the interrupt and run the QT application simultaneously, the QT application will get wrong like this after a few minutes(but the linux is still running fine):
> [ 1601.496828] Unhandled fault: page domain fault (0x01b) at 0xb6fa135c
> [ 1601.503233] pgd = c5ea4000
> [ 1601.505947] [b6fa135c] *pgd=8571e831, *pte=80be818f, *ppte=80be8a3e
> [ 1601.512291] Internal error: : 1b [#2] PREEMPT ARM
> [ 1601.517019] Modules linked in: motionDrv(O) FPGA(O)
> [ 1601.521930] CPU: 0 PID: 882 Comm: HMI_V2 Tainted: G      D    O    4.14.67-gd315a9bb00 #104
> [ 1601.530317] Hardware name: Generic AM33XX (Flattened Device Tree)
> [ 1601.536418] I-pipe domain: Linux
> [ 1601.539651] task: c5537600 task.stack: c52f4000
> [ 1601.544226] PC is at __und_svc+0x70/0x84
> [ 1601.548160] LR is at __und_svc+0x68/0x84
> [ 1601.552095] pc : [<c010cef0>]    lr : [<c010cee8>]    psr: 60000193
> [ 1601.558409] sp : c52f5fa8  ip : 20000193  fp : 32450e8c
> [ 1601.563624] r10: b6fb8dc8  r9 : c52f4000  r8 : 0000001a
> [ 1601.568870] r7 : c52f5fdc  r6 : ffffffff  r5 : 60000113  r4 : b6fa1360
> [ 1601.575428] r3 : c0c901c0  r2 : 20000193  r1 : c52f5fa8  r0 : 00000000
> [ 1601.581986] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
> [ 1601.589245] Control: 10c5387d  Table: 85ea4019  DAC: 00000051
> [ 1601.595010] Process HMI_V2 (pid: 882, stack limit = 0xc52f4218)
> [ 1601.600957] Stack: (0xc52f5fa8 to 0xc52f6000)
> [ 1601.605319] 5fa0:                   00000000 0000021b 000003eb b616f100 00000004 00000000
> [ 1601.613554] 5fc0: b5400708 b6fb3550 0000001a 00000000 b6fb8dc8 32450e8c bedfd7b8 c52f5ff8
> [ 1601.621759] 5fe0: b6fa135a b6fa1360 60000113 ffffffff 00000055 bf000000 00000000 00000000
> [ 1601.629964] Backtrace: invalid frame pointer 0x32450e8c
> [ 1601.635210] Code: e1a0100d eb0265e0 e3500000 1a000006 (e5140004) 
> [ 1601.641340] ---[ end trace 0eef451faa9b7a24 ]---
> or like this:
>  Unable to handle kernel paging request at virtual address e5bcfe84
> [ 1789.775575] pgd = c5ef0000
> [ 1789.778320] [e5bcfe84] *pgd=00000000
> [ 1789.781919] Internal error: Oops: 80000005 [#4] PREEMPT ARM
> [ 1789.787500] Modules linked in: motionDrv(O) FPGA(O)
> [ 1789.792442] CPU: 0 PID: 1135 Comm: HMI_V2 Tainted: G      D    O    4.14.67-gd315a9bb00 #104
> [ 1789.800890] Hardware name: Generic AM33XX (Flattened Device Tree)
> [ 1789.807021] I-pipe domain: Linux
> [ 1789.810254] task: c5423600 task.stack: c5e14000
> [ 1789.814799] PC is at 0xe5bcfe84
> [ 1789.817971] LR is at 0xb57a00fb
> [ 1789.821112] pc : [<e5bcfe84>]    lr : [<b57a00fb>]    psr: 000f0113
> [ 1789.827395] sp : c5e15ff8  ip : b59b1cdc  fp : 0016e634
> [ 1789.832642] r10: 0016e636  r9 : 0000000a  r8 : bec38350
> [ 1789.837888] r7 : 0031c7e8  r6 : bec38218  r5 : bec38204  r4 : 008c2a38
> [ 1789.844445] r3 : 00000000  r2 : 00000000  r1 : 0000003a  r0 : 00000001
> [ 1789.851003] Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
> [ 1789.858171] Control: 10c5387d  Table: 85ef0019  DAC: 00000055
> [ 1789.863935] Process HMI_V2 (pid: 1135, stack limit = 0xc5e14218)
> [ 1789.869975] Stack: (0xc5e15ff8 to 0xc5e16000)
> [ 1789.874336] 5fe0:                                                       00000000 00000000
> [ 1789.882541] Backtrace: invalid frame pointer 0x0016e634
> [ 1789.887787] Code: bad PC value
> [ 1789.890868] ---[ end trace 0eef451faa9b7a26 ]---
> i don't think it is something wrong with the QT application; becase if i shut down the every millicsecond interrupt,
>  it can run fine for 24 hours or more. And i use the 'top' command to check the QT application , found that
>  it only occupy %2~%3 cpu usage, and its physical memory consumption is about 40M, the system still get 35M memory free.
>  here is  the isr of the interrupt, i just do very simple things:
>  static int int1msHandler(rtdm_irq_t *irq_handle)
>  {
> *(unsigned int *)(intc_reg_base + OFFSET_INTC_CONTROL) = 0x1;//enable new IRQ generation
>   times1ms++; //just for test
>   //udd_notify_event(&device);
>   return RTDM_IRQ_HANDLED;
>  }
> so  it is possible that the xenomai domain interrupt is too frequently that the linux domain system call cannot be handle somtimes ? and how to slove this problem?
> and here is my board info: linux 4.14 + ipipe-core-4.14.71-arm-4.patch + xenomai3.0.7 ; the am3352 is runing at 800M HZ frequency 

This is not in line with the backtrace. It talks about revision
4.14.67-gd315a9bb00, which is not an official commit. Did you need to change
anything?

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


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

* Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29  8:03 every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong? 梁权
  2018-11-29 11:14 ` Jan Kiszka
@ 2018-11-29 14:34 ` Philippe Gerum
  2018-11-29 15:27   ` 梁权
  2018-11-29 16:40 ` Philippe Gerum
  2 siblings, 1 reply; 14+ messages in thread
From: Philippe Gerum @ 2018-11-29 14:34 UTC (permalink / raw)
  To: 梁权, xenomai

On 11/29/18 9:03 AM, 梁权 via Xenomai wrote:
> hi,
> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ; 

What do you mean precisely by "cannot be masked"? Are you referring to
NMI or FIQ?

-- 
Philippe.


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

* Re:Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29 11:14 ` Jan Kiszka
@ 2018-11-29 15:15   ` 梁权
  2018-11-29 15:25     ` Jan Kiszka
  0 siblings, 1 reply; 14+ messages in thread
From: 梁权 @ 2018-11-29 15:15 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

The linux 4.14.67 which i used is from the latest TI Linux Processor SDK for AM335x;  when i patch it with the ipipe-core-4.14.71-arm-4.patch,
i did not need to do any change except that  telling where the file dmtimer.c is;
i guess it is because that in linux 4.14.67 the location of dmtimer.c is different from which in linux 4.14.71





--

----------------------------------------------
          梁权
THANKS & BR!





At 2018-11-29 19:14:28, "Jan Kiszka" <jan.kiszka@siemens.com> wrote:
>On 29.11.18 09:03, 梁权 via Xenomai wrote:
>> hi,
>> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
>> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ; 
>> to  handler this interrupt immediately, i register  the interrupt handler in xenomai domain.Also there is a QT applictation running on the board;  and here is the problem i encounter:
>> if i open the interrupt and run the QT application simultaneously, the QT application will get wrong like this after a few minutes(but the linux is still running fine):
>> [ 1601.496828] Unhandled fault: page domain fault (0x01b) at 0xb6fa135c
>> [ 1601.503233] pgd = c5ea4000
>> [ 1601.505947] [b6fa135c] *pgd=8571e831, *pte=80be818f, *ppte=80be8a3e
>> [ 1601.512291] Internal error: : 1b [#2] PREEMPT ARM
>> [ 1601.517019] Modules linked in: motionDrv(O) FPGA(O)
>> [ 1601.521930] CPU: 0 PID: 882 Comm: HMI_V2 Tainted: G      D    O    4.14.67-gd315a9bb00 #104
>> [ 1601.530317] Hardware name: Generic AM33XX (Flattened Device Tree)
>> [ 1601.536418] I-pipe domain: Linux
>> [ 1601.539651] task: c5537600 task.stack: c52f4000
>> [ 1601.544226] PC is at __und_svc+0x70/0x84
>> [ 1601.548160] LR is at __und_svc+0x68/0x84
>> [ 1601.552095] pc : [<c010cef0>]    lr : [<c010cee8>]    psr: 60000193
>> [ 1601.558409] sp : c52f5fa8  ip : 20000193  fp : 32450e8c
>> [ 1601.563624] r10: b6fb8dc8  r9 : c52f4000  r8 : 0000001a
>> [ 1601.568870] r7 : c52f5fdc  r6 : ffffffff  r5 : 60000113  r4 : b6fa1360
>> [ 1601.575428] r3 : c0c901c0  r2 : 20000193  r1 : c52f5fa8  r0 : 00000000
>> [ 1601.581986] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
>> [ 1601.589245] Control: 10c5387d  Table: 85ea4019  DAC: 00000051
>> [ 1601.595010] Process HMI_V2 (pid: 882, stack limit = 0xc52f4218)
>> [ 1601.600957] Stack: (0xc52f5fa8 to 0xc52f6000)
>> [ 1601.605319] 5fa0:                   00000000 0000021b 000003eb b616f100 00000004 00000000
>> [ 1601.613554] 5fc0: b5400708 b6fb3550 0000001a 00000000 b6fb8dc8 32450e8c bedfd7b8 c52f5ff8
>> [ 1601.621759] 5fe0: b6fa135a b6fa1360 60000113 ffffffff 00000055 bf000000 00000000 00000000
>> [ 1601.629964] Backtrace: invalid frame pointer 0x32450e8c
>> [ 1601.635210] Code: e1a0100d eb0265e0 e3500000 1a000006 (e5140004) 
>> [ 1601.641340] ---[ end trace 0eef451faa9b7a24 ]---
>> or like this:
>>  Unable to handle kernel paging request at virtual address e5bcfe84
>> [ 1789.775575] pgd = c5ef0000
>> [ 1789.778320] [e5bcfe84] *pgd=00000000
>> [ 1789.781919] Internal error: Oops: 80000005 [#4] PREEMPT ARM
>> [ 1789.787500] Modules linked in: motionDrv(O) FPGA(O)
>> [ 1789.792442] CPU: 0 PID: 1135 Comm: HMI_V2 Tainted: G      D    O    4.14.67-gd315a9bb00 #104
>> [ 1789.800890] Hardware name: Generic AM33XX (Flattened Device Tree)
>> [ 1789.807021] I-pipe domain: Linux
>> [ 1789.810254] task: c5423600 task.stack: c5e14000
>> [ 1789.814799] PC is at 0xe5bcfe84
>> [ 1789.817971] LR is at 0xb57a00fb
>> [ 1789.821112] pc : [<e5bcfe84>]    lr : [<b57a00fb>]    psr: 000f0113
>> [ 1789.827395] sp : c5e15ff8  ip : b59b1cdc  fp : 0016e634
>> [ 1789.832642] r10: 0016e636  r9 : 0000000a  r8 : bec38350
>> [ 1789.837888] r7 : 0031c7e8  r6 : bec38218  r5 : bec38204  r4 : 008c2a38
>> [ 1789.844445] r3 : 00000000  r2 : 00000000  r1 : 0000003a  r0 : 00000001
>> [ 1789.851003] Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
>> [ 1789.858171] Control: 10c5387d  Table: 85ef0019  DAC: 00000055
>> [ 1789.863935] Process HMI_V2 (pid: 1135, stack limit = 0xc5e14218)
>> [ 1789.869975] Stack: (0xc5e15ff8 to 0xc5e16000)
>> [ 1789.874336] 5fe0:                                                       00000000 00000000
>> [ 1789.882541] Backtrace: invalid frame pointer 0x0016e634
>> [ 1789.887787] Code: bad PC value
>> [ 1789.890868] ---[ end trace 0eef451faa9b7a26 ]---
>> i don't think it is something wrong with the QT application; becase if i shut down the every millicsecond interrupt,
>>  it can run fine for 24 hours or more. And i use the 'top' command to check the QT application , found that
>>  it only occupy %2~%3 cpu usage, and its physical memory consumption is about 40M, the system still get 35M memory free.
>>  here is  the isr of the interrupt, i just do very simple things:
>>  static int int1msHandler(rtdm_irq_t *irq_handle)
>>  {
>> *(unsigned int *)(intc_reg_base + OFFSET_INTC_CONTROL) = 0x1;//enable new IRQ generation
>>   times1ms++; //just for test
>>   //udd_notify_event(&device);
>>   return RTDM_IRQ_HANDLED;
>>  }
>> so  it is possible that the xenomai domain interrupt is too frequently that the linux domain system call cannot be handle somtimes ? and how to slove this problem?
>> and here is my board info: linux 4.14 + ipipe-core-4.14.71-arm-4.patch + xenomai3.0.7 ; the am3352 is runing at 800M HZ frequency 
>
>This is not in line with the backtrace. It talks about revision
>4.14.67-gd315a9bb00, which is not an official commit. Did you need to change
>anything?
>
>Jan
>
>-- 
>Siemens AG, Corporate Technology, CT RDA IOT SES-DE
>Corporate Competence Center Embedded Linux

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

* Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29 15:15   ` 梁权
@ 2018-11-29 15:25     ` Jan Kiszka
  2018-11-29 15:58       ` 梁权
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Kiszka @ 2018-11-29 15:25 UTC (permalink / raw)
  To: 梁权; +Cc: xenomai

On 29.11.18 16:15, 梁权 wrote:
> The linux 4.14.67 which i used is from the latest TI Linux Processor SDK for 
> AM335x;  when i patch it with the /ipipe-core-4.14.71-arm-4.patch,/
> i did not need to do any change except that  telling where the file dmtimer.c is;
> i guess it is because that in linux 4.14.67 the location of dmtimer.c is 
> different from which in linux 4.14.71
> 

Could you try if you can reproduce the issue with vanilla 4.14.71 + I-pipe? Just 
to exclude downstream issues.

I think there is no longer a need for a downstream kernel on that board, but I 
might be wrong (which would be sad).

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


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

* Re:Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29 14:34 ` Philippe Gerum
@ 2018-11-29 15:27   ` 梁权
  2018-11-29 15:39     ` Greg Gallagher
  0 siblings, 1 reply; 14+ messages in thread
From: 梁权 @ 2018-11-29 15:27 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

it is neither NMI nor FIQ; "cannot be mask" just for emphasize this interrupt is so important that cannot be missed even once.
 it maybe my fault for this unclear expression




--

----------------------------------------------
          梁权
THANKS & BR!





在 2018-11-29 22:34:03,"Philippe Gerum" <rpm@xenomai.org> 写道:
>On 11/29/18 9:03 AM, 梁权 via Xenomai wrote:
>> hi,
>> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
>> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ; 
>
>What do you mean precisely by "cannot be masked"? Are you referring to
>NMI or FIQ?
>
>-- 
>Philippe.

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

* Re: Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29 15:27   ` 梁权
@ 2018-11-29 15:39     ` Greg Gallagher
  2018-11-29 15:50       ` 梁权
  0 siblings, 1 reply; 14+ messages in thread
From: Greg Gallagher @ 2018-11-29 15:39 UTC (permalink / raw)
  To: liang_1911; +Cc: Philippe Gerum, Xenomai@xenomai.org

This doc will help explain how the ipipe handles interrupts.

https://gitlab.denx.de/Xenomai/ipipe-noarch/blob/master/Documentation/ipipe.rst


I don't think the interrupt is being missed, what domain do you want
to handle the interrupt?

-Greg
On Thu, Nov 29, 2018 at 10:28 AM 梁权 via Xenomai <xenomai@xenomai.org> wrote:
>
> it is neither NMI nor FIQ; "cannot be mask" just for emphasize this interrupt is so important that cannot be missed even once.
>  it maybe my fault for this unclear expression
>
>
>
>
> --
>
> ----------------------------------------------
>           梁权
> THANKS & BR!
>
>
>
>
>
> 在 2018-11-29 22:34:03,"Philippe Gerum" <rpm@xenomai.org> 写道:
> >On 11/29/18 9:03 AM, 梁权 via Xenomai wrote:
> >> hi,
> >> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
> >> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ;
> >
> >What do you mean precisely by "cannot be masked"? Are you referring to
> >NMI or FIQ?
> >
> >--
> >Philippe.


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

* Re:Re: Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29 15:39     ` Greg Gallagher
@ 2018-11-29 15:50       ` 梁权
  0 siblings, 0 replies; 14+ messages in thread
From: 梁权 @ 2018-11-29 15:50 UTC (permalink / raw)
  To: Greg Gallagher; +Cc: Philippe Gerum, Xenomai@xenomai.org

Now i handle the interrupt in xenomai domain , and after my long time test, the interrupt never be missed once.
But the Qt application run on the board crashed when i enable this interrupt in xenomai domain. 


--

----------------------------------------------
          梁权
THANKS & BR!
At 2018-11-29 23:39:03, "Greg Gallagher" <greg@embeddedgreg.com> wrote:
>This doc will help explain how the ipipe handles interrupts.
>
>https://gitlab.denx.de/Xenomai/ipipe-noarch/blob/master/Documentation/ipipe.rst
>
>
>I don't think the interrupt is being missed, what domain do you want
>to handle the interrupt?
>
>-Greg
>On Thu, Nov 29, 2018 at 10:28 AM 梁权 via Xenomai <xenomai@xenomai.org> wrote:
>>
>> it is neither NMI nor FIQ; "cannot be mask" just for emphasize this interrupt is so important that cannot be missed even once.
>>  it maybe my fault for this unclear expression
>>
>>
>>
>>
>> --
>>
>> ----------------------------------------------
>>           梁权
>> THANKS & BR!
>>
>>
>>
>>
>>
>> 在 2018-11-29 22:34:03,"Philippe Gerum" <rpm@xenomai.org> 写道:
>> >On 11/29/18 9:03 AM, 梁权 via Xenomai wrote:
>> >> hi,
>> >> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
>> >> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ;
>> >
>> >What do you mean precisely by "cannot be masked"? Are you referring to
>> >NMI or FIQ?
>> >
>> >--
>> >Philippe.

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

* Re:Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29 15:25     ` Jan Kiszka
@ 2018-11-29 15:58       ` 梁权
  0 siblings, 0 replies; 14+ messages in thread
From: 梁权 @ 2018-11-29 15:58 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

i think it is hardly to run a vanilla 4.14.71 on that board , but i will try tomorrow.
it is 12 o'clock late at night in china; so i must go sleep now.thanks &  good night guys

--

----------------------------------------------
          梁权
THANKS & BR!
At 2018-11-29 23:25:30, "Jan Kiszka" <jan.kiszka@siemens.com> wrote:
>On 29.11.18 16:15, 梁权 wrote:
>> The linux 4.14.67 which i used is from the latest TI Linux Processor SDK for 
>> AM335x;  when i patch it with the /ipipe-core-4.14.71-arm-4.patch,/
>> i did not need to do any change except that  telling where the file dmtimer.c is;
>> i guess it is because that in linux 4.14.67 the location of dmtimer.c is 
>> different from which in linux 4.14.71
>> 
>
>Could you try if you can reproduce the issue with vanilla 4.14.71 + I-pipe? Just 
>to exclude downstream issues.
>
>I think there is no longer a need for a downstream kernel on that board, but I 
>might be wrong (which would be sad).
>
>Jan
>
>-- 
>Siemens AG, Corporate Technology, CT RDA IOT SES-DE
>Corporate Competence Center Embedded Linux

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

* Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29  8:03 every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong? 梁权
  2018-11-29 11:14 ` Jan Kiszka
  2018-11-29 14:34 ` Philippe Gerum
@ 2018-11-29 16:40 ` Philippe Gerum
  2018-11-30 16:44   ` 梁权
  2 siblings, 1 reply; 14+ messages in thread
From: Philippe Gerum @ 2018-11-29 16:40 UTC (permalink / raw)
  To: 梁权, xenomai

On 11/29/18 9:03 AM, 梁权 via Xenomai wrote:
> hi,
> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ; 
> to  handler this interrupt immediately, i register  the interrupt handler in xenomai domain.Also there is a QT applictation running on the board;  and here is the problem i encounter:
> if i open the interrupt and run the QT application simultaneously, the QT application will get wrong like this after a few minutes(but the linux is still running fine):
> [ 1601.496828] Unhandled fault: page domain fault (0x01b) at 0xb6fa135c

Any improvement with this patch in?

diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 3569b3174372..c53f51357b3c 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -296,6 +296,7 @@ __und_svc:
 	bl	__ipipe_notify_trap		@ branch to trap handler
 	cmp	r0, #0
 	bne	__und_svc_finish
+	uaccess_enable ip
 #endif /* CONFIG_IPIPE */
 	@
 	@ call emulation code, which returns using r9 if it has emulated

-- 
Philippe.


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

* Re:Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-29 16:40 ` Philippe Gerum
@ 2018-11-30 16:44   ` 梁权
  2018-12-02  7:07     ` 梁权
  0 siblings, 1 reply; 14+ messages in thread
From: 梁权 @ 2018-11-30 16:44 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

i try this patch  several times,  the QT app still crashed after runing few minutes. and the kenerl report the error like this:
root@am335x-evm:~/tmp# [ 1696.313121] Internal error: Oops - undefined instruction: 0 [#1] PREEMPT ARM
[ 1696.320258] Modules linked in: motionDrv(O) FPGA(O)
[ 1696.325169] CPU: 0 PID: 606 Comm: HMI_V2 Tainted: G           O    4.14.67-gd315a9bb00 #115
[ 1696.333557] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1696.339657] I-pipe domain: Linux
[ 1696.342920] task: cda6c600 task.stack: cdad6000
[ 1696.347465] PC is at 0xb5c27c64
[ 1696.350607] LR is at 0xb5c27c60
[ 1696.353779] pc : [<b5c27c64>]    lr : [<b5c27c60>]    psr: 60070113
[ 1696.360062] sp : cdad7ff8  ip : b61060ec  fp : 00000000
[ 1696.365308] r10: 00000000  r9 : b6100fa8  r8 : 0031e2a8
[ 1696.370554] r7 : 00362b18  r6 : bef16a84  r5 : 003623a8  r4 : b610b40c
[ 1696.377081] r3 : 000083d0  r2 : 00000000  r1 : 00000000  r0 : 0035f8b0
[ 1696.383639] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1696.390807] Control: 10c5387d  Table: 8e7b8019  DAC: 00000055
[ 1696.396571] Process HMI_V2 (pid: 606, stack limit = 0xcdad6218)
[ 1696.402519] Stack: (0xcdad7ff8 to 0xcdad8000)
[ 1696.406911] 7fe0:                                                       00000000 00000000
[ 1696.415116] Backtrace: no frame pointer
[ 1696.418959] Code: 6820e83c 4010e8bd ba20f76f 4604b510 (f76c6800) 
[ 1696.427652] ---[ end trace 4f2a065db149444a ]---
or like this:
[  801.038004] Unable to handle kernel paging request at virtual address 302e3020
[  801.045476] pgd = cda04000
[  801.048313] [302e3020] *pgd=00000000
[  801.052857] Internal error: Oops: 80000005 [#1] PREEMPT ARM
[  801.058592] Modules linked in: motionDrv(O) FPGA(O)
[  801.064173] CPU: 0 PID: 601 Comm: HMI_V2 Tainted: G           O    4.14.67-gd315a9bb00 #113
[  801.073019] Hardware name: Generic AM33XX (Flattened Device Tree)
[  801.079241] I-pipe domain: Linux
[  801.083023] task: cdaaa400 task.stack: cf04c000
[  801.087720] PC is at 0x302e3020
[  801.090923] LR is at 0xb5888f2c
[  801.094491] pc : [<302e3020>]    lr : [<b5888f2c>]    psr: 60070113
[  801.100866] sp : cf04dff8  ip : 000000ac  fp : be942a08
[  801.106417] r10: 00000039  r9 : 00000321  r8 : 00000032
[  801.111816] r7 : 0038f6e8  r6 : 00398800  r5 : 00000000  r4 : 001024a0
[  801.118434] r3 : 00000000  r2 : 00000006  r1 : 00398800  r0 : be9424a4
[  801.125388] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  801.132709] Control: 10c5387d  Table: 8da04019  DAC: 00000055
[  801.138565] Process HMI_V2 (pid: 601, stack limit = 0xcf04c218)
[  801.144909] Stack: (0xcf04dff8 to 0xcf04e000)
[  801.149423] dfe0:                                                       00000000 00000000
[  801.157963] Backtrace: invalid frame pointer 0xbe942a08
[  801.163331] Code: bad PC value
[  801.166534] ---[ end trace 98fa8ef156ddf39e ]---
or this:
[ 1417.451198] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 1417.459556] pgd = cd870000
[ 1417.463185] [00000000] *pgd=8d8b9831, *pte=00000000, *ppte=00000000
[ 1417.469621] Internal error: Oops: 817 [#2] PREEMPT ARM
[ 1417.474806] Modules linked in: motionDrv(O) FPGA(O)
[ 1417.479717] CPU: 0 PID: 628 Comm: HMI_V2 Tainted: G      D    O    4.14.67-gd315a9bb00 #113
[ 1417.488104] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1417.494204] I-pipe domain: Linux
[ 1417.497468] task: cdb11800 task.stack: cd8be000
[ 1417.502013] PC is at 0xb5b56a48
[ 1417.505154] LR is at 0xb5b56a44
[ 1417.508296] pc : [<b5b56a48>]    lr : [<b5b56a44>]    psr: 60070113
[ 1417.514609] sp : cd8bfff8  ip : b6096ff8  fp : 00000000
[ 1417.519856] r10: 00347130  r9 : b608ffa8  r8 : 004d956a
[ 1417.525102] r7 : 00330c98  r6 : 00000000  r5 : ffffffff  r4 : ffffffff
[ 1417.531629] r3 : 0035e9c0  r2 : 00000000  r1 : bee89a08  r0 : 00330c98
[ 1417.538187] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1417.545354] Control: 10c5387d  Table: 8d870019  DAC: 00000055
[ 1417.551119] Process HMI_V2 (pid: 628, stack limit = 0xcd8be218)
[ 1417.557067] Stack: (0xcd8bfff8 to 0xcd8c0000)
[ 1417.561459] ffe0:                                                       00000000 00000000
[ 1417.569663] Backtrace: no frame pointer
[ 1417.573507] Code: 461fda04 685b19bb d1f54298 1c563a01 (0682ea4f) 
[ 1417.581894] ---[ end trace 98fa8ef156ddf39f ]---


besides that, there is another thing i was curious on; at the beginning i register the interrupt by using the
rtdm_request_irq func; however it have no effect; then i add the following code before i call rtdm_request_irq:
irq_set_handler(irqNo,handle_simple_irq); 
it work around.  i think this code has nothing to do with the problem, so i didn't mention it before。
----------------------------------------------
          梁权
THANKS & BR!
At 2018-11-30 00:40:49, "Philippe Gerum" <rpm@xenomai.org> wrote:
>On 11/29/18 9:03 AM, 梁权 via Xenomai wrote:
>> hi,
>> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
>> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ; 
>> to  handler this interrupt immediately, i register  the interrupt handler in xenomai domain.Also there is a QT applictation running on the board;  and here is the problem i encounter:
>> if i open the interrupt and run the QT application simultaneously, the QT application will get wrong like this after a few minutes(but the linux is still running fine):
>> [ 1601.496828] Unhandled fault: page domain fault (0x01b) at 0xb6fa135c
>
>Any improvement with this patch in?
>
>diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
>index 3569b3174372..c53f51357b3c 100644
>--- a/arch/arm/kernel/entry-armv.S
>+++ b/arch/arm/kernel/entry-armv.S
>@@ -296,6 +296,7 @@ __und_svc:
> 	bl	__ipipe_notify_trap		@ branch to trap handler
> 	cmp	r0, #0
> 	bne	__und_svc_finish
>+	uaccess_enable ip
> #endif /* CONFIG_IPIPE */
> 	@
> 	@ call emulation code, which returns using r9 if it has emulated
>
>-- 
>Philippe.

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

* Re:Re:Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-11-30 16:44   ` 梁权
@ 2018-12-02  7:07     ` 梁权
  2018-12-02 10:00       ` Philippe Gerum
  0 siblings, 1 reply; 14+ messages in thread
From: 梁权 @ 2018-12-02  7:07 UTC (permalink / raw)
  To: 梁权; +Cc: Philippe Gerum, xenomai

To simplify the problem, i do a test without QT like the following program:
#define MALLOC_SIZE 8*1024*1024
int main()
{
int err;
char *addr=(char *)0;
time_t now;
struct tm *timenow;
time(&now);
timenow = localtime(&now);
printf("%s\n", asctime(timenow));
addr = (char *)malloc(MALLOC_SIZE);
if (addr)
printf("malloc ok\n");
do
{
if (addr){
memset(addr, 0x12, MALLOC_SIZE/2);
                        memset(addr + MALLOC_SIZE/2, 0x34, MALLOC_SIZE/2);
}
usleep(1000);
}while(1);
return 0;
}
After i enable the interrupt for several minutes,  the error occur:
root@am335x-evm:~/tmp# ./testMemset 
Sun Dec  2 14:38:11 2018
malloc ok
[  311.700939] Unable to handle kernel paging request at virtual address b6e76000
[  311.708290] pgd = cdfd8000
[  311.711004] [b6e76000] *pgd=8e7b7831, *pte=80bd118f, *ppte=80bd1a3e
[  311.718141] Internal error: Oops: 81f [#1] PREEMPT ARM
[  311.723327] Modules linked in: motionDrv(O) FPGA(O)
[  311.728237] CPU: 0 PID: 659 Comm: testMemset Tainted: G           O    4.14.67-gd315a9bb00 #115
[  311.736960] Hardware name: Generic AM33XX (Flattened Device Tree)
[  311.743091] I-pipe domain: Linux
[  311.746324] task: cdedf600 task.stack: cdb92000
[  311.750899] PC is at 0xb6ecee78
[  311.754041] LR is at 0xb6ecee58
[  311.757182] pc : [<b6ecee78>]    lr : [<b6ecee58>]    psr: 20000113
[  311.763466] sp : cdb93ff8  ip : 34343434  fp : 00000000
[  311.768712] r10: b6f77000  r9 : 00000000  r8 : 00000000
[  311.773958] r7 : beb0dc20  r6 : 00008525  r5 : beb0dc48  r4 : 00000000
[  311.780516] r3 : b6e76000  r2 : 00000006  r1 : 34343434  r0 : b6a75008
[  311.787073] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  311.794241] Control: 10c5387d  Table: 8dfd8019  DAC: 00000055
[  311.800006] Process testMemset (pid: 659, stack limit = 0xcdb92218)
[  311.806289] Stack: (0xcdb93ff8 to 0xcdb94000)
[  311.810681] 3fe0:                                                       00000000 00000000
[  311.818886] Backtrace: no frame pointer
[  311.822729] Code: 28a31002 2afffff6 e2022007 e2522001 (24c31001) 
[  311.830628] ---[ end trace a41a426083b826ca ]---
Segmentation fault
wether the kernel  have the Philippe's pathc or not , the situation is the same.

so in my opinion,it is maybe the robust  of this version of the ipipe-patch or  xenomai is not so well  to make this happen? 
i will have a try with the 4.9 kenerl  tomorrow, and  hope can eliminate this problem. if not , i am afraid i have to give up the xenomai on my project.
--

----------------------------------------------
          梁权
THANKS & BR!



At 2018-12-01 00:44:10, "梁权" <liang_1911@163.com> wrote:

i try this patch  several times,  the QT app still crashed after runing few minutes. and the kenerl report the error like this:
root@am335x-evm:~/tmp# [ 1696.313121] Internal error: Oops - undefined instruction: 0 [#1] PREEMPT ARM
[ 1696.320258] Modules linked in: motionDrv(O) FPGA(O)
[ 1696.325169] CPU: 0 PID: 606 Comm: HMI_V2 Tainted: G           O    4.14.67-gd315a9bb00 #115
[ 1696.333557] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1696.339657] I-pipe domain: Linux
[ 1696.342920] task: cda6c600 task.stack: cdad6000
[ 1696.347465] PC is at 0xb5c27c64
[ 1696.350607] LR is at 0xb5c27c60
[ 1696.353779] pc : [<b5c27c64>]    lr : [<b5c27c60>]    psr: 60070113
[ 1696.360062] sp : cdad7ff8  ip : b61060ec  fp : 00000000
[ 1696.365308] r10: 00000000  r9 : b6100fa8  r8 : 0031e2a8
[ 1696.370554] r7 : 00362b18  r6 : bef16a84  r5 : 003623a8  r4 : b610b40c
[ 1696.377081] r3 : 000083d0  r2 : 00000000  r1 : 00000000  r0 : 0035f8b0
[ 1696.383639] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1696.390807] Control: 10c5387d  Table: 8e7b8019  DAC: 00000055
[ 1696.396571] Process HMI_V2 (pid: 606, stack limit = 0xcdad6218)
[ 1696.402519] Stack: (0xcdad7ff8 to 0xcdad8000)
[ 1696.406911] 7fe0:                                                       00000000 00000000
[ 1696.415116] Backtrace: no frame pointer
[ 1696.418959] Code: 6820e83c 4010e8bd ba20f76f 4604b510 (f76c6800) 
[ 1696.427652] ---[ end trace 4f2a065db149444a ]---
or like this:
[  801.038004] Unable to handle kernel paging request at virtual address 302e3020
[  801.045476] pgd = cda04000
[  801.048313] [302e3020] *pgd=00000000
[  801.052857] Internal error: Oops: 80000005 [#1] PREEMPT ARM
[  801.058592] Modules linked in: motionDrv(O) FPGA(O)
[  801.064173] CPU: 0 PID: 601 Comm: HMI_V2 Tainted: G           O    4.14.67-gd315a9bb00 #113
[  801.073019] Hardware name: Generic AM33XX (Flattened Device Tree)
[  801.079241] I-pipe domain: Linux
[  801.083023] task: cdaaa400 task.stack: cf04c000
[  801.087720] PC is at 0x302e3020
[  801.090923] LR is at 0xb5888f2c
[  801.094491] pc : [<302e3020>]    lr : [<b5888f2c>]    psr: 60070113
[  801.100866] sp : cf04dff8  ip : 000000ac  fp : be942a08
[  801.106417] r10: 00000039  r9 : 00000321  r8 : 00000032
[  801.111816] r7 : 0038f6e8  r6 : 00398800  r5 : 00000000  r4 : 001024a0
[  801.118434] r3 : 00000000  r2 : 00000006  r1 : 00398800  r0 : be9424a4
[  801.125388] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  801.132709] Control: 10c5387d  Table: 8da04019  DAC: 00000055
[  801.138565] Process HMI_V2 (pid: 601, stack limit = 0xcf04c218)
[  801.144909] Stack: (0xcf04dff8 to 0xcf04e000)
[  801.149423] dfe0:                                                       00000000 00000000
[  801.157963] Backtrace: invalid frame pointer 0xbe942a08
[  801.163331] Code: bad PC value
[  801.166534] ---[ end trace 98fa8ef156ddf39e ]---
or this:
[ 1417.451198] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 1417.459556] pgd = cd870000
[ 1417.463185] [00000000] *pgd=8d8b9831, *pte=00000000, *ppte=00000000
[ 1417.469621] Internal error: Oops: 817 [#2] PREEMPT ARM
[ 1417.474806] Modules linked in: motionDrv(O) FPGA(O)
[ 1417.479717] CPU: 0 PID: 628 Comm: HMI_V2 Tainted: G      D    O    4.14.67-gd315a9bb00 #113
[ 1417.488104] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 1417.494204] I-pipe domain: Linux
[ 1417.497468] task: cdb11800 task.stack: cd8be000
[ 1417.502013] PC is at 0xb5b56a48
[ 1417.505154] LR is at 0xb5b56a44
[ 1417.508296] pc : [<b5b56a48>]    lr : [<b5b56a44>]    psr: 60070113
[ 1417.514609] sp : cd8bfff8  ip : b6096ff8  fp : 00000000
[ 1417.519856] r10: 00347130  r9 : b608ffa8  r8 : 004d956a
[ 1417.525102] r7 : 00330c98  r6 : 00000000  r5 : ffffffff  r4 : ffffffff
[ 1417.531629] r3 : 0035e9c0  r2 : 00000000  r1 : bee89a08  r0 : 00330c98
[ 1417.538187] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1417.545354] Control: 10c5387d  Table: 8d870019  DAC: 00000055
[ 1417.551119] Process HMI_V2 (pid: 628, stack limit = 0xcd8be218)
[ 1417.557067] Stack: (0xcd8bfff8 to 0xcd8c0000)
[ 1417.561459] ffe0:                                                       00000000 00000000
[ 1417.569663] Backtrace: no frame pointer
[ 1417.573507] Code: 461fda04 685b19bb d1f54298 1c563a01 (0682ea4f) 
[ 1417.581894] ---[ end trace 98fa8ef156ddf39f ]---


besides that, there is another thing i was curious on; at the beginning i register the interrupt by using the
rtdm_request_irq func; however it have no effect; then i add the following code before i call rtdm_request_irq:
irq_set_handler(irqNo,handle_simple_irq); 
it work around.  i think this code has nothing to do with the problem, so i didn't mention it before。
----------------------------------------------
          梁权
THANKS & BR!
At 2018-11-30 00:40:49, "Philippe Gerum" <rpm@xenomai.org> wrote:
>On 11/29/18 9:03 AM, 梁权 via Xenomai wrote:
>> hi,
>> i'm work on a customed board with TI am335X; i have installed xenomai 3 on it correcttly , and can run the latency test.
>> On this board, an interrupt which cannot be masked and delayed will be generated every millicsecond by a FPGA ; 
>> to  handler this interrupt immediately, i register  the interrupt handler in xenomai domain.Also there is a QT applictation running on the board;  and here is the problem i encounter:
>> if i open the interrupt and run the QT application simultaneously, the QT application will get wrong like this after a few minutes(but the linux is still running fine):
>> [ 1601.496828] Unhandled fault: page domain fault (0x01b) at 0xb6fa135c
>
>Any improvement with this patch in?
>
>diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
>index 3569b3174372..c53f51357b3c 100644
>--- a/arch/arm/kernel/entry-armv.S
>+++ b/arch/arm/kernel/entry-armv.S
>@@ -296,6 +296,7 @@ __und_svc:
> 	bl	__ipipe_notify_trap		@ branch to trap handler
> 	cmp	r0, #0
> 	bne	__und_svc_finish
>+	uaccess_enable ip
> #endif /* CONFIG_IPIPE */
> 	@
> 	@ call emulation code, which returns using r9 if it has emulated
>
>-- 
>Philippe.

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

* Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-12-02  7:07     ` 梁权
@ 2018-12-02 10:00       ` Philippe Gerum
  2018-12-05  4:17         ` 梁权
  0 siblings, 1 reply; 14+ messages in thread
From: Philippe Gerum @ 2018-12-02 10:00 UTC (permalink / raw)
  To: 梁权; +Cc: xenomai

On 12/2/18 8:07 AM, 梁权 wrote:
> To simplify the problem, i do a test without QT like the following program:
> #define MALLOC_SIZE 8*1024*1024
> int main()
> {
> int err;
> char *addr=(char *)0;
> time_t now;
> struct tm *timenow;
> time(&now);
> timenow = localtime(&now);
> printf("%s\n", asctime(timenow));
> addr = (char *)malloc(MALLOC_SIZE);
> if (addr)
> printf("malloc ok\n");
> do
> {
> if (addr){
> memset(addr, 0x12, MALLOC_SIZE/2);
>                         memset(addr + MALLOC_SIZE/2, 0x34, MALLOC_SIZE/2);
> }
> usleep(1000);
> }while(1);
> return 0;
> }
> After i enable the interrupt for several minutes,  the error occur:
> root@am335x-evm:~/tmp# ./testMemset

Ok, thanks for investing time in creating this test snippet. I'll divert
some cycles in a few days to look into this.

-- 
Philippe.


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

* Re:Re: every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong?
  2018-12-02 10:00       ` Philippe Gerum
@ 2018-12-05  4:17         ` 梁权
  0 siblings, 0 replies; 14+ messages in thread
From: 梁权 @ 2018-12-05  4:17 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

hi, Philippe. i have tried with linux kernel 4.9.28+ipipe-core-4.9.38-arm-3.patch; it works fine for hours.
And i will do a long time test tonight.
Here,i also want to ask another question: because there is something wrong with the am3352's timer1 on my board,
after i power on the board for serverl hours, the kernel told me that:
[ 7313.887896] WARNING: Underflow in clocksource 'ipipe_tsc' observed, time update ignored.
[ 7313.887904]          Please report this, consider using a different clocksource, if possible.
[ 7313.887907]          Your kernel is probably still fine.
i wonder to know how much this issue would impact the xenomai's real-time performace? 
If it just have dozens of microseconds addtional latency to the xenomai's real-time task,  i think it is acceptalbe on my project.
And also, there is also another solution to get rid of this problem. That is changing the input clock source of am3352's timer1 from 24M to 32K. When change to 32K input source, the kernel print as following when booting:
[    0.000000] I-pipe, 0.032 MHz clocksource, wrap in 134217727 ms
Wether this change will impact the xenomai's performance very much? 
Compared with the former , which is the better solution?  Any replys will be appreciate.
--

----------------------------------------------
          梁权
THANKS & BR!
At 2018-12-02 18:00:44, "Philippe Gerum" <rpm@xenomai.org> wrote:
>On 12/2/18 8:07 AM, 梁权 wrote:
>> To simplify the problem, i do a test without QT like the following program:
>> #define MALLOC_SIZE 8*1024*1024
>> int main()
>> {
>> int err;
>> char *addr=(char *)0;
>> time_t now;
>> struct tm *timenow;
>> time(&now);
>> timenow = localtime(&now);
>> printf("%s\n", asctime(timenow));
>> addr = (char *)malloc(MALLOC_SIZE);
>> if (addr)
>> printf("malloc ok\n");
>> do
>> {
>> if (addr){
>> memset(addr, 0x12, MALLOC_SIZE/2);
>>                         memset(addr + MALLOC_SIZE/2, 0x34, MALLOC_SIZE/2);
>> }
>> usleep(1000);
>> }while(1);
>> return 0;
>> }
>> After i enable the interrupt for several minutes,  the error occur:
>> root@am335x-evm:~/tmp# ./testMemset
>
>Ok, thanks for investing time in creating this test snippet. I'll divert
>some cycles in a few days to look into this.
>
>-- 
>Philippe.

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

end of thread, other threads:[~2018-12-05  4:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29  8:03 every millicsecond interrupt in xenomai domain on a am355x board can cause something wrong? 梁权
2018-11-29 11:14 ` Jan Kiszka
2018-11-29 15:15   ` 梁权
2018-11-29 15:25     ` Jan Kiszka
2018-11-29 15:58       ` 梁权
2018-11-29 14:34 ` Philippe Gerum
2018-11-29 15:27   ` 梁权
2018-11-29 15:39     ` Greg Gallagher
2018-11-29 15:50       ` 梁权
2018-11-29 16:40 ` Philippe Gerum
2018-11-30 16:44   ` 梁权
2018-12-02  7:07     ` 梁权
2018-12-02 10:00       ` Philippe Gerum
2018-12-05  4:17         ` 梁权

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.