[PATCH 8/8] staging: tidspbridge - make sync_wait_on_event interruptible

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Fernando Guzman Lugo
Date: Monday, October 25, 2010 - 5:51 pm

So that avoid non-killable process.

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
---
 .../staging/tidspbridge/include/dspbridge/sync.h   |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tidspbridge/include/dspbridge/sync.h b/drivers/staging/tidspbridge/include/dspbridge/sync.h
index e2651e7..df05b8f 100644
--- a/drivers/staging/tidspbridge/include/dspbridge/sync.h
+++ b/drivers/staging/tidspbridge/include/dspbridge/sync.h
@@ -80,13 +80,22 @@ void sync_set_event(struct sync_object *event);
  * This functios will wait until @event is set or until timeout. In case of
  * success the function will return 0 and
  * in case of timeout the function will return -ETIME
+ * in case of signal the function will return -ERESTARTSYS
  */
 
 static inline int sync_wait_on_event(struct sync_object *event,
 							unsigned timeout)
 {
-	return wait_for_completion_timeout(&event->comp,
-		msecs_to_jiffies(timeout)) ? 0 : -ETIME;
+	int res;
+
+	res = wait_for_completion_interruptible_timeout(&event->comp,
+						msecs_to_jiffies(timeout));
+	if (!res)
+		res = -ETIME;
+	else if (res > 0)
+		res = 0;
+
+	return res;
 }
 
 /**
-- 
1.6.3.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/8] staging: tidspbridge - misc fixes, Fernando Guzman Lugo, (Mon Oct 25, 5:51 pm)
[PATCH 1/8] staging: tidspbridge - remove req_addr from pr ..., Fernando Guzman Lugo, (Mon Oct 25, 5:51 pm)
[PATCH 2/8] staging: tidspbridge - add kconfig parameter f ..., Fernando Guzman Lugo, (Mon Oct 25, 5:51 pm)
[PATCH 3/8] staging: tidspbridge - change mmufault tasklet ..., Fernando Guzman Lugo, (Mon Oct 25, 5:51 pm)
[PATCH 4/8] staging: tidspbridge - fix timeout in dsp_gpt_ ..., Fernando Guzman Lugo, (Mon Oct 25, 5:51 pm)
[PATCH 5/8] staging: tidspbridge - use GTP7 for DSP stack dump, Fernando Guzman Lugo, (Mon Oct 25, 5:51 pm)
[PATCH 6/8] staging: tidspbridge - remove disabling twl wh ..., Fernando Guzman Lugo, (Mon Oct 25, 5:51 pm)
[PATCH 7/8] staging: tidspbridge - fix some issues after i ..., Fernando Guzman Lugo, (Mon Oct 25, 5:51 pm)
[PATCH 8/8] staging: tidspbridge - make sync_wait_on_event ..., Fernando Guzman Lugo, (Mon Oct 25, 5:51 pm)
Re: [PATCH 0/8] staging: tidspbridge - misc fixes, Felipe Contreras, (Tue Oct 26, 7:43 am)
Re: [PATCH 0/8] staging: tidspbridge - misc fixes, Omar Ramirez Luna, (Tue Oct 26, 7:55 am)
RE: [PATCH 0/8] staging: tidspbridge - misc fixes, Guzman Lugo, Fernando, (Tue Oct 26, 8:46 am)
RE: [PATCH 8/8] staging: tidspbridge - make sync_wait_on_e ..., Guzman Lugo, Fernando, (Tue Oct 26, 8:50 am)
RE: [PATCH 1/8] staging: tidspbridge - remove req_addr fro ..., Guzman Lugo, Fernando, (Tue Oct 26, 8:52 am)
RE: [PATCH 8/8] staging: tidspbridge - make sync_wait_on_e ..., Felipe Contreras, (Tue Oct 26, 10:03 am)
RE: [PATCH 1/8] staging: tidspbridge - remove req_addr fro ..., Felipe Contreras, (Tue Oct 26, 10:07 am)
RE: [PATCH 8/8] staging: tidspbridge - make sync_wait_on_e ..., Guzman Lugo, Fernando, (Tue Oct 26, 10:58 am)
RE: [PATCH 1/8] staging: tidspbridge - remove req_addr fro ..., Guzman Lugo, Fernando, (Tue Oct 26, 11:08 am)
RE: [PATCH 8/8] staging: tidspbridge - make sync_wait_on_e ..., Felipe Contreras, (Tue Oct 26, 12:27 pm)
RE: [PATCH 1/8] staging: tidspbridge - remove req_addr fro ..., Felipe Contreras, (Tue Oct 26, 12:37 pm)
RE: [PATCH 8/8] staging: tidspbridge - make sync_wait_on_e ..., Guzman Lugo, Fernando, (Tue Oct 26, 1:01 pm)
RE: [PATCH 1/8] staging: tidspbridge - remove req_addr fro ..., Guzman Lugo, Fernando, (Tue Oct 26, 1:39 pm)
RE: [PATCH 1/8] staging: tidspbridge - remove req_addr fro ..., Guzman Lugo, Fernando, (Thu Oct 28, 8:38 am)
Re: [PATCH 1/8] staging: tidspbridge - remove req_addr fro ..., Russell King - ARM Linux, (Thu Oct 28, 8:56 am)
Re: [PATCH 8/8] staging: tidspbridge - make sync_wait_on_e ..., Ramirez Luna, Omar, (Mon Dec 6, 1:51 am)