Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'devicetree-fixes-for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull DeviceTree fixes from Rob Herring:

- a couple of DT node ref counting fixes

- fix __unflatten_device_tree for PPC PCI hotplug case

- rework marking irq controllers as OF_POPULATED in cases where real
driver is used.

- disable of_platform_default_populate_init on PPC. The change in
initcall order causes problems which need to be sorted out later.

* tag 'devicetree-fixes-for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
of: fix reference counting in of_graph_get_endpoint_by_regs
of/platform: disable the of_platform_default_populate_init() for all the ppc boards
ARM: imx6: mark GPC node as not populated after irq init to probe pm domain driver
of/irq: Mark interrupt controllers as populated before initialisation
drivers/of: Validate device node in __unflatten_device_tree()
of: Delete an unnecessary check before the function call "of_node_put"

+15 -14
+6
arch/arm/mach-imx/gpc.c
··· 271 271 for (i = 0; i < IMR_NUM; i++) 272 272 writel_relaxed(~0, gpc_base + GPC_IMR1 + i * 4); 273 273 274 + /* 275 + * Clear the OF_POPULATED flag set in of_irq_init so that 276 + * later the GPC power domain driver will not be skipped. 277 + */ 278 + of_node_clear_flag(node, OF_POPULATED); 279 + 274 280 return 0; 275 281 } 276 282 IRQCHIP_DECLARE(imx_gpc, "fsl,imx6q-gpc", imx_gpc_init);
+3 -11
drivers/of/base.c
··· 1631 1631 */ 1632 1632 1633 1633 err: 1634 - if (it.node) 1635 - of_node_put(it.node); 1634 + of_node_put(it.node); 1636 1635 return rc; 1637 1636 } 1638 1637 ··· 2342 2343 const struct device_node *parent, int port_reg, int reg) 2343 2344 { 2344 2345 struct of_endpoint endpoint; 2345 - struct device_node *node, *prev_node = NULL; 2346 + struct device_node *node = NULL; 2346 2347 2347 - while (1) { 2348 - node = of_graph_get_next_endpoint(parent, prev_node); 2349 - of_node_put(prev_node); 2350 - if (!node) 2351 - break; 2352 - 2348 + for_each_endpoint_of_node(parent, node) { 2353 2349 of_graph_parse_endpoint(node, &endpoint); 2354 2350 if (((port_reg == -1) || (endpoint.port == port_reg)) && 2355 2351 ((reg == -1) || (endpoint.id == reg))) 2356 2352 return node; 2357 - 2358 - prev_node = node; 2359 2353 } 2360 2354 2361 2355 return NULL;
+1 -1
drivers/of/fdt.c
··· 517 517 pr_warning("End of tree marker overwritten: %08x\n", 518 518 be32_to_cpup(mem + size)); 519 519 520 - if (detached) { 520 + if (detached && mynodes) { 521 521 of_node_set_flag(*mynodes, OF_DETACHED); 522 522 pr_debug("unflattened tree is detached\n"); 523 523 }
+3 -2
drivers/of/irq.c
··· 544 544 545 545 list_del(&desc->list); 546 546 547 + of_node_set_flag(desc->dev, OF_POPULATED); 548 + 547 549 pr_debug("of_irq_init: init %s (%p), parent %p\n", 548 550 desc->dev->full_name, 549 551 desc->dev, desc->interrupt_parent); 550 552 ret = desc->irq_init_cb(desc->dev, 551 553 desc->interrupt_parent); 552 554 if (ret) { 555 + of_node_clear_flag(desc->dev, OF_POPULATED); 553 556 kfree(desc); 554 557 continue; 555 558 } ··· 562 559 * its children can get processed in a subsequent pass. 563 560 */ 564 561 list_add_tail(&desc->list, &intc_parent_list); 565 - 566 - of_node_set_flag(desc->dev, OF_POPULATED); 567 562 } 568 563 569 564 /* Get the next pending parent that might have children */
+2
drivers/of/platform.c
··· 497 497 } 498 498 EXPORT_SYMBOL_GPL(of_platform_default_populate); 499 499 500 + #ifndef CONFIG_PPC 500 501 static int __init of_platform_default_populate_init(void) 501 502 { 502 503 struct device_node *node; ··· 522 521 return 0; 523 522 } 524 523 arch_initcall_sync(of_platform_default_populate_init); 524 + #endif 525 525 526 526 static int of_platform_device_destroy(struct device *dev, void *data) 527 527 {