mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
qed: Fix reading wrong value in loop condition
[ Upstream commit ed4eac20dc ]
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: Denis Bolotin <denis.bolotin@cavium.com>
Signed-off-by: Michal Kalderon <michal.kalderon@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
@@ -2135,6 +2135,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);
|
||||
|
||||
Reference in New Issue
Block a user