|
@@ -1491,17 +1491,14 @@ static void __init free_on_init_error(void)
|
|
* After everything is set up the IOMMUs are enabled and the necessary
|
|
* After everything is set up the IOMMUs are enabled and the necessary
|
|
* hotplug and suspend notifiers are registered.
|
|
* hotplug and suspend notifiers are registered.
|
|
*/
|
|
*/
|
|
-int __init amd_iommu_init_hardware(void)
|
|
|
|
|
|
+static int __init early_amd_iommu_init(void)
|
|
{
|
|
{
|
|
struct acpi_table_header *ivrs_base;
|
|
struct acpi_table_header *ivrs_base;
|
|
acpi_size ivrs_size;
|
|
acpi_size ivrs_size;
|
|
acpi_status status;
|
|
acpi_status status;
|
|
int i, ret = 0;
|
|
int i, ret = 0;
|
|
|
|
|
|
- if (no_iommu || (iommu_detected && !gart_iommu_aperture))
|
|
|
|
- return -ENODEV;
|
|
|
|
-
|
|
|
|
- if (amd_iommu_disabled || !amd_iommu_detected)
|
|
|
|
|
|
+ if (!amd_iommu_detected)
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
|
|
if (amd_iommu_dev_table != NULL) {
|
|
if (amd_iommu_dev_table != NULL) {
|
|
@@ -1588,16 +1585,6 @@ int __init amd_iommu_init_hardware(void)
|
|
if (ret)
|
|
if (ret)
|
|
goto free;
|
|
goto free;
|
|
|
|
|
|
- ret = amd_iommu_init_pci();
|
|
|
|
- if (ret)
|
|
|
|
- goto free;
|
|
|
|
-
|
|
|
|
- enable_iommus();
|
|
|
|
-
|
|
|
|
- amd_iommu_init_notifier();
|
|
|
|
-
|
|
|
|
- register_syscore_ops(&amd_iommu_syscore_ops);
|
|
|
|
-
|
|
|
|
out:
|
|
out:
|
|
/* Don't leak any ACPI memory */
|
|
/* Don't leak any ACPI memory */
|
|
early_acpi_os_unmap_memory((char __iomem *)ivrs_base, ivrs_size);
|
|
early_acpi_os_unmap_memory((char __iomem *)ivrs_base, ivrs_size);
|
|
@@ -1611,6 +1598,27 @@ free:
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+int __init amd_iommu_init_hardware(void)
|
|
|
|
+{
|
|
|
|
+ int ret = 0;
|
|
|
|
+
|
|
|
|
+ ret = early_amd_iommu_init();
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
+
|
|
|
|
+ ret = amd_iommu_init_pci();
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
+
|
|
|
|
+ enable_iommus();
|
|
|
|
+
|
|
|
|
+ amd_iommu_init_notifier();
|
|
|
|
+
|
|
|
|
+ register_syscore_ops(&amd_iommu_syscore_ops);
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
static int amd_iommu_enable_interrupts(void)
|
|
static int amd_iommu_enable_interrupts(void)
|
|
{
|
|
{
|
|
struct amd_iommu *iommu;
|
|
struct amd_iommu *iommu;
|