From 89df6bfc04059716de2eb2fe529f05b3e124fafd Mon Sep 17 00:00:00 2001 From: Eduard-Gabriel Munteanu Date: Sun, 15 Jul 2007 23:38:51 -0700 Subject: uml: DEBUG_SHIRQ fixes DEBUG_SHIRQ generates spurious interrupts, triggering handlers such as mconsole_interrupt() or line_interrupt(). They expect data to be available to be read from their sockets/pipes, but in the case of spurious interrupts, the host didn't actually send anything, so UML hangs in read() and friends. Setting those fd's as O_NONBLOCK makes DEBUG_SHIRQ-enabled UML kernels boot and run correctly. Signed-off-by: Eduard-Gabriel Munteanu Signed-off-by: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/drivers/chan_user.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'arch/um/drivers/chan_user.c') diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c index 13f0bf852b2..5d1289d3341 100644 --- a/arch/um/drivers/chan_user.c +++ b/arch/um/drivers/chan_user.c @@ -170,7 +170,13 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out) err = -EINVAL; goto out_close; } - return err ; + + if (os_set_fd_block(*fd_out, 0)) { + printk("winch_tramp: failed to set thread_fd non-blocking.\n"); + goto out_close; + } + + return err; out_close: os_close_file(fds[1]); -- cgit v1.2.3