All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: robert165 <robert165@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Problem in irq_handle
Date: Thu, 25 Mar 2010 14:49:45 +0100	[thread overview]
Message-ID: <4BAB69F9.7070105@domain.hid> (raw)
In-Reply-To: <1a51bc0.b6de.127955f4dc7.Coremail.robert165@domain.hid>

robert165 wrote:
> 
> 
> 
> 在2010-03-25 15:55:53,"Gilles Chanteperdrix"
> <gilles.chanteperdrix@xenomai.org> 写道:
>> robert165 wrote:
>>> 
>>> 在2010-03-24 18:22:24,"Gilles Chanteperdrix"
>>> <gilles.chanteperdrix@xenomai.org> 写道:
>>>> robert165 wrote:
>>>>> Hi Jan, I am new to xenomai, I am writing a gpio driver based
>>>>> on your "RTDM skeleton v1.1". There is a problem that when I
>>>>> complied and run your skeleton in a at91rm9200 broad with
>>>>> TIMERINT, the output is not show one line one second but very
>>>>> fast. The problem is still whenever I changed the following
>>>>> codes in demo_interrupt()
>>>>> 
>>>>> #ifdef TIMERINT if (events > XXX){ 
>>>>> rtdm_event_signal(&ctx->irq_event); event=0; } ... events++;
>>>>> 
>>>>> And, it seems likely in my own irq_handle of a gpio irq. When
>>>>> the irq arrive, the irq_handle repeats many times. Should I
>>>>> mask the same irq in irq_handle? I did it by write the PIO
>>>>> interrupt mask register, but no effect.
>>>> Which interrupt is TIMERINT?
>>> TIMERINT is timer interrupt.
>>> 
>>> It is in the demo of rtdm driver, the sourse is:
>>> 
>>> http://www.captain.at/xenomai-real-time-driver-example.php
>>> 
>>> Best wishes,
>> Yes, but I was wondering which timer interrupt: - if you are
>> talking about the AT91 "system interrupt", it is shared between
>> several peripherals, including the DBGU serial port, and can not be
>> used in a real-time driver for this reason; - if you are talking
>> about the TC interrupt, it is handled by the I-pipe, and you can
>> not register a handler for your own driver either.
>> 
>> IOW, what value of TIMERINT do you use?
> What I said is  the the original codes of Jan, I just compiled and
> run it without any modification. The value of TIMERINT is 0.

Ok. In fact, I am afraid Jan's code is for x86, not AT91. Since that
driver was written, RTDM gained support for timers, so, hooking into the
timer interrupt is no longer needed if you want a handler to be
triggered periodically.

> 
>> And I do not really understand why you use the timer interrupt. If
>> you are interested in interrupts coming from a GPIO, why not
>> register a handler for the GPIO interrupt?
> I did not use the  timer interrupt in my own GPIO driver, that is a
> real GPIO interrupt. I put a printk() in irq_handle , when the int
> arrived, the irq_handle repeat many times. I used RTDM_IRQTYPE_EDGE,
> masked the irq in irq_handle by write irq_mask_register. Results are
> the same. Regards, Luo

If you want to mask an irq, you should not write directly to registers,
you should use the linux kernel APIs. Anyway, I think that is not your
problem, your problem is a known one with edge and level interrupts.
Could you try setting up the irq as level instead of edge?

If it does not work, try and also call:
set_irq_handler(<irq number>, handle_level_irq)

-- 
					    Gilles.



  reply	other threads:[~2010-03-25 13:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19 15:46 [Xenomai-help] crash after termination Stefan Kisdaroczi
2010-03-20 15:53 ` Jan Kiszka
2010-03-22 10:36   ` Stefan Kisdaroczi
2010-03-23  8:00     ` Jan Kiszka
2010-03-23 13:25       ` Stefan Kisdaroczi
2010-03-23 17:06         ` Jan Kiszka
2010-03-23 17:15           ` Gilles Chanteperdrix
2010-03-23 17:23             ` Jan Kiszka
2010-03-24  2:54               ` [Xenomai-help] Problem in irq_handle robert165
2010-03-24 10:22                 ` Gilles Chanteperdrix
2010-03-25  2:55                   ` robert165
2010-03-25  7:55                     ` Gilles Chanteperdrix
2010-03-25 12:50                       ` robert165
2010-03-25 13:49                         ` Gilles Chanteperdrix [this message]
2010-03-25 14:28                           ` Jan Kiszka

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=4BAB69F9.7070105@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=robert165@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.