From 44a7185c2ae6383c88ff5b1ef2e2969f35d7b8b7 Mon Sep 17 00:00:00 2001 From: Kefeng Wang Date: Wed, 1 Jun 2016 14:52:54 +0800 Subject: of/platform: Add common method to populate default bus The arch code calls of_platform_populate() with default match table when it wants to populate default bus. This patch introduce a new of_platform_default_populate_init() and make it arch_initcall_sync(it should be later than some iommu configration, eg, of_iommu_init() and swiotlb_late_init in arm64), then we can finish above job in common method. In order to avoid the default bus being populated twice, simply checking the flag of bus node whether has be set OF_POPULATED_BUS or not. After that, we can safely remove the caller in arch code. Btw, add debug print in of_platform_populate(), and use __func__ to print function's name of of_platform_bus_create(). Cc: Rob Herring Cc: Frank Rowand Cc: Grant Likely Signed-off-by: Kefeng Wang Signed-off-by: Rob Herring --- drivers/of/platform.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'drivers/of') diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 16e8daffac06..c559ef81b07a 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -363,6 +363,12 @@ static int of_platform_bus_create(struct device_node *bus, return 0; } + if (of_node_check_flag(bus, OF_POPULATED_BUS)) { + pr_debug("%s() - skipping %s, already populated\n", + __func__, bus->full_name); + return 0; + } + auxdata = of_dev_lookup(lookup, bus); if (auxdata) { bus_id = auxdata->name; @@ -414,7 +420,7 @@ int of_platform_bus_probe(struct device_node *root, if (!root) return -EINVAL; - pr_debug("of_platform_bus_probe()\n"); + pr_debug("%s()\n", __func__); pr_debug(" starting at: %s\n", root->full_name); /* Do a self check of bus type, if there's a match, create children */ @@ -466,6 +472,9 @@ int of_platform_populate(struct device_node *root, if (!root) return -EINVAL; + pr_debug("%s()\n", __func__); + pr_debug(" starting at: %s\n", root->full_name); + for_each_child_of_node(root, child) { rc = of_platform_bus_create(child, matches, lookup, parent, true); if (rc) { @@ -489,6 +498,15 @@ int of_platform_default_populate(struct device_node *root, } EXPORT_SYMBOL_GPL(of_platform_default_populate); +static int __init of_platform_default_populate_init(void) +{ + if (of_have_populated_dt()) + of_platform_default_populate(NULL, NULL, NULL); + + return 0; +} +arch_initcall_sync(of_platform_default_populate_init); + static int of_platform_device_destroy(struct device *dev, void *data) { /* Do not touch devices not populated from the device tree */ -- cgit v1.2.3 From 146dedbcabd89461faaa85a82e50b2fdd6b24683 Mon Sep 17 00:00:00 2001 From: Kefeng Wang Date: Wed, 1 Jun 2016 14:53:10 +0800 Subject: of: unittest: use of_platform_default_populate() to populate default bus Use helper of_platform_default_populate() in linux/of_platform when possible, instead of calling of_platform_populate() with the default match table. Cc: Rob Herring Cc: Frank Rowand Cc: Grant Likely Signed-off-by: Kefeng Wang Signed-off-by: Rob Herring --- drivers/of/unittest.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/of') diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index f34ed9310323..53c83d66eb7e 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -771,7 +771,7 @@ static void __init of_unittest_platform_populate(void) }; np = of_find_node_by_path("/testcase-data"); - of_platform_populate(np, of_default_bus_match_table, NULL, NULL); + of_platform_default_populate(np, NULL, NULL); /* Test that a missing irq domain returns -EPROBE_DEFER */ np = of_find_node_by_path("/testcase-data/testcase-device1"); @@ -1871,8 +1871,7 @@ static void __init of_unittest_overlay(void) goto out; } - ret = of_platform_populate(bus_np, of_default_bus_match_table, - NULL, NULL); + ret = of_platform_default_populate(bus_np, NULL, NULL); if (ret != 0) { unittest(0, "could not populate bus @ \"%s\"\n", bus_path); goto out; -- cgit v1.2.3 From e1bcbee6f95301197e1039b4e4104cbdc4a332a6 Mon Sep 17 00:00:00 2001 From: Kefeng Wang Date: Wed, 1 Jun 2016 14:53:11 +0800 Subject: Revert "of/platform: export of_default_bus_match_table" This reverts commit b80443c2211c7daaabd20fbbe9e7beb3fa3408e0. After covering to use helper of_platform_default_populate() to populate the default bus, no need to export of_default_bus_match_table anymore. Reviewed-by: Masahiro Yamada Cc: Masahiro Yamada Cc: Rob Herring Cc: Frank Rowand Cc: Grant Likely Signed-off-by: Kefeng Wang Signed-off-by: Rob Herring --- drivers/of/platform.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/of') diff --git a/drivers/of/platform.c b/drivers/of/platform.c index c559ef81b07a..153dbe172295 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -31,7 +31,6 @@ const struct of_device_id of_default_bus_match_table[] = { #endif /* CONFIG_ARM_AMBA */ {} /* Empty terminated list */ }; -EXPORT_SYMBOL(of_default_bus_match_table); static int of_dev_node_match(struct device *dev, void *data) { -- cgit v1.2.3 From d9fc880723321dbf16b2981e3f3e916b73942210 Mon Sep 17 00:00:00 2001 From: Frank Rowand Date: Thu, 16 Jun 2016 10:51:46 -0700 Subject: of: fix memory leak related to safe_name() Fix a memory leak resulting from memory allocation in safe_name(). This patch fixes all call sites of safe_name(). Mathieu Malaterre reported the memory leak on boot: On my PowerMac device-tree would generate a duplicate name: [ 0.023043] device-tree: Duplicate name in PowerPC,G4@0, renamed to "l2-cache#1" in this case a newly allocated name is generated by `safe_name`. However in this case it is never deallocated. The bug was found using kmemleak reported as: unreferenced object 0xdf532e60 (size 32): comm "swapper", pid 1, jiffies 4294892300 (age 1993.532s) hex dump (first 32 bytes): 6c 32 2d 63 61 63 68 65 23 31 00 dd e4 dd 1e c2 l2-cache#1...... ec d4 ba ce 04 ec cc de 8e 85 e9 ca c4 ec cc 9e ................ backtrace: [] kvasprintf+0x64/0xc8 [] kasprintf+0x4c/0x5c [] safe_name.isra.1+0x80/0xc4 [] __of_attach_node_sysfs+0x6c/0x11c [] of_core_init+0x8c/0xf8 [] kernel_init_freeable+0xd4/0x208 [] kernel_init+0x24/0x11c [] ret_from_kernel_thread+0x5c/0x64 Link: https://bugzilla.kernel.org/show_bug.cgi?id=120331 Signed-off-by: Frank Rowand Reported-by: mathieu.malaterre@gmail.com Tested-by: Mathieu Malaterre Cc: stable@vger.kernel.org Signed-off-by: Rob Herring --- drivers/of/base.c | 30 +++++++++++++++++++++--------- drivers/of/dynamic.c | 2 +- drivers/of/of_private.h | 3 +++ 3 files changed, 25 insertions(+), 10 deletions(-) (limited to 'drivers/of') diff --git a/drivers/of/base.c b/drivers/of/base.c index ebf84e3b56d5..8bb3d1adf1b0 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -112,6 +112,7 @@ static ssize_t of_node_property_read(struct file *filp, struct kobject *kobj, return memory_read_from_buffer(buf, count, &offset, pp->value, pp->length); } +/* always return newly allocated name, caller must free after use */ static const char *safe_name(struct kobject *kobj, const char *orig_name) { const char *name = orig_name; @@ -126,9 +127,12 @@ static const char *safe_name(struct kobject *kobj, const char *orig_name) name = kasprintf(GFP_KERNEL, "%s#%i", orig_name, ++i); } - if (name != orig_name) + if (name == orig_name) { + name = kstrdup(orig_name, GFP_KERNEL); + } else { pr_warn("device-tree: Duplicate name in %s, renamed to \"%s\"\n", kobject_name(kobj), name); + } return name; } @@ -159,6 +163,7 @@ int __of_add_property_sysfs(struct device_node *np, struct property *pp) int __of_attach_node_sysfs(struct device_node *np) { const char *name; + struct kobject *parent; struct property *pp; int rc; @@ -171,15 +176,16 @@ int __of_attach_node_sysfs(struct device_node *np) np->kobj.kset = of_kset; if (!np->parent) { /* Nodes without parents are new top level trees */ - rc = kobject_add(&np->kobj, NULL, "%s", - safe_name(&of_kset->kobj, "base")); + name = safe_name(&of_kset->kobj, "base"); + parent = NULL; } else { name = safe_name(&np->parent->kobj, kbasename(np->full_name)); - if (!name || !name[0]) - return -EINVAL; - - rc = kobject_add(&np->kobj, &np->parent->kobj, "%s", name); + parent = &np->parent->kobj; } + if (!name) + return -ENOMEM; + rc = kobject_add(&np->kobj, parent, "%s", name); + kfree(name); if (rc) return rc; @@ -1815,6 +1821,12 @@ int __of_remove_property(struct device_node *np, struct property *prop) return 0; } +void __of_sysfs_remove_bin_file(struct device_node *np, struct property *prop) +{ + sysfs_remove_bin_file(&np->kobj, &prop->attr); + kfree(prop->attr.attr.name); +} + void __of_remove_property_sysfs(struct device_node *np, struct property *prop) { if (!IS_ENABLED(CONFIG_SYSFS)) @@ -1822,7 +1834,7 @@ void __of_remove_property_sysfs(struct device_node *np, struct property *prop) /* at early boot, bail here and defer setup to of_init() */ if (of_kset && of_node_is_attached(np)) - sysfs_remove_bin_file(&np->kobj, &prop->attr); + __of_sysfs_remove_bin_file(np, prop); } /** @@ -1895,7 +1907,7 @@ void __of_update_property_sysfs(struct device_node *np, struct property *newprop return; if (oldprop) - sysfs_remove_bin_file(&np->kobj, &oldprop->attr); + __of_sysfs_remove_bin_file(np, oldprop); __of_add_property_sysfs(np, newprop); } diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index 3033fa3250dc..a2015599ed7e 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -55,7 +55,7 @@ void __of_detach_node_sysfs(struct device_node *np) /* only remove properties if on sysfs */ if (of_node_is_attached(np)) { for_each_property_of_node(np, pp) - sysfs_remove_bin_file(&np->kobj, &pp->attr); + __of_sysfs_remove_bin_file(np, pp); kobject_del(&np->kobj); } diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index 829469faeb23..18bbb4517e25 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -83,6 +83,9 @@ extern int __of_attach_node_sysfs(struct device_node *np); extern void __of_detach_node(struct device_node *np); extern void __of_detach_node_sysfs(struct device_node *np); +extern void __of_sysfs_remove_bin_file(struct device_node *np, + struct property *prop); + /* iterators for transactions, used for overlays */ /* forward iterator */ #define for_each_transaction_entry(_oft, _te) \ -- cgit v1.2.3 From 15cc2ed6dcf91a8658e084be4e140147161819d7 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 20 Jun 2016 14:49:18 +0100 Subject: of/irq: Mark initialised interrupt controllers as populated For interrupt controllers successfully initialised early via device-tree, mark these interrupt controllers as populated so we don't unnecessarily create a device and populate any platform data later on in the boot sequence when we populate all the various platform devices. Signed-off-by: Jon Hunter Signed-off-by: Rob Herring --- drivers/of/irq.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/of') diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 6ec743faabe8..1b58cd574316 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -557,6 +557,8 @@ void __init of_irq_init(const struct of_device_id *matches) * its children can get processed in a subsequent pass. */ list_add_tail(&desc->list, &intc_parent_list); + + of_node_set_flag(desc->dev, OF_POPULATED); } /* Get the next pending parent that might have children */ -- cgit v1.2.3 From 606ad42aa3b1fe8bb122305bef5aea79a6cef54b Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 15 Jun 2016 08:32:18 -0500 Subject: of: use pr_fmt prefix for all console printing Clean-up all the DT printk functions to use common pr_fmt prefix. Some print statements such as kmalloc errors were redundant, so just drop those. Cc: Frank Rowand Cc: Pantelis Antoniou Reviewed-by: Frank Rowand Signed-off-by: Rob Herring --- drivers/of/address.c | 49 ++++++++++++++++++++++---------------------- drivers/of/base.c | 11 ++++++---- drivers/of/dynamic.c | 47 +++++++++++++++++++++--------------------- drivers/of/fdt.c | 12 +++++------ drivers/of/fdt_address.c | 35 ++++++++++++++++--------------- drivers/of/irq.c | 2 ++ drivers/of/of_pci.c | 6 ++++-- drivers/of/of_reserved_mem.c | 22 ++++++++++---------- drivers/of/overlay.c | 43 +++++++++++++++----------------------- drivers/of/platform.c | 16 +++++++-------- drivers/of/resolver.c | 2 ++ 11 files changed, 124 insertions(+), 121 deletions(-) (limited to 'drivers/of') diff --git a/drivers/of/address.c b/drivers/of/address.c index 0a553c084a81..02b2903fe9d2 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -1,4 +1,6 @@ +#define pr_fmt(fmt) "OF: " fmt + #include #include #include @@ -24,10 +26,10 @@ static int __of_address_to_resource(struct device_node *dev, #ifdef DEBUG static void of_dump_addr(const char *s, const __be32 *addr, int na) { - printk(KERN_DEBUG "%s", s); + pr_debug("%s", s); while (na--) - printk(" %08x", be32_to_cpu(*(addr++))); - printk("\n"); + pr_cont(" %08x", be32_to_cpu(*(addr++))); + pr_cont("\n"); } #else static void of_dump_addr(const char *s, const __be32 *addr, int na) { } @@ -68,7 +70,7 @@ static u64 of_bus_default_map(__be32 *addr, const __be32 *range, s = of_read_number(range + na + pna, ns); da = of_read_number(addr, na); - pr_debug("OF: default map, cp=%llx, s=%llx, da=%llx\n", + pr_debug("default map, cp=%llx, s=%llx, da=%llx\n", (unsigned long long)cp, (unsigned long long)s, (unsigned long long)da); @@ -156,7 +158,7 @@ static u64 of_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns, s = of_read_number(range + na + pna, ns); da = of_read_number(addr + 1, na - 1); - pr_debug("OF: PCI map, cp=%llx, s=%llx, da=%llx\n", + pr_debug("PCI map, cp=%llx, s=%llx, da=%llx\n", (unsigned long long)cp, (unsigned long long)s, (unsigned long long)da); @@ -381,7 +383,7 @@ static u64 of_bus_isa_map(__be32 *addr, const __be32 *range, int na, int ns, s = of_read_number(range + na + pna, ns); da = of_read_number(addr + 1, na - 1); - pr_debug("OF: ISA map, cp=%llx, s=%llx, da=%llx\n", + pr_debug("ISA map, cp=%llx, s=%llx, da=%llx\n", (unsigned long long)cp, (unsigned long long)s, (unsigned long long)da); @@ -504,17 +506,17 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus, */ ranges = of_get_property(parent, rprop, &rlen); if (ranges == NULL && !of_empty_ranges_quirk(parent)) { - pr_debug("OF: no ranges; cannot translate\n"); + pr_debug("no ranges; cannot translate\n"); return 1; } if (ranges == NULL || rlen == 0) { offset = of_read_number(addr, na); memset(addr, 0, pna * 4); - pr_debug("OF: empty ranges; 1:1 translation\n"); + pr_debug("empty ranges; 1:1 translation\n"); goto finish; } - pr_debug("OF: walking ranges...\n"); + pr_debug("walking ranges...\n"); /* Now walk through the ranges */ rlen /= 4; @@ -525,14 +527,14 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus, break; } if (offset == OF_BAD_ADDR) { - pr_debug("OF: not found !\n"); + pr_debug("not found !\n"); return 1; } memcpy(addr, ranges + na, 4 * pna); finish: - of_dump_addr("OF: parent translation for:", addr, pna); - pr_debug("OF: with offset: %llx\n", (unsigned long long)offset); + of_dump_addr("parent translation for:", addr, pna); + pr_debug("with offset: %llx\n", (unsigned long long)offset); /* Translate it into parent bus space */ return pbus->translate(addr, offset, pna); @@ -557,7 +559,7 @@ static u64 __of_translate_address(struct device_node *dev, int na, ns, pna, pns; u64 result = OF_BAD_ADDR; - pr_debug("OF: ** translation for device %s **\n", of_node_full_name(dev)); + pr_debug("** translation for device %s **\n", of_node_full_name(dev)); /* Increase refcount at current level */ of_node_get(dev); @@ -571,14 +573,14 @@ static u64 __of_translate_address(struct device_node *dev, /* Count address cells & copy address locally */ bus->count_cells(dev, &na, &ns); if (!OF_CHECK_COUNTS(na, ns)) { - pr_debug("OF: Bad cell count for %s\n", of_node_full_name(dev)); + pr_debug("Bad cell count for %s\n", of_node_full_name(dev)); goto bail; } memcpy(addr, in_addr, na * 4); - pr_debug("OF: bus is %s (na=%d, ns=%d) on %s\n", + pr_debug("bus is %s (na=%d, ns=%d) on %s\n", bus->name, na, ns, of_node_full_name(parent)); - of_dump_addr("OF: translating address:", addr, na); + of_dump_addr("translating address:", addr, na); /* Translate */ for (;;) { @@ -589,7 +591,7 @@ static u64 __of_translate_address(struct device_node *dev, /* If root, we have finished */ if (parent == NULL) { - pr_debug("OF: reached root node\n"); + pr_debug("reached root node\n"); result = of_read_number(addr, na); break; } @@ -598,12 +600,12 @@ static u64 __of_translate_address(struct device_node *dev, pbus = of_match_bus(parent); pbus->count_cells(dev, &pna, &pns); if (!OF_CHECK_COUNTS(pna, pns)) { - pr_err("prom_parse: Bad cell count for %s\n", + pr_err("Bad cell count for %s\n", of_node_full_name(dev)); break; } - pr_debug("OF: parent bus is %s (na=%d, ns=%d) on %s\n", + pr_debug("parent bus is %s (na=%d, ns=%d) on %s\n", pbus->name, pna, pns, of_node_full_name(parent)); /* Apply bus translation */ @@ -615,7 +617,7 @@ static u64 __of_translate_address(struct device_node *dev, ns = pns; bus = pbus; - of_dump_addr("OF: one level translation:", addr, na); + of_dump_addr("one level translation:", addr, na); } bail: of_node_put(parent); @@ -853,8 +855,7 @@ int of_dma_get_range(struct device_node *np, u64 *dma_addr, u64 *paddr, u64 *siz } if (!ranges) { - pr_debug("%s: no dma-ranges found for node(%s)\n", - __func__, np->full_name); + pr_debug("no dma-ranges found for node(%s)\n", np->full_name); ret = -ENODEV; goto out; } @@ -871,8 +872,8 @@ int of_dma_get_range(struct device_node *np, u64 *dma_addr, u64 *paddr, u64 *siz dmaaddr = of_read_number(ranges, naddr); *paddr = of_translate_dma_address(np, ranges); if (*paddr == OF_BAD_ADDR) { - pr_err("%s: translation of DMA address(%pad) to CPU address failed node(%s)\n", - __func__, dma_addr, np->full_name); + pr_err("translation of DMA address(%pad) to CPU address failed node(%s)\n", + dma_addr, np->full_name); ret = -EINVAL; goto out; } diff --git a/drivers/of/base.c b/drivers/of/base.c index 8bb3d1adf1b0..a4b608776c73 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -17,6 +17,9 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ + +#define pr_fmt(fmt) "OF: " fmt + #include #include #include @@ -130,7 +133,7 @@ static const char *safe_name(struct kobject *kobj, const char *orig_name) if (name == orig_name) { name = kstrdup(orig_name, GFP_KERNEL); } else { - pr_warn("device-tree: Duplicate name in %s, renamed to \"%s\"\n", + pr_warn("Duplicate name in %s, renamed to \"%s\"\n", kobject_name(kobj), name); } return name; @@ -204,7 +207,7 @@ void __init of_core_init(void) of_kset = kset_create_and_add("devicetree", NULL, firmware_kobj); if (!of_kset) { mutex_unlock(&of_mutex); - pr_err("devicetree: failed to register existing nodes\n"); + pr_err("failed to register existing nodes\n"); return; } for_each_of_allnodes(np) @@ -2269,8 +2272,8 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, of_node_put(node); if (!port) { - pr_err("%s(): no port node found in %s\n", - __func__, parent->full_name); + pr_err("graph: no port node found in %s\n", + parent->full_name); return NULL; } } else { diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index a2015599ed7e..888fdbc09992 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -6,6 +6,8 @@ * device tree nodes. */ +#define pr_fmt(fmt) "OF: " fmt + #include #include #include @@ -96,13 +98,13 @@ int of_reconfig_notify(unsigned long action, struct of_reconfig_data *p) switch (action) { case OF_RECONFIG_ATTACH_NODE: case OF_RECONFIG_DETACH_NODE: - pr_debug("of/notify %-15s %s\n", action_names[action], + pr_debug("notify %-15s %s\n", action_names[action], pr->dn->full_name); break; case OF_RECONFIG_ADD_PROPERTY: case OF_RECONFIG_REMOVE_PROPERTY: case OF_RECONFIG_UPDATE_PROPERTY: - pr_debug("of/notify %-15s %s:%s\n", action_names[action], + pr_debug("notify %-15s %s:%s\n", action_names[action], pr->dn->full_name, pr->prop->name); break; @@ -460,12 +462,12 @@ static void __of_changeset_entry_dump(struct of_changeset_entry *ce) case OF_RECONFIG_ADD_PROPERTY: case OF_RECONFIG_REMOVE_PROPERTY: case OF_RECONFIG_UPDATE_PROPERTY: - pr_debug("of/cset<%p> %-15s %s/%s\n", ce, action_names[ce->action], + pr_debug("cset<%p> %-15s %s/%s\n", ce, action_names[ce->action], ce->np->full_name, ce->prop->name); break; case OF_RECONFIG_ATTACH_NODE: case OF_RECONFIG_DETACH_NODE: - pr_debug("of/cset<%p> %-15s %s\n", ce, action_names[ce->action], + pr_debug("cset<%p> %-15s %s\n", ce, action_names[ce->action], ce->np->full_name); break; } @@ -531,13 +533,13 @@ static void __of_changeset_entry_notify(struct of_changeset_entry *ce, bool reve ret = of_property_notify(ce->action, ce->np, ce->prop, ce->old_prop); break; default: - pr_err("%s: invalid devicetree changeset action: %i\n", __func__, + pr_err("invalid devicetree changeset action: %i\n", (int)ce->action); return; } if (ret) - pr_err("%s: notifier error @%s\n", __func__, ce->np->full_name); + pr_err("changeset notifier error @%s\n", ce->np->full_name); } static int __of_changeset_entry_apply(struct of_changeset_entry *ce) @@ -568,8 +570,8 @@ static int __of_changeset_entry_apply(struct of_changeset_entry *ce) ret = __of_add_property(ce->np, ce->prop); if (ret) { - pr_err("%s: add_property failed @%s/%s\n", - __func__, ce->np->full_name, + pr_err("changeset: add_property failed @%s/%s\n", + ce->np->full_name, ce->prop->name); break; } @@ -577,8 +579,8 @@ static int __of_changeset_entry_apply(struct of_changeset_entry *ce) case OF_RECONFIG_REMOVE_PROPERTY: ret = __of_remove_property(ce->np, ce->prop); if (ret) { - pr_err("%s: remove_property failed @%s/%s\n", - __func__, ce->np->full_name, + pr_err("changeset: remove_property failed @%s/%s\n", + ce->np->full_name, ce->prop->name); break; } @@ -596,8 +598,8 @@ static int __of_changeset_entry_apply(struct of_changeset_entry *ce) ret = __of_update_property(ce->np, ce->prop, &old_prop); if (ret) { - pr_err("%s: update_property failed @%s/%s\n", - __func__, ce->np->full_name, + pr_err("changeset: update_property failed @%s/%s\n", + ce->np->full_name, ce->prop->name); break; } @@ -677,24 +679,24 @@ int __of_changeset_apply(struct of_changeset *ocs) int ret; /* perform the rest of the work */ - pr_debug("of_changeset: applying...\n"); + pr_debug("changeset: applying...\n"); list_for_each_entry(ce, &ocs->entries, node) { ret = __of_changeset_entry_apply(ce); if (ret) { - pr_err("%s: Error applying changeset (%d)\n", __func__, ret); + pr_err("Error applying changeset (%d)\n", ret); list_for_each_entry_continue_reverse(ce, &ocs->entries, node) __of_changeset_entry_revert(ce); return ret; } } - pr_debug("of_changeset: applied, emitting notifiers.\n"); + pr_debug("changeset: applied, emitting notifiers.\n"); /* drop the global lock while emitting notifiers */ mutex_unlock(&of_mutex); list_for_each_entry(ce, &ocs->entries, node) __of_changeset_entry_notify(ce, 0); mutex_lock(&of_mutex); - pr_debug("of_changeset: notifiers sent.\n"); + pr_debug("changeset: notifiers sent.\n"); return 0; } @@ -728,24 +730,24 @@ int __of_changeset_revert(struct of_changeset *ocs) struct of_changeset_entry *ce; int ret; - pr_debug("of_changeset: reverting...\n"); + pr_debug("changeset: reverting...\n"); list_for_each_entry_reverse(ce, &ocs->entries, node) { ret = __of_changeset_entry_revert(ce); if (ret) { - pr_err("%s: Error reverting changeset (%d)\n", __func__, ret); + pr_err("Error reverting changeset (%d)\n", ret); list_for_each_entry_continue(ce, &ocs->entries, node) __of_changeset_entry_apply(ce); return ret; } } - pr_debug("of_changeset: reverted, emitting notifiers.\n"); + pr_debug("changeset: reverted, emitting notifiers.\n"); /* drop the global lock while emitting notifiers */ mutex_unlock(&of_mutex); list_for_each_entry_reverse(ce, &ocs->entries, node) __of_changeset_entry_notify(ce, 1); mutex_lock(&of_mutex); - pr_debug("of_changeset: notifiers sent.\n"); + pr_debug("changeset: notifiers sent.\n"); return 0; } @@ -795,10 +797,9 @@ int of_changeset_action(struct of_changeset *ocs, unsigned long action, struct of_changeset_entry *ce; ce = kzalloc(sizeof(*ce), GFP_KERNEL); - if (!ce) { - pr_err("%s: Failed to allocate\n", __func__); + if (!ce) return -ENOMEM; - } + /* get a reference to the node */ ce->action = action; ce->np = of_node_get(np); diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 33daffc4392c..a0a7b76be381 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -9,6 +9,8 @@ * version 2 as published by the Free Software Foundation. */ +#define pr_fmt(fmt) "OF: fdt:" fmt + #include #include #include @@ -182,14 +184,12 @@ static void populate_properties(const void *blob, val = fdt_getprop_by_offset(blob, cur, &pname, &sz); if (!val) { - pr_warn("%s: Cannot locate property at 0x%x\n", - __func__, cur); + pr_warn("Cannot locate property at 0x%x\n", cur); continue; } if (!pname) { - pr_warn("%s: Cannot find property name at 0x%x\n", - __func__, cur); + pr_warn("Cannot find property name at 0x%x\n", cur); continue; } @@ -439,7 +439,7 @@ static int unflatten_dt_nodes(const void *blob, } if (offset < 0 && offset != -FDT_ERR_NOTFOUND) { - pr_err("%s: Error %d processing FDT\n", __func__, offset); + pr_err("Error %d processing FDT\n", offset); return -EINVAL; } @@ -1281,7 +1281,7 @@ static int __init of_fdt_raw_init(void) if (of_fdt_crc32 != crc32_be(~0, initial_boot_params, fdt_totalsize(initial_boot_params))) { - pr_warn("fdt: not creating '/sys/firmware/fdt': CRC check failed\n"); + pr_warn("not creating '/sys/firmware/fdt': CRC check failed\n"); return 0; } of_fdt_raw_attr.size = fdt_totalsize(initial_boot_params); diff --git a/drivers/of/fdt_address.c b/drivers/of/fdt_address.c index dca8f9b93745..843a542dac7d 100644 --- a/drivers/of/fdt_address.c +++ b/drivers/of/fdt_address.c @@ -12,6 +12,9 @@ * the Free Software Foundation; either version 2, or (at your option) * any later version. */ + +#define pr_fmt(fmt) "OF: fdt: " fmt + #include #include #include @@ -30,7 +33,7 @@ static void __init of_dump_addr(const char *s, const __be32 *addr, int na) pr_debug("%s", s); while(na--) pr_cont(" %08x", *(addr++)); - pr_debug("\n"); + pr_cont("\n"); } #else static void __init of_dump_addr(const char *s, const __be32 *addr, int na) { } @@ -77,7 +80,7 @@ static u64 __init fdt_bus_default_map(__be32 *addr, const __be32 *range, s = of_read_number(range + na + pna, ns); da = of_read_number(addr, na); - pr_debug("FDT: default map, cp=%llx, s=%llx, da=%llx\n", + pr_debug("default map, cp=%llx, s=%llx, da=%llx\n", cp, s, da); if (da < cp || da >= (cp + s)) @@ -123,11 +126,11 @@ static int __init fdt_translate_one(const void *blob, int parent, if (rlen == 0) { offset = of_read_number(addr, na); memset(addr, 0, pna * 4); - pr_debug("FDT: empty ranges, 1:1 translation\n"); + pr_debug("empty ranges, 1:1 translation\n"); goto finish; } - pr_debug("FDT: walking ranges...\n"); + pr_debug("walking ranges...\n"); /* Now walk through the ranges */ rlen /= 4; @@ -138,14 +141,14 @@ static int __init fdt_translate_one(const void *blob, int parent, break; } if (offset == OF_BAD_ADDR) { - pr_debug("FDT: not found !\n"); + pr_debug("not found !\n"); return 1; } memcpy(addr, ranges + na, 4 * pna); finish: - of_dump_addr("FDT: parent translation for:", addr, pna); - pr_debug("FDT: with offset: %llx\n", offset); + of_dump_addr("parent translation for:", addr, pna); + pr_debug("with offset: %llx\n", offset); /* Translate it into parent bus space */ return pbus->translate(addr, offset, pna); @@ -170,12 +173,12 @@ static u64 __init fdt_translate_address(const void *blob, int node_offset) int na, ns, pna, pns; u64 result = OF_BAD_ADDR; - pr_debug("FDT: ** translation for device %s **\n", + pr_debug("** translation for device %s **\n", fdt_get_name(blob, node_offset, NULL)); reg = fdt_getprop(blob, node_offset, "reg", &len); if (!reg) { - pr_err("FDT: warning: device tree node '%s' has no address.\n", + pr_err("warning: device tree node '%s' has no address.\n", fdt_get_name(blob, node_offset, NULL)); goto bail; } @@ -189,15 +192,15 @@ static u64 __init fdt_translate_address(const void *blob, int node_offset) /* Cound address cells & copy address locally */ bus->count_cells(blob, parent, &na, &ns); if (!OF_CHECK_COUNTS(na, ns)) { - pr_err("FDT: Bad cell count for %s\n", + pr_err("Bad cell count for %s\n", fdt_get_name(blob, node_offset, NULL)); goto bail; } memcpy(addr, reg, na * 4); - pr_debug("FDT: bus (na=%d, ns=%d) on %s\n", + pr_debug("bus (na=%d, ns=%d) on %s\n", na, ns, fdt_get_name(blob, parent, NULL)); - of_dump_addr("OF: translating address:", addr, na); + of_dump_addr("translating address:", addr, na); /* Translate */ for (;;) { @@ -207,7 +210,7 @@ static u64 __init fdt_translate_address(const void *blob, int node_offset) /* If root, we have finished */ if (parent < 0) { - pr_debug("FDT: reached root node\n"); + pr_debug("reached root node\n"); result = of_read_number(addr, na); break; } @@ -216,12 +219,12 @@ static u64 __init fdt_translate_address(const void *blob, int node_offset) pbus = &of_busses[0]; pbus->count_cells(blob, parent, &pna, &pns); if (!OF_CHECK_COUNTS(pna, pns)) { - pr_err("FDT: Bad cell count for %s\n", + pr_err("Bad cell count for %s\n", fdt_get_name(blob, node_offset, NULL)); break; } - pr_debug("FDT: parent bus (na=%d, ns=%d) on %s\n", + pr_debug("parent bus (na=%d, ns=%d) on %s\n", pna, pns, fdt_get_name(blob, parent, NULL)); /* Apply bus translation */ @@ -234,7 +237,7 @@ static u64 __init fdt_translate_address(const void *blob, int node_offset) ns = pns; bus = pbus; - of_dump_addr("FDT: one level translation:", addr, na); + of_dump_addr("one level translation:", addr, na); } bail: return result; diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 1b58cd574316..89a71c6074fc 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -18,6 +18,8 @@ * driver. */ +#define pr_fmt(fmt) "OF: " fmt + #include #include #include diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c index 13f4fed38048..589b30c68e14 100644 --- a/drivers/of/of_pci.c +++ b/drivers/of/of_pci.c @@ -1,3 +1,5 @@ +#define pr_fmt(fmt) "OF: PCI: " fmt + #include #include #include @@ -138,7 +140,7 @@ void of_pci_check_probe_only(void) else pci_clear_flags(PCI_PROBE_ONLY); - pr_info("PCI: PROBE_ONLY %sabled\n", val ? "en" : "dis"); + pr_info("PROBE_ONLY %sabled\n", val ? "en" : "dis"); } EXPORT_SYMBOL_GPL(of_pci_check_probe_only); @@ -181,7 +183,7 @@ int of_pci_get_host_bridge_resources(struct device_node *dev, if (!bus_range) return -ENOMEM; - pr_info("PCI host bridge %s ranges:\n", dev->full_name); + pr_info("host bridge %s ranges:\n", dev->full_name); err = of_pci_parse_bus_range(dev, bus_range); if (err) { diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index 216648233874..eed788698268 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -13,6 +13,8 @@ * License or (at your optional) any later version of the license. */ +#define pr_fmt(fmt) "OF: reserved mem: " fmt + #include #include #include @@ -75,7 +77,7 @@ void __init fdt_reserved_mem_save_node(unsigned long node, const char *uname, struct reserved_mem *rmem = &reserved_mem[reserved_mem_count]; if (reserved_mem_count == ARRAY_SIZE(reserved_mem)) { - pr_err("Reserved memory: not enough space all defined regions.\n"); + pr_err("not enough space all defined regions.\n"); return; } @@ -108,8 +110,7 @@ static int __init __reserved_mem_alloc_size(unsigned long node, return -EINVAL; if (len != dt_root_size_cells * sizeof(__be32)) { - pr_err("Reserved memory: invalid size property in '%s' node.\n", - uname); + pr_err("invalid size property in '%s' node.\n", uname); return -EINVAL; } size = dt_mem_next_cell(dt_root_size_cells, &prop); @@ -119,7 +120,7 @@ static int __init __reserved_mem_alloc_size(unsigned long node, prop = of_get_flat_dt_prop(node, "alignment", &len); if (prop) { if (len != dt_root_addr_cells * sizeof(__be32)) { - pr_err("Reserved memory: invalid alignment property in '%s' node.\n", + pr_err("invalid alignment property in '%s' node.\n", uname); return -EINVAL; } @@ -141,7 +142,7 @@ static int __init __reserved_mem_alloc_size(unsigned long node, if (prop) { if (len % t_len != 0) { - pr_err("Reserved memory: invalid alloc-ranges property in '%s', skipping node.\n", + pr_err("invalid alloc-ranges property in '%s', skipping node.\n", uname); return -EINVAL; } @@ -156,7 +157,7 @@ static int __init __reserved_mem_alloc_size(unsigned long node, ret = early_init_dt_alloc_reserved_memory_arch(size, align, start, end, nomap, &base); if (ret == 0) { - pr_debug("Reserved memory: allocated memory for '%s' node: base %pa, size %ld MiB\n", + pr_debug("allocated memory for '%s' node: base %pa, size %ld MiB\n", uname, &base, (unsigned long)size / SZ_1M); break; @@ -168,13 +169,12 @@ static int __init __reserved_mem_alloc_size(unsigned long node, ret = early_init_dt_alloc_reserved_memory_arch(size, align, 0, 0, nomap, &base); if (ret == 0) - pr_debug("Reserved memory: allocated memory for '%s' node: base %pa, size %ld MiB\n", + pr_debug("allocated memory for '%s' node: base %pa, size %ld MiB\n", uname, &base, (unsigned long)size / SZ_1M); } if (base == 0) { - pr_info("Reserved memory: failed to allocate memory for node '%s'\n", - uname); + pr_info("failed to allocate memory for node '%s'\n", uname); return -ENOMEM; } @@ -203,7 +203,7 @@ static int __init __reserved_mem_init_node(struct reserved_mem *rmem) continue; if (initfn(rmem) == 0) { - pr_info("Reserved memory: initialized node %s, compatible id %s\n", + pr_info("initialized node %s, compatible id %s\n", rmem->name, compat); return 0; } @@ -245,7 +245,7 @@ static void __init __rmem_check_for_overlap(void) this_end = this->base + this->size; next_end = next->base + next->size; - pr_err("Reserved memory: OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n", + pr_err("OVERLAP DETECTED!\n%s (%pa--%pa) overlaps with %s (%pa--%pa)\n", this->name, &this->base, &this_end, next->name, &next->base, &next_end); } diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 82250815e9a5..318dbb51e7a2 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -8,7 +8,9 @@ * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. */ -#undef DEBUG + +#define pr_fmt(fmt) "OF: overlay: " fmt + #include #include #include @@ -137,8 +139,8 @@ static int of_overlay_apply_one(struct of_overlay *ov, for_each_property_of_node(overlay, prop) { ret = of_overlay_apply_single_property(ov, target, prop); if (ret) { - pr_err("%s: Failed to apply prop @%s/%s\n", - __func__, target->full_name, prop->name); + pr_err("Failed to apply prop @%s/%s\n", + target->full_name, prop->name); return ret; } } @@ -146,9 +148,8 @@ static int of_overlay_apply_one(struct of_overlay *ov, for_each_child_of_node(overlay, child) { ret = of_overlay_apply_single_device_node(ov, target, child); if (ret != 0) { - pr_err("%s: Failed to apply single node @%s/%s\n", - __func__, target->full_name, - child->name); + pr_err("Failed to apply single node @%s/%s\n", + target->full_name, child->name); of_node_put(child); return ret; } @@ -176,8 +177,7 @@ static int of_overlay_apply(struct of_overlay *ov) err = of_overlay_apply_one(ov, ovinfo->target, ovinfo->overlay); if (err != 0) { - pr_err("%s: overlay failed '%s'\n", - __func__, ovinfo->target->full_name); + pr_err("apply failed '%s'\n", ovinfo->target->full_name); return err; } } @@ -208,7 +208,7 @@ static struct device_node *find_target_node(struct device_node *info_node) if (ret == 0) return of_find_node_by_path(path); - pr_err("%s: Failed to find target for node %p (%s)\n", __func__, + pr_err("Failed to find target for node %p (%s)\n", info_node, info_node->name); return NULL; @@ -355,8 +355,6 @@ int of_overlay_create(struct device_node *tree) id = idr_alloc(&ov_idr, ov, 0, 0, GFP_KERNEL); if (id < 0) { - pr_err("%s: idr_alloc() failed for tree@%s\n", - __func__, tree->full_name); err = id; goto err_destroy_trans; } @@ -365,26 +363,21 @@ int of_overlay_create(struct device_node *tree) /* build the overlay info structures */ err = of_build_overlay_info(ov, tree); if (err) { - pr_err("%s: of_build_overlay_info() failed for tree@%s\n", - __func__, tree->full_name); + pr_err("of_build_overlay_info() failed for tree@%s\n", + tree->full_name); goto err_free_idr; } /* apply the overlay */ err = of_overlay_apply(ov); - if (err) { - pr_err("%s: of_overlay_apply() failed for tree@%s\n", - __func__, tree->full_name); + if (err) goto err_abort_trans; - } /* apply the changeset */ err = __of_changeset_apply(&ov->cset); - if (err) { - pr_err("%s: __of_changeset_apply() failed for tree@%s\n", - __func__, tree->full_name); + if (err) goto err_revert_overlay; - } + /* add to the tail of the overlay list */ list_add_tail(&ov->node, &ov_list); @@ -469,8 +462,7 @@ static int overlay_removal_is_ok(struct of_overlay *ov) list_for_each_entry(ce, &ov->cset.entries, node) { if (!overlay_is_topmost(ov, ce->np)) { - pr_err("%s: overlay #%d is not topmost\n", - __func__, ov->id); + pr_err("overlay #%d is not topmost\n", ov->id); return 0; } } @@ -496,16 +488,13 @@ int of_overlay_destroy(int id) ov = idr_find(&ov_idr, id); if (ov == NULL) { err = -ENODEV; - pr_err("%s: Could not find overlay #%d\n", - __func__, id); + pr_err("destroy: Could not find overlay #%d\n", id); goto out; } /* check whether the overlay is safe to remove */ if (!overlay_removal_is_ok(ov)) { err = -EBUSY; - pr_err("%s: removal check failed for overlay #%d\n", - __func__, id); goto out; } diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 153dbe172295..765390e3ed8d 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -11,6 +11,9 @@ * 2 of the License, or (at your option) any later version. * */ + +#define pr_fmt(fmt) "OF: " fmt + #include #include #include @@ -233,11 +236,8 @@ static struct amba_device *of_amba_device_create(struct device_node *node, return NULL; dev = amba_device_alloc(NULL, 0, 0); - if (!dev) { - pr_err("%s(): amba_device_alloc() failed for %s\n", - __func__, node->full_name); + if (!dev) goto err_clear_flag; - } /* setup generic device info */ dev->dev.of_node = of_node_get(node); @@ -260,15 +260,15 @@ static struct amba_device *of_amba_device_create(struct device_node *node, ret = of_address_to_resource(node, 0, &dev->res); if (ret) { - pr_err("%s(): of_address_to_resource() failed (%d) for %s\n", - __func__, ret, node->full_name); + pr_err("amba: of_address_to_resource() failed (%d) for %s\n", + ret, node->full_name); goto err_free; } ret = amba_device_add(dev, &iomem_resource); if (ret) { - pr_err("%s(): amba_device_add() failed (%d) for %s\n", - __func__, ret, node->full_name); + pr_err("amba_device_add() failed (%d) for %s\n", + ret, node->full_name); goto err_free; } diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c index d313d492f278..741461142984 100644 --- a/drivers/of/resolver.c +++ b/drivers/of/resolver.c @@ -9,6 +9,8 @@ * version 2 as published by the Free Software Foundation. */ +#define pr_fmt(fmt) "OF: resolver: " fmt + #include #include #include -- cgit v1.2.3 From 5de3bbc8501b637eb753e4ee18a2cccb233cfe41 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sun, 26 Jun 2016 22:11:58 +0200 Subject: of: overlay: add resolver error prints Applying overlay fails silently in case of an error. Add error prints. Most notably the lack of symbols in the live tree is not reported. Signed-off-by: Michal Suchanek Signed-off-by: Rob Herring --- drivers/of/resolver.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/of') diff --git a/drivers/of/resolver.c b/drivers/of/resolver.c index 741461142984..46325d6394cf 100644 --- a/drivers/of/resolver.c +++ b/drivers/of/resolver.c @@ -315,6 +315,11 @@ int of_resolve_phandles(struct device_node *resolve) phandle phandle, phandle_delta; int err; + if (!resolve) + pr_err("%s: null node\n", __func__); + if (resolve && !of_node_check_flag(resolve, OF_DETACHED)) + pr_err("%s: node %s not detached\n", __func__, + resolve->full_name); /* the resolve node must exist, and be detached */ if (!resolve || !of_node_check_flag(resolve, OF_DETACHED)) return -EINVAL; @@ -371,6 +376,7 @@ int of_resolve_phandles(struct device_node *resolve) /* we need to fixup, but no root symbols... */ if (!root_sym) { + pr_err("%s: no symbols in root of device tree.\n", __func__); err = -EINVAL; goto out; } -- cgit v1.2.3 From 1d1bde550ea3b08a95bd9b6b3adb6d7cd3781870 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 19 Jul 2016 00:01:12 +0200 Subject: of: fdt: mark unflattened tree as detached The tree returned from of_fdt_unflatten_tree cannot be attached to the live tree because it is not marked as detached so mark it as such. The dt resolver checks the flag and refuses to process the tree otherwise. Signed-off-by: Michal Suchanek Signed-off-by: Rob Herring --- drivers/of/fdt.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'drivers/of') diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index a0a7b76be381..ae4d07bcce24 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -472,7 +472,8 @@ static int unflatten_dt_nodes(const void *blob, static void *__unflatten_device_tree(const void *blob, struct device_node *dad, struct device_node **mynodes, - void *(*dt_alloc)(u64 size, u64 align)) + void *(*dt_alloc)(u64 size, u64 align), + bool detached) { int size; void *mem; @@ -516,6 +517,11 @@ static void *__unflatten_device_tree(const void *blob, pr_warning("End of tree marker overwritten: %08x\n", be32_to_cpup(mem + size)); + if (detached) { + of_node_set_flag(*mynodes, OF_DETACHED); + pr_debug("unflattened tree is detached\n"); + } + pr_debug(" <- unflatten_device_tree()\n"); return mem; } @@ -548,7 +554,8 @@ void *of_fdt_unflatten_tree(const unsigned long *blob, void *mem; mutex_lock(&of_fdt_unflatten_mutex); - mem = __unflatten_device_tree(blob, dad, mynodes, &kernel_tree_alloc); + mem = __unflatten_device_tree(blob, dad, mynodes, &kernel_tree_alloc, + true); mutex_unlock(&of_fdt_unflatten_mutex); return mem; @@ -1224,7 +1231,7 @@ bool __init early_init_dt_scan(void *params) void __init unflatten_device_tree(void) { __unflatten_device_tree(initial_boot_params, NULL, &of_root, - early_init_dt_alloc_memory_arch); + early_init_dt_alloc_memory_arch, false); /* Get pointer to "/chosen" and "/aliases" nodes for use everywhere */ of_alias_scan(early_init_dt_alloc_memory_arch); -- cgit v1.2.3