Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iommu: Cleanup ifdefs in detect_intel_iommu()

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: yinghai@kernel.org
Cc: youquan.song@intel.com
Cc: joerg.roedel@amd.com
Cc: tony.luck@intel.com
Cc: dwmw2@infradead.org
Link: http://lkml.kernel.org/r/20110824001456.386003047@sbsiddha-desk.sc.intel.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Suresh Siddha and committed by
Ingo Molnar
f5d1b97b 80990c5b

+12 -10
+4 -2
arch/ia64/include/asm/iommu.h
··· 7 7 8 8 extern void pci_iommu_shutdown(void); 9 9 extern void no_iommu_init(void); 10 - extern int force_iommu, no_iommu; 11 - extern int iommu_detected; 12 10 #ifdef CONFIG_DMAR 11 + extern int force_iommu, no_iommu; 13 12 extern int iommu_pass_through; 13 + extern int iommu_detected; 14 14 #else 15 15 #define iommu_pass_through (0) 16 + #define no_iommu (1) 17 + #define iommu_detected (0) 16 18 #endif 17 19 extern void iommu_dma_init(void); 18 20 extern void machvec_init(const char *name);
+6 -7
drivers/iommu/dmar.c
··· 551 551 if (ret) 552 552 ret = check_zero_address(); 553 553 { 554 - #ifdef CONFIG_INTR_REMAP 555 554 struct acpi_table_dmar *dmar; 556 555 557 556 dmar = (struct acpi_table_dmar *) dmar_tbl; 558 - if (ret && cpu_has_x2apic && dmar->flags & 0x1) 557 + 558 + if (ret && intr_remapping_enabled && cpu_has_x2apic && 559 + dmar->flags & 0x1) 559 560 printk(KERN_INFO 560 - "Queued invalidation will be enabled to support " 561 - "x2apic and Intr-remapping.\n"); 562 - #endif 563 - #ifdef CONFIG_DMAR 561 + "Queued invalidation will be enabled to support x2apic and Intr-remapping.\n"); 562 + 564 563 if (ret && !no_iommu && !iommu_detected && !dmar_disabled) { 565 564 iommu_detected = 1; 566 565 /* Make sure ACS will be enabled */ 567 566 pci_request_acs(); 568 567 } 569 - #endif 568 + 570 569 #ifdef CONFIG_X86 571 570 if (ret) 572 571 x86_init.iommu.iommu_init = intel_iommu_init;
+2 -1
include/linux/dma_remapping.h
··· 30 30 extern void free_dmar_iommu(struct intel_iommu *iommu); 31 31 extern int iommu_calculate_agaw(struct intel_iommu *iommu); 32 32 extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); 33 + extern int dmar_disabled; 33 34 #else 34 35 static inline int iommu_calculate_agaw(struct intel_iommu *iommu) 35 36 { ··· 43 42 static inline void free_dmar_iommu(struct intel_iommu *iommu) 44 43 { 45 44 } 45 + #define dmar_disabled (1) 46 46 #endif 47 47 48 - extern int dmar_disabled; 49 48 50 49 #endif