Commit 31ee890a authored by Robin Murphy's avatar Robin Murphy Committed by Joerg Roedel
Browse files

iommu/amd: Clean up bus_set_iommu()



Stop calling bus_set_iommu() since it's now unnecessary, and
garbage-collect the last remnants of amd_iommu_init_api().

Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/6bcc367e8802ae5a2b2840cbe4e9661ee024e80e.1660572783.git.robin.murphy@arm.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 57365a04
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@ extern void amd_iommu_restart_event_logging(struct amd_iommu *iommu);
extern int amd_iommu_init_devices(void);
extern int amd_iommu_init_devices(void);
extern void amd_iommu_uninit_devices(void);
extern void amd_iommu_uninit_devices(void);
extern void amd_iommu_init_notifier(void);
extern void amd_iommu_init_notifier(void);
extern int amd_iommu_init_api(void);
extern void amd_iommu_set_rlookup_table(struct amd_iommu *iommu, u16 devid);
extern void amd_iommu_set_rlookup_table(struct amd_iommu *iommu, u16 devid);


#ifdef CONFIG_AMD_IOMMU_DEBUGFS
#ifdef CONFIG_AMD_IOMMU_DEBUGFS
+1 −8
Original line number Original line Diff line number Diff line
@@ -2168,20 +2168,13 @@ static int __init amd_iommu_init_pci(void)
	/*
	/*
	 * Order is important here to make sure any unity map requirements are
	 * Order is important here to make sure any unity map requirements are
	 * fulfilled. The unity mappings are created and written to the device
	 * fulfilled. The unity mappings are created and written to the device
	 * table during the amd_iommu_init_api() call.
	 * table during the iommu_init_pci() call.
	 *
	 *
	 * After that we call init_device_table_dma() to make sure any
	 * After that we call init_device_table_dma() to make sure any
	 * uninitialized DTE will block DMA, and in the end we flush the caches
	 * uninitialized DTE will block DMA, and in the end we flush the caches
	 * of all IOMMUs to make sure the changes to the device table are
	 * of all IOMMUs to make sure the changes to the device table are
	 * active.
	 * active.
	 */
	 */
	ret = amd_iommu_init_api();
	if (ret) {
		pr_err("IOMMU: Failed to initialize IOMMU-API interface (error=%d)!\n",
		       ret);
		goto out;
	}

	for_each_pci_segment(pci_seg)
	for_each_pci_segment(pci_seg)
		init_device_table_dma(pci_seg);
		init_device_table_dma(pci_seg);


+0 −21
Original line number Original line Diff line number Diff line
@@ -11,8 +11,6 @@
#include <linux/ratelimit.h>
#include <linux/ratelimit.h>
#include <linux/pci.h>
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/acpi.h>
#include <linux/amba/bus.h>
#include <linux/platform_device.h>
#include <linux/pci-ats.h>
#include <linux/pci-ats.h>
#include <linux/bitmap.h>
#include <linux/bitmap.h>
#include <linux/slab.h>
#include <linux/slab.h>
@@ -1941,25 +1939,6 @@ void amd_iommu_domain_update(struct protection_domain *domain)
	amd_iommu_domain_flush_complete(domain);
	amd_iommu_domain_flush_complete(domain);
}
}


int __init amd_iommu_init_api(void)
{
	int err;

	err = bus_set_iommu(&pci_bus_type, &amd_iommu_ops);
	if (err)
		return err;
#ifdef CONFIG_ARM_AMBA
	err = bus_set_iommu(&amba_bustype, &amd_iommu_ops);
	if (err)
		return err;
#endif
	err = bus_set_iommu(&platform_bus_type, &amd_iommu_ops);
	if (err)
		return err;

	return 0;
}

/*****************************************************************************
/*****************************************************************************
 *
 *
 * The following functions belong to the exported interface of AMD IOMMU
 * The following functions belong to the exported interface of AMD IOMMU