lkml.org 
[lkml]   [2005]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: waiting process in procfs read
On 8/26/05, Richard Stover <richard@ucolick.org> wrote:
> I submitted this as a bugzilla kernel bug report but was directed here.
> Perhaps someone can help me.
>
> I have a device driver developed with 2.4 kernels. I've ported
> it to the 2.6 kernel (FC3) and it all works fine except for one
> aspect of procfs.

<snip>

> THE PROBLEM: In FC3 (2.6.11-13_FC3) the reading process blocks but it never
> wakes up.

<snip>

> if (offset == 0) {
>
> printk("####%s waiting event %x\n",__FUNCTION__,
> (unsigned int)&dev->read_proc_wait);
>
> wait_event_interruptible(dev->read_proc_wait,(offset != 0));
> printk("####%s WOKE UP\n",__FUNCTION__);

<snip>

> /* Wake up anyone waiting on reading /proc/readXw */
> printk(KERN_INFO "#### waking up anyone waiting on read_proc_wait event %x\n",
> (unsigned int)&dev->read_proc_wait);
>
> wake_up_interruptible(&dev->read_proc_wait);

Your symptoms indicate to me that the "event" in
wait_event_interruptible() has not been satisifed, and thus the
(potentially) infinite loop in wait_event_interruptible() is
continuing, e.g. event still is 0. A signal (as you've specified
_interruptible()) causes that loop to break out. One option to debug
would be to use wait_event_interruptible_timeout() and then see if it
returns from that (it should in this case after the timeout has
passed) and then print out the value of offset. If it's still 0, then
wait_event_interruptible() is functioning as expected.

Thanks,
Nish
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-26 18:44    [W:0.032 / U:1.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site