Received: by 10.213.65.68 with SMTP id h4csp751370imn; Fri, 23 Mar 2018 15:25:48 -0700 (PDT) X-Google-Smtp-Source: AG47ELtKANSb4iSmILqrUIPchus3++O3nIFxy8xubzTgvkfyduySOhlWhOVcqmYowjjsYzOlOmOW X-Received: by 10.98.104.71 with SMTP id d68mr16112208pfc.116.1521843947955; Fri, 23 Mar 2018 15:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521843947; cv=none; d=google.com; s=arc-20160816; b=awpEdJTtqhx2YglKCUzGp4zjnvWZ3F+F2ThFWeLF0AB+mRj7dv8LbbMHImQ+qYwv+N 9a4XtAiT7pPrUZJYG/r2OYX17A20u3Py+0EWWvLLhj2HVw/6yIwobnR4pFWDydTuVwps 9dhCfSNVWQLhxJ9SFmwVY4WI6MmRiqbPpgpxz8WIQXHMU1VDoeNEaH4f+G3SLbOLtQqT mDSyUWZ4As6n1hW3Mv1JzPBGJdRXZnbqtLsspNAysN4zZRC0nDBB2jeRiWdNHcgYAKgK HkKtqpYqS/eEuCfKfpi87udAq/q5dNO9H/YHNL/aOEydfASx/3ZAEVWVWUudN3ndGkkc BEZA== 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=n4qKvZ22dToghse+bgJC3bYVWnCHIanjGuDGBxpJugw=; b=gL+khTm0M+DkF6UcxfX0nZW68rn8c3lfSmrIDObPaWypEEe/18NfZZeTvOn05yS84D /Lk6Fv6/Jm1mtLnLZ+X1emkLTUf7whoUAWXCYVDC3VReVlKU18bpFj6kjXkS6do7msA4 B7W1EkYqV2UV0AdWWGbXpuEhFeVKoxEDQ8+fw6x0b12xB/avwuN2NoextIKuJuArj1uG DbfzTOZBL0cbo1/aQTPuVPlzXFwxdTqLkBq5BOymjFdIFTuFRjlxiiqbpFUK7WneVfbQ 1LwQPR1/vH36y0kQhOuXY2e6DOc9wOproM+SEe8s0t5beU2sEKyuyD0qgFml4gKlAO+J U9Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=QEnBY5y6; dkim=pass header.i=@codeaurora.org header.s=default header.b=dHg5HkYE; 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 e67si6586289pgc.274.2018.03.23.15.25.33; Fri, 23 Mar 2018 15:25:47 -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=QEnBY5y6; dkim=pass header.i=@codeaurora.org header.s=default header.b=dHg5HkYE; 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 S1752306AbeCWWXX (ORCPT + 99 others); Fri, 23 Mar 2018 18:23:23 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35612 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751632AbeCWWXS (ORCPT ); Fri, 23 Mar 2018 18:23:18 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 29EC7601D3; Fri, 23 Mar 2018 22:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521843798; bh=v+h4GXmyu/tKzKBRDO+IdYEuRqQDlxUYkWkFq23fhC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QEnBY5y6wbmExgKxXdHZ/Z5xFL3QOXEoKSi+ZCW1d/1w+hvI0WWxOKBayofnN3uRf EWC3QZVEpUICUn2wsVGYC0jbdQMm3Ritf+I4kSA3KPogu6z0RRdX71K5+72uysh024 wIeZOU1xvVaDyxpT3Mc8qEzchZcVcmmoN9qIGR5U= 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 BD44B601D3; Fri, 23 Mar 2018 22:23:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521843797; bh=v+h4GXmyu/tKzKBRDO+IdYEuRqQDlxUYkWkFq23fhC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dHg5HkYER5preAhLbQHeyodgDCiA4HRDg4da4zuG5y+So2T/SSgaM6x+JeP9G0TTZ qN6FENmnsK+ivys6Fyu5slj6zDED/q+4Fhw1xMTYAIX3XbxIx1kEN+5BE4nUsxtTBw RuCX/03fsgxpN3W4fNuRFuhHxanMoMrRryG0aN4E= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BD44B601D3 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 , Dept-GELinuxNICDev@cavium.com, linux-kernel@vger.kernel.org Subject: [PATCH v6 1/6] net: qla3xxx: Eliminate duplicate barriers on weakly-ordered archs Date: Fri, 23 Mar 2018 18:23:06 -0400 Message-Id: <1521843791-21201-2-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 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 code to wmb() writel_relaxed() mmiowb() for multi-arch support. Signed-off-by: Sinan Kaya --- drivers/net/ethernet/qlogic/qla3xxx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c index 9e5264d..b48f761 100644 --- a/drivers/net/ethernet/qlogic/qla3xxx.c +++ b/drivers/net/ethernet/qlogic/qla3xxx.c @@ -1858,8 +1858,9 @@ static void ql_update_small_bufq_prod_index(struct ql3_adapter *qdev) qdev->small_buf_release_cnt -= 8; } wmb(); - writel(qdev->small_buf_q_producer_index, - &port_regs->CommonRegs.rxSmallQProducerIndex); + writel_relaxed(qdev->small_buf_q_producer_index, + &port_regs->CommonRegs.rxSmallQProducerIndex); + mmiowb(); } } -- 2.7.4