Received: by 10.213.65.68 with SMTP id h4csp605667imn; Fri, 23 Mar 2018 11:25:44 -0700 (PDT) X-Google-Smtp-Source: AG47ELtBMSO0al6YhX9smfFNqiGBvf4GVEYHQK3z3XpQ7kYLuGpGIZ98cStLQS22J/QJ6UPEQ67e X-Received: by 10.99.132.72 with SMTP id k69mr21818626pgd.367.1521829544488; Fri, 23 Mar 2018 11:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521829544; cv=none; d=google.com; s=arc-20160816; b=v/DPkSea4KNVdRGQgaIF5KGy4RlUu/FVCfNQ3XkfROQa74Bfd2A9Ce+BDAuTP3vP/k zddElvNqYt45NV936+8L5uS9T/wOrwxHgJCVleRk9Oh+W9U9I92wko0YdViWT8mUh4rK 3dUUaLqbL7VcpsK5REOcRyIjPj8XYh9V0zjjUUEFIPOVOjpMXXuvlWs9zmmkDzWSOvwM ft7GvSIoJMWsJx6AToMEIYg0WYMl9XopbdF+Vs2RAErKAEyPCg0O0dtsq07vVfh1o10d BxR/q84b1kDpl4OgrEMZ0Zm8881yjQG1041MQd3dGqvrGT0qKS1pRtuKaWI9xmW+7Ylz L7Yw== 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=P5PB39mgynmVauPGWV1aSr1Ghd07TysHuws1IGlabhA=; b=TqtSayCzStgkIhKnvfFHXqPLycMBgpHAJW/adKkPnPqtNyLMXd60FkwS4r2jkmOP/4 64WO/VqupI6EX07tZpeaZk8tknbZC3cL5PGgu/iEv3kfDl+50LCP2nBwVtpB4qGznPHQ ctWbVZ0dLfGvBnJ1fUlPmN6UjOfrYxgRhQq8xXeZxfsVr4Yzmemlve3tUjU7n3JKOE1y BDH4GBCQPiymBVT6gpaZnVawWWgruZtta4ELXE2rBBfcCVXLKh2DSjyUEJ2J9ryeg5n8 3yjDcoEdhSOZe7g/4P+3kvUZUM0IYwnOgMQMqVRKSbqV/98acoKjU1PvEj0504AnrpnE jlpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=d00ivP3s; dkim=pass header.i=@codeaurora.org header.s=default header.b=Bsd5iEdy; 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 d8si7115424pfb.349.2018.03.23.11.25.20; Fri, 23 Mar 2018 11:25:44 -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=d00ivP3s; dkim=pass header.i=@codeaurora.org header.s=default header.b=Bsd5iEdy; 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 S1752299AbeCWSXm (ORCPT + 99 others); Fri, 23 Mar 2018 14:23:42 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40736 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812AbeCWSVa (ORCPT ); Fri, 23 Mar 2018 14:21:30 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8B5FC60F6D; Fri, 23 Mar 2018 18:21:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521829289; bh=v53g2DOFjCdo3yuI/FdDmH4aVp8hj+Ea4WIRnf8UDy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d00ivP3sZnbDS61L/RV5yW/JEt5aNxTDZLvm1wJlpD71MTUX0tRBi2e8Xaui6WDMl nZd4iKIX+zCHwaVxKYLsDvFyP9bWCCV78p2f8/UxFOpaRdJP8LfFQxjH8MlZW4C4oR oFObR03/6fbDPM8kb89vXbibodKUJMyvGXTjIg2U= 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 0015D60F61; Fri, 23 Mar 2018 18:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521829288; bh=v53g2DOFjCdo3yuI/FdDmH4aVp8hj+Ea4WIRnf8UDy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bsd5iEdyAiNTb+eDATh/lw5KPtnQUIVVdeM1E6Xn7HTgayI/QNr0eqLw1ee8d84aw Z6P+Z0a3hVWjTkcSiJl8Y+JgURZnV9pheqO/tKpVS1SAngiZ0fKDHt2z/bi3HpjGBm mIjGodH2HkNDuF3jlcK7FeGExli662x8UI3MNS5E= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0015D60F61 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: jeffrey.t.kirsher@intel.com Cc: netdev@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 3/7] igbvf: eliminate duplicate barriers on weakly-ordered archs Date: Fri, 23 Mar 2018 14:21:13 -0400 Message-Id: <1521829277-9398-4-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521829277-9398-1-git-send-email-okaya@codeaurora.org> References: <1521829277-9398-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 Code includes wmb() followed by writel(). writel() already has a barrier on some architectures like arm64. This ends up CPU observing two barriers back to back before executing the register write. Since code already has an explicit barrier call, changing writel() to writel_relaxed(). Signed-off-by: Sinan Kaya --- drivers/net/ethernet/intel/igbvf/netdev.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index fa07876..6dfd3dc 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c @@ -252,7 +252,12 @@ static void igbvf_alloc_rx_buffers(struct igbvf_ring *rx_ring, * such as IA-64). */ wmb(); - writel(i, adapter->hw.hw_addr + rx_ring->tail); + writel_relaxed(i, adapter->hw.hw_addr + rx_ring->tail); + + /* We need this if more than one processor can write to our tail + * at a time, it synchronizes IO on IA64/Altix systems + */ + mmiowb(); } } @@ -2298,7 +2303,7 @@ static inline void igbvf_tx_queue_adv(struct igbvf_adapter *adapter, tx_ring->buffer_info[first].next_to_watch = tx_desc; tx_ring->next_to_use = i; - writel(i, adapter->hw.hw_addr + tx_ring->tail); + writel_relaxed(i, adapter->hw.hw_addr + tx_ring->tail); /* we need this if more than one processor can write to our tail * at a time, it synchronizes IO on IA64/Altix systems */ -- 2.7.4