aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/interrupt.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2014-09-29 09:31:42 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-29 11:56:01 -0400
commit2bf94cabb199f73402a5ddefa4a7bf1a82aaeda5 (patch)
tree334572e3557836eab69581513b36fc4d7ba9dfdd /drivers/misc/mei/interrupt.c
parent3a7e9b6c661a23429b4a106d1ffa8aa5ce6c62bb (diff)
mei: get rid of most of the pci dependencies in mei
For purpose of adding testing HW we would like to get rid of pci dependency in generic mei code This patch provides only straight forward changes FW status and prob quirks need to be handled separately 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.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index b8d9cfee3e87..8dac76901130 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -47,7 +47,7 @@ void mei_irq_compl_handler(struct mei_device *dev, struct mei_cl_cb *compl_list)
47 if (!cl) 47 if (!cl)
48 continue; 48 continue;
49 49
50 dev_dbg(&dev->pdev->dev, "completing call back.\n"); 50 dev_dbg(dev->dev, "completing call back.\n");
51 if (cl == &dev->iamthif_cl) 51 if (cl == &dev->iamthif_cl)
52 mei_amthif_complete(dev, cb); 52 mei_amthif_complete(dev, cb);
53 else 53 else
@@ -148,10 +148,10 @@ static int mei_cl_irq_read_msg(struct mei_device *dev,
148 break; 148 break;
149 } 149 }
150 150
151 dev_dbg(&dev->pdev->dev, "message read\n"); 151 dev_dbg(dev->dev, "message read\n");
152 if (!buffer) { 152 if (!buffer) {
153 mei_read_slots(dev, dev->rd_msg_buf, mei_hdr->length); 153 mei_read_slots(dev, dev->rd_msg_buf, mei_hdr->length);
154 dev_dbg(&dev->pdev->dev, "discarding message " MEI_HDR_FMT "\n", 154 dev_dbg(dev->dev, "discarding message " MEI_HDR_FMT "\n",
155 MEI_HDR_PRM(mei_hdr)); 155 MEI_HDR_PRM(mei_hdr));
156 } 156 }
157 157
@@ -333,20 +333,20 @@ int mei_irq_read_handler(struct mei_device *dev,
333 if (!dev->rd_msg_hdr) { 333 if (!dev->rd_msg_hdr) {
334 dev->rd_msg_hdr = mei_read_hdr(dev); 334 dev->rd_msg_hdr = mei_read_hdr(dev);
335 (*slots)--; 335 (*slots)--;
336 dev_dbg(&dev->pdev->dev, "slots =%08x.\n", *slots); 336 dev_dbg(dev->dev, "slots =%08x.\n", *slots);
337 } 337 }
338 mei_hdr = (struct mei_msg_hdr *) &dev->rd_msg_hdr; 338 mei_hdr = (struct mei_msg_hdr *) &dev->rd_msg_hdr;
339 dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr)); 339 dev_dbg(dev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
340 340
341 if (mei_hdr->reserved || !dev->rd_msg_hdr) { 341 if (mei_hdr->reserved || !dev->rd_msg_hdr) {
342 dev_err(&dev->pdev->dev, "corrupted message header 0x%08X\n", 342 dev_err(dev->dev, "corrupted message header 0x%08X\n",
343 dev->rd_msg_hdr); 343 dev->rd_msg_hdr);
344 ret = -EBADMSG; 344 ret = -EBADMSG;
345 goto end; 345 goto end;
346 } 346 }
347 347
348 if (mei_slots2data(*slots) < mei_hdr->length) { 348 if (mei_slots2data(*slots) < mei_hdr->length) {
349 dev_err(&dev->pdev->dev, "less data available than length=%08x.\n", 349 dev_err(dev->dev, "less data available than length=%08x.\n",
350 *slots); 350 *slots);
351 /* we can't read the message */ 351 /* we can't read the message */
352 ret = -ENODATA; 352 ret = -ENODATA;
@@ -357,7 +357,7 @@ int mei_irq_read_handler(struct mei_device *dev,
357 if (mei_hdr->host_addr == 0 && mei_hdr->me_addr == 0) { 357 if (mei_hdr->host_addr == 0 && mei_hdr->me_addr == 0) {
358 ret = mei_hbm_dispatch(dev, mei_hdr); 358 ret = mei_hbm_dispatch(dev, mei_hdr);
359 if (ret) { 359 if (ret) {
360 dev_dbg(&dev->pdev->dev, "mei_hbm_dispatch failed ret = %d\n", 360 dev_dbg(dev->dev, "mei_hbm_dispatch failed ret = %d\n",
361 ret); 361 ret);
362 goto end; 362 goto end;
363 } 363 }
@@ -374,7 +374,7 @@ int mei_irq_read_handler(struct mei_device *dev,
374 374
375 /* if no recipient cl was found we assume corrupted header */ 375 /* if no recipient cl was found we assume corrupted header */
376 if (&cl->link == &dev->file_list) { 376 if (&cl->link == &dev->file_list) {
377 dev_err(&dev->pdev->dev, "no destination client found 0x%08X\n", 377 dev_err(dev->dev, "no destination client found 0x%08X\n",
378 dev->rd_msg_hdr); 378 dev->rd_msg_hdr);
379 ret = -EBADMSG; 379 ret = -EBADMSG;
380 goto end; 380 goto end;
@@ -386,14 +386,14 @@ int mei_irq_read_handler(struct mei_device *dev,
386 386
387 ret = mei_amthif_irq_read_msg(dev, mei_hdr, cmpl_list); 387 ret = mei_amthif_irq_read_msg(dev, mei_hdr, cmpl_list);
388 if (ret) { 388 if (ret) {
389 dev_err(&dev->pdev->dev, "mei_amthif_irq_read_msg failed = %d\n", 389 dev_err(dev->dev, "mei_amthif_irq_read_msg failed = %d\n",
390 ret); 390 ret);
391 goto end; 391 goto end;
392 } 392 }
393 } else { 393 } else {
394 ret = mei_cl_irq_read_msg(dev, mei_hdr, cmpl_list); 394 ret = mei_cl_irq_read_msg(dev, mei_hdr, cmpl_list);
395 if (ret) { 395 if (ret) {
396 dev_err(&dev->pdev->dev, "mei_cl_irq_read_msg failed = %d\n", 396 dev_err(dev->dev, "mei_cl_irq_read_msg failed = %d\n",
397 ret); 397 ret);
398 goto end; 398 goto end;
399 } 399 }
@@ -406,7 +406,7 @@ reset_slots:
406 406
407 if (*slots == -EOVERFLOW) { 407 if (*slots == -EOVERFLOW) {
408 /* overflow - reset */ 408 /* overflow - reset */
409 dev_err(&dev->pdev->dev, "resetting due to slots overflow.\n"); 409 dev_err(dev->dev, "resetting due to slots overflow.\n");
410 /* set the event since message has been read */ 410 /* set the event since message has been read */
411 ret = -ERANGE; 411 ret = -ERANGE;
412 goto end; 412 goto end;
@@ -444,7 +444,7 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list)
444 return -EMSGSIZE; 444 return -EMSGSIZE;
445 445
446 /* complete all waiting for write CB */ 446 /* complete all waiting for write CB */
447 dev_dbg(&dev->pdev->dev, "complete all waiting for write cb.\n"); 447 dev_dbg(dev->dev, "complete all waiting for write cb.\n");
448 448
449 list = &dev->write_waiting_list; 449 list = &dev->write_waiting_list;
450 list_for_each_entry_safe(cb, next, &list->list, list) { 450 list_for_each_entry_safe(cb, next, &list->list, list) {
@@ -486,7 +486,7 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list)
486 } 486 }
487 487
488 /* complete control write list CB */ 488 /* complete control write list CB */
489 dev_dbg(&dev->pdev->dev, "complete control write list cb.\n"); 489 dev_dbg(dev->dev, "complete control write list cb.\n");
490 list_for_each_entry_safe(cb, next, &dev->ctrl_wr_list.list, list) { 490 list_for_each_entry_safe(cb, next, &dev->ctrl_wr_list.list, list) {
491 cl = cb->cl; 491 cl = cb->cl;
492 if (!cl) { 492 if (!cl) {
@@ -527,7 +527,7 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list)
527 527
528 } 528 }
529 /* complete write list CB */ 529 /* complete write list CB */
530 dev_dbg(&dev->pdev->dev, "complete write list cb.\n"); 530 dev_dbg(dev->dev, "complete write list cb.\n");
531 list_for_each_entry_safe(cb, next, &dev->write_list.list, list) { 531 list_for_each_entry_safe(cb, next, &dev->write_list.list, list) {
532 cl = cb->cl; 532 cl = cb->cl;
533 if (cl == NULL) 533 if (cl == NULL)
@@ -568,7 +568,7 @@ void mei_timer(struct work_struct *work)
568 568
569 if (dev->init_clients_timer) { 569 if (dev->init_clients_timer) {
570 if (--dev->init_clients_timer == 0) { 570 if (--dev->init_clients_timer == 0) {
571 dev_err(&dev->pdev->dev, "timer: init clients timeout hbm_state = %d.\n", 571 dev_err(dev->dev, "timer: init clients timeout hbm_state = %d.\n",
572 dev->hbm_state); 572 dev->hbm_state);
573 mei_reset(dev); 573 mei_reset(dev);
574 goto out; 574 goto out;
@@ -583,7 +583,7 @@ void mei_timer(struct work_struct *work)
583 list_for_each_entry(cl, &dev->file_list, link) { 583 list_for_each_entry(cl, &dev->file_list, link) {
584 if (cl->timer_count) { 584 if (cl->timer_count) {
585 if (--cl->timer_count == 0) { 585 if (--cl->timer_count == 0) {
586 dev_err(&dev->pdev->dev, "timer: connect/disconnect timeout.\n"); 586 dev_err(dev->dev, "timer: connect/disconnect timeout.\n");
587 mei_reset(dev); 587 mei_reset(dev);
588 goto out; 588 goto out;
589 } 589 }
@@ -595,7 +595,7 @@ void mei_timer(struct work_struct *work)
595 595
596 if (dev->iamthif_stall_timer) { 596 if (dev->iamthif_stall_timer) {
597 if (--dev->iamthif_stall_timer == 0) { 597 if (--dev->iamthif_stall_timer == 0) {
598 dev_err(&dev->pdev->dev, "timer: amthif hanged.\n"); 598 dev_err(dev->dev, "timer: amthif hanged.\n");
599 mei_reset(dev); 599 mei_reset(dev);
600 dev->iamthif_msg_buf_size = 0; 600 dev->iamthif_msg_buf_size = 0;
601 dev->iamthif_msg_buf_index = 0; 601 dev->iamthif_msg_buf_index = 0;
@@ -617,17 +617,17 @@ void mei_timer(struct work_struct *work)
617 timeout = dev->iamthif_timer + 617 timeout = dev->iamthif_timer +
618 mei_secs_to_jiffies(MEI_IAMTHIF_READ_TIMER); 618 mei_secs_to_jiffies(MEI_IAMTHIF_READ_TIMER);
619 619
620 dev_dbg(&dev->pdev->dev, "dev->iamthif_timer = %ld\n", 620 dev_dbg(dev->dev, "dev->iamthif_timer = %ld\n",
621 dev->iamthif_timer); 621 dev->iamthif_timer);
622 dev_dbg(&dev->pdev->dev, "timeout = %ld\n", timeout); 622 dev_dbg(dev->dev, "timeout = %ld\n", timeout);
623 dev_dbg(&dev->pdev->dev, "jiffies = %ld\n", jiffies); 623 dev_dbg(dev->dev, "jiffies = %ld\n", jiffies);
624 if (time_after(jiffies, timeout)) { 624 if (time_after(jiffies, timeout)) {
625 /* 625 /*
626 * User didn't read the AMTHI data on time (15sec) 626 * User didn't read the AMTHI data on time (15sec)
627 * freeing AMTHI for other requests 627 * freeing AMTHI for other requests
628 */ 628 */
629 629
630 dev_dbg(&dev->pdev->dev, "freeing AMTHI for other requests\n"); 630 dev_dbg(dev->dev, "freeing AMTHI for other requests\n");
631 631
632 mei_io_list_flush(&dev->amthif_rd_complete_list, 632 mei_io_list_flush(&dev->amthif_rd_complete_list,
633 &dev->iamthif_cl); 633 &dev->iamthif_cl);