From patchwork Tue Mar 20 02:50:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 10296121 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 EE9A0602C2 for ; Tue, 20 Mar 2018 02:51:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0BAD28F20 for ; Tue, 20 Mar 2018 02:51:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4CD228F76; Tue, 20 Mar 2018 02:51:55 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94D3428F20 for ; Tue, 20 Mar 2018 02:51:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752006AbeCTCuZ (ORCPT ); Mon, 19 Mar 2018 22:50:25 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:35142 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857AbeCTCuV (ORCPT ); Mon, 19 Mar 2018 22:50:21 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 34221610D5; Tue, 20 Mar 2018 02:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521514219; bh=W9/yviHskqvwFPloVpoKaCcmJwlqdPqG2IWrksKoXY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R6D2zwihP5TPXzq8ws57Pwh+7i6YYVANaOB/Jby39rssUGxicXTrI2+lZGY3vxmtc kfemyVaQGRHnF8+krHFobgFCOjjjHO/KDk5HbW7sxjtHY1Gs3osTyi6V+06m0ZZq7Q RbvUspPX10kVpnf+KcmE7IrspIZ4eoCWKOK8Cf0A= 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 0165A60FEE; Tue, 20 Mar 2018 02:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521514214; bh=W9/yviHskqvwFPloVpoKaCcmJwlqdPqG2IWrksKoXY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWVSX6QlqGdyn8teHhBhixyiolrGKEn+lihL0C9Vlzc3GM3paJPA7NWhu9Ho+795O R25MyVO3K3GGDmb0T49NIddFbg58FN+CmUFrE5b0Gy8qkAaE5XoiwVgV57HNpSPmVV bHRCnddyeZRzJd1ItKyf7dB4lfBjWQqvBHcn0aMo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0165A60FEE 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 , Don Brace , "James E.J. Bottomley" , "Martin K. Petersen" , esc.storagedev@microsemi.com, linux-kernel@vger.kernel.org Subject: [PATCH v4 1/7] scsi: hpsa: Eliminate duplicate barriers on weakly-ordered archs Date: Mon, 19 Mar 2018 22:50:01 -0400 Message-Id: <1521514207-10695-2-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 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Laurence Oberman --- drivers/scsi/hpsa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa.h b/drivers/scsi/hpsa.h index 018f980..c7d7e6a 100644 --- a/drivers/scsi/hpsa.h +++ b/drivers/scsi/hpsa.h @@ -599,7 +599,7 @@ static unsigned long SA5_ioaccel_mode1_completed(struct ctlr_info *h, u8 q) * but with current driver design this is easiest. */ wmb(); - writel((q << 24) | rq->current_entry, h->vaddr + + writel_relaxed((q << 24) | rq->current_entry, h->vaddr + IOACCEL_MODE1_CONSUMER_INDEX); atomic_dec(&h->commands_outstanding); }