diff options
Diffstat (limited to 'drivers/misc/mei/hw-me.c')
-rw-r--r-- | drivers/misc/mei/hw-me.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index 3412adcdaeb0..6c07623704c2 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c | |||
@@ -469,7 +469,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id) | |||
469 | struct mei_device *dev = (struct mei_device *) dev_id; | 469 | struct mei_device *dev = (struct mei_device *) dev_id; |
470 | struct mei_cl_cb complete_list; | 470 | struct mei_cl_cb complete_list; |
471 | s32 slots; | 471 | s32 slots; |
472 | int rets; | 472 | int rets = 0; |
473 | 473 | ||
474 | dev_dbg(&dev->pdev->dev, "function called after ISR to handle the interrupt processing.\n"); | 474 | dev_dbg(&dev->pdev->dev, "function called after ISR to handle the interrupt processing.\n"); |
475 | /* initialize our complete list */ | 475 | /* initialize our complete list */ |
@@ -487,10 +487,9 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id) | |||
487 | dev->dev_state != MEI_DEV_INITIALIZING && | 487 | dev->dev_state != MEI_DEV_INITIALIZING && |
488 | dev->dev_state != MEI_DEV_POWER_DOWN && | 488 | dev->dev_state != MEI_DEV_POWER_DOWN && |
489 | dev->dev_state != MEI_DEV_POWER_UP) { | 489 | dev->dev_state != MEI_DEV_POWER_UP) { |
490 | dev_dbg(&dev->pdev->dev, "FW not ready.\n"); | 490 | dev_warn(&dev->pdev->dev, "FW not ready: resetting.\n"); |
491 | mei_reset(dev, 1); | 491 | schedule_work(&dev->reset_work); |
492 | mutex_unlock(&dev->device_lock); | 492 | goto end; |
493 | return IRQ_HANDLED; | ||
494 | } | 493 | } |
495 | 494 | ||
496 | /* check if we need to start the dev */ | 495 | /* check if we need to start the dev */ |
@@ -500,15 +499,12 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id) | |||
500 | 499 | ||
501 | dev->recvd_hw_ready = true; | 500 | dev->recvd_hw_ready = true; |
502 | wake_up_interruptible(&dev->wait_hw_ready); | 501 | wake_up_interruptible(&dev->wait_hw_ready); |
503 | |||
504 | mutex_unlock(&dev->device_lock); | ||
505 | return IRQ_HANDLED; | ||
506 | } else { | 502 | } else { |
503 | |||
507 | dev_dbg(&dev->pdev->dev, "Reset Completed.\n"); | 504 | dev_dbg(&dev->pdev->dev, "Reset Completed.\n"); |
508 | mei_me_hw_reset_release(dev); | 505 | mei_me_hw_reset_release(dev); |
509 | mutex_unlock(&dev->device_lock); | ||
510 | return IRQ_HANDLED; | ||
511 | } | 506 | } |
507 | goto end; | ||
512 | } | 508 | } |
513 | /* check slots available for reading */ | 509 | /* check slots available for reading */ |
514 | slots = mei_count_full_read_slots(dev); | 510 | slots = mei_count_full_read_slots(dev); |
@@ -516,21 +512,23 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id) | |||
516 | /* we have urgent data to send so break the read */ | 512 | /* we have urgent data to send so break the read */ |
517 | if (dev->wr_ext_msg.hdr.length) | 513 | if (dev->wr_ext_msg.hdr.length) |
518 | break; | 514 | break; |
519 | dev_dbg(&dev->pdev->dev, "slots =%08x\n", slots); | 515 | dev_dbg(&dev->pdev->dev, "slots to read = %08x\n", slots); |
520 | dev_dbg(&dev->pdev->dev, "call mei_irq_read_handler.\n"); | ||
521 | rets = mei_irq_read_handler(dev, &complete_list, &slots); | 516 | rets = mei_irq_read_handler(dev, &complete_list, &slots); |
522 | if (rets) | 517 | if (rets) { |
518 | schedule_work(&dev->reset_work); | ||
523 | goto end; | 519 | goto end; |
520 | } | ||
524 | } | 521 | } |
522 | |||
525 | rets = mei_irq_write_handler(dev, &complete_list); | 523 | rets = mei_irq_write_handler(dev, &complete_list); |
526 | end: | ||
527 | dev_dbg(&dev->pdev->dev, "end of bottom half function.\n"); | ||
528 | dev->hbuf_is_ready = mei_hbuf_is_ready(dev); | ||
529 | 524 | ||
530 | mutex_unlock(&dev->device_lock); | 525 | dev->hbuf_is_ready = mei_hbuf_is_ready(dev); |
531 | 526 | ||
532 | mei_irq_compl_handler(dev, &complete_list); | 527 | mei_irq_compl_handler(dev, &complete_list); |
533 | 528 | ||
529 | end: | ||
530 | dev_dbg(&dev->pdev->dev, "interrupt thread end ret = %d\n", rets); | ||
531 | mutex_unlock(&dev->device_lock); | ||
534 | return IRQ_HANDLED; | 532 | return IRQ_HANDLED; |
535 | } | 533 | } |
536 | static const struct mei_hw_ops mei_me_hw_ops = { | 534 | static const struct mei_hw_ops mei_me_hw_ops = { |