]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Alpha: UP1500 pci_mem fix
authorRichard Henderson <rth@twiddle.net>
Tue, 30 Mar 2004 08:53:09 +0000 (00:53 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 30 Mar 2004 08:53:09 +0000 (00:53 -0800)
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>

The memory reserved for PCI probe is not freed properly in some cases,
for instance with a 3.5Gb of RAM.

Forward port from 2.4.

arch/alpha/kernel/sys_nautilus.c

index 32bfb659fbfbb6bd27b7209cfa12c75f444b4b77..fcf04ed3b78b9b290be3ae3002eafc4a1effa15c 100644 (file)
@@ -225,11 +225,13 @@ nautilus_init_pci(void)
        if (request_resource(&iomem_resource, bus->resource[1]) < 0)
                printk(KERN_ERR "Failed to request MEM on hose 0\n");
 
-       if (pci_mem < memtop && pci_mem > alpha_mv.min_mem_address) {
+       if (pci_mem < memtop)
+               memtop = pci_mem;
+       if (memtop > alpha_mv.min_mem_address) {
                free_reserved_mem(__va(alpha_mv.min_mem_address),
-                                 __va(pci_mem));
+                                 __va(memtop));
                printk("nautilus_init_pci: %ldk freed\n",
-                       (pci_mem - alpha_mv.min_mem_address) >> 10);
+                       (memtop - alpha_mv.min_mem_address) >> 10);
        }
 
        if ((IRONGATE0->dev_vendor >> 16) > 0x7006)     /* Albacore? */