aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2014-02-19 10:35:48 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-28 18:15:57 -0500
commit9d098192c3d45ab6dd90ae87d649950a9ef70ccb (patch)
treea0f48fbc9a60e411cd499a22ac013f85fbb0aeeb /drivers/misc/mei
parent6aae48ff18f2fcfb533d2b448ecae16d1de006c1 (diff)
mei: revamp writing slot counting
Since txe use doorbell and not circular buffer we have to cheat in write slot counting, txe always consume all the slots upon write. In order for it to work we need to track slots using mei_hbuf_empty_slots() instead of tracking it in mei layer Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r--drivers/misc/mei/amthif.c19
-rw-r--r--drivers/misc/mei/client.c19
-rw-r--r--drivers/misc/mei/client.h4
-rw-r--r--drivers/misc/mei/hw-me.c2
-rw-r--r--drivers/misc/mei/hw-txe.c21
-rw-r--r--drivers/misc/mei/hw-txe.h1
-rw-r--r--drivers/misc/mei/interrupt.c78
-rw-r--r--drivers/misc/mei/mei_dev.h4
8 files changed, 68 insertions, 80 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index e7ba8801d2b4..bff9a07f1af5 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -436,23 +436,23 @@ unsigned int mei_amthif_poll(struct mei_device *dev,
436 436
437 437
438/** 438/**
439 * mei_amthif_irq_write_completed - processes completed iamthif operation. 439 * mei_amthif_irq_write - write iamthif command in irq thread context.
440 * 440 *
441 * @dev: the device structure. 441 * @dev: the device structure.
442 * @slots: free slots.
443 * @cb_pos: callback block. 442 * @cb_pos: callback block.
444 * @cl: private data of the file object. 443 * @cl: private data of the file object.
445 * @cmpl_list: complete list. 444 * @cmpl_list: complete list.
446 * 445 *
447 * returns 0, OK; otherwise, error. 446 * returns 0, OK; otherwise, error.
448 */ 447 */
449int mei_amthif_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb, 448int mei_amthif_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
450 s32 *slots, struct mei_cl_cb *cmpl_list) 449 struct mei_cl_cb *cmpl_list)
451{ 450{
452 struct mei_device *dev = cl->dev; 451 struct mei_device *dev = cl->dev;
453 struct mei_msg_hdr mei_hdr; 452 struct mei_msg_hdr mei_hdr;
454 size_t len = dev->iamthif_msg_buf_size - dev->iamthif_msg_buf_index; 453 size_t len = dev->iamthif_msg_buf_size - dev->iamthif_msg_buf_index;
455 u32 msg_slots = mei_data2slots(len); 454 u32 msg_slots = mei_data2slots(len);
455 int slots;
456 int rets; 456 int rets;
457 457
458 rets = mei_cl_flow_ctrl_creds(cl); 458 rets = mei_cl_flow_ctrl_creds(cl);
@@ -469,13 +469,15 @@ int mei_amthif_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
469 mei_hdr.reserved = 0; 469 mei_hdr.reserved = 0;
470 mei_hdr.internal = 0; 470 mei_hdr.internal = 0;
471 471
472 if (*slots >= msg_slots) { 472 slots = mei_hbuf_empty_slots(dev);
473
474 if (slots >= msg_slots) {
473 mei_hdr.length = len; 475 mei_hdr.length = len;
474 mei_hdr.msg_complete = 1; 476 mei_hdr.msg_complete = 1;
475 /* Split the message only if we can write the whole host buffer */ 477 /* Split the message only if we can write the whole host buffer */
476 } else if (*slots == dev->hbuf_depth) { 478 } else if (slots == dev->hbuf_depth) {
477 msg_slots = *slots; 479 msg_slots = slots;
478 len = (*slots * sizeof(u32)) - sizeof(struct mei_msg_hdr); 480 len = (slots * sizeof(u32)) - sizeof(struct mei_msg_hdr);
479 mei_hdr.length = len; 481 mei_hdr.length = len;
480 mei_hdr.msg_complete = 0; 482 mei_hdr.msg_complete = 0;
481 } else { 483 } else {
@@ -485,7 +487,6 @@ int mei_amthif_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
485 487
486 dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(&mei_hdr)); 488 dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(&mei_hdr));
487 489
488 *slots -= msg_slots;
489 rets = mei_write_message(dev, &mei_hdr, 490 rets = mei_write_message(dev, &mei_hdr,
490 dev->iamthif_msg_buf + dev->iamthif_msg_buf_index); 491 dev->iamthif_msg_buf + dev->iamthif_msg_buf_index);
491 if (rets) { 492 if (rets) {
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 083179b75297..2b0f99955ba6 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -698,27 +698,26 @@ err:
698} 698}
699 699
700/** 700/**
701 * mei_cl_irq_write_complete - write a message to device 701 * mei_cl_irq_write - write a message to device
702 * from the interrupt thread context 702 * from the interrupt thread context
703 * 703 *
704 * @cl: client 704 * @cl: client
705 * @cb: callback block. 705 * @cb: callback block.
706 * @slots: free slots.
707 * @cmpl_list: complete list. 706 * @cmpl_list: complete list.
708 * 707 *
709 * returns 0, OK; otherwise error. 708 * returns 0, OK; otherwise error.
710 */ 709 */
711int mei_cl_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb, 710int mei_cl_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
712 s32 *slots, struct mei_cl_cb *cmpl_list) 711 struct mei_cl_cb *cmpl_list)
713{ 712{
714 struct mei_device *dev; 713 struct mei_device *dev;
715 struct mei_msg_data *buf; 714 struct mei_msg_data *buf;
716 struct mei_msg_hdr mei_hdr; 715 struct mei_msg_hdr mei_hdr;
717 size_t len; 716 size_t len;
718 u32 msg_slots; 717 u32 msg_slots;
718 int slots;
719 int rets; 719 int rets;
720 720
721
722 if (WARN_ON(!cl || !cl->dev)) 721 if (WARN_ON(!cl || !cl->dev))
723 return -ENODEV; 722 return -ENODEV;
724 723
@@ -735,6 +734,7 @@ int mei_cl_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
735 return 0; 734 return 0;
736 } 735 }
737 736
737 slots = mei_hbuf_empty_slots(dev);
738 len = buf->size - cb->buf_idx; 738 len = buf->size - cb->buf_idx;
739 msg_slots = mei_data2slots(len); 739 msg_slots = mei_data2slots(len);
740 740
@@ -743,13 +743,13 @@ int mei_cl_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
743 mei_hdr.reserved = 0; 743 mei_hdr.reserved = 0;
744 mei_hdr.internal = cb->internal; 744 mei_hdr.internal = cb->internal;
745 745
746 if (*slots >= msg_slots) { 746 if (slots >= msg_slots) {
747 mei_hdr.length = len; 747 mei_hdr.length = len;
748 mei_hdr.msg_complete = 1; 748 mei_hdr.msg_complete = 1;
749 /* Split the message only if we can write the whole host buffer */ 749 /* Split the message only if we can write the whole host buffer */
750 } else if (*slots == dev->hbuf_depth) { 750 } else if (slots == dev->hbuf_depth) {
751 msg_slots = *slots; 751 msg_slots = slots;
752 len = (*slots * sizeof(u32)) - sizeof(struct mei_msg_hdr); 752 len = (slots * sizeof(u32)) - sizeof(struct mei_msg_hdr);
753 mei_hdr.length = len; 753 mei_hdr.length = len;
754 mei_hdr.msg_complete = 0; 754 mei_hdr.msg_complete = 0;
755 } else { 755 } else {
@@ -760,7 +760,6 @@ int mei_cl_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb,
760 cl_dbg(dev, cl, "buf: size = %d idx = %lu\n", 760 cl_dbg(dev, cl, "buf: size = %d idx = %lu\n",
761 cb->request_buffer.size, cb->buf_idx); 761 cb->request_buffer.size, cb->buf_idx);
762 762
763 *slots -= msg_slots;
764 rets = mei_write_message(dev, &mei_hdr, buf->data + cb->buf_idx); 763 rets = mei_write_message(dev, &mei_hdr, buf->data + cb->buf_idx);
765 if (rets) { 764 if (rets) {
766 cl->status = rets; 765 cl->status = rets;
diff --git a/drivers/misc/mei/client.h b/drivers/misc/mei/client.h
index c8396e582f1c..c11b663358a4 100644
--- a/drivers/misc/mei/client.h
+++ b/drivers/misc/mei/client.h
@@ -102,8 +102,8 @@ int mei_cl_disconnect(struct mei_cl *cl);
102int mei_cl_connect(struct mei_cl *cl, struct file *file); 102int mei_cl_connect(struct mei_cl *cl, struct file *file);
103int mei_cl_read_start(struct mei_cl *cl, size_t length); 103int mei_cl_read_start(struct mei_cl *cl, size_t length);
104int mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, bool blocking); 104int mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, bool blocking);
105int mei_cl_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb, 105int mei_cl_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
106 s32 *slots, struct mei_cl_cb *cmpl_list); 106 struct mei_cl_cb *cmpl_list);
107 107
108void mei_cl_complete(struct mei_cl *cl, struct mei_cl_cb *cb); 108void mei_cl_complete(struct mei_cl *cl, struct mei_cl_cb *cb);
109 109
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index b0c42d6182a6..84165cce57d2 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -354,7 +354,7 @@ static int mei_me_write_message(struct mei_device *dev,
354 354
355 dw_cnt = mei_data2slots(length); 355 dw_cnt = mei_data2slots(length);
356 if (empty_slots < 0 || dw_cnt > empty_slots) 356 if (empty_slots < 0 || dw_cnt > empty_slots)
357 return -EIO; 357 return -EMSGSIZE;
358 358
359 mei_me_reg_write(hw, H_CB_WW, *((u32 *) header)); 359 mei_me_reg_write(hw, H_CB_WW, *((u32 *) header));
360 360
diff --git a/drivers/misc/mei/hw-txe.c b/drivers/misc/mei/hw-txe.c
index 8f5e4be9ebc2..f60182a52f96 100644
--- a/drivers/misc/mei/hw-txe.c
+++ b/drivers/misc/mei/hw-txe.c
@@ -566,7 +566,9 @@ static int mei_txe_write(struct mei_device *dev,
566 struct mei_txe_hw *hw = to_txe_hw(dev); 566 struct mei_txe_hw *hw = to_txe_hw(dev);
567 unsigned long rem; 567 unsigned long rem;
568 unsigned long length; 568 unsigned long length;
569 int slots = dev->hbuf_depth;
569 u32 *reg_buf = (u32 *)buf; 570 u32 *reg_buf = (u32 *)buf;
571 u32 dw_cnt;
570 int i; 572 int i;
571 573
572 if (WARN_ON(!header || !buf)) 574 if (WARN_ON(!header || !buf))
@@ -576,11 +578,9 @@ static int mei_txe_write(struct mei_device *dev,
576 578
577 dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(header)); 579 dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(header));
578 580
579 if ((length + sizeof(struct mei_msg_hdr)) > PAYLOAD_SIZE) { 581 dw_cnt = mei_data2slots(length);
580 dev_err(&dev->pdev->dev, "write length exceeded = %ld > %d\n", 582 if (dw_cnt > slots)
581 length + sizeof(struct mei_msg_hdr), PAYLOAD_SIZE); 583 return -EMSGSIZE;
582 return -ERANGE;
583 }
584 584
585 if (WARN(!hw->aliveness, "txe write: aliveness not asserted\n")) 585 if (WARN(!hw->aliveness, "txe write: aliveness not asserted\n"))
586 return -EAGAIN; 586 return -EAGAIN;
@@ -605,6 +605,9 @@ static int mei_txe_write(struct mei_device *dev,
605 mei_txe_input_payload_write(dev, i + 1, reg); 605 mei_txe_input_payload_write(dev, i + 1, reg);
606 } 606 }
607 607
608 /* after each write the whole buffer is consumed */
609 hw->slots = 0;
610
608 /* Set Input-Doorbell */ 611 /* Set Input-Doorbell */
609 mei_txe_input_doorbell_set(hw); 612 mei_txe_input_doorbell_set(hw);
610 613
@@ -632,7 +635,8 @@ static size_t mei_txe_hbuf_max_len(const struct mei_device *dev)
632 */ 635 */
633static int mei_txe_hbuf_empty_slots(struct mei_device *dev) 636static int mei_txe_hbuf_empty_slots(struct mei_device *dev)
634{ 637{
635 return dev->hbuf_depth; 638 struct mei_txe_hw *hw = to_txe_hw(dev);
639 return hw->slots;
636} 640}
637 641
638/** 642/**
@@ -978,11 +982,12 @@ irqreturn_t mei_txe_irq_thread_handler(int irq, void *dev_id)
978 } 982 }
979 } 983 }
980 /* Input Ready: Detection if host can write to SeC */ 984 /* Input Ready: Detection if host can write to SeC */
981 if (test_and_clear_bit(TXE_INTR_IN_READY_BIT, &hw->intr_cause)) 985 if (test_and_clear_bit(TXE_INTR_IN_READY_BIT, &hw->intr_cause)) {
982 dev->hbuf_is_ready = true; 986 dev->hbuf_is_ready = true;
987 hw->slots = dev->hbuf_depth;
988 }
983 989
984 if (hw->aliveness && dev->hbuf_is_ready) { 990 if (hw->aliveness && dev->hbuf_is_ready) {
985
986 /* get the real register value */ 991 /* get the real register value */
987 dev->hbuf_is_ready = mei_hbuf_is_ready(dev); 992 dev->hbuf_is_ready = mei_hbuf_is_ready(dev);
988 rets = mei_irq_write_handler(dev, &complete_list); 993 rets = mei_irq_write_handler(dev, &complete_list);
diff --git a/drivers/misc/mei/hw-txe.h b/drivers/misc/mei/hw-txe.h
index fdb665f44d5d..0812d98633a4 100644
--- a/drivers/misc/mei/hw-txe.h
+++ b/drivers/misc/mei/hw-txe.h
@@ -46,6 +46,7 @@ struct mei_txe_hw {
46 void __iomem *mem_addr[NUM_OF_MEM_BARS]; 46 void __iomem *mem_addr[NUM_OF_MEM_BARS];
47 u32 aliveness; 47 u32 aliveness;
48 u32 readiness; 48 u32 readiness;
49 u32 slots;
49 50
50 wait_queue_head_t wait_aliveness; 51 wait_queue_head_t wait_aliveness;
51 bool recvd_aliveness; 52 bool recvd_aliveness;
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index aed03efa72f4..e6151e2dac48 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -165,25 +165,24 @@ static int mei_cl_irq_read_msg(struct mei_device *dev,
165 * 165 *
166 * @cl: client 166 * @cl: client
167 * @cb: callback block. 167 * @cb: callback block.
168 * @slots: free slots.
169 * @cmpl_list: complete list. 168 * @cmpl_list: complete list.
170 * 169 *
171 * returns 0, OK; otherwise, error. 170 * returns 0, OK; otherwise, error.
172 */ 171 */
173static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb, 172static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb,
174 s32 *slots, struct mei_cl_cb *cmpl_list) 173 struct mei_cl_cb *cmpl_list)
175{ 174{
176 struct mei_device *dev = cl->dev; 175 struct mei_device *dev = cl->dev;
176 u32 msg_slots;
177 int slots;
177 int ret; 178 int ret;
178 179
179 u32 msg_slots = 180 slots = mei_hbuf_empty_slots(dev);
180 mei_data2slots(sizeof(struct hbm_client_connect_response)); 181 msg_slots = mei_data2slots(sizeof(struct hbm_client_connect_response));
181 182
182 if (*slots < msg_slots) 183 if (slots < msg_slots)
183 return -EMSGSIZE; 184 return -EMSGSIZE;
184 185
185 *slots -= msg_slots;
186
187 ret = mei_hbm_cl_disconnect_rsp(dev, cl); 186 ret = mei_hbm_cl_disconnect_rsp(dev, cl);
188 187
189 cl->state = MEI_FILE_DISCONNECTED; 188 cl->state = MEI_FILE_DISCONNECTED;
@@ -201,24 +200,23 @@ static int mei_cl_irq_disconnect_rsp(struct mei_cl *cl, struct mei_cl_cb *cb,
201 * 200 *
202 * @cl: client 201 * @cl: client
203 * @cb: callback block. 202 * @cb: callback block.
204 * @slots: free slots.
205 * @cmpl_list: complete list. 203 * @cmpl_list: complete list.
206 * 204 *
207 * returns 0, OK; otherwise, error. 205 * returns 0, OK; otherwise, error.
208 */ 206 */
209static int mei_cl_irq_close(struct mei_cl *cl, struct mei_cl_cb *cb, 207static int mei_cl_irq_close(struct mei_cl *cl, struct mei_cl_cb *cb,
210 s32 *slots, struct mei_cl_cb *cmpl_list) 208 struct mei_cl_cb *cmpl_list)
211{ 209{
212 struct mei_device *dev = cl->dev; 210 struct mei_device *dev = cl->dev;
211 u32 msg_slots;
212 int slots;
213 213
214 u32 msg_slots = 214 msg_slots = mei_data2slots(sizeof(struct hbm_client_connect_request));
215 mei_data2slots(sizeof(struct hbm_client_connect_request)); 215 slots = mei_hbuf_empty_slots(dev);
216 216
217 if (*slots < msg_slots) 217 if (slots < msg_slots)
218 return -EMSGSIZE; 218 return -EMSGSIZE;
219 219
220 *slots -= msg_slots;
221
222 if (mei_hbm_cl_disconnect_req(dev, cl)) { 220 if (mei_hbm_cl_disconnect_req(dev, cl)) {
223 cl->status = 0; 221 cl->status = 0;
224 cb->buf_idx = 0; 222 cb->buf_idx = 0;
@@ -242,27 +240,23 @@ static int mei_cl_irq_close(struct mei_cl *cl, struct mei_cl_cb *cb,
242 * 240 *
243 * @cl: client 241 * @cl: client
244 * @cb: callback block. 242 * @cb: callback block.
245 * @slots: free slots.
246 * @cmpl_list: complete list. 243 * @cmpl_list: complete list.
247 * 244 *
248 * returns 0, OK; otherwise, error. 245 * returns 0, OK; otherwise, error.
249 */ 246 */
250static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb, 247static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb,
251 s32 *slots, struct mei_cl_cb *cmpl_list) 248 struct mei_cl_cb *cmpl_list)
252{ 249{
253 struct mei_device *dev = cl->dev; 250 struct mei_device *dev = cl->dev;
254 u32 msg_slots = mei_data2slots(sizeof(struct hbm_flow_control)); 251 u32 msg_slots;
255 252 int slots;
256 int ret; 253 int ret;
257 254
255 msg_slots = mei_data2slots(sizeof(struct hbm_flow_control));
256 slots = mei_hbuf_empty_slots(dev);
258 257
259 if (*slots < msg_slots) { 258 if (slots < msg_slots)
260 /* return the cancel routine */
261 list_del(&cb->list);
262 return -EMSGSIZE; 259 return -EMSGSIZE;
263 }
264
265 *slots -= msg_slots;
266 260
267 ret = mei_hbm_cl_flow_control_req(dev, cl); 261 ret = mei_hbm_cl_flow_control_req(dev, cl);
268 if (ret) { 262 if (ret) {
@@ -283,30 +277,26 @@ static int mei_cl_irq_read(struct mei_cl *cl, struct mei_cl_cb *cb,
283 * 277 *
284 * @cl: client 278 * @cl: client
285 * @cb: callback block. 279 * @cb: callback block.
286 * @slots: free slots.
287 * @cmpl_list: complete list. 280 * @cmpl_list: complete list.
288 * 281 *
289 * returns 0, OK; otherwise, error. 282 * returns 0, OK; otherwise, error.
290 */ 283 */
291static int mei_cl_irq_connect(struct mei_cl *cl, struct mei_cl_cb *cb, 284static int mei_cl_irq_connect(struct mei_cl *cl, struct mei_cl_cb *cb,
292 s32 *slots, struct mei_cl_cb *cmpl_list) 285 struct mei_cl_cb *cmpl_list)
293{ 286{
294 struct mei_device *dev = cl->dev; 287 struct mei_device *dev = cl->dev;
288 u32 msg_slots;
289 int slots;
295 int ret; 290 int ret;
296 291
297 u32 msg_slots = 292 msg_slots = mei_data2slots(sizeof(struct hbm_client_connect_request));
298 mei_data2slots(sizeof(struct hbm_client_connect_request)); 293 slots = mei_hbuf_empty_slots(dev);
299 294
300 if (mei_cl_is_other_connecting(cl)) 295 if (mei_cl_is_other_connecting(cl))
301 return 0; 296 return 0;
302 297
303 if (*slots < msg_slots) { 298 if (slots < msg_slots)
304 /* return the cancel routine */
305 list_del(&cb->list);
306 return -EMSGSIZE; 299 return -EMSGSIZE;
307 }
308
309 *slots -= msg_slots;
310 300
311 cl->state = MEI_FILE_CONNECTING; 301 cl->state = MEI_FILE_CONNECTING;
312 302
@@ -494,13 +484,7 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list)
494 dev_dbg(&dev->pdev->dev, "wd send failed.\n"); 484 dev_dbg(&dev->pdev->dev, "wd send failed.\n");
495 else if (mei_cl_flow_ctrl_reduce(&dev->wd_cl)) 485 else if (mei_cl_flow_ctrl_reduce(&dev->wd_cl))
496 return -ENODEV; 486 return -ENODEV;
497
498 dev->wd_pending = false; 487 dev->wd_pending = false;
499
500 if (dev->wd_state == MEI_WD_RUNNING)
501 slots -= mei_data2slots(MEI_WD_START_MSG_SIZE);
502 else
503 slots -= mei_data2slots(MEI_WD_STOP_MSG_SIZE);
504 } 488 }
505 } 489 }
506 490
@@ -515,28 +499,28 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list)
515 switch (cb->fop_type) { 499 switch (cb->fop_type) {
516 case MEI_FOP_CLOSE: 500 case MEI_FOP_CLOSE:
517 /* send disconnect message */ 501 /* send disconnect message */
518 ret = mei_cl_irq_close(cl, cb, &slots, cmpl_list); 502 ret = mei_cl_irq_close(cl, cb, cmpl_list);
519 if (ret) 503 if (ret)
520 return ret; 504 return ret;
521 505
522 break; 506 break;
523 case MEI_FOP_READ: 507 case MEI_FOP_READ:
524 /* send flow control message */ 508 /* send flow control message */
525 ret = mei_cl_irq_read(cl, cb, &slots, cmpl_list); 509 ret = mei_cl_irq_read(cl, cb, cmpl_list);
526 if (ret) 510 if (ret)
527 return ret; 511 return ret;
528 512
529 break; 513 break;
530 case MEI_FOP_CONNECT: 514 case MEI_FOP_CONNECT:
531 /* connect message */ 515 /* connect message */
532 ret = mei_cl_irq_connect(cl, cb, &slots, cmpl_list); 516 ret = mei_cl_irq_connect(cl, cb, cmpl_list);
533 if (ret) 517 if (ret)
534 return ret; 518 return ret;
535 519
536 break; 520 break;
537 case MEI_FOP_DISCONNECT_RSP: 521 case MEI_FOP_DISCONNECT_RSP:
538 /* send disconnect resp */ 522 /* send disconnect resp */
539 ret = mei_cl_irq_disconnect_rsp(cl, cb, &slots, cmpl_list); 523 ret = mei_cl_irq_disconnect_rsp(cl, cb, cmpl_list);
540 if (ret) 524 if (ret)
541 return ret; 525 return ret;
542 default: 526 default:
@@ -551,11 +535,9 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list)
551 if (cl == NULL) 535 if (cl == NULL)
552 continue; 536 continue;
553 if (cl == &dev->iamthif_cl) 537 if (cl == &dev->iamthif_cl)
554 ret = mei_amthif_irq_write_complete(cl, cb, 538 ret = mei_amthif_irq_write(cl, cb, cmpl_list);
555 &slots, cmpl_list);
556 else 539 else
557 ret = mei_cl_irq_write_complete(cl, cb, 540 ret = mei_cl_irq_write(cl, cb, cmpl_list);
558 &slots, cmpl_list);
559 if (ret) 541 if (ret)
560 return ret; 542 return ret;
561 } 543 }
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 52499bc5a068..36640b9d54c5 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -515,8 +515,8 @@ struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev,
515 515
516void mei_amthif_run_next_cmd(struct mei_device *dev); 516void mei_amthif_run_next_cmd(struct mei_device *dev);
517 517
518int mei_amthif_irq_write_complete(struct mei_cl *cl, struct mei_cl_cb *cb, 518int mei_amthif_irq_write(struct mei_cl *cl, struct mei_cl_cb *cb,
519 s32 *slots, struct mei_cl_cb *cmpl_list); 519 struct mei_cl_cb *cmpl_list);
520 520
521void mei_amthif_complete(struct mei_device *dev, struct mei_cl_cb *cb); 521void mei_amthif_complete(struct mei_device *dev, struct mei_cl_cb *cb);
522int mei_amthif_irq_read_msg(struct mei_device *dev, 522int mei_amthif_irq_read_msg(struct mei_device *dev,