Commit ed4eac20 authored by Denis Bolotin's avatar Denis Bolotin Committed by David S. Miller
Browse files

qed: Fix reading wrong value in loop condition



The value of "sb_index" is written by the hardware. Reading its value and
writing it to "index" must finish before checking the loop condition.

Signed-off-by: default avatarDenis Bolotin <denis.bolotin@cavium.com>
Signed-off-by: default avatarMichal Kalderon <michal.kalderon@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 291d57f6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -992,6 +992,8 @@ static int qed_int_attentions(struct qed_hwfn *p_hwfn)
	 */
	do {
		index = p_sb_attn->sb_index;
		/* finish reading index before the loop condition */
		dma_rmb();
		attn_bits = le32_to_cpu(p_sb_attn->atten_bits);
		attn_acks = le32_to_cpu(p_sb_attn->atten_ack);
	} while (index != p_sb_attn->sb_index);