Skip to content

Commit

Permalink
uml: fix spurious IRQ testing
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Nov 15, 2007
1 parent 7c06a8d commit 9ac625a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions arch/um/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,15 @@ int um_request_irq(unsigned int irq, int fd, int type,
{
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);

Expand Down

0 comments on commit 9ac625a

Please sign in to comment.