aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/svc.h
diff options
context:
space:
mode:
authorGravatar Johan Hovold <johan@hovoldconsulting.com> 2015-12-02 18:23:31 +0100
committerGravatar Greg Kroah-Hartman <gregkh@google.com> 2015-12-02 16:55:45 -0800
commit3e48acac26c8b5321ff5b752c8650e1cf4d04344 (patch)
tree74ac46877e418e3eca54d9802cfe62db1ad52a71 /drivers/staging/greybus/svc.h
parentgreybus: svc: defer processing of hot-unplug requests (diff)
downloadlinux-3e48acac26c8b5321ff5b752c8650e1cf4d04344.tar.gz
linux-3e48acac26c8b5321ff5b752c8650e1cf4d04344.tar.bz2
linux-3e48acac26c8b5321ff5b752c8650e1cf4d04344.zip
greybus: svc: fix racy hotplug handling
Fix racy hotplug handling by serialising all processing of hot-plug and unplug requests using a single-threaded dedicated workqueue. This fixes a reported crash during enumeration when processing multiple events. The current svc implementation does not handle concurrency at all (e.g. no interface list lock or refcounting) so we need to use the big hammer for now. Note that we will eventually want to process events for different interfaces in parallel, but that we'd still need a workqueue in order not to starve other svc requests (e.g. for timesync). Reported-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/svc.h')
-rw-r--r--drivers/staging/greybus/svc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/greybus/svc.h b/drivers/staging/greybus/svc.h
index 99be0411d000..3acfa07cc73b 100644
--- a/drivers/staging/greybus/svc.h
+++ b/drivers/staging/greybus/svc.h
@@ -22,6 +22,7 @@ struct gb_svc {
struct gb_connection *connection;
enum gb_svc_state state;
struct ida device_id_map;
+ struct workqueue_struct *wq;
u16 endo_id;
u8 ap_intf_id;