From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4B9B8020.1080605@domain.hid> Date: Sat, 13 Mar 2010 13:08:00 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] RTDM rtdm_task_sleep in kernel not always wakes up List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Huan Fang Cc: "xenomai@xenomai.org" Huan Fang wrote: > Hello. I am writing a driver using RTDM. Just for testing, I have a > rt kernel thread waiting for event signal sent from nrt_ioctl. After > the thread is activated, it calls rtdm_task_busy_sleep(100000); then > rtdm_task_sleep(100000); When the RT thread is really sleeping, the > nrt_ioctl resumes and sleeps via wait_event_interruptible_timeout(2 > jiffiles). > > Normally, RT thread wakes up after 100us. But the thread seems to > hang after 20-30 such loops and never wake up. When I kill the > process. I saw that wait_event_interruptible_timeout returns a -512. > The worse thing is I saw kernel panic sometimes during such context > switches. Hi, If you are using wait_event_interruptible_timeout from the context of a xenomai thread running in primary mode, it is normal to get kernel oopses. If you do not do that, then I did not get your explanation, and I think the best thing to do is to send us a self contained example, including driver code and user-space code. Something that we can compile and run to see what you are observing. Regards. -- Gilles.