* [Xenomai] rtdm driver open_rt/nrt handler question
@ 2015-11-26 9:00 JK.Behnke
2015-11-26 9:10 ` Gilles Chanteperdrix
0 siblings, 1 reply; 3+ messages in thread
From: JK.Behnke @ 2015-11-26 9:00 UTC (permalink / raw)
To: xenomai
Xenomai 2.6.3 documentation states, that the usage of open_rt handlers
is deprecated
as this feature will be removed in the future.
As a consequence one cannot use rtdm_mutex_lock inside an nrt_open
handler
to synchronize multiple callers, as this will result in a
(!xnpod_unblockable_p()) assertion.
So using a spinlock would be the only solution in that situation.
Is that true?
By the way, if an rtdm driver only supports RTDM_EXCLUSIVE mode, is
there
a need to synchronize concurrent calls to rt_dev_open on this device at
all?
I guess not, because the second caller will be refused.
Is that also true?
Thanks for your help
Jochen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai] rtdm driver open_rt/nrt handler question
2015-11-26 9:00 [Xenomai] rtdm driver open_rt/nrt handler question JK.Behnke
@ 2015-11-26 9:10 ` Gilles Chanteperdrix
2015-11-26 9:39 ` JK.Behnke
0 siblings, 1 reply; 3+ messages in thread
From: Gilles Chanteperdrix @ 2015-11-26 9:10 UTC (permalink / raw)
To: JK.Behnke; +Cc: xenomai
On Thu, Nov 26, 2015 at 10:00:16AM +0100, JK.Behnke@web.de wrote:
> Xenomai 2.6.3 documentation states, that the usage of open_rt handlers
> is deprecated
> as this feature will be removed in the future.
Xenomai 2.6.3 is very old now. It is not even the latest release in
the 2.6 branch. open_rt has been removed from Xenomai 3.
> As a consequence one cannot use rtdm_mutex_lock inside an nrt_open
> handler
> to synchronize multiple callers, as this will result in a
> (!xnpod_unblockable_p()) assertion.
> So using a spinlock would be the only solution in that situation.
> Is that true?
No, the caller is a Linux task, or a Xenomai task running in
secondary mode. As such, any Linux service can be used, such as
mutex or semaphores (the Linux ones).
>
> By the way, if an rtdm driver only supports RTDM_EXCLUSIVE mode, is
> there
> a need to synchronize concurrent calls to rt_dev_open on this device at
> all?
> I guess not, because the second caller will be refused.
> Is that also true?
Yes.
--
Gilles.
https://click-hack.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai] rtdm driver open_rt/nrt handler question
2015-11-26 9:10 ` Gilles Chanteperdrix
@ 2015-11-26 9:39 ` JK.Behnke
0 siblings, 0 replies; 3+ messages in thread
From: JK.Behnke @ 2015-11-26 9:39 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
> On Thu, Nov 26, 2015 at 10:00:16AM +0100, JK.Behnke@web.de wrote:
> > Xenomai 2.6.3 documentation states, that the usage of open_rt handlers
> > is deprecated
> > as this feature will be removed in the future.
>
> Xenomai 2.6.3 is very old now. It is not even the latest release in
> the 2.6 branch. open_rt has been removed from Xenomai 3.
>
> > As a consequence one cannot use rtdm_mutex_lock inside an nrt_open
> > handler
> > to synchronize multiple callers, as this will result in a
> > (!xnpod_unblockable_p()) assertion.
> > So using a spinlock would be the only solution in that situation.
> > Is that true?
>
> No, the caller is a Linux task, or a Xenomai task running in
> secondary mode. As such, any Linux service can be used, such as
> mutex or semaphores (the Linux ones).
Yes, I agree.
Using a xenomai spinlock would of course also result in a
xenomai assertion, hence I'm left with the linux synchronization
services.
Same goes for init_module/cleanup_module handlers, as these can
only be called by Linux tasks.
>
> >
> > By the way, if an rtdm driver only supports RTDM_EXCLUSIVE mode, is
> > there
> > a need to synchronize concurrent calls to rt_dev_open on this device at
> > all?
> > I guess not, because the second caller will be refused.
> > Is that also true?
>
> Yes.
OK.
Gilles, thanks again for responding that fast.
I really appreciate it.
Regards
Jochen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-26 9:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-26 9:00 [Xenomai] rtdm driver open_rt/nrt handler question JK.Behnke
2015-11-26 9:10 ` Gilles Chanteperdrix
2015-11-26 9:39 ` JK.Behnke
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.