diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-09-16 23:44:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 08:42:02 -0700 |
commit | 2ebf8c94d431078d93599ba56efa58bf850078a1 (patch) | |
tree | 73090229bb39f830da0f32794ac216e5c4424464 /drivers/misc/mei/interrupt.c | |
parent | 0da90747353c0f5b663c9c25fd56cd21440d222c (diff) | |
download | blackbird-op-linux-2ebf8c94d431078d93599ba56efa58bf850078a1.tar.gz blackbird-op-linux-2ebf8c94d431078d93599ba56efa58bf850078a1.zip |
mei: propagate error from write routines instead of ENODEV
ENODEV will cause application to try to reconnect since
it assumes that device went through the reset
write errors are not always fatal it can happen due to
resource contention
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/interrupt.c')
-rw-r--r-- | drivers/misc/mei/interrupt.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index be42c700b15a..e4bb9aee40a1 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -216,9 +216,11 @@ static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb, s32 *slots, struct mei_cl_cb *cmpl_list) { struct mei_device *dev = cl->dev; - u32 msg_slots = mei_data2slots(sizeof(struct hbm_flow_control)); + int ret; + + if (*slots < msg_slots) { /* return the cancel routine */ list_del(&cb->list); @@ -227,12 +229,14 @@ static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb, *slots -= msg_slots; - if (mei_hbm_cl_flow_control_req(dev, cl)) { - cl->status = -ENODEV; + ret = mei_hbm_cl_flow_control_req(dev, cl); + if (ret) { + cl->status = ret; cb->buf_idx = 0; list_move_tail(&cb->list, &cmpl_list->list); - return -ENODEV; + return ret; } + list_move_tail(&cb->list, &dev->read_list.list); return 0; @@ -254,6 +258,7 @@ static int mei_cl_irq_ioctl(struct mei_cl *cl, struct mei_cl_cb *cb, s32 *slots, struct mei_cl_cb *cmpl_list) { struct mei_device *dev = cl->dev; + int ret; u32 msg_slots = mei_data2slots(sizeof(struct hbm_client_connect_request)); @@ -268,11 +273,12 @@ static int mei_cl_irq_ioctl(struct mei_cl *cl, struct mei_cl_cb *cb, cl->state = MEI_FILE_CONNECTING; - if (mei_hbm_cl_connect_req(dev, cl)) { - cl->status = -ENODEV; + ret = mei_hbm_cl_connect_req(dev, cl); + if (ret) { + cl->status = ret; cb->buf_idx = 0; list_del(&cb->list); - return -ENODEV; + return ret; } list_move_tail(&cb->list, &dev->ctrl_rd_list.list); |