From patchwork Fri Mar 23 22:23:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10305685 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 C98E460349 for ; Fri, 23 Mar 2018 22:23:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAEA529178 for ; Fri, 23 Mar 2018 22:23:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F9A8291C9; Fri, 23 Mar 2018 22:23:59 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2958429178 for ; Fri, 23 Mar 2018 22:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yZb2yEA2esV6fv0/rtQ2KsSV2ooWHavUfWXwwgIlOLU=; b=pm7xughTvcx4T9 mb8fNy4la77nj6nAl+mcPyKnbJ47EiaREHUvq7iw47pq+lty2Dwiav6T2j66tYMkl5bB+xVb+zF0c Bg+UY+XxUBi91+dRR3izCeNOb/gy1WtbVuRlqWO4tqs4XYGkdf17Fp3X3kaUadvfSoVzWVyhxW1W+ D4HddTQqq+AZrI7JaGTHYvdbECemwFIzDJtusb4AuSKLuJYjtTyhhlRnBfIBb4yUuaJ7aybNATojw 75HS4dT0QDfSYHrXzMKZD6NKuxcQlRveHt/yNq3Qwf/sGVMR0zfAZFBPtwbt8ZLH4m3OSoku/OI40 eK3N7YQcmIMXDD6Kf9Dg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ezV6H-0005e8-Lq; Fri, 23 Mar 2018 22:23:53 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ezV5r-0005Md-4R for linux-arm-kernel@lists.infradead.org; Fri, 23 Mar 2018 22:23:28 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0E50E607A2; Fri, 23 Mar 2018 22:23:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521843801; bh=1P/d1yLCr461rdg/SWhnfgT3leBNtwmeS2rai72OKcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gPrejwTofMFhlc/s/JwIaztM8n8qaSWsR+Nk99Wg5T1HO4UgANxdOvZ6o4b41p+Om T5Kr9uhsd93PxdB2zOJtHFdOi2bVfXd51OGlPa+qLIxrlM0ds6L9zbZptddwKEFAcJ bPqHYmVcpE8zMQR3BLoMWcvLkD6Es1Gwa92+72DM= 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 8E19B607E5; Fri, 23 Mar 2018 22:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521843800; bh=1P/d1yLCr461rdg/SWhnfgT3leBNtwmeS2rai72OKcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QOQfYjhnQXHS+1m5PTkt+bnnFTXaKCeOr5mJ4o3M5UQTJjDocmFSJeVALdQdgBBEF SW7ff7hegvzNo/NYy6/4UIM9cL+r+q4YElQKZ17QppXZ0ZKYBCfrjD7EkM2Iu/7gNy lh6MlBzcuSTm3IOc4JEuqPzCGqC6bZ5GdlyV0Ln0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8E19B607E5 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 Subject: [PATCH v6 3/6] bnx2x: Replace doorbell barrier() with wmb() Date: Fri, 23 Mar 2018 18:23:08 -0400 Message-Id: <1521843791-21201-4-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521843791-21201-1-git-send-email-okaya@codeaurora.org> References: <1521843791-21201-1-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180323_152327_340200_9172653B X-CRM114-Status: GOOD ( 11.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Sinan Kaya , Ariel Elior , everest-linux-l2@cavium.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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..b97820f 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 sur edescriptor 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();