mhi: core: Fix race condition on poll_inbound

Fix race condition in mhi_poll_inbound which could leave the
bounce buffer list and TRE list out of sync.

Change-Id: I76c7de75256b59f8a0dff2a85af733c441761385
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Signed-off-by: Tony Truong <truong@codeaurora.org>
This commit is contained in:
Tony Truong 2016-01-11 15:20:56 -08:00 committed by David Keitel
parent 4b71631d65
commit 7695e3d2ea

View file

@ -1499,7 +1499,7 @@ int mhi_poll_inbound(struct mhi_client_handle *client_handle,
bb_ctxt = &mhi_dev_ctxt->chan_bb_list[chan];
mutex_lock(chan_mutex);
if (local_chan_ctxt->rp != local_chan_ctxt->ack_rp) {
if (bb_ctxt->rp != bb_ctxt->ack_rp) {
pending_trb = (struct mhi_tx_pkt *)(local_chan_ctxt->ack_rp);
result->flags = pending_trb->info;
bb = bb_ctxt->ack_rp;