[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 05/11] device tree: add device_tree_for_each_node()

On 22/03/12 11:12, Ian Campbell wrote:
> On Mon, 2012-03-19 at 17:52 +0000, David Vrabel wrote:
>> +    for ( node = 0, depth = 0;
>> +          node >=0 && depth >= 0;
>> +          node = fdt_next_node(fdt, node, &depth) )
>> +    {
>> +        if ( depth >= MAX_DEPTH )
>> +            continue;
> Perhaps we should fail and return an error here (which the caller can
> log with whatever facilities are available, e.g. early_printk or
> printk)? Silently just not walking a bit of the tree seem liable to lead
> to odd errors...

Not sure about making it an error.  May be best to make it a warning as
at least in the early scan we want to try as hard as possible to get the
memory and console info so we have a better chance of printing a diagnostic.

I'm post a separate patch for this later because: a) it's unlikely a
device tree will have a depth of more than 16 (the current device tree
for the model is only 5 levels deep); and b) there is a test and a
warning message when generating dom0's device tree (so unless your
console and memory is 16 nodes deep you'll get a message).


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.