Re: [BK PATCH] I2C update for 2.6.8-rc1

From: Linus Torvalds
Date: Tue Aug 24 2004 - 19:39:46 EST




On Tue, 24 Aug 2004, Greg KH wrote:
>
> If someone can come up with a patch that works for everyone, I'll be
> glad to apply it.

Hmm.. Why exactly does the PCI layer re-locate the IO ports?

Afaik, ACPI requesting the region shouldn't matter. The
"request_resource()" should still be happy..

Ahh. I see the problem. Because the ACPI code allocates the sub-resources,
the request_resource thing is indeed not happy.

How about this _trivial_ change? Does that fix things for you guys? Can
you send the /proc/ioport output if this works out for you, just so that
we can see?

(The difference between "request_resource()" and "insert_resource()" is
that the latter accepts pre-existing sub-resources that the firmware might
have allocated within the resource we have..)

Linus

===== arch/i386/pci/i386.c 1.16 vs edited =====
--- 1.16/arch/i386/pci/i386.c 2003-07-31 16:47:19 -07:00
+++ edited/arch/i386/pci/i386.c 2004-08-24 17:36:10 -07:00
@@ -142,7 +142,7 @@
DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",
r->start, r->end, r->flags, disabled, pass);
pr = pci_find_parent_resource(dev, r);
- if (!pr || request_resource(pr, r) < 0) {
+ if (!pr || insert_resource(pr, r) < 0) {
printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev));
/* We'll assign a new address later */
r->end -= r->start;
-
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/