All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Steven Seeger <sseeger@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] more geode issues
Date: Sun, 11 Nov 2007 18:08:32 +0100	[thread overview]
Message-ID: <47373710.1030400@domain.hid> (raw)
In-Reply-To: <51CAD0CE1504444DBE77CBBE51A0135D3285C9@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

Steven Seeger wrote:
> Just to let everyone know, select() still locks up on me with 2.6.22.2
> and revision 3169.
> 
>  
> 
> All I’m doing is opening up a pipe in linux and select() on it for
> reading, and then opening up that pipe on the realtime side. Then, I hit
> control-C. I load the program again and it locks up when I hit control-C
> again. This won’t happen the 2^nd time if I unload and reload the nucleus.
> 

The way we were handling the poll handler was broken. Fixed in both
v2.3.x and trunk branches. The attached patch is on top of commit #3166.

-- 
Philippe.

[-- Attachment #2: fix-pipe-select.patch --]
[-- Type: text/x-patch, Size: 1657 bytes --]

Index: include/nucleus/pipe.h
===================================================================
--- include/nucleus/pipe.h	(revision 3166)
+++ include/nucleus/pipe.h	(working copy)
@@ -101,7 +101,6 @@
     struct fasync_struct *asyncq;
     wait_queue_head_t readq;		/* open/read/poll waiters */
     wait_queue_head_t syncq;		/* sync waiters */
-    unsigned int nwait;
     size_t ionrd;
 
 } xnpipe_state_t;
Index: ksrc/nucleus/pipe.c
===================================================================
--- ksrc/nucleus/pipe.c	(revision 3166)
+++ ksrc/nucleus/pipe.c	(working copy)
@@ -97,8 +97,6 @@
 		__setbits(state->status, mask);
 	}
 
-	state->nwait++;
-
 	xnlock_put_irqrestore(&nklock, s);
 }
 
@@ -135,7 +133,7 @@
 
 	xnlock_get_irqsave(&nklock, s);
 
-	if (--state->nwait == 0) {
+	if (testbits(state->status, mask)) {
 		__clrbits(state->status, mask);
 		removeq(&xnpipe_sleepq, &state->slink);
 	}
@@ -635,7 +633,6 @@
 	file->private_data = state;
 	init_waitqueue_head(&state->readq);
 	init_waitqueue_head(&state->syncq);
-	state->nwait = 0;
 
 	__clrbits(state->status,
 		  XNPIPE_USER_ALL_WAIT | XNPIPE_USER_ALL_READY | XNPIPE_USER_SIGIO);
@@ -699,12 +696,9 @@
 
 	xnlock_get_irqsave(&nklock, s);
 
-	if (testbits(state->status, XNPIPE_USER_WREAD))
-		xnpipe_dequeue_wait(state, XNPIPE_USER_WREAD);
+	if (testbits(state->status, XNPIPE_USER_WREAD|XNPIPE_USER_WSYNC))
+		xnpipe_dequeue_wait(state, XNPIPE_USER_WREAD|XNPIPE_USER_WSYNC);
 
-	if (testbits(state->status, XNPIPE_USER_WSYNC))
-		xnpipe_dequeue_wait(state, XNPIPE_USER_WSYNC);
-
 	if (testbits(state->status, XNPIPE_KERN_CONN)) {
 		int minor = xnminor_from_state(state);
 

  reply	other threads:[~2007-11-11 17:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-11  0:35 [Xenomai-help] more geode issues Steven Seeger
2007-11-11  0:53 ` Steven Seeger
2007-11-11 17:08   ` Philippe Gerum [this message]
2007-11-11 20:46     ` Steven Seeger
2007-11-27 17:36       ` Philippe Gerum
2007-11-11  9:49 ` Philippe Gerum
2007-11-11 19:36   ` Steven Seeger

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=47373710.1030400@domain.hid \
    --to=rpm@xenomai.org \
    --cc=sseeger@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.