All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Russell Johnson <russell.johnson@kratosdefense.com>
Cc: xenomai@xenomai.org
Subject: Re: Interrupts
Date: Sat, 18 Jun 2022 10:44:57 +0200	[thread overview]
Message-ID: <87pmj673g0.fsf@xenomai.org> (raw)
In-Reply-To: <PH1P110MB1050EB01901ACB993D94FF8EE2AF9@PH1P110MB1050.NAMP110.PROD.OUTLOOK.COM>


Russell Johnson via Xenomai <xenomai@xenomai.org> writes:

> The app that I am currently working with has an interrupt scheme as follows:
> device on the PCIe bus sends an interrupt to the CPU, our linux driver then
> has an MSI interrupt handler (will be replaced by the EVL oob interrupt
> handler), the handler then calls eventfd_signal() to alert the userspace app
> that an interrupt happened. On the userspace side, there is a thread that
> implements an epoll that is monitoring the eventfd for an event. The issue
> is that eventfd and epoll are both Linux OS items, so I am not sure if
> sticking with this kind of method is the best option. Is there a more
> generally excepted method when developing with EVL to have an EVL kernel
> driver notify a userspace EVL thread that there was an interrupt?
>

The recommended way with EVL is to follow the common patterns used for
developing regular linux drivers, except that the EVL kernel API must be
used instead of the regular/in-band kernel API for anything which wants
to synchronize threads over the oob stage.

Typically, you could share an EVL semaphore [1] or an event flag group
[2] between the interrupt handler and the oob_ioctl() or oob_read()
call, which would block the user-space task until the matching event
happens. To monitor complex events, you could use an EVL wait queue
instead of a semaphore or a flag.

If you need to monitor multiple event sources in userland, you can use
the EVL poll API [4] with the file descriptors you would otherwise pass
to the oob_{ioctl, read, write}() calls.

[1] https://evlproject.org/core/user-api/semaphore/
[2] https://evlproject.org/core/user-api/flags/
[3] https://evlproject.org/core/kernel-api/wait/
[4] https://evlproject.org/core/user-api/poll/

-- 
Philippe.


  reply	other threads:[~2022-06-18  8:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 19:23 Interrupts Russell Johnson
2022-06-18  8:44 ` Philippe Gerum [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-20 15:17 Interrupts Russell Johnson
2022-06-20 15:42 ` Interrupts Philippe Gerum
     [not found] <D6CF33887D864426B02D21261537559B@ChuckPC>
2010-09-17 16:42 ` interrupts Luis R. Rodriguez
2010-09-17 17:39   ` interrupts Christian Lamparter
2007-04-01 15:05 Interrupts Guy Zana
2004-03-15  3:22 Interrupts Nishant Nagalia
2004-03-15  5:51 ` Interrupts Zwane Mwaikambo

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=87pmj673g0.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=russell.johnson@kratosdefense.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.