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=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 0A38AC4338F for ; Wed, 11 Aug 2021 10:33:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFE38600CD for ; Wed, 11 Aug 2021 10:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237204AbhHKKeP (ORCPT ); Wed, 11 Aug 2021 06:34:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:60388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237116AbhHKKeN (ORCPT ); Wed, 11 Aug 2021 06:34:13 -0400 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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