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

H. J. Lu
2002-08-27T19:29:52Z

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

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.

[-- Attachment #2: linux-2.4.18-yenta-resource.patch --]
[-- Type: text/plain, Size: 1004 bytes --]

--- 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);