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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 93608C3271E for ; Fri, 5 Jul 2024 15:27:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DR0X45VKCKK65vkp5xl+4qOMSJPKNaW6DsChjtBaaQM=; b=WFW+AuOoioWiBHdbzzSDE9ZVT8 bZ76wwHxFwiFdNu6LyRAIO9KzjhEl7jLClmjr8TYA+vgwOG7yAEDvRr4hkjZzD5RRG1QgNq4QJvw+ vEgFe/qA9AjdQnTxbK2n71dWzeweiL6K6gIXPt88x+QGAX9sJQyG35QttaLhAn7YBFAvMkVP/oFA1 FxF46y3I9owIvM3Vh6JTRHte1IRUEiGmr5TpFG5tsVyAgqSRLrkDU+WtTSkVAPi9osYOBakUGV0+7 NzAAwz4Nc3KykGOqsR7upaQfc63YfcqJ1D3uTVwjivqNHOkVdLB4AWL957tbJzxmQEOipiLoKCMTI Vk64u6WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPkqg-0000000GKh8-440k; Fri, 05 Jul 2024 15:27:46 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sPkqR-0000000GKZc-236g for linux-arm-kernel@lists.infradead.org; Fri, 05 Jul 2024 15:27:33 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 810F1CE3E3F; Fri, 5 Jul 2024 15:27:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7C35C116B1; Fri, 5 Jul 2024 15:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720193246; bh=293ScHg6dX/n+ot2SYdQNqDyAVHAPFtaqM2zrDuwcv8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=u9FP9MSA3B0NehidQL4z1aVZ6ykOFX706cXsvFxi3vnOFdxwvaWcdaBm8XYb00mJE CB8+5rLVm2/7sFIxoKSCzQdwuYig8ozO2UVOU1Z7iVl3iL1Vx1mSa3kREGAEmFAy1s ENoEKat0IgjUGHjGzUCWE2ZGaDlDrzpVxpUDhJWD03UvPJ5luubcbS/GpzKw6gzWit O9WeswdkP+YwBYH3eG497P7yqcFiPYXjhhC+o0IBtWOnONz+z/oa3YYiXR/+xfEujv kaKra6NC4TfBJWTs8U9yA12L3y2xEfDeL4+BNC5uURk1s9zZxBH7W8y63OhVksJfGb cpTzvXfgb44ig== Date: Fri, 5 Jul 2024 16:27:21 +0100 From: Will Deacon To: Nicolin Chen Cc: robin.murphy@arm.com, joro@8bytes.org, jgg@nvidia.com, thierry.reding@gmail.com, vdumpa@nvidia.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH v9 4/6] iommu/arm-smmu-v3: Add CS_NONE quirk for CONFIG_TEGRA241_CMDQV Message-ID: <20240705152721.GA9485@willie-the-truck> References: <20240702174307.GB4740@willie-the-truck> <20240702184942.GD5167@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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240705_082731_736970_B67FDB9B X-CRM114-Status: GOOD ( 15.53 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 02, 2024 at 01:10:19PM -0700, Nicolin Chen wrote: > On Tue, Jul 02, 2024 at 12:47:14PM -0700, Nicolin Chen wrote: > > @@ -345,6 +345,11 @@ static void arm_smmu_cmdq_build_sync_cmd(u64 *cmd, struct arm_smmu_device *smmu, > > FIELD_PREP(CMDQ_SYNC_0_MSH, ARM_SMMU_SH_ISH) | > > FIELD_PREP(CMDQ_SYNC_0_MSIATTR, ARM_SMMU_MEMATTR_OIWB); > > > > + if (cmdq->type == TEGRA241_VCMDQ) { > > + cmd[0] |= FIELD_PREP(CMDQ_SYNC_0_CS, CMDQ_SYNC_0_CS_NONE); > > + return; > > + } > > + > > if (!(smmu->options & ARM_SMMU_OPT_MSIPOLL)) { > > cmd[0] |= FIELD_PREP(CMDQ_SYNC_0_CS, CMDQ_SYNC_0_CS_SEV); > > return; > > @@ -690,7 +695,8 @@ static int arm_smmu_cmdq_poll_until_sync(struct arm_smmu_device *smmu, > > struct arm_smmu_cmdq *cmdq, > > struct arm_smmu_ll_queue *llq) > > { > > - if (smmu->options & ARM_SMMU_OPT_MSIPOLL) > > + if (smmu->options & ARM_SMMU_OPT_MSIPOLL && > > + cmdq->type != TEGRA241_VCMDQ) { > > return __arm_smmu_cmdq_poll_until_msi(smmu, cmdq, llq); > > > > -------------------------------------------------------------- > > > > Would you prefer this one? I feel CMDQ_QUIRK_SYNC_CS_NONE_ONLY > > is more general looking though.. > > And we would need some additional lines of comments for the two > pieces above, explaining why TEGRA241_VCMDQ type needs the first > one while bypasses the second one. Again, it feels even worse :( I hacked the code around a bit this afternoon. Please can you see if: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=for-nicolin/grace-vcmdq-wip does roughly what you need? Will