Skip to contentSkip to conversation

at91sam9260

Adeos-main Michael Trimarchi 2 participants 4 messages Dec 17, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

Wait a minute. You mean that you want more than 5000 interrupts by second ? Are you sure you do not get overruns with plain, unpatched Linux, if you load it sufficiently ?

If you do a simple count ( 115200 bps ) considering buffer length = 1

the

Quoted 4 lines
Quoted 4 lines

answer is yes.

:)

Quoted 10 lines
Quoted 3 lines

regards Michael

PS work with linux

Do you observe this behaviour with I-pipe only or with Xenomai running ? If we xenomai, could you try only booting Linux with I-pipe enabled ?

Signature · 1 line
                                              Gilles Chanteperdrix

I report this only using ipipe. I have some trouble with xenomai, that I will try to solve ( see below )

== Sampling period: 100 us
== Test mode: periodic user-mode task
== All results in microseconds
warming up...
I-pipe: Detected illicit call from domain 'Xenomai'
into a service reserved for domain 'Linux' and below.
[<c0021988>] (show_stack+0x0/0x48) from [<c005cca0>] (ipipe_check_context+0x88/0xa4) [<c005cc18>] (ipipe_check_context+0x0/0xa4) from [<c0057e40>] (search_module_extables+0x3c/0xe8)
r5:00000000 r4:c0063cf0
[<c0057e04>] (search_module_extables+0x0/0xe8) from [<c004887c>] (search_exception_tables+0x30/0x3c)
r8:00000154 r7:00000017 r6:00000000 r5:c0271e00 r4:c0063cf0
[<c004884c>] (search_exception_tables+0x0/0x3c) from [<c00231c0>] (fixup_exception+0x18/0x30)
r4:c0271e00
[<c00231a8>] (fixup_exception+0x0/0x30) from [<c002339c>] (__do_kernel_fault+0x24/0x7c)
r4:00000154
[<c0023378>] (__do_kernel_fault+0x0/0x7c) from [<c0023670>] (do_page_fault+0x27c/0x29c)
r7:00000000 r6:c0266520 r5:c01a1e6c r4:ffffffff
[<c00233f4>] (do_page_fault+0x0/0x29c) from [<c001c2c8>] (do_DataAbort+0x3c/0x11c) [<c001c28c>] (do_DataAbort+0x0/0x11c) from [<c001cb40>] (__dabt_svc+0x40/0x60)

Exception stack(0xc0271e00 to 0xc0271e48)

1e00: 204c0000 c0457860 40000093 40000093 c0457860 00000000 c01bf860 00000000
1e20: c0280b30 c0270000 c01bf890 c0271e80 00000000 c0271e48 c0063ce4 c0063cf0
1e40: 40000093 ffffffff
r8:c0280b30 r7:00000000 r6:c01bf860 r5:c0271e34 r4:ffffffff
[<c00636ec>] (xnpod_schedule+0x0/0x7ac) from [<c00608f8>] (xnintr_clock_handler+0xa8/0x124) [<c0060850>] (xnintr_clock_handler+0x0/0x124) from [<c005deb0>] (__ipipe_dispatch_wired+0xdc/0x104)
r8:c0266520 r7:c01bf480 r6:c01a8120 r5:c01aa4e0 r4:c01bd140
[<c005ddd4>] (__ipipe_dispatch_wired+0x0/0x104) from [<c0021efc>] (__ipipe_handle_irq+0x94/0x1c8)
r6:c0271f20 r5:00000011 r4:c01bd140
[<c0021e68>] (__ipipe_handle_irq+0x0/0x1c8) from [<c00220f4>] (__ipipe_grab_irq+0xc4/0x120) [<c0022030>] (__ipipe_grab_irq+0x0/0x120) from [<c001cb90>] (__irq_svc+0x30/0x78)
r8:c0266520 r7:c0457860 r6:00000011 r5:fefff000 r4:ffffffff
[<c014e0d4>] (schedule+0x0/0x814) from [<c006af54>] (gatekeeper_thread+0xfc/0x194) [<c006ae58>] (gatekeeper_thread+0x0/0x194) from [<c004b1a4>] (kthread+0x58/0x90) [<c004b14c>] (kthread+0x0/0x90) from [<c003780c>] (do_exit+0x0/0x94c)
r6:00000000 r5:00000000 r4:00000000

There is a patch to using the serial device with DMA too and I use it with other board

equipped with the at91rm9200. But my question is this:

spi prioriy < serial priority

In linux the interrupt nesting is controlled by the hardware logic. Is it true?

The priority is mainted using ipipe in at91sam9260?

Regards Michael

      ___________________________________ 

L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail:
http://it.docs.yahoo.com/nowyoucan.html

#1 lore raw
Quoted 20 lines · Michael Trimarchi

Hi,

Quoted 16 lines
Quoted 11 lines
Quoted 3 lines

Wait a minute. You mean that you want more than 5000 interrupts by second ? Are you sure you do not get overruns with plain, unpatched Linux, if you load it sufficiently ?

If you do a simple count ( 115200 bps ) considering buffer length = 1 the answer is yes.

:)

regards Michael

PS work with linux

Do you observe this behaviour with I-pipe only or with Xenomai running ? If we xenomai, could you try only booting Linux with I-pipe enabled ?

Quoted 5 lines
Quoted 2 lines

--
Gilles Chanteperdrix

I report this only using ipipe. I have some trouble with xenomai, that I will try to solve ( see below )

Ok. Could you try something ? It will work with I-pipe only but will break Xenomai, so do not try to run Xenomai over this modification.

In include/asm-arm/system.h in the definition of the switch_to macro try removing the calls to local_irq_disable_hw_cond and local_irq_enable_hw_cond, and tell us if you still get the serial driver overruns.

Quoted 45 lines

== Sampling period: 100 us
== Test mode: periodic user-mode task
== All results in microseconds
warming up...
I-pipe: Detected illicit call from domain 'Xenomai'
into a service reserved for domain 'Linux' and below.
[<c0021988>] (show_stack+0x0/0x48) from [<c005cca0>] (ipipe_check_context+0x88/0xa4)
[<c005cc18>] (ipipe_check_context+0x0/0xa4) from [<c0057e40>] (search_module_extables+0x3c/0xe8)
r5:00000000 r4:c0063cf0
[<c0057e04>] (search_module_extables+0x0/0xe8) from [<c004887c>] (search_exception_tables+0x30/0x3c)
r8:00000154 r7:00000017 r6:00000000 r5:c0271e00 r4:c0063cf0
[<c004884c>] (search_exception_tables+0x0/0x3c) from [<c00231c0>] (fixup_exception+0x18/0x30)
r4:c0271e00
[<c00231a8>] (fixup_exception+0x0/0x30) from [<c002339c>] (__do_kernel_fault+0x24/0x7c)
r4:00000154
[<c0023378>] (__do_kernel_fault+0x0/0x7c) from [<c0023670>] (do_page_fault+0x27c/0x29c)
r7:00000000 r6:c0266520 r5:c01a1e6c r4:ffffffff
[<c00233f4>] (do_page_fault+0x0/0x29c) from [<c001c2c8>] (do_DataAbort+0x3c/0x11c)
[<c001c28c>] (do_DataAbort+0x0/0x11c) from [<c001cb40>] (__dabt_svc+0x40/0x60)

Exception stack(0xc0271e00 to 0xc0271e48)

1e00: 204c0000 c0457860 40000093 40000093 c0457860 00000000 c01bf860 00000000
1e20: c0280b30 c0270000 c01bf890 c0271e80 00000000 c0271e48 c0063ce4 c0063cf0
1e40: 40000093 ffffffff
r8:c0280b30 r7:00000000 r6:c01bf860 r5:c0271e34 r4:ffffffff
[<c00636ec>] (xnpod_schedule+0x0/0x7ac) from [<c00608f8>] (xnintr_clock_handler+0xa8/0x124)
[<c0060850>] (xnintr_clock_handler+0x0/0x124) from [<c005deb0>] (__ipipe_dispatch_wired+0xdc/0x104)
r8:c0266520 r7:c01bf480 r6:c01a8120 r5:c01aa4e0 r4:c01bd140
[<c005ddd4>] (__ipipe_dispatch_wired+0x0/0x104) from [<c0021efc>] (__ipipe_handle_irq+0x94/0x1c8)
r6:c0271f20 r5:00000011 r4:c01bd140
[<c0021e68>] (__ipipe_handle_irq+0x0/0x1c8) from [<c00220f4>] (__ipipe_grab_irq+0xc4/0x120)
[<c0022030>] (__ipipe_grab_irq+0x0/0x120) from [<c001cb90>]

Quoted 8 lines

(__irq_svc+0x30/0x78)
r8:c0266520 r7:c0457860 r6:00000011 r5:fefff000 r4:ffffffff
[<c014e0d4>] (schedule+0x0/0x814) from [<c006af54>] (gatekeeper_thread+0xfc/0x194)
[<c006ae58>] (gatekeeper_thread+0x0/0x194) from [<c004b1a4>] (kthread+0x58/0x90)
[<c004b14c>] (kthread+0x0/0x90) from [<c003780c>] (do_exit+0x0/0x94c)
r6:00000000 r5:00000000 r4:00000000

This means that there is a fault in xnpod_schedule, that causes a Linux function to be called over Xenomai domain. But the problem is the fault in the first place. To debug this, we need a disassembly of xnpod_schedule. This will be best discussed on Xenomai mailing list. You probably have a problem in your port of the I-pipe patch, since Xenomai is reported to works on other AT91s.

Quoted 6 lines

There is a patch to using the serial device with DMA too and I use it with other board
equipped with the at91rm9200. But my question is this:

Quoted 6 lines

spi prioriy < serial priority

In linux the interrupt nesting is controlled by the hardware logic. Is it
true?

The priority is mainted using ipipe in at91sam9260?

This is a difficult subject, will give a detailed explanation later. The I-pipe evolved between the 1.7-08 and 1.8-02 versions, and Linux is going to evolve in the same way. But the short answer is that interrupt controller priority should matter only when receiving several interrupts at the same time, which means not often, if it matters it is because there is a bug in the interrupt handling, the bug that was fixed in I-pipe version 1.8 and which is going to be fixed in Linux soon.
http://marc.info/?l=linux-arm-kernel&m=119776017521950&w=2

Signature · 1 line
                                               Gilles Chanteperdrix
#2 lore raw
In reply to Michael Trimarchi
Quoted 5 lines · Michael Trimarchi

In linux the interrupt nesting is controlled by the hardware logic. Is it true?

The priority is mainted using ipipe in at91sam9260?

On AT91 the interrupt controller works as follows: when an interrupt occurs, the processor irq line is asserted, until the processor reads the AIC_IVR register. At that point, and until the processor writes to the AIC_EOICR register, interrupts of lower priority are masked, and only interrupts of higher priority could cause the processor irq line to be reasserted.

In linux implementation (as of today), the write to the AIC_EOICR register occurs at the end of the asm_do_IRQ function, after the interrupt handler is invoked. So, this means that during all the work done by an interrupt handler, lower priority interrupts are masked, and only higher or equal priority interrupts can trigger the next interrupt. So, the answer to your first question is yes, the interrupt nesting of Linux _on AT91_ is controlled by the hardware logic.

Now about the I-pipe. The first implementation of I-pipe on AT91 followed the same logic as Linux, and this caused me a lot of headaches:
when testing the I-pipe: I could get timer interrupt jitter of 40 ms when the board was put under ethernet irq load and could not understand why. Until I understood that the interrupt controller had priorities, and that the TC (used as timer hardware on AT91) had a lower priority than the ethernet interrupt. So my first conclusion was that TC should be given a priority higher than any other interrupt on the system if we wanted to run Xenomai on AT91. And the result is that the I-pipe patch, until 1.7-06 followed the same logic as Linux.

But this behaviour means that a non real-time interrupt can delay a real-time interrupt if its hardware priority is higher. And discussion with Jan convinced me that the behaviour was wrong: interrupt controller priorities should only arbiter interrupts occuring at the same time, and soon I understood why this happened: because of the late writing to the AIC_EOICR register, so, I changed the write to the AIC_EOICR register to happen when acknowleding the interrupt, at the very beginning of the interrupt handling, which allowed me to test successfully the I-pipe patch with the original interrupt priorities. So, the answer to your second question is no: the priority in I-pipe (from 1.8-00 onward) is no longer handled in hardware, and it is probably better the way it is.

Interestingly enough, I have not followed that discussion at all, but a discussion took place about interrupt handling and the RT patch on AT91, and looking at the patches sent to the linux-arm-kernel mailing list, it seems that these people came to the same conclusion: write to the AIC_EOICR should take place when acknowleding the interrupt, that is why I say that the I-pipe patch is probably better the way it is.

Signature · 1 line
					    Gilles Chanteperdrix.