iommu/arm-smmu-v3: Invalidate ATC when detaching a device
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Wed, 3 Jul 2019 11:19:20 +0000 (12:19 +0100)
committerJoerg Roedel <jroedel@suse.de>
Thu, 4 Jul 2019 08:03:27 +0000 (10:03 +0200)
commit8dd8f005bdd45823fc153ef490239558caf6ff20
tree3f17e360918065e360b58e9305d45d26992560c2
parent900a85ca43f4ae88c325a468cb8827e4852b9141
iommu/arm-smmu-v3: Invalidate ATC when detaching a device

We make the invalid assumption in arm_smmu_detach_dev() that the ATC is
clear after calling pci_disable_ats(). For one thing, only enabling the
PCIe ATS capability constitutes an implicit invalidation event, so the
comment was wrong. More importantly, the ATS capability isn't necessarily
disabled by pci_disable_ats() in a PF, if the associated VFs have ATS
enabled. Explicitly invalidate all ATC entries in arm_smmu_detach_dev().
The endpoint cannot form new ATC entries because STE.EATS is clear.

Fixes: 9ce27afc0830 ("iommu/arm-smmu-v3: Add support for PCI ATS")
Reported-by: Manoj Kumar <Manoj.Kumar3@arm.com>
Reported-by: Robin Murphy <Robin.Murphy@arm.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/arm-smmu-v3.c