From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1ACDC433FF for ; Mon, 29 Jul 2019 20:11:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B577A205F4 for ; Mon, 29 Jul 2019 20:11:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564431111; bh=ppr5BAOLZkqvQ0hhuWwGlJX9zzXOdBVO8hauVU+jdio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=NiFQQKkM6TqVUQd7JyCKOdBWQwuuJ2doTNEDhY8bUkitOufzzw1cVht3kJqFcX4bZ 9IRv3uUAjUSMxdugoGNBAuTWMDNiQwqRj2ZaNtyjn8tVbZ/+f5lvDi2FC09xV+W7zH JSkSkWDPzJNx6rTAs3FrbhXuit7Nw9wMB7xPBri4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730495AbfG2ULu (ORCPT ); Mon, 29 Jul 2019 16:11:50 -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;