Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp802218imu; Tue, 11 Dec 2018 07:49:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/UoY+uCSl9WNrZgOncvfyqmeEH7UJNRQaZplMjkFsk2A383b3JXTDIKuNb3w/0NPVNzbzOr X-Received: by 2002:a62:c42:: with SMTP id u63mr16461922pfi.73.1544543367918; Tue, 11 Dec 2018 07:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543367; cv=none; d=google.com; s=arc-20160816; b=aXmk6BFMpc33flazBczLxws7FEV09gwJ3KNe+EG7ZI2dmnyUZB8L/t99+MHQhoOgbK tCruyBPMDpGRKSRDZWboYSmB2D6qOsDWA6yuTjLkmdAnc8tEWVpwf6H2oLB6PxhZHldU oqmgLDAqsFg7bTfKU+dJb0pTrM7cxiPMk21v9CB9Uz8dh7CNSD1crgeZAoLa//dnvov+ B+vYYbqAdqZz9piC+egfUKjMGwfT2yH+g0uIbBudF0a+MpOCL/iLjn4zNy9Y47/Tmd8n cV55qdY15HUgcmL6BgtcMv8tUrC4zi+9nHNbgoF7swyfh6YSLgucxkihgMQvM0rTukJC 1zbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4eaKUIYJkl9y9uhE71RAzcWxjO4v3+mJnoUIq9cn8HM=; b=0gFoAGeab60Wk191/p/Vk1DisDmCht5IlSlO9ViWV9eC82IFN1ngDsOKzhSzIv7RrT BBZl8NghAefZSDE+ZRETPCk8qb66JQ4CqL2LYzc6UZhI08Bbs4zBIz7+nW/danLMRJHL vFB4+U9Pl2RhYHSux3hc/SpGLS+Hyg3xlUi1FehFAI6ltxjwJ9k158YPumgqnii8BRC3 vV6npilgPBmcEWhAM6qbOzyl65yrvF6MotAKHrMfWSr+POxT5FPAzTLjiuZFXfYQhYpJ /8GM+8sIZWlmoogYAzhMPxS4IETcfSdp2gf1/pnCOferlZrveh0J08M57yR0ZGEw0oEb 6c1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LBbfIrzS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p66si13279534pfp.144.2018.12.11.07.48.50; Tue, 11 Dec 2018 07:49:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LBbfIrzS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728013AbeLKPrM (ORCPT + 99 others); Tue, 11 Dec 2018 10:47:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:35606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728486AbeLKPrK (ORCPT ); Tue, 11 Dec 2018 10:47:10 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 987342133F; Tue, 11 Dec 2018 15:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543230; bh=A6V1Hq06bn19ISrH+ofeByRCf3jCqEkPFyfmzRhaeqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LBbfIrzS7qyk4V9eT42OgLEBLFb8qfQ3BNgW4g8Fvvavgd2JGFgEeOFXjAD0xu1Il t8zQMGiuPovsGZm6buRkOtMBQY+Yr2itpvOq+sjZVM/+ffZ5DjCOhU4sR+FpqW3x+W xjhmJm85ZpHQOnyG2oAKhQIsIi1dzaRmdKo0Gark= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Denis Bolotin , Michal Kalderon , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 63/91] qed: Fix reading wrong value in loop condition Date: Tue, 11 Dec 2018 16:41:22 +0100 Message-Id: <20181211151611.216751710@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 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); -- 2.19.1