Browse Source

qcacmn: Add memory barrier to avoid inconsistent read for valid flag

Currently there is no memory barrier after valid flag read,
which can result in reading q_elem values in random order,
due to which host can read stale entried from the q_elem.

To fix the issue add memory barrier to avoid inconsistent
read for valid flag.

Change-Id: I9431d4f62188def37c2515e376a28f3985733f85
CRs-Fixed: 3577746
Amit Mehta 1 year ago
parent
commit
63979604dd
1 changed files with 1 additions and 0 deletions
  1. 1 0
      hif/src/hif_main.c

+ 1 - 0
hif/src/hif_main.c

@@ -1707,6 +1707,7 @@ static void hif_reg_write_work(void *arg)
 		if (!q_elem->valid)
 			break;
 
+		qdf_rmb();
 		q_elem->dequeue_time = qdf_get_log_timestamp();
 		ring_id = q_elem->ce_state->id;
 		offset = q_elem->offset;