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-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux

Pull devicetree fixes from Rob Herring:

- Fix DT node refcount when creating platform devices

- Fix deadlock in changeset code due to printing with devtree_lock held

- Fix unittest EXPECT strings for parse_phandle_with_args_map() test

- Fix IMA kexec memblock freeing

* tag 'devicetree-fixes-for-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
of/platform: increase refcount of fwnode
of: dynamic: Refactor action prints to not use "%pOF" inside devtree_lock
of: unittest: Fix EXPECT for parse_phandle_with_args_map() test
mm,ima,kexec,of: use memblock_free_late from ima_free_kexec_buffer

+15 -27
+9 -22
drivers/of/dynamic.c
··· 63 63 } 64 64 EXPORT_SYMBOL_GPL(of_reconfig_notifier_unregister); 65 65 66 - #ifdef DEBUG 67 - const char *action_names[] = { 66 + static const char *action_names[] = { 67 + [0] = "INVALID", 68 68 [OF_RECONFIG_ATTACH_NODE] = "ATTACH_NODE", 69 69 [OF_RECONFIG_DETACH_NODE] = "DETACH_NODE", 70 70 [OF_RECONFIG_ADD_PROPERTY] = "ADD_PROPERTY", 71 71 [OF_RECONFIG_REMOVE_PROPERTY] = "REMOVE_PROPERTY", 72 72 [OF_RECONFIG_UPDATE_PROPERTY] = "UPDATE_PROPERTY", 73 73 }; 74 - #endif 75 74 76 75 int of_reconfig_notify(unsigned long action, struct of_reconfig_data *p) 77 76 { ··· 619 620 } 620 621 621 622 ret = __of_add_property(ce->np, ce->prop); 622 - if (ret) { 623 - pr_err("changeset: add_property failed @%pOF/%s\n", 624 - ce->np, 625 - ce->prop->name); 626 - break; 627 - } 628 623 break; 629 624 case OF_RECONFIG_REMOVE_PROPERTY: 630 625 ret = __of_remove_property(ce->np, ce->prop); 631 - if (ret) { 632 - pr_err("changeset: remove_property failed @%pOF/%s\n", 633 - ce->np, 634 - ce->prop->name); 635 - break; 636 - } 637 626 break; 638 627 639 628 case OF_RECONFIG_UPDATE_PROPERTY: ··· 635 648 } 636 649 637 650 ret = __of_update_property(ce->np, ce->prop, &old_prop); 638 - if (ret) { 639 - pr_err("changeset: update_property failed @%pOF/%s\n", 640 - ce->np, 641 - ce->prop->name); 642 - break; 643 - } 644 651 break; 645 652 default: 646 653 ret = -EINVAL; 647 654 } 648 655 raw_spin_unlock_irqrestore(&devtree_lock, flags); 649 656 650 - if (ret) 657 + if (ret) { 658 + pr_err("changeset: apply failed: %-15s %pOF:%s\n", 659 + action_names[ce->action], ce->np, ce->prop->name); 651 660 return ret; 661 + } 652 662 653 663 switch (ce->action) { 654 664 case OF_RECONFIG_ATTACH_NODE: ··· 930 946 ce = kzalloc(sizeof(*ce), GFP_KERNEL); 931 947 if (!ce) 932 948 return -ENOMEM; 949 + 950 + if (WARN_ON(action >= ARRAY_SIZE(action_names))) 951 + return -EINVAL; 933 952 934 953 /* get a reference to the node */ 935 954 ce->action = action;
+2 -1
drivers/of/kexec.c
··· 184 184 if (ret) 185 185 return ret; 186 186 187 - return memblock_phys_free(addr, size); 187 + memblock_free_late(addr, size); 188 + return 0; 188 189 } 189 190 #endif 190 191
+2 -2
drivers/of/platform.c
··· 141 141 } 142 142 143 143 /* setup generic device info */ 144 - device_set_node(&dev->dev, of_fwnode_handle(np)); 144 + device_set_node(&dev->dev, of_fwnode_handle(of_node_get(np))); 145 145 dev->dev.parent = parent ? : &platform_bus; 146 146 147 147 if (bus_id) ··· 239 239 dev->dev.dma_mask = &dev->dev.coherent_dma_mask; 240 240 241 241 /* setup generic device info */ 242 - device_set_node(&dev->dev, of_fwnode_handle(node)); 242 + device_set_node(&dev->dev, of_fwnode_handle(of_node_get(node))); 243 243 dev->dev.parent = parent ? : &platform_bus; 244 244 dev->dev.platform_data = platform_data; 245 245 if (bus_id)
+2 -2
drivers/of/unittest.c
··· 664 664 memset(&args, 0, sizeof(args)); 665 665 666 666 EXPECT_BEGIN(KERN_INFO, 667 - "OF: /testcase-data/phandle-tests/consumer-b: could not find phandle"); 667 + "OF: /testcase-data/phandle-tests/consumer-b: could not find phandle 12345678"); 668 668 669 669 rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-phandle", 670 670 "phandle", 0, &args); 671 671 EXPECT_END(KERN_INFO, 672 - "OF: /testcase-data/phandle-tests/consumer-b: could not find phandle"); 672 + "OF: /testcase-data/phandle-tests/consumer-b: could not find phandle 12345678"); 673 673 674 674 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); 675 675