diff options
Diffstat (limited to 'drivers/misc/mei/hw-me.c')
-rw-r--r-- | drivers/misc/mei/hw-me.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index e4f8dec4dc3c..b22c7e247225 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw-me.c | |||
@@ -239,14 +239,18 @@ static int mei_me_hw_ready_wait(struct mei_device *dev) | |||
239 | if (mei_me_hw_is_ready(dev)) | 239 | if (mei_me_hw_is_ready(dev)) |
240 | return 0; | 240 | return 0; |
241 | 241 | ||
242 | dev->recvd_hw_ready = false; | ||
242 | mutex_unlock(&dev->device_lock); | 243 | mutex_unlock(&dev->device_lock); |
243 | err = wait_event_interruptible_timeout(dev->wait_hw_ready, | 244 | err = wait_event_interruptible_timeout(dev->wait_hw_ready, |
244 | dev->recvd_hw_ready, MEI_INTEROP_TIMEOUT); | 245 | dev->recvd_hw_ready, |
246 | mei_secs_to_jiffies(MEI_INTEROP_TIMEOUT)); | ||
245 | mutex_lock(&dev->device_lock); | 247 | mutex_lock(&dev->device_lock); |
246 | if (!err && !dev->recvd_hw_ready) { | 248 | if (!err && !dev->recvd_hw_ready) { |
249 | if (!err) | ||
250 | err = -ETIMEDOUT; | ||
247 | dev_err(&dev->pdev->dev, | 251 | dev_err(&dev->pdev->dev, |
248 | "wait hw ready failed. status = 0x%x\n", err); | 252 | "wait hw ready failed. status = %d\n", err); |
249 | return -ETIMEDOUT; | 253 | return err; |
250 | } | 254 | } |
251 | 255 | ||
252 | dev->recvd_hw_ready = false; | 256 | dev->recvd_hw_ready = false; |
@@ -483,7 +487,9 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id) | |||
483 | /* check if ME wants a reset */ | 487 | /* check if ME wants a reset */ |
484 | if (!mei_hw_is_ready(dev) && | 488 | if (!mei_hw_is_ready(dev) && |
485 | dev->dev_state != MEI_DEV_RESETTING && | 489 | dev->dev_state != MEI_DEV_RESETTING && |
486 | dev->dev_state != MEI_DEV_INITIALIZING) { | 490 | dev->dev_state != MEI_DEV_INITIALIZING && |
491 | dev->dev_state != MEI_DEV_POWER_DOWN && | ||
492 | dev->dev_state != MEI_DEV_POWER_UP) { | ||
487 | dev_dbg(&dev->pdev->dev, "FW not ready.\n"); | 493 | dev_dbg(&dev->pdev->dev, "FW not ready.\n"); |
488 | mei_reset(dev, 1); | 494 | mei_reset(dev, 1); |
489 | mutex_unlock(&dev->device_lock); | 495 | mutex_unlock(&dev->device_lock); |