Questions about ioport-assignments

Komuro komurojun-mbn at nifty.com
Sat Apr 17 21:11:41 EDT 2010


Hi,

>Hm, I don't get (yet) where you're heading to -- could you provide me with a
>patch and/or more extensive explanation?

OK. Here is the patch.

pci_bus_alloc_resource calls pcmcia_align with res->start=0xc000.
To avoid this , we need to call pcmcia_align manually.



--- linux-2.6.34-rc4-git4/drivers/pcmcia/rsrc_nonstatic.c.orig	2010-04-18 09:52:12.000000000 +0900
+++ linux-2.6.34-rc4-git4/drivers/pcmcia/rsrc_nonstatic.c	2010-04-18 09:56:09.000000000 +0900
@@ -697,6 +697,9 @@ static struct resource *nonstatic_find_i
 	struct pcmcia_align_data data;
 	unsigned long min = base;
 	int ret;
+#if defined(CONFIG_X86)
+	resource_size_t start;
+#endif
 
 	if (align == 0)
 		align = 0x10000;
@@ -705,6 +708,16 @@ static struct resource *nonstatic_find_i
 	data.offset = base & data.mask;
 	data.map = &s_data->io_db;
 
+#if defined(CONFIG_X86)
+	start = pcmcia_align(&data, res, num, align);
+
+	if (start) {
+		res->start = start;
+		res->end = start+num-1;
+		return res;
+	}
+#endif
+
 #ifdef CONFIG_PCI
 	if (s->cb_dev) {
 		ret = pci_bus_alloc_resource(s->cb_dev->bus, res, num, 1,



More information about the linux-pcmcia mailing list