Received: by 10.213.65.68 with SMTP id h4csp66911imn; Mon, 19 Mar 2018 19:52:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELsXV8OvNqsKk5/qYyMqzrMstMv7PtwTnsyhRcb2PwmZ6U74YGy2Ua+mQ9zhkiIrbrqcg6Y7 X-Received: by 10.101.82.12 with SMTP id o12mr10779354pgp.126.1521514365279; Mon, 19 Mar 2018 19:52:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521514365; cv=none; d=google.com; s=arc-20160816; b=SHFWgqUHA3uyMcCV04avaeNh7leDWKwvTTrUAM1mMSQwEWdfoL5lhuNdqCJIROz1zk JwniIQ0EPXW4H3HZ6pcT3pfb5237fz55e+sVQaiw/V8Yeua/7jNf1ZTg3qMjEnRYUjdT 0HnYggmHLlmBiEjmcAdDawn/ScPA08Xx8A8rMl/tCueMRriiUwEAirAEpXqXLUb5d+qG fmgIlzceEWzCyyxGBg6S4h+mvD6Ob16RJCtDfLCAJb3YRlMhhF9wNLFU5joBoscckv7m lVAg50t9pwgNZK3lVq6N7ZIlMN0t7GKjDhHzWNgjV4q87NCceXg1wFueTkqTNA+Hs2lh eyvQ== 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=toBBRwmJyNTAqAO6zdKAoABs/yZFIv7dm2qDFwAiHQA=; b=ltdXptjWNtZKWVXNKu6zEdw0o9Z19SHdE/T416LypoDZvtSZNtJp69S6q8f0HEDMDy qC+7l7MehL4QF3rgXntY/2GP7LDsHYd2N6ewTNkyDMKbJ7yzXTM9Oz/JnxAXsyrcN0pJ l4YkTneD+YqmzZjUqEqNteY0kIc2+647IX6VayZCDLgk0HepzTvNMJLptW5UZpE/pRdP x7iWMmyGN6xWgps+J+qA0PxKT5mt958iYzSvjru75tG/pnsMbeMxKflC2Gj/XPf0H3DZ N1NQltLrNhCJ7WlvWLGDdYLQ0o47455opPYrGQhYPgRWWaP036FMwklwmj4wwePHngkh wQGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=ScBrUHmC; dkim=pass header.i=@codeaurora.org header.s=default header.b=i4+uoyBk; 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 r4si469978pgs.685.2018.03.19.19.52.31; Mon, 19 Mar 2018 19:52:45 -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=ScBrUHmC; dkim=pass header.i=@codeaurora.org header.s=default header.b=i4+uoyBk; 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 S1752449AbeCTCvU (ORCPT + 99 others); Mon, 19 Mar 2018 22:51:20 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35826 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbeCTCub (ORCPT ); Mon, 19 Mar 2018 22:50:31 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C8A7F60F92; Tue, 20 Mar 2018 02:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521514231; bh=xitJ6QBYMPXpw2oo4vPhOefkO0aZUz6xvLmIuGKSF58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ScBrUHmC4ViyqqSsVXFk25VkSK9mLVyiXOvwWAddSIA1MtAg1soQRidWUHIObp7RI jU2vxO+AFyCOVc7kFGJ/LVG55d3YCKqDO3MUNhfQGs/0vsLlz/Eh5X+3r8Mvj/pIIF SFLxQmdqyplWmuFRA4JJ37EpFZg61zeWg1HOUg2I= 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 94E3960FF7; Tue, 20 Mar 2018 02:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521514221; bh=xitJ6QBYMPXpw2oo4vPhOefkO0aZUz6xvLmIuGKSF58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i4+uoyBkkXqeSzSV4awkHH0uIXzzgKYGcadQHKicQDK/S7wPLaz8lwOYfgFB8BkGs LJfguR/X0p7o6IgwnEbSJ6oLw/KKTgVRc4odqldKtSYVFNAjkvyQ0XP0zP9omPgG/y 7SJC25ggbkSiltJk26a8FKsRPV74oPdntJXPsZkE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 94E3960FF7 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: linux-scsi@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Brian King , "James E.J. Bottomley" , "Martin K. Petersen" , linux-kernel@vger.kernel.org Subject: [PATCH v4 5/7] scsi: ipr: Eliminate duplicate barriers on weakly-ordered archs Date: Mon, 19 Mar 2018 22:50:05 -0400 Message-Id: <1521514207-10695-6-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521514207-10695-1-git-send-email-okaya@codeaurora.org> References: <1521514207-10695-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 barrier() 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 writeX() to writeX_relaxed(). Signed-off-by: Sinan Kaya --- drivers/scsi/ipr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index e07dd99..209adac 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -762,9 +762,9 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg, /* Set interrupt mask to stop all new interrupts */ if (ioa_cfg->sis64) - writeq(~0, ioa_cfg->regs.set_interrupt_mask_reg); + writeq_relaxed(~0, ioa_cfg->regs.set_interrupt_mask_reg); else - writel(~0, ioa_cfg->regs.set_interrupt_mask_reg); + writel_relaxed(~0, ioa_cfg->regs.set_interrupt_mask_reg); /* Clear any pending interrupts */ if (ioa_cfg->sis64) @@ -8435,7 +8435,8 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd) wmb(); if (ioa_cfg->sis64) { /* Set the adapter to the correct endian mode. */ - writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg); + writel_relaxed(IPR_ENDIAN_SWAP_KEY, + ioa_cfg->regs.endian_swap_reg); int_reg = readl(ioa_cfg->regs.endian_swap_reg); } -- 2.7.4