* [Xenomai-help] rt_dev_ioctl serialization
@ 2006-08-29 14:36 Paul Ianna
2006-08-29 14:53 ` Jan Kiszka
0 siblings, 1 reply; 2+ messages in thread
From: Paul Ianna @ 2006-08-29 14:36 UTC (permalink / raw)
To: xenomai
Greetings,
Background:
I have not (yet) studied or written a linux or rtdm device driver. I
am, however, using one whose source with which I am unfamiliar. My
particular scenario involves a communications device driver written to
by many asynchronous tasks with varying priorities. I am concerned
that I may need to provide protections in front of the rt_dev_ioctl
call to ensure coherency.
Question:
Does a call to rt_dev_ioctl implicitly handle serialization or is it
each driver's (or application's) responsibility to take care of
serialization/reentrancy issues?
Thanks in advance,
Paul
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Xenomai-help] rt_dev_ioctl serialization
2006-08-29 14:36 [Xenomai-help] rt_dev_ioctl serialization Paul Ianna
@ 2006-08-29 14:53 ` Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2006-08-29 14:53 UTC (permalink / raw)
To: Paul Ianna; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 1699 bytes --]
Paul Ianna wrote:
> Greetings,
>
> Background:
>
> I have not (yet) studied or written a linux or rtdm device driver. I
> am, however, using one whose source with which I am unfamiliar. My
> particular scenario involves a communications device driver written to
> by many asynchronous tasks with varying priorities. I am concerned
> that I may need to provide protections in front of the rt_dev_ioctl
> call to ensure coherency.
>
>
> Question:
>
> Does a call to rt_dev_ioctl implicitly handle serialization or is it
> each driver's (or application's) responsibility to take care of
> serialization/reentrancy issues?
It's first of all the driver's responsibility. There are so many
different usages even of basic services (read/write/recv/send) that a
common solution makes no sense. Depending on the usage model of the
driver, the degree of protection against concurrency may vary.
An example for this are the read and write handlers of xeno_16550A:
Writing concurrently is considered a potential valid scenario (though
rare), thus it is ensured via a blocking mutex that a data chunk can be
written atomically. In contrast, reading is not considered to happen
concurrently, and the applied protection against wrong usage is a simple
flag set on entry and reset on exit of the read handler. If a concurrent
read occurs, this will be rejected and the user will be warned via an
error code. The same protection is applied on RTSER_RTIOC_WAIT_EVENT.
That said, your particular driver (which one?) may behave differently.
Either this is documented somewhere, our you actually have to study the
sources to understand its characteristics.
HTH,
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-29 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-29 14:36 [Xenomai-help] rt_dev_ioctl serialization Paul Ianna
2006-08-29 14:53 ` Jan Kiszka
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.