Skip to content

Commit

Permalink
mei: reduce flow control only for completed messages
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Tomas Winkler authored and gregkh committed Apr 23, 2013
1 parent 0cfee51 commit 7013539
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/misc/mei/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7013539

Please sign in to comment.