Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tomas Winkler and committed by
Greg Kroah-Hartman
9049f793 c20c68d5

+8 -3
+6 -1
drivers/misc/mei/init.c
··· 181 181 return; 182 182 } 183 183 184 - mei_hw_start(dev); 184 + ret = mei_hw_start(dev); 185 + if (ret) { 186 + dev_err(&dev->pdev->dev, "hw_start failed disabling the device\n"); 187 + dev->dev_state = MEI_DEV_DISABLED; 188 + return; 189 + } 185 190 186 191 dev_dbg(&dev->pdev->dev, "link is established start sending messages.\n"); 187 192 /* link is established * start sending messages. */
+2 -2
drivers/misc/mei/mei_dev.h
··· 544 544 return dev->ops->hw_reset(dev, enable); 545 545 } 546 546 547 - static inline void mei_hw_start(struct mei_device *dev) 547 + static inline int mei_hw_start(struct mei_device *dev) 548 548 { 549 - dev->ops->hw_start(dev); 549 + return dev->ops->hw_start(dev); 550 550 } 551 551 552 552 static inline void mei_clear_interrupts(struct mei_device *dev)