Re: Problem with ioremap which returns NULL in 2.6 kernel

From: Markus Lidel
Date: Wed Jun 02 2004 - 08:46:07 EST


Hello,

Jeff Garzik wrote:
My preferred approach would be: consider that the hardware does not need the entire 0x8000000-byte area mapped. Plain and simple.
This is a "don't do that" situation, and that renders the other questions moot :) You should only be mapping what you need to map.
Okay, i'll let try it out with only 64MB.
Why do you need 64MB, even? :)

I don't know how much space i need :-D But why does the device set the size to 128MB then?

Also now both controllers where found, but the kernel crashes. It could be because the driver was never used with 2 controllers, but to be sure i didn't make something wrong with the ioremap here is my patch.

--- a/drivers/message/i2o/i2o_core.c 2004-05-25 00:51:48.822275000 +0200
+++ b/drivers/message/i2o/i2o_core.c 2004-06-01 22:17:55.562844312 +0200
@@ -3664,6 +3664,8 @@
}

size = dev->resource[i].end-dev->resource[i].start+1;
+ if(size>67108864)
+ size = 67108864;
/* Map the I2O controller */

printk(KERN_INFO "i2o: PCI I2O controller at 0x%08X size=%d\n", memptr, size);

mem = (unsigned long)ioremap(memptr, size);


Simply set size lower :-) Or have i missed something?

Thanks for you help!


Best regards,


Markus Lidel
------------------------------------------
Markus Lidel (Senior IT Consultant)

Shadow Connect GmbH
Carl-Reisch-Weg 12
D-86381 Krumbach
Germany

Phone: +49 82 82/99 51-0
Fax: +49 82 82/99 51-11

E-Mail: Markus.Lidel@xxxxxxxxxxxxxxxxx
URL: http://www.shadowconnect.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/