All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] Missing IRQ end function on PowerPC
Date: Thu, 19 Jan 2006 14:06:23 +0100	[thread overview]
Message-ID: <43CF8ECF.4020805@domain.hid> (raw)
In-Reply-To: <17359.34362.870823.168739@domain.hid>

Gilles Chanteperdrix wrote:
> Wolfgang Grandegger wrote:
>  > Hello,
>  > 
>  > with RTnet over Xenomai and Linux 2.4 on PowerPC I realized that Xenomai 
>  > does not distinguish between a normal IRQ enable and an IRQ unmask at 
>  > the end of an ISR (to reenable the IRQ). In the latter case the IRQ 
>  > should be enabled on PowerPC as shown:
>  > 
>  >     if (rthal_irq_descp(irq)->handler->end != NULL)
>  >   	   rthal_irq_descp(irq)->handler->end(irq);
>  >      else
>  > 	   rthal_irq_descp(irq)->handler->enable(irq);
>  > 
>  > To handle this case properly, we need to different functions, I think.
> 
> I am not sure I understand what you mean. Would you want functions
> rthal_end_irq and xnarch_end_irq added and that this xnarch_end_irq
> would be called in xnintr_irq_handler when XN_ISR_ENABLE is set ?

Yes, that's what I have basically done to get the RTnet SCC enet driver 
working on my MPC8xx module. In arch/ppc/kernel/irq.c you can see how 
Linux re-enables interrupts at the end of it's ISR (see
http://cvs.gna.org/cvsweb/linux/v2.4/2.4.25-ppc/arch/ppc/kernel/irq.c?rev=1.1;cvsroot=adeos):

   507: 	 * The ->end() handler has to deal with interrupts which got
   508: 	 * disabled while the handler was running.
   509: 	 */
   510: 	if (desc->handler) {
   511: 		if (desc->handler->end)
   512: 			desc->handler->end(irq);
   513: 		else if (desc->handler->enable)
   514: 			desc->handler->enable(irq);

In PPC Linux 2.6 things are a bit different. The "end" functions seems 
to be mandatory now (I have to check more carefully).

Therefore we need a dedicated function to re-enable interrupts in the 
ISR. We could name it *_end_irq, but maybe *_enable_isr_irq is more 
obvious. On non-PPC archs it would translate to *_irq_enable. I 
realized, that *_irq_enable is used in various place/skins and therefore 
I have not yet provided a patch.

Wolfgang.




  reply	other threads:[~2006-01-19 13:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-18 10:44 [Xenomai-core] Missing IRQ end function on PowerPC Wolfgang Grandegger
2006-01-19 12:29 ` Gilles Chanteperdrix
2006-01-19 13:06   ` Wolfgang Grandegger [this message]
2006-01-19 13:27     ` Gilles Chanteperdrix
2006-01-19 13:40       ` Wolfgang Grandegger
2006-01-24 10:20       ` Wolfgang Grandegger
2006-02-02 12:52         ` Philippe Gerum
2006-01-29 22:56       ` Philippe Gerum
2006-01-30  8:16         ` Jan Kiszka
2006-01-30 10:00           ` Philippe Gerum
  -- strict thread matches above, loose matches on Subject: below --
2006-01-30  8:33 Wolfgang Grandegger
2006-01-30  9:20 ` Jan Kiszka
2006-01-30  9:58   ` Philippe Gerum
2006-01-30 10:12     ` Jan Kiszka
2006-01-30 11:13       ` Philippe Gerum
2006-01-30 11:09 Wolfgang Grandegger

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=43CF8ECF.4020805@domain.hid \
    --to=wg@domain.hid \
    --cc=gilles.chanteperdrix@xenomai.org \
    --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.