* [Xenomai-core] Problem with RTDM descriptors with only rt close handler.
@ 2007-06-01 17:59 Gilles Chanteperdrix
2007-06-01 20:05 ` Jan Kiszka
0 siblings, 1 reply; 3+ messages in thread
From: Gilles Chanteperdrix @ 2007-06-01 17:59 UTC (permalink / raw)
To: xenomai
Hi,
I had a problem with an RTDM driver: /proc/xenomai/rtdm/open_fildes
could not close its descriptors. So, I tried with trunk which has
auto-cleanup of RTDM descriptors, to see if descriptors would be closed,
the descriptors were not auto-closed when killing my application
either. After a little investigation, it appears that the problem is
that my drivers had a real-time close handler but no non-realtime
handler, so when close was invoked from a non real-time context (either
/proc/xenomai/rtdm/open_fildes, or the auto-cleanup routine), the
default close handler installed by RTDM simply returned -38 and close
aborted.
The way to fix this issue was rather simple: implement a non real-time
close handler, but I find this behaviour a bit disturbing, maybe
implementing a non real-time close handler could be mandatory ?
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-core] Problem with RTDM descriptors with only rt close handler.
2007-06-01 17:59 [Xenomai-core] Problem with RTDM descriptors with only rt close handler Gilles Chanteperdrix
@ 2007-06-01 20:05 ` Jan Kiszka
2007-06-03 16:14 ` Gilles Chanteperdrix
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2007-06-01 20:05 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]
Gilles Chanteperdrix wrote:
> Hi,
>
> I had a problem with an RTDM driver: /proc/xenomai/rtdm/open_fildes
> could not close its descriptors. So, I tried with trunk which has
> auto-cleanup of RTDM descriptors, to see if descriptors would be closed,
> the descriptors were not auto-closed when killing my application
> either. After a little investigation, it appears that the problem is
> that my drivers had a real-time close handler but no non-realtime
> handler, so when close was invoked from a non real-time context (either
> /proc/xenomai/rtdm/open_fildes, or the auto-cleanup routine), the
> default close handler installed by RTDM simply returned -38 and close
> aborted.
>
> The way to fix this issue was rather simple: implement a non real-time
> close handler, but I find this behaviour a bit disturbing, maybe
> implementing a non real-time close handler could be mandatory ?
>
It is, read the fine manual :). Moreover, if you had validated your
driver via CONFIG_XENO_OPT_DEBUG_RTDM, you would have got an error on
registration. But given the now even more required close_nrt handler, I
think decoupling this particular check from the debug switch is
appropriate. Will fix.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Xenomai-core] Problem with RTDM descriptors with only rt close handler.
2007-06-01 20:05 ` Jan Kiszka
@ 2007-06-03 16:14 ` Gilles Chanteperdrix
0 siblings, 0 replies; 3+ messages in thread
From: Gilles Chanteperdrix @ 2007-06-03 16:14 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai
Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
> > Hi,
> >
> > I had a problem with an RTDM driver: /proc/xenomai/rtdm/open_fildes
> > could not close its descriptors. So, I tried with trunk which has
> > auto-cleanup of RTDM descriptors, to see if descriptors would be closed,
> > the descriptors were not auto-closed when killing my application
> > either. After a little investigation, it appears that the problem is
> > that my drivers had a real-time close handler but no non-realtime
> > handler, so when close was invoked from a non real-time context (either
> > /proc/xenomai/rtdm/open_fildes, or the auto-cleanup routine), the
> > default close handler installed by RTDM simply returned -38 and close
> > aborted.
> >
> > The way to fix this issue was rather simple: implement a non real-time
> > close handler, but I find this behaviour a bit disturbing, maybe
> > implementing a non real-time close handler could be mandatory ?
> >
>
> It is, read the fine manual :). Moreover, if you had validated your
> driver via CONFIG_XENO_OPT_DEBUG_RTDM, you would have got an error on
> registration. But given the now even more required close_nrt handler, I
> think decoupling this particular check from the debug switch is
> appropriate. Will fix.
I have to say that I did not really test trunk, I backported the
auto-cleanup stuff to the version of the v2.3.x branch that I am
using. So, if the debug check was added after this commit, I missed it
completely.
--
Gilles Chanteperdrix.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-06-03 16:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-01 17:59 [Xenomai-core] Problem with RTDM descriptors with only rt close handler Gilles Chanteperdrix
2007-06-01 20:05 ` Jan Kiszka
2007-06-03 16:14 ` Gilles Chanteperdrix
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.