[PATCH 2/2] iommu/arm-smmu-v3: Issue CFGI/TLBI twice on Tegra264

Jason Gunthorpe jgg at ziepe.ca
Thu May 28 17:59:33 PDT 2026


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 at 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 at nvidia.com>

Jason



More information about the linux-arm-kernel mailing list