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: 10307005 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 7FAB360212 for ; Sun, 25 Mar 2018 23:20:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7442C28DA9 for ; Sun, 25 Mar 2018 23:20:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67C3B29142; Sun, 25 Mar 2018 23:20:35 +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 CEF6C28DA9 for ; Sun, 25 Mar 2018 23:20:34 +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=2xX4MB5Ron5e61AWb1firVBBY9U4ls6KiRaZp7JP4w4=; b=bK1QA6V/AO8E96 K8QQ+rGzUR9eoFsA84oEISP8VW6OhVoGOXyz1ZlxATVWY/eaLLMZxuoYAdvleaSmOKEi1wRCGcq+0 o+lpWxsYmJlWsaz5Kuyv6oH1x6JyUNEu6UaJKQCTFN6coO7T97hJGC2MwqfSdtYYa4UrFUfxaGTtE jeBiagZOEb+6xgsai3bsADPxgrFEgfBZeRVWCInbkfbO0hqQCoMJd5FqF0RSKBgDcXghrMvypZreW SHvuwTf1SrFtCFbkb0IdF1kRQKw1Zbe+oIZtyvY4YEYhWEnQLVZgWq2IOFs0wISCr8nKNYujp7beQ 5YFt0NlBFqyMbMdyZlXg==; 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 1f0Ew9-0000sT-7g; Sun, 25 Mar 2018 23:20:29 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0Ema-0006ba-S0 for linux-arm-kernel@bombadil.infradead.org; Sun, 25 Mar 2018 23:10:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=odfLg5NNkdi+u0fSx0X25SNbuh5VwgBl1kYnpDZyzIw=; b=vfI+lkyCrQkbKmiToJzfgii5Bg mjG/OjtiUV6sA4Ldc52vJahpXExJQhfnu6dJwhV4thuLPY1LIp6sgV1U8PuNhdiL/BSJeuTI+h/sY KCT15YdafzT1mjPGgV9xE61x9CFHlUVchEUwsR3ZcSGGs8giUJAQi192jiilxDF/4nm+vwLQTNQhA a8+/S/hW6cAU0NArOYfdPvJ5bG273CDl4kcCuPgK6DhHa5zgkUAJb/RJaFtZnE0XM/jg3GliyULOo hskp23V3JevB7nhMDtYJPcZOGxpCcU38aYqaYgVxvBsU8QNB7JBLLnuptXV8fetHzQRvm+ABOTzDb mWrlPy/Q==; Received: from smtp.codeaurora.org ([198.145.29.96]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f06oi-00037y-DB for linux-arm-kernel@lists.infradead.org; Sun, 25 Mar 2018 14:40:17 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C0A83607F5; 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180325_104016_626984_4CC7EB5D X-CRM114-Status: GOOD ( 12.01 ) 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..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();