summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/aperture_64.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-04-13 11:24:54 (GMT)
committerIngo Molnar <mingo@elte.hu>2010-04-13 11:24:54 (GMT)
commit2b2f862ee6ef8ae8f913fee6af2112c5ffeedf94 (patch)
tree06a89df37436f9902a37800e05541880ba3aa603 /arch/x86/kernel/aperture_64.c
parent0d0fb0f9c5fddef4a10242fe3337f00f528a3099 (diff)
parent4b83873d3da0704987cb116833818ed96214ee29 (diff)
downloadlinux-2b2f862ee6ef8ae8f913fee6af2112c5ffeedf94.tar.xz
Merge branch 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent
Diffstat (limited to 'arch/x86/kernel/aperture_64.c')
-rw-r--r--arch/x86/kernel/aperture_64.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/x86/kernel/aperture_64.c b/arch/x86/kernel/aperture_64.c
index 3704997..b5d8b0b 100644
--- a/arch/x86/kernel/aperture_64.c
+++ b/arch/x86/kernel/aperture_64.c
@@ -393,6 +393,7 @@ void __init gart_iommu_hole_init(void)
for (i = 0; i < ARRAY_SIZE(bus_dev_ranges); i++) {
int bus;
int dev_base, dev_limit;
+ u32 ctl;
bus = bus_dev_ranges[i].bus;
dev_base = bus_dev_ranges[i].dev_base;
@@ -406,7 +407,19 @@ void __init gart_iommu_hole_init(void)
gart_iommu_aperture = 1;
x86_init.iommu.iommu_init = gart_iommu_init;
- aper_order = (read_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL) >> 1) & 7;
+ ctl = read_pci_config(bus, slot, 3,
+ AMD64_GARTAPERTURECTL);
+
+ /*
+ * Before we do anything else disable the GART. It may
+ * still be enabled if we boot into a crash-kernel here.
+ * Reconfiguring the GART while it is enabled could have
+ * unknown side-effects.
+ */
+ ctl &= ~GARTEN;
+ write_pci_config(bus, slot, 3, AMD64_GARTAPERTURECTL, ctl);
+
+ aper_order = (ctl >> 1) & 7;
aper_size = (32 * 1024 * 1024) << aper_order;
aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff;
aper_base <<= 25;