Don't call __ipipe_mach_set_dec in rthal_timer_release directly
Subsystems (3)
PATCH 1/1 Don't call __ipipe_mach_set_dec in rthal_timer_release directly
Hi,
here's a proposal for a minor change in the I-pipe implementation for ARM. Since it is required for my S3C24xx patch not to call __ipipe_mach_set_dec directly when the timer is released by the Xenomai domain I suggest the following changes. The patch comprises the necessary modifications for PXA, SA1100 and Integrator, too.
Comments or objections?
--
Sebastian
arch/arm/mach-integrator/core.c +6 -0
@@ -330,6 +330,12 @@ void __ipipe_mach_set_dec(unsigned long }EXPORT_SYMBOL (__ipipe_mach_set_dec); +void __ipipe_mach_release_timer (void ) +{ +__ipipe_mach_set_dec (__ipipe_mach_ticks_per_jiffy); +} +EXPORT_SYMBOL (__ipipe_mach_release_timer); +unsigned long __ipipe_mach_get_dec (void ) {return readl (TIMER1_VA_BASE +TIMER_VALUE );
arch/arm/mach-pxa/time.c +6 -0
@@ -324,6 +324,12 @@ void __ipipe_mach_set_dec(unsigned long }EXPORT_SYMBOL (__ipipe_mach_set_dec); +void __ipipe_mach_release_timer (void ) +{ +__ipipe_mach_set_dec (__ipipe_mach_ticks_per_jiffy); +} +EXPORT_SYMBOL (__ipipe_mach_release_timer); +unsigned long __ipipe_mach_get_dec (void ) {return OSMR0 -OSCR ;
arch/arm/mach-sa1100/time.c +6 -0
@@ -314,6 +314,12 @@ void __ipipe_mach_set_dec(unsigned long }EXPORT_SYMBOL (__ipipe_mach_set_dec); +void __ipipe_mach_release_timer (void ) +{ +__ipipe_mach_set_dec (__ipipe_mach_ticks_per_jiffy); +} +EXPORT_SYMBOL (__ipipe_mach_release_timer); +unsigned long __ipipe_mach_get_dec (void ) {return OSMR0 -OSCR ;
include/asm-arm/ipipe.h +1 -0
@@ -117,6 +117,7 @@ extern unsigned int __ipipe_mach_ticks_pextern void __ipipe_mach_acktimer (void );extern unsigned long long __ipipe_mach_get_tsc (void );extern void __ipipe_mach_set_dec (unsigned long ); +extern void __ipipe_mach_release_timer (void );extern unsigned long __ipipe_mach_get_dec (void );extern void __ipipe_mach_demux_irq (unsigned irq,struct pt_regs *regs);
arch/arm/hal.c +1 -1
@@ -94,7 +94,7 @@if (rthal_periodic_p)rthal_reset_timer ();else -__ipipe_mach_set_dec (__ipipe_mach_ticks_per_jiffy); +__ipipe_mach_release_timer ();rthal_irq_release (RTHAL_TIMER_IRQ );
Quoted 9 lines · Sebastian Smolorz
Hi,
here's a proposal for a minor change in the I-pipe implementation for ARM. Since it is required for my S3C24xx patch not to call
__ipipe_mach_set_decdirectly when the timer is released by the Xenomai domain I suggest the following changes. The patch comprises the necessary modifications for PXA, SA1100 and Integrator, too.Comments or objections?
Why can not you call __ipipe_mach_set_dec directly when the timer is released ?
Signature · 1 line
Gilles Chanteperdrix
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Sebastian Smolorz
Hi,
here's a proposal for a minor change in the I-pipe implementation for ARM. Since it is required for my S3C24xx patch not to call
__ipipe_mach_set_decdirectly when the timer is released by the Xenomai domain I suggest the following changes. The patch comprises the necessary modifications for PXA, SA1100 and Integrator, too.
Quoted 4 lines
Quoted 1 line
Comments or objections?
Why can not you call
__ipipe_mach_set_decdirectly when the timer is released ?
The timer used for generating interrupts operates in auto-reloading mode when it is under Linux control. But when Xenomai reloads the timer the mode of operation is one-shot (auto-reload feature in hardware is off). So I have to make a distinction between setting the dec value by Xenomai for programming the next period and setting the dec value to __ipipe_mach_ticks_per_jiffy when the timer control is given back to Linux.
The reason for this is the fact that programming a timer on the S3C24xx can take some ticks which means that these ticks aren't count whereas time is going on in the real world. So it is more reasonable to let the timer reload itself when Xenomai hasn't started it. Setting __ipipe_mach_ticks_per_jiffy in the Linux interrupt handler would make every period last some ticks longer.
--
Sebastian
Quoted 25 lines · Sebastian Smolorz
Quoted 10 lines · Gilles Chanteperdrix
Quoted 8 lines · Sebastian Smolorz
Hi,
here's a proposal for a minor change in the I-pipe implementation for ARM. Since it is required for my S3C24xx patch not to call
__ipipe_mach_set_decdirectly when the timer is released by the Xenomai domain I suggest the following changes. The patch comprises the necessary modifications for PXA, SA1100 and Integrator, too.Quoted 4 lines
Quoted 1 line
Comments or objections?
Why can not you call
__ipipe_mach_set_decdirectly when the timer is released ?The timer used for generating interrupts operates in auto-reloading mode when it is under Linux control. But when Xenomai reloads the timer the mode of operation is one-shot (auto-reload feature in hardware is off). So I have to make a distinction between setting the dec value by Xenomai for programming the next period and setting the dec value to
__ipipe_mach_ticks_per_jiffywhen the timer control is given back to Linux.
Quoted 6 lines
The reason for this is the fact that programming a timer on the S3C24xx can take some ticks which means that these ticks aren't count whereas time is going on in the real world. So it is more reasonable to let the timer reload itself when Xenomai hasn't started it. Setting
__ipipe_mach_ticks_per_jiffyin the Linux interrupt handler would make every period last some ticks longer.
You can avoid this problem by adding LATCH or __ipipe_mach_ticks_per_jiffy to the current value of the match register in the timer interrupt, as it is done for the SA and PXA architectures.
Signature · 1 line
Gilles Chanteperdrix
Quoted 31 lines · Gilles Chanteperdrix
Quoted 23 lines · Sebastian Smolorz
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Sebastian Smolorz
Hi,
here's a proposal for a minor change in the I-pipe implementation for ARM. Since it is required for my S3C24xx patch not to call
__ipipe_mach_set_decdirectly when the timer is released by the Xenomai domain I suggest the following changes. The patch comprises the necessary modifications for PXA, SA1100 and Integrator, too.Quoted 4 lines
Quoted 1 line
Comments or objections?
Why can not you call
__ipipe_mach_set_decdirectly when the timer is released ?The timer used for generating interrupts operates in auto-reloading mode when it is under Linux control. But when Xenomai reloads the timer the mode of operation is one-shot (auto-reload feature in hardware is off). So I have to make a distinction between setting the dec value by Xenomai for programming the next period and setting the dec value to
__ipipe_mach_ticks_per_jiffywhen the timer control is given back to Linux.Quoted 6 lines
The reason for this is the fact that programming a timer on the S3C24xx can take some ticks which means that these ticks aren't count whereas time is going on in the real world. So it is more reasonable to let the timer reload itself when Xenomai hasn't started it. Setting
__ipipe_mach_ticks_per_jiffyin the Linux interrupt handler would make every period last some ticks longer.
Quoted 3 lines
You can avoid this problem by adding LATCH or
__ipipe_mach_ticks_per_jiffyto the current value of the match register in the timer interrupt, as it is done for the SA and PXA architectures.
Unfortunately, this solution is not applicable. The timers of PXA and SA are counting up whereas the S3C24xx timers are counting down to zero. There is no match register for the next interrupt. In contrast, the timer must be programmed with the new dec value directly, thus stopping it for the time of re-programming.
--
Sebastian
Quoted 11 lines · Sebastian Smolorz
Quoted 3 lines · Gilles Chanteperdrix
You can avoid this problem by adding LATCH or
__ipipe_mach_ticks_per_jiffyto the current value of the match register in the timer interrupt, as it is done for the SA and PXA architectures.Unfortunately, this solution is not applicable. The timers of PXA and SA are counting up whereas the S3C24xx timers are counting down to zero. There is no match register for the next interrupt. In contrast, the timer must be programmed with the new dec value directly, thus stopping it for the time of re-programming.
Right, you are in the same case as the integrator platform.
Signature · 1 line
Gilles Chanteperdrix
Quoted 6 lines · Gilles Chanteperdrix
Quoted 5 lines · Sebastian Smolorz
Quoted 3 lines · Gilles Chanteperdrix
You can avoid this problem by adding LATCH or
__ipipe_mach_ticks_per_jiffyto the current value of the match register in the timer interrupt, as it is done for the SA and PXA architectures.
Quoted 7 lines
Quoted 5 lines
Unfortunately, this solution is not applicable. The timers of PXA and SA are counting up whereas the S3C24xx timers are counting down to zero. There is no match register for the next interrupt. In contrast, the timer must be programmed with the new dec value directly, thus stopping it for the time of re-programming.
Right, you are in the same case as the integrator platform.
Yes. But I cannot adopt the integrator's re-programming of the timer in the Linux timer interrupt handler because this would lead to lost ticks or rather to longer periods. Therefore I proposed the patch.
--
Sebastian