From c701c4d9d2206c2bf69af1131ff693ea4f8af9af Mon Sep 17 00:00:00 2001 From: Govind Singh Date: Fri, 28 Jul 2017 15:00:26 +0530 Subject: [PATCH] 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 --- core/dp/htt/htt_rx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c index f76026e6bd8a..ac6bcf29adc2 100644 --- a/core/dp/htt/htt_rx.c +++ b/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);