* [Xenomai-help] Sleep in rtdm driver
2010-02-07 21:27 ` Alexis Berlemont
@ 2010-03-17 14:07 ` robert165
2010-03-17 15:05 ` Jan Kiszka
2010-03-17 16:19 ` Philippe Gerum
0 siblings, 2 replies; 7+ messages in thread
From: robert165 @ 2010-03-17 14:07 UTC (permalink / raw)
To: xenomai-help
[-- Attachment #1: Type: text/plain, Size: 571 bytes --]
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.
Thank you very much!
Best regards
Luo
[-- Attachment #2: Type: text/html, Size: 802 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] Sleep in rtdm driver
2010-03-17 14:07 ` [Xenomai-help] Sleep in rtdm driver robert165
@ 2010-03-17 15:05 ` Jan Kiszka
2010-03-18 8:33 ` robert165
2010-03-17 16:19 ` Philippe Gerum
1 sibling, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2010-03-17 15:05 UTC (permalink / raw)
To: robert165; +Cc: xenomai-help
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.
The terms "kernel-based task" or "user space task" can be misleading.
This services requires a real-time task context. That can either be a
kernel-based *RT* task or a Xenomai shadow (aka *RT*) task in user space
that has invoked some driver service, and that driver can then call
rtdm_task_sleep on behalf of the user space task.
Blocking RTDM service *must not* be called by ordinary Linux kernel
threads or on behalf of ordinary (non-shadowed) Linux user space
threads. That's why the assertion failed for you.
HTH,
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] Sleep in rtdm driver
2010-03-17 14:07 ` [Xenomai-help] Sleep in rtdm driver robert165
2010-03-17 15:05 ` Jan Kiszka
@ 2010-03-17 16:19 ` Philippe Gerum
1 sibling, 0 replies; 7+ messages in thread
From: Philippe Gerum @ 2010-03-17 16:19 UTC (permalink / raw)
To: robert165; +Cc: xenomai-help
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.
I'm puzzled: what does "slower" mean, regarding what operation?
>
> Thank you very much!
>
> Best regards
>
> Luo
>
>
>
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
--
Philippe.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] Sleep in rtdm driver
2010-03-17 15:05 ` Jan Kiszka
@ 2010-03-18 8:33 ` robert165
0 siblings, 0 replies; 7+ messages in thread
From: robert165 @ 2010-03-18 8:33 UTC (permalink / raw)
To: xenomai-help
[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]
在2010-03-17 23:05:33,"Jan Kiszka" jan.kiszka@siemens.com> 写道:
>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.
>
>The terms "kernel-based task" or "user space task" can be misleading.
>This services requires a real-time task context. That can either be a
>kernel-based *RT* task or a Xenomai shadow (aka *RT*) task in user space
>that has invoked some driver service, and that driver can then call
>rtdm_task_sleep on behalf of the user space task.
Thanks for your demo, I started my code with it.
Is that means the demo_ioctrl_rt is not a kernel based 'RT' task? But why using rtdm_event_timewait in demo_read_rt is OK?
Thanks for help.
>Blocking RTDM service *must not* be called by ordinary Linux kernel
>threads or on behalf of ordinary (non-shadowed) Linux user space
>threads. That's why the assertion failed for you.
>
>HTH,
>Jan
>
>--
>Siemens AG, Corporate Technology, CT T DE IT 1
>Corporate Competence Center Embedded Linux
[-- Attachment #2: Type: text/html, Size: 2569 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] Sleep in rtdm driver
@ 2010-03-18 12:02 robert165
2010-03-18 15:18 ` Jan Kiszka
0 siblings, 1 reply; 7+ messages in thread
From: robert165 @ 2010-03-18 12:02 UTC (permalink / raw)
To: xenomai-help
[-- Attachment #1: Type: text/plain, Size: 931 bytes --]
Hi,
在2010-03-18 00:19:47,"Philippe Gerum" <rpm@xenomai.org> 写道:
>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.
>
>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.
[-- Attachment #2: Type: text/html, Size: 1719 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] Sleep in rtdm driver
2010-03-18 12:02 [Xenomai-help] Sleep in rtdm driver robert165
@ 2010-03-18 15:18 ` Jan Kiszka
2010-03-19 4:17 ` robert165
0 siblings, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2010-03-18 15:18 UTC (permalink / raw)
To: robert165; +Cc: xenomai-help
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=x-gbk, Size: 1272 bytes --]
robert165 wrote:
> Hi,
>
>
>
> ÔÚ2010-03-18 00:19:47£¬"Philippe Gerum" <rpm@xenomai.org> дµÀ£º
>> 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.
>> 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
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Xenomai-help] Sleep in rtdm driver
2010-03-18 15:18 ` Jan Kiszka
@ 2010-03-19 4:17 ` robert165
0 siblings, 0 replies; 7+ messages in thread
From: robert165 @ 2010-03-19 4:17 UTC (permalink / raw)
To: xenomai-help
[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]
在2010-03-18 23:18:55,"Jan Kiszka" <jan.kiszka@siemens.com> 写道:
>robert165 wrote:
>> Hi,
>>
>>
>>
>> 在2010-03-18 00:19:47,"Philippe Gerum" <rpm@xenomai.org> 写道:
>>> 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.
>>> 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!
[-- Attachment #2: Type: text/html, Size: 2568 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-03-19 4:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18 12:02 [Xenomai-help] Sleep in rtdm driver robert165
2010-03-18 15:18 ` Jan Kiszka
2010-03-19 4:17 ` robert165
-- strict thread matches above, loose matches on Subject: below --
2010-02-07 20:43 [Xenomai-help] Analogy vs Comedi Jaryn Sepesi
2010-02-07 21:27 ` Alexis Berlemont
2010-03-17 14:07 ` [Xenomai-help] Sleep in rtdm driver robert165
2010-03-17 15:05 ` Jan Kiszka
2010-03-18 8:33 ` robert165
2010-03-17 16:19 ` Philippe Gerum
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.