diff options
author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-06-22 23:41:15 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-06-22 23:41:14 -0700 |
commit | c9b4dc7067dd229908daf79cc1478081cde5ab7c (patch) | |
tree | 13ee4595a783e04bbb8e021d39f978cbe1fd2c73 /drivers/usb/gadget | |
parent | a21b8a6a89c17ca29630f619d833f187df907135 (diff) | |
parent | e0a0b484bf394e1f5e5ecf48ec9af7d57bcd8083 (diff) |
Merge "Merge branch 'android-4.4@e76c0fa' into branch 'msm-4.4'"
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/function/f_mass_storage.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 59d6ac67d072..9b7274821d0b 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -399,7 +399,11 @@ static int fsg_set_halt(struct fsg_dev *fsg, struct usb_ep *ep) /* Caller must hold fsg->lock */ static void wakeup_thread(struct fsg_common *common) { - smp_wmb(); /* ensure the write of bh->state is complete */ + /* + * Ensure the reading of thread_wakeup_needed + * and the writing of bh->state are completed + */ + smp_mb(); /* Tell the main thread that something has happened */ common->thread_wakeup_needed = 1; if (common->thread_task) @@ -649,7 +653,12 @@ static int sleep_thread(struct fsg_common *common, bool can_freeze) } __set_current_state(TASK_RUNNING); common->thread_wakeup_needed = 0; - smp_rmb(); /* ensure the latest bh->state is visible */ + + /* + * Ensure the writing of thread_wakeup_needed + * and the reading of bh->state are completed + */ + smp_mb(); return rc; } |