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.

_______________________________________________
Xenomai-help mailing list
Xenomai-help@gna.org
https://mail.gna.org/listinfo/xenomai-help

Reply via email to