[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181112105023.23842-5-denis.bolotin@cavium.com>
Date: Mon, 12 Nov 2018 12:50:23 +0200
From: Denis Bolotin <denis.bolotin@...ium.com>
To: <davem@...emloft.net>, <netdev@...r.kernel.org>
CC: <michal.kalderon@...ium.com>, <ariel.elior@...ium.com>,
Denis Bolotin <denis.bolotin@...ium.com>
Subject: [PATCH net v2 4/4] 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: Denis Bolotin <denis.bolotin@...ium.com>
Signed-off-by: Michal Kalderon <michal.kalderon@...ium.com>
---
drivers/net/ethernet/qlogic/qed/qed_int.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_int.c b/drivers/net/ethernet/qlogic/qed/qed_int.c
index 0f0aba7..b22f464 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_int.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_int.c
@@ -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);
--
1.8.3.1
Powered by blists - more mailing lists