Skip to contentSkip to conversation

Sleep in rtdm driver

Xenomai-help robert165 2 participants 3 messages Mar 18, 2010 – Mar 19, 2010

lore
Share & tools
lore

robert165

author
#0 lore raw

Hi,

Quoted 13 lines · 在2010-03-18 00:19:47,"Philippe Gerum" <[email protected]> 写道:
Quoted 11 lines · On Wed, 2010-03-17 at 22:07 +0800, robert165 wrote:

Hi everyone!

I'm writing a gpio driver in RTDM. I start it with the demo "Hard real time RTDM driver skeleton v1.1" of Jan Kiszka.
If I used rtdm_task_sleep in rt_ioctrl function, it return that "Xenomai: assertion failed at kernel/xenomai/skins/rtdm/drvlib.c:372 (!xnpod_unblockable_p())" when running.
It is said that rtdm_task_sleep can be called from Kernel-based task. Why I can't use it in my driver. Optionally, I can do this in user-space by periodic calling the driver, but it seems slower than in kernel space.

Quoted 1 line

I'm puzzled: what does "slower" mean, regarding what operation?

I am sorry, I means is it more effective if doing things in kernel space. I think when periodic calling driver in user-space, it may spent more in context switching. Thanks a lot.

#1 lore raw
Quoted 17 lines · robert165 wrote:

Hi,

Quoted 12 lines · 在2010-03-18 00:19:47,"Philippe Gerum" <[email protected]> 写道:
Quoted 11 lines · On Wed, 2010-03-17 at 22:07 +0800, robert165 wrote:

Hi everyone!

I'm writing a gpio driver in RTDM. I start it with the demo "Hard real time RTDM driver skeleton v1.1" of Jan Kiszka.
If I used rtdm_task_sleep in rt_ioctrl function, it return that "Xenomai: assertion failed at kernel/xenomai/skins/rtdm/drvlib.c:372 (!xnpod_unblockable_p())" when running.
It is said that rtdm_task_sleep can be called from Kernel-based task. Why I can't use it in my driver. Optionally, I can do this in user-space by periodic calling the driver, but it seems slower than in kernel space.

Quoted 2 lines
Quoted 1 line

I'm puzzled: what does "slower" mean, regarding what operation?

I am sorry, I means is it more effective if doing things in kernel space. I think when periodic calling driver in user-space, it may spent more in context switching.

If you really depend on this minor difference, you are already designing with a too small safety margin.

Have you measured the differences and compared them to your requirements?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
author
#2 lore raw
Quoted 18 lines · 在2010-03-18 23:18:55,"Jan Kiszka" <[email protected]> 写道:
Quoted 17 lines · robert165 wrote:

Hi,

Quoted 12 lines · 在2010-03-18 00:19:47,"Philippe Gerum" <[email protected]> 写道:
Quoted 11 lines · On Wed, 2010-03-17 at 22:07 +0800, robert165 wrote:

Hi everyone!

I'm writing a gpio driver in RTDM. I start it with the demo "Hard real time RTDM driver skeleton v1.1" of Jan Kiszka.
If I used rtdm_task_sleep in rt_ioctrl function, it return that "Xenomai: assertion failed at kernel/xenomai/skins/rtdm/drvlib.c:372 (!xnpod_unblockable_p())" when running.
It is said that rtdm_task_sleep can be called from Kernel-based task. Why I can't use it in my driver. Optionally, I can do this in user-space by periodic calling the driver, but it seems slower than in kernel space.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

I'm puzzled: what does "slower" mean, regarding what operation?

I am sorry, I means is it more effective if doing things in kernel space. I think when periodic calling driver in user-space, it may spent more in context switching.

If you really depend on this minor difference, you are already designing with a too small safety margin.

Have you measured the differences and compared them to your requirements?

No, the difference is not so important. I just want to kown the the reason why I got the error message that you have explained to me clearly. Thanks for help!