Commit 77cf3f5d authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Greg Kroah-Hartman

staging: vchiq: make wait events interruptible

The killable version of wait_event() is meant to be used on situations
where it should not fail at all costs, but still have the convenience of
being able to kill it if really necessary. Wait events in VCHIQ doesn't
fit this criteria, as it's mainly used as an interface to V4L2 and ALSA
devices.

Fixes: 852b2876 ("staging: vchiq: rework remove_event handling")
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 086efbab
...@@ -395,13 +395,21 @@ remote_event_create(wait_queue_head_t *wq, struct remote_event *event) ...@@ -395,13 +395,21 @@ remote_event_create(wait_queue_head_t *wq, struct remote_event *event)
init_waitqueue_head(wq); init_waitqueue_head(wq);
} }
/*
* All the event waiting routines in VCHIQ used a custom semaphore
* implementation that filtered most signals. This achieved a behaviour similar
* to the "killable" family of functions. While cleaning up this code all the
* routines where switched to the "interruptible" family of functions, as the
* former was deemed unjustified and the use "killable" set all VCHIQ's
* threads in D state.
*/
static inline int static inline int
remote_event_wait(wait_queue_head_t *wq, struct remote_event *event) remote_event_wait(wait_queue_head_t *wq, struct remote_event *event)
{ {
if (!event->fired) { if (!event->fired) {
event->armed = 1; event->armed = 1;
dsb(sy); dsb(sy);
if (wait_event_killable(*wq, event->fired)) { if (wait_event_interruptible(*wq, event->fired)) {
event->armed = 0; event->armed = 0;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment