diff options
author | Fenghua Yu <fenghua.yu@intel.com> | 2008-10-23 19:51:00 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-10-24 14:09:43 -0400 |
commit | 3b15e581981b3ad35809f56d8131d5c19b6da1bd (patch) | |
tree | bfd195b86451f2ee5600a05be32346b157ff97db | |
parent | e013e13bf605b9e6b702adffbe2853cfc60e7806 (diff) |
x86/PCI: build failure at x86/kernel/pci-dma.c with !CONFIG_PCI
On Thu, Oct 23, 2008 at 04:09:52PM -0700, Alexander Beregalov wrote:
> arch/x86/kernel/built-in.o: In function `iommu_setup':
> pci-dma.c:(.init.text+0x36ad): undefined reference to `forbid_dac'
> pci-dma.c:(.init.text+0x36cc): undefined reference to `forbid_dac'
> pci-dma.c:(.init.text+0x3711): undefined reference to `forbid_dac
This patch partially reverts a patch to add IOMMU support to ia64. The
forbid_dac variable was incorrectly moved to quirks.c, which isn't built
when PCI is disabled.
Tested-by: "Alexander Beregalov" <a.beregalov@gmail.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | arch/ia64/include/asm/iommu.h | 1 | ||||
-rw-r--r-- | arch/ia64/kernel/pci-dma.c | 7 | ||||
-rw-r--r-- | arch/x86/include/asm/iommu.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 16 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 14 |
5 files changed, 16 insertions, 23 deletions
diff --git a/arch/ia64/include/asm/iommu.h b/arch/ia64/include/asm/iommu.h index 5fb2bb93de3b..0490794fe4aa 100644 --- a/arch/ia64/include/asm/iommu.h +++ b/arch/ia64/include/asm/iommu.h | |||
@@ -11,6 +11,5 @@ extern int force_iommu, no_iommu; | |||
11 | extern int iommu_detected; | 11 | extern int iommu_detected; |
12 | extern void iommu_dma_init(void); | 12 | extern void iommu_dma_init(void); |
13 | extern void machvec_init(const char *name); | 13 | extern void machvec_init(const char *name); |
14 | extern int forbid_dac; | ||
15 | 14 | ||
16 | #endif | 15 | #endif |
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c index 10a75b557650..031abbf9c875 100644 --- a/arch/ia64/kernel/pci-dma.c +++ b/arch/ia64/kernel/pci-dma.c | |||
@@ -89,13 +89,6 @@ int iommu_dma_supported(struct device *dev, u64 mask) | |||
89 | { | 89 | { |
90 | struct dma_mapping_ops *ops = get_dma_ops(dev); | 90 | struct dma_mapping_ops *ops = get_dma_ops(dev); |
91 | 91 | ||
92 | #ifdef CONFIG_PCI | ||
93 | if (mask > 0xffffffff && forbid_dac > 0) { | ||
94 | dev_info(dev, "Disallowing DAC for device\n"); | ||
95 | return 0; | ||
96 | } | ||
97 | #endif | ||
98 | |||
99 | if (ops->dma_supported_op) | 92 | if (ops->dma_supported_op) |
100 | return ops->dma_supported_op(dev, mask); | 93 | return ops->dma_supported_op(dev, mask); |
101 | 94 | ||
diff --git a/arch/x86/include/asm/iommu.h b/arch/x86/include/asm/iommu.h index 98e28ea8cd16..e4a552d44465 100644 --- a/arch/x86/include/asm/iommu.h +++ b/arch/x86/include/asm/iommu.h | |||
@@ -7,7 +7,6 @@ extern struct dma_mapping_ops nommu_dma_ops; | |||
7 | extern int force_iommu, no_iommu; | 7 | extern int force_iommu, no_iommu; |
8 | extern int iommu_detected; | 8 | extern int iommu_detected; |
9 | extern int dmar_disabled; | 9 | extern int dmar_disabled; |
10 | extern int forbid_dac; | ||
11 | 10 | ||
12 | extern unsigned long iommu_nr_pages(unsigned long addr, unsigned long len); | 11 | extern unsigned long iommu_nr_pages(unsigned long addr, unsigned long len); |
13 | 12 | ||
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 1972266e8ba5..192624820217 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -9,6 +9,8 @@ | |||
9 | #include <asm/calgary.h> | 9 | #include <asm/calgary.h> |
10 | #include <asm/amd_iommu.h> | 10 | #include <asm/amd_iommu.h> |
11 | 11 | ||
12 | static int forbid_dac __read_mostly; | ||
13 | |||
12 | struct dma_mapping_ops *dma_ops; | 14 | struct dma_mapping_ops *dma_ops; |
13 | EXPORT_SYMBOL(dma_ops); | 15 | EXPORT_SYMBOL(dma_ops); |
14 | 16 | ||
@@ -291,3 +293,17 @@ void pci_iommu_shutdown(void) | |||
291 | } | 293 | } |
292 | /* Must execute after PCI subsystem */ | 294 | /* Must execute after PCI subsystem */ |
293 | fs_initcall(pci_iommu_init); | 295 | fs_initcall(pci_iommu_init); |
296 | |||
297 | #ifdef CONFIG_PCI | ||
298 | /* Many VIA bridges seem to corrupt data for DAC. Disable it here */ | ||
299 | |||
300 | static __devinit void via_no_dac(struct pci_dev *dev) | ||
301 | { | ||
302 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) { | ||
303 | printk(KERN_INFO "PCI: VIA PCI bridge detected." | ||
304 | "Disabling DAC.\n"); | ||
305 | forbid_dac = 1; | ||
306 | } | ||
307 | } | ||
308 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac); | ||
309 | #endif | ||
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 96cf8ecd04ce..bbf66ea8fd87 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -43,20 +43,6 @@ static void __devinit quirk_mellanox_tavor(struct pci_dev *dev) | |||
43 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR,quirk_mellanox_tavor); | 43 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR,quirk_mellanox_tavor); |
44 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE,quirk_mellanox_tavor); | 44 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE,quirk_mellanox_tavor); |
45 | 45 | ||
46 | /* Many VIA bridges seem to corrupt data for DAC. Disable it here */ | ||
47 | int forbid_dac __read_mostly; | ||
48 | EXPORT_SYMBOL(forbid_dac); | ||
49 | |||
50 | static __devinit void via_no_dac(struct pci_dev *dev) | ||
51 | { | ||
52 | if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) { | ||
53 | dev_info(&dev->dev, | ||
54 | "VIA PCI bridge detected. Disabling DAC.\n"); | ||
55 | forbid_dac = 1; | ||
56 | } | ||
57 | } | ||
58 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac); | ||
59 | |||
60 | /* Deal with broken BIOS'es that neglect to enable passive release, | 46 | /* Deal with broken BIOS'es that neglect to enable passive release, |
61 | which can cause problems in combination with the 82441FX/PPro MTRRs */ | 47 | which can cause problems in combination with the 82441FX/PPro MTRRs */ |
62 | static void quirk_passive_release(struct pci_dev *dev) | 48 | static void quirk_passive_release(struct pci_dev *dev) |