aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/intel-iommu.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-03-05 06:47:28 -0500
committerIngo Molnar <mingo@elte.hu>2009-03-05 06:47:28 -0500
commit7df4edb07cf54a4868b9a750424c0d2aa68f8d66 (patch)
tree0ad0ad3f3dcb6f9edf26dde42ba625053dddf54f /drivers/pci/intel-iommu.c
parent0d688da5505d77bcef2441e0a22d8cc26459702d (diff)
parent559595a985e106d2fa9f0c79b7f5805453fed593 (diff)
Merge branch 'linus' into core/iommu
Diffstat (limited to 'drivers/pci/intel-iommu.c')
-rw-r--r--drivers/pci/intel-iommu.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 628f8b72e530..e7d058aa7b0d 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -61,6 +61,8 @@
61/* global iommu list, set NULL for ignored DMAR units */ 61/* global iommu list, set NULL for ignored DMAR units */
62static struct intel_iommu **g_iommus; 62static struct intel_iommu **g_iommus;
63 63
64static int rwbf_quirk;
65
64/* 66/*
65 * 0: Present 67 * 0: Present
66 * 1-11: Reserved 68 * 1-11: Reserved
@@ -268,7 +270,12 @@ static long list_size;
268 270
269static void domain_remove_dev_info(struct dmar_domain *domain); 271static void domain_remove_dev_info(struct dmar_domain *domain);
270 272
271int dmar_disabled; 273#ifdef CONFIG_DMAR_DEFAULT_ON
274int dmar_disabled = 0;
275#else
276int dmar_disabled = 1;
277#endif /*CONFIG_DMAR_DEFAULT_ON*/
278
272static int __initdata dmar_map_gfx = 1; 279static int __initdata dmar_map_gfx = 1;
273static int dmar_forcedac; 280static int dmar_forcedac;
274static int intel_iommu_strict; 281static int intel_iommu_strict;
@@ -284,9 +291,12 @@ static int __init intel_iommu_setup(char *str)
284 if (!str) 291 if (!str)
285 return -EINVAL; 292 return -EINVAL;
286 while (*str) { 293 while (*str) {
287 if (!strncmp(str, "off", 3)) { 294 if (!strncmp(str, "on", 2)) {
295 dmar_disabled = 0;
296 printk(KERN_INFO "Intel-IOMMU: enabled\n");
297 } else if (!strncmp(str, "off", 3)) {
288 dmar_disabled = 1; 298 dmar_disabled = 1;
289 printk(KERN_INFO"Intel-IOMMU: disabled\n"); 299 printk(KERN_INFO "Intel-IOMMU: disabled\n");
290 } else if (!strncmp(str, "igfx_off", 8)) { 300 } else if (!strncmp(str, "igfx_off", 8)) {
291 dmar_map_gfx = 0; 301 dmar_map_gfx = 0;
292 printk(KERN_INFO 302 printk(KERN_INFO
@@ -777,7 +787,7 @@ static void iommu_flush_write_buffer(struct intel_iommu *iommu)
777 u32 val; 787 u32 val;
778 unsigned long flag; 788 unsigned long flag;
779 789
780 if (!cap_rwbf(iommu->cap)) 790 if (!rwbf_quirk && !cap_rwbf(iommu->cap))
781 return; 791 return;
782 val = iommu->gcmd | DMA_GCMD_WBF; 792 val = iommu->gcmd | DMA_GCMD_WBF;
783 793
@@ -3145,3 +3155,15 @@ static struct iommu_ops intel_iommu_ops = {
3145 .unmap = intel_iommu_unmap_range, 3155 .unmap = intel_iommu_unmap_range,
3146 .iova_to_phys = intel_iommu_iova_to_phys, 3156 .iova_to_phys = intel_iommu_iova_to_phys,
3147}; 3157};
3158
3159static void __devinit quirk_iommu_rwbf(struct pci_dev *dev)
3160{
3161 /*
3162 * Mobile 4 Series Chipset neglects to set RWBF capability,
3163 * but needs it:
3164 */
3165 printk(KERN_INFO "DMAR: Forcing write-buffer flush capability\n");
3166 rwbf_quirk = 1;
3167}
3168
3169DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2a40, quirk_iommu_rwbf);