diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-09-02 13:29:46 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 13:56:53 -0700 |
commit | e2b31644e999e8bfe3efce880fb32840299abf41 (patch) | |
tree | 092f58faecfc5a79efc4e31c709f6312a38c255f /drivers/misc/mei/bus.c | |
parent | 1aee351a739153529fbb98ee461777b2abd5e1c9 (diff) | |
download | op-kernel-dev-e2b31644e999e8bfe3efce880fb32840299abf41.zip op-kernel-dev-e2b31644e999e8bfe3efce880fb32840299abf41.tar.gz |
mei: bus: stop wait for read during cl state transition
Bus layer omitted check for client state transition while waiting
for read completion
The client state transition may occur for example as result
of firmware initiated reset
Add mei_cl_is_transitioning wrapper to reduce the code
repetition.:
Cc: <stable@vger.kernel.org> # 3.9+
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/bus.c')
-rw-r--r-- | drivers/misc/mei/bus.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 6d0282c..cd2033c 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -297,10 +297,13 @@ int __mei_cl_recv(struct mei_cl *cl, u8 *buf, size_t length) if (cl->reading_state != MEI_READ_COMPLETE && !waitqueue_active(&cl->rx_wait)) { + mutex_unlock(&dev->device_lock); if (wait_event_interruptible(cl->rx_wait, - (MEI_READ_COMPLETE == cl->reading_state))) { + cl->reading_state == MEI_READ_COMPLETE || + mei_cl_is_transitioning(cl))) { + if (signal_pending(current)) return -EINTR; return -ERESTARTSYS; |