aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2014-08-12 13:16:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-24 01:56:16 -0400
commit2c2b93ecace25c3720e68e6cd7ee47f38c1d2e90 (patch)
treed7223dc0fb6cc6225cc34271a636a1678179dae5 /drivers/misc/mei
parente60cdc907c1d656b628480b737710fb73bb69001 (diff)
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: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r--drivers/misc/mei/hw-me.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index a9a0d08f758e..caf0da335994 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -266,19 +266,14 @@ static bool mei_me_hw_is_ready(struct mei_device *dev)
266 266
267static int mei_me_hw_ready_wait(struct mei_device *dev) 267static int mei_me_hw_ready_wait(struct mei_device *dev)
268{ 268{
269 int err;
270
271 mutex_unlock(&dev->device_lock); 269 mutex_unlock(&dev->device_lock);
272 err = wait_event_interruptible_timeout(dev->wait_hw_ready, 270 wait_event_timeout(dev->wait_hw_ready,
273 dev->recvd_hw_ready, 271 dev->recvd_hw_ready,
274 mei_secs_to_jiffies(MEI_HW_READY_TIMEOUT)); 272 mei_secs_to_jiffies(MEI_HW_READY_TIMEOUT));
275 mutex_lock(&dev->device_lock); 273 mutex_lock(&dev->device_lock);
276 if (!err && !dev->recvd_hw_ready) { 274 if (!dev->recvd_hw_ready) {
277 if (!err) 275 dev_err(&dev->pdev->dev, "wait hw ready failed\n");
278 err = -ETIME; 276 return -ETIME;
279 dev_err(&dev->pdev->dev,
280 "wait hw ready failed. status = %d\n", err);
281 return err;
282 } 277 }
283 278
284 dev->recvd_hw_ready = false; 279 dev->recvd_hw_ready = false;
@@ -664,7 +659,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
664 dev_dbg(&dev->pdev->dev, "we need to start the dev.\n"); 659 dev_dbg(&dev->pdev->dev, "we need to start the dev.\n");
665 660
666 dev->recvd_hw_ready = true; 661 dev->recvd_hw_ready = true;
667 wake_up_interruptible(&dev->wait_hw_ready); 662 wake_up(&dev->wait_hw_ready);
668 } else { 663 } else {
669 dev_dbg(&dev->pdev->dev, "Spurious Interrupt\n"); 664 dev_dbg(&dev->pdev->dev, "Spurious Interrupt\n");
670 } 665 }