summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDenis Bolotin <denis.bolotin@cavium.com>2018-11-12 12:50:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-13 09:21:35 +0100
commit93940a277fdaf2edd308519b89f57a2b6705a9c5 (patch)
tree1e044e34093aea70c44b50582f667fa35f178cba /drivers
parent30d5a7c1b6c06fad598f5fbd71b513625c462bc5 (diff)
qed: Fix reading wrong value in loop condition
[ Upstream commit ed4eac20dcffdad47709422e0cb925981b056668 ] 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_int.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_int.c b/drivers/net/ethernet/qlogic/qed/qed_int.c
index 9cc9d62c1fec..8b15a018d625 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_int.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_int.c
@@ -177,6 +177,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);