greybus: loopback: convert loopback wake/sleep to a waitqueue
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Fri, 24 Jul 2015 09:02:56 +0000 (10:02 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 24 Jul 2015 23:18:35 +0000 (16:18 -0700)
commit3dfe8aaaeede22b0601c95cf1a4c2eadcb3851ba
tree42459b2f73924da76a18e2c343934a519724070f
parentc2939f41bca86d30388e6fa48e469a4e748b71e2
greybus: loopback: convert loopback wake/sleep to a waitqueue

Current code will incrementally poll for gb->type == 0 and sleep.
This type of polling strategy wastes cycles.

This patch changes the sleep strategy by introducing a wait-queue which
waits for gb->type != 0 or kthread_should_stop() to wake-up and work or
to wake-up and terminate.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c