]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu/amd: Rework amd_iommu_update_and_flush_device_table()
authorVasant Hegde <vasant.hegde@amd.com>
Wed, 28 Aug 2024 11:10:28 +0000 (11:10 +0000)
committerJoerg Roedel <jroedel@suse.de>
Wed, 4 Sep 2024 09:35:57 +0000 (11:35 +0200)
Remove separate function to update and flush the device table as only
amd_iommu_update_and_flush_device_table() calls these functions.

No functional changes intended.

Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20240828111029.5429-8-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/iommu.c

index 9af084fa6dd48cd3e1e216b00d395cedc713e0ef..5289be98377ac54d7cb728fa8fc1babe541efb37 100644 (file)
@@ -1591,15 +1591,7 @@ static void domain_flush_np_cache(struct protection_domain *domain,
 /*
  * This function flushes the DTEs for all devices in domain
  */
-static void domain_flush_devices(struct protection_domain *domain)
-{
-       struct iommu_dev_data *dev_data;
-
-       list_for_each_entry(dev_data, &domain->dev_list, list)
-               device_flush_dte(dev_data);
-}
-
-static void update_device_table(struct protection_domain *domain)
+void amd_iommu_update_and_flush_device_table(struct protection_domain *domain)
 {
        struct iommu_dev_data *dev_data;
 
@@ -1609,12 +1601,10 @@ static void update_device_table(struct protection_domain *domain)
                set_dte_entry(iommu, dev_data);
                clone_aliases(iommu, dev_data->dev);
        }
-}
 
-void amd_iommu_update_and_flush_device_table(struct protection_domain *domain)
-{
-       update_device_table(domain);
-       domain_flush_devices(domain);
+       list_for_each_entry(dev_data, &domain->dev_list, list)
+               device_flush_dte(dev_data);
+
        domain_flush_complete(domain);
 }