Re: promise controller resource alloc problems with ~2.6.8

From: Linus Torvalds
Date: Sat Oct 09 2004 - 22:16:40 EST




On Sun, 10 Oct 2004, CaT wrote:
> >
> > That's really wrong. Hmm.. Can you enable debugging for the PCI resource
> > stuff? It's DEBUG_CONFIG in drivers/pci/setup-res.c, and DEBUG in
> > arch/i386/pci/pci.h, and now your dmesg should be a lot more verbose about
> > the bootup resources..
>
> I did this:
>
> ./setup-res.c:#define DEBUG_CONFIG 1
> ./pci.h:#define DEBUG
>
> dmesg attached.

Thanks. This is really _really_ confusing. Your dmesg clearly says:

PCI: Resource 44000000-47ffffff (f=1208, d=0, p=0)
PCI: Resource 000010f0-000010f7 (f=101, d=0, p=0)
PCI: Resource 00001800-00001803 (f=101, d=0, p=0)
PCI: Resource 000010f8-000010ff (f=101, d=0, p=0)
PCI: Resource 00001804-00001807 (f=101, d=0, p=0)
PCI: Resource 00001080-000010bf (f=101, d=0, p=0) *****
PCI: Resource 42000000-4201ffff (f=200, d=0, p=0)
PCI: Resource 00001000-0000107f (f=101, d=0, p=0)
PCI: Resource 40900000-4090007f (f=200, d=0, p=0)
PCI: Resource 00001400-000014ff (f=101, d=0, p=0)
PCI: Resource 42100000-421000ff (f=200, d=0, p=0)
PCI: Resource 000010a0-000010af (f=101, d=0, p=0) *****
PCI: Resource 41000000-41ffffff (f=1208, d=0, p=0)
PCI: Resource 40800000-40803fff (f=200, d=0, p=0)
PCI: Resource 40000000-407fffff (f=200, d=0, p=0)

note how the two resources I marked should have clashed, and if you had a
"request_resource()" in the loop that prints this out, then the code
_should_ have looked like this:

....
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) {
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;
r->start = 0;
....

ie _immediately_ after the thing that prints out the resource, you have a
"request_resource()" that should have _clashed_ with an earlier one,
dammit!

And "request_resource()" hasn't actually changed lately (insert_resource()
_did_ change), so I don't understand why it's now broken for you.

Can you add another DBG() statement to just after the

pr = pci_find_parent_resource(..)

line? One that proints out the parent resource, ie just something like

DBG("Parent resource: %08lx-%08lx (%lx)", pr->start, pr->end, pr->flags);

to see if the code somehow gets _really_ confused, and thinks that the
earlier clashing resource is actually the parent resource (it's definitely
not - the resource at 1080 is PCI device 0:0d.0, which is your promise IDE
controller).

I wonder if request_resource() is broken. "insert_resource()" had been
broken for a _loong_ time (since its inception), maybe
"request_resource()" also is. Hmm..

Greg, do you see something I've missed? I feel stupid.

Linus
-
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/