diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-09-02 14:29:46 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-27 00:56:53 +0400 |
commit | e2b31644e999e8bfe3efce880fb32840299abf41 (patch) | |
tree | 092f58faecfc5a79efc4e31c709f6312a38c255f /drivers/misc/mei/client.h | |
parent | 1aee351a739153529fbb98ee461777b2abd5e1c9 (diff) | |
download | linux-e2b31644e999e8bfe3efce880fb32840299abf41.tar.xz |
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/client.h')
-rw-r--r-- | drivers/misc/mei/client.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/mei/client.h b/drivers/misc/mei/client.h index 9eb031e92070..892cc4207fa2 100644 --- a/drivers/misc/mei/client.h +++ b/drivers/misc/mei/client.h @@ -90,6 +90,12 @@ static inline bool mei_cl_is_connected(struct mei_cl *cl) cl->dev->dev_state == MEI_DEV_ENABLED && cl->state == MEI_FILE_CONNECTED); } +static inline bool mei_cl_is_transitioning(struct mei_cl *cl) +{ + return (MEI_FILE_INITIALIZING == cl->state || + MEI_FILE_DISCONNECTED == cl->state || + MEI_FILE_DISCONNECTING == cl->state); +} bool mei_cl_is_other_connecting(struct mei_cl *cl); int mei_cl_disconnect(struct mei_cl *cl); |