summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/init.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2013-06-23 09:42:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-25 01:32:31 +0200
commitc20c68d535409f2ff000415d5e0578529c016521 (patch)
tree2403718e9c823d1845e33382a81bccfcb0653269 /drivers/misc/mei/init.c
parentmei: mei_cl_connect: don't multiply the timeout twice (diff)
downloadlinux-c20c68d535409f2ff000415d5e0578529c016521.tar.xz
linux-c20c68d535409f2ff000415d5e0578529c016521.zip
mei: check if the hardware reset succeeded
The hw may have multiple steps for resetting so we need to check if it has really succeeded. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/init.c')
-rw-r--r--drivers/misc/mei/init.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index 79e9e1c30562..15253886f37e 100644
--- a/drivers/misc/mei/init.c
+++ b/drivers/misc/mei/init.c
@@ -132,13 +132,19 @@ EXPORT_SYMBOL_GPL(mei_start);
void mei_reset(struct mei_device *dev, int interrupts_enabled)
{
bool unexpected;
+ int ret;
unexpected = (dev->dev_state != MEI_DEV_INITIALIZING &&
dev->dev_state != MEI_DEV_DISABLED &&
dev->dev_state != MEI_DEV_POWER_DOWN &&
dev->dev_state != MEI_DEV_POWER_UP);
- mei_hw_reset(dev, interrupts_enabled);
+ ret = mei_hw_reset(dev, interrupts_enabled);
+ if (ret) {
+ dev_err(&dev->pdev->dev, "hw reset failed disabling the device\n");
+ interrupts_enabled = false;
+ dev->dev_state = MEI_DEV_DISABLED;
+ }
dev->hbm_state = MEI_HBM_IDLE;