diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-07-25 20:15:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-26 17:54:30 -0700 |
commit | b950ac1dabfcbf97b99f26fa75f86087e1960aef (patch) | |
tree | d9ef0e00c79acedc8eebdd3d61a460d7bbff962f /drivers/misc/mei/client.h | |
parent | 20138d6cb838aa01bb1b382dcb5f3d3a119ff2cb (diff) | |
download | linux-b950ac1dabfcbf97b99f26fa75f86087e1960aef.tar.gz linux-b950ac1dabfcbf97b99f26fa75f86087e1960aef.tar.bz2 linux-b950ac1dabfcbf97b99f26fa75f86087e1960aef.zip |
mei: don't get stuck in select during reset
Clear pending connection after hw reset but before hw start
and wake up the waiting task in poll. Signal POLLERR in select
when device went through reset.
Add wrapper mei_cl_is_connected for checking if
the device and client are connected.
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 | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/misc/mei/client.h b/drivers/misc/mei/client.h index 9bae4c724603..9eb031e92070 100644 --- a/drivers/misc/mei/client.h +++ b/drivers/misc/mei/client.h @@ -84,6 +84,13 @@ int mei_cl_flow_ctrl_reduce(struct mei_cl *cl); /* * MEI input output function prototype */ +static inline bool mei_cl_is_connected(struct mei_cl *cl) +{ + return (cl->dev && + cl->dev->dev_state == MEI_DEV_ENABLED && + cl->state == MEI_FILE_CONNECTED); +} + bool mei_cl_is_other_connecting(struct mei_cl *cl); int mei_cl_disconnect(struct mei_cl *cl); int mei_cl_connect(struct mei_cl *cl, struct file *file); |