From patchwork Sun Mar 25 14:39:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10306653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E11F600F6 for ; Sun, 25 Mar 2018 14:41:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D28A281B7 for ; Sun, 25 Mar 2018 14:41:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 308CB28C63; Sun, 25 Mar 2018 14:41:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF1A928BC5 for ; Sun, 25 Mar 2018 14:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753414AbeCYOjg (ORCPT ); Sun, 25 Mar 2018 10:39:36 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59158 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753396AbeCYOjb (ORCPT ); Sun, 25 Mar 2018 10:39:31 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id AF58D60C65; Sun, 25 Mar 2018 14:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521988770; bh=h0mHZFSFZJbJqZkcxxKfY2TdQZJjiKz025WLDIUNbV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KPh2sR7q5JaTsodivQL24cEWIfHk3qrutI//FnJxar7x2yY8rcBdxPCgfvPGi2liI PD0zR7VhUNwq+FnSfTihLXblZrzxk9zH9Nwfq6KGEvnXGiA4pEx9blaTapnZi1jD61 6zco7Lx1PYpy6nGAHVyeKDtMYaqtTKIRx+aBGqDk= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7983660C5F; Sun, 25 Mar 2018 14:39:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521988770; bh=h0mHZFSFZJbJqZkcxxKfY2TdQZJjiKz025WLDIUNbV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KPh2sR7q5JaTsodivQL24cEWIfHk3qrutI//FnJxar7x2yY8rcBdxPCgfvPGi2liI PD0zR7VhUNwq+FnSfTihLXblZrzxk9zH9Nwfq6KGEvnXGiA4pEx9blaTapnZi1jD61 6zco7Lx1PYpy6nGAHVyeKDtMYaqtTKIRx+aBGqDk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7983660C5F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: netdev@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Ariel Elior , everest-linux-l2@cavium.com, linux-kernel@vger.kernel.org Subject: [PATCH v7 3/7] bnx2x: Replace doorbell barrier() with wmb() Date: Sun, 25 Mar 2018 10:39:17 -0400 Message-Id: <1521988761-30344-4-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521988761-30344-1-git-send-email-okaya@codeaurora.org> References: <1521988761-30344-1-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP barrier() doesn't guarantee memory writes to be observed by the hardware on all architectures. barrier() only tells compiler not to move this code with respect to other read/writes. If memory write needs to be observed by the HW, wmb() is the right choice. Signed-off-by: Sinan Kaya --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 3 ++- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index d7c98e8..0f86f18 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c @@ -4153,7 +4153,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) wmb(); txdata->tx_db.data.prod += nbd; - barrier(); + /* make sure descriptor update is observed by HW */ + wmb(); DOORBELL(bp, txdata->cid, txdata->tx_db.raw); diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 1e33abd..39af4f8 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c @@ -2591,7 +2591,8 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode) wmb(); txdata->tx_db.data.prod += 2; - barrier(); + /* make sure descriptor update is observed by the HW */ + wmb(); DOORBELL(bp, txdata->cid, txdata->tx_db.raw); mmiowb();