diff options
author | Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> | 2023-05-30 10:11:37 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2023-06-09 14:47:10 +0200 |
commit | bccc37a8a2fb002a302a526656c56a793a708670 (patch) | |
tree | 99e580b3b775dfc82d21b084f4dbf3d80740f700 /drivers/iommu/amd/init.c | |
parent | 98aeb4ea5599c5f7fbb1645bdd2050d0be96dfa3 (diff) | |
download | linux-stable-bccc37a8a2fb002a302a526656c56a793a708670.tar.gz linux-stable-bccc37a8a2fb002a302a526656c56a793a708670.tar.bz2 linux-stable-bccc37a8a2fb002a302a526656c56a793a708670.zip |
iommu/amd: Improving Interrupt Remapping Table Invalidation
Invalidating Interrupt Remapping Table (IRT) requires, the AMD IOMMU driver
to issue INVALIDATE_INTERRUPT_TABLE and COMPLETION_WAIT commands.
Currently, the driver issues the two commands separately, which requires
calling raw_spin_lock_irqsave() twice. In addition, the COMPLETION_WAIT
could potentially be interleaved with other commands causing delay of
the COMPLETION_WAIT command.
Therefore, combine issuing of the two commands in one spin-lock, and
changing struct amd_iommu.cmd_sem_val to use atomic64 to minimize
locking.
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20230530141137.14376-6-suravee.suthikulpanit@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd/init.c')
-rw-r--r-- | drivers/iommu/amd/init.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index 418da641ee3d..4c68dc382286 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -1733,7 +1733,7 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h, iommu->pci_seg = pci_seg; raw_spin_lock_init(&iommu->lock); - iommu->cmd_sem_val = 0; + atomic64_set(&iommu->cmd_sem_val, 0); /* Add IOMMU to internal data structures */ list_add_tail(&iommu->list, &amd_iommu_list); |