All of lore.kernel.org
 help / color / mirror / Atom feed
* Triggering UserCode from KernelModule (IRQ)
@ 2009-04-22 14:14 ` M. Koehrer
  2009-04-22 14:36   ` Daniel Walker
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: M. Koehrer @ 2009-04-22 14:14 UTC (permalink / raw)
  To: linux-rt-users

Hi all!

I am currently evaluting the RT_PREEMPT kernel as a replacement for a Xenomai based real time application.
(Intel Core2Duo PCs).
So far, everything works really fine and the performance is about the same as with Xenomai.
Great work!

However, I have one question:
I have a PCI hardware I/O board that exchanges data with the user mode 
directly (by using mmap), this works fine.
However, there is one operation mode that uses interrupts to signal incoming data.
The interrupt handler is realized as a tiny kernel module (that one that provides also 
the mmap for the user mode application).
Now I am not sure how the signalling of the IRQ from kernel to user mode could be realized 
best (in terms of low latency).

The "classical" approach for this task is to provide a character driver with a .poll file operation.
In Xenomai I could use a semaphore that was accessible from kernel and user space for this.
What is the best way in the RT_PREEMPT "world"? 

Thanks a lot for all feedback on this question.

Regards

Mathias


-- 
Mathias Koehrer
mathias_koehrer@arcor.de


Arcor.de Gaming Area - kostenfrei daddeln bis der Arzt kommt!
Jetzt checken und aus über 80 Spielen wählen!
http://www.arcor.de/footer-gaming/
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Triggering UserCode from KernelModule (IRQ)
  2009-04-22 14:14 ` Triggering UserCode from KernelModule (IRQ) M. Koehrer
@ 2009-04-22 14:36   ` Daniel Walker
  2009-04-22 19:59   ` Robert Schwebel
  2009-04-23  6:36   ` M. Koehrer
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Walker @ 2009-04-22 14:36 UTC (permalink / raw)
  To: M. Koehrer; +Cc: linux-rt-users

On Wed, 2009-04-22 at 16:14 +0200, M. Koehrer wrote:
> Hi all!
> 
> I am currently evaluting the RT_PREEMPT kernel as a replacement for a Xenomai based real time application.
> (Intel Core2Duo PCs).
> So far, everything works really fine and the performance is about the same as with Xenomai.
> Great work!

I thought I saw something someplace about Xenomai supporting preempt_rt
as a real time layer. So you might not need to do much to your
application in order to switch ..

Daniel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Triggering UserCode from KernelModule (IRQ)
  2009-04-22 14:14 ` Triggering UserCode from KernelModule (IRQ) M. Koehrer
  2009-04-22 14:36   ` Daniel Walker
@ 2009-04-22 19:59   ` Robert Schwebel
  2009-04-23  6:36   ` M. Koehrer
  2 siblings, 0 replies; 4+ messages in thread
From: Robert Schwebel @ 2009-04-22 19:59 UTC (permalink / raw)
  To: M. Koehrer; +Cc: linux-rt-users

On Wed, Apr 22, 2009 at 04:14:48PM +0200, M. Koehrer wrote:
> However, there is one operation mode that uses interrupts to signal
> incoming data.  The interrupt handler is realized as a tiny kernel
> module (that one that provides also the mmap for the user mode
> application).  Now I am not sure how the signalling of the IRQ from
> kernel to user mode could be realized best (in terms of low latency).
>
> The "classical" approach for this task is to provide a character
> driver with a .poll file operation. In Xenomai I could use a semaphore
> that was accessible from kernel and user space for this. What is the
> best way in the RT_PREEMPT "world"?

UIO might be a good choice here, the rest is giving the interrupt
handler and the processes the right priorities.

rsc
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: Triggering UserCode from KernelModule (IRQ)
  2009-04-22 14:14 ` Triggering UserCode from KernelModule (IRQ) M. Koehrer
  2009-04-22 14:36   ` Daniel Walker
  2009-04-22 19:59   ` Robert Schwebel
@ 2009-04-23  6:36   ` M. Koehrer
  2 siblings, 0 replies; 4+ messages in thread
From: M. Koehrer @ 2009-04-23  6:36 UTC (permalink / raw)
  To: claus.gindhart, mathias_koehrer; +Cc: linux-rt-users

Hi Claus, 

thanks for the feedback.
> simply write an UIO driver for your I/O-HW. You find an excellent howto in
> http://www.osadl.org/UIO.uio0.0.html
> 
> The UIO-driver has 2 benefits for you:
> 1. It provides you with direct access to the mmapped area from user space, 
> freeing you from the necessity to communicate via the /dev interface.
> 2. It can invoke a handler function in user space, if an interrupt occurs.
That is really cool for a new driver, however I have an already existing driver
(that works with Xenomai) and in the first step I do not want to change too much...
The only missing piece here is the "triggering" of my user space task whenever
an interrupt occurred.
Is the .poll approach real time capable or is there another approach better?

Thanks a lot

Regards

Mathias

-- 
Mathias Koehrer
mathias_koehrer@arcor.de


Arcor.de Gaming Area - kostenfrei daddeln bis der Arzt kommt!
Jetzt checken und aus über 80 Spielen wählen!
http://www.arcor.de/footer-gaming/
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-23  6:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200904221628.27659.claus.gindhart@kontron.com>
2009-04-22 14:14 ` Triggering UserCode from KernelModule (IRQ) M. Koehrer
2009-04-22 14:36   ` Daniel Walker
2009-04-22 19:59   ` Robert Schwebel
2009-04-23  6:36   ` M. Koehrer

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.