mei: move read cb to complete queue if not connected
authorAlexander Usyskin <alexander.usyskin@intel.com>
Thu, 16 Jun 2016 14:58:56 +0000 (17:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Aug 2016 12:36:39 +0000 (14:36 +0200)
Move read cb to the completion queue if a read finds out that client
is not connected. This expedite user space reader wake on error
condition.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/interrupt.c

index 436ecda3935e551b5be4adcd947802762601c59c..412229e7bb7cc8003ce0af2e5e7a8bfc31ff3370 100644 (file)
@@ -113,6 +113,7 @@ int mei_cl_irq_read_msg(struct mei_cl *cl,
 
        if (!mei_cl_is_connected(cl)) {
                cl_dbg(dev, cl, "not connected\n");
+               list_move_tail(&cb->list, &complete_list->list);
                cb->status = -ENODEV;
                goto out;
        }