From mboxrd@z Thu Jan 1 00:00:00 1970 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.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 67519C4338F for ; Wed, 11 Aug 2021 10:35:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 24E8060C3E for ; Wed, 11 Aug 2021 10:35:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 24E8060C3E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oYWSA9Bsp656Q7KALKqr+SGRLwx8oDDGX+MQ/42XFMo=; b=kAjE33Mmka+PdU 8njYONpmFdShwpBBAQyBgjuNJJ68i9nREr8thQmuQKZSa9xSFMLyIWJDCEPoP330n/I2EcpBm798K TluVjOe1795PXan8sFlKpYSbWeOceknjWH5zU0NpDOeuTkgyHujLThZBsehphz8vfLS/0oSVQf2Z1 4yP818tlEAB/ioltYGzS2vSCwJ4x0inHiHK2wQaUG/HmflK04+xOWyQ/KVBWepQ+eRsCfWb7n1NN8 yot+xXptpwzdVPO+KJcCRQ0yPHJSg/atI+nfGP7d+NJClIf1bzynrfk3bbkE1AKvNYvvh+cSD9S3i Uamc6WENjzSSbsBch8xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDlYY-006eS9-IS; Wed, 11 Aug 2021 10:33:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDlYU-006eR8-D6 for linux-arm-kernel@lists.infradead.org; Wed, 11 Aug 2021 10:33:51 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id ECD0360C3E; Wed, 11 Aug 2021 10:33:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628678030; bh=MG7heJZm5M3tEsl415rXYzpWZZsIqmxepajSEhkW4Zo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RkuqxgEd02iFCSEOmFrL6Lj/suWCuMrUu0fBECIz8mEjKlnHsjlvIwLmWXayBI4Re oZvfIrh7+xC86tFxJHW8SKB/YbYeNXNtVKwsFMJrmiRcbkxpnsDM9Gyr0NF9Tx05eL d6n8iqUo9ZMGfyCSqYV81EERnG3geug5cBJRdmmWa96V70yrmdv7REaVMTHpEBiNq+ RBLk8UI5qQHo+uIbngO+jZHUIyWDZQu4gOpt7SiSXL1HF/exMLTmgfxtkMySOuVpry Z/dEEi8lNKQJv6UHHHeefspGTTd3zZSjfhYcuGgUB0TfugRT1VzoeIlIaHegB1TdJm BsEKf0t/yQ4gA== Date: Wed, 11 Aug 2021 11:33:45 +0100 From: Will Deacon To: John Garry Cc: "Leizhen (ThunderTown)" , Robin Murphy , iommu , linux-arm-kernel , linux-kernel Subject: Re: [PATCH RFC 2/8] iommu/arm-smmu-v3: Add and use static helper function arm_smmu_cmdq_issue_cmd_with_sync() Message-ID: <20210811103344.GA4736@willie-the-truck> References: <20210626110130.2416-1-thunder.leizhen@huawei.com> <20210626110130.2416-3-thunder.leizhen@huawei.com> <20210810182454.GB3296@willie-the-truck> <20210811100905.GB4426@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210811_033350_502809_C2157229 X-CRM114-Status: GOOD ( 20.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 11, 2021 at 11:31:08AM +0100, John Garry wrote: > > > > > Obviously, inserting as many commands at a time as possible can reduce the > > > > > number of times the mutex contention participates, thereby improving the > > > > > overall performance. At least it reduces the number of calls to function > > > > > arm_smmu_cmdq_issue_cmdlist(). > > > > > > > > > > Therefore, function arm_smmu_cmdq_issue_cmd_with_sync() is added to insert > > > > > the 'cmd+sync' commands at a time. > > > > > > > > > > Signed-off-by: Zhen Lei > > > > > --- > > > > > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 33 +++++++++++++-------- > > > > > 1 file changed, 21 insertions(+), 12 deletions(-) > > > > > > > > > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > > > > index 2433d3c29b49ff2..a5361153ca1d6a4 100644 > > > > > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > > > > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > > > > > @@ -858,11 +858,25 @@ static int arm_smmu_cmdq_issue_cmd(struct arm_smmu_device *smmu, > > > > > return arm_smmu_cmdq_issue_cmdlist(smmu, cmd, 1, false); > > > > > } > > > > > -static int arm_smmu_cmdq_issue_sync(struct arm_smmu_device *smmu) > > > > > +static int __maybe_unused arm_smmu_cmdq_issue_sync(struct arm_smmu_device *smmu) > > > > > { > > > > > return arm_smmu_cmdq_issue_cmdlist(smmu, NULL, 0, true); > > > > > } > > > > > +static int arm_smmu_cmdq_issue_cmd_with_sync(struct arm_smmu_device *smmu, > > > > > + struct arm_smmu_cmdq_ent *ent) > > > > > +{ > > > > > + u64 cmd[CMDQ_ENT_DWORDS]; > > > > > + > > > > > + if (arm_smmu_cmdq_build_cmd(cmd, ent)) { > > > > > + dev_warn(smmu->dev, "ignoring unknown CMDQ opcode 0x%x\n", > > > > > + ent->opcode); > > > > > + return -EINVAL; > > Are any of the errors returned from the "issue command" functions actually > consumed? I couldn't see it on mainline code from a brief browse. I don't think so. Can we actually propagate them? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel