mei: check whether hw start has succeeded
authorTomas Winkler <tomas.winkler@intel.com>
Sun, 23 Jun 2013 19:49:04 +0000 (22:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jun 2013 23:33:28 +0000 (16:33 -0700)
hw start may fail therefore the reset flow has
to check for the return value

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/init.c
drivers/misc/mei/mei_dev.h

index 15253886f37e04a7a0a0bc3808e5a8af7d5bf81d..6fc573cef1782d706c364a8414469230ee555b35 100644 (file)
@@ -181,7 +181,12 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
                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");
        /* link is established * start sending messages.  */
index 1aa499782abe9e611c38bc0c4134b0b5db110ab2..7b918b2fb89468ad6c653a3ff9e0f616aefa5022 100644 (file)
@@ -544,9 +544,9 @@ static inline int mei_hw_reset(struct mei_device *dev, bool 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)