From: Arnd Bergmann Date: Thu, 2 Jan 2014 12:07:37 +0000 (+0100) Subject: cris: sync_serial: remove interruptible_sleep_on X-Git-Tag: v3.14-rc1~86^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=329fddd7b60cf6aed53cdb6fdc8e64117b8e8bc6;p=profile%2Fivi%2Fkernel-x86-ivi.git cris: sync_serial: remove interruptible_sleep_on sleep_on and its variants are racy and going away. This replaces the two uses in the cris sync_serial drivers with the equivalent but race-free wait_event_interruptible. Signed-off-by: Arnd Bergmann Cc: Mikael Starvik Cc: linux-cris-kernel@axis.com Signed-off-by: Jesper Nilsson --- diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index 04d39e0..29eb02a 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1136,7 +1137,8 @@ static ssize_t sync_serial_read(struct file *file, char *buf, if (file->f_flags & O_NONBLOCK) return -EAGAIN; - interruptible_sleep_on(&port->in_wait_q); + wait_event_interruptible(port->in_wait_q, + !(start == end && !port->full)); if (signal_pending(current)) return -EINTR; diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index 219f704..bbb806b 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -1144,7 +1145,8 @@ static ssize_t sync_serial_read(struct file * file, char * buf, if (file->f_flags & O_NONBLOCK) return -EAGAIN; - interruptible_sleep_on(&port->in_wait_q); + wait_event_interruptible(port->in_wait_q, + !(start == end && !port->full)); if (signal_pending(current)) return -EINTR;