Jelajahi Sumber

wil6210: guarantee safe access to rx descriptors shared memory

add memory barrier after allocating new rx descriptors, before
updating the hwtail.
This will guarantee that all writes to descriptors (shared memory)
are done before committing them to HW.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Maya Erez 9 tahun lalu
induk
melakukan
ab6d7cc3ea
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  1. 6 0
      drivers/net/wireless/ath/wil6210/txrx.c

+ 6 - 0
drivers/net/wireless/ath/wil6210/txrx.c

@@ -544,6 +544,12 @@ static int wil_rx_refill(struct wil6210_priv *wil, int count)
 			break;
 			break;
 		}
 		}
 	}
 	}
+
+	/* make sure all writes to descriptors (shared memory) are done before
+	 * committing them to HW
+	 */
+	wmb();
+
 	wil_w(wil, v->hwtail, v->swtail);
 	wil_w(wil, v->hwtail, v->swtail);
 
 
 	return rc;
 	return rc;