From: Jan Kiszka <jan.kiszka@domain.hid>
To: DOURNES Guillaume <Guillaume.DOURNES@lgm.fr>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Interrupt management under rtdm driver
Date: Tue, 13 May 2008 13:03:02 +0200 [thread overview]
Message-ID: <48297566.1010607@domain.hid> (raw)
In-Reply-To: <0C9896A4B6D338488AD6FFFE58BAEF100276DBF6@domain.hid>
[ Please don't reply on earlier postings when starting a new thread. ]
DOURNES Guillaume wrote:
> Hello,
>
> I try to manage irq on my digital I/O board rtdm driver.
> So, I call rtdm_irq_request with RTDM_IRQTYPE_SHARED | RTDM_IRQTYPE_EDGE
> option to define my irq handler, in my rtdm open function.
> This irq handler works very good.
> So, I try to establish a callback system to inform my sofware when an
> valid interrupt is arrived.
> I don't know callback system, so i establish a rtdm semaphore.
> So, in my irq handler I call rtdm_sem_up, and I have an blocant ioctl
> where I call only rtdm_sem_down.
>
> To test this method, I write a test code, where I create a rt task by
> calling rt_task_create(&Handler_IT_task, "Handler IT Task",0,50,0); and
> rt_task_start(&Handler_IT_task, &Handler_IT_task_proc, NULL);
>
> And my task procedure is :
>
> void Handler_IT_task_proc (void * arg)
> {
> int ret;
> while(1)
> {
> ret = rt_dev_ioctl(IO_Card_ID, DISCRETS_IOC_WAIT_IT, 0);
> if (!ret)
> printf("IT detected\n");
> else
> goto exit_Handler_IT_task;
> //rt_task_suspend(&Handler_IT_task);
> }
> exit_Handler_IT_task:
> printf("Exit Handler IT task\n");
> }
>
> My problem is that on IT reception, my work station freeze. But, if I
> call a suspend task after my blocant ioctl (see comment), and I call an
> task resume by a gets in my main function, all my interrupts are founded
> correctly.
>
> I try to change the rtdm semaphore by a rtdm event, but the results are
> the same.
>
> So, why my sofware is frozen when the Handler task procedure keep the
> hand ? Can I establish a really callback function instead of a blocant
> ioctl ?
Use CONFIG_XENO_OPT_WATCHDOG to ensure that you don't see a runaway
thread here. Alternatively, you could break out of the loop after some
iterations to check if this is the reason for your "locked-up" system.
Note that, if we should help you beyond this, we will need the driver
source code as well. How should we know otherwise when your driver
returns 0 and how long it suspends the caller?
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2008-05-13 11:03 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 9:18 [Xenomai-help] gdb + multi-threaded application + Intel dual core processor + Xenomai => frozen system Kaeppeler, Oliver
2008-05-13 9:36 ` Jan Kiszka
2008-05-13 10:46 ` [Xenomai-help] Interrupt management under rtdm driver DOURNES Guillaume
2008-05-13 11:03 ` Jan Kiszka [this message]
2008-05-13 13:11 ` DOURNES Guillaume
2008-05-13 14:47 ` Jan Kiszka
2008-05-13 16:36 ` DOURNES Guillaume
2008-05-13 16:58 ` Jan Kiszka
2008-05-14 9:55 ` DOURNES Guillaume
2008-05-14 19:21 ` Jan Kiszka
2008-05-14 19:35 ` Jan Kiszka
2008-05-15 10:24 ` DOURNES Guillaume
2008-05-16 7:11 ` Jan Kiszka
2008-05-16 10:08 ` DOURNES Guillaume
2008-05-16 11:28 ` [Xenomai-help] Serial driver and TX events Anders Blomdell
2008-05-16 12:49 ` Jan Kiszka
2008-05-16 13:12 ` Anders Blomdell
2008-05-16 13:25 ` Jan Kiszka
2008-05-16 17:56 ` Anders Blomdell
2008-06-19 19:41 ` [Xenomai-help] Weird rt_dev_socket behaviour Anders Blomdell
2008-06-20 10:54 ` Jan Kiszka
2008-05-13 14:06 ` [Xenomai-help] gdb + multi-threaded application + Intel dual core processor + Xenomai => frozen system Kaeppeler, Oliver
2008-05-13 14:44 ` Jan Kiszka
2008-05-14 6:13 ` Jan Kiszka
2008-05-14 12:02 ` Kaeppeler, Oliver
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=48297566.1010607@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=Guillaume.DOURNES@lgm.fr \
--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.