[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1454880943-12653-14-git-send-email-tomas.winkler@intel.com>
Date: Sun, 7 Feb 2016 23:35:29 +0200
From: Tomas Winkler <tomas.winkler@...el.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Alexander Usyskin <alexander.usyskin@...el.com>,
linux-kernel@...r.kernel.org,
Tomas Winkler <tomas.winkler@...el.com>
Subject: [char-misc-next 13/27] mei: amthif: interrupt reader on link reset
From: Alexander Usyskin <alexander.usyskin@...el.com>
In case of link reset all waiting readers should be interrupted.
Signed-off-by: Alexander Usyskin <alexander.usyskin@...el.com>
Signed-off-by: Tomas Winkler <tomas.winkler@...el.com>
---
drivers/misc/mei/amthif.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index b98eac389782..ca2efc3602df 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -122,7 +122,8 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
mutex_unlock(&dev->device_lock);
wait_ret = wait_event_interruptible(cl->rx_wait,
- !list_empty(&cl->rd_completed));
+ !list_empty(&cl->rd_completed) ||
+ !mei_cl_is_connected(cl));
/* Locking again the Mutex */
mutex_lock(&dev->device_lock);
@@ -130,6 +131,11 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
if (wait_ret)
return -ERESTARTSYS;
+ if (!mei_cl_is_connected(cl)) {
+ rets = -EBUSY;
+ goto out;
+ }
+
cb = mei_cl_read_cb(cl, file);
}
--
2.4.3
Powered by blists - more mailing lists