diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-07-17 08:13:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 22:31:35 -0400 |
commit | dab9bf41b23fe700c4a74133e41eb6a21706031e (patch) | |
tree | 652729611132f5cbf25e40e43da9ec08864edde6 /drivers/misc/mei/hw-me.c | |
parent | 99f22c4ef24cf87b0dae6aabe6b5e620b62961d9 (diff) |
mei: me: fix waiting for hw ready
1. MEI_INTEROP_TIMEOUT is in seconds not in jiffies
so we use mei_secs_to_jiffies macro
While cold boot is fast this is relevant in resume
2. wait_event_interruptible_timeout can return with
-ERESTARTSYS so do not override it with -ETIMEDOUT
3.Adjust error message
Tested-by: Shuah Khan <shuah.kh@samsung.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/hw-me.c')
-rw-r--r-- | drivers/misc/mei/hw-me.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index a0e19e61e7df..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; |