All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [PATCH 1/4] UML - Fix spurious IRQ testing
@ 2007-10-31 19:59 ` Jeff Dike
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Dike @ 2007-10-31 19:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, uml-devel

The spurious IRQ testing in request_irq is mishandled in
um_request_irq, which sets the incoming file descriptors non-blocking
only after request_irq succeeds.  This results in the spurious irq
calling read on a blocking descriptor, and a hang.

Fixed by reversing the O_NONBLOCK setting and the request_irq call.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
---
 arch/um/kernel/irq.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Index: linux-2.6.22/arch/um/kernel/irq.c
===================================================================
--- linux-2.6.22.orig/arch/um/kernel/irq.c	2007-10-25 12:23:09.000000000 -0400
+++ linux-2.6.22/arch/um/kernel/irq.c	2007-10-29 13:00:18.000000000 -0400
@@ -347,14 +347,15 @@ int um_request_irq(unsigned int irq, int
 {
 	int err;
 
-	err = request_irq(irq, handler, irqflags, devname, dev_id);
-	if (err)
-		return err;
-
-	if (fd != -1)
+	if (fd != -1) {
 		err = activate_fd(irq, fd, type, dev_id);
-	return err;
+		if (err)
+			return err;
+	}
+
+	return request_irq(irq, handler, irqflags, devname, dev_id);
 }
+
 EXPORT_SYMBOL(um_request_irq);
 EXPORT_SYMBOL(reactivate_fd);
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/4] UML - Fix spurious IRQ testing
@ 2007-10-31 19:59 ` Jeff Dike
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Dike @ 2007-10-31 19:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, uml-devel

The spurious IRQ testing in request_irq is mishandled in
um_request_irq, which sets the incoming file descriptors non-blocking
only after request_irq succeeds.  This results in the spurious irq
calling read on a blocking descriptor, and a hang.

Fixed by reversing the O_NONBLOCK setting and the request_irq call.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
---
 arch/um/kernel/irq.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Index: linux-2.6.22/arch/um/kernel/irq.c
===================================================================
--- linux-2.6.22.orig/arch/um/kernel/irq.c	2007-10-25 12:23:09.000000000 -0400
+++ linux-2.6.22/arch/um/kernel/irq.c	2007-10-29 13:00:18.000000000 -0400
@@ -347,14 +347,15 @@ int um_request_irq(unsigned int irq, int
 {
 	int err;
 
-	err = request_irq(irq, handler, irqflags, devname, dev_id);
-	if (err)
-		return err;
-
-	if (fd != -1)
+	if (fd != -1) {
 		err = activate_fd(irq, fd, type, dev_id);
-	return err;
+		if (err)
+			return err;
+	}
+
+	return request_irq(irq, handler, irqflags, devname, dev_id);
 }
+
 EXPORT_SYMBOL(um_request_irq);
 EXPORT_SYMBOL(reactivate_fd);
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-31 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-31 19:59 [uml-devel] [PATCH 1/4] UML - Fix spurious IRQ testing Jeff Dike
2007-10-31 19:59 ` Jeff Dike

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.