aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/client.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2013-09-16 16:44:43 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 11:42:02 -0400
commit2ebf8c94d431078d93599ba56efa58bf850078a1 (patch)
tree73090229bb39f830da0f32794ac216e5c4424464 /drivers/misc/mei/client.c
parent0da90747353c0f5b663c9c25fd56cd21440d222c (diff)
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/client.c')
-rw-r--r--drivers/misc/mei/client.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index bccc3164ea4c..1a53d961302a 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -706,6 +706,7 @@ int mei_cl_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
706 struct mei_msg_hdr mei_hdr; 706 struct mei_msg_hdr mei_hdr;
707 size_t len = cb->request_buffer.size - cb->buf_idx; 707 size_t len = cb->request_buffer.size - cb->buf_idx;
708 u32 msg_slots = mei_data2slots(len); 708 u32 msg_slots = mei_data2slots(len);
709 int rets;
709 710
710 mei_hdr.host_addr = cl->host_client_id; 711 mei_hdr.host_addr = cl->host_client_id;
711 mei_hdr.me_addr = cl->me_client_id; 712 mei_hdr.me_addr = cl->me_client_id;
@@ -729,11 +730,12 @@ int mei_cl_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
729 cb->request_buffer.size, cb->buf_idx); 730 cb->request_buffer.size, cb->buf_idx);
730 731
731 *slots -= msg_slots; 732 *slots -= msg_slots;
732 if (mei_write_message(dev, &mei_hdr, 733 rets = mei_write_message(dev, &mei_hdr,
733 cb->request_buffer.data + cb->buf_idx)) { 734 cb->request_buffer.data + cb->buf_idx);
734 cl->status = -ENODEV; 735 if (rets) {
736 cl->status = rets;
735 list_move_tail(&cb->list, &cmpl_list->list); 737 list_move_tail(&cb->list, &cmpl_list->list);
736 return -ENODEV; 738 return rets;
737 } 739 }
738 740
739 cl->status = 0; 741 cl->status = 0;
@@ -742,7 +744,7 @@ int mei_cl_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
742 744
743 if (mei_hdr.msg_complete) { 745 if (mei_hdr.msg_complete) {
744 if (mei_cl_flow_ctrl_reduce(cl)) 746 if (mei_cl_flow_ctrl_reduce(cl))
745 return -ENODEV; 747 return -EIO;
746 list_move_tail(&cb->list, &dev->write_waiting_list.list); 748 list_move_tail(&cb->list, &dev->write_waiting_list.list);
747 } 749 }
748 750
@@ -811,10 +813,9 @@ int mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, bool blocking)
811 mei_hdr.reserved = 0; 813 mei_hdr.reserved = 0;
812 814
813 815
814 if (mei_write_message(dev, &mei_hdr, buf->data)) { 816 rets = mei_write_message(dev, &mei_hdr, buf->data);
815 rets = -EIO; 817 if (rets)
816 goto err; 818 goto err;
817 }
818 819
819 cl->writing_state = MEI_WRITING; 820 cl->writing_state = MEI_WRITING;
820 cb->buf_idx = mei_hdr.length; 821 cb->buf_idx = mei_hdr.length;