Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1162276ybi; Fri, 2 Aug 2019 10:18:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvI8hIgpdDcqAXQULnrDqo3sTYb/m7c1+V7/XitjaougqcKYU4/n5or27+S2we9/gk3Z5g X-Received: by 2002:a17:902:449:: with SMTP id 67mr16145106ple.105.1564766323666; Fri, 02 Aug 2019 10:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564766323; cv=none; d=google.com; s=arc-20160816; b=ZNQANNcrYTTWchRi1e5YUd37Rb+PaDNIS9VbXimC8G6ykxlLV8rUQ2iIcuwVR70U3E Nzk6B0WTwxwrPsmW7IrtUbnzIYMel3ZbMWMZgUn/89cpxRhqz41uYh4MDsicB+kkWTRo 0cI9AUqumPog4ws4C9Xq0/qe9dxIlc1YpES9OgdlG/LRmY8/OtG4wwf0zHDho9r2oalD Ub1FxJnmub0FeNiKTHpt9SN8igv94xlVhAHpT6SKsyG5U1h9rEGu2ML5cpKiSk1T8ncW EEwu6JQP+oepWExOxILOYbBVeXIrscoicMjo3Ssh6vh/85QD4eHKHQSpVN8DWlsPO65y 9I1Q== 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=7X/Mx/vLXpzvuirKDdQ/t9sfU0kEQkXQkIgI4jP54c8=; b=p4R0JaIQG9uWrDjCJtXsCY2NfdaUsNhL+/UplicR2QnRZnEWlVIx4sNxq0V6rTOOuO NwxvEKgiGsKuUdhs+rjbkr/EEM2tqwNX8Gft7aynRp+kvZZHGCX5w+uRubCBLNs5Nv8j D0N8SIxU5hQZkl7coLcTjziGNBVB3aqAlaisBv0tsrD3OkFWuOVwtK16e7LiFOqE+zGg RhQbM6Iy9FPlB1Gq2wCSuG5ZJYPSbX6AsSYEjUDMPV9vGQxcTj0frgaOafYcTm87RrhQ D8GnYD2i4oxMT0/TtptyiKSS3G877Ru68PvwLQhSkjlc+LgUsxeg6vPBCIEwpwl4Qmpy mGMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TxVeltpA; 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 l1si6903355pjq.17.2019.08.02.10.18.28; Fri, 02 Aug 2019 10:18:43 -0700 (PDT) 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=TxVeltpA; 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 S2392006AbfHBJpr (ORCPT + 99 others); Fri, 2 Aug 2019 05:45:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:49548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391999AbfHBJpn (ORCPT ); Fri, 2 Aug 2019 05:45:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 9B84F206A2; Fri, 2 Aug 2019 09:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564739142; bh=ppr5BAOLZkqvQ0hhuWwGlJX9zzXOdBVO8hauVU+jdio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TxVeltpAJOdRUenZMO+363gmBVH0/3/eWYdsxi4zsxzjf8U90QU+0J7bqJQcNhslx a5ABcnKvFkq1OPWivS+gOrMNi2yYcjVN/tLDULo/fJs2r0mr7P/kHyFroP//XYGBSQ IqyEZo/03qljbBJ6Z+TMI6zLkTHiBAuRkPyC34sM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brian King , "David S. Miller" Subject: [PATCH 4.9 129/223] bnx2x: Prevent load reordering in tx completion processing Date: Fri, 2 Aug 2019 11:35:54 +0200 Message-Id: <20190802092247.364104604@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Brian King [ Upstream commit ea811b795df24644a8eb760b493c43fba4450677 ] This patch fixes an issue seen on Power systems with bnx2x which results in the skb is NULL WARN_ON in bnx2x_free_tx_pkt firing due to the skb pointer getting loaded in bnx2x_free_tx_pkt prior to the hw_cons load in bnx2x_tx_int. Adding a read memory barrier resolves the issue. Signed-off-by: Brian King Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c @@ -286,6 +286,9 @@ int bnx2x_tx_int(struct bnx2x *bp, struc hw_cons = le16_to_cpu(*txdata->tx_cons_sb); sw_cons = txdata->tx_pkt_cons; + /* Ensure subsequent loads occur after hw_cons */ + smp_rmb(); + while (sw_cons != hw_cons) { u16 pkt_cons;