Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b74d8831 authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Greg Kroah-Hartman
Browse files

mei: amthif: interrupt reader on link reset



In case of link reset all waiting readers should be interrupted.

Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4bddf56f
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -122,7 +122,8 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
		mutex_unlock(&dev->device_lock);
		mutex_unlock(&dev->device_lock);


		wait_ret = wait_event_interruptible(cl->rx_wait,
		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 */
		/* Locking again the Mutex */
		mutex_lock(&dev->device_lock);
		mutex_lock(&dev->device_lock);
@@ -130,6 +131,11 @@ int mei_amthif_read(struct mei_device *dev, struct file *file,
		if (wait_ret)
		if (wait_ret)
			return -ERESTARTSYS;
			return -ERESTARTSYS;


		if (!mei_cl_is_connected(cl)) {
			rets = -EBUSY;
			goto out;
		}

		cb = mei_cl_read_cb(cl, file);
		cb = mei_cl_read_cb(cl, file);
	}
	}