Browse Source

qcacld-3.0: Add mb before updating the write index of remote ring

When replenishing Rx buffers driver updates the address of the
buffer and the index of rx buffer in rx ring to the firmware.

Make sure alloc index write is reflected in the memory before
FW polls the remote ring write index as compiler can reorder
the instructions based on optimizations.

Disable compile time reorder by adding a write memory barrier.

Change-Id: Icb37598e6c36b4a128b1bcd91bfb9d643bf083e2
CRs-Fixed: 2084210
Govind Singh 7 years ago
parent
commit
c701c4d9d2
1 changed files with 6 additions and 0 deletions
  1. 6 0
      core/dp/htt/htt_rx.c

+ 6 - 0
core/dp/htt/htt_rx.c

@@ -541,6 +541,12 @@ moretofill:
 	}
 
 fail:
+	/*
+	 * Make sure alloc index write is reflected correctly before FW polls
+	 * remote ring write index as compiler can reorder the instructions
+	 * based on optimizations.
+	 */
+	qdf_mb();
 	*(pdev->rx_ring.alloc_idx.vaddr) = idx;
 	htt_rx_dbg_rxbuf_indupd(pdev, idx);