Commit 2c2b93ec authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Greg Kroah-Hartman

mei: me: wait for hw ready non-interruptible

We cannot handle user interrupt in context of hw initialization
so we only wait for time out which is reasonably short
Also we don't need to check error from wait, only flag value.
Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e60cdc90
...@@ -266,19 +266,14 @@ static bool mei_me_hw_is_ready(struct mei_device *dev) ...@@ -266,19 +266,14 @@ static bool mei_me_hw_is_ready(struct mei_device *dev)
static int mei_me_hw_ready_wait(struct mei_device *dev) static int mei_me_hw_ready_wait(struct mei_device *dev)
{ {
int err;
mutex_unlock(&dev->device_lock); mutex_unlock(&dev->device_lock);
err = wait_event_interruptible_timeout(dev->wait_hw_ready, wait_event_timeout(dev->wait_hw_ready,
dev->recvd_hw_ready, dev->recvd_hw_ready,
mei_secs_to_jiffies(MEI_HW_READY_TIMEOUT)); mei_secs_to_jiffies(MEI_HW_READY_TIMEOUT));
mutex_lock(&dev->device_lock); mutex_lock(&dev->device_lock);
if (!err && !dev->recvd_hw_ready) { if (!dev->recvd_hw_ready) {
if (!err) dev_err(&dev->pdev->dev, "wait hw ready failed\n");
err = -ETIME; return -ETIME;
dev_err(&dev->pdev->dev,
"wait hw ready failed. status = %d\n", err);
return err;
} }
dev->recvd_hw_ready = false; dev->recvd_hw_ready = false;
...@@ -664,7 +659,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id) ...@@ -664,7 +659,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
dev_dbg(&dev->pdev->dev, "we need to start the dev.\n"); dev_dbg(&dev->pdev->dev, "we need to start the dev.\n");
dev->recvd_hw_ready = true; dev->recvd_hw_ready = true;
wake_up_interruptible(&dev->wait_hw_ready); wake_up(&dev->wait_hw_ready);
} else { } else {
dev_dbg(&dev->pdev->dev, "Spurious Interrupt\n"); dev_dbg(&dev->pdev->dev, "Spurious Interrupt\n");
} }
......
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