diff options
author | Guzman Lugo, Fernando <x0095840@ti.com> | 2010-10-26 00:51:46 (GMT) |
---|---|---|
committer | Omar Ramirez Luna <omar.ramirez@ti.com> | 2011-02-05 02:11:08 (GMT) |
commit | 4097c4968cd60bf5c690455466731d11149fe43f (patch) | |
tree | 761e406cbf870c49aadf2ceb43a94490af9440d3 | |
parent | ebf53826e105f488f4f628703a108e98940d1dc5 (diff) | |
download | linux-fsl-qoriq-4097c4968cd60bf5c690455466731d11149fe43f.tar.xz |
staging: tidspbridge: make sync_wait_on_event interruptible
So that avoid non-killable process.
Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
-rw-r--r-- | drivers/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; } /** |