summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/pci-me.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2014-01-12 00:36:09 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-13 14:57:21 -0800
commit33ec0826314734fc4f3c9bf37d12e98063339b31 (patch)
tree9fb9169af14ae0930fd49e96b4d4f34fcb619c0f /drivers/misc/mei/pci-me.c
parentdb50d2f65b7c2bcdfb931dfa18cdcb4bb75dcfaa (diff)
downloadlinux-33ec0826314734fc4f3c9bf37d12e98063339b31.tar.bz2
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/pci-me.c')
-rw-r--r--drivers/misc/mei/pci-me.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
index 8b1deea2abf6..ddadd08956f4 100644
--- a/drivers/misc/mei/pci-me.c
+++ b/drivers/misc/mei/pci-me.c
@@ -321,16 +321,14 @@ static int mei_me_pci_resume(struct device *device)
return err;
}
- mutex_lock(&dev->device_lock);
- dev->dev_state = MEI_DEV_POWER_UP;
- mei_clear_interrupts(dev);
- mei_reset(dev, 1);
- mutex_unlock(&dev->device_lock);
+ err = mei_restart(dev);
+ if (err)
+ return err;
/* Start timer if stopped in suspend */
schedule_delayed_work(&dev->timer_work, HZ);
- return err;
+ return 0;
}
static SIMPLE_DEV_PM_OPS(mei_me_pm_ops, mei_me_pci_suspend, mei_me_pci_resume);
#define MEI_ME_PM_OPS (&mei_me_pm_ops)