mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [staging] staging/mei: fix suspend failure
@ 2011-06-13 13:39 Tomas Winkler
  2011-06-14 10:10 ` Winkler, Tomas
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas Winkler @ 2011-06-13 13:39 UTC (permalink / raw)
  To: gregkh, a.miskiewicz; +Cc: linux-kernel, devel, Tomas Winkler

wait_event_interruptible_timeout return value was wrongly used.
The remaining timeout was used as the error code.
This fix translated wait_event_interruptible_timeout return value
into error code that can be propagated.

[10291.674121] pci_pm_suspend(): mei_pci_suspend+0x0/0x8b [mei] returns 2500
It's thinkpad t400 with
00:03.0 Communication controller [0780]: Intel Corporation Mobile 4 Series Chipset MEI Controller [8086:2a44] (rev 07)

Reported-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/staging/mei/init.c |    2 +-
 drivers/staging/mei/wd.c   |   13 +++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/mei/init.c b/drivers/staging/mei/init.c
index eb70e70..0fa8216 100644
--- a/drivers/staging/mei/init.c
+++ b/drivers/staging/mei/init.c
@@ -185,7 +185,7 @@ int mei_hw_init(struct mei_device *dev)
 		mutex_lock(&dev->device_lock);
 	}
 
-	if (!err && !dev->recvd_msg) {
+	if (err <= 0 && !dev->recvd_msg) {
 		dev->mei_state = MEI_DISABLED;
 		dev_dbg(&dev->pdev->dev,
 			"wait_event_interruptible_timeout failed"
diff --git a/drivers/staging/mei/wd.c b/drivers/staging/mei/wd.c
index 18516a8..42f04ef 100644
--- a/drivers/staging/mei/wd.c
+++ b/drivers/staging/mei/wd.c
@@ -169,10 +169,15 @@ int mei_wd_stop(struct mei_device *dev, bool preserve)
 	ret = wait_event_interruptible_timeout(dev->wait_stop_wd,
 					dev->wd_stopped, 10 * HZ);
 	mutex_lock(&dev->device_lock);
-	if (!dev->wd_stopped)
-		dev_dbg(&dev->pdev->dev, "stop wd failed to complete.\n");
-	else
-		dev_dbg(&dev->pdev->dev, "stop wd complete.\n");
+	if (dev->wd_stopped) {
+		dev_dbg(&dev->pdev->dev, "stop wd complete ret=%d.\n", ret);
+		ret = 0;
+	} else {
+		if (!ret)
+			ret = -ETIMEDOUT;
+		dev_warn(&dev->pdev->dev,
+			"stop wd failed to complete ret=%d.\n", ret);
+	}
 
 	if (preserve)
 		dev->wd_timeout = wd_timeout;
-- 
1.7.4.4

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [staging] staging/mei: fix suspend failure
  2011-06-13 13:39 [staging] staging/mei: fix suspend failure Tomas Winkler
@ 2011-06-14 10:10 ` Winkler, Tomas
  0 siblings, 0 replies; 2+ messages in thread
From: Winkler, Tomas @ 2011-06-14 10:10 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, devel, a.miskiewicz



> -----Original Message-----
> From: Winkler, Tomas
> Sent: Monday, June 13, 2011 4:40 PM
> To: gregkh@suse.de; a.miskiewicz@gmail.com
> Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org; Winkler,
> Tomas
> Subject: [staging] staging/mei: fix suspend failure
> 
> wait_event_interruptible_timeout return value was wrongly used.
> The remaining timeout was used as the error code.
> This fix translated wait_event_interruptible_timeout return value into error
> code that can be propagated.
> 
> [10291.674121] pci_pm_suspend(): mei_pci_suspend+0x0/0x8b [mei]
> returns 2500 It's thinkpad t400 with
> 00:03.0 Communication controller [0780]: Intel Corporation Mobile 4 Series
> Chipset MEI Controller [8086:2a44] (rev 07)
> 
> Reported-by: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---


Greg,  I forgot to state that this one is probably 3.0 material.


Thanks
Tomas

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-14 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-13 13:39 [staging] staging/mei: fix suspend failure Tomas Winkler
2011-06-14 10:10 ` Winkler, Tomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®