All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Carlos Eduardo de Brito Novaes <carlosnov@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Trouble with rtdm timers and events
Date: Thu, 11 Aug 2011 17:00:16 +0200	[thread overview]
Message-ID: <4E43EE80.8050406@domain.hid> (raw)
In-Reply-To: <201108111131.11981.carlosnov@domain.hid>

On 08/11/2011 04:31 PM, Carlos Eduardo de Brito Novaes wrote:
> Here it comes.
> I found out that if wait is called inside an IOCTL, there is no hangs at all, 
> everything work as expected, except from te fact that it seens a litle bit 
> strange (to me) to use ioctl to read or write, I would expect to use the 
> correspondent rad and write functions and ioctl to setup something.
> I tried to reduce the code, in the tarball there are one Makefile, one c file 
> for the module and one c file for the app. There is one define line on the 
> module file, comment it ou to get the hangs. The app will simply open the 
> device, issue an wait ioctl (dummy if the module is compiled to wait in 
> read_rt) and the do the actual reading (it hangs on my system if i tell the 
> module to wait on the read_rt function).
> 
> Here comes the kernel log from one run that does the error but fortunately
> does not hang the entire system.

Yes, you can use rtdm_event_wait in read or write. The fact that it
hangs or results in bugs is probably due to the fact that you are
corrupting some memory. Your testcase contains too much code. If you
want to test rtdm_event_wait / rtdm_event_pulse, simply do one driver,
with one ioctl which does the rtdm_event_wait, and the timer which does
the rtdm_event_pulse.

The copy_to_user in the read callback overflows the source area, but
that is not your problem.

Also, do not use open_rt and close_rt in new code as they are deprecated.

-- 
					    Gilles.


  reply	other threads:[~2011-08-11 15:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-10 17:49 [Xenomai-help] Trouble with rtdm timers and events Carlos Eduardo de Brito Novaes
2011-08-10 19:57 ` Carlos Eduardo de Brito Novaes
2011-08-10 21:10   ` Carlos Eduardo de Brito Novaes
2011-08-11  7:39     ` Gilles Chanteperdrix
2011-08-11 14:31       ` Carlos Eduardo de Brito Novaes
2011-08-11 15:00         ` Gilles Chanteperdrix [this message]
2011-08-11 17:56           ` Carlos Eduardo de Brito Novaes
2011-08-11 18:01             ` Gilles Chanteperdrix
2011-08-11 18:12               ` Carlos Eduardo de Brito Novaes
2011-08-11 19:34                 ` Gilles Chanteperdrix
2011-08-11 22:28                   ` Carlos Eduardo de Brito Novaes

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=4E43EE80.8050406@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=carlosnov@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.