From: Jason Gunthorpe <jgg@ziepe.ca>
To: Ashish Mhetre <amhetre@nvidia.com>
Cc: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org,
nicolinc@nvidia.com, linux-arm-kernel@lists.infradead.org,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH 2/2] iommu/arm-smmu-v3: Issue CFGI/TLBI twice on Tegra264
Date: Thu, 28 May 2026 21:59:33 -0300 [thread overview]
Message-ID: <20260529005933.GQ2487554@ziepe.ca> (raw)
In-Reply-To: <20260528101617.4068249-3-amhetre@nvidia.com>
On Thu, May 28, 2026 at 10:16:17AM +0000, Ashish Mhetre wrote:
> Apply the workaround for Tegra264 erratum by issuing every CFGI/TLBI
> command twice on affected SMMU instances, with CMD_SYNC after each.
> The erratum requires this exact sequencing:
>
> TLBI/CFGI ... CMD_SYNC TLBI/CFGI ... CMD_SYNC
>
> To get this sequence with minimal surgery, hook the workaround into
> arm_smmu_cmdq_issue_cmdlist(). Rename the original function to
> __arm_smmu_cmdq_issue_cmdlist() and add a thin wrapper that, on
> affected SMMUs and when @sync is true, re-issues the same cmdlist a
> second time.
>
> A new arm_smmu_cmd_needs_tlbi_twice() helper classifies which opcodes
> need the doubling: CFGI_* and TLBI_*.
>
> For batches that exceed CMDQ_BATCH_ENTRIES commands,
> arm_smmu_cmdq_batch_add_cmd_p() normally flushes the full buffer with
> sync=false, deferring the SYNC to the eventual batch_submit(). On
> affected SMMUs this would leave the first chunk's commands issued
> only once, since the WAR hook in arm_smmu_cmdq_issue_cmdlist() only
> fires on synced submissions. Force a SYNC on the capacity rollover
> when the buffer carries CFGI/TLBI commands so every flushed chunk is
> correctly doubled.
>
> Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
> ---
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 66 +++++++++++++++++++--
> 1 file changed, 61 insertions(+), 5 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Jason
next prev parent reply other threads:[~2026-05-29 0:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 10:16 [PATCH 0/2] iommu/arm-smmu-v3: Tegra264 invalidation workaround Ashish Mhetre
2026-05-28 10:16 ` [PATCH 1/2] iommu/arm-smmu-v3: Detect Tegra264 erratum Ashish Mhetre
2026-05-28 10:34 ` Robin Murphy
2026-05-28 16:06 ` Ashish Mhetre
2026-05-28 18:38 ` Nicolin Chen
2026-05-29 6:11 ` Ashish Mhetre
2026-05-28 10:16 ` [PATCH 2/2] iommu/arm-smmu-v3: Issue CFGI/TLBI twice on Tegra264 Ashish Mhetre
2026-05-29 0:59 ` Jason Gunthorpe [this message]
2026-05-28 18:41 ` [PATCH 0/2] iommu/arm-smmu-v3: Tegra264 invalidation workaround Nicolin Chen
2026-05-29 6:18 ` Ashish Mhetre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260529005933.GQ2487554@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=amhetre@nvidia.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=nicolinc@nvidia.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox