[3.13.y.z extended stable] Patch "mei: fix return value on disconnect timeout" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Mon Sep 15 22:07:40 UTC 2014

This is a note to let you know that I have just added a patch titled

    mei: fix return value on disconnect timeout

to the linux-3.13.y-queue branch of the 3.13.y.z extended stable tree 
which can be found at:


This patch is scheduled to be released in version

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y.z tree, see



>From 83ab711db71b7ecd3eafcee2c723f6a126e92ae8 Mon Sep 17 00:00:00 2001
From: Alexander Usyskin <alexander.usyskin at intel.com>
Date: Thu, 17 Jul 2014 10:53:38 +0300
Subject: mei: fix return value on disconnect timeout

commit fe2f17eb3da38ac0d5a00c511255bf3a33d16d24 upstream.

wait_event_timeout can return 0 or the remaining jiffies
so return -ETIME if disconnected state not reached.

Signed-off-by: Alexander Usyskin <alexander.usyskin at intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler at intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/misc/mei/client.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 54122db..0a91a23 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -436,7 +436,7 @@ int mei_cl_disconnect(struct mei_cl *cl)
 	struct mei_device *dev;
 	struct mei_cl_cb *cb;
-	int rets, err;
+	int rets;

 	if (WARN_ON(!cl || !cl->dev))
 		return -ENODEV;
@@ -470,24 +470,18 @@ int mei_cl_disconnect(struct mei_cl *cl)

-	err = wait_event_timeout(dev->wait_recvd_msg,
+	wait_event_timeout(dev->wait_recvd_msg,
 			MEI_FILE_DISCONNECTED == cl->state,

 	if (MEI_FILE_DISCONNECTED == cl->state) {
 		rets = 0;
 		cl_dbg(dev, cl, "successfully disconnected from FW client.\n");
 	} else {
-		rets = -ENODEV;
-		if (MEI_FILE_DISCONNECTED != cl->state)
-			cl_err(dev, cl, "wrong status client disconnect.\n");
-		if (err)
-			cl_dbg(dev, cl, "wait failed disconnect err=%08x\n",
-					err);
-		cl_err(dev, cl, "failed to disconnect from FW client.\n");
+		cl_dbg(dev, cl, "timeout on disconnect from FW client.\n");
+		rets = -ETIME;

 	mei_io_list_flush(&dev->ctrl_rd_list, cl);

More information about the kernel-team mailing list