From patchwork Tue Mar 20 02:50:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10296147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B8442602C2 for ; Tue, 20 Mar 2018 03:00:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8D5929095 for ; Tue, 20 Mar 2018 03:00:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C2B1290B6; Tue, 20 Mar 2018 03:00:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2339929095 for ; Tue, 20 Mar 2018 03:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Uk15OX/r+bghxcdfWPgqaRiVNevrz1FapoVZ/Oa+DBA=; b=iyskVZHZ6b46pp abqh2lp6SBdQ+lcx+sWh7yBNynh4Kco+/xoGKDlQStKxkR9psQwexQW0WZIbXX6+rMz3X3fOh7TVJ XixTyEey7QrzMKvQmEw4I8YMsn6y7gctZNARG5dCNNh1fRHSQ5+X8gFkcAlv3lijtL9Xfz+M9iAV9 oeEh4Mcg+jn5rW2G3lV9fjdSzuOfMa06dWMIGqD+uprh2mhqHz+a3hMF4v/A8Y1fhHJ39IkrFUVfX yd1Zy1Lq0w/NrqzWYYQGKs56j4N5UFnvC2YgqxAnwH1a7LK7wftsNxAWWoAvkCn4jjDm+8IvcucIt A3d4W6U02Eoa+f5dRhAg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ey7W1-0004VZ-01; Tue, 20 Mar 2018 03:00:45 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ey7VC-0003OI-Ts for linux-arm-kernel@bombadil.infradead.org; Tue, 20 Mar 2018 02:59:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=toBBRwmJyNTAqAO6zdKAoABs/yZFIv7dm2qDFwAiHQA=; b=W8dTgb8r9qSOhjq4f52I/GVDhj 5KVRF5LHCVwPsQLoWoaos8vQKuhWv1BgWwyBrcLuSHtRPKfcbWYZ2npYWVhpAAbrFCwGw++IO6yu9 393vvLWtnEBlOHzYqga8vk6XyjWy/jZXuR2bkW7tfApvZSCMWKIJEdJ8e+OE/l/Ec5Tf7rbwTU+wS WGwEoa1UsyIPd1+p6AQYk1k7bd3NWKTJLONKPIyvmSN/3ajnmL1q3pn0mstTOCL0Zr85Q66CgimR4 ksWmAQKEuA487hF+oFEN84lELmaxG6tUfVLAmFG0bmdlk0gyJXSrZhzZu6QTxOeB7mKweP277AmQ/ JgYAKKSg==; Received: from smtp.codeaurora.org ([198.145.29.96]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ey7MI-0000p0-67 for linux-arm-kernel@lists.infradead.org; Tue, 20 Mar 2018 02:50:43 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id CF66560FF2; 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=1521514225; bh=xitJ6QBYMPXpw2oo4vPhOefkO0aZUz6xvLmIuGKSF58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kBLPnYBFgaNsTkoQ+w+2LOidYs601lvh8JOdhSZ4qg40ztvP0RpfDVHjgIvTzvYUy 5F/sOjClR6ktxcfu9F49ed7k+4o5WLgc93usMi+mNDH6XZ39CdM3jPZfub2CbLOkKK SgITogv6y8FeHTtLPPAGMBY/Fb3xI3TDUq39eZ+E= 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180320_025042_355740_ABA5F3B1 X-CRM114-Status: GOOD ( 12.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "James E.J. Bottomley" , "Martin K. Petersen" , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Sinan Kaya , Brian King , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Brian King --- 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); }