Received: by 10.213.65.68 with SMTP id h4csp586742imn; Sun, 25 Mar 2018 07:41:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELsU9wEO6d7/uEvfILHynw4pSq3+JdjzVjCnUSXpw6RD3XG/plBERh97sTos8wqHgIlhLmhG X-Received: by 10.98.245.156 with SMTP id b28mr16526824pfm.90.1521988915708; Sun, 25 Mar 2018 07:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521988915; cv=none; d=google.com; s=arc-20160816; b=tUVNtfLI/hf5P+ENIvW4QB9NYznaGaYJb4rizaBEmDxdw/gbdgk86Aa4xQ2oZDuiPI emW9RAdpJl0lkCgte2xLLh+inwQGc/dRonba4DIj1o9w9cmfleVP9tAzrtiyH8COMYKN tJ6AY8AHd3GwnFq8ooxJSbOP8FsC9kJtS/KqebhoVWnv1qNbqcsGyiTcidxOXDVf3csK I621EdkT+rDyxJ0wGqWCdq60aCDrMsi3i/B5HNmWmPfU/IQcxlL9JbcKMWv38bapGMeZ muqMQficZbveoeP/yDJWiLXuXUNLhJMfnTqP/Mp1aEQRXJwDbibtfN5MIMIuKBXJmrWc 9bDQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=odfLg5NNkdi+u0fSx0X25SNbuh5VwgBl1kYnpDZyzIw=; b=BEQMbgboTeX268axAFK+WquKEcvH43pCTe214hVLwb5lYmEDo0SzMMxFrywLWttJ+K PQEWt2xQ3sqbF0q9w3hNlryEXI1DNKP5+MY/mGPCuwyv+R4zHjkDP72KVxqfgpTp3T8f v/KVzavTmyi9bmyeHGksoEtTgNWu5a3nvCTAZg82MX7qEMQD8r4xuz8l4pJAMJ+UVNzy 4b28/dqs/xRU3JEQW8W6pH3eDPTS7L2dMchUZSSXYFiQUwoZP0zIw4wto2nKmAn7Apho LaQyPzUbvnCiOa+SDzMtNN5h/tuy9+32vjeJcLCqRF/OjMI4FsKaqeLrGPqEPjlimZZT 73qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=KPh2sR7q; dkim=pass header.i=@codeaurora.org header.s=default header.b=KPh2sR7q; 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 c10-v6si13379431pla.602.2018.03.25.07.41.27; Sun, 25 Mar 2018 07:41:55 -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=@codeaurora.org header.s=default header.b=KPh2sR7q; dkim=pass header.i=@codeaurora.org header.s=default header.b=KPh2sR7q; 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 S1753525AbeCYOjr (ORCPT + 99 others); Sun, 25 Mar 2018 10:39:47 -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= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 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 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(); -- 2.7.4