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 7924EC3DA4A for ; Fri, 16 Aug 2024 13:54:33 +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=P8iJkytSuTAgdYkqAvV5dB82ndbWdXc/0eOkX6hdVY4=; b=ZUht725qNPOov5yaIlfr+1gmlR W4H02CDxwOpRRGF20YYRAN8+vTsePHLj7M32MuHB9QottPvwsPkTLFcYC46yYRWW9qdqDmIgqhRdw 82XHO5oS7qDjkk/GWipi/t7zDCm0YnmVtW3/b3so0eWMPw55LfDztoUYJPA8WTm5b8pDzU+8CJieH aMmPA+iWNKOqBKR3pWGYMtBkChQTq5Q2yzQeLOa3nQgP+4ezoEW5YiYEGdFXMqiTam83AGDWE0+LT +07/JZquaFl31FyumtL24ZPIGHCNATwH6aEE6oL5CE3b0Tso0EK8tMZnwrr54Yd36m9hx96H+i1FV 1w2ueQYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sexPJ-0000000D6Hc-20z5; Fri, 16 Aug 2024 13:54:21 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sexOd-0000000D6C3-4A6A for linux-arm-kernel@lists.infradead.org; Fri, 16 Aug 2024 13:53:41 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 31829CE1BBD; Fri, 16 Aug 2024 13:53:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61E0FC32782; Fri, 16 Aug 2024 13:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723816417; bh=I1cI1Ny0H4g/lNQvAGQgRTIrokQ8aivqsHqBmdZtkDo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=n6vdj1Qe8EJeh7ovIB7iyFJcQaCK5HfYlEQ9XsIKQITWDoRtRuFk/0/hfK3r0/ZDd cL8JspC0xYQHo95NlSkbij8J/tHt2Yfzs1y9JJ9ifOwfBCi5f1t67rNqVrvXpEMl4t QLsewN20p7WqfrmTd07QUCBZEfAFl0XsvRfou+wDAz5/V6GbWEH9jUvGp+sm6OGe76 WRv4Gbve+Ku95td0x2FP6S1IhxkMwN6diWBkPk9r6PAk2oQI5JSnG05h+0lnu9eHrs OmtVF3C/nrAQNzNtj4t3yo7dYtSDf6P8V9TTJSWNJnxYxBaN0K7nc/zMTYGwo/kiQS 0ExjyvSlkXJcQ== Date: Fri, 16 Aug 2024 14:53:31 +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 v11 2/9] iommu/arm-smmu-v3: Enforce arm_smmu_cmdq_build_sync_cmd Message-ID: <20240816135331.GA24607@willie-the-truck> References: <9e59a460c969357a98b3434ed5007ddf9381899b.1722993435.git.nicolinc@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9e59a460c969357a98b3434ed5007ddf9381899b.1722993435.git.nicolinc@nvidia.com> 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-20240816_065340_226739_9303CA70 X-CRM114-Status: GOOD ( 16.70 ) 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, Aug 06, 2024 at 07:11:47PM -0700, Nicolin Chen wrote: > There is an existing arm_smmu_cmdq_build_sync_cmd() so the driver should > call it at all places other than going through arm_smmu_cmdq_build_cmd() > separately. This helps the following patch that adds a CS_NONE option. > > Note that this changes the type of CMD_SYNC in __arm_smmu_cmdq_skip_err, > in ARM_SMMU_OPT_MSIPOLL=true case, from previously a non-MSI one to now > an MSI one that is proven to still work using a hacking test: > nvme: Adding to iommu group 10 > nvme: --------hacking----------- > arm-smmu-v3: unexpected global error reported (0x00000001), > this could be serious > arm-smmu-v3: CMDQ error (cons 0x01000022): Illegal command > arm-smmu-v3: skipping command in error state: > arm-smmu-v3: 0x0000000000000000 > arm-smmu-v3: 0x0000000000000000 > nvme: -------recovered---------- > nvme nvme0: 72/0/0 default/read/poll queues > nvme0n1: p1 p2 Hmm, I'm still a little wary of this. The only reason we emit a CMD_SYNC in __arm_smmu_cmdq_skip_err() is because the SMMU doesn't have a NOP command. So I'd really like the SYNC to have as little functionality as possible in this case. I think we could either propapate the 'cs' field down to arm_smmu_cmdq_build_cmd() or just open-code the command-creation in __arm_smmu_cmdq_skip_err(). Will