All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Marcelo Coelho <mjcoelho@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] IRQ Enable/Disable
Date: Thu, 31 Aug 2006 20:49:25 +0200	[thread overview]
Message-ID: <44F72F35.4070109@domain.hid> (raw)
In-Reply-To: <44F6E774.2000701@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1899 bytes --]

Marcelo Coelho wrote:
> Hi!
> 
> 
> I've found out in RTAI's 16550a driver, that uses RTDM, the following
> comment:
> 
>     /*We should disable the line now, but this requires counting
>      * enable/disable, something not yet implemented by the core.
>      * At the moment this call could starve other users sharing the
>      * same line.
>     rtdm_irq_disable(&ctx->irq_handle);*/
>     rtdm_irq_free(&ctx->irq_handle);

In fact, you find the same in Xenomai as RTAI just mirrors the original. :)

> 
> Is this still true? I mean, if i free the device at device close, should
> i expect that i need to request the irq again?

It is still true. Xenomai does not support a nesting counter for
irq_disable/enable yet, therefore RTDM did not change its interface in
this regard as well.

> 
> I'm trying to ckeck what to expect about these calls.
> 

For now the situation is like this: rtdm_irq_request allocates an IRQ,
but doesn't necessarily enables it. So you have to call rtdm_irq_enable
afterwards. To release it, just switch off IRQ generation in your device
and call rtdm_irq_free.

That's true unless the IRQ is shared. Then some other driver may have
already enabled it (which doesn't releases your from the duty to do it
again - you cannot predict the load order). Therefore, if writing a
driver with shared IRQ support, you should not rely on the fact that the
IRQ line is disabled right after rtdm_irq_request. Neither should you
disable the line on release (only in the hardware). Otherwise, you would
cut off persisting users of that line.


Mmh, your question makes me wonder if we shouldn't enable the line in
rtdm_irq_request automatically. I do not recall any urging use-case for
the current behaviour... Does anyone else?

Dmitry, Philippe, what's the reason for the split up in the core? Does
any skin require this?

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2006-08-31 18:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31 13:43 [Xenomai-help] IRQ Enable/Disable Marcelo Coelho
2006-08-31 18:49 ` Jan Kiszka [this message]
2006-08-31 22:01   ` [Xenomai-help] Kernel panic with Xenomai SMP kernel Jeff Webb
2006-08-31 23:16     ` Gilles Chanteperdrix
2006-08-31 23:45       ` Jeff Webb
2006-09-01  7:26       ` Philippe Gerum
2006-09-01 15:05       ` Jeff Webb
2006-09-01 18:16         ` Gilles Chanteperdrix
2006-09-01 22:15           ` Jeff Webb
2006-09-02  7:41             ` Philippe Gerum
2006-09-06 20:23               ` Jeff Webb
2006-09-06 22:24                 ` Philippe Gerum
2006-09-07 16:31                   ` Jeff Webb
2006-09-08  8:18                     ` Philippe Gerum
2006-09-13 14:43                   ` Jeff Webb
2006-09-13 15:59                     ` Philippe Gerum
2006-09-14 18:53                       ` Jeff Webb
2006-09-15  7:17                         ` Philippe Gerum
2006-09-01  7:23   ` [Xenomai-help] IRQ Enable/Disable Dmitry Adamushko
2006-09-01  8:29   ` Philippe Gerum
2006-09-01 13:37     ` Jan Kiszka
2006-09-01 14:21       ` Philippe Gerum

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=44F72F35.4070109@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=mjcoelho@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.