diff options
| -rw-r--r-- | arch/x86/include/asm/amd_iommu.h | 4 | ||||
| -rw-r--r-- | arch/x86/include/asm/calgary.h | 4 | ||||
| -rw-r--r-- | arch/x86/include/asm/gart.h | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/amd_iommu_init.c | 8 | ||||
| -rw-r--r-- | arch/x86/kernel/aperture_64.c | 11 | ||||
| -rw-r--r-- | arch/x86/kernel/pci-calgary_64.c | 15 | ||||
| -rw-r--r-- | drivers/pci/dmar.c | 4 | ||||
| -rw-r--r-- | include/linux/dmar.h | 6 |
8 files changed, 33 insertions, 24 deletions
diff --git a/arch/x86/include/asm/amd_iommu.h b/arch/x86/include/asm/amd_iommu.h index 5af2982133b5..2798142cdb49 100644 --- a/arch/x86/include/asm/amd_iommu.h +++ b/arch/x86/include/asm/amd_iommu.h | |||
| @@ -24,11 +24,11 @@ | |||
| 24 | 24 | ||
| 25 | #ifdef CONFIG_AMD_IOMMU | 25 | #ifdef CONFIG_AMD_IOMMU |
| 26 | 26 | ||
| 27 | extern void amd_iommu_detect(void); | 27 | extern int amd_iommu_detect(void); |
| 28 | 28 | ||
| 29 | #else | 29 | #else |
| 30 | 30 | ||
| 31 | static inline void amd_iommu_detect(void) { } | 31 | static inline int amd_iommu_detect(void) { return -ENODEV; } |
| 32 | 32 | ||
| 33 | #endif | 33 | #endif |
| 34 | 34 | ||
diff --git a/arch/x86/include/asm/calgary.h b/arch/x86/include/asm/calgary.h index 0918654305af..0d467b338835 100644 --- a/arch/x86/include/asm/calgary.h +++ b/arch/x86/include/asm/calgary.h | |||
| @@ -62,9 +62,9 @@ struct cal_chipset_ops { | |||
| 62 | extern int use_calgary; | 62 | extern int use_calgary; |
| 63 | 63 | ||
| 64 | #ifdef CONFIG_CALGARY_IOMMU | 64 | #ifdef CONFIG_CALGARY_IOMMU |
| 65 | extern void detect_calgary(void); | 65 | extern int detect_calgary(void); |
| 66 | #else | 66 | #else |
| 67 | static inline void detect_calgary(void) { return; } | 67 | static inline int detect_calgary(void) { return -ENODEV; } |
| 68 | #endif | 68 | #endif |
| 69 | 69 | ||
| 70 | #endif /* _ASM_X86_CALGARY_H */ | 70 | #endif /* _ASM_X86_CALGARY_H */ |
diff --git a/arch/x86/include/asm/gart.h b/arch/x86/include/asm/gart.h index 4ac5b0f33fc1..d7d1d4c438a4 100644 --- a/arch/x86/include/asm/gart.h +++ b/arch/x86/include/asm/gart.h | |||
| @@ -37,7 +37,7 @@ extern int gart_iommu_aperture_disabled; | |||
| 37 | extern void early_gart_iommu_check(void); | 37 | extern void early_gart_iommu_check(void); |
| 38 | extern int gart_iommu_init(void); | 38 | extern int gart_iommu_init(void); |
| 39 | extern void __init gart_parse_options(char *); | 39 | extern void __init gart_parse_options(char *); |
| 40 | extern void gart_iommu_hole_init(void); | 40 | extern int gart_iommu_hole_init(void); |
| 41 | 41 | ||
| 42 | #else | 42 | #else |
| 43 | #define gart_iommu_aperture 0 | 43 | #define gart_iommu_aperture 0 |
| @@ -50,8 +50,9 @@ static inline void early_gart_iommu_check(void) | |||
| 50 | static inline void gart_parse_options(char *options) | 50 | static inline void gart_parse_options(char *options) |
| 51 | { | 51 | { |
| 52 | } | 52 | } |
| 53 | static inline void gart_iommu_hole_init(void) | 53 | static inline int gart_iommu_hole_init(void) |
| 54 | { | 54 | { |
| 55 | return -ENODEV; | ||
| 55 | } | 56 | } |
| 56 | #endif | 57 | #endif |
| 57 | 58 | ||
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 3cc63e2b8dd4..0b9e2dc4fc9a 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
| @@ -1382,13 +1382,13 @@ static int __init early_amd_iommu_detect(struct acpi_table_header *table) | |||
| 1382 | return 0; | 1382 | return 0; |
| 1383 | } | 1383 | } |
| 1384 | 1384 | ||
| 1385 | void __init amd_iommu_detect(void) | 1385 | int __init amd_iommu_detect(void) |
| 1386 | { | 1386 | { |
| 1387 | if (no_iommu || (iommu_detected && !gart_iommu_aperture)) | 1387 | if (no_iommu || (iommu_detected && !gart_iommu_aperture)) |
| 1388 | return; | 1388 | return -ENODEV; |
| 1389 | 1389 | ||
| 1390 | if (amd_iommu_disabled) | 1390 | if (amd_iommu_disabled) |
| 1391 | return; | 1391 | return -ENODEV; |
| 1392 | 1392 | ||
| 1393 | if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) { | 1393 | if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) { |
| 1394 | iommu_detected = 1; | 1394 | iommu_detected = 1; |
| @@ -1397,7 +1397,9 @@ void __init amd_iommu_detect(void) | |||
| 1397 | 1397 | ||
| 1398 | /* Make sure ACS will be enabled */ | 1398 | /* Make sure ACS will be enabled */ |
| 1399 | pci_request_acs(); | 1399 | pci_request_acs(); |
| 1400 | return 1; | ||
| 1400 | } | 1401 | } |
| 1402 | return -ENODEV; | ||
| 1401 | } | 1403 | } |
| 1402 | 1404 | ||
| 1403 | /**************************************************************************** | 1405 | /**************************************************************************** |
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c index a2e0caf26e17..afa0dab3302f 100644 --- a/arch/x86/kernel/aperture_64.c +++ b/arch/x86/kernel/aperture_64.c | |||
| @@ -371,7 +371,7 @@ void __init early_gart_iommu_check(void) | |||
| 371 | 371 | ||
| 372 | static int __initdata printed_gart_size_msg; | 372 | static int __initdata printed_gart_size_msg; |
| 373 | 373 | ||
| 374 | void __init gart_iommu_hole_init(void) | 374 | int __init gart_iommu_hole_init(void) |
| 375 | { | 375 | { |
| 376 | u32 agp_aper_base = 0, agp_aper_order = 0; | 376 | u32 agp_aper_base = 0, agp_aper_order = 0; |
| 377 | u32 aper_size, aper_alloc = 0, aper_order = 0, last_aper_order = 0; | 377 | u32 aper_size, aper_alloc = 0, aper_order = 0, last_aper_order = 0; |
| @@ -381,7 +381,7 @@ void __init gart_iommu_hole_init(void) | |||
| 381 | 381 | ||
| 382 | if (gart_iommu_aperture_disabled || !fix_aperture || | 382 | if (gart_iommu_aperture_disabled || !fix_aperture || |
| 383 | !early_pci_allowed()) | 383 | !early_pci_allowed()) |
| 384 | return; | 384 | return -ENODEV; |
| 385 | 385 | ||
| 386 | printk(KERN_INFO "Checking aperture...\n"); | 386 | printk(KERN_INFO "Checking aperture...\n"); |
| 387 | 387 | ||
| @@ -463,8 +463,9 @@ out: | |||
| 463 | unsigned long n = (32 * 1024 * 1024) << last_aper_order; | 463 | unsigned long n = (32 * 1024 * 1024) << last_aper_order; |
| 464 | 464 | ||
| 465 | insert_aperture_resource((u32)last_aper_base, n); | 465 | insert_aperture_resource((u32)last_aper_base, n); |
| 466 | return 1; | ||
| 466 | } | 467 | } |
| 467 | return; | 468 | return 0; |
| 468 | } | 469 | } |
| 469 | 470 | ||
| 470 | if (!fallback_aper_force) { | 471 | if (!fallback_aper_force) { |
| @@ -500,7 +501,7 @@ out: | |||
| 500 | panic("Not enough memory for aperture"); | 501 | panic("Not enough memory for aperture"); |
| 501 | } | 502 | } |
| 502 | } else { | 503 | } else { |
| 503 | return; | 504 | return 0; |
| 504 | } | 505 | } |
| 505 | 506 | ||
| 506 | /* Fix up the north bridges */ | 507 | /* Fix up the north bridges */ |
| @@ -524,4 +525,6 @@ out: | |||
| 524 | } | 525 | } |
| 525 | 526 | ||
| 526 | set_up_gart_resume(aper_order, aper_alloc); | 527 | set_up_gart_resume(aper_order, aper_alloc); |
| 528 | |||
| 529 | return 1; | ||
| 527 | } | 530 | } |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 078d4ec1a9d9..28c6b389fee6 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
| @@ -1364,7 +1364,7 @@ static int __init calgary_iommu_init(void) | |||
| 1364 | return 0; | 1364 | return 0; |
| 1365 | } | 1365 | } |
| 1366 | 1366 | ||
| 1367 | void __init detect_calgary(void) | 1367 | int __init detect_calgary(void) |
| 1368 | { | 1368 | { |
| 1369 | int bus; | 1369 | int bus; |
| 1370 | void *tbl; | 1370 | void *tbl; |
| @@ -1378,13 +1378,13 @@ void __init detect_calgary(void) | |||
| 1378 | * another HW IOMMU already, bail out. | 1378 | * another HW IOMMU already, bail out. |
| 1379 | */ | 1379 | */ |
| 1380 | if (no_iommu || iommu_detected) | 1380 | if (no_iommu || iommu_detected) |
| 1381 | return; | 1381 | return -ENODEV; |
| 1382 | 1382 | ||
| 1383 | if (!use_calgary) | 1383 | if (!use_calgary) |
| 1384 | return; | 1384 | return -ENODEV; |
| 1385 | 1385 | ||
| 1386 | if (!early_pci_allowed()) | 1386 | if (!early_pci_allowed()) |
| 1387 | return; | 1387 | return -ENODEV; |
| 1388 | 1388 | ||
| 1389 | printk(KERN_DEBUG "Calgary: detecting Calgary via BIOS EBDA area\n"); | 1389 | printk(KERN_DEBUG "Calgary: detecting Calgary via BIOS EBDA area\n"); |
| 1390 | 1390 | ||
| @@ -1410,13 +1410,13 @@ void __init detect_calgary(void) | |||
