瀏覽代碼

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 年之前
父節點
當前提交
c701c4d9d2
共有 1 個文件被更改,包括 6 次插入0 次删除
  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);