All of lore.kernel.org
 help / color / mirror / Atom feed
From: Per Oberg <pero@wolfram.com>
To: xenomai <xenomai@xenomai.org>
Subject: RTDM open, open_rt, and open_nrt
Date: Mon, 16 Sep 2019 02:32:08 -0500 (CDT)	[thread overview]
Message-ID: <2078452807.5749189.1568619128144.JavaMail.zimbra@wolfram.com> (raw)

Hello list

I am trying to understand how rtdm works, and possibly why out of a historical context. Perhaps there is a good place to read up on this stuff, then please let me know. 

It seems like in the rtdm-api there is only open, but no open_rt or open_nrt. 
More specifically we have: 
- read_rt  / read_nrt
- recvmsg_rt / recvmsg_nrt
- ioctl_rt / ioctl_nrt
- .. etc.

However, when studying an old xenomai2->3 ported driver it seems like there used to be open_rt and open_nrt. The problem I was having before (see my background comment below) was because the open had been mapped to the old open_nrt code, which in turned used a rt-lock, thus a mix of the two. When switching to a regular mutex it "worked", as in it didn't complain. 

In a short discussion Jan Kiszka gave me the impression that open could possibly end up being rt or nrt depending on situation. 

PÖ: I'm guessing that open is always non-rt and therefore a rtdm_lock should be used? ...

JK: This depends. If the open code needs to synchronize only with other non-RT
JK: paths, normal Linux locks are fine. If there is the need to sync with the
JK: interrupt handler or some of the _rt callbacks, rtdm_lock & Co. is needed.


So, how does this work? And why was (if it was) open_nrt and open_rt replaced with a common open?


Background
----------------
I recently wrote about a driver which warned about "drvlib.c:1349 rtdm_mutex_timedlock". I got good answers which led me to some more general questions, but instead of continuing in the old tread I thought it better to start a new one since it's not about the initial problem. The driver in case is the Peak Linux Driver for their CAN hardware, see [1]


[1] https://www.peak-system.com/fileadmin/media/linux/index.htm


Best regards
Per Öberg 


             reply	other threads:[~2019-09-16  7:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16  7:32 Per Oberg [this message]
2019-09-16  9:34 ` RTDM open, open_rt, and open_nrt Jan Kiszka
2019-09-16 10:10   ` Per Oberg
  -- strict thread matches above, loose matches on Subject: below --
2019-09-16 12:36 Per Oberg
2019-09-16 12:41 ` Per Oberg
2019-09-16 14:59   ` Jan Kiszka
2019-09-16 15:33     ` Per Oberg
2019-09-16 17:01       ` Jan Kiszka
2019-09-17  7:20         ` Per Oberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2078452807.5749189.1568619128144.JavaMail.zimbra@wolfram.com \
    --to=pero@wolfram.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.