]> www.infradead.org Git - users/dwmw2/linux.git/commit
iommu/arm-smmu-v3: Do not zero the strtab twice
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 11 Jun 2024 00:31:10 +0000 (21:31 -0300)
committerWill Deacon <will@kernel.org>
Tue, 2 Jul 2024 15:33:58 +0000 (16:33 +0100)
commitc84c5ab76c9c04b5f1c8cc66ee9313198e89bb11
treed408b32ee0a980ee67b7bcd6a7da50d5dd7e99cf
parentf3b273b7c7e42ff7ef5b6063834d768d33c7ba79
iommu/arm-smmu-v3: Do not zero the strtab twice

dmam_alloc_coherent() already returns zero'd memory so cfg->strtab.l1_desc
(the list of DMA addresses for the L2 entries) is already zero'd.

arm_smmu_init_l1_strtab() goes through and calls
arm_smmu_write_strtab_l1_desc() on the newly allocated (and zero'd) struct
arm_smmu_strtab_l1_desc, which ends up computing 'val = 0' and zeroing it
again.

Remove arm_smmu_init_l1_strtab() and just call devm_kcalloc() from
arm_smmu_init_strtab_2lvl to allocate the companion struct.

Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Link: https://lore.kernel.org/r/1-v2-318ed5f6983b+198f-smmuv3_tidy_jgg@nvidia.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c