summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/client.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2013-09-02 12:29:46 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 22:56:53 +0200
commite2b31644e999e8bfe3efce880fb32840299abf41 (patch)
tree092f58faecfc5a79efc4e31c709f6312a38c255f /drivers/misc/mei/client.h
parentmei: make me client counters less error prone (diff)
downloadlinux-e2b31644e999e8bfe3efce880fb32840299abf41.tar.xz
linux-e2b31644e999e8bfe3efce880fb32840299abf41.zip
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.h6
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);