Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b0d1533 authored by suchawla's avatar suchawla
Browse files

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: Ideb07e2eae5d17821c4c0b1b3a27502d8701f119
Signed-off-by: default avatarsuchawla <suchawla@codeaurora.org>
parent 74879d9a
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -826,6 +826,9 @@ static int __read_queue(struct cvp_iface_q_info *qinfo, u8 *packet,
		 */
		mb();
		*pb_tx_req_is_set = 0;
		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",
@@ -834,6 +837,7 @@ static int __read_queue(struct cvp_iface_q_info *qinfo, u8 *packet,
				queue->qhdr_read_idx);
			return -ENODATA;
		}
	}

	read_ptr = (u32 *)((qinfo->q_array.align_virtual_addr) +
				(read_idx << 2));
@@ -876,7 +880,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;