[lkml]   [2003]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectPCI resource allocation bug
Could someone tell me if this is a bug, or if this should
be used in a different manner? I am using
pci_assign_resource(dev, 7);
dev->resource[7].start = 0
dev->resource[7].end = size to allocate
dev->resource[7].flags = IORESOURCE_MEM

In pci_assign_resource, 'min' gets assigned to PCIBIOS_MIN_MEM
(all that is important here is that it is not 0).
Also, 'align' gets assigned to 'res->start' (resource[7].start
from above). which is 0.

This routine calls allocate_resource, which calls find_resource,
in which we find that new->start (again resource[7].start above)
gets set to min. Then, there is the fateful line:
new->start = (new->start + align - 1) & ~(align - 1);
Since we know that align = 0, then ~(align-1) = 0, thus
new->start get assigned 0 again. This doesn't work, it
should be left to be min.

In kernel 2.4.18, the align variable was set to size, and thus
this all works. I can get it to be set to size again by using
resource 6 instead of 7, but I don't think that is the correct
solution here.

I would propose a patch, but I'm not sure what the intent here

Could responses please be CC'd to me?

S. Baker

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:48    [W:0.043 / U:1.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site