All of lore.kernel.org
 help / color / mirror / Atom feed
* [Adeos-main] [PATCH] ipipe i.MXL freeze's boot
@ 2009-02-25 11:05 Gwenhaël
  2009-02-25 13:06 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Gwenhaël @ 2009-02-25 11:05 UTC (permalink / raw)
  To: adeos-main


With i.MXL processor, kernel patched with
adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer
calibration.
Tick event never appear. This patch modify acktimer() in
arch/arm/mach-imx/time.c.

I need to know if this modification is good (without adding
new errors).

Thank you very much

Gwenhael

Signed-off-by: gwenhael.goavec-merou@domain.hid


---- diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
--- a/arch/arm/mach-imx/irq.c    2009-02-17 11:32:52.000000000 +0100
+++ b/arch/arm/mach-imx/irq.c       2009-02-23 14:12:43.000000000 +0100
@@ -35,7 +35,7 @@
 #include <asm/io.h>
 
 #include <asm/mach/irq.h>
-#include <asm/arch/imx-regs.h>
+#include <mach/imx-regs.h>
 
 
 /* Used for IMX INTERRUPT priority: Still Experimental */ 
diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
--- a/arch/arm/mach-imx/time.c  2009-02-24 15:26:42.000000000 +0100
+++ b/arch/arm/mach-imx/time.c      2009-02-24 15:24:45.000000000 +0100
@@ -294,7 +294,12 @@
 #ifdef CONFIG_IPIPE
 void __ipipe_mach_acktimer(void)
 {  
+  uint32_t tstat;
+  tstat = IMX_TSTAT(TIMER_BASE);
   IMX_TSTAT(TIMER_BASE) = 0;
+  if (likely(tstat & TSTAT_COMP)) {
+    ipipe_mach_update_tsc(void);
+  }
 }
 
 static void ipipe_mach_update_tsc(void)


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

* Re: [Adeos-main] [PATCH] ipipe i.MXL freeze's boot
  2009-02-25 11:05 [Adeos-main] [PATCH] ipipe i.MXL freeze's boot Gwenhaël
@ 2009-02-25 13:06 ` Gilles Chanteperdrix
  2009-02-25 15:09   ` Gwenhaël
  0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2009-02-25 13:06 UTC (permalink / raw)
  To: adeos-main

Gwenhaël wrote:
> With i.MXL processor, kernel patched with
> adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer
> calibration.
> Tick event never appear. This patch modify acktimer() in
> arch/arm/mach-imx/time.c.
> 
> I need to know if this modification is good (without adding
> new errors).

ipipe_mach_update_tsc should be called from imx_timer_interrupt, so,
there is no need to call it from acktimer (and in fact, avoiding the
call to update_tsc in acktimer reduces the timer interrupt latency). So,
maybe what is needed and is missing is simply to read
IMX_TSTAT(TIMER_BASE) ?
-- 
                                                 Gilles.



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

* Re: [Adeos-main] [PATCH] ipipe i.MXL freeze's boot
  2009-02-25 13:06 ` Gilles Chanteperdrix
@ 2009-02-25 15:09   ` Gwenhaël
  2009-02-25 15:14     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Gwenhaël @ 2009-02-25 15:09 UTC (permalink / raw)
  To: adeos-main


On Wed, 25 Feb 2009 14:06:14 +0100, Gilles Chanteperdrix
<gilles.chanteperdrix@xenomai.org> wrote:
> Gwenhaël wrote:
>> With i.MXL processor, kernel patched with
>> adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer
>> calibration.
>> Tick event never appear. This patch modify acktimer() in
>> arch/arm/mach-imx/time.c.
>> 
>> I need to know if this modification is good (without adding
>> new errors).
> 
> ipipe_mach_update_tsc should be called from imx_timer_interrupt, so,
> there is no need to call it from acktimer (and in fact, avoiding the
> call to update_tsc in acktimer reduces the timer interrupt latency). So,
> maybe what is needed and is missing is simply to read
> IMX_TSTAT(TIMER_BASE) ?

I've made modifications on patch thanks to your assumption. 
The new patch work fine.

Thank you very much

Gwenhael

Signed-off-by: gwenhael.goavec-merou@domain.hid


diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
--- a/arch/arm/mach-imx/irq.c    2009-02-17 11:32:52.000000000 +0100
+++ b/arch/arm/mach-imx/irq.c       2009-02-23 14:12:43.000000000 +0100
@@ -35,7 +35,7 @@
 #include <asm/io.h>
 
 #include <asm/mach/irq.h>
-#include <asm/arch/imx-regs.h>
+#include <mach/imx-regs.h>
 
 
 /* Used for IMX INTERRUPT priority: Still Experimental */ 
diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
--- a/arch/arm/mach-imx/time.c	2009-02-25 15:10:01.000000000 +0100
+++ b/arch/arm/mach-imx/time.c	2009-02-25 15:10:49.000000000 +0100
@@ -89,25 +89,23 @@
 imx_timer_interrupt(int irq, void *dev_id)
 {
 	struct clock_event_device *evt = &clockevent_imx;
-#ifndef CONFIG_IPIPE
 	uint32_t tstat;
 	irqreturn_t ret = IRQ_NONE;
 
 	/* clear the interrupt */
 	tstat = IMX_TSTAT(TIMER_BASE);
+#ifndef CONFIG_IPIPE
 	IMX_TSTAT(TIMER_BASE) = 0;
+#endif
 	if (tstat & TSTAT_COMP) {
+#ifdef CONFIG_IPIPE
 		ipipe_mach_update_tsc();
+#endif
 		evt->event_handler(evt);
 		ret = IRQ_HANDLED;
 	}
 
 	return ret;
-#else /* CONFIG_IPIPE */
-	ipipe_mach_update_tsc();
-	evt->event_handler(evt);
-	return  IRQ_HANDLED;
-#endif /* CONFIG_IPIPE */
 }
 
 static struct irqaction imx_timer_irq = {




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

* Re: [Adeos-main] [PATCH] ipipe i.MXL freeze's boot
  2009-02-25 15:09   ` Gwenhaël
@ 2009-02-25 15:14     ` Gilles Chanteperdrix
  2009-02-26 16:33       ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2009-02-25 15:14 UTC (permalink / raw)
  To: adeos-main

Gwenhaël wrote:
> On Wed, 25 Feb 2009 14:06:14 +0100, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>> Gwenhaël wrote:
>>> With i.MXL processor, kernel patched with
>>> adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer
>>> calibration.
>>> Tick event never appear. This patch modify acktimer() in
>>> arch/arm/mach-imx/time.c.
>>>
>>> I need to know if this modification is good (without adding
>>> new errors).
>> ipipe_mach_update_tsc should be called from imx_timer_interrupt, so,
>> there is no need to call it from acktimer (and in fact, avoiding the
>> call to update_tsc in acktimer reduces the timer interrupt latency). So,
>> maybe what is needed and is missing is simply to read
>> IMX_TSTAT(TIMER_BASE) ?
> 
> I've made modifications on patch thanks to your assumption. 
> The new patch work fine.
> 
> Thank you very much
> 
> Gwenhael
> 
> Signed-off-by: gwenhael.goavec-merou@domain.hid
> 
> 
> diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
> --- a/arch/arm/mach-imx/irq.c    2009-02-17 11:32:52.000000000 +0100
> +++ b/arch/arm/mach-imx/irq.c       2009-02-23 14:12:43.000000000 +0100
> @@ -35,7 +35,7 @@
>  #include <asm/io.h>
>  
>  #include <asm/mach/irq.h>
> -#include <asm/arch/imx-regs.h>
> +#include <mach/imx-regs.h>
>  
>  
>  /* Used for IMX INTERRUPT priority: Still Experimental */ 
> diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
> --- a/arch/arm/mach-imx/time.c	2009-02-25 15:10:01.000000000 +0100
> +++ b/arch/arm/mach-imx/time.c	2009-02-25 15:10:49.000000000 +0100
> @@ -89,25 +89,23 @@
>  imx_timer_interrupt(int irq, void *dev_id)
>  {
>  	struct clock_event_device *evt = &clockevent_imx;
> -#ifndef CONFIG_IPIPE
>  	uint32_t tstat;
>  	irqreturn_t ret = IRQ_NONE;
>  
>  	/* clear the interrupt */
>  	tstat = IMX_TSTAT(TIMER_BASE);
> +#ifndef CONFIG_IPIPE
>  	IMX_TSTAT(TIMER_BASE) = 0;
> +#endif
>  	if (tstat & TSTAT_COMP) {
> +#ifdef CONFIG_IPIPE
>  		ipipe_mach_update_tsc();
> +#endif
>  		evt->event_handler(evt);
>  		ret = IRQ_HANDLED;
>  	}
>  
>  	return ret;
> -#else /* CONFIG_IPIPE */
> -	ipipe_mach_update_tsc();
> -	evt->event_handler(evt);
> -	return  IRQ_HANDLED;
> -#endif /* CONFIG_IPIPE */
>  }
>  
>  static struct irqaction imx_timer_irq = {

No, that is still wrong. You should read IMX_TSTAT(TIMER_BASE) in
acktimer not in linux timer interrupt. When running with xenomai, the
linux timer interrupt is a virtual interrupt and should not touch hardware.

-- 
                                                 Gilles.



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

* Re: [Adeos-main] [PATCH] ipipe i.MXL freeze's boot
  2009-02-25 15:14     ` Gilles Chanteperdrix
@ 2009-02-26 16:33       ` Gilles Chanteperdrix
  2009-02-27 21:23         ` gwenhael.goavec
  0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2009-02-26 16:33 UTC (permalink / raw)
  To: adeos-main, Gwenhaël

Gilles Chanteperdrix wrote:
> Gwenhaël wrote:
>> On Wed, 25 Feb 2009 14:06:14 +0100, Gilles Chanteperdrix
>> <gilles.chanteperdrix@xenomai.org> wrote:
>>> Gwenhaël wrote:
>>>> With i.MXL processor, kernel patched with
>>>> adeos-2.6.27-ipipe-1.12-00.patch wait indefinitly for timer
>>>> calibration.
>>>> Tick event never appear. This patch modify acktimer() in
>>>> arch/arm/mach-imx/time.c.
>>>>
>>>> I need to know if this modification is good (without adding
>>>> new errors).
>>> ipipe_mach_update_tsc should be called from imx_timer_interrupt, so,
>>> there is no need to call it from acktimer (and in fact, avoiding the
>>> call to update_tsc in acktimer reduces the timer interrupt latency). So,
>>> maybe what is needed and is missing is simply to read
>>> IMX_TSTAT(TIMER_BASE) ?
>> I've made modifications on patch thanks to your assumption. 
>> The new patch work fine.
>>
>> Thank you very much
>>
>> Gwenhael
>>
>> Signed-off-by: gwenhael.goavec-merou@domain.hid
>>
>>
>> diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
>> --- a/arch/arm/mach-imx/irq.c    2009-02-17 11:32:52.000000000 +0100
>> +++ b/arch/arm/mach-imx/irq.c       2009-02-23 14:12:43.000000000 +0100
>> @@ -35,7 +35,7 @@
>>  #include <asm/io.h>
>>  
>>  #include <asm/mach/irq.h>
>> -#include <asm/arch/imx-regs.h>
>> +#include <mach/imx-regs.h>
>>  
>>  
>>  /* Used for IMX INTERRUPT priority: Still Experimental */ 
>> diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
>> --- a/arch/arm/mach-imx/time.c	2009-02-25 15:10:01.000000000 +0100
>> +++ b/arch/arm/mach-imx/time.c	2009-02-25 15:10:49.000000000 +0100
>> @@ -89,25 +89,23 @@
>>  imx_timer_interrupt(int irq, void *dev_id)
>>  {
>>  	struct clock_event_device *evt = &clockevent_imx;
>> -#ifndef CONFIG_IPIPE
>>  	uint32_t tstat;
>>  	irqreturn_t ret = IRQ_NONE;
>>  
>>  	/* clear the interrupt */
>>  	tstat = IMX_TSTAT(TIMER_BASE);
>> +#ifndef CONFIG_IPIPE
>>  	IMX_TSTAT(TIMER_BASE) = 0;
>> +#endif
>>  	if (tstat & TSTAT_COMP) {
>> +#ifdef CONFIG_IPIPE
>>  		ipipe_mach_update_tsc();
>> +#endif
>>  		evt->event_handler(evt);
>>  		ret = IRQ_HANDLED;
>>  	}
>>  
>>  	return ret;
>> -#else /* CONFIG_IPIPE */
>> -	ipipe_mach_update_tsc();
>> -	evt->event_handler(evt);
>> -	return  IRQ_HANDLED;
>> -#endif /* CONFIG_IPIPE */
>>  }
>>  
>>  static struct irqaction imx_timer_irq = {
> 
> No, that is still wrong. You should read IMX_TSTAT(TIMER_BASE) in
> acktimer not in linux timer interrupt. When running with xenomai, the
> linux timer interrupt is a virtual interrupt and should not touch hardware.
> 

Hi Gwenhaël,

any news about this issue ?

Regards.

-- 
                                                 Gilles.



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

* Re: [Adeos-main] [PATCH] ipipe i.MXL freeze's boot
  2009-02-26 16:33       ` Gilles Chanteperdrix
@ 2009-02-27 21:23         ` gwenhael.goavec
  0 siblings, 0 replies; 6+ messages in thread
From: gwenhael.goavec @ 2009-02-27 21:23 UTC (permalink / raw)
  To: adeos-main

On Thu, 26 Feb 2009 17:33:12 +0100
Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
wrote:
> > 
> 
> Hi Gwenhaël,
> 
> any news about this issue ?
> 
> Regards.
> 
> -- 
>                                                  Gilles.
> 

Yes,
I'm sorry for the late.
This patch seem correct for the Adeos i'MXL support.
The first part is only usefull for 2.6.27 and 2.6.28.
The second part is for 2.6.2{6,7,8}

Regards

Gwenhaël

Signed-off-by: gwenhael.goavec-merou@domain.hid

diff -ru a/arch/arm/mach-imx/irq.c b/arch/arm/mach-imx/irq.c
--- a/arch/arm/mach-imx/irq.c    2009-02-17 11:32:52.000000000 +0100
+++ b/arch/arm/mach-imx/irq.c       2009-02-23 14:12:43.000000000 +0100
@@ -35,7 +35,7 @@
 #include <asm/io.h>
 
 #include <asm/mach/irq.h>
-#include <asm/arch/imx-regs.h>
+#include <mach/imx-regs.h>
 
 
 /* Used for IMX INTERRUPT priority: Still Experimental */ 
diff -ru a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
--- a/arch/arm/mach-imx/time.c	2009-02-25 17:03:34.000000000 +0100
+++ b/arch/arm/mach-imx/time.c	2009-02-25 16:36:16.000000000 +0100
@@ -294,6 +294,8 @@
 #ifdef CONFIG_IPIPE
 void __ipipe_mach_acktimer(void)
 {
+	uint32_t tstat;
+	tstat = IMX_TSTAT(TIMER_BASE);
 	IMX_TSTAT(TIMER_BASE) = 0;
 }
 

 


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

end of thread, other threads:[~2009-02-27 21:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-25 11:05 [Adeos-main] [PATCH] ipipe i.MXL freeze's boot Gwenhaël
2009-02-25 13:06 ` Gilles Chanteperdrix
2009-02-25 15:09   ` Gwenhaël
2009-02-25 15:14     ` Gilles Chanteperdrix
2009-02-26 16:33       ` Gilles Chanteperdrix
2009-02-27 21:23         ` gwenhael.goavec

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.