Commit b8123db4 authored by Dave Jones's avatar Dave Jones

Merge delerium.codemonkey.org.uk:/mnt/nfs/sepia/bar/src/kernel/2.6/trees/bk-linus

into delerium.codemonkey.org.uk:/mnt/nfs/sepia/bar/src/kernel/2.6/trees/agpgart
parents 44cb023a d990de21
...@@ -680,7 +680,7 @@ static int __init pci_iommu_init(void) ...@@ -680,7 +680,7 @@ static int __init pci_iommu_init(void)
unsigned long iommu_start; unsigned long iommu_start;
struct pci_dev *dev; struct pci_dev *dev;
#ifndef CONFIG_AGP_AMD_8151 #ifndef CONFIG_AGP_AMD64
no_agp = 1; no_agp = 1;
#else #else
/* Makefile puts PCI initialization via subsys_initcall first. */ /* Makefile puts PCI initialization via subsys_initcall first. */
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
static int nr_garts; static int nr_garts;
static struct pci_dev * hammers[MAX_HAMMER_GARTS]; static struct pci_dev * hammers[MAX_HAMMER_GARTS];
static struct resource *aperture_resource;
static int __initdata agp_try_unsupported; static int __initdata agp_try_unsupported;
static int gart_iterator; static int gart_iterator;
...@@ -250,7 +251,6 @@ struct agp_bridge_driver amd_8151_driver = { ...@@ -250,7 +251,6 @@ struct agp_bridge_driver amd_8151_driver = {
/* Some basic sanity checks for the aperture. */ /* Some basic sanity checks for the aperture. */
static int __devinit aperture_valid(u64 aper, u32 size) static int __devinit aperture_valid(u64 aper, u32 size)
{ {
static int not_first_call;
u32 pfn, c; u32 pfn, c;
if (aper == 0) { if (aper == 0) {
printk(KERN_ERR PFX "No aperture\n"); printk(KERN_ERR PFX "No aperture\n");
...@@ -279,12 +279,11 @@ static int __devinit aperture_valid(u64 aper, u32 size) ...@@ -279,12 +279,11 @@ static int __devinit aperture_valid(u64 aper, u32 size)
Maybe better to use pci_assign_resource/pci_enable_device instead trusting Maybe better to use pci_assign_resource/pci_enable_device instead trusting
the bridges? */ the bridges? */
if (!not_first_call && request_mem_region(aper, size, "aperture") < 0) { if (!aperture_resource &&
!(aperture_resource = request_mem_region(aper, size, "aperture"))) {
printk(KERN_ERR PFX "Aperture conflicts with PCI mapping.\n"); printk(KERN_ERR PFX "Aperture conflicts with PCI mapping.\n");
return 0; return 0;
} }
not_first_call = 1;
return 1; return 1;
} }
...@@ -357,11 +356,18 @@ static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr) ...@@ -357,11 +356,18 @@ static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
} }
hammers[i++] = loop_dev; hammers[i++] = loop_dev;
nr_garts = i; nr_garts = i;
if (i == MAX_HAMMER_GARTS) { #ifdef CONFIG_SMP
if (i > MAX_HAMMER_GARTS) {
printk(KERN_INFO PFX "Too many northbridges for AGP\n"); printk(KERN_INFO PFX "Too many northbridges for AGP\n");
return -1; return -1;
} }
#else
/* Uniprocessor case, return after finding first bridge.
(There may be more, but in UP, we don't care). */
return 0;
#endif
} }
return i == 0 ? -1 : 0; return i == 0 ? -1 : 0;
} }
...@@ -530,6 +536,8 @@ int __init agp_amd64_init(void) ...@@ -530,6 +536,8 @@ int __init agp_amd64_init(void)
static void __exit agp_amd64_cleanup(void) static void __exit agp_amd64_cleanup(void)
{ {
if (aperture_resource)
release_resource(aperture_resource);
pci_unregister_driver(&agp_amd64_pci_driver); pci_unregister_driver(&agp_amd64_pci_driver);
} }
......
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