Re: [Xenomai-core] rtdm timer questions

2009-03-12 Thread Steven Seeger
> Be careful with volatile variables: Unless they refer to hardware- 
> backed
> data (MMIO), you may just happen to write racy lock-less code - or the
> volatile is useless anyway.

Yes that is true. In this case, however, writes are atomic (just 0 or  
1) and even if something happens the "mode of failure" will be a  
missed 125us cycle of sound output. I doubt anyone would hear just one.

Steven


___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] rtdm timer questions

2009-03-12 Thread Jan Kiszka
Steven Seeger wrote:
> I think I see what my problem is with the driver. The flag that is
> holding off the extra starts is stupidly not set to volatile. Oops. I'll
> report back with results later.

Be careful with volatile variables: Unless they refer to hardware-backed
data (MMIO), you may just happen to write racy lock-less code - or the
volatile is useless anyway.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] rtdm timer questions

2009-03-12 Thread Steven Seeger
I think I see what my problem is with the driver. The flag that is  
holding off the extra starts is stupidly not set to volatile. Oops.  
I'll report back with results later.

Thanks,
Steven


___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] rtdm timer questions

2009-03-12 Thread Steven Seeger
> Not explicitly specified, but the existing timer will be stopped first
> and then newly started.

I should see if we are doing that, then. We are loading bytes into a  
buffer and calling start if we need to call it. Perhaps the logic is  
incorrect.

> "...start ... in 2 ms" sounds a bit like TIMERMODE_RELATIVE, no? :)

Yes I made this same mistake when I first wrote the driver. The  
version we are having issues with does say RELATIVE. I am still  
adjusting to a new time zone, so I use that as my excuse. :)

Steven

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] rtdm timer questions

2009-03-12 Thread Jan Kiszka
Steven Seeger wrote:
> I will ask Mark to run the klatency -t 2 test. I do not have a system  
> or even a piece of a system right now so I can't run anything. Sorry. :(
> 
> What happens if I call start on a timer that is already running? Will  

Not explicitly specified, but the existing timer will be stopped first
and then newly started.

> it change the timing at all or ignore the start?
> 
> Is this correct:
> 
> rtdm_timer_start(&timer, 200, 125000, RTDM_TIMERMODE_ABSOLUTE);
> 
> The behavior I want is to start my timer in 2ms and have it fire every  

"...start ... in 2 ms" sounds a bit like TIMERMODE_RELATIVE, no? :)

> 125us. The timer itself will use rtdm_timer_stop_in_handler() to stop  
> itself.
> 
> Am I making any mistakes here?
> 
> Steven
> 

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] rtdm timer questions

2009-03-12 Thread Steven Seeger
I will ask Mark to run the klatency -t 2 test. I do not have a system  
or even a piece of a system right now so I can't run anything. Sorry. :(

What happens if I call start on a timer that is already running? Will  
it change the timing at all or ignore the start?

Is this correct:

rtdm_timer_start(&timer, 200, 125000, RTDM_TIMERMODE_ABSOLUTE);

The behavior I want is to start my timer in 2ms and have it fire every  
125us. The timer itself will use rtdm_timer_stop_in_handler() to stop  
itself.

Am I making any mistakes here?

Steven

On Mar 12, 2009, at 7:12 AM, Gilles Chanteperdrix wrote:

> Steven Seeger wrote:
>> Is an RTDM timer going to run at a priority higher than any scheduled
>> realtime thread?
>>
>> How accurate is the timing?
>>
>> We are seeing the timer running at 125us periodic rate being called
>> much too quickly. At least, I think we are. I can't personally use
>> anything for a little over a week.
>
> Yes a timer runs in interrupt context. This is the same design as  
> Linux,
> VxWorks, RTLinux, RTAI and most known OSes.
>
> I do not understand what you mean by "too quickly", but do you get the
> same phenomenon with the klatency -t 2 test?
>
> -- 
> Gilles.


___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] rtdm timer questions

2009-03-12 Thread Gilles Chanteperdrix
Steven Seeger wrote:
> Is an RTDM timer going to run at a priority higher than any scheduled  
> realtime thread?
> 
> How accurate is the timing?
> 
> We are seeing the timer running at 125us periodic rate being called  
> much too quickly. At least, I think we are. I can't personally use  
> anything for a little over a week.

Yes a timer runs in interrupt context. This is the same design as Linux,
VxWorks, RTLinux, RTAI and most known OSes.

I do not understand what you mean by "too quickly", but do you get the
same phenomenon with the klatency -t 2 test?

-- 
 Gilles.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


[Xenomai-core] rtdm timer questions

2009-03-12 Thread Steven Seeger
Is an RTDM timer going to run at a priority higher than any scheduled  
realtime thread?

How accurate is the timing?

We are seeing the timer running at 125us periodic rate being called  
much too quickly. At least, I think we are. I can't personally use  
anything for a little over a week.

Thanks,
Steven


___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core