On Tue, Apr 03, 2012 at 06:39:22PM +1200, Alexey Korolev wrote:
Hi Kevin,
Thank you for the patches! I've created a diff of final version of your changes over mine, to make it clear what has changed.
Rather than including the complete diff, I've just left relevant parts and added comments.
Yes - there isn't much difference between your patches and my patches. I was really just playing with your patch.
Structure members naming was one of difficult things when I was writing the code. The child_bus might be a bit confusing as people may thing that it describes a child bus in the bus topology,in fact this element describes the bus this pci_region_entry is representing.
On Sunday, it occurred to me that we really don't need either parent_bus or this_bus.
+static int pci_size_to_index(u32 size, enum pci_region_type type)
[...]
The only purpose to have these functions is to define the minimum size of pci BAR. They are used only once. What if we add size adjustment to pci_region_create_entry, or just create a function like pci_adjust_size(u32 size, enum pci_region_type type, int bridge)?
Agreed - the only thing it does is force a minimum size for memory bars as you pointed out in a previous email.
As above, I did play with this a little more on Sunday. I also added in two patches from Gerd's series and made alignment handling more explicit. I'm including the series here if you're interested. Again, I think this should wait until after the 1.7.0 release.
-Kevin