X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=arch%2Fx86%2Fkernel%2Famd_iommu_init.c;h=2a13e430437dc5f1e05793aa995df4befcbc8938;hb=734b397cd14f3340394a8dd3266bec97d01f034b;hp=5d9e45c7cea2b3175008c50b8317aaf558633fad;hpb=7441e9cb18a1a1e5b87f516fa97b6d4abb0838e3;p=linux-2.6-omap-h63xx.git diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 5d9e45c7cea..2a13e430437 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c @@ -101,7 +101,7 @@ struct ivmd_header { u64 range_length; } __attribute__((packed)); -static int __initdata amd_iommu_disable; +static int __initdata amd_iommu_detected; u16 amd_iommu_last_bdf; struct list_head amd_iommu_unity_map; @@ -169,14 +169,11 @@ static void __init iommu_feature_disable(struct amd_iommu *iommu, u8 bit) void __init iommu_enable(struct amd_iommu *iommu) { - u32 ctrl; - printk(KERN_INFO "AMD IOMMU: Enabling IOMMU at "); print_devid(iommu->devid, 0); printk(" cap 0x%hx\n", iommu->cap_ptr); iommu_feature_enable(iommu, CONTROL_IOMMU_EN); - ctrl = readl(iommu->mmio_base + MMIO_CONTROL_OFFSET); } static u8 * __init iommu_map_mmio_space(u64 address) @@ -686,11 +683,14 @@ int __init amd_iommu_init(void) int i, ret = 0; - if (amd_iommu_disable) { + if (no_iommu) { printk(KERN_INFO "AMD IOMMU disabled by kernel command line\n"); return 0; } + if (!amd_iommu_detected) + return -ENODEV; + /* * First parse ACPI tables to find the largest Bus/Dev/Func * we need to handle. Upon this information the shared data @@ -831,11 +831,9 @@ void __init amd_iommu_detect(void) if (swiotlb || no_iommu || iommu_detected) return; - if (amd_iommu_disable) - return; - if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) { iommu_detected = 1; + amd_iommu_detected = 1; #ifdef CONFIG_GART_IOMMU gart_iommu_aperture_disabled = 1; gart_iommu_aperture = 0; @@ -846,8 +844,6 @@ void __init amd_iommu_detect(void) static int __init parse_amd_iommu_options(char *str) { for (; *str; ++str) { - if (strcmp(str, "off") == 0) - amd_iommu_disable = 1; if (strcmp(str, "isolate") == 0) amd_iommu_isolate = 1; }