aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/interrupt.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2014-01-11 17:36:09 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-13 17:57:21 -0500
commit33ec0826314734fc4f3c9bf37d12e98063339b31 (patch)
tree9fb9169af14ae0930fd49e96b4d4f34fcb619c0f /drivers/misc/mei/interrupt.c
parentdb50d2f65b7c2bcdfb931dfa18cdcb4bb75dcfaa (diff)
mei: revamp mei reset state machine
1. MEI_DEV_RESETTING device state spans only hardware reset flow while starting dev state is saved into a local variable for further reference, this let us to reduce big if statements in case we are trying to avoid nested resets 2. During initializations if the reset ended in MEI_DEV_DISABLED device state we bail out with -ENODEV 3. Remove redundant interrupts_enabled parameter as this can be deduced from the starting dev_state 4. mei_reset propagates error code to the caller 5. Add mei_restart function to wrap the pci resume Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Alexander Usyskin <alexander.usyskin@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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index 2a7277de7ca1..f0fbb5179f80 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -560,7 +560,7 @@ void mei_timer(struct work_struct *work)
560 if (--dev->init_clients_timer == 0) { 560 if (--dev->init_clients_timer == 0) {
561 dev_err(&dev->pdev->dev, "timer: init clients timeout hbm_state = %d.\n", 561 dev_err(&dev->pdev->dev, "timer: init clients timeout hbm_state = %d.\n",
562 dev->hbm_state); 562 dev->hbm_state);
563 mei_reset(dev, 1); 563 mei_reset(dev);
564 goto out; 564 goto out;
565 } 565 }
566 } 566 }
@@ -573,8 +573,8 @@ void mei_timer(struct work_struct *work)
573 list_for_each_entry_safe(cl_pos, cl_next, &dev->file_list, link) { 573 list_for_each_entry_safe(cl_pos, cl_next, &dev->file_list, link) {
574 if (cl_pos->timer_count) { 574 if (cl_pos->timer_count) {
575 if (--cl_pos->timer_count == 0) { 575 if (--cl_pos->timer_count == 0) {
576 dev_err(&dev->pdev->dev, "reset: connect/disconnect timeout.\n"); 576 dev_err(&dev->pdev->dev, "timer: connect/disconnect timeout.\n");
577 mei_reset(dev, 1); 577 mei_reset(dev);
578 goto out; 578 goto out;
579 } 579 }
580 } 580 }
@@ -582,8 +582,8 @@ void mei_timer(struct work_struct *work)
582 582
583 if (dev->iamthif_stall_timer) { 583 if (dev->iamthif_stall_timer) {
584 if (--dev->iamthif_stall_timer == 0) { 584 if (--dev->iamthif_stall_timer == 0) {
585 dev_err(&dev->pdev->dev, "reset: amthif hanged.\n"); 585 dev_err(&dev->pdev->dev, "timer: amthif hanged.\n");
586 mei_reset(dev, 1); 586 mei_reset(dev);
587 dev->iamthif_msg_buf_size = 0; 587 dev->iamthif_msg_buf_size = 0;
588 dev->iamthif_msg_buf_index = 0; 588 dev->iamthif_msg_buf_index = 0;
589 dev->iamthif_canceled = false; 589 dev->iamthif_canceled = false;
@@ -636,7 +636,8 @@ void mei_timer(struct work_struct *work)
636 } 636 }
637 } 637 }
638out: 638out:
639 schedule_delayed_work(&dev->timer_work, 2 * HZ); 639 if (dev->dev_state != MEI_DEV_DISABLED)
640 schedule_delayed_work(&dev->timer_work, 2 * HZ);
640 mutex_unlock(&dev->device_lock); 641 mutex_unlock(&dev->device_lock);
641} 642}
642 643