mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
msm: cvp: avoid checking read_idx again
checking new_read_idx with write_idx and rechecking the read and write idx after resetting request. Change-Id: I375837f8f4ad3d1445bcbdd89dc5c79e4cea0f9d Signed-off-by: suchawla <suchawla@codeaurora.org>
This commit is contained in:
parent
17c22334d7
commit
ccf452010a
1 changed files with 12 additions and 8 deletions
|
|
@ -723,13 +723,17 @@ static int __read_queue(struct cvp_iface_q_info *qinfo, u8 *packet,
|
|||
*/
|
||||
mb();
|
||||
*pb_tx_req_is_set = 0;
|
||||
spin_unlock(&qinfo->hfi_lock);
|
||||
dprintk(CVP_DBG,
|
||||
"%s queue is empty, rx_req = %u, tx_req = %u, read_idx = %u\n",
|
||||
receive_request ? "message" : "debug",
|
||||
queue->qhdr_rx_req, queue->qhdr_tx_req,
|
||||
queue->qhdr_read_idx);
|
||||
return -ENODATA;
|
||||
if (write_idx != queue->qhdr_write_idx) {
|
||||
queue->qhdr_rx_req = 0;
|
||||
} else {
|
||||
spin_unlock(&qinfo->hfi_lock);
|
||||
dprintk(CVP_DBG,
|
||||
"%s queue is empty, rx_req = %u, tx_req = %u, read_idx = %u\n",
|
||||
receive_request ? "message" : "debug",
|
||||
queue->qhdr_rx_req, queue->qhdr_tx_req,
|
||||
queue->qhdr_read_idx);
|
||||
return -ENODATA;
|
||||
}
|
||||
}
|
||||
|
||||
read_ptr = (u32 *)((qinfo->q_array.align_virtual_addr) +
|
||||
|
|
@ -773,7 +777,7 @@ static int __read_queue(struct cvp_iface_q_info *qinfo, u8 *packet,
|
|||
rc = -ENODATA;
|
||||
}
|
||||
|
||||
if (read_idx != write_idx)
|
||||
if (new_read_idx != queue->qhdr_write_idx)
|
||||
queue->qhdr_rx_req = 0;
|
||||
else
|
||||
queue->qhdr_rx_req = receive_request;
|
||||
|
|
|
|||
Loading…
Reference in a new issue