diff options
author | Alexander Usyskin <alexander.usyskin@intel.com> | 2014-02-17 15:13:20 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-18 10:05:07 -0800 |
commit | 285e2996655b7bbfb5eb83076a7d7e6f03e2f5c2 (patch) | |
tree | 2c90567eed399090fd5c41cd6ae88eeaef6246da /drivers/misc/mei/client.c | |
parent | 487056932d372cc4f6c636f21a928d6667b151d7 (diff) |
mei: hbm: revamp client connect and disconnection status
1. Return -ENOTTY on client connect if the requested client was not found
on the enumeration list or the client was internally disabled, in the later
case FW will return NOT_FOUND.
2. Return -EBUSY if the client cannot be connected because of resource
contention
3. Change response status enum to have MEI_CL_ prefix
4. Add function to translate response status to a string
for more readable logging
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
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.c')
-rw-r--r-- | drivers/misc/mei/client.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index 9ac72f1ea6b..8afba053477 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -521,18 +521,19 @@ int mei_cl_connect(struct mei_cl *cl, struct file *file) } mutex_unlock(&dev->device_lock); - rets = wait_event_timeout(dev->wait_recvd_msg, - (cl->state == MEI_FILE_CONNECTED || - cl->state == MEI_FILE_DISCONNECTED), - mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); + wait_event_timeout(dev->wait_recvd_msg, + (cl->state == MEI_FILE_CONNECTED || + cl->state == MEI_FILE_DISCONNECTED), + mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); mutex_lock(&dev->device_lock); if (cl->state != MEI_FILE_CONNECTED) { - rets = -EFAULT; + /* something went really wrong */ + if (!cl->status) + cl->status = -EFAULT; mei_io_list_flush(&dev->ctrl_rd_list, cl); mei_io_list_flush(&dev->ctrl_wr_list, cl); - goto out; } rets = cl->status; |