aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2014-08-14 10:22:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-24 01:56:16 -0400
commit05e314e2535f1693098e58b0261169565a43bec1 (patch)
tree09006c027139340566634e9f248378c9a73a645f
parent5456796b1a2aedd2d6345944b73ac41aeb8cb589 (diff)
mei: amthif: don't check amthif client identity on amthif queues
Amthif has its own queues therefore it is redundant to check the client type when processing the queues 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>
-rw-r--r--drivers/misc/mei/amthif.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 0d6234db00fa..ab6095988620 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -130,12 +130,9 @@ struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev,
130 struct file *file) 130 struct file *file)
131{ 131{
132 struct mei_cl_cb *cb; 132 struct mei_cl_cb *cb;
133 133 list_for_each_entry(cb, &dev->amthif_rd_complete_list.list, list)
134 list_for_each_entry(cb, &dev->amthif_rd_complete_list.list, list) { 134 if (cb->file_object == file)
135 if (cb->cl && cb->cl == &dev->iamthif_cl &&
136 cb->file_object == file)
137 return cb; 135 return cb;
138 }
139 return NULL; 136 return NULL;
140} 137}
141 138
@@ -168,8 +165,8 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
168 int i; 165 int i;
169 166
170 /* Only possible if we are in timeout */ 167 /* Only possible if we are in timeout */
171 if (!cl || cl != &dev->iamthif_cl) { 168 if (!cl) {
172 dev_dbg(&dev->pdev->dev, "bad file ext.\n"); 169 dev_err(&dev->pdev->dev, "bad file ext.\n");
173 return -ETIME; 170 return -ETIME;
174 } 171 }
175 172
@@ -371,8 +368,8 @@ int mei_amthif_write(struct mei_device *dev, struct mei_cl_cb *cb)
371 */ 368 */
372void mei_amthif_run_next_cmd(struct mei_device *dev) 369void mei_amthif_run_next_cmd(struct mei_device *dev)
373{ 370{
374 struct mei_cl_cb *pos = NULL; 371 struct mei_cl_cb *cb;
375 struct mei_cl_cb *next = NULL; 372 struct mei_cl_cb *next;
376 int status; 373 int status;
377 374
378 if (!dev) 375 if (!dev)
@@ -388,19 +385,15 @@ void mei_amthif_run_next_cmd(struct mei_device *dev)
388 385
389 dev_dbg(&dev->pdev->dev, "complete amthif cmd_list cb.\n"); 386 dev_dbg(&dev->pdev->dev, "complete amthif cmd_list cb.\n");
390 387
391 list_for_each_entry_safe(pos, next, &dev->amthif_cmd_list.list, list) { 388 list_for_each_entry_safe(cb, next, &dev->amthif_cmd_list.list, list) {
392 list_del(&pos->list); 389 list_del(&cb->list);
393 390 if (!cb->cl)
394 if (pos->cl && pos->cl == &dev->iamthif_cl) { 391 continue;
395 status = mei_amthif_send_cmd(dev, pos); 392 status = mei_amthif_send_cmd(dev, cb);
396 if (status) { 393 if (status)
397 dev_dbg(&dev->pdev->dev, 394 dev_warn(&dev->pdev->dev, "amthif write failed status = %d\n",
398 "amthif write failed status = %d\n",
399 status); 395 status);
400 return; 396 break;
401 }
402 break;
403 }
404 } 397 }
405} 398}
406 399
@@ -559,7 +552,7 @@ int mei_amthif_irq_read_msg(struct mei_device *dev,
559 dev->iamthif_stall_timer = 0; 552 dev->iamthif_stall_timer = 0;
560 cb->buf_idx = dev->iamthif_msg_buf_index; 553 cb->buf_idx = dev->iamthif_msg_buf_index;
561 cb->read_time = jiffies; 554 cb->read_time = jiffies;
562 if (dev->iamthif_ioctl && cb->cl == &dev->iamthif_cl) { 555 if (dev->iamthif_ioctl) {
563 /* found the iamthif cb */ 556 /* found the iamthif cb */
564 dev_dbg(&dev->pdev->dev, "complete the amthif read cb.\n "); 557 dev_dbg(&dev->pdev->dev, "complete the amthif read cb.\n ");
565 dev_dbg(&dev->pdev->dev, "add the amthif read cb to complete.\n "); 558 dev_dbg(&dev->pdev->dev, "add the amthif read cb to complete.\n ");