]> asedeno.scripts.mit.edu Git - linux.git/commit
iommu/amd: Take domain->lock for complete attach/detach path
authorJoerg Roedel <jroedel@suse.de>
Wed, 25 Sep 2019 13:22:57 +0000 (15:22 +0200)
committerJoerg Roedel <jroedel@suse.de>
Sat, 28 Sep 2019 12:43:52 +0000 (14:43 +0200)
commitf6c0bfce271b2dd613e8b8e009eefe89c1f788e8
treec01bbfce2692ac4d1f7f620a26ca98c52adea28c
parent3a11905b69eb026402448c750f97a0eadfa76b08
iommu/amd: Take domain->lock for complete attach/detach path

The code-paths before __attach_device() and __detach_device() are called
also access and modify domain state, so take the domain lock there too.
This allows to get rid of the __detach_device() function.

Fixes: 92d420ec028d ("iommu/amd: Relax locking in dma_ops path")
Reviewed-by: Filippo Sironi <sironi@amazon.de>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c