Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5d08418 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: glink: smem: Add wmb between data and write index"

parents c2a3c084 cd2e54ca
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -557,6 +557,12 @@ static int fifo_write(struct edge_info *einfo, const void *data, int len)
	len = fifo_write_body(einfo, data, len, &write_index);
	if (unlikely(len < 0))
		return len;

	/* All data writes need to be flushed to memory before the write index
	 * is updated. This protects against a race condition where the remote
	 * reads stale data because the write index was written before the data.
	 */
	wmb();
	einfo->tx_ch_desc->write_index = write_index;
	send_irq(einfo);

@@ -599,6 +605,11 @@ static int fifo_write_complex(struct edge_info *einfo,
	if (unlikely(len3 < 0))
		return len3;

	/* All data writes need to be flushed to memory before the write index
	 * is updated. This protects against a race condition where the remote
	 * reads stale data because the write index was written before the data.
	 */
	wmb();
	einfo->tx_ch_desc->write_index = write_index;
	send_irq(einfo);