"PCI: Cannot allocate resource region" error misleading (withpatch)

From: Kyle Rose
Date: Sat Nov 15 2003 - 14:46:43 EST


It turns out that this error typically indicates that the resource is
being remapped elsewhere, but no indication is given of the remapping,
leading the naive user (e.g., me) to believe no memory was mapped at
all. Perhaps a reasonable patch would be:

--- linux-2.6.0-test9/arch/i386/pci/i386.c.orig 2003-11-15 14:17:30.000000000 -0500
+++ linux-2.6.0-test9/arch/i386/pci/i386.c 2003-11-15 14:22:45.000000000 -0500
@@ -143,7 +143,7 @@
r->start, r->end, r->flags, disabled, pass);
pr = pci_find_parent_resource(dev, r);
if (!pr || request_resource(pr, r) < 0) {
- printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, pci_name(dev));
+ printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s (requested %08lx-%08lx); deferring reassignment\n", idx, pci_name(dev), r->start, r->end);
/* We'll assign a new address later */
r->end -= r->start;
r->start = 0;
@@ -192,8 +192,11 @@
* the BIOS forgot to do so or because we have decided the old
* address was unusable for some reason.
*/
- if (!r->start && r->end)
- pci_assign_resource(dev, idx);
+ if (!r->start && r->end) {
+ if (!pci_assign_resource(dev, idx)) {
+ printk(KERN_ERR "PCI: Reassigned region %d of device %s to %08lx-%08lx\n", idx, pci_name(dev), r->start, r->end);
+ }
+ }
}

if (pci_probe & PCI_ASSIGN_ROMS) {

Of course, I haven't come up with a solution to my original problem,
but I'm inclined the believe it originates with the nVidia
closed-source driver instead of with the kernel, since the open source
nv XFree86 driver doesn't exhibit the same set of problems (e.g., DVD
playback is fine), although its set of problems is likely to be at
least as large. If anyone has any leads or can offer any insight, it
would be greatly appreciated.

Cheers,
Kyle
-
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/