diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2015-12-02 18:23:31 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-12-02 16:55:45 -0800 |
commit | 3e48acac26c8b5321ff5b752c8650e1cf4d04344 (patch) | |
tree | 74ac46877e418e3eca54d9802cfe62db1ad52a71 /drivers/staging/greybus/svc.h | |
parent | 57ccd4b08767bc3c44d3752bddcb6d6cad78830c (diff) |
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.h | 1 |
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; |