All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin ZORES <benjamin.zores@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] Error propagating ISR to Linux domain
Date: Wed, 16 Jul 2008 18:03:52 +0200	[thread overview]
Message-ID: <487E1BE8.1000306@domain.hid> (raw)

Hi,

I've encountered a little problem when trying to propagate an ISR from 
Xenomai to Linux context.

To sum up clearly, I'm writing an RT kernel module that drives a PCI card.
I've registered a nucleus ISR handler on the IRQ attributed to this card.

On some systems, this IRQ is dedicated to this PCI card only.
Though, on others, it is shared with other peripherals.
Hence, I need to forward/propagate this IRQ to Linux domain for other 
drivers to handle it
when the IRQ has not been initiated by my PCI card.

My RT ISR code looks like the following:

int my_isr_handler (xnintr_t *irq)
{
    ... /* handling */
   return XN_ISR_HANDLED | XN_ISR_PROPAGATE;
}

While this code works perfectly when the IRQ number is really shared 
among peripherals,
when I use it on system where this IRQ is dedicated to RT only (i.e. not 
used by Linux),
then, the IRQ is never acknowledged.

In other words, I see a bug when returning XN_ISR_PROPAGATE on a system 
where
no Linux driver has registered a handler for this IRQ.
Is this something known and is there some workaround (I'm using 2.6.23 + 
lastest Adeos + Xenomai 2.4.4 on x86_32) ???

A quick and dirty workaround is to create a dummy Linux IRQ handler 
(doing so acknowledge my propagated IRQ) but:
 - if it returns IRQ_NONE, then Linux discard the IRQ line after having 
missed 100000 of them (on system where the IRQ is dedicated)
 - if it returns IRQ_HANDLED, then I have no guarantee that this dumym 
handler won't get called before the legacy drivers that need it.

Or maybe there is a way in Xenomai to know that any subdomain (like 
Linux) has registered a handler for this given IRQ ??

Any help would be appreciated,

Ben


             reply	other threads:[~2008-07-16 16:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-16 16:03 Benjamin ZORES [this message]
2008-07-16 17:02 ` [Xenomai-core] Error propagating ISR to Linux domain Jan Kiszka
2008-07-20 16:25 ` Ulrich Schwab
2008-07-28 14:37   ` Gilles Chanteperdrix
2008-07-29 14:20     ` Gilles Chanteperdrix
2008-07-29 22:15       ` Ulrich Schwab
2008-07-29 22:24         ` Gilles Chanteperdrix
2008-07-30  8:31         ` Gilles Chanteperdrix
2008-07-30  9:22           ` Ulrich Schwab
2008-07-30  9:26             ` Gilles Chanteperdrix

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=487E1BE8.1000306@domain.hid \
    --to=benjamin.zores@domain.hid \
    --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.