greybus: loopback: make loopback code thread safe
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Tue, 28 Jul 2015 17:34:36 +0000 (18:34 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 28 Jul 2015 21:50:02 +0000 (14:50 -0700)
commit85d678c0bee883c63b760b35a4104feac9018a0f
tree72d37243e53ea2d87bab0def4fb053c17203b124
parenta7e60062b022d1ce1104610d0b0c37322aeb66b6
greybus: loopback: make loopback code thread safe

Current code allows a sysfs callback and a kernel worker thread to write
all over and act upon data that could be in the process of being updated by
the other. This patch adds a reasonably coarse mutex to enscure sync
between the two.

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