[parisc-linux-cvs] linux willy

Matthew Wilcox willy@debian.org
Tue, 28 May 2002 15:32:15 +0100


On Tue, May 28, 2002 at 08:28:28AM -0600, Matthew Wilcox wrote:
> fix a wrap-around bug in detecting whether ccio has been programmed to
> forward a port range or not.  Showed up in K-class firmware but not in
> C/J-class firmware.

Thanks to robbie for testing this fix.

diff -u -p -r1.53 ccio-dma.c
--- ccio-dma.c  2002/04/13 22:12:27     1.53
+++ ccio-dma.c  2002/05/28 14:13:09
@@ -1435,14 +1435,14 @@ ccio_init_resource(struct resource *res,
        res->flags = IORESOURCE_MEM;
        res->start = (unsigned long)(signed) __raw_readl(ioaddr) << 16;
        res->end = (unsigned long)(signed) (__raw_readl(ioaddr + 4) << 16) - 1;
-       if (res->end < res->start)
+       if (res->end + 1 == res->start)
                return;
        res->name = name;
        result = request_resource(&iomem_resource, res);
        if (result < 0) {
                printk(KERN_ERR 
-                      "%s: failed to claim CCIO bus address space!\n", 
-                      __FILE__);
+                      "%s: failed to claim CCIO bus address space (%p,%p)\n", 
+                      __FILE__, res->start, res->end);
        }
 }
 


-- 
Revolutions do not require corporate support.