Commit 9049f793 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: check whether hw start has succeeded

hw start may fail therefore the reset flow has
to check for the return value
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c20c68d5
...@@ -181,7 +181,12 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled) ...@@ -181,7 +181,12 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
return; return;
} }
mei_hw_start(dev); ret = mei_hw_start(dev);
if (ret) {
dev_err(&dev->pdev->dev, "hw_start failed disabling the device\n");
dev->dev_state = MEI_DEV_DISABLED;
return;
}
dev_dbg(&dev->pdev->dev, "link is established start sending messages.\n"); dev_dbg(&dev->pdev->dev, "link is established start sending messages.\n");
/* link is established * start sending messages. */ /* link is established * start sending messages. */
......
...@@ -544,9 +544,9 @@ static inline int mei_hw_reset(struct mei_device *dev, bool enable) ...@@ -544,9 +544,9 @@ static inline int mei_hw_reset(struct mei_device *dev, bool enable)
return dev->ops->hw_reset(dev, enable); return dev->ops->hw_reset(dev, enable);
} }
static inline void mei_hw_start(struct mei_device *dev) static inline int mei_hw_start(struct mei_device *dev)
{ {
dev->ops->hw_start(dev); return dev->ops->hw_start(dev);
} }
static inline void mei_clear_interrupts(struct mei_device *dev) static inline void mei_clear_interrupts(struct mei_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment