Commit 1e8b36cc authored by Markus Lidel's avatar Markus Lidel Committed by Linus Torvalds

[PATCH] reduce ioremap memory size for Adaptec I2O controllers

The I2O subsystem currently map all memory from the I2O controller for the
controller's in queue, even if it is not necessary.  This is a problem,
because on some systems the size returned from pci_resource_len() could be
128MB and only 1-4MB is needed.

Changes:

- only ioremap as much memory as the controller is actually using.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 25c407de
......@@ -133,6 +133,21 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c)
if (!c->base.phys) {
c->base.phys = pci_resource_start(pdev, i);
c->base.len = pci_resource_len(pdev, i);
/*
* If we know what card it is, set the size
* correctly. Code is taken from dpt_i2o.c
*/
if(pdev->device == 0xa501) {
if(pdev->subsystem_device >= 0xc032 &&
pdev->subsystem_device <= 0xc03b) {
if(c->base.len > 0x400000)
c->base.len = 0x400000;
} else {
if(c->base.len > 0x100000)
c->base.len = 0x100000;
}
}
if (!c->raptor)
break;
} else {
......
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