s3c24xx: Priority rotate enable !?
Hello,
On s3c24xx processors the interrupt source priority isn't fixed by Adeos patch (ARB_SEL bits in PRIORITY register).
Is it intentional ?
It may be possible to give priority to an interrupt simultaneously arrived that the interruption IRQ_TIMER4 (before being grabbed by Adeos). Therefore, we can have more jitter for real time applications.
Do we need to fix the priority at this level ?
Thanks,
Romain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s3c24xx_fix_interrupt_priority.patch
Type: text/x-patch
Size: 514 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20120822/ab2cabfa/attachment.bin>
Quoted 8 lines · Romain Naour
Hello,
On s3c24xx processors the interrupt source priority isn't fixed by Adeos patch (
ARB_SELbits in PRIORITY register).
Is it intentional ?
It may be possible to give priority to an interrupt simultaneously arrived that the interruptionIRQ_TIMER4(before being grabbed by Adeos). Therefore, we can have more jitter for real time applications.
This can always happen even with interrupt priorities: imagine that the first interrupt happens 1 microsecond before the timer interrupt, even with the priority, the handler for first interrupt will be executed and the timer interrupt will have to wait for the end of this handler before it is serviced.
Quoted 2 lines
Do we need to fix the priority at this level ?
I do not think so. However, what can be done is implement interrupt controller muting using the priority register, see:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#Priority_based_interrupt_controller_muting
Signature · 1 line
Gilles.
Quoted 17 lines · Gilles Chanteperdrix
Quoted 8 lines · Romain Naour
Hello,
On s3c24xx processors the interrupt source priority isn't fixed by Adeos patch (
ARB_SELbits in PRIORITY register).
Is it intentional ?
It may be possible to give priority to an interrupt simultaneously arrived that the interruptionIRQ_TIMER4(before being grabbed by Adeos). Therefore, we can have more jitter for real time applications.This can always happen even with interrupt priorities: imagine that the first interrupt happens 1 microsecond before the timer interrupt, even with the priority, the handler for first interrupt will be executed and the timer interrupt will have to wait for the end of this handler before it is serviced.
Quoted 1 line
Quoted 5 lines
Quoted 1 line
Do we need to fix the priority at this level ?
I do not think so. However, what can be done is implement interrupt controller muting using the priority register, see:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#Priority_based_interrupt_controller_muting
Other things which could be done for s3c24xx are:
- convert the timers to clocksource/clockevent: since this platform is the only one not to use clocksource/clockevent, we have to keep code around for this case in xenomai-forge which could be removed. Having two different timers for clocksource and clockevent would allow to avoid the tsc emulation based on the decrementer, which I am not sure is really reliable since the conversion to CONFIG_IPIPE_ARM_KUSER_TSC.
- failing that, check that the tsc emulation based on the decrementer really works, and maybe fix it if it does not work. Or simply use a different hardware timer for tsc emulation than for the timer.
Signature · 1 line
Gilles.
Quoted 16 lines · Gilles Chanteperdrix
Quoted 15 lines · Gilles Chanteperdrix
Quoted 8 lines · Romain Naour
Hello,
On s3c24xx processors the interrupt source priority isn't fixed by Adeos patch (
ARB_SELbits in PRIORITY register).
Is it intentional ?
It may be possible to give priority to an interrupt simultaneously arrived that the interruptionIRQ_TIMER4(before being grabbed by Adeos). Therefore, we can have more jitter for real time applications.This can always happen even with interrupt priorities: imagine that the first interrupt happens 1 microsecond before the timer interrupt, even with the priority, the handler for first interrupt will be executed and the timer interrupt will have to wait for the end of this handler before it is serviced.
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Do we need to fix the priority at this level ?
I do not think so. However, what can be done is implement interrupt controller muting using the priority register, see:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#Priority_based_interrupt_controller_muting
The priority register can't be used for implement interrupt controller muting using this method . The PIC hardware can't be configured with only two priority levels.
We are obligated to choose between fixed or "rotation fashion" priority with 32 levels...
However, we can try to implement interrupt controller muting using bit-mask method. But, bits mask are scattered between 4 registers:
32 bits in INTMSK (IRQ 16 to 47)
20 bits in EINTMASK (IRQ 48 to 67)
2 bits in LCDINTMSK (IRQ 68 and 69)
15 bits in INTSUBMSK (IRQ 70 to 84)
Fortunately there are only 69 interrupts.
Quoted 11 lines
Other things which could be done for s3c24xx are:
- convert the timers to clocksource/clockevent: since this platform is the only one not to use clocksource/clockevent, we have to keep code around for this case in xenomai-forge which could be removed. Having two different timers for clocksource and clockevent would allow to avoid the tsc emulation based on the decrementer, which I am not sure is really reliable since the conversion toCONFIG_IPIPE_ARM_KUSER_TSC.
- failing that, check that the tsc emulation based on the decrementer really works, and maybe fix it if it does not work. Or simply use a different hardware timer for tsc emulation than for the timer.
I used Xenomai 2.6.0 with kernel 2.6.38.8 on mini2440 board during my internship. I haven't seen bug with tsc emulation.
Xenomai-forge will not work on s3c24xx since it needs CONFIG_GENERIC_CLOCKEVENTS.
Regards,
Romain
Quoted 18 lines · Romain Naour
Quoted 17 lines · Gilles Chanteperdrix
Quoted 16 lines · Gilles Chanteperdrix
Quoted 8 lines · Romain Naour
Hello,
On s3c24xx processors the interrupt source priority isn't fixed by Adeos patch (
ARB_SELbits in PRIORITY register).
Is it intentional ?
It may be possible to give priority to an interrupt simultaneously arrived that the interruptionIRQ_TIMER4(before being grabbed by Adeos). Therefore, we can have more jitter for real time applications.This can always happen even with interrupt priorities: imagine that the first interrupt happens 1 microsecond before the timer interrupt, even with the priority, the handler for first interrupt will be executed and the timer interrupt will have to wait for the end of this handler before it is serviced.
Quoted 1 line
Do we need to fix the priority at this level ?
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
I do not think so. However, what can be done is implement interrupt controller muting using the priority register, see:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#Priority_based_interrupt_controller_mutingThe priority register can't be used for implement interrupt controller muting using this method .
The PIC hardware can't be configured with only two priority levels. We are obligated to choose between fixed or "rotation fashion" priority with 32 levels...
What prevents us from using the "fixed" priorities, with one level for real-time interrupts and another for non real-time interrupts ?
Quoted 21 lines
However, we can try to implement interrupt controller muting using bit-mask method.
But, bits mask are scattered between 4 registers:
32 bits in INTMSK (IRQ 16 to 47)
20 bits in EINTMASK (IRQ 48 to 67)
2 bits in LCDINTMSK (IRQ 68 and 69)
15 bits in INTSUBMSK (IRQ 70 to 84)
Fortunately there are only 69 interrupts.Quoted 11 lines
Other things which could be done for s3c24xx are:
- convert the timers to clocksource/clockevent: since this platform is the only one not to use clocksource/clockevent, we have to keep code around for this case in xenomai-forge which could be removed. Having two different timers for clocksource and clockevent would allow to avoid the tsc emulation based on the decrementer, which I am not sure is really reliable since the conversion toCONFIG_IPIPE_ARM_KUSER_TSC.
- failing that, check that the tsc emulation based on the decrementer really works, and maybe fix it if it does not work. Or simply use a different hardware timer for tsc emulation than for the timer.
Quoted 3 lines
I used Xenomai 2.6.0 with kernel 2.6.38.8 on mini2440 board during my internship.
I haven't seen bug with tsc emulation.
To see if there is a bug, you should read the tsc, sleep for 30 minutes, read the tsc again, and check if the difference corresponds to 30 minutes. Have you done that test?
Quoted 3 lines
Xenomai-forge will not work on s3c24xx since it needs
CONFIG_GENERIC_CLOCKEVENTS.
It currently works. But if someone could convert s3c24xx to clockevents, we could remove the code allowing that.
Signature · 1 line
Gilles.
Quoted 11 lines · Gilles Chanteperdrix
Quoted 7 lines
Quoted 4 lines
- failing that, check that the tsc emulation based on the decrementer really works, and maybe fix it if it does not work. Or simply use a different hardware timer for tsc emulation than for the timer.
I used Xenomai 2.6.0 with kernel 2.6.38.8 on mini2440 board during my internship.
I haven't seen bug with tsc emulation.To see if there is a bug, you should read the tsc, sleep for 30 minutes, read the tsc again, and check if the difference corresponds to 30 minutes. Have you done that test?
With a latency test running in parallel.
Signature · 1 line
Gilles.
Quoted 22 lines · Gilles Chanteperdrix
Quoted 21 lines · Romain Naour
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Gilles Chanteperdrix
Quoted 8 lines · Romain Naour
Hello,
On s3c24xx processors the interrupt source priority isn't fixed by Adeos patch (
ARB_SELbits in PRIORITY register).
Is it intentional ?
It may be possible to give priority to an interrupt simultaneously arrived that the interruptionIRQ_TIMER4(before being grabbed by Adeos). Therefore, we can have more jitter for real time applications.This can always happen even with interrupt priorities: imagine that the first interrupt happens 1 microsecond before the timer interrupt, even with the priority, the handler for first interrupt will be executed and the timer interrupt will have to wait for the end of this handler before it is serviced.
Quoted 1 line
Do we need to fix the priority at this level ?
I do not think so. However, what can be done is implement interrupt controller muting using the priority register, see:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#Priority_based_interrupt_controller_muting
Quoted 7 lines
Quoted 5 lines
The priority register can't be used for implement interrupt controller muting using this method .
The PIC hardware can't be configured with only two priority levels. We are obligated to choose between fixed or "rotation fashion" priority with 32 levels...What prevents us from using the "fixed" priorities, with one level for real-time interrupts and another for non real-time interrupts ?
The priority register is used to configure the arbitration procedure when multiple interrupts occur. But some interrupt sources always have higher priority than other.
For example, EINT0 is always takes priority regardless INT_RTC, when arrive at the same time. Whatever the configuration of priority register.
When INT_TIMER4 is trigged, the value of priority register is modified. Thus, INT_TIMER4 loses its priority for arbitration procedure.
That is why I wonder if it is better to fix the priority for arbitration procedure.
Quoted 20 lines
Quoted 20 lines
However, we can try to implement interrupt controller muting using bit-mask method.
But, bits mask are scattered between 4 registers:
32 bits in INTMSK (IRQ 16 to 47)
20 bits in EINTMASK (IRQ 48 to 67)
2 bits in LCDINTMSK (IRQ 68 and 69)
15 bits in INTSUBMSK (IRQ 70 to 84)
Fortunately there are only 69 interrupts.Quoted 11 lines
Other things which could be done for s3c24xx are:
- convert the timers to clocksource/clockevent: since this platform is the only one not to use clocksource/clockevent, we have to keep code around for this case in xenomai-forge which could be removed. Having two different timers for clocksource and clockevent would allow to avoid the tsc emulation based on the decrementer, which I am not sure is really reliable since the conversion toCONFIG_IPIPE_ARM_KUSER_TSC.
- failing that, check that the tsc emulation based on the decrementer really works, and maybe fix it if it does not work. Or simply use a different hardware timer for tsc emulation than for the timer.
Quoted 6 lines
Quoted 3 lines
I used Xenomai 2.6.0 with kernel 2.6.38.8 on mini2440 board during my internship.
I haven't seen bug with tsc emulation.To see if there is a bug, you should read the tsc, sleep for 30 minutes, read the tsc again, and check if the difference corresponds to 30 minutes. Have you done that test?
No, and I haven't the board right now.
Quoted 6 lines
Quoted 3 lines
Xenomai-forge will not work on s3c24xx since it needs
CONFIG_GENERIC_CLOCKEVENTS.It currently works. But if someone could convert s3c24xx to clockevents, we could remove the code allowing that.
I will see if i can do that.
Romain
Quoted 34 lines · Romain Naour
Quoted 22 lines · Gilles Chanteperdrix
Quoted 21 lines · Romain Naour
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Gilles Chanteperdrix
Quoted 8 lines · Romain Naour
Hello,
On s3c24xx processors the interrupt source priority isn't fixed by Adeos patch (
ARB_SELbits in PRIORITY register).
Is it intentional ?
It may be possible to give priority to an interrupt simultaneously arrived that the interruptionIRQ_TIMER4(before being grabbed by Adeos). Therefore, we can have more jitter for real time applications.This can always happen even with interrupt priorities: imagine that the first interrupt happens 1 microsecond before the timer interrupt, even with the priority, the handler for first interrupt will be executed and the timer interrupt will have to wait for the end of this handler before it is serviced.
Quoted 1 line
Do we need to fix the priority at this level ?
I do not think so. However, what can be done is implement interrupt controller muting using the priority register, see:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#Priority_based_interrupt_controller_mutingQuoted 7 lines
Quoted 5 lines
The priority register can't be used for implement interrupt controller muting using this method .
The PIC hardware can't be configured with only two priority levels. We are obligated to choose between fixed or "rotation fashion" priority with 32 levels...What prevents us from using the "fixed" priorities, with one level for real-time interrupts and another for non real-time interrupts ?
The priority register is used to configure the arbitration procedure when multiple interrupts occur.
But some interrupt sources always have higher priority than other.
Quoted 8 lines
For example, EINT0 is always takes priority regardless
INT_RTC, when arrive at the same time.
Whatever the configuration of priority register.When
INT_TIMER4is trigged, the value of priority register is modified. Thus,INT_TIMER4loses its priority for arbitration procedure. That is why I wonder if it is better to fix the priority for arbitration procedure.
I don't get it, could you point me to the datasheet?
Signature · 1 line
Gilles.
Quoted 40 lines · Gilles Chanteperdrix
Quoted 38 lines · Romain Naour
Quoted 22 lines · Gilles Chanteperdrix
Quoted 21 lines · Romain Naour
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Gilles Chanteperdrix
Quoted 8 lines · Romain Naour
Hello,
On s3c24xx processors the interrupt source priority isn't fixed by Adeos patch (
ARB_SELbits in PRIORITY register).
Is it intentional ?
It may be possible to give priority to an interrupt simultaneously arrived that the interruptionIRQ_TIMER4(before being grabbed by Adeos). Therefore, we can have more jitter for real time applications.This can always happen even with interrupt priorities: imagine that the first interrupt happens 1 microsecond before the timer interrupt, even with the priority, the handler for first interrupt will be executed and the timer interrupt will have to wait for the end of this handler before it is serviced.
Quoted 1 line
Do we need to fix the priority at this level ?
I do not think so. However, what can be done is implement interrupt controller muting using the priority register, see:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#Priority_based_interrupt_controller_mutingQuoted 7 lines
Quoted 5 lines
The priority register can't be used for implement interrupt controller muting using this method .
The PIC hardware can't be configured with only two priority levels. We are obligated to choose between fixed or "rotation fashion" priority with 32 levels...What prevents us from using the "fixed" priorities, with one level for real-time interrupts and another for non real-time interrupts ?
The priority register is used to configure the arbitration procedure when multiple interrupts occur.
But some interrupt sources always have higher priority than other.For example, EINT0 is always takes priority regardless
INT_RTC, when arrive at the same time.
Whatever the configuration of priority register.
Quoted 6 lines
Quoted 4 lines
When
INT_TIMER4is trigged, the value of priority register is modified. Thus,INT_TIMER4loses its priority for arbitration procedure. That is why I wonder if it is better to fix the priority for arbitration procedure.I don't get it, could you point me to the datasheet?
In the figure 14-1, there is the Priority Generating Block (priority) between IRQ mask and INTPND register. It is detailed in figure 14-2 and its functional principle is explained on the next page. The priority of interrupt source is determined by the configuration of each arbiter.
This configuration is set by the priority register (P 14-13) which is left on initial state by Linux (0x7F). (ARB_MODE = 1 for all arbiter)
"ARB_MODE bit is 1, ARB_SEL bits are changed in rotation fashion, e.g., if REQ1 is serviced, ARB_SEL bits are changed to 01b automatically so as to put REQ1 into the lowest priority"
"Note that REQ0 of an arbiter always has the highest priority, and REQ5 has the lowest one." For example, EINT0 always has the highest priority and INT_ADC has the lowest one.
I suggest to reset ARB_MODE for all arbiter and modify ARB6 (01b) and ARB2 (11b), in order to increase and fix INT_TIMER4's priority'. This is all what we can do with this register. Tell me if I'm wrong.
Regards,
Romain
Quoted 61 lines · Romain Naour
Quoted 40 lines · Gilles Chanteperdrix
Quoted 38 lines · Romain Naour
Quoted 22 lines · Gilles Chanteperdrix
Quoted 21 lines · Romain Naour
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Gilles Chanteperdrix
Quoted 8 lines · Romain Naour
Hello,
On s3c24xx processors the interrupt source priority isn't fixed by Adeos patch (
ARB_SELbits in PRIORITY register).
Is it intentional ?
It may be possible to give priority to an interrupt simultaneously arrived that the interruptionIRQ_TIMER4(before being grabbed by Adeos). Therefore, we can have more jitter for real time applications.This can always happen even with interrupt priorities: imagine that the first interrupt happens 1 microsecond before the timer interrupt, even with the priority, the handler for first interrupt will be executed and the timer interrupt will have to wait for the end of this handler before it is serviced.
Quoted 1 line
Do we need to fix the priority at this level ?
I do not think so. However, what can be done is implement interrupt controller muting using the priority register, see:
http://www.xenomai.org/index.php/I-pipe-core:ArmPorting#Priority_based_interrupt_controller_mutingQuoted 7 lines
Quoted 5 lines
The priority register can't be used for implement interrupt controller muting using this method .
The PIC hardware can't be configured with only two priority levels. We are obligated to choose between fixed or "rotation fashion" priority with 32 levels...What prevents us from using the "fixed" priorities, with one level for real-time interrupts and another for non real-time interrupts ?
The priority register is used to configure the arbitration procedure when multiple interrupts occur.
But some interrupt sources always have higher priority than other.For example, EINT0 is always takes priority regardless
INT_RTC, when arrive at the same time.
Whatever the configuration of priority register.Quoted 6 lines
Quoted 4 lines
When
INT_TIMER4is trigged, the value of priority register is modified. Thus,INT_TIMER4loses its priority for arbitration procedure. That is why I wonder if it is better to fix the priority for arbitration procedure.I don't get it, could you point me to the datasheet?
In the figure 14-1, there is the Priority Generating Block (priority) between IRQ mask and INTPND register.
It is detailed in figure 14-2 and its functional principle is explained on the next page.
The priority of interrupt source is determined by the configuration of each arbiter.
This configuration is set by the priority register (P 14-13) which is left on initial state by Linux (0x7F).
(ARB_MODE= 1 for all arbiter)"
ARB_MODEbit is 1,ARB_SELbits are changed in rotation fashion, e.g., if REQ1 is serviced,ARB_SELbits are changed to 01b automatically so as to put REQ1 into the lowest priority"
Quoted 8 lines
"Note that REQ0 of an arbiter always has the highest priority, and REQ5 has the lowest one."
For example, EINT0 always has the highest priority andINT_ADChas the lowest one.I suggest to reset
ARB_MODEfor all arbiter and modify ARB6 (01b) and ARB2 (11b), in order to increase and fix INT_TIMER4's priority'. This is all what we can do with this register. Tell me if I'm wrong.
Ok, what I asked was for the URL of the datasheet, but I found it. No, you will not gain much with this register, you would better implement interrupt controller muting.
Signature · 1 line
Gilles.