mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
x86/agp: Fix agp_amd64_init and agp_amd64_cleanup
This fixes the regression introduced by the commit
f405d2c023.
The above commit fixes the following issue:
http://marc.info/?l=linux-kernel&m=126192729110083&w=2
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: FUJITA Tomonori <[email protected]>
Cc: [email protected]
Cc: [email protected]
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
fcfbb2b5fa
commit
42590a7501
2 changed files with 4 additions and 2 deletions
|
|
@ -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)
|
||||
return;
|
||||
if (aperture_resource)
|
||||
release_resource(aperture_resource);
|
||||
pci_unregister_driver(&agp_amd64_pci_driver);
|
||||
|
|
|
|||
Loading…
Reference in a new issue