mei: reduce flow control only for completed messages
authorTomas Winkler <tomas.winkler@intel.com>
Tue, 23 Apr 2013 04:38:12 +0000 (07:38 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Apr 2013 17:29:58 +0000 (10:29 -0700)
This fixes bug when only first chunk of a large message split
by hbuf_max_len is written to the hardware.
All the consequent chunks will not get a new credit.

A regression introduced by the commit
0ef319c93cebff9f82bdd0cdbb298f2dd00acda8
mei: streamline write complete flow function

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

index 74730713a8d3e00512c972ac92c22de3654432d6..5ee2f07c929dd432d2ed4450f1dbdb17f5a9f8d2 100644 (file)
@@ -356,13 +356,14 @@ static int mei_irq_thread_write_complete(struct mei_device *dev, s32 *slots,
                return -ENODEV;
        }
 
-       if (mei_cl_flow_ctrl_reduce(cl))
-               return -ENODEV;
 
        cl->status = 0;
        cb->buf_idx += mei_hdr.length;
-       if (mei_hdr.msg_complete)
+       if (mei_hdr.msg_complete) {
+               if (mei_cl_flow_ctrl_reduce(cl))
+                       return -ENODEV;
                list_move_tail(&cb->list, &dev->write_waiting_list.list);
+       }
 
        return 0;
 }