Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3818207ybi; Mon, 29 Jul 2019 13:13:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpRsF7z1zGcNeHCLsFRqpvYnUnLcldAK/559yX8FXO10icgXHpG5Hx3E1i0dvEfZC054P4 X-Received: by 2002:a62:2582:: with SMTP id l124mr38048488pfl.43.1564431199787; Mon, 29 Jul 2019 13:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564431199; cv=none; d=google.com; s=arc-20160816; b=LKV5HniGFFLNYdDL2W9xbCQFhWdbZ4OhtnkmhfTQ5hkj711XNlWoB6yWFwp9rFXIGZ kO8u2m55AY4FoqVPuYNU54W92LeKIS8cgjROcSgPy0bbLHtD4UdWMdCEd8HwJ113YGkh AOWAySNP/YHSFSCZAUFuLyMI3BT8lT2vjH2y91tkzbCWzf5Cp+jHh4UIg1lkLozJrDUr Bt3EKWfBWIH1ezaEc7L5BNifgV9AOlkvwslXR0zhHr/Y0QFpq5KJI1ae2nySzQkLhWED 5DUiZ5nKU59Js3JPdqDy1bsn3VY7f+jxxYGHD4mxuD48sdEsPhJw26fT75DQs3FILx4V o15w== 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=pG44rMOGETBN4AXpKl23iGPwE+VD7ngsnyEtXKnB7TFqLWi79uUzNrakCd257RQ8/O BPh+kDcgMMLOXUdysIFWpPmR9O5mhCS7JrXkkutzUw4Jz+3q0z1Fhc0prVfDkPxITTZ9 oC2a+KBgo8U/Ro3pyamUUaJs5/xCBrq6WxQOmxmmQpJ+NYpIVsKR8U41/YnPXOpo1nHF Ok+J2D1R/CKfCRfd71epuiX5V/LvzDJSWEBtv8j9lUe2EHLTXMXYS9GVHOCCnLhiSi/L 1dgIqOEVTh78DP1qBytjucswTrcY+04J7YmbjanwYJSCDMUFCmN0XQtcbQYs8EjC/i7A DJAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=p+fHldtz; 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 v184si29697228pgv.566.2019.07.29.13.13.04; Mon, 29 Jul 2019 13:13:19 -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=p+fHldtz; 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 S1730491AbfG2ULt (ORCPT + 99 others); Mon, 29 Jul 2019 16:11:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:46716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730288AbfG2Tcz (ORCPT ); Mon, 29 Jul 2019 15:32:55 -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 6FC992171F; Mon, 29 Jul 2019 19:32:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428774; bh=ppr5BAOLZkqvQ0hhuWwGlJX9zzXOdBVO8hauVU+jdio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p+fHldtz4/d0AH9Wwww+8GY999hAP8IZiMQZWB+Aga6jPsQ7yDOgHn1LTVqgXWN9i wpIcdryUcBKrGKttnmhjw9eH3Po5k3Es9tgT0htjDr8JMURFlfso36V8IVlw2c8kuZ 3ltb/pDUuGXxjf+PTrLR9Rj8mq2hG0ZZE5Qm+MnA= 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.14 181/293] bnx2x: Prevent load reordering in tx completion processing Date: Mon, 29 Jul 2019 21:21:12 +0200 Message-Id: <20190729190838.371128482@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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;