iommu/io-pgtable-arm: Remove redundant call to io_pgtable_tlb_sync()
authorWill Deacon <will@kernel.org>
Tue, 2 Jul 2019 15:43:24 +0000 (16:43 +0100)
committerWill Deacon <will@kernel.org>
Wed, 24 Jul 2019 12:32:33 +0000 (13:32 +0100)
Commit b6b65ca20bc9 ("iommu/io-pgtable-arm: Add support for non-strict
mode") added an unconditional call to io_pgtable_tlb_sync() immediately
after the case where we replace a block entry with a table entry during
an unmap() call. This is redundant, since the IOMMU API will call
iommu_tlb_sync() on this path and the patch in question mentions this:

 | To save having to reason about it too much, make sure the invalidation
 | in arm_lpae_split_blk_unmap() just performs its own unconditional sync
 | to minimise the window in which we're technically violating the break-
 | before-make requirement on a live mapping. This might work out redundant
 | with an outer-level sync for strict unmaps, but we'll never be splitting
 | blocks on a DMA fastpath anyway.

However, this sync gets in the way of deferred TLB invalidation for leaf
entries and is at best a questionable, unproven hack. Remove it.

Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/io-pgtable-arm-v7s.c
drivers/iommu/io-pgtable-arm.c

index 0fc8dfab2abf57d51418ba17f5d470eb6292b49a..a62733c6a632f9cbd06934cc749f9dd10d703a71 100644 (file)
@@ -587,7 +587,6 @@ static size_t arm_v7s_split_blk_unmap(struct arm_v7s_io_pgtable *data,
        }
 
        io_pgtable_tlb_add_flush(&data->iop, iova, size, size, true);
-       io_pgtable_tlb_sync(&data->iop);
        return size;
 }
 
index 161a7d56264d0c26b7297930c0d843df674dd7bc..0d6633921c1ece00d6e17cde9ec4138243c2b207 100644 (file)
@@ -583,7 +583,6 @@ static size_t arm_lpae_split_blk_unmap(struct arm_lpae_io_pgtable *data,
                tablep = iopte_deref(pte, data);
        } else if (unmap_idx >= 0) {
                io_pgtable_tlb_add_flush(&data->iop, iova, size, size, true);
-               io_pgtable_tlb_sync(&data->iop);
                return size;
        }