From patchwork Tue Feb 23 04:17:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 12099881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AABD0C433DB for ; Tue, 23 Feb 2021 04:19:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E9BB64E4B for ; Tue, 23 Feb 2021 04:19:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E9BB64E4B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=/f2d1cQsnY63r8Whqi8QvhY7+QtMtl0MSlvNGGiaVUI=; b=a6sQMSJjib4cPpeO4fuVoWMsLB 3071+JUOdJvxY+idX0Ee6fjH/RU+NFedSl5NKCtBDl+yI7deOW1BS5jrRvLcRxdYzv0c79z1x/KZK jrbyoekIieuQDnZjXw0ydUAYVaA2LtjAusK9hLvcocSd91kn/Marq9rsJH8ymyIF8GibAvfVvP+wg gijDLRha3MMG+aemcVAO07uNEOnvXEa4A85aKE+u7gLmIPClKmqlIVtnl3auh0xMRsrCrfJcZbf1r PnXWlVtDd4WcYvbFWhbre4qTbXriDlOofb/lL/sH+MdvefRoJxDyJkgt0Ts5tY7YBfjCd8e6WNWWD GKUE/MUw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEP90-0006qT-BT; Tue, 23 Feb 2021 04:17:54 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEP8w-0006oS-JU for linux-arm-kernel@lists.infradead.org; Tue, 23 Feb 2021 04:17:52 +0000 Received: by mail-pg1-x52b.google.com with SMTP id a4so11573465pgc.11 for ; Mon, 22 Feb 2021 20:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Gzs+lLSVaE993nw8Nyen177ZOwuN43ccPeEJwO/dn8E=; b=Wo9nC6FzqbHp2XtezJ+NnMW0EmenENobnEVUgbL49wIzRfaiEzeFM5wSOcZEy0QH06 mpvXpgP7YJra7/YQSZIWFU8KbhTQamwPRElgKqFk8ZZsXbEhvf77qERZnxFKKceSxexI ZMosqCcTrXD9yM01NmStukp1LpFo37Kj59ynMcgZ/KyUf/10FWxCoQLyWJ8F42X13EjX uPFqf2xS6GmofJiH/82psxaZz1VdYHjYHiSeMRsyo/3PmMHAg5ccKDnuM7MipZWSowp1 em0s7XyHUxMImlL0mySiI9Obh811LG/WHhdxj9KezH9zr5IwaKMlPbNrQsJj37NqU1BR PJYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=Gzs+lLSVaE993nw8Nyen177ZOwuN43ccPeEJwO/dn8E=; b=NDcp+jUCOnGQWqmpeQEP03yF+yAhQ8CBrpBRr3c3NCLRH1Z1isPVF/yoBnaYHIaeV3 rMWPQxEUMMZGS7FbW2ysZWIafFTriS+HqSaSqkFmtd5cxL9K5abTHm8/squmzZPTJqgU zRQAtXRKD65vH+AD9FLutWkKClkTuUMX+Db/n4hyh1accwuZ25hQHXZjov5cVhPyCPGS stO9LwymAX+hfWcH5sxzm2T88CrFVC7T9O+oqMZwijPTyhKm2ClSFRcN8yOH/DA7dIVl okUq3iZV6Ia15aIv3uhO+4ZEmD2lMUrHsYLqBnyWp7GmjueEtwwCryDutGuXME3YIOAy stcw== X-Gm-Message-State: AOAM532fpd3M5NhvWZWwZHGREBu8Ewn6aYI92kn5Cs1sOL5n+GueNlZp fA76Ujbwvy9FZw4iMwOsw0KeuTuIkoM= X-Google-Smtp-Source: ABdhPJwdAskaiczNbCW9pSsr5hq268hO4ty3aqGRyARBQB5eKKgTFpiLNvp6mO+cC/KihS8u5OEwxg== X-Received: by 2002:aa7:87d5:0:b029:1ed:b85b:1420 with SMTP id i21-20020aa787d50000b02901edb85b1420mr527702pfo.17.1614053867337; Mon, 22 Feb 2021 20:17:47 -0800 (PST) Received: from voyager.lan ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id gd18sm1164466pjb.5.2021.02.22.20.17.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 20:17:46 -0800 (PST) From: Joel Stanley To: Jeremy Kerr , Eddie James , Andrew Jeffery Subject: [PATCH] fsi: aspeed: Emit fewer barriers in opb operations Date: Tue, 23 Feb 2021 14:47:37 +1030 Message-Id: <20210223041737.171274-1-joel@jms.id.au> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210222_231750_706883_5DEAEE2F X-CRM114-Status: GOOD ( 10.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-aspeed@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-fsi@lists.ozlabs.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When setting up a read or write to the OPB memory space, we must perform five or six AHB writes. The ordering of these up until the trigger write does not matter, so use writel_relaxed. The generated code goes from (Debian GCC 10.2.1-6): mov r8, r3 mcr 15, 0, sl, cr7, cr10, {4} str sl, [r6, #20] mcr 15, 0, sl, cr7, cr10, {4} str r3, [r6, #24] mcr 15, 0, sl, cr7, cr10, {4} str r1, [r6, #28] mcr 15, 0, sl, cr7, cr10, {4} str r2, [r6, #32] mcr 15, 0, sl, cr7, cr10, {4} mov r1, #1 str r1, [r6, #64] ; 0x40 mcr 15, 0, sl, cr7, cr10, {4} str r1, [r6, #4] to this: str r3, [r7, #20] str r2, [r7, #24] str r1, [r7, #28] str r3, [r7, #64] mov r8, #0 mcr 15, 0, r8, cr7, cr10, {4} str r3, [r7, #4] Signed-off-by: Joel Stanley Acked-by: Jeremy Kerr Reviewed-by: Eddie James Tested-by: Eddie James --- drivers/fsi/fsi-master-aspeed.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index 90dbe58ca1ed..09fff86b2bac 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -101,11 +101,11 @@ static int __opb_write(struct fsi_master_aspeed *aspeed, u32 addr, u32 reg, status; int ret; - writel(CMD_WRITE, base + OPB0_RW); - writel(transfer_size, base + OPB0_XFER_SIZE); - writel(addr, base + OPB0_FSI_ADDR); - writel(val, base + OPB0_FSI_DATA_W); - writel(0x1, base + OPB_IRQ_CLEAR); + writel_relaxed(CMD_WRITE, base + OPB0_RW); + writel_relaxed(transfer_size, base + OPB0_XFER_SIZE); + writel_relaxed(addr, base + OPB0_FSI_ADDR); + writel_relaxed(val, base + OPB0_FSI_DATA_W); + writel_relaxed(0x1, base + OPB_IRQ_CLEAR); writel(0x1, base + OPB_TRIGGER); ret = readl_poll_timeout(base + OPB_IRQ_STATUS, reg, @@ -149,10 +149,10 @@ static int __opb_read(struct fsi_master_aspeed *aspeed, uint32_t addr, u32 result, reg; int status, ret; - writel(CMD_READ, base + OPB0_RW); - writel(transfer_size, base + OPB0_XFER_SIZE); - writel(addr, base + OPB0_FSI_ADDR); - writel(0x1, base + OPB_IRQ_CLEAR); + writel_relaxed(CMD_READ, base + OPB0_RW); + writel_relaxed(transfer_size, base + OPB0_XFER_SIZE); + writel_relaxed(addr, base + OPB0_FSI_ADDR); + writel_relaxed(0x1, base + OPB_IRQ_CLEAR); writel(0x1, base + OPB_TRIGGER); ret = readl_poll_timeout(base + OPB_IRQ_STATUS, reg,