Received: by 10.213.65.68 with SMTP id h4csp751732imn; Fri, 23 Mar 2018 15:26:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELt7y823QSSigqz2LPLxb4BS4D1eonSgJjJSgE6MvdQ3ldlCtZB1kDzTmYvjQRqy0Y0K1cXK X-Received: by 10.98.194.26 with SMTP id l26mr8682702pfg.47.1521843999580; Fri, 23 Mar 2018 15:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521843999; cv=none; d=google.com; s=arc-20160816; b=eJ68wvXE8TgNh9+sLCEnl5hqEV/AZFCPX+AWl45AdNGkK6Gq3Wm30xynS1E3NkQHvy Q5Mjefh17DRYNkUzVH1dmudUFUBWoJOKLu2b3PUmi5xA+jEIe8QreE7N9O0UU7eft7Lr IKmnrTEanD5+FRTdSiN7VvRQWFb5uQDBpuPVfz00fKk5OrMHiO0evZaWyBI0J/o97FOi 6VwPKLTNJqVoR8GbcFtcz8Hd5vfcR9EKMIZHUtBLjCDblveMvjZ+Gj34DK4ZoPbVHkqv fuI6BFNsf0qND0FQ8mx12iH9phYJlWxNYKQ6G748LPie32Ot9aHJNzPAKl4dsYMtmRqD j7Bw== 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=GZFLLKLn70PwprJw2R1ZYxCEifpV+Xr/NTlZhStL854=; b=hXIE6TbXuYw8LObMoXy5SXFxypsC8uEFGOdwWl/1K5mrZn6ee1+jEs3yvWgWtz/0gs 3Qm8FlUr1RepoJkZXUjdf3ydB/fV1ixvbT8kEP9uWE+5gZpYLNx35h4GUrALI6/u9hXY m/8XHSDk14k9PcI3e4TK9Ev2dttRnnVZul65ed9oUlAv+M89guV/eWNVPQ+AdktHhETU aDoYP6XN87B6mOpeaq9G1KvgrxKyWQe9dMuZHNPg/t5VCWuxhR4lx/opXFhnc6y30X9k mJn1MsCOrUBi1cFZIwqKHX2I3Hh7TnyOQEHxZ5Lq5Sw4yVlTN+Cf244vfewX/hswAXEh rI4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=gPrejwTo; dkim=pass header.i=@codeaurora.org header.s=default header.b=QOQfYjhn; 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 x4si6776452pgq.11.2018.03.23.15.26.25; Fri, 23 Mar 2018 15:26:39 -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=gPrejwTo; dkim=pass header.i=@codeaurora.org header.s=default header.b=QOQfYjhn; 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 S1752678AbeCWWZT (ORCPT + 99 others); Fri, 23 Mar 2018 18:25:19 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35788 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752112AbeCWWXV (ORCPT ); Fri, 23 Mar 2018 18:23:21 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 20AB260F8E; Fri, 23 Mar 2018 22:23:20 +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= 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 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 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 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 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..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(); -- 2.7.4