2011-04-26 09:34:10     bfin_simple_timer start issue

Document created by Aaronwu Employee on Aug 27, 2013
Version 1Show Document
  • View in full screen mode

2011-04-26 09:34:10     bfin_simple_timer start issue

Chandrashekhar Lavania (INDIA)

Message: 100168   

 

Hi,

 

I am using a BF527 based board, TLL6527M. I wrote a simple app to test timer operation using bfin_simple_timer. The app works fine but there are some issues. Here is what I did:

 

1. I loaded the module using modprobe bfin_simple_timer

 

Result -> Entries for timer appear in /dev as /dev/timer0 to /dev/timer7 . Also a Read Only file is created as /proc/bfin_simple_timer

 

2. Executed my app.

 

Result -> Timer failed to start. In /proc/bfin_simple_timer all values are zero.

 

3. Waited for... a minute I guess...Re Executed my app

 

Result -> This time I get non zero values in /proc/bfin_simple_timer

 

For each subsequent execution of my app, the timer values were incremented by almost the same amount, which is correct.

 

 

 

This happens whenever I restart my system and need to load the bfin_simple_timer module.

 

What might be the cause of this lag?

 

Regards,

 

Shekhar

 

PS: I am using 2010R1-RC5

QuoteReplyEditDelete

 

 

2011-04-26 22:39:55     Re: bfin_simple_timer start issue

Aaron Wu (CHINA)

Message: 100181   

 

Could you attache your test app code?

QuoteReplyEditDelete

 

 

2011-04-27 01:29:10     Re: bfin_simple_timer start issue

Sonic Zhang (CHINA)

Message: 100182   

 

When you say "Timer failed to start", what is the error number or message?

QuoteReplyEditDelete

 

 

2011-04-27 02:34:37     Re: bfin_simple_timer start issue

Chandrashekhar Lavania (INDIA)

Message: 100183   

 

Hi,

 

No error message.......I have my app in a while loop which only exits after 10 timer interrupts (ticks value in /proc/bfin_simple_timer).

 

It just hangs there as the timer value doesent get incremented. I aborted the application and checked the values in /proc/bfin_simple_timer....they were all zeros.

 

If I remove the loop then the app just exits, without any change in timer values. I also added a sleep between start and stop, but still no difference. That lag is still there.

 

Also if we look at drivers/char/bfin_simple_timer.c  :: The ioctl function returns an error( -EINVAL) only if a wrong ioctl command was fed to it.

 

Regards,

 

Shekhar

 

QuoteReplyEditDelete

 

 

2011-04-27 03:17:49     Re: bfin_simple_timer start issue

Sonic Zhang (CHINA)

Message: 100189   

 

Please attach you test application.

QuoteReplyEditDelete

 

 

2011-04-27 06:52:08     Re: bfin_simple_timer start issue

Chandrashekhar Lavania (INDIA)

Message: 100201   

 

Hi,

 

I have attached my test app. The executable was called Simple_Timer_Test_V1_0 .

 

This gave me the following results::

 

 

 

root:/home> modprobe bfin_simple_timer                                         

root:/home> ./Simple_Timer_Test_V1_0                                           

Timer Value = 0                                                                

root:/home> ./Simple_Timer_Test_V1_0                                           

Timer Value = 212                                                              

root:/home> ./Simple_Timer_Test_V1_0                                           

Timer Value = 424                                                              

root:/home> ./Simple_Timer_Test_V1_0                                           

Timer Value = 637                                                              

root:/home> ./Simple_Timer_Test_V1_0                                           

Timer Value = 847                                                              

root:/home>

 

As can be seen....apart from the first execution, all subsequent executions incremented the timer value by roughly 212 ticks.

For The first execution, there was no increment in the timer values.

 

At this stage the /proc/bfin_simple_timer looks as follows::

 

root:/home> cat /proc/bfin_simple_timer                                        

timer  0 isr count: 847                                                        

timer  1 isr count: 0                                                          

timer  2 isr count: 0                                                          

timer  3 isr count: 0                                                          

timer  4 isr count: 0                                                          

timer  5 isr count: 0                                                          

timer  6 isr count: 0                                                          

timer  7 isr count: 0                                                          

root:/home>

 

Regards,

Shekhar

 

PS : Instead of a loop to generate delay I used usleep this time.

 

main.c

bfin_simple_timer.h

QuoteReplyEditDelete

 

 

2011-04-27 23:18:55     Re: bfin_simple_timer start issue

Aaron Wu (CHINA)

Message: 100220   

 

Did not see obvious mistake in your code or the timer driver/generic timer code, I compiled your code and it seems to work fine, timer is opend and started first time your apps runs. I reboot the board and tried a few times like this, following is the log. I am running this on a BF537 ezkit board with 2010R1 release.

 

root:/> tftp -g -r timer_test 10.99.29.99

root:/> chmod a+x timer_test

root:/> cat /proc/bfin_simple_timer

timer  0 isr count: 0

timer  1 isr count: 0

timer  2 isr count: 0

timer  3 isr count: 0

timer  4 isr count: 0

timer  5 isr count: 0

timer  6 isr count: 0

timer  7 isr count: 0

root:/> ./timer_test

Timer Value = 201

root:/> cat /proc/bfin_simple_timer

timer  0 isr count: 201

timer  1 isr count: 0

timer  2 isr count: 0

timer  3 isr count: 0

timer  4 isr count: 0

timer  5 isr count: 0

timer  6 isr count: 0

timer  7 isr count: 0

QuoteReplyEditDelete

 

 

2011-04-27 23:42:32     Re: bfin_simple_timer start issue

Aaron Wu (CHINA)

Message: 100221   

 

However on a BF527 ezkit we do find a problem like yours, will keep you updated.

 

root:/> ./timer_test

Timer Value = 0

root:/> cat /proc/bfin_simple_timer

timer  0 isr count: 0

timer  1 isr count: 0

timer  2 isr count: 0

timer  3 isr count: 0

timer  4 isr count: 0

timer  5 isr count: 0

timer  6 isr count: 0

timer  7 isr count: 0

QuoteReplyEditDelete

 

 

2011-04-28 01:35:27     Re: bfin_simple_timer start issue

Aaron Wu (CHINA)

Message: 100222   

 

Other timers like timer 2 has no this problem on 527, you may use other timers first.

QuoteReplyEditDelete

 

 

2011-07-19 15:21:52     Re: bfin_simple_timer start issue

Mike Frysinger (UNITED STATES)

Message: 102541   

 

has a tracker item been filed for this ?  i dont see any ...

Attachments

Outcomes