summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/u_fs.h
diff options
context:
space:
mode:
authorJohn Keeping <john@metanate.com>2017-09-12 10:24:40 +0100
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-09-28 12:37:24 +0300
commitaddfc5823dbf3e6ed400e98e49c7e64b10e191d6 (patch)
tree14a9eb490836ad46c806a6dccd4c900b8c35e2de /drivers/usb/gadget/function/u_fs.h
parent0a2ce62b61f2c76d0213edf4e37aaf54a8ddf295 (diff)
downloadlinux-addfc5823dbf3e6ed400e98e49c7e64b10e191d6.tar.bz2
usb: gadget: ffs: handle I/O completion in-order
By submitting completed transfers to the system workqueue there is no guarantee that completion events will be queued up in the correct order, as in multi-processor systems there is a thread running for each processor and the work items are not bound to a particular core. This means that several completions are in the queue at the same time, they may be processed in parallel and complete out of order, resulting in data appearing corrupt when read by userspace. Create a single-threaded workqueue for FunctionFS so that data completed requests is passed to userspace in the order in which they complete. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/function/u_fs.h')
-rw-r--r--drivers/usb/gadget/function/u_fs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/u_fs.h b/drivers/usb/gadget/function/u_fs.h
index 540f1c48c1a8..79f70ebf85dc 100644
--- a/drivers/usb/gadget/function/u_fs.h
+++ b/drivers/usb/gadget/function/u_fs.h
@@ -279,6 +279,7 @@ struct ffs_data {
} file_perms;
struct eventfd_ctx *ffs_eventfd;
+ struct workqueue_struct *io_completion_wq;
bool no_disconnect;
struct work_struct reset_work;