Re: [Fwd: [PATCH] reduce size of bridge regions for yenta.c]

H. J. Lu (hjl@lucon.org)
Tue, 27 Aug 2002 12:34:01 -0700


--cWoXeonUoKmBZSoM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Aug 25, 2002 at 06:37:14PM +0200, Manfred Spraul wrote:
>
> yenta.c doesn't contain error handling, and that should be fixed.
>

This is what I have been using.

H.J.

--cWoXeonUoKmBZSoM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="linux-2.4.18-yenta-resource.patch"

--- linux/drivers/pcmcia/yenta.c.resource Sat Aug 10 20:30:35 2002
+++ linux/drivers/pcmcia/yenta.c Fri Aug 16 09:34:32 2002
@@ -739,17 +739,27 @@ static void yenta_allocate_res(pci_socke
return;
}

- align = size = 4*1024*1024;
- min = PCIBIOS_MIN_MEM; max = ~0U;
if (type & IORESOURCE_IO) {
align = 1024;
size = 256;
min = 0x4000;
max = 0xffff;
}
+ else {
+ align = size = 4*1024*1024;
+ min = PCIBIOS_MIN_MEM;
+ max = ~0U;
+ }

- if (allocate_resource(root, res, size, min, max, align, NULL, NULL) < 0)
+
+ if (allocate_resource(root, res, size, min, max, align, NULL, NULL) < 0) {
+ printk (KERN_NOTICE "PCI: CardBus bridge (%04x:%04x, %04x:%04x): Failed to allocate %s resource: %d bytes!\n",
+ socket->dev->vendor, socket->dev->device,
+ socket->dev->subsystem_vendor,
+ socket->dev->subsystem_device,
+ (type & IORESOURCE_IO) ? "I/O" : "memory", size);
return;
+ }

config_writel(socket, offset, res->start);
config_writel(socket, offset+4, res->end);

--cWoXeonUoKmBZSoM--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/