Commit 42590a75 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Ingo Molnar

x86/agp: Fix agp_amd64_init and agp_amd64_cleanup

This fixes the regression introduced by the commit

The above commit fixes the following issue:

However, it doesn't work properly when you remove and insert the
agp_amd64 module again.

agp_amd64_init() and agp_amd64_cleanup should be called only
when gart_iommu is not called earlier (that is, the GART IOMMU
is not enabled). We need to use 'gart_iommu_aperture' to see if
GART IOMMU is enabled or not.
Signed-off-by: default avatarFUJITA Tomonori <>
LKML-Reference: <>
Signed-off-by: default avatarIngo Molnar <>
parent fcfbb2b5
......@@ -31,6 +31,7 @@
#include <asm/x86_init.h>
int gart_iommu_aperture;
int gart_iommu_aperture_disabled __initdata;
int gart_iommu_aperture_allowed __initdata;
......@@ -725,12 +725,11 @@ static struct pci_driver agp_amd64_pci_driver = {
int __init agp_amd64_init(void)
int err = 0;
static int done = 0;
if (agp_off)
return -EINVAL;
if (done++)
if (gart_iommu_aperture)
return agp_bridges_found ? 0 : -ENODEV;
err = pci_register_driver(&agp_amd64_pci_driver);
......@@ -771,6 +770,8 @@ int __init agp_amd64_init(void)
static void __exit agp_amd64_cleanup(void)
if (gart_iommu_aperture)
if (aperture_resource)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment